diff --git a/api/js/etemplate/expose.js b/api/js/etemplate/expose.js index 32abd7c5fa..818c7379ac 100644 --- a/api/js/etemplate/expose.js +++ b/api/js/etemplate/expose.js @@ -52,6 +52,9 @@ function expose (widget) // For filtering to only show things we can handle var mime_regex = new RegExp(/(video\/(mp4|ogg|webm))|(image\/:*(?!tif|x-xcf|pdf))/); + // open office document mime type currently supported by webodf editor + var mime_odf_regex = new RegExp(/application\/vnd\.oasis\.opendocument\.text/); + // IE only supports video/mp4 mime type if (navigator.userAgent.match(/(MSIE|Trident)/)) mime_regex.compile(/(video\/mp4)|(image\/:*(?!tif|x-xcf|pdf))/); @@ -392,7 +395,7 @@ function expose (widget) var self=this; // If the media type is not supported do not bind the click handler - if (!_value || typeof _value.mime != 'string' || !_value.mime.match(mime_regex,'ig') || typeof _value.download_url == 'undefined') + if (!_value || typeof _value.mime != 'string' || (!_value.mime.match(mime_regex,'ig') && !_value.mime.match(mime_odf_regex,'ig')) || typeof _value.download_url == 'undefined') { return; } @@ -400,7 +403,17 @@ function expose (widget) { jQuery(this.node).on('click', function(event){ // Do not trigger expose view if one of the operator keys are held - if (!event.altKey && !event.ctrlKey && !event.shiftKey && !event.metaKey) self._init_blueimp_gallery(event, _value); + if (!event.altKey && !event.ctrlKey && !event.shiftKey && !event.metaKey) + { + if (_value.mime.match(mime_regex,'ig')) + { + self._init_blueimp_gallery(event, _value); + } + else if(_value.mime.match(mime_odf_regex,'ig')) + { + self._init_odf_editor (event, _value); + } + } event.stopImmediatePropagation(); }).addClass('et2_clickable'); } @@ -601,7 +614,21 @@ function expose (widget) nm.applyFilters({col_filter: {mime: ''}}); } }, - expose_onclosed: function (event){} + expose_onclosed: function (event){}, + /** + * Initialise odf editor handler for expose mime type handling + * + * @param {type} _event + * @param {type} _value + * @returns {undefined} + */ + _init_odf_editor: function (_event, _value) + { + egw.open_link(egw.link('/index.php', { + menuaction: 'filemanager.filemanager_ui.editor', + path: _value.download_url + }), '', '800x600'); + } }); } diff --git a/api/js/webodf/AGPL-3.0.txt b/api/js/webodf/AGPL-3.0.txt new file mode 100644 index 0000000000..dba13ed2dd --- /dev/null +++ b/api/js/webodf/AGPL-3.0.txt @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 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 Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are 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. + + 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. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + 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 Affero 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. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + 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 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 work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero 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 Affero 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 Affero 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 Affero 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 Affero 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + 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 AGPL, see +. diff --git a/api/js/webodf/webodf-debug.js b/api/js/webodf/webodf-debug.js new file mode 100644 index 0000000000..1cf7ebfd75 --- /dev/null +++ b/api/js/webodf/webodf-debug.js @@ -0,0 +1,21497 @@ +/* + + This is a generated file. DO NOT EDIT. + + Copyright (C) 2010-2015 KO GmbH + + @licstart + The code in this file is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License (GNU AGPL) + as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + The code in this file 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with WebODF. If not, see . + + As additional permission under GNU AGPL version 3 section 7, you + may distribute UNMODIFIED VERSIONS OF THIS file without the copy of the GNU AGPL normally + required by section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + As a special exception to the AGPL, any HTML file which merely makes function + calls to this code, and for that purpose includes it in unmodified form by reference or in-line shall be + deemed a separate work for copyright law purposes. In addition, the copyright + holders of this code give you permission to combine this code with free + software libraries that are released under the GNU LGPL. You may copy and + distribute such a system following the terms of the GNU AGPL for this code + and the LGPL for the libraries. If you modify this code, you may extend this + exception to your version of the code, but you are not obligated to do so. + If you do not wish to do so, delete this exception statement from your + version. + + This license applies to this entire compilation. + @licend + + @source: http://www.webodf.org/ + @source: https://github.com/kogmbh/WebODF/ +*/ +var webodf_version = "0.5.9"; +function Runtime() { +} +Runtime.prototype.getVariable = function(name) { +}; +Runtime.prototype.toJson = function(anything) { +}; +Runtime.prototype.fromJson = function(jsonstr) { +}; +Runtime.prototype.byteArrayFromString = function(string, encoding) { +}; +Runtime.prototype.byteArrayToString = function(bytearray, encoding) { +}; +Runtime.prototype.read = function(path, offset, length, callback) { +}; +Runtime.prototype.readFile = function(path, encoding, callback) { +}; +Runtime.prototype.readFileSync = function(path, encoding) { +}; +Runtime.prototype.loadXML = function(path, callback) { +}; +Runtime.prototype.writeFile = function(path, data, callback) { +}; +Runtime.prototype.deleteFile = function(path, callback) { +}; +Runtime.prototype.log = function(msgOrCategory, msg) { +}; +Runtime.prototype.setTimeout = function(callback, milliseconds) { +}; +Runtime.prototype.clearTimeout = function(timeoutID) { +}; +Runtime.prototype.libraryPaths = function() { +}; +Runtime.prototype.currentDirectory = function() { +}; +Runtime.prototype.setCurrentDirectory = function(dir) { +}; +Runtime.prototype.type = function() { +}; +Runtime.prototype.getDOMImplementation = function() { +}; +Runtime.prototype.parseXML = function(xml) { +}; +Runtime.prototype.exit = function(exitCode) { +}; +Runtime.prototype.getWindow = function() { +}; +Runtime.prototype.requestAnimationFrame = function(callback) { +}; +Runtime.prototype.cancelAnimationFrame = function(requestId) { +}; +Runtime.prototype.assert = function(condition, message) { +}; +var IS_COMPILED_CODE = true; +Runtime.byteArrayToString = function(bytearray, encoding) { + function byteArrayToString(bytearray) { + var s = "", i, l = bytearray.length; + for (i = 0;i < l;i += 1) { + s += String.fromCharCode(bytearray[i] & 255); + } + return s; + } + function utf8ByteArrayToString(bytearray) { + var s = "", startPos, i, l = bytearray.length, chars = [], c0, c1, c2, c3, codepoint; + if (l >= 3 && bytearray[0] === 239 && bytearray[1] === 187 && bytearray[2] === 191) { + startPos = 3; + } else { + startPos = 0; + } + for (i = startPos;i < l;i += 1) { + c0 = bytearray[i]; + if (c0 < 128) { + chars.push(c0); + } else { + i += 1; + c1 = bytearray[i]; + if (c0 >= 194 && c0 < 224) { + chars.push((c0 & 31) << 6 | c1 & 63); + } else { + i += 1; + c2 = bytearray[i]; + if (c0 >= 224 && c0 < 240) { + chars.push((c0 & 15) << 12 | (c1 & 63) << 6 | c2 & 63); + } else { + i += 1; + c3 = bytearray[i]; + if (c0 >= 240 && c0 < 245) { + codepoint = (c0 & 7) << 18 | (c1 & 63) << 12 | (c2 & 63) << 6 | c3 & 63; + codepoint -= 65536; + chars.push((codepoint >> 10) + 55296, (codepoint & 1023) + 56320); + } + } + } + } + if (chars.length >= 1E3) { + s += String.fromCharCode.apply(null, chars); + chars.length = 0; + } + } + return s + String.fromCharCode.apply(null, chars); + } + var result; + if (encoding === "utf8") { + result = utf8ByteArrayToString(bytearray); + } else { + if (encoding !== "binary") { + this.log("Unsupported encoding: " + encoding); + } + result = byteArrayToString(bytearray); + } + return result; +}; +Runtime.getVariable = function(name) { + try { + return eval(name); + } catch (e) { + return undefined; + } +}; +Runtime.toJson = function(anything) { + return JSON.stringify(anything); +}; +Runtime.fromJson = function(jsonstr) { + return JSON.parse(jsonstr); +}; +Runtime.getFunctionName = function getFunctionName(f) { + var m; + if (f.name === undefined) { + m = (new RegExp("function\\s+(\\w+)")).exec(f); + return m && m[1]; + } + return f.name; +}; +Runtime.assert = function(condition, message) { + if (!condition) { + this.log("alert", "ASSERTION FAILED:\n" + message); + throw new Error(message); + } +}; +function BrowserRuntime() { + var self = this; + function getUtf8LengthForString(string) { + var l = string.length, i, n, j = 0; + for (i = 0;i < l;i += 1) { + n = string.charCodeAt(i); + j += 1 + (n > 128) + (n > 2048); + if (n > 55040 && n < 57344) { + j += 1; + i += 1; + } + } + return j; + } + function utf8ByteArrayFromString(string, length, addBOM) { + var l = string.length, bytearray, i, n, j; + bytearray = new Uint8Array(new ArrayBuffer(length)); + if (addBOM) { + bytearray[0] = 239; + bytearray[1] = 187; + bytearray[2] = 191; + j = 3; + } else { + j = 0; + } + for (i = 0;i < l;i += 1) { + n = string.charCodeAt(i); + if (n < 128) { + bytearray[j] = n; + j += 1; + } else { + if (n < 2048) { + bytearray[j] = 192 | n >>> 6; + bytearray[j + 1] = 128 | n & 63; + j += 2; + } else { + if (n <= 55040 || n >= 57344) { + bytearray[j] = 224 | n >>> 12 & 15; + bytearray[j + 1] = 128 | n >>> 6 & 63; + bytearray[j + 2] = 128 | n & 63; + j += 3; + } else { + i += 1; + n = (n - 55296 << 10 | string.charCodeAt(i) - 56320) + 65536; + bytearray[j] = 240 | n >>> 18 & 7; + bytearray[j + 1] = 128 | n >>> 12 & 63; + bytearray[j + 2] = 128 | n >>> 6 & 63; + bytearray[j + 3] = 128 | n & 63; + j += 4; + } + } + } + } + return bytearray; + } + function utf8ByteArrayFromXHRString(string, wishLength) { + var addBOM = false, length = getUtf8LengthForString(string); + if (typeof wishLength === "number") { + if (wishLength !== length && wishLength !== length + 3) { + return undefined; + } + addBOM = length + 3 === wishLength; + length = wishLength; + } + return utf8ByteArrayFromString(string, length, addBOM); + } + function byteArrayFromString(string) { + var l = string.length, a = new Uint8Array(new ArrayBuffer(l)), i; + for (i = 0;i < l;i += 1) { + a[i] = string.charCodeAt(i) & 255; + } + return a; + } + this.byteArrayFromString = function(string, encoding) { + var result; + if (encoding === "utf8") { + result = utf8ByteArrayFromString(string, getUtf8LengthForString(string), false); + } else { + if (encoding !== "binary") { + self.log("unknown encoding: " + encoding); + } + result = byteArrayFromString(string); + } + return result; + }; + this.byteArrayToString = Runtime.byteArrayToString; + this.getVariable = Runtime.getVariable; + this.fromJson = Runtime.fromJson; + this.toJson = Runtime.toJson; + function log(msgOrCategory, msg) { + var category; + if (msg !== undefined) { + category = msgOrCategory; + } else { + msg = msgOrCategory; + } + console.log(msg); + if (self.enableAlerts && category === "alert") { + alert(msg); + } + } + function arrayToUint8Array(buffer) { + var l = buffer.length, i, a = new Uint8Array(new ArrayBuffer(l)); + for (i = 0;i < l;i += 1) { + a[i] = buffer[i]; + } + return a; + } + function stringToBinaryWorkaround(xhr) { + var cl, data; + cl = xhr.getResponseHeader("Content-Length"); + if (cl) { + cl = parseInt(cl, 10); + } + if (cl && cl !== xhr.responseText.length) { + data = utf8ByteArrayFromXHRString(xhr.responseText, cl); + } + if (data === undefined) { + data = byteArrayFromString(xhr.responseText); + } + return data; + } + function handleXHRResult(path, encoding, xhr) { + var r, d, a, data; + if (xhr.status === 0 && !xhr.responseText) { + r = {err:"File " + path + " is empty.", data:null}; + } else { + if (xhr.status === 200 || xhr.status === 0) { + if (xhr.response && typeof xhr.response !== "string") { + if (encoding === "binary") { + d = xhr.response; + data = new Uint8Array(d); + } else { + data = String(xhr.response); + } + } else { + if (encoding === "binary") { + if (xhr.responseBody !== null && String(typeof VBArray) !== "undefined") { + a = (new VBArray(xhr.responseBody)).toArray(); + data = arrayToUint8Array(a); + } else { + data = stringToBinaryWorkaround(xhr); + } + } else { + data = xhr.responseText; + } + } + r = {err:null, data:data}; + } else { + r = {err:xhr.responseText || xhr.statusText, data:null}; + } + } + return r; + } + function createXHR(path, encoding, async) { + var xhr = new XMLHttpRequest; + xhr.open("GET", path, async); + if (xhr.overrideMimeType) { + if (encoding !== "binary") { + xhr.overrideMimeType("text/plain; charset=" + encoding); + } else { + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + } + } + return xhr; + } + function readFile(path, encoding, callback) { + var xhr = createXHR(path, encoding, true); + function handleResult() { + var r; + if (xhr.readyState === 4) { + r = handleXHRResult(path, encoding, xhr); + callback(r.err, r.data); + } + } + xhr.onreadystatechange = handleResult; + try { + xhr.send(null); + } catch (e) { + callback(e.message, null); + } + } + function read(path, offset, length, callback) { + readFile(path, "binary", function(err, result) { + var r = null; + if (result) { + if (typeof result === "string") { + throw "This should not happen."; + } + r = result.subarray(offset, offset + length); + } + callback(err, r); + }); + } + function readFileSync(path, encoding) { + var xhr = createXHR(path, encoding, false), r; + try { + xhr.send(null); + r = handleXHRResult(path, encoding, xhr); + if (r.err) { + throw r.err; + } + if (r.data === null) { + throw "No data read from " + path + "."; + } + } catch (e) { + throw e; + } + return r.data; + } + function writeFile(path, data, callback) { + var xhr = new XMLHttpRequest, d; + function handleResult() { + if (xhr.readyState === 4) { + if (xhr.status === 0 && !xhr.responseText) { + callback("File " + path + " is empty."); + } else { + if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 0) { + callback(null); + } else { + callback("Status " + String(xhr.status) + ": " + xhr.responseText || xhr.statusText); + } + } + } + } + xhr.open("PUT", path, true); + xhr.onreadystatechange = handleResult; + if (data.buffer && !xhr.sendAsBinary) { + d = data.buffer; + } else { + d = self.byteArrayToString(data, "binary"); + } + try { + if (xhr.sendAsBinary) { + xhr.sendAsBinary(d); + } else { + xhr.send(d); + } + } catch (e) { + self.log("HUH? " + e + " " + data); + callback(e.message); + } + } + function deleteFile(path, callback) { + var xhr = new XMLHttpRequest; + xhr.open("DELETE", path, true); + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + if (xhr.status < 200 && xhr.status >= 300) { + callback(xhr.responseText); + } else { + callback(null); + } + } + }; + xhr.send(null); + } + function loadXML(path, callback) { + var xhr = new XMLHttpRequest; + function handleResult() { + if (xhr.readyState === 4) { + if (xhr.status === 0 && !xhr.responseText) { + callback("File " + path + " is empty.", null); + } else { + if (xhr.status === 200 || xhr.status === 0) { + callback(null, xhr.responseXML); + } else { + callback(xhr.responseText, null); + } + } + } + } + xhr.open("GET", path, true); + if (xhr.overrideMimeType) { + xhr.overrideMimeType("text/xml"); + } + xhr.onreadystatechange = handleResult; + try { + xhr.send(null); + } catch (e) { + callback(e.message, null); + } + } + this.readFile = readFile; + this.read = read; + this.readFileSync = readFileSync; + this.writeFile = writeFile; + this.deleteFile = deleteFile; + this.loadXML = loadXML; + this.log = log; + this.enableAlerts = true; + this.assert = Runtime.assert; + this.setTimeout = function(f, msec) { + return setTimeout(function() { + f(); + }, msec); + }; + this.clearTimeout = function(timeoutID) { + clearTimeout(timeoutID); + }; + this.libraryPaths = function() { + return ["lib"]; + }; + this.setCurrentDirectory = function() { + }; + this.currentDirectory = function() { + return ""; + }; + this.type = function() { + return "BrowserRuntime"; + }; + this.getDOMImplementation = function() { + return window.document.implementation; + }; + this.parseXML = function(xml) { + var parser = new DOMParser; + return parser.parseFromString(xml, "text/xml"); + }; + this.exit = function(exitCode) { + log("Calling exit with code " + String(exitCode) + ", but exit() is not implemented."); + }; + this.getWindow = function() { + return window; + }; + this.requestAnimationFrame = function(callback) { + var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame, requestId = 0; + if (rAF) { + rAF.bind(window); + requestId = rAF(callback); + } else { + return setTimeout(callback, 15); + } + return requestId; + }; + this.cancelAnimationFrame = function(requestId) { + var cAF = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame; + if (cAF) { + cAF.bind(window); + cAF(requestId); + } else { + clearTimeout(requestId); + } + }; +} +function NodeJSRuntime() { + var self = this, fs = require("fs"), pathmod = require("path"), currentDirectory = "", parser, domImplementation; + function bufferToUint8Array(buffer) { + var l = buffer.length, i, a = new Uint8Array(new ArrayBuffer(l)); + for (i = 0;i < l;i += 1) { + a[i] = buffer[i]; + } + return a; + } + this.byteArrayFromString = function(string, encoding) { + var buf = new Buffer(string, encoding), i, l = buf.length, a = new Uint8Array(new ArrayBuffer(l)); + for (i = 0;i < l;i += 1) { + a[i] = buf[i]; + } + return a; + }; + this.byteArrayToString = Runtime.byteArrayToString; + this.getVariable = Runtime.getVariable; + this.fromJson = Runtime.fromJson; + this.toJson = Runtime.toJson; + function readFile(path, encoding, callback) { + function convert(err, data) { + if (err) { + return callback(err, null); + } + if (!data) { + return callback("No data for " + path + ".", null); + } + var d; + if (typeof data === "string") { + d = data; + return callback(err, d); + } + d = data; + callback(err, bufferToUint8Array(d)); + } + path = pathmod.resolve(currentDirectory, path); + if (encoding !== "binary") { + fs.readFile(path, encoding, convert); + } else { + fs.readFile(path, null, convert); + } + } + this.readFile = readFile; + function loadXML(path, callback) { + readFile(path, "utf-8", function(err, data) { + if (err) { + return callback(err, null); + } + if (!data) { + return callback("No data for " + path + ".", null); + } + var d = data; + callback(null, self.parseXML(d)); + }); + } + this.loadXML = loadXML; + this.writeFile = function(path, data, callback) { + var buf = new Buffer(data); + path = pathmod.resolve(currentDirectory, path); + fs.writeFile(path, buf, "binary", function(err) { + callback(err || null); + }); + }; + this.deleteFile = function(path, callback) { + path = pathmod.resolve(currentDirectory, path); + fs.unlink(path, callback); + }; + this.read = function(path, offset, length, callback) { + path = pathmod.resolve(currentDirectory, path); + fs.open(path, "r+", 666, function(err, fd) { + if (err) { + callback(err, null); + return; + } + var buffer = new Buffer(length); + fs.read(fd, buffer, 0, length, offset, function(err) { + fs.close(fd); + callback(err, bufferToUint8Array(buffer)); + }); + }); + }; + this.readFileSync = function(path, encoding) { + var s, enc = encoding === "binary" ? null : encoding, r = fs.readFileSync(path, enc); + if (r === null) { + throw "File " + path + " could not be read."; + } + if (encoding === "binary") { + s = r; + s = bufferToUint8Array(s); + } else { + s = r; + } + return s; + }; + function log(msgOrCategory, msg) { + var category; + if (msg !== undefined) { + category = msgOrCategory; + } else { + msg = msgOrCategory; + } + if (category === "alert") { + process.stderr.write("\n!!!!! ALERT !!!!!" + "\n"); + } + process.stderr.write(msg + "\n"); + if (category === "alert") { + process.stderr.write("!!!!! ALERT !!!!!" + "\n"); + } + } + this.log = log; + this.assert = Runtime.assert; + this.setTimeout = function(f, msec) { + return setTimeout(function() { + f(); + }, msec); + }; + this.clearTimeout = function(timeoutID) { + clearTimeout(timeoutID); + }; + this.libraryPaths = function() { + return [__dirname]; + }; + this.setCurrentDirectory = function(dir) { + currentDirectory = dir; + }; + this.currentDirectory = function() { + return currentDirectory; + }; + this.type = function() { + return "NodeJSRuntime"; + }; + this.getDOMImplementation = function() { + return domImplementation; + }; + this.parseXML = function(xml) { + return parser.parseFromString(xml, "text/xml"); + }; + this.exit = process.exit; + this.getWindow = function() { + return null; + }; + this.requestAnimationFrame = function(callback) { + return setTimeout(callback, 15); + }; + this.cancelAnimationFrame = function(requestId) { + clearTimeout(requestId); + }; + function init() { + var DOMParser = require("xmldom").DOMParser; + parser = new DOMParser; + domImplementation = self.parseXML("").implementation; + } + init(); +} +function RhinoRuntime() { + var self = this, Packages = {}, dom = Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(), builder, entityresolver, currentDirectory = ""; + dom.setValidating(false); + dom.setNamespaceAware(true); + dom.setExpandEntityReferences(false); + dom.setSchema(null); + entityresolver = Packages.org.xml.sax.EntityResolver({resolveEntity:function(publicId, systemId) { + var file; + function open(path) { + var reader = new Packages.java.io.FileReader(path), source = new Packages.org.xml.sax.InputSource(reader); + return source; + } + file = systemId; + return open(file); + }}); + builder = dom.newDocumentBuilder(); + builder.setEntityResolver(entityresolver); + this.byteArrayFromString = function(string, encoding) { + var i, l = string.length, a = new Uint8Array(new ArrayBuffer(l)); + for (i = 0;i < l;i += 1) { + a[i] = string.charCodeAt(i) & 255; + } + return a; + }; + this.byteArrayToString = Runtime.byteArrayToString; + this.getVariable = Runtime.getVariable; + this.fromJson = Runtime.fromJson; + this.toJson = Runtime.toJson; + function loadXML(path, callback) { + var file = new Packages.java.io.File(path), xmlDocument = null; + try { + xmlDocument = builder.parse(file); + } catch (err) { + print(err); + return callback(err, null); + } + callback(null, xmlDocument); + } + function runtimeReadFile(path, encoding, callback) { + if (currentDirectory) { + path = currentDirectory + "/" + path; + } + var file = new Packages.java.io.File(path), data, rhinoencoding = encoding === "binary" ? "latin1" : encoding; + if (!file.isFile()) { + callback(path + " is not a file.", null); + } else { + data = readFile(path, rhinoencoding); + if (data && encoding === "binary") { + data = self.byteArrayFromString(data, "binary"); + } + callback(null, data); + } + } + function runtimeReadFileSync(path, encoding) { + var file = new Packages.java.io.File(path); + if (!file.isFile()) { + return null; + } + if (encoding === "binary") { + encoding = "latin1"; + } + return readFile(path, encoding); + } + this.loadXML = loadXML; + this.readFile = runtimeReadFile; + this.writeFile = function(path, data, callback) { + if (currentDirectory) { + path = currentDirectory + "/" + path; + } + var out = new Packages.java.io.FileOutputStream(path), i, l = data.length; + for (i = 0;i < l;i += 1) { + out.write(data[i]); + } + out.close(); + callback(null); + }; + this.deleteFile = function(path, callback) { + if (currentDirectory) { + path = currentDirectory + "/" + path; + } + var file = new Packages.java.io.File(path), otherPath = path + Math.random(), other = new Packages.java.io.File(otherPath); + if (file.rename(other)) { + other.deleteOnExit(); + callback(null); + } else { + callback("Could not delete " + path); + } + }; + this.read = function(path, offset, length, callback) { + if (currentDirectory) { + path = currentDirectory + "/" + path; + } + var data = runtimeReadFileSync(path, "binary"); + if (data) { + callback(null, this.byteArrayFromString(data.substring(offset, offset + length), "binary")); + } else { + callback("Cannot read " + path, null); + } + }; + this.readFileSync = function(path, encoding) { + if (!encoding) { + return ""; + } + var s = readFile(path, encoding); + if (s === null) { + throw "File could not be read."; + } + return s; + }; + function log(msgOrCategory, msg) { + var category; + if (msg !== undefined) { + category = msgOrCategory; + } else { + msg = msgOrCategory; + } + if (category === "alert") { + print("\n!!!!! ALERT !!!!!"); + } + print(msg); + if (category === "alert") { + print("!!!!! ALERT !!!!!"); + } + } + this.log = log; + this.assert = Runtime.assert; + this.setTimeout = function(f) { + f(); + return 0; + }; + this.clearTimeout = function() { + }; + this.libraryPaths = function() { + return ["lib"]; + }; + this.setCurrentDirectory = function(dir) { + currentDirectory = dir; + }; + this.currentDirectory = function() { + return currentDirectory; + }; + this.type = function() { + return "RhinoRuntime"; + }; + this.getDOMImplementation = function() { + return builder.getDOMImplementation(); + }; + this.parseXML = function(xml) { + var reader = new Packages.java.io.StringReader(xml), source = new Packages.org.xml.sax.InputSource(reader); + return builder.parse(source); + }; + this.exit = quit; + this.getWindow = function() { + return null; + }; + this.requestAnimationFrame = function(callback) { + callback(); + return 0; + }; + this.cancelAnimationFrame = function() { + }; +} +Runtime.create = function create() { + var result; + if (String(typeof window) !== "undefined") { + result = new BrowserRuntime; + } else { + if (String(typeof require) !== "undefined") { + result = new NodeJSRuntime; + } else { + result = new RhinoRuntime; + } + } + return result; +}; +var runtime = Runtime.create(); +var core = {}; +var gui = {}; +var xmldom = {}; +var odf = {}; +var ops = {}; +var webodf = {}; +(function() { + function getWebODFVersion() { + var version = String(typeof webodf_version) !== "undefined" ? webodf_version : "From Source"; + return version; + } + webodf.Version = getWebODFVersion(); +})(); +(function() { + function loadDependenciesFromManifest(dir, dependencies, expectFail) { + var path = dir + "/manifest.json", content, list, manifest, m; + runtime.log("Loading manifest: " + path); + try { + content = runtime.readFileSync(path, "utf-8"); + } catch (e) { + if (expectFail) { + runtime.log("No loadable manifest found."); + } else { + console.log(String(e)); + throw e; + } + return; + } + list = JSON.parse(content); + manifest = list; + for (m in manifest) { + if (manifest.hasOwnProperty(m)) { + dependencies[m] = {dir:dir, deps:manifest[m]}; + } + } + } + function loadDependenciesFromManifests() { + var dependencies = [], paths = runtime.libraryPaths(), i; + if (runtime.currentDirectory() && paths.indexOf(runtime.currentDirectory()) === -1) { + loadDependenciesFromManifest(runtime.currentDirectory(), dependencies, true); + } + for (i = 0;i < paths.length;i += 1) { + loadDependenciesFromManifest(paths[i], dependencies); + } + return dependencies; + } + function getPath(dir, className) { + return dir + "/" + className.replace(".", "/") + ".js"; + } + function getLoadList(classNames, dependencies, isDefined) { + var loadList = [], stack = {}, visited = {}; + function visit(n) { + if (visited[n] || isDefined(n)) { + return; + } + if (stack[n]) { + throw "Circular dependency detected for " + n + "."; + } + stack[n] = true; + if (!dependencies[n]) { + throw "Missing dependency information for class " + n + "."; + } + var d = dependencies[n], deps = d.deps, i, l = deps.length; + for (i = 0;i < l;i += 1) { + visit(deps[i]); + } + stack[n] = false; + visited[n] = true; + loadList.push(getPath(d.dir, n)); + } + classNames.forEach(visit); + return loadList; + } + function addContent(path, content) { + content += "\n//# sourceURL=" + path; + return content; + } + function loadFiles(paths) { + var i, content; + for (i = 0;i < paths.length;i += 1) { + content = runtime.readFileSync(paths[i], "utf-8"); + content = addContent(paths[i], content); + eval(content); + } + } + function loadFilesInBrowser(paths, callback) { + var e = document.currentScript || document.documentElement.lastChild, df = document.createDocumentFragment(), script, i; + for (i = 0;i < paths.length;i += 1) { + script = document.createElement("script"); + script.type = "text/javascript"; + script.charset = "utf-8"; + script.async = false; + script.setAttribute("src", paths[i]); + df.appendChild(script); + } + if (callback) { + script.onload = callback; + } + e.parentNode.insertBefore(df, e); + } + var dependencies, packages = {core:core, gui:gui, xmldom:xmldom, odf:odf, ops:ops}; + function isDefined(classname) { + var parts = classname.split("."), i, p = packages, l = parts.length; + for (i = 0;i < l;i += 1) { + if (!p.hasOwnProperty(parts[i])) { + return false; + } + p = p[parts[i]]; + } + return true; + } + runtime.loadClasses = function(classnames, callback) { + if (IS_COMPILED_CODE || classnames.length === 0) { + return callback && callback(); + } + dependencies = dependencies || loadDependenciesFromManifests(); + classnames = getLoadList(classnames, dependencies, isDefined); + if (classnames.length === 0) { + return callback && callback(); + } + if (runtime.type() === "BrowserRuntime" && callback) { + loadFilesInBrowser(classnames, callback); + } else { + loadFiles(classnames); + if (callback) { + callback(); + } + } + }; + runtime.loadClass = function(classname, callback) { + runtime.loadClasses([classname], callback); + }; +})(); +(function() { + var translator = function(string) { + return string; + }; + function tr(original) { + var result = translator(original); + if (!result || String(typeof result) !== "string") { + return original; + } + return result; + } + runtime.getTranslator = function() { + return translator; + }; + runtime.setTranslator = function(translatorFunction) { + translator = translatorFunction; + }; + runtime.tr = tr; +})(); +(function(args) { + if (args) { + args = Array.prototype.slice.call(args); + } else { + args = []; + } + function run(argv) { + if (!argv.length) { + return; + } + var script = argv[0]; + runtime.readFile(script, "utf8", function(err, code) { + var path = "", pathEndIndex = script.lastIndexOf("/"), codestring = code; + if (pathEndIndex !== -1) { + path = script.substring(0, pathEndIndex); + } else { + path = "."; + } + runtime.setCurrentDirectory(path); + function inner_run() { + var script, path, args, argv, result; + result = eval(codestring); + if (result) { + runtime.exit(result); + } + return; + } + if (err) { + runtime.log(err); + runtime.exit(1); + } else { + if (codestring === null) { + runtime.log("No code found for " + script); + runtime.exit(1); + } else { + inner_run.apply(null, argv); + } + } + }); + } + if (runtime.type() === "NodeJSRuntime") { + run(process.argv.slice(2)); + } else { + if (runtime.type() === "RhinoRuntime") { + run(args); + } else { + run(args.slice(1)); + } + } +})(String(typeof arguments) !== "undefined" && arguments); +(function() { + function createASyncSingleton() { + function forEach(items, f, callback) { + var i, l = items.length, itemsDone = 0; + function end(err) { + if (itemsDone !== l) { + if (err) { + itemsDone = l; + callback(err); + } else { + itemsDone += 1; + if (itemsDone === l) { + callback(null); + } + } + } + } + for (i = 0;i < l;i += 1) { + f(items[i], end); + } + } + function destroyAll(items, callback) { + function destroy(itemIndex, err) { + if (err) { + callback(err); + } else { + if (itemIndex < items.length) { + items[itemIndex](function(err) { + destroy(itemIndex + 1, err); + }); + } else { + callback(); + } + } + } + destroy(0, undefined); + } + return {forEach:forEach, destroyAll:destroyAll}; + } + core.Async = createASyncSingleton(); +})(); +function makeBase64() { + function makeB64tab(bin) { + var t = {}, i, l; + for (i = 0, l = bin.length;i < l;i += 1) { + t[bin.charAt(i)] = i; + } + return t; + } + var b64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", b64tab = makeB64tab(b64chars), convertUTF16StringToBase64, convertBase64ToUTF16String, window = runtime.getWindow(), btoa, atob; + function stringToArray(s) { + var i, l = s.length, a = new Uint8Array(new ArrayBuffer(l)); + for (i = 0;i < l;i += 1) { + a[i] = s.charCodeAt(i) & 255; + } + return a; + } + function convertUTF8ArrayToBase64(bin) { + var n, b64 = "", i, l = bin.length - 2; + for (i = 0;i < l;i += 3) { + n = bin[i] << 16 | bin[i + 1] << 8 | bin[i + 2]; + b64 += b64chars[n >>> 18]; + b64 += b64chars[n >>> 12 & 63]; + b64 += b64chars[n >>> 6 & 63]; + b64 += b64chars[n & 63]; + } + if (i === l + 1) { + n = bin[i] << 4; + b64 += b64chars[n >>> 6]; + b64 += b64chars[n & 63]; + b64 += "=="; + } else { + if (i === l) { + n = bin[i] << 10 | bin[i + 1] << 2; + b64 += b64chars[n >>> 12]; + b64 += b64chars[n >>> 6 & 63]; + b64 += b64chars[n & 63]; + b64 += "="; + } + } + return b64; + } + function convertBase64ToUTF8Array(b64) { + b64 = b64.replace(/[^A-Za-z0-9+\/]+/g, ""); + var l = b64.length, bin = new Uint8Array(new ArrayBuffer(3 * l)), padlen = b64.length % 4, o = 0, i, n, a = [0, 0, 2, 1]; + for (i = 0;i < l;i += 4) { + n = (b64tab[b64.charAt(i)] || 0) << 18 | (b64tab[b64.charAt(i + 1)] || 0) << 12 | (b64tab[b64.charAt(i + 2)] || 0) << 6 | (b64tab[b64.charAt(i + 3)] || 0); + bin[o] = n >> 16; + bin[o + 1] = n >> 8 & 255; + bin[o + 2] = n & 255; + o += 3; + } + l = 3 * l - a[padlen]; + return bin.subarray(0, l); + } + function convertUTF16ArrayToUTF8Array(uni) { + var i, n, l = uni.length, o = 0, bin = new Uint8Array(new ArrayBuffer(3 * l)); + for (i = 0;i < l;i += 1) { + n = uni[i]; + if (n < 128) { + bin[o++] = n; + } else { + if (n < 2048) { + bin[o++] = 192 | n >>> 6; + bin[o++] = 128 | n & 63; + } else { + bin[o++] = 224 | n >>> 12 & 15; + bin[o++] = 128 | n >>> 6 & 63; + bin[o++] = 128 | n & 63; + } + } + } + return bin.subarray(0, o); + } + function convertUTF8ArrayToUTF16Array(bin) { + var i, c0, c1, c2, l = bin.length, uni = new Uint8Array(new ArrayBuffer(l)), o = 0; + for (i = 0;i < l;i += 1) { + c0 = bin[i]; + if (c0 < 128) { + uni[o++] = c0; + } else { + i += 1; + c1 = bin[i]; + if (c0 < 224) { + uni[o++] = (c0 & 31) << 6 | c1 & 63; + } else { + i += 1; + c2 = bin[i]; + uni[o++] = (c0 & 15) << 12 | (c1 & 63) << 6 | c2 & 63; + } + } + } + return uni.subarray(0, o); + } + function convertUTF8StringToBase64(bin) { + return convertUTF8ArrayToBase64(stringToArray(bin)); + } + function convertBase64ToUTF8String(b64) { + return String.fromCharCode.apply(String, convertBase64ToUTF8Array(b64)); + } + function convertUTF8StringToUTF16Array(bin) { + return convertUTF8ArrayToUTF16Array(stringToArray(bin)); + } + function convertUTF8ArrayToUTF16String(bin) { + var b = convertUTF8ArrayToUTF16Array(bin), r = "", i = 0, chunksize = 45E3; + while (i < b.length) { + r += String.fromCharCode.apply(String, b.subarray(i, i + chunksize)); + i += chunksize; + } + return r; + } + function convertUTF8StringToUTF16String_internal(bin, i, end) { + var c0, c1, c2, j, str = ""; + for (j = i;j < end;j += 1) { + c0 = bin.charCodeAt(j) & 255; + if (c0 < 128) { + str += String.fromCharCode(c0); + } else { + j += 1; + c1 = bin.charCodeAt(j) & 255; + if (c0 < 224) { + str += String.fromCharCode((c0 & 31) << 6 | c1 & 63); + } else { + j += 1; + c2 = bin.charCodeAt(j) & 255; + str += String.fromCharCode((c0 & 15) << 12 | (c1 & 63) << 6 | c2 & 63); + } + } + } + return str; + } + function convertUTF8StringToUTF16String(bin, callback) { + var partsize = 1E5, str = "", pos = 0; + if (bin.length < partsize) { + callback(convertUTF8StringToUTF16String_internal(bin, 0, bin.length), true); + return; + } + if (typeof bin !== "string") { + bin = bin.slice(); + } + function f() { + var end = pos + partsize; + if (end > bin.length) { + end = bin.length; + } + str += convertUTF8StringToUTF16String_internal(bin, pos, end); + pos = end; + end = pos === bin.length; + if (callback(str, end) && !end) { + runtime.setTimeout(f, 0); + } + } + f(); + } + function convertUTF16StringToUTF8Array(uni) { + return convertUTF16ArrayToUTF8Array(stringToArray(uni)); + } + function convertUTF16ArrayToUTF8String(uni) { + return String.fromCharCode.apply(String, convertUTF16ArrayToUTF8Array(uni)); + } + function convertUTF16StringToUTF8String(uni) { + return String.fromCharCode.apply(String, convertUTF16ArrayToUTF8Array(stringToArray(uni))); + } + if (window && window.btoa) { + btoa = window.btoa; + convertUTF16StringToBase64 = function(uni) { + return btoa(convertUTF16StringToUTF8String(uni)); + }; + } else { + btoa = convertUTF8StringToBase64; + convertUTF16StringToBase64 = function(uni) { + return convertUTF8ArrayToBase64(convertUTF16StringToUTF8Array(uni)); + }; + } + if (window && window.atob) { + atob = window.atob; + convertBase64ToUTF16String = function(b64) { + var b = atob(b64); + return convertUTF8StringToUTF16String_internal(b, 0, b.length); + }; + } else { + atob = convertBase64ToUTF8String; + convertBase64ToUTF16String = function(b64) { + return convertUTF8ArrayToUTF16String(convertBase64ToUTF8Array(b64)); + }; + } + core.Base64 = function Base64() { + this.convertUTF8ArrayToBase64 = convertUTF8ArrayToBase64; + this.convertByteArrayToBase64 = convertUTF8ArrayToBase64; + this.convertBase64ToUTF8Array = convertBase64ToUTF8Array; + this.convertBase64ToByteArray = convertBase64ToUTF8Array; + this.convertUTF16ArrayToUTF8Array = convertUTF16ArrayToUTF8Array; + this.convertUTF16ArrayToByteArray = convertUTF16ArrayToUTF8Array; + this.convertUTF8ArrayToUTF16Array = convertUTF8ArrayToUTF16Array; + this.convertByteArrayToUTF16Array = convertUTF8ArrayToUTF16Array; + this.convertUTF8StringToBase64 = convertUTF8StringToBase64; + this.convertBase64ToUTF8String = convertBase64ToUTF8String; + this.convertUTF8StringToUTF16Array = convertUTF8StringToUTF16Array; + this.convertUTF8ArrayToUTF16String = convertUTF8ArrayToUTF16String; + this.convertByteArrayToUTF16String = convertUTF8ArrayToUTF16String; + this.convertUTF8StringToUTF16String = convertUTF8StringToUTF16String; + this.convertUTF16StringToUTF8Array = convertUTF16StringToUTF8Array; + this.convertUTF16StringToByteArray = convertUTF16StringToUTF8Array; + this.convertUTF16ArrayToUTF8String = convertUTF16ArrayToUTF8String; + this.convertUTF16StringToUTF8String = convertUTF16StringToUTF8String; + this.convertUTF16StringToBase64 = convertUTF16StringToBase64; + this.convertBase64ToUTF16String = convertBase64ToUTF16String; + this.fromBase64 = convertBase64ToUTF8String; + this.toBase64 = convertUTF8StringToBase64; + this.atob = atob; + this.btoa = btoa; + this.utob = convertUTF16StringToUTF8String; + this.btou = convertUTF8StringToUTF16String; + this.encode = convertUTF16StringToBase64; + this.encodeURI = function(u) { + return convertUTF16StringToBase64(u).replace(/[+\/]/g, function(m0) { + return m0 === "+" ? "-" : "_"; + }).replace(/\\=+$/, ""); + }; + this.decode = function(a) { + return convertBase64ToUTF16String(a.replace(/[\-_]/g, function(m0) { + return m0 === "-" ? "+" : "/"; + })); + }; + return this; + }; + return core.Base64; +} +core.Base64 = makeBase64(); +core.CSSUnits = function CSSUnits() { + var self = this, sizemap = {"in":1, "cm":2.54, "mm":25.4, "pt":72, "pc":12, "px":96}; + this.convert = function(value, oldUnit, newUnit) { + return value * sizemap[newUnit] / sizemap[oldUnit]; + }; + this.convertMeasure = function(measure, newUnit) { + var value, oldUnit, newMeasure; + if (measure && newUnit) { + value = parseFloat(measure); + oldUnit = measure.replace(value.toString(), ""); + newMeasure = self.convert(value, oldUnit, newUnit); + } + return newMeasure; + }; + this.getUnits = function(measure) { + return measure.substr(measure.length - 2, measure.length); + }; +}; +(function() { + var browserQuirks; + function getBrowserQuirks() { + var range, directBoundingRect, rangeBoundingRect, testContainer, testElement, detectedQuirks, window, document, docElement, body, docOverflow, bodyOverflow, bodyHeight, bodyScroll; + if (browserQuirks === undefined) { + window = runtime.getWindow(); + document = window && window.document; + docElement = document.documentElement; + body = document.body; + browserQuirks = {rangeBCRIgnoresElementBCR:false, unscaledRangeClientRects:false, elementBCRIgnoresBodyScroll:false}; + if (document) { + testContainer = document.createElement("div"); + testContainer.style.position = "absolute"; + testContainer.style.left = "-99999px"; + testContainer.style.transform = "scale(2)"; + testContainer.style["-webkit-transform"] = "scale(2)"; + testElement = document.createElement("div"); + testContainer.appendChild(testElement); + body.appendChild(testContainer); + range = document.createRange(); + range.selectNode(testElement); + browserQuirks.rangeBCRIgnoresElementBCR = range.getClientRects().length === 0; + testElement.appendChild(document.createTextNode("Rect transform test")); + directBoundingRect = testElement.getBoundingClientRect(); + rangeBoundingRect = range.getBoundingClientRect(); + browserQuirks.unscaledRangeClientRects = Math.abs(directBoundingRect.height - rangeBoundingRect.height) > 2; + testContainer.style.transform = ""; + testContainer.style["-webkit-transform"] = ""; + docOverflow = docElement.style.overflow; + bodyOverflow = body.style.overflow; + bodyHeight = body.style.height; + bodyScroll = body.scrollTop; + docElement.style.overflow = "visible"; + body.style.overflow = "visible"; + body.style.height = "200%"; + body.scrollTop = body.scrollHeight; + browserQuirks.elementBCRIgnoresBodyScroll = range.getBoundingClientRect().top !== testElement.getBoundingClientRect().top; + body.scrollTop = bodyScroll; + body.style.height = bodyHeight; + body.style.overflow = bodyOverflow; + docElement.style.overflow = docOverflow; + range.detach(); + body.removeChild(testContainer); + detectedQuirks = Object.keys(browserQuirks).map(function(quirk) { + return quirk + ":" + String(browserQuirks[quirk]); + }).join(", "); + runtime.log("Detected browser quirks - " + detectedQuirks); + } + } + return browserQuirks; + } + function getDirectChild(parent, ns, name) { + var node = parent ? parent.firstElementChild : null; + while (node) { + if (node.localName === name && node.namespaceURI === ns) { + return node; + } + node = node.nextElementSibling; + } + return null; + } + core.DomUtilsImpl = function DomUtilsImpl() { + var sharedRange = null; + function getSharedRange(doc) { + var range; + if (sharedRange) { + range = sharedRange; + } else { + sharedRange = range = doc.createRange(); + } + return range; + } + function findStablePoint(container, offset) { + var c = container; + if (offset < c.childNodes.length) { + c = c.childNodes.item(offset); + offset = 0; + while (c.firstChild) { + c = c.firstChild; + } + } else { + while (c.lastChild) { + c = c.lastChild; + offset = c.nodeType === Node.TEXT_NODE ? c.textContent.length : c.childNodes.length; + } + } + return {container:c, offset:offset}; + } + function getPositionInContainingNode(node, container) { + var offset = 0, n; + while (node.parentNode !== container) { + runtime.assert(node.parentNode !== null, "parent is null"); + node = node.parentNode; + } + n = container.firstChild; + while (n !== node) { + offset += 1; + n = n.nextSibling; + } + return offset; + } + function splitBoundaries(range) { + var modifiedNodes = [], originalEndContainer, resetToContainerLength, end, splitStart, node, text, offset; + if (range.startContainer.nodeType === Node.TEXT_NODE || range.endContainer.nodeType === Node.TEXT_NODE) { + originalEndContainer = range.endContainer; + resetToContainerLength = range.endContainer.nodeType !== Node.TEXT_NODE ? range.endOffset === range.endContainer.childNodes.length : false; + end = findStablePoint(range.endContainer, range.endOffset); + if (end.container === originalEndContainer) { + originalEndContainer = null; + } + range.setEnd(end.container, end.offset); + node = range.endContainer; + if (range.endOffset !== 0 && node.nodeType === Node.TEXT_NODE) { + text = node; + if (range.endOffset !== text.length) { + modifiedNodes.push(text.splitText(range.endOffset)); + modifiedNodes.push(text); + } + } + node = range.startContainer; + if (range.startOffset !== 0 && node.nodeType === Node.TEXT_NODE) { + text = node; + if (range.startOffset !== text.length) { + splitStart = text.splitText(range.startOffset); + modifiedNodes.push(text); + modifiedNodes.push(splitStart); + range.setStart(splitStart, 0); + } + } + if (originalEndContainer !== null) { + node = range.endContainer; + while (node.parentNode && node.parentNode !== originalEndContainer) { + node = node.parentNode; + } + if (resetToContainerLength) { + offset = originalEndContainer.childNodes.length; + } else { + offset = getPositionInContainingNode(node, originalEndContainer); + } + range.setEnd(originalEndContainer, offset); + } + } + return modifiedNodes; + } + this.splitBoundaries = splitBoundaries; + function containsRange(container, insideRange) { + return container.compareBoundaryPoints(Range.START_TO_START, insideRange) <= 0 && container.compareBoundaryPoints(Range.END_TO_END, insideRange) >= 0; + } + this.containsRange = containsRange; + function rangesIntersect(range1, range2) { + return range1.compareBoundaryPoints(Range.END_TO_START, range2) <= 0 && range1.compareBoundaryPoints(Range.START_TO_END, range2) >= 0; + } + this.rangesIntersect = rangesIntersect; + function rangeIntersection(range1, range2) { + var newRange; + if (rangesIntersect(range1, range2)) { + newRange = range1.cloneRange(); + if (range1.compareBoundaryPoints(Range.START_TO_START, range2) === -1) { + newRange.setStart(range2.startContainer, range2.startOffset); + } + if (range1.compareBoundaryPoints(Range.END_TO_END, range2) === 1) { + newRange.setEnd(range2.endContainer, range2.endOffset); + } + } + return newRange; + } + this.rangeIntersection = rangeIntersection; + function maximumOffset(node) { + return node.nodeType === Node.TEXT_NODE ? node.length : node.childNodes.length; + } + function moveToNonRejectedNode(walker, root, nodeFilter) { + var node = walker.currentNode; + if (node !== root) { + node = node.parentNode; + while (node && node !== root) { + if (nodeFilter(node) === NodeFilter.FILTER_REJECT) { + walker.currentNode = node; + } + node = node.parentNode; + } + } + return walker.currentNode; + } + function getNodesInRange(range, nodeFilter, whatToShow) { + var document = range.startContainer.ownerDocument, elements = [], rangeRoot = range.commonAncestorContainer, root = rangeRoot.nodeType === Node.TEXT_NODE ? rangeRoot.parentNode : rangeRoot, treeWalker = document.createTreeWalker(root, whatToShow, nodeFilter, false), currentNode, lastNodeInRange, endNodeCompareFlags, comparePositionResult; + if (range.endContainer.childNodes[range.endOffset - 1]) { + lastNodeInRange = range.endContainer.childNodes[range.endOffset - 1]; + endNodeCompareFlags = Node.DOCUMENT_POSITION_PRECEDING | Node.DOCUMENT_POSITION_CONTAINED_BY; + } else { + lastNodeInRange = range.endContainer; + endNodeCompareFlags = Node.DOCUMENT_POSITION_PRECEDING; + } + if (range.startContainer.childNodes[range.startOffset]) { + currentNode = range.startContainer.childNodes[range.startOffset]; + treeWalker.currentNode = currentNode; + } else { + if (range.startOffset === maximumOffset(range.startContainer)) { + currentNode = range.startContainer; + treeWalker.currentNode = currentNode; + treeWalker.lastChild(); + currentNode = treeWalker.nextNode(); + } else { + currentNode = range.startContainer; + treeWalker.currentNode = currentNode; + } + } + if (currentNode) { + currentNode = moveToNonRejectedNode(treeWalker, root, nodeFilter); + switch(nodeFilter(currentNode)) { + case NodeFilter.FILTER_REJECT: + currentNode = treeWalker.nextSibling(); + while (!currentNode && treeWalker.parentNode()) { + currentNode = treeWalker.nextSibling(); + } + break; + case NodeFilter.FILTER_SKIP: + currentNode = treeWalker.nextNode(); + break; + default: + break; + } + while (currentNode) { + comparePositionResult = lastNodeInRange.compareDocumentPosition(currentNode); + if (comparePositionResult !== 0 && (comparePositionResult & endNodeCompareFlags) === 0) { + break; + } + elements.push(currentNode); + currentNode = treeWalker.nextNode(); + } + } + return elements; + } + this.getNodesInRange = getNodesInRange; + function mergeTextNodes(node, nextNode) { + var mergedNode = null, text, nextText; + if (node.nodeType === Node.TEXT_NODE) { + text = node; + if (text.length === 0) { + text.parentNode.removeChild(text); + if (nextNode.nodeType === Node.TEXT_NODE) { + mergedNode = nextNode; + } + } else { + if (nextNode.nodeType === Node.TEXT_NODE) { + nextText = nextNode; + text.appendData(nextText.data); + nextNode.parentNode.removeChild(nextNode); + } + mergedNode = node; + } + } + return mergedNode; + } + function normalizeTextNodes(node) { + if (node && node.nextSibling) { + node = mergeTextNodes(node, node.nextSibling); + } + if (node && node.previousSibling) { + mergeTextNodes(node.previousSibling, node); + } + } + this.normalizeTextNodes = normalizeTextNodes; + function rangeContainsNode(limits, node) { + var range = node.ownerDocument.createRange(), nodeRange = node.ownerDocument.createRange(), result; + range.setStart(limits.startContainer, limits.startOffset); + range.setEnd(limits.endContainer, limits.endOffset); + nodeRange.selectNodeContents(node); + result = containsRange(range, nodeRange); + range.detach(); + nodeRange.detach(); + return result; + } + this.rangeContainsNode = rangeContainsNode; + function mergeIntoParent(targetNode) { + var parent = targetNode.parentNode; + while (targetNode.firstChild) { + parent.insertBefore(targetNode.firstChild, targetNode); + } + parent.removeChild(targetNode); + return parent; + } + this.mergeIntoParent = mergeIntoParent; + function removeUnwantedNodes(targetNode, nodeFilter) { + var parent = targetNode.parentNode, node = targetNode.firstChild, filterResult = nodeFilter(targetNode), next; + if (filterResult === NodeFilter.FILTER_SKIP) { + return parent; + } + while (node) { + next = node.nextSibling; + removeUnwantedNodes(node, nodeFilter); + node = next; + } + if (parent && filterResult === NodeFilter.FILTER_REJECT) { + mergeIntoParent(targetNode); + } + return parent; + } + this.removeUnwantedNodes = removeUnwantedNodes; + this.removeAllChildNodes = function(node) { + while (node.firstChild) { + node.removeChild(node.firstChild); + } + }; + function getElementsByTagNameNS(node, namespace, tagName) { + var e = [], list, i, l; + list = node.getElementsByTagNameNS(namespace, tagName); + e.length = l = list.length; + for (i = 0;i < l;i += 1) { + e[i] = list.item(i); + } + return e; + } + this.getElementsByTagNameNS = getElementsByTagNameNS; + function getElementsByTagName(node, tagName) { + var e = [], list, i, l; + list = node.getElementsByTagName(tagName); + e.length = l = list.length; + for (i = 0;i < l;i += 1) { + e[i] = list.item(i); + } + return e; + } + this.getElementsByTagName = getElementsByTagName; + function containsNode(parent, descendant) { + return parent === descendant || parent.contains(descendant); + } + this.containsNode = containsNode; + function containsNodeForBrokenWebKit(parent, descendant) { + return parent === descendant || Boolean(parent.compareDocumentPosition(descendant) & Node.DOCUMENT_POSITION_CONTAINED_BY); + } + function comparePoints(c1, o1, c2, o2) { + if (c1 === c2) { + return o2 - o1; + } + var comparison = c1.compareDocumentPosition(c2); + if (comparison === 2) { + comparison = -1; + } else { + if (comparison === 4) { + comparison = 1; + } else { + if (comparison === 10) { + o1 = getPositionInContainingNode(c1, c2); + comparison = o1 < o2 ? 1 : -1; + } else { + o2 = getPositionInContainingNode(c2, c1); + comparison = o2 < o1 ? -1 : 1; + } + } + } + return comparison; + } + this.comparePoints = comparePoints; + function adaptRangeDifferenceToZoomLevel(inputNumber, zoomLevel) { + if (getBrowserQuirks().unscaledRangeClientRects) { + return inputNumber; + } + return inputNumber / zoomLevel; + } + this.adaptRangeDifferenceToZoomLevel = adaptRangeDifferenceToZoomLevel; + this.translateRect = function(child, parent, zoomLevel) { + return {top:adaptRangeDifferenceToZoomLevel(child.top - parent.top, zoomLevel), left:adaptRangeDifferenceToZoomLevel(child.left - parent.left, zoomLevel), bottom:adaptRangeDifferenceToZoomLevel(child.bottom - parent.top, zoomLevel), right:adaptRangeDifferenceToZoomLevel(child.right - parent.left, zoomLevel), width:adaptRangeDifferenceToZoomLevel(child.width, zoomLevel), height:adaptRangeDifferenceToZoomLevel(child.height, zoomLevel)}; + }; + function getBoundingClientRect(node) { + var doc = node.ownerDocument, quirks = getBrowserQuirks(), range, element, rect, body = doc.body; + if (quirks.unscaledRangeClientRects === false || quirks.rangeBCRIgnoresElementBCR) { + if (node.nodeType === Node.ELEMENT_NODE) { + element = node; + rect = element.getBoundingClientRect(); + if (quirks.elementBCRIgnoresBodyScroll) { + return {left:rect.left + body.scrollLeft, right:rect.right + body.scrollLeft, top:rect.top + body.scrollTop, bottom:rect.bottom + body.scrollTop, width:rect.width, height:rect.height}; + } + return rect; + } + } + range = getSharedRange(doc); + range.selectNode(node); + return range.getBoundingClientRect(); + } + this.getBoundingClientRect = getBoundingClientRect; + function mapKeyValObjOntoNode(node, properties, nsResolver) { + Object.keys(properties).forEach(function(key) { + var parts = key.split(":"), prefix = parts[0], localName = parts[1], ns = nsResolver(prefix), value = properties[key], element; + if (ns) { + element = node.getElementsByTagNameNS(ns, localName)[0]; + if (!element) { + element = node.ownerDocument.createElementNS(ns, key); + node.appendChild(element); + } + element.textContent = value; + } else { + runtime.log("Key ignored: " + key); + } + }); + } + this.mapKeyValObjOntoNode = mapKeyValObjOntoNode; + function removeKeyElementsFromNode(node, propertyNames, nsResolver) { + propertyNames.forEach(function(propertyName) { + var parts = propertyName.split(":"), prefix = parts[0], localName = parts[1], ns = nsResolver(prefix), element; + if (ns) { + element = node.getElementsByTagNameNS(ns, localName)[0]; + if (element) { + element.parentNode.removeChild(element); + } else { + runtime.log("Element for " + propertyName + " not found."); + } + } else { + runtime.log("Property Name ignored: " + propertyName); + } + }); + } + this.removeKeyElementsFromNode = removeKeyElementsFromNode; + function getKeyValRepresentationOfNode(node, prefixResolver) { + var properties = {}, currentSibling = node.firstElementChild, prefix; + while (currentSibling) { + prefix = prefixResolver(currentSibling.namespaceURI); + if (prefix) { + properties[prefix + ":" + currentSibling.localName] = currentSibling.textContent; + } + currentSibling = currentSibling.nextElementSibling; + } + return properties; + } + this.getKeyValRepresentationOfNode = getKeyValRepresentationOfNode; + function mapObjOntoNode(node, properties, nsResolver) { + Object.keys(properties).forEach(function(key) { + var parts = key.split(":"), prefix = parts[0], localName = parts[1], ns = nsResolver(prefix), value = properties[key], valueType = typeof value, element; + if (valueType === "object") { + if (Object.keys(value).length) { + if (ns) { + element = node.getElementsByTagNameNS(ns, localName)[0] || node.ownerDocument.createElementNS(ns, key); + } else { + element = node.getElementsByTagName(localName)[0] || node.ownerDocument.createElement(key); + } + node.appendChild(element); + mapObjOntoNode(element, value, nsResolver); + } + } else { + if (ns) { + runtime.assert(valueType === "number" || valueType === "string", "attempting to map unsupported type '" + valueType + "' (key: " + key + ")"); + node.setAttributeNS(ns, key, String(value)); + } + } + }); + } + this.mapObjOntoNode = mapObjOntoNode; + function cloneEvent(event) { + var e = Object.create(null); + Object.keys(event.constructor.prototype).forEach(function(x) { + e[x] = event[x]; + }); + e.prototype = event.constructor.prototype; + return e; + } + this.cloneEvent = cloneEvent; + this.getDirectChild = getDirectChild; + function init(self) { + var appVersion, webKitOrSafari, ie, window = runtime.getWindow(); + if (window === null) { + return; + } + appVersion = window.navigator.appVersion.toLowerCase(); + webKitOrSafari = appVersion.indexOf("chrome") === -1 && (appVersion.indexOf("applewebkit") !== -1 || appVersion.indexOf("safari") !== -1); + ie = appVersion.indexOf("msie") !== -1 || appVersion.indexOf("trident") !== -1; + if (webKitOrSafari || ie) { + self.containsNode = containsNodeForBrokenWebKit; + } + } + init(this); + }; + core.DomUtils = new core.DomUtilsImpl; +})(); +core.Cursor = function Cursor(document, memberId) { + var cursorns = "urn:webodf:names:cursor", cursorNode = document.createElementNS(cursorns, "cursor"), anchorNode = document.createElementNS(cursorns, "anchor"), forwardSelection, recentlyModifiedNodes = [], selectedRange = document.createRange(), isCollapsed, domUtils = core.DomUtils; + function putIntoTextNode(node, container, offset) { + runtime.assert(Boolean(container), "putCursorIntoTextNode: invalid container"); + var parent = container.parentNode; + runtime.assert(Boolean(parent), "putCursorIntoTextNode: container without parent"); + runtime.assert(offset >= 0 && offset <= container.length, "putCursorIntoTextNode: offset is out of bounds"); + if (offset === 0) { + parent.insertBefore(node, container); + } else { + if (offset === container.length) { + parent.insertBefore(node, container.nextSibling); + } else { + container.splitText(offset); + parent.insertBefore(node, container.nextSibling); + } + } + } + function removeNode(node) { + if (node.parentNode) { + recentlyModifiedNodes.push(node.previousSibling); + recentlyModifiedNodes.push(node.nextSibling); + node.parentNode.removeChild(node); + } + } + function putNode(node, container, offset) { + if (container.nodeType === Node.TEXT_NODE) { + putIntoTextNode(node, container, offset); + } else { + if (container.nodeType === Node.ELEMENT_NODE) { + container.insertBefore(node, container.childNodes.item(offset)); + } + } + recentlyModifiedNodes.push(node.previousSibling); + recentlyModifiedNodes.push(node.nextSibling); + } + function getStartNode() { + return forwardSelection ? anchorNode : cursorNode; + } + function getEndNode() { + return forwardSelection ? cursorNode : anchorNode; + } + this.getNode = function() { + return cursorNode; + }; + this.getAnchorNode = function() { + return anchorNode.parentNode ? anchorNode : cursorNode; + }; + this.getSelectedRange = function() { + if (isCollapsed) { + selectedRange.setStartBefore(cursorNode); + selectedRange.collapse(true); + } else { + selectedRange.setStartAfter(getStartNode()); + selectedRange.setEndBefore(getEndNode()); + } + return selectedRange; + }; + this.setSelectedRange = function(range, isForwardSelection) { + if (selectedRange && selectedRange !== range) { + selectedRange.detach(); + } + selectedRange = range; + forwardSelection = isForwardSelection !== false; + isCollapsed = range.collapsed; + if (range.collapsed) { + removeNode(anchorNode); + removeNode(cursorNode); + putNode(cursorNode, range.startContainer, range.startOffset); + } else { + removeNode(anchorNode); + removeNode(cursorNode); + putNode(getEndNode(), range.endContainer, range.endOffset); + putNode(getStartNode(), range.startContainer, range.startOffset); + } + recentlyModifiedNodes.forEach(domUtils.normalizeTextNodes); + recentlyModifiedNodes.length = 0; + }; + this.hasForwardSelection = function() { + return forwardSelection; + }; + this.remove = function() { + removeNode(cursorNode); + recentlyModifiedNodes.forEach(domUtils.normalizeTextNodes); + recentlyModifiedNodes.length = 0; + }; + function init() { + cursorNode.setAttributeNS(cursorns, "memberId", memberId); + anchorNode.setAttributeNS(cursorns, "memberId", memberId); + } + init(); +}; +core.Destroyable = function Destroyable() { +}; +core.Destroyable.prototype.destroy = function(callback) { +}; +core.EventSource = function() { +}; +core.EventSource.prototype.subscribe = function(eventId, cb) { +}; +core.EventSource.prototype.unsubscribe = function(eventId, cb) { +}; +core.EventNotifier = function EventNotifier(eventIds) { + var eventListener = {}; + this.emit = function(eventId, args) { + var i, subscribers; + runtime.assert(eventListener.hasOwnProperty(eventId), 'unknown event fired "' + eventId + '"'); + subscribers = eventListener[eventId]; + for (i = 0;i < subscribers.length;i += 1) { + subscribers[i](args); + } + }; + this.subscribe = function(eventId, cb) { + runtime.assert(eventListener.hasOwnProperty(eventId), 'tried to subscribe to unknown event "' + eventId + '"'); + eventListener[eventId].push(cb); + }; + this.unsubscribe = function(eventId, cb) { + var cbIndex; + runtime.assert(eventListener.hasOwnProperty(eventId), 'tried to unsubscribe from unknown event "' + eventId + '"'); + cbIndex = eventListener[eventId].indexOf(cb); + runtime.assert(cbIndex !== -1, 'tried to unsubscribe unknown callback from event "' + eventId + '"'); + if (cbIndex !== -1) { + eventListener[eventId].splice(cbIndex, 1); + } + }; + function register(eventId) { + runtime.assert(!eventListener.hasOwnProperty(eventId), 'Duplicated event ids: "' + eventId + '" registered more than once.'); + eventListener[eventId] = []; + } + this.register = register; + function init() { + if (eventIds) { + eventIds.forEach(register); + } + } + init(); +}; +core.ScheduledTask = function ScheduledTask(fn, scheduleTask, cancelTask) { + var timeoutId, scheduled = false, args = [], destroyed = false; + function cancel() { + if (scheduled) { + cancelTask(timeoutId); + scheduled = false; + } + } + function execute() { + cancel(); + fn.apply(undefined, args); + args = null; + } + this.trigger = function() { + runtime.assert(destroyed === false, "Can't trigger destroyed ScheduledTask instance"); + args = Array.prototype.slice.call(arguments); + if (!scheduled) { + scheduled = true; + timeoutId = scheduleTask(execute); + } + }; + this.triggerImmediate = function() { + runtime.assert(destroyed === false, "Can't trigger destroyed ScheduledTask instance"); + args = Array.prototype.slice.call(arguments); + execute(); + }; + this.processRequests = function() { + if (scheduled) { + execute(); + } + }; + this.cancel = cancel; + this.restart = function() { + runtime.assert(destroyed === false, "Can't trigger destroyed ScheduledTask instance"); + cancel(); + scheduled = true; + timeoutId = scheduleTask(execute); + }; + this.destroy = function(callback) { + cancel(); + destroyed = true; + callback(); + }; +}; +(function() { + var redrawTasks; + function RedrawTasks() { + var callbacks = {}; + this.requestRedrawTask = function(callback) { + var id = runtime.requestAnimationFrame(function() { + callback(); + delete callbacks[id]; + }); + callbacks[id] = callback; + return id; + }; + this.performRedraw = function() { + Object.keys(callbacks).forEach(function(id) { + callbacks[id](); + runtime.cancelAnimationFrame(parseInt(id, 10)); + }); + callbacks = {}; + }; + this.cancelRedrawTask = function(id) { + runtime.cancelAnimationFrame(id); + delete callbacks[id]; + }; + } + core.Task = {}; + core.Task.SUPPRESS_MANUAL_PROCESSING = false; + core.Task.processTasks = function() { + if (!core.Task.SUPPRESS_MANUAL_PROCESSING) { + redrawTasks.performRedraw(); + } + }; + core.Task.createRedrawTask = function(callback) { + return new core.ScheduledTask(callback, redrawTasks.requestRedrawTask, redrawTasks.cancelRedrawTask); + }; + core.Task.createTimeoutTask = function(callback, delay) { + return new core.ScheduledTask(callback, function(callback) { + return runtime.setTimeout(callback, delay); + }, runtime.clearTimeout); + }; + function init() { + redrawTasks = new RedrawTasks; + } + init(); +})(); +core.EventSubscriptions = function() { + var subscriptions = [], frameEventNotifier = new core.EventNotifier, frameSubscriptions = {}, nextFrameEventId = 0; + function addSubscription(eventSource, eventid, callback) { + eventSource.subscribe(eventid, callback); + subscriptions.push({eventSource:eventSource, eventid:eventid, callback:callback}); + } + this.addSubscription = addSubscription; + this.addFrameSubscription = function(eventSource, eventid, callback) { + var frameSubscription, frameEventId, eventFrameSubscriptions, i; + if (!frameSubscriptions.hasOwnProperty(eventid)) { + frameSubscriptions[eventid] = []; + } + eventFrameSubscriptions = frameSubscriptions[eventid]; + for (i = 0;i < eventFrameSubscriptions.length;i += 1) { + if (eventFrameSubscriptions[i].eventSource === eventSource) { + frameSubscription = eventFrameSubscriptions[i]; + break; + } + } + if (!frameSubscription) { + frameEventId = "s" + nextFrameEventId; + nextFrameEventId += 1; + frameEventNotifier.register(frameEventId); + frameSubscription = {frameEventId:frameEventId, eventSource:eventSource, task:core.Task.createRedrawTask(function() { + frameEventNotifier.emit(frameEventId, undefined); + })}; + eventFrameSubscriptions.push(frameSubscription); + addSubscription(eventSource, eventid, frameSubscription.task.trigger); + } + frameEventNotifier.subscribe(frameSubscription.frameEventId, callback); + }; + function unsubscribeAll() { + var cleanup = []; + subscriptions.forEach(function(subscription) { + subscription.eventSource.unsubscribe(subscription.eventid, subscription.callback); + }); + subscriptions.length = 0; + Object.keys(frameSubscriptions).forEach(function(eventId) { + frameSubscriptions[eventId].forEach(function(subscriber) { + cleanup.push(subscriber.task.destroy); + }); + delete frameSubscriptions[eventId]; + }); + core.Async.destroyAll(cleanup, function() { + }); + frameEventNotifier = new core.EventNotifier; + } + this.unsubscribeAll = unsubscribeAll; + this.destroy = function(callback) { + unsubscribeAll(); + callback(); + }; +}; +core.LazyProperty = function(valueLoader) { + var cachedValue, valueLoaded = false; + this.value = function() { + if (!valueLoaded) { + cachedValue = valueLoader(); + valueLoaded = true; + } + return cachedValue; + }; + this.reset = function() { + valueLoaded = false; + }; +}; +core.LoopWatchDog = function LoopWatchDog(timeout, maxChecks) { + var startTime = Date.now(), checks = 0; + function check() { + var t; + if (timeout) { + t = Date.now(); + if (t - startTime > timeout) { + runtime.log("alert", "watchdog timeout"); + throw "timeout!"; + } + } + if (maxChecks > 0) { + checks += 1; + if (checks > maxChecks) { + runtime.log("alert", "watchdog loop overflow"); + throw "loop overflow"; + } + } + } + this.check = check; +}; +core.NodeFilterChain = function(filters) { + var FILTER_REJECT = NodeFilter.FILTER_REJECT, FILTER_ACCEPT = NodeFilter.FILTER_ACCEPT; + this.acceptNode = function(node) { + var i; + for (i = 0;i < filters.length;i += 1) { + if (filters[i].acceptNode(node) === FILTER_REJECT) { + return FILTER_REJECT; + } + } + return FILTER_ACCEPT; + }; +}; +core.PositionIterator = function PositionIterator(root, whatToShow, filter, expandEntityReferences) { + var self = this, walker, currentPos, nodeFilter, TEXT_NODE = Node.TEXT_NODE, ELEMENT_NODE = Node.ELEMENT_NODE, FILTER_ACCEPT = NodeFilter.FILTER_ACCEPT, FILTER_REJECT = NodeFilter.FILTER_REJECT; + function EmptyTextNodeFilter() { + this.acceptNode = function(node) { + var text = node; + if (!node || node.nodeType === TEXT_NODE && text.length === 0) { + return FILTER_REJECT; + } + return FILTER_ACCEPT; + }; + } + function FilteredEmptyTextNodeFilter(filter) { + this.acceptNode = function(node) { + var text = node; + if (!node || node.nodeType === TEXT_NODE && text.length === 0) { + return FILTER_REJECT; + } + return filter.acceptNode(node); + }; + } + this.nextPosition = function() { + var currentNode = walker.currentNode, nodeType = currentNode.nodeType, text = currentNode; + if (currentNode === root) { + return false; + } + if (currentPos === 0 && nodeType === ELEMENT_NODE) { + if (walker.firstChild() === null) { + currentPos = 1; + } + } else { + if (nodeType === TEXT_NODE && currentPos + 1 < text.length) { + currentPos += 1; + } else { + if (walker.nextSibling() !== null) { + currentPos = 0; + } else { + if (walker.parentNode()) { + currentPos = 1; + } else { + return false; + } + } + } + } + return true; + }; + function setAtEnd() { + var text = walker.currentNode, type = text.nodeType; + if (type === TEXT_NODE) { + currentPos = text.length - 1; + } else { + currentPos = type === ELEMENT_NODE ? 1 : 0; + } + } + function previousNode() { + if (walker.previousSibling() === null) { + if (!walker.parentNode() || walker.currentNode === root) { + walker.firstChild(); + return false; + } + currentPos = 0; + } else { + setAtEnd(); + } + return true; + } + this.previousPosition = function() { + var moved = true, currentNode = walker.currentNode; + if (currentPos === 0) { + moved = previousNode(); + } else { + if (currentNode.nodeType === TEXT_NODE) { + currentPos -= 1; + } else { + if (walker.lastChild() !== null) { + setAtEnd(); + } else { + if (currentNode === root) { + moved = false; + } else { + currentPos = 0; + } + } + } + } + return moved; + }; + this.previousNode = previousNode; + this.container = function() { + var n = walker.currentNode, t = n.nodeType; + if (currentPos === 0 && t !== TEXT_NODE) { + n = n.parentNode; + } + return n; + }; + this.rightNode = function() { + var n = walker.currentNode, text = n, nodeType = n.nodeType; + if (nodeType === TEXT_NODE && currentPos === text.length) { + n = n.nextSibling; + while (n && nodeFilter(n) !== FILTER_ACCEPT) { + n = n.nextSibling; + } + } else { + if (nodeType === ELEMENT_NODE && currentPos === 1) { + n = null; + } + } + return n; + }; + this.leftNode = function() { + var n = walker.currentNode; + if (currentPos === 0) { + n = n.previousSibling; + while (n && nodeFilter(n) !== FILTER_ACCEPT) { + n = n.previousSibling; + } + } else { + if (n.nodeType === ELEMENT_NODE) { + n = n.lastChild; + while (n && nodeFilter(n) !== FILTER_ACCEPT) { + n = n.previousSibling; + } + } + } + return n; + }; + this.getCurrentNode = function() { + var n = walker.currentNode; + return n; + }; + this.unfilteredDomOffset = function() { + if (walker.currentNode.nodeType === TEXT_NODE) { + return currentPos; + } + var c = 0, n = walker.currentNode; + if (currentPos === 1) { + n = n.lastChild; + } else { + n = n.previousSibling; + } + while (n) { + c += 1; + n = n.previousSibling; + } + return c; + }; + this.getPreviousSibling = function() { + var currentNode = walker.currentNode, sibling = walker.previousSibling(); + walker.currentNode = currentNode; + return sibling; + }; + this.getNextSibling = function() { + var currentNode = walker.currentNode, sibling = walker.nextSibling(); + walker.currentNode = currentNode; + return sibling; + }; + function moveToAcceptedNode() { + var node = walker.currentNode, filterResult, moveResult; + filterResult = nodeFilter(node); + if (node !== root) { + node = node.parentNode; + while (node && node !== root) { + if (nodeFilter(node) === FILTER_REJECT) { + walker.currentNode = node; + filterResult = FILTER_REJECT; + } + node = node.parentNode; + } + } + if (filterResult === FILTER_REJECT) { + currentPos = walker.currentNode.nodeType === TEXT_NODE ? node.length : 1; + moveResult = self.nextPosition(); + } else { + if (filterResult === FILTER_ACCEPT) { + moveResult = true; + } else { + moveResult = self.nextPosition(); + } + } + if (moveResult) { + runtime.assert(nodeFilter(walker.currentNode) === FILTER_ACCEPT, "moveToAcceptedNode did not result in walker being on an accepted node"); + } + return moveResult; + } + this.setPositionBeforeElement = function(element) { + runtime.assert(Boolean(element), "setPositionBeforeElement called without element"); + walker.currentNode = element; + currentPos = 0; + return moveToAcceptedNode(); + }; + this.setUnfilteredPosition = function(container, offset) { + var text; + runtime.assert(Boolean(container), "PositionIterator.setUnfilteredPosition called without container"); + walker.currentNode = container; + if (container.nodeType === TEXT_NODE) { + currentPos = offset; + text = container; + runtime.assert(offset <= text.length, "Error in setPosition: " + offset + " > " + text.length); + runtime.assert(offset >= 0, "Error in setPosition: " + offset + " < 0"); + if (offset === text.length) { + if (walker.nextSibling()) { + currentPos = 0; + } else { + if (walker.parentNode()) { + currentPos = 1; + } else { + runtime.assert(false, "Error in setUnfilteredPosition: position not valid."); + } + } + } + } else { + if (offset < container.childNodes.length) { + walker.currentNode = container.childNodes.item(offset); + currentPos = 0; + } else { + currentPos = 1; + } + } + return moveToAcceptedNode(); + }; + this.moveToEnd = function() { + walker.currentNode = root; + currentPos = 1; + }; + this.moveToEndOfNode = function(node) { + var text; + if (node.nodeType === TEXT_NODE) { + text = node; + self.setUnfilteredPosition(text, text.length); + } else { + walker.currentNode = node; + currentPos = 1; + } + }; + this.isBeforeNode = function() { + return currentPos === 0; + }; + this.getNodeFilter = function() { + return nodeFilter; + }; + function init() { + var f; + if (filter) { + f = new FilteredEmptyTextNodeFilter(filter); + } else { + f = new EmptyTextNodeFilter; + } + nodeFilter = f.acceptNode; + nodeFilter.acceptNode = nodeFilter; + whatToShow = whatToShow || NodeFilter.SHOW_ALL; + runtime.assert(root.nodeType !== Node.TEXT_NODE, "Internet Explorer doesn't allow tree walker roots to be text nodes"); + walker = root.ownerDocument.createTreeWalker(root, whatToShow, nodeFilter, expandEntityReferences); + currentPos = 0; + if (walker.firstChild() === null) { + currentPos = 1; + } + } + init(); +}; +core.PositionFilter = function PositionFilter() { +}; +core.PositionFilter.FilterResult = {FILTER_ACCEPT:1, FILTER_REJECT:2, FILTER_SKIP:3}; +core.PositionFilter.prototype.acceptPosition = function(point) { +}; +core.PositionFilterChain = function PositionFilterChain() { + var filterChain = [], FILTER_ACCEPT = core.PositionFilter.FilterResult.FILTER_ACCEPT, FILTER_REJECT = core.PositionFilter.FilterResult.FILTER_REJECT; + this.acceptPosition = function(iterator) { + var i; + for (i = 0;i < filterChain.length;i += 1) { + if (filterChain[i].acceptPosition(iterator) === FILTER_REJECT) { + return FILTER_REJECT; + } + } + return FILTER_ACCEPT; + }; + this.addFilter = function(filterInstance) { + filterChain.push(filterInstance); + }; +}; +core.StepDirection = {PREVIOUS:1, NEXT:2}; +core.StepIterator = function StepIterator(filter, iterator) { + var FILTER_ACCEPT = core.PositionFilter.FilterResult.FILTER_ACCEPT, NEXT = core.StepDirection.NEXT, cachedContainer, cachedOffset, cachedFilterResult; + function resetCache() { + cachedContainer = null; + cachedOffset = undefined; + cachedFilterResult = undefined; + } + function isStep() { + if (cachedFilterResult === undefined) { + cachedFilterResult = filter.acceptPosition(iterator) === FILTER_ACCEPT; + } + return cachedFilterResult; + } + this.isStep = isStep; + function setPosition(newContainer, newOffset) { + resetCache(); + return iterator.setUnfilteredPosition(newContainer, newOffset); + } + this.setPosition = setPosition; + function container() { + if (!cachedContainer) { + cachedContainer = iterator.container(); + } + return cachedContainer; + } + this.container = container; + function offset() { + if (cachedOffset === undefined) { + cachedOffset = iterator.unfilteredDomOffset(); + } + return cachedOffset; + } + this.offset = offset; + function nextStep() { + resetCache(); + while (iterator.nextPosition()) { + resetCache(); + if (isStep()) { + return true; + } + } + return false; + } + this.nextStep = nextStep; + function previousStep() { + resetCache(); + while (iterator.previousPosition()) { + resetCache(); + if (isStep()) { + return true; + } + } + return false; + } + this.previousStep = previousStep; + this.advanceStep = function(direction) { + return direction === NEXT ? nextStep() : previousStep(); + }; + this.roundToClosestStep = function() { + var currentContainer, currentOffset, isAtStep = isStep(); + if (!isAtStep) { + currentContainer = container(); + currentOffset = offset(); + isAtStep = previousStep(); + if (!isAtStep) { + setPosition(currentContainer, currentOffset); + isAtStep = nextStep(); + } + } + return isAtStep; + }; + this.roundToPreviousStep = function() { + var isAtStep = isStep(); + if (!isAtStep) { + isAtStep = previousStep(); + } + return isAtStep; + }; + this.roundToNextStep = function() { + var isAtStep = isStep(); + if (!isAtStep) { + isAtStep = nextStep(); + } + return isAtStep; + }; + this.leftNode = function() { + return iterator.leftNode(); + }; + this.snapshot = function() { + return new core.StepIterator.StepSnapshot(container(), offset()); + }; + this.restore = function(snapshot) { + setPosition(snapshot.container, snapshot.offset); + }; +}; +core.StepIterator.StepSnapshot = function(container, offset) { + this.container = container; + this.offset = offset; +}; +core.Utils = function Utils() { + function hashString(value) { + var hash = 0, i, l; + for (i = 0, l = value.length;i < l;i += 1) { + hash = (hash << 5) - hash + value.charCodeAt(i); + hash |= 0; + } + return hash; + } + this.hashString = hashString; + var mergeObjects; + function mergeItems(destination, source) { + if (source && Array.isArray(source)) { + destination = destination || []; + if (!Array.isArray(destination)) { + throw "Destination is not an array."; + } + destination = destination.concat(source.map(function(obj) { + return mergeItems(null, obj); + })); + } else { + if (source && typeof source === "object") { + destination = destination || {}; + if (typeof destination !== "object") { + throw "Destination is not an object."; + } + Object.keys(source).forEach(function(p) { + destination[p] = mergeItems(destination[p], source[p]); + }); + } else { + destination = source; + } + } + return destination; + } + mergeObjects = function(destination, source) { + Object.keys(source).forEach(function(p) { + destination[p] = mergeItems(destination[p], source[p]); + }); + return destination; + }; + this.mergeObjects = mergeObjects; +}; +core.Zip = function Zip(url, entriesReadCallback) { + var self = this, zip, base64 = new core.Base64; + function load(filename, callback) { + var entry = zip.file(filename); + if (entry) { + callback(null, entry.asUint8Array()); + } else { + callback(filename + " not found.", null); + } + } + function loadAsString(filename, callback) { + load(filename, function(err, data) { + if (err || data === null) { + return callback(err, null); + } + var d = runtime.byteArrayToString(data, "utf8"); + callback(null, d); + }); + } + function loadContentXmlAsFragments(filename, handler) { + loadAsString(filename, function(err, data) { + if (err) { + return handler.rootElementReady(err); + } + handler.rootElementReady(null, data, true); + }); + } + function loadAsDataURL(filename, mimetype, callback) { + load(filename, function(err, data) { + if (err || !data) { + return callback(err, null); + } + var p = data, chunksize = 45E3, i = 0, dataurl; + if (!mimetype) { + if (p[1] === 80 && p[2] === 78 && p[3] === 71) { + mimetype = "image/png"; + } else { + if (p[0] === 255 && p[1] === 216 && p[2] === 255) { + mimetype = "image/jpeg"; + } else { + if (p[0] === 71 && p[1] === 73 && p[2] === 70) { + mimetype = "image/gif"; + } else { + mimetype = ""; + } + } + } + } + dataurl = "data:" + mimetype + ";base64,"; + while (i < data.length) { + dataurl += base64.convertUTF8ArrayToBase64(p.subarray(i, Math.min(i + chunksize, p.length))); + i += chunksize; + } + callback(null, dataurl); + }); + } + function loadAsDOM(filename, callback) { + loadAsString(filename, function(err, xmldata) { + if (err || xmldata === null) { + callback(err, null); + return; + } + var parser = new DOMParser, dom = parser.parseFromString(xmldata, "text/xml"); + callback(null, dom); + }); + } + function save(filename, data, compressed, date) { + zip.file(filename, data, {date:date, compression:compressed ? "DEFLATE" : "STORE"}); + } + function remove(filename) { + var exists = zip.file(filename) !== null; + zip.remove(filename); + return exists; + } + function createByteArray(successCallback, errorCallback) { + try { + successCallback(zip.generate({type:"uint8array", compression:"STORE"})); + } catch (e) { + errorCallback(e.message); + } + } + function writeAs(newurl, callback) { + createByteArray(function(data) { + runtime.writeFile(newurl, data, callback); + }, callback); + } + function write(callback) { + writeAs(url, callback); + } + this.load = load; + this.save = save; + this.remove = remove; + this.write = write; + this.writeAs = writeAs; + this.createByteArray = createByteArray; + this.loadContentXmlAsFragments = loadContentXmlAsFragments; + this.loadAsString = loadAsString; + this.loadAsDOM = loadAsDOM; + this.loadAsDataURL = loadAsDataURL; + this.getEntries = function() { + return Object.keys(zip.files).map(function(filename) { + var e = zip.files[filename]; + return {filename:filename, date:e.date}; + }); + }; + zip = new externs.JSZip; + if (entriesReadCallback === null) { + return; + } + runtime.readFile(url, "binary", function(err, result) { + if (typeof result === "string") { + err = "file was read as a string. Should be Uint8Array."; + } + if (err || !result || result.length === 0) { + entriesReadCallback("File '" + url + "' cannot be read. Err: " + (err || "[none]"), self); + } else { + try { + zip.load(result, {checkCRC32:false}); + entriesReadCallback(null, self); + } catch (e) { + entriesReadCallback(e.message, self); + } + } + }); +}; +core.SimpleClientRect = null; +gui.CommonConstraints = {EDIT:{ANNOTATIONS:{ONLY_DELETE_OWN:"onlyDeleteOwn"}, REVIEW_MODE:"reviewMode"}}; +gui.SessionConstraints = function SessionConstraints() { + var constraints = {}, constraintNotifier = new core.EventNotifier; + function registerConstraint(constraint) { + if (!constraints.hasOwnProperty(constraint)) { + constraints[constraint] = false; + constraintNotifier.register(constraint); + } + } + this.registerConstraint = registerConstraint; + this.subscribe = function(constraint, callback) { + registerConstraint(constraint); + constraintNotifier.subscribe(constraint, callback); + }; + this.unsubscribe = function(constraint, callback) { + constraintNotifier.unsubscribe(constraint, callback); + }; + this.setState = function(constraint, enabled) { + runtime.assert(constraints.hasOwnProperty(constraint) === true, "No such constraint"); + if (constraints[constraint] !== enabled) { + constraints[constraint] = enabled; + constraintNotifier.emit(constraint, enabled); + } + }; + this.getState = function(constraint) { + runtime.assert(constraints.hasOwnProperty(constraint) === true, "No such constraint"); + return constraints[constraint]; + }; +}; +gui.BlacklistNamespaceNodeFilter = function(excludedNamespaces) { + var excludedNamespacesObj = {}, FILTER_REJECT = NodeFilter.FILTER_REJECT, FILTER_ACCEPT = NodeFilter.FILTER_ACCEPT; + this.acceptNode = function(node) { + if (!node || excludedNamespacesObj.hasOwnProperty(node.namespaceURI)) { + return FILTER_REJECT; + } + return FILTER_ACCEPT; + }; + function init() { + excludedNamespaces.forEach(function(ns) { + excludedNamespacesObj[ns] = true; + }); + } + init(); +}; +odf.Namespaces = {namespaceMap:{config:"urn:oasis:names:tc:opendocument:xmlns:config:1.0", db:"urn:oasis:names:tc:opendocument:xmlns:database:1.0", dc:"http://purl.org/dc/elements/1.1/", dr3d:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0", draw:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0", chart:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0", fo:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0", form:"urn:oasis:names:tc:opendocument:xmlns:form:1.0", math:"http://www.w3.org/1998/Math/MathML", +meta:"urn:oasis:names:tc:opendocument:xmlns:meta:1.0", number:"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0", office:"urn:oasis:names:tc:opendocument:xmlns:office:1.0", presentation:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0", style:"urn:oasis:names:tc:opendocument:xmlns:style:1.0", svg:"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0", table:"urn:oasis:names:tc:opendocument:xmlns:table:1.0", text:"urn:oasis:names:tc:opendocument:xmlns:text:1.0", xforms:"http://www.w3.org/2002/xforms", +xlink:"http://www.w3.org/1999/xlink", xml:"http://www.w3.org/XML/1998/namespace"}, prefixMap:{}, configns:"urn:oasis:names:tc:opendocument:xmlns:config:1.0", dbns:"urn:oasis:names:tc:opendocument:xmlns:database:1.0", dcns:"http://purl.org/dc/elements/1.1/", dr3dns:"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0", drawns:"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0", chartns:"urn:oasis:names:tc:opendocument:xmlns:chart:1.0", fons:"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0", +formns:"urn:oasis:names:tc:opendocument:xmlns:form:1.0", mathns:"http://www.w3.org/1998/Math/MathML", metans:"urn:oasis:names:tc:opendocument:xmlns:meta:1.0", numberns:"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0", officens:"urn:oasis:names:tc:opendocument:xmlns:office:1.0", presentationns:"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0", stylens:"urn:oasis:names:tc:opendocument:xmlns:style:1.0", svgns:"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0", tablens:"urn:oasis:names:tc:opendocument:xmlns:table:1.0", +textns:"urn:oasis:names:tc:opendocument:xmlns:text:1.0", xformsns:"http://www.w3.org/2002/xforms", xlinkns:"http://www.w3.org/1999/xlink", xmlns:"http://www.w3.org/XML/1998/namespace"}; +(function() { + var map = odf.Namespaces.namespaceMap, pmap = odf.Namespaces.prefixMap, prefix; + for (prefix in map) { + if (map.hasOwnProperty(prefix)) { + pmap[map[prefix]] = prefix; + } + } +})(); +odf.Namespaces.forEachPrefix = function forEachPrefix(cb) { + var ns = odf.Namespaces.namespaceMap, prefix; + for (prefix in ns) { + if (ns.hasOwnProperty(prefix)) { + cb(prefix, ns[prefix]); + } + } +}; +odf.Namespaces.lookupNamespaceURI = function lookupNamespaceURI(prefix) { + var r = null; + if (odf.Namespaces.namespaceMap.hasOwnProperty(prefix)) { + r = odf.Namespaces.namespaceMap[prefix]; + } + return r; +}; +odf.Namespaces.lookupPrefix = function lookupPrefix(namespaceURI) { + var map = odf.Namespaces.prefixMap; + return map.hasOwnProperty(namespaceURI) ? map[namespaceURI] : null; +}; +odf.Namespaces.lookupNamespaceURI.lookupNamespaceURI = odf.Namespaces.lookupNamespaceURI; +(function() { + odf.OdfSchemaImpl = function() { + var TEXT = "text", FIELD = "field", OBJECT = "object", STYLE = "style", DEPRECATED = "deprecated", UNKNOWN = "uncategorized", containers = [["config:config-item", UNKNOWN], ["form:item", OBJECT], ["form:option", UNKNOWN], ["math:math", FIELD], ["meta:user-defined", UNKNOWN], ["number:currency-symbol", UNKNOWN], ["number:embedded-text", UNKNOWN], ["number:text", UNKNOWN], ["presentation:date-time-decl", UNKNOWN], ["presentation:footer-decl", UNKNOWN], ["presentation:header-decl", UNKNOWN], ["svg:desc", + TEXT], ["svg:title", TEXT], ["table:desc", UNKNOWN], ["table:title", UNKNOWN], ["text:a", TEXT], ["text:author-initials", FIELD], ["text:author-name", FIELD], ["text:bibliography-mark", FIELD], ["text:bookmark-ref", FIELD], ["text:chapter", FIELD], ["text:character-count", FIELD], ["text:conditional-text", FIELD], ["text:creation-date", FIELD], ["text:creation-time", FIELD], ["text:creator", FIELD], ["text:database-display", FIELD], ["text:database-name", FIELD], ["text:database-row-number", + FIELD], ["text:date", FIELD], ["text:dde-connection", FIELD], ["text:description", FIELD], ["text:editing-cycles", FIELD], ["text:editing-duration", FIELD], ["text:execute-macro", UNKNOWN], ["text:expression", UNKNOWN], ["text:file-name", FIELD], ["text:h", TEXT], ["text:hidden-paragraph", TEXT], ["text:hidden-text", TEXT], ["text:image-count", FIELD], ["text:index-entry-span", UNKNOWN], ["text:index-title-template", UNKNOWN], ["text:initial-creator", FIELD], ["text:keywords", FIELD], ["text:linenumbering-separator", + STYLE], ["text:measure", UNKNOWN], ["text:meta", UNKNOWN], ["text:meta-field", UNKNOWN], ["text:modification-date", FIELD], ["text:modification-time", FIELD], ["text:note-citation", FIELD], ["text:note-continuation-notice-backward", STYLE], ["text:note-continuation-notice-forward", STYLE], ["text:note-ref", FIELD], ["text:object-count", FIELD], ["text:p", TEXT], ["text:page-continuation", UNKNOWN], ["text:page-count", FIELD], ["text:page-number", FIELD], ["text:page-variable-get", FIELD], ["text:page-variable-set", + FIELD], ["text:paragraph-count", FIELD], ["text:placeholder", FIELD], ["text:print-date", FIELD], ["text:print-time", FIELD], ["text:printed-by", FIELD], ["text:reference-ref", FIELD], ["text:ruby-base", TEXT], ["text:ruby-text", TEXT], ["text:script", TEXT], ["text:sender-city", FIELD], ["text:sender-company", FIELD], ["text:sender-country", FIELD], ["text:sender-email", FIELD], ["text:sender-fax", FIELD], ["text:sender-firstname", FIELD], ["text:sender-initials", FIELD], ["text:sender-lastname", + FIELD], ["text:sender-phone-private", FIELD], ["text:sender-phone-work", FIELD], ["text:sender-position", FIELD], ["text:sender-postal-code", FIELD], ["text:sender-state-or-province", FIELD], ["text:sender-street", FIELD], ["text:sender-title", FIELD], ["text:sequence", UNKNOWN], ["text:sequence-ref", UNKNOWN], ["text:sheet-name", UNKNOWN], ["text:span", TEXT], ["text:subject", FIELD], ["text:table-count", FIELD], ["text:table-formula", DEPRECATED], ["text:template-name", UNKNOWN], ["text:text-input", + FIELD], ["text:time", FIELD], ["text:title", FIELD], ["text:user-defined", FIELD], ["text:user-field-get", FIELD], ["text:user-field-input", FIELD], ["text:variable-get", FIELD], ["text:variable-input", FIELD], ["text:variable-set", FIELD], ["text:word-count", FIELD], ["xforms:model", UNKNOWN]], cache = {}; + this.isTextContainer = function(namespaceURI, localName) { + return cache[namespaceURI + ":" + localName] === TEXT; + }; + this.isField = function(namespaceURI, localName) { + return cache[namespaceURI + ":" + localName] === FIELD; + }; + this.getFields = function() { + return containers.filter(function(containerInfo) { + return containerInfo[1] === FIELD; + }).map(function(containerInfo) { + return containerInfo[0]; + }); + }; + function init() { + containers.forEach(function(containerInfo) { + var name = containerInfo[0], type = containerInfo[1], nameParts = name.split(":"), prefix = nameParts[0], localName = nameParts[1], namespaceURI = odf.Namespaces.lookupNamespaceURI(prefix); + if (namespaceURI) { + cache[namespaceURI + ":" + localName] = type; + } else { + runtime.log("DEBUG: OdfSchema - unknown prefix '" + prefix + "'"); + } + }); + } + init(); + }; + odf.OdfSchema = new odf.OdfSchemaImpl; +})(); +odf.OdfUtilsImpl = function OdfUtilsImpl() { + var textns = odf.Namespaces.textns, drawns = odf.Namespaces.drawns, xlinkns = odf.Namespaces.xlinkns, domUtils = core.DomUtils, odfNodeNamespaceMap = [odf.Namespaces.dbns, odf.Namespaces.dcns, odf.Namespaces.dr3dns, odf.Namespaces.drawns, odf.Namespaces.chartns, odf.Namespaces.formns, odf.Namespaces.numberns, odf.Namespaces.officens, odf.Namespaces.presentationns, odf.Namespaces.stylens, odf.Namespaces.svgns, odf.Namespaces.tablens, odf.Namespaces.textns], odfSchema = odf.OdfSchema; + function isImage(e) { + var name = e && e.localName; + return name === "image" && e.namespaceURI === drawns; + } + this.isImage = isImage; + function isCharacterFrame(e) { + return e !== null && e.nodeType === Node.ELEMENT_NODE && e.localName === "frame" && e.namespaceURI === drawns && e.getAttributeNS(textns, "anchor-type") === "as-char"; + } + this.isCharacterFrame = isCharacterFrame; + function isAnnotation(e) { + var name = e && e.localName; + return name === "annotation" && e.namespaceURI === odf.Namespaces.officens; + } + function isAnnotationWrapper(e) { + var name = e && e.localName; + return name === "div" && e.className === "annotationWrapper"; + } + function isInlineRoot(e) { + return isAnnotation(e) || isAnnotationWrapper(e); + } + this.isInlineRoot = isInlineRoot; + this.isTextSpan = function(e) { + var name = e && e.localName; + return name === "span" && e.namespaceURI === textns; + }; + function isHyperlink(node) { + var name = node && node.localName; + return name === "a" && node.namespaceURI === textns; + } + this.isHyperlink = isHyperlink; + this.getHyperlinkTarget = function(element) { + return element.getAttributeNS(xlinkns, "href") || ""; + }; + function isParagraph(e) { + var name = e && e.localName; + return (name === "p" || name === "h") && e.namespaceURI === textns; + } + this.isParagraph = isParagraph; + function getParagraphElement(node, offset) { + if (node && offset !== undefined && !isParagraph(node) && node.childNodes.item(offset)) { + node = node.childNodes.item(offset); + } + while (node && !isParagraph(node)) { + node = node.parentNode; + } + return node; + } + this.getParagraphElement = getParagraphElement; + function getParentAnnotation(node, container) { + while (node && node !== container) { + if (node.namespaceURI === odf.Namespaces.officens && node.localName === "annotation") { + return node; + } + node = node.parentNode; + } + return null; + } + this.getParentAnnotation = getParentAnnotation; + this.isWithinAnnotation = function(node, container) { + return Boolean(getParentAnnotation(node, container)); + }; + this.getAnnotationCreator = function(annotationElement) { + var creatorElement = annotationElement.getElementsByTagNameNS(odf.Namespaces.dcns, "creator")[0]; + return creatorElement.textContent; + }; + this.isListItem = function(e) { + var name = e && e.localName; + return name === "list-item" && e.namespaceURI === textns; + }; + this.isLineBreak = function(e) { + var name = e && e.localName; + return name === "line-break" && e.namespaceURI === textns; + }; + function isODFWhitespace(text) { + return /^[ \t\r\n]+$/.test(text); + } + this.isODFWhitespace = isODFWhitespace; + function isGroupingElement(n) { + if (n === null || n.nodeType !== Node.ELEMENT_NODE) { + return false; + } + var e = n, localName = e.localName; + return odfSchema.isTextContainer(e.namespaceURI, localName) || localName === "span" && e.className === "webodf-annotationHighlight"; + } + this.isGroupingElement = isGroupingElement; + function isFieldElement(n) { + if (n === null || n.nodeType !== Node.ELEMENT_NODE) { + return false; + } + var e = n, localName = e.localName; + return odfSchema.isField(e.namespaceURI, localName); + } + this.isFieldElement = isFieldElement; + function isCharacterElement(e) { + var n = e && e.localName, ns, r = false; + if (n) { + ns = e.namespaceURI; + if (ns === textns) { + r = n === "s" || n === "tab" || n === "line-break"; + } + } + return r; + } + this.isCharacterElement = isCharacterElement; + function isAnchoredAsCharacterElement(e) { + return isCharacterElement(e) || isFieldElement(e) || isCharacterFrame(e) || isInlineRoot(e); + } + this.isAnchoredAsCharacterElement = isAnchoredAsCharacterElement; + function isSpaceElement(e) { + var n = e && e.localName, ns, r = false; + if (n) { + ns = e.namespaceURI; + if (ns === textns) { + r = n === "s"; + } + } + return r; + } + this.isSpaceElement = isSpaceElement; + function isODFNode(node) { + return odfNodeNamespaceMap.indexOf(node.namespaceURI) !== -1; + } + this.isODFNode = isODFNode; + function hasNoODFContent(node) { + var childNode; + if (isCharacterElement(node) || isFieldElement(node)) { + return false; + } + if (isGroupingElement(node.parentNode) && node.nodeType === Node.TEXT_NODE) { + return node.textContent.length === 0; + } + childNode = node.firstChild; + while (childNode) { + if (isODFNode(childNode) || !hasNoODFContent(childNode)) { + return false; + } + childNode = childNode.nextSibling; + } + return true; + } + this.hasNoODFContent = hasNoODFContent; + function firstChild(node) { + while (node.firstChild !== null && isGroupingElement(node)) { + node = node.firstChild; + } + return node; + } + this.firstChild = firstChild; + function lastChild(node) { + while (node.lastChild !== null && isGroupingElement(node)) { + node = node.lastChild; + } + return node; + } + this.lastChild = lastChild; + function previousNode(node) { + while (!isParagraph(node) && node.previousSibling === null) { + node = node.parentNode; + } + return isParagraph(node) ? null : lastChild(node.previousSibling); + } + this.previousNode = previousNode; + function nextNode(node) { + while (!isParagraph(node) && node.nextSibling === null) { + node = node.parentNode; + } + return isParagraph(node) ? null : firstChild(node.nextSibling); + } + this.nextNode = nextNode; + function scanLeftForNonSpace(node) { + var r = false, text; + while (node) { + if (node.nodeType === Node.TEXT_NODE) { + text = node; + if (text.length === 0) { + node = previousNode(text); + } else { + return !isODFWhitespace(text.data.substr(text.length - 1, 1)); + } + } else { + if (isAnchoredAsCharacterElement(node)) { + r = isSpaceElement(node) === false; + node = null; + } else { + node = previousNode(node); + } + } + } + return r; + } + this.scanLeftForNonSpace = scanLeftForNonSpace; + function lookLeftForCharacter(node) { + var text, r = 0, tl = 0; + if (node.nodeType === Node.TEXT_NODE) { + tl = node.length; + } + if (tl > 0) { + text = node.data; + if (!isODFWhitespace(text.substr(tl - 1, 1))) { + r = 1; + } else { + if (tl === 1) { + r = scanLeftForNonSpace(previousNode(node)) ? 2 : 0; + } else { + r = isODFWhitespace(text.substr(tl - 2, 1)) ? 0 : 2; + } + } + } else { + if (isAnchoredAsCharacterElement(node)) { + r = 1; + } + } + return r; + } + this.lookLeftForCharacter = lookLeftForCharacter; + function lookRightForCharacter(node) { + var r = false, l = 0; + if (node && node.nodeType === Node.TEXT_NODE) { + l = node.length; + } + if (l > 0) { + r = !isODFWhitespace(node.data.substr(0, 1)); + } else { + if (isAnchoredAsCharacterElement(node)) { + r = true; + } + } + return r; + } + this.lookRightForCharacter = lookRightForCharacter; + function scanLeftForAnyCharacter(node) { + var r = false, l; + node = node && lastChild(node); + while (node) { + if (node.nodeType === Node.TEXT_NODE) { + l = node.length; + } else { + l = 0; + } + if (l > 0 && !isODFWhitespace(node.data)) { + r = true; + break; + } + if (isAnchoredAsCharacterElement(node)) { + r = true; + break; + } + node = previousNode(node); + } + return r; + } + this.scanLeftForAnyCharacter = scanLeftForAnyCharacter; + function scanRightForAnyCharacter(node) { + var r = false, l; + node = node && firstChild(node); + while (node) { + if (node.nodeType === Node.TEXT_NODE) { + l = node.length; + } else { + l = 0; + } + if (l > 0 && !isODFWhitespace(node.data)) { + r = true; + break; + } + if (isAnchoredAsCharacterElement(node)) { + r = true; + break; + } + node = nextNode(node); + } + return r; + } + this.scanRightForAnyCharacter = scanRightForAnyCharacter; + function isTrailingWhitespace(textnode, offset) { + if (!isODFWhitespace(textnode.data.substr(offset))) { + return false; + } + return !scanRightForAnyCharacter(nextNode(textnode)); + } + this.isTrailingWhitespace = isTrailingWhitespace; + function isSignificantWhitespace(textNode, offset) { + var text = textNode.data, result; + if (!isODFWhitespace(text[offset])) { + return false; + } + if (isAnchoredAsCharacterElement(textNode.parentNode)) { + return false; + } + if (offset > 0) { + if (!isODFWhitespace(text[offset - 1])) { + result = true; + } + } else { + if (scanLeftForNonSpace(previousNode(textNode))) { + result = true; + } + } + if (result === true) { + return isTrailingWhitespace(textNode, offset) ? false : true; + } + return false; + } + this.isSignificantWhitespace = isSignificantWhitespace; + this.isDowngradableSpaceElement = function(node) { + if (isSpaceElement(node)) { + return scanLeftForNonSpace(previousNode(node)) && scanRightForAnyCharacter(nextNode(node)); + } + return false; + }; + function parseLength(length) { + var re = /(-?[0-9]*[0-9][0-9]*(\.[0-9]*)?|0+\.[0-9]*[1-9][0-9]*|\.[0-9]*[1-9][0-9]*)((cm)|(mm)|(in)|(pt)|(pc)|(px)|(%))/, m = re.exec(length); + if (!m) { + return null; + } + return {value:parseFloat(m[1]), unit:m[3]}; + } + this.parseLength = parseLength; + function parsePositiveLength(length) { + var result = parseLength(length); + if (result && (result.value <= 0 || result.unit === "%")) { + return null; + } + return result; + } + function parseNonNegativeLength(length) { + var result = parseLength(length); + if (result && (result.value < 0 || result.unit === "%")) { + return null; + } + return result; + } + this.parseNonNegativeLength = parseNonNegativeLength; + function parsePercentage(length) { + var result = parseLength(length); + if (result && result.unit !== "%") { + return null; + } + return result; + } + function parseFoFontSize(fontSize) { + return parsePositiveLength(fontSize) || parsePercentage(fontSize); + } + this.parseFoFontSize = parseFoFontSize; + function parseFoLineHeight(lineHeight) { + return parseNonNegativeLength(lineHeight) || parsePercentage(lineHeight); + } + this.parseFoLineHeight = parseFoLineHeight; + function isTextContentContainingNode(node) { + switch(node.namespaceURI) { + case odf.Namespaces.drawns: + ; + case odf.Namespaces.svgns: + ; + case odf.Namespaces.dr3dns: + return false; + case odf.Namespaces.textns: + switch(node.localName) { + case "note-body": + ; + case "ruby-text": + return false; + } + break; + case odf.Namespaces.officens: + switch(node.localName) { + case "annotation": + ; + case "binary-data": + ; + case "event-listeners": + return false; + } + break; + default: + switch(node.localName) { + case "cursor": + ; + case "editinfo": + return false; + } + break; + } + return true; + } + this.isTextContentContainingNode = isTextContentContainingNode; + function isSignificantTextContent(textNode) { + return Boolean(getParagraphElement(textNode) && (!isODFWhitespace(textNode.textContent) || isSignificantWhitespace(textNode, 0))); + } + function removePartiallyContainedNodes(range, nodes) { + while (nodes.length > 0 && !domUtils.rangeContainsNode(range, nodes[0])) { + nodes.shift(); + } + while (nodes.length > 0 && !domUtils.rangeContainsNode(range, nodes[nodes.length - 1])) { + nodes.pop(); + } + } + function getTextNodes(range, includePartial) { + var textNodes; + function nodeFilter(node) { + var result = NodeFilter.FILTER_REJECT; + if (node.nodeType === Node.TEXT_NODE) { + if (isSignificantTextContent(node)) { + result = NodeFilter.FILTER_ACCEPT; + } + } else { + if (isTextContentContainingNode(node)) { + result = NodeFilter.FILTER_SKIP; + } + } + return result; + } + textNodes = domUtils.getNodesInRange(range, nodeFilter, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT); + if (!includePartial) { + removePartiallyContainedNodes(range, textNodes); + } + return textNodes; + } + this.getTextNodes = getTextNodes; + function getTextElements(range, includePartial, includeInsignificantWhitespace) { + var elements; + function nodeFilter(node) { + var result = NodeFilter.FILTER_REJECT; + if (isCharacterElement(node.parentNode) || isFieldElement(node.parentNode) || isInlineRoot(node)) { + result = NodeFilter.FILTER_REJECT; + } else { + if (node.nodeType === Node.TEXT_NODE) { + if (includeInsignificantWhitespace || isSignificantTextContent(node)) { + result = NodeFilter.FILTER_ACCEPT; + } + } else { + if (isAnchoredAsCharacterElement(node)) { + result = NodeFilter.FILTER_ACCEPT; + } else { + if (isTextContentContainingNode(node) || isGroupingElement(node)) { + result = NodeFilter.FILTER_SKIP; + } + } + } + } + return result; + } + elements = domUtils.getNodesInRange(range, nodeFilter, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT); + if (!includePartial) { + removePartiallyContainedNodes(range, elements); + } + return elements; + } + this.getTextElements = getTextElements; + function prependParentContainers(startContainer, elements, filter) { + var container = startContainer; + while (container) { + if (filter(container)) { + if (elements[0] !== container) { + elements.unshift(container); + } + break; + } + if (isInlineRoot(container)) { + break; + } + container = container.parentNode; + } + } + this.getParagraphElements = function(range) { + var elements; + function nodeFilter(node) { + var result = NodeFilter.FILTER_REJECT; + if (isParagraph(node)) { + result = NodeFilter.FILTER_ACCEPT; + } else { + if (isTextContentContainingNode(node) || isGroupingElement(node)) { + result = NodeFilter.FILTER_SKIP; + } + } + return result; + } + elements = domUtils.getNodesInRange(range, nodeFilter, NodeFilter.SHOW_ELEMENT); + prependParentContainers(range.startContainer, elements, isParagraph); + return elements; + }; + this.getImageElements = function(range) { + var elements; + function nodeFilter(node) { + var result = NodeFilter.FILTER_SKIP; + if (isImage(node)) { + result = NodeFilter.FILTER_ACCEPT; + } + return result; + } + elements = domUtils.getNodesInRange(range, nodeFilter, NodeFilter.SHOW_ELEMENT); + prependParentContainers(range.startContainer, elements, isImage); + return elements; + }; + function getRightNode(container, offset) { + var node = container; + if (offset < node.childNodes.length - 1) { + node = node.childNodes[offset + 1]; + } else { + while (!node.nextSibling) { + node = node.parentNode; + } + node = node.nextSibling; + } + while (node.firstChild) { + node = node.firstChild; + } + return node; + } + this.getHyperlinkElements = function(range) { + var links = [], newRange = range.cloneRange(), node, textNodes; + if (range.collapsed && range.endContainer.nodeType === Node.ELEMENT_NODE) { + node = getRightNode(range.endContainer, range.endOffset); + if (node.nodeType === Node.TEXT_NODE) { + newRange.setEnd(node, 1); + } + } + textNodes = getTextElements(newRange, true, false); + textNodes.forEach(function(node) { + var parent = node.parentNode; + while (!isParagraph(parent)) { + if (isHyperlink(parent) && links.indexOf(parent) === -1) { + links.push(parent); + break; + } + parent = parent.parentNode; + } + }); + newRange.detach(); + return links; + }; + this.getNormalizedFontFamilyName = function(fontFamilyName) { + if (!/^(["'])(?:.|[\n\r])*?\1$/.test(fontFamilyName)) { + fontFamilyName = fontFamilyName.replace(/^[ \t\r\n\f]*((?:.|[\n\r])*?)[ \t\r\n\f]*$/, "$1"); + if (/[ \t\r\n\f]/.test(fontFamilyName)) { + fontFamilyName = "'" + fontFamilyName.replace(/[ \t\r\n\f]+/g, " ") + "'"; + } + } + return fontFamilyName; + }; +}; +odf.OdfUtils = new odf.OdfUtilsImpl; +gui.OdfTextBodyNodeFilter = function() { + var odfUtils = odf.OdfUtils, TEXT_NODE = Node.TEXT_NODE, FILTER_REJECT = NodeFilter.FILTER_REJECT, FILTER_ACCEPT = NodeFilter.FILTER_ACCEPT, textns = odf.Namespaces.textns; + this.acceptNode = function(node) { + if (node.nodeType === TEXT_NODE) { + if (!odfUtils.isGroupingElement(node.parentNode)) { + return FILTER_REJECT; + } + } else { + if (node.namespaceURI === textns && node.localName === "tracked-changes") { + return FILTER_REJECT; + } + } + return FILTER_ACCEPT; + }; +}; +xmldom.LSSerializerFilter = function LSSerializerFilter() { +}; +xmldom.LSSerializerFilter.prototype.acceptNode = function(node) { +}; +odf.OdfNodeFilter = function OdfNodeFilter() { + this.acceptNode = function(node) { + var result; + if (node.namespaceURI === "http://www.w3.org/1999/xhtml") { + result = NodeFilter.FILTER_SKIP; + } else { + if (node.namespaceURI && node.namespaceURI.match(/^urn:webodf:/)) { + result = NodeFilter.FILTER_REJECT; + } else { + result = NodeFilter.FILTER_ACCEPT; + } + } + return result; + }; +}; +xmldom.XPathIterator = function XPathIterator() { +}; +xmldom.XPathIterator.prototype.next = function() { +}; +xmldom.XPathIterator.prototype.reset = function() { +}; +xmldom.XPathAtom; +function createXPathSingleton() { + var createXPathPathIterator, parsePredicates; + function isSmallestPositive(a, b, c) { + return a !== -1 && (a < b || b === -1) && (a < c || c === -1); + } + function parseXPathStep(xpath, pos, end, steps) { + var location = "", predicates = [], brapos = xpath.indexOf("[", pos), slapos = xpath.indexOf("/", pos), eqpos = xpath.indexOf("=", pos); + if (isSmallestPositive(slapos, brapos, eqpos)) { + location = xpath.substring(pos, slapos); + pos = slapos + 1; + } else { + if (isSmallestPositive(brapos, slapos, eqpos)) { + location = xpath.substring(pos, brapos); + pos = parsePredicates(xpath, brapos, predicates); + } else { + if (isSmallestPositive(eqpos, slapos, brapos)) { + location = xpath.substring(pos, eqpos); + pos = eqpos; + } else { + location = xpath.substring(pos, end); + pos = end; + } + } + } + steps.push({location:location, predicates:predicates}); + return pos; + } + function parseXPath(xpath) { + var steps = [], p = 0, end = xpath.length, value; + while (p < end) { + p = parseXPathStep(xpath, p, end, steps); + if (p < end && xpath[p] === "=") { + value = xpath.substring(p + 1, end); + if (value.length > 2 && (value[0] === "'" || value[0] === '"')) { + value = value.slice(1, value.length - 1); + } else { + try { + value = parseInt(value, 10); + } catch (ignore) { + } + } + p = end; + } + } + return {steps:steps, value:value}; + } + parsePredicates = function parsePredicates(xpath, start, predicates) { + var pos = start, l = xpath.length, depth = 0; + while (pos < l) { + if (xpath[pos] === "]") { + depth -= 1; + if (depth <= 0) { + predicates.push(parseXPath(xpath.substring(start, pos))); + } + } else { + if (xpath[pos] === "[") { + if (depth <= 0) { + start = pos + 1; + } + depth += 1; + } + } + pos += 1; + } + return pos; + }; + function XPathNodeIterator() { + var node = null, done = false; + this.setNode = function setNode(n) { + node = n; + }; + this.reset = function() { + done = false; + }; + this.next = function next() { + var val = done ? null : node; + done = true; + return val; + }; + } + function AttributeIterator(it, namespace, localName) { + this.reset = function reset() { + it.reset(); + }; + this.next = function next() { + var node = it.next(); + while (node) { + if (node.nodeType === Node.ELEMENT_NODE) { + node = node.getAttributeNodeNS(namespace, localName); + } + if (node) { + return node; + } + node = it.next(); + } + return node; + }; + } + function AllChildElementIterator(it, recurse) { + var root = it.next(), node = null; + this.reset = function reset() { + it.reset(); + root = it.next(); + node = null; + }; + this.next = function next() { + while (root) { + if (node) { + if (recurse && node.firstChild) { + node = node.firstChild; + } else { + while (!node.nextSibling && node !== root) { + node = node.parentNode; + } + if (node === root) { + root = it.next(); + } else { + node = node.nextSibling; + } + } + } else { + do { + node = root.firstChild; + if (!node) { + root = it.next(); + } + } while (root && !node); + } + if (node && node.nodeType === Node.ELEMENT_NODE) { + return node; + } + } + return null; + }; + } + function ConditionIterator(it, condition) { + this.reset = function reset() { + it.reset(); + }; + this.next = function next() { + var n = it.next(); + while (n && !condition(n)) { + n = it.next(); + } + return n; + }; + } + function createNodenameFilter(it, name, namespaceResolver) { + var s = name.split(":", 2), namespace = namespaceResolver(s[0]), localName = s[1]; + return new ConditionIterator(it, function(node) { + return node.localName === localName && node.namespaceURI === namespace; + }); + } + function createPredicateFilteredIterator(it, p, namespaceResolver) { + var nit = new XPathNodeIterator, pit = createXPathPathIterator(nit, p, namespaceResolver), value = p.value; + if (value === undefined) { + return new ConditionIterator(it, function(node) { + nit.setNode(node); + pit.reset(); + return pit.next() !== null; + }); + } + return new ConditionIterator(it, function(node) { + nit.setNode(node); + pit.reset(); + var n = pit.next(); + return n ? n.nodeValue === value : false; + }); + } + function item(p, i) { + return p[i]; + } + createXPathPathIterator = function createXPathPathIterator(it, xpath, namespaceResolver) { + var i, j, step, location, s, p, ns; + for (i = 0;i < xpath.steps.length;i += 1) { + step = xpath.steps[i]; + location = step.location; + if (location === "") { + it = new AllChildElementIterator(it, false); + } else { + if (location[0] === "@") { + s = location.substr(1).split(":", 2); + ns = namespaceResolver(s[0]); + if (!ns) { + throw "No namespace associated with the prefix " + s[0]; + } + it = new AttributeIterator(it, ns, s[1]); + } else { + if (location !== ".") { + it = new AllChildElementIterator(it, false); + if (location.indexOf(":") !== -1) { + it = createNodenameFilter(it, location, namespaceResolver); + } + } + } + } + for (j = 0;j < step.predicates.length;j += 1) { + p = item(step.predicates, j); + it = createPredicateFilteredIterator(it, p, namespaceResolver); + } + } + return it; + }; + function fallback(node, xpath, namespaceResolver) { + var it = new XPathNodeIterator, i, nodelist, parsedXPath; + it.setNode(node); + parsedXPath = parseXPath(xpath); + it = createXPathPathIterator(it, parsedXPath, namespaceResolver); + nodelist = []; + i = it.next(); + while (i) { + nodelist.push(i); + i = it.next(); + } + return nodelist; + } + function getODFElementsWithXPath(node, xpath, namespaceResolver) { + var doc = node.ownerDocument, nodes, elements = [], n = null; + if (!doc || typeof doc.evaluate !== "function") { + elements = fallback(node, xpath, namespaceResolver); + } else { + nodes = doc.evaluate(xpath, node, namespaceResolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null); + n = nodes.iterateNext(); + while (n !== null) { + if (n.nodeType === Node.ELEMENT_NODE) { + elements.push(n); + } + n = nodes.iterateNext(); + } + } + return elements; + } + return {getODFElementsWithXPath:getODFElementsWithXPath}; +} +xmldom.XPath = createXPathSingleton(); +odf.StyleInfo = function StyleInfo() { + var chartns = odf.Namespaces.chartns, dbns = odf.Namespaces.dbns, dr3dns = odf.Namespaces.dr3dns, drawns = odf.Namespaces.drawns, formns = odf.Namespaces.formns, numberns = odf.Namespaces.numberns, officens = odf.Namespaces.officens, presentationns = odf.Namespaces.presentationns, stylens = odf.Namespaces.stylens, tablens = odf.Namespaces.tablens, textns = odf.Namespaces.textns, nsprefixes = {"urn:oasis:names:tc:opendocument:xmlns:chart:1.0":"chart:", "urn:oasis:names:tc:opendocument:xmlns:database:1.0":"db:", + "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0":"dr3d:", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0":"draw:", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0":"fo:", "urn:oasis:names:tc:opendocument:xmlns:form:1.0":"form:", "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0":"number:", "urn:oasis:names:tc:opendocument:xmlns:office:1.0":"office:", "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0":"presentation:", "urn:oasis:names:tc:opendocument:xmlns:style:1.0":"style:", + "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0":"svg:", "urn:oasis:names:tc:opendocument:xmlns:table:1.0":"table:", "urn:oasis:names:tc:opendocument:xmlns:text:1.0":"chart:", "http://www.w3.org/XML/1998/namespace":"xml:"}, elementstyles = {"text":[{ens:stylens, en:"tab-stop", ans:stylens, a:"leader-text-style"}, {ens:stylens, en:"drop-cap", ans:stylens, a:"style-name"}, {ens:textns, en:"notes-configuration", ans:textns, a:"citation-body-style-name"}, {ens:textns, en:"notes-configuration", + ans:textns, a:"citation-style-name"}, {ens:textns, en:"a", ans:textns, a:"style-name"}, {ens:textns, en:"alphabetical-index", ans:textns, a:"style-name"}, {ens:textns, en:"linenumbering-configuration", ans:textns, a:"style-name"}, {ens:textns, en:"list-level-style-number", ans:textns, a:"style-name"}, {ens:textns, en:"ruby-text", ans:textns, a:"style-name"}, {ens:textns, en:"span", ans:textns, a:"style-name"}, {ens:textns, en:"a", ans:textns, a:"visited-style-name"}, {ens:stylens, en:"text-properties", + ans:stylens, a:"text-line-through-text-style"}, {ens:textns, en:"alphabetical-index-source", ans:textns, a:"main-entry-style-name"}, {ens:textns, en:"index-entry-bibliography", ans:textns, a:"style-name"}, {ens:textns, en:"index-entry-chapter", ans:textns, a:"style-name"}, {ens:textns, en:"index-entry-link-end", ans:textns, a:"style-name"}, {ens:textns, en:"index-entry-link-start", ans:textns, a:"style-name"}, {ens:textns, en:"index-entry-page-number", ans:textns, a:"style-name"}, {ens:textns, + en:"index-entry-span", ans:textns, a:"style-name"}, {ens:textns, en:"index-entry-tab-stop", ans:textns, a:"style-name"}, {ens:textns, en:"index-entry-text", ans:textns, a:"style-name"}, {ens:textns, en:"index-title-template", ans:textns, a:"style-name"}, {ens:textns, en:"list-level-style-bullet", ans:textns, a:"style-name"}, {ens:textns, en:"outline-level-style", ans:textns, a:"style-name"}], "paragraph":[{ens:drawns, en:"caption", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"circle", ans:drawns, + a:"text-style-name"}, {ens:drawns, en:"connector", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"control", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"custom-shape", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"ellipse", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"frame", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"line", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"measure", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"path", ans:drawns, a:"text-style-name"}, + {ens:drawns, en:"polygon", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"polyline", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"rect", ans:drawns, a:"text-style-name"}, {ens:drawns, en:"regular-polygon", ans:drawns, a:"text-style-name"}, {ens:officens, en:"annotation", ans:drawns, a:"text-style-name"}, {ens:formns, en:"column", ans:formns, a:"text-style-name"}, {ens:stylens, en:"style", ans:stylens, a:"next-style-name"}, {ens:tablens, en:"body", ans:tablens, a:"paragraph-style-name"}, + {ens:tablens, en:"even-columns", ans:tablens, a:"paragraph-style-name"}, {ens:tablens, en:"even-rows", ans:tablens, a:"paragraph-style-name"}, {ens:tablens, en:"first-column", ans:tablens, a:"paragraph-style-name"}, {ens:tablens, en:"first-row", ans:tablens, a:"paragraph-style-name"}, {ens:tablens, en:"last-column", ans:tablens, a:"paragraph-style-name"}, {ens:tablens, en:"last-row", ans:tablens, a:"paragraph-style-name"}, {ens:tablens, en:"odd-columns", ans:tablens, a:"paragraph-style-name"}, + {ens:tablens, en:"odd-rows", ans:tablens, a:"paragraph-style-name"}, {ens:textns, en:"notes-configuration", ans:textns, a:"default-style-name"}, {ens:textns, en:"alphabetical-index-entry-template", ans:textns, a:"style-name"}, {ens:textns, en:"bibliography-entry-template", ans:textns, a:"style-name"}, {ens:textns, en:"h", ans:textns, a:"style-name"}, {ens:textns, en:"illustration-index-entry-template", ans:textns, a:"style-name"}, {ens:textns, en:"index-source-style", ans:textns, a:"style-name"}, + {ens:textns, en:"object-index-entry-template", ans:textns, a:"style-name"}, {ens:textns, en:"p", ans:textns, a:"style-name"}, {ens:textns, en:"table-index-entry-template", ans:textns, a:"style-name"}, {ens:textns, en:"table-of-content-entry-template", ans:textns, a:"style-name"}, {ens:textns, en:"table-index-entry-template", ans:textns, a:"style-name"}, {ens:textns, en:"user-index-entry-template", ans:textns, a:"style-name"}, {ens:stylens, en:"page-layout-properties", ans:stylens, a:"register-truth-ref-style-name"}], + "chart":[{ens:chartns, en:"axis", ans:chartns, a:"style-name"}, {ens:chartns, en:"chart", ans:chartns, a:"style-name"}, {ens:chartns, en:"data-label", ans:chartns, a:"style-name"}, {ens:chartns, en:"data-point", ans:chartns, a:"style-name"}, {ens:chartns, en:"equation", ans:chartns, a:"style-name"}, {ens:chartns, en:"error-indicator", ans:chartns, a:"style-name"}, {ens:chartns, en:"floor", ans:chartns, a:"style-name"}, {ens:chartns, en:"footer", ans:chartns, a:"style-name"}, {ens:chartns, en:"grid", + ans:chartns, a:"style-name"}, {ens:chartns, en:"legend", ans:chartns, a:"style-name"}, {ens:chartns, en:"mean-value", ans:chartns, a:"style-name"}, {ens:chartns, en:"plot-area", ans:chartns, a:"style-name"}, {ens:chartns, en:"regression-curve", ans:chartns, a:"style-name"}, {ens:chartns, en:"series", ans:chartns, a:"style-name"}, {ens:chartns, en:"stock-gain-marker", ans:chartns, a:"style-name"}, {ens:chartns, en:"stock-loss-marker", ans:chartns, a:"style-name"}, {ens:chartns, en:"stock-range-line", + ans:chartns, a:"style-name"}, {ens:chartns, en:"subtitle", ans:chartns, a:"style-name"}, {ens:chartns, en:"title", ans:chartns, a:"style-name"}, {ens:chartns, en:"wall", ans:chartns, a:"style-name"}], "section":[{ens:textns, en:"alphabetical-index", ans:textns, a:"style-name"}, {ens:textns, en:"bibliography", ans:textns, a:"style-name"}, {ens:textns, en:"illustration-index", ans:textns, a:"style-name"}, {ens:textns, en:"index-title", ans:textns, a:"style-name"}, {ens:textns, en:"object-index", + ans:textns, a:"style-name"}, {ens:textns, en:"section", ans:textns, a:"style-name"}, {ens:textns, en:"table-of-content", ans:textns, a:"style-name"}, {ens:textns, en:"table-index", ans:textns, a:"style-name"}, {ens:textns, en:"user-index", ans:textns, a:"style-name"}], "ruby":[{ens:textns, en:"ruby", ans:textns, a:"style-name"}], "table":[{ens:dbns, en:"query", ans:dbns, a:"style-name"}, {ens:dbns, en:"table-representation", ans:dbns, a:"style-name"}, {ens:tablens, en:"background", ans:tablens, + a:"style-name"}, {ens:tablens, en:"table", ans:tablens, a:"style-name"}], "table-column":[{ens:dbns, en:"column", ans:dbns, a:"style-name"}, {ens:tablens, en:"table-column", ans:tablens, a:"style-name"}], "table-row":[{ens:dbns, en:"query", ans:dbns, a:"default-row-style-name"}, {ens:dbns, en:"table-representation", ans:dbns, a:"default-row-style-name"}, {ens:tablens, en:"table-row", ans:tablens, a:"style-name"}], "table-cell":[{ens:dbns, en:"column", ans:dbns, a:"default-cell-style-name"}, {ens:tablens, + en:"table-column", ans:tablens, a:"default-cell-style-name"}, {ens:tablens, en:"table-row", ans:tablens, a:"default-cell-style-name"}, {ens:tablens, en:"body", ans:tablens, a:"style-name"}, {ens:tablens, en:"covered-table-cell", ans:tablens, a:"style-name"}, {ens:tablens, en:"even-columns", ans:tablens, a:"style-name"}, {ens:tablens, en:"covered-table-cell", ans:tablens, a:"style-name"}, {ens:tablens, en:"even-columns", ans:tablens, a:"style-name"}, {ens:tablens, en:"even-rows", ans:tablens, a:"style-name"}, + {ens:tablens, en:"first-column", ans:tablens, a:"style-name"}, {ens:tablens, en:"first-row", ans:tablens, a:"style-name"}, {ens:tablens, en:"last-column", ans:tablens, a:"style-name"}, {ens:tablens, en:"last-row", ans:tablens, a:"style-name"}, {ens:tablens, en:"odd-columns", ans:tablens, a:"style-name"}, {ens:tablens, en:"odd-rows", ans:tablens, a:"style-name"}, {ens:tablens, en:"table-cell", ans:tablens, a:"style-name"}], "graphic":[{ens:dr3dns, en:"cube", ans:drawns, a:"style-name"}, {ens:dr3dns, + en:"extrude", ans:drawns, a:"style-name"}, {ens:dr3dns, en:"rotate", ans:drawns, a:"style-name"}, {ens:dr3dns, en:"scene", ans:drawns, a:"style-name"}, {ens:dr3dns, en:"sphere", ans:drawns, a:"style-name"}, {ens:drawns, en:"caption", ans:drawns, a:"style-name"}, {ens:drawns, en:"circle", ans:drawns, a:"style-name"}, {ens:drawns, en:"connector", ans:drawns, a:"style-name"}, {ens:drawns, en:"control", ans:drawns, a:"style-name"}, {ens:drawns, en:"custom-shape", ans:drawns, a:"style-name"}, {ens:drawns, + en:"ellipse", ans:drawns, a:"style-name"}, {ens:drawns, en:"frame", ans:drawns, a:"style-name"}, {ens:drawns, en:"g", ans:drawns, a:"style-name"}, {ens:drawns, en:"line", ans:drawns, a:"style-name"}, {ens:drawns, en:"measure", ans:drawns, a:"style-name"}, {ens:drawns, en:"page-thumbnail", ans:drawns, a:"style-name"}, {ens:drawns, en:"path", ans:drawns, a:"style-name"}, {ens:drawns, en:"polygon", ans:drawns, a:"style-name"}, {ens:drawns, en:"polyline", ans:drawns, a:"style-name"}, {ens:drawns, en:"rect", + ans:drawns, a:"style-name"}, {ens:drawns, en:"regular-polygon", ans:drawns, a:"style-name"}, {ens:officens, en:"annotation", ans:drawns, a:"style-name"}], "presentation":[{ens:dr3dns, en:"cube", ans:presentationns, a:"style-name"}, {ens:dr3dns, en:"extrude", ans:presentationns, a:"style-name"}, {ens:dr3dns, en:"rotate", ans:presentationns, a:"style-name"}, {ens:dr3dns, en:"scene", ans:presentationns, a:"style-name"}, {ens:dr3dns, en:"sphere", ans:presentationns, a:"style-name"}, {ens:drawns, en:"caption", + ans:presentationns, a:"style-name"}, {ens:drawns, en:"circle", ans:presentationns, a:"style-name"}, {ens:drawns, en:"connector", ans:presentationns, a:"style-name"}, {ens:drawns, en:"control", ans:presentationns, a:"style-name"}, {ens:drawns, en:"custom-shape", ans:presentationns, a:"style-name"}, {ens:drawns, en:"ellipse", ans:presentationns, a:"style-name"}, {ens:drawns, en:"frame", ans:presentationns, a:"style-name"}, {ens:drawns, en:"g", ans:presentationns, a:"style-name"}, {ens:drawns, en:"line", + ans:presentationns, a:"style-name"}, {ens:drawns, en:"measure", ans:presentationns, a:"style-name"}, {ens:drawns, en:"page-thumbnail", ans:presentationns, a:"style-name"}, {ens:drawns, en:"path", ans:presentationns, a:"style-name"}, {ens:drawns, en:"polygon", ans:presentationns, a:"style-name"}, {ens:drawns, en:"polyline", ans:presentationns, a:"style-name"}, {ens:drawns, en:"rect", ans:presentationns, a:"style-name"}, {ens:drawns, en:"regular-polygon", ans:presentationns, a:"style-name"}, {ens:officens, + en:"annotation", ans:presentationns, a:"style-name"}], "drawing-page":[{ens:drawns, en:"page", ans:drawns, a:"style-name"}, {ens:presentationns, en:"notes", ans:drawns, a:"style-name"}, {ens:stylens, en:"handout-master", ans:drawns, a:"style-name"}, {ens:stylens, en:"master-page", ans:drawns, a:"style-name"}], "list-style":[{ens:textns, en:"list", ans:textns, a:"style-name"}, {ens:textns, en:"numbered-paragraph", ans:textns, a:"style-name"}, {ens:textns, en:"list-item", ans:textns, a:"style-override"}, + {ens:stylens, en:"style", ans:stylens, a:"list-style-name"}], "data":[{ens:stylens, en:"style", ans:stylens, a:"data-style-name"}, {ens:stylens, en:"style", ans:stylens, a:"percentage-data-style-name"}, {ens:presentationns, en:"date-time-decl", ans:stylens, a:"data-style-name"}, {ens:textns, en:"creation-date", ans:stylens, a:"data-style-name"}, {ens:textns, en:"creation-time", ans:stylens, a:"data-style-name"}, {ens:textns, en:"database-display", ans:stylens, a:"data-style-name"}, {ens:textns, + en:"date", ans:stylens, a:"data-style-name"}, {ens:textns, en:"editing-duration", ans:stylens, a:"data-style-name"}, {ens:textns, en:"expression", ans:stylens, a:"data-style-name"}, {ens:textns, en:"meta-field", ans:stylens, a:"data-style-name"}, {ens:textns, en:"modification-date", ans:stylens, a:"data-style-name"}, {ens:textns, en:"modification-time", ans:stylens, a:"data-style-name"}, {ens:textns, en:"print-date", ans:stylens, a:"data-style-name"}, {ens:textns, en:"print-time", ans:stylens, + a:"data-style-name"}, {ens:textns, en:"table-formula", ans:stylens, a:"data-style-name"}, {ens:textns, en:"time", ans:stylens, a:"data-style-name"}, {ens:textns, en:"user-defined", ans:stylens, a:"data-style-name"}, {ens:textns, en:"user-field-get", ans:stylens, a:"data-style-name"}, {ens:textns, en:"user-field-input", ans:stylens, a:"data-style-name"}, {ens:textns, en:"variable-get", ans:stylens, a:"data-style-name"}, {ens:textns, en:"variable-input", ans:stylens, a:"data-style-name"}, {ens:textns, + en:"variable-set", ans:stylens, a:"data-style-name"}], "page-layout":[{ens:presentationns, en:"notes", ans:stylens, a:"page-layout-name"}, {ens:stylens, en:"handout-master", ans:stylens, a:"page-layout-name"}, {ens:stylens, en:"master-page", ans:stylens, a:"page-layout-name"}]}, elements, xpath = xmldom.XPath; + function hasDerivedStyles(odfbody, nsResolver, styleElement) { + var nodes, xp, styleName = styleElement.getAttributeNS(stylens, "name"), styleFamily = styleElement.getAttributeNS(stylens, "family"); + xp = '//style:*[@style:parent-style-name="' + styleName + '"][@style:family="' + styleFamily + '"]'; + nodes = xpath.getODFElementsWithXPath(odfbody, xp, nsResolver); + if (nodes.length) { + return true; + } + return false; + } + function prefixUsedStyleNames(element, prefix) { + var i, stylename, a, e, ns, elname, elns, localName, length = 0; + elname = elements[element.localName]; + if (elname) { + elns = elname[element.namespaceURI]; + if (elns) { + length = elns.length; + } + } + for (i = 0;i < length;i += 1) { + a = elns[i]; + ns = a.ns; + localName = a.localname; + stylename = element.getAttributeNS(ns, localName); + if (stylename) { + element.setAttributeNS(ns, nsprefixes[ns] + localName, prefix + stylename); + } + } + e = element.firstElementChild; + while (e) { + prefixUsedStyleNames(e, prefix); + e = e.nextElementSibling; + } + } + function prefixStyleName(styleElement, prefix) { + var stylename = styleElement.getAttributeNS(drawns, "name"), ns; + if (stylename) { + ns = drawns; + } else { + stylename = styleElement.getAttributeNS(stylens, "name"); + if (stylename) { + ns = stylens; + } + } + if (ns) { + styleElement.setAttributeNS(ns, nsprefixes[ns] + "name", prefix + stylename); + } + } + function prefixStyleNames(styleElementsRoot, prefix, styleUsingElementsRoot) { + var s; + if (styleElementsRoot) { + s = styleElementsRoot.firstChild; + while (s) { + if (s.nodeType === Node.ELEMENT_NODE) { + prefixStyleName(s, prefix); + } + s = s.nextSibling; + } + prefixUsedStyleNames(styleElementsRoot, prefix); + if (styleUsingElementsRoot) { + prefixUsedStyleNames(styleUsingElementsRoot, prefix); + } + } + } + function removeRegExpFromUsedStyleNames(element, regExp) { + var i, stylename, e, elname, elns, a, ns, localName, length = 0; + elname = elements[element.localName]; + if (elname) { + elns = elname[element.namespaceURI]; + if (elns) { + length = elns.length; + } + } + for (i = 0;i < length;i += 1) { + a = elns[i]; + ns = a.ns; + localName = a.localname; + stylename = element.getAttributeNS(ns, localName); + if (stylename) { + stylename = stylename.replace(regExp, ""); + element.setAttributeNS(ns, nsprefixes[ns] + localName, stylename); + } + } + e = element.firstElementChild; + while (e) { + removeRegExpFromUsedStyleNames(e, regExp); + e = e.nextElementSibling; + } + } + function removeRegExpFromStyleName(styleElement, regExp) { + var stylename = styleElement.getAttributeNS(drawns, "name"), ns; + if (stylename) { + ns = drawns; + } else { + stylename = styleElement.getAttributeNS(stylens, "name"); + if (stylename) { + ns = stylens; + } + } + if (ns) { + stylename = stylename.replace(regExp, ""); + styleElement.setAttributeNS(ns, nsprefixes[ns] + "name", stylename); + } + } + function removePrefixFromStyleNames(styleElementsRoot, prefix, styleUsingElementsRoot) { + var s, regExp = new RegExp("^" + prefix); + if (styleElementsRoot) { + s = styleElementsRoot.firstChild; + while (s) { + if (s.nodeType === Node.ELEMENT_NODE) { + removeRegExpFromStyleName(s, regExp); + } + s = s.nextSibling; + } + removeRegExpFromUsedStyleNames(styleElementsRoot, regExp); + if (styleUsingElementsRoot) { + removeRegExpFromUsedStyleNames(styleUsingElementsRoot, regExp); + } + } + } + function determineStylesForNode(element, usedStyles) { + var i, stylename, elname, elns, a, ns, localName, keyname, length = 0, map; + elname = elements[element.localName]; + if (elname) { + elns = elname[element.namespaceURI]; + if (elns) { + length = elns.length; + } + } + for (i = 0;i < length;i += 1) { + a = elns[i]; + ns = a.ns; + localName = a.localname; + stylename = element.getAttributeNS(ns, localName); + if (stylename) { + usedStyles = usedStyles || {}; + keyname = a.keyname; + if (usedStyles.hasOwnProperty(keyname)) { + usedStyles[keyname][stylename] = 1; + } else { + map = {}; + map[stylename] = 1; + usedStyles[keyname] = map; + } + } + } + return usedStyles; + } + function determineUsedStyles(styleUsingElementsRoot, usedStyles) { + var i, e; + determineStylesForNode(styleUsingElementsRoot, usedStyles); + i = styleUsingElementsRoot.firstChild; + while (i) { + if (i.nodeType === Node.ELEMENT_NODE) { + e = i; + determineUsedStyles(e, usedStyles); + } + i = i.nextSibling; + } + } + function StyleDefinition(key, name, family) { + this.key = key; + this.name = name; + this.family = family; + this.requires = {}; + } + function getStyleDefinition(stylename, stylefamily, knownStyles) { + var styleKey = stylename + '"' + stylefamily, styleDefinition = knownStyles[styleKey]; + if (!styleDefinition) { + styleDefinition = knownStyles[styleKey] = new StyleDefinition(styleKey, stylename, stylefamily); + } + return styleDefinition; + } + function determineDependentStyles(element, styleScope, knownStyles) { + var i, stylename, elname, elns, a, ns, localName, e, referencedStyleFamily, referencedStyleDef, length = 0, newScopeName = element.getAttributeNS(stylens, "name"), newScopeFamily = element.getAttributeNS(stylens, "family"); + if (newScopeName && newScopeFamily) { + styleScope = getStyleDefinition(newScopeName, newScopeFamily, knownStyles); + } + if (styleScope) { + elname = elements[element.localName]; + if (elname) { + elns = elname[element.namespaceURI]; + if (elns) { + length = elns.length; + } + } + for (i = 0;i < length;i += 1) { + a = elns[i]; + ns = a.ns; + localName = a.localname; + stylename = element.getAttributeNS(ns, localName); + if (stylename) { + referencedStyleFamily = a.keyname; + referencedStyleDef = getStyleDefinition(stylename, referencedStyleFamily, knownStyles); + styleScope.requires[referencedStyleDef.key] = referencedStyleDef; + } + } + } + e = element.firstElementChild; + while (e) { + determineDependentStyles(e, styleScope, knownStyles); + e = e.nextElementSibling; + } + return knownStyles; + } + function inverse() { + var i, l, keyname, list, item, e = {}, map, array, en, ens; + for (keyname in elementstyles) { + if (elementstyles.hasOwnProperty(keyname)) { + list = elementstyles[keyname]; + l = list.length; + for (i = 0;i < l;i += 1) { + item = list[i]; + en = item.en; + ens = item.ens; + if (e.hasOwnProperty(en)) { + map = e[en]; + } else { + e[en] = map = {}; + } + if (map.hasOwnProperty(ens)) { + array = map[ens]; + } else { + map[ens] = array = []; + } + array.push({ns:item.ans, localname:item.a, keyname:keyname}); + } + } + } + return e; + } + function mergeRequiredStyles(styleDependency, usedStyles) { + var family = usedStyles[styleDependency.family]; + if (!family) { + family = usedStyles[styleDependency.family] = {}; + } + family[styleDependency.name] = 1; + Object.keys(styleDependency.requires).forEach(function(requiredStyleKey) { + mergeRequiredStyles(styleDependency.requires[requiredStyleKey], usedStyles); + }); + } + function mergeUsedAutomaticStyles(automaticStylesRoot, usedStyles) { + var automaticStyles = determineDependentStyles(automaticStylesRoot, null, {}); + Object.keys(automaticStyles).forEach(function(styleKey) { + var automaticStyleDefinition = automaticStyles[styleKey], usedFamily = usedStyles[automaticStyleDefinition.family]; + if (usedFamily && usedFamily.hasOwnProperty(automaticStyleDefinition.name)) { + mergeRequiredStyles(automaticStyleDefinition, usedStyles); + } + }); + } + function collectUsedFontFaces(usedFontFaceDeclMap, styleElement) { + var localNames = ["font-name", "font-name-asian", "font-name-complex"], e, currentElement; + function collectByAttribute(localName) { + var fontFaceName = currentElement.getAttributeNS(stylens, localName); + if (fontFaceName) { + usedFontFaceDeclMap[fontFaceName] = true; + } + } + e = styleElement && styleElement.firstElementChild; + while (e) { + currentElement = e; + localNames.forEach(collectByAttribute); + collectUsedFontFaces(usedFontFaceDeclMap, currentElement); + e = e.nextElementSibling; + } + } + this.collectUsedFontFaces = collectUsedFontFaces; + function changeFontFaceNames(styleElement, fontFaceNameChangeMap) { + var localNames = ["font-name", "font-name-asian", "font-name-complex"], e, currentElement; + function changeFontFaceNameByAttribute(localName) { + var fontFaceName = currentElement.getAttributeNS(stylens, localName); + if (fontFaceName && fontFaceNameChangeMap.hasOwnProperty(fontFaceName)) { + currentElement.setAttributeNS(stylens, "style:" + localName, fontFaceNameChangeMap[fontFaceName]); + } + } + e = styleElement && styleElement.firstElementChild; + while (e) { + currentElement = e; + localNames.forEach(changeFontFaceNameByAttribute); + changeFontFaceNames(currentElement, fontFaceNameChangeMap); + e = e.nextElementSibling; + } + } + this.changeFontFaceNames = changeFontFaceNames; + this.UsedStyleList = function(styleUsingElementsRoot, automaticStylesRoot) { + var usedStyles = {}; + this.uses = function(element) { + var localName = element.localName, name = element.getAttributeNS(drawns, "name") || element.getAttributeNS(stylens, "name"), keyName, map; + if (localName === "style") { + keyName = element.getAttributeNS(stylens, "family"); + } else { + if (element.namespaceURI === numberns) { + keyName = "data"; + } else { + keyName = localName; + } + } + map = usedStyles[keyName]; + return map ? map[name] > 0 : false; + }; + determineUsedStyles(styleUsingElementsRoot, usedStyles); + if (automaticStylesRoot) { + mergeUsedAutomaticStyles(automaticStylesRoot, usedStyles); + } + }; + function getStyleName(family, element) { + var stylename, i, map = elements[element.localName]; + if (map) { + map = map[element.namespaceURI]; + if (map) { + for (i = 0;i < map.length;i += 1) { + if (map[i].keyname === family) { + map = map[i]; + if (element.hasAttributeNS(map.ns, map.localname)) { + stylename = element.getAttributeNS(map.ns, map.localname); + break; + } + } + } + } + } + return stylename; + } + this.getStyleName = getStyleName; + this.hasDerivedStyles = hasDerivedStyles; + this.prefixStyleNames = prefixStyleNames; + this.removePrefixFromStyleNames = removePrefixFromStyleNames; + this.determineStylesForNode = determineStylesForNode; + elements = inverse(); +}; +if (typeof Object.create !== "function") { + Object["create"] = function(o) { + var F = function() { + }; + F.prototype = o; + return new F; + }; +} +xmldom.LSSerializer = function LSSerializer() { + var self = this; + function Namespaces(nsmap) { + function invertMap(map) { + var m = {}, i; + for (i in map) { + if (map.hasOwnProperty(i)) { + m[map[i]] = i; + } + } + return m; + } + var current = nsmap || {}, currentrev = invertMap(nsmap), levels = [current], levelsrev = [currentrev], level = 0; + this.push = function() { + level += 1; + current = levels[level] = Object.create(current); + currentrev = levelsrev[level] = Object.create(currentrev); + }; + this.pop = function() { + levels.pop(); + levelsrev.pop(); + level -= 1; + current = levels[level]; + currentrev = levelsrev[level]; + }; + this.getLocalNamespaceDefinitions = function() { + return currentrev; + }; + this.getQName = function(node) { + var ns = node.namespaceURI, i = 0, p; + if (!ns) { + return node.localName; + } + p = currentrev[ns]; + if (p) { + return p + ":" + node.localName; + } + do { + if (p || !node.prefix) { + p = "ns" + i; + i += 1; + } else { + p = node.prefix; + } + if (current[p] === ns) { + break; + } + if (!current[p]) { + current[p] = ns; + currentrev[ns] = p; + break; + } + p = null; + } while (p === null); + return p + ":" + node.localName; + }; + } + function escapeContent(value) { + return value.replace(/&/g, "&").replace(//g, ">").replace(/'/g, "'").replace(/"/g, """); + } + function serializeAttribute(qname, attr) { + var escapedValue = typeof attr.value === "string" ? escapeContent(attr.value) : attr.value, s = qname + '="' + escapedValue + '"'; + return s; + } + function startElement(ns, qname, element) { + var s = "", atts = element.attributes, length, i, attr, attstr = "", accept, prefix, nsmap; + s += "<" + qname; + length = atts.length; + for (i = 0;i < length;i += 1) { + attr = atts.item(i); + if (attr.namespaceURI !== "http://www.w3.org/2000/xmlns/") { + accept = self.filter ? self.filter.acceptNode(attr) : NodeFilter.FILTER_ACCEPT; + if (accept === NodeFilter.FILTER_ACCEPT) { + attstr += " " + serializeAttribute(ns.getQName(attr), attr); + } + } + } + nsmap = ns.getLocalNamespaceDefinitions(); + for (i in nsmap) { + if (nsmap.hasOwnProperty(i)) { + prefix = nsmap[i]; + if (!prefix) { + s += ' xmlns="' + i + '"'; + } else { + if (prefix !== "xmlns") { + s += " xmlns:" + nsmap[i] + '="' + i + '"'; + } + } + } + } + s += attstr + ">"; + return s; + } + function serializeNode(ns, node) { + var s = "", accept = self.filter ? self.filter.acceptNode(node) : NodeFilter.FILTER_ACCEPT, child, qname; + if (accept === NodeFilter.FILTER_ACCEPT && node.nodeType === Node.ELEMENT_NODE) { + ns.push(); + qname = ns.getQName(node); + s += startElement(ns, qname, node); + } + if (accept === NodeFilter.FILTER_ACCEPT || accept === NodeFilter.FILTER_SKIP) { + child = node.firstChild; + while (child) { + s += serializeNode(ns, child); + child = child.nextSibling; + } + if (node.nodeValue) { + s += escapeContent(node.nodeValue); + } + } + if (qname) { + s += ""; + ns.pop(); + } + return s; + } + this.filter = null; + this.writeToString = function(node, nsmap) { + if (!node) { + return ""; + } + var ns = new Namespaces(nsmap); + return serializeNode(ns, node); + }; +}; +(function() { + var styleInfo = new odf.StyleInfo, domUtils = core.DomUtils, officens = "urn:oasis:names:tc:opendocument:xmlns:office:1.0", manifestns = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", webodfns = "urn:webodf:names:scope", stylens = odf.Namespaces.stylens, nodeorder = ["meta", "settings", "scripts", "font-face-decls", "styles", "automatic-styles", "master-styles", "body"], automaticStylePrefix = Date.now() + "_webodf_", base64 = new core.Base64, documentStylesScope = "document-styles", documentContentScope = + "document-content"; + function getNodePosition(child) { + var i, l = nodeorder.length; + for (i = 0;i < l;i += 1) { + if (child.namespaceURI === officens && child.localName === nodeorder[i]) { + return i; + } + } + return -1; + } + function OdfStylesFilter(styleUsingElementsRoot, automaticStyles) { + var usedStyleList = new styleInfo.UsedStyleList(styleUsingElementsRoot, automaticStyles), odfNodeFilter = new odf.OdfNodeFilter; + this.acceptNode = function(node) { + var result = odfNodeFilter.acceptNode(node); + if (result === NodeFilter.FILTER_ACCEPT && node.parentNode === automaticStyles && node.nodeType === Node.ELEMENT_NODE) { + if (usedStyleList.uses(node)) { + result = NodeFilter.FILTER_ACCEPT; + } else { + result = NodeFilter.FILTER_REJECT; + } + } + return result; + }; + } + function OdfContentFilter(styleUsingElementsRoot, automaticStyles) { + var odfStylesFilter = new OdfStylesFilter(styleUsingElementsRoot, automaticStyles); + this.acceptNode = function(node) { + var result = odfStylesFilter.acceptNode(node); + if (result === NodeFilter.FILTER_ACCEPT && node.parentNode && node.parentNode.namespaceURI === odf.Namespaces.textns && (node.parentNode.localName === "s" || node.parentNode.localName === "tab")) { + result = NodeFilter.FILTER_REJECT; + } + return result; + }; + } + function setChild(node, child) { + if (!child) { + return; + } + var childpos = getNodePosition(child), pos, c = node.firstChild; + if (childpos === -1) { + return; + } + while (c) { + pos = getNodePosition(c); + if (pos !== -1 && pos > childpos) { + break; + } + c = c.nextSibling; + } + node.insertBefore(child, c); + } + odf.ODFElement = function ODFElement() { + }; + odf.ODFDocumentElement = function ODFDocumentElement() { + }; + odf.ODFDocumentElement.prototype = new odf.ODFElement; + odf.ODFDocumentElement.prototype.constructor = odf.ODFDocumentElement; + odf.ODFDocumentElement.prototype.automaticStyles; + odf.ODFDocumentElement.prototype.body; + odf.ODFDocumentElement.prototype.fontFaceDecls = null; + odf.ODFDocumentElement.prototype.manifest = null; + odf.ODFDocumentElement.prototype.masterStyles; + odf.ODFDocumentElement.prototype.meta; + odf.ODFDocumentElement.prototype.settings = null; + odf.ODFDocumentElement.prototype.styles; + odf.ODFDocumentElement.namespaceURI = officens; + odf.ODFDocumentElement.localName = "document"; + odf.AnnotationElement = function AnnotationElement() { + }; + odf.AnnotationElement.prototype.annotationEndElement; + odf.OdfPart = function OdfPart(name, mimetype, container, zip) { + var self = this; + this.size = 0; + this.type = null; + this.name = name; + this.container = container; + this.url = null; + this.mimetype = mimetype; + this.document = null; + this.onstatereadychange = null; + this.onchange; + this.EMPTY = 0; + this.LOADING = 1; + this.DONE = 2; + this.state = this.EMPTY; + this.data = ""; + this.load = function() { + if (zip === null) { + return; + } + this.mimetype = mimetype; + zip.loadAsDataURL(name, mimetype, function(err, url) { + if (err) { + runtime.log(err); + } + self.url = url; + if (self.onchange) { + self.onchange(self); + } + if (self.onstatereadychange) { + self.onstatereadychange(self); + } + }); + }; + }; + odf.OdfPart.prototype.load = function() { + }; + odf.OdfPart.prototype.getUrl = function() { + if (this.data) { + return "data:;base64," + base64.toBase64(this.data); + } + return null; + }; + odf.OdfContainer = function OdfContainer(urlOrType, onstatereadychange) { + var self = this, zip, partMimetypes = {}, contentElement, url = ""; + this.onstatereadychange = onstatereadychange; + this.onchange = null; + this.state = null; + this.rootElement; + function removeProcessingInstructions(element) { + var n = element.firstChild, next, e; + while (n) { + next = n.nextSibling; + if (n.nodeType === Node.ELEMENT_NODE) { + e = n; + removeProcessingInstructions(e); + } else { + if (n.nodeType === Node.PROCESSING_INSTRUCTION_NODE) { + element.removeChild(n); + } + } + n = next; + } + } + function linkAnnotationStartAndEndElements(rootElement) { + var document = rootElement.ownerDocument, annotationStarts = {}, n, name, annotationStart, nodeIterator = document.createNodeIterator(rootElement, NodeFilter.SHOW_ELEMENT, null, false); + n = nodeIterator.nextNode(); + while (n) { + if (n.namespaceURI === officens) { + if (n.localName === "annotation") { + name = n.getAttributeNS(officens, "name"); + if (name) { + if (annotationStarts.hasOwnProperty(name)) { + runtime.log("Warning: annotation name used more than once with : '" + name + "'"); + } else { + annotationStarts[name] = n; + } + } + } else { + if (n.localName === "annotation-end") { + name = n.getAttributeNS(officens, "name"); + if (name) { + if (annotationStarts.hasOwnProperty(name)) { + annotationStart = annotationStarts[name]; + if (!annotationStart.annotationEndElement) { + annotationStart.annotationEndElement = n; + } else { + runtime.log("Warning: annotation name used more than once with : '" + name + "'"); + } + } else { + runtime.log("Warning: annotation end without an annotation start, name: '" + name + "'"); + } + } else { + runtime.log("Warning: annotation end without a name found"); + } + } + } + } + n = nodeIterator.nextNode(); + } + } + function setAutomaticStylesScope(stylesRootElement, scope) { + var n = stylesRootElement && stylesRootElement.firstChild; + while (n) { + if (n.nodeType === Node.ELEMENT_NODE) { + n.setAttributeNS(webodfns, "scope", scope); + } + n = n.nextSibling; + } + } + function getEnsuredMetaElement() { + var root = self.rootElement, meta = root.meta; + if (!meta) { + root.meta = meta = document.createElementNS(officens, "meta"); + setChild(root, meta); + } + return meta; + } + function getMetadata(metadataNs, metadataLocalName) { + var node = self.rootElement.meta, textNode; + node = node && node.firstChild; + while (node && (node.namespaceURI !== metadataNs || node.localName !== metadataLocalName)) { + node = node.nextSibling; + } + node = node && node.firstChild; + while (node && node.nodeType !== Node.TEXT_NODE) { + node = node.nextSibling; + } + if (node) { + textNode = node; + return textNode.data; + } + return null; + } + this.getMetadata = getMetadata; + function unusedKey(key, map1, map2) { + var i = 0, postFixedKey; + key = key.replace(/\d+$/, ""); + postFixedKey = key; + while (map1.hasOwnProperty(postFixedKey) || map2.hasOwnProperty(postFixedKey)) { + i += 1; + postFixedKey = key + i; + } + return postFixedKey; + } + function mapByFontFaceName(fontFaceDecls) { + var fn, result = {}, fontname; + fn = fontFaceDecls.firstChild; + while (fn) { + if (fn.nodeType === Node.ELEMENT_NODE && fn.namespaceURI === stylens && fn.localName === "font-face") { + fontname = fn.getAttributeNS(stylens, "name"); + result[fontname] = fn; + } + fn = fn.nextSibling; + } + return result; + } + function mergeFontFaceDecls(targetFontFaceDeclsRootElement, sourceFontFaceDeclsRootElement) { + var e, s, fontFaceName, newFontFaceName, targetFontFaceDeclsMap, sourceFontFaceDeclsMap, fontFaceNameChangeMap = {}; + targetFontFaceDeclsMap = mapByFontFaceName(targetFontFaceDeclsRootElement); + sourceFontFaceDeclsMap = mapByFontFaceName(sourceFontFaceDeclsRootElement); + e = sourceFontFaceDeclsRootElement.firstElementChild; + while (e) { + s = e.nextElementSibling; + if (e.namespaceURI === stylens && e.localName === "font-face") { + fontFaceName = e.getAttributeNS(stylens, "name"); + if (targetFontFaceDeclsMap.hasOwnProperty(fontFaceName)) { + if (!e.isEqualNode(targetFontFaceDeclsMap[fontFaceName])) { + newFontFaceName = unusedKey(fontFaceName, targetFontFaceDeclsMap, sourceFontFaceDeclsMap); + e.setAttributeNS(stylens, "style:name", newFontFaceName); + targetFontFaceDeclsRootElement.appendChild(e); + targetFontFaceDeclsMap[newFontFaceName] = e; + delete sourceFontFaceDeclsMap[fontFaceName]; + fontFaceNameChangeMap[fontFaceName] = newFontFaceName; + } + } else { + targetFontFaceDeclsRootElement.appendChild(e); + targetFontFaceDeclsMap[fontFaceName] = e; + delete sourceFontFaceDeclsMap[fontFaceName]; + } + } + e = s; + } + return fontFaceNameChangeMap; + } + function cloneStylesInScope(stylesRootElement, scope) { + var copy = null, e, s, scopeAttrValue; + if (stylesRootElement) { + copy = stylesRootElement.cloneNode(true); + e = copy.firstElementChild; + while (e) { + s = e.nextElementSibling; + scopeAttrValue = e.getAttributeNS(webodfns, "scope"); + if (scopeAttrValue && scopeAttrValue !== scope) { + copy.removeChild(e); + } + e = s; + } + } + return copy; + } + function cloneFontFaceDeclsUsedInStyles(fontFaceDeclsRootElement, stylesRootElementList) { + var e, nextSibling, fontFaceName, copy = null, usedFontFaceDeclMap = {}; + if (fontFaceDeclsRootElement) { + stylesRootElementList.forEach(function(stylesRootElement) { + styleInfo.collectUsedFontFaces(usedFontFaceDeclMap, stylesRootElement); + }); + copy = fontFaceDeclsRootElement.cloneNode(true); + e = copy.firstElementChild; + while (e) { + nextSibling = e.nextElementSibling; + fontFaceName = e.getAttributeNS(stylens, "name"); + if (!usedFontFaceDeclMap[fontFaceName]) { + copy.removeChild(e); + } + e = nextSibling; + } + } + return copy; + } + function importRootNode(xmldoc) { + var doc = self.rootElement.ownerDocument, node; + if (xmldoc) { + removeProcessingInstructions(xmldoc.documentElement); + try { + node = doc.importNode(xmldoc.documentElement, true); + } catch (ignore) { + } + } + return node; + } + function setState(state) { + self.state = state; + if (self.onchange) { + self.onchange(self); + } + if (self.onstatereadychange) { + self.onstatereadychange(self); + } + } + function setRootElement(root) { + contentElement = null; + self.rootElement = root; + root.fontFaceDecls = domUtils.getDirectChild(root, officens, "font-face-decls"); + root.styles = domUtils.getDirectChild(root, officens, "styles"); + root.automaticStyles = domUtils.getDirectChild(root, officens, "automatic-styles"); + root.masterStyles = domUtils.getDirectChild(root, officens, "master-styles"); + root.body = domUtils.getDirectChild(root, officens, "body"); + root.meta = domUtils.getDirectChild(root, officens, "meta"); + root.settings = domUtils.getDirectChild(root, officens, "settings"); + root.scripts = domUtils.getDirectChild(root, officens, "scripts"); + linkAnnotationStartAndEndElements(root); + } + function handleFlatXml(xmldoc) { + var root = importRootNode(xmldoc); + if (!root || root.localName !== "document" || root.namespaceURI !== officens) { + setState(OdfContainer.INVALID); + return; + } + setRootElement(root); + setState(OdfContainer.DONE); + } + function handleStylesXml(xmldoc) { + var node = importRootNode(xmldoc), root = self.rootElement, n; + if (!node || node.localName !== "document-styles" || node.namespaceURI !== officens) { + setState(OdfContainer.INVALID); + return; + } + root.fontFaceDecls = domUtils.getDirectChild(node, officens, "font-face-decls"); + setChild(root, root.fontFaceDecls); + n = domUtils.getDirectChild(node, officens, "styles"); + root.styles = n || xmldoc.createElementNS(officens, "styles"); + setChild(root, root.styles); + n = domUtils.getDirectChild(node, officens, "automatic-styles"); + root.automaticStyles = n || xmldoc.createElementNS(officens, "automatic-styles"); + setAutomaticStylesScope(root.automaticStyles, documentStylesScope); + setChild(root, root.automaticStyles); + node = domUtils.getDirectChild(node, officens, "master-styles"); + root.masterStyles = node || xmldoc.createElementNS(officens, "master-styles"); + setChild(root, root.masterStyles); + styleInfo.prefixStyleNames(root.automaticStyles, automaticStylePrefix, root.masterStyles); + } + function handleContentXml(xmldoc) { + var node = importRootNode(xmldoc), root, automaticStyles, fontFaceDecls, fontFaceNameChangeMap, c; + if (!node || node.localName !== "document-content" || node.namespaceURI !== officens) { + setState(OdfContainer.INVALID); + return; + } + root = self.rootElement; + fontFaceDecls = domUtils.getDirectChild(node, officens, "font-face-decls"); + if (root.fontFaceDecls && fontFaceDecls) { + fontFaceNameChangeMap = mergeFontFaceDecls(root.fontFaceDecls, fontFaceDecls); + } else { + if (fontFaceDecls) { + root.fontFaceDecls = fontFaceDecls; + setChild(root, fontFaceDecls); + } + } + automaticStyles = domUtils.getDirectChild(node, officens, "automatic-styles"); + setAutomaticStylesScope(automaticStyles, documentContentScope); + if (fontFaceNameChangeMap) { + styleInfo.changeFontFaceNames(automaticStyles, fontFaceNameChangeMap); + } + if (root.automaticStyles && automaticStyles) { + c = automaticStyles.firstChild; + while (c) { + root.automaticStyles.appendChild(c); + c = automaticStyles.firstChild; + } + } else { + if (automaticStyles) { + root.automaticStyles = automaticStyles; + setChild(root, automaticStyles); + } + } + node = domUtils.getDirectChild(node, officens, "body"); + if (node === null) { + throw " tag is mising."; + } + root.body = node; + setChild(root, root.body); + } + function handleMetaXml(xmldoc) { + var node = importRootNode(xmldoc), root; + if (!node || node.localName !== "document-meta" || node.namespaceURI !== officens) { + return; + } + root = self.rootElement; + root.meta = domUtils.getDirectChild(node, officens, "meta"); + setChild(root, root.meta); + } + function handleSettingsXml(xmldoc) { + var node = importRootNode(xmldoc), root; + if (!node || node.localName !== "document-settings" || node.namespaceURI !== officens) { + return; + } + root = self.rootElement; + root.settings = domUtils.getDirectChild(node, officens, "settings"); + setChild(root, root.settings); + } + function handleManifestXml(xmldoc) { + var node = importRootNode(xmldoc), root, e; + if (!node || node.localName !== "manifest" || node.namespaceURI !== manifestns) { + return; + } + root = self.rootElement; + root.manifest = node; + e = root.manifest.firstElementChild; + while (e) { + if (e.localName === "file-entry" && e.namespaceURI === manifestns) { + partMimetypes[e.getAttributeNS(manifestns, "full-path")] = e.getAttributeNS(manifestns, "media-type"); + } + e = e.nextElementSibling; + } + } + function removeElements(xmldoc, localName, allowedNamespaces) { + var elements = domUtils.getElementsByTagName(xmldoc, localName), element, i; + for (i = 0;i < elements.length;i += 1) { + element = elements[i]; + if (!allowedNamespaces.hasOwnProperty(element.namespaceURI)) { + element.parentNode.removeChild(element); + } + } + } + function removeDangerousElements(xmldoc) { + removeElements(xmldoc, "script", {"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0":true, "urn:oasis:names:tc:opendocument:xmlns:office:1.0":true, "urn:oasis:names:tc:opendocument:xmlns:table:1.0":true, "urn:oasis:names:tc:opendocument:xmlns:text:1.0":true, "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0":true}); + removeElements(xmldoc, "style", {"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0":true, "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0":true, "urn:oasis:names:tc:opendocument:xmlns:style:1.0":true}); + } + function removeDangerousAttributes(element) { + var e = element.firstElementChild, as = [], i, n, a, atts = element.attributes, l = atts.length; + for (i = 0;i < l;i += 1) { + a = atts.item(i); + n = a.localName.substr(0, 2).toLowerCase(); + if (a.namespaceURI === null && n === "on") { + as.push(a); + } + } + l = as.length; + for (i = 0;i < l;i += 1) { + element.removeAttributeNode(as[i]); + } + while (e) { + removeDangerousAttributes(e); + e = e.nextElementSibling; + } + } + function loadNextComponent(remainingComponents) { + var component = remainingComponents.shift(); + if (component) { + zip.loadAsDOM(component.path, function(err, xmldoc) { + if (xmldoc) { + removeDangerousElements(xmldoc); + removeDangerousAttributes(xmldoc.documentElement); + } + component.handler(xmldoc); + if (self.state === OdfContainer.INVALID) { + if (err) { + runtime.log("ERROR: Unable to load " + component.path + " - " + err); + } else { + runtime.log("ERROR: Unable to load " + component.path); + } + return; + } + if (err) { + runtime.log("DEBUG: Unable to load " + component.path + " - " + err); + } + loadNextComponent(remainingComponents); + }); + } else { + linkAnnotationStartAndEndElements(self.rootElement); + setState(OdfContainer.DONE); + } + } + function loadComponents() { + var componentOrder = [{path:"styles.xml", handler:handleStylesXml}, {path:"content.xml", handler:handleContentXml}, {path:"meta.xml", handler:handleMetaXml}, {path:"settings.xml", handler:handleSettingsXml}, {path:"META-INF/manifest.xml", handler:handleManifestXml}]; + loadNextComponent(componentOrder); + } + function createDocumentElement(name) { + var s = ""; + function defineNamespace(prefix, ns) { + s += " xmlns:" + prefix + '="' + ns + '"'; + } + odf.Namespaces.forEachPrefix(defineNamespace); + return ''; + } + function serializeMetaXml() { + var serializer = new xmldom.LSSerializer, s = createDocumentElement("document-meta"); + serializer.filter = new odf.OdfNodeFilter; + s += serializer.writeToString(self.rootElement.meta, odf.Namespaces.namespaceMap); + s += ""; + return s; + } + function createManifestEntry(fullPath, mediaType) { + var element = document.createElementNS(manifestns, "manifest:file-entry"); + element.setAttributeNS(manifestns, "manifest:full-path", fullPath); + element.setAttributeNS(manifestns, "manifest:media-type", mediaType); + return element; + } + function serializeManifestXml() { + var header = '\n', xml = '', manifest = runtime.parseXML(xml), manifestRoot = manifest.documentElement, serializer = new xmldom.LSSerializer, fullPath; + for (fullPath in partMimetypes) { + if (partMimetypes.hasOwnProperty(fullPath)) { + manifestRoot.appendChild(createManifestEntry(fullPath, partMimetypes[fullPath])); + } + } + serializer.filter = new odf.OdfNodeFilter; + return header + serializer.writeToString(manifest, odf.Namespaces.namespaceMap); + } + function serializeSettingsXml() { + var serializer, s = ""; + if (self.rootElement.settings && self.rootElement.settings.firstElementChild) { + serializer = new xmldom.LSSerializer; + s = createDocumentElement("document-settings"); + serializer.filter = new odf.OdfNodeFilter; + s += serializer.writeToString(self.rootElement.settings, odf.Namespaces.namespaceMap); + s += ""; + } + return s; + } + function serializeStylesXml() { + var fontFaceDecls, automaticStyles, masterStyles, nsmap = odf.Namespaces.namespaceMap, serializer = new xmldom.LSSerializer, s = createDocumentElement("document-styles"); + automaticStyles = cloneStylesInScope(self.rootElement.automaticStyles, documentStylesScope); + masterStyles = self.rootElement.masterStyles.cloneNode(true); + fontFaceDecls = cloneFontFaceDeclsUsedInStyles(self.rootElement.fontFaceDecls, [masterStyles, self.rootElement.styles, automaticStyles]); + styleInfo.removePrefixFromStyleNames(automaticStyles, automaticStylePrefix, masterStyles); + serializer.filter = new OdfStylesFilter(masterStyles, automaticStyles); + s += serializer.writeToString(fontFaceDecls, nsmap); + s += serializer.writeToString(self.rootElement.styles, nsmap); + s += serializer.writeToString(automaticStyles, nsmap); + s += serializer.writeToString(masterStyles, nsmap); + s += ""; + return s; + } + function serializeContentXml() { + var fontFaceDecls, automaticStyles, nsmap = odf.Namespaces.namespaceMap, serializer = new xmldom.LSSerializer, s = createDocumentElement("document-content"); + automaticStyles = cloneStylesInScope(self.rootElement.automaticStyles, documentContentScope); + fontFaceDecls = cloneFontFaceDeclsUsedInStyles(self.rootElement.fontFaceDecls, [automaticStyles]); + serializer.filter = new OdfContentFilter(self.rootElement.body, automaticStyles); + s += serializer.writeToString(fontFaceDecls, nsmap); + s += serializer.writeToString(automaticStyles, nsmap); + s += serializer.writeToString(self.rootElement.body, nsmap); + s += ""; + return s; + } + function createElement(type) { + var original = document.createElementNS(type.namespaceURI, type.localName), method, iface = new type.Type; + for (method in iface) { + if (iface.hasOwnProperty(method)) { + original[method] = iface[method]; + } + } + return original; + } + function loadFromXML(url, callback) { + function handler(err, dom) { + if (err) { + callback(err); + } else { + if (!dom) { + callback("No DOM was loaded."); + } else { + removeDangerousElements(dom); + removeDangerousAttributes(dom.documentElement); + handleFlatXml(dom); + } + } + } + runtime.loadXML(url, handler); + } + this.setRootElement = setRootElement; + this.getContentElement = function() { + var body; + if (!contentElement) { + body = self.rootElement.body; + contentElement = domUtils.getDirectChild(body, officens, "text") || domUtils.getDirectChild(body, officens, "presentation") || domUtils.getDirectChild(body, officens, "spreadsheet"); + } + if (!contentElement) { + throw "Could not find content element in ."; + } + return contentElement; + }; + this.getDocumentType = function() { + var content = self.getContentElement(); + return content && content.localName; + }; + this.isTemplate = function() { + var docMimetype = partMimetypes["/"]; + return docMimetype.substr(-9) === "-template"; + }; + this.setIsTemplate = function(isTemplate) { + var docMimetype = partMimetypes["/"], oldIsTemplate = docMimetype.substr(-9) === "-template", data; + if (isTemplate === oldIsTemplate) { + return; + } + if (isTemplate) { + docMimetype = docMimetype + "-template"; + } else { + docMimetype = docMimetype.substr(0, docMimetype.length - 9); + } + partMimetypes["/"] = docMimetype; + data = runtime.byteArrayFromString(docMimetype, "utf8"); + zip.save("mimetype", data, false, new Date); + }; + this.getPart = function(partname) { + return new odf.OdfPart(partname, partMimetypes[partname], self, zip); + }; + this.getPartData = function(url, callback) { + zip.load(url, callback); + }; + function setMetadata(setProperties, removedPropertyNames) { + var metaElement = getEnsuredMetaElement(); + if (setProperties) { + domUtils.mapKeyValObjOntoNode(metaElement, setProperties, odf.Namespaces.lookupNamespaceURI); + } + if (removedPropertyNames) { + domUtils.removeKeyElementsFromNode(metaElement, removedPropertyNames, odf.Namespaces.lookupNamespaceURI); + } + } + this.setMetadata = setMetadata; + this.incrementEditingCycles = function() { + var currentValueString = getMetadata(odf.Namespaces.metans, "editing-cycles"), currentCycles = currentValueString ? parseInt(currentValueString, 10) : 0; + if (isNaN(currentCycles)) { + currentCycles = 0; + } + setMetadata({"meta:editing-cycles":currentCycles + 1}, null); + return currentCycles + 1; + }; + function updateMetadataForSaving() { + var generatorString, window = runtime.getWindow(); + generatorString = "WebODF/" + webodf.Version; + if (window) { + generatorString = generatorString + " " + window.navigator.userAgent; + } + setMetadata({"meta:generator":generatorString}, null); + } + function createEmptyDocument(type, isTemplate) { + var emptyzip = new core.Zip("", null), mimetype = "application/vnd.oasis.opendocument." + type + (isTemplate === true ? "-template" : ""), data = runtime.byteArrayFromString(mimetype, "utf8"), root = self.rootElement, content = document.createElementNS(officens, type); + emptyzip.save("mimetype", data, false, new Date); + function addToplevelElement(memberName, realLocalName) { + var element; + if (!realLocalName) { + realLocalName = memberName; + } + element = document.createElementNS(officens, realLocalName); + root[memberName] = element; + root.appendChild(element); + } + addToplevelElement("meta"); + addToplevelElement("settings"); + addToplevelElement("scripts"); + addToplevelElement("fontFaceDecls", "font-face-decls"); + addToplevelElement("styles"); + addToplevelElement("automaticStyles", "automatic-styles"); + addToplevelElement("masterStyles", "master-styles"); + addToplevelElement("body"); + root.body.appendChild(content); + partMimetypes["/"] = mimetype; + partMimetypes["settings.xml"] = "text/xml"; + partMimetypes["meta.xml"] = "text/xml"; + partMimetypes["styles.xml"] = "text/xml"; + partMimetypes["content.xml"] = "text/xml"; + setState(OdfContainer.DONE); + return emptyzip; + } + function fillZip() { + var data, date = new Date, settings; + settings = serializeSettingsXml(); + if (settings) { + data = runtime.byteArrayFromString(settings, "utf8"); + zip.save("settings.xml", data, true, date); + } else { + zip.remove("settings.xml"); + } + updateMetadataForSaving(); + data = runtime.byteArrayFromString(serializeMetaXml(), "utf8"); + zip.save("meta.xml", data, true, date); + data = runtime.byteArrayFromString(serializeStylesXml(), "utf8"); + zip.save("styles.xml", data, true, date); + data = runtime.byteArrayFromString(serializeContentXml(), "utf8"); + zip.save("content.xml", data, true, date); + data = runtime.byteArrayFromString(serializeManifestXml(), "utf8"); + zip.save("META-INF/manifest.xml", data, true, date); + } + function createByteArray(successCallback, errorCallback) { + fillZip(); + zip.createByteArray(successCallback, errorCallback); + } + this.createByteArray = createByteArray; + function saveAs(newurl, callback) { + fillZip(); + zip.writeAs(newurl, function(err) { + callback(err); + }); + } + this.saveAs = saveAs; + this.save = function(callback) { + saveAs(url, callback); + }; + this.getUrl = function() { + return url; + }; + this.setBlob = function(filename, mimetype, content) { + var data = base64.convertBase64ToByteArray(content), date = new Date; + zip.save(filename, data, false, date); + if (partMimetypes.hasOwnProperty(filename)) { + runtime.log(filename + " has been overwritten."); + } + partMimetypes[filename] = mimetype; + }; + this.removeBlob = function(filename) { + var foundAndRemoved = zip.remove(filename); + runtime.assert(foundAndRemoved, "file is not found: " + filename); + delete partMimetypes[filename]; + }; + this.state = OdfContainer.LOADING; + this.rootElement = createElement({Type:odf.ODFDocumentElement, namespaceURI:odf.ODFDocumentElement.namespaceURI, localName:odf.ODFDocumentElement.localName}); + if (urlOrType === odf.OdfContainer.DocumentType.TEXT) { + zip = createEmptyDocument("text"); + } else { + if (urlOrType === odf.OdfContainer.DocumentType.TEXT_TEMPLATE) { + zip = createEmptyDocument("text", true); + } else { + if (urlOrType === odf.OdfContainer.DocumentType.PRESENTATION) { + zip = createEmptyDocument("presentation"); + } else { + if (urlOrType === odf.OdfContainer.DocumentType.PRESENTATION_TEMPLATE) { + zip = createEmptyDocument("presentation", true); + } else { + if (urlOrType === odf.OdfContainer.DocumentType.SPREADSHEET) { + zip = createEmptyDocument("spreadsheet"); + } else { + if (urlOrType === odf.OdfContainer.DocumentType.SPREADSHEET_TEMPLATE) { + zip = createEmptyDocument("spreadsheet", true); + } else { + url = urlOrType; + zip = new core.Zip(url, function(err, zipobject) { + zip = zipobject; + if (err) { + loadFromXML(url, function(xmlerr) { + if (err) { + zip.error = err + "\n" + xmlerr; + setState(OdfContainer.INVALID); + } + }); + } else { + loadComponents(); + } + }); + } + } + } + } + } + } + }; + odf.OdfContainer.EMPTY = 0; + odf.OdfContainer.LOADING = 1; + odf.OdfContainer.DONE = 2; + odf.OdfContainer.INVALID = 3; + odf.OdfContainer.SAVING = 4; + odf.OdfContainer.MODIFIED = 5; + odf.OdfContainer.getContainer = function(url) { + return new odf.OdfContainer(url, null); + }; +})(); +odf.OdfContainer.DocumentType = {TEXT:1, TEXT_TEMPLATE:2, PRESENTATION:3, PRESENTATION_TEMPLATE:4, SPREADSHEET:5, SPREADSHEET_TEMPLATE:6}; +gui.AnnotatableCanvas = function AnnotatableCanvas() { +}; +gui.AnnotatableCanvas.prototype.refreshSize = function() { +}; +gui.AnnotatableCanvas.prototype.getZoomLevel = function() { +}; +gui.AnnotatableCanvas.prototype.getSizer = function() { +}; +gui.AnnotationViewManager = function AnnotationViewManager(canvas, odfFragment, annotationsPane, showAnnotationRemoveButton) { + var annotations = [], doc = odfFragment.ownerDocument, odfUtils = odf.OdfUtils, CONNECTOR_MARGIN = 30, NOTE_MARGIN = 20, window = runtime.getWindow(), htmlns = "http://www.w3.org/1999/xhtml"; + runtime.assert(Boolean(window), "Expected to be run in an environment which has a global window, like a browser."); + function wrapAnnotation(annotation) { + var annotationWrapper = doc.createElement("div"), annotationNote = doc.createElement("div"), connectorHorizontal = doc.createElement("div"), connectorAngular = doc.createElement("div"), removeButton; + annotationWrapper.className = "annotationWrapper"; + annotationWrapper.setAttribute("creator", odfUtils.getAnnotationCreator(annotation)); + annotation.parentNode.insertBefore(annotationWrapper, annotation); + annotationNote.className = "annotationNote"; + annotationNote.appendChild(annotation); + if (showAnnotationRemoveButton) { + removeButton = doc.createElement("div"); + removeButton.className = "annotationRemoveButton"; + annotationNote.appendChild(removeButton); + } + connectorHorizontal.className = "annotationConnector horizontal"; + connectorAngular.className = "annotationConnector angular"; + annotationWrapper.appendChild(annotationNote); + annotationWrapper.appendChild(connectorHorizontal); + annotationWrapper.appendChild(connectorAngular); + } + function unwrapAnnotation(annotation) { + var annotationWrapper = annotation.parentNode.parentNode; + if (annotationWrapper.localName === "div") { + annotationWrapper.parentNode.insertBefore(annotation, annotationWrapper); + annotationWrapper.parentNode.removeChild(annotationWrapper); + } + } + function isNodeWithinAnnotationHighlight(node, annotationName) { + var iteratingNode = node.parentNode; + while (!(iteratingNode.namespaceURI === odf.Namespaces.officens && iteratingNode.localName === "body")) { + if (iteratingNode.namespaceURI === htmlns && iteratingNode.className === "webodf-annotationHighlight" && iteratingNode.getAttribute("annotation") === annotationName) { + return true; + } + iteratingNode = iteratingNode.parentNode; + } + return false; + } + function highlightAnnotation(annotation) { + var annotationEnd = annotation.annotationEndElement, range = doc.createRange(), annotationName = annotation.getAttributeNS(odf.Namespaces.officens, "name"), textNodes; + if (annotationEnd) { + range.setStart(annotation, annotation.childNodes.length); + range.setEnd(annotationEnd, 0); + textNodes = odfUtils.getTextNodes(range, false); + textNodes.forEach(function(n) { + if (!isNodeWithinAnnotationHighlight(n, annotationName)) { + var container = doc.createElement("span"); + container.className = "webodf-annotationHighlight"; + container.setAttribute("annotation", annotationName); + n.parentNode.replaceChild(container, n); + container.appendChild(n); + } + }); + } + range.detach(); + } + function unhighlightAnnotation(annotation) { + var annotationName = annotation.getAttributeNS(odf.Namespaces.officens, "name"), highlightSpans = doc.querySelectorAll('span.webodf-annotationHighlight[annotation="' + annotationName + '"]'), i, container; + for (i = 0;i < highlightSpans.length;i += 1) { + container = highlightSpans.item(i); + while (container.firstChild) { + container.parentNode.insertBefore(container.firstChild, container); + } + container.parentNode.removeChild(container); + } + } + function lineDistance(point1, point2) { + var xs = 0, ys = 0; + xs = point2.x - point1.x; + xs = xs * xs; + ys = point2.y - point1.y; + ys = ys * ys; + return Math.sqrt(xs + ys); + } + function renderAnnotation(annotation) { + var annotationNote = annotation.parentNode, connectorHorizontal = annotationNote.nextElementSibling, connectorAngular = connectorHorizontal.nextElementSibling, annotationWrapper = annotationNote.parentNode, connectorAngle = 0, previousAnnotation = annotations[annotations.indexOf(annotation) - 1], previousRect, zoomLevel = canvas.getZoomLevel(); + annotationNote.style.left = (annotationsPane.getBoundingClientRect().left - annotationWrapper.getBoundingClientRect().left) / zoomLevel + "px"; + annotationNote.style.width = annotationsPane.getBoundingClientRect().width / zoomLevel + "px"; + connectorHorizontal.style.width = parseFloat(annotationNote.style.left) - CONNECTOR_MARGIN + "px"; + if (previousAnnotation) { + previousRect = previousAnnotation.parentNode.getBoundingClientRect(); + if ((annotationWrapper.getBoundingClientRect().top - previousRect.bottom) / zoomLevel <= NOTE_MARGIN) { + annotationNote.style.top = Math.abs(annotationWrapper.getBoundingClientRect().top - previousRect.bottom) / zoomLevel + NOTE_MARGIN + "px"; + } else { + annotationNote.style.top = "0px"; + } + } else { + annotationNote.style.top = "0px"; + } + connectorAngular.style.left = connectorHorizontal.getBoundingClientRect().width / zoomLevel + "px"; + connectorAngular.style.width = lineDistance({x:connectorAngular.getBoundingClientRect().left / zoomLevel, y:connectorAngular.getBoundingClientRect().top / zoomLevel}, {x:annotationNote.getBoundingClientRect().left / zoomLevel, y:annotationNote.getBoundingClientRect().top / zoomLevel}) + "px"; + connectorAngle = Math.asin((annotationNote.getBoundingClientRect().top - connectorAngular.getBoundingClientRect().top) / (zoomLevel * parseFloat(connectorAngular.style.width))); + connectorAngular.style.transform = "rotate(" + connectorAngle + "rad)"; + connectorAngular.style.MozTransform = "rotate(" + connectorAngle + "rad)"; + connectorAngular.style.WebkitTransform = "rotate(" + connectorAngle + "rad)"; + connectorAngular.style.msTransform = "rotate(" + connectorAngle + "rad)"; + } + function showAnnotationsPane(show) { + var sizer = canvas.getSizer(); + if (show) { + annotationsPane.style.display = "inline-block"; + sizer.style.paddingRight = window.getComputedStyle(annotationsPane).width; + } else { + annotationsPane.style.display = "none"; + sizer.style.paddingRight = 0; + } + canvas.refreshSize(); + } + function sortAnnotations() { + annotations.sort(function(a, b) { + if ((a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0) { + return -1; + } + return 1; + }); + } + function rerenderAnnotations() { + var i; + for (i = 0;i < annotations.length;i += 1) { + renderAnnotation(annotations[i]); + } + } + this.rerenderAnnotations = rerenderAnnotations; + function rehighlightAnnotations() { + annotations.forEach(function(annotation) { + highlightAnnotation(annotation); + }); + } + this.rehighlightAnnotations = rehighlightAnnotations; + function getMinimumHeightForAnnotationPane() { + if (annotationsPane.style.display !== "none" && annotations.length > 0) { + return (annotations[annotations.length - 1].parentNode.getBoundingClientRect().bottom - annotationsPane.getBoundingClientRect().top) / canvas.getZoomLevel() + "px"; + } + return null; + } + this.getMinimumHeightForAnnotationPane = getMinimumHeightForAnnotationPane; + function addAnnotations(annotationElements) { + if (annotationElements.length === 0) { + return; + } + showAnnotationsPane(true); + annotationElements.forEach(function(annotation) { + annotations.push(annotation); + wrapAnnotation(annotation); + if (annotation.annotationEndElement) { + highlightAnnotation(annotation); + } + }); + sortAnnotations(); + rerenderAnnotations(); + } + this.addAnnotations = addAnnotations; + function forgetAnnotation(annotation) { + var index = annotations.indexOf(annotation); + unwrapAnnotation(annotation); + unhighlightAnnotation(annotation); + if (index !== -1) { + annotations.splice(index, 1); + } + if (annotations.length === 0) { + showAnnotationsPane(false); + } + } + this.forgetAnnotation = forgetAnnotation; + function forgetAnnotations() { + while (annotations.length) { + forgetAnnotation(annotations[0]); + } + } + this.forgetAnnotations = forgetAnnotations; +}; +gui.Viewport = function Viewport() { +}; +gui.Viewport.prototype.scrollIntoView = function(clientRect, alignWithTop) { +}; +gui.SingleScrollViewport = function(scrollPane) { + var VIEW_PADDING_PX = 5; + function shrinkClientRectByMargin(clientRect, margin) { + return {left:clientRect.left + margin.left, top:clientRect.top + margin.top, right:clientRect.right - margin.right, bottom:clientRect.bottom - margin.bottom}; + } + function height(clientRect) { + return clientRect.bottom - clientRect.top; + } + function width(clientRect) { + return clientRect.right - clientRect.left; + } + this.scrollIntoView = function(clientRect, alignWithTop) { + var verticalScrollbarHeight = scrollPane.offsetHeight - scrollPane.clientHeight, horizontalScrollbarWidth = scrollPane.offsetWidth - scrollPane.clientWidth, nonNullClientRect, scrollPaneRect = scrollPane.getBoundingClientRect(), paneRect; + if (!clientRect || !scrollPaneRect) { + return; + } + nonNullClientRect = clientRect; + paneRect = shrinkClientRectByMargin(scrollPaneRect, {top:VIEW_PADDING_PX, bottom:verticalScrollbarHeight + VIEW_PADDING_PX, left:VIEW_PADDING_PX, right:horizontalScrollbarWidth + VIEW_PADDING_PX}); + if (alignWithTop || nonNullClientRect.top < paneRect.top) { + scrollPane.scrollTop -= paneRect.top - nonNullClientRect.top; + } else { + if (nonNullClientRect.top > paneRect.bottom || nonNullClientRect.bottom > paneRect.bottom) { + if (height(nonNullClientRect) <= height(paneRect)) { + scrollPane.scrollTop += nonNullClientRect.bottom - paneRect.bottom; + } else { + scrollPane.scrollTop += nonNullClientRect.top - paneRect.top; + } + } + } + if (nonNullClientRect.left < paneRect.left) { + scrollPane.scrollLeft -= paneRect.left - nonNullClientRect.left; + } else { + if (nonNullClientRect.right > paneRect.right) { + if (width(nonNullClientRect) <= width(paneRect)) { + scrollPane.scrollLeft += nonNullClientRect.right - paneRect.right; + } else { + scrollPane.scrollLeft -= paneRect.left - nonNullClientRect.left; + } + } + } + }; +}; +(function() { + var xpath = xmldom.XPath, odfUtils = odf.OdfUtils, base64 = new core.Base64; + function getEmbeddedFontDeclarations(fontFaceDecls) { + var decls = {}, fonts, i, font, name, uris, href, family; + if (!fontFaceDecls) { + return decls; + } + fonts = xpath.getODFElementsWithXPath(fontFaceDecls, "style:font-face[svg:font-face-src]", odf.Namespaces.lookupNamespaceURI); + for (i = 0;i < fonts.length;i += 1) { + font = fonts[i]; + name = font.getAttributeNS(odf.Namespaces.stylens, "name"); + family = odfUtils.getNormalizedFontFamilyName(font.getAttributeNS(odf.Namespaces.svgns, "font-family")); + uris = xpath.getODFElementsWithXPath(font, "svg:font-face-src/svg:font-face-uri", odf.Namespaces.lookupNamespaceURI); + if (uris.length > 0) { + href = uris[0].getAttributeNS(odf.Namespaces.xlinkns, "href"); + decls[name] = {href:href, family:family}; + } + } + return decls; + } + function addFontToCSS(name, font, fontdata, stylesheet) { + var cssFamily = font.family || name, rule = "@font-face { font-family: " + cssFamily + "; src: " + "url(data:application/x-font-ttf;charset=binary;base64," + base64.convertUTF8ArrayToBase64(fontdata) + ') format("truetype"); }'; + try { + stylesheet.insertRule(rule, stylesheet.cssRules.length); + } catch (e) { + runtime.log("Problem inserting rule in CSS: " + runtime.toJson(e) + "\nRule: " + rule); + } + } + function loadFontIntoCSS(embeddedFontDeclarations, odfContainer, pos, stylesheet, callback) { + var name, i = 0, n; + for (n in embeddedFontDeclarations) { + if (embeddedFontDeclarations.hasOwnProperty(n)) { + if (i === pos) { + name = n; + break; + } + i += 1; + } + } + if (!name) { + if (callback) { + callback(); + } + return; + } + odfContainer.getPartData(embeddedFontDeclarations[name].href, function(err, fontdata) { + if (err) { + runtime.log(err); + } else { + if (!fontdata) { + runtime.log("missing font data for " + embeddedFontDeclarations[name].href); + } else { + addFontToCSS(name, embeddedFontDeclarations[name], fontdata, stylesheet); + } + } + loadFontIntoCSS(embeddedFontDeclarations, odfContainer, pos + 1, stylesheet, callback); + }); + } + function loadFontsIntoCSS(embeddedFontDeclarations, odfContainer, stylesheet) { + loadFontIntoCSS(embeddedFontDeclarations, odfContainer, 0, stylesheet); + } + odf.FontLoader = function FontLoader() { + this.loadFonts = function(odfContainer, stylesheet) { + var embeddedFontDeclarations, fontFaceDecls = odfContainer.rootElement.fontFaceDecls; + while (stylesheet.cssRules.length) { + stylesheet.deleteRule(stylesheet.cssRules.length - 1); + } + if (fontFaceDecls) { + embeddedFontDeclarations = getEmbeddedFontDeclarations(fontFaceDecls); + loadFontsIntoCSS(embeddedFontDeclarations, odfContainer, stylesheet); + } + }; + }; +})(); +odf.Formatting = function Formatting() { + var odfContainer, styleInfo = new odf.StyleInfo, svgns = odf.Namespaces.svgns, stylens = odf.Namespaces.stylens, textns = odf.Namespaces.textns, numberns = odf.Namespaces.numberns, fons = odf.Namespaces.fons, odfUtils = odf.OdfUtils, domUtils = core.DomUtils, utils = new core.Utils, cssUnits = new core.CSSUnits, builtInDefaultStyleAttributesByFamily = {"paragraph":{"style:paragraph-properties":{"fo:text-align":"left"}}}, defaultPageFormatSettings = {width:"21.001cm", height:"29.7cm", margin:"2cm", + padding:"0cm"}; + function getSystemDefaultStyleAttributes(styleFamily) { + var result, builtInDefaultStyleAttributes = builtInDefaultStyleAttributesByFamily[styleFamily]; + if (builtInDefaultStyleAttributes) { + result = utils.mergeObjects({}, builtInDefaultStyleAttributes); + } else { + result = {}; + } + return result; + } + this.getSystemDefaultStyleAttributes = getSystemDefaultStyleAttributes; + this.setOdfContainer = function(odfcontainer) { + odfContainer = odfcontainer; + }; + function getFontMap() { + var fontFaceDecls = odfContainer.rootElement.fontFaceDecls, fontFaceDeclsMap = {}, node, name, family; + node = fontFaceDecls && fontFaceDecls.firstElementChild; + while (node) { + name = node.getAttributeNS(stylens, "name"); + if (name) { + family = node.getAttributeNS(svgns, "font-family"); + if (family || node.getElementsByTagNameNS(svgns, "font-face-uri").length > 0) { + fontFaceDeclsMap[name] = family; + } + } + node = node.nextElementSibling; + } + return fontFaceDeclsMap; + } + this.getFontMap = getFontMap; + this.getAvailableParagraphStyles = function() { + var node = odfContainer.rootElement.styles, p_family, p_name, p_displayName, paragraphStyles = []; + node = node && node.firstElementChild; + while (node) { + if (node.localName === "style" && node.namespaceURI === stylens) { + p_family = node.getAttributeNS(stylens, "family"); + if (p_family === "paragraph") { + p_name = node.getAttributeNS(stylens, "name"); + p_displayName = node.getAttributeNS(stylens, "display-name") || p_name; + if (p_name && p_displayName) { + paragraphStyles.push({name:p_name, displayName:p_displayName}); + } + } + } + node = node.nextElementSibling; + } + return paragraphStyles; + }; + this.isStyleUsed = function(styleElement) { + var hasDerivedStyles, isUsed, root = odfContainer.rootElement; + hasDerivedStyles = styleInfo.hasDerivedStyles(root, odf.Namespaces.lookupNamespaceURI, styleElement); + isUsed = (new styleInfo.UsedStyleList(root.styles)).uses(styleElement) || (new styleInfo.UsedStyleList(root.automaticStyles)).uses(styleElement) || (new styleInfo.UsedStyleList(root.body)).uses(styleElement); + return hasDerivedStyles || isUsed; + }; + function getDefaultStyleElement(family) { + var node = odfContainer.rootElement.styles.firstElementChild; + while (node) { + if (node.namespaceURI === stylens && node.localName === "default-style" && node.getAttributeNS(stylens, "family") === family) { + return node; + } + node = node.nextElementSibling; + } + return null; + } + this.getDefaultStyleElement = getDefaultStyleElement; + function getStyleElement(styleName, family, styleElements) { + var node, nodeStyleName, styleListElement, i; + styleElements = styleElements || [odfContainer.rootElement.automaticStyles, odfContainer.rootElement.styles]; + for (i = 0;i < styleElements.length;i += 1) { + styleListElement = styleElements[i]; + node = styleListElement.firstElementChild; + while (node) { + nodeStyleName = node.getAttributeNS(stylens, "name"); + if (node.namespaceURI === stylens && node.localName === "style" && node.getAttributeNS(stylens, "family") === family && nodeStyleName === styleName) { + return node; + } + if (family === "list-style" && node.namespaceURI === textns && node.localName === "list-style" && nodeStyleName === styleName) { + return node; + } + if (family === "data" && node.namespaceURI === numberns && nodeStyleName === styleName) { + return node; + } + node = node.nextElementSibling; + } + } + return null; + } + this.getStyleElement = getStyleElement; + function getStyleAttributes(styleNode) { + var i, a, map, ai, propertiesMap = {}, propertiesNode = styleNode.firstElementChild; + while (propertiesNode) { + if (propertiesNode.namespaceURI === stylens) { + map = propertiesMap[propertiesNode.nodeName] = {}; + a = propertiesNode.attributes; + for (i = 0;i < a.length;i += 1) { + ai = a.item(i); + map[ai.name] = ai.value; + } + } + propertiesNode = propertiesNode.nextElementSibling; + } + a = styleNode.attributes; + for (i = 0;i < a.length;i += 1) { + ai = a.item(i); + propertiesMap[ai.name] = ai.value; + } + return propertiesMap; + } + this.getStyleAttributes = getStyleAttributes; + function getInheritedStyleAttributes(styleNode, includeSystemDefault) { + var styleListElement = odfContainer.rootElement.styles, parentStyleName, propertiesMap, inheritedPropertiesMap = {}, styleFamily = styleNode.getAttributeNS(stylens, "family"), node = styleNode; + while (node) { + propertiesMap = getStyleAttributes(node); + inheritedPropertiesMap = utils.mergeObjects(propertiesMap, inheritedPropertiesMap); + parentStyleName = node.getAttributeNS(stylens, "parent-style-name"); + if (parentStyleName) { + node = getStyleElement(parentStyleName, styleFamily, [styleListElement]); + } else { + node = null; + } + } + node = getDefaultStyleElement(styleFamily); + if (node) { + propertiesMap = getStyleAttributes(node); + inheritedPropertiesMap = utils.mergeObjects(propertiesMap, inheritedPropertiesMap); + } + if (includeSystemDefault !== false) { + propertiesMap = getSystemDefaultStyleAttributes(styleFamily); + inheritedPropertiesMap = utils.mergeObjects(propertiesMap, inheritedPropertiesMap); + } + return inheritedPropertiesMap; + } + this.getInheritedStyleAttributes = getInheritedStyleAttributes; + this.getFirstCommonParentStyleNameOrSelf = function(styleName) { + var automaticStyleElementList = odfContainer.rootElement.automaticStyles, styleElementList = odfContainer.rootElement.styles, styleElement; + styleElement = getStyleElement(styleName, "paragraph", [automaticStyleElementList]); + if (styleElement) { + styleName = styleElement.getAttributeNS(stylens, "parent-style-name"); + if (!styleName) { + return null; + } + } + styleElement = getStyleElement(styleName, "paragraph", [styleElementList]); + if (!styleElement) { + return null; + } + return styleName; + }; + this.hasParagraphStyle = function(styleName) { + return Boolean(getStyleElement(styleName, "paragraph")); + }; + function buildStyleChain(node, collectedChains) { + var parent = node.nodeType === Node.TEXT_NODE ? node.parentNode : node, nodeStyles, appliedStyles = [], chainKey = "", foundContainer = false; + while (parent && !odfUtils.isInlineRoot(parent) && parent.parentNode !== odfContainer.rootElement) { + if (!foundContainer && odfUtils.isGroupingElement(parent)) { + foundContainer = true; + } + nodeStyles = styleInfo.determineStylesForNode(parent); + if (nodeStyles) { + appliedStyles.push(nodeStyles); + } + parent = parent.parentNode; + } + function chainStyles(usedStyleMap) { + Object.keys(usedStyleMap).forEach(function(styleFamily) { + Object.keys(usedStyleMap[styleFamily]).forEach(function(styleName) { + chainKey += "|" + styleFamily + ":" + styleName + "|"; + }); + }); + } + if (foundContainer) { + appliedStyles.forEach(chainStyles); + if (collectedChains) { + collectedChains[chainKey] = appliedStyles; + } + } + return foundContainer ? appliedStyles : undefined; + } + function isCommonStyleElement(styleNode) { + return styleNode.parentNode === odfContainer.rootElement.styles; + } + function calculateAppliedStyle(styleChain) { + var mergedChildStyle = {orderedStyles:[], styleProperties:{}}; + styleChain.forEach(function(elementStyleSet) { + Object.keys(elementStyleSet).forEach(function(styleFamily) { + var styleName = Object.keys(elementStyleSet[styleFamily])[0], styleSummary = {name:styleName, family:styleFamily, displayName:undefined, isCommonStyle:false}, styleElement, parentStyle; + styleElement = getStyleElement(styleName, styleFamily); + if (styleElement) { + parentStyle = getInheritedStyleAttributes(styleElement); + mergedChildStyle.styleProperties = utils.mergeObjects(parentStyle, mergedChildStyle.styleProperties); + styleSummary.displayName = styleElement.getAttributeNS(stylens, "display-name") || undefined; + styleSummary.isCommonStyle = isCommonStyleElement(styleElement); + } else { + runtime.log("No style element found for '" + styleName + "' of family '" + styleFamily + "'"); + } + mergedChildStyle.orderedStyles.push(styleSummary); + }); + }); + return mergedChildStyle; + } + function getAppliedStyles(nodes, calculatedStylesCache) { + var styleChains = {}, styles = []; + if (!calculatedStylesCache) { + calculatedStylesCache = {}; + } + nodes.forEach(function(n) { + buildStyleChain(n, styleChains); + }); + Object.keys(styleChains).forEach(function(key) { + if (!calculatedStylesCache[key]) { + calculatedStylesCache[key] = calculateAppliedStyle(styleChains[key]); + } + styles.push(calculatedStylesCache[key]); + }); + return styles; + } + this.getAppliedStyles = getAppliedStyles; + this.getAppliedStylesForElement = function(node, calculatedStylesCache) { + return getAppliedStyles([node], calculatedStylesCache)[0]; + }; + this.updateStyle = function(styleNode, properties) { + var fontName, fontFaceNode, textProperties; + domUtils.mapObjOntoNode(styleNode, properties, odf.Namespaces.lookupNamespaceURI); + textProperties = properties["style:text-properties"]; + fontName = textProperties && textProperties["style:font-name"]; + if (fontName && !getFontMap().hasOwnProperty(fontName)) { + fontFaceNode = styleNode.ownerDocument.createElementNS(stylens, "style:font-face"); + fontFaceNode.setAttributeNS(stylens, "style:name", fontName); + fontFaceNode.setAttributeNS(svgns, "svg:font-family", fontName); + odfContainer.rootElement.fontFaceDecls.appendChild(fontFaceNode); + } + }; + this.createDerivedStyleObject = function(parentStyleName, family, overrides) { + var originalStyleElement = getStyleElement(parentStyleName, family), newStyleObject; + runtime.assert(Boolean(originalStyleElement), "No style element found for '" + parentStyleName + "' of family '" + family + "'"); + if (isCommonStyleElement(originalStyleElement)) { + newStyleObject = {"style:parent-style-name":parentStyleName}; + } else { + newStyleObject = getStyleAttributes(originalStyleElement); + } + newStyleObject["style:family"] = family; + utils.mergeObjects(newStyleObject, overrides); + return newStyleObject; + }; + this.getDefaultTabStopDistance = function() { + var defaultParagraph = getDefaultStyleElement("paragraph"), paragraphProperties = defaultParagraph && defaultParagraph.firstElementChild, tabStopDistance; + while (paragraphProperties) { + if (paragraphProperties.namespaceURI === stylens && paragraphProperties.localName === "paragraph-properties") { + tabStopDistance = paragraphProperties.getAttributeNS(stylens, "tab-stop-distance"); + } + paragraphProperties = paragraphProperties.nextElementSibling; + } + if (!tabStopDistance) { + tabStopDistance = "1.25cm"; + } + return odfUtils.parseNonNegativeLength(tabStopDistance); + }; + function getMasterPageElement(pageName) { + var node = odfContainer.rootElement.masterStyles.firstElementChild; + while (node) { + if (node.namespaceURI === stylens && node.localName === "master-page" && node.getAttributeNS(stylens, "name") === pageName) { + break; + } + node = node.nextElementSibling; + } + return node; + } + this.getMasterPageElement = getMasterPageElement; + function getPageLayoutStyleElement(styleName, styleFamily) { + var masterPageName, layoutName, pageLayoutElements, node, i, styleElement = getStyleElement(styleName, styleFamily); + runtime.assert(styleFamily === "paragraph" || styleFamily === "table", "styleFamily must be either paragraph or table"); + if (styleElement) { + masterPageName = styleElement.getAttributeNS(stylens, "master-page-name"); + if (masterPageName) { + node = getMasterPageElement(masterPageName); + if (!node) { + runtime.log("WARN: No master page definition found for " + masterPageName); + } + } + if (!node) { + node = getMasterPageElement("Standard"); + } + if (!node) { + node = odfContainer.rootElement.masterStyles.getElementsByTagNameNS(stylens, "master-page")[0]; + if (!node) { + runtime.log("WARN: Document has no master pages defined"); + } + } + if (node) { + layoutName = node.getAttributeNS(stylens, "page-layout-name"); + pageLayoutElements = odfContainer.rootElement.automaticStyles.getElementsByTagNameNS(stylens, "page-layout"); + for (i = 0;i < pageLayoutElements.length;i += 1) { + node = pageLayoutElements.item(i); + if (node.getAttributeNS(stylens, "name") === layoutName) { + return node; + } + } + } + } + return null; + } + function lengthInPx(length, defaultValue) { + var measure; + if (length) { + measure = cssUnits.convertMeasure(length, "px"); + } + if (measure === undefined && defaultValue) { + measure = cssUnits.convertMeasure(defaultValue, "px"); + } + return measure; + } + this.getContentSize = function(styleName, styleFamily) { + var pageLayoutElement, props, defaultOrientedPageWidth, defaultOrientedPageHeight, pageWidth, pageHeight, margin, marginLeft, marginRight, marginTop, marginBottom, padding, paddingLeft, paddingRight, paddingTop, paddingBottom; + pageLayoutElement = getPageLayoutStyleElement(styleName, styleFamily); + if (!pageLayoutElement) { + pageLayoutElement = domUtils.getDirectChild(odfContainer.rootElement.styles, stylens, "default-page-layout"); + } + props = domUtils.getDirectChild(pageLayoutElement, stylens, "page-layout-properties"); + if (props) { + if (props.getAttributeNS(stylens, "print-orientation") === "landscape") { + defaultOrientedPageWidth = defaultPageFormatSettings.height; + defaultOrientedPageHeight = defaultPageFormatSettings.width; + } else { + defaultOrientedPageWidth = defaultPageFormatSettings.width; + defaultOrientedPageHeight = defaultPageFormatSettings.height; + } + pageWidth = lengthInPx(props.getAttributeNS(fons, "page-width"), defaultOrientedPageWidth); + pageHeight = lengthInPx(props.getAttributeNS(fons, "page-height"), defaultOrientedPageHeight); + margin = lengthInPx(props.getAttributeNS(fons, "margin")); + if (margin === undefined) { + marginLeft = lengthInPx(props.getAttributeNS(fons, "margin-left"), defaultPageFormatSettings.margin); + marginRight = lengthInPx(props.getAttributeNS(fons, "margin-right"), defaultPageFormatSettings.margin); + marginTop = lengthInPx(props.getAttributeNS(fons, "margin-top"), defaultPageFormatSettings.margin); + marginBottom = lengthInPx(props.getAttributeNS(fons, "margin-bottom"), defaultPageFormatSettings.margin); + } else { + marginLeft = marginRight = marginTop = marginBottom = margin; + } + padding = lengthInPx(props.getAttributeNS(fons, "padding")); + if (padding === undefined) { + paddingLeft = lengthInPx(props.getAttributeNS(fons, "padding-left"), defaultPageFormatSettings.padding); + paddingRight = lengthInPx(props.getAttributeNS(fons, "padding-right"), defaultPageFormatSettings.padding); + paddingTop = lengthInPx(props.getAttributeNS(fons, "padding-top"), defaultPageFormatSettings.padding); + paddingBottom = lengthInPx(props.getAttributeNS(fons, "padding-bottom"), defaultPageFormatSettings.padding); + } else { + paddingLeft = paddingRight = paddingTop = paddingBottom = padding; + } + } else { + pageWidth = lengthInPx(defaultPageFormatSettings.width); + pageHeight = lengthInPx(defaultPageFormatSettings.height); + margin = lengthInPx(defaultPageFormatSettings.margin); + marginLeft = marginRight = marginTop = marginBottom = margin; + padding = lengthInPx(defaultPageFormatSettings.padding); + paddingLeft = paddingRight = paddingTop = paddingBottom = padding; + } + return {width:pageWidth - marginLeft - marginRight - paddingLeft - paddingRight, height:pageHeight - marginTop - marginBottom - paddingTop - paddingBottom}; + }; +}; +odf.Formatting.StyleMetadata; +odf.Formatting.StyleData; +odf.Formatting.AppliedStyle; +(function() { + var stylens = odf.Namespaces.stylens, textns = odf.Namespaces.textns, familyNamespacePrefixes = {"graphic":"draw", "drawing-page":"draw", "paragraph":"text", "presentation":"presentation", "ruby":"text", "section":"text", "table":"table", "table-cell":"table", "table-column":"table", "table-row":"table", "text":"text", "list":"text", "page":"office"}; + odf.StyleTreeNode = function StyleTreeNode(element) { + this.derivedStyles = {}; + this.element = element; + }; + odf.StyleTree = function StyleTree(styles, autoStyles) { + var tree = {}; + function getStyleMap(stylesNode) { + var node, name, family, style, styleMap = {}; + if (!stylesNode) { + return styleMap; + } + node = stylesNode.firstElementChild; + while (node) { + if (node.namespaceURI === stylens && (node.localName === "style" || node.localName === "default-style")) { + family = node.getAttributeNS(stylens, "family"); + } else { + if (node.namespaceURI === textns && node.localName === "list-style") { + family = "list"; + } else { + if (node.namespaceURI === stylens && (node.localName === "page-layout" || node.localName === "default-page-layout")) { + family = "page"; + } else { + family = undefined; + } + } + } + if (family) { + name = node.getAttributeNS(stylens, "name"); + if (!name) { + name = ""; + } + if (styleMap.hasOwnProperty(family)) { + style = styleMap[family]; + } else { + styleMap[family] = style = {}; + } + style[name] = node; + } + node = node.nextElementSibling; + } + return styleMap; + } + function findStyleTreeNode(stylesTree, name) { + if (stylesTree.hasOwnProperty(name)) { + return stylesTree[name]; + } + var style = null, styleNames = Object.keys(stylesTree), i; + for (i = 0;i < styleNames.length;i += 1) { + style = findStyleTreeNode(stylesTree[styleNames[i]].derivedStyles, name); + if (style) { + break; + } + } + return style; + } + function createStyleTreeNode(styleName, stylesMap, stylesTree) { + var style, parentname, parentstyle; + if (!stylesMap.hasOwnProperty(styleName)) { + return null; + } + style = new odf.StyleTreeNode(stylesMap[styleName]); + parentname = style.element.getAttributeNS(stylens, "parent-style-name"); + parentstyle = null; + if (parentname) { + parentstyle = findStyleTreeNode(stylesTree, parentname) || createStyleTreeNode(parentname, stylesMap, stylesTree); + } + if (parentstyle) { + parentstyle.derivedStyles[styleName] = style; + } else { + stylesTree[styleName] = style; + } + delete stylesMap[styleName]; + return style; + } + function addStyleMapToStyleTree(stylesMap, stylesTree) { + if (stylesMap) { + Object.keys(stylesMap).forEach(function(styleName) { + createStyleTreeNode(styleName, stylesMap, stylesTree); + }); + } + } + this.getStyleTree = function() { + return tree; + }; + function init() { + var subTree, styleNodes, autoStyleNodes; + styleNodes = getStyleMap(styles); + autoStyleNodes = getStyleMap(autoStyles); + Object.keys(familyNamespacePrefixes).forEach(function(family) { + subTree = tree[family] = {}; + addStyleMapToStyleTree(styleNodes[family], subTree); + addStyleMapToStyleTree(autoStyleNodes[family], subTree); + }); + } + init(); + }; +})(); +odf.StyleTree.Tree; +(function() { + var fons = odf.Namespaces.fons, stylens = odf.Namespaces.stylens, textns = odf.Namespaces.textns, xmlns = odf.Namespaces.xmlns, helperns = "urn:webodf:names:helper", listCounterIdSuffix = "webodf-listLevel", stylemap = {1:"decimal", "a":"lower-latin", "A":"upper-latin", "i":"lower-roman", "I":"upper-roman"}; + function appendRule(styleSheet, rule) { + try { + styleSheet.insertRule(rule, styleSheet.cssRules.length); + } catch (e) { + runtime.log("cannot load rule: " + rule + " - " + e); + } + } + function ParseState(contentRules, continuedCounterIdStack) { + this.listCounterCount = 0; + this.contentRules = contentRules; + this.counterIdStack = []; + this.continuedCounterIdStack = continuedCounterIdStack; + } + function UniqueListCounter(styleSheet) { + var customListIdIndex = 0, globalCounterResetRule = "", counterIdStacks = {}; + function getCounterIdStack(list) { + var counterId, stack = []; + if (list) { + counterId = list.getAttributeNS(helperns, "counter-id"); + stack = counterIdStacks[counterId].slice(0); + } + return stack; + } + function createCssRulesForList(topLevelListId, listElement, listLevel, parseState) { + var newListSelectorId, newListCounterId, newRule, contentRule, i; + parseState.listCounterCount += 1; + newListSelectorId = topLevelListId + "-level" + listLevel + "-" + parseState.listCounterCount; + listElement.setAttributeNS(helperns, "counter-id", newListSelectorId); + newListCounterId = parseState.continuedCounterIdStack.shift(); + if (!newListCounterId) { + newListCounterId = newListSelectorId; + globalCounterResetRule += newListSelectorId + " 1 "; + newRule = 'text|list[webodfhelper|counter-id="' + newListSelectorId + '"]'; + newRule += " > text|list-item:first-child > :not(text|list):first-child:before"; + newRule += "{"; + newRule += "counter-increment: " + newListCounterId + " 0;"; + newRule += "}"; + appendRule(styleSheet, newRule); + } + while (parseState.counterIdStack.length >= listLevel) { + parseState.counterIdStack.pop(); + } + parseState.counterIdStack.push(newListCounterId); + contentRule = parseState.contentRules[listLevel.toString()] || ""; + for (i = 1;i <= listLevel;i += 1) { + contentRule = contentRule.replace(i + listCounterIdSuffix, parseState.counterIdStack[i - 1]); + } + newRule = 'text|list[webodfhelper|counter-id="' + newListSelectorId + '"]'; + newRule += " > text|list-item > :not(text|list):first-child:before"; + newRule += "{"; + newRule += contentRule; + newRule += "counter-increment: " + newListCounterId + ";"; + newRule += "}"; + appendRule(styleSheet, newRule); + } + function iterateOverChildListElements(topLevelListId, element, listLevel, parseState) { + var isListElement = element.namespaceURI === textns && element.localName === "list", isListItemElement = element.namespaceURI === textns && element.localName === "list-item", childElement; + if (!isListElement && !isListItemElement) { + parseState.continuedCounterIdStack = []; + return; + } + if (isListElement) { + listLevel += 1; + createCssRulesForList(topLevelListId, element, listLevel, parseState); + } + childElement = element.firstElementChild; + while (childElement) { + iterateOverChildListElements(topLevelListId, childElement, listLevel, parseState); + childElement = childElement.nextElementSibling; + } + } + this.createCounterRules = function(contentRules, list, continuedList) { + var listId = list.getAttributeNS(xmlns, "id"), currentParseState = new ParseState(contentRules, getCounterIdStack(continuedList)); + if (!listId) { + customListIdIndex += 1; + listId = "X" + customListIdIndex; + } else { + listId = "Y" + listId; + } + iterateOverChildListElements(listId, list, 0, currentParseState); + counterIdStacks[listId + "-level1-1"] = currentParseState.counterIdStack; + }; + this.initialiseCreatedCounters = function() { + var newRule; + newRule = "office|document"; + newRule += "{"; + newRule += "counter-reset: " + globalCounterResetRule + ";"; + newRule += "}"; + appendRule(styleSheet, newRule); + }; + } + odf.ListStyleToCss = function ListStyleToCss() { + var cssUnits = new core.CSSUnits, odfUtils = odf.OdfUtils; + function convertToPxValue(value) { + var parsedLength = odfUtils.parseLength(value); + if (!parsedLength) { + runtime.log("Could not parse value '" + value + "'."); + return 0; + } + return cssUnits.convert(parsedLength.value, parsedLength.unit, "px"); + } + function escapeCSSString(value) { + return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"'); + } + function isMatchingListStyle(list, matchingStyleName) { + var styleName; + if (list) { + styleName = list.getAttributeNS(textns, "style-name"); + } + return styleName === matchingStyleName; + } + function getNumberRule(node) { + var style = node.getAttributeNS(stylens, "num-format"), suffix = node.getAttributeNS(stylens, "num-suffix") || "", prefix = node.getAttributeNS(stylens, "num-prefix") || "", content = "", textLevel = node.getAttributeNS(textns, "level"), displayLevels = node.getAttributeNS(textns, "display-levels"); + if (prefix) { + content += '"' + escapeCSSString(prefix) + '"\n'; + } + if (stylemap.hasOwnProperty(style)) { + textLevel = textLevel ? parseInt(textLevel, 10) : 1; + displayLevels = displayLevels ? parseInt(displayLevels, 10) : 1; + while (displayLevels > 0) { + content += " counter(" + (textLevel - displayLevels + 1) + listCounterIdSuffix + "," + stylemap[style] + ")"; + if (displayLevels > 1) { + content += '"."'; + } + displayLevels -= 1; + } + } else { + if (style) { + content += ' "' + style + '"'; + } else { + content += ' ""'; + } + } + return "content:" + content + ' "' + escapeCSSString(suffix) + '"'; + } + function getImageRule() { + return "content: none"; + } + function getBulletRule(node) { + var bulletChar = node.getAttributeNS(textns, "bullet-char"); + return 'content: "' + escapeCSSString(bulletChar) + '"'; + } + function getContentRule(node) { + var contentRule = "", listLevelProps, listLevelPositionSpaceMode, listLevelLabelAlign, followedBy; + if (node.localName === "list-level-style-number") { + contentRule = getNumberRule(node); + } else { + if (node.localName === "list-level-style-image") { + contentRule = getImageRule(); + } else { + if (node.localName === "list-level-style-bullet") { + contentRule = getBulletRule(node); + } + } + } + listLevelProps = node.getElementsByTagNameNS(stylens, "list-level-properties")[0]; + if (listLevelProps) { + listLevelPositionSpaceMode = listLevelProps.getAttributeNS(textns, "list-level-position-and-space-mode"); + if (listLevelPositionSpaceMode === "label-alignment") { + listLevelLabelAlign = listLevelProps.getElementsByTagNameNS(stylens, "list-level-label-alignment")[0]; + if (listLevelLabelAlign) { + followedBy = listLevelLabelAlign.getAttributeNS(textns, "label-followed-by"); + } + if (followedBy === "space") { + contentRule += ' "\\a0"'; + } + } + } + return "\n" + contentRule + ";\n"; + } + function getAllContentRules(listStyleNode) { + var childNode = listStyleNode.firstElementChild, level, rules = {}; + while (childNode) { + level = childNode.getAttributeNS(textns, "level"); + level = level && parseInt(level, 10); + rules[level] = getContentRule(childNode); + childNode = childNode.nextElementSibling; + } + return rules; + } + function addListStyleRule(styleSheet, name, node) { + var selector = 'text|list[text|style-name="' + name + '"]', level = node.getAttributeNS(textns, "level"), selectorLevel, listItemRule, listLevelProps, listLevelPositionSpaceMode, listLevelLabelAlign, listIndent, textAlign, bulletWidth, labelDistance, bulletIndent, followedBy, leftOffset; + listLevelProps = node.getElementsByTagNameNS(stylens, "list-level-properties")[0]; + listLevelPositionSpaceMode = listLevelProps && listLevelProps.getAttributeNS(textns, "list-level-position-and-space-mode"); + listLevelLabelAlign = listLevelProps && listLevelProps.getElementsByTagNameNS(stylens, "list-level-label-alignment")[0]; + level = level && parseInt(level, 10); + selectorLevel = level; + while (selectorLevel > 1) { + selector += " > text|list-item > text|list"; + selectorLevel -= 1; + } + textAlign = listLevelProps && listLevelProps.getAttributeNS(fons, "text-align") || "left"; + switch(textAlign) { + case "end": + textAlign = "right"; + break; + case "start": + textAlign = "left"; + break; + } + if (listLevelPositionSpaceMode === "label-alignment") { + listIndent = listLevelLabelAlign && listLevelLabelAlign.getAttributeNS(fons, "margin-left") || "0px"; + bulletIndent = listLevelLabelAlign && listLevelLabelAlign.getAttributeNS(fons, "text-indent") || "0px"; + followedBy = listLevelLabelAlign && listLevelLabelAlign.getAttributeNS(textns, "label-followed-by"); + leftOffset = convertToPxValue(listIndent); + } else { + listIndent = listLevelProps && listLevelProps.getAttributeNS(textns, "space-before") || "0px"; + bulletWidth = listLevelProps && listLevelProps.getAttributeNS(textns, "min-label-width") || "0px"; + labelDistance = listLevelProps && listLevelProps.getAttributeNS(textns, "min-label-distance") || "0px"; + leftOffset = convertToPxValue(listIndent) + convertToPxValue(bulletWidth); + } + listItemRule = selector + " > text|list-item"; + listItemRule += "{"; + listItemRule += "margin-left: " + leftOffset + "px;"; + listItemRule += "}"; + appendRule(styleSheet, listItemRule); + listItemRule = selector + " > text|list-item > text|list"; + listItemRule += "{"; + listItemRule += "margin-left: " + -leftOffset + "px;"; + listItemRule += "}"; + appendRule(styleSheet, listItemRule); + listItemRule = selector + " > text|list-item > :not(text|list):first-child:before"; + listItemRule += "{"; + listItemRule += "text-align: " + textAlign + ";"; + listItemRule += "display: inline-block;"; + if (listLevelPositionSpaceMode === "label-alignment") { + listItemRule += "margin-left: " + bulletIndent + ";"; + if (followedBy === "listtab") { + listItemRule += "padding-right: 0.2cm;"; + } + } else { + listItemRule += "min-width: " + bulletWidth + ";"; + listItemRule += "margin-left: " + (parseFloat(bulletWidth) === 0 ? "" : "-") + bulletWidth + ";"; + listItemRule += "padding-right: " + labelDistance + ";"; + } + listItemRule += "}"; + appendRule(styleSheet, listItemRule); + } + function addRule(styleSheet, name, node) { + var n = node.firstElementChild; + while (n) { + if (n.namespaceURI === textns) { + addListStyleRule(styleSheet, name, n); + } + n = n.nextElementSibling; + } + } + function applyContentBasedStyles(styleSheet, odfBody, listStyles) { + var lists = odfBody.getElementsByTagNameNS(textns, "list"), listCounter = new UniqueListCounter(styleSheet), list, previousList, continueNumbering, continueListXmlId, xmlId, styleName, contentRules, listsWithXmlId = {}, i; + for (i = 0;i < lists.length;i += 1) { + list = lists.item(i); + styleName = list.getAttributeNS(textns, "style-name"); + if (styleName) { + continueNumbering = list.getAttributeNS(textns, "continue-numbering"); + continueListXmlId = list.getAttributeNS(textns, "continue-list"); + xmlId = list.getAttributeNS(xmlns, "id"); + if (xmlId) { + listsWithXmlId[xmlId] = list; + } + contentRules = getAllContentRules(listStyles[styleName].element); + if (continueNumbering && !continueListXmlId && isMatchingListStyle(previousList, styleName)) { + listCounter.createCounterRules(contentRules, list, previousList); + } else { + if (continueListXmlId && isMatchingListStyle(listsWithXmlId[continueListXmlId], styleName)) { + listCounter.createCounterRules(contentRules, list, listsWithXmlId[continueListXmlId]); + } else { + listCounter.createCounterRules(contentRules, list); + } + } + previousList = list; + } + } + listCounter.initialiseCreatedCounters(); + } + this.applyListStyles = function(styleSheet, styleTree, odfBody) { + var styleFamilyTree, node; + styleFamilyTree = styleTree["list"]; + if (styleFamilyTree) { + Object.keys(styleFamilyTree).forEach(function(styleName) { + node = styleFamilyTree[styleName]; + addRule(styleSheet, styleName, node.element); + }); + } + applyContentBasedStyles(styleSheet, odfBody, styleFamilyTree); + }; + }; +})(); +odf.LazyStyleProperties = function(parent, getters) { + var data = {}; + this.value = function(name) { + var v; + if (data.hasOwnProperty(name)) { + v = data[name]; + } else { + v = getters[name](); + if (v === undefined && parent) { + v = parent.value(name); + } + data[name] = v; + } + return v; + }; + this.reset = function(p) { + parent = p; + data = {}; + }; +}; +odf.StyleParseUtils = function() { + var stylens = odf.Namespaces.stylens; + function splitLength(length) { + var re = /(-?[0-9]*[0-9][0-9]*(\.[0-9]*)?|0+\.[0-9]*[1-9][0-9]*|\.[0-9]*[1-9][0-9]*)((cm)|(mm)|(in)|(pt)|(pc)|(px))/, m = re.exec(length); + if (!m) { + return null; + } + return {value:parseFloat(m[1]), unit:m[3]}; + } + function parseLength(val) { + var n, length, unit; + length = splitLength(val); + unit = length && length.unit; + if (unit === "px") { + n = length.value; + } else { + if (unit === "cm") { + n = length.value / 2.54 * 96; + } else { + if (unit === "mm") { + n = length.value / 25.4 * 96; + } else { + if (unit === "in") { + n = length.value * 96; + } else { + if (unit === "pt") { + n = length.value / .75; + } else { + if (unit === "pc") { + n = length.value * 16; + } + } + } + } + } + } + return n; + } + this.parseLength = parseLength; + function parsePercent(value) { + var v; + if (value) { + v = parseFloat(value.substr(0, value.indexOf("%"))); + if (isNaN(v)) { + v = undefined; + } + } + return v; + } + function parsePositiveLengthOrPercent(value, name, parent) { + var v = parsePercent(value), parentValue; + if (v !== undefined) { + if (parent) { + parentValue = parent.value(name); + } + if (parentValue === undefined) { + v = undefined; + } else { + v *= parentValue / 100; + } + } else { + v = parseLength(value); + } + return v; + } + this.parsePositiveLengthOrPercent = parsePositiveLengthOrPercent; + function getPropertiesElement(name, styleElement, previousPropertyElement) { + var e = previousPropertyElement ? previousPropertyElement.nextElementSibling : styleElement.firstElementChild; + while (e !== null && (e.localName !== name || e.namespaceURI !== stylens)) { + e = e.nextElementSibling; + } + return e; + } + this.getPropertiesElement = getPropertiesElement; + function parseAttributeList(text) { + if (text) { + text = text.replace(/^\s*(.*?)\s*$/g, "$1"); + } + return text && text.length > 0 ? text.split(/\s+/) : []; + } + this.parseAttributeList = parseAttributeList; +}; +odf.Style2CSS = function Style2CSS() { + var drawns = odf.Namespaces.drawns, fons = odf.Namespaces.fons, officens = odf.Namespaces.officens, stylens = odf.Namespaces.stylens, svgns = odf.Namespaces.svgns, tablens = odf.Namespaces.tablens, xlinkns = odf.Namespaces.xlinkns, presentationns = odf.Namespaces.presentationns, webodfhelperns = "urn:webodf:names:helper", domUtils = core.DomUtils, styleParseUtils = new odf.StyleParseUtils, familynamespaceprefixes = {"graphic":"draw", "drawing-page":"draw", "paragraph":"text", "presentation":"presentation", + "ruby":"text", "section":"text", "table":"table", "table-cell":"table", "table-column":"table", "table-row":"table", "text":"text", "list":"text", "page":"office"}, familytagnames = {"graphic":["circle", "connected", "control", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], "paragraph":["alphabetical-index-entry-template", "h", "illustration-index-entry-template", "index-source-style", "object-index-entry-template", + "p", "table-index-entry-template", "table-of-content-entry-template", "user-index-entry-template"], "presentation":["caption", "circle", "connector", "control", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], "drawing-page":["caption", "circle", "connector", "control", "page", "custom-shape", "ellipse", "frame", "g", "line", "measure", "page-thumbnail", "path", "polygon", "polyline", "rect", "regular-polygon"], + "ruby":["ruby", "ruby-text"], "section":["alphabetical-index", "bibliography", "illustration-index", "index-title", "object-index", "section", "table-of-content", "table-index", "user-index"], "table":["background", "table"], "table-cell":["body", "covered-table-cell", "even-columns", "even-rows", "first-column", "first-row", "last-column", "last-row", "odd-columns", "odd-rows", "table-cell"], "table-column":["table-column"], "table-row":["table-row"], "text":["a", "index-entry-chapter", "index-entry-link-end", + "index-entry-link-start", "index-entry-page-number", "index-entry-span", "index-entry-tab-stop", "index-entry-text", "index-title-template", "linenumbering-configuration", "list-level-style-number", "list-level-style-bullet", "outline-level-style", "span"], "list":["list-item"]}, textPropertySimpleMapping = [[fons, "color", "color"], [fons, "background-color", "background-color"], [fons, "font-weight", "font-weight"], [fons, "font-style", "font-style"]], bgImageSimpleMapping = [[stylens, "repeat", + "background-repeat"]], paragraphPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "text-align", "text-align"], [fons, "text-indent", "text-indent"], [fons, "padding", "padding"], [fons, "padding-left", "padding-left"], [fons, "padding-right", "padding-right"], [fons, "padding-top", "padding-top"], [fons, "padding-bottom", "padding-bottom"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", + "border-bottom"], [fons, "margin", "margin"], [fons, "margin-left", "margin-left"], [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"], [fons, "border", "border"]], graphicPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "min-height", "min-height"], [drawns, "stroke", "border"], [svgns, "stroke-color", "border-color"], [svgns, "stroke-width", "border-width"], [fons, "border", "border"], [fons, "border-left", + "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"]], tablecellPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"], [fons, "border", "border"]], tablecolumnPropertySimpleMapping = [[stylens, "column-width", "width"]], tablerowPropertySimpleMapping = + [[stylens, "row-height", "height"], [fons, "keep-together", null]], tablePropertySimpleMapping = [[stylens, "width", "width"], [fons, "margin-left", "margin-left"], [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"]], pageContentPropertySimpleMapping = [[fons, "background-color", "background-color"], [fons, "padding", "padding"], [fons, "padding-left", "padding-left"], [fons, "padding-right", "padding-right"], [fons, "padding-top", + "padding-top"], [fons, "padding-bottom", "padding-bottom"], [fons, "border", "border"], [fons, "border-left", "border-left"], [fons, "border-right", "border-right"], [fons, "border-top", "border-top"], [fons, "border-bottom", "border-bottom"], [fons, "margin", "margin"], [fons, "margin-left", "margin-left"], [fons, "margin-right", "margin-right"], [fons, "margin-top", "margin-top"], [fons, "margin-bottom", "margin-bottom"]], pageSizePropertySimpleMapping = [[fons, "page-width", "width"], [fons, + "page-height", "height"]], borderPropertyMap = {"border":true, "border-left":true, "border-right":true, "border-top":true, "border-bottom":true, "stroke-width":true}, marginPropertyMap = {"margin":true, "margin-left":true, "margin-right":true, "margin-top":true, "margin-bottom":true}, fontFaceDeclsMap = {}, utils = odf.OdfUtils, documentType, odfRoot, defaultFontSize, xpath = xmldom.XPath, cssUnits = new core.CSSUnits; + function createSelector(family, name) { + var prefix = familynamespaceprefixes[family], namepart, selector; + if (prefix === undefined) { + return null; + } + if (name) { + namepart = "[" + prefix + '|style-name="' + name + '"]'; + } else { + namepart = ""; + } + if (prefix === "presentation") { + prefix = "draw"; + if (name) { + namepart = '[presentation|style-name="' + name + '"]'; + } else { + namepart = ""; + } + } + selector = prefix + "|" + familytagnames[family].join(namepart + "," + prefix + "|") + namepart; + return selector; + } + function getSelectors(family, name, node) { + var selectors = [], ss, derivedStyles = node.derivedStyles, n; + ss = createSelector(family, name); + if (ss !== null) { + selectors.push(ss); + } + for (n in derivedStyles) { + if (derivedStyles.hasOwnProperty(n)) { + ss = getSelectors(family, n, derivedStyles[n]); + selectors = selectors.concat(ss); + } + } + return selectors; + } + function fixBorderWidth(value) { + var index = value.indexOf(" "), width, theRestOfBorderAttributes; + if (index !== -1) { + width = value.substring(0, index); + theRestOfBorderAttributes = value.substring(index); + } else { + width = value; + theRestOfBorderAttributes = ""; + } + width = utils.parseLength(width); + if (width && width.unit === "pt" && width.value < .75) { + value = "0.75pt" + theRestOfBorderAttributes; + } + return value; + } + function getParentStyleNode(styleNode) { + var parentStyleName = "", parentStyleFamily = "", parentStyleNode = null, xp; + if (styleNode.localName === "default-style") { + return null; + } + parentStyleName = styleNode.getAttributeNS(stylens, "parent-style-name"); + parentStyleFamily = styleNode.getAttributeNS(stylens, "family"); + if (parentStyleName) { + xp = "//style:*[@style:name='" + parentStyleName + "'][@style:family='" + parentStyleFamily + "']"; + } else { + xp = "//style:default-style[@style:family='" + parentStyleFamily + "']"; + } + parentStyleNode = xpath.getODFElementsWithXPath(odfRoot, xp, odf.Namespaces.lookupNamespaceURI)[0]; + return parentStyleNode; + } + function fixMargin(props, namespace, name, value) { + var length = utils.parseLength(value), multiplier, parentStyle, parentLength, result, properties; + if (!length || length.unit !== "%") { + return value; + } + multiplier = length.value / 100; + parentStyle = getParentStyleNode(props.parentNode); + result = "0"; + while (parentStyle) { + properties = domUtils.getDirectChild(parentStyle, stylens, "paragraph-properties"); + if (properties) { + parentLength = utils.parseLength(properties.getAttributeNS(namespace, name)); + if (parentLength) { + if (parentLength.unit !== "%") { + result = parentLength.value * multiplier + parentLength.unit; + break; + } + multiplier *= parentLength.value / 100; + } + } + parentStyle = getParentStyleNode(parentStyle); + } + return result; + } + function applySimpleMapping(props, mapping) { + var rule = "", i, r, value; + for (i = 0;i < mapping.length;i += 1) { + r = mapping[i]; + value = props.getAttributeNS(r[0], r[1]); + if (value) { + value = value.trim(); + if (borderPropertyMap.hasOwnProperty(r[1])) { + value = fixBorderWidth(value); + } else { + if (marginPropertyMap.hasOwnProperty(r[1])) { + value = fixMargin(props, r[0], r[1], value); + } + } + if (r[2]) { + rule += r[2] + ":" + value + ";"; + } + } + } + return rule; + } + function getFontSize(styleNode) { + var props = domUtils.getDirectChild(styleNode, stylens, "text-properties"); + if (props) { + return utils.parseFoFontSize(props.getAttributeNS(fons, "font-size")); + } + return null; + } + function parseTextPosition(position) { + var parts = styleParseUtils.parseAttributeList(position); + return {verticalTextPosition:parts[0], fontHeight:parts[1]}; + } + function getTextProperties(props) { + var rule = "", fontName, fontSize, value, textDecorationLine = "", textDecorationStyle = "", textPosition, fontSizeRule = "", sizeMultiplier = 1, textFamilyStyleNode; + rule += applySimpleMapping(props, textPropertySimpleMapping); + value = props.getAttributeNS(stylens, "text-underline-style"); + if (value === "solid") { + textDecorationLine += " underline"; + } + value = props.getAttributeNS(stylens, "text-line-through-style"); + if (value === "solid") { + textDecorationLine += " line-through"; + } + if (textDecorationLine.length) { + rule += "text-decoration:" + textDecorationLine + ";\n"; + rule += "text-decoration-line:" + textDecorationLine + ";\n"; + rule += "-moz-text-decoration-line:" + textDecorationLine + ";\n"; + } + value = props.getAttributeNS(stylens, "text-line-through-type"); + switch(value) { + case "double": + textDecorationStyle += " double"; + break; + case "single": + textDecorationStyle += " single"; + break; + } + if (textDecorationStyle) { + rule += "text-decoration-style:" + textDecorationStyle + ";\n"; + rule += "-moz-text-decoration-style:" + textDecorationStyle + ";\n"; + } + fontName = props.getAttributeNS(stylens, "font-name") || props.getAttributeNS(fons, "font-family"); + if (fontName) { + value = fontFaceDeclsMap[fontName]; + rule += "font-family: " + (value || fontName) + ";"; + } + value = props.getAttributeNS(stylens, "text-position"); + if (value) { + textPosition = parseTextPosition(value); + rule += "vertical-align: " + textPosition.verticalTextPosition + "\n; "; + if (textPosition.fontHeight) { + sizeMultiplier = parseFloat(textPosition.fontHeight) / 100; + } + } + if (props.hasAttributeNS(fons, "font-size") || sizeMultiplier !== 1) { + textFamilyStyleNode = props.parentNode; + while (textFamilyStyleNode) { + fontSize = getFontSize(textFamilyStyleNode); + if (fontSize) { + if (fontSize.unit !== "%") { + fontSizeRule = "font-size: " + fontSize.value * sizeMultiplier + fontSize.unit + ";"; + break; + } + sizeMultiplier *= fontSize.value / 100; + } + textFamilyStyleNode = getParentStyleNode(textFamilyStyleNode); + } + if (!fontSizeRule) { + fontSizeRule = "font-size: " + parseFloat(defaultFontSize) * sizeMultiplier + cssUnits.getUnits(defaultFontSize) + ";"; + } + } + rule += fontSizeRule; + return rule; + } + function getParagraphProperties(props) { + var rule = "", bgimage, url, lineHeight; + rule += applySimpleMapping(props, paragraphPropertySimpleMapping); + bgimage = domUtils.getDirectChild(props, stylens, "background-image"); + if (bgimage) { + url = bgimage.getAttributeNS(xlinkns, "href"); + if (url) { + rule += "background-image: url('odfkit:" + url + "');"; + rule += applySimpleMapping(bgimage, bgImageSimpleMapping); + } + } + lineHeight = props.getAttributeNS(fons, "line-height"); + if (lineHeight && lineHeight !== "normal") { + lineHeight = utils.parseFoLineHeight(lineHeight); + if (lineHeight.unit !== "%") { + rule += "line-height: " + lineHeight.value + lineHeight.unit + ";"; + } else { + rule += "line-height: " + lineHeight.value / 100 + ";"; + } + } + return rule; + } + function matchToRgb(m, r, g, b) { + return r + r + g + g + b + b; + } + function hexToRgb(hex) { + var result, shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; + hex = hex.replace(shorthandRegex, matchToRgb); + result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? {r:parseInt(result[1], 16), g:parseInt(result[2], 16), b:parseInt(result[3], 16)} : null; + } + function isNumber(n) { + return !isNaN(parseFloat(n)); + } + function getGraphicProperties(props) { + var rule = "", alpha, bgcolor, fill; + rule += applySimpleMapping(props, graphicPropertySimpleMapping); + alpha = props.getAttributeNS(drawns, "opacity"); + fill = props.getAttributeNS(drawns, "fill"); + bgcolor = props.getAttributeNS(drawns, "fill-color"); + if (fill === "solid" || fill === "hatch") { + if (bgcolor && bgcolor !== "none") { + alpha = isNumber(alpha) ? parseFloat(alpha) / 100 : 1; + bgcolor = hexToRgb(bgcolor); + if (bgcolor) { + rule += "background-color: rgba(" + bgcolor.r + "," + bgcolor.g + "," + bgcolor.b + "," + alpha + ");"; + } + } else { + rule += "background: none;"; + } + } else { + if (fill === "none") { + rule += "background: none;"; + } + } + return rule; + } + function getDrawingPageProperties(props) { + var rule = ""; + rule += applySimpleMapping(props, graphicPropertySimpleMapping); + if (props.getAttributeNS(presentationns, "background-visible") === "true") { + rule += "background: none;"; + } + return rule; + } + function getTableCellProperties(props) { + var rule = ""; + rule += applySimpleMapping(props, tablecellPropertySimpleMapping); + return rule; + } + function getTableRowProperties(props) { + var rule = ""; + rule += applySimpleMapping(props, tablerowPropertySimpleMapping); + return rule; + } + function getTableColumnProperties(props) { + var rule = ""; + rule += applySimpleMapping(props, tablecolumnPropertySimpleMapping); + return rule; + } + function getTableProperties(props) { + var rule = "", borderModel; + rule += applySimpleMapping(props, tablePropertySimpleMapping); + borderModel = props.getAttributeNS(tablens, "border-model"); + if (borderModel === "collapsing") { + rule += "border-collapse:collapse;"; + } else { + if (borderModel === "separating") { + rule += "border-collapse:separate;"; + } + } + return rule; + } + function getDerivedStyleNames(styleName, node) { + var styleNames = [styleName], derivedStyles = node.derivedStyles; + Object.keys(derivedStyles).forEach(function(styleName) { + var dsn = getDerivedStyleNames(styleName, derivedStyles[styleName]); + styleNames = styleNames.concat(dsn); + }); + return styleNames; + } + function addDrawPageFrameDisplayRules(sheet, styleName, properties, node) { + var frameClasses = ["page-number", "date-time", "header", "footer"], styleNames = getDerivedStyleNames(styleName, node), visibleFrameClasses = [], invisibleFrameClasses = []; + function insertFrameVisibilityRule(controlledFrameClasses, visibility) { + var selectors = [], rule; + controlledFrameClasses.forEach(function(frameClass) { + styleNames.forEach(function(styleName) { + selectors.push('draw|page[webodfhelper|page-style-name="' + styleName + '"] draw|frame[presentation|class="' + frameClass + '"]'); + }); + }); + if (selectors.length > 0) { + rule = selectors.join(",") + "{visibility:" + visibility + ";}"; + sheet.insertRule(rule, sheet.cssRules.length); + } + } + frameClasses.forEach(function(frameClass) { + var displayValue; + displayValue = properties.getAttributeNS(presentationns, "display-" + frameClass); + if (displayValue === "true") { + visibleFrameClasses.push(frameClass); + } else { + if (displayValue === "false") { + invisibleFrameClasses.push(frameClass); + } + } + }); + insertFrameVisibilityRule(visibleFrameClasses, "visible"); + insertFrameVisibilityRule(invisibleFrameClasses, "hidden"); + } + function addStyleRule(sheet, family, name, node) { + var selectors = getSelectors(family, name, node), selector = selectors.join(","), rule = "", properties; + properties = domUtils.getDirectChild(node.element, stylens, "text-properties"); + if (properties) { + rule += getTextProperties(properties); + } + properties = domUtils.getDirectChild(node.element, stylens, "paragraph-properties"); + if (properties) { + rule += getParagraphProperties(properties); + } + properties = domUtils.getDirectChild(node.element, stylens, "graphic-properties"); + if (properties) { + rule += getGraphicProperties(properties); + } + properties = domUtils.getDirectChild(node.element, stylens, "drawing-page-properties"); + if (properties) { + rule += getDrawingPageProperties(properties); + addDrawPageFrameDisplayRules(sheet, name, properties, node); + } + properties = domUtils.getDirectChild(node.element, stylens, "table-cell-properties"); + if (properties) { + rule += getTableCellProperties(properties); + } + properties = domUtils.getDirectChild(node.element, stylens, "table-row-properties"); + if (properties) { + rule += getTableRowProperties(properties); + } + properties = domUtils.getDirectChild(node.element, stylens, "table-column-properties"); + if (properties) { + rule += getTableColumnProperties(properties); + } + properties = domUtils.getDirectChild(node.element, stylens, "table-properties"); + if (properties) { + rule += getTableProperties(properties); + } + if (rule.length === 0) { + return; + } + rule = selector + "{" + rule + "}"; + sheet.insertRule(rule, sheet.cssRules.length); + } + function addPageStyleRules(sheet, node) { + var rule = "", imageProps, url, contentLayoutRule = "", pageSizeRule = "", props = domUtils.getDirectChild(node, stylens, "page-layout-properties"), stylename, masterStyles, e, masterStyleName; + if (!props) { + return; + } + stylename = node.getAttributeNS(stylens, "name"); + rule += applySimpleMapping(props, pageContentPropertySimpleMapping); + imageProps = domUtils.getDirectChild(props, stylens, "background-image"); + if (imageProps) { + url = imageProps.getAttributeNS(xlinkns, "href"); + if (url) { + rule += "background-image: url('odfkit:" + url + "');"; + rule += applySimpleMapping(imageProps, bgImageSimpleMapping); + } + } + if (documentType === "presentation") { + masterStyles = domUtils.getDirectChild(node.parentNode.parentNode, officens, "master-styles"); + e = masterStyles && masterStyles.firstElementChild; + while (e) { + if (e.namespaceURI === stylens && e.localName === "master-page" && e.getAttributeNS(stylens, "page-layout-name") === stylename) { + masterStyleName = e.getAttributeNS(stylens, "name"); + contentLayoutRule = 'draw|page[draw|master-page-name="' + masterStyleName + '"] {' + rule + "}"; + pageSizeRule = 'office|body, draw|page[draw|master-page-name="' + masterStyleName + '"] {' + applySimpleMapping(props, pageSizePropertySimpleMapping) + " }"; + sheet.insertRule(contentLayoutRule, sheet.cssRules.length); + sheet.insertRule(pageSizeRule, sheet.cssRules.length); + } + e = e.nextElementSibling; + } + } else { + if (documentType === "text") { + contentLayoutRule = "office|text {" + rule + "}"; + rule = ""; + pageSizeRule = "office|body {" + "width: " + props.getAttributeNS(fons, "page-width") + ";" + "}"; + sheet.insertRule(contentLayoutRule, sheet.cssRules.length); + sheet.insertRule(pageSizeRule, sheet.cssRules.length); + } + } + } + function addRule(sheet, family, name, node) { + if (family === "page") { + addPageStyleRules(sheet, node.element); + } else { + addStyleRule(sheet, family, name, node); + } + } + function addRules(sheet, family, name, node) { + addRule(sheet, family, name, node); + var n; + for (n in node.derivedStyles) { + if (node.derivedStyles.hasOwnProperty(n)) { + addRules(sheet, family, n, node.derivedStyles[n]); + } + } + } + this.style2css = function(doctype, rootNode, stylesheet, fontFaceMap, styleTree) { + var tree, rule, name, family; + function insertCSSNamespace(prefix, ns) { + rule = "@namespace " + prefix + " url(" + ns + ");"; + try { + stylesheet.insertRule(rule, stylesheet.cssRules.length); + } catch (ignore) { + } + } + odfRoot = rootNode; + while (stylesheet.cssRules.length) { + stylesheet.deleteRule(stylesheet.cssRules.length - 1); + } + odf.Namespaces.forEachPrefix(insertCSSNamespace); + insertCSSNamespace("webodfhelper", webodfhelperns); + fontFaceDeclsMap = fontFaceMap; + documentType = doctype; + defaultFontSize = runtime.getWindow().getComputedStyle(document.body, null).getPropertyValue("font-size") || "12pt"; + for (family in familynamespaceprefixes) { + if (familynamespaceprefixes.hasOwnProperty(family)) { + tree = styleTree[family]; + for (name in tree) { + if (tree.hasOwnProperty(name)) { + addRules(stylesheet, family, name, tree[name]); + } + } + } + } + }; +}; +(function() { + function Point(x, y) { + var self = this; + this.getDistance = function(point) { + var xOffset = self.x - point.x, yOffset = self.y - point.y; + return Math.sqrt(xOffset * xOffset + yOffset * yOffset); + }; + this.getCenter = function(point) { + return new Point((self.x + point.x) / 2, (self.y + point.y) / 2); + }; + this.x; + this.y; + function init() { + self.x = x; + self.y = y; + } + init(); + } + gui.ZoomHelper = function() { + var zoomableElement, panPoint, previousPanPoint, firstPinchDistance, zoom, previousZoom, maxZoom = 4, offsetParent, parentElement, events = new core.EventNotifier([gui.ZoomHelper.signalZoomChanged]), gestures = {NONE:0, SCROLL:1, PINCH:2}, currentGesture = gestures.NONE, requiresCustomScrollBars = runtime.getWindow().hasOwnProperty("ontouchstart"), parentOverflow = ""; + function applyCSSTransform(x, y, scale, is3D) { + var transformCommand; + if (is3D) { + transformCommand = "translate3d(" + x + "px, " + y + "px, 0) scale3d(" + scale + ", " + scale + ", 1)"; + } else { + transformCommand = "translate(" + x + "px, " + y + "px) scale(" + scale + ")"; + } + zoomableElement.style.WebkitTransform = transformCommand; + zoomableElement.style.MozTransform = transformCommand; + zoomableElement.style.msTransform = transformCommand; + zoomableElement.style.OTransform = transformCommand; + zoomableElement.style.transform = transformCommand; + } + function applyTransform(is3D) { + if (is3D) { + applyCSSTransform(-panPoint.x, -panPoint.y, zoom, true); + } else { + applyCSSTransform(0, 0, zoom, true); + applyCSSTransform(0, 0, zoom, false); + } + } + function applyFastTransform() { + applyTransform(true); + } + function applyDetailedTransform() { + applyTransform(false); + } + function enableScrollBars(enable) { + if (!offsetParent || !requiresCustomScrollBars) { + return; + } + var initialOverflow = offsetParent.style.overflow, enabled = offsetParent.classList.contains("webodf-customScrollbars"); + if (enable && enabled || !enable && !enabled) { + return; + } + if (enable) { + offsetParent.classList.add("webodf-customScrollbars"); + offsetParent.style.overflow = "hidden"; + runtime.requestAnimationFrame(function() { + offsetParent.style.overflow = initialOverflow; + }); + } else { + offsetParent.classList.remove("webodf-customScrollbars"); + } + } + function removeScroll() { + applyCSSTransform(-panPoint.x, -panPoint.y, zoom, true); + offsetParent.scrollLeft = 0; + offsetParent.scrollTop = 0; + parentOverflow = parentElement.style.overflow; + parentElement.style.overflow = "visible"; + enableScrollBars(false); + } + function restoreScroll() { + applyCSSTransform(0, 0, zoom, true); + offsetParent.scrollLeft = panPoint.x; + offsetParent.scrollTop = panPoint.y; + parentElement.style.overflow = parentOverflow || ""; + enableScrollBars(true); + } + function getPoint(touch) { + return new Point(touch.pageX - zoomableElement.offsetLeft, touch.pageY - zoomableElement.offsetTop); + } + function sanitizePointForPan(point) { + return new Point(Math.min(Math.max(point.x, zoomableElement.offsetLeft), (zoomableElement.offsetLeft + zoomableElement.offsetWidth) * zoom - offsetParent.clientWidth), Math.min(Math.max(point.y, zoomableElement.offsetTop), (zoomableElement.offsetTop + zoomableElement.offsetHeight) * zoom - offsetParent.clientHeight)); + } + function processPan(point) { + if (previousPanPoint) { + panPoint.x -= point.x - previousPanPoint.x; + panPoint.y -= point.y - previousPanPoint.y; + panPoint = sanitizePointForPan(panPoint); + } + previousPanPoint = point; + } + function processZoom(zoomPoint, incrementalZoom) { + var originalZoom = zoom, actuallyIncrementedZoom, minZoom = Math.min(maxZoom, zoomableElement.offsetParent.clientWidth / zoomableElement.offsetWidth); + zoom = previousZoom * incrementalZoom; + zoom = Math.min(Math.max(zoom, minZoom), maxZoom); + actuallyIncrementedZoom = zoom / originalZoom; + panPoint.x += (actuallyIncrementedZoom - 1) * (zoomPoint.x + panPoint.x); + panPoint.y += (actuallyIncrementedZoom - 1) * (zoomPoint.y + panPoint.y); + } + function processPinch(point1, point2) { + var zoomPoint = point1.getCenter(point2), pinchDistance = point1.getDistance(point2), incrementalZoom = pinchDistance / firstPinchDistance; + processPan(zoomPoint); + processZoom(zoomPoint, incrementalZoom); + } + function prepareGesture(event) { + var fingers = event.touches.length, point1 = fingers > 0 ? getPoint(event.touches[0]) : null, point2 = fingers > 1 ? getPoint(event.touches[1]) : null; + if (point1 && point2) { + firstPinchDistance = point1.getDistance(point2); + previousZoom = zoom; + previousPanPoint = point1.getCenter(point2); + removeScroll(); + currentGesture = gestures.PINCH; + } else { + if (point1) { + previousPanPoint = point1; + currentGesture = gestures.SCROLL; + } + } + } + function processGesture(event) { + var fingers = event.touches.length, point1 = fingers > 0 ? getPoint(event.touches[0]) : null, point2 = fingers > 1 ? getPoint(event.touches[1]) : null; + if (point1 && point2) { + event.preventDefault(); + if (currentGesture === gestures.SCROLL) { + currentGesture = gestures.PINCH; + removeScroll(); + firstPinchDistance = point1.getDistance(point2); + return; + } + processPinch(point1, point2); + applyFastTransform(); + } else { + if (point1) { + if (currentGesture === gestures.PINCH) { + currentGesture = gestures.SCROLL; + restoreScroll(); + return; + } + processPan(point1); + } + } + } + function sanitizeGesture() { + if (currentGesture === gestures.PINCH) { + events.emit(gui.ZoomHelper.signalZoomChanged, zoom); + restoreScroll(); + applyDetailedTransform(); + } + currentGesture = gestures.NONE; + } + this.subscribe = function(eventid, cb) { + events.subscribe(eventid, cb); + }; + this.unsubscribe = function(eventid, cb) { + events.unsubscribe(eventid, cb); + }; + this.getZoomLevel = function() { + return zoom; + }; + this.setZoomLevel = function(zoomLevel) { + if (zoomableElement) { + zoom = zoomLevel; + applyDetailedTransform(); + events.emit(gui.ZoomHelper.signalZoomChanged, zoom); + } + }; + function registerGestureListeners() { + if (offsetParent) { + offsetParent.addEventListener("touchstart", prepareGesture, false); + offsetParent.addEventListener("touchmove", processGesture, false); + offsetParent.addEventListener("touchend", sanitizeGesture, false); + } + } + function unregisterGestureListeners() { + if (offsetParent) { + offsetParent.removeEventListener("touchstart", prepareGesture, false); + offsetParent.removeEventListener("touchmove", processGesture, false); + offsetParent.removeEventListener("touchend", sanitizeGesture, false); + } + } + this.destroy = function(callback) { + unregisterGestureListeners(); + enableScrollBars(false); + callback(); + }; + this.setZoomableElement = function(element) { + unregisterGestureListeners(); + zoomableElement = element; + offsetParent = zoomableElement.offsetParent; + parentElement = zoomableElement.parentNode; + applyDetailedTransform(); + registerGestureListeners(); + enableScrollBars(true); + }; + function init() { + zoom = 1; + previousZoom = 1; + panPoint = new Point(0, 0); + } + init(); + }; + gui.ZoomHelper.signalZoomChanged = "zoomChanged"; +})(); +ops.Canvas = function Canvas() { +}; +ops.Canvas.prototype.getZoomLevel = function() { +}; +ops.Canvas.prototype.getElement = function() { +}; +ops.Canvas.prototype.getSizer = function() { +}; +ops.Canvas.prototype.getZoomHelper = function() { +}; +(function() { + function LoadingQueue() { + var queue = [], taskRunning = false; + function run(task) { + taskRunning = true; + runtime.setTimeout(function() { + try { + task(); + } catch (e) { + runtime.log(String(e) + "\n" + e.stack); + } + taskRunning = false; + if (queue.length > 0) { + run(queue.pop()); + } + }, 10); + } + this.clearQueue = function() { + queue.length = 0; + }; + this.addToQueue = function(loadingTask) { + if (queue.length === 0 && !taskRunning) { + return run(loadingTask); + } + queue.push(loadingTask); + }; + } + function PageSwitcher(css) { + var sheet = css.sheet, position = 1; + function updateCSS() { + while (sheet.cssRules.length > 0) { + sheet.deleteRule(0); + } + sheet.insertRule("#shadowContent draw|page {display:none;}", 0); + sheet.insertRule("office|presentation draw|page {display:none;}", 1); + sheet.insertRule("#shadowContent draw|page:nth-of-type(" + position + ") {display:block;}", 2); + sheet.insertRule("office|presentation draw|page:nth-of-type(" + position + ") {display:block;}", 3); + } + this.showFirstPage = function() { + position = 1; + updateCSS(); + }; + this.showNextPage = function() { + position += 1; + updateCSS(); + }; + this.showPreviousPage = function() { + if (position > 1) { + position -= 1; + updateCSS(); + } + }; + this.showPage = function(n) { + if (n > 0) { + position = n; + updateCSS(); + } + }; + this.css = css; + this.destroy = function(callback) { + css.parentNode.removeChild(css); + callback(); + }; + } + function listenEvent(eventTarget, eventType, eventHandler) { + if (eventTarget.addEventListener) { + eventTarget.addEventListener(eventType, eventHandler, false); + } else { + if (eventTarget.attachEvent) { + eventType = "on" + eventType; + eventTarget.attachEvent(eventType, eventHandler); + } else { + eventTarget["on" + eventType] = eventHandler; + } + } + } + var drawns = odf.Namespaces.drawns, fons = odf.Namespaces.fons, officens = odf.Namespaces.officens, stylens = odf.Namespaces.stylens, svgns = odf.Namespaces.svgns, tablens = odf.Namespaces.tablens, textns = odf.Namespaces.textns, xlinkns = odf.Namespaces.xlinkns, presentationns = odf.Namespaces.presentationns, webodfhelperns = "urn:webodf:names:helper", xpath = xmldom.XPath, domUtils = core.DomUtils; + function clearCSSStyleSheet(style) { + var stylesheet = style.sheet, cssRules = stylesheet.cssRules; + while (cssRules.length) { + stylesheet.deleteRule(cssRules.length - 1); + } + } + function handleStyles(odfcontainer, formatting, stylesxmlcss) { + var style2css = new odf.Style2CSS, list2css = new odf.ListStyleToCss, styleSheet = stylesxmlcss.sheet, styleTree = (new odf.StyleTree(odfcontainer.rootElement.styles, odfcontainer.rootElement.automaticStyles)).getStyleTree(); + style2css.style2css(odfcontainer.getDocumentType(), odfcontainer.rootElement, styleSheet, formatting.getFontMap(), styleTree); + list2css.applyListStyles(styleSheet, styleTree, odfcontainer.rootElement.body); + } + function handleFonts(odfContainer, fontcss) { + var fontLoader = new odf.FontLoader; + fontLoader.loadFonts(odfContainer, fontcss.sheet); + } + function dropTemplateDrawFrames(clonedNode) { + var i, element, presentationClass, clonedDrawFrameElements = domUtils.getElementsByTagNameNS(clonedNode, drawns, "frame"); + for (i = 0;i < clonedDrawFrameElements.length;i += 1) { + element = clonedDrawFrameElements[i]; + presentationClass = element.getAttributeNS(presentationns, "class"); + if (presentationClass && !/^(date-time|footer|header|page-number)$/.test(presentationClass)) { + element.parentNode.removeChild(element); + } + } + } + function getHeaderFooter(odfContainer, frame, headerFooterId) { + var headerFooter = null, i, declElements = odfContainer.rootElement.body.getElementsByTagNameNS(presentationns, headerFooterId + "-decl"), headerFooterName = frame.getAttributeNS(presentationns, "use-" + headerFooterId + "-name"), element; + if (headerFooterName && declElements.length > 0) { + for (i = 0;i < declElements.length;i += 1) { + element = declElements[i]; + if (element.getAttributeNS(presentationns, "name") === headerFooterName) { + headerFooter = element.textContent; + break; + } + } + } + return headerFooter; + } + function setContainerValue(rootElement, ns, localName, value) { + var i, containerList, document = rootElement.ownerDocument, e; + containerList = domUtils.getElementsByTagNameNS(rootElement, ns, localName); + for (i = 0;i < containerList.length;i += 1) { + domUtils.removeAllChildNodes(containerList[i]); + if (value) { + e = containerList[i]; + e.appendChild(document.createTextNode(value)); + } + } + } + function setDrawElementPosition(styleid, frame, stylesheet) { + frame.setAttributeNS(webodfhelperns, "styleid", styleid); + var rule, anchor = frame.getAttributeNS(textns, "anchor-type"), x = frame.getAttributeNS(svgns, "x"), y = frame.getAttributeNS(svgns, "y"), width = frame.getAttributeNS(svgns, "width"), height = frame.getAttributeNS(svgns, "height"), minheight = frame.getAttributeNS(fons, "min-height"), minwidth = frame.getAttributeNS(fons, "min-width"); + if (anchor === "as-char") { + rule = "display: inline-block;"; + } else { + if (anchor || x || y) { + rule = "position: absolute;"; + } else { + if (width || height || minheight || minwidth) { + rule = "display: block;"; + } + } + } + if (x) { + rule += "left: " + x + ";"; + } + if (y) { + rule += "top: " + y + ";"; + } + if (width) { + rule += "width: " + width + ";"; + } + if (height) { + rule += "height: " + height + ";"; + } + if (minheight) { + rule += "min-height: " + minheight + ";"; + } + if (minwidth) { + rule += "min-width: " + minwidth + ";"; + } + if (rule) { + rule = "draw|" + frame.localName + '[webodfhelper|styleid="' + styleid + '"] {' + rule + "}"; + stylesheet.insertRule(rule, stylesheet.cssRules.length); + } + } + function getUrlFromBinaryDataElement(image) { + var node = image.firstChild; + while (node) { + if (node.namespaceURI === officens && node.localName === "binary-data") { + return "data:image/png;base64," + node.textContent.replace(/[\r\n\s]/g, ""); + } + node = node.nextSibling; + } + return ""; + } + function setImage(id, container, image, stylesheet) { + image.setAttributeNS(webodfhelperns, "styleid", id); + var url = image.getAttributeNS(xlinkns, "href"), part; + function callback(url) { + var rule; + if (url) { + rule = "background-image: url(" + url + ");"; + rule = 'draw|image[webodfhelper|styleid="' + id + '"] {' + rule + "}"; + stylesheet.insertRule(rule, stylesheet.cssRules.length); + } + } + function onchange(p) { + callback(p.url); + } + if (url) { + try { + part = container.getPart(url); + part.onchange = onchange; + part.load(); + } catch (e) { + runtime.log("slight problem: " + String(e)); + } + } else { + url = getUrlFromBinaryDataElement(image); + callback(url); + } + } + function formatParagraphAnchors(odfbody) { + var n, i, nodes = xpath.getODFElementsWithXPath(odfbody, ".//*[*[@text:anchor-type='paragraph']]", odf.Namespaces.lookupNamespaceURI); + for (i = 0;i < nodes.length;i += 1) { + n = nodes[i]; + if (n.setAttributeNS) { + n.setAttributeNS(webodfhelperns, "containsparagraphanchor", true); + } + } + } + function modifyTables(odffragment, documentns) { + var i, tableCells, node; + function modifyTableCell(node) { + if (node.hasAttributeNS(tablens, "number-columns-spanned")) { + node.setAttributeNS(documentns, "colspan", node.getAttributeNS(tablens, "number-columns-spanned")); + } + if (node.hasAttributeNS(tablens, "number-rows-spanned")) { + node.setAttributeNS(documentns, "rowspan", node.getAttributeNS(tablens, "number-rows-spanned")); + } + } + tableCells = domUtils.getElementsByTagNameNS(odffragment, tablens, "table-cell"); + for (i = 0;i < tableCells.length;i += 1) { + node = tableCells[i]; + modifyTableCell(node); + } + } + function modifyLineBreakElements(odffragment) { + var document = odffragment.ownerDocument, lineBreakElements = domUtils.getElementsByTagNameNS(odffragment, textns, "line-break"); + lineBreakElements.forEach(function(lineBreak) { + if (!lineBreak.hasChildNodes()) { + lineBreak.appendChild(document.createElement("br")); + } + }); + } + function expandSpaceElements(odffragment) { + var spaces, doc = odffragment.ownerDocument; + function expandSpaceElement(space) { + var j, count; + domUtils.removeAllChildNodes(space); + space.appendChild(doc.createTextNode(" ")); + count = parseInt(space.getAttributeNS(textns, "c"), 10); + if (count > 1) { + space.removeAttributeNS(textns, "c"); + for (j = 1;j < count;j += 1) { + space.parentNode.insertBefore(space.cloneNode(true), space); + } + } + } + spaces = domUtils.getElementsByTagNameNS(odffragment, textns, "s"); + spaces.forEach(expandSpaceElement); + } + function expandTabElements(odffragment) { + var tabs; + tabs = domUtils.getElementsByTagNameNS(odffragment, textns, "tab"); + tabs.forEach(function(tab) { + tab.textContent = "\t"; + }); + } + function modifyDrawElements(odfbody, stylesheet) { + var node, drawElements = [], i; + node = odfbody.firstElementChild; + while (node && node !== odfbody) { + if (node.namespaceURI === drawns) { + drawElements[drawElements.length] = node; + } + if (node.firstElementChild) { + node = node.firstElementChild; + } else { + while (node && node !== odfbody && !node.nextElementSibling) { + node = node.parentNode; + } + if (node && node.nextElementSibling) { + node = node.nextElementSibling; + } + } + } + for (i = 0;i < drawElements.length;i += 1) { + node = drawElements[i]; + setDrawElementPosition("frame" + String(i), node, stylesheet); + } + formatParagraphAnchors(odfbody); + } + function cloneMasterPages(formatting, odfContainer, shadowContent, odfbody, stylesheet) { + var masterPageName, masterPageElement, styleId, clonedPageElement, clonedElement, clonedDrawElements, pageNumber = 0, i, element, elementToClone, document = odfContainer.rootElement.ownerDocument; + element = odfbody.firstElementChild; + if (!(element && element.namespaceURI === officens && (element.localName === "presentation" || element.localName === "drawing"))) { + return; + } + element = element.firstElementChild; + while (element) { + masterPageName = element.getAttributeNS(drawns, "master-page-name"); + masterPageElement = masterPageName ? formatting.getMasterPageElement(masterPageName) : null; + if (masterPageElement) { + styleId = element.getAttributeNS(webodfhelperns, "styleid"); + clonedPageElement = document.createElementNS(drawns, "draw:page"); + elementToClone = masterPageElement.firstElementChild; + i = 0; + while (elementToClone) { + if (elementToClone.getAttributeNS(presentationns, "placeholder") !== "true") { + clonedElement = elementToClone.cloneNode(true); + clonedPageElement.appendChild(clonedElement); + } + elementToClone = elementToClone.nextElementSibling; + i += 1; + } + dropTemplateDrawFrames(clonedPageElement); + clonedDrawElements = domUtils.getElementsByTagNameNS(clonedPageElement, drawns, "*"); + for (i = 0;i < clonedDrawElements.length;i += 1) { + setDrawElementPosition(styleId + "_" + i, clonedDrawElements[i], stylesheet); + } + shadowContent.appendChild(clonedPageElement); + pageNumber = String(shadowContent.getElementsByTagNameNS(drawns, "page").length); + setContainerValue(clonedPageElement, textns, "page-number", pageNumber); + setContainerValue(clonedPageElement, presentationns, "header", getHeaderFooter(odfContainer, element, "header")); + setContainerValue(clonedPageElement, presentationns, "footer", getHeaderFooter(odfContainer, element, "footer")); + setDrawElementPosition(styleId, clonedPageElement, stylesheet); + clonedPageElement.setAttributeNS(webodfhelperns, "page-style-name", element.getAttributeNS(drawns, "style-name")); + clonedPageElement.setAttributeNS(drawns, "draw:master-page-name", masterPageElement.getAttributeNS(stylens, "name")); + } + element = element.nextElementSibling; + } + } + function setVideo(container, plugin) { + var video, source, url, doc = plugin.ownerDocument, part; + url = plugin.getAttributeNS(xlinkns, "href"); + function callback(url, mimetype) { + var ns = doc.documentElement.namespaceURI; + if (mimetype.substr(0, 6) === "video/") { + video = doc.createElementNS(ns, "video"); + video.setAttribute("controls", "controls"); + source = doc.createElementNS(ns, "source"); + if (url) { + source.setAttribute("src", url); + } + source.setAttribute("type", mimetype); + video.appendChild(source); + plugin.parentNode.appendChild(video); + } else { + plugin.innerHtml = "Unrecognised Plugin"; + } + } + function onchange(p) { + callback(p.url, p.mimetype); + } + if (url) { + try { + part = container.getPart(url); + part.onchange = onchange; + part.load(); + } catch (e) { + runtime.log("slight problem: " + String(e)); + } + } else { + runtime.log("using MP4 data fallback"); + url = getUrlFromBinaryDataElement(plugin); + callback(url, "video/mp4"); + } + } + function findWebODFStyleSheet(head) { + var style = head.firstElementChild; + while (style && !(style.localName === "style" && style.hasAttribute("webodfcss"))) { + style = style.nextElementSibling; + } + return style; + } + function addWebODFStyleSheet(document) { + var head = document.getElementsByTagName("head")[0], css, style, href, count = document.styleSheets.length; + style = findWebODFStyleSheet(head); + if (style) { + count = parseInt(style.getAttribute("webodfcss"), 10); + style.setAttribute("webodfcss", count + 1); + return style; + } + if (String(typeof webodf_css) === "string") { + css = webodf_css; + } else { + href = "webodf.css"; + if (runtime.currentDirectory) { + href = runtime.currentDirectory(); + if (href.length > 0 && href.substr(-1) !== "/") { + href += "/"; + } + href += "../webodf.css"; + } + css = runtime.readFileSync(href, "utf-8"); + } + style = document.createElementNS(head.namespaceURI, "style"); + style.setAttribute("media", "screen, print, handheld, projection"); + style.setAttribute("type", "text/css"); + style.setAttribute("webodfcss", "1"); + style.appendChild(document.createTextNode(css)); + head.appendChild(style); + return style; + } + function removeWebODFStyleSheet(webodfcss) { + var count = parseInt(webodfcss.getAttribute("webodfcss"), 10); + if (count === 1) { + webodfcss.parentNode.removeChild(webodfcss); + } else { + webodfcss.setAttribute("count", count - 1); + } + } + function addStyleSheet(document) { + var head = document.getElementsByTagName("head")[0], style = document.createElementNS(head.namespaceURI, "style"), text = ""; + style.setAttribute("type", "text/css"); + style.setAttribute("media", "screen, print, handheld, projection"); + odf.Namespaces.forEachPrefix(function(prefix, ns) { + text += "@namespace " + prefix + " url(" + ns + ");\n"; + }); + text += "@namespace webodfhelper url(" + webodfhelperns + ");\n"; + style.appendChild(document.createTextNode(text)); + head.appendChild(style); + return style; + } + odf.OdfCanvas = function OdfCanvas(element, viewport) { + runtime.assert(element !== null && element !== undefined, "odf.OdfCanvas constructor needs DOM element"); + runtime.assert(element.ownerDocument !== null && element.ownerDocument !== undefined, "odf.OdfCanvas constructor needs DOM"); + var self = this, doc = element.ownerDocument, odfcontainer, formatting = new odf.Formatting, pageSwitcher, sizer = null, annotationsPane = null, allowAnnotations = false, showAnnotationRemoveButton = false, annotationViewManager = null, webodfcss, fontcss, stylesxmlcss, positioncss, shadowContent, eventHandlers = {}, waitingForDoneTimeoutId, redrawContainerTask, shouldRefreshCss = false, shouldRerenderAnnotations = false, loadingQueue = new LoadingQueue, zoomHelper = new gui.ZoomHelper, canvasViewport = + viewport || new gui.SingleScrollViewport(element.parentNode); + function loadImages(container, odffragment, stylesheet) { + var i, images, node; + function loadImage(name, container, node, stylesheet) { + loadingQueue.addToQueue(function() { + setImage(name, container, node, stylesheet); + }); + } + images = odffragment.getElementsByTagNameNS(drawns, "image"); + for (i = 0;i < images.length;i += 1) { + node = images.item(i); + loadImage("image" + String(i), container, node, stylesheet); + } + } + function loadVideos(container, odffragment) { + var i, plugins, node; + function loadVideo(container, node) { + loadingQueue.addToQueue(function() { + setVideo(container, node); + }); + } + plugins = odffragment.getElementsByTagNameNS(drawns, "plugin"); + for (i = 0;i < plugins.length;i += 1) { + node = plugins.item(i); + loadVideo(container, node); + } + } + function addEventListener(eventType, eventHandler) { + var handlers; + if (eventHandlers.hasOwnProperty(eventType)) { + handlers = eventHandlers[eventType]; + } else { + handlers = eventHandlers[eventType] = []; + } + if (eventHandler && handlers.indexOf(eventHandler) === -1) { + handlers.push(eventHandler); + } + } + function fireEvent(eventType, args) { + if (!eventHandlers.hasOwnProperty(eventType)) { + return; + } + var handlers = eventHandlers[eventType], i; + for (i = 0;i < handlers.length;i += 1) { + handlers[i].apply(null, args); + } + } + function fixContainerSize() { + var minHeight, odfdoc = sizer.firstChild, zoomLevel = zoomHelper.getZoomLevel(); + if (!odfdoc) { + return; + } + sizer.style.WebkitTransformOrigin = "0% 0%"; + sizer.style.MozTransformOrigin = "0% 0%"; + sizer.style.msTransformOrigin = "0% 0%"; + sizer.style.OTransformOrigin = "0% 0%"; + sizer.style.transformOrigin = "0% 0%"; + if (annotationViewManager) { + minHeight = annotationViewManager.getMinimumHeightForAnnotationPane(); + if (minHeight) { + sizer.style.minHeight = minHeight; + } else { + sizer.style.removeProperty("min-height"); + } + } + element.style.width = Math.round(zoomLevel * sizer.offsetWidth) + "px"; + element.style.height = Math.round(zoomLevel * sizer.offsetHeight) + "px"; + element.style.display = "inline-block"; + } + function redrawContainer() { + if (shouldRefreshCss) { + handleStyles(odfcontainer, formatting, stylesxmlcss); + shouldRefreshCss = false; + } + if (shouldRerenderAnnotations) { + if (annotationViewManager) { + annotationViewManager.rerenderAnnotations(); + } + shouldRerenderAnnotations = false; + } + fixContainerSize(); + } + function handleContent(container, odfnode) { + var css = positioncss.sheet; + domUtils.removeAllChildNodes(element); + sizer = doc.createElementNS(element.namespaceURI, "div"); + sizer.style.display = "inline-block"; + sizer.style.background = "white"; + sizer.style.setProperty("float", "left", "important"); + sizer.appendChild(odfnode); + element.appendChild(sizer); + annotationsPane = doc.createElementNS(element.namespaceURI, "div"); + annotationsPane.id = "annotationsPane"; + shadowContent = doc.createElementNS(element.namespaceURI, "div"); + shadowContent.id = "shadowContent"; + shadowContent.style.position = "absolute"; + shadowContent.style.top = 0; + shadowContent.style.left = 0; + container.getContentElement().appendChild(shadowContent); + modifyDrawElements(odfnode.body, css); + cloneMasterPages(formatting, container, shadowContent, odfnode.body, css); + modifyTables(odfnode.body, element.namespaceURI); + modifyLineBreakElements(odfnode.body); + expandSpaceElements(odfnode.body); + expandTabElements(odfnode.body); + loadImages(container, odfnode.body, css); + loadVideos(container, odfnode.body); + sizer.insertBefore(shadowContent, sizer.firstChild); + zoomHelper.setZoomableElement(sizer); + } + function handleAnnotations(odfnode) { + var annotationNodes; + if (allowAnnotations) { + if (!annotationsPane.parentNode) { + sizer.appendChild(annotationsPane); + } + if (annotationViewManager) { + annotationViewManager.forgetAnnotations(); + } + annotationViewManager = new gui.AnnotationViewManager(self, odfnode.body, annotationsPane, showAnnotationRemoveButton); + annotationNodes = domUtils.getElementsByTagNameNS(odfnode.body, officens, "annotation"); + annotationViewManager.addAnnotations(annotationNodes); + fixContainerSize(); + } else { + if (annotationsPane.parentNode) { + sizer.removeChild(annotationsPane); + annotationViewManager.forgetAnnotations(); + fixContainerSize(); + } + } + } + function refreshOdf(suppressEvent) { + function callback() { + clearCSSStyleSheet(fontcss); + clearCSSStyleSheet(stylesxmlcss); + clearCSSStyleSheet(positioncss); + domUtils.removeAllChildNodes(element); + element.style.display = "inline-block"; + var odfnode = odfcontainer.rootElement; + element.ownerDocument.importNode(odfnode, true); + formatting.setOdfContainer(odfcontainer); + handleFonts(odfcontainer, fontcss); + handleStyles(odfcontainer, formatting, stylesxmlcss); + handleContent(odfcontainer, odfnode); + handleAnnotations(odfnode); + if (!suppressEvent) { + loadingQueue.addToQueue(function() { + fireEvent("statereadychange", [odfcontainer]); + }); + } + } + if (odfcontainer.state === odf.OdfContainer.DONE) { + callback(); + } else { + runtime.log("WARNING: refreshOdf called but ODF was not DONE."); + waitingForDoneTimeoutId = runtime.setTimeout(function later_cb() { + if (odfcontainer.state === odf.OdfContainer.DONE) { + callback(); + } else { + runtime.log("will be back later..."); + waitingForDoneTimeoutId = runtime.setTimeout(later_cb, 500); + } + }, 100); + } + } + this.refreshCSS = function() { + shouldRefreshCss = true; + redrawContainerTask.trigger(); + }; + this.refreshSize = function() { + redrawContainerTask.trigger(); + }; + this.odfContainer = function() { + return odfcontainer; + }; + this.setOdfContainer = function(container, suppressEvent) { + odfcontainer = container; + refreshOdf(suppressEvent === true); + }; + function load(url) { + loadingQueue.clearQueue(); + domUtils.removeAllChildNodes(element); + element.appendChild(element.ownerDocument.createTextNode(runtime.tr("Loading") + url + "...")); + element.removeAttribute("style"); + odfcontainer = new odf.OdfContainer(url, function(container) { + odfcontainer = container; + refreshOdf(false); + }); + } + this["load"] = load; + this.load = load; + this.save = function(callback) { + odfcontainer.save(callback); + }; + this.addListener = function(eventName, handler) { + switch(eventName) { + case "click": + listenEvent(element, eventName, handler); + break; + default: + addEventListener(eventName, handler); + break; + } + }; + this.getFormatting = function() { + return formatting; + }; + this.getAnnotationViewManager = function() { + return annotationViewManager; + }; + this.refreshAnnotations = function() { + handleAnnotations(odfcontainer.rootElement); + }; + this.rerenderAnnotations = function() { + if (annotationViewManager) { + shouldRerenderAnnotations = true; + redrawContainerTask.trigger(); + } + }; + this.getSizer = function() { + return sizer; + }; + this.enableAnnotations = function(allow, showRemoveButton) { + if (allow !== allowAnnotations) { + allowAnnotations = allow; + showAnnotationRemoveButton = showRemoveButton; + if (odfcontainer) { + handleAnnotations(odfcontainer.rootElement); + } + } + }; + this.addAnnotation = function(annotation) { + if (annotationViewManager) { + annotationViewManager.addAnnotations([annotation]); + fixContainerSize(); + } + }; + this.forgetAnnotation = function(annotation) { + if (annotationViewManager) { + annotationViewManager.forgetAnnotation(annotation); + fixContainerSize(); + } + }; + this.getZoomHelper = function() { + return zoomHelper; + }; + this.setZoomLevel = function(zoom) { + zoomHelper.setZoomLevel(zoom); + }; + this.getZoomLevel = function() { + return zoomHelper.getZoomLevel(); + }; + this.fitToContainingElement = function(width, height) { + var zoomLevel = zoomHelper.getZoomLevel(), realWidth = element.offsetWidth / zoomLevel, realHeight = element.offsetHeight / zoomLevel, zoom; + zoom = width / realWidth; + if (height / realHeight < zoom) { + zoom = height / realHeight; + } + zoomHelper.setZoomLevel(zoom); + }; + this.fitToWidth = function(width) { + var realWidth = element.offsetWidth / zoomHelper.getZoomLevel(); + zoomHelper.setZoomLevel(width / realWidth); + }; + this.fitSmart = function(width, height) { + var realWidth, realHeight, newScale, zoomLevel = zoomHelper.getZoomLevel(); + realWidth = element.offsetWidth / zoomLevel; + realHeight = element.offsetHeight / zoomLevel; + newScale = width / realWidth; + if (height !== undefined) { + if (height / realHeight < newScale) { + newScale = height / realHeight; + } + } + zoomHelper.setZoomLevel(Math.min(1, newScale)); + }; + this.fitToHeight = function(height) { + var realHeight = element.offsetHeight / zoomHelper.getZoomLevel(); + zoomHelper.setZoomLevel(height / realHeight); + }; + this.showFirstPage = function() { + pageSwitcher.showFirstPage(); + }; + this.showNextPage = function() { + pageSwitcher.showNextPage(); + }; + this.showPreviousPage = function() { + pageSwitcher.showPreviousPage(); + }; + this.showPage = function(n) { + pageSwitcher.showPage(n); + fixContainerSize(); + }; + this.getElement = function() { + return element; + }; + this.getViewport = function() { + return canvasViewport; + }; + this.addCssForFrameWithImage = function(frame) { + var frameName = frame.getAttributeNS(drawns, "name"), fc = frame.firstElementChild; + setDrawElementPosition(frameName, frame, positioncss.sheet); + if (fc) { + setImage(frameName + "img", odfcontainer, fc, positioncss.sheet); + } + }; + this.destroy = function(callback) { + var head = doc.getElementsByTagName("head")[0], cleanup = [pageSwitcher.destroy, redrawContainerTask.destroy]; + runtime.clearTimeout(waitingForDoneTimeoutId); + if (annotationsPane && annotationsPane.parentNode) { + annotationsPane.parentNode.removeChild(annotationsPane); + } + zoomHelper.destroy(function() { + if (sizer) { + element.removeChild(sizer); + sizer = null; + } + }); + removeWebODFStyleSheet(webodfcss); + head.removeChild(fontcss); + head.removeChild(stylesxmlcss); + head.removeChild(positioncss); + core.Async.destroyAll(cleanup, callback); + }; + function init() { + webodfcss = addWebODFStyleSheet(doc); + pageSwitcher = new PageSwitcher(addStyleSheet(doc)); + fontcss = addStyleSheet(doc); + stylesxmlcss = addStyleSheet(doc); + positioncss = addStyleSheet(doc); + redrawContainerTask = core.Task.createRedrawTask(redrawContainer); + zoomHelper.subscribe(gui.ZoomHelper.signalZoomChanged, fixContainerSize); + } + init(); + }; +})(); +odf.StepUtils = function StepUtils() { + function getContentBounds(stepIterator) { + var container = stepIterator.container(), offset, contentBounds; + runtime.assert(stepIterator.isStep(), "Step iterator must be on a step"); + if (container.nodeType === Node.TEXT_NODE && stepIterator.offset() > 0) { + offset = stepIterator.offset(); + } else { + container = stepIterator.leftNode(); + if (container && container.nodeType === Node.TEXT_NODE) { + offset = container.length; + } + } + if (container) { + if (container.nodeType === Node.TEXT_NODE) { + runtime.assert(offset > 0, "Empty text node found"); + contentBounds = {container:container, startOffset:offset - 1, endOffset:offset}; + } else { + contentBounds = {container:container, startOffset:0, endOffset:container.childNodes.length}; + } + } + return contentBounds; + } + this.getContentBounds = getContentBounds; +}; +ops.MemberProperties = function() { + this.fullName; + this.color; + this.imageUrl; +}; +ops.Member = function Member(memberId, properties) { + var props = new ops.MemberProperties; + function getMemberId() { + return memberId; + } + function getProperties() { + return props; + } + function setProperties(newProperties) { + Object.keys(newProperties).forEach(function(key) { + props[key] = newProperties[key]; + }); + } + function removeProperties(removedProperties) { + Object.keys(removedProperties).forEach(function(key) { + if (key !== "fullName" && key !== "color" && key !== "imageUrl" && props.hasOwnProperty(key)) { + delete props[key]; + } + }); + } + this.getMemberId = getMemberId; + this.getProperties = getProperties; + this.setProperties = setProperties; + this.removeProperties = removeProperties; + function init() { + runtime.assert(Boolean(memberId), "No memberId was supplied!"); + if (!properties.fullName) { + properties.fullName = runtime.tr("Unknown Author"); + } + if (!properties.color) { + properties.color = "black"; + } + if (!properties.imageUrl) { + properties.imageUrl = "avatar-joe.png"; + } + props = properties; + } + init(); +}; +ops.Document = function Document() { +}; +ops.Document.prototype.getMemberIds = function() { +}; +ops.Document.prototype.removeCursor = function(memberid) { +}; +ops.Document.prototype.getDocumentElement = function() { +}; +ops.Document.prototype.getRootNode = function() { +}; +ops.Document.prototype.getDOMDocument = function() { +}; +ops.Document.prototype.cloneDocumentElement = function() { +}; +ops.Document.prototype.setDocumentElement = function(element) { +}; +ops.Document.prototype.subscribe = function(eventid, cb) { +}; +ops.Document.prototype.unsubscribe = function(eventid, cb) { +}; +ops.Document.prototype.getCanvas = function() { +}; +ops.Document.prototype.createRootFilter = function(inputMemberId) { +}; +ops.Document.prototype.createPositionIterator = function(rootNode) { +}; +ops.Document.prototype.hasCursor = function(memberid) { +}; +ops.Document.signalCursorAdded = "cursor/added"; +ops.Document.signalCursorRemoved = "cursor/removed"; +ops.Document.signalCursorMoved = "cursor/moved"; +ops.Document.signalMemberAdded = "member/added"; +ops.Document.signalMemberUpdated = "member/updated"; +ops.Document.signalMemberRemoved = "member/removed"; +ops.OdtCursor = function OdtCursor(memberId, document) { + var self = this, validSelectionTypes = {}, selectionType, cursor, events = new core.EventNotifier([ops.OdtCursor.signalCursorUpdated]); + this.removeFromDocument = function() { + cursor.remove(); + }; + this.subscribe = function(eventid, cb) { + events.subscribe(eventid, cb); + }; + this.unsubscribe = function(eventid, cb) { + events.unsubscribe(eventid, cb); + }; + this.getMemberId = function() { + return memberId; + }; + this.getNode = function() { + return cursor.getNode(); + }; + this.getAnchorNode = function() { + return cursor.getAnchorNode(); + }; + this.getSelectedRange = function() { + return cursor.getSelectedRange(); + }; + this.setSelectedRange = function(range, isForwardSelection) { + cursor.setSelectedRange(range, isForwardSelection); + events.emit(ops.OdtCursor.signalCursorUpdated, self); + }; + this.hasForwardSelection = function() { + return cursor.hasForwardSelection(); + }; + this.getDocument = function() { + return document; + }; + this.getSelectionType = function() { + return selectionType; + }; + this.setSelectionType = function(value) { + if (validSelectionTypes.hasOwnProperty(value)) { + selectionType = value; + } else { + runtime.log("Invalid selection type: " + value); + } + }; + this.resetSelectionType = function() { + self.setSelectionType(ops.OdtCursor.RangeSelection); + }; + function init() { + cursor = new core.Cursor(document.getDOMDocument(), memberId); + validSelectionTypes[ops.OdtCursor.RangeSelection] = true; + validSelectionTypes[ops.OdtCursor.RegionSelection] = true; + self.resetSelectionType(); + } + init(); +}; +ops.OdtCursor.RangeSelection = "Range"; +ops.OdtCursor.RegionSelection = "Region"; +ops.OdtCursor.signalCursorUpdated = "cursorUpdated"; +(function() { + var nextNodeId = 0; + ops.StepsCache = function StepsCache(rootElement, bucketSize, restoreBookmarkPosition) { + var coordinatens = "urn:webodf:names:steps", stepToDomPoint = {}, nodeToBookmark = {}, domUtils = core.DomUtils, basePoint, lastUndamagedCacheStep, DOCUMENT_POSITION_FOLLOWING = Node.DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_PRECEDING = Node.DOCUMENT_POSITION_PRECEDING; + function NodeBookmark(nodeId, bookmarkNode) { + var self = this; + this.nodeId = nodeId; + this.steps = -1; + this.node = bookmarkNode; + this.nextBookmark = null; + this.previousBookmark = null; + this.setIteratorPosition = function(iterator) { + iterator.setPositionBeforeElement(bookmarkNode); + restoreBookmarkPosition(self.steps, iterator); + }; + } + function RootBookmark(nodeId, steps, rootNode) { + var self = this; + this.nodeId = nodeId; + this.steps = steps; + this.node = rootNode; + this.nextBookmark = null; + this.previousBookmark = null; + this.setIteratorPosition = function(iterator) { + iterator.setUnfilteredPosition(rootNode, 0); + restoreBookmarkPosition(self.steps, iterator); + }; + } + function inspectBookmarks(bookmark1, bookmark2) { + var parts = "[" + bookmark1.nodeId; + if (bookmark2) { + parts += " => " + bookmark2.nodeId; + } + return parts + "]"; + } + function isUndamagedBookmark(bookmark) { + return lastUndamagedCacheStep === undefined || bookmark === basePoint || bookmark.steps <= lastUndamagedCacheStep; + } + function verifyCache() { + if (ops.StepsCache.ENABLE_CACHE_VERIFICATION !== true) { + return; + } + var bookmark = basePoint, previousBookmark, nextBookmark, documentPosition, loopCheck = new core.LoopWatchDog(0, 1E5), stepToDomPointNodeIds = {}; + while (bookmark) { + loopCheck.check(); + previousBookmark = bookmark.previousBookmark; + if (previousBookmark) { + runtime.assert(previousBookmark.nextBookmark === bookmark, "Broken bookmark link to previous @" + inspectBookmarks(previousBookmark, bookmark)); + } else { + runtime.assert(bookmark === basePoint, "Broken bookmark link @" + inspectBookmarks(bookmark)); + runtime.assert(isUndamagedBookmark(basePoint), "Base point is damaged @" + inspectBookmarks(bookmark)); + } + nextBookmark = bookmark.nextBookmark; + if (nextBookmark) { + runtime.assert(nextBookmark.previousBookmark === bookmark, "Broken bookmark link to next @" + inspectBookmarks(bookmark, nextBookmark)); + } + if (isUndamagedBookmark(bookmark)) { + runtime.assert(domUtils.containsNode(rootElement, bookmark.node), "Disconnected node is being reported as undamaged @" + inspectBookmarks(bookmark)); + if (previousBookmark) { + documentPosition = bookmark.node.compareDocumentPosition(previousBookmark.node); + runtime.assert(documentPosition === 0 || (documentPosition & DOCUMENT_POSITION_PRECEDING) !== 0, "Bookmark order with previous does not reflect DOM order @" + inspectBookmarks(previousBookmark, bookmark)); + } + if (nextBookmark) { + if (domUtils.containsNode(rootElement, nextBookmark.node)) { + documentPosition = bookmark.node.compareDocumentPosition(nextBookmark.node); + runtime.assert(documentPosition === 0 || (documentPosition & DOCUMENT_POSITION_FOLLOWING) !== 0, "Bookmark order with next does not reflect DOM order @" + inspectBookmarks(bookmark, nextBookmark)); + } + } + } + bookmark = bookmark.nextBookmark; + } + Object.keys(stepToDomPoint).forEach(function(step) { + var domPointBookmark = stepToDomPoint[step]; + if (lastUndamagedCacheStep === undefined || step <= lastUndamagedCacheStep) { + runtime.assert(domPointBookmark.steps <= step, "Bookmark step of " + domPointBookmark.steps + " exceeds cached step lookup for " + step + " @" + inspectBookmarks(domPointBookmark)); + } + runtime.assert(stepToDomPointNodeIds.hasOwnProperty(domPointBookmark.nodeId) === false, "Bookmark " + inspectBookmarks(domPointBookmark) + " appears twice in cached step lookup at steps " + stepToDomPointNodeIds[domPointBookmark.nodeId] + " and " + step); + stepToDomPointNodeIds[domPointBookmark.nodeId] = step; + }); + } + function getBucket(steps) { + return Math.floor(steps / bucketSize) * bucketSize; + } + function getDestinationBucket(steps) { + return Math.ceil(steps / bucketSize) * bucketSize; + } + function clearNodeId(node) { + node.removeAttributeNS(coordinatens, "nodeId"); + } + function getNodeId(node) { + var id = ""; + if (node.nodeType === Node.ELEMENT_NODE) { + id = node.getAttributeNS(coordinatens, "nodeId") || ""; + } + return id; + } + function setNodeId(node) { + var nodeId = nextNodeId.toString(); + node.setAttributeNS(coordinatens, "nodeId", nodeId); + nextNodeId += 1; + return nodeId; + } + function isValidBookmarkForNode(node, bookmark) { + return bookmark.node === node; + } + function getNodeBookmark(node) { + var nodeId = getNodeId(node) || setNodeId(node), existingBookmark; + existingBookmark = nodeToBookmark[nodeId]; + if (!existingBookmark) { + existingBookmark = nodeToBookmark[nodeId] = new NodeBookmark(nodeId, node); + } else { + if (!isValidBookmarkForNode(node, existingBookmark)) { + runtime.log("Cloned node detected. Creating new bookmark"); + nodeId = setNodeId(node); + existingBookmark = nodeToBookmark[nodeId] = new NodeBookmark(nodeId, node); + } + } + return existingBookmark; + } + function getClosestBookmark(steps) { + var cacheBucket, cachePoint, loopGuard = new core.LoopWatchDog(0, 1E4); + if (lastUndamagedCacheStep !== undefined && steps > lastUndamagedCacheStep) { + steps = lastUndamagedCacheStep; + } + cacheBucket = getBucket(steps); + while (!cachePoint && cacheBucket >= 0) { + cachePoint = stepToDomPoint[cacheBucket]; + cacheBucket -= bucketSize; + } + cachePoint = cachePoint || basePoint; + while (cachePoint.nextBookmark && cachePoint.nextBookmark.steps <= steps) { + loopGuard.check(); + cachePoint = cachePoint.nextBookmark; + } + runtime.assert(steps === -1 || cachePoint.steps <= steps, "Bookmark @" + inspectBookmarks(cachePoint) + " at step " + cachePoint.steps + " exceeds requested step of " + steps); + return cachePoint; + } + function getUndamagedBookmark(bookmark) { + if (lastUndamagedCacheStep !== undefined && bookmark.steps > lastUndamagedCacheStep) { + bookmark = getClosestBookmark(lastUndamagedCacheStep); + } + return bookmark; + } + function removeBookmark(currentBookmark) { + if (currentBookmark.previousBookmark) { + currentBookmark.previousBookmark.nextBookmark = currentBookmark.nextBookmark; + } + if (currentBookmark.nextBookmark) { + currentBookmark.nextBookmark.previousBookmark = currentBookmark.previousBookmark; + } + } + function isAlreadyInOrder(previousBookmark, newBookmark) { + return previousBookmark === newBookmark || previousBookmark.nextBookmark === newBookmark; + } + function insertBookmark(previousBookmark, newBookmark) { + var nextBookmark; + if (!isAlreadyInOrder(previousBookmark, newBookmark)) { + if (previousBookmark.steps === newBookmark.steps) { + while ((newBookmark.node.compareDocumentPosition(previousBookmark.node) & DOCUMENT_POSITION_FOLLOWING) !== 0 && previousBookmark !== basePoint) { + previousBookmark = previousBookmark.previousBookmark; + } + } + if (!isAlreadyInOrder(previousBookmark, newBookmark)) { + removeBookmark(newBookmark); + nextBookmark = previousBookmark.nextBookmark; + newBookmark.nextBookmark = previousBookmark.nextBookmark; + newBookmark.previousBookmark = previousBookmark; + previousBookmark.nextBookmark = newBookmark; + if (nextBookmark) { + nextBookmark.previousBookmark = newBookmark; + } + } + } + } + function repairCacheUpToStep(currentIteratorStep) { + var damagedBookmark, undamagedBookmark, nextBookmark, stepsBucket; + if (lastUndamagedCacheStep !== undefined && lastUndamagedCacheStep < currentIteratorStep) { + undamagedBookmark = getClosestBookmark(lastUndamagedCacheStep); + damagedBookmark = undamagedBookmark.nextBookmark; + while (damagedBookmark && damagedBookmark.steps <= currentIteratorStep) { + nextBookmark = damagedBookmark.nextBookmark; + stepsBucket = getDestinationBucket(damagedBookmark.steps); + if (stepToDomPoint[stepsBucket] === damagedBookmark) { + delete stepToDomPoint[stepsBucket]; + } + if (!domUtils.containsNode(rootElement, damagedBookmark.node)) { + removeBookmark(damagedBookmark); + delete nodeToBookmark[damagedBookmark.nodeId]; + } else { + damagedBookmark.steps = currentIteratorStep + 1; + } + damagedBookmark = nextBookmark; + } + lastUndamagedCacheStep = currentIteratorStep; + } else { + undamagedBookmark = getClosestBookmark(currentIteratorStep); + } + return undamagedBookmark; + } + this.updateBookmark = function(steps, node) { + var previousCacheBucket, newCacheBucket = getDestinationBucket(steps), existingCachePoint, bookmark, closestPriorBookmark; + closestPriorBookmark = repairCacheUpToStep(steps); + bookmark = getNodeBookmark(node); + if (bookmark.steps !== steps) { + previousCacheBucket = getDestinationBucket(bookmark.steps); + if (previousCacheBucket !== newCacheBucket && stepToDomPoint[previousCacheBucket] === bookmark) { + delete stepToDomPoint[previousCacheBucket]; + } + bookmark.steps = steps; + } + insertBookmark(closestPriorBookmark, bookmark); + existingCachePoint = stepToDomPoint[newCacheBucket]; + if (!existingCachePoint || bookmark.steps > existingCachePoint.steps) { + stepToDomPoint[newCacheBucket] = bookmark; + } + verifyCache(); + }; + this.setToClosestStep = function(steps, iterator) { + var cachePoint; + verifyCache(); + cachePoint = getClosestBookmark(steps); + cachePoint.setIteratorPosition(iterator); + return cachePoint.steps; + }; + function findBookmarkedAncestor(node) { + var currentNode = node, nodeId, bookmark = null; + while (!bookmark && currentNode && currentNode !== rootElement) { + nodeId = getNodeId(currentNode); + if (nodeId) { + bookmark = nodeToBookmark[nodeId]; + if (bookmark && !isValidBookmarkForNode(currentNode, bookmark)) { + runtime.log("Cloned node detected. Creating new bookmark"); + bookmark = null; + clearNodeId(currentNode); + } + } + currentNode = currentNode.parentNode; + } + return bookmark; + } + this.setToClosestDomPoint = function(node, offset, iterator) { + var bookmark, b, key; + verifyCache(); + if (node === rootElement && offset === 0) { + bookmark = basePoint; + } else { + if (node === rootElement && offset === rootElement.childNodes.length) { + bookmark = basePoint; + for (key in stepToDomPoint) { + if (stepToDomPoint.hasOwnProperty(key)) { + b = stepToDomPoint[key]; + if (b.steps > bookmark.steps) { + bookmark = b; + } + } + } + } else { + bookmark = findBookmarkedAncestor(node.childNodes.item(offset) || node); + if (!bookmark) { + iterator.setUnfilteredPosition(node, offset); + while (!bookmark && iterator.previousNode()) { + bookmark = findBookmarkedAncestor(iterator.getCurrentNode()); + } + } + } + } + bookmark = getUndamagedBookmark(bookmark || basePoint); + bookmark.setIteratorPosition(iterator); + return bookmark.steps; + }; + this.damageCacheAfterStep = function(inflectionStep) { + if (inflectionStep < 0) { + inflectionStep = -1; + } + if (lastUndamagedCacheStep === undefined) { + lastUndamagedCacheStep = inflectionStep; + } else { + if (inflectionStep < lastUndamagedCacheStep) { + lastUndamagedCacheStep = inflectionStep; + } + } + verifyCache(); + }; + function init() { + var rootElementId = getNodeId(rootElement) || setNodeId(rootElement); + basePoint = new RootBookmark(rootElementId, 0, rootElement); + } + init(); + }; + ops.StepsCache.ENABLE_CACHE_VERIFICATION = false; + ops.StepsCache.Bookmark = function Bookmark() { + }; + ops.StepsCache.Bookmark.prototype.nodeId; + ops.StepsCache.Bookmark.prototype.node; + ops.StepsCache.Bookmark.prototype.steps; + ops.StepsCache.Bookmark.prototype.previousBookmark; + ops.StepsCache.Bookmark.prototype.nextBookmark; + ops.StepsCache.Bookmark.prototype.setIteratorPosition = function(iterator) { + }; +})(); +(function() { + ops.OdtStepsTranslator = function OdtStepsTranslator(rootNode, iterator, filter, bucketSize) { + var stepsCache, odfUtils = odf.OdfUtils, domUtils = core.DomUtils, FILTER_ACCEPT = core.PositionFilter.FilterResult.FILTER_ACCEPT, PREVIOUS = core.StepDirection.PREVIOUS, NEXT = core.StepDirection.NEXT; + function updateCache(steps, iterator, isStep) { + var node = iterator.getCurrentNode(); + if (iterator.isBeforeNode() && odfUtils.isParagraph(node)) { + if (!isStep) { + steps += 1; + } + stepsCache.updateBookmark(steps, node); + } + } + function roundUpToStep(steps, iterator) { + do { + if (filter.acceptPosition(iterator) === FILTER_ACCEPT) { + updateCache(steps, iterator, true); + break; + } + updateCache(steps - 1, iterator, false); + } while (iterator.nextPosition()); + } + this.convertStepsToDomPoint = function(steps) { + var stepsFromRoot, isStep; + if (isNaN(steps)) { + throw new TypeError("Requested steps is not numeric (" + steps + ")"); + } + if (steps < 0) { + throw new RangeError("Requested steps is negative (" + steps + ")"); + } + stepsFromRoot = stepsCache.setToClosestStep(steps, iterator); + while (stepsFromRoot < steps && iterator.nextPosition()) { + isStep = filter.acceptPosition(iterator) === FILTER_ACCEPT; + if (isStep) { + stepsFromRoot += 1; + } + updateCache(stepsFromRoot, iterator, isStep); + } + if (stepsFromRoot !== steps) { + throw new RangeError("Requested steps (" + steps + ") exceeds available steps (" + stepsFromRoot + ")"); + } + return {node:iterator.container(), offset:iterator.unfilteredDomOffset()}; + }; + function roundToPreferredStep(iterator, roundDirection) { + if (!roundDirection || filter.acceptPosition(iterator) === FILTER_ACCEPT) { + return true; + } + while (iterator.previousPosition()) { + if (filter.acceptPosition(iterator) === FILTER_ACCEPT) { + if (roundDirection(PREVIOUS, iterator.container(), iterator.unfilteredDomOffset())) { + return true; + } + break; + } + } + while (iterator.nextPosition()) { + if (filter.acceptPosition(iterator) === FILTER_ACCEPT) { + if (roundDirection(NEXT, iterator.container(), iterator.unfilteredDomOffset())) { + return true; + } + break; + } + } + return false; + } + this.convertDomPointToSteps = function(node, offset, roundDirection) { + var stepsFromRoot, beforeRoot, destinationNode, destinationOffset, rounding = 0, isStep; + if (!domUtils.containsNode(rootNode, node)) { + beforeRoot = domUtils.comparePoints(rootNode, 0, node, offset) < 0; + node = rootNode; + offset = beforeRoot ? 0 : rootNode.childNodes.length; + } + iterator.setUnfilteredPosition(node, offset); + if (!roundToPreferredStep(iterator, roundDirection)) { + iterator.setUnfilteredPosition(node, offset); + } + destinationNode = iterator.container(); + destinationOffset = iterator.unfilteredDomOffset(); + stepsFromRoot = stepsCache.setToClosestDomPoint(destinationNode, destinationOffset, iterator); + if (domUtils.comparePoints(iterator.container(), iterator.unfilteredDomOffset(), destinationNode, destinationOffset) < 0) { + return stepsFromRoot > 0 ? stepsFromRoot - 1 : stepsFromRoot; + } + while (!(iterator.container() === destinationNode && iterator.unfilteredDomOffset() === destinationOffset) && iterator.nextPosition()) { + isStep = filter.acceptPosition(iterator) === FILTER_ACCEPT; + if (isStep) { + stepsFromRoot += 1; + } + updateCache(stepsFromRoot, iterator, isStep); + } + return stepsFromRoot + rounding; + }; + this.prime = function() { + var stepsFromRoot, isStep; + stepsFromRoot = stepsCache.setToClosestStep(0, iterator); + while (iterator.nextPosition()) { + isStep = filter.acceptPosition(iterator) === FILTER_ACCEPT; + if (isStep) { + stepsFromRoot += 1; + } + updateCache(stepsFromRoot, iterator, isStep); + } + }; + this.handleStepsInserted = function(eventArgs) { + stepsCache.damageCacheAfterStep(eventArgs.position); + }; + this.handleStepsRemoved = function(eventArgs) { + stepsCache.damageCacheAfterStep(eventArgs.position - 1); + }; + function init() { + stepsCache = new ops.StepsCache(rootNode, bucketSize, roundUpToStep); + } + init(); + }; +})(); +ops.Operation = function Operation() { +}; +ops.Operation.prototype.init = function(data) { +}; +ops.Operation.prototype.isEdit; +ops.Operation.prototype.group; +ops.Operation.prototype.execute = function(document) { +}; +ops.Operation.prototype.spec = function() { +}; +ops.TextPositionFilter = function TextPositionFilter() { + var odfUtils = odf.OdfUtils, ELEMENT_NODE = Node.ELEMENT_NODE, TEXT_NODE = Node.TEXT_NODE, FILTER_ACCEPT = core.PositionFilter.FilterResult.FILTER_ACCEPT, FILTER_REJECT = core.PositionFilter.FilterResult.FILTER_REJECT; + function previousSibling(node, nodeFilter) { + while (node && nodeFilter(node) !== FILTER_ACCEPT) { + node = node.previousSibling; + } + return node; + } + function checkLeftRight(container, leftNode, rightNode, nodeFilter) { + var r, firstPos, rightOfChar; + if (leftNode) { + if (odfUtils.isInlineRoot(leftNode) && odfUtils.isGroupingElement(rightNode)) { + return FILTER_REJECT; + } + r = odfUtils.lookLeftForCharacter(leftNode); + if (r === 1) { + return FILTER_ACCEPT; + } + if (r === 2 && (odfUtils.scanRightForAnyCharacter(rightNode) || odfUtils.scanRightForAnyCharacter(odfUtils.nextNode(container)))) { + return FILTER_ACCEPT; + } + } else { + if (odfUtils.isGroupingElement(container) && odfUtils.isInlineRoot(previousSibling(container.previousSibling, nodeFilter))) { + return FILTER_ACCEPT; + } + } + firstPos = leftNode === null && odfUtils.isParagraph(container); + rightOfChar = odfUtils.lookRightForCharacter(rightNode); + if (firstPos) { + if (rightOfChar) { + return FILTER_ACCEPT; + } + return odfUtils.scanRightForAnyCharacter(rightNode) ? FILTER_REJECT : FILTER_ACCEPT; + } + if (!rightOfChar) { + return FILTER_REJECT; + } + leftNode = leftNode || odfUtils.previousNode(container); + return odfUtils.scanLeftForAnyCharacter(leftNode) ? FILTER_REJECT : FILTER_ACCEPT; + } + this.acceptPosition = function(iterator) { + var container = iterator.container(), nodeType = container.nodeType, offset, text, leftChar, rightChar, leftNode, rightNode, r; + if (nodeType !== ELEMENT_NODE && nodeType !== TEXT_NODE) { + return FILTER_REJECT; + } + if (nodeType === TEXT_NODE) { + offset = iterator.unfilteredDomOffset(); + text = container.data; + runtime.assert(offset !== text.length, "Unexpected offset."); + if (offset > 0) { + leftChar = text[offset - 1]; + if (!odfUtils.isODFWhitespace(leftChar)) { + return FILTER_ACCEPT; + } + if (offset > 1) { + leftChar = text[offset - 2]; + if (!odfUtils.isODFWhitespace(leftChar)) { + r = FILTER_ACCEPT; + } else { + if (!odfUtils.isODFWhitespace(text.substr(0, offset))) { + return FILTER_REJECT; + } + } + } else { + leftNode = odfUtils.previousNode(container); + if (odfUtils.scanLeftForNonSpace(leftNode)) { + r = FILTER_ACCEPT; + } + } + if (r === FILTER_ACCEPT) { + return odfUtils.isTrailingWhitespace(container, offset) ? FILTER_REJECT : FILTER_ACCEPT; + } + rightChar = text[offset]; + if (odfUtils.isODFWhitespace(rightChar)) { + return FILTER_REJECT; + } + return odfUtils.scanLeftForAnyCharacter(odfUtils.previousNode(container)) ? FILTER_REJECT : FILTER_ACCEPT; + } + leftNode = iterator.leftNode(); + rightNode = container; + container = container.parentNode; + r = checkLeftRight(container, leftNode, rightNode, iterator.getNodeFilter()); + } else { + if (!odfUtils.isGroupingElement(container)) { + r = FILTER_REJECT; + } else { + leftNode = iterator.leftNode(); + rightNode = iterator.rightNode(); + r = checkLeftRight(container, leftNode, rightNode, iterator.getNodeFilter()); + } + } + return r; + }; +}; +function RootFilter(anchor, cursors, getRoot) { + var FILTER_ACCEPT = core.PositionFilter.FilterResult.FILTER_ACCEPT, FILTER_REJECT = core.PositionFilter.FilterResult.FILTER_REJECT; + this.acceptPosition = function(iterator) { + var node = iterator.container(), anchorNode; + if (typeof anchor === "string") { + anchorNode = cursors[anchor].getNode(); + } else { + anchorNode = anchor; + } + if (getRoot(node) === getRoot(anchorNode)) { + return FILTER_ACCEPT; + } + return FILTER_REJECT; + }; +} +ops.OdtDocument = function OdtDocument(odfCanvas) { + var self = this, stepUtils, odfUtils = odf.OdfUtils, domUtils = core.DomUtils, cursors = {}, members = {}, eventNotifier = new core.EventNotifier([ops.Document.signalMemberAdded, ops.Document.signalMemberUpdated, ops.Document.signalMemberRemoved, ops.Document.signalCursorAdded, ops.Document.signalCursorRemoved, ops.Document.signalCursorMoved, ops.OdtDocument.signalParagraphChanged, ops.OdtDocument.signalParagraphStyleModified, ops.OdtDocument.signalCommonStyleCreated, ops.OdtDocument.signalCommonStyleDeleted, + ops.OdtDocument.signalTableAdded, ops.OdtDocument.signalOperationStart, ops.OdtDocument.signalOperationEnd, ops.OdtDocument.signalProcessingBatchStart, ops.OdtDocument.signalProcessingBatchEnd, ops.OdtDocument.signalUndoStackChanged, ops.OdtDocument.signalStepsInserted, ops.OdtDocument.signalStepsRemoved, ops.OdtDocument.signalMetadataUpdated, ops.OdtDocument.signalAnnotationAdded]), NEXT = core.StepDirection.NEXT, filter, stepsTranslator, lastEditingOp, unsupportedMetadataRemoved = false, SHOW_ALL = + NodeFilter.SHOW_ALL, blacklistedNodes = new gui.BlacklistNamespaceNodeFilter(["urn:webodf:names:cursor", "urn:webodf:names:editinfo"]), odfTextBodyFilter = new gui.OdfTextBodyNodeFilter, defaultNodeFilter = new core.NodeFilterChain([blacklistedNodes, odfTextBodyFilter]); + function createPositionIterator(rootNode) { + return new core.PositionIterator(rootNode, SHOW_ALL, defaultNodeFilter, false); + } + this.createPositionIterator = createPositionIterator; + function getRootNode() { + var element = odfCanvas.odfContainer().getContentElement(), localName = element && element.localName; + runtime.assert(localName === "text", "Unsupported content element type '" + localName + "' for OdtDocument"); + return element; + } + this.getDocumentElement = function() { + return odfCanvas.odfContainer().rootElement; + }; + this.cloneDocumentElement = function() { + var rootElement = self.getDocumentElement(), annotationViewManager = odfCanvas.getAnnotationViewManager(), initialDoc; + if (annotationViewManager) { + annotationViewManager.forgetAnnotations(); + } + initialDoc = rootElement.cloneNode(true); + odfCanvas.refreshAnnotations(); + self.fixCursorPositions(); + return initialDoc; + }; + this.setDocumentElement = function(documentElement) { + var odfContainer = odfCanvas.odfContainer(), rootNode; + eventNotifier.unsubscribe(ops.OdtDocument.signalStepsInserted, stepsTranslator.handleStepsInserted); + eventNotifier.unsubscribe(ops.OdtDocument.signalStepsRemoved, stepsTranslator.handleStepsRemoved); + odfContainer.setRootElement(documentElement); + odfCanvas.setOdfContainer(odfContainer, true); + odfCanvas.refreshCSS(); + rootNode = getRootNode(); + stepsTranslator = new ops.OdtStepsTranslator(rootNode, createPositionIterator(rootNode), filter, 500); + eventNotifier.subscribe(ops.OdtDocument.signalStepsInserted, stepsTranslator.handleStepsInserted); + eventNotifier.subscribe(ops.OdtDocument.signalStepsRemoved, stepsTranslator.handleStepsRemoved); + }; + function getDOMDocument() { + return self.getDocumentElement().ownerDocument; + } + this.getDOMDocument = getDOMDocument; + function isRoot(node) { + if (node.namespaceURI === odf.Namespaces.officens && node.localName === "text" || node.namespaceURI === odf.Namespaces.officens && node.localName === "annotation") { + return true; + } + return false; + } + function getRoot(node) { + while (node && !isRoot(node)) { + node = node.parentNode; + } + return node; + } + this.getRootElement = getRoot; + function createStepIterator(container, offset, filters, subTree) { + var positionIterator = createPositionIterator(subTree), filterOrChain, stepIterator; + if (filters.length === 1) { + filterOrChain = filters[0]; + } else { + filterOrChain = new core.PositionFilterChain; + filters.forEach(filterOrChain.addFilter); + } + stepIterator = new core.StepIterator(filterOrChain, positionIterator); + stepIterator.setPosition(container, offset); + return stepIterator; + } + this.createStepIterator = createStepIterator; + function getIteratorAtPosition(position) { + var iterator = createPositionIterator(getRootNode()), point = stepsTranslator.convertStepsToDomPoint(position); + iterator.setUnfilteredPosition(point.node, point.offset); + return iterator; + } + this.getIteratorAtPosition = getIteratorAtPosition; + this.convertCursorStepToDomPoint = function(step) { + return stepsTranslator.convertStepsToDomPoint(step); + }; + function roundUp(step) { + return step === NEXT; + } + this.convertDomPointToCursorStep = function(node, offset, roundDirection) { + var roundingFunc; + if (roundDirection === NEXT) { + roundingFunc = roundUp; + } + return stepsTranslator.convertDomPointToSteps(node, offset, roundingFunc); + }; + this.convertDomToCursorRange = function(selection) { + var point1, point2; + point1 = stepsTranslator.convertDomPointToSteps(selection.anchorNode, selection.anchorOffset); + if (selection.anchorNode === selection.focusNode && selection.anchorOffset === selection.focusOffset) { + point2 = point1; + } else { + point2 = stepsTranslator.convertDomPointToSteps(selection.focusNode, selection.focusOffset); + } + return {position:point1, length:point2 - point1}; + }; + this.convertCursorToDomRange = function(position, length) { + var range = getDOMDocument().createRange(), point1, point2; + point1 = stepsTranslator.convertStepsToDomPoint(position); + if (length) { + point2 = stepsTranslator.convertStepsToDomPoint(position + length); + if (length > 0) { + range.setStart(point1.node, point1.offset); + range.setEnd(point2.node, point2.offset); + } else { + range.setStart(point2.node, point2.offset); + range.setEnd(point1.node, point1.offset); + } + } else { + range.setStart(point1.node, point1.offset); + } + return range; + }; + function getTextNodeAtStep(steps, memberid) { + var iterator = getIteratorAtPosition(steps), node = iterator.container(), lastTextNode, nodeOffset = 0, cursorNode = null, text; + if (node.nodeType === Node.TEXT_NODE) { + lastTextNode = node; + nodeOffset = iterator.unfilteredDomOffset(); + if (lastTextNode.length > 0) { + if (nodeOffset > 0) { + lastTextNode = lastTextNode.splitText(nodeOffset); + } + lastTextNode.parentNode.insertBefore(getDOMDocument().createTextNode(""), lastTextNode); + lastTextNode = lastTextNode.previousSibling; + nodeOffset = 0; + } + } else { + lastTextNode = getDOMDocument().createTextNode(""); + nodeOffset = 0; + node.insertBefore(lastTextNode, iterator.rightNode()); + } + if (memberid) { + if (cursors[memberid] && self.getCursorPosition(memberid) === steps) { + cursorNode = cursors[memberid].getNode(); + while (cursorNode.nextSibling && cursorNode.nextSibling.localName === "cursor") { + cursorNode.parentNode.insertBefore(cursorNode.nextSibling, cursorNode); + } + if (lastTextNode.length > 0 && lastTextNode.nextSibling !== cursorNode) { + lastTextNode = getDOMDocument().createTextNode(""); + nodeOffset = 0; + } + cursorNode.parentNode.insertBefore(lastTextNode, cursorNode); + } + } else { + while (lastTextNode.nextSibling && lastTextNode.nextSibling.localName === "cursor") { + lastTextNode.parentNode.insertBefore(lastTextNode.nextSibling, lastTextNode); + } + } + while (lastTextNode.previousSibling && lastTextNode.previousSibling.nodeType === Node.TEXT_NODE) { + text = lastTextNode.previousSibling; + text.appendData(lastTextNode.data); + nodeOffset = text.length; + lastTextNode = text; + lastTextNode.parentNode.removeChild(lastTextNode.nextSibling); + } + while (lastTextNode.nextSibling && lastTextNode.nextSibling.nodeType === Node.TEXT_NODE) { + text = lastTextNode.nextSibling; + lastTextNode.appendData(text.data); + lastTextNode.parentNode.removeChild(text); + } + return {textNode:lastTextNode, offset:nodeOffset}; + } + function handleOperationExecuted(op) { + var opspec = op.spec(), memberId = opspec.memberid, date = (new Date(opspec.timestamp)).toISOString(), odfContainer = odfCanvas.odfContainer(), changedMetadata, fullName; + if (op.isEdit) { + fullName = self.getMember(memberId).getProperties().fullName; + odfContainer.setMetadata({"dc:creator":fullName, "dc:date":date}, null); + changedMetadata = {setProperties:{"dc:creator":fullName, "dc:date":date}, removedProperties:[]}; + if (!lastEditingOp) { + changedMetadata.setProperties["meta:editing-cycles"] = odfContainer.incrementEditingCycles(); + if (!unsupportedMetadataRemoved) { + odfContainer.setMetadata(null, ["meta:editing-duration", "meta:document-statistic"]); + } + } + lastEditingOp = op; + self.emit(ops.OdtDocument.signalMetadataUpdated, changedMetadata); + } + } + function upgradeWhitespaceToElement(textNode, offset) { + runtime.assert(textNode.data[offset] === " ", "upgradeWhitespaceToElement: textNode.data[offset] should be a literal space"); + var space = textNode.ownerDocument.createElementNS(odf.Namespaces.textns, "text:s"), container = textNode.parentNode, adjacentNode = textNode; + space.appendChild(textNode.ownerDocument.createTextNode(" ")); + if (textNode.length === 1) { + container.replaceChild(space, textNode); + } else { + textNode.deleteData(offset, 1); + if (offset > 0) { + if (offset < textNode.length) { + textNode.splitText(offset); + } + adjacentNode = textNode.nextSibling; + } + container.insertBefore(space, adjacentNode); + } + return space; + } + function upgradeWhitespacesAtPosition(step) { + var positionIterator = getIteratorAtPosition(step), stepIterator = new core.StepIterator(filter, positionIterator), contentBounds, container, offset, stepsToUpgrade = 2; + runtime.assert(stepIterator.isStep(), "positionIterator is not at a step (requested step: " + step + ")"); + do { + contentBounds = stepUtils.getContentBounds(stepIterator); + if (contentBounds) { + container = contentBounds.container; + offset = contentBounds.startOffset; + if (container.nodeType === Node.TEXT_NODE && odfUtils.isSignificantWhitespace(container, offset)) { + container = upgradeWhitespaceToElement(container, offset); + stepIterator.setPosition(container, container.childNodes.length); + stepIterator.roundToPreviousStep(); + } + } + stepsToUpgrade -= 1; + } while (stepsToUpgrade > 0 && stepIterator.nextStep()); + } + this.upgradeWhitespacesAtPosition = upgradeWhitespacesAtPosition; + function maxOffset(node) { + return node.nodeType === Node.TEXT_NODE ? node.length : node.childNodes.length; + } + function downgradeWhitespaces(stepIterator) { + var contentBounds, container, modifiedNodes = [], lastChild, stepsToUpgrade = 2; + runtime.assert(stepIterator.isStep(), "positionIterator is not at a step"); + do { + contentBounds = stepUtils.getContentBounds(stepIterator); + if (contentBounds) { + container = contentBounds.container; + if (odfUtils.isDowngradableSpaceElement(container)) { + lastChild = container.lastChild; + while (container.firstChild) { + modifiedNodes.push(container.firstChild); + container.parentNode.insertBefore(container.firstChild, container); + } + container.parentNode.removeChild(container); + stepIterator.setPosition(lastChild, maxOffset(lastChild)); + stepIterator.roundToPreviousStep(); + } + } + stepsToUpgrade -= 1; + } while (stepsToUpgrade > 0 && stepIterator.nextStep()); + modifiedNodes.forEach(domUtils.normalizeTextNodes); + } + this.downgradeWhitespaces = downgradeWhitespaces; + this.downgradeWhitespacesAtPosition = function(step) { + var positionIterator = getIteratorAtPosition(step), stepIterator = new core.StepIterator(filter, positionIterator); + downgradeWhitespaces(stepIterator); + }; + this.getTextNodeAtStep = getTextNodeAtStep; + function paragraphOrRoot(container, offset, root) { + var node = container.childNodes.item(offset) || container, paragraph = odfUtils.getParagraphElement(node); + if (paragraph && domUtils.containsNode(root, paragraph)) { + return paragraph; + } + return root; + } + this.fixCursorPositions = function() { + Object.keys(cursors).forEach(function(memberId) { + var cursor = cursors[memberId], root = getRoot(cursor.getNode()), rootFilter = self.createRootFilter(root), subTree, startPoint, endPoint, selectedRange, cursorMoved = false; + selectedRange = cursor.getSelectedRange(); + subTree = paragraphOrRoot(selectedRange.startContainer, selectedRange.startOffset, root); + startPoint = createStepIterator(selectedRange.startContainer, selectedRange.startOffset, [filter, rootFilter], subTree); + if (!selectedRange.collapsed) { + subTree = paragraphOrRoot(selectedRange.endContainer, selectedRange.endOffset, root); + endPoint = createStepIterator(selectedRange.endContainer, selectedRange.endOffset, [filter, rootFilter], subTree); + } else { + endPoint = startPoint; + } + if (!startPoint.isStep() || !endPoint.isStep()) { + cursorMoved = true; + runtime.assert(startPoint.roundToClosestStep(), "No walkable step found for cursor owned by " + memberId); + selectedRange.setStart(startPoint.container(), startPoint.offset()); + runtime.assert(endPoint.roundToClosestStep(), "No walkable step found for cursor owned by " + memberId); + selectedRange.setEnd(endPoint.container(), endPoint.offset()); + } else { + if (startPoint.container() === endPoint.container() && startPoint.offset() === endPoint.offset()) { + if (!selectedRange.collapsed || cursor.getAnchorNode() !== cursor.getNode()) { + cursorMoved = true; + selectedRange.setStart(startPoint.container(), startPoint.offset()); + selectedRange.collapse(true); + } + } + } + if (cursorMoved) { + cursor.setSelectedRange(selectedRange, cursor.hasForwardSelection()); + self.emit(ops.Document.signalCursorMoved, cursor); + } + }); + }; + this.getCursorPosition = function(memberid) { + var cursor = cursors[memberid]; + return cursor ? stepsTranslator.convertDomPointToSteps(cursor.getNode(), 0) : 0; + }; + this.getCursorSelection = function(memberid) { + var cursor = cursors[memberid], focusPosition = 0, anchorPosition = 0; + if (cursor) { + focusPosition = stepsTranslator.convertDomPointToSteps(cursor.getNode(), 0); + anchorPosition = stepsTranslator.convertDomPointToSteps(cursor.getAnchorNode(), 0); + } + return {position:anchorPosition, length:focusPosition - anchorPosition}; + }; + this.getPositionFilter = function() { + return filter; + }; + this.getOdfCanvas = function() { + return odfCanvas; + }; + this.getCanvas = function() { + return odfCanvas; + }; + this.getRootNode = getRootNode; + this.addMember = function(member) { + runtime.assert(members[member.getMemberId()] === undefined, "This member already exists"); + members[member.getMemberId()] = member; + }; + this.getMember = function(memberId) { + return members.hasOwnProperty(memberId) ? members[memberId] : null; + }; + this.removeMember = function(memberId) { + delete members[memberId]; + }; + this.getCursor = function(memberid) { + return cursors[memberid]; + }; + this.hasCursor = function(memberid) { + return cursors.hasOwnProperty(memberid); + }; + this.getMemberIds = function() { + return Object.keys(members); + }; + this.addCursor = function(cursor) { + runtime.assert(Boolean(cursor), "OdtDocument::addCursor without cursor"); + var memberid = cursor.getMemberId(), initialSelection = self.convertCursorToDomRange(0, 0); + runtime.assert(typeof memberid === "string", "OdtDocument::addCursor has cursor without memberid"); + runtime.assert(!cursors[memberid], "OdtDocument::addCursor is adding a duplicate cursor with memberid " + memberid); + cursor.setSelectedRange(initialSelection, true); + cursors[memberid] = cursor; + }; + this.removeCursor = function(memberid) { + var cursor = cursors[memberid]; + if (cursor) { + cursor.removeFromDocument(); + delete cursors[memberid]; + self.emit(ops.Document.signalCursorRemoved, memberid); + return true; + } + return false; + }; + this.moveCursor = function(memberid, position, length, selectionType) { + var cursor = cursors[memberid], selectionRange = self.convertCursorToDomRange(position, length); + if (cursor) { + cursor.setSelectedRange(selectionRange, length >= 0); + cursor.setSelectionType(selectionType || ops.OdtCursor.RangeSelection); + } + }; + this.getFormatting = function() { + return odfCanvas.getFormatting(); + }; + this.emit = function(eventid, args) { + eventNotifier.emit(eventid, args); + }; + this.subscribe = function(eventid, cb) { + eventNotifier.subscribe(eventid, cb); + }; + this.unsubscribe = function(eventid, cb) { + eventNotifier.unsubscribe(eventid, cb); + }; + this.createRootFilter = function(inputMemberId) { + return new RootFilter(inputMemberId, cursors, getRoot); + }; + this.close = function(callback) { + callback(); + }; + this.destroy = function(callback) { + callback(); + }; + function init() { + var rootNode = getRootNode(); + filter = new ops.TextPositionFilter; + stepUtils = new odf.StepUtils; + stepsTranslator = new ops.OdtStepsTranslator(rootNode, createPositionIterator(rootNode), filter, 500); + eventNotifier.subscribe(ops.OdtDocument.signalStepsInserted, stepsTranslator.handleStepsInserted); + eventNotifier.subscribe(ops.OdtDocument.signalStepsRemoved, stepsTranslator.handleStepsRemoved); + eventNotifier.subscribe(ops.OdtDocument.signalOperationEnd, handleOperationExecuted); + eventNotifier.subscribe(ops.OdtDocument.signalProcessingBatchEnd, core.Task.processTasks); + } + init(); +}; +ops.OdtDocument.signalParagraphChanged = "paragraph/changed"; +ops.OdtDocument.signalTableAdded = "table/added"; +ops.OdtDocument.signalCommonStyleCreated = "style/created"; +ops.OdtDocument.signalCommonStyleDeleted = "style/deleted"; +ops.OdtDocument.signalParagraphStyleModified = "paragraphstyle/modified"; +ops.OdtDocument.signalOperationStart = "operation/start"; +ops.OdtDocument.signalOperationEnd = "operation/end"; +ops.OdtDocument.signalProcessingBatchStart = "router/batchstart"; +ops.OdtDocument.signalProcessingBatchEnd = "router/batchend"; +ops.OdtDocument.signalUndoStackChanged = "undo/changed"; +ops.OdtDocument.signalStepsInserted = "steps/inserted"; +ops.OdtDocument.signalStepsRemoved = "steps/removed"; +ops.OdtDocument.signalMetadataUpdated = "metadata/updated"; +ops.OdtDocument.signalAnnotationAdded = "annotation/added"; +ops.OpAddAnnotation = function OpAddAnnotation() { + var memberid, timestamp, position, length, name, doc; + this.init = function(data) { + memberid = data.memberid; + timestamp = parseInt(data.timestamp, 10); + position = parseInt(data.position, 10); + length = data.length !== undefined ? parseInt(data.length, 10) || 0 : undefined; + name = data.name; + }; + this.isEdit = true; + this.group = undefined; + function createAnnotationNode(odtDocument, date) { + var annotationNode, creatorNode, dateNode, listNode, listItemNode, paragraphNode; + annotationNode = doc.createElementNS(odf.Namespaces.officens, "office:annotation"); + annotationNode.setAttributeNS(odf.Namespaces.officens, "office:name", name); + creatorNode = doc.createElementNS(odf.Namespaces.dcns, "dc:creator"); + creatorNode.setAttributeNS("urn:webodf:names:editinfo", "editinfo:memberid", memberid); + creatorNode.textContent = odtDocument.getMember(memberid).getProperties().fullName; + dateNode = doc.createElementNS(odf.Namespaces.dcns, "dc:date"); + dateNode.appendChild(doc.createTextNode(date.toISOString())); + listNode = doc.createElementNS(odf.Namespaces.textns, "text:list"); + listItemNode = doc.createElementNS(odf.Namespaces.textns, "text:list-item"); + paragraphNode = doc.createElementNS(odf.Namespaces.textns, "text:p"); + listItemNode.appendChild(paragraphNode); + listNode.appendChild(listItemNode); + annotationNode.appendChild(creatorNode); + annotationNode.appendChild(dateNode); + annotationNode.appendChild(listNode); + return annotationNode; + } + function createAnnotationEnd() { + var annotationEnd; + annotationEnd = doc.createElementNS(odf.Namespaces.officens, "office:annotation-end"); + annotationEnd.setAttributeNS(odf.Namespaces.officens, "office:name", name); + return annotationEnd; + } + function insertNodeAtPosition(odtDocument, node, insertPosition) { + var previousNode, parentNode, domPosition = odtDocument.getTextNodeAtStep(insertPosition, memberid); + if (domPosition) { + previousNode = domPosition.textNode; + parentNode = previousNode.parentNode; + if (domPosition.offset !== previousNode.length) { + previousNode.splitText(domPosition.offset); + } + parentNode.insertBefore(node, previousNode.nextSibling); + if (previousNode.length === 0) { + parentNode.removeChild(previousNode); + } + } + } + this.execute = function(document) { + var odtDocument = document, annotation, annotationEnd, cursor = odtDocument.getCursor(memberid), selectedRange, paragraphElement; + doc = odtDocument.getDOMDocument(); + annotation = createAnnotationNode(odtDocument, new Date(timestamp)); + if (length !== undefined) { + annotationEnd = createAnnotationEnd(); + annotation.annotationEndElement = annotationEnd; + insertNodeAtPosition(odtDocument, annotationEnd, position + length); + } + insertNodeAtPosition(odtDocument, annotation, position); + odtDocument.emit(ops.OdtDocument.signalStepsInserted, {position:position}); + if (cursor) { + selectedRange = doc.createRange(); + paragraphElement = annotation.getElementsByTagNameNS(odf.Namespaces.textns, "p")[0]; + selectedRange.selectNodeContents(paragraphElement); + cursor.setSelectedRange(selectedRange, false); + cursor.setSelectionType(ops.OdtCursor.RangeSelection); + odtDocument.emit(ops.Document.signalCursorMoved, cursor); + } + odtDocument.getOdfCanvas().addAnnotation(annotation); + odtDocument.fixCursorPositions(); + odtDocument.emit(ops.OdtDocument.signalAnnotationAdded, {memberId:memberid, annotation:annotation}); + return true; + }; + this.spec = function() { + return {optype:"AddAnnotation", memberid:memberid, timestamp:timestamp, position:position, length:length, name:name}; + }; +}; +ops.OpAddAnnotation.Spec; +ops.OpAddAnnotation.InitSpec; +ops.OpAddCursor = function OpAddCursor() { + var memberid, timestamp; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + }; + this.isEdit = false; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, cursor = odtDocument.getCursor(memberid); + if (cursor) { + return false; + } + cursor = new ops.OdtCursor(memberid, odtDocument); + odtDocument.addCursor(cursor); + odtDocument.emit(ops.Document.signalCursorAdded, cursor); + return true; + }; + this.spec = function() { + return {optype:"AddCursor", memberid:memberid, timestamp:timestamp}; + }; +}; +ops.OpAddCursor.Spec; +ops.OpAddCursor.InitSpec; +ops.OpAddMember = function OpAddMember() { + var memberid, timestamp, setProperties; + this.init = function(data) { + memberid = data.memberid; + timestamp = parseInt(data.timestamp, 10); + setProperties = data.setProperties; + }; + this.isEdit = false; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, member; + if (odtDocument.getMember(memberid)) { + return false; + } + member = new ops.Member(memberid, setProperties); + odtDocument.addMember(member); + odtDocument.emit(ops.Document.signalMemberAdded, member); + return true; + }; + this.spec = function() { + return {optype:"AddMember", memberid:memberid, timestamp:timestamp, setProperties:setProperties}; + }; +}; +ops.OpAddMember.Spec; +ops.OpAddMember.InitSpec; +ops.OpAddStyle = function OpAddStyle() { + var memberid, timestamp, styleName, styleFamily, isAutomaticStyle, setProperties, stylens = odf.Namespaces.stylens; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + styleName = data.styleName; + styleFamily = data.styleFamily; + isAutomaticStyle = data.isAutomaticStyle === "true" || data.isAutomaticStyle === true; + setProperties = data.setProperties; + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, odfContainer = odtDocument.getOdfCanvas().odfContainer(), formatting = odtDocument.getFormatting(), dom = odtDocument.getDOMDocument(), styleNode = dom.createElementNS(stylens, "style:style"); + if (!styleNode) { + return false; + } + if (setProperties) { + formatting.updateStyle(styleNode, setProperties); + } + styleNode.setAttributeNS(stylens, "style:family", styleFamily); + styleNode.setAttributeNS(stylens, "style:name", styleName); + if (isAutomaticStyle) { + odfContainer.rootElement.automaticStyles.appendChild(styleNode); + } else { + odfContainer.rootElement.styles.appendChild(styleNode); + } + odtDocument.getOdfCanvas().refreshCSS(); + if (!isAutomaticStyle) { + odtDocument.emit(ops.OdtDocument.signalCommonStyleCreated, {name:styleName, family:styleFamily}); + } + return true; + }; + this.spec = function() { + return {optype:"AddStyle", memberid:memberid, timestamp:timestamp, styleName:styleName, styleFamily:styleFamily, isAutomaticStyle:isAutomaticStyle, setProperties:setProperties}; + }; +}; +ops.OpAddStyle.Spec; +ops.OpAddStyle.InitSpec; +odf.ObjectNameGenerator = function ObjectNameGenerator(odfContainer, memberId) { + var stylens = odf.Namespaces.stylens, drawns = odf.Namespaces.drawns, xlinkns = odf.Namespaces.xlinkns, utils = new core.Utils, memberIdHash = utils.hashString(memberId), styleNameGenerator = null, frameNameGenerator = null, imageNameGenerator = null, existingFrameNames = {}, existingImageNames = {}; + function NameGenerator(prefix, findExistingNames) { + var reportedNames = {}; + this.generateName = function() { + var existingNames = findExistingNames(), startIndex = 0, name; + do { + name = prefix + startIndex; + startIndex += 1; + } while (reportedNames[name] || existingNames[name]); + reportedNames[name] = true; + return name; + }; + } + function getAllStyleNames() { + var styleElements = [odfContainer.rootElement.automaticStyles, odfContainer.rootElement.styles], styleNames = {}; + function getStyleNames(styleListElement) { + var e = styleListElement.firstElementChild; + while (e) { + if (e.namespaceURI === stylens && e.localName === "style") { + styleNames[e.getAttributeNS(stylens, "name")] = true; + } + e = e.nextElementSibling; + } + } + styleElements.forEach(getStyleNames); + return styleNames; + } + this.generateStyleName = function() { + if (styleNameGenerator === null) { + styleNameGenerator = new NameGenerator("auto" + memberIdHash + "_", function() { + return getAllStyleNames(); + }); + } + return styleNameGenerator.generateName(); + }; + this.generateFrameName = function() { + var i, nodes, node; + if (frameNameGenerator === null) { + nodes = odfContainer.rootElement.body.getElementsByTagNameNS(drawns, "frame"); + for (i = 0;i < nodes.length;i += 1) { + node = nodes.item(i); + existingFrameNames[node.getAttributeNS(drawns, "name")] = true; + } + frameNameGenerator = new NameGenerator("fr" + memberIdHash + "_", function() { + return existingFrameNames; + }); + } + return frameNameGenerator.generateName(); + }; + this.generateImageName = function() { + var i, path, nodes, node; + if (imageNameGenerator === null) { + nodes = odfContainer.rootElement.body.getElementsByTagNameNS(drawns, "image"); + for (i = 0;i < nodes.length;i += 1) { + node = nodes.item(i); + path = node.getAttributeNS(xlinkns, "href"); + path = path.substring("Pictures/".length, path.lastIndexOf(".")); + existingImageNames[path] = true; + } + imageNameGenerator = new NameGenerator("img" + memberIdHash + "_", function() { + return existingImageNames; + }); + } + return imageNameGenerator.generateName(); + }; +}; +odf.TextStyleApplicator = function TextStyleApplicator(objectNameGenerator, formatting, automaticStyles) { + var domUtils = core.DomUtils, textns = odf.Namespaces.textns, stylens = odf.Namespaces.stylens, textProperties = "style:text-properties", webodfns = "urn:webodf:names:scope"; + function StyleLookup(info) { + var cachedAppliedStyles = {}; + function compare(expected, actual) { + if (typeof expected === "object" && typeof actual === "object") { + return Object.keys(expected).every(function(key) { + return compare(expected[key], actual[key]); + }); + } + return expected === actual; + } + this.isStyleApplied = function(textNode) { + var appliedStyle = formatting.getAppliedStylesForElement(textNode, cachedAppliedStyles).styleProperties; + return compare(info, appliedStyle); + }; + } + function StyleManager(info) { + var createdStyles = {}; + function createDirectFormat(existingStyleName, document) { + var derivedStyleInfo, derivedStyleNode; + derivedStyleInfo = existingStyleName ? formatting.createDerivedStyleObject(existingStyleName, "text", info) : info; + derivedStyleNode = document.createElementNS(stylens, "style:style"); + formatting.updateStyle(derivedStyleNode, derivedStyleInfo); + derivedStyleNode.setAttributeNS(stylens, "style:name", objectNameGenerator.generateStyleName()); + derivedStyleNode.setAttributeNS(stylens, "style:family", "text"); + derivedStyleNode.setAttributeNS(webodfns, "scope", "document-content"); + automaticStyles.appendChild(derivedStyleNode); + return derivedStyleNode; + } + function getDirectStyle(existingStyleName, document) { + existingStyleName = existingStyleName || ""; + if (!createdStyles.hasOwnProperty(existingStyleName)) { + createdStyles[existingStyleName] = createDirectFormat(existingStyleName, document); + } + return createdStyles[existingStyleName].getAttributeNS(stylens, "name"); + } + this.applyStyleToContainer = function(container) { + var name = getDirectStyle(container.getAttributeNS(textns, "style-name"), container.ownerDocument); + container.setAttributeNS(textns, "text:style-name", name); + }; + } + function isTextSpan(node) { + return node.localName === "span" && node.namespaceURI === textns; + } + function moveToNewSpan(startNode, range) { + var document = startNode.ownerDocument, originalContainer = startNode.parentNode, styledContainer, trailingContainer, moveTrailing, node, nextNode, loopGuard = new core.LoopWatchDog(1E4), styledNodes = []; + styledNodes.push(startNode); + node = startNode.nextSibling; + while (node && domUtils.rangeContainsNode(range, node)) { + loopGuard.check(); + styledNodes.push(node); + node = node.nextSibling; + } + if (!isTextSpan(originalContainer)) { + styledContainer = document.createElementNS(textns, "text:span"); + originalContainer.insertBefore(styledContainer, startNode); + moveTrailing = false; + } else { + if (startNode.previousSibling && !domUtils.rangeContainsNode(range, originalContainer.firstChild)) { + styledContainer = originalContainer.cloneNode(false); + originalContainer.parentNode.insertBefore(styledContainer, originalContainer.nextSibling); + moveTrailing = true; + } else { + styledContainer = originalContainer; + moveTrailing = true; + } + } + styledNodes.forEach(function(n) { + if (n.parentNode !== styledContainer) { + styledContainer.appendChild(n); + } + }); + if (node && moveTrailing) { + trailingContainer = styledContainer.cloneNode(false); + styledContainer.parentNode.insertBefore(trailingContainer, styledContainer.nextSibling); + while (node) { + loopGuard.check(); + nextNode = node.nextSibling; + trailingContainer.appendChild(node); + node = nextNode; + } + } + return styledContainer; + } + this.applyStyle = function(textNodes, range, info) { + var textPropsOnly = {}, isStyled, container, styleCache, styleLookup; + runtime.assert(info && info.hasOwnProperty(textProperties), "applyStyle without any text properties"); + textPropsOnly[textProperties] = info[textProperties]; + styleCache = new StyleManager(textPropsOnly); + styleLookup = new StyleLookup(textPropsOnly); + function apply(n) { + isStyled = styleLookup.isStyleApplied(n); + if (isStyled === false) { + container = moveToNewSpan(n, range); + styleCache.applyStyleToContainer(container); + } + } + textNodes.forEach(apply); + }; +}; +ops.OpApplyDirectStyling = function OpApplyDirectStyling() { + var memberid, timestamp, position, length, setProperties, odfUtils = odf.OdfUtils, domUtils = core.DomUtils; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = parseInt(data.position, 10); + length = parseInt(data.length, 10); + setProperties = data.setProperties; + }; + this.isEdit = true; + this.group = undefined; + function applyStyle(odtDocument, range, info) { + var odfCanvas = odtDocument.getOdfCanvas(), odfContainer = odfCanvas.odfContainer(), nextTextNodes = domUtils.splitBoundaries(range), textNodes = odfUtils.getTextNodes(range, false), textStyles; + textStyles = new odf.TextStyleApplicator(new odf.ObjectNameGenerator(odfContainer, memberid), odtDocument.getFormatting(), odfContainer.rootElement.automaticStyles); + textStyles.applyStyle(textNodes, range, info); + nextTextNodes.forEach(domUtils.normalizeTextNodes); + } + this.execute = function(document) { + var odtDocument = document, range = odtDocument.convertCursorToDomRange(position, length), impactedParagraphs = odfUtils.getParagraphElements(range); + applyStyle(odtDocument, range, setProperties); + range.detach(); + odtDocument.getOdfCanvas().refreshCSS(); + odtDocument.fixCursorPositions(); + impactedParagraphs.forEach(function(n) { + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:n, memberId:memberid, timeStamp:timestamp}); + }); + odtDocument.getOdfCanvas().rerenderAnnotations(); + return true; + }; + this.spec = function() { + return {optype:"ApplyDirectStyling", memberid:memberid, timestamp:timestamp, position:position, length:length, setProperties:setProperties}; + }; +}; +ops.OpApplyDirectStyling.Spec; +ops.OpApplyDirectStyling.InitSpec; +ops.OpApplyHyperlink = function OpApplyHyperlink() { + var memberid, timestamp, position, length, hyperlink, domUtils = core.DomUtils, odfUtils = odf.OdfUtils; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = data.position; + length = data.length; + hyperlink = data.hyperlink; + }; + this.isEdit = true; + this.group = undefined; + function createHyperlink(document, hyperlink) { + var node = document.createElementNS(odf.Namespaces.textns, "text:a"); + node.setAttributeNS(odf.Namespaces.xlinkns, "xlink:type", "simple"); + node.setAttributeNS(odf.Namespaces.xlinkns, "xlink:href", hyperlink); + return node; + } + function isPartOfLink(node) { + while (node) { + if (odfUtils.isHyperlink(node)) { + return true; + } + node = node.parentNode; + } + return false; + } + this.execute = function(document) { + var odtDocument = document, ownerDocument = odtDocument.getDOMDocument(), range = odtDocument.convertCursorToDomRange(position, length), boundaryNodes = domUtils.splitBoundaries(range), modifiedParagraphs = [], textNodes = odfUtils.getTextNodes(range, false); + if (textNodes.length === 0) { + return false; + } + textNodes.forEach(function(node) { + var linkNode, paragraph = odfUtils.getParagraphElement(node); + runtime.assert(isPartOfLink(node) === false, "The given range should not contain any link."); + linkNode = createHyperlink(ownerDocument, hyperlink); + node.parentNode.insertBefore(linkNode, node); + linkNode.appendChild(node); + if (modifiedParagraphs.indexOf(paragraph) === -1) { + modifiedParagraphs.push(paragraph); + } + }); + boundaryNodes.forEach(domUtils.normalizeTextNodes); + range.detach(); + odtDocument.fixCursorPositions(); + odtDocument.getOdfCanvas().refreshSize(); + odtDocument.getOdfCanvas().rerenderAnnotations(); + modifiedParagraphs.forEach(function(paragraph) { + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:paragraph, memberId:memberid, timeStamp:timestamp}); + }); + return true; + }; + this.spec = function() { + return {optype:"ApplyHyperlink", memberid:memberid, timestamp:timestamp, position:position, length:length, hyperlink:hyperlink}; + }; +}; +ops.OpApplyHyperlink.Spec; +ops.OpApplyHyperlink.InitSpec; +ops.OpInsertImage = function OpInsertImage() { + var memberid, timestamp, position, filename, frameWidth, frameHeight, frameStyleName, frameName, drawns = odf.Namespaces.drawns, svgns = odf.Namespaces.svgns, textns = odf.Namespaces.textns, xlinkns = odf.Namespaces.xlinkns, odfUtils = odf.OdfUtils; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = data.position; + filename = data.filename; + frameWidth = data.frameWidth; + frameHeight = data.frameHeight; + frameStyleName = data.frameStyleName; + frameName = data.frameName; + }; + this.isEdit = true; + this.group = undefined; + function createFrameElement(document) { + var imageNode = document.createElementNS(drawns, "draw:image"), frameNode = document.createElementNS(drawns, "draw:frame"); + imageNode.setAttributeNS(xlinkns, "xlink:href", filename); + imageNode.setAttributeNS(xlinkns, "xlink:type", "simple"); + imageNode.setAttributeNS(xlinkns, "xlink:show", "embed"); + imageNode.setAttributeNS(xlinkns, "xlink:actuate", "onLoad"); + frameNode.setAttributeNS(drawns, "draw:style-name", frameStyleName); + frameNode.setAttributeNS(drawns, "draw:name", frameName); + frameNode.setAttributeNS(textns, "text:anchor-type", "as-char"); + frameNode.setAttributeNS(svgns, "svg:width", frameWidth); + frameNode.setAttributeNS(svgns, "svg:height", frameHeight); + frameNode.appendChild(imageNode); + return frameNode; + } + this.execute = function(document) { + var odtDocument = document, odfCanvas = odtDocument.getOdfCanvas(), domPosition = odtDocument.getTextNodeAtStep(position, memberid), textNode, refNode, paragraphElement, frameElement; + if (!domPosition) { + return false; + } + textNode = domPosition.textNode; + paragraphElement = odfUtils.getParagraphElement(textNode); + refNode = domPosition.offset !== textNode.length ? textNode.splitText(domPosition.offset) : textNode.nextSibling; + frameElement = createFrameElement(odtDocument.getDOMDocument()); + textNode.parentNode.insertBefore(frameElement, refNode); + odtDocument.emit(ops.OdtDocument.signalStepsInserted, {position:position}); + if (textNode.length === 0) { + textNode.parentNode.removeChild(textNode); + } + odfCanvas.addCssForFrameWithImage(frameElement); + odfCanvas.refreshCSS(); + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:paragraphElement, memberId:memberid, timeStamp:timestamp}); + odfCanvas.rerenderAnnotations(); + return true; + }; + this.spec = function() { + return {optype:"InsertImage", memberid:memberid, timestamp:timestamp, filename:filename, position:position, frameWidth:frameWidth, frameHeight:frameHeight, frameStyleName:frameStyleName, frameName:frameName}; + }; +}; +ops.OpInsertImage.Spec; +ops.OpInsertImage.InitSpec; +ops.OpInsertTable = function OpInsertTable() { + var memberid, timestamp, initialRows, initialColumns, position, tableName, tableStyleName, tableColumnStyleName, tableCellStyleMatrix, tablens = "urn:oasis:names:tc:opendocument:xmlns:table:1.0", textns = "urn:oasis:names:tc:opendocument:xmlns:text:1.0", odfUtils = odf.OdfUtils; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = data.position; + initialRows = data.initialRows; + initialColumns = data.initialColumns; + tableName = data.tableName; + tableStyleName = data.tableStyleName; + tableColumnStyleName = data.tableColumnStyleName; + tableCellStyleMatrix = data.tableCellStyleMatrix; + }; + this.isEdit = true; + this.group = undefined; + function getCellStyleName(row, column) { + var rowStyles; + if (tableCellStyleMatrix.length === 1) { + rowStyles = tableCellStyleMatrix[0]; + } else { + if (tableCellStyleMatrix.length === 3) { + switch(row) { + case 0: + rowStyles = tableCellStyleMatrix[0]; + break; + case initialRows - 1: + rowStyles = tableCellStyleMatrix[2]; + break; + default: + rowStyles = tableCellStyleMatrix[1]; + break; + } + } else { + rowStyles = tableCellStyleMatrix[row]; + } + } + if (rowStyles.length === 1) { + return rowStyles[0]; + } + if (rowStyles.length === 3) { + switch(column) { + case 0: + return rowStyles[0]; + case initialColumns - 1: + return rowStyles[2]; + default: + return rowStyles[1]; + } + } + return rowStyles[column]; + } + function createTableNode(document) { + var tableNode = document.createElementNS(tablens, "table:table"), columns = document.createElementNS(tablens, "table:table-column"), row, cell, paragraph, rowCounter, columnCounter, cellStyleName; + if (tableStyleName) { + tableNode.setAttributeNS(tablens, "table:style-name", tableStyleName); + } + if (tableName) { + tableNode.setAttributeNS(tablens, "table:name", tableName); + } + columns.setAttributeNS(tablens, "table:number-columns-repeated", initialColumns); + if (tableColumnStyleName) { + columns.setAttributeNS(tablens, "table:style-name", tableColumnStyleName); + } + tableNode.appendChild(columns); + for (rowCounter = 0;rowCounter < initialRows;rowCounter += 1) { + row = document.createElementNS(tablens, "table:table-row"); + for (columnCounter = 0;columnCounter < initialColumns;columnCounter += 1) { + cell = document.createElementNS(tablens, "table:table-cell"); + cellStyleName = getCellStyleName(rowCounter, columnCounter); + if (cellStyleName) { + cell.setAttributeNS(tablens, "table:style-name", cellStyleName); + } + paragraph = document.createElementNS(textns, "text:p"); + cell.appendChild(paragraph); + row.appendChild(cell); + } + tableNode.appendChild(row); + } + return tableNode; + } + this.execute = function(document) { + var odtDocument = document, domPosition = odtDocument.getTextNodeAtStep(position), rootNode = odtDocument.getRootNode(), previousSibling, tableNode; + if (domPosition) { + tableNode = createTableNode(odtDocument.getDOMDocument()); + previousSibling = odfUtils.getParagraphElement(domPosition.textNode); + rootNode.insertBefore(tableNode, previousSibling.nextSibling); + odtDocument.emit(ops.OdtDocument.signalStepsInserted, {position:position}); + odtDocument.getOdfCanvas().refreshSize(); + odtDocument.emit(ops.OdtDocument.signalTableAdded, {tableElement:tableNode, memberId:memberid, timeStamp:timestamp}); + odtDocument.getOdfCanvas().rerenderAnnotations(); + return true; + } + return false; + }; + this.spec = function() { + return {optype:"InsertTable", memberid:memberid, timestamp:timestamp, position:position, initialRows:initialRows, initialColumns:initialColumns, tableName:tableName, tableStyleName:tableStyleName, tableColumnStyleName:tableColumnStyleName, tableCellStyleMatrix:tableCellStyleMatrix}; + }; +}; +ops.OpInsertTable.Spec; +ops.OpInsertTable.InitSpec; +ops.OpInsertText = function OpInsertText() { + var tab = "\t", memberid, timestamp, position, moveCursor, text, odfUtils = odf.OdfUtils; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = data.position; + text = data.text; + moveCursor = data.moveCursor === "true" || data.moveCursor === true; + }; + this.isEdit = true; + this.group = undefined; + function triggerLayoutInWebkit(textNode) { + var parent = textNode.parentNode, next = textNode.nextSibling; + parent.removeChild(textNode); + parent.insertBefore(textNode, next); + } + function isNonTabWhiteSpace(character) { + return character !== tab && odfUtils.isODFWhitespace(character); + } + function requiresSpaceElement(text, index) { + return isNonTabWhiteSpace(text[index]) && (index === 0 || index === text.length - 1 || isNonTabWhiteSpace(text[index - 1])); + } + this.execute = function(document) { + var odtDocument = document, domPosition, previousNode, parentElement, nextNode = null, ownerDocument = odtDocument.getDOMDocument(), paragraphElement, textns = "urn:oasis:names:tc:opendocument:xmlns:text:1.0", toInsertIndex = 0, spaceElement, cursor = odtDocument.getCursor(memberid), i; + function insertTextNode(toInsertText) { + parentElement.insertBefore(ownerDocument.createTextNode(toInsertText), nextNode); + } + odtDocument.upgradeWhitespacesAtPosition(position); + domPosition = odtDocument.getTextNodeAtStep(position); + if (domPosition) { + previousNode = domPosition.textNode; + nextNode = previousNode.nextSibling; + parentElement = previousNode.parentNode; + paragraphElement = odfUtils.getParagraphElement(previousNode); + for (i = 0;i < text.length;i += 1) { + if (text[i] === tab || requiresSpaceElement(text, i)) { + if (toInsertIndex === 0) { + if (domPosition.offset !== previousNode.length) { + nextNode = previousNode.splitText(domPosition.offset); + } + if (0 < i) { + previousNode.appendData(text.substring(0, i)); + } + } else { + if (toInsertIndex < i) { + insertTextNode(text.substring(toInsertIndex, i)); + } + } + toInsertIndex = i + 1; + if (text[i] === tab) { + spaceElement = ownerDocument.createElementNS(textns, "text:tab"); + spaceElement.appendChild(ownerDocument.createTextNode("\t")); + } else { + if (text[i] !== " ") { + runtime.log("WARN: InsertText operation contains non-tab, non-space whitespace character (character code " + text.charCodeAt(i) + ")"); + } + spaceElement = ownerDocument.createElementNS(textns, "text:s"); + spaceElement.appendChild(ownerDocument.createTextNode(" ")); + } + parentElement.insertBefore(spaceElement, nextNode); + } + } + if (toInsertIndex === 0) { + previousNode.insertData(domPosition.offset, text); + } else { + if (toInsertIndex < text.length) { + insertTextNode(text.substring(toInsertIndex)); + } + } + triggerLayoutInWebkit(previousNode); + if (previousNode.length === 0) { + previousNode.parentNode.removeChild(previousNode); + } + odtDocument.emit(ops.OdtDocument.signalStepsInserted, {position:position}); + if (cursor && moveCursor) { + odtDocument.moveCursor(memberid, position + text.length, 0); + odtDocument.emit(ops.Document.signalCursorMoved, cursor); + } + odtDocument.downgradeWhitespacesAtPosition(position); + odtDocument.downgradeWhitespacesAtPosition(position + text.length); + odtDocument.getOdfCanvas().refreshSize(); + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:paragraphElement, memberId:memberid, timeStamp:timestamp}); + odtDocument.getOdfCanvas().rerenderAnnotations(); + return true; + } + return false; + }; + this.spec = function() { + return {optype:"InsertText", memberid:memberid, timestamp:timestamp, position:position, text:text, moveCursor:moveCursor}; + }; +}; +ops.OpInsertText.Spec; +ops.OpInsertText.InitSpec; +odf.CollapsingRules = function CollapsingRules(rootNode) { + var odfUtils = odf.OdfUtils, domUtils = core.DomUtils; + function filterOdfNodesToRemove(node) { + var isToRemove = odfUtils.isODFNode(node) || node.localName === "br" && odfUtils.isLineBreak(node.parentNode) || node.nodeType === Node.TEXT_NODE && odfUtils.isODFNode(node.parentNode); + return isToRemove ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; + } + function isCollapsibleContainer(node) { + return !odfUtils.isParagraph(node) && node !== rootNode && odfUtils.hasNoODFContent(node); + } + function mergeChildrenIntoParent(targetNode) { + var parent; + if (targetNode.nodeType === Node.TEXT_NODE) { + parent = targetNode.parentNode; + parent.removeChild(targetNode); + } else { + parent = domUtils.removeUnwantedNodes(targetNode, filterOdfNodesToRemove); + } + if (parent && isCollapsibleContainer(parent)) { + return mergeChildrenIntoParent(parent); + } + return parent; + } + this.mergeChildrenIntoParent = mergeChildrenIntoParent; +}; +ops.OpMergeParagraph = function OpMergeParagraph() { + var memberid, timestamp, moveCursor, paragraphStyleName, sourceStartPosition, destinationStartPosition, odfUtils = odf.OdfUtils, domUtils = core.DomUtils, textns = odf.Namespaces.textns; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + moveCursor = data.moveCursor; + paragraphStyleName = data.paragraphStyleName; + sourceStartPosition = parseInt(data.sourceStartPosition, 10); + destinationStartPosition = parseInt(data.destinationStartPosition, 10); + }; + this.isEdit = true; + this.group = undefined; + function filterEmptyGroupingElementToRemove(element) { + if (odf.OdfUtils.isInlineRoot(element)) { + return NodeFilter.FILTER_SKIP; + } + return odfUtils.isGroupingElement(element) && odfUtils.hasNoODFContent(element) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; + } + function mergeParagraphs(destination, source) { + var child; + child = source.firstChild; + while (child) { + if (child.localName === "editinfo") { + source.removeChild(child); + } else { + destination.appendChild(child); + domUtils.removeUnwantedNodes(child, filterEmptyGroupingElementToRemove); + } + child = source.firstChild; + } + } + function isInsignificantWhitespace(node) { + var textNode, badNodeDescription; + if (node.nodeType === Node.TEXT_NODE) { + textNode = node; + if (textNode.length === 0) { + runtime.log("WARN: Empty text node found during merge operation"); + return true; + } + if (odfUtils.isODFWhitespace(textNode.data) && odfUtils.isSignificantWhitespace(textNode, 0) === false) { + return true; + } + badNodeDescription = "#text"; + } else { + badNodeDescription = (node.prefix ? node.prefix + ":" : "") + node.localName; + } + runtime.log("WARN: Unexpected text element found near paragraph boundary [" + badNodeDescription + "]"); + return false; + } + function removeTextNodes(range) { + var emptyTextNodes; + if (range.collapsed) { + return; + } + domUtils.splitBoundaries(range); + emptyTextNodes = odfUtils.getTextElements(range, false, true).filter(isInsignificantWhitespace); + emptyTextNodes.forEach(function(node) { + node.parentNode.removeChild(node); + }); + } + function trimLeadingInsignificantWhitespace(stepIterator, paragraphElement) { + var range = paragraphElement.ownerDocument.createRange(); + stepIterator.setPosition(paragraphElement, 0); + stepIterator.roundToNextStep(); + range.setStart(paragraphElement, 0); + range.setEnd(stepIterator.container(), stepIterator.offset()); + removeTextNodes(range); + } + function trimTrailingInsignificantWhitespace(stepIterator, paragraphElement) { + var range = paragraphElement.ownerDocument.createRange(); + stepIterator.setPosition(paragraphElement, paragraphElement.childNodes.length); + stepIterator.roundToPreviousStep(); + range.setStart(stepIterator.container(), stepIterator.offset()); + range.setEnd(paragraphElement, paragraphElement.childNodes.length); + removeTextNodes(range); + } + function getParagraphAtStep(odtDocument, steps, stepIterator) { + var domPoint = odtDocument.convertCursorStepToDomPoint(steps), paragraph = odfUtils.getParagraphElement(domPoint.node, domPoint.offset); + runtime.assert(Boolean(paragraph), "Paragraph not found at step " + steps); + if (stepIterator) { + stepIterator.setPosition(domPoint.node, domPoint.offset); + } + return paragraph; + } + this.execute = function(document) { + var odtDocument = document, sourceParagraph, destinationParagraph, cursor = odtDocument.getCursor(memberid), rootNode = odtDocument.getRootNode(), collapseRules = new odf.CollapsingRules(rootNode), stepIterator = odtDocument.createStepIterator(rootNode, 0, [odtDocument.getPositionFilter()], rootNode), downgradeOffset; + runtime.assert(destinationStartPosition < sourceStartPosition, "Destination paragraph (" + destinationStartPosition + ") must be " + "before source paragraph (" + sourceStartPosition + ")"); + destinationParagraph = getParagraphAtStep(odtDocument, destinationStartPosition); + sourceParagraph = getParagraphAtStep(odtDocument, sourceStartPosition, stepIterator); + stepIterator.previousStep(); + runtime.assert(domUtils.containsNode(destinationParagraph, stepIterator.container()), "Destination paragraph must be adjacent to the source paragraph"); + trimTrailingInsignificantWhitespace(stepIterator, destinationParagraph); + downgradeOffset = destinationParagraph.childNodes.length; + trimLeadingInsignificantWhitespace(stepIterator, sourceParagraph); + mergeParagraphs(destinationParagraph, sourceParagraph); + runtime.assert(sourceParagraph.childNodes.length === 0, "Source paragraph should be empty before it is removed"); + collapseRules.mergeChildrenIntoParent(sourceParagraph); + odtDocument.emit(ops.OdtDocument.signalStepsRemoved, {position:sourceStartPosition - 1}); + stepIterator.setPosition(destinationParagraph, downgradeOffset); + stepIterator.roundToClosestStep(); + if (!stepIterator.previousStep()) { + stepIterator.roundToNextStep(); + } + odtDocument.downgradeWhitespaces(stepIterator); + if (paragraphStyleName) { + destinationParagraph.setAttributeNS(textns, "text:style-name", paragraphStyleName); + } else { + destinationParagraph.removeAttributeNS(textns, "style-name"); + } + if (cursor && moveCursor) { + odtDocument.moveCursor(memberid, sourceStartPosition - 1, 0); + odtDocument.emit(ops.Document.signalCursorMoved, cursor); + } + odtDocument.fixCursorPositions(); + odtDocument.getOdfCanvas().refreshSize(); + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:destinationParagraph, memberId:memberid, timeStamp:timestamp}); + odtDocument.getOdfCanvas().rerenderAnnotations(); + return true; + }; + this.spec = function() { + return {optype:"MergeParagraph", memberid:memberid, timestamp:timestamp, moveCursor:moveCursor, paragraphStyleName:paragraphStyleName, sourceStartPosition:sourceStartPosition, destinationStartPosition:destinationStartPosition}; + }; +}; +ops.OpMergeParagraph.Spec; +ops.OpMergeParagraph.InitSpec; +ops.OpMoveCursor = function OpMoveCursor() { + var memberid, timestamp, position, length, selectionType; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = data.position; + length = data.length || 0; + selectionType = data.selectionType || ops.OdtCursor.RangeSelection; + }; + this.isEdit = false; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, cursor = odtDocument.getCursor(memberid), selectedRange; + if (!cursor) { + return false; + } + selectedRange = odtDocument.convertCursorToDomRange(position, length); + cursor.setSelectedRange(selectedRange, length >= 0); + cursor.setSelectionType(selectionType); + odtDocument.emit(ops.Document.signalCursorMoved, cursor); + return true; + }; + this.spec = function() { + return {optype:"MoveCursor", memberid:memberid, timestamp:timestamp, position:position, length:length, selectionType:selectionType}; + }; +}; +ops.OpMoveCursor.Spec; +ops.OpMoveCursor.InitSpec; +ops.OpRemoveAnnotation = function OpRemoveAnnotation() { + var memberid, timestamp, position, length, domUtils = core.DomUtils; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = parseInt(data.position, 10); + length = parseInt(data.length, 10); + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, iterator = odtDocument.getIteratorAtPosition(position), container = iterator.container(), annotationNode, annotationEnd; + while (!(container.namespaceURI === odf.Namespaces.officens && container.localName === "annotation")) { + container = container.parentNode; + } + if (container === null) { + return false; + } + annotationNode = container; + annotationEnd = annotationNode.annotationEndElement; + odtDocument.getOdfCanvas().forgetAnnotation(annotationNode); + function insert(node) { + annotationNode.parentNode.insertBefore(node, annotationNode); + } + domUtils.getElementsByTagNameNS(annotationNode, "urn:webodf:names:cursor", "cursor").forEach(insert); + domUtils.getElementsByTagNameNS(annotationNode, "urn:webodf:names:cursor", "anchor").forEach(insert); + annotationNode.parentNode.removeChild(annotationNode); + if (annotationEnd) { + annotationEnd.parentNode.removeChild(annotationEnd); + } + odtDocument.emit(ops.OdtDocument.signalStepsRemoved, {position:position > 0 ? position - 1 : position}); + odtDocument.getOdfCanvas().rerenderAnnotations(); + odtDocument.fixCursorPositions(); + return true; + }; + this.spec = function() { + return {optype:"RemoveAnnotation", memberid:memberid, timestamp:timestamp, position:position, length:length}; + }; +}; +ops.OpRemoveAnnotation.Spec; +ops.OpRemoveAnnotation.InitSpec; +ops.OpRemoveBlob = function OpRemoveBlob() { + var memberid, timestamp, filename; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + filename = data.filename; + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document; + odtDocument.getOdfCanvas().odfContainer().removeBlob(filename); + return true; + }; + this.spec = function() { + return {optype:"RemoveBlob", memberid:memberid, timestamp:timestamp, filename:filename}; + }; +}; +ops.OpRemoveBlob.Spec; +ops.OpRemoveBlob.InitSpec; +ops.OpRemoveCursor = function OpRemoveCursor() { + var memberid, timestamp; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + }; + this.isEdit = false; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document; + if (!odtDocument.removeCursor(memberid)) { + return false; + } + return true; + }; + this.spec = function() { + return {optype:"RemoveCursor", memberid:memberid, timestamp:timestamp}; + }; +}; +ops.OpRemoveCursor.Spec; +ops.OpRemoveCursor.InitSpec; +ops.OpRemoveHyperlink = function OpRemoveHyperlink() { + var memberid, timestamp, position, length, domUtils = core.DomUtils, odfUtils = odf.OdfUtils; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = data.position; + length = data.length; + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, range = odtDocument.convertCursorToDomRange(position, length), links = odfUtils.getHyperlinkElements(range), node; + runtime.assert(links.length === 1, "The given range should only contain a single link."); + node = domUtils.mergeIntoParent(links[0]); + range.detach(); + odtDocument.fixCursorPositions(); + odtDocument.getOdfCanvas().refreshSize(); + odtDocument.getOdfCanvas().rerenderAnnotations(); + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:odfUtils.getParagraphElement(node), memberId:memberid, timeStamp:timestamp}); + return true; + }; + this.spec = function() { + return {optype:"RemoveHyperlink", memberid:memberid, timestamp:timestamp, position:position, length:length}; + }; +}; +ops.OpRemoveHyperlink.Spec; +ops.OpRemoveHyperlink.InitSpec; +ops.OpRemoveMember = function OpRemoveMember() { + var memberid, timestamp; + this.init = function(data) { + memberid = data.memberid; + timestamp = parseInt(data.timestamp, 10); + }; + this.isEdit = false; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document; + if (!odtDocument.getMember(memberid)) { + return false; + } + odtDocument.removeMember(memberid); + odtDocument.emit(ops.Document.signalMemberRemoved, memberid); + return true; + }; + this.spec = function() { + return {optype:"RemoveMember", memberid:memberid, timestamp:timestamp}; + }; +}; +ops.OpRemoveMember.Spec; +ops.OpRemoveMember.InitSpec; +ops.OpRemoveStyle = function OpRemoveStyle() { + var memberid, timestamp, styleName, styleFamily; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + styleName = data.styleName; + styleFamily = data.styleFamily; + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, styleNode = odtDocument.getFormatting().getStyleElement(styleName, styleFamily); + if (!styleNode) { + return false; + } + styleNode.parentNode.removeChild(styleNode); + odtDocument.getOdfCanvas().refreshCSS(); + odtDocument.emit(ops.OdtDocument.signalCommonStyleDeleted, {name:styleName, family:styleFamily}); + return true; + }; + this.spec = function() { + return {optype:"RemoveStyle", memberid:memberid, timestamp:timestamp, styleName:styleName, styleFamily:styleFamily}; + }; +}; +ops.OpRemoveStyle.Spec; +ops.OpRemoveStyle.InitSpec; +ops.OpRemoveText = function OpRemoveText() { + var memberid, timestamp, position, length, odfUtils = odf.OdfUtils, domUtils = core.DomUtils; + this.init = function(data) { + runtime.assert(data.length >= 0, "OpRemoveText only supports positive lengths"); + memberid = data.memberid; + timestamp = data.timestamp; + position = parseInt(data.position, 10); + length = parseInt(data.length, 10); + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, range, textNodes, paragraph, cursor = odtDocument.getCursor(memberid), collapseRules = new odf.CollapsingRules(odtDocument.getRootNode()); + odtDocument.upgradeWhitespacesAtPosition(position); + odtDocument.upgradeWhitespacesAtPosition(position + length); + range = odtDocument.convertCursorToDomRange(position, length); + domUtils.splitBoundaries(range); + textNodes = odfUtils.getTextElements(range, false, true); + paragraph = odfUtils.getParagraphElement(range.startContainer, range.startOffset); + runtime.assert(paragraph !== undefined, "Attempting to remove text outside a paragraph element"); + range.detach(); + textNodes.forEach(function(element) { + if (element.parentNode) { + runtime.assert(domUtils.containsNode(paragraph, element), "RemoveText only supports removing elements within the same paragraph"); + collapseRules.mergeChildrenIntoParent(element); + } else { + runtime.log("WARN: text element has already been removed from it's container"); + } + }); + odtDocument.emit(ops.OdtDocument.signalStepsRemoved, {position:position}); + odtDocument.downgradeWhitespacesAtPosition(position); + odtDocument.fixCursorPositions(); + odtDocument.getOdfCanvas().refreshSize(); + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:paragraph, memberId:memberid, timeStamp:timestamp}); + if (cursor) { + cursor.resetSelectionType(); + odtDocument.emit(ops.Document.signalCursorMoved, cursor); + } + odtDocument.getOdfCanvas().rerenderAnnotations(); + return true; + }; + this.spec = function() { + return {optype:"RemoveText", memberid:memberid, timestamp:timestamp, position:position, length:length}; + }; +}; +ops.OpRemoveText.Spec; +ops.OpRemoveText.InitSpec; +ops.OpSetBlob = function OpSetBlob() { + var memberid, timestamp, filename, mimetype, content; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + filename = data.filename; + mimetype = data.mimetype; + content = data.content; + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document; + odtDocument.getOdfCanvas().odfContainer().setBlob(filename, mimetype, content); + return true; + }; + this.spec = function() { + return {optype:"SetBlob", memberid:memberid, timestamp:timestamp, filename:filename, mimetype:mimetype, content:content}; + }; +}; +ops.OpSetBlob.Spec; +ops.OpSetBlob.InitSpec; +ops.OpSetParagraphStyle = function OpSetParagraphStyle() { + var memberid, timestamp, position, styleName, textns = "urn:oasis:names:tc:opendocument:xmlns:text:1.0", odfUtils = odf.OdfUtils; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = data.position; + styleName = data.styleName; + }; + this.isEdit = true; + this.group = undefined; + function isFirstStep(odtDocument, paragraphNode, iterator) { + var filters = [odtDocument.getPositionFilter()], container = iterator.container(), offset = iterator.unfilteredDomOffset(), stepIterator = odtDocument.createStepIterator(container, offset, filters, paragraphNode); + return stepIterator.previousStep() === false; + } + this.execute = function(document) { + var odtDocument = document, iterator, paragraphNode; + iterator = odtDocument.getIteratorAtPosition(position); + paragraphNode = odfUtils.getParagraphElement(iterator.container()); + if (paragraphNode) { + runtime.assert(isFirstStep(odtDocument, paragraphNode, iterator), "SetParagraphStyle position should be the first position in the paragraph"); + if (styleName) { + paragraphNode.setAttributeNS(textns, "text:style-name", styleName); + } else { + paragraphNode.removeAttributeNS(textns, "style-name"); + } + odtDocument.getOdfCanvas().refreshSize(); + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:paragraphNode, timeStamp:timestamp, memberId:memberid}); + odtDocument.getOdfCanvas().rerenderAnnotations(); + return true; + } + return false; + }; + this.spec = function() { + return {optype:"SetParagraphStyle", memberid:memberid, timestamp:timestamp, position:position, styleName:styleName}; + }; +}; +ops.OpSetParagraphStyle.Spec; +ops.OpSetParagraphStyle.InitSpec; +ops.OpSplitParagraph = function OpSplitParagraph() { + var memberid, timestamp, sourceParagraphPosition, position, moveCursor, paragraphStyleName, odfUtils = odf.OdfUtils, textns = odf.Namespaces.textns; + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + position = data.position; + sourceParagraphPosition = data.sourceParagraphPosition; + paragraphStyleName = data.paragraphStyleName; + moveCursor = data.moveCursor === "true" || data.moveCursor === true; + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, domPosition, paragraphNode, targetNode, node, splitNode, splitChildNode, keptChildNode, cursor = odtDocument.getCursor(memberid); + odtDocument.upgradeWhitespacesAtPosition(position); + domPosition = odtDocument.getTextNodeAtStep(position); + if (!domPosition) { + return false; + } + paragraphNode = odfUtils.getParagraphElement(domPosition.textNode); + if (!paragraphNode) { + return false; + } + if (odfUtils.isListItem(paragraphNode.parentNode)) { + targetNode = paragraphNode.parentNode; + } else { + targetNode = paragraphNode; + } + if (domPosition.offset === 0) { + keptChildNode = domPosition.textNode.previousSibling; + splitChildNode = null; + } else { + keptChildNode = domPosition.textNode; + if (domPosition.offset >= domPosition.textNode.length) { + splitChildNode = null; + } else { + splitChildNode = domPosition.textNode.splitText(domPosition.offset); + } + } + node = domPosition.textNode; + while (node !== targetNode) { + node = node.parentNode; + splitNode = node.cloneNode(false); + if (splitChildNode) { + splitNode.appendChild(splitChildNode); + } + if (keptChildNode) { + while (keptChildNode && keptChildNode.nextSibling) { + splitNode.appendChild(keptChildNode.nextSibling); + } + } else { + while (node.firstChild) { + splitNode.appendChild(node.firstChild); + } + } + node.parentNode.insertBefore(splitNode, node.nextSibling); + keptChildNode = node; + splitChildNode = splitNode; + } + if (odfUtils.isListItem(splitChildNode)) { + splitChildNode = splitChildNode.childNodes.item(0); + } + if (paragraphStyleName) { + splitChildNode.setAttributeNS(textns, "text:style-name", paragraphStyleName); + } else { + splitChildNode.removeAttributeNS(textns, "style-name"); + } + if (domPosition.textNode.length === 0) { + domPosition.textNode.parentNode.removeChild(domPosition.textNode); + } + odtDocument.emit(ops.OdtDocument.signalStepsInserted, {position:position}); + if (cursor && moveCursor) { + odtDocument.moveCursor(memberid, position + 1, 0); + odtDocument.emit(ops.Document.signalCursorMoved, cursor); + } + odtDocument.fixCursorPositions(); + odtDocument.getOdfCanvas().refreshSize(); + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:paragraphNode, memberId:memberid, timeStamp:timestamp}); + odtDocument.emit(ops.OdtDocument.signalParagraphChanged, {paragraphElement:splitChildNode, memberId:memberid, timeStamp:timestamp}); + odtDocument.getOdfCanvas().rerenderAnnotations(); + return true; + }; + this.spec = function() { + return {optype:"SplitParagraph", memberid:memberid, timestamp:timestamp, position:position, sourceParagraphPosition:sourceParagraphPosition, paragraphStyleName:paragraphStyleName, moveCursor:moveCursor}; + }; +}; +ops.OpSplitParagraph.Spec; +ops.OpSplitParagraph.InitSpec; +ops.OpUpdateMember = function OpUpdateMember() { + var memberid, timestamp, setProperties, removedProperties; + this.init = function(data) { + memberid = data.memberid; + timestamp = parseInt(data.timestamp, 10); + setProperties = data.setProperties; + removedProperties = data.removedProperties; + }; + this.isEdit = false; + this.group = undefined; + function updateCreators(doc) { + var xpath = xmldom.XPath, xp = "//dc:creator[@editinfo:memberid='" + memberid + "']", creators = xpath.getODFElementsWithXPath(doc.getRootNode(), xp, function(prefix) { + if (prefix === "editinfo") { + return "urn:webodf:names:editinfo"; + } + return odf.Namespaces.lookupNamespaceURI(prefix); + }), i; + for (i = 0;i < creators.length;i += 1) { + creators[i].textContent = setProperties.fullName; + } + } + this.execute = function(document) { + var odtDocument = document, member = odtDocument.getMember(memberid); + if (!member) { + return false; + } + if (removedProperties) { + member.removeProperties(removedProperties); + } + if (setProperties) { + member.setProperties(setProperties); + if (setProperties.fullName) { + updateCreators(odtDocument); + } + } + odtDocument.emit(ops.Document.signalMemberUpdated, member); + return true; + }; + this.spec = function() { + return {optype:"UpdateMember", memberid:memberid, timestamp:timestamp, setProperties:setProperties, removedProperties:removedProperties}; + }; +}; +ops.OpUpdateMember.Spec; +ops.OpUpdateMember.InitSpec; +ops.OpUpdateMetadata = function OpUpdateMetadata() { + var memberid, timestamp, setProperties, removedProperties; + this.init = function(data) { + memberid = data.memberid; + timestamp = parseInt(data.timestamp, 10); + setProperties = data.setProperties; + removedProperties = data.removedProperties; + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, odfContainer = odtDocument.getOdfCanvas().odfContainer(), removedPropertiesArray = null; + if (removedProperties) { + removedPropertiesArray = removedProperties.attributes.split(","); + } + odfContainer.setMetadata(setProperties, removedPropertiesArray); + odtDocument.emit(ops.OdtDocument.signalMetadataUpdated, {setProperties:setProperties !== null ? setProperties : {}, removedProperties:removedPropertiesArray !== null ? removedPropertiesArray : []}); + return true; + }; + this.spec = function() { + return {optype:"UpdateMetadata", memberid:memberid, timestamp:timestamp, setProperties:setProperties, removedProperties:removedProperties}; + }; +}; +ops.OpUpdateMetadata.Spec; +ops.OpUpdateMetadata.InitSpec; +ops.OpUpdateParagraphStyle = function OpUpdateParagraphStyle() { + var memberid, timestamp, styleName, setProperties, removedProperties, paragraphPropertiesName = "style:paragraph-properties", textPropertiesName = "style:text-properties", stylens = odf.Namespaces.stylens; + function removedAttributesFromStyleNode(node, removedAttributeNames) { + var i, attributeNameParts, attributeNameList = removedAttributeNames ? removedAttributeNames.split(",") : []; + for (i = 0;i < attributeNameList.length;i += 1) { + attributeNameParts = attributeNameList[i].split(":"); + node.removeAttributeNS(odf.Namespaces.lookupNamespaceURI(attributeNameParts[0]), attributeNameParts[1]); + } + } + this.init = function(data) { + memberid = data.memberid; + timestamp = data.timestamp; + styleName = data.styleName; + setProperties = data.setProperties; + removedProperties = data.removedProperties; + }; + this.isEdit = true; + this.group = undefined; + this.execute = function(document) { + var odtDocument = document, formatting = odtDocument.getFormatting(), styleNode, object, paragraphPropertiesNode, textPropertiesNode; + if (styleName !== "") { + styleNode = formatting.getStyleElement(styleName, "paragraph"); + } else { + styleNode = formatting.getDefaultStyleElement("paragraph"); + } + if (styleNode) { + paragraphPropertiesNode = styleNode.getElementsByTagNameNS(stylens, "paragraph-properties").item(0); + textPropertiesNode = styleNode.getElementsByTagNameNS(stylens, "text-properties").item(0); + if (setProperties) { + formatting.updateStyle(styleNode, setProperties); + } + if (removedProperties) { + object = removedProperties[paragraphPropertiesName]; + if (paragraphPropertiesNode && object) { + removedAttributesFromStyleNode(paragraphPropertiesNode, object.attributes); + if (paragraphPropertiesNode.attributes.length === 0) { + styleNode.removeChild(paragraphPropertiesNode); + } + } + object = removedProperties[textPropertiesName]; + if (textPropertiesNode && object) { + removedAttributesFromStyleNode(textPropertiesNode, object.attributes); + if (textPropertiesNode.attributes.length === 0) { + styleNode.removeChild(textPropertiesNode); + } + } + removedAttributesFromStyleNode(styleNode, removedProperties.attributes); + } + odtDocument.getOdfCanvas().refreshCSS(); + odtDocument.emit(ops.OdtDocument.signalParagraphStyleModified, styleName); + odtDocument.getOdfCanvas().rerenderAnnotations(); + return true; + } + return false; + }; + this.spec = function() { + return {optype:"UpdateParagraphStyle", memberid:memberid, timestamp:timestamp, styleName:styleName, setProperties:setProperties, removedProperties:removedProperties}; + }; +}; +ops.OpUpdateParagraphStyle.Spec; +ops.OpUpdateParagraphStyle.InitSpec; +ops.OperationFactory = function OperationFactory() { + var specs; + function construct(Constructor) { + return function(spec) { + return new Constructor; + }; + } + this.register = function(specName, specConstructor) { + specs[specName] = specConstructor; + }; + this.create = function(spec) { + var op = null, constructor = specs[spec.optype]; + if (constructor) { + op = constructor(spec); + op.init(spec); + } + return op; + }; + function init() { + specs = {AddMember:construct(ops.OpAddMember), UpdateMember:construct(ops.OpUpdateMember), RemoveMember:construct(ops.OpRemoveMember), AddCursor:construct(ops.OpAddCursor), ApplyDirectStyling:construct(ops.OpApplyDirectStyling), SetBlob:construct(ops.OpSetBlob), RemoveBlob:construct(ops.OpRemoveBlob), InsertImage:construct(ops.OpInsertImage), InsertTable:construct(ops.OpInsertTable), InsertText:construct(ops.OpInsertText), RemoveText:construct(ops.OpRemoveText), MergeParagraph:construct(ops.OpMergeParagraph), + SplitParagraph:construct(ops.OpSplitParagraph), SetParagraphStyle:construct(ops.OpSetParagraphStyle), UpdateParagraphStyle:construct(ops.OpUpdateParagraphStyle), AddStyle:construct(ops.OpAddStyle), RemoveStyle:construct(ops.OpRemoveStyle), MoveCursor:construct(ops.OpMoveCursor), RemoveCursor:construct(ops.OpRemoveCursor), AddAnnotation:construct(ops.OpAddAnnotation), RemoveAnnotation:construct(ops.OpRemoveAnnotation), UpdateMetadata:construct(ops.OpUpdateMetadata), ApplyHyperlink:construct(ops.OpApplyHyperlink), + RemoveHyperlink:construct(ops.OpRemoveHyperlink)}; + } + init(); +}; +ops.OperationFactory.SpecConstructor; +ops.OperationRouter = function OperationRouter() { +}; +ops.OperationRouter.prototype.setOperationFactory = function(f) { +}; +ops.OperationRouter.prototype.setPlaybackFunction = function(playback_func) { +}; +ops.OperationRouter.prototype.push = function(operations) { +}; +ops.OperationRouter.prototype.close = function(callback) { +}; +ops.OperationRouter.prototype.subscribe = function(eventId, cb) { +}; +ops.OperationRouter.prototype.unsubscribe = function(eventId, cb) { +}; +ops.OperationRouter.prototype.hasLocalUnsyncedOps = function() { +}; +ops.OperationRouter.prototype.hasSessionHostConnection = function() { +}; +ops.OperationRouter.signalProcessingBatchStart = "router/batchstart"; +ops.OperationRouter.signalProcessingBatchEnd = "router/batchend"; +ops.TrivialOperationRouter = function TrivialOperationRouter() { + var events = new core.EventNotifier([ops.OperationRouter.signalProcessingBatchStart, ops.OperationRouter.signalProcessingBatchEnd]), operationFactory, playbackFunction, groupIdentifier = 0; + this.setOperationFactory = function(f) { + operationFactory = f; + }; + this.setPlaybackFunction = function(playback_func) { + playbackFunction = playback_func; + }; + this.push = function(operations) { + groupIdentifier += 1; + events.emit(ops.OperationRouter.signalProcessingBatchStart, {}); + operations.forEach(function(op) { + var timedOp, opspec = op.spec(); + opspec.timestamp = Date.now(); + timedOp = operationFactory.create(opspec); + timedOp.group = "g" + groupIdentifier; + playbackFunction(timedOp); + }); + events.emit(ops.OperationRouter.signalProcessingBatchEnd, {}); + }; + this.close = function(cb) { + cb(); + }; + this.subscribe = function(eventId, cb) { + events.subscribe(eventId, cb); + }; + this.unsubscribe = function(eventId, cb) { + events.unsubscribe(eventId, cb); + }; + this.hasLocalUnsyncedOps = function() { + return false; + }; + this.hasSessionHostConnection = function() { + return true; + }; +}; +ops.Session = function Session(odfCanvas) { + var self = this, operationFactory = new ops.OperationFactory, odtDocument = new ops.OdtDocument(odfCanvas), operationRouter = null; + function forwardBatchStart(args) { + odtDocument.emit(ops.OdtDocument.signalProcessingBatchStart, args); + } + function forwardBatchEnd(args) { + odtDocument.emit(ops.OdtDocument.signalProcessingBatchEnd, args); + } + this.setOperationFactory = function(opFactory) { + operationFactory = opFactory; + if (operationRouter) { + operationRouter.setOperationFactory(operationFactory); + } + }; + this.setOperationRouter = function(opRouter) { + if (operationRouter) { + operationRouter.unsubscribe(ops.OperationRouter.signalProcessingBatchStart, forwardBatchStart); + operationRouter.unsubscribe(ops.OperationRouter.signalProcessingBatchEnd, forwardBatchEnd); + } + operationRouter = opRouter; + operationRouter.subscribe(ops.OperationRouter.signalProcessingBatchStart, forwardBatchStart); + operationRouter.subscribe(ops.OperationRouter.signalProcessingBatchEnd, forwardBatchEnd); + opRouter.setPlaybackFunction(function(op) { + odtDocument.emit(ops.OdtDocument.signalOperationStart, op); + if (op.execute(odtDocument)) { + odtDocument.emit(ops.OdtDocument.signalOperationEnd, op); + return true; + } + return false; + }); + opRouter.setOperationFactory(operationFactory); + }; + this.getOperationFactory = function() { + return operationFactory; + }; + this.getOdtDocument = function() { + return odtDocument; + }; + this.enqueue = function(ops) { + operationRouter.push(ops); + }; + this.close = function(callback) { + operationRouter.close(function(err) { + if (err) { + callback(err); + } else { + odtDocument.close(callback); + } + }); + }; + this.destroy = function(callback) { + odtDocument.destroy(callback); + }; + function init() { + self.setOperationRouter(new ops.TrivialOperationRouter); + } + init(); +}; +gui.AnnotationController = function AnnotationController(session, sessionConstraints, inputMemberId) { + var odtDocument = session.getOdtDocument(), isAnnotatable = false, eventNotifier = new core.EventNotifier([gui.AnnotationController.annotatableChanged]), odfUtils = odf.OdfUtils, NEXT = core.StepDirection.NEXT; + function updatedCachedValues() { + var cursor = odtDocument.getCursor(inputMemberId), cursorNode = cursor && cursor.getNode(), newIsAnnotatable = false; + if (cursorNode) { + newIsAnnotatable = !odfUtils.isWithinAnnotation(cursorNode, odtDocument.getRootNode()); + } + if (newIsAnnotatable !== isAnnotatable) { + isAnnotatable = newIsAnnotatable; + eventNotifier.emit(gui.AnnotationController.annotatableChanged, isAnnotatable); + } + } + function onCursorAdded(cursor) { + if (cursor.getMemberId() === inputMemberId) { + updatedCachedValues(); + } + } + function onCursorRemoved(memberId) { + if (memberId === inputMemberId) { + updatedCachedValues(); + } + } + function onCursorMoved(cursor) { + if (cursor.getMemberId() === inputMemberId) { + updatedCachedValues(); + } + } + this.isAnnotatable = function() { + return isAnnotatable; + }; + this.addAnnotation = function() { + var op = new ops.OpAddAnnotation, selection = odtDocument.getCursorSelection(inputMemberId), length = selection.length, position = selection.position; + if (!isAnnotatable) { + return; + } + if (length === 0) { + length = undefined; + } else { + position = length >= 0 ? position : position + length; + length = Math.abs(length); + } + op.init({memberid:inputMemberId, position:position, length:length, name:inputMemberId + Date.now()}); + session.enqueue([op]); + }; + this.removeAnnotation = function(annotationNode) { + var startStep, endStep, op, moveCursor, currentUserName = odtDocument.getMember(inputMemberId).getProperties().fullName; + if (sessionConstraints.getState(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN) === true) { + if (currentUserName !== odfUtils.getAnnotationCreator(annotationNode)) { + return; + } + } + startStep = odtDocument.convertDomPointToCursorStep(annotationNode, 0, NEXT); + endStep = odtDocument.convertDomPointToCursorStep(annotationNode, annotationNode.childNodes.length); + op = new ops.OpRemoveAnnotation; + op.init({memberid:inputMemberId, position:startStep, length:endStep - startStep}); + moveCursor = new ops.OpMoveCursor; + moveCursor.init({memberid:inputMemberId, position:startStep > 0 ? startStep - 1 : startStep, length:0}); + session.enqueue([op, moveCursor]); + }; + this.subscribe = function(eventid, cb) { + eventNotifier.subscribe(eventid, cb); + }; + this.unsubscribe = function(eventid, cb) { + eventNotifier.unsubscribe(eventid, cb); + }; + this.destroy = function(callback) { + odtDocument.unsubscribe(ops.Document.signalCursorAdded, onCursorAdded); + odtDocument.unsubscribe(ops.Document.signalCursorRemoved, onCursorRemoved); + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorMoved); + callback(); + }; + function init() { + sessionConstraints.registerConstraint(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN); + odtDocument.subscribe(ops.Document.signalCursorAdded, onCursorAdded); + odtDocument.subscribe(ops.Document.signalCursorRemoved, onCursorRemoved); + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorMoved); + updatedCachedValues(); + } + init(); +}; +gui.AnnotationController.annotatableChanged = "annotatable/changed"; +gui.Avatar = function Avatar(parentElement, avatarInitiallyVisible) { + var self = this, handle, image, pendingImageUrl, displayShown = "block", displayHidden = "none"; + this.setColor = function(color) { + image.style.borderColor = color; + }; + this.setImageUrl = function(url) { + if (self.isVisible()) { + image.src = url; + } else { + pendingImageUrl = url; + } + }; + this.isVisible = function() { + return handle.style.display === displayShown; + }; + this.show = function() { + if (pendingImageUrl) { + image.src = pendingImageUrl; + pendingImageUrl = undefined; + } + handle.style.display = displayShown; + }; + this.hide = function() { + handle.style.display = displayHidden; + }; + this.markAsFocussed = function(isFocussed) { + if (isFocussed) { + handle.classList.add("active"); + } else { + handle.classList.remove("active"); + } + }; + this.destroy = function(callback) { + parentElement.removeChild(handle); + callback(); + }; + function init() { + var document = parentElement.ownerDocument; + handle = document.createElement("div"); + image = document.createElement("img"); + handle.appendChild(image); + handle.style.display = avatarInitiallyVisible ? displayShown : displayHidden; + handle.className = "handle"; + parentElement.appendChild(handle); + } + init(); +}; +gui.StepInfo = function() { +}; +gui.StepInfo.VisualDirection = {LEFT_TO_RIGHT:0, RIGHT_TO_LEFT:1}; +gui.StepInfo.prototype.token; +gui.StepInfo.prototype.container = function() { +}; +gui.StepInfo.prototype.offset = function() { +}; +gui.StepInfo.prototype.direction; +gui.StepInfo.prototype.visualDirection; +gui.VisualStepScanner = function() { +}; +gui.VisualStepScanner.prototype.token; +gui.VisualStepScanner.prototype.process = function(stepInfo, previousRect, nextRect) { +}; +gui.GuiStepUtils = function GuiStepUtils() { + var odfUtils = odf.OdfUtils, stepUtils = new odf.StepUtils, domUtils = core.DomUtils, NEXT = core.StepDirection.NEXT, LEFT_TO_RIGHT = gui.StepInfo.VisualDirection.LEFT_TO_RIGHT, RIGHT_TO_LEFT = gui.StepInfo.VisualDirection.RIGHT_TO_LEFT; + function getContentRect(stepIterator) { + var bounds = stepUtils.getContentBounds(stepIterator), range, rect = null; + if (bounds) { + if (bounds.container.nodeType === Node.TEXT_NODE) { + range = bounds.container.ownerDocument.createRange(); + range.setStart(bounds.container, bounds.startOffset); + range.setEnd(bounds.container, bounds.endOffset); + rect = range.getClientRects().length > 0 ? range.getBoundingClientRect() : null; + if (rect && bounds.container.data.substring(bounds.startOffset, bounds.endOffset) === " " && rect.width <= 1) { + rect = null; + } + range.detach(); + } else { + if (odfUtils.isCharacterElement(bounds.container) || odfUtils.isCharacterFrame(bounds.container)) { + rect = domUtils.getBoundingClientRect(bounds.container); + } + } + } + return rect; + } + this.getContentRect = getContentRect; + function moveToFilteredStep(stepIterator, direction, scanners) { + var isForward = direction === NEXT, leftRect, rightRect, previousRect, nextRect, destinationToken, initialToken = stepIterator.snapshot(), wasTerminated = false, stepInfo; + function process(terminated, scanner) { + if (scanner.process(stepInfo, previousRect, nextRect)) { + terminated = true; + if (!destinationToken && scanner.token) { + destinationToken = scanner.token; + } + } + return terminated; + } + do { + leftRect = getContentRect(stepIterator); + stepInfo = {token:stepIterator.snapshot(), container:stepIterator.container, offset:stepIterator.offset, direction:direction, visualDirection:direction === NEXT ? LEFT_TO_RIGHT : RIGHT_TO_LEFT}; + if (stepIterator.nextStep()) { + rightRect = getContentRect(stepIterator); + } else { + rightRect = null; + } + stepIterator.restore(stepInfo.token); + if (isForward) { + previousRect = leftRect; + nextRect = rightRect; + } else { + previousRect = rightRect; + nextRect = leftRect; + } + wasTerminated = scanners.reduce(process, false); + } while (!wasTerminated && stepIterator.advanceStep(direction)); + if (!wasTerminated) { + scanners.forEach(function(scanner) { + if (!destinationToken && scanner.token) { + destinationToken = scanner.token; + } + }); + } + stepIterator.restore(destinationToken || initialToken); + return Boolean(destinationToken); + } + this.moveToFilteredStep = moveToFilteredStep; +}; +gui.Caret = function Caret(cursor, viewport, avatarInitiallyVisible, blinkOnRangeSelect) { + var cursorns = "urn:webodf:names:cursor", MIN_OVERLAY_HEIGHT_PX = 8, BLINK_PERIOD_MS = 500, caretOverlay, caretElement, avatar, overlayElement, caretSizer, caretSizerRange, canvas = cursor.getDocument().getCanvas(), domUtils = core.DomUtils, guiStepUtils = new gui.GuiStepUtils, stepIterator, redrawTask, blinkTask, shouldResetBlink = false, shouldCheckCaretVisibility = false, shouldUpdateCaretSize = false, state = {isFocused:false, isShown:true, visibility:"hidden"}, lastState = {isFocused:!state.isFocused, + isShown:!state.isShown, visibility:"hidden"}; + function blinkCaret() { + caretElement.style.opacity = caretElement.style.opacity === "0" ? "1" : "0"; + blinkTask.trigger(); + } + function getCaretSizeFromCursor() { + caretSizerRange.selectNodeContents(caretSizer); + return caretSizerRange.getBoundingClientRect(); + } + function getSelectionRect() { + var node = cursor.getNode(), caretRectangle, nextRectangle, selectionRectangle, rootRect = domUtils.getBoundingClientRect(canvas.getSizer()), useLeftEdge = false, width = 0; + node.removeAttributeNS(cursorns, "caret-sizer-active"); + if (node.getClientRects().length > 0) { + selectionRectangle = getCaretSizeFromCursor(); + width = selectionRectangle.left - domUtils.getBoundingClientRect(node).left; + useLeftEdge = true; + } else { + stepIterator.setPosition(node, 0); + selectionRectangle = guiStepUtils.getContentRect(stepIterator); + if (!selectionRectangle && stepIterator.nextStep()) { + nextRectangle = guiStepUtils.getContentRect(stepIterator); + if (nextRectangle) { + selectionRectangle = nextRectangle; + useLeftEdge = true; + } + } + if (!selectionRectangle) { + node.setAttributeNS(cursorns, "caret-sizer-active", "true"); + selectionRectangle = getCaretSizeFromCursor(); + useLeftEdge = true; + } + if (!selectionRectangle) { + runtime.log("WARN: No suitable client rectangle found for visual caret for " + cursor.getMemberId()); + while (node) { + if (node.getClientRects().length > 0) { + selectionRectangle = domUtils.getBoundingClientRect(node); + useLeftEdge = true; + break; + } + node = node.parentNode; + } + } + } + selectionRectangle = domUtils.translateRect(selectionRectangle, rootRect, canvas.getZoomLevel()); + caretRectangle = {top:selectionRectangle.top, height:selectionRectangle.height, right:useLeftEdge ? selectionRectangle.left : selectionRectangle.right, width:domUtils.adaptRangeDifferenceToZoomLevel(width, canvas.getZoomLevel())}; + return caretRectangle; + } + function updateOverlayHeightAndPosition() { + var selectionRect = getSelectionRect(), cursorStyle; + if (selectionRect.height < MIN_OVERLAY_HEIGHT_PX) { + selectionRect = {top:selectionRect.top - (MIN_OVERLAY_HEIGHT_PX - selectionRect.height) / 2, height:MIN_OVERLAY_HEIGHT_PX, right:selectionRect.right}; + } + caretOverlay.style.height = selectionRect.height + "px"; + caretOverlay.style.top = selectionRect.top + "px"; + caretOverlay.style.left = selectionRect.right - selectionRect.width + "px"; + caretOverlay.style.width = selectionRect.width ? selectionRect.width + "px" : ""; + if (overlayElement) { + cursorStyle = runtime.getWindow().getComputedStyle(cursor.getNode(), null); + if (cursorStyle.font) { + overlayElement.style.font = cursorStyle.font; + } else { + overlayElement.style.fontStyle = cursorStyle.fontStyle; + overlayElement.style.fontVariant = cursorStyle.fontVariant; + overlayElement.style.fontWeight = cursorStyle.fontWeight; + overlayElement.style.fontSize = cursorStyle.fontSize; + overlayElement.style.lineHeight = cursorStyle.lineHeight; + overlayElement.style.fontFamily = cursorStyle.fontFamily; + } + } + } + function hasStateChanged(property) { + return lastState[property] !== state[property]; + } + function saveState() { + Object.keys(state).forEach(function(key) { + lastState[key] = state[key]; + }); + } + function updateCaret() { + if (state.isShown === false || cursor.getSelectionType() !== ops.OdtCursor.RangeSelection || !blinkOnRangeSelect && !cursor.getSelectedRange().collapsed) { + state.visibility = "hidden"; + caretElement.style.visibility = "hidden"; + blinkTask.cancel(); + } else { + state.visibility = "visible"; + caretElement.style.visibility = "visible"; + if (state.isFocused === false) { + caretElement.style.opacity = "1"; + blinkTask.cancel(); + } else { + if (shouldResetBlink || hasStateChanged("visibility")) { + caretElement.style.opacity = "1"; + blinkTask.cancel(); + } + blinkTask.trigger(); + } + } + if (shouldUpdateCaretSize || shouldCheckCaretVisibility) { + updateOverlayHeightAndPosition(); + } + if (state.isShown && shouldCheckCaretVisibility) { + viewport.scrollIntoView(caretElement.getBoundingClientRect()); + } + if (hasStateChanged("isFocused")) { + avatar.markAsFocussed(state.isFocused); + } + saveState(); + shouldResetBlink = false; + shouldCheckCaretVisibility = false; + shouldUpdateCaretSize = false; + } + this.handleUpdate = function() { + shouldUpdateCaretSize = true; + redrawTask.trigger(); + }; + this.refreshCursorBlinking = function() { + shouldResetBlink = true; + redrawTask.trigger(); + }; + this.setFocus = function() { + state.isFocused = true; + redrawTask.trigger(); + }; + this.removeFocus = function() { + state.isFocused = false; + redrawTask.trigger(); + }; + this.show = function() { + state.isShown = true; + redrawTask.trigger(); + }; + this.hide = function() { + state.isShown = false; + redrawTask.trigger(); + }; + this.setAvatarImageUrl = function(url) { + avatar.setImageUrl(url); + }; + this.setColor = function(newColor) { + caretElement.style.borderColor = newColor; + avatar.setColor(newColor); + }; + this.getCursor = function() { + return cursor; + }; + this.getFocusElement = function() { + return caretElement; + }; + this.toggleHandleVisibility = function() { + if (avatar.isVisible()) { + avatar.hide(); + } else { + avatar.show(); + } + }; + this.showHandle = function() { + avatar.show(); + }; + this.hideHandle = function() { + avatar.hide(); + }; + this.setOverlayElement = function(element) { + overlayElement = element; + caretOverlay.appendChild(element); + shouldUpdateCaretSize = true; + redrawTask.trigger(); + }; + this.ensureVisible = function() { + shouldCheckCaretVisibility = true; + redrawTask.trigger(); + }; + this.getBoundingClientRect = function() { + return domUtils.getBoundingClientRect(caretOverlay); + }; + function destroy(callback) { + caretOverlay.parentNode.removeChild(caretOverlay); + caretSizer.parentNode.removeChild(caretSizer); + callback(); + } + this.destroy = function(callback) { + var cleanup = [redrawTask.destroy, blinkTask.destroy, avatar.destroy, destroy]; + core.Async.destroyAll(cleanup, callback); + }; + function init() { + var odtDocument = cursor.getDocument(), positionFilters = [odtDocument.createRootFilter(cursor.getMemberId()), odtDocument.getPositionFilter()], dom = odtDocument.getDOMDocument(), editinfons = "urn:webodf:names:editinfo"; + caretSizerRange = dom.createRange(); + caretSizer = dom.createElement("span"); + caretSizer.className = "webodf-caretSizer"; + caretSizer.textContent = "|"; + cursor.getNode().appendChild(caretSizer); + caretOverlay = dom.createElement("div"); + caretOverlay.setAttributeNS(editinfons, "editinfo:memberid", cursor.getMemberId()); + caretOverlay.className = "webodf-caretOverlay"; + caretElement = dom.createElement("div"); + caretElement.className = "caret"; + caretOverlay.appendChild(caretElement); + avatar = new gui.Avatar(caretOverlay, avatarInitiallyVisible); + canvas.getSizer().appendChild(caretOverlay); + stepIterator = odtDocument.createStepIterator(cursor.getNode(), 0, positionFilters, odtDocument.getRootNode()); + redrawTask = core.Task.createRedrawTask(updateCaret); + blinkTask = core.Task.createTimeoutTask(blinkCaret, BLINK_PERIOD_MS); + redrawTask.triggerImmediate(); + } + init(); +}; +odf.TextSerializer = function TextSerializer() { + var self = this, odfUtils = odf.OdfUtils; + function serializeNode(node) { + var s = "", accept = self.filter ? self.filter.acceptNode(node) : NodeFilter.FILTER_ACCEPT, nodeType = node.nodeType, child; + if ((accept === NodeFilter.FILTER_ACCEPT || accept === NodeFilter.FILTER_SKIP) && odfUtils.isTextContentContainingNode(node)) { + child = node.firstChild; + while (child) { + s += serializeNode(child); + child = child.nextSibling; + } + } + if (accept === NodeFilter.FILTER_ACCEPT) { + if (nodeType === Node.ELEMENT_NODE && odfUtils.isParagraph(node)) { + s += "\n"; + } else { + if (nodeType === Node.TEXT_NODE && node.textContent) { + s += node.textContent; + } + } + } + return s; + } + this.filter = null; + this.writeToString = function(node) { + var plainText; + if (!node) { + return ""; + } + plainText = serializeNode(node); + if (plainText[plainText.length - 1] === "\n") { + plainText = plainText.substr(0, plainText.length - 1); + } + return plainText; + }; +}; +gui.MimeDataExporter = function MimeDataExporter() { + var textSerializer; + this.exportRangeToDataTransfer = function(dataTransfer, range) { + var document = range.startContainer.ownerDocument, serializedFragment, fragmentContainer; + fragmentContainer = document.createElement("span"); + fragmentContainer.appendChild(range.cloneContents()); + serializedFragment = textSerializer.writeToString(fragmentContainer); + try { + dataTransfer.setData("text/plain", serializedFragment); + } catch (e) { + dataTransfer.setData("Text", serializedFragment); + } + }; + function init() { + textSerializer = new odf.TextSerializer; + textSerializer.filter = new odf.OdfNodeFilter; + } + init(); +}; +gui.Clipboard = function Clipboard(mimeDataExporter) { + this.setDataFromRange = function(e, range) { + var result, clipboard = e.clipboardData, window = runtime.getWindow(); + if (!clipboard && window) { + clipboard = window.clipboardData; + } + if (clipboard) { + result = true; + mimeDataExporter.exportRangeToDataTransfer(clipboard, range); + e.preventDefault(); + } else { + result = false; + } + return result; + }; +}; +gui.SessionContext = function(session, inputMemberId) { + var odtDocument = session.getOdtDocument(), odfUtils = odf.OdfUtils; + this.isLocalCursorWithinOwnAnnotation = function() { + var cursor = odtDocument.getCursor(inputMemberId), cursorNode, currentUserName, parentAnnotation; + if (!cursor) { + return false; + } + cursorNode = cursor && cursor.getNode(); + currentUserName = odtDocument.getMember(inputMemberId).getProperties().fullName; + parentAnnotation = odfUtils.getParentAnnotation(cursorNode, odtDocument.getRootNode()); + if (parentAnnotation && odfUtils.getAnnotationCreator(parentAnnotation) === currentUserName) { + return true; + } + return false; + }; +}; +gui.StyleSummary = function StyleSummary(styles) { + var propertyValues = {}; + function getPropertyValues(section, propertyName) { + var cacheKey = section + "|" + propertyName, values; + if (!propertyValues.hasOwnProperty(cacheKey)) { + values = []; + styles.forEach(function(style) { + var styleSection = style.styleProperties[section], value = styleSection && styleSection[propertyName]; + if (values.indexOf(value) === -1) { + values.push(value); + } + }); + propertyValues[cacheKey] = values; + } + return propertyValues[cacheKey]; + } + this.getPropertyValues = getPropertyValues; + function lazilyLoaded(section, propertyName, acceptedPropertyValues) { + return function() { + var existingPropertyValues = getPropertyValues(section, propertyName); + return acceptedPropertyValues.length >= existingPropertyValues.length && existingPropertyValues.every(function(v) { + return acceptedPropertyValues.indexOf(v) !== -1; + }); + }; + } + function getCommonValue(section, propertyName) { + var values = getPropertyValues(section, propertyName); + return values.length === 1 ? values[0] : undefined; + } + this.getCommonValue = getCommonValue; + this.isBold = lazilyLoaded("style:text-properties", "fo:font-weight", ["bold"]); + this.isItalic = lazilyLoaded("style:text-properties", "fo:font-style", ["italic"]); + this.hasUnderline = lazilyLoaded("style:text-properties", "style:text-underline-style", ["solid"]); + this.hasStrikeThrough = lazilyLoaded("style:text-properties", "style:text-line-through-style", ["solid"]); + this.fontSize = function() { + var stringFontSize = getCommonValue("style:text-properties", "fo:font-size"); + return stringFontSize && parseFloat(stringFontSize); + }; + this.fontName = function() { + return getCommonValue("style:text-properties", "style:font-name"); + }; + this.isAlignedLeft = lazilyLoaded("style:paragraph-properties", "fo:text-align", ["left", "start"]); + this.isAlignedCenter = lazilyLoaded("style:paragraph-properties", "fo:text-align", ["center"]); + this.isAlignedRight = lazilyLoaded("style:paragraph-properties", "fo:text-align", ["right", "end"]); + this.isAlignedJustified = lazilyLoaded("style:paragraph-properties", "fo:text-align", ["justify"]); + this.text = {isBold:this.isBold, isItalic:this.isItalic, hasUnderline:this.hasUnderline, hasStrikeThrough:this.hasStrikeThrough, fontSize:this.fontSize, fontName:this.fontName}; + this.paragraph = {isAlignedLeft:this.isAlignedLeft, isAlignedCenter:this.isAlignedCenter, isAlignedRight:this.isAlignedRight, isAlignedJustified:this.isAlignedJustified}; +}; +gui.DirectFormattingController = function DirectFormattingController(session, sessionConstraints, sessionContext, inputMemberId, objectNameGenerator, directTextStylingEnabled, directParagraphStylingEnabled) { + var self = this, odtDocument = session.getOdtDocument(), utils = new core.Utils, odfUtils = odf.OdfUtils, eventNotifier = new core.EventNotifier([gui.DirectFormattingController.enabledChanged, gui.DirectFormattingController.textStylingChanged, gui.DirectFormattingController.paragraphStylingChanged]), textns = odf.Namespaces.textns, NEXT = core.StepDirection.NEXT, directCursorStyleProperties = null, lastSignalledSelectionInfo, selectionInfoCache; + function getCachedStyleSummary() { + return selectionInfoCache.value().styleSummary; + } + function getCachedEnabledFeatures() { + return selectionInfoCache.value().enabledFeatures; + } + this.enabledFeatures = getCachedEnabledFeatures; + function getNodes(range) { + var container, nodes; + if (range.collapsed) { + container = range.startContainer; + if (container.hasChildNodes() && range.startOffset < container.childNodes.length) { + container = container.childNodes.item(range.startOffset); + } + nodes = [container]; + } else { + nodes = odfUtils.getTextElements(range, true, false); + } + return nodes; + } + function getSelectionInfo() { + var cursor = odtDocument.getCursor(inputMemberId), range = cursor && cursor.getSelectedRange(), nodes = [], selectionStyles = [], selectionContainsText = true, enabledFeatures = {directTextStyling:true, directParagraphStyling:true}; + if (range) { + nodes = getNodes(range); + if (nodes.length === 0) { + nodes = [range.startContainer, range.endContainer]; + selectionContainsText = false; + } + selectionStyles = odtDocument.getFormatting().getAppliedStyles(nodes); + } + if (selectionStyles[0] !== undefined && directCursorStyleProperties) { + selectionStyles[0].styleProperties = utils.mergeObjects(selectionStyles[0].styleProperties, directCursorStyleProperties); + } + if (sessionConstraints.getState(gui.CommonConstraints.EDIT.REVIEW_MODE) === true) { + enabledFeatures.directTextStyling = enabledFeatures.directParagraphStyling = sessionContext.isLocalCursorWithinOwnAnnotation(); + } + if (enabledFeatures.directTextStyling) { + enabledFeatures.directTextStyling = selectionContainsText && cursor !== undefined && cursor.getSelectionType() === ops.OdtCursor.RangeSelection; + } + return {enabledFeatures:enabledFeatures, appliedStyles:selectionStyles, styleSummary:new gui.StyleSummary(selectionStyles)}; + } + function createDiff(oldSummary, newSummary) { + var diffMap = {}; + Object.keys(oldSummary).forEach(function(funcName) { + var oldValue = oldSummary[funcName](), newValue = newSummary[funcName](); + if (oldValue !== newValue) { + diffMap[funcName] = newValue; + } + }); + return diffMap; + } + function emitSelectionChanges() { + var textStyleDiff, paragraphStyleDiff, lastStyleSummary = lastSignalledSelectionInfo.styleSummary, newSelectionInfo = selectionInfoCache.value(), newSelectionStylesSummary = newSelectionInfo.styleSummary, lastEnabledFeatures = lastSignalledSelectionInfo.enabledFeatures, newEnabledFeatures = newSelectionInfo.enabledFeatures, enabledFeaturesChanged; + textStyleDiff = createDiff(lastStyleSummary.text, newSelectionStylesSummary.text); + paragraphStyleDiff = createDiff(lastStyleSummary.paragraph, newSelectionStylesSummary.paragraph); + enabledFeaturesChanged = !(newEnabledFeatures.directTextStyling === lastEnabledFeatures.directTextStyling && newEnabledFeatures.directParagraphStyling === lastEnabledFeatures.directParagraphStyling); + lastSignalledSelectionInfo = newSelectionInfo; + if (enabledFeaturesChanged) { + eventNotifier.emit(gui.DirectFormattingController.enabledChanged, newEnabledFeatures); + } + if (Object.keys(textStyleDiff).length > 0) { + eventNotifier.emit(gui.DirectFormattingController.textStylingChanged, textStyleDiff); + } + if (Object.keys(paragraphStyleDiff).length > 0) { + eventNotifier.emit(gui.DirectFormattingController.paragraphStylingChanged, paragraphStyleDiff); + } + } + function forceSelectionInfoRefresh() { + selectionInfoCache.reset(); + emitSelectionChanges(); + } + function onCursorEvent(cursorOrId) { + var cursorMemberId = typeof cursorOrId === "string" ? cursorOrId : cursorOrId.getMemberId(); + if (cursorMemberId === inputMemberId) { + selectionInfoCache.reset(); + } + } + function onParagraphStyleModified() { + selectionInfoCache.reset(); + } + function onParagraphChanged(args) { + var cursor = odtDocument.getCursor(inputMemberId), p = args.paragraphElement; + if (cursor && odfUtils.getParagraphElement(cursor.getNode()) === p) { + selectionInfoCache.reset(); + } + } + function toggle(predicate, toggleMethod) { + toggleMethod(!predicate()); + return true; + } + function formatTextSelection(textProperties) { + if (!getCachedEnabledFeatures().directTextStyling) { + return; + } + var selection = odtDocument.getCursorSelection(inputMemberId), op, properties = {"style:text-properties":textProperties}; + if (selection.length !== 0) { + op = new ops.OpApplyDirectStyling; + op.init({memberid:inputMemberId, position:selection.position, length:selection.length, setProperties:properties}); + session.enqueue([op]); + } else { + directCursorStyleProperties = utils.mergeObjects(directCursorStyleProperties || {}, properties); + selectionInfoCache.reset(); + } + } + this.formatTextSelection = formatTextSelection; + function applyTextPropertyToSelection(propertyName, propertyValue) { + var textProperties = {}; + textProperties[propertyName] = propertyValue; + formatTextSelection(textProperties); + } + this.createCursorStyleOp = function(position, length, useCachedStyle) { + var styleOp = null, appliedStyles, properties = directCursorStyleProperties; + if (useCachedStyle) { + appliedStyles = selectionInfoCache.value().appliedStyles[0]; + properties = appliedStyles && appliedStyles.styleProperties; + } + if (properties && properties["style:text-properties"]) { + styleOp = new ops.OpApplyDirectStyling; + styleOp.init({memberid:inputMemberId, position:position, length:length, setProperties:{"style:text-properties":properties["style:text-properties"]}}); + directCursorStyleProperties = null; + selectionInfoCache.reset(); + } + return styleOp; + }; + function clearCursorStyle(op) { + var spec = op.spec(); + if (directCursorStyleProperties && spec.memberid === inputMemberId) { + if (spec.optype !== "SplitParagraph") { + directCursorStyleProperties = null; + selectionInfoCache.reset(); + } + } + } + function setBold(checked) { + var value = checked ? "bold" : "normal"; + applyTextPropertyToSelection("fo:font-weight", value); + } + this.setBold = setBold; + function setItalic(checked) { + var value = checked ? "italic" : "normal"; + applyTextPropertyToSelection("fo:font-style", value); + } + this.setItalic = setItalic; + function setHasUnderline(checked) { + var value = checked ? "solid" : "none"; + applyTextPropertyToSelection("style:text-underline-style", value); + } + this.setHasUnderline = setHasUnderline; + function setHasStrikethrough(checked) { + var value = checked ? "solid" : "none"; + applyTextPropertyToSelection("style:text-line-through-style", value); + } + this.setHasStrikethrough = setHasStrikethrough; + function setFontSize(value) { + applyTextPropertyToSelection("fo:font-size", value + "pt"); + } + this.setFontSize = setFontSize; + function setFontName(value) { + applyTextPropertyToSelection("style:font-name", value); + } + this.setFontName = setFontName; + this.getAppliedStyles = function() { + return selectionInfoCache.value().appliedStyles; + }; + this.toggleBold = toggle.bind(self, function() { + return getCachedStyleSummary().isBold(); + }, setBold); + this.toggleItalic = toggle.bind(self, function() { + return getCachedStyleSummary().isItalic(); + }, setItalic); + this.toggleUnderline = toggle.bind(self, function() { + return getCachedStyleSummary().hasUnderline(); + }, setHasUnderline); + this.toggleStrikethrough = toggle.bind(self, function() { + return getCachedStyleSummary().hasStrikeThrough(); + }, setHasStrikethrough); + this.isBold = function() { + return getCachedStyleSummary().isBold(); + }; + this.isItalic = function() { + return getCachedStyleSummary().isItalic(); + }; + this.hasUnderline = function() { + return getCachedStyleSummary().hasUnderline(); + }; + this.hasStrikeThrough = function() { + return getCachedStyleSummary().hasStrikeThrough(); + }; + this.fontSize = function() { + return getCachedStyleSummary().fontSize(); + }; + this.fontName = function() { + return getCachedStyleSummary().fontName(); + }; + this.isAlignedLeft = function() { + return getCachedStyleSummary().isAlignedLeft(); + }; + this.isAlignedCenter = function() { + return getCachedStyleSummary().isAlignedCenter(); + }; + this.isAlignedRight = function() { + return getCachedStyleSummary().isAlignedRight(); + }; + this.isAlignedJustified = function() { + return getCachedStyleSummary().isAlignedJustified(); + }; + function getOwnProperty(obj, key) { + return obj.hasOwnProperty(key) ? obj[key] : undefined; + } + function applyParagraphDirectStyling(applyDirectStyling) { + if (!getCachedEnabledFeatures().directParagraphStyling) { + return; + } + var range = odtDocument.getCursor(inputMemberId).getSelectedRange(), paragraphs = odfUtils.getParagraphElements(range), formatting = odtDocument.getFormatting(), operations = [], derivedStyleNames = {}, defaultStyleName; + paragraphs.forEach(function(paragraph) { + var paragraphStartPoint = odtDocument.convertDomPointToCursorStep(paragraph, 0, NEXT), paragraphStyleName = paragraph.getAttributeNS(odf.Namespaces.textns, "style-name"), newParagraphStyleName, opAddStyle, opSetParagraphStyle, paragraphProperties; + if (paragraphStyleName) { + newParagraphStyleName = getOwnProperty(derivedStyleNames, paragraphStyleName); + } else { + newParagraphStyleName = defaultStyleName; + } + if (!newParagraphStyleName) { + newParagraphStyleName = objectNameGenerator.generateStyleName(); + if (paragraphStyleName) { + derivedStyleNames[paragraphStyleName] = newParagraphStyleName; + paragraphProperties = formatting.createDerivedStyleObject(paragraphStyleName, "paragraph", {}); + } else { + defaultStyleName = newParagraphStyleName; + paragraphProperties = {}; + } + paragraphProperties = applyDirectStyling(paragraphProperties); + opAddStyle = new ops.OpAddStyle; + opAddStyle.init({memberid:inputMemberId, styleName:newParagraphStyleName.toString(), styleFamily:"paragraph", isAutomaticStyle:true, setProperties:paragraphProperties}); + operations.push(opAddStyle); + } + opSetParagraphStyle = new ops.OpSetParagraphStyle; + opSetParagraphStyle.init({memberid:inputMemberId, styleName:newParagraphStyleName.toString(), position:paragraphStartPoint}); + operations.push(opSetParagraphStyle); + }); + session.enqueue(operations); + } + function applySimpleParagraphDirectStyling(styleOverrides) { + applyParagraphDirectStyling(function(paragraphStyle) { + return utils.mergeObjects(paragraphStyle, styleOverrides); + }); + } + function alignParagraph(alignment) { + applySimpleParagraphDirectStyling({"style:paragraph-properties":{"fo:text-align":alignment}}); + } + this.alignParagraphLeft = function() { + alignParagraph("left"); + return true; + }; + this.alignParagraphCenter = function() { + alignParagraph("center"); + return true; + }; + this.alignParagraphRight = function() { + alignParagraph("right"); + return true; + }; + this.alignParagraphJustified = function() { + alignParagraph("justify"); + return true; + }; + function modifyParagraphIndent(direction, paragraphStyle) { + var tabStopDistance = odtDocument.getFormatting().getDefaultTabStopDistance(), paragraphProperties = paragraphStyle["style:paragraph-properties"], indentValue, indent, newIndent; + if (paragraphProperties) { + indentValue = paragraphProperties["fo:margin-left"]; + indent = odfUtils.parseLength(indentValue); + } + if (indent && indent.unit === tabStopDistance.unit) { + newIndent = indent.value + direction * tabStopDistance.value + indent.unit; + } else { + newIndent = direction * tabStopDistance.value + tabStopDistance.unit; + } + return utils.mergeObjects(paragraphStyle, {"style:paragraph-properties":{"fo:margin-left":newIndent}}); + } + this.indent = function() { + applyParagraphDirectStyling(modifyParagraphIndent.bind(null, 1)); + return true; + }; + this.outdent = function() { + applyParagraphDirectStyling(modifyParagraphIndent.bind(null, -1)); + return true; + }; + function isSelectionAtTheEndOfLastParagraph(range, paragraphNode) { + var stepIterator, filters = [odtDocument.getPositionFilter(), odtDocument.createRootFilter(inputMemberId)]; + stepIterator = odtDocument.createStepIterator(range.endContainer, range.endOffset, filters, paragraphNode); + return stepIterator.nextStep() === false; + } + function isTextStyleDifferentFromFirstParagraph(range, paragraphNode) { + var textNodes = getNodes(range), selectedNodes = textNodes.length === 0 ? [range.startContainer] : textNodes, appliedTextStyles = odtDocument.getFormatting().getAppliedStyles(selectedNodes), textStyle = appliedTextStyles.length > 0 ? appliedTextStyles[0].styleProperties : undefined, paragraphStyle = odtDocument.getFormatting().getAppliedStylesForElement(paragraphNode).styleProperties; + if (!textStyle || textStyle["style:family"] !== "text" || !textStyle["style:text-properties"]) { + return false; + } + if (!paragraphStyle || !paragraphStyle["style:text-properties"]) { + return true; + } + textStyle = textStyle["style:text-properties"]; + paragraphStyle = paragraphStyle["style:text-properties"]; + return !Object.keys(textStyle).every(function(key) { + return textStyle[key] === paragraphStyle[key]; + }); + } + this.createParagraphStyleOps = function(position) { + if (!getCachedEnabledFeatures().directParagraphStyling) { + return []; + } + var cursor = odtDocument.getCursor(inputMemberId), range = cursor.getSelectedRange(), operations = [], op, startNode, endNode, paragraphNode, appliedStyles, properties, parentStyleName, styleName; + if (cursor.hasForwardSelection()) { + startNode = cursor.getAnchorNode(); + endNode = cursor.getNode(); + } else { + startNode = cursor.getNode(); + endNode = cursor.getAnchorNode(); + } + paragraphNode = odfUtils.getParagraphElement(endNode); + runtime.assert(Boolean(paragraphNode), "DirectFormattingController: Cursor outside paragraph"); + if (!isSelectionAtTheEndOfLastParagraph(range, paragraphNode)) { + return operations; + } + if (endNode !== startNode) { + paragraphNode = odfUtils.getParagraphElement(startNode); + } + if (!directCursorStyleProperties && !isTextStyleDifferentFromFirstParagraph(range, paragraphNode)) { + return operations; + } + appliedStyles = selectionInfoCache.value().appliedStyles[0]; + properties = appliedStyles && appliedStyles.styleProperties; + if (!properties) { + return operations; + } + parentStyleName = paragraphNode.getAttributeNS(textns, "style-name"); + if (parentStyleName) { + properties = {"style:text-properties":properties["style:text-properties"]}; + properties = odtDocument.getFormatting().createDerivedStyleObject(parentStyleName, "paragraph", properties); + } + styleName = objectNameGenerator.generateStyleName(); + op = new ops.OpAddStyle; + op.init({memberid:inputMemberId, styleName:styleName, styleFamily:"paragraph", isAutomaticStyle:true, setProperties:properties}); + operations.push(op); + op = new ops.OpSetParagraphStyle; + op.init({memberid:inputMemberId, styleName:styleName, position:position}); + operations.push(op); + return operations; + }; + this.subscribe = function(eventid, cb) { + eventNotifier.subscribe(eventid, cb); + }; + this.unsubscribe = function(eventid, cb) { + eventNotifier.unsubscribe(eventid, cb); + }; + this.destroy = function(callback) { + odtDocument.unsubscribe(ops.Document.signalCursorAdded, onCursorEvent); + odtDocument.unsubscribe(ops.Document.signalCursorRemoved, onCursorEvent); + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorEvent); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphStyleModified, onParagraphStyleModified); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphChanged, onParagraphChanged); + odtDocument.unsubscribe(ops.OdtDocument.signalOperationEnd, clearCursorStyle); + odtDocument.unsubscribe(ops.OdtDocument.signalProcessingBatchEnd, emitSelectionChanges); + sessionConstraints.unsubscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, forceSelectionInfoRefresh); + callback(); + }; + function emptyFunction() { + } + function emptyBoolFunction() { + return false; + } + function emptyFalseReturningFunction() { + return false; + } + function getCachedSelectionInfo() { + return selectionInfoCache.value(); + } + function init() { + odtDocument.subscribe(ops.Document.signalCursorAdded, onCursorEvent); + odtDocument.subscribe(ops.Document.signalCursorRemoved, onCursorEvent); + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorEvent); + odtDocument.subscribe(ops.OdtDocument.signalParagraphStyleModified, onParagraphStyleModified); + odtDocument.subscribe(ops.OdtDocument.signalParagraphChanged, onParagraphChanged); + odtDocument.subscribe(ops.OdtDocument.signalOperationEnd, clearCursorStyle); + odtDocument.subscribe(ops.OdtDocument.signalProcessingBatchEnd, emitSelectionChanges); + sessionConstraints.subscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, forceSelectionInfoRefresh); + selectionInfoCache = new core.LazyProperty(getSelectionInfo); + lastSignalledSelectionInfo = getCachedSelectionInfo(); + if (!directTextStylingEnabled) { + self.formatTextSelection = emptyFunction; + self.setBold = emptyFunction; + self.setItalic = emptyFunction; + self.setHasUnderline = emptyFunction; + self.setHasStrikethrough = emptyFunction; + self.setFontSize = emptyFunction; + self.setFontName = emptyFunction; + self.toggleBold = emptyFalseReturningFunction; + self.toggleItalic = emptyFalseReturningFunction; + self.toggleUnderline = emptyFalseReturningFunction; + self.toggleStrikethrough = emptyFalseReturningFunction; + } + if (!directParagraphStylingEnabled) { + self.alignParagraphCenter = emptyBoolFunction; + self.alignParagraphJustified = emptyBoolFunction; + self.alignParagraphLeft = emptyBoolFunction; + self.alignParagraphRight = emptyBoolFunction; + self.createParagraphStyleOps = function() { + return []; + }; + self.indent = emptyBoolFunction; + self.outdent = emptyBoolFunction; + } + } + init(); +}; +gui.DirectFormattingController.enabledChanged = "enabled/changed"; +gui.DirectFormattingController.textStylingChanged = "textStyling/changed"; +gui.DirectFormattingController.paragraphStylingChanged = "paragraphStyling/changed"; +gui.DirectFormattingController.SelectionInfo = function() { + this.enabledFeatures; + this.appliedStyles; + this.styleSummary; +}; +gui.KeyboardHandler = function KeyboardHandler() { + var modifier = gui.KeyboardHandler.Modifier, defaultBinding = null, bindings = {}; + function getModifiers(e) { + var modifiers = modifier.None; + if (e.metaKey) { + modifiers |= modifier.Meta; + } + if (e.ctrlKey) { + modifiers |= modifier.Ctrl; + } + if (e.altKey) { + modifiers |= modifier.Alt; + } + if (e.shiftKey) { + modifiers |= modifier.Shift; + } + return modifiers; + } + function getKeyCombo(keyCode, modifiers) { + if (!modifiers) { + modifiers = modifier.None; + } + switch(keyCode) { + case gui.KeyboardHandler.KeyCode.LeftMeta: + ; + case gui.KeyboardHandler.KeyCode.RightMeta: + ; + case gui.KeyboardHandler.KeyCode.MetaInMozilla: + modifiers |= modifier.Meta; + break; + case gui.KeyboardHandler.KeyCode.Ctrl: + modifiers |= modifier.Ctrl; + break; + case gui.KeyboardHandler.KeyCode.Alt: + modifiers |= modifier.Alt; + break; + case gui.KeyboardHandler.KeyCode.Shift: + modifiers |= modifier.Shift; + break; + } + return keyCode + ":" + modifiers; + } + this.setDefault = function(callback) { + defaultBinding = callback; + }; + this.bind = function(keyCode, modifiers, callback, overwrite) { + var keyCombo = getKeyCombo(keyCode, modifiers); + runtime.assert(overwrite || bindings.hasOwnProperty(keyCombo) === false, "tried to overwrite the callback handler of key combo: " + keyCombo); + bindings[keyCombo] = callback; + }; + this.unbind = function(keyCode, modifiers) { + var keyCombo = getKeyCombo(keyCode, modifiers); + delete bindings[keyCombo]; + }; + this.reset = function() { + defaultBinding = null; + bindings = {}; + }; + this.handleEvent = function(e) { + var keyCombo = getKeyCombo(e.keyCode, getModifiers(e)), callback = bindings[keyCombo], handled = false; + if (callback) { + handled = callback(); + } else { + if (defaultBinding !== null) { + handled = defaultBinding(e); + } + } + if (handled) { + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + } + }; +}; +gui.KeyboardHandler.Modifier = {None:0, Meta:1, Ctrl:2, Alt:4, CtrlAlt:6, Shift:8, MetaShift:9, CtrlShift:10, AltShift:12}; +gui.KeyboardHandler.KeyCode = {Backspace:8, Tab:9, Clear:12, Enter:13, Shift:16, Ctrl:17, Alt:18, End:35, Home:36, Left:37, Up:38, Right:39, Down:40, Delete:46, A:65, B:66, C:67, D:68, E:69, F:70, G:71, H:72, I:73, J:74, K:75, L:76, M:77, N:78, O:79, P:80, Q:81, R:82, S:83, T:84, U:85, V:86, W:87, X:88, Y:89, Z:90, LeftMeta:91, RightMeta:93, MetaInMozilla:224}; +gui.HyperlinkClickHandler = function HyperlinkClickHandler(getContainer, keyDownHandler, keyUpHandler) { + var inactiveLinksCssClass = "webodf-inactiveLinks", modifier = gui.KeyboardHandler.Modifier, keyCode = gui.KeyboardHandler.KeyCode, xpath = xmldom.XPath, odfUtils = odf.OdfUtils, window = runtime.getWindow(), activeModifier = modifier.None, activeKeyBindings = []; + runtime.assert(window !== null, "Expected to be run in an environment which has a global window, like a browser."); + function getHyperlinkElement(node) { + while (node !== null) { + if (odfUtils.isHyperlink(node)) { + return node; + } + if (odfUtils.isParagraph(node)) { + break; + } + node = node.parentNode; + } + return null; + } + this.handleClick = function(e) { + var target = e.target || e.srcElement, pressedModifier, linkElement, url, rootNode, bookmarks; + if (e.ctrlKey) { + pressedModifier = modifier.Ctrl; + } else { + if (e.metaKey) { + pressedModifier = modifier.Meta; + } + } + if (activeModifier !== modifier.None && activeModifier !== pressedModifier) { + return; + } + linkElement = getHyperlinkElement(target); + if (!linkElement) { + return; + } + url = odfUtils.getHyperlinkTarget(linkElement); + if (url === "") { + return; + } + if (url[0] === "#") { + url = url.substring(1); + rootNode = getContainer(); + bookmarks = xpath.getODFElementsWithXPath(rootNode, "//text:bookmark-start[@text:name='" + url + "']", odf.Namespaces.lookupNamespaceURI); + if (bookmarks.length === 0) { + bookmarks = xpath.getODFElementsWithXPath(rootNode, "//text:bookmark[@text:name='" + url + "']", odf.Namespaces.lookupNamespaceURI); + } + if (bookmarks.length > 0) { + bookmarks[0].scrollIntoView(true); + } + } else { + if (/^\s*(javascript|data):/.test(url)) { + runtime.log("WARN:", "potentially malicious URL ignored"); + } else { + window.open(url); + } + } + if (e.preventDefault) { + e.preventDefault(); + } else { + e.returnValue = false; + } + }; + function showPointerCursor() { + var container = getContainer(); + runtime.assert(Boolean(container.classList), "Document container has no classList element"); + container.classList.remove(inactiveLinksCssClass); + } + function showTextCursor() { + var container = getContainer(); + runtime.assert(Boolean(container.classList), "Document container has no classList element"); + container.classList.add(inactiveLinksCssClass); + } + function cleanupEventBindings() { + window.removeEventListener("focus", showTextCursor, false); + activeKeyBindings.forEach(function(boundShortcut) { + keyDownHandler.unbind(boundShortcut.keyCode, boundShortcut.modifier); + keyUpHandler.unbind(boundShortcut.keyCode, boundShortcut.modifier); + }); + activeKeyBindings.length = 0; + } + function bindEvents(modifierKey) { + cleanupEventBindings(); + if (modifierKey !== modifier.None) { + window.addEventListener("focus", showTextCursor, false); + switch(modifierKey) { + case modifier.Ctrl: + activeKeyBindings.push({keyCode:keyCode.Ctrl, modifier:modifier.None}); + break; + case modifier.Meta: + activeKeyBindings.push({keyCode:keyCode.LeftMeta, modifier:modifier.None}); + activeKeyBindings.push({keyCode:keyCode.RightMeta, modifier:modifier.None}); + activeKeyBindings.push({keyCode:keyCode.MetaInMozilla, modifier:modifier.None}); + break; + } + activeKeyBindings.forEach(function(boundShortcut) { + keyDownHandler.bind(boundShortcut.keyCode, boundShortcut.modifier, showPointerCursor); + keyUpHandler.bind(boundShortcut.keyCode, boundShortcut.modifier, showTextCursor); + }); + } + } + this.setModifier = function(value) { + if (activeModifier === value) { + return; + } + runtime.assert(value === modifier.None || value === modifier.Ctrl || value === modifier.Meta, "Unsupported KeyboardHandler.Modifier value: " + value); + activeModifier = value; + if (activeModifier !== modifier.None) { + showTextCursor(); + } else { + showPointerCursor(); + } + bindEvents(activeModifier); + }; + this.getModifier = function() { + return activeModifier; + }; + this.destroy = function(callback) { + showTextCursor(); + cleanupEventBindings(); + callback(); + }; +}; +gui.EventManager = function EventManager(odtDocument) { + var window = runtime.getWindow(), bindToDirectHandler = {"beforecut":true, "beforepaste":true, "longpress":true, "drag":true, "dragstop":true}, bindToWindow = {"mousedown":true, "mouseup":true, "focus":true}, compoundEvents = {}, eventDelegates = {}, eventTrap, canvasElement = odtDocument.getCanvas().getElement(), eventManager = this, longPressTimers = {}, LONGPRESS_DURATION = 400; + function EventDelegate(eventName) { + var self = this, recentEvents = [], subscribers = new core.EventNotifier([eventName]); + function listenEvent(eventTarget, eventType, eventHandler) { + var onVariant, bound = false; + onVariant = "on" + eventType; + if (eventTarget.attachEvent) { + eventTarget.attachEvent(onVariant, eventHandler); + bound = true; + } + if (!bound && eventTarget.addEventListener) { + eventTarget.addEventListener(eventType, eventHandler, false); + bound = true; + } + if ((!bound || bindToDirectHandler[eventType]) && eventTarget.hasOwnProperty(onVariant)) { + eventTarget[onVariant] = eventHandler; + } + } + function removeEvent(eventTarget, eventType, eventHandler) { + var onVariant = "on" + eventType; + if (eventTarget.detachEvent) { + eventTarget.detachEvent(onVariant, eventHandler); + } + if (eventTarget.removeEventListener) { + eventTarget.removeEventListener(eventType, eventHandler, false); + } + if (eventTarget[onVariant] === eventHandler) { + eventTarget[onVariant] = null; + } + } + function handleEvent(e) { + if (recentEvents.indexOf(e) === -1) { + recentEvents.push(e); + if (self.filters.every(function(filter) { + return filter(e); + })) { + try { + subscribers.emit(eventName, e); + } catch (err) { + runtime.log("Error occurred while processing " + eventName + ":\n" + err.message + "\n" + err.stack); + } + } + runtime.setTimeout(function() { + recentEvents.splice(recentEvents.indexOf(e), 1); + }, 0); + } + } + this.filters = []; + this.subscribe = function(cb) { + subscribers.subscribe(eventName, cb); + }; + this.unsubscribe = function(cb) { + subscribers.unsubscribe(eventName, cb); + }; + this.destroy = function() { + removeEvent(window, eventName, handleEvent); + removeEvent(eventTrap, eventName, handleEvent); + removeEvent(canvasElement, eventName, handleEvent); + }; + function init() { + if (bindToWindow[eventName]) { + listenEvent(window, eventName, handleEvent); + } + listenEvent(eventTrap, eventName, handleEvent); + listenEvent(canvasElement, eventName, handleEvent); + } + init(); + } + function CompoundEvent(eventName, dependencies, eventProxy) { + var cachedState = {}, subscribers = new core.EventNotifier([eventName]); + function subscribedProxy(event) { + eventProxy(event, cachedState, function(compoundEventInstance) { + compoundEventInstance.type = eventName; + subscribers.emit(eventName, compoundEventInstance); + }); + } + this.subscribe = function(cb) { + subscribers.subscribe(eventName, cb); + }; + this.unsubscribe = function(cb) { + subscribers.unsubscribe(eventName, cb); + }; + this.destroy = function() { + dependencies.forEach(function(eventName) { + eventManager.unsubscribe(eventName, subscribedProxy); + }); + }; + function init() { + dependencies.forEach(function(eventName) { + eventManager.subscribe(eventName, subscribedProxy); + }); + } + init(); + } + function clearTimeout(timer) { + runtime.clearTimeout(timer); + delete longPressTimers[timer]; + } + function setTimeout(fn, duration) { + var timer = runtime.setTimeout(function() { + fn(); + clearTimeout(timer); + }, duration); + longPressTimers[timer] = true; + return timer; + } + function getTarget(e) { + return e.target || e.srcElement || null; + } + function emitLongPressEvent(event, cachedState, callback) { + var touchEvent = event, fingers = touchEvent.touches.length, touch = touchEvent.touches[0], timer = cachedState.timer; + if (event.type === "touchmove" || event.type === "touchend") { + if (timer) { + clearTimeout(timer); + } + } else { + if (event.type === "touchstart") { + if (fingers !== 1) { + runtime.clearTimeout(timer); + } else { + timer = setTimeout(function() { + callback({clientX:touch.clientX, clientY:touch.clientY, pageX:touch.pageX, pageY:touch.pageY, target:getTarget(event), detail:1}); + }, LONGPRESS_DURATION); + } + } + } + cachedState.timer = timer; + } + function emitDragEvent(event, cachedState, callback) { + var touchEvent = event, fingers = touchEvent.touches.length, touch = touchEvent.touches[0], target = getTarget(event), cachedTarget = cachedState.target; + if (fingers !== 1 || event.type === "touchend") { + cachedTarget = null; + } else { + if (event.type === "touchstart" && target.getAttribute("class") === "webodf-draggable") { + cachedTarget = target; + } else { + if (event.type === "touchmove" && cachedTarget) { + event.preventDefault(); + event.stopPropagation(); + callback({clientX:touch.clientX, clientY:touch.clientY, pageX:touch.pageX, pageY:touch.pageY, target:cachedTarget, detail:1}); + } + } + } + cachedState.target = cachedTarget; + } + function emitDragStopEvent(event, cachedState, callback) { + var touchEvent = event, target = getTarget(event), touch, dragging = cachedState.dragging; + if (event.type === "drag") { + dragging = true; + } else { + if (event.type === "touchend" && dragging) { + dragging = false; + touch = touchEvent.changedTouches[0]; + callback({clientX:touch.clientX, clientY:touch.clientY, pageX:touch.pageX, pageY:touch.pageY, target:target, detail:1}); + } + } + cachedState.dragging = dragging; + } + function declareTouchEnabled() { + canvasElement.classList.add("webodf-touchEnabled"); + eventManager.unsubscribe("touchstart", declareTouchEnabled); + } + function WindowScrollState(window) { + var x = window.scrollX, y = window.scrollY; + this.restore = function() { + if (window.scrollX !== x || window.scrollY !== y) { + window.scrollTo(x, y); + } + }; + } + function ElementScrollState(element) { + var top = element.scrollTop, left = element.scrollLeft; + this.restore = function() { + if (element.scrollTop !== top || element.scrollLeft !== left) { + element.scrollTop = top; + element.scrollLeft = left; + } + }; + } + function getDelegateForEvent(eventName, shouldCreate) { + var delegate = eventDelegates[eventName] || compoundEvents[eventName] || null; + if (!delegate && shouldCreate) { + delegate = eventDelegates[eventName] = new EventDelegate(eventName); + } + return delegate; + } + this.addFilter = function(eventName, filter) { + var delegate = getDelegateForEvent(eventName, true); + delegate.filters.push(filter); + }; + this.removeFilter = function(eventName, filter) { + var delegate = getDelegateForEvent(eventName, true), index = delegate.filters.indexOf(filter); + if (index !== -1) { + delegate.filters.splice(index, 1); + } + }; + function subscribe(eventName, handler) { + var delegate = getDelegateForEvent(eventName, true); + delegate.subscribe(handler); + } + this.subscribe = subscribe; + function unsubscribe(eventName, handler) { + var delegate = getDelegateForEvent(eventName, false); + if (delegate) { + delegate.unsubscribe(handler); + } + } + this.unsubscribe = unsubscribe; + function hasFocus() { + return odtDocument.getDOMDocument().activeElement === eventTrap; + } + this.hasFocus = hasFocus; + function disableTrapSelection() { + if (hasFocus()) { + eventTrap.blur(); + } + eventTrap.setAttribute("disabled", "true"); + } + function enableTrapSelection() { + eventTrap.removeAttribute("disabled"); + } + function findScrollableParents(element) { + var scrollParents = []; + while (element) { + if (element.scrollWidth > element.clientWidth || element.scrollHeight > element.clientHeight) { + scrollParents.push(new ElementScrollState(element)); + } + element = element.parentNode; + } + scrollParents.push(new WindowScrollState(window)); + return scrollParents; + } + function focus() { + var scrollParents; + if (!hasFocus()) { + scrollParents = findScrollableParents(eventTrap); + enableTrapSelection(); + eventTrap.focus(); + scrollParents.forEach(function(scrollParent) { + scrollParent.restore(); + }); + } + } + this.focus = focus; + this.getEventTrap = function() { + return eventTrap; + }; + this.setEditing = function(editable) { + var hadFocus = hasFocus(); + if (hadFocus) { + eventTrap.blur(); + } + if (editable) { + eventTrap.removeAttribute("readOnly"); + } else { + eventTrap.setAttribute("readOnly", "true"); + } + if (hadFocus) { + focus(); + } + }; + this.destroy = function(callback) { + unsubscribe("touchstart", declareTouchEnabled); + Object.keys(longPressTimers).forEach(function(timer) { + clearTimeout(parseInt(timer, 10)); + }); + longPressTimers.length = 0; + Object.keys(compoundEvents).forEach(function(compoundEventName) { + compoundEvents[compoundEventName].destroy(); + }); + compoundEvents = {}; + unsubscribe("mousedown", disableTrapSelection); + unsubscribe("mouseup", enableTrapSelection); + unsubscribe("contextmenu", enableTrapSelection); + Object.keys(eventDelegates).forEach(function(eventName) { + eventDelegates[eventName].destroy(); + }); + eventDelegates = {}; + eventTrap.parentNode.removeChild(eventTrap); + callback(); + }; + function init() { + var sizerElement = odtDocument.getOdfCanvas().getSizer(), doc = sizerElement.ownerDocument; + runtime.assert(Boolean(window), "EventManager requires a window object to operate correctly"); + eventTrap = doc.createElement("textarea"); + eventTrap.id = "eventTrap"; + eventTrap.setAttribute("tabindex", "-1"); + eventTrap.setAttribute("readOnly", "true"); + eventTrap.setAttribute("rows", "1"); + sizerElement.appendChild(eventTrap); + subscribe("mousedown", disableTrapSelection); + subscribe("mouseup", enableTrapSelection); + subscribe("contextmenu", enableTrapSelection); + compoundEvents.longpress = new CompoundEvent("longpress", ["touchstart", "touchmove", "touchend"], emitLongPressEvent); + compoundEvents.drag = new CompoundEvent("drag", ["touchstart", "touchmove", "touchend"], emitDragEvent); + compoundEvents.dragstop = new CompoundEvent("dragstop", ["drag", "touchend"], emitDragStopEvent); + subscribe("touchstart", declareTouchEnabled); + } + init(); +}; +gui.IOSSafariSupport = function(eventManager) { + var window = runtime.getWindow(), eventTrap = eventManager.getEventTrap(); + function suppressFocusScrollIfKeyboardOpen() { + if (window.innerHeight !== window.outerHeight) { + eventTrap.style.display = "none"; + runtime.requestAnimationFrame(function() { + eventTrap.style.display = "block"; + }); + } + } + this.destroy = function(callback) { + eventManager.unsubscribe("focus", suppressFocusScrollIfKeyboardOpen); + eventTrap.removeAttribute("autocapitalize"); + eventTrap.style.WebkitTransform = ""; + callback(); + }; + function init() { + eventManager.subscribe("focus", suppressFocusScrollIfKeyboardOpen); + eventTrap.setAttribute("autocapitalize", "off"); + eventTrap.style.WebkitTransform = "translateX(-10000px)"; + } + init(); +}; +gui.HyperlinkController = function HyperlinkController(session, sessionConstraints, sessionContext, inputMemberId) { + var odfUtils = odf.OdfUtils, odtDocument = session.getOdtDocument(), eventNotifier = new core.EventNotifier([gui.HyperlinkController.enabledChanged]), isEnabled = false; + function updateEnabledState() { + var newIsEnabled = true; + if (sessionConstraints.getState(gui.CommonConstraints.EDIT.REVIEW_MODE) === true) { + newIsEnabled = sessionContext.isLocalCursorWithinOwnAnnotation(); + } + if (newIsEnabled !== isEnabled) { + isEnabled = newIsEnabled; + eventNotifier.emit(gui.HyperlinkController.enabledChanged, isEnabled); + } + } + function onCursorEvent(cursor) { + if (cursor.getMemberId() === inputMemberId) { + updateEnabledState(); + } + } + this.isEnabled = function() { + return isEnabled; + }; + this.subscribe = function(eventid, cb) { + eventNotifier.subscribe(eventid, cb); + }; + this.unsubscribe = function(eventid, cb) { + eventNotifier.unsubscribe(eventid, cb); + }; + function addHyperlink(hyperlink, insertionText) { + if (!isEnabled) { + return; + } + var selection = odtDocument.getCursorSelection(inputMemberId), op = new ops.OpApplyHyperlink, operations = []; + if (selection.length === 0 || insertionText) { + insertionText = insertionText || hyperlink; + op = new ops.OpInsertText; + op.init({memberid:inputMemberId, position:selection.position, text:insertionText}); + selection.length = insertionText.length; + operations.push(op); + } + op = new ops.OpApplyHyperlink; + op.init({memberid:inputMemberId, position:selection.position, length:selection.length, hyperlink:hyperlink}); + operations.push(op); + session.enqueue(operations); + } + this.addHyperlink = addHyperlink; + function removeHyperlinks() { + if (!isEnabled) { + return; + } + var iterator = odtDocument.createPositionIterator(odtDocument.getRootNode()), selectedRange = odtDocument.getCursor(inputMemberId).getSelectedRange(), links = odfUtils.getHyperlinkElements(selectedRange), removeEntireLink = selectedRange.collapsed && links.length === 1, domRange = odtDocument.getDOMDocument().createRange(), operations = [], cursorRange, firstLink, lastLink, offset, op; + if (links.length === 0) { + return; + } + links.forEach(function(link) { + domRange.selectNodeContents(link); + cursorRange = odtDocument.convertDomToCursorRange({anchorNode:domRange.startContainer, anchorOffset:domRange.startOffset, focusNode:domRange.endContainer, focusOffset:domRange.endOffset}); + op = new ops.OpRemoveHyperlink; + op.init({memberid:inputMemberId, position:cursorRange.position, length:cursorRange.length}); + operations.push(op); + }); + if (!removeEntireLink) { + firstLink = links[0]; + if (selectedRange.comparePoint(firstLink, 0) === -1) { + domRange.setStart(firstLink, 0); + domRange.setEnd(selectedRange.startContainer, selectedRange.startOffset); + cursorRange = odtDocument.convertDomToCursorRange({anchorNode:domRange.startContainer, anchorOffset:domRange.startOffset, focusNode:domRange.endContainer, focusOffset:domRange.endOffset}); + if (cursorRange.length > 0) { + op = new ops.OpApplyHyperlink; + op.init({memberid:inputMemberId, position:cursorRange.position, length:cursorRange.length, hyperlink:odfUtils.getHyperlinkTarget(firstLink)}); + operations.push(op); + } + } + lastLink = links[links.length - 1]; + iterator.moveToEndOfNode(lastLink); + offset = iterator.unfilteredDomOffset(); + if (selectedRange.comparePoint(lastLink, offset) === 1) { + domRange.setStart(selectedRange.endContainer, selectedRange.endOffset); + domRange.setEnd(lastLink, offset); + cursorRange = odtDocument.convertDomToCursorRange({anchorNode:domRange.startContainer, anchorOffset:domRange.startOffset, focusNode:domRange.endContainer, focusOffset:domRange.endOffset}); + if (cursorRange.length > 0) { + op = new ops.OpApplyHyperlink; + op.init({memberid:inputMemberId, position:cursorRange.position, length:cursorRange.length, hyperlink:odfUtils.getHyperlinkTarget(lastLink)}); + operations.push(op); + } + } + } + session.enqueue(operations); + domRange.detach(); + } + this.removeHyperlinks = removeHyperlinks; + this.destroy = function(callback) { + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorEvent); + sessionConstraints.unsubscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, updateEnabledState); + callback(); + }; + function init() { + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorEvent); + sessionConstraints.subscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, updateEnabledState); + updateEnabledState(); + } + init(); +}; +gui.HyperlinkController.enabledChanged = "enabled/changed"; +gui.ImageController = function ImageController(session, sessionConstraints, sessionContext, inputMemberId, objectNameGenerator) { + var fileExtensionByMimetype = {"image/gif":".gif", "image/jpeg":".jpg", "image/png":".png"}, textns = odf.Namespaces.textns, odtDocument = session.getOdtDocument(), odfUtils = odf.OdfUtils, formatting = odtDocument.getFormatting(), eventNotifier = new core.EventNotifier([gui.HyperlinkController.enabledChanged]), isEnabled = false; + function updateEnabledState() { + var newIsEnabled = true; + if (sessionConstraints.getState(gui.CommonConstraints.EDIT.REVIEW_MODE) === true) { + newIsEnabled = sessionContext.isLocalCursorWithinOwnAnnotation(); + } + if (newIsEnabled !== isEnabled) { + isEnabled = newIsEnabled; + eventNotifier.emit(gui.ImageController.enabledChanged, isEnabled); + } + } + function onCursorEvent(cursor) { + if (cursor.getMemberId() === inputMemberId) { + updateEnabledState(); + } + } + this.isEnabled = function() { + return isEnabled; + }; + this.subscribe = function(eventid, cb) { + eventNotifier.subscribe(eventid, cb); + }; + this.unsubscribe = function(eventid, cb) { + eventNotifier.unsubscribe(eventid, cb); + }; + function createAddGraphicsStyleOp(name) { + var op = new ops.OpAddStyle; + op.init({memberid:inputMemberId, styleName:name, styleFamily:"graphic", isAutomaticStyle:false, setProperties:{"style:graphic-properties":{"text:anchor-type":"paragraph", "svg:x":"0cm", "svg:y":"0cm", "style:wrap":"dynamic", "style:number-wrapped-paragraphs":"no-limit", "style:wrap-contour":"false", "style:vertical-pos":"top", "style:vertical-rel":"paragraph", "style:horizontal-pos":"center", "style:horizontal-rel":"paragraph"}}}); + return op; + } + function createAddFrameStyleOp(styleName, parentStyleName) { + var op = new ops.OpAddStyle; + op.init({memberid:inputMemberId, styleName:styleName, styleFamily:"graphic", isAutomaticStyle:true, setProperties:{"style:parent-style-name":parentStyleName, "style:graphic-properties":{"style:vertical-pos":"top", "style:vertical-rel":"baseline", "style:horizontal-pos":"center", "style:horizontal-rel":"paragraph", "fo:background-color":"transparent", "style:background-transparency":"100%", "style:shadow":"none", "style:mirror":"none", "fo:clip":"rect(0cm, 0cm, 0cm, 0cm)", "draw:luminance":"0%", + "draw:contrast":"0%", "draw:red":"0%", "draw:green":"0%", "draw:blue":"0%", "draw:gamma":"100%", "draw:color-inversion":"false", "draw:image-opacity":"100%", "draw:color-mode":"standard"}}}); + return op; + } + function getFileExtension(mimetype) { + mimetype = mimetype.toLowerCase(); + return fileExtensionByMimetype.hasOwnProperty(mimetype) ? fileExtensionByMimetype[mimetype] : null; + } + function insertImageInternal(mimetype, content, widthMeasure, heightMeasure) { + var graphicsStyleName = "Graphics", stylesElement = odtDocument.getOdfCanvas().odfContainer().rootElement.styles, fileExtension = getFileExtension(mimetype), fileName, graphicsStyleElement, frameStyleName, op, operations = []; + runtime.assert(fileExtension !== null, "Image type is not supported: " + mimetype); + fileName = "Pictures/" + objectNameGenerator.generateImageName() + fileExtension; + op = new ops.OpSetBlob; + op.init({memberid:inputMemberId, filename:fileName, mimetype:mimetype, content:content}); + operations.push(op); + graphicsStyleElement = formatting.getStyleElement(graphicsStyleName, "graphic", [stylesElement]); + if (!graphicsStyleElement) { + op = createAddGraphicsStyleOp(graphicsStyleName); + operations.push(op); + } + frameStyleName = objectNameGenerator.generateStyleName(); + op = createAddFrameStyleOp(frameStyleName, graphicsStyleName); + operations.push(op); + op = new ops.OpInsertImage; + op.init({memberid:inputMemberId, position:odtDocument.getCursorPosition(inputMemberId), filename:fileName, frameWidth:widthMeasure, frameHeight:heightMeasure, frameStyleName:frameStyleName, frameName:objectNameGenerator.generateFrameName()}); + operations.push(op); + session.enqueue(operations); + } + function scaleToAvailableContentSize(originalSize, pageContentSize) { + var widthRatio = 1, heightRatio = 1, ratio; + if (originalSize.width > pageContentSize.width) { + widthRatio = pageContentSize.width / originalSize.width; + } + if (originalSize.height > pageContentSize.height) { + heightRatio = pageContentSize.height / originalSize.height; + } + ratio = Math.min(widthRatio, heightRatio); + return {width:originalSize.width * ratio, height:originalSize.height * ratio}; + } + this.insertImage = function(mimetype, content, widthInPx, heightInPx) { + if (!isEnabled) { + return; + } + var paragraphElement, styleName, pageContentSize, imageSize, cssUnits = new core.CSSUnits; + runtime.assert(widthInPx > 0 && heightInPx > 0, "Both width and height of the image should be greater than 0px."); + imageSize = {width:widthInPx, height:heightInPx}; + paragraphElement = odfUtils.getParagraphElement(odtDocument.getCursor(inputMemberId).getNode()); + styleName = paragraphElement.getAttributeNS(textns, "style-name"); + if (styleName) { + pageContentSize = formatting.getContentSize(styleName, "paragraph"); + imageSize = scaleToAvailableContentSize(imageSize, pageContentSize); + } + insertImageInternal(mimetype, content, cssUnits.convert(imageSize.width, "px", "cm") + "cm", cssUnits.convert(imageSize.height, "px", "cm") + "cm"); + }; + this.destroy = function(callback) { + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorEvent); + sessionConstraints.unsubscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, updateEnabledState); + callback(); + }; + function init() { + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorEvent); + sessionConstraints.subscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, updateEnabledState); + updateEnabledState(); + } + init(); +}; +gui.ImageController.enabledChanged = "enabled/changed"; +gui.ImageSelector = function ImageSelector(odfCanvas) { + var svgns = odf.Namespaces.svgns, imageSelectorId = "imageSelector", selectorBorderWidth = 1, squareClassNames = ["topLeft", "topRight", "bottomRight", "bottomLeft", "topMiddle", "rightMiddle", "bottomMiddle", "leftMiddle"], document = odfCanvas.getElement().ownerDocument, hasSelection = false; + function createSelectorElement() { + var sizerElement = odfCanvas.getSizer(), selectorElement = document.createElement("div"); + selectorElement.id = "imageSelector"; + selectorElement.style.borderWidth = selectorBorderWidth + "px"; + sizerElement.appendChild(selectorElement); + function createDiv(className) { + var squareElement = document.createElement("div"); + squareElement.className = className; + selectorElement.appendChild(squareElement); + } + squareClassNames.forEach(createDiv); + return selectorElement; + } + function getPosition(element, referenceElement) { + var rect = element.getBoundingClientRect(), refRect = referenceElement.getBoundingClientRect(), zoomLevel = odfCanvas.getZoomLevel(); + return {left:(rect.left - refRect.left) / zoomLevel - selectorBorderWidth, top:(rect.top - refRect.top) / zoomLevel - selectorBorderWidth}; + } + this.select = function(frameElement) { + var selectorElement = document.getElementById(imageSelectorId), position; + if (!selectorElement) { + selectorElement = createSelectorElement(); + } + hasSelection = true; + position = getPosition(frameElement, selectorElement.parentNode); + selectorElement.style.display = "block"; + selectorElement.style.left = position.left + "px"; + selectorElement.style.top = position.top + "px"; + selectorElement.style.width = frameElement.getAttributeNS(svgns, "width"); + selectorElement.style.height = frameElement.getAttributeNS(svgns, "height"); + }; + this.clearSelection = function() { + var selectorElement; + if (hasSelection) { + selectorElement = document.getElementById(imageSelectorId); + if (selectorElement) { + selectorElement.style.display = "none"; + } + } + hasSelection = false; + }; + this.isSelectorElement = function(node) { + var selectorElement = document.getElementById(imageSelectorId); + if (!selectorElement) { + return false; + } + return node === selectorElement || node.parentNode === selectorElement; + }; +}; +(function() { + function DetectSafariCompositionError(eventManager) { + var lastCompositionValue, suppressedKeyPress = false; + function suppressIncorrectKeyPress(e) { + suppressedKeyPress = e.which && String.fromCharCode(e.which) === lastCompositionValue; + lastCompositionValue = undefined; + return suppressedKeyPress === false; + } + function clearSuppression() { + suppressedKeyPress = false; + } + function trapComposedValue(e) { + lastCompositionValue = e.data; + suppressedKeyPress = false; + } + function init() { + eventManager.subscribe("textInput", clearSuppression); + eventManager.subscribe("compositionend", trapComposedValue); + eventManager.addFilter("keypress", suppressIncorrectKeyPress); + } + this.destroy = function(callback) { + eventManager.unsubscribe("textInput", clearSuppression); + eventManager.unsubscribe("compositionend", trapComposedValue); + eventManager.removeFilter("keypress", suppressIncorrectKeyPress); + callback(); + }; + init(); + } + gui.InputMethodEditor = function InputMethodEditor(inputMemberId, eventManager) { + var cursorns = "urn:webodf:names:cursor", localCursor = null, eventTrap = eventManager.getEventTrap(), doc = eventTrap.ownerDocument, compositionElement, processUpdates, pendingEvent = false, pendingData = "", events = new core.EventNotifier([gui.InputMethodEditor.signalCompositionStart, gui.InputMethodEditor.signalCompositionEnd]), lastCompositionData, textSerializer, filters = [], cleanup, processingFocusEvent = false; + this.subscribe = events.subscribe; + this.unsubscribe = events.unsubscribe; + function setCursorComposing(state) { + if (localCursor) { + if (state) { + localCursor.getNode().setAttributeNS(cursorns, "composing", "true"); + } else { + localCursor.getNode().removeAttributeNS(cursorns, "composing"); + compositionElement.textContent = ""; + } + } + } + function flushEvent() { + if (pendingEvent) { + pendingEvent = false; + setCursorComposing(false); + events.emit(gui.InputMethodEditor.signalCompositionEnd, {data:pendingData}); + pendingData = ""; + } + } + function addCompositionData(data) { + pendingEvent = true; + pendingData += data; + processUpdates.trigger(); + } + function synchronizeWindowSelection() { + if (processingFocusEvent) { + return; + } + processingFocusEvent = true; + flushEvent(); + if (localCursor && localCursor.getSelectedRange().collapsed) { + eventTrap.value = ""; + } else { + eventTrap.value = textSerializer.writeToString(localCursor.getSelectedRange().cloneContents()); + } + eventTrap.setSelectionRange(0, eventTrap.value.length); + processingFocusEvent = false; + } + function handleCursorUpdated() { + if (eventManager.hasFocus()) { + processUpdates.trigger(); + } + } + function compositionStart() { + lastCompositionData = undefined; + processUpdates.cancel(); + setCursorComposing(true); + if (!pendingEvent) { + events.emit(gui.InputMethodEditor.signalCompositionStart, {data:""}); + } + } + function compositionEnd(e) { + lastCompositionData = e.data; + addCompositionData(e.data); + } + function textInput(e) { + if (e.data !== lastCompositionData) { + addCompositionData(e.data); + } + lastCompositionData = undefined; + } + function synchronizeCompositionText() { + compositionElement.textContent = eventTrap.value; + } + this.registerCursor = function(cursor) { + if (cursor.getMemberId() === inputMemberId) { + localCursor = cursor; + localCursor.getNode().appendChild(compositionElement); + cursor.subscribe(ops.OdtCursor.signalCursorUpdated, handleCursorUpdated); + eventManager.subscribe("input", synchronizeCompositionText); + eventManager.subscribe("compositionupdate", synchronizeCompositionText); + } + }; + this.removeCursor = function(memberid) { + if (localCursor && memberid === inputMemberId) { + localCursor.getNode().removeChild(compositionElement); + localCursor.unsubscribe(ops.OdtCursor.signalCursorUpdated, handleCursorUpdated); + eventManager.unsubscribe("input", synchronizeCompositionText); + eventManager.unsubscribe("compositionupdate", synchronizeCompositionText); + localCursor = null; + } + }; + this.destroy = function(callback) { + eventManager.unsubscribe("compositionstart", compositionStart); + eventManager.unsubscribe("compositionend", compositionEnd); + eventManager.unsubscribe("textInput", textInput); + eventManager.unsubscribe("keypress", flushEvent); + eventManager.unsubscribe("focus", synchronizeWindowSelection); + core.Async.destroyAll(cleanup, callback); + }; + function init() { + textSerializer = new odf.TextSerializer; + textSerializer.filter = new odf.OdfNodeFilter; + eventManager.subscribe("compositionstart", compositionStart); + eventManager.subscribe("compositionend", compositionEnd); + eventManager.subscribe("textInput", textInput); + eventManager.subscribe("keypress", flushEvent); + eventManager.subscribe("focus", synchronizeWindowSelection); + filters.push(new DetectSafariCompositionError(eventManager)); + function getDestroy(filter) { + return filter.destroy; + } + cleanup = filters.map(getDestroy); + compositionElement = doc.createElement("span"); + compositionElement.setAttribute("id", "composer"); + processUpdates = core.Task.createTimeoutTask(synchronizeWindowSelection, 1); + cleanup.push(processUpdates.destroy); + } + init(); + }; + gui.InputMethodEditor.signalCompositionStart = "input/compositionstart"; + gui.InputMethodEditor.signalCompositionEnd = "input/compositionend"; +})(); +gui.MetadataController = function MetadataController(session, inputMemberId) { + var odtDocument = session.getOdtDocument(), eventNotifier = new core.EventNotifier([gui.MetadataController.signalMetadataChanged]), readonlyProperties = ["dc:creator", "dc:date", "meta:editing-cycles", "meta:editing-duration", "meta:document-statistic"]; + function onMetadataUpdated(changes) { + eventNotifier.emit(gui.MetadataController.signalMetadataChanged, changes); + } + function isWriteableMetadata(property) { + var isWriteable = readonlyProperties.indexOf(property) === -1; + if (!isWriteable) { + runtime.log("Setting " + property + " is restricted."); + } + return isWriteable; + } + this.setMetadata = function(setProperties, removedProperties) { + var filteredSetProperties = {}, filteredRemovedProperties = "", op; + if (setProperties) { + Object.keys(setProperties).filter(isWriteableMetadata).forEach(function(property) { + filteredSetProperties[property] = setProperties[property]; + }); + } + if (removedProperties) { + filteredRemovedProperties = removedProperties.filter(isWriteableMetadata).join(","); + } + if (filteredRemovedProperties.length > 0 || Object.keys(filteredSetProperties).length > 0) { + op = new ops.OpUpdateMetadata; + op.init({memberid:inputMemberId, setProperties:filteredSetProperties, removedProperties:filteredRemovedProperties.length > 0 ? {attributes:filteredRemovedProperties} : null}); + session.enqueue([op]); + } + }; + this.getMetadata = function(property) { + var namespaceUri, parts; + runtime.assert(typeof property === "string", "Property must be a string"); + parts = property.split(":"); + runtime.assert(parts.length === 2, "Property must be a namespace-prefixed string"); + namespaceUri = odf.Namespaces.lookupNamespaceURI(parts[0]); + runtime.assert(Boolean(namespaceUri), "Prefix must be for an ODF namespace."); + return odtDocument.getOdfCanvas().odfContainer().getMetadata(namespaceUri, parts[1]); + }; + this.subscribe = function(eventid, cb) { + eventNotifier.subscribe(eventid, cb); + }; + this.unsubscribe = function(eventid, cb) { + eventNotifier.unsubscribe(eventid, cb); + }; + this.destroy = function(callback) { + odtDocument.unsubscribe(ops.OdtDocument.signalMetadataUpdated, onMetadataUpdated); + callback(); + }; + function init() { + odtDocument.subscribe(ops.OdtDocument.signalMetadataUpdated, onMetadataUpdated); + } + init(); +}; +gui.MetadataController.signalMetadataChanged = "metadata/changed"; +gui.PasteController = function PasteController(session, sessionConstraints, sessionContext, inputMemberId) { + var odtDocument = session.getOdtDocument(), isEnabled = false, textns = odf.Namespaces.textns, NEXT = core.StepDirection.NEXT, odfUtils = odf.OdfUtils; + function updateEnabledState() { + if (sessionConstraints.getState(gui.CommonConstraints.EDIT.REVIEW_MODE) === true) { + isEnabled = sessionContext.isLocalCursorWithinOwnAnnotation(); + } else { + isEnabled = true; + } + } + function onCursorEvent(cursor) { + if (cursor.getMemberId() === inputMemberId) { + updateEnabledState(); + } + } + this.isEnabled = function() { + return isEnabled; + }; + this.paste = function(data) { + if (!isEnabled) { + return; + } + var originalCursorPosition = odtDocument.getCursorPosition(inputMemberId), cursorNode = odtDocument.getCursor(inputMemberId).getNode(), originalParagraph = odfUtils.getParagraphElement(cursorNode), paragraphStyle = originalParagraph.getAttributeNS(textns, "style-name") || "", cursorPosition = originalCursorPosition, operations = [], currentParagraphStartPosition = odtDocument.convertDomPointToCursorStep(originalParagraph, 0, NEXT), paragraphs; + paragraphs = data.replace(/\r/g, "").split("\n"); + paragraphs.forEach(function(text) { + var insertTextOp = new ops.OpInsertText, splitParagraphOp = new ops.OpSplitParagraph; + insertTextOp.init({memberid:inputMemberId, position:cursorPosition, text:text, moveCursor:true}); + operations.push(insertTextOp); + cursorPosition += text.length; + splitParagraphOp.init({memberid:inputMemberId, position:cursorPosition, paragraphStyleName:paragraphStyle, sourceParagraphPosition:currentParagraphStartPosition, moveCursor:true}); + operations.push(splitParagraphOp); + cursorPosition += 1; + currentParagraphStartPosition = cursorPosition; + }); + operations.pop(); + session.enqueue(operations); + }; + this.destroy = function(callback) { + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorEvent); + sessionConstraints.unsubscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, updateEnabledState); + callback(); + }; + function init() { + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorEvent); + sessionConstraints.subscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, updateEnabledState); + updateEnabledState(); + } + init(); +}; +gui.ClosestXOffsetScanner = function(offset) { + var self = this, closestDiff, LEFT_TO_RIGHT = gui.StepInfo.VisualDirection.LEFT_TO_RIGHT; + this.token = undefined; + function isFurtherFromOffset(edgeOffset) { + if (edgeOffset !== null && closestDiff !== undefined) { + return Math.abs(edgeOffset - offset) > closestDiff; + } + return false; + } + function updateDiffIfSmaller(edge) { + if (edge !== null && isFurtherFromOffset(edge) === false) { + closestDiff = Math.abs(edge - offset); + } + } + this.process = function(stepInfo, previousRect, nextRect) { + var edge1, edge2; + if (stepInfo.visualDirection === LEFT_TO_RIGHT) { + edge1 = previousRect && previousRect.right; + edge2 = nextRect && nextRect.left; + } else { + edge1 = previousRect && previousRect.left; + edge2 = nextRect && nextRect.right; + } + if (isFurtherFromOffset(edge1) || isFurtherFromOffset(edge2)) { + return true; + } + if (previousRect || nextRect) { + updateDiffIfSmaller(edge1); + updateDiffIfSmaller(edge2); + self.token = stepInfo.token; + } + return false; + }; +}; +gui.LineBoundaryScanner = function() { + var self = this, lineRect = null, MIN_OVERLAP_THRESHOLD = .4; + function verticalOverlapPercent(rect1, rect2) { + var rect1Height = rect1.bottom - rect1.top, rect2Height = rect2.bottom - rect2.top, minRectHeight = Math.min(rect1Height, rect2Height), intersectTop = Math.max(rect1.top, rect2.top), intersectBottom = Math.min(rect1.bottom, rect2.bottom), overlapHeight = intersectBottom - intersectTop; + return minRectHeight > 0 ? overlapHeight / minRectHeight : 0; + } + function isLineBoundary(nextRect) { + if (lineRect) { + return verticalOverlapPercent(lineRect, nextRect) <= MIN_OVERLAP_THRESHOLD; + } + return false; + } + function combineRects(rect1, rect2) { + return {left:Math.min(rect1.left, rect2.left), right:Math.max(rect1.right, rect2.right), top:Math.min(rect1.top, rect2.top), bottom:Math.min(rect1.bottom, rect2.bottom)}; + } + function growRect(originalRect, newRect) { + if (originalRect && newRect) { + return combineRects(originalRect, newRect); + } + return originalRect || newRect; + } + this.token = undefined; + this.process = function(stepInfo, previousRect, nextRect) { + var isOverLineBoundary = nextRect && isLineBoundary(nextRect); + if (previousRect && (!nextRect || isOverLineBoundary)) { + self.token = stepInfo.token; + } + if (isOverLineBoundary) { + return true; + } + lineRect = growRect(lineRect, previousRect); + return false; + }; +}; +gui.ParagraphBoundaryScanner = function() { + var self = this, isInitialised = false, lastParagraph, odfUtils = odf.OdfUtils; + this.token = undefined; + this.process = function(stepInfo) { + var currentParagraph = odfUtils.getParagraphElement(stepInfo.container()); + if (!isInitialised) { + lastParagraph = currentParagraph; + isInitialised = true; + } + if (lastParagraph !== currentParagraph) { + return true; + } + self.token = stepInfo.token; + return false; + }; +}; +odf.WordBoundaryFilter = function WordBoundaryFilter(odtDocument, includeWhitespace) { + var TEXT_NODE = Node.TEXT_NODE, ELEMENT_NODE = Node.ELEMENT_NODE, odfUtils = odf.OdfUtils, punctuation = /[!-#%-*,-\/:-;?-@\[-\]_{}\u00a1\u00ab\u00b7\u00bb\u00bf;\u00b7\u055a-\u055f\u0589-\u058a\u05be\u05c0\u05c3\u05c6\u05f3-\u05f4\u0609-\u060a\u060c-\u060d\u061b\u061e-\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0964-\u0965\u0970\u0df4\u0e4f\u0e5a-\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u104a-\u104f\u10fb\u1361-\u1368\u166d-\u166e\u169b-\u169c\u16eb-\u16ed\u1735-\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944-\u1945\u19de-\u19df\u1a1e-\u1a1f\u1b5a-\u1b60\u1c3b-\u1c3f\u1c7e-\u1c7f\u2000-\u206e\u207d-\u207e\u208d-\u208e\u3008-\u3009\u2768-\u2775\u27c5-\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc-\u29fd\u2cf9-\u2cfc\u2cfe-\u2cff\u2e00-\u2e7e\u3000-\u303f\u30a0\u30fb\ua60d-\ua60f\ua673\ua67e\ua874-\ua877\ua8ce-\ua8cf\ua92e-\ua92f\ua95f\uaa5c-\uaa5f\ufd3e-\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a-\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a-\uff1b\uff1f-\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]|\ud800[\udd00-\udd01\udf9f\udfd0]|\ud802[\udd1f\udd3f\ude50-\ude58]|\ud809[\udc00-\udc7e]/, + spacing = /\s/, FILTER_ACCEPT = core.PositionFilter.FilterResult.FILTER_ACCEPT, FILTER_REJECT = core.PositionFilter.FilterResult.FILTER_REJECT, TRAILING = odf.WordBoundaryFilter.IncludeWhitespace.TRAILING, LEADING = odf.WordBoundaryFilter.IncludeWhitespace.LEADING, NeighborType = {NO_NEIGHBOUR:0, SPACE_CHAR:1, PUNCTUATION_CHAR:2, WORD_CHAR:3, OTHER:4}; + function findHigherNeighborNode(node, direction, nodeFilter) { + var neighboringNode = null, rootNode = odtDocument.getRootNode(), unfilteredCandidate; + while (node !== rootNode && node !== null && neighboringNode === null) { + unfilteredCandidate = direction < 0 ? node.previousSibling : node.nextSibling; + if (nodeFilter(unfilteredCandidate) === NodeFilter.FILTER_ACCEPT) { + neighboringNode = unfilteredCandidate; + } + node = node.parentNode; + } + return neighboringNode; + } + function typeOfNeighbor(node, getOffset) { + var neighboringChar; + if (node === null) { + return NeighborType.NO_NEIGHBOUR; + } + if (odfUtils.isCharacterElement(node)) { + return NeighborType.SPACE_CHAR; + } + if (node.nodeType === TEXT_NODE || odfUtils.isTextSpan(node) || odfUtils.isHyperlink(node)) { + neighboringChar = node.textContent.charAt(getOffset()); + if (spacing.test(neighboringChar)) { + return NeighborType.SPACE_CHAR; + } + if (punctuation.test(neighboringChar)) { + return NeighborType.PUNCTUATION_CHAR; + } + return NeighborType.WORD_CHAR; + } + return NeighborType.OTHER; + } + this.acceptPosition = function(iterator) { + var container = iterator.container(), leftNode = iterator.leftNode(), rightNode = iterator.rightNode(), getRightCharOffset = iterator.unfilteredDomOffset, getLeftCharOffset = function() { + return iterator.unfilteredDomOffset() - 1; + }, leftNeighborType, rightNeighborType; + if (container.nodeType === ELEMENT_NODE) { + if (rightNode === null) { + rightNode = findHigherNeighborNode(container, 1, iterator.getNodeFilter()); + } + if (leftNode === null) { + leftNode = findHigherNeighborNode(container, -1, iterator.getNodeFilter()); + } + } + if (container !== rightNode) { + getRightCharOffset = function() { + return 0; + }; + } + if (container !== leftNode && leftNode !== null) { + getLeftCharOffset = function() { + return leftNode.textContent.length - 1; + }; + } + leftNeighborType = typeOfNeighbor(leftNode, getLeftCharOffset); + rightNeighborType = typeOfNeighbor(rightNode, getRightCharOffset); + if (leftNeighborType === NeighborType.WORD_CHAR && rightNeighborType === NeighborType.WORD_CHAR || leftNeighborType === NeighborType.PUNCTUATION_CHAR && rightNeighborType === NeighborType.PUNCTUATION_CHAR || includeWhitespace === TRAILING && leftNeighborType !== NeighborType.NO_NEIGHBOUR && rightNeighborType === NeighborType.SPACE_CHAR || includeWhitespace === LEADING && leftNeighborType === NeighborType.SPACE_CHAR && rightNeighborType !== NeighborType.NO_NEIGHBOUR) { + return FILTER_REJECT; + } + return FILTER_ACCEPT; + }; +}; +odf.WordBoundaryFilter.IncludeWhitespace = {None:0, TRAILING:1, LEADING:2}; +gui.SelectionController = function SelectionController(session, inputMemberId) { + var odtDocument = session.getOdtDocument(), domUtils = core.DomUtils, odfUtils = odf.OdfUtils, baseFilter = odtDocument.getPositionFilter(), guiStepUtils = new gui.GuiStepUtils, rootFilter = odtDocument.createRootFilter(inputMemberId), caretXPositionLocator = null, lastXPosition, resetLastXPositionTask, TRAILING_SPACE = odf.WordBoundaryFilter.IncludeWhitespace.TRAILING, LEADING_SPACE = odf.WordBoundaryFilter.IncludeWhitespace.LEADING, PREVIOUS = core.StepDirection.PREVIOUS, NEXT = core.StepDirection.NEXT, + UPDOWN_NAVIGATION_RESET_DELAY_MS = 2E3; + function resetLastXPosition(op) { + var opspec = op.spec(); + if (op.isEdit || opspec.memberid === inputMemberId) { + lastXPosition = undefined; + resetLastXPositionTask.cancel(); + } + } + function createKeyboardStepIterator() { + var cursor = odtDocument.getCursor(inputMemberId), node = cursor.getNode(); + return odtDocument.createStepIterator(node, 0, [baseFilter, rootFilter], odtDocument.getRootElement(node)); + } + function createWordBoundaryStepIterator(node, offset, includeWhitespace) { + var wordBoundaryFilter = new odf.WordBoundaryFilter(odtDocument, includeWhitespace), nodeRoot = odtDocument.getRootElement(node) || odtDocument.getRootNode(), nodeRootFilter = odtDocument.createRootFilter(nodeRoot); + return odtDocument.createStepIterator(node, offset, [baseFilter, nodeRootFilter, wordBoundaryFilter], nodeRoot); + } + function selectionToRange(selection) { + var hasForwardSelection = domUtils.comparePoints(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset) >= 0, range = selection.focusNode.ownerDocument.createRange(); + if (hasForwardSelection) { + range.setStart(selection.anchorNode, selection.anchorOffset); + range.setEnd(selection.focusNode, selection.focusOffset); + } else { + range.setStart(selection.focusNode, selection.focusOffset); + range.setEnd(selection.anchorNode, selection.anchorOffset); + } + return {range:range, hasForwardSelection:hasForwardSelection}; + } + this.selectionToRange = selectionToRange; + function rangeToSelection(range, hasForwardSelection) { + if (hasForwardSelection) { + return {anchorNode:range.startContainer, anchorOffset:range.startOffset, focusNode:range.endContainer, focusOffset:range.endOffset}; + } + return {anchorNode:range.endContainer, anchorOffset:range.endOffset, focusNode:range.startContainer, focusOffset:range.startOffset}; + } + this.rangeToSelection = rangeToSelection; + function createOpMoveCursor(position, length, selectionType) { + var op = new ops.OpMoveCursor; + op.init({memberid:inputMemberId, position:position, length:length || 0, selectionType:selectionType}); + return op; + } + function moveCursorFocusPoint(focusNode, focusOffset, extend) { + var cursor, newSelection, newCursorSelection; + cursor = odtDocument.getCursor(inputMemberId); + newSelection = rangeToSelection(cursor.getSelectedRange(), cursor.hasForwardSelection()); + newSelection.focusNode = focusNode; + newSelection.focusOffset = focusOffset; + if (!extend) { + newSelection.anchorNode = newSelection.focusNode; + newSelection.anchorOffset = newSelection.focusOffset; + } + newCursorSelection = odtDocument.convertDomToCursorRange(newSelection); + session.enqueue([createOpMoveCursor(newCursorSelection.position, newCursorSelection.length)]); + } + function selectImage(frameNode) { + var frameRoot = odtDocument.getRootElement(frameNode), frameRootFilter = odtDocument.createRootFilter(frameRoot), stepIterator = odtDocument.createStepIterator(frameNode, 0, [frameRootFilter, odtDocument.getPositionFilter()], frameRoot), anchorNode, anchorOffset, newSelection, op; + if (!stepIterator.roundToPreviousStep()) { + runtime.assert(false, "No walkable position before frame"); + } + anchorNode = stepIterator.container(); + anchorOffset = stepIterator.offset(); + stepIterator.setPosition(frameNode, frameNode.childNodes.length); + if (!stepIterator.roundToNextStep()) { + runtime.assert(false, "No walkable position after frame"); + } + newSelection = odtDocument.convertDomToCursorRange({anchorNode:anchorNode, anchorOffset:anchorOffset, focusNode:stepIterator.container(), focusOffset:stepIterator.offset()}); + op = createOpMoveCursor(newSelection.position, newSelection.length, ops.OdtCursor.RegionSelection); + session.enqueue([op]); + } + this.selectImage = selectImage; + function expandToWordBoundaries(range) { + var stepIterator; + stepIterator = createWordBoundaryStepIterator(range.startContainer, range.startOffset, TRAILING_SPACE); + if (stepIterator.roundToPreviousStep()) { + range.setStart(stepIterator.container(), stepIterator.offset()); + } + stepIterator = createWordBoundaryStepIterator(range.endContainer, range.endOffset, LEADING_SPACE); + if (stepIterator.roundToNextStep()) { + range.setEnd(stepIterator.container(), stepIterator.offset()); + } + } + this.expandToWordBoundaries = expandToWordBoundaries; + function expandToParagraphBoundaries(range) { + var paragraphs = odfUtils.getParagraphElements(range), startParagraph = paragraphs[0], endParagraph = paragraphs[paragraphs.length - 1]; + if (startParagraph) { + range.setStart(startParagraph, 0); + } + if (endParagraph) { + if (odfUtils.isParagraph(range.endContainer) && range.endOffset === 0) { + range.setEndBefore(endParagraph); + } else { + range.setEnd(endParagraph, endParagraph.childNodes.length); + } + } + } + this.expandToParagraphBoundaries = expandToParagraphBoundaries; + function roundToClosestStep(root, filters, range, modifyStart) { + var stepIterator, node, offset; + if (modifyStart) { + node = range.startContainer; + offset = range.startOffset; + } else { + node = range.endContainer; + offset = range.endOffset; + } + if (!domUtils.containsNode(root, node)) { + if (domUtils.comparePoints(root, 0, node, offset) < 0) { + offset = 0; + } else { + offset = root.childNodes.length; + } + node = root; + } + stepIterator = odtDocument.createStepIterator(node, offset, filters, odfUtils.getParagraphElement(node) || root); + if (!stepIterator.roundToClosestStep()) { + runtime.assert(false, "No step found in requested range"); + } + if (modifyStart) { + range.setStart(stepIterator.container(), stepIterator.offset()); + } else { + range.setEnd(stepIterator.container(), stepIterator.offset()); + } + } + function selectRange(range, hasForwardSelection, clickCount) { + var canvasElement = odtDocument.getOdfCanvas().getElement(), validSelection, startInsideCanvas, endInsideCanvas, existingSelection, newSelection, anchorRoot, filters = [baseFilter], op; + startInsideCanvas = domUtils.containsNode(canvasElement, range.startContainer); + endInsideCanvas = domUtils.containsNode(canvasElement, range.endContainer); + if (!startInsideCanvas && !endInsideCanvas) { + return; + } + if (startInsideCanvas && endInsideCanvas) { + if (clickCount === 2) { + expandToWordBoundaries(range); + } else { + if (clickCount >= 3) { + expandToParagraphBoundaries(range); + } + } + } + if (hasForwardSelection) { + anchorRoot = odtDocument.getRootElement(range.startContainer); + } else { + anchorRoot = odtDocument.getRootElement(range.endContainer); + } + if (!anchorRoot) { + anchorRoot = odtDocument.getRootNode(); + } + filters.push(odtDocument.createRootFilter(anchorRoot)); + roundToClosestStep(anchorRoot, filters, range, true); + roundToClosestStep(anchorRoot, filters, range, false); + validSelection = rangeToSelection(range, hasForwardSelection); + newSelection = odtDocument.convertDomToCursorRange(validSelection); + existingSelection = odtDocument.getCursorSelection(inputMemberId); + if (newSelection.position !== existingSelection.position || newSelection.length !== existingSelection.length) { + op = createOpMoveCursor(newSelection.position, newSelection.length, ops.OdtCursor.RangeSelection); + session.enqueue([op]); + } + } + this.selectRange = selectRange; + function moveCursor(direction, extend) { + var stepIterator = createKeyboardStepIterator(); + if (stepIterator.advanceStep(direction)) { + moveCursorFocusPoint(stepIterator.container(), stepIterator.offset(), extend); + } + } + function moveCursorToLeft() { + moveCursor(PREVIOUS, false); + return true; + } + this.moveCursorToLeft = moveCursorToLeft; + function moveCursorToRight() { + moveCursor(NEXT, false); + return true; + } + this.moveCursorToRight = moveCursorToRight; + function extendSelectionToLeft() { + moveCursor(PREVIOUS, true); + return true; + } + this.extendSelectionToLeft = extendSelectionToLeft; + function extendSelectionToRight() { + moveCursor(NEXT, true); + return true; + } + this.extendSelectionToRight = extendSelectionToRight; + this.setCaretXPositionLocator = function(locator) { + caretXPositionLocator = locator; + }; + function moveCursorByLine(direction, extend) { + var stepIterator, currentX = lastXPosition, stepScanners = [new gui.LineBoundaryScanner, new gui.ParagraphBoundaryScanner]; + if (currentX === undefined && caretXPositionLocator) { + currentX = caretXPositionLocator(); + } + if (isNaN(currentX)) { + return; + } + stepIterator = createKeyboardStepIterator(); + if (!guiStepUtils.moveToFilteredStep(stepIterator, direction, stepScanners)) { + return; + } + if (!stepIterator.advanceStep(direction)) { + return; + } + stepScanners = [new gui.ClosestXOffsetScanner(currentX), new gui.LineBoundaryScanner, new gui.ParagraphBoundaryScanner]; + if (guiStepUtils.moveToFilteredStep(stepIterator, direction, stepScanners)) { + moveCursorFocusPoint(stepIterator.container(), stepIterator.offset(), extend); + lastXPosition = currentX; + resetLastXPositionTask.restart(); + } + } + function moveCursorUp() { + moveCursorByLine(PREVIOUS, false); + return true; + } + this.moveCursorUp = moveCursorUp; + function moveCursorDown() { + moveCursorByLine(NEXT, false); + return true; + } + this.moveCursorDown = moveCursorDown; + function extendSelectionUp() { + moveCursorByLine(PREVIOUS, true); + return true; + } + this.extendSelectionUp = extendSelectionUp; + function extendSelectionDown() { + moveCursorByLine(NEXT, true); + return true; + } + this.extendSelectionDown = extendSelectionDown; + function moveCursorToLineBoundary(direction, extend) { + var stepIterator = createKeyboardStepIterator(), stepScanners = [new gui.LineBoundaryScanner, new gui.ParagraphBoundaryScanner]; + if (guiStepUtils.moveToFilteredStep(stepIterator, direction, stepScanners)) { + moveCursorFocusPoint(stepIterator.container(), stepIterator.offset(), extend); + } + } + function moveCursorByWord(direction, extend) { + var cursor = odtDocument.getCursor(inputMemberId), newSelection = rangeToSelection(cursor.getSelectedRange(), cursor.hasForwardSelection()), stepIterator = createWordBoundaryStepIterator(newSelection.focusNode, newSelection.focusOffset, TRAILING_SPACE); + if (stepIterator.advanceStep(direction)) { + moveCursorFocusPoint(stepIterator.container(), stepIterator.offset(), extend); + } + } + function moveCursorBeforeWord() { + moveCursorByWord(PREVIOUS, false); + return true; + } + this.moveCursorBeforeWord = moveCursorBeforeWord; + function moveCursorPastWord() { + moveCursorByWord(NEXT, false); + return true; + } + this.moveCursorPastWord = moveCursorPastWord; + function extendSelectionBeforeWord() { + moveCursorByWord(PREVIOUS, true); + return true; + } + this.extendSelectionBeforeWord = extendSelectionBeforeWord; + function extendSelectionPastWord() { + moveCursorByWord(NEXT, true); + return true; + } + this.extendSelectionPastWord = extendSelectionPastWord; + function moveCursorToLineStart() { + moveCursorToLineBoundary(PREVIOUS, false); + return true; + } + this.moveCursorToLineStart = moveCursorToLineStart; + function moveCursorToLineEnd() { + moveCursorToLineBoundary(NEXT, false); + return true; + } + this.moveCursorToLineEnd = moveCursorToLineEnd; + function extendSelectionToLineStart() { + moveCursorToLineBoundary(PREVIOUS, true); + return true; + } + this.extendSelectionToLineStart = extendSelectionToLineStart; + function extendSelectionToLineEnd() { + moveCursorToLineBoundary(NEXT, true); + return true; + } + this.extendSelectionToLineEnd = extendSelectionToLineEnd; + function adjustSelectionByNode(direction, extend, getContainmentNode) { + var validStepFound = false, cursor = odtDocument.getCursor(inputMemberId), containmentNode, selection = rangeToSelection(cursor.getSelectedRange(), cursor.hasForwardSelection()), rootElement = odtDocument.getRootElement(selection.focusNode), stepIterator; + runtime.assert(Boolean(rootElement), "SelectionController: Cursor outside root"); + stepIterator = odtDocument.createStepIterator(selection.focusNode, selection.focusOffset, [baseFilter, rootFilter], rootElement); + stepIterator.roundToClosestStep(); + if (!stepIterator.advanceStep(direction)) { + return; + } + containmentNode = getContainmentNode(stepIterator.container()); + if (!containmentNode) { + return; + } + if (direction === PREVIOUS) { + stepIterator.setPosition(containmentNode, 0); + validStepFound = stepIterator.roundToNextStep(); + } else { + stepIterator.setPosition(containmentNode, containmentNode.childNodes.length); + validStepFound = stepIterator.roundToPreviousStep(); + } + if (validStepFound) { + moveCursorFocusPoint(stepIterator.container(), stepIterator.offset(), extend); + } + } + this.extendSelectionToParagraphStart = function() { + adjustSelectionByNode(PREVIOUS, true, odfUtils.getParagraphElement); + return true; + }; + this.extendSelectionToParagraphEnd = function() { + adjustSelectionByNode(NEXT, true, odfUtils.getParagraphElement); + return true; + }; + this.moveCursorToParagraphStart = function() { + adjustSelectionByNode(PREVIOUS, false, odfUtils.getParagraphElement); + return true; + }; + this.moveCursorToParagraphEnd = function() { + adjustSelectionByNode(NEXT, false, odfUtils.getParagraphElement); + return true; + }; + this.moveCursorToDocumentStart = function() { + adjustSelectionByNode(PREVIOUS, false, odtDocument.getRootElement); + return true; + }; + this.moveCursorToDocumentEnd = function() { + adjustSelectionByNode(NEXT, false, odtDocument.getRootElement); + return true; + }; + this.extendSelectionToDocumentStart = function() { + adjustSelectionByNode(PREVIOUS, true, odtDocument.getRootElement); + return true; + }; + this.extendSelectionToDocumentEnd = function() { + adjustSelectionByNode(NEXT, true, odtDocument.getRootElement); + return true; + }; + function extendSelectionToEntireDocument() { + var cursor = odtDocument.getCursor(inputMemberId), rootElement = odtDocument.getRootElement(cursor.getNode()), anchorNode, anchorOffset, stepIterator, newCursorSelection; + runtime.assert(Boolean(rootElement), "SelectionController: Cursor outside root"); + stepIterator = odtDocument.createStepIterator(rootElement, 0, [baseFilter, rootFilter], rootElement); + stepIterator.roundToClosestStep(); + anchorNode = stepIterator.container(); + anchorOffset = stepIterator.offset(); + stepIterator.setPosition(rootElement, rootElement.childNodes.length); + stepIterator.roundToClosestStep(); + newCursorSelection = odtDocument.convertDomToCursorRange({anchorNode:anchorNode, anchorOffset:anchorOffset, focusNode:stepIterator.container(), focusOffset:stepIterator.offset()}); + session.enqueue([createOpMoveCursor(newCursorSelection.position, newCursorSelection.length)]); + return true; + } + this.extendSelectionToEntireDocument = extendSelectionToEntireDocument; + this.destroy = function(callback) { + odtDocument.unsubscribe(ops.OdtDocument.signalOperationStart, resetLastXPosition); + core.Async.destroyAll([resetLastXPositionTask.destroy], callback); + }; + function init() { + resetLastXPositionTask = core.Task.createTimeoutTask(function() { + lastXPosition = undefined; + }, UPDOWN_NAVIGATION_RESET_DELAY_MS); + odtDocument.subscribe(ops.OdtDocument.signalOperationStart, resetLastXPosition); + } + init(); +}; +gui.TextController = function TextController(session, sessionConstraints, sessionContext, inputMemberId, directStyleOp, paragraphStyleOps) { + var odtDocument = session.getOdtDocument(), odfUtils = odf.OdfUtils, domUtils = core.DomUtils, BACKWARD = false, FORWARD = true, isEnabled = false, textns = odf.Namespaces.textns, NEXT = core.StepDirection.NEXT; + function updateEnabledState() { + if (sessionConstraints.getState(gui.CommonConstraints.EDIT.REVIEW_MODE) === true) { + isEnabled = sessionContext.isLocalCursorWithinOwnAnnotation(); + } else { + isEnabled = true; + } + } + function onCursorEvent(cursor) { + if (cursor.getMemberId() === inputMemberId) { + updateEnabledState(); + } + } + this.isEnabled = function() { + return isEnabled; + }; + function domToCursorRange(range, subTree, withRootFilter) { + var filters = [odtDocument.getPositionFilter()], startStep, endStep, stepIterator; + if (withRootFilter) { + filters.push(odtDocument.createRootFilter(range.startContainer)); + } + stepIterator = odtDocument.createStepIterator(range.startContainer, range.startOffset, filters, subTree); + if (!stepIterator.roundToClosestStep()) { + runtime.assert(false, "No walkable step found in paragraph element at range start"); + } + startStep = odtDocument.convertDomPointToCursorStep(stepIterator.container(), stepIterator.offset()); + if (range.collapsed) { + endStep = startStep; + } else { + stepIterator.setPosition(range.endContainer, range.endOffset); + if (!stepIterator.roundToClosestStep()) { + runtime.assert(false, "No walkable step found in paragraph element at range end"); + } + endStep = odtDocument.convertDomPointToCursorStep(stepIterator.container(), stepIterator.offset()); + } + return {position:startStep, length:endStep - startStep}; + } + function createRemoveSelectionOps(range) { + var firstParagraph, lastParagraph, mergedParagraphStyleName, previousParagraphStart, paragraphs = odfUtils.getParagraphElements(range), paragraphRange = range.cloneRange(), operations = []; + firstParagraph = paragraphs[0]; + if (paragraphs.length > 1) { + if (odfUtils.hasNoODFContent(firstParagraph)) { + lastParagraph = paragraphs[paragraphs.length - 1]; + mergedParagraphStyleName = lastParagraph.getAttributeNS(odf.Namespaces.textns, "style-name") || ""; + } else { + mergedParagraphStyleName = firstParagraph.getAttributeNS(odf.Namespaces.textns, "style-name") || ""; + } + } + paragraphs.forEach(function(paragraph, index) { + var paragraphStart, removeLimits, intersectionRange, removeOp, mergeOp; + paragraphRange.setStart(paragraph, 0); + paragraphRange.collapse(true); + paragraphStart = domToCursorRange(paragraphRange, paragraph, false).position; + if (index > 0) { + mergeOp = new ops.OpMergeParagraph; + mergeOp.init({memberid:inputMemberId, paragraphStyleName:mergedParagraphStyleName, destinationStartPosition:previousParagraphStart, sourceStartPosition:paragraphStart, moveCursor:index === 1}); + operations.unshift(mergeOp); + } + previousParagraphStart = paragraphStart; + paragraphRange.selectNodeContents(paragraph); + intersectionRange = domUtils.rangeIntersection(paragraphRange, range); + if (intersectionRange) { + removeLimits = domToCursorRange(intersectionRange, paragraph, true); + if (removeLimits.length > 0) { + removeOp = new ops.OpRemoveText; + removeOp.init({memberid:inputMemberId, position:removeLimits.position, length:removeLimits.length}); + operations.unshift(removeOp); + } + } + }); + return operations; + } + function toForwardSelection(selection) { + if (selection.length < 0) { + selection.position += selection.length; + selection.length = -selection.length; + } + return selection; + } + this.enqueueParagraphSplittingOps = function() { + if (!isEnabled) { + return false; + } + var cursor = odtDocument.getCursor(inputMemberId), range = cursor.getSelectedRange(), selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op, operations = [], styleOps, originalParagraph = odfUtils.getParagraphElement(cursor.getNode()), paragraphStyle = originalParagraph.getAttributeNS(textns, "style-name") || ""; + if (selection.length > 0) { + operations = operations.concat(createRemoveSelectionOps(range)); + } + op = new ops.OpSplitParagraph; + op.init({memberid:inputMemberId, position:selection.position, paragraphStyleName:paragraphStyle, sourceParagraphPosition:odtDocument.convertDomPointToCursorStep(originalParagraph, 0, NEXT), moveCursor:true}); + operations.push(op); + if (paragraphStyleOps) { + styleOps = paragraphStyleOps(selection.position + 1); + operations = operations.concat(styleOps); + } + session.enqueue(operations); + return true; + }; + function createStepIterator(cursorNode) { + var cursorRoot = odtDocument.getRootElement(cursorNode), filters = [odtDocument.getPositionFilter(), odtDocument.createRootFilter(cursorRoot)]; + return odtDocument.createStepIterator(cursorNode, 0, filters, cursorRoot); + } + function removeTextInDirection(isForward) { + if (!isEnabled) { + return false; + } + var cursorNode, range = odtDocument.getCursor(inputMemberId).getSelectedRange().cloneRange(), selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), stepIterator; + if (selection.length === 0) { + selection = undefined; + cursorNode = odtDocument.getCursor(inputMemberId).getNode(); + stepIterator = createStepIterator(cursorNode); + if (stepIterator.roundToClosestStep() && (isForward ? stepIterator.nextStep() : stepIterator.previousStep())) { + selection = toForwardSelection(odtDocument.convertDomToCursorRange({anchorNode:cursorNode, anchorOffset:0, focusNode:stepIterator.container(), focusOffset:stepIterator.offset()})); + if (isForward) { + range.setStart(cursorNode, 0); + range.setEnd(stepIterator.container(), stepIterator.offset()); + } else { + range.setStart(stepIterator.container(), stepIterator.offset()); + range.setEnd(cursorNode, 0); + } + } + } + if (selection) { + session.enqueue(createRemoveSelectionOps(range)); + } + return selection !== undefined; + } + this.removeTextByBackspaceKey = function() { + return removeTextInDirection(BACKWARD); + }; + this.removeTextByDeleteKey = function() { + return removeTextInDirection(FORWARD); + }; + this.removeCurrentSelection = function() { + if (!isEnabled) { + return false; + } + var range = odtDocument.getCursor(inputMemberId).getSelectedRange(); + session.enqueue(createRemoveSelectionOps(range)); + return true; + }; + function insertText(text) { + if (!isEnabled) { + return; + } + var range = odtDocument.getCursor(inputMemberId).getSelectedRange(), selection = toForwardSelection(odtDocument.getCursorSelection(inputMemberId)), op, stylingOp, operations = [], useCachedStyle = false; + if (selection.length > 0) { + operations = operations.concat(createRemoveSelectionOps(range)); + useCachedStyle = true; + } + op = new ops.OpInsertText; + op.init({memberid:inputMemberId, position:selection.position, text:text, moveCursor:true}); + operations.push(op); + if (directStyleOp) { + stylingOp = directStyleOp(selection.position, text.length, useCachedStyle); + if (stylingOp) { + operations.push(stylingOp); + } + } + session.enqueue(operations); + } + this.insertText = insertText; + this.destroy = function(callback) { + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorEvent); + sessionConstraints.unsubscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, updateEnabledState); + callback(); + }; + function init() { + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorEvent); + sessionConstraints.subscribe(gui.CommonConstraints.EDIT.REVIEW_MODE, updateEnabledState); + updateEnabledState(); + } + init(); +}; +gui.UndoManager = function UndoManager() { +}; +gui.UndoManager.prototype.subscribe = function(signal, callback) { +}; +gui.UndoManager.prototype.unsubscribe = function(signal, callback) { +}; +gui.UndoManager.prototype.setDocument = function(newDocument) { +}; +gui.UndoManager.prototype.setInitialState = function() { +}; +gui.UndoManager.prototype.initialize = function() { +}; +gui.UndoManager.prototype.purgeInitialState = function() { +}; +gui.UndoManager.prototype.setPlaybackFunction = function(playback_func) { +}; +gui.UndoManager.prototype.hasUndoStates = function() { +}; +gui.UndoManager.prototype.hasRedoStates = function() { +}; +gui.UndoManager.prototype.moveForward = function(states) { +}; +gui.UndoManager.prototype.moveBackward = function(states) { +}; +gui.UndoManager.prototype.onOperationExecuted = function(op) { +}; +gui.UndoManager.prototype.isDocumentModified = function() { +}; +gui.UndoManager.prototype.setDocumentModified = function(modified) { +}; +gui.UndoManager.signalUndoStackChanged = "undoStackChanged"; +gui.UndoManager.signalUndoStateCreated = "undoStateCreated"; +gui.UndoManager.signalUndoStateModified = "undoStateModified"; +gui.UndoManager.signalDocumentModifiedChanged = "documentModifiedChanged"; +gui.SessionControllerOptions = function() { + this.directTextStylingEnabled = false; + this.directParagraphStylingEnabled = false; + this.annotationsEnabled = false; +}; +(function() { + var FILTER_ACCEPT = core.PositionFilter.FilterResult.FILTER_ACCEPT; + gui.SessionController = function SessionController(session, inputMemberId, shadowCursor, args) { + var window = runtime.getWindow(), odtDocument = session.getOdtDocument(), sessionConstraints = new gui.SessionConstraints, sessionContext = new gui.SessionContext(session, inputMemberId), domUtils = core.DomUtils, odfUtils = odf.OdfUtils, mimeDataExporter = new gui.MimeDataExporter, clipboard = new gui.Clipboard(mimeDataExporter), keyDownHandler = new gui.KeyboardHandler, keyPressHandler = new gui.KeyboardHandler, keyUpHandler = new gui.KeyboardHandler, clickStartedWithinCanvas = false, objectNameGenerator = + new odf.ObjectNameGenerator(odtDocument.getOdfCanvas().odfContainer(), inputMemberId), isMouseMoved = false, mouseDownRootFilter = null, handleMouseClickTimeoutId, undoManager = null, eventManager = new gui.EventManager(odtDocument), annotationsEnabled = args.annotationsEnabled, annotationController = new gui.AnnotationController(session, sessionConstraints, inputMemberId), directFormattingController = new gui.DirectFormattingController(session, sessionConstraints, sessionContext, inputMemberId, + objectNameGenerator, args.directTextStylingEnabled, args.directParagraphStylingEnabled), createCursorStyleOp = directFormattingController.createCursorStyleOp, createParagraphStyleOps = directFormattingController.createParagraphStyleOps, textController = new gui.TextController(session, sessionConstraints, sessionContext, inputMemberId, createCursorStyleOp, createParagraphStyleOps), imageController = new gui.ImageController(session, sessionConstraints, sessionContext, inputMemberId, objectNameGenerator), + imageSelector = new gui.ImageSelector(odtDocument.getOdfCanvas()), shadowCursorIterator = odtDocument.createPositionIterator(odtDocument.getRootNode()), drawShadowCursorTask, redrawRegionSelectionTask, pasteController = new gui.PasteController(session, sessionConstraints, sessionContext, inputMemberId), inputMethodEditor = new gui.InputMethodEditor(inputMemberId, eventManager), clickCount = 0, hyperlinkClickHandler = new gui.HyperlinkClickHandler(odtDocument.getOdfCanvas().getElement, keyDownHandler, + keyUpHandler), hyperlinkController = new gui.HyperlinkController(session, sessionConstraints, sessionContext, inputMemberId), selectionController = new gui.SelectionController(session, inputMemberId), metadataController = new gui.MetadataController(session, inputMemberId), modifier = gui.KeyboardHandler.Modifier, keyCode = gui.KeyboardHandler.KeyCode, isMacOS = window.navigator.appVersion.toLowerCase().indexOf("mac") !== -1, isIOS = ["iPad", "iPod", "iPhone"].indexOf(window.navigator.platform) !== + -1, iOSSafariSupport; + runtime.assert(window !== null, "Expected to be run in an environment which has a global window, like a browser."); + function getTarget(e) { + return e.target || e.srcElement || null; + } + function cancelEvent(event) { + if (event.preventDefault) { + event.preventDefault(); + } else { + event.returnValue = false; + } + } + function caretPositionFromPoint(x, y) { + var doc = odtDocument.getDOMDocument(), c, result = null; + if (doc.caretRangeFromPoint) { + c = doc.caretRangeFromPoint(x, y); + result = {container:c.startContainer, offset:c.startOffset}; + } else { + if (doc.caretPositionFromPoint) { + c = doc.caretPositionFromPoint(x, y); + if (c && c.offsetNode) { + result = {container:c.offsetNode, offset:c.offset}; + } + } + } + return result; + } + function redrawRegionSelection() { + var cursor = odtDocument.getCursor(inputMemberId), imageElement; + if (cursor && cursor.getSelectionType() === ops.OdtCursor.RegionSelection) { + imageElement = odfUtils.getImageElements(cursor.getSelectedRange())[0]; + if (imageElement) { + imageSelector.select(imageElement.parentNode); + return; + } + } + imageSelector.clearSelection(); + } + function stringFromKeyPress(event) { + if (event.which === null || event.which === undefined) { + return String.fromCharCode(event.keyCode); + } + if (event.which !== 0 && event.charCode !== 0) { + return String.fromCharCode(event.which); + } + return null; + } + function handleCut(e) { + var cursor = odtDocument.getCursor(inputMemberId), selectedRange = cursor.getSelectedRange(); + if (selectedRange.collapsed) { + e.preventDefault(); + return; + } + if (clipboard.setDataFromRange(e, selectedRange)) { + textController.removeCurrentSelection(); + } else { + runtime.log("Cut operation failed"); + } + } + function handleBeforeCut() { + var cursor = odtDocument.getCursor(inputMemberId), selectedRange = cursor.getSelectedRange(); + return selectedRange.collapsed !== false; + } + function handleCopy(e) { + var cursor = odtDocument.getCursor(inputMemberId), selectedRange = cursor.getSelectedRange(); + if (selectedRange.collapsed) { + e.preventDefault(); + return; + } + if (!clipboard.setDataFromRange(e, selectedRange)) { + runtime.log("Copy operation failed"); + } + } + function handlePaste(e) { + var plainText; + if (window.clipboardData && window.clipboardData.getData) { + plainText = window.clipboardData.getData("Text"); + } else { + if (e.clipboardData && e.clipboardData.getData) { + plainText = e.clipboardData.getData("text/plain"); + } + } + if (plainText) { + textController.removeCurrentSelection(); + pasteController.paste(plainText); + } + cancelEvent(e); + } + function handleBeforePaste() { + return false; + } + function updateUndoStack(op) { + if (undoManager) { + undoManager.onOperationExecuted(op); + } + } + function forwardUndoStackChange(e) { + odtDocument.emit(ops.OdtDocument.signalUndoStackChanged, e); + } + function undo() { + var hadFocusBefore; + if (undoManager) { + hadFocusBefore = eventManager.hasFocus(); + undoManager.moveBackward(1); + if (hadFocusBefore) { + eventManager.focus(); + } + return true; + } + return false; + } + this.undo = undo; + function redo() { + var hadFocusBefore; + if (undoManager) { + hadFocusBefore = eventManager.hasFocus(); + undoManager.moveForward(1); + if (hadFocusBefore) { + eventManager.focus(); + } + return true; + } + return false; + } + this.redo = redo; + function extendSelectionByDrag(event) { + var position, cursor = odtDocument.getCursor(inputMemberId), selectedRange = cursor.getSelectedRange(), newSelectionRange, handleEnd = getTarget(event).getAttribute("end"); + if (selectedRange && handleEnd) { + position = caretPositionFromPoint(event.clientX, event.clientY); + if (position) { + shadowCursorIterator.setUnfilteredPosition(position.container, position.offset); + if (mouseDownRootFilter.acceptPosition(shadowCursorIterator) === FILTER_ACCEPT) { + newSelectionRange = selectedRange.cloneRange(); + if (handleEnd === "left") { + newSelectionRange.setStart(shadowCursorIterator.container(), shadowCursorIterator.unfilteredDomOffset()); + } else { + newSelectionRange.setEnd(shadowCursorIterator.container(), shadowCursorIterator.unfilteredDomOffset()); + } + shadowCursor.setSelectedRange(newSelectionRange, handleEnd === "right"); + odtDocument.emit(ops.Document.signalCursorMoved, shadowCursor); + } + } + } + } + function updateCursorSelection() { + selectionController.selectRange(shadowCursor.getSelectedRange(), shadowCursor.hasForwardSelection(), 1); + } + function updateShadowCursor() { + var selection = window.getSelection(), selectionRange = selection.rangeCount > 0 && selectionController.selectionToRange(selection); + if (clickStartedWithinCanvas && selectionRange) { + isMouseMoved = true; + imageSelector.clearSelection(); + shadowCursorIterator.setUnfilteredPosition(selection.focusNode, selection.focusOffset); + if (mouseDownRootFilter.acceptPosition(shadowCursorIterator) === FILTER_ACCEPT) { + if (clickCount === 2) { + selectionController.expandToWordBoundaries(selectionRange.range); + } else { + if (clickCount >= 3) { + selectionController.expandToParagraphBoundaries(selectionRange.range); + } + } + shadowCursor.setSelectedRange(selectionRange.range, selectionRange.hasForwardSelection); + odtDocument.emit(ops.Document.signalCursorMoved, shadowCursor); + } + } + } + function synchronizeWindowSelection(cursor) { + var selection = window.getSelection(), range = cursor.getSelectedRange(); + if (selection.extend) { + if (cursor.hasForwardSelection()) { + selection.collapse(range.startContainer, range.startOffset); + selection.extend(range.endContainer, range.endOffset); + } else { + selection.collapse(range.endContainer, range.endOffset); + selection.extend(range.startContainer, range.startOffset); + } + } else { + selection.removeAllRanges(); + selection.addRange(range.cloneRange()); + } + } + function computeClickCount(event) { + return event.button === 0 ? event.detail : 0; + } + function handleMouseDown(e) { + var target = getTarget(e), cursor = odtDocument.getCursor(inputMemberId), rootNode; + clickStartedWithinCanvas = target !== null && domUtils.containsNode(odtDocument.getOdfCanvas().getElement(), target); + if (clickStartedWithinCanvas) { + isMouseMoved = false; + rootNode = odtDocument.getRootElement(target) || odtDocument.getRootNode(); + mouseDownRootFilter = odtDocument.createRootFilter(rootNode); + clickCount = computeClickCount(e); + if (cursor && e.shiftKey) { + window.getSelection().collapse(cursor.getAnchorNode(), 0); + } else { + synchronizeWindowSelection(cursor); + } + if (clickCount > 1) { + updateShadowCursor(); + } + } + } + function mutableSelection(selection) { + if (selection) { + return {anchorNode:selection.anchorNode, anchorOffset:selection.anchorOffset, focusNode:selection.focusNode, focusOffset:selection.focusOffset}; + } + return null; + } + function getNextWalkablePosition(node) { + var root = odtDocument.getRootElement(node), rootFilter = odtDocument.createRootFilter(root), stepIterator = odtDocument.createStepIterator(node, 0, [rootFilter, odtDocument.getPositionFilter()], root); + stepIterator.setPosition(node, node.childNodes.length); + if (!stepIterator.roundToNextStep()) { + return null; + } + return {container:stepIterator.container(), offset:stepIterator.offset()}; + } + function moveByMouseClickEvent(event) { + var selection = mutableSelection(window.getSelection()), isCollapsed = window.getSelection().isCollapsed, position, selectionRange, rect, frameNode; + if (!selection.anchorNode && !selection.focusNode) { + position = caretPositionFromPoint(event.clientX, event.clientY); + if (position) { + selection.anchorNode = position.container; + selection.anchorOffset = position.offset; + selection.focusNode = selection.anchorNode; + selection.focusOffset = selection.anchorOffset; + } + } + if (odfUtils.isImage(selection.focusNode) && selection.focusOffset === 0 && odfUtils.isCharacterFrame(selection.focusNode.parentNode)) { + frameNode = selection.focusNode.parentNode; + rect = frameNode.getBoundingClientRect(); + if (event.clientX > rect.left) { + position = getNextWalkablePosition(frameNode); + if (position) { + selection.focusNode = position.container; + selection.focusOffset = position.offset; + if (isCollapsed) { + selection.anchorNode = selection.focusNode; + selection.anchorOffset = selection.focusOffset; + } + } + } + } else { + if (odfUtils.isImage(selection.focusNode.firstChild) && selection.focusOffset === 1 && odfUtils.isCharacterFrame(selection.focusNode)) { + position = getNextWalkablePosition(selection.focusNode); + if (position) { + selection.anchorNode = selection.focusNode = position.container; + selection.anchorOffset = selection.focusOffset = position.offset; + } + } + } + if (selection.anchorNode && selection.focusNode) { + selectionRange = selectionController.selectionToRange(selection); + selectionController.selectRange(selectionRange.range, selectionRange.hasForwardSelection, computeClickCount(event)); + } + eventManager.focus(); + } + function selectWordByLongPress(event) { + var selection, position, selectionRange, container, offset; + position = caretPositionFromPoint(event.clientX, event.clientY); + if (position) { + container = position.container; + offset = position.offset; + selection = {anchorNode:container, anchorOffset:offset, focusNode:container, focusOffset:offset}; + selectionRange = selectionController.selectionToRange(selection); + selectionController.selectRange(selectionRange.range, selectionRange.hasForwardSelection, 2); + eventManager.focus(); + } + } + function handleMouseClickEvent(event) { + var target = getTarget(event), clickEvent, range, wasCollapsed, frameNode, pos; + drawShadowCursorTask.processRequests(); + if (clickStartedWithinCanvas) { + if (odfUtils.isImage(target) && odfUtils.isCharacterFrame(target.parentNode) && window.getSelection().isCollapsed) { + selectionController.selectImage(target.parentNode); + eventManager.focus(); + } else { + if (imageSelector.isSelectorElement(target)) { + eventManager.focus(); + } else { + if (isMouseMoved) { + range = shadowCursor.getSelectedRange(); + wasCollapsed = range.collapsed; + if (odfUtils.isImage(range.endContainer) && range.endOffset === 0 && odfUtils.isCharacterFrame(range.endContainer.parentNode)) { + frameNode = range.endContainer.parentNode; + pos = getNextWalkablePosition(frameNode); + if (pos) { + range.setEnd(pos.container, pos.offset); + if (wasCollapsed) { + range.collapse(false); + } + } + } + selectionController.selectRange(range, shadowCursor.hasForwardSelection(), computeClickCount(event)); + eventManager.focus(); + } else { + if (isIOS) { + moveByMouseClickEvent(event); + } else { + clickEvent = domUtils.cloneEvent(event); + handleMouseClickTimeoutId = runtime.setTimeout(function() { + moveByMouseClickEvent(clickEvent); + }, 0); + } + } + } + } + clickCount = 0; + clickStartedWithinCanvas = false; + isMouseMoved = false; + } + } + function handleDragStart(e) { + var cursor = odtDocument.getCursor(inputMemberId), selectedRange = cursor.getSelectedRange(); + if (selectedRange.collapsed) { + return; + } + mimeDataExporter.exportRangeToDataTransfer(e.dataTransfer, selectedRange); + } + function handleDragEnd() { + if (clickStartedWithinCanvas) { + eventManager.focus(); + } + clickCount = 0; + clickStartedWithinCanvas = false; + isMouseMoved = false; + } + function handleContextMenu(e) { + handleMouseClickEvent(e); + } + function handleMouseUp(event) { + var target = getTarget(event), annotationNode = null; + if (target.className === "annotationRemoveButton") { + runtime.assert(annotationsEnabled, "Remove buttons are displayed on annotations while annotation editing is disabled in the controller."); + annotationNode = target.parentNode.getElementsByTagNameNS(odf.Namespaces.officens, "annotation").item(0); + annotationController.removeAnnotation(annotationNode); + eventManager.focus(); + } else { + if (target.getAttribute("class") !== "webodf-draggable") { + handleMouseClickEvent(event); + } + } + } + function insertNonEmptyData(e) { + var input = e.data; + if (input) { + if (input.indexOf("\n") === -1) { + textController.insertText(input); + } else { + pasteController.paste(input); + } + } + } + function returnTrue(fn) { + return function() { + fn(); + return true; + }; + } + function rangeSelectionOnly(fn) { + function f(e) { + var selectionType = odtDocument.getCursor(inputMemberId).getSelectionType(); + if (selectionType === ops.OdtCursor.RangeSelection) { + return fn(e); + } + return true; + } + return f; + } + function insertLocalCursor() { + runtime.assert(session.getOdtDocument().getCursor(inputMemberId) === undefined, "Inserting local cursor a second time."); + var op = new ops.OpAddCursor; + op.init({memberid:inputMemberId}); + session.enqueue([op]); + eventManager.focus(); + } + this.insertLocalCursor = insertLocalCursor; + function removeLocalCursor() { + runtime.assert(session.getOdtDocument().getCursor(inputMemberId) !== undefined, "Removing local cursor without inserting before."); + var op = new ops.OpRemoveCursor; + op.init({memberid:inputMemberId}); + session.enqueue([op]); + } + this.removeLocalCursor = removeLocalCursor; + this.startEditing = function() { + inputMethodEditor.subscribe(gui.InputMethodEditor.signalCompositionStart, textController.removeCurrentSelection); + inputMethodEditor.subscribe(gui.InputMethodEditor.signalCompositionEnd, insertNonEmptyData); + eventManager.subscribe("beforecut", handleBeforeCut); + eventManager.subscribe("cut", handleCut); + eventManager.subscribe("beforepaste", handleBeforePaste); + eventManager.subscribe("paste", handlePaste); + if (undoManager) { + undoManager.initialize(); + } + eventManager.setEditing(true); + hyperlinkClickHandler.setModifier(isMacOS ? modifier.Meta : modifier.Ctrl); + keyDownHandler.bind(keyCode.Backspace, modifier.None, returnTrue(textController.removeTextByBackspaceKey), true); + keyDownHandler.bind(keyCode.Delete, modifier.None, textController.removeTextByDeleteKey); + keyDownHandler.bind(keyCode.Tab, modifier.None, rangeSelectionOnly(function() { + textController.insertText("\t"); + return true; + })); + if (isMacOS) { + keyDownHandler.bind(keyCode.Clear, modifier.None, textController.removeCurrentSelection); + keyDownHandler.bind(keyCode.B, modifier.Meta, rangeSelectionOnly(directFormattingController.toggleBold)); + keyDownHandler.bind(keyCode.I, modifier.Meta, rangeSelectionOnly(directFormattingController.toggleItalic)); + keyDownHandler.bind(keyCode.U, modifier.Meta, rangeSelectionOnly(directFormattingController.toggleUnderline)); + keyDownHandler.bind(keyCode.L, modifier.MetaShift, rangeSelectionOnly(directFormattingController.alignParagraphLeft)); + keyDownHandler.bind(keyCode.E, modifier.MetaShift, rangeSelectionOnly(directFormattingController.alignParagraphCenter)); + keyDownHandler.bind(keyCode.R, modifier.MetaShift, rangeSelectionOnly(directFormattingController.alignParagraphRight)); + keyDownHandler.bind(keyCode.J, modifier.MetaShift, rangeSelectionOnly(directFormattingController.alignParagraphJustified)); + if (annotationsEnabled) { + keyDownHandler.bind(keyCode.C, modifier.MetaShift, annotationController.addAnnotation); + } + keyDownHandler.bind(keyCode.Z, modifier.Meta, undo); + keyDownHandler.bind(keyCode.Z, modifier.MetaShift, redo); + } else { + keyDownHandler.bind(keyCode.B, modifier.Ctrl, rangeSelectionOnly(directFormattingController.toggleBold)); + keyDownHandler.bind(keyCode.I, modifier.Ctrl, rangeSelectionOnly(directFormattingController.toggleItalic)); + keyDownHandler.bind(keyCode.U, modifier.Ctrl, rangeSelectionOnly(directFormattingController.toggleUnderline)); + keyDownHandler.bind(keyCode.L, modifier.CtrlShift, rangeSelectionOnly(directFormattingController.alignParagraphLeft)); + keyDownHandler.bind(keyCode.E, modifier.CtrlShift, rangeSelectionOnly(directFormattingController.alignParagraphCenter)); + keyDownHandler.bind(keyCode.R, modifier.CtrlShift, rangeSelectionOnly(directFormattingController.alignParagraphRight)); + keyDownHandler.bind(keyCode.J, modifier.CtrlShift, rangeSelectionOnly(directFormattingController.alignParagraphJustified)); + if (annotationsEnabled) { + keyDownHandler.bind(keyCode.C, modifier.CtrlAlt, annotationController.addAnnotation); + } + keyDownHandler.bind(keyCode.Z, modifier.Ctrl, undo); + keyDownHandler.bind(keyCode.Z, modifier.CtrlShift, redo); + } + function handler(e) { + var text = stringFromKeyPress(e); + if (text && !(e.altKey || e.ctrlKey || e.metaKey)) { + textController.insertText(text); + return true; + } + return false; + } + keyPressHandler.setDefault(rangeSelectionOnly(handler)); + keyPressHandler.bind(keyCode.Enter, modifier.None, rangeSelectionOnly(textController.enqueueParagraphSplittingOps)); + }; + this.endEditing = function() { + inputMethodEditor.unsubscribe(gui.InputMethodEditor.signalCompositionStart, textController.removeCurrentSelection); + inputMethodEditor.unsubscribe(gui.InputMethodEditor.signalCompositionEnd, insertNonEmptyData); + eventManager.unsubscribe("cut", handleCut); + eventManager.unsubscribe("beforecut", handleBeforeCut); + eventManager.unsubscribe("paste", handlePaste); + eventManager.unsubscribe("beforepaste", handleBeforePaste); + eventManager.setEditing(false); + hyperlinkClickHandler.setModifier(modifier.None); + keyDownHandler.bind(keyCode.Backspace, modifier.None, function() { + return true; + }, true); + keyDownHandler.unbind(keyCode.Delete, modifier.None); + keyDownHandler.unbind(keyCode.Tab, modifier.None); + if (isMacOS) { + keyDownHandler.unbind(keyCode.Clear, modifier.None); + keyDownHandler.unbind(keyCode.B, modifier.Meta); + keyDownHandler.unbind(keyCode.I, modifier.Meta); + keyDownHandler.unbind(keyCode.U, modifier.Meta); + keyDownHandler.unbind(keyCode.L, modifier.MetaShift); + keyDownHandler.unbind(keyCode.E, modifier.MetaShift); + keyDownHandler.unbind(keyCode.R, modifier.MetaShift); + keyDownHandler.unbind(keyCode.J, modifier.MetaShift); + if (annotationsEnabled) { + keyDownHandler.unbind(keyCode.C, modifier.MetaShift); + } + keyDownHandler.unbind(keyCode.Z, modifier.Meta); + keyDownHandler.unbind(keyCode.Z, modifier.MetaShift); + } else { + keyDownHandler.unbind(keyCode.B, modifier.Ctrl); + keyDownHandler.unbind(keyCode.I, modifier.Ctrl); + keyDownHandler.unbind(keyCode.U, modifier.Ctrl); + keyDownHandler.unbind(keyCode.L, modifier.CtrlShift); + keyDownHandler.unbind(keyCode.E, modifier.CtrlShift); + keyDownHandler.unbind(keyCode.R, modifier.CtrlShift); + keyDownHandler.unbind(keyCode.J, modifier.CtrlShift); + if (annotationsEnabled) { + keyDownHandler.unbind(keyCode.C, modifier.CtrlAlt); + } + keyDownHandler.unbind(keyCode.Z, modifier.Ctrl); + keyDownHandler.unbind(keyCode.Z, modifier.CtrlShift); + } + keyPressHandler.setDefault(null); + keyPressHandler.unbind(keyCode.Enter, modifier.None); + }; + this.getInputMemberId = function() { + return inputMemberId; + }; + this.getSession = function() { + return session; + }; + this.getSessionConstraints = function() { + return sessionConstraints; + }; + this.setUndoManager = function(manager) { + if (undoManager) { + undoManager.unsubscribe(gui.UndoManager.signalUndoStackChanged, forwardUndoStackChange); + } + undoManager = manager; + if (undoManager) { + undoManager.setDocument(odtDocument); + undoManager.setPlaybackFunction(session.enqueue); + undoManager.subscribe(gui.UndoManager.signalUndoStackChanged, forwardUndoStackChange); + } + }; + this.getUndoManager = function() { + return undoManager; + }; + this.getMetadataController = function() { + return metadataController; + }; + this.getAnnotationController = function() { + return annotationController; + }; + this.getDirectFormattingController = function() { + return directFormattingController; + }; + this.getHyperlinkClickHandler = function() { + return hyperlinkClickHandler; + }; + this.getHyperlinkController = function() { + return hyperlinkController; + }; + this.getImageController = function() { + return imageController; + }; + this.getSelectionController = function() { + return selectionController; + }; + this.getTextController = function() { + return textController; + }; + this.getEventManager = function() { + return eventManager; + }; + this.getKeyboardHandlers = function() { + return {keydown:keyDownHandler, keypress:keyPressHandler}; + }; + function destroy(callback) { + eventManager.unsubscribe("keydown", keyDownHandler.handleEvent); + eventManager.unsubscribe("keypress", keyPressHandler.handleEvent); + eventManager.unsubscribe("keyup", keyUpHandler.handleEvent); + eventManager.unsubscribe("copy", handleCopy); + eventManager.unsubscribe("mousedown", handleMouseDown); + eventManager.unsubscribe("mousemove", drawShadowCursorTask.trigger); + eventManager.unsubscribe("mouseup", handleMouseUp); + eventManager.unsubscribe("contextmenu", handleContextMenu); + eventManager.unsubscribe("dragstart", handleDragStart); + eventManager.unsubscribe("dragend", handleDragEnd); + eventManager.unsubscribe("click", hyperlinkClickHandler.handleClick); + eventManager.unsubscribe("longpress", selectWordByLongPress); + eventManager.unsubscribe("drag", extendSelectionByDrag); + eventManager.unsubscribe("dragstop", updateCursorSelection); + odtDocument.unsubscribe(ops.OdtDocument.signalOperationEnd, redrawRegionSelectionTask.trigger); + odtDocument.unsubscribe(ops.Document.signalCursorAdded, inputMethodEditor.registerCursor); + odtDocument.unsubscribe(ops.Document.signalCursorRemoved, inputMethodEditor.removeCursor); + odtDocument.unsubscribe(ops.OdtDocument.signalOperationEnd, updateUndoStack); + callback(); + } + this.destroy = function(callback) { + var destroyCallbacks = [drawShadowCursorTask.destroy, redrawRegionSelectionTask.destroy, directFormattingController.destroy, inputMethodEditor.destroy, eventManager.destroy, hyperlinkClickHandler.destroy, hyperlinkController.destroy, metadataController.destroy, selectionController.destroy, textController.destroy, destroy]; + if (iOSSafariSupport) { + destroyCallbacks.unshift(iOSSafariSupport.destroy); + } + runtime.clearTimeout(handleMouseClickTimeoutId); + core.Async.destroyAll(destroyCallbacks, callback); + }; + function init() { + drawShadowCursorTask = core.Task.createRedrawTask(updateShadowCursor); + redrawRegionSelectionTask = core.Task.createRedrawTask(redrawRegionSelection); + keyDownHandler.bind(keyCode.Left, modifier.None, rangeSelectionOnly(selectionController.moveCursorToLeft)); + keyDownHandler.bind(keyCode.Right, modifier.None, rangeSelectionOnly(selectionController.moveCursorToRight)); + keyDownHandler.bind(keyCode.Up, modifier.None, rangeSelectionOnly(selectionController.moveCursorUp)); + keyDownHandler.bind(keyCode.Down, modifier.None, rangeSelectionOnly(selectionController.moveCursorDown)); + keyDownHandler.bind(keyCode.Left, modifier.Shift, rangeSelectionOnly(selectionController.extendSelectionToLeft)); + keyDownHandler.bind(keyCode.Right, modifier.Shift, rangeSelectionOnly(selectionController.extendSelectionToRight)); + keyDownHandler.bind(keyCode.Up, modifier.Shift, rangeSelectionOnly(selectionController.extendSelectionUp)); + keyDownHandler.bind(keyCode.Down, modifier.Shift, rangeSelectionOnly(selectionController.extendSelectionDown)); + keyDownHandler.bind(keyCode.Home, modifier.None, rangeSelectionOnly(selectionController.moveCursorToLineStart)); + keyDownHandler.bind(keyCode.End, modifier.None, rangeSelectionOnly(selectionController.moveCursorToLineEnd)); + keyDownHandler.bind(keyCode.Home, modifier.Ctrl, rangeSelectionOnly(selectionController.moveCursorToDocumentStart)); + keyDownHandler.bind(keyCode.End, modifier.Ctrl, rangeSelectionOnly(selectionController.moveCursorToDocumentEnd)); + keyDownHandler.bind(keyCode.Home, modifier.Shift, rangeSelectionOnly(selectionController.extendSelectionToLineStart)); + keyDownHandler.bind(keyCode.End, modifier.Shift, rangeSelectionOnly(selectionController.extendSelectionToLineEnd)); + keyDownHandler.bind(keyCode.Up, modifier.CtrlShift, rangeSelectionOnly(selectionController.extendSelectionToParagraphStart)); + keyDownHandler.bind(keyCode.Down, modifier.CtrlShift, rangeSelectionOnly(selectionController.extendSelectionToParagraphEnd)); + keyDownHandler.bind(keyCode.Home, modifier.CtrlShift, rangeSelectionOnly(selectionController.extendSelectionToDocumentStart)); + keyDownHandler.bind(keyCode.End, modifier.CtrlShift, rangeSelectionOnly(selectionController.extendSelectionToDocumentEnd)); + if (isMacOS) { + keyDownHandler.bind(keyCode.Left, modifier.Alt, rangeSelectionOnly(selectionController.moveCursorBeforeWord)); + keyDownHandler.bind(keyCode.Right, modifier.Alt, rangeSelectionOnly(selectionController.moveCursorPastWord)); + keyDownHandler.bind(keyCode.Left, modifier.Meta, rangeSelectionOnly(selectionController.moveCursorToLineStart)); + keyDownHandler.bind(keyCode.Right, modifier.Meta, rangeSelectionOnly(selectionController.moveCursorToLineEnd)); + keyDownHandler.bind(keyCode.Home, modifier.Meta, rangeSelectionOnly(selectionController.moveCursorToDocumentStart)); + keyDownHandler.bind(keyCode.End, modifier.Meta, rangeSelectionOnly(selectionController.moveCursorToDocumentEnd)); + keyDownHandler.bind(keyCode.Left, modifier.AltShift, rangeSelectionOnly(selectionController.extendSelectionBeforeWord)); + keyDownHandler.bind(keyCode.Right, modifier.AltShift, rangeSelectionOnly(selectionController.extendSelectionPastWord)); + keyDownHandler.bind(keyCode.Left, modifier.MetaShift, rangeSelectionOnly(selectionController.extendSelectionToLineStart)); + keyDownHandler.bind(keyCode.Right, modifier.MetaShift, rangeSelectionOnly(selectionController.extendSelectionToLineEnd)); + keyDownHandler.bind(keyCode.Up, modifier.AltShift, rangeSelectionOnly(selectionController.extendSelectionToParagraphStart)); + keyDownHandler.bind(keyCode.Down, modifier.AltShift, rangeSelectionOnly(selectionController.extendSelectionToParagraphEnd)); + keyDownHandler.bind(keyCode.Up, modifier.MetaShift, rangeSelectionOnly(selectionController.extendSelectionToDocumentStart)); + keyDownHandler.bind(keyCode.Down, modifier.MetaShift, rangeSelectionOnly(selectionController.extendSelectionToDocumentEnd)); + keyDownHandler.bind(keyCode.A, modifier.Meta, rangeSelectionOnly(selectionController.extendSelectionToEntireDocument)); + } else { + keyDownHandler.bind(keyCode.Left, modifier.Ctrl, rangeSelectionOnly(selectionController.moveCursorBeforeWord)); + keyDownHandler.bind(keyCode.Right, modifier.Ctrl, rangeSelectionOnly(selectionController.moveCursorPastWord)); + keyDownHandler.bind(keyCode.Left, modifier.CtrlShift, rangeSelectionOnly(selectionController.extendSelectionBeforeWord)); + keyDownHandler.bind(keyCode.Right, modifier.CtrlShift, rangeSelectionOnly(selectionController.extendSelectionPastWord)); + keyDownHandler.bind(keyCode.A, modifier.Ctrl, rangeSelectionOnly(selectionController.extendSelectionToEntireDocument)); + } + if (isIOS) { + iOSSafariSupport = new gui.IOSSafariSupport(eventManager); + } + eventManager.subscribe("keydown", keyDownHandler.handleEvent); + eventManager.subscribe("keypress", keyPressHandler.handleEvent); + eventManager.subscribe("keyup", keyUpHandler.handleEvent); + eventManager.subscribe("copy", handleCopy); + eventManager.subscribe("mousedown", handleMouseDown); + eventManager.subscribe("mousemove", drawShadowCursorTask.trigger); + eventManager.subscribe("mouseup", handleMouseUp); + eventManager.subscribe("contextmenu", handleContextMenu); + eventManager.subscribe("dragstart", handleDragStart); + eventManager.subscribe("dragend", handleDragEnd); + eventManager.subscribe("click", hyperlinkClickHandler.handleClick); + eventManager.subscribe("longpress", selectWordByLongPress); + eventManager.subscribe("drag", extendSelectionByDrag); + eventManager.subscribe("dragstop", updateCursorSelection); + odtDocument.subscribe(ops.OdtDocument.signalOperationEnd, redrawRegionSelectionTask.trigger); + odtDocument.subscribe(ops.Document.signalCursorAdded, inputMethodEditor.registerCursor); + odtDocument.subscribe(ops.Document.signalCursorRemoved, inputMethodEditor.removeCursor); + odtDocument.subscribe(ops.OdtDocument.signalOperationEnd, updateUndoStack); + } + init(); + }; +})(); +gui.CaretManager = function CaretManager(sessionController, viewport) { + var carets = {}, window = runtime.getWindow(), odtDocument = sessionController.getSession().getOdtDocument(), eventManager = sessionController.getEventManager(); + function getCaret(memberId) { + return carets.hasOwnProperty(memberId) ? carets[memberId] : null; + } + function getLocalCaretXOffsetPx() { + var localCaret = getCaret(sessionController.getInputMemberId()), lastRect; + if (localCaret) { + lastRect = localCaret.getBoundingClientRect(); + } + return lastRect ? lastRect.right : undefined; + } + function getCarets() { + return Object.keys(carets).map(function(memberid) { + return carets[memberid]; + }); + } + function removeCaret(memberId) { + var caret = carets[memberId]; + if (caret) { + delete carets[memberId]; + if (memberId === sessionController.getInputMemberId()) { + odtDocument.unsubscribe(ops.OdtDocument.signalProcessingBatchEnd, caret.ensureVisible); + odtDocument.unsubscribe(ops.Document.signalCursorMoved, caret.refreshCursorBlinking); + eventManager.unsubscribe("compositionupdate", caret.handleUpdate); + eventManager.unsubscribe("compositionend", caret.handleUpdate); + eventManager.unsubscribe("focus", caret.setFocus); + eventManager.unsubscribe("blur", caret.removeFocus); + window.removeEventListener("focus", caret.show, false); + window.removeEventListener("blur", caret.hide, false); + } else { + odtDocument.unsubscribe(ops.OdtDocument.signalProcessingBatchEnd, caret.handleUpdate); + } + caret.destroy(function() { + }); + } + } + this.registerCursor = function(cursor, caretAvatarInitiallyVisible, blinkOnRangeSelect) { + var memberid = cursor.getMemberId(), caret = new gui.Caret(cursor, viewport, caretAvatarInitiallyVisible, blinkOnRangeSelect); + carets[memberid] = caret; + if (memberid === sessionController.getInputMemberId()) { + runtime.log("Starting to track input on new cursor of " + memberid); + odtDocument.subscribe(ops.OdtDocument.signalProcessingBatchEnd, caret.ensureVisible); + odtDocument.subscribe(ops.Document.signalCursorMoved, caret.refreshCursorBlinking); + eventManager.subscribe("compositionupdate", caret.handleUpdate); + eventManager.subscribe("compositionend", caret.handleUpdate); + eventManager.subscribe("focus", caret.setFocus); + eventManager.subscribe("blur", caret.removeFocus); + window.addEventListener("focus", caret.show, false); + window.addEventListener("blur", caret.hide, false); + caret.setOverlayElement(eventManager.getEventTrap()); + } else { + odtDocument.subscribe(ops.OdtDocument.signalProcessingBatchEnd, caret.handleUpdate); + } + return caret; + }; + this.getCaret = getCaret; + this.getCarets = getCarets; + this.destroy = function(callback) { + var caretCleanup = getCarets().map(function(caret) { + return caret.destroy; + }); + sessionController.getSelectionController().setCaretXPositionLocator(null); + odtDocument.unsubscribe(ops.Document.signalCursorRemoved, removeCaret); + carets = {}; + core.Async.destroyAll(caretCleanup, callback); + }; + function init() { + sessionController.getSelectionController().setCaretXPositionLocator(getLocalCaretXOffsetPx); + odtDocument.subscribe(ops.Document.signalCursorRemoved, removeCaret); + } + init(); +}; +gui.EditInfoHandle = function EditInfoHandle(parentElement) { + var edits = [], handle, document = parentElement.ownerDocument, htmlns = document.documentElement.namespaceURI, editinfons = "urn:webodf:names:editinfo"; + function renderEdits() { + var i, infoDiv, colorSpan, authorSpan, timeSpan; + core.DomUtils.removeAllChildNodes(handle); + for (i = 0;i < edits.length;i += 1) { + infoDiv = document.createElementNS(htmlns, "div"); + infoDiv.className = "editInfo"; + colorSpan = document.createElementNS(htmlns, "span"); + colorSpan.className = "editInfoColor"; + colorSpan.setAttributeNS(editinfons, "editinfo:memberid", edits[i].memberid); + authorSpan = document.createElementNS(htmlns, "span"); + authorSpan.className = "editInfoAuthor"; + authorSpan.setAttributeNS(editinfons, "editinfo:memberid", edits[i].memberid); + timeSpan = document.createElementNS(htmlns, "span"); + timeSpan.className = "editInfoTime"; + timeSpan.setAttributeNS(editinfons, "editinfo:memberid", edits[i].memberid); + timeSpan.appendChild(document.createTextNode(edits[i].time.toString())); + infoDiv.appendChild(colorSpan); + infoDiv.appendChild(authorSpan); + infoDiv.appendChild(timeSpan); + handle.appendChild(infoDiv); + } + } + this.setEdits = function(editArray) { + edits = editArray; + renderEdits(); + }; + this.show = function() { + handle.style.display = "block"; + }; + this.hide = function() { + handle.style.display = "none"; + }; + this.destroy = function(callback) { + parentElement.removeChild(handle); + callback(); + }; + function init() { + handle = document.createElementNS(htmlns, "div"); + handle.setAttribute("class", "editInfoHandle"); + handle.style.display = "none"; + parentElement.appendChild(handle); + } + init(); +}; +ops.EditInfo = function EditInfo(container, odtDocument) { + var editInfoNode, editHistory = {}; + function sortEdits() { + var arr = [], memberid; + for (memberid in editHistory) { + if (editHistory.hasOwnProperty(memberid)) { + arr.push({"memberid":memberid, "time":editHistory[memberid].time}); + } + } + arr.sort(function(a, b) { + return a.time - b.time; + }); + return arr; + } + this.getNode = function() { + return editInfoNode; + }; + this.getOdtDocument = function() { + return odtDocument; + }; + this.getEdits = function() { + return editHistory; + }; + this.getSortedEdits = function() { + return sortEdits(); + }; + this.addEdit = function(memberid, timestamp) { + editHistory[memberid] = {time:timestamp}; + }; + this.clearEdits = function() { + editHistory = {}; + }; + this.destroy = function(callback) { + if (container.parentNode) { + container.removeChild(editInfoNode); + } + callback(); + }; + function init() { + var editInfons = "urn:webodf:names:editinfo", dom = odtDocument.getDOMDocument(); + editInfoNode = dom.createElementNS(editInfons, "editinfo"); + container.insertBefore(editInfoNode, container.firstChild); + } + init(); +}; +gui.EditInfoMarker = function EditInfoMarker(editInfo, initialVisibility) { + var self = this, editInfoNode, handle, marker, editinfons = "urn:webodf:names:editinfo", decayTimer0, decayTimer1, decayTimer2, decayTimeStep = 1E4; + function applyDecay(opacity, delay) { + return runtime.setTimeout(function() { + marker.style.opacity = opacity; + }, delay); + } + function deleteDecay(timerId) { + runtime.clearTimeout(timerId); + } + function setLastAuthor(memberid) { + marker.setAttributeNS(editinfons, "editinfo:memberid", memberid); + } + this.addEdit = function(memberid, timestamp) { + var age = Date.now() - timestamp; + editInfo.addEdit(memberid, timestamp); + handle.setEdits(editInfo.getSortedEdits()); + setLastAuthor(memberid); + deleteDecay(decayTimer1); + deleteDecay(decayTimer2); + if (age < decayTimeStep) { + decayTimer0 = applyDecay(1, 0); + decayTimer1 = applyDecay(.5, decayTimeStep - age); + decayTimer2 = applyDecay(.2, decayTimeStep * 2 - age); + } else { + if (age >= decayTimeStep && age < decayTimeStep * 2) { + decayTimer0 = applyDecay(.5, 0); + decayTimer2 = applyDecay(.2, decayTimeStep * 2 - age); + } else { + decayTimer0 = applyDecay(.2, 0); + } + } + }; + this.getEdits = function() { + return editInfo.getEdits(); + }; + this.clearEdits = function() { + editInfo.clearEdits(); + handle.setEdits([]); + if (marker.hasAttributeNS(editinfons, "editinfo:memberid")) { + marker.removeAttributeNS(editinfons, "editinfo:memberid"); + } + }; + this.getEditInfo = function() { + return editInfo; + }; + this.show = function() { + marker.style.display = "block"; + }; + this.hide = function() { + self.hideHandle(); + marker.style.display = "none"; + }; + this.showHandle = function() { + handle.show(); + }; + this.hideHandle = function() { + handle.hide(); + }; + this.destroy = function(callback) { + deleteDecay(decayTimer0); + deleteDecay(decayTimer1); + deleteDecay(decayTimer2); + editInfoNode.removeChild(marker); + handle.destroy(function(err) { + if (err) { + callback(err); + } else { + editInfo.destroy(callback); + } + }); + }; + function init() { + var dom = editInfo.getOdtDocument().getDOMDocument(), htmlns = dom.documentElement.namespaceURI; + marker = dom.createElementNS(htmlns, "div"); + marker.setAttribute("class", "editInfoMarker"); + marker.onmouseover = function() { + self.showHandle(); + }; + marker.onmouseout = function() { + self.hideHandle(); + }; + editInfoNode = editInfo.getNode(); + editInfoNode.appendChild(marker); + handle = new gui.EditInfoHandle(editInfoNode); + if (!initialVisibility) { + self.hide(); + } + } + init(); +}; +gui.HyperlinkTooltipView = function HyperlinkTooltipView(odfCanvas, getActiveModifier) { + var domUtils = core.DomUtils, odfUtils = odf.OdfUtils, window = runtime.getWindow(), linkSpan, textSpan, tooltipElement, offsetXPx = 15, offsetYPx = 10; + runtime.assert(window !== null, "Expected to be run in an environment which has a global window, like a browser."); + function getHyperlinkElement(node) { + while (node) { + if (odfUtils.isHyperlink(node)) { + return node; + } + if (odfUtils.isParagraph(node) || odfUtils.isInlineRoot(node)) { + break; + } + node = node.parentNode; + } + return null; + } + function getHint() { + var modifierKey = getActiveModifier(), hint; + switch(modifierKey) { + case gui.KeyboardHandler.Modifier.Ctrl: + hint = runtime.tr("Ctrl-click to follow link"); + break; + case gui.KeyboardHandler.Modifier.Meta: + hint = runtime.tr("\u2318-click to follow link"); + break; + default: + hint = ""; + break; + } + return hint; + } + this.showTooltip = function(e) { + var target = e.target || e.srcElement, sizerElement = odfCanvas.getSizer(), zoomLevel = odfCanvas.getZoomLevel(), referenceRect, linkElement, left, top, max; + linkElement = getHyperlinkElement(target); + if (!linkElement) { + return; + } + if (!domUtils.containsNode(sizerElement, tooltipElement)) { + sizerElement.appendChild(tooltipElement); + } + textSpan.textContent = getHint(); + linkSpan.textContent = odfUtils.getHyperlinkTarget(linkElement); + tooltipElement.style.display = "block"; + max = window.innerWidth - tooltipElement.offsetWidth - offsetXPx; + left = e.clientX > max ? max : e.clientX + offsetXPx; + max = window.innerHeight - tooltipElement.offsetHeight - offsetYPx; + top = e.clientY > max ? max : e.clientY + offsetYPx; + referenceRect = sizerElement.getBoundingClientRect(); + left = (left - referenceRect.left) / zoomLevel; + top = (top - referenceRect.top) / zoomLevel; + tooltipElement.style.left = left + "px"; + tooltipElement.style.top = top + "px"; + }; + this.hideTooltip = function() { + tooltipElement.style.display = "none"; + }; + this.destroy = function(callback) { + if (tooltipElement.parentNode) { + tooltipElement.parentNode.removeChild(tooltipElement); + } + callback(); + }; + function init() { + var document = odfCanvas.getElement().ownerDocument; + linkSpan = document.createElement("span"); + textSpan = document.createElement("span"); + linkSpan.className = "webodf-hyperlinkTooltipLink"; + textSpan.className = "webodf-hyperlinkTooltipText"; + tooltipElement = document.createElement("div"); + tooltipElement.className = "webodf-hyperlinkTooltip"; + tooltipElement.appendChild(linkSpan); + tooltipElement.appendChild(textSpan); + odfCanvas.getElement().appendChild(tooltipElement); + } + init(); +}; +gui.OdfFieldView = function(odfCanvas) { + var style, document = odfCanvas.getElement().ownerDocument; + function newStyleSheet() { + var head = document.getElementsByTagName("head").item(0), sheet = document.createElement("style"), text = ""; + sheet.type = "text/css"; + sheet.media = "screen, print, handheld, projection"; + odf.Namespaces.forEachPrefix(function(prefix, ns) { + text += "@namespace " + prefix + " url(" + ns + ");\n"; + }); + sheet.appendChild(document.createTextNode(text)); + head.appendChild(sheet); + return sheet; + } + function clearCSSStyleSheet(style) { + var stylesheet = style.sheet, cssRules = stylesheet.cssRules; + while (cssRules.length) { + stylesheet.deleteRule(cssRules.length - 1); + } + } + function createRule(selectors, css) { + return selectors.join(",\n") + "\n" + css + "\n"; + } + function generateFieldCSS() { + var cssSelectors = odf.OdfSchema.getFields().map(function(prefixedName) { + return prefixedName.replace(":", "|"); + }), highlightFields = createRule(cssSelectors, "{ background-color: #D0D0D0; }"), emptyCssSelectors = cssSelectors.map(function(selector) { + return selector + ":empty::after"; + }), highlightEmptyFields = createRule(emptyCssSelectors, "{ content:' '; white-space: pre; }"); + return highlightFields + "\n" + highlightEmptyFields; + } + this.showFieldHighlight = function() { + style.appendChild(document.createTextNode(generateFieldCSS())); + }; + this.hideFieldHighlight = function() { + clearCSSStyleSheet(style); + }; + this.destroy = function(callback) { + if (style.parentNode) { + style.parentNode.removeChild(style); + } + callback(); + }; + function init() { + style = newStyleSheet(); + } + init(); +}; +gui.ShadowCursor = function ShadowCursor(document) { + var selectedRange = document.getDOMDocument().createRange(), forwardSelection = true; + this.removeFromDocument = function() { + }; + this.getMemberId = function() { + return gui.ShadowCursor.ShadowCursorMemberId; + }; + this.getSelectedRange = function() { + return selectedRange; + }; + this.setSelectedRange = function(range, isForwardSelection) { + selectedRange = range; + forwardSelection = isForwardSelection !== false; + }; + this.hasForwardSelection = function() { + return forwardSelection; + }; + this.getDocument = function() { + return document; + }; + this.getSelectionType = function() { + return ops.OdtCursor.RangeSelection; + }; + function init() { + selectedRange.setStart(document.getRootNode(), 0); + } + init(); +}; +gui.ShadowCursor.ShadowCursorMemberId = ""; +gui.SelectionView = function SelectionView(cursor) { +}; +gui.SelectionView.prototype.rerender = function() { +}; +gui.SelectionView.prototype.show = function() { +}; +gui.SelectionView.prototype.hide = function() { +}; +gui.SelectionView.prototype.destroy = function(callback) { +}; +gui.SelectionViewManager = function SelectionViewManager(SelectionView) { + var selectionViews = {}; + function getSelectionView(memberId) { + return selectionViews.hasOwnProperty(memberId) ? selectionViews[memberId] : null; + } + this.getSelectionView = getSelectionView; + function getSelectionViews() { + return Object.keys(selectionViews).map(function(memberid) { + return selectionViews[memberid]; + }); + } + this.getSelectionViews = getSelectionViews; + function removeSelectionView(memberId) { + if (selectionViews.hasOwnProperty(memberId)) { + selectionViews[memberId].destroy(function() { + }); + delete selectionViews[memberId]; + } + } + this.removeSelectionView = removeSelectionView; + function hideSelectionView(memberId) { + if (selectionViews.hasOwnProperty(memberId)) { + selectionViews[memberId].hide(); + } + } + this.hideSelectionView = hideSelectionView; + function showSelectionView(memberId) { + if (selectionViews.hasOwnProperty(memberId)) { + selectionViews[memberId].show(); + } + } + this.showSelectionView = showSelectionView; + this.rerenderSelectionViews = function() { + Object.keys(selectionViews).forEach(function(memberId) { + selectionViews[memberId].rerender(); + }); + }; + this.registerCursor = function(cursor, virtualSelectionsInitiallyVisible) { + var memberId = cursor.getMemberId(), selectionView = new SelectionView(cursor); + if (virtualSelectionsInitiallyVisible) { + selectionView.show(); + } else { + selectionView.hide(); + } + selectionViews[memberId] = selectionView; + return selectionView; + }; + this.destroy = function(callback) { + var selectionViewArray = getSelectionViews(); + function destroySelectionView(i, err) { + if (err) { + callback(err); + } else { + if (i < selectionViewArray.length) { + selectionViewArray[i].destroy(function(err) { + destroySelectionView(i + 1, err); + }); + } else { + callback(); + } + } + } + destroySelectionView(0, undefined); + }; +}; +gui.SessionViewOptions = function() { + this.editInfoMarkersInitiallyVisible = true; + this.caretAvatarsInitiallyVisible = true; + this.caretBlinksOnRangeSelect = true; +}; +(function() { + function configOption(userValue, defaultValue) { + return userValue !== undefined ? Boolean(userValue) : defaultValue; + } + gui.SessionView = function SessionView(viewOptions, localMemberId, session, sessionConstraints, caretManager, selectionViewManager) { + var avatarInfoStyles, annotationConstraintStyles, editInfons = "urn:webodf:names:editinfo", editInfoMap = {}, odtDocument, odfCanvas, highlightRefreshTask, showEditInfoMarkers = configOption(viewOptions.editInfoMarkersInitiallyVisible, true), showCaretAvatars = configOption(viewOptions.caretAvatarsInitiallyVisible, true), blinkOnRangeSelect = configOption(viewOptions.caretBlinksOnRangeSelect, true); + function onAnnotationAdded(info) { + if (info.memberId === localMemberId) { + odfCanvas.getViewport().scrollIntoView(info.annotation.getBoundingClientRect()); + } + } + function newStyleSheet() { + var head = document.getElementsByTagName("head").item(0), sheet = document.createElement("style"); + sheet.type = "text/css"; + sheet.media = "screen, print, handheld, projection"; + head.appendChild(sheet); + return sheet; + } + function createAvatarInfoNodeMatch(nodeName, memberId, pseudoClass) { + return nodeName + '[editinfo|memberid="' + memberId + '"]' + pseudoClass; + } + function getAvatarInfoStyle(nodeName, memberId, pseudoClass) { + var node = avatarInfoStyles.firstChild, nodeMatch = createAvatarInfoNodeMatch(nodeName, memberId, pseudoClass) + "{"; + while (node) { + if (node.nodeType === Node.TEXT_NODE && node.data.indexOf(nodeMatch) === 0) { + return node; + } + node = node.nextSibling; + } + return null; + } + function setAvatarInfoStyle(memberId, name, color) { + function setStyle(nodeName, rule, pseudoClass) { + var styleRule = createAvatarInfoNodeMatch(nodeName, memberId, pseudoClass) + rule, styleNode = getAvatarInfoStyle(nodeName, memberId, pseudoClass); + if (styleNode) { + styleNode.data = styleRule; + } else { + avatarInfoStyles.appendChild(document.createTextNode(styleRule)); + } + } + setStyle("div.editInfoMarker", "{ background-color: " + color + "; }", ""); + setStyle("span.editInfoColor", "{ background-color: " + color + "; }", ""); + setStyle("span.editInfoAuthor", '{ content: "' + name + '"; }', ":before"); + setStyle("dc|creator", "{ background-color: " + color + "; }", ""); + setStyle(".webodf-selectionOverlay", "{ fill: " + color + "; stroke: " + color + ";}", ""); + if (memberId === localMemberId) { + setStyle(".webodf-touchEnabled .webodf-selectionOverlay", "{ display: block; }", " > .webodf-draggable"); + memberId = gui.ShadowCursor.ShadowCursorMemberId; + setStyle(".webodf-selectionOverlay", "{ fill: " + color + "; stroke: " + color + ";}", ""); + setStyle(".webodf-touchEnabled .webodf-selectionOverlay", "{ display: block; }", " > .webodf-draggable"); + } + } + function highlightEdit(element, memberId, timestamp) { + var editInfo, editInfoMarker, id = "", editInfoNode = element.getElementsByTagNameNS(editInfons, "editinfo").item(0); + if (editInfoNode) { + id = editInfoNode.getAttributeNS(editInfons, "id"); + editInfoMarker = editInfoMap[id]; + } else { + id = Math.random().toString(); + editInfo = new ops.EditInfo(element, session.getOdtDocument()); + editInfoMarker = new gui.EditInfoMarker(editInfo, showEditInfoMarkers); + editInfoNode = element.getElementsByTagNameNS(editInfons, "editinfo").item(0); + editInfoNode.setAttributeNS(editInfons, "id", id); + editInfoMap[id] = editInfoMarker; + } + editInfoMarker.addEdit(memberId, new Date(timestamp)); + } + function setEditInfoMarkerVisibility(visible) { + var editInfoMarker, keyname; + for (keyname in editInfoMap) { + if (editInfoMap.hasOwnProperty(keyname)) { + editInfoMarker = editInfoMap[keyname]; + if (visible) { + editInfoMarker.show(); + } else { + editInfoMarker.hide(); + } + } + } + } + function setCaretAvatarVisibility(visible) { + caretManager.getCarets().forEach(function(caret) { + if (visible) { + caret.showHandle(); + } else { + caret.hideHandle(); + } + }); + } + this.showEditInfoMarkers = function() { + if (showEditInfoMarkers) { + return; + } + showEditInfoMarkers = true; + setEditInfoMarkerVisibility(showEditInfoMarkers); + }; + this.hideEditInfoMarkers = function() { + if (!showEditInfoMarkers) { + return; + } + showEditInfoMarkers = false; + setEditInfoMarkerVisibility(showEditInfoMarkers); + }; + this.showCaretAvatars = function() { + if (showCaretAvatars) { + return; + } + showCaretAvatars = true; + setCaretAvatarVisibility(showCaretAvatars); + }; + this.hideCaretAvatars = function() { + if (!showCaretAvatars) { + return; + } + showCaretAvatars = false; + setCaretAvatarVisibility(showCaretAvatars); + }; + this.getSession = function() { + return session; + }; + this.getCaret = function(memberid) { + return caretManager.getCaret(memberid); + }; + function renderMemberData(member) { + var memberId = member.getMemberId(), properties = member.getProperties(); + setAvatarInfoStyle(memberId, properties.fullName, properties.color); + } + function onCursorAdded(cursor) { + var memberId = cursor.getMemberId(), properties = session.getOdtDocument().getMember(memberId).getProperties(), caret; + caretManager.registerCursor(cursor, showCaretAvatars, blinkOnRangeSelect); + selectionViewManager.registerCursor(cursor, true); + caret = caretManager.getCaret(memberId); + if (caret) { + caret.setAvatarImageUrl(properties.imageUrl); + caret.setColor(properties.color); + } + runtime.log("+++ View here +++ eagerly created an Caret for '" + memberId + "'! +++"); + } + function onCursorMoved(cursor) { + var memberId = cursor.getMemberId(), localSelectionView = selectionViewManager.getSelectionView(localMemberId), shadowSelectionView = selectionViewManager.getSelectionView(gui.ShadowCursor.ShadowCursorMemberId), localCaret = caretManager.getCaret(localMemberId); + if (memberId === localMemberId) { + shadowSelectionView.hide(); + if (localSelectionView) { + localSelectionView.show(); + } + if (localCaret) { + localCaret.show(); + } + } else { + if (memberId === gui.ShadowCursor.ShadowCursorMemberId) { + shadowSelectionView.show(); + if (localSelectionView) { + localSelectionView.hide(); + } + if (localCaret) { + localCaret.hide(); + } + } + } + } + function onCursorRemoved(memberid) { + selectionViewManager.removeSelectionView(memberid); + } + function onParagraphChanged(info) { + highlightEdit(info.paragraphElement, info.memberId, info.timeStamp); + highlightRefreshTask.trigger(); + } + function refreshHighlights() { + var annotationViewManager = odfCanvas.getAnnotationViewManager(); + if (annotationViewManager) { + annotationViewManager.rehighlightAnnotations(); + odtDocument.fixCursorPositions(); + } + } + function processConstraints() { + var localMemberName, cssString, localMember; + if (annotationConstraintStyles.hasChildNodes()) { + core.DomUtils.removeAllChildNodes(annotationConstraintStyles); + } + if (sessionConstraints.getState(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN) === true) { + localMember = session.getOdtDocument().getMember(localMemberId); + if (localMember) { + localMemberName = localMember.getProperties().fullName; + cssString = ".annotationWrapper:not([creator = '" + localMemberName + "']) .annotationRemoveButton { display: none; }"; + annotationConstraintStyles.appendChild(document.createTextNode(cssString)); + } + } + } + function destroy(callback) { + var editInfoArray = Object.keys(editInfoMap).map(function(keyname) { + return editInfoMap[keyname]; + }); + odtDocument.unsubscribe(ops.Document.signalMemberAdded, renderMemberData); + odtDocument.unsubscribe(ops.Document.signalMemberUpdated, renderMemberData); + odtDocument.unsubscribe(ops.Document.signalCursorAdded, onCursorAdded); + odtDocument.unsubscribe(ops.Document.signalCursorRemoved, onCursorRemoved); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphChanged, onParagraphChanged); + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorMoved); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphChanged, selectionViewManager.rerenderSelectionViews); + odtDocument.unsubscribe(ops.OdtDocument.signalTableAdded, selectionViewManager.rerenderSelectionViews); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphStyleModified, selectionViewManager.rerenderSelectionViews); + sessionConstraints.unsubscribe(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN, processConstraints); + odtDocument.unsubscribe(ops.Document.signalMemberAdded, processConstraints); + odtDocument.unsubscribe(ops.Document.signalMemberUpdated, processConstraints); + avatarInfoStyles.parentNode.removeChild(avatarInfoStyles); + annotationConstraintStyles.parentNode.removeChild(annotationConstraintStyles); + (function destroyEditInfo(i, err) { + if (err) { + callback(err); + } else { + if (i < editInfoArray.length) { + editInfoArray[i].destroy(function(err) { + destroyEditInfo(i + 1, err); + }); + } else { + callback(); + } + } + })(0, undefined); + } + this.destroy = function(callback) { + var cleanup = [highlightRefreshTask.destroy, destroy]; + odtDocument.unsubscribe(ops.OdtDocument.signalAnnotationAdded, onAnnotationAdded); + core.Async.destroyAll(cleanup, callback); + }; + function init() { + odtDocument = session.getOdtDocument(); + odfCanvas = odtDocument.getOdfCanvas(); + odtDocument.subscribe(ops.OdtDocument.signalAnnotationAdded, onAnnotationAdded); + odtDocument.subscribe(ops.Document.signalMemberAdded, renderMemberData); + odtDocument.subscribe(ops.Document.signalMemberUpdated, renderMemberData); + odtDocument.subscribe(ops.Document.signalCursorAdded, onCursorAdded); + odtDocument.subscribe(ops.Document.signalCursorRemoved, onCursorRemoved); + odtDocument.subscribe(ops.OdtDocument.signalParagraphChanged, onParagraphChanged); + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorMoved); + odtDocument.subscribe(ops.OdtDocument.signalParagraphChanged, selectionViewManager.rerenderSelectionViews); + odtDocument.subscribe(ops.OdtDocument.signalTableAdded, selectionViewManager.rerenderSelectionViews); + odtDocument.subscribe(ops.OdtDocument.signalParagraphStyleModified, selectionViewManager.rerenderSelectionViews); + sessionConstraints.subscribe(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN, processConstraints); + odtDocument.subscribe(ops.Document.signalMemberAdded, processConstraints); + odtDocument.subscribe(ops.Document.signalMemberUpdated, processConstraints); + avatarInfoStyles = newStyleSheet(); + avatarInfoStyles.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);")); + avatarInfoStyles.appendChild(document.createTextNode("@namespace dc url(http://purl.org/dc/elements/1.1/);")); + annotationConstraintStyles = newStyleSheet(); + processConstraints(); + highlightRefreshTask = core.Task.createRedrawTask(refreshHighlights); + } + init(); + }; +})(); +gui.SvgSelectionView = function SvgSelectionView(cursor) { + var document = cursor.getDocument(), documentRoot, sizer, doc = document.getDOMDocument(), svgns = "http://www.w3.org/2000/svg", overlay = doc.createElementNS(svgns, "svg"), polygon = doc.createElementNS(svgns, "polygon"), handle1 = doc.createElementNS(svgns, "circle"), handle2 = doc.createElementNS(svgns, "circle"), odfUtils = odf.OdfUtils, domUtils = core.DomUtils, zoomHelper = document.getCanvas().getZoomHelper(), isVisible = true, positionIterator = cursor.getDocument().createPositionIterator(document.getRootNode()), + FILTER_ACCEPT = NodeFilter.FILTER_ACCEPT, FILTER_REJECT = NodeFilter.FILTER_REJECT, HANDLE_RADIUS = 8, renderTask; + function addOverlay() { + var newDocumentRoot = document.getRootNode(); + if (documentRoot !== newDocumentRoot) { + documentRoot = newDocumentRoot; + sizer = document.getCanvas().getSizer(); + sizer.appendChild(overlay); + overlay.setAttribute("class", "webodf-selectionOverlay"); + handle1.setAttribute("class", "webodf-draggable"); + handle2.setAttribute("class", "webodf-draggable"); + handle1.setAttribute("end", "left"); + handle2.setAttribute("end", "right"); + handle1.setAttribute("r", HANDLE_RADIUS); + handle2.setAttribute("r", HANDLE_RADIUS); + overlay.appendChild(polygon); + overlay.appendChild(handle1); + overlay.appendChild(handle2); + } + } + function isRangeVisible(range) { + var bcr = range.getBoundingClientRect(); + return Boolean(bcr && bcr.height !== 0); + } + function lastVisibleRect(range, nodes) { + var nextNodeIndex = nodes.length - 1, node = nodes[nextNodeIndex], startOffset, endOffset; + if (range.endContainer === node) { + startOffset = range.endOffset; + } else { + if (node.nodeType === Node.TEXT_NODE) { + startOffset = node.length; + } else { + startOffset = node.childNodes.length; + } + } + endOffset = startOffset; + range.setStart(node, startOffset); + range.setEnd(node, endOffset); + while (!isRangeVisible(range)) { + if (node.nodeType === Node.ELEMENT_NODE && startOffset > 0) { + startOffset = 0; + } else { + if (node.nodeType === Node.TEXT_NODE && startOffset > 0) { + startOffset -= 1; + } else { + if (nodes[nextNodeIndex]) { + node = nodes[nextNodeIndex]; + nextNodeIndex -= 1; + startOffset = endOffset = node.length || node.childNodes.length; + } else { + return false; + } + } + } + range.setStart(node, startOffset); + range.setEnd(node, endOffset); + } + return true; + } + function firstVisibleRect(range, nodes) { + var nextNodeIndex = 0, node = nodes[nextNodeIndex], startOffset = range.startContainer === node ? range.startOffset : 0, endOffset = startOffset; + range.setStart(node, startOffset); + range.setEnd(node, endOffset); + while (!isRangeVisible(range)) { + if (node.nodeType === Node.ELEMENT_NODE && endOffset < node.childNodes.length) { + endOffset = node.childNodes.length; + } else { + if (node.nodeType === Node.TEXT_NODE && endOffset < node.length) { + endOffset += 1; + } else { + if (nodes[nextNodeIndex]) { + node = nodes[nextNodeIndex]; + nextNodeIndex += 1; + startOffset = endOffset = 0; + } else { + return false; + } + } + } + range.setStart(node, startOffset); + range.setEnd(node, endOffset); + } + return true; + } + function getExtremeRanges(range) { + var nodes = odfUtils.getTextElements(range, true, false), firstRange = range.cloneRange(), lastRange = range.cloneRange(), fillerRange = range.cloneRange(); + if (!nodes.length) { + return null; + } + if (!firstVisibleRect(firstRange, nodes)) { + return null; + } + if (!lastVisibleRect(lastRange, nodes)) { + return null; + } + fillerRange.setStart(firstRange.startContainer, firstRange.startOffset); + fillerRange.setEnd(lastRange.endContainer, lastRange.endOffset); + return {firstRange:firstRange, lastRange:lastRange, fillerRange:fillerRange}; + } + function getBoundingRect(rect1, rect2) { + var resultRect = {}; + resultRect.top = Math.min(rect1.top, rect2.top); + resultRect.left = Math.min(rect1.left, rect2.left); + resultRect.right = Math.max(rect1.right, rect2.right); + resultRect.bottom = Math.max(rect1.bottom, rect2.bottom); + resultRect.width = resultRect.right - resultRect.left; + resultRect.height = resultRect.bottom - resultRect.top; + return resultRect; + } + function checkAndGrowOrCreateRect(originalRect, newRect) { + if (newRect && newRect.width > 0 && newRect.height > 0) { + if (!originalRect) { + originalRect = newRect; + } else { + originalRect = getBoundingRect(originalRect, newRect); + } + } + return originalRect; + } + function getFillerRect(fillerRange) { + var containerNode = fillerRange.commonAncestorContainer, firstNode = fillerRange.startContainer, lastNode = fillerRange.endContainer, firstOffset = fillerRange.startOffset, lastOffset = fillerRange.endOffset, currentNode, lastMeasuredNode, firstSibling, lastSibling, grownRect = null, currentRect, range = doc.createRange(), rootFilter, odfNodeFilter = new odf.OdfNodeFilter, treeWalker; + function acceptNode(node) { + positionIterator.setUnfilteredPosition(node, 0); + if (odfNodeFilter.acceptNode(node) === FILTER_ACCEPT && rootFilter.acceptPosition(positionIterator) === FILTER_ACCEPT) { + return FILTER_ACCEPT; + } + return FILTER_REJECT; + } + function getRectFromNodeAfterFiltering(node) { + var rect = null; + if (acceptNode(node) === FILTER_ACCEPT) { + rect = domUtils.getBoundingClientRect(node); + } + return rect; + } + if (firstNode === containerNode || lastNode === containerNode) { + range = fillerRange.cloneRange(); + grownRect = range.getBoundingClientRect(); + range.detach(); + return grownRect; + } + firstSibling = firstNode; + while (firstSibling.parentNode !== containerNode) { + firstSibling = firstSibling.parentNode; + } + lastSibling = lastNode; + while (lastSibling.parentNode !== containerNode) { + lastSibling = lastSibling.parentNode; + } + rootFilter = document.createRootFilter(firstNode); + currentNode = firstSibling.nextSibling; + while (currentNode && currentNode !== lastSibling) { + currentRect = getRectFromNodeAfterFiltering(currentNode); + grownRect = checkAndGrowOrCreateRect(grownRect, currentRect); + currentNode = currentNode.nextSibling; + } + if (odfUtils.isParagraph(firstSibling)) { + grownRect = checkAndGrowOrCreateRect(grownRect, domUtils.getBoundingClientRect(firstSibling)); + } else { + if (firstSibling.nodeType === Node.TEXT_NODE) { + currentNode = firstSibling; + range.setStart(currentNode, firstOffset); + range.setEnd(currentNode, currentNode === lastSibling ? lastOffset : currentNode.length); + currentRect = range.getBoundingClientRect(); + grownRect = checkAndGrowOrCreateRect(grownRect, currentRect); + } else { + treeWalker = doc.createTreeWalker(firstSibling, NodeFilter.SHOW_TEXT, acceptNode, false); + currentNode = treeWalker.currentNode = firstNode; + while (currentNode && currentNode !== lastNode) { + range.setStart(currentNode, firstOffset); + range.setEnd(currentNode, currentNode.length); + currentRect = range.getBoundingClientRect(); + grownRect = checkAndGrowOrCreateRect(grownRect, currentRect); + lastMeasuredNode = currentNode; + firstOffset = 0; + currentNode = treeWalker.nextNode(); + } + } + } + if (!lastMeasuredNode) { + lastMeasuredNode = firstNode; + } + if (odfUtils.isParagraph(lastSibling)) { + grownRect = checkAndGrowOrCreateRect(grownRect, domUtils.getBoundingClientRect(lastSibling)); + } else { + if (lastSibling.nodeType === Node.TEXT_NODE) { + currentNode = lastSibling; + range.setStart(currentNode, currentNode === firstSibling ? firstOffset : 0); + range.setEnd(currentNode, lastOffset); + currentRect = range.getBoundingClientRect(); + grownRect = checkAndGrowOrCreateRect(grownRect, currentRect); + } else { + treeWalker = doc.createTreeWalker(lastSibling, NodeFilter.SHOW_TEXT, acceptNode, false); + currentNode = treeWalker.currentNode = lastNode; + while (currentNode && currentNode !== lastMeasuredNode) { + range.setStart(currentNode, 0); + range.setEnd(currentNode, lastOffset); + currentRect = range.getBoundingClientRect(); + grownRect = checkAndGrowOrCreateRect(grownRect, currentRect); + currentNode = treeWalker.previousNode(); + if (currentNode) { + lastOffset = currentNode.length; + } + } + } + } + return grownRect; + } + function getCollapsedRectOfTextRange(range, useRightEdge) { + var clientRect = range.getBoundingClientRect(), collapsedRect = {}; + collapsedRect.width = 0; + collapsedRect.top = clientRect.top; + collapsedRect.bottom = clientRect.bottom; + collapsedRect.height = clientRect.height; + collapsedRect.left = collapsedRect.right = useRightEdge ? clientRect.right : clientRect.left; + return collapsedRect; + } + function setPoints(points) { + var pointsString = "", i; + for (i = 0;i < points.length;i += 1) { + pointsString += points[i].x + "," + points[i].y + " "; + } + polygon.setAttribute("points", pointsString); + } + function repositionOverlays(selectedRange) { + var rootRect = domUtils.getBoundingClientRect(sizer), zoomLevel = zoomHelper.getZoomLevel(), extremes = getExtremeRanges(selectedRange), firstRange, lastRange, fillerRange, firstRect, fillerRect, lastRect, left, right, top, bottom; + if (extremes) { + firstRange = extremes.firstRange; + lastRange = extremes.lastRange; + fillerRange = extremes.fillerRange; + firstRect = domUtils.translateRect(getCollapsedRectOfTextRange(firstRange, false), rootRect, zoomLevel); + lastRect = domUtils.translateRect(getCollapsedRectOfTextRange(lastRange, true), rootRect, zoomLevel); + fillerRect = getFillerRect(fillerRange); + if (!fillerRect) { + fillerRect = getBoundingRect(firstRect, lastRect); + } else { + fillerRect = domUtils.translateRect(fillerRect, rootRect, zoomLevel); + } + left = fillerRect.left; + right = firstRect.left + Math.max(0, fillerRect.width - (firstRect.left - fillerRect.left)); + top = Math.min(firstRect.top, lastRect.top); + bottom = lastRect.top + lastRect.height; + setPoints([{x:firstRect.left, y:top + firstRect.height}, {x:firstRect.left, y:top}, {x:right, y:top}, {x:right, y:bottom - lastRect.height}, {x:lastRect.right, y:bottom - lastRect.height}, {x:lastRect.right, y:bottom}, {x:left, y:bottom}, {x:left, y:top + firstRect.height}, {x:firstRect.left, y:top + firstRect.height}]); + handle1.setAttribute("cx", firstRect.left); + handle1.setAttribute("cy", top + firstRect.height / 2); + handle2.setAttribute("cx", lastRect.right); + handle2.setAttribute("cy", bottom - lastRect.height / 2); + firstRange.detach(); + lastRange.detach(); + fillerRange.detach(); + } + return Boolean(extremes); + } + function rerender() { + var range = cursor.getSelectedRange(), shouldShow; + shouldShow = isVisible && cursor.getSelectionType() === ops.OdtCursor.RangeSelection && !range.collapsed; + if (shouldShow) { + addOverlay(); + shouldShow = repositionOverlays(range); + } + if (shouldShow) { + overlay.style.display = "block"; + } else { + overlay.style.display = "none"; + } + } + this.rerender = function() { + if (isVisible) { + renderTask.trigger(); + } + }; + this.show = function() { + isVisible = true; + renderTask.trigger(); + }; + this.hide = function() { + isVisible = false; + renderTask.trigger(); + }; + function handleCursorMove(movedCursor) { + if (isVisible && movedCursor === cursor) { + renderTask.trigger(); + } + } + function scaleHandles(zoomLevel) { + var radius = HANDLE_RADIUS / zoomLevel; + handle1.setAttribute("r", radius); + handle2.setAttribute("r", radius); + } + function destroy(callback) { + sizer.removeChild(overlay); + sizer.classList.remove("webodf-virtualSelections"); + cursor.getDocument().unsubscribe(ops.Document.signalCursorMoved, handleCursorMove); + zoomHelper.unsubscribe(gui.ZoomHelper.signalZoomChanged, scaleHandles); + callback(); + } + this.destroy = function(callback) { + core.Async.destroyAll([renderTask.destroy, destroy], callback); + }; + function init() { + var editinfons = "urn:webodf:names:editinfo", memberid = cursor.getMemberId(); + renderTask = core.Task.createRedrawTask(rerender); + addOverlay(); + overlay.setAttributeNS(editinfons, "editinfo:memberid", memberid); + sizer.classList.add("webodf-virtualSelections"); + cursor.getDocument().subscribe(ops.Document.signalCursorMoved, handleCursorMove); + zoomHelper.subscribe(gui.ZoomHelper.signalZoomChanged, scaleHandles); + scaleHandles(zoomHelper.getZoomLevel()); + } + init(); +}; +gui.UndoStateRules = function UndoStateRules() { + function ReverseIterator(array, predicate) { + var index = array.length; + this.previous = function() { + for (index = index - 1;index >= 0;index -= 1) { + if (predicate(array[index])) { + return array[index]; + } + } + return null; + }; + } + function getOpType(op) { + return op.spec().optype; + } + function getOpPosition(op) { + var key = "position", spec = op.spec(), value; + if (spec.hasOwnProperty(key)) { + value = spec[key]; + } + return value; + } + function isEditOperation(op) { + return op.isEdit; + } + this.isEditOperation = isEditOperation; + function canAggregateOperation(op) { + switch(getOpType(op)) { + case "RemoveText": + ; + case "InsertText": + return true; + default: + return false; + } + } + function isSameDirectionOfTravel(thisOp, lastEditOp, secondLastEditOp) { + var thisPosition = getOpPosition(thisOp), lastPosition = getOpPosition(lastEditOp), secondLastPosition = getOpPosition(secondLastEditOp), diffLastToSecondLast = lastPosition - secondLastPosition, diffThisToLast = thisPosition - lastPosition; + return diffThisToLast === diffLastToSecondLast; + } + function isAdjacentOperation(thisOp, lastEditOp) { + var positionDifference = getOpPosition(thisOp) - getOpPosition(lastEditOp); + return positionDifference === 0 || Math.abs(positionDifference) === 1; + } + function continuesOperations(thisOp, lastEditOp, secondLastEditOp) { + if (!secondLastEditOp) { + return isAdjacentOperation(thisOp, lastEditOp); + } + return isSameDirectionOfTravel(thisOp, lastEditOp, secondLastEditOp); + } + function continuesMostRecentEditOperation(thisOp, recentOperations) { + var thisOpType = getOpType(thisOp), editOpsFinder = new ReverseIterator(recentOperations, isEditOperation), lastEditOp = editOpsFinder.previous(); + runtime.assert(Boolean(lastEditOp), "No edit operations found in state"); + if (thisOpType === getOpType(lastEditOp)) { + return continuesOperations(thisOp, lastEditOp, editOpsFinder.previous()); + } + return false; + } + function continuesMostRecentEditGroup(thisOp, recentOperations) { + var thisOpType = getOpType(thisOp), editOpsFinder = new ReverseIterator(recentOperations, isEditOperation), candidateOp = editOpsFinder.previous(), lastEditOp, secondLastEditOp = null, inspectedGroupsCount, groupId; + runtime.assert(Boolean(candidateOp), "No edit operations found in state"); + groupId = candidateOp.group; + runtime.assert(groupId !== undefined, "Operation has no group"); + inspectedGroupsCount = 1; + while (candidateOp && candidateOp.group === groupId) { + if (thisOpType === getOpType(candidateOp)) { + lastEditOp = candidateOp; + break; + } + candidateOp = editOpsFinder.previous(); + } + if (lastEditOp) { + candidateOp = editOpsFinder.previous(); + while (candidateOp) { + if (candidateOp.group !== groupId) { + if (inspectedGroupsCount === 2) { + break; + } + groupId = candidateOp.group; + inspectedGroupsCount += 1; + } + if (thisOpType === getOpType(candidateOp)) { + secondLastEditOp = candidateOp; + break; + } + candidateOp = editOpsFinder.previous(); + } + return continuesOperations(thisOp, lastEditOp, secondLastEditOp); + } + return false; + } + function isPartOfOperationSet(operation, recentOperations) { + var areOperationsGrouped = operation.group !== undefined, lastOperation; + if (!isEditOperation(operation)) { + return true; + } + if (recentOperations.length === 0) { + return true; + } + lastOperation = recentOperations[recentOperations.length - 1]; + if (areOperationsGrouped && operation.group === lastOperation.group) { + return true; + } + if (canAggregateOperation(operation) && recentOperations.some(isEditOperation)) { + if (areOperationsGrouped) { + return continuesMostRecentEditGroup(operation, recentOperations); + } + return continuesMostRecentEditOperation(operation, recentOperations); + } + return false; + } + this.isPartOfOperationSet = isPartOfOperationSet; +}; +(function() { + var stateIdBase = 0; + function StateId(mainId, subId) { + this.mainId = mainId !== undefined ? mainId : -1; + this.subId = subId !== undefined ? subId : -1; + } + function StateTransition(undoRules, initialOps, editOpsPossible) { + var nextStateId, operations, editOpsCount; + this.addOperation = function(op) { + if (undoRules.isEditOperation(op)) { + editOpsCount += 1; + } + operations.push(op); + }; + this.isNextStateId = function(stateId) { + return stateId.mainId === nextStateId && stateId.subId === editOpsCount; + }; + this.getNextStateId = function() { + return new StateId(nextStateId, editOpsCount); + }; + this.getOperations = function() { + return operations; + }; + function addEditOpsCount(count, op) { + return count + (undoRules.isEditOperation(op) ? 1 : 0); + } + function init() { + stateIdBase += 1; + nextStateId = stateIdBase; + operations = initialOps || []; + editOpsCount = initialOps && editOpsPossible ? initialOps.reduce(addEditOpsCount, 0) : 0; + } + init(); + } + gui.TrivialUndoManager = function TrivialUndoManager(defaultRules) { + var self = this, cursorns = "urn:webodf:names:cursor", domUtils = core.DomUtils, initialDoc, initialStateTransition, playFunc, document, unmodifiedStateId, currentUndoStateTransition, undoStateTransitions = [], redoStateTransitions = [], eventNotifier = new core.EventNotifier([gui.UndoManager.signalUndoStackChanged, gui.UndoManager.signalUndoStateCreated, gui.UndoManager.signalUndoStateModified, gui.UndoManager.signalDocumentModifiedChanged, gui.TrivialUndoManager.signalDocumentRootReplaced]), + undoRules = defaultRules || new gui.UndoStateRules, isExecutingOps = false; + function isModified() { + return currentUndoStateTransition.isNextStateId(unmodifiedStateId) !== true; + } + function executeOperations(stateTransition) { + var operations = stateTransition.getOperations(); + if (operations.length > 0) { + isExecutingOps = true; + playFunc(operations); + isExecutingOps = false; + } + } + function emitStackChange() { + eventNotifier.emit(gui.UndoManager.signalUndoStackChanged, {undoAvailable:self.hasUndoStates(), redoAvailable:self.hasRedoStates()}); + } + function emitDocumentModifiedChange(oldModified) { + var newModified = isModified(); + if (oldModified !== newModified) { + eventNotifier.emit(gui.UndoManager.signalDocumentModifiedChanged, newModified); + } + } + function mostRecentUndoStateTransition() { + return undoStateTransitions[undoStateTransitions.length - 1]; + } + function completeCurrentUndoState() { + if (currentUndoStateTransition !== initialStateTransition && currentUndoStateTransition !== mostRecentUndoStateTransition()) { + undoStateTransitions.push(currentUndoStateTransition); + } + } + function removeNode(node) { + var sibling = node.previousSibling || node.nextSibling; + node.parentNode.removeChild(node); + domUtils.normalizeTextNodes(sibling); + } + function removeCursors(root) { + domUtils.getElementsByTagNameNS(root, cursorns, "cursor").forEach(removeNode); + domUtils.getElementsByTagNameNS(root, cursorns, "anchor").forEach(removeNode); + } + function values(obj) { + return Object.keys(obj).map(function(key) { + return obj[key]; + }); + } + function extractCursorStates(undoStateTransitions) { + var addCursor = {}, moveCursor = {}, requiredAddOps = {}, remainingAddOps, ops, stateTransition = undoStateTransitions.pop(); + document.getMemberIds().forEach(function(memberid) { + requiredAddOps[memberid] = true; + }); + remainingAddOps = Object.keys(requiredAddOps).length; + function processOp(op) { + var spec = op.spec(); + if (!requiredAddOps[spec.memberid]) { + return; + } + switch(spec.optype) { + case "AddCursor": + if (!addCursor[spec.memberid]) { + addCursor[spec.memberid] = op; + delete requiredAddOps[spec.memberid]; + remainingAddOps -= 1; + } + break; + case "MoveCursor": + if (!moveCursor[spec.memberid]) { + moveCursor[spec.memberid] = op; + } + break; + } + } + while (stateTransition && remainingAddOps > 0) { + ops = stateTransition.getOperations(); + ops.reverse(); + ops.forEach(processOp); + stateTransition = undoStateTransitions.pop(); + } + return new StateTransition(undoRules, values(addCursor).concat(values(moveCursor))); + } + this.subscribe = function(signal, callback) { + eventNotifier.subscribe(signal, callback); + }; + this.unsubscribe = function(signal, callback) { + eventNotifier.unsubscribe(signal, callback); + }; + this.isDocumentModified = isModified; + this.setDocumentModified = function(modified) { + if (isModified() === modified) { + return; + } + if (modified) { + unmodifiedStateId = new StateId; + } else { + unmodifiedStateId = currentUndoStateTransition.getNextStateId(); + } + eventNotifier.emit(gui.UndoManager.signalDocumentModifiedChanged, modified); + }; + this.hasUndoStates = function() { + return undoStateTransitions.length > 0; + }; + this.hasRedoStates = function() { + return redoStateTransitions.length > 0; + }; + this.setDocument = function(newDocument) { + document = newDocument; + }; + this.purgeInitialState = function() { + var oldModified = isModified(); + undoStateTransitions.length = 0; + redoStateTransitions.length = 0; + currentUndoStateTransition = initialStateTransition = new StateTransition(undoRules); + unmodifiedStateId = currentUndoStateTransition.getNextStateId(); + initialDoc = null; + emitStackChange(); + emitDocumentModifiedChange(oldModified); + }; + function setInitialState() { + var oldModified = isModified(); + initialDoc = document.cloneDocumentElement(); + removeCursors(initialDoc); + completeCurrentUndoState(); + currentUndoStateTransition = initialStateTransition = extractCursorStates([initialStateTransition].concat(undoStateTransitions)); + undoStateTransitions.length = 0; + redoStateTransitions.length = 0; + if (!oldModified) { + unmodifiedStateId = currentUndoStateTransition.getNextStateId(); + } + emitStackChange(); + emitDocumentModifiedChange(oldModified); + } + this.setInitialState = setInitialState; + this.initialize = function() { + if (!initialDoc) { + setInitialState(); + } + }; + this.setPlaybackFunction = function(playback_func) { + playFunc = playback_func; + }; + this.onOperationExecuted = function(op) { + if (isExecutingOps) { + return; + } + var oldModified = isModified(); + if (undoRules.isEditOperation(op) && (currentUndoStateTransition === initialStateTransition || redoStateTransitions.length > 0) || !undoRules.isPartOfOperationSet(op, currentUndoStateTransition.getOperations())) { + redoStateTransitions.length = 0; + completeCurrentUndoState(); + currentUndoStateTransition = new StateTransition(undoRules, [op], true); + undoStateTransitions.push(currentUndoStateTransition); + eventNotifier.emit(gui.UndoManager.signalUndoStateCreated, {operations:currentUndoStateTransition.getOperations()}); + emitStackChange(); + } else { + currentUndoStateTransition.addOperation(op); + eventNotifier.emit(gui.UndoManager.signalUndoStateModified, {operations:currentUndoStateTransition.getOperations()}); + } + emitDocumentModifiedChange(oldModified); + }; + this.moveForward = function(states) { + var moved = 0, oldModified = isModified(), redoOperations; + while (states && redoStateTransitions.length) { + redoOperations = redoStateTransitions.pop(); + undoStateTransitions.push(redoOperations); + executeOperations(redoOperations); + states -= 1; + moved += 1; + } + if (moved) { + currentUndoStateTransition = mostRecentUndoStateTransition(); + emitStackChange(); + emitDocumentModifiedChange(oldModified); + } + return moved; + }; + this.moveBackward = function(states) { + var moved = 0, oldModified = isModified(); + while (states && undoStateTransitions.length) { + redoStateTransitions.push(undoStateTransitions.pop()); + states -= 1; + moved += 1; + } + if (moved) { + document.getMemberIds().forEach(function(memberid) { + if (document.hasCursor(memberid)) { + document.removeCursor(memberid); + } + }); + document.setDocumentElement(initialDoc.cloneNode(true)); + eventNotifier.emit(gui.TrivialUndoManager.signalDocumentRootReplaced, {}); + executeOperations(initialStateTransition); + undoStateTransitions.forEach(executeOperations); + currentUndoStateTransition = mostRecentUndoStateTransition() || initialStateTransition; + emitStackChange(); + emitDocumentModifiedChange(oldModified); + } + return moved; + }; + function init() { + currentUndoStateTransition = initialStateTransition = new StateTransition(undoRules); + unmodifiedStateId = currentUndoStateTransition.getNextStateId(); + } + init(); + }; + gui.TrivialUndoManager.signalDocumentRootReplaced = "documentRootReplaced"; +})(); +odf.GraphicProperties = function(element, styleParseUtils, parent) { + var self = this, stylens = odf.Namespaces.stylens, svgns = odf.Namespaces.svgns, getter; + getter = {verticalPos:function() { + var v = element.getAttributeNS(stylens, "vertical-pos"); + return v === "" ? undefined : v; + }, verticalRel:function() { + var v = element.getAttributeNS(stylens, "vertical-rel"); + return v === "" ? undefined : v; + }, horizontalPos:function() { + var v = element.getAttributeNS(stylens, "horizontal-pos"); + return v === "" ? undefined : v; + }, horizontalRel:function() { + var v = element.getAttributeNS(stylens, "horizontal-rel"); + return v === "" ? undefined : v; + }, strokeWidth:function() { + var a = element.getAttributeNS(svgns, "stroke-width"); + return styleParseUtils.parseLength(a); + }}; + this.verticalPos = function() { + return self.data.value("verticalPos"); + }; + this.verticalRel = function() { + return self.data.value("verticalRel"); + }; + this.horizontalPos = function() { + return self.data.value("horizontalPos"); + }; + this.horizontalRel = function() { + return self.data.value("horizontalRel"); + }; + this.strokeWidth = function() { + return self.data.value("strokeWidth"); + }; + this.data; + function init() { + var p = parent === undefined ? undefined : parent.data; + self.data = new odf.LazyStyleProperties(p, getter); + } + init(); +}; +odf.ComputedGraphicProperties = function() { + var g; + this.setGraphicProperties = function(graphicProperties) { + g = graphicProperties; + }; + this.verticalPos = function() { + return g && g.verticalPos() || "from-top"; + }; + this.verticalRel = function() { + return g && g.verticalRel() || "page"; + }; + this.horizontalPos = function() { + return g && g.horizontalPos() || "from-left"; + }; + this.horizontalRel = function() { + return g && g.horizontalRel() || "page"; + }; +}; +odf.PageLayoutProperties = function(element, styleParseUtils, parent) { + var self = this, fons = odf.Namespaces.fons, getter; + getter = {pageHeight:function() { + var a, value; + if (element) { + a = element.getAttributeNS(fons, "page-height"); + value = styleParseUtils.parseLength(a); + } + return value; + }, pageWidth:function() { + var a, value; + if (element) { + a = element.getAttributeNS(fons, "page-width"); + value = styleParseUtils.parseLength(a); + } + return value; + }}; + this.pageHeight = function() { + return self.data.value("pageHeight") || 1123; + }; + this.pageWidth = function() { + return self.data.value("pageWidth") || 794; + }; + this.data; + function init() { + var p = parent === undefined ? undefined : parent.data; + self.data = new odf.LazyStyleProperties(p, getter); + } + init(); +}; +odf.PageLayout = function(element, styleParseUtils, parent) { + var self = this; + this.pageLayout; + function init() { + var e = null; + if (element) { + e = styleParseUtils.getPropertiesElement("page-layout-properties", element); + } + self.pageLayout = new odf.PageLayoutProperties(e, styleParseUtils, parent && parent.pageLayout); + } + init(); +}; +odf.PageLayoutCache = function() { +}; +odf.PageLayoutCache.prototype.getPageLayout = function(name) { +}; +odf.PageLayoutCache.prototype.getDefaultPageLayout = function() { +}; +odf.ParagraphProperties = function(element, styleParseUtils, parent) { + var self = this, fons = odf.Namespaces.fons, getter; + getter = {marginTop:function() { + var a = element.getAttributeNS(fons, "margin-top"), value = styleParseUtils.parsePositiveLengthOrPercent(a, "marginTop", parent && parent.data); + return value; + }}; + this.marginTop = function() { + return self.data.value("marginTop"); + }; + this.data; + function init() { + var p = parent === undefined ? undefined : parent.data; + self.data = new odf.LazyStyleProperties(p, getter); + } + init(); +}; +odf.ComputedParagraphProperties = function() { + var data = {}, styleChain = []; + function value(name) { + var v, i; + if (data.hasOwnProperty(name)) { + v = data[name]; + } else { + for (i = 0;v === undefined && i < styleChain.length;i += 1) { + v = styleChain[i][name](); + } + data[name] = v; + } + return v; + } + this.setStyleChain = function setStyleChain(newStyleChain) { + styleChain = newStyleChain; + data = {}; + }; + this.marginTop = function() { + return value("marginTop") || 0; + }; +}; +odf.TextProperties = function(element, styleParseUtils, parent) { + var self = this, fons = odf.Namespaces.fons, getter; + getter = {fontSize:function() { + var a = element.getAttributeNS(fons, "font-size"), value = styleParseUtils.parsePositiveLengthOrPercent(a, "fontSize", parent && parent.data); + return value; + }}; + this.fontSize = function() { + return self.data.value("fontSize"); + }; + this.data; + function init() { + var p = parent === undefined ? undefined : parent.data; + self.data = new odf.LazyStyleProperties(p, getter); + } + init(); +}; +odf.ComputedTextProperties = function() { + var data = {}, styleChain = []; + function value(name) { + var v, i; + if (data.hasOwnProperty(name)) { + v = data[name]; + } else { + for (i = 0;v === undefined && i < styleChain.length;i += 1) { + v = styleChain[i][name](); + } + data[name] = v; + } + return v; + } + this.setStyleChain = function setStyleChain(newStyleChain) { + styleChain = newStyleChain; + data = {}; + }; + this.fontSize = function() { + return value("fontSize") || 12; + }; +}; +odf.MasterPage = function(element, pageLayoutCache) { + var self = this; + this.pageLayout; + function init() { + var pageLayoutName; + if (element) { + pageLayoutName = element.getAttributeNS(odf.Namespaces.stylens, "page-layout-name"); + self.pageLayout = pageLayoutCache.getPageLayout(pageLayoutName); + } else { + self.pageLayout = pageLayoutCache.getDefaultPageLayout(); + } + } + init(); +}; +odf.MasterPageCache = function() { +}; +odf.MasterPageCache.prototype.getMasterPage = function(name) { +}; +odf.StylePileEntry = function(element, styleParseUtils, masterPageCache, parent) { + this.text; + this.paragraph; + this.graphic; + this.masterPage = function() { + var masterPageName = element.getAttributeNS(odf.Namespaces.stylens, "master-page-name"), masterPage = null; + if (masterPageName) { + masterPage = masterPageCache.getMasterPage(masterPageName); + } + return masterPage; + }; + function init(self) { + var stylens = odf.Namespaces.stylens, family = element.getAttributeNS(stylens, "family"), e = null; + if (family === "graphic" || family === "chart") { + self.graphic = parent === undefined ? undefined : parent.graphic; + e = styleParseUtils.getPropertiesElement("graphic-properties", element, e); + if (e !== null) { + self.graphic = new odf.GraphicProperties(e, styleParseUtils, self.graphic); + } + } + if (family === "paragraph" || family === "table-cell" || family === "graphic" || family === "presentation" || family === "chart") { + self.paragraph = parent === undefined ? undefined : parent.paragraph; + e = styleParseUtils.getPropertiesElement("paragraph-properties", element, e); + if (e !== null) { + self.paragraph = new odf.ParagraphProperties(e, styleParseUtils, self.paragraph); + } + } + if (family === "text" || family === "paragraph" || family === "table-cell" || family === "graphic" || family === "presentation" || family === "chart") { + self.text = parent === undefined ? undefined : parent.text; + e = styleParseUtils.getPropertiesElement("text-properties", element, e); + if (e !== null) { + self.text = new odf.TextProperties(e, styleParseUtils, self.text); + } + } + } + init(this); +}; +odf.StylePile = function(styleParseUtils, masterPageCache) { + var stylens = odf.Namespaces.stylens, commonStyles = {}, automaticStyles = {}, defaultStyle, parsedCommonStyles = {}, parsedAutomaticStyles = {}, getCommonStyle; + function parseStyle(element, visitedStyles) { + var parent, parentName, style; + if (element.hasAttributeNS(stylens, "parent-style-name")) { + parentName = element.getAttributeNS(stylens, "parent-style-name"); + if (visitedStyles.indexOf(parentName) === -1) { + parent = getCommonStyle(parentName, visitedStyles); + } + } + style = new odf.StylePileEntry(element, styleParseUtils, masterPageCache, parent); + return style; + } + getCommonStyle = function(styleName, visitedStyles) { + var style = parsedCommonStyles[styleName], element; + if (!style) { + element = commonStyles[styleName]; + if (element) { + visitedStyles.push(styleName); + style = parseStyle(element, visitedStyles); + parsedCommonStyles[styleName] = style; + } + } + return style; + }; + function getStyle(styleName) { + var style = parsedAutomaticStyles[styleName] || parsedCommonStyles[styleName], element, visitedStyles = []; + if (!style) { + element = automaticStyles[styleName]; + if (!element) { + element = commonStyles[styleName]; + if (element) { + visitedStyles.push(styleName); + } + } + if (element) { + style = parseStyle(element, visitedStyles); + } + } + return style; + } + this.getStyle = getStyle; + this.addCommonStyle = function(style) { + var name; + if (style.hasAttributeNS(stylens, "name")) { + name = style.getAttributeNS(stylens, "name"); + if (!commonStyles.hasOwnProperty(name)) { + commonStyles[name] = style; + } + } + }; + this.addAutomaticStyle = function(style) { + var name; + if (style.hasAttributeNS(stylens, "name")) { + name = style.getAttributeNS(stylens, "name"); + if (!automaticStyles.hasOwnProperty(name)) { + automaticStyles[name] = style; + } + } + }; + this.setDefaultStyle = function(style) { + if (defaultStyle === undefined) { + defaultStyle = parseStyle(style, []); + } + }; + this.getDefaultStyle = function() { + return defaultStyle; + }; +}; +odf.ComputedGraphicStyle = function() { + this.text = new odf.ComputedTextProperties; + this.paragraph = new odf.ComputedParagraphProperties; + this.graphic = new odf.ComputedGraphicProperties; +}; +odf.ComputedParagraphStyle = function() { + this.text = new odf.ComputedTextProperties; + this.paragraph = new odf.ComputedParagraphProperties; +}; +odf.ComputedTextStyle = function() { + this.text = new odf.ComputedTextProperties; +}; +odf.StyleCache = function(odfroot) { + var self = this, stylePiles, textStyleCache, paragraphStyleCache, graphicStyleCache, textStylePile, paragraphStylePile, graphicStylePile, textns = odf.Namespaces.textns, stylens = odf.Namespaces.stylens, styleInfo = new odf.StyleInfo, styleParseUtils = new odf.StyleParseUtils, masterPages, parsedMasterPages, defaultMasterPage, defaultPageLayout, pageLayouts, parsedPageLayouts; + function appendClassNames(family, ns, element, chain) { + var names = element.getAttributeNS(ns, "class-names"), stylename, i; + if (names) { + names = names.split(" "); + for (i = 0;i < names.length;i += 1) { + stylename = names[i]; + if (stylename) { + chain.push(family); + chain.push(stylename); + } + } + } + } + function getGraphicStyleChain(element, chain) { + var stylename = styleInfo.getStyleName("graphic", element); + if (stylename !== undefined) { + chain.push("graphic"); + chain.push(stylename); + } + return chain; + } + function getParagraphStyleChain(element, chain) { + var stylename = styleInfo.getStyleName("paragraph", element); + if (stylename !== undefined) { + chain.push("paragraph"); + chain.push(stylename); + } + if (element.namespaceURI === textns && (element.localName === "h" || element.localName === "p")) { + appendClassNames("paragraph", textns, element, chain); + } + return chain; + } + function createPropertiesChain(styleChain, propertiesName, defaultFamily) { + var chain = [], i, lastProperties, family, styleName, pile, style, properties; + for (i = 0;i < styleChain.length;i += 2) { + family = styleChain[i]; + styleName = styleChain[i + 1]; + pile = stylePiles[family]; + style = pile.getStyle(styleName); + if (style !== undefined) { + properties = style[propertiesName]; + if (properties !== undefined && properties !== lastProperties) { + chain.push(properties); + lastProperties = properties; + } + } + } + pile = stylePiles[defaultFamily]; + style = pile.getDefaultStyle(); + if (style) { + properties = style[propertiesName]; + if (properties !== undefined && properties !== lastProperties) { + chain.push(properties); + } + } + return chain; + } + this.getComputedGraphicStyle = function(element) { + var styleChain = getGraphicStyleChain(element, []), key = styleChain.join("/"), computedStyle = graphicStyleCache[key]; + runtime.assert(styleChain.length % 2 === 0, "Invalid style chain."); + if (computedStyle === undefined) { + computedStyle = new odf.ComputedGraphicStyle; + computedStyle.graphic.setGraphicProperties(createPropertiesChain(styleChain, "graphic", "graphic")[0]); + computedStyle.text.setStyleChain(createPropertiesChain(styleChain, "text", "graphic")); + computedStyle.paragraph.setStyleChain(createPropertiesChain(styleChain, "paragraph", "graphic")); + graphicStyleCache[key] = computedStyle; + } + return computedStyle; + }; + this.getComputedParagraphStyle = function(element) { + var styleChain = getParagraphStyleChain(element, []), key = styleChain.join("/"), computedStyle = paragraphStyleCache[key]; + runtime.assert(styleChain.length % 2 === 0, "Invalid style chain."); + if (computedStyle === undefined) { + computedStyle = new odf.ComputedParagraphStyle; + computedStyle.text.setStyleChain(createPropertiesChain(styleChain, "text", "paragraph")); + computedStyle.paragraph.setStyleChain(createPropertiesChain(styleChain, "paragraph", "paragraph")); + paragraphStyleCache[key] = computedStyle; + } + return computedStyle; + }; + function getTextStyleChain(element, chain) { + var stylename = styleInfo.getStyleName("text", element), parent = element.parentNode; + if (stylename !== undefined) { + chain.push("text"); + chain.push(stylename); + } + if (element.localName === "span" && element.namespaceURI === textns) { + appendClassNames("text", textns, element, chain); + } + if (!parent || parent === odfroot) { + return chain; + } + if (parent.namespaceURI === textns && (parent.localName === "p" || parent.localName === "h")) { + getParagraphStyleChain(parent, chain); + } else { + getTextStyleChain(parent, chain); + } + return chain; + } + this.getComputedTextStyle = function(element) { + var styleChain = getTextStyleChain(element, []), key = styleChain.join("/"), computedStyle = textStyleCache[key]; + runtime.assert(styleChain.length % 2 === 0, "Invalid style chain."); + if (computedStyle === undefined) { + computedStyle = new odf.ComputedTextStyle; + computedStyle.text.setStyleChain(createPropertiesChain(styleChain, "text", "text")); + textStyleCache[key] = computedStyle; + } + return computedStyle; + }; + function getPileFromElement(element) { + var family = element.getAttributeNS(stylens, "family"); + return stylePiles[family]; + } + function addMasterPage(element) { + var name = element.getAttributeNS(stylens, "name"); + if (name.length > 0 && !masterPages.hasOwnProperty(name)) { + masterPages[name] = element; + } + } + function getPageLayout(name) { + var pageLayout = parsedPageLayouts[name], e; + if (!pageLayout) { + e = pageLayouts[name]; + if (e) { + pageLayout = new odf.PageLayout(e, styleParseUtils, defaultPageLayout); + parsedPageLayouts[name] = pageLayout; + } else { + pageLayout = defaultPageLayout; + } + } + return pageLayout; + } + this.getPageLayout = getPageLayout; + this.getDefaultPageLayout = function() { + return defaultPageLayout; + }; + function getMasterPage(name) { + var masterPage = parsedMasterPages[name], element; + if (masterPage === undefined) { + element = masterPages[name]; + if (element) { + masterPage = new odf.MasterPage(element, self); + parsedMasterPages[name] = masterPage; + } else { + masterPage = null; + } + } + return masterPage; + } + this.getMasterPage = getMasterPage; + this.getDefaultMasterPage = function() { + return defaultMasterPage; + }; + function update() { + var e, pile, defaultPageLayoutElement = null, defaultMasterPageElement = null; + textStyleCache = {}; + paragraphStyleCache = {}; + graphicStyleCache = {}; + masterPages = {}; + parsedMasterPages = {}; + parsedPageLayouts = {}; + pageLayouts = {}; + textStylePile = new odf.StylePile(styleParseUtils, self); + paragraphStylePile = new odf.StylePile(styleParseUtils, self); + graphicStylePile = new odf.StylePile(styleParseUtils, self); + stylePiles = {text:textStylePile, paragraph:paragraphStylePile, graphic:graphicStylePile}; + e = odfroot.styles.firstElementChild; + while (e) { + if (e.namespaceURI === stylens) { + pile = getPileFromElement(e); + if (pile) { + if (e.localName === "style") { + pile.addCommonStyle(e); + } else { + if (e.localName === "default-style") { + pile.setDefaultStyle(e); + } + } + } else { + if (e.localName === "default-page-layout") { + defaultPageLayoutElement = e; + } + } + } + e = e.nextElementSibling; + } + defaultPageLayout = new odf.PageLayout(defaultPageLayoutElement, styleParseUtils); + e = odfroot.automaticStyles.firstElementChild; + while (e) { + if (e.namespaceURI === stylens) { + pile = getPileFromElement(e); + if (pile && e.localName === "style") { + pile.addAutomaticStyle(e); + } else { + if (e.localName === "page-layout") { + pageLayouts[e.getAttributeNS(stylens, "name")] = e; + } + } + } + e = e.nextElementSibling; + } + e = odfroot.masterStyles.firstElementChild; + while (e) { + if (e.namespaceURI === stylens && e.localName === "master-page") { + defaultMasterPageElement = defaultMasterPageElement || e; + addMasterPage(e); + } + e = e.nextElementSibling; + } + defaultMasterPage = new odf.MasterPage(defaultMasterPageElement, self); + } + this.update = update; +}; +ops.OperationTransformMatrix = function OperationTransformMatrix() { + function invertMoveCursorSpecRange(moveCursorSpec) { + moveCursorSpec.position = moveCursorSpec.position + moveCursorSpec.length; + moveCursorSpec.length *= -1; + } + function invertMoveCursorSpecRangeOnNegativeLength(moveCursorSpec) { + var isBackwards = moveCursorSpec.length < 0; + if (isBackwards) { + invertMoveCursorSpecRange(moveCursorSpec); + } + return isBackwards; + } + function getStyleReferencingAttributes(setProperties, styleName) { + var attributes = []; + function check(attributeName) { + if (setProperties[attributeName] === styleName) { + attributes.push(attributeName); + } + } + if (setProperties) { + ["style:parent-style-name", "style:next-style-name"].forEach(check); + } + return attributes; + } + function dropStyleReferencingAttributes(setProperties, deletedStyleName) { + function del(attributeName) { + if (setProperties[attributeName] === deletedStyleName) { + delete setProperties[attributeName]; + } + } + if (setProperties) { + ["style:parent-style-name", "style:next-style-name"].forEach(del); + } + } + function cloneOpspec(opspec) { + var result = {}; + Object.keys(opspec).forEach(function(key) { + if (typeof opspec[key] === "object") { + result[key] = cloneOpspec(opspec[key]); + } else { + result[key] = opspec[key]; + } + }); + return result; + } + function dropOverruledAndUnneededAttributes(minorSetProperties, minorRemovedProperties, majorSetProperties, majorRemovedProperties) { + var i, name, majorChanged = false, minorChanged = false, removedPropertyNames, majorRemovedPropertyNames = []; + if (majorRemovedProperties && majorRemovedProperties.attributes) { + majorRemovedPropertyNames = majorRemovedProperties.attributes.split(","); + } + if (minorSetProperties && (majorSetProperties || majorRemovedPropertyNames.length > 0)) { + Object.keys(minorSetProperties).forEach(function(key) { + var value = minorSetProperties[key], overrulingPropertyValue; + if (typeof value !== "object") { + if (majorSetProperties) { + overrulingPropertyValue = majorSetProperties[key]; + } + if (overrulingPropertyValue !== undefined) { + delete minorSetProperties[key]; + minorChanged = true; + if (overrulingPropertyValue === value) { + delete majorSetProperties[key]; + majorChanged = true; + } + } else { + if (majorRemovedPropertyNames.indexOf(key) !== -1) { + delete minorSetProperties[key]; + minorChanged = true; + } + } + } + }); + } + if (minorRemovedProperties && minorRemovedProperties.attributes && (majorSetProperties || majorRemovedPropertyNames.length > 0)) { + removedPropertyNames = minorRemovedProperties.attributes.split(","); + for (i = 0;i < removedPropertyNames.length;i += 1) { + name = removedPropertyNames[i]; + if (majorSetProperties && majorSetProperties[name] !== undefined || majorRemovedPropertyNames && majorRemovedPropertyNames.indexOf(name) !== -1) { + removedPropertyNames.splice(i, 1); + i -= 1; + minorChanged = true; + } + } + if (removedPropertyNames.length > 0) { + minorRemovedProperties.attributes = removedPropertyNames.join(","); + } else { + delete minorRemovedProperties.attributes; + } + } + return {majorChanged:majorChanged, minorChanged:minorChanged}; + } + function hasProperties(properties) { + var key; + for (key in properties) { + if (properties.hasOwnProperty(key)) { + return true; + } + } + return false; + } + function hasRemovedProperties(properties) { + var key; + for (key in properties) { + if (properties.hasOwnProperty(key)) { + if (key !== "attributes" || properties.attributes.length > 0) { + return true; + } + } + } + return false; + } + function dropOverruledAndUnneededProperties(minorSet, minorRem, majorSet, majorRem, propertiesName) { + var minorSP = minorSet ? minorSet[propertiesName] : null, minorRP = minorRem ? minorRem[propertiesName] : null, majorSP = majorSet ? majorSet[propertiesName] : null, majorRP = majorRem ? majorRem[propertiesName] : null, result; + result = dropOverruledAndUnneededAttributes(minorSP, minorRP, majorSP, majorRP); + if (minorSP && !hasProperties(minorSP)) { + delete minorSet[propertiesName]; + } + if (minorRP && !hasRemovedProperties(minorRP)) { + delete minorRem[propertiesName]; + } + if (majorSP && !hasProperties(majorSP)) { + delete majorSet[propertiesName]; + } + if (majorRP && !hasRemovedProperties(majorRP)) { + delete majorRem[propertiesName]; + } + return result; + } + function transformAddAnnotationAddAnnotation(addAnnotationSpecA, addAnnotationSpecB, hasAPriority) { + var firstAnnotationSpec, secondAnnotationSpec; + if (addAnnotationSpecA.position < addAnnotationSpecB.position) { + firstAnnotationSpec = addAnnotationSpecA; + secondAnnotationSpec = addAnnotationSpecB; + } else { + if (addAnnotationSpecB.position < addAnnotationSpecA.position) { + firstAnnotationSpec = addAnnotationSpecB; + secondAnnotationSpec = addAnnotationSpecA; + } else { + firstAnnotationSpec = hasAPriority ? addAnnotationSpecA : addAnnotationSpecB; + secondAnnotationSpec = hasAPriority ? addAnnotationSpecB : addAnnotationSpecA; + } + } + if (secondAnnotationSpec.position < firstAnnotationSpec.position + firstAnnotationSpec.length) { + firstAnnotationSpec.length += 2; + } + secondAnnotationSpec.position += 2; + return {opSpecsA:[addAnnotationSpecA], opSpecsB:[addAnnotationSpecB]}; + } + function transformAddAnnotationApplyDirectStyling(addAnnotationSpec, applyDirectStylingSpec) { + if (addAnnotationSpec.position <= applyDirectStylingSpec.position) { + applyDirectStylingSpec.position += 2; + } else { + if (addAnnotationSpec.position <= applyDirectStylingSpec.position + applyDirectStylingSpec.length) { + applyDirectStylingSpec.length += 2; + } + } + return {opSpecsA:[addAnnotationSpec], opSpecsB:[applyDirectStylingSpec]}; + } + function transformAddAnnotationInsertText(addAnnotationSpec, insertTextSpec) { + if (insertTextSpec.position <= addAnnotationSpec.position) { + addAnnotationSpec.position += insertTextSpec.text.length; + } else { + if (addAnnotationSpec.length !== undefined) { + if (insertTextSpec.position <= addAnnotationSpec.position + addAnnotationSpec.length) { + addAnnotationSpec.length += insertTextSpec.text.length; + } + } + insertTextSpec.position += 2; + } + return {opSpecsA:[addAnnotationSpec], opSpecsB:[insertTextSpec]}; + } + function transformAddAnnotationMergeParagraph(addAnnotationSpec, mergeParagraphSpec) { + if (mergeParagraphSpec.sourceStartPosition <= addAnnotationSpec.position) { + addAnnotationSpec.position -= 1; + } else { + if (addAnnotationSpec.length !== undefined) { + if (mergeParagraphSpec.sourceStartPosition <= addAnnotationSpec.position + addAnnotationSpec.length) { + addAnnotationSpec.length -= 1; + } + } + mergeParagraphSpec.sourceStartPosition += 2; + if (addAnnotationSpec.position < mergeParagraphSpec.destinationStartPosition) { + mergeParagraphSpec.destinationStartPosition += 2; + } + } + return {opSpecsA:[addAnnotationSpec], opSpecsB:[mergeParagraphSpec]}; + } + function transformAddAnnotationMoveCursor(addAnnotationSpec, moveCursorSpec) { + var isMoveCursorSpecRangeInverted = invertMoveCursorSpecRangeOnNegativeLength(moveCursorSpec); + if (addAnnotationSpec.position < moveCursorSpec.position) { + moveCursorSpec.position += 2; + } else { + if (addAnnotationSpec.position < moveCursorSpec.position + moveCursorSpec.length) { + moveCursorSpec.length += 2; + } + } + if (isMoveCursorSpecRangeInverted) { + invertMoveCursorSpecRange(moveCursorSpec); + } + return {opSpecsA:[addAnnotationSpec], opSpecsB:[moveCursorSpec]}; + } + function transformAddAnnotationRemoveAnnotation(addAnnotationSpec, removeAnnotationSpec) { + if (addAnnotationSpec.position < removeAnnotationSpec.position) { + if (removeAnnotationSpec.position < addAnnotationSpec.position + addAnnotationSpec.length) { + addAnnotationSpec.length -= removeAnnotationSpec.length + 2; + } + removeAnnotationSpec.position += 2; + } else { + addAnnotationSpec.position -= removeAnnotationSpec.length + 2; + } + return {opSpecsA:[addAnnotationSpec], opSpecsB:[removeAnnotationSpec]}; + } + function transformAddAnnotationRemoveText(addAnnotationSpec, removeTextSpec) { + var removeTextSpecPosition = removeTextSpec.position, removeTextSpecEnd = removeTextSpec.position + removeTextSpec.length, annotationSpecEnd, helperOpspec, addAnnotationSpecResult = [addAnnotationSpec], removeTextSpecResult = [removeTextSpec]; + if (addAnnotationSpec.position <= removeTextSpec.position) { + removeTextSpec.position += 2; + } else { + if (addAnnotationSpec.position < removeTextSpecEnd) { + removeTextSpec.length = addAnnotationSpec.position - removeTextSpec.position; + helperOpspec = {optype:"RemoveText", memberid:removeTextSpec.memberid, timestamp:removeTextSpec.timestamp, position:addAnnotationSpec.position + 2, length:removeTextSpecEnd - addAnnotationSpec.position}; + removeTextSpecResult.unshift(helperOpspec); + } + } + if (removeTextSpec.position + removeTextSpec.length <= addAnnotationSpec.position) { + addAnnotationSpec.position -= removeTextSpec.length; + if (addAnnotationSpec.length !== undefined && helperOpspec) { + if (helperOpspec.length >= addAnnotationSpec.length) { + addAnnotationSpec.length = 0; + } else { + addAnnotationSpec.length -= helperOpspec.length; + } + } + } else { + if (addAnnotationSpec.length !== undefined) { + annotationSpecEnd = addAnnotationSpec.position + addAnnotationSpec.length; + if (removeTextSpecEnd <= annotationSpecEnd) { + addAnnotationSpec.length -= removeTextSpec.length; + } else { + if (removeTextSpecPosition < annotationSpecEnd) { + addAnnotationSpec.length = removeTextSpecPosition - addAnnotationSpec.position; + } + } + } + } + return {opSpecsA:addAnnotationSpecResult, opSpecsB:removeTextSpecResult}; + } + function transformAddAnnotationSetParagraphStyle(addAnnotationSpec, setParagraphStyleSpec) { + if (addAnnotationSpec.position < setParagraphStyleSpec.position) { + setParagraphStyleSpec.position += 2; + } + return {opSpecsA:[addAnnotationSpec], opSpecsB:[setParagraphStyleSpec]}; + } + function transformAddAnnotationSplitParagraph(addAnnotationSpec, splitParagraphSpec) { + if (addAnnotationSpec.position < splitParagraphSpec.sourceParagraphPosition) { + splitParagraphSpec.sourceParagraphPosition += 2; + } + if (splitParagraphSpec.position <= addAnnotationSpec.position) { + addAnnotationSpec.position += 1; + } else { + if (addAnnotationSpec.length !== undefined) { + if (splitParagraphSpec.position <= addAnnotationSpec.position + addAnnotationSpec.length) { + addAnnotationSpec.length += 1; + } + } + splitParagraphSpec.position += 2; + } + return {opSpecsA:[addAnnotationSpec], opSpecsB:[splitParagraphSpec]}; + } + function transformAddStyleRemoveStyle(addStyleSpec, removeStyleSpec) { + var setAttributes, helperOpspec, addStyleSpecResult = [addStyleSpec], removeStyleSpecResult = [removeStyleSpec]; + if (addStyleSpec.styleFamily === removeStyleSpec.styleFamily) { + setAttributes = getStyleReferencingAttributes(addStyleSpec.setProperties, removeStyleSpec.styleName); + if (setAttributes.length > 0) { + helperOpspec = {optype:"UpdateParagraphStyle", memberid:removeStyleSpec.memberid, timestamp:removeStyleSpec.timestamp, styleName:addStyleSpec.styleName, removedProperties:{attributes:setAttributes.join(",")}}; + removeStyleSpecResult.unshift(helperOpspec); + } + dropStyleReferencingAttributes(addStyleSpec.setProperties, removeStyleSpec.styleName); + } + return {opSpecsA:addStyleSpecResult, opSpecsB:removeStyleSpecResult}; + } + function transformApplyDirectStylingApplyDirectStyling(applyDirectStylingSpecA, applyDirectStylingSpecB, hasAPriority) { + var majorSpec, minorSpec, majorSpecResult, minorSpecResult, majorSpecEnd, minorSpecEnd, dropResult, originalMajorSpec, originalMinorSpec, helperOpspecBefore, helperOpspecAfter, applyDirectStylingSpecAResult = [applyDirectStylingSpecA], applyDirectStylingSpecBResult = [applyDirectStylingSpecB]; + if (!(applyDirectStylingSpecA.position + applyDirectStylingSpecA.length <= applyDirectStylingSpecB.position || applyDirectStylingSpecA.position >= applyDirectStylingSpecB.position + applyDirectStylingSpecB.length)) { + majorSpec = hasAPriority ? applyDirectStylingSpecA : applyDirectStylingSpecB; + minorSpec = hasAPriority ? applyDirectStylingSpecB : applyDirectStylingSpecA; + if (applyDirectStylingSpecA.position !== applyDirectStylingSpecB.position || applyDirectStylingSpecA.length !== applyDirectStylingSpecB.length) { + originalMajorSpec = cloneOpspec(majorSpec); + originalMinorSpec = cloneOpspec(minorSpec); + } + dropResult = dropOverruledAndUnneededProperties(minorSpec.setProperties, null, majorSpec.setProperties, null, "style:text-properties"); + if (dropResult.majorChanged || dropResult.minorChanged) { + majorSpecResult = []; + minorSpecResult = []; + majorSpecEnd = majorSpec.position + majorSpec.length; + minorSpecEnd = minorSpec.position + minorSpec.length; + if (minorSpec.position < majorSpec.position) { + if (dropResult.minorChanged) { + helperOpspecBefore = cloneOpspec(originalMinorSpec); + helperOpspecBefore.length = majorSpec.position - minorSpec.position; + minorSpecResult.push(helperOpspecBefore); + minorSpec.position = majorSpec.position; + minorSpec.length = minorSpecEnd - minorSpec.position; + } + } else { + if (majorSpec.position < minorSpec.position) { + if (dropResult.majorChanged) { + helperOpspecBefore = cloneOpspec(originalMajorSpec); + helperOpspecBefore.length = minorSpec.position - majorSpec.position; + majorSpecResult.push(helperOpspecBefore); + majorSpec.position = minorSpec.position; + majorSpec.length = majorSpecEnd - majorSpec.position; + } + } + } + if (minorSpecEnd > majorSpecEnd) { + if (dropResult.minorChanged) { + helperOpspecAfter = originalMinorSpec; + helperOpspecAfter.position = majorSpecEnd; + helperOpspecAfter.length = minorSpecEnd - majorSpecEnd; + minorSpecResult.push(helperOpspecAfter); + minorSpec.length = majorSpecEnd - minorSpec.position; + } + } else { + if (majorSpecEnd > minorSpecEnd) { + if (dropResult.majorChanged) { + helperOpspecAfter = originalMajorSpec; + helperOpspecAfter.position = minorSpecEnd; + helperOpspecAfter.length = majorSpecEnd - minorSpecEnd; + majorSpecResult.push(helperOpspecAfter); + majorSpec.length = minorSpecEnd - majorSpec.position; + } + } + } + if (majorSpec.setProperties && hasProperties(majorSpec.setProperties)) { + majorSpecResult.push(majorSpec); + } + if (minorSpec.setProperties && hasProperties(minorSpec.setProperties)) { + minorSpecResult.push(minorSpec); + } + if (hasAPriority) { + applyDirectStylingSpecAResult = majorSpecResult; + applyDirectStylingSpecBResult = minorSpecResult; + } else { + applyDirectStylingSpecAResult = minorSpecResult; + applyDirectStylingSpecBResult = majorSpecResult; + } + } + } + return {opSpecsA:applyDirectStylingSpecAResult, opSpecsB:applyDirectStylingSpecBResult}; + } + function transformApplyDirectStylingInsertText(applyDirectStylingSpec, insertTextSpec) { + if (insertTextSpec.position <= applyDirectStylingSpec.position) { + applyDirectStylingSpec.position += insertTextSpec.text.length; + } else { + if (insertTextSpec.position <= applyDirectStylingSpec.position + applyDirectStylingSpec.length) { + applyDirectStylingSpec.length += insertTextSpec.text.length; + } + } + return {opSpecsA:[applyDirectStylingSpec], opSpecsB:[insertTextSpec]}; + } + function transformApplyDirectStylingMergeParagraph(applyDirectStylingSpec, mergeParagraphSpec) { + var pointA = applyDirectStylingSpec.position, pointB = applyDirectStylingSpec.position + applyDirectStylingSpec.length; + if (pointA >= mergeParagraphSpec.sourceStartPosition) { + pointA -= 1; + } + if (pointB >= mergeParagraphSpec.sourceStartPosition) { + pointB -= 1; + } + applyDirectStylingSpec.position = pointA; + applyDirectStylingSpec.length = pointB - pointA; + return {opSpecsA:[applyDirectStylingSpec], opSpecsB:[mergeParagraphSpec]}; + } + function transformApplyDirectStylingRemoveAnnotation(applyDirectStylingSpec, removeAnnotationSpec) { + var pointA = applyDirectStylingSpec.position, pointB = applyDirectStylingSpec.position + applyDirectStylingSpec.length, removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, applyDirectStylingSpecResult = [applyDirectStylingSpec], removeAnnotationSpecResult = [removeAnnotationSpec]; + if (removeAnnotationSpec.position <= pointA && pointB <= removeAnnotationEnd) { + applyDirectStylingSpecResult = []; + } else { + if (removeAnnotationEnd < pointA) { + pointA -= removeAnnotationSpec.length + 2; + } + if (removeAnnotationEnd < pointB) { + pointB -= removeAnnotationSpec.length + 2; + } + applyDirectStylingSpec.position = pointA; + applyDirectStylingSpec.length = pointB - pointA; + } + return {opSpecsA:applyDirectStylingSpecResult, opSpecsB:removeAnnotationSpecResult}; + } + function transformApplyDirectStylingRemoveText(applyDirectStylingSpec, removeTextSpec) { + var applyDirectStylingSpecEnd = applyDirectStylingSpec.position + applyDirectStylingSpec.length, removeTextSpecEnd = removeTextSpec.position + removeTextSpec.length, applyDirectStylingSpecResult = [applyDirectStylingSpec], removeTextSpecResult = [removeTextSpec]; + if (removeTextSpecEnd <= applyDirectStylingSpec.position) { + applyDirectStylingSpec.position -= removeTextSpec.length; + } else { + if (removeTextSpec.position < applyDirectStylingSpecEnd) { + if (applyDirectStylingSpec.position < removeTextSpec.position) { + if (removeTextSpecEnd < applyDirectStylingSpecEnd) { + applyDirectStylingSpec.length -= removeTextSpec.length; + } else { + applyDirectStylingSpec.length = removeTextSpec.position - applyDirectStylingSpec.position; + } + } else { + applyDirectStylingSpec.position = removeTextSpec.position; + if (removeTextSpecEnd < applyDirectStylingSpecEnd) { + applyDirectStylingSpec.length = applyDirectStylingSpecEnd - removeTextSpecEnd; + } else { + applyDirectStylingSpecResult = []; + } + } + } + } + return {opSpecsA:applyDirectStylingSpecResult, opSpecsB:removeTextSpecResult}; + } + function transformApplyDirectStylingSplitParagraph(applyDirectStylingSpec, splitParagraphSpec) { + if (splitParagraphSpec.position < applyDirectStylingSpec.position) { + applyDirectStylingSpec.position += 1; + } else { + if (splitParagraphSpec.position < applyDirectStylingSpec.position + applyDirectStylingSpec.length) { + applyDirectStylingSpec.length += 1; + } + } + return {opSpecsA:[applyDirectStylingSpec], opSpecsB:[splitParagraphSpec]}; + } + function transformInsertTextInsertText(insertTextSpecA, insertTextSpecB, hasAPriority) { + if (insertTextSpecA.position < insertTextSpecB.position) { + insertTextSpecB.position += insertTextSpecA.text.length; + } else { + if (insertTextSpecA.position > insertTextSpecB.position) { + insertTextSpecA.position += insertTextSpecB.text.length; + } else { + if (hasAPriority) { + insertTextSpecB.position += insertTextSpecA.text.length; + } else { + insertTextSpecA.position += insertTextSpecB.text.length; + } + } + } + return {opSpecsA:[insertTextSpecA], opSpecsB:[insertTextSpecB]}; + } + function transformInsertTextMergeParagraph(insertTextSpec, mergeParagraphSpec) { + if (insertTextSpec.position >= mergeParagraphSpec.sourceStartPosition) { + insertTextSpec.position -= 1; + } else { + if (insertTextSpec.position < mergeParagraphSpec.sourceStartPosition) { + mergeParagraphSpec.sourceStartPosition += insertTextSpec.text.length; + } + if (insertTextSpec.position < mergeParagraphSpec.destinationStartPosition) { + mergeParagraphSpec.destinationStartPosition += insertTextSpec.text.length; + } + } + return {opSpecsA:[insertTextSpec], opSpecsB:[mergeParagraphSpec]}; + } + function transformInsertTextMoveCursor(insertTextSpec, moveCursorSpec) { + var isMoveCursorSpecRangeInverted = invertMoveCursorSpecRangeOnNegativeLength(moveCursorSpec); + if (insertTextSpec.position < moveCursorSpec.position) { + moveCursorSpec.position += insertTextSpec.text.length; + } else { + if (insertTextSpec.position < moveCursorSpec.position + moveCursorSpec.length) { + moveCursorSpec.length += insertTextSpec.text.length; + } + } + if (isMoveCursorSpecRangeInverted) { + invertMoveCursorSpecRange(moveCursorSpec); + } + return {opSpecsA:[insertTextSpec], opSpecsB:[moveCursorSpec]}; + } + function transformInsertTextRemoveAnnotation(insertTextSpec, removeAnnotationSpec) { + var insertTextSpecPosition = insertTextSpec.position, removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, insertTextSpecResult = [insertTextSpec], removeAnnotationSpecResult = [removeAnnotationSpec]; + if (removeAnnotationSpec.position <= insertTextSpecPosition && insertTextSpecPosition <= removeAnnotationEnd) { + insertTextSpecResult = []; + removeAnnotationSpec.length += insertTextSpec.text.length; + } else { + if (removeAnnotationEnd < insertTextSpec.position) { + insertTextSpec.position -= removeAnnotationSpec.length + 2; + } else { + removeAnnotationSpec.position += insertTextSpec.text.length; + } + } + return {opSpecsA:insertTextSpecResult, opSpecsB:removeAnnotationSpecResult}; + } + function transformInsertTextRemoveText(insertTextSpec, removeTextSpec) { + var helperOpspec, removeTextSpecEnd = removeTextSpec.position + removeTextSpec.length, insertTextSpecResult = [insertTextSpec], removeTextSpecResult = [removeTextSpec]; + if (removeTextSpecEnd <= insertTextSpec.position) { + insertTextSpec.position -= removeTextSpec.length; + } else { + if (insertTextSpec.position <= removeTextSpec.position) { + removeTextSpec.position += insertTextSpec.text.length; + } else { + removeTextSpec.length = insertTextSpec.position - removeTextSpec.position; + helperOpspec = {optype:"RemoveText", memberid:removeTextSpec.memberid, timestamp:removeTextSpec.timestamp, position:insertTextSpec.position + insertTextSpec.text.length, length:removeTextSpecEnd - insertTextSpec.position}; + removeTextSpecResult.unshift(helperOpspec); + insertTextSpec.position = removeTextSpec.position; + } + } + return {opSpecsA:insertTextSpecResult, opSpecsB:removeTextSpecResult}; + } + function transformInsertTextSetParagraphStyle(insertTextSpec, setParagraphStyleSpec) { + if (setParagraphStyleSpec.position > insertTextSpec.position) { + setParagraphStyleSpec.position += insertTextSpec.text.length; + } + return {opSpecsA:[insertTextSpec], opSpecsB:[setParagraphStyleSpec]}; + } + function transformInsertTextSplitParagraph(insertTextSpec, splitParagraphSpec) { + if (insertTextSpec.position < splitParagraphSpec.sourceParagraphPosition) { + splitParagraphSpec.sourceParagraphPosition += insertTextSpec.text.length; + } + if (insertTextSpec.position <= splitParagraphSpec.position) { + splitParagraphSpec.position += insertTextSpec.text.length; + } else { + insertTextSpec.position += 1; + } + return {opSpecsA:[insertTextSpec], opSpecsB:[splitParagraphSpec]}; + } + function transformMergeParagraphMergeParagraph(mergeParagraphSpecA, mergeParagraphSpecB, hasAPriority) { + var specsForB = [mergeParagraphSpecA], specsForA = [mergeParagraphSpecB], priorityOp, styleParagraphFixup, moveCursorA, moveCursorB; + if (mergeParagraphSpecA.destinationStartPosition === mergeParagraphSpecB.destinationStartPosition) { + specsForB = []; + specsForA = []; + if (mergeParagraphSpecA.moveCursor) { + moveCursorA = {optype:"MoveCursor", memberid:mergeParagraphSpecA.memberid, timestamp:mergeParagraphSpecA.timestamp, position:mergeParagraphSpecA.sourceStartPosition - 1}; + specsForB.push(moveCursorA); + } + if (mergeParagraphSpecB.moveCursor) { + moveCursorB = {optype:"MoveCursor", memberid:mergeParagraphSpecB.memberid, timestamp:mergeParagraphSpecB.timestamp, position:mergeParagraphSpecB.sourceStartPosition - 1}; + specsForA.push(moveCursorB); + } + priorityOp = hasAPriority ? mergeParagraphSpecA : mergeParagraphSpecB; + styleParagraphFixup = {optype:"SetParagraphStyle", memberid:priorityOp.memberid, timestamp:priorityOp.timestamp, position:priorityOp.destinationStartPosition, styleName:priorityOp.paragraphStyleName}; + if (hasAPriority) { + specsForB.push(styleParagraphFixup); + } else { + specsForA.push(styleParagraphFixup); + } + } else { + if (mergeParagraphSpecB.sourceStartPosition === mergeParagraphSpecA.destinationStartPosition) { + mergeParagraphSpecA.destinationStartPosition = mergeParagraphSpecB.destinationStartPosition; + mergeParagraphSpecA.sourceStartPosition -= 1; + mergeParagraphSpecA.paragraphStyleName = mergeParagraphSpecB.paragraphStyleName; + } else { + if (mergeParagraphSpecA.sourceStartPosition === mergeParagraphSpecB.destinationStartPosition) { + mergeParagraphSpecB.destinationStartPosition = mergeParagraphSpecA.destinationStartPosition; + mergeParagraphSpecB.sourceStartPosition -= 1; + mergeParagraphSpecB.paragraphStyleName = mergeParagraphSpecA.paragraphStyleName; + } else { + if (mergeParagraphSpecA.destinationStartPosition < mergeParagraphSpecB.destinationStartPosition) { + mergeParagraphSpecB.destinationStartPosition -= 1; + mergeParagraphSpecB.sourceStartPosition -= 1; + } else { + mergeParagraphSpecA.destinationStartPosition -= 1; + mergeParagraphSpecA.sourceStartPosition -= 1; + } + } + } + } + return {opSpecsA:specsForB, opSpecsB:specsForA}; + } + function transformMergeParagraphMoveCursor(mergeParagraphSpec, moveCursorSpec) { + var pointA = moveCursorSpec.position, pointB = moveCursorSpec.position + moveCursorSpec.length, start = Math.min(pointA, pointB), end = Math.max(pointA, pointB); + if (start >= mergeParagraphSpec.sourceStartPosition) { + start -= 1; + } + if (end >= mergeParagraphSpec.sourceStartPosition) { + end -= 1; + } + if (moveCursorSpec.length >= 0) { + moveCursorSpec.position = start; + moveCursorSpec.length = end - start; + } else { + moveCursorSpec.position = end; + moveCursorSpec.length = start - end; + } + return {opSpecsA:[mergeParagraphSpec], opSpecsB:[moveCursorSpec]}; + } + function transformMergeParagraphRemoveAnnotation(mergeParagraphSpec, removeAnnotationSpec) { + var removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, mergeParagraphSpecResult = [mergeParagraphSpec], removeAnnotationSpecResult = [removeAnnotationSpec]; + if (removeAnnotationSpec.position <= mergeParagraphSpec.destinationStartPosition && mergeParagraphSpec.sourceStartPosition <= removeAnnotationEnd) { + mergeParagraphSpecResult = []; + removeAnnotationSpec.length -= 1; + } else { + if (mergeParagraphSpec.sourceStartPosition < removeAnnotationSpec.position) { + removeAnnotationSpec.position -= 1; + } else { + if (removeAnnotationEnd < mergeParagraphSpec.destinationStartPosition) { + mergeParagraphSpec.destinationStartPosition -= removeAnnotationSpec.length + 2; + } + if (removeAnnotationEnd < mergeParagraphSpec.sourceStartPosition) { + mergeParagraphSpec.sourceStartPosition -= removeAnnotationSpec.length + 2; + } + } + } + return {opSpecsA:mergeParagraphSpecResult, opSpecsB:removeAnnotationSpecResult}; + } + function transformMergeParagraphRemoveText(mergeParagraphSpec, removeTextSpec) { + if (removeTextSpec.position >= mergeParagraphSpec.sourceStartPosition) { + removeTextSpec.position -= 1; + } else { + if (removeTextSpec.position < mergeParagraphSpec.destinationStartPosition) { + mergeParagraphSpec.destinationStartPosition -= removeTextSpec.length; + } + if (removeTextSpec.position < mergeParagraphSpec.sourceStartPosition) { + mergeParagraphSpec.sourceStartPosition -= removeTextSpec.length; + } + } + return {opSpecsA:[mergeParagraphSpec], opSpecsB:[removeTextSpec]}; + } + function transformMergeParagraphSetParagraphStyle(mergeParagraphSpec, setParagraphStyleSpec) { + var opSpecsA = [mergeParagraphSpec], opSpecsB = [setParagraphStyleSpec]; + if (setParagraphStyleSpec.position > mergeParagraphSpec.sourceStartPosition) { + setParagraphStyleSpec.position -= 1; + } else { + if (setParagraphStyleSpec.position === mergeParagraphSpec.destinationStartPosition || setParagraphStyleSpec.position === mergeParagraphSpec.sourceStartPosition) { + setParagraphStyleSpec.position = mergeParagraphSpec.destinationStartPosition; + mergeParagraphSpec.paragraphStyleName = setParagraphStyleSpec.styleName; + } + } + return {opSpecsA:opSpecsA, opSpecsB:opSpecsB}; + } + function transformMergeParagraphSplitParagraph(mergeParagraphSpec, splitParagraphSpec) { + var styleSplitParagraph, moveCursorOp, opSpecsA = [mergeParagraphSpec], opSpecsB = [splitParagraphSpec]; + if (splitParagraphSpec.position < mergeParagraphSpec.destinationStartPosition) { + mergeParagraphSpec.destinationStartPosition += 1; + mergeParagraphSpec.sourceStartPosition += 1; + } else { + if (splitParagraphSpec.position >= mergeParagraphSpec.destinationStartPosition && splitParagraphSpec.position < mergeParagraphSpec.sourceStartPosition) { + splitParagraphSpec.paragraphStyleName = mergeParagraphSpec.paragraphStyleName; + styleSplitParagraph = {optype:"SetParagraphStyle", memberid:mergeParagraphSpec.memberid, timestamp:mergeParagraphSpec.timestamp, position:mergeParagraphSpec.destinationStartPosition, styleName:mergeParagraphSpec.paragraphStyleName}; + opSpecsA.push(styleSplitParagraph); + if (splitParagraphSpec.position === mergeParagraphSpec.sourceStartPosition - 1 && mergeParagraphSpec.moveCursor) { + moveCursorOp = {optype:"MoveCursor", memberid:mergeParagraphSpec.memberid, timestamp:mergeParagraphSpec.timestamp, position:splitParagraphSpec.position, length:0}; + opSpecsA.push(moveCursorOp); + } + mergeParagraphSpec.destinationStartPosition = splitParagraphSpec.position + 1; + mergeParagraphSpec.sourceStartPosition += 1; + } else { + if (splitParagraphSpec.position >= mergeParagraphSpec.sourceStartPosition) { + splitParagraphSpec.position -= 1; + splitParagraphSpec.sourceParagraphPosition -= 1; + } + } + } + return {opSpecsA:opSpecsA, opSpecsB:opSpecsB}; + } + function transformUpdateParagraphStyleUpdateParagraphStyle(updateParagraphStyleSpecA, updateParagraphStyleSpecB, hasAPriority) { + var majorSpec, minorSpec, updateParagraphStyleSpecAResult = [updateParagraphStyleSpecA], updateParagraphStyleSpecBResult = [updateParagraphStyleSpecB]; + if (updateParagraphStyleSpecA.styleName === updateParagraphStyleSpecB.styleName) { + majorSpec = hasAPriority ? updateParagraphStyleSpecA : updateParagraphStyleSpecB; + minorSpec = hasAPriority ? updateParagraphStyleSpecB : updateParagraphStyleSpecA; + dropOverruledAndUnneededProperties(minorSpec.setProperties, minorSpec.removedProperties, majorSpec.setProperties, majorSpec.removedProperties, "style:paragraph-properties"); + dropOverruledAndUnneededProperties(minorSpec.setProperties, minorSpec.removedProperties, majorSpec.setProperties, majorSpec.removedProperties, "style:text-properties"); + dropOverruledAndUnneededAttributes(minorSpec.setProperties || null, minorSpec.removedProperties || null, majorSpec.setProperties || null, majorSpec.removedProperties || null); + if (!(majorSpec.setProperties && hasProperties(majorSpec.setProperties)) && !(majorSpec.removedProperties && hasRemovedProperties(majorSpec.removedProperties))) { + if (hasAPriority) { + updateParagraphStyleSpecAResult = []; + } else { + updateParagraphStyleSpecBResult = []; + } + } + if (!(minorSpec.setProperties && hasProperties(minorSpec.setProperties)) && !(minorSpec.removedProperties && hasRemovedProperties(minorSpec.removedProperties))) { + if (hasAPriority) { + updateParagraphStyleSpecBResult = []; + } else { + updateParagraphStyleSpecAResult = []; + } + } + } + return {opSpecsA:updateParagraphStyleSpecAResult, opSpecsB:updateParagraphStyleSpecBResult}; + } + function transformUpdateMetadataUpdateMetadata(updateMetadataSpecA, updateMetadataSpecB, hasAPriority) { + var majorSpec, minorSpec, updateMetadataSpecAResult = [updateMetadataSpecA], updateMetadataSpecBResult = [updateMetadataSpecB]; + majorSpec = hasAPriority ? updateMetadataSpecA : updateMetadataSpecB; + minorSpec = hasAPriority ? updateMetadataSpecB : updateMetadataSpecA; + dropOverruledAndUnneededAttributes(minorSpec.setProperties || null, minorSpec.removedProperties || null, majorSpec.setProperties || null, majorSpec.removedProperties || null); + if (!(majorSpec.setProperties && hasProperties(majorSpec.setProperties)) && !(majorSpec.removedProperties && hasRemovedProperties(majorSpec.removedProperties))) { + if (hasAPriority) { + updateMetadataSpecAResult = []; + } else { + updateMetadataSpecBResult = []; + } + } + if (!(minorSpec.setProperties && hasProperties(minorSpec.setProperties)) && !(minorSpec.removedProperties && hasRemovedProperties(minorSpec.removedProperties))) { + if (hasAPriority) { + updateMetadataSpecBResult = []; + } else { + updateMetadataSpecAResult = []; + } + } + return {opSpecsA:updateMetadataSpecAResult, opSpecsB:updateMetadataSpecBResult}; + } + function transformSetParagraphStyleSetParagraphStyle(setParagraphStyleSpecA, setParagraphStyleSpecB, hasAPriority) { + if (setParagraphStyleSpecA.position === setParagraphStyleSpecB.position) { + if (hasAPriority) { + setParagraphStyleSpecB.styleName = setParagraphStyleSpecA.styleName; + } else { + setParagraphStyleSpecA.styleName = setParagraphStyleSpecB.styleName; + } + } + return {opSpecsA:[setParagraphStyleSpecA], opSpecsB:[setParagraphStyleSpecB]}; + } + function transformSetParagraphStyleSplitParagraph(setParagraphStyleSpec, splitParagraphSpec) { + var opSpecsA = [setParagraphStyleSpec], opSpecsB = [splitParagraphSpec], setParagraphClone; + if (setParagraphStyleSpec.position > splitParagraphSpec.position) { + setParagraphStyleSpec.position += 1; + } else { + if (setParagraphStyleSpec.position === splitParagraphSpec.sourceParagraphPosition) { + splitParagraphSpec.paragraphStyleName = setParagraphStyleSpec.styleName; + setParagraphClone = cloneOpspec(setParagraphStyleSpec); + setParagraphClone.position = splitParagraphSpec.position + 1; + opSpecsA.push(setParagraphClone); + } + } + return {opSpecsA:opSpecsA, opSpecsB:opSpecsB}; + } + function transformSplitParagraphSplitParagraph(splitParagraphSpecA, splitParagraphSpecB, hasAPriority) { + var specABeforeB, specBBeforeA; + if (splitParagraphSpecA.position < splitParagraphSpecB.position) { + specABeforeB = true; + } else { + if (splitParagraphSpecB.position < splitParagraphSpecA.position) { + specBBeforeA = true; + } else { + if (splitParagraphSpecA.position === splitParagraphSpecB.position) { + if (hasAPriority) { + specABeforeB = true; + } else { + specBBeforeA = true; + } + } + } + } + if (specABeforeB) { + splitParagraphSpecB.position += 1; + if (splitParagraphSpecA.position < splitParagraphSpecB.sourceParagraphPosition) { + splitParagraphSpecB.sourceParagraphPosition += 1; + } else { + splitParagraphSpecB.sourceParagraphPosition = splitParagraphSpecA.position + 1; + } + } else { + if (specBBeforeA) { + splitParagraphSpecA.position += 1; + if (splitParagraphSpecB.position < splitParagraphSpecB.sourceParagraphPosition) { + splitParagraphSpecA.sourceParagraphPosition += 1; + } else { + splitParagraphSpecA.sourceParagraphPosition = splitParagraphSpecB.position + 1; + } + } + } + return {opSpecsA:[splitParagraphSpecA], opSpecsB:[splitParagraphSpecB]}; + } + function transformMoveCursorRemoveAnnotation(moveCursorSpec, removeAnnotationSpec) { + var isMoveCursorSpecRangeInverted = invertMoveCursorSpecRangeOnNegativeLength(moveCursorSpec), moveCursorSpecEnd = moveCursorSpec.position + moveCursorSpec.length, removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length; + if (removeAnnotationSpec.position <= moveCursorSpec.position && moveCursorSpecEnd <= removeAnnotationEnd) { + moveCursorSpec.position = removeAnnotationSpec.position - 1; + moveCursorSpec.length = 0; + } else { + if (removeAnnotationEnd < moveCursorSpec.position) { + moveCursorSpec.position -= removeAnnotationSpec.length + 2; + } else { + if (removeAnnotationEnd < moveCursorSpecEnd) { + moveCursorSpec.length -= removeAnnotationSpec.length + 2; + } + } + if (isMoveCursorSpecRangeInverted) { + invertMoveCursorSpecRange(moveCursorSpec); + } + } + return {opSpecsA:[moveCursorSpec], opSpecsB:[removeAnnotationSpec]}; + } + function transformMoveCursorRemoveCursor(moveCursorSpec, removeCursorSpec) { + var isSameCursorRemoved = moveCursorSpec.memberid === removeCursorSpec.memberid; + return {opSpecsA:isSameCursorRemoved ? [] : [moveCursorSpec], opSpecsB:[removeCursorSpec]}; + } + function transformMoveCursorRemoveText(moveCursorSpec, removeTextSpec) { + var isMoveCursorSpecRangeInverted = invertMoveCursorSpecRangeOnNegativeLength(moveCursorSpec), moveCursorSpecEnd = moveCursorSpec.position + moveCursorSpec.length, removeTextSpecEnd = removeTextSpec.position + removeTextSpec.length; + if (removeTextSpecEnd <= moveCursorSpec.position) { + moveCursorSpec.position -= removeTextSpec.length; + } else { + if (removeTextSpec.position < moveCursorSpecEnd) { + if (moveCursorSpec.position < removeTextSpec.position) { + if (removeTextSpecEnd < moveCursorSpecEnd) { + moveCursorSpec.length -= removeTextSpec.length; + } else { + moveCursorSpec.length = removeTextSpec.position - moveCursorSpec.position; + } + } else { + moveCursorSpec.position = removeTextSpec.position; + if (removeTextSpecEnd < moveCursorSpecEnd) { + moveCursorSpec.length = moveCursorSpecEnd - removeTextSpecEnd; + } else { + moveCursorSpec.length = 0; + } + } + } + } + if (isMoveCursorSpecRangeInverted) { + invertMoveCursorSpecRange(moveCursorSpec); + } + return {opSpecsA:[moveCursorSpec], opSpecsB:[removeTextSpec]}; + } + function transformMoveCursorSplitParagraph(moveCursorSpec, splitParagraphSpec) { + var isMoveCursorSpecRangeInverted = invertMoveCursorSpecRangeOnNegativeLength(moveCursorSpec); + if (splitParagraphSpec.position < moveCursorSpec.position) { + moveCursorSpec.position += 1; + } else { + if (splitParagraphSpec.position < moveCursorSpec.position + moveCursorSpec.length) { + moveCursorSpec.length += 1; + } + } + if (isMoveCursorSpecRangeInverted) { + invertMoveCursorSpecRange(moveCursorSpec); + } + return {opSpecsA:[moveCursorSpec], opSpecsB:[splitParagraphSpec]}; + } + function transformRemoveAnnotationRemoveAnnotation(removeAnnotationSpecA, removeAnnotationSpecB) { + var removeAnnotationSpecAResult = [removeAnnotationSpecA], removeAnnotationSpecBResult = [removeAnnotationSpecB]; + if (removeAnnotationSpecA.position === removeAnnotationSpecB.position && removeAnnotationSpecA.length === removeAnnotationSpecB.length) { + removeAnnotationSpecAResult = []; + removeAnnotationSpecBResult = []; + } else { + if (removeAnnotationSpecA.position < removeAnnotationSpecB.position) { + removeAnnotationSpecB.position -= removeAnnotationSpecA.length + 2; + } else { + removeAnnotationSpecA.position -= removeAnnotationSpecB.length + 2; + } + } + return {opSpecsA:removeAnnotationSpecAResult, opSpecsB:removeAnnotationSpecBResult}; + } + function transformRemoveAnnotationRemoveText(removeAnnotationSpec, removeTextSpec) { + var removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, removeTextSpecEnd = removeTextSpec.position + removeTextSpec.length, removeAnnotationSpecResult = [removeAnnotationSpec], removeTextSpecResult = [removeTextSpec]; + if (removeAnnotationSpec.position <= removeTextSpec.position && removeTextSpecEnd <= removeAnnotationEnd) { + removeTextSpecResult = []; + removeAnnotationSpec.length -= removeTextSpec.length; + } else { + if (removeTextSpecEnd < removeAnnotationSpec.position) { + removeAnnotationSpec.position -= removeTextSpec.length; + } else { + if (removeTextSpec.position < removeAnnotationSpec.position) { + removeAnnotationSpec.position = removeTextSpec.position + 1; + removeTextSpec.length -= removeAnnotationSpec.length + 2; + } else { + removeTextSpec.position -= removeAnnotationSpec.length + 2; + } + } + } + return {opSpecsA:removeAnnotationSpecResult, opSpecsB:removeTextSpecResult}; + } + function transformRemoveAnnotationSetParagraphStyle(removeAnnotationSpec, setParagraphStyleSpec) { + var setParagraphStyleSpecPosition = setParagraphStyleSpec.position, removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, removeAnnotationSpecResult = [removeAnnotationSpec], setParagraphStyleSpecResult = [setParagraphStyleSpec]; + if (removeAnnotationSpec.position <= setParagraphStyleSpecPosition && setParagraphStyleSpecPosition <= removeAnnotationEnd) { + setParagraphStyleSpecResult = []; + } else { + if (removeAnnotationEnd < setParagraphStyleSpecPosition) { + setParagraphStyleSpec.position -= removeAnnotationSpec.length + 2; + } + } + return {opSpecsA:removeAnnotationSpecResult, opSpecsB:setParagraphStyleSpecResult}; + } + function transformRemoveAnnotationSplitParagraph(removeAnnotationSpec, splitParagraphSpec) { + var splitParagraphSpecPosition = splitParagraphSpec.position, removeAnnotationEnd = removeAnnotationSpec.position + removeAnnotationSpec.length, removeAnnotationSpecResult = [removeAnnotationSpec], splitParagraphSpecResult = [splitParagraphSpec]; + if (removeAnnotationSpec.position <= splitParagraphSpecPosition && splitParagraphSpecPosition <= removeAnnotationEnd) { + splitParagraphSpecResult = []; + removeAnnotationSpec.length += 1; + } else { + if (removeAnnotationEnd < splitParagraphSpec.sourceParagraphPosition) { + splitParagraphSpec.sourceParagraphPosition -= removeAnnotationSpec.length + 2; + } + if (removeAnnotationEnd < splitParagraphSpecPosition) { + splitParagraphSpec.position -= removeAnnotationSpec.length + 2; + } else { + removeAnnotationSpec.position += 1; + } + } + return {opSpecsA:removeAnnotationSpecResult, opSpecsB:splitParagraphSpecResult}; + } + function transformRemoveCursorRemoveCursor(removeCursorSpecA, removeCursorSpecB) { + var isSameMemberid = removeCursorSpecA.memberid === removeCursorSpecB.memberid; + return {opSpecsA:isSameMemberid ? [] : [removeCursorSpecA], opSpecsB:isSameMemberid ? [] : [removeCursorSpecB]}; + } + function transformRemoveStyleRemoveStyle(removeStyleSpecA, removeStyleSpecB) { + var isSameStyle = removeStyleSpecA.styleName === removeStyleSpecB.styleName && removeStyleSpecA.styleFamily === removeStyleSpecB.styleFamily; + return {opSpecsA:isSameStyle ? [] : [removeStyleSpecA], opSpecsB:isSameStyle ? [] : [removeStyleSpecB]}; + } + function transformRemoveStyleSetParagraphStyle(removeStyleSpec, setParagraphStyleSpec) { + var helperOpspec, removeStyleSpecResult = [removeStyleSpec], setParagraphStyleSpecResult = [setParagraphStyleSpec]; + if (removeStyleSpec.styleFamily === "paragraph" && removeStyleSpec.styleName === setParagraphStyleSpec.styleName) { + helperOpspec = {optype:"SetParagraphStyle", memberid:removeStyleSpec.memberid, timestamp:removeStyleSpec.timestamp, position:setParagraphStyleSpec.position, styleName:""}; + removeStyleSpecResult.unshift(helperOpspec); + setParagraphStyleSpec.styleName = ""; + } + return {opSpecsA:removeStyleSpecResult, opSpecsB:setParagraphStyleSpecResult}; + } + function transformRemoveStyleUpdateParagraphStyle(removeStyleSpec, updateParagraphStyleSpec) { + var setAttributes, helperOpspec, removeStyleSpecResult = [removeStyleSpec], updateParagraphStyleSpecResult = [updateParagraphStyleSpec]; + if (removeStyleSpec.styleFamily === "paragraph") { + setAttributes = getStyleReferencingAttributes(updateParagraphStyleSpec.setProperties, removeStyleSpec.styleName); + if (setAttributes.length > 0) { + helperOpspec = {optype:"UpdateParagraphStyle", memberid:removeStyleSpec.memberid, timestamp:removeStyleSpec.timestamp, styleName:updateParagraphStyleSpec.styleName, removedProperties:{attributes:setAttributes.join(",")}}; + removeStyleSpecResult.unshift(helperOpspec); + } + if (removeStyleSpec.styleName === updateParagraphStyleSpec.styleName) { + updateParagraphStyleSpecResult = []; + } else { + dropStyleReferencingAttributes(updateParagraphStyleSpec.setProperties, removeStyleSpec.styleName); + } + } + return {opSpecsA:removeStyleSpecResult, opSpecsB:updateParagraphStyleSpecResult}; + } + function transformRemoveTextRemoveText(removeTextSpecA, removeTextSpecB) { + var removeTextSpecAEnd = removeTextSpecA.position + removeTextSpecA.length, removeTextSpecBEnd = removeTextSpecB.position + removeTextSpecB.length, removeTextSpecAResult = [removeTextSpecA], removeTextSpecBResult = [removeTextSpecB]; + if (removeTextSpecBEnd <= removeTextSpecA.position) { + removeTextSpecA.position -= removeTextSpecB.length; + } else { + if (removeTextSpecAEnd <= removeTextSpecB.position) { + removeTextSpecB.position -= removeTextSpecA.length; + } else { + if (removeTextSpecB.position < removeTextSpecAEnd) { + if (removeTextSpecA.position < removeTextSpecB.position) { + if (removeTextSpecBEnd < removeTextSpecAEnd) { + removeTextSpecA.length = removeTextSpecA.length - removeTextSpecB.length; + } else { + removeTextSpecA.length = removeTextSpecB.position - removeTextSpecA.position; + } + if (removeTextSpecAEnd < removeTextSpecBEnd) { + removeTextSpecB.position = removeTextSpecA.position; + removeTextSpecB.length = removeTextSpecBEnd - removeTextSpecAEnd; + } else { + removeTextSpecBResult = []; + } + } else { + if (removeTextSpecAEnd < removeTextSpecBEnd) { + removeTextSpecB.length = removeTextSpecB.length - removeTextSpecA.length; + } else { + if (removeTextSpecB.position < removeTextSpecA.position) { + removeTextSpecB.length = removeTextSpecA.position - removeTextSpecB.position; + } else { + removeTextSpecBResult = []; + } + } + if (removeTextSpecBEnd < removeTextSpecAEnd) { + removeTextSpecA.position = removeTextSpecB.position; + removeTextSpecA.length = removeTextSpecAEnd - removeTextSpecBEnd; + } else { + removeTextSpecAResult = []; + } + } + } + } + } + return {opSpecsA:removeTextSpecAResult, opSpecsB:removeTextSpecBResult}; + } + function transformRemoveTextSetParagraphStyle(removeTextSpec, setParagraphStyleSpec) { + if (removeTextSpec.position < setParagraphStyleSpec.position) { + setParagraphStyleSpec.position -= removeTextSpec.length; + } + return {opSpecsA:[removeTextSpec], opSpecsB:[setParagraphStyleSpec]}; + } + function transformRemoveTextSplitParagraph(removeTextSpec, splitParagraphSpec) { + var removeTextSpecEnd = removeTextSpec.position + removeTextSpec.length, helperOpspec, removeTextSpecResult = [removeTextSpec], splitParagraphSpecResult = [splitParagraphSpec]; + if (splitParagraphSpec.position <= removeTextSpec.position) { + removeTextSpec.position += 1; + } else { + if (splitParagraphSpec.position < removeTextSpecEnd) { + removeTextSpec.length = splitParagraphSpec.position - removeTextSpec.position; + helperOpspec = {optype:"RemoveText", memberid:removeTextSpec.memberid, timestamp:removeTextSpec.timestamp, position:splitParagraphSpec.position + 1, length:removeTextSpecEnd - splitParagraphSpec.position}; + removeTextSpecResult.unshift(helperOpspec); + } + } + if (removeTextSpec.position + removeTextSpec.length <= splitParagraphSpec.position) { + splitParagraphSpec.position -= removeTextSpec.length; + } else { + if (removeTextSpec.position < splitParagraphSpec.position) { + splitParagraphSpec.position = removeTextSpec.position; + } + } + if (removeTextSpec.position + removeTextSpec.length < splitParagraphSpec.sourceParagraphPosition) { + splitParagraphSpec.sourceParagraphPosition -= removeTextSpec.length; + } + return {opSpecsA:removeTextSpecResult, opSpecsB:splitParagraphSpecResult}; + } + function passUnchanged(opSpecA, opSpecB) { + return {opSpecsA:[opSpecA], opSpecsB:[opSpecB]}; + } + var transformations; + transformations = {"AddAnnotation":{"AddAnnotation":transformAddAnnotationAddAnnotation, "AddCursor":passUnchanged, "AddMember":passUnchanged, "AddStyle":passUnchanged, "ApplyDirectStyling":transformAddAnnotationApplyDirectStyling, "InsertText":transformAddAnnotationInsertText, "MergeParagraph":transformAddAnnotationMergeParagraph, "MoveCursor":transformAddAnnotationMoveCursor, "RemoveAnnotation":transformAddAnnotationRemoveAnnotation, "RemoveCursor":passUnchanged, "RemoveMember":passUnchanged, + "RemoveStyle":passUnchanged, "RemoveText":transformAddAnnotationRemoveText, "SetParagraphStyle":transformAddAnnotationSetParagraphStyle, "SplitParagraph":transformAddAnnotationSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "AddCursor":{"AddCursor":passUnchanged, "AddMember":passUnchanged, "AddStyle":passUnchanged, "ApplyDirectStyling":passUnchanged, "InsertText":passUnchanged, "MergeParagraph":passUnchanged, "MoveCursor":passUnchanged, + "RemoveAnnotation":passUnchanged, "RemoveCursor":passUnchanged, "RemoveMember":passUnchanged, "RemoveStyle":passUnchanged, "RemoveText":passUnchanged, "SetParagraphStyle":passUnchanged, "SplitParagraph":passUnchanged, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "AddMember":{"AddStyle":passUnchanged, "ApplyDirectStyling":passUnchanged, "InsertText":passUnchanged, "MergeParagraph":passUnchanged, "MoveCursor":passUnchanged, "RemoveAnnotation":passUnchanged, + "RemoveCursor":passUnchanged, "RemoveStyle":passUnchanged, "RemoveText":passUnchanged, "SetParagraphStyle":passUnchanged, "SplitParagraph":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "AddStyle":{"AddStyle":passUnchanged, "ApplyDirectStyling":passUnchanged, "InsertText":passUnchanged, "MergeParagraph":passUnchanged, "MoveCursor":passUnchanged, "RemoveAnnotation":passUnchanged, "RemoveCursor":passUnchanged, "RemoveMember":passUnchanged, "RemoveStyle":transformAddStyleRemoveStyle, + "RemoveText":passUnchanged, "SetParagraphStyle":passUnchanged, "SplitParagraph":passUnchanged, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "ApplyDirectStyling":{"ApplyDirectStyling":transformApplyDirectStylingApplyDirectStyling, "InsertText":transformApplyDirectStylingInsertText, "MergeParagraph":transformApplyDirectStylingMergeParagraph, "MoveCursor":passUnchanged, "RemoveAnnotation":transformApplyDirectStylingRemoveAnnotation, "RemoveCursor":passUnchanged, + "RemoveMember":passUnchanged, "RemoveStyle":passUnchanged, "RemoveText":transformApplyDirectStylingRemoveText, "SetParagraphStyle":passUnchanged, "SplitParagraph":transformApplyDirectStylingSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "InsertText":{"InsertText":transformInsertTextInsertText, "MergeParagraph":transformInsertTextMergeParagraph, "MoveCursor":transformInsertTextMoveCursor, "RemoveAnnotation":transformInsertTextRemoveAnnotation, + "RemoveCursor":passUnchanged, "RemoveMember":passUnchanged, "RemoveStyle":passUnchanged, "RemoveText":transformInsertTextRemoveText, "SetParagraphStyle":transformInsertTextSetParagraphStyle, "SplitParagraph":transformInsertTextSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "MergeParagraph":{"MergeParagraph":transformMergeParagraphMergeParagraph, "MoveCursor":transformMergeParagraphMoveCursor, "RemoveAnnotation":transformMergeParagraphRemoveAnnotation, + "RemoveCursor":passUnchanged, "RemoveMember":passUnchanged, "RemoveStyle":passUnchanged, "RemoveText":transformMergeParagraphRemoveText, "SetParagraphStyle":transformMergeParagraphSetParagraphStyle, "SplitParagraph":transformMergeParagraphSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "MoveCursor":{"MoveCursor":passUnchanged, "RemoveAnnotation":transformMoveCursorRemoveAnnotation, "RemoveCursor":transformMoveCursorRemoveCursor, + "RemoveMember":passUnchanged, "RemoveStyle":passUnchanged, "RemoveText":transformMoveCursorRemoveText, "SetParagraphStyle":passUnchanged, "SplitParagraph":transformMoveCursorSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "RemoveAnnotation":{"RemoveAnnotation":transformRemoveAnnotationRemoveAnnotation, "RemoveCursor":passUnchanged, "RemoveMember":passUnchanged, "RemoveStyle":passUnchanged, "RemoveText":transformRemoveAnnotationRemoveText, + "SetParagraphStyle":transformRemoveAnnotationSetParagraphStyle, "SplitParagraph":transformRemoveAnnotationSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "RemoveCursor":{"RemoveCursor":transformRemoveCursorRemoveCursor, "RemoveMember":passUnchanged, "RemoveStyle":passUnchanged, "RemoveText":passUnchanged, "SetParagraphStyle":passUnchanged, "SplitParagraph":passUnchanged, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, + "UpdateParagraphStyle":passUnchanged}, "RemoveMember":{"RemoveStyle":passUnchanged, "RemoveText":passUnchanged, "SetParagraphStyle":passUnchanged, "SplitParagraph":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "RemoveStyle":{"RemoveStyle":transformRemoveStyleRemoveStyle, "RemoveText":passUnchanged, "SetParagraphStyle":transformRemoveStyleSetParagraphStyle, "SplitParagraph":passUnchanged, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":transformRemoveStyleUpdateParagraphStyle}, + "RemoveText":{"RemoveText":transformRemoveTextRemoveText, "SetParagraphStyle":transformRemoveTextSetParagraphStyle, "SplitParagraph":transformRemoveTextSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "SetParagraphStyle":{"SetParagraphStyle":transformSetParagraphStyleSetParagraphStyle, "SplitParagraph":transformSetParagraphStyleSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, + "SplitParagraph":{"SplitParagraph":transformSplitParagraphSplitParagraph, "UpdateMember":passUnchanged, "UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "UpdateMember":{"UpdateMetadata":passUnchanged, "UpdateParagraphStyle":passUnchanged}, "UpdateMetadata":{"UpdateMetadata":transformUpdateMetadataUpdateMetadata, "UpdateParagraphStyle":passUnchanged}, "UpdateParagraphStyle":{"UpdateParagraphStyle":transformUpdateParagraphStyleUpdateParagraphStyle}}; + this.passUnchanged = passUnchanged; + this.extendTransformations = function(moreTransformations) { + Object.keys(moreTransformations).forEach(function(optypeA) { + var moreTransformationsOptypeAMap = moreTransformations[optypeA], optypeAMap, isExtendingOptypeAMap = transformations.hasOwnProperty(optypeA); + runtime.log((isExtendingOptypeAMap ? "Extending" : "Adding") + " map for optypeA: " + optypeA); + if (!isExtendingOptypeAMap) { + transformations[optypeA] = {}; + } + optypeAMap = transformations[optypeA]; + Object.keys(moreTransformationsOptypeAMap).forEach(function(optypeB) { + var isOverwritingOptypeBEntry = optypeAMap.hasOwnProperty(optypeB); + runtime.assert(optypeA <= optypeB, "Wrong order:" + optypeA + ", " + optypeB); + runtime.log(" " + (isOverwritingOptypeBEntry ? "Overwriting" : "Adding") + " entry for optypeB: " + optypeB); + optypeAMap[optypeB] = moreTransformationsOptypeAMap[optypeB]; + }); + }); + }; + this.transformOpspecVsOpspec = function(opSpecA, opSpecB) { + var isOptypeAAlphaNumericSmaller = opSpecA.optype <= opSpecB.optype, helper, transformationFunctionMap, transformationFunction, result; + runtime.log("Crosstransforming:"); + runtime.log(runtime.toJson(opSpecA)); + runtime.log(runtime.toJson(opSpecB)); + if (!isOptypeAAlphaNumericSmaller) { + helper = opSpecA; + opSpecA = opSpecB; + opSpecB = helper; + } + transformationFunctionMap = transformations[opSpecA.optype]; + transformationFunction = transformationFunctionMap && transformationFunctionMap[opSpecB.optype]; + if (transformationFunction) { + result = transformationFunction(opSpecA, opSpecB, !isOptypeAAlphaNumericSmaller); + if (!isOptypeAAlphaNumericSmaller && result !== null) { + result = {opSpecsA:result.opSpecsB, opSpecsB:result.opSpecsA}; + } + } else { + result = null; + } + runtime.log("result:"); + if (result) { + runtime.log(runtime.toJson(result.opSpecsA)); + runtime.log(runtime.toJson(result.opSpecsB)); + } else { + runtime.log("null"); + } + return result; + }; +}; +ops.OperationTransformer = function OperationTransformer() { + var operationTransformMatrix = new ops.OperationTransformMatrix; + function transformOpVsOp(opSpecA, opSpecB) { + return operationTransformMatrix.transformOpspecVsOpspec(opSpecA, opSpecB); + } + function transformOpListVsOp(opSpecsA, opSpecB) { + var transformResult, transformListResult, transformedOpspecsA = [], transformedOpspecsB = []; + while (opSpecsA.length > 0 && opSpecB) { + transformResult = transformOpVsOp(opSpecsA.shift(), opSpecB); + if (!transformResult) { + return null; + } + transformedOpspecsA = transformedOpspecsA.concat(transformResult.opSpecsA); + if (transformResult.opSpecsB.length === 0) { + transformedOpspecsA = transformedOpspecsA.concat(opSpecsA); + opSpecB = null; + break; + } + while (transformResult.opSpecsB.length > 1) { + transformListResult = transformOpListVsOp(opSpecsA, transformResult.opSpecsB.shift()); + if (!transformListResult) { + return null; + } + transformedOpspecsB = transformedOpspecsB.concat(transformListResult.opSpecsB); + opSpecsA = transformListResult.opSpecsA; + } + opSpecB = transformResult.opSpecsB.pop(); + } + if (opSpecB) { + transformedOpspecsB.push(opSpecB); + } + return {opSpecsA:transformedOpspecsA, opSpecsB:transformedOpspecsB}; + } + this.getOperationTransformMatrix = function() { + return operationTransformMatrix; + }; + this.transform = function(opSpecsA, opSpecsB) { + var transformResult, transformedOpspecsB = []; + while (opSpecsB.length > 0) { + transformResult = transformOpListVsOp(opSpecsA, opSpecsB.shift()); + if (!transformResult) { + return null; + } + opSpecsA = transformResult.opSpecsA; + transformedOpspecsB = transformedOpspecsB.concat(transformResult.opSpecsB); + } + return {opSpecsA:opSpecsA, opSpecsB:transformedOpspecsB}; + }; +}; +var webodf_css = '@namespace draw url(urn:oasis:names:tc:opendocument:xmlns:drawing:1.0);@namespace fo url(urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0);@namespace office url(urn:oasis:names:tc:opendocument:xmlns:office:1.0);@namespace presentation url(urn:oasis:names:tc:opendocument:xmlns:presentation:1.0);@namespace style url(urn:oasis:names:tc:opendocument:xmlns:style:1.0);@namespace svg url(urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0);@namespace table url(urn:oasis:names:tc:opendocument:xmlns:table:1.0);@namespace text url(urn:oasis:names:tc:opendocument:xmlns:text:1.0);@namespace webodfhelper url(urn:webodf:names:helper);@namespace cursor url(urn:webodf:names:cursor);@namespace editinfo url(urn:webodf:names:editinfo);@namespace annotation url(urn:webodf:names:annotation);@namespace dc url(http://purl.org/dc/elements/1.1/);@namespace svgns url(http://www.w3.org/2000/svg);office|document > *, office|document-content > * {display: none;}office|body, office|document {display: inline-block;position: relative;}text|p, text|h {display: block;padding: 0;margin: 0;line-height: normal;position: relative;}text|p::after, text|h::after {content: "\\200B";white-space: pre;}*[webodfhelper|containsparagraphanchor] {position: relative;}text|s {white-space: pre;}text|tab {display: inline;white-space: pre;}text|tracked-changes {display: none;}office|binary-data {display: none;}office|text {display: block;text-align: left;overflow: visible;word-wrap: break-word;}office|text::selection {background: transparent;}.webodf-virtualSelections *::selection {background: transparent;}.webodf-virtualSelections *::-moz-selection {background: transparent;}office|text * draw|text-box {display: block;border: 1px solid #d3d3d3;}office|text draw|frame {z-index: 1;}office|spreadsheet {display: block;border-collapse: collapse;empty-cells: show;font-family: sans-serif;font-size: 10pt;text-align: left;page-break-inside: avoid;overflow: hidden;}office|presentation {display: inline-block;text-align: left;}#shadowContent {display: inline-block;text-align: left;}draw|page {display: block;position: relative;overflow: hidden;}presentation|notes, presentation|footer-decl, presentation|date-time-decl {display: none;}@media print {draw|page {border: 1pt solid black;page-break-inside: avoid;}presentation|notes {}}office|spreadsheet text|p {border: 0px;padding: 1px;margin: 0px;}office|spreadsheet table|table {margin: 3px;}office|spreadsheet table|table:after {}office|spreadsheet table|table-row {counter-increment: row;}office|spreadsheet table|table-row:before {width: 3em;background: #cccccc;border: 1px solid black;text-align: center;content: counter(row);display: table-cell;}office|spreadsheet table|table-cell {border: 1px solid #cccccc;}table|table {display: table;}draw|frame table|table {width: 100%;height: 100%;background: white;}table|table-header-rows {display: table-header-group;}table|table-row {display: table-row;}table|table-column {display: table-column;}table|table-cell {width: 0.889in;display: table-cell;word-break: break-all;}draw|frame {display: block;}draw|image {display: block;width: 100%;height: 100%;top: 0px;left: 0px;background-repeat: no-repeat;background-size: 100% 100%;-moz-background-size: 100% 100%;}draw|frame > draw|image:nth-of-type(n+2) {display: none;}text|list:before {display: none;content:"";}text|list {display: block;}text|list-item {display: block;}text|number {display:none;}text|a {color: blue;text-decoration: underline;cursor: pointer;}.webodf-inactiveLinks text|a {cursor: text;}text|note-citation {vertical-align: super;font-size: smaller;}text|note-body {display: none;}text|note:hover text|note-citation {background: #dddddd;}text|note:hover text|note-body {display: block;left:1em;max-width: 80%;position: absolute;background: #ffffaa;}text|bibliography-source {display: none;}svg|title, svg|desc {display: none;}video {width: 100%;height: 100%}cursor|anchor {display: none;}cursor|cursor {display: none;}.webodf-caretOverlay {position: absolute;top: 5%;height: 1em;z-index: 10;padding-left: 1px;pointer-events: none;}.webodf-caretOverlay .caret {position: absolute;border-left: 2px solid black;top: 0;bottom: 0;right: 0;}.webodf-caretOverlay .handle {position: absolute;margin-top: 5px;padding-top: 3px;margin-left: auto;margin-right: auto;width: 64px;height: 68px;border-radius: 5px;opacity: 0.3;text-align: center;background-color: black;box-shadow: 0px 0px 5px rgb(90, 90, 90);border: 1px solid black;top: -85px;right: -32px;}.webodf-caretOverlay .handle > img {box-shadow: 0px 0px 5px rgb(90, 90, 90) inset;background-color: rgb(200, 200, 200);border-radius: 5px;border: 2px solid;height: 60px;width: 60px;display: block;margin: auto;}.webodf-caretOverlay .handle.active {opacity: 0.8;}.webodf-caretOverlay .handle:after {content: " ";position: absolute;width: 0px;height: 0px;border-style: solid;border-width: 8.7px 5px 0 5px;border-color: black transparent transparent transparent;top: 100%;left: 43%;}.webodf-caretSizer {display: inline-block;width: 0;visibility: hidden;}#eventTrap {display: block;position: absolute;bottom: 0;left: 0;outline: none;opacity: 0;color: rgba(255, 255, 255, 0);pointer-events: none;white-space: pre;overflow: hidden;}cursor|cursor > #composer {text-decoration: underline;}cursor|cursor[cursor|caret-sizer-active="true"],cursor|cursor[cursor|composing="true"] {display: inline;}editinfo|editinfo {display: inline-block;}.editInfoMarker {position: absolute;width: 10px;height: 100%;left: -20px;opacity: 0.8;top: 0;border-radius: 5px;background-color: transparent;box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);}.editInfoMarker:hover {box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);}.editInfoHandle {position: absolute;background-color: black;padding: 5px;border-radius: 5px;opacity: 0.8;box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);bottom: 100%;margin-bottom: 10px;z-index: 3;left: -25px;}.editInfoHandle:after {content: " ";position: absolute;width: 0px;height: 0px;border-style: solid;border-width: 8.7px 5px 0 5px;border-color: black transparent transparent transparent;top: 100%;left: 5px;}.editInfo {font-family: sans-serif;font-weight: normal;font-style: normal;text-decoration: none;color: white;width: 100%;height: 12pt;}.editInfoColor {float: left;width: 10pt;height: 10pt;border: 1px solid white;}.editInfoAuthor {float: left;margin-left: 5pt;font-size: 10pt;text-align: left;height: 12pt;line-height: 12pt;}.editInfoTime {float: right;margin-left: 30pt;font-size: 8pt;font-style: italic;color: yellow;height: 12pt;line-height: 12pt;}.annotationWrapper {display: inline;position: relative;}.annotationRemoveButton:before {content: "\u00d7";color: white;padding: 5px;line-height: 1em;}.annotationRemoveButton {width: 20px;height: 20px;border-radius: 10px;background-color: black;box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);position: absolute;top: -10px;left: -10px;z-index: 3;text-align: center;font-family: sans-serif;font-style: normal;font-weight: normal;text-decoration: none;font-size: 15px;}.annotationRemoveButton:hover {cursor: pointer;box-shadow: 0px 0px 5px rgba(0, 0, 0, 1);}.annotationNote {width: 4cm;position: absolute;display: inline;z-index: 10;top: 0;}.annotationNote > office|annotation {display: block;text-align: left;}.annotationConnector {position: absolute;display: inline;top: 0;z-index: 2;border-top: 1px dashed brown;}.annotationConnector.angular {-moz-transform-origin: left top;-webkit-transform-origin: left top;-ms-transform-origin: left top;transform-origin: left top;}.annotationConnector.horizontal {left: 0;}.annotationConnector.horizontal:before {content: "";display: inline;position: absolute;width: 0px;height: 0px;border-style: solid;border-width: 8.7px 5px 0 5px;border-color: brown transparent transparent transparent;top: -1px;left: -5px;}office|annotation {width: 100%;height: 100%;display: none;background: rgb(198, 238, 184);background: -moz-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);background: -webkit-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);background: -o-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);background: -ms-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);background: linear-gradient(180deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);box-shadow: 0 3px 4px -3px #ccc;}office|annotation > dc|creator {display: block;font-size: 10pt;font-weight: normal;font-style: normal;font-family: sans-serif;color: white;background-color: brown;padding: 4px;}office|annotation > dc|date {display: block;font-size: 10pt;font-weight: normal;font-style: normal;font-family: sans-serif;border: 4px solid transparent;color: black;}office|annotation > text|list {display: block;padding: 5px;}office|annotation text|p {font-size: 10pt;color: black;font-weight: normal;font-style: normal;text-decoration: none;font-family: sans-serif;}#annotationsPane {background-color: #EAEAEA;width: 4cm;height: 100%;display: none;position: absolute;outline: 1px solid #ccc;}.webodf-annotationHighlight {background-color: yellow;position: relative;}.webodf-selectionOverlay {position: absolute;pointer-events: none;top: 0;left: 0;top: 0;left: 0;width: 100%;height: 100%;z-index: 15;}.webodf-selectionOverlay > polygon {fill-opacity: 0.3;stroke-opacity: 0.8;stroke-width: 1;fill-rule: evenodd;}.webodf-selectionOverlay > .webodf-draggable {fill-opacity: 0.8;stroke-opacity: 0;stroke-width: 8;pointer-events: all;display: none;-moz-transform-origin: center center;-webkit-transform-origin: center center;-ms-transform-origin: center center;transform-origin: center center;}#imageSelector {display: none;position: absolute;border-style: solid;border-color: black;}#imageSelector > div {width: 5px;height: 5px;display: block;position: absolute;border: 1px solid black;background-color: #ffffff;}#imageSelector > .topLeft {top: -4px;left: -4px;}#imageSelector > .topRight {top: -4px;right: -4px;}#imageSelector > .bottomRight {right: -4px;bottom: -4px;}#imageSelector > .bottomLeft {bottom: -4px;left: -4px;}#imageSelector > .topMiddle {top: -4px;left: 50%;margin-left: -2.5px;}#imageSelector > .rightMiddle {top: 50%;right: -4px;margin-top: -2.5px;}#imageSelector > .bottomMiddle {bottom: -4px;left: 50%;margin-left: -2.5px;}#imageSelector > .leftMiddle {top: 50%;left: -4px;margin-top: -2.5px;}div.webodf-customScrollbars::-webkit-scrollbar{width: 8px;height: 8px;background-color: transparent;}div.webodf-customScrollbars::-webkit-scrollbar-track{background-color: transparent;}div.webodf-customScrollbars::-webkit-scrollbar-thumb{background-color: #444;border-radius: 4px;}.webodf-hyperlinkTooltip {display: none;color: white;background-color: black;border-radius: 5px;box-shadow: 2px 2px 5px gray;padding: 3px;position: absolute;max-width: 210px;text-align: left;word-break: break-all;z-index: 16;}.webodf-hyperlinkTooltipText {display: block;font-weight: bold;}'; +/* + + @licstart +JSZip - A Javascript class for generating and reading zip files + + +(c) 2009-2014 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/master/LICENSE + @licend +*/ +!function(e) { + var globalScope = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}, externs = globalScope.externs || (globalScope.externs = {}); + externs.JSZip = e(); +}(function() { + var define, module, exports; + return function e(t, n, r) { + function s(o, u) { + if (!n[o]) { + if (!t[o]) { + var a = typeof require == "function" && require; + if (!u && a) { + return a(o, !0); + } + if (i) { + return i(o, !0); + } + throw new Error("Cannot find module '" + o + "'"); + } + var f = n[o] = {exports:{}}; + t[o][0].call(f.exports, function(e) { + var n = t[o][1][e]; + return s(n ? n : e); + }, f, f.exports, e, t, n, r); + } + return n[o].exports; + } + var i = typeof require == "function" && require; + for (var o = 0;o < r.length;o++) { + s(r[o]); + } + return s; + }({1:[function(_dereq_, module, exports) { + var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + exports.encode = function(input, utf8) { + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + enc1 = chr1 >> 2; + enc2 = (chr1 & 3) << 4 | chr2 >> 4; + enc3 = (chr2 & 15) << 2 | chr3 >> 6; + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else { + if (isNaN(chr3)) { + enc4 = 64; + } + } + output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4); + } + return output; + }; + exports.decode = function(input, utf8) { + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + while (i < input.length) { + enc1 = _keyStr.indexOf(input.charAt(i++)); + enc2 = _keyStr.indexOf(input.charAt(i++)); + enc3 = _keyStr.indexOf(input.charAt(i++)); + enc4 = _keyStr.indexOf(input.charAt(i++)); + chr1 = enc1 << 2 | enc2 >> 4; + chr2 = (enc2 & 15) << 4 | enc3 >> 2; + chr3 = (enc3 & 3) << 6 | enc4; + output = output + String.fromCharCode(chr1); + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + } + return output; + }; + }, {}], 2:[function(_dereq_, module, exports) { + function CompressedObject() { + this.compressedSize = 0; + this.uncompressedSize = 0; + this.crc32 = 0; + this.compressionMethod = null; + this.compressedContent = null; + } + CompressedObject.prototype = {getContent:function() { + return null; + }, getCompressedContent:function() { + return null; + }}; + module.exports = CompressedObject; + }, {}], 3:[function(_dereq_, module, exports) { + exports.STORE = {magic:"\x00\x00", compress:function(content) { + return content; + }, uncompress:function(content) { + return content; + }, compressInputType:null, uncompressInputType:null}; + exports.DEFLATE = _dereq_("./flate"); + }, {"./flate":8}], 4:[function(_dereq_, module, exports) { + var utils = _dereq_("./utils"); + var table = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, + 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, + 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, + 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, + 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, + 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918E3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117]; + module.exports = function crc32(input, crc) { + if (typeof input === "undefined" || !input.length) { + return 0; + } + var isArray = utils.getTypeOf(input) !== "string"; + if (typeof crc == "undefined") { + crc = 0; + } + var x = 0; + var y = 0; + var b = 0; + crc = crc ^ -1; + for (var i = 0, iTop = input.length;i < iTop;i++) { + b = isArray ? input[i] : input.charCodeAt(i); + y = (crc ^ b) & 255; + x = table[y]; + crc = crc >>> 8 ^ x; + } + return crc ^ -1; + }; + }, {"./utils":21}], 5:[function(_dereq_, module, exports) { + var utils = _dereq_("./utils"); + function DataReader(data) { + this.data = null; + this.length = 0; + this.index = 0; + } + DataReader.prototype = {checkOffset:function(offset) { + this.checkIndex(this.index + offset); + }, checkIndex:function(newIndex) { + if (this.length < newIndex || newIndex < 0) { + throw new Error("End of data reached (data length = " + this.length + ", asked index = " + newIndex + "). Corrupted zip ?"); + } + }, setIndex:function(newIndex) { + this.checkIndex(newIndex); + this.index = newIndex; + }, skip:function(n) { + this.setIndex(this.index + n); + }, byteAt:function(i) { + }, readInt:function(size) { + var result = 0, i; + this.checkOffset(size); + for (i = this.index + size - 1;i >= this.index;i--) { + result = (result << 8) + this.byteAt(i); + } + this.index += size; + return result; + }, readString:function(size) { + return utils.transformTo("string", this.readData(size)); + }, readData:function(size) { + }, lastIndexOfSignature:function(sig) { + }, readDate:function() { + var dostime = this.readInt(4); + return new Date((dostime >> 25 & 127) + 1980, (dostime >> 21 & 15) - 1, dostime >> 16 & 31, dostime >> 11 & 31, dostime >> 5 & 63, (dostime & 31) << 1); + }}; + module.exports = DataReader; + }, {"./utils":21}], 6:[function(_dereq_, module, exports) { + exports.base64 = false; + exports.binary = false; + exports.dir = false; + exports.createFolders = false; + exports.date = null; + exports.compression = null; + exports.comment = null; + }, {}], 7:[function(_dereq_, module, exports) { + var utils = _dereq_("./utils"); + exports.string2binary = function(str) { + return utils.string2binary(str); + }; + exports.string2Uint8Array = function(str) { + return utils.transformTo("uint8array", str); + }; + exports.uint8Array2String = function(array) { + return utils.transformTo("string", array); + }; + exports.string2Blob = function(str) { + var buffer = utils.transformTo("arraybuffer", str); + return utils.arrayBuffer2Blob(buffer); + }; + exports.arrayBuffer2Blob = function(buffer) { + return utils.arrayBuffer2Blob(buffer); + }; + exports.transformTo = function(outputType, input) { + return utils.transformTo(outputType, input); + }; + exports.getTypeOf = function(input) { + return utils.getTypeOf(input); + }; + exports.checkSupport = function(type) { + return utils.checkSupport(type); + }; + exports.MAX_VALUE_16BITS = utils.MAX_VALUE_16BITS; + exports.MAX_VALUE_32BITS = utils.MAX_VALUE_32BITS; + exports.pretty = function(str) { + return utils.pretty(str); + }; + exports.findCompression = function(compressionMethod) { + return utils.findCompression(compressionMethod); + }; + exports.isRegExp = function(object) { + return utils.isRegExp(object); + }; + }, {"./utils":21}], 8:[function(_dereq_, module, exports) { + var USE_TYPEDARRAY = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Uint32Array !== "undefined"; + var pako = _dereq_("pako"); + exports.uncompressInputType = USE_TYPEDARRAY ? "uint8array" : "array"; + exports.compressInputType = USE_TYPEDARRAY ? "uint8array" : "array"; + exports.magic = "\b\x00"; + exports.compress = function(input) { + return pako.deflateRaw(input); + }; + exports.uncompress = function(input) { + return pako.inflateRaw(input); + }; + }, {"pako":24}], 9:[function(_dereq_, module, exports) { + var base64 = _dereq_("./base64"); + function JSZip(data, options) { + if (!(this instanceof JSZip)) { + return new JSZip(data, options); + } + this.files = {}; + this.comment = null; + this.root = ""; + if (data) { + this.load(data, options); + } + this.clone = function() { + var newObj = new JSZip; + for (var i in this) { + if (typeof this[i] !== "function") { + newObj[i] = this[i]; + } + } + return newObj; + }; + } + JSZip.prototype = _dereq_("./object"); + JSZip.prototype.load = _dereq_("./load"); + JSZip.support = _dereq_("./support"); + JSZip.defaults = _dereq_("./defaults"); + JSZip.utils = _dereq_("./deprecatedPublicUtils"); + JSZip.base64 = {encode:function(input) { + return base64.encode(input); + }, decode:function(input) { + return base64.decode(input); + }}; + JSZip.compressions = _dereq_("./compressions"); + module.exports = JSZip; + }, {"./base64":1, "./compressions":3, "./defaults":6, "./deprecatedPublicUtils":7, "./load":10, "./object":13, "./support":17}], 10:[function(_dereq_, module, exports) { + var base64 = _dereq_("./base64"); + var ZipEntries = _dereq_("./zipEntries"); + module.exports = function(data, options) { + var files, zipEntries, i, input; + options = options || {}; + if (options.base64) { + data = base64.decode(data); + } + zipEntries = new ZipEntries(data, options); + files = zipEntries.files; + for (i = 0;i < files.length;i++) { + input = files[i]; + this.file(input.fileName, input.decompressed, {binary:true, optimizedBinaryString:true, date:input.date, dir:input.dir, comment:input.fileComment.length ? input.fileComment : null, createFolders:options.createFolders}); + } + if (zipEntries.zipComment.length) { + this.comment = zipEntries.zipComment; + } + return this; + }; + }, {"./base64":1, "./zipEntries":22}], 11:[function(_dereq_, module, exports) { + (function(Buffer) { + module.exports = function(data, encoding) { + return new Buffer(data, encoding); + }; + module.exports.test = function(b) { + return Buffer.isBuffer(b); + }; + }).call(this, typeof Buffer !== "undefined" ? Buffer : undefined); + }, {}], 12:[function(_dereq_, module, exports) { + var Uint8ArrayReader = _dereq_("./uint8ArrayReader"); + function NodeBufferReader(data) { + this.data = data; + this.length = this.data.length; + this.index = 0; + } + NodeBufferReader.prototype = new Uint8ArrayReader; + NodeBufferReader.prototype.readData = function(size) { + this.checkOffset(size); + var result = this.data.slice(this.index, this.index + size); + this.index += size; + return result; + }; + module.exports = NodeBufferReader; + }, {"./uint8ArrayReader":18}], 13:[function(_dereq_, module, exports) { + var support = _dereq_("./support"); + var utils = _dereq_("./utils"); + var crc32 = _dereq_("./crc32"); + var signature = _dereq_("./signature"); + var defaults = _dereq_("./defaults"); + var base64 = _dereq_("./base64"); + var compressions = _dereq_("./compressions"); + var CompressedObject = _dereq_("./compressedObject"); + var nodeBuffer = _dereq_("./nodeBuffer"); + var utf8 = _dereq_("./utf8"); + var StringWriter = _dereq_("./stringWriter"); + var Uint8ArrayWriter = _dereq_("./uint8ArrayWriter"); + var getRawData = function(file) { + if (file._data instanceof CompressedObject) { + file._data = file._data.getContent(); + file.options.binary = true; + file.options.base64 = false; + if (utils.getTypeOf(file._data) === "uint8array") { + var copy = file._data; + file._data = new Uint8Array(copy.length); + if (copy.length !== 0) { + file._data.set(copy, 0); + } + } + } + return file._data; + }; + var getBinaryData = function(file) { + var result = getRawData(file), type = utils.getTypeOf(result); + if (type === "string") { + if (!file.options.binary) { + if (support.nodebuffer) { + return nodeBuffer(result, "utf-8"); + } + } + return file.asBinary(); + } + return result; + }; + var dataToString = function(asUTF8) { + var result = getRawData(this); + if (result === null || typeof result === "undefined") { + return ""; + } + if (this.options.base64) { + result = base64.decode(result); + } + if (asUTF8 && this.options.binary) { + result = out.utf8decode(result); + } else { + result = utils.transformTo("string", result); + } + if (!asUTF8 && !this.options.binary) { + result = utils.transformTo("string", out.utf8encode(result)); + } + return result; + }; + var ZipObject = function(name, data, options) { + this.name = name; + this.dir = options.dir; + this.date = options.date; + this.comment = options.comment; + this._data = data; + this.options = options; + this._initialMetadata = {dir:options.dir, date:options.date}; + }; + ZipObject.prototype = {asText:function() { + return dataToString.call(this, true); + }, asBinary:function() { + return dataToString.call(this, false); + }, asNodeBuffer:function() { + var result = getBinaryData(this); + return utils.transformTo("nodebuffer", result); + }, asUint8Array:function() { + var result = getBinaryData(this); + return utils.transformTo("uint8array", result); + }, asArrayBuffer:function() { + return this.asUint8Array().buffer; + }}; + var decToHex = function(dec, bytes) { + var hex = "", i; + for (i = 0;i < bytes;i++) { + hex += String.fromCharCode(dec & 255); + dec = dec >>> 8; + } + return hex; + }; + var extend = function() { + var result = {}, i, attr; + for (i = 0;i < arguments.length;i++) { + for (attr in arguments[i]) { + if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") { + result[attr] = arguments[i][attr]; + } + } + } + return result; + }; + var prepareFileAttrs = function(o) { + o = o || {}; + if (o.base64 === true && (o.binary === null || o.binary === undefined)) { + o.binary = true; + } + o = extend(o, defaults); + o.date = o.date || new Date; + if (o.compression !== null) { + o.compression = o.compression.toUpperCase(); + } + return o; + }; + var fileAdd = function(name, data, o) { + var dataType = utils.getTypeOf(data), parent; + o = prepareFileAttrs(o); + if (o.createFolders && (parent = parentFolder(name))) { + folderAdd.call(this, parent, true); + } + if (o.dir || data === null || typeof data === "undefined") { + o.base64 = false; + o.binary = false; + data = null; + } else { + if (dataType === "string") { + if (o.binary && !o.base64) { + if (o.optimizedBinaryString !== true) { + data = utils.string2binary(data); + } + } + } else { + o.base64 = false; + o.binary = true; + if (!dataType && !(data instanceof CompressedObject)) { + throw new Error("The data of '" + name + "' is in an unsupported format !"); + } + if (dataType === "arraybuffer") { + data = utils.transformTo("uint8array", data); + } + } + } + var object = new ZipObject(name, data, o); + this.files[name] = object; + return object; + }; + var parentFolder = function(path) { + if (path.slice(-1) == "/") { + path = path.substring(0, path.length - 1); + } + var lastSlash = path.lastIndexOf("/"); + return lastSlash > 0 ? path.substring(0, lastSlash) : ""; + }; + var folderAdd = function(name, createFolders) { + if (name.slice(-1) != "/") { + name += "/"; + } + createFolders = typeof createFolders !== "undefined" ? createFolders : false; + if (!this.files[name]) { + fileAdd.call(this, name, null, {dir:true, createFolders:createFolders}); + } + return this.files[name]; + }; + var generateCompressedObjectFrom = function(file, compression) { + var result = new CompressedObject, content; + if (file._data instanceof CompressedObject) { + result.uncompressedSize = file._data.uncompressedSize; + result.crc32 = file._data.crc32; + if (result.uncompressedSize === 0 || file.dir) { + compression = compressions["STORE"]; + result.compressedContent = ""; + result.crc32 = 0; + } else { + if (file._data.compressionMethod === compression.magic) { + result.compressedContent = file._data.getCompressedContent(); + } else { + content = file._data.getContent(); + result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content)); + } + } + } else { + content = getBinaryData(file); + if (!content || content.length === 0 || file.dir) { + compression = compressions["STORE"]; + content = ""; + } + result.uncompressedSize = content.length; + result.crc32 = crc32(content); + result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content)); + } + result.compressedSize = result.compressedContent.length; + result.compressionMethod = compression.magic; + return result; + }; + var generateZipParts = function(name, file, compressedObject, offset) { + var data = compressedObject.compressedContent, utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)), comment = file.comment || "", utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)), useUTF8ForFileName = utfEncodedFileName.length !== file.name.length, useUTF8ForComment = utfEncodedComment.length !== comment.length, o = file.options, dosTime, dosDate, extraFields = "", unicodePathExtraField = "", unicodeCommentExtraField = "", dir, date; + if (file._initialMetadata.dir !== file.dir) { + dir = file.dir; + } else { + dir = o.dir; + } + if (file._initialMetadata.date !== file.date) { + date = file.date; + } else { + date = o.date; + } + dosTime = date.getHours(); + dosTime = dosTime << 6; + dosTime = dosTime | date.getMinutes(); + dosTime = dosTime << 5; + dosTime = dosTime | date.getSeconds() / 2; + dosDate = date.getFullYear() - 1980; + dosDate = dosDate << 4; + dosDate = dosDate | date.getMonth() + 1; + dosDate = dosDate << 5; + dosDate = dosDate | date.getDate(); + if (useUTF8ForFileName) { + unicodePathExtraField = decToHex(1, 1) + decToHex(crc32(utfEncodedFileName), 4) + utfEncodedFileName; + extraFields += "up" + decToHex(unicodePathExtraField.length, 2) + unicodePathExtraField; + } + if (useUTF8ForComment) { + unicodeCommentExtraField = decToHex(1, 1) + decToHex(this.crc32(utfEncodedComment), 4) + utfEncodedComment; + extraFields += "uc" + decToHex(unicodeCommentExtraField.length, 2) + unicodeCommentExtraField; + } + var header = ""; + header += "\n\x00"; + header += useUTF8ForFileName || useUTF8ForComment ? "\x00\b" : "\x00\x00"; + header += compressedObject.compressionMethod; + header += decToHex(dosTime, 2); + header += decToHex(dosDate, 2); + header += decToHex(compressedObject.crc32, 4); + header += decToHex(compressedObject.compressedSize, 4); + header += decToHex(compressedObject.uncompressedSize, 4); + header += decToHex(utfEncodedFileName.length, 2); + header += decToHex(extraFields.length, 2); + var fileRecord = signature.LOCAL_FILE_HEADER + header + utfEncodedFileName + extraFields; + var dirRecord = signature.CENTRAL_FILE_HEADER + "\u0014\x00" + header + decToHex(utfEncodedComment.length, 2) + "\x00\x00" + "\x00\x00" + (dir === true ? "\u0010\x00\x00\x00" : "\x00\x00\x00\x00") + decToHex(offset, 4) + utfEncodedFileName + extraFields + utfEncodedComment; + return {fileRecord:fileRecord, dirRecord:dirRecord, compressedObject:compressedObject}; + }; + var out = {load:function(stream, options) { + throw new Error("Load method is not defined. Is the file jszip-load.js included ?"); + }, filter:function(search) { + var result = [], filename, relativePath, file, fileClone; + for (filename in this.files) { + if (!this.files.hasOwnProperty(filename)) { + continue; + } + file = this.files[filename]; + fileClone = new ZipObject(file.name, file._data, extend(file.options)); + relativePath = filename.slice(this.root.length, filename.length); + if (filename.slice(0, this.root.length) === this.root && search(relativePath, fileClone)) { + result.push(fileClone); + } + } + return result; + }, file:function(name, data, o) { + if (arguments.length === 1) { + if (utils.isRegExp(name)) { + var regexp = name; + return this.filter(function(relativePath, file) { + return !file.dir && regexp.test(relativePath); + }); + } else { + return this.filter(function(relativePath, file) { + return !file.dir && relativePath === name; + })[0] || null; + } + } else { + name = this.root + name; + fileAdd.call(this, name, data, o); + } + return this; + }, folder:function(arg) { + if (!arg) { + return this; + } + if (utils.isRegExp(arg)) { + return this.filter(function(relativePath, file) { + return file.dir && arg.test(relativePath); + }); + } + var name = this.root + arg; + var newFolder = folderAdd.call(this, name); + var ret = this.clone(); + ret.root = newFolder.name; + return ret; + }, remove:function(name) { + name = this.root + name; + var file = this.files[name]; + if (!file) { + if (name.slice(-1) != "/") { + name += "/"; + } + file = this.files[name]; + } + if (file && !file.dir) { + delete this.files[name]; + } else { + var kids = this.filter(function(relativePath, file) { + return file.name.slice(0, name.length) === name; + }); + for (var i = 0;i < kids.length;i++) { + delete this.files[kids[i].name]; + } + } + return this; + }, generate:function(options) { + options = extend(options || {}, {base64:true, compression:"STORE", type:"base64", comment:null}); + utils.checkSupport(options.type); + var zipData = [], localDirLength = 0, centralDirLength = 0, writer, i, utfEncodedComment = utils.transformTo("string", this.utf8encode(options.comment || this.comment || "")); + for (var name in this.files) { + if (!this.files.hasOwnProperty(name)) { + continue; + } + var file = this.files[name]; + var compressionName = file.options.compression || options.compression.toUpperCase(); + var compression = compressions[compressionName]; + if (!compression) { + throw new Error(compressionName + " is not a valid compression method !"); + } + var compressedObject = generateCompressedObjectFrom.call(this, file, compression); + var zipPart = generateZipParts.call(this, name, file, compressedObject, localDirLength); + localDirLength += zipPart.fileRecord.length + compressedObject.compressedSize; + centralDirLength += zipPart.dirRecord.length; + zipData.push(zipPart); + } + var dirEnd = ""; + dirEnd = signature.CENTRAL_DIRECTORY_END + "\x00\x00" + "\x00\x00" + decToHex(zipData.length, 2) + decToHex(zipData.length, 2) + decToHex(centralDirLength, 4) + decToHex(localDirLength, 4) + decToHex(utfEncodedComment.length, 2) + utfEncodedComment; + var typeName = options.type.toLowerCase(); + if (typeName === "uint8array" || typeName === "arraybuffer" || typeName === "blob" || typeName === "nodebuffer") { + writer = new Uint8ArrayWriter(localDirLength + centralDirLength + dirEnd.length); + } else { + writer = new StringWriter(localDirLength + centralDirLength + dirEnd.length); + } + for (i = 0;i < zipData.length;i++) { + writer.append(zipData[i].fileRecord); + writer.append(zipData[i].compressedObject.compressedContent); + } + for (i = 0;i < zipData.length;i++) { + writer.append(zipData[i].dirRecord); + } + writer.append(dirEnd); + var zip = writer.finalize(); + switch(options.type.toLowerCase()) { + case "uint8array": + ; + case "arraybuffer": + ; + case "nodebuffer": + return utils.transformTo(options.type.toLowerCase(), zip); + case "blob": + return utils.arrayBuffer2Blob(utils.transformTo("arraybuffer", zip)); + case "base64": + return options.base64 ? base64.encode(zip) : zip; + default: + return zip; + } + }, crc32:function(input, crc) { + return crc32(input, crc); + }, utf8encode:function(string) { + return utils.transformTo("string", utf8.utf8encode(string)); + }, utf8decode:function(input) { + return utf8.utf8decode(input); + }}; + module.exports = out; + }, {"./base64":1, "./compressedObject":2, "./compressions":3, "./crc32":4, "./defaults":6, "./nodeBuffer":11, "./signature":14, "./stringWriter":16, "./support":17, "./uint8ArrayWriter":19, "./utf8":20, "./utils":21}], 14:[function(_dereq_, module, exports) { + exports.LOCAL_FILE_HEADER = "PK\u0003\u0004"; + exports.CENTRAL_FILE_HEADER = "PK\u0001\u0002"; + exports.CENTRAL_DIRECTORY_END = "PK\u0005\u0006"; + exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\u0006\u0007"; + exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\u0006\u0006"; + exports.DATA_DESCRIPTOR = "PK\u0007\b"; + }, {}], 15:[function(_dereq_, module, exports) { + var DataReader = _dereq_("./dataReader"); + var utils = _dereq_("./utils"); + function StringReader(data, optimizedBinaryString) { + this.data = data; + if (!optimizedBinaryString) { + this.data = utils.string2binary(this.data); + } + this.length = this.data.length; + this.index = 0; + } + StringReader.prototype = new DataReader; + StringReader.prototype.byteAt = function(i) { + return this.data.charCodeAt(i); + }; + StringReader.prototype.lastIndexOfSignature = function(sig) { + return this.data.lastIndexOf(sig); + }; + StringReader.prototype.readData = function(size) { + this.checkOffset(size); + var result = this.data.slice(this.index, this.index + size); + this.index += size; + return result; + }; + module.exports = StringReader; + }, {"./dataReader":5, "./utils":21}], 16:[function(_dereq_, module, exports) { + var utils = _dereq_("./utils"); + var StringWriter = function() { + this.data = []; + }; + StringWriter.prototype = {append:function(input) { + input = utils.transformTo("string", input); + this.data.push(input); + }, finalize:function() { + return this.data.join(""); + }}; + module.exports = StringWriter; + }, {"./utils":21}], 17:[function(_dereq_, module, exports) { + (function(Buffer) { + exports.base64 = true; + exports.array = true; + exports.string = true; + exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined"; + exports.nodebuffer = typeof Buffer !== "undefined"; + exports.uint8array = typeof Uint8Array !== "undefined"; + if (typeof ArrayBuffer === "undefined") { + exports.blob = false; + } else { + var buffer = new ArrayBuffer(0); + try { + exports.blob = (new Blob([buffer], {type:"application/zip"})).size === 0; + } catch (e) { + try { + var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; + var builder = new Builder; + builder.append(buffer); + exports.blob = builder.getBlob("application/zip").size === 0; + } catch (e) { + exports.blob = false; + } + } + } + }).call(this, typeof Buffer !== "undefined" ? Buffer : undefined); + }, {}], 18:[function(_dereq_, module, exports) { + var DataReader = _dereq_("./dataReader"); + function Uint8ArrayReader(data) { + if (data) { + this.data = data; + this.length = this.data.length; + this.index = 0; + } + } + Uint8ArrayReader.prototype = new DataReader; + Uint8ArrayReader.prototype.byteAt = function(i) { + return this.data[i]; + }; + Uint8ArrayReader.prototype.lastIndexOfSignature = function(sig) { + var sig0 = sig.charCodeAt(0), sig1 = sig.charCodeAt(1), sig2 = sig.charCodeAt(2), sig3 = sig.charCodeAt(3); + for (var i = this.length - 4;i >= 0;--i) { + if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) { + return i; + } + } + return -1; + }; + Uint8ArrayReader.prototype.readData = function(size) { + this.checkOffset(size); + if (size === 0) { + return new Uint8Array(0); + } + var result = this.data.subarray(this.index, this.index + size); + this.index += size; + return result; + }; + module.exports = Uint8ArrayReader; + }, {"./dataReader":5}], 19:[function(_dereq_, module, exports) { + var utils = _dereq_("./utils"); + var Uint8ArrayWriter = function(length) { + this.data = new Uint8Array(length); + this.index = 0; + }; + Uint8ArrayWriter.prototype = {append:function(input) { + if (input.length !== 0) { + input = utils.transformTo("uint8array", input); + this.data.set(input, this.index); + this.index += input.length; + } + }, finalize:function() { + return this.data; + }}; + module.exports = Uint8ArrayWriter; + }, {"./utils":21}], 20:[function(_dereq_, module, exports) { + var utils = _dereq_("./utils"); + var support = _dereq_("./support"); + var nodeBuffer = _dereq_("./nodeBuffer"); + var _utf8len = new Array(256); + for (var i = 0;i < 256;i++) { + _utf8len[i] = i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1; + } + _utf8len[254] = _utf8len[254] = 1; + var string2buf = function(str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + for (m_pos = 0;m_pos < str_len;m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 64512) === 55296 && m_pos + 1 < str_len) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 64512) === 56320) { + c = 65536 + (c - 55296 << 10) + (c2 - 56320); + m_pos++; + } + } + buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4; + } + if (support.uint8array) { + buf = new Uint8Array(buf_len); + } else { + buf = new Array(buf_len); + } + for (i = 0, m_pos = 0;i < buf_len;m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 64512) === 55296 && m_pos + 1 < str_len) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 64512) === 56320) { + c = 65536 + (c - 55296 << 10) + (c2 - 56320); + m_pos++; + } + } + if (c < 128) { + buf[i++] = c; + } else { + if (c < 2048) { + buf[i++] = 192 | c >>> 6; + buf[i++] = 128 | c & 63; + } else { + if (c < 65536) { + buf[i++] = 224 | c >>> 12; + buf[i++] = 128 | c >>> 6 & 63; + buf[i++] = 128 | c & 63; + } else { + buf[i++] = 240 | c >>> 18; + buf[i++] = 128 | c >>> 12 & 63; + buf[i++] = 128 | c >>> 6 & 63; + buf[i++] = 128 | c & 63; + } + } + } + } + return buf; + }; + var utf8border = function(buf, max) { + var pos; + max = max || buf.length; + if (max > buf.length) { + max = buf.length; + } + pos = max - 1; + while (pos >= 0 && (buf[pos] & 192) === 128) { + pos--; + } + if (pos < 0) { + return max; + } + if (pos === 0) { + return max; + } + return pos + _utf8len[buf[pos]] > max ? pos : max; + }; + var buf2string = function(buf) { + var str, i, out, c, c_len; + var len = buf.length; + var utf16buf = new Array(len * 2); + for (out = 0, i = 0;i < len;) { + c = buf[i++]; + if (c < 128) { + utf16buf[out++] = c; + continue; + } + c_len = _utf8len[c]; + if (c_len > 4) { + utf16buf[out++] = 65533; + i += c_len - 1; + continue; + } + c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; + while (c_len > 1 && i < len) { + c = c << 6 | buf[i++] & 63; + c_len--; + } + if (c_len > 1) { + utf16buf[out++] = 65533; + continue; + } + if (c < 65536) { + utf16buf[out++] = c; + } else { + c -= 65536; + utf16buf[out++] = 55296 | c >> 10 & 1023; + utf16buf[out++] = 56320 | c & 1023; + } + } + if (utf16buf.length !== out) { + if (utf16buf.subarray) { + utf16buf = utf16buf.subarray(0, out); + } else { + utf16buf.length = out; + } + } + return utils.applyFromCharCode(utf16buf); + }; + exports.utf8encode = function utf8encode(str) { + if (support.nodebuffer) { + return nodeBuffer(str, "utf-8"); + } + return string2buf(str); + }; + exports.utf8decode = function utf8decode(buf) { + if (support.nodebuffer) { + return utils.transformTo("nodebuffer", buf).toString("utf-8"); + } + buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf); + var result = [], k = 0, len = buf.length, chunk = 65536; + while (k < len) { + var nextBoundary = utf8border(buf, Math.min(k + chunk, len)); + if (support.uint8array) { + result.push(buf2string(buf.subarray(k, nextBoundary))); + } else { + result.push(buf2string(buf.slice(k, nextBoundary))); + } + k = nextBoundary; + } + return result.join(""); + }; + }, {"./nodeBuffer":11, "./support":17, "./utils":21}], 21:[function(_dereq_, module, exports) { + var support = _dereq_("./support"); + var compressions = _dereq_("./compressions"); + var nodeBuffer = _dereq_("./nodeBuffer"); + exports.string2binary = function(str) { + var result = ""; + for (var i = 0;i < str.length;i++) { + result += String.fromCharCode(str.charCodeAt(i) & 255); + } + return result; + }; + exports.arrayBuffer2Blob = function(buffer) { + exports.checkSupport("blob"); + try { + return new Blob([buffer], {type:"application/zip"}); + } catch (e) { + try { + var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder; + var builder = new Builder; + builder.append(buffer); + return builder.getBlob("application/zip"); + } catch (e) { + throw new Error("Bug : can't construct the Blob."); + } + } + }; + function identity(input) { + return input; + } + function stringToArrayLike(str, array) { + for (var i = 0;i < str.length;++i) { + array[i] = str.charCodeAt(i) & 255; + } + return array; + } + function arrayLikeToString(array) { + var chunk = 65536; + var result = [], len = array.length, type = exports.getTypeOf(array), k = 0, canUseApply = true; + try { + switch(type) { + case "uint8array": + String.fromCharCode.apply(null, new Uint8Array(0)); + break; + case "nodebuffer": + String.fromCharCode.apply(null, nodeBuffer(0)); + break; + } + } catch (e) { + canUseApply = false; + } + if (!canUseApply) { + var resultStr = ""; + for (var i = 0;i < array.length;i++) { + resultStr += String.fromCharCode(array[i]); + } + return resultStr; + } + while (k < len && chunk > 1) { + try { + if (type === "array" || type === "nodebuffer") { + result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len)))); + } else { + result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len)))); + } + k += chunk; + } catch (e) { + chunk = Math.floor(chunk / 2); + } + } + return result.join(""); + } + exports.applyFromCharCode = arrayLikeToString; + function arrayLikeToArrayLike(arrayFrom, arrayTo) { + for (var i = 0;i < arrayFrom.length;i++) { + arrayTo[i] = arrayFrom[i]; + } + return arrayTo; + } + var transform = {}; + transform["string"] = {"string":identity, "array":function(input) { + return stringToArrayLike(input, new Array(input.length)); + }, "arraybuffer":function(input) { + return transform["string"]["uint8array"](input).buffer; + }, "uint8array":function(input) { + return stringToArrayLike(input, new Uint8Array(input.length)); + }, "nodebuffer":function(input) { + return stringToArrayLike(input, nodeBuffer(input.length)); + }}; + transform["array"] = {"string":arrayLikeToString, "array":identity, "arraybuffer":function(input) { + return (new Uint8Array(input)).buffer; + }, "uint8array":function(input) { + return new Uint8Array(input); + }, "nodebuffer":function(input) { + return nodeBuffer(input); + }}; + transform["arraybuffer"] = {"string":function(input) { + return arrayLikeToString(new Uint8Array(input)); + }, "array":function(input) { + return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength)); + }, "arraybuffer":identity, "uint8array":function(input) { + return new Uint8Array(input); + }, "nodebuffer":function(input) { + return nodeBuffer(new Uint8Array(input)); + }}; + transform["uint8array"] = {"string":arrayLikeToString, "array":function(input) { + return arrayLikeToArrayLike(input, new Array(input.length)); + }, "arraybuffer":function(input) { + return input.buffer; + }, "uint8array":identity, "nodebuffer":function(input) { + return nodeBuffer(input); + }}; + transform["nodebuffer"] = {"string":arrayLikeToString, "array":function(input) { + return arrayLikeToArrayLike(input, new Array(input.length)); + }, "arraybuffer":function(input) { + return transform["nodebuffer"]["uint8array"](input).buffer; + }, "uint8array":function(input) { + return arrayLikeToArrayLike(input, new Uint8Array(input.length)); + }, "nodebuffer":identity}; + exports.transformTo = function(outputType, input) { + if (!input) { + input = ""; + } + if (!outputType) { + return input; + } + exports.checkSupport(outputType); + var inputType = exports.getTypeOf(input); + var result = transform[inputType][outputType](input); + return result; + }; + exports.getTypeOf = function(input) { + if (typeof input === "string") { + return "string"; + } + if (Object.prototype.toString.call(input) === "[object Array]") { + return "array"; + } + if (support.nodebuffer && nodeBuffer.test(input)) { + return "nodebuffer"; + } + if (support.uint8array && input instanceof Uint8Array) { + return "uint8array"; + } + if (support.arraybuffer && input instanceof ArrayBuffer) { + return "arraybuffer"; + } + }; + exports.checkSupport = function(type) { + var supported = support[type.toLowerCase()]; + if (!supported) { + throw new Error(type + " is not supported by this browser"); + } + }; + exports.MAX_VALUE_16BITS = 65535; + exports.MAX_VALUE_32BITS = -1; + exports.pretty = function(str) { + var res = "", code, i; + for (i = 0;i < (str || "").length;i++) { + code = str.charCodeAt(i); + res += "\\x" + (code < 16 ? "0" : "") + code.toString(16).toUpperCase(); + } + return res; + }; + exports.findCompression = function(compressionMethod) { + for (var method in compressions) { + if (!compressions.hasOwnProperty(method)) { + continue; + } + if (compressions[method].magic === compressionMethod) { + return compressions[method]; + } + } + return null; + }; + exports.isRegExp = function(object) { + return Object.prototype.toString.call(object) === "[object RegExp]"; + }; + }, {"./compressions":3, "./nodeBuffer":11, "./support":17}], 22:[function(_dereq_, module, exports) { + var StringReader = _dereq_("./stringReader"); + var NodeBufferReader = _dereq_("./nodeBufferReader"); + var Uint8ArrayReader = _dereq_("./uint8ArrayReader"); + var utils = _dereq_("./utils"); + var sig = _dereq_("./signature"); + var ZipEntry = _dereq_("./zipEntry"); + var support = _dereq_("./support"); + var jszipProto = _dereq_("./object"); + function ZipEntries(data, loadOptions) { + this.files = []; + this.loadOptions = loadOptions; + if (data) { + this.load(data); + } + } + ZipEntries.prototype = {checkSignature:function(expectedSignature) { + var signature = this.reader.readString(4); + if (signature !== expectedSignature) { + throw new Error("Corrupted zip or bug : unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")"); + } + }, readBlockEndOfCentral:function() { + this.diskNumber = this.reader.readInt(2); + this.diskWithCentralDirStart = this.reader.readInt(2); + this.centralDirRecordsOnThisDisk = this.reader.readInt(2); + this.centralDirRecords = this.reader.readInt(2); + this.centralDirSize = this.reader.readInt(4); + this.centralDirOffset = this.reader.readInt(4); + this.zipCommentLength = this.reader.readInt(2); + this.zipComment = this.reader.readString(this.zipCommentLength); + this.zipComment = jszipProto.utf8decode(this.zipComment); + }, readBlockZip64EndOfCentral:function() { + this.zip64EndOfCentralSize = this.reader.readInt(8); + this.versionMadeBy = this.reader.readString(2); + this.versionNeeded = this.reader.readInt(2); + this.diskNumber = this.reader.readInt(4); + this.diskWithCentralDirStart = this.reader.readInt(4); + this.centralDirRecordsOnThisDisk = this.reader.readInt(8); + this.centralDirRecords = this.reader.readInt(8); + this.centralDirSize = this.reader.readInt(8); + this.centralDirOffset = this.reader.readInt(8); + this.zip64ExtensibleData = {}; + var extraDataSize = this.zip64EndOfCentralSize - 44, index = 0, extraFieldId, extraFieldLength, extraFieldValue; + while (index < extraDataSize) { + extraFieldId = this.reader.readInt(2); + extraFieldLength = this.reader.readInt(4); + extraFieldValue = this.reader.readString(extraFieldLength); + this.zip64ExtensibleData[extraFieldId] = {id:extraFieldId, length:extraFieldLength, value:extraFieldValue}; + } + }, readBlockZip64EndOfCentralLocator:function() { + this.diskWithZip64CentralDirStart = this.reader.readInt(4); + this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8); + this.disksCount = this.reader.readInt(4); + if (this.disksCount > 1) { + throw new Error("Multi-volumes zip are not supported"); + } + }, readLocalFiles:function() { + var i, file; + for (i = 0;i < this.files.length;i++) { + file = this.files[i]; + this.reader.setIndex(file.localHeaderOffset); + this.checkSignature(sig.LOCAL_FILE_HEADER); + file.readLocalPart(this.reader); + file.handleUTF8(); + } + }, readCentralDir:function() { + var file; + this.reader.setIndex(this.centralDirOffset); + while (this.reader.readString(4) === sig.CENTRAL_FILE_HEADER) { + file = new ZipEntry({zip64:this.zip64}, this.loadOptions); + file.readCentralPart(this.reader); + this.files.push(file); + } + }, readEndOfCentral:function() { + var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END); + if (offset === -1) { + throw new Error("Corrupted zip : can't find end of central directory"); + } + this.reader.setIndex(offset); + this.checkSignature(sig.CENTRAL_DIRECTORY_END); + this.readBlockEndOfCentral(); + if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) { + this.zip64 = true; + offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); + if (offset === -1) { + throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator"); + } + this.reader.setIndex(offset); + this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); + this.readBlockZip64EndOfCentralLocator(); + this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir); + this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END); + this.readBlockZip64EndOfCentral(); + } + }, prepareReader:function(data) { + var type = utils.getTypeOf(data); + if (type === "string" && !support.uint8array) { + this.reader = new StringReader(data, this.loadOptions.optimizedBinaryString); + } else { + if (type === "nodebuffer") { + this.reader = new NodeBufferReader(data); + } else { + this.reader = new Uint8ArrayReader(utils.transformTo("uint8array", data)); + } + } + }, load:function(data) { + this.prepareReader(data); + this.readEndOfCentral(); + this.readCentralDir(); + this.readLocalFiles(); + }}; + module.exports = ZipEntries; + }, {"./nodeBufferReader":12, "./object":13, "./signature":14, "./stringReader":15, "./support":17, "./uint8ArrayReader":18, "./utils":21, "./zipEntry":23}], 23:[function(_dereq_, module, exports) { + var StringReader = _dereq_("./stringReader"); + var utils = _dereq_("./utils"); + var CompressedObject = _dereq_("./compressedObject"); + var jszipProto = _dereq_("./object"); + function ZipEntry(options, loadOptions) { + this.options = options; + this.loadOptions = loadOptions; + } + ZipEntry.prototype = {isEncrypted:function() { + return (this.bitFlag & 1) === 1; + }, useUTF8:function() { + return (this.bitFlag & 2048) === 2048; + }, prepareCompressedContent:function(reader, from, length) { + return function() { + var previousIndex = reader.index; + reader.setIndex(from); + var compressedFileData = reader.readData(length); + reader.setIndex(previousIndex); + return compressedFileData; + }; + }, prepareContent:function(reader, from, length, compression, uncompressedSize) { + return function() { + var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent()); + var uncompressedFileData = compression.uncompress(compressedFileData); + if (uncompressedFileData.length !== uncompressedSize) { + throw new Error("Bug : uncompressed data size mismatch"); + } + return uncompressedFileData; + }; + }, readLocalPart:function(reader) { + var compression, localExtraFieldsLength; + reader.skip(22); + this.fileNameLength = reader.readInt(2); + localExtraFieldsLength = reader.readInt(2); + this.fileName = reader.readString(this.fileNameLength); + reader.skip(localExtraFieldsLength); + if (this.compressedSize == -1 || this.uncompressedSize == -1) { + throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize == -1 || uncompressedSize == -1)"); + } + compression = utils.findCompression(this.compressionMethod); + if (compression === null) { + throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + this.fileName + ")"); + } + this.decompressed = new CompressedObject; + this.decompressed.compressedSize = this.compressedSize; + this.decompressed.uncompressedSize = this.uncompressedSize; + this.decompressed.crc32 = this.crc32; + this.decompressed.compressionMethod = this.compressionMethod; + this.decompressed.getCompressedContent = this.prepareCompressedContent(reader, reader.index, this.compressedSize, compression); + this.decompressed.getContent = this.prepareContent(reader, reader.index, this.compressedSize, compression, this.uncompressedSize); + if (this.loadOptions.checkCRC32) { + this.decompressed = utils.transformTo("string", this.decompressed.getContent()); + if (jszipProto.crc32(this.decompressed) !== this.crc32) { + throw new Error("Corrupted zip : CRC32 mismatch"); + } + } + }, readCentralPart:function(reader) { + this.versionMadeBy = reader.readString(2); + this.versionNeeded = reader.readInt(2); + this.bitFlag = reader.readInt(2); + this.compressionMethod = reader.readString(2); + this.date = reader.readDate(); + this.crc32 = reader.readInt(4); + this.compressedSize = reader.readInt(4); + this.uncompressedSize = reader.readInt(4); + this.fileNameLength = reader.readInt(2); + this.extraFieldsLength = reader.readInt(2); + this.fileCommentLength = reader.readInt(2); + this.diskNumberStart = reader.readInt(2); + this.internalFileAttributes = reader.readInt(2); + this.externalFileAttributes = reader.readInt(4); + this.localHeaderOffset = reader.readInt(4); + if (this.isEncrypted()) { + throw new Error("Encrypted zip are not supported"); + } + this.fileName = reader.readString(this.fileNameLength); + this.readExtraFields(reader); + this.parseZIP64ExtraField(reader); + this.fileComment = reader.readString(this.fileCommentLength); + this.dir = this.externalFileAttributes & 16 ? true : false; + }, parseZIP64ExtraField:function(reader) { + if (!this.extraFields[1]) { + return; + } + var extraReader = new StringReader(this.extraFields[1].value); + if (this.uncompressedSize === utils.MAX_VALUE_32BITS) { + this.uncompressedSize = extraReader.readInt(8); + } + if (this.compressedSize === utils.MAX_VALUE_32BITS) { + this.compressedSize = extraReader.readInt(8); + } + if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) { + this.localHeaderOffset = extraReader.readInt(8); + } + if (this.diskNumberStart === utils.MAX_VALUE_32BITS) { + this.diskNumberStart = extraReader.readInt(4); + } + }, readExtraFields:function(reader) { + var start = reader.index, extraFieldId, extraFieldLength, extraFieldValue; + this.extraFields = this.extraFields || {}; + while (reader.index < start + this.extraFieldsLength) { + extraFieldId = reader.readInt(2); + extraFieldLength = reader.readInt(2); + extraFieldValue = reader.readString(extraFieldLength); + this.extraFields[extraFieldId] = {id:extraFieldId, length:extraFieldLength, value:extraFieldValue}; + } + }, handleUTF8:function() { + if (this.useUTF8()) { + this.fileName = jszipProto.utf8decode(this.fileName); + this.fileComment = jszipProto.utf8decode(this.fileComment); + } else { + var upath = this.findExtraFieldUnicodePath(); + if (upath !== null) { + this.fileName = upath; + } + var ucomment = this.findExtraFieldUnicodeComment(); + if (ucomment !== null) { + this.fileComment = ucomment; + } + } + }, findExtraFieldUnicodePath:function() { + var upathField = this.extraFields[28789]; + if (upathField) { + var extraReader = new StringReader(upathField.value); + if (extraReader.readInt(1) !== 1) { + return null; + } + if (jszipProto.crc32(this.fileName) !== extraReader.readInt(4)) { + return null; + } + return jszipProto.utf8decode(extraReader.readString(upathField.length - 5)); + } + return null; + }, findExtraFieldUnicodeComment:function() { + var ucommentField = this.extraFields[25461]; + if (ucommentField) { + var extraReader = new StringReader(ucommentField.value); + if (extraReader.readInt(1) !== 1) { + return null; + } + if (jszipProto.crc32(this.fileComment) !== extraReader.readInt(4)) { + return null; + } + return jszipProto.utf8decode(extraReader.readString(ucommentField.length - 5)); + } + return null; + }}; + module.exports = ZipEntry; + }, {"./compressedObject":2, "./object":13, "./stringReader":15, "./utils":21}], 24:[function(_dereq_, module, exports) { + var assign = _dereq_("./lib/utils/common").assign; + var deflate = _dereq_("./lib/deflate"); + var inflate = _dereq_("./lib/inflate"); + var constants = _dereq_("./lib/zlib/constants"); + var pako = {}; + assign(pako, deflate, inflate, constants); + module.exports = pako; + }, {"./lib/deflate":25, "./lib/inflate":26, "./lib/utils/common":27, "./lib/zlib/constants":30}], 25:[function(_dereq_, module, exports) { + var zlib_deflate = _dereq_("./zlib/deflate.js"); + var utils = _dereq_("./utils/common"); + var strings = _dereq_("./utils/strings"); + var msg = _dereq_("./zlib/messages"); + var zstream = _dereq_("./zlib/zstream"); + var Z_NO_FLUSH = 0; + var Z_FINISH = 4; + var Z_OK = 0; + var Z_STREAM_END = 1; + var Z_DEFAULT_COMPRESSION = -1; + var Z_DEFAULT_STRATEGY = 0; + var Z_DEFLATED = 8; + var Deflate = function(options) { + this.options = utils.assign({level:Z_DEFAULT_COMPRESSION, method:Z_DEFLATED, chunkSize:16384, windowBits:15, memLevel:8, strategy:Z_DEFAULT_STRATEGY, to:""}, options || {}); + var opt = this.options; + if (opt.raw && opt.windowBits > 0) { + opt.windowBits = -opt.windowBits; + } else { + if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) { + opt.windowBits += 16; + } + } + this.err = 0; + this.msg = ""; + this.ended = false; + this.chunks = []; + this.strm = new zstream; + this.strm.avail_out = 0; + var status = zlib_deflate.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy); + if (status !== Z_OK) { + throw new Error(msg[status]); + } + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } + }; + Deflate.prototype.push = function(data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + if (this.ended) { + return false; + } + _mode = mode === ~~mode ? mode : mode === true ? Z_FINISH : Z_NO_FLUSH; + if (typeof data === "string") { + strm.input = strings.string2buf(data); + } else { + strm.input = data; + } + strm.next_in = 0; + strm.avail_in = strm.input.length; + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_deflate.deflate(strm, _mode); + if (status !== Z_STREAM_END && status !== Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || strm.avail_in === 0 && _mode === Z_FINISH) { + if (this.options.to === "string") { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); + if (_mode === Z_FINISH) { + status = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === Z_OK; + } + return true; + }; + Deflate.prototype.onData = function(chunk) { + this.chunks.push(chunk); + }; + Deflate.prototype.onEnd = function(status) { + if (status === Z_OK) { + if (this.options.to === "string") { + this.result = this.chunks.join(""); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; + }; + function deflate(input, options) { + var deflator = new Deflate(options); + deflator.push(input, true); + if (deflator.err) { + throw deflator.msg; + } + return deflator.result; + } + function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate(input, options); + } + function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate(input, options); + } + exports.Deflate = Deflate; + exports.deflate = deflate; + exports.deflateRaw = deflateRaw; + exports.gzip = gzip; + }, {"./utils/common":27, "./utils/strings":28, "./zlib/deflate.js":32, "./zlib/messages":37, "./zlib/zstream":39}], 26:[function(_dereq_, module, exports) { + var zlib_inflate = _dereq_("./zlib/inflate.js"); + var utils = _dereq_("./utils/common"); + var strings = _dereq_("./utils/strings"); + var c = _dereq_("./zlib/constants"); + var msg = _dereq_("./zlib/messages"); + var zstream = _dereq_("./zlib/zstream"); + var gzheader = _dereq_("./zlib/gzheader"); + var Inflate = function(options) { + this.options = utils.assign({chunkSize:16384, windowBits:0, to:""}, options || {}); + var opt = this.options; + if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { + opt.windowBits = -15; + } + } + if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) { + opt.windowBits += 32; + } + if (opt.windowBits > 15 && opt.windowBits < 48) { + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + this.err = 0; + this.msg = ""; + this.ended = false; + this.chunks = []; + this.strm = new zstream; + this.strm.avail_out = 0; + var status = zlib_inflate.inflateInit2(this.strm, opt.windowBits); + if (status !== c.Z_OK) { + throw new Error(msg[status]); + } + this.header = new gzheader; + zlib_inflate.inflateGetHeader(this.strm, this.header); + }; + Inflate.prototype.push = function(data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status, _mode; + var next_out_utf8, tail, utf8str; + if (this.ended) { + return false; + } + _mode = mode === ~~mode ? mode : mode === true ? c.Z_FINISH : c.Z_NO_FLUSH; + if (typeof data === "string") { + strm.input = strings.binstring2buf(data); + } else { + strm.input = data; + } + strm.next_in = 0; + strm.avail_in = strm.input.length; + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); + if (status !== c.Z_STREAM_END && status !== c.Z_OK) { + this.onEnd(status); + this.ended = true; + return false; + } + if (strm.next_out) { + if (strm.avail_out === 0 || status === c.Z_STREAM_END || strm.avail_in === 0 && _mode === c.Z_FINISH) { + if (this.options.to === "string") { + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { + utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); + } + this.onData(utf8str); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + } while (strm.avail_in > 0 && status !== c.Z_STREAM_END); + if (status === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + if (_mode === c.Z_FINISH) { + status = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status); + this.ended = true; + return status === c.Z_OK; + } + return true; + }; + Inflate.prototype.onData = function(chunk) { + this.chunks.push(chunk); + }; + Inflate.prototype.onEnd = function(status) { + if (status === c.Z_OK) { + if (this.options.to === "string") { + this.result = this.chunks.join(""); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status; + this.msg = this.strm.msg; + }; + function inflate(input, options) { + var inflator = new Inflate(options); + inflator.push(input, true); + if (inflator.err) { + throw inflator.msg; + } + return inflator.result; + } + function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate(input, options); + } + exports.Inflate = Inflate; + exports.inflate = inflate; + exports.inflateRaw = inflateRaw; + exports.ungzip = inflate; + }, {"./utils/common":27, "./utils/strings":28, "./zlib/constants":30, "./zlib/gzheader":33, "./zlib/inflate.js":35, "./zlib/messages":37, "./zlib/zstream":39}], 27:[function(_dereq_, module, exports) { + var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined"; + exports.assign = function(obj) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { + continue; + } + if (typeof source !== "object") { + throw new TypeError(source + "must be non-object"); + } + for (var p in source) { + if (source.hasOwnProperty(p)) { + obj[p] = source[p]; + } + } + } + return obj; + }; + exports.shrinkBuf = function(buf, size) { + if (buf.length === size) { + return buf; + } + if (buf.subarray) { + return buf.subarray(0, size); + } + buf.length = size; + return buf; + }; + var fnTyped = {arraySet:function(dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs + len), dest_offs); + return; + } + for (var i = 0;i < len;i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, flattenChunks:function(chunks) { + var i, l, len, pos, chunk, result; + len = 0; + for (i = 0, l = chunks.length;i < l;i++) { + len += chunks[i].length; + } + result = new Uint8Array(len); + pos = 0; + for (i = 0, l = chunks.length;i < l;i++) { + chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + return result; + }}; + var fnUntyped = {arraySet:function(dest, src, src_offs, len, dest_offs) { + for (var i = 0;i < len;i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, flattenChunks:function(chunks) { + return [].concat.apply([], chunks); + }}; + exports.setTyped = function(on) { + if (on) { + exports.Buf8 = Uint8Array; + exports.Buf16 = Uint16Array; + exports.Buf32 = Int32Array; + exports.assign(exports, fnTyped); + } else { + exports.Buf8 = Array; + exports.Buf16 = Array; + exports.Buf32 = Array; + exports.assign(exports, fnUntyped); + } + }; + exports.setTyped(TYPED_OK); + }, {}], 28:[function(_dereq_, module, exports) { + var utils = _dereq_("./common"); + var STR_APPLY_OK = true; + var STR_APPLY_UIA_OK = true; + try { + String.fromCharCode.apply(null, [0]); + } catch (__) { + STR_APPLY_OK = false; + } + try { + String.fromCharCode.apply(null, new Uint8Array(1)); + } catch (__) { + STR_APPLY_UIA_OK = false; + } + var _utf8len = new utils.Buf8(256); + for (var i = 0;i < 256;i++) { + _utf8len[i] = i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1; + } + _utf8len[254] = _utf8len[254] = 1; + exports.string2buf = function(str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + for (m_pos = 0;m_pos < str_len;m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 64512) === 55296 && m_pos + 1 < str_len) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 64512) === 56320) { + c = 65536 + (c - 55296 << 10) + (c2 - 56320); + m_pos++; + } + } + buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4; + } + buf = new utils.Buf8(buf_len); + for (i = 0, m_pos = 0;i < buf_len;m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 64512) === 55296 && m_pos + 1 < str_len) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 64512) === 56320) { + c = 65536 + (c - 55296 << 10) + (c2 - 56320); + m_pos++; + } + } + if (c < 128) { + buf[i++] = c; + } else { + if (c < 2048) { + buf[i++] = 192 | c >>> 6; + buf[i++] = 128 | c & 63; + } else { + if (c < 65536) { + buf[i++] = 224 | c >>> 12; + buf[i++] = 128 | c >>> 6 & 63; + buf[i++] = 128 | c & 63; + } else { + buf[i++] = 240 | c >>> 18; + buf[i++] = 128 | c >>> 12 & 63; + buf[i++] = 128 | c >>> 6 & 63; + buf[i++] = 128 | c & 63; + } + } + } + } + return buf; + }; + function buf2binstring(buf, len) { + if (len < 65537) { + if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + var result = ""; + for (var i = 0;i < len;i++) { + result += String.fromCharCode(buf[i]); + } + return result; + } + exports.buf2binstring = function(buf) { + return buf2binstring(buf, buf.length); + }; + exports.binstring2buf = function(str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length;i < len;i++) { + buf[i] = str.charCodeAt(i); + } + return buf; + }; + exports.buf2string = function(buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + var utf16buf = new Array(len * 2); + for (out = 0, i = 0;i < len;) { + c = buf[i++]; + if (c < 128) { + utf16buf[out++] = c; + continue; + } + c_len = _utf8len[c]; + if (c_len > 4) { + utf16buf[out++] = 65533; + i += c_len - 1; + continue; + } + c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; + while (c_len > 1 && i < len) { + c = c << 6 | buf[i++] & 63; + c_len--; + } + if (c_len > 1) { + utf16buf[out++] = 65533; + continue; + } + if (c < 65536) { + utf16buf[out++] = c; + } else { + c -= 65536; + utf16buf[out++] = 55296 | c >> 10 & 1023; + utf16buf[out++] = 56320 | c & 1023; + } + } + return buf2binstring(utf16buf, out); + }; + exports.utf8border = function(buf, max) { + var pos; + max = max || buf.length; + if (max > buf.length) { + max = buf.length; + } + pos = max - 1; + while (pos >= 0 && (buf[pos] & 192) === 128) { + pos--; + } + if (pos < 0) { + return max; + } + if (pos === 0) { + return max; + } + return pos + _utf8len[buf[pos]] > max ? pos : max; + }; + }, {"./common":27}], 29:[function(_dereq_, module, exports) { + function adler32(adler, buf, len, pos) { + var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0; + while (len !== 0) { + n = len > 2E3 ? 2E3 : len; + len -= n; + do { + s1 = s1 + buf[pos++] | 0; + s2 = s2 + s1 | 0; + } while (--n); + s1 %= 65521; + s2 %= 65521; + } + return s1 | s2 << 16 | 0; + } + module.exports = adler32; + }, {}], 30:[function(_dereq_, module, exports) { + module.exports = {Z_NO_FLUSH:0, Z_PARTIAL_FLUSH:1, Z_SYNC_FLUSH:2, Z_FULL_FLUSH:3, Z_FINISH:4, Z_BLOCK:5, Z_TREES:6, Z_OK:0, Z_STREAM_END:1, Z_NEED_DICT:2, Z_ERRNO:-1, Z_STREAM_ERROR:-2, Z_DATA_ERROR:-3, Z_BUF_ERROR:-5, Z_NO_COMPRESSION:0, Z_BEST_SPEED:1, Z_BEST_COMPRESSION:9, Z_DEFAULT_COMPRESSION:-1, Z_FILTERED:1, Z_HUFFMAN_ONLY:2, Z_RLE:3, Z_FIXED:4, Z_DEFAULT_STRATEGY:0, Z_BINARY:0, Z_TEXT:1, Z_UNKNOWN:2, Z_DEFLATED:8}; + }, {}], 31:[function(_dereq_, module, exports) { + function makeTable() { + var c, table = []; + for (var n = 0;n < 256;n++) { + c = n; + for (var k = 0;k < 8;k++) { + c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1; + } + table[n] = c; + } + return table; + } + var crcTable = makeTable(); + function crc32(crc, buf, len, pos) { + var t = crcTable, end = pos + len; + crc = crc ^ -1; + for (var i = pos;i < end;i++) { + crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255]; + } + return crc ^ -1; + } + module.exports = crc32; + }, {}], 32:[function(_dereq_, module, exports) { + var utils = _dereq_("../utils/common"); + var trees = _dereq_("./trees"); + var adler32 = _dereq_("./adler32"); + var crc32 = _dereq_("./crc32"); + var msg = _dereq_("./messages"); + var Z_NO_FLUSH = 0; + var Z_PARTIAL_FLUSH = 1; + var Z_FULL_FLUSH = 3; + var Z_FINISH = 4; + var Z_BLOCK = 5; + var Z_OK = 0; + var Z_STREAM_END = 1; + var Z_STREAM_ERROR = -2; + var Z_DATA_ERROR = -3; + var Z_BUF_ERROR = -5; + var Z_DEFAULT_COMPRESSION = -1; + var Z_FILTERED = 1; + var Z_HUFFMAN_ONLY = 2; + var Z_RLE = 3; + var Z_FIXED = 4; + var Z_DEFAULT_STRATEGY = 0; + var Z_UNKNOWN = 2; + var Z_DEFLATED = 8; + var MAX_MEM_LEVEL = 9; + var MAX_WBITS = 15; + var DEF_MEM_LEVEL = 8; + var LENGTH_CODES = 29; + var LITERALS = 256; + var L_CODES = LITERALS + 1 + LENGTH_CODES; + var D_CODES = 30; + var BL_CODES = 19; + var HEAP_SIZE = 2 * L_CODES + 1; + var MAX_BITS = 15; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; + var PRESET_DICT = 32; + var INIT_STATE = 42; + var EXTRA_STATE = 69; + var NAME_STATE = 73; + var COMMENT_STATE = 91; + var HCRC_STATE = 103; + var BUSY_STATE = 113; + var FINISH_STATE = 666; + var BS_NEED_MORE = 1; + var BS_BLOCK_DONE = 2; + var BS_FINISH_STARTED = 3; + var BS_FINISH_DONE = 4; + var OS_CODE = 3; + function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; + } + function rank(f) { + return (f << 1) - (f > 4 ? 9 : 0); + } + function zero(buf) { + var len = buf.length; + while (--len >= 0) { + buf[len] = 0; + } + } + function flush_pending(strm) { + var s = strm.state; + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { + return; + } + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } + } + function flush_block_only(s, last) { + trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last); + s.block_start = s.strstart; + flush_pending(s.strm); + } + function put_byte(s, b) { + s.pending_buf[s.pending++] = b; + } + function putShortMSB(s, b) { + s.pending_buf[s.pending++] = b >>> 8 & 255; + s.pending_buf[s.pending++] = b & 255; + } + function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + if (len > size) { + len = size; + } + if (len === 0) { + return 0; + } + strm.avail_in -= len; + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } else { + if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + } + strm.next_in += len; + strm.total_in += len; + return len; + } + function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; + var scan = s.strstart; + var match; + var len; + var best_len = s.prev_length; + var nice_match = s.nice_match; + var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0; + var _win = s.window; + var wmask = s.w_mask; + var prev = s.prev; + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + if (nice_match > s.lookahead) { + nice_match = s.lookahead; + } + do { + match = cur_match; + if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { + continue; + } + scan += 2; + match++; + do { + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; + } + function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + do { + more = s.window_size - s.lookahead - s.strstart; + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + s.block_start -= _w_size; + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = m >= _w_size ? m - _w_size : 0; + } while (--n); + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = m >= _w_size ? m - _w_size : 0; + } while (--n); + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; + while (s.insert) { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + } + function deflate_stored(s, flush) { + var max_block_size = 65535; + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + for (;;) { + if (s.lookahead <= 1) { + fill_window(s); + if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + s.strstart += s.lookahead; + s.lookahead = 0; + var max_start = s.block_start + max_block_size; + if (s.strstart === 0 || s.strstart >= max_start) { + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = 0; + if (flush === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.strstart > s.block_start) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_NEED_MORE; + } + function deflate_fast(s, flush) { + var hash_head; + var bflush; + for (;;) { + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + hash_head = 0; + if (s.lookahead >= MIN_MATCH) { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { + s.match_length = longest_match(s, hash_head); + } + if (s.match_length >= MIN_MATCH) { + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + s.lookahead -= s.match_length; + if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) { + s.match_length--; + do { + s.strstart++; + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } while (--s.match_length !== 0); + s.strstart++; + } else { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; + } + } else { + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + } + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.last_lit) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_slow(s, flush) { + var hash_head; + var bflush; + var max_insert; + for (;;) { + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + hash_head = 0; + if (s.lookahead >= MIN_MATCH) { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { + s.match_length = longest_match(s, hash_head); + if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) { + s.match_length = MIN_MATCH - 1; + } + } + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } else { + if (s.match_available) { + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + if (bflush) { + flush_block_only(s, false); + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + } + if (s.match_available) { + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.last_lit) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_rle(s, flush) { + var bflush; + var prev; + var scan, strend; + var _win = s.window; + for (;;) { + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + } + if (s.match_length >= MIN_MATCH) { + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + } + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = 0; + if (flush === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.last_lit) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_huff(s, flush) { + var bflush; + for (;;) { + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; + } + } + s.match_length = 0; + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = 0; + if (flush === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.last_lit) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + var Config = function(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; + }; + var configuration_table; + configuration_table = [new Config(0, 0, 0, 0, deflate_stored), new Config(4, 4, 8, 4, deflate_fast), new Config(4, 5, 16, 8, deflate_fast), new Config(4, 6, 32, 32, deflate_fast), new Config(4, 4, 16, 16, deflate_slow), new Config(8, 16, 32, 32, deflate_slow), new Config(8, 16, 128, 128, deflate_slow), new Config(8, 32, 128, 256, deflate_slow), new Config(32, 128, 258, 1024, deflate_slow), new Config(32, 258, 258, 4096, deflate_slow)]; + function lm_init(s) { + s.window_size = 2 * s.w_size; + zero(s.head); + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; + } + function DeflateState() { + this.strm = null; + this.status = 0; + this.pending_buf = null; + this.pending_buf_size = 0; + this.pending_out = 0; + this.pending = 0; + this.wrap = 0; + this.gzhead = null; + this.gzindex = 0; + this.method = Z_DEFLATED; + this.last_flush = -1; + this.w_size = 0; + this.w_bits = 0; + this.w_mask = 0; + this.window = null; + this.window_size = 0; + this.prev = null; + this.head = null; + this.ins_h = 0; + this.hash_size = 0; + this.hash_bits = 0; + this.hash_mask = 0; + this.hash_shift = 0; + this.block_start = 0; + this.match_length = 0; + this.prev_match = 0; + this.match_available = 0; + this.strstart = 0; + this.match_start = 0; + this.lookahead = 0; + this.prev_length = 0; + this.max_chain_length = 0; + this.max_lazy_match = 0; + this.level = 0; + this.strategy = 0; + this.good_match = 0; + this.nice_match = 0; + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + this.l_desc = null; + this.d_desc = null; + this.bl_desc = null; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + this.heap = new utils.Buf16(2 * L_CODES + 1); + zero(this.heap); + this.heap_len = 0; + this.heap_max = 0; + this.depth = new utils.Buf16(2 * L_CODES + 1); + zero(this.depth); + this.l_buf = 0; + this.lit_bufsize = 0; + this.last_lit = 0; + this.d_buf = 0; + this.opt_len = 0; + this.static_len = 0; + this.matches = 0; + this.insert = 0; + this.bi_buf = 0; + this.bi_valid = 0; + } + function deflateResetKeep(strm) { + var s; + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + s = strm.state; + s.pending = 0; + s.pending_out = 0; + if (s.wrap < 0) { + s.wrap = -s.wrap; + } + s.status = s.wrap ? INIT_STATE : BUSY_STATE; + strm.adler = s.wrap === 2 ? 0 : 1; + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; + } + function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; + } + function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + if (strm.state.wrap !== 2) { + return Z_STREAM_ERROR; + } + strm.state.gzhead = head; + return Z_OK; + } + function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { + return Z_STREAM_ERROR; + } + var wrap = 1; + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } else { + if (windowBits > 15) { + wrap = 2; + windowBits -= 16; + } + } + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + if (windowBits === 8) { + windowBits = 9; + } + var s = new DeflateState; + strm.state = s; + s.strm = strm; + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + s.lit_bufsize = 1 << memLevel + 6; + s.pending_buf_size = s.lit_bufsize * 4; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + s.d_buf = s.lit_bufsize >> 1; + s.l_buf = (1 + 2) * s.lit_bufsize; + s.level = level; + s.strategy = strategy; + s.method = method; + return deflateReset(strm); + } + function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + } + function deflate(strm, flush) { + var old_flush, s; + var beg, val; + if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + s = strm.state; + if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) { + return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + s.strm = strm; + old_flush = s.last_flush; + s.last_flush = flush; + if (s.status === INIT_STATE) { + if (s.wrap === 2) { + strm.adler = 0; + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } else { + put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16)); + put_byte(s, s.gzhead.time & 255); + put_byte(s, s.gzhead.time >> 8 & 255); + put_byte(s, s.gzhead.time >> 16 & 255); + put_byte(s, s.gzhead.time >> 24 & 255); + put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); + put_byte(s, s.gzhead.os & 255); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 255); + put_byte(s, s.gzhead.extra.length >> 8 & 255); + } + if (s.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } else { + var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8; + var level_flags = -1; + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else { + if (s.level < 6) { + level_flags = 1; + } else { + if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + } + } + header |= level_flags << 6; + if (s.strstart !== 0) { + header |= PRESET_DICT; + } + header += 31 - header % 31; + s.status = BUSY_STATE; + putShortMSB(s, header); + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 65535); + } + strm.adler = 1; + } + } + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra) { + beg = s.pending; + while (s.gzindex < (s.gzhead.extra.length & 65535)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 255); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name) { + beg = s.pending; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 255; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment) { + beg = s.pending; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 255); + put_byte(s, strm.adler >> 8 & 255); + strm.adler = 0; + s.status = BUSY_STATE; + } + } else { + s.status = BUSY_STATE; + } + } + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; + return Z_OK; + } + } else { + if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + } + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) { + var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush); + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + } + return Z_OK; + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } else { + if (flush !== Z_BLOCK) { + trees._tr_stored_block(s, 0, 0, false); + if (flush === Z_FULL_FLUSH) { + zero(s.head); + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; + return Z_OK; + } + } + } + if (flush !== Z_FINISH) { + return Z_OK; + } + if (s.wrap <= 0) { + return Z_STREAM_END; + } + if (s.wrap === 2) { + put_byte(s, strm.adler & 255); + put_byte(s, strm.adler >> 8 & 255); + put_byte(s, strm.adler >> 16 & 255); + put_byte(s, strm.adler >> 24 & 255); + put_byte(s, strm.total_in & 255); + put_byte(s, strm.total_in >> 8 & 255); + put_byte(s, strm.total_in >> 16 & 255); + put_byte(s, strm.total_in >> 24 & 255); + } else { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 65535); + } + flush_pending(strm); + if (s.wrap > 0) { + s.wrap = -s.wrap; + } + return s.pending !== 0 ? Z_OK : Z_STREAM_END; + } + function deflateEnd(strm) { + var status; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + status = strm.state.status; + if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) { + return err(strm, Z_STREAM_ERROR); + } + strm.state = null; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + } + exports.deflateInit = deflateInit; + exports.deflateInit2 = deflateInit2; + exports.deflateReset = deflateReset; + exports.deflateResetKeep = deflateResetKeep; + exports.deflateSetHeader = deflateSetHeader; + exports.deflate = deflate; + exports.deflateEnd = deflateEnd; + exports.deflateInfo = "pako deflate (from Nodeca project)"; + }, {"../utils/common":27, "./adler32":29, "./crc32":31, "./messages":37, "./trees":38}], 33:[function(_dereq_, module, exports) { + function GZheader() { + this.text = 0; + this.time = 0; + this.xflags = 0; + this.os = 0; + this.extra = null; + this.extra_len = 0; + this.name = ""; + this.comment = ""; + this.hcrc = 0; + this.done = false; + } + module.exports = GZheader; + }, {}], 34:[function(_dereq_, module, exports) { + var BAD = 30; + var TYPE = 12; + module.exports = function inflate_fast(strm, start) { + var state; + var _in; + var last; + var _out; + var beg; + var end; + var dmax; + var wsize; + var whave; + var wnext; + var window; + var hold; + var bits; + var lcode; + var dcode; + var lmask; + var dmask; + var here; + var op; + var len; + var dist; + var from; + var from_source; + var input, output; + state = strm.state; + _in = strm.next_in; + input = strm.input; + last = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); + dmax = state.dmax; + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + top: do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = lcode[hold & lmask]; + dolen: for (;;) { + op = here >>> 24; + hold >>>= op; + bits -= op; + op = here >>> 16 & 255; + if (op === 0) { + output[_out++] = here & 65535; + } else { + if (op & 16) { + len = here & 65535; + op &= 15; + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & (1 << op) - 1; + hold >>>= op; + bits -= op; + } + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + dodist: for (;;) { + op = here >>> 24; + hold >>>= op; + bits -= op; + op = here >>> 16 & 255; + if (op & 16) { + dist = here & 65535; + op &= 15; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & (1 << op) - 1; + if (dist > dmax) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break top; + } + hold >>>= op; + bits -= op; + op = _out - beg; + if (dist > op) { + op = dist - op; + if (op > whave) { + if (state.sane) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break top; + } + } + from = 0; + from_source = window; + if (wnext === 0) { + from += wsize - op; + if (op < len) { + len -= op; + do { + output[_out++] = window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } else { + if (wnext < op) { + from += wsize + wnext - op; + op -= wnext; + if (op < len) { + len -= op; + do { + output[_out++] = window[from++]; + } while (--op); + from = 0; + if (wnext < len) { + op = wnext; + len -= op; + do { + output[_out++] = window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } + } else { + from += wnext - op; + if (op < len) { + len -= op; + do { + output[_out++] = window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } else { + from = _out - dist; + do { + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } else { + if ((op & 64) === 0) { + here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; + continue dodist; + } else { + strm.msg = "invalid distance code"; + state.mode = BAD; + break top; + } + } + break; + } + } else { + if ((op & 64) === 0) { + here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; + continue dolen; + } else { + if (op & 32) { + state.mode = TYPE; + break top; + } else { + strm.msg = "invalid literal/length code"; + state.mode = BAD; + break top; + } + } + } + } + break; + } + } while (_in < last && _out < end); + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last); + strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); + state.hold = hold; + state.bits = bits; + return; + }; + }, {}], 35:[function(_dereq_, module, exports) { + var utils = _dereq_("../utils/common"); + var adler32 = _dereq_("./adler32"); + var crc32 = _dereq_("./crc32"); + var inflate_fast = _dereq_("./inffast"); + var inflate_table = _dereq_("./inftrees"); + var CODES = 0; + var LENS = 1; + var DISTS = 2; + var Z_FINISH = 4; + var Z_BLOCK = 5; + var Z_TREES = 6; + var Z_OK = 0; + var Z_STREAM_END = 1; + var Z_NEED_DICT = 2; + var Z_STREAM_ERROR = -2; + var Z_DATA_ERROR = -3; + var Z_MEM_ERROR = -4; + var Z_BUF_ERROR = -5; + var Z_DEFLATED = 8; + var HEAD = 1; + var FLAGS = 2; + var TIME = 3; + var OS = 4; + var EXLEN = 5; + var EXTRA = 6; + var NAME = 7; + var COMMENT = 8; + var HCRC = 9; + var DICTID = 10; + var DICT = 11; + var TYPE = 12; + var TYPEDO = 13; + var STORED = 14; + var COPY_ = 15; + var COPY = 16; + var TABLE = 17; + var LENLENS = 18; + var CODELENS = 19; + var LEN_ = 20; + var LEN = 21; + var LENEXT = 22; + var DIST = 23; + var DISTEXT = 24; + var MATCH = 25; + var LIT = 26; + var CHECK = 27; + var LENGTH = 28; + var DONE = 29; + var BAD = 30; + var MEM = 31; + var SYNC = 32; + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + var MAX_WBITS = 15; + var DEF_WBITS = MAX_WBITS; + function ZSWAP32(q) { + return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24); + } + function InflateState() { + this.mode = 0; + this.last = false; + this.wrap = 0; + this.havedict = false; + this.flags = 0; + this.dmax = 0; + this.check = 0; + this.total = 0; + this.head = null; + this.wbits = 0; + this.wsize = 0; + this.whave = 0; + this.wnext = 0; + this.window = null; + this.hold = 0; + this.bits = 0; + this.length = 0; + this.offset = 0; + this.extra = 0; + this.lencode = null; + this.distcode = null; + this.lenbits = 0; + this.distbits = 0; + this.ncode = 0; + this.nlen = 0; + this.ndist = 0; + this.have = 0; + this.next = null; + this.lens = new utils.Buf16(320); + this.work = new utils.Buf16(288); + this.lendyn = null; + this.distdyn = null; + this.sane = 0; + this.back = 0; + this.was = 0; + } + function inflateResetKeep(strm) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ""; + if (state.wrap) { + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null; + state.hold = 0; + state.bits = 0; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + state.sane = 1; + state.back = -1; + return Z_OK; + } + function inflateReset(strm) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + } + function inflateReset2(strm, windowBits) { + var wrap; + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); + } + function inflateInit2(strm, windowBits) { + var ret; + var state; + if (!strm) { + return Z_STREAM_ERROR; + } + state = new InflateState; + strm.state = state; + state.window = null; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null; + } + return ret; + } + function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); + } + var virgin = true; + var lenfix, distfix; + function fixedtables(state) { + if (virgin) { + var sym; + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + sym = 0; + while (sym < 144) { + state.lens[sym++] = 8; + } + while (sym < 256) { + state.lens[sym++] = 9; + } + while (sym < 280) { + state.lens[sym++] = 7; + } + while (sym < 288) { + state.lens[sym++] = 8; + } + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {bits:9}); + sym = 0; + while (sym < 32) { + state.lens[sym++] = 5; + } + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {bits:5}); + virgin = false; + } + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; + } + function updatewindow(strm, src, end, copy) { + var dist; + var state = strm.state; + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + state.window = new utils.Buf8(state.wsize); + } + if (copy >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } else { + dist = state.wsize - state.wnext; + if (dist > copy) { + dist = copy; + } + utils.arraySet(state.window, src, end - copy, dist, state.wnext); + copy -= dist; + if (copy) { + utils.arraySet(state.window, src, end - copy, copy, 0); + state.wnext = copy; + state.whave = state.wsize; + } else { + state.wnext += dist; + if (state.wnext === state.wsize) { + state.wnext = 0; + } + if (state.whave < state.wsize) { + state.whave += dist; + } + } + } + return 0; + } + function inflate(strm, flush) { + var state; + var input, output; + var next; + var put; + var have, left; + var hold; + var bits; + var _in, _out; + var copy; + var from; + var from_source; + var here = 0; + var here_bits, here_op, here_val; + var last_bits, last_op, last_val; + var len; + var ret; + var hbuf = new utils.Buf8(4); + var opts; + var n; + var order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { + return Z_STREAM_ERROR; + } + state = strm.state; + if (state.mode === TYPE) { + state.mode = TYPEDO; + } + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + _in = have; + _out = left; + ret = Z_OK; + inf_leave: for (;;) { + switch(state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.wrap & 2 && hold === 35615) { + state.check = 0; + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32(state.check, hbuf, 2, 0); + hold = 0; + bits = 0; + state.mode = FLAGS; + break; + } + state.flags = 0; + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) { + strm.msg = "incorrect header check"; + state.mode = BAD; + break; + } + if ((hold & 15) !== Z_DEFLATED) { + strm.msg = "unknown compression method"; + state.mode = BAD; + break; + } + hold >>>= 4; + bits -= 4; + len = (hold & 15) + 8; + if (state.wbits === 0) { + state.wbits = len; + } else { + if (len > state.wbits) { + strm.msg = "invalid window size"; + state.mode = BAD; + break; + } + } + state.dmax = 1 << len; + strm.adler = state.check = 1; + state.mode = hold & 512 ? DICTID : TYPE; + hold = 0; + bits = 0; + break; + case FLAGS: + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.flags = hold; + if ((state.flags & 255) !== Z_DEFLATED) { + strm.msg = "unknown compression method"; + state.mode = BAD; + break; + } + if (state.flags & 57344) { + strm.msg = "unknown header flags set"; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = hold >> 8 & 1; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + state.mode = TIME; + case TIME: + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.head) { + state.head.time = hold; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + hbuf[2] = hold >>> 16 & 255; + hbuf[3] = hold >>> 24 & 255; + state.check = crc32(state.check, hbuf, 4, 0); + } + hold = 0; + bits = 0; + state.mode = OS; + case OS: + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.head) { + state.head.xflags = hold & 255; + state.head.os = hold >> 8; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + state.mode = EXLEN; + case EXLEN: + if (state.flags & 1024) { + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + } else { + if (state.head) { + state.head.extra = null; + } + } + state.mode = EXTRA; + case EXTRA: + if (state.flags & 1024) { + copy = state.length; + if (copy > have) { + copy = have; + } + if (copy) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet(state.head.extra, input, next, copy, len); + } + if (state.flags & 512) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + state.length -= copy; + } + if (state.length) { + break inf_leave; + } + } + state.length = 0; + state.mode = NAME; + case NAME: + if (state.flags & 2048) { + if (have === 0) { + break inf_leave; + } + copy = 0; + do { + len = input[next + copy++]; + if (state.head && len && state.length < 65536) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 512) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { + break inf_leave; + } + } else { + if (state.head) { + state.head.name = null; + } + } + state.length = 0; + state.mode = COMMENT; + case COMMENT: + if (state.flags & 4096) { + if (have === 0) { + break inf_leave; + } + copy = 0; + do { + len = input[next + copy++]; + if (state.head && len && state.length < 65536) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy < have); + if (state.flags & 512) { + state.check = crc32(state.check, input, copy, next); + } + have -= copy; + next += copy; + if (len) { + break inf_leave; + } + } else { + if (state.head) { + state.head.comment = null; + } + } + state.mode = HCRC; + case HCRC: + if (state.flags & 512) { + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (hold !== (state.check & 65535)) { + strm.msg = "header crc mismatch"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + if (state.head) { + state.head.hcrc = state.flags >> 9 & 1; + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + strm.adler = state.check = ZSWAP32(hold); + hold = 0; + bits = 0; + state.mode = DICT; + case DICT: + if (state.havedict === 0) { + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + return Z_NEED_DICT; + } + strm.adler = state.check = 1; + state.mode = TYPE; + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { + break inf_leave; + } + ; + case TYPEDO: + if (state.last) { + hold >>>= bits & 7; + bits -= bits & 7; + state.mode = CHECK; + break; + } + while (bits < 3) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.last = hold & 1; + hold >>>= 1; + bits -= 1; + switch(hold & 3) { + case 0: + state.mode = STORED; + break; + case 1: + fixedtables(state); + state.mode = LEN_; + if (flush === Z_TREES) { + hold >>>= 2; + bits -= 2; + break inf_leave; + } + break; + case 2: + state.mode = TABLE; + break; + case 3: + strm.msg = "invalid block type"; + state.mode = BAD; + } + hold >>>= 2; + bits -= 2; + break; + case STORED: + hold >>>= bits & 7; + bits -= bits & 7; + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { + strm.msg = "invalid stored block lengths"; + state.mode = BAD; + break; + } + state.length = hold & 65535; + hold = 0; + bits = 0; + state.mode = COPY_; + if (flush === Z_TREES) { + break inf_leave; + } + ; + case COPY_: + state.mode = COPY; + case COPY: + copy = state.length; + if (copy) { + if (copy > have) { + copy = have; + } + if (copy > left) { + copy = left; + } + if (copy === 0) { + break inf_leave; + } + utils.arraySet(output, input, next, copy, put); + have -= copy; + next += copy; + left -= copy; + put += copy; + state.length -= copy; + break; + } + state.mode = TYPE; + break; + case TABLE: + while (bits < 14) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.nlen = (hold & 31) + 257; + hold >>>= 5; + bits -= 5; + state.ndist = (hold & 31) + 1; + hold >>>= 5; + bits -= 5; + state.ncode = (hold & 15) + 4; + hold >>>= 4; + bits -= 4; + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = "too many length or distance symbols"; + state.mode = BAD; + break; + } + state.have = 0; + state.mode = LENLENS; + case LENLENS: + while (state.have < state.ncode) { + while (bits < 3) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.lens[order[state.have++]] = hold & 7; + hold >>>= 3; + bits -= 3; + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + state.lencode = state.lendyn; + state.lenbits = 7; + opts = {bits:state.lenbits}; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + if (ret) { + strm.msg = "invalid code lengths set"; + state.mode = BAD; + break; + } + state.have = 0; + state.mode = CODELENS; + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (;;) { + here = state.lencode[hold & (1 << state.lenbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (here_val < 16) { + hold >>>= here_bits; + bits -= here_bits; + state.lens[state.have++] = here_val; + } else { + if (here_val === 16) { + n = here_bits + 2; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + if (state.have === 0) { + strm.msg = "invalid bit length repeat"; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy = 3 + (hold & 3); + hold >>>= 2; + bits -= 2; + } else { + if (here_val === 17) { + n = here_bits + 3; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + len = 0; + copy = 3 + (hold & 7); + hold >>>= 3; + bits -= 3; + } else { + n = here_bits + 7; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + len = 0; + copy = 11 + (hold & 127); + hold >>>= 7; + bits -= 7; + } + } + if (state.have + copy > state.nlen + state.ndist) { + strm.msg = "invalid bit length repeat"; + state.mode = BAD; + break; + } + while (copy--) { + state.lens[state.have++] = len; + } + } + } + if (state.mode === BAD) { + break; + } + if (state.lens[256] === 0) { + strm.msg = "invalid code -- missing end-of-block"; + state.mode = BAD; + break; + } + state.lenbits = 9; + opts = {bits:state.lenbits}; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + if (ret) { + strm.msg = "invalid literal/lengths set"; + state.mode = BAD; + break; + } + state.distbits = 6; + state.distcode = state.distdyn; + opts = {bits:state.distbits}; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + state.distbits = opts.bits; + if (ret) { + strm.msg = "invalid distances set"; + state.mode = BAD; + break; + } + state.mode = LEN_; + if (flush === Z_TREES) { + break inf_leave; + } + ; + case LEN_: + state.mode = LEN; + case LEN: + if (have >= 6 && left >= 258) { + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + inflate_fast(strm, _out); + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (;;) { + here = state.lencode[hold & (1 << state.lenbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (here_op && (here_op & 240) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (last_bits + here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= last_bits; + bits -= last_bits; + state.back += last_bits; + } + hold >>>= here_bits; + bits -= here_bits; + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + state.mode = LIT; + break; + } + if (here_op & 32) { + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = "invalid literal/length code"; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + case LENEXT: + if (state.extra) { + n = state.extra; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.length += hold & (1 << state.extra) - 1; + hold >>>= state.extra; + bits -= state.extra; + state.back += state.extra; + } + state.was = state.length; + state.mode = DIST; + case DIST: + for (;;) { + here = state.distcode[hold & (1 << state.distbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if ((here_op & 240) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (;;) { + here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (last_bits + here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= last_bits; + bits -= last_bits; + state.back += last_bits; + } + hold >>>= here_bits; + bits -= here_bits; + state.back += here_bits; + if (here_op & 64) { + strm.msg = "invalid distance code"; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = here_op & 15; + state.mode = DISTEXT; + case DISTEXT: + if (state.extra) { + n = state.extra; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.offset += hold & (1 << state.extra) - 1; + hold >>>= state.extra; + bits -= state.extra; + state.back += state.extra; + } + if (state.offset > state.dmax) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break; + } + state.mode = MATCH; + case MATCH: + if (left === 0) { + break inf_leave; + } + copy = _out - left; + if (state.offset > copy) { + copy = state.offset - copy; + if (copy > state.whave) { + if (state.sane) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break; + } + } + if (copy > state.wnext) { + copy -= state.wnext; + from = state.wsize - copy; + } else { + from = state.wnext - copy; + } + if (copy > state.length) { + copy = state.length; + } + from_source = state.window; + } else { + from_source = output; + from = put - state.offset; + copy = state.length; + } + if (copy > left) { + copy = left; + } + left -= copy; + state.length -= copy; + do { + output[put++] = from_source[from++]; + } while (--copy); + if (state.length === 0) { + state.mode = LEN; + } + break; + case LIT: + if (left === 0) { + break inf_leave; + } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold |= input[next++] << bits; + bits += 8; + } + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out); + } + _out = left; + if ((state.flags ? hold : ZSWAP32(hold)) !== state.check) { + strm.msg = "incorrect data check"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + state.mode = LENGTH; + case LENGTH: + if (state.wrap && state.flags) { + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (hold !== (state.total & 4294967295)) { + strm.msg = "incorrect length check"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + state.mode = DONE; + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + ; + default: + return Z_STREAM_ERROR; + } + } + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; + } + function inflateEnd(strm) { + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; + } + function inflateGetHeader(strm, head) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + if ((state.wrap & 2) === 0) { + return Z_STREAM_ERROR; + } + state.head = head; + head.done = false; + return Z_OK; + } + exports.inflateReset = inflateReset; + exports.inflateReset2 = inflateReset2; + exports.inflateResetKeep = inflateResetKeep; + exports.inflateInit = inflateInit; + exports.inflateInit2 = inflateInit2; + exports.inflate = inflate; + exports.inflateEnd = inflateEnd; + exports.inflateGetHeader = inflateGetHeader; + exports.inflateInfo = "pako inflate (from Nodeca project)"; + }, {"../utils/common":27, "./adler32":29, "./crc32":31, "./inffast":34, "./inftrees":36}], 36:[function(_dereq_, module, exports) { + var utils = _dereq_("../utils/common"); + var MAXBITS = 15; + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + var CODES = 0; + var LENS = 1; + var DISTS = 2; + var lbase = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0]; + var lext = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78]; + var dbase = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0]; + var dext = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]; + module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) { + var bits = opts.bits; + var len = 0; + var sym = 0; + var min = 0, max = 0; + var root = 0; + var curr = 0; + var drop = 0; + var left = 0; + var used = 0; + var huff = 0; + var incr; + var fill; + var low; + var mask; + var next; + var base = null; + var base_index = 0; + var end; + var count = new utils.Buf16(MAXBITS + 1); + var offs = new utils.Buf16(MAXBITS + 1); + var extra = null; + var extra_index = 0; + var here_bits, here_op, here_val; + for (len = 0;len <= MAXBITS;len++) { + count[len] = 0; + } + for (sym = 0;sym < codes;sym++) { + count[lens[lens_index + sym]]++; + } + root = bits; + for (max = MAXBITS;max >= 1;max--) { + if (count[max] !== 0) { + break; + } + } + if (root > max) { + root = max; + } + if (max === 0) { + table[table_index++] = 1 << 24 | 64 << 16 | 0; + table[table_index++] = 1 << 24 | 64 << 16 | 0; + opts.bits = 1; + return 0; + } + for (min = 1;min < max;min++) { + if (count[min] !== 0) { + break; + } + } + if (root < min) { + root = min; + } + left = 1; + for (len = 1;len <= MAXBITS;len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; + } + offs[1] = 0; + for (len = 1;len < MAXBITS;len++) { + offs[len + 1] = offs[len] + count[len]; + } + for (sym = 0;sym < codes;sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + if (type === CODES) { + base = extra = work; + end = 19; + } else { + if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + } else { + base = dbase; + extra = dext; + end = -1; + } + } + huff = 0; + sym = 0; + len = min; + next = table_index; + curr = root; + drop = 0; + low = -1; + used = 1 << root; + mask = used - 1; + if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { + return 1; + } + var i = 0; + for (;;) { + i++; + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } else { + if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } else { + here_op = 32 + 64; + here_val = 0; + } + } + incr = 1 << len - drop; + fill = 1 << curr; + min = fill; + do { + fill -= incr; + table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0; + } while (fill !== 0); + incr = 1 << len - 1; + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + sym++; + if (--count[len] === 0) { + if (len === max) { + break; + } + len = lens[lens_index + work[sym]]; + } + if (len > root && (huff & mask) !== low) { + if (drop === 0) { + drop = root; + } + next += min; + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { + break; + } + curr++; + left <<= 1; + } + used += 1 << curr; + if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { + return 1; + } + low = huff & mask; + table[low] = root << 24 | curr << 16 | next - table_index | 0; + } + } + if (huff !== 0) { + table[next + huff] = len - drop << 24 | 64 << 16 | 0; + } + opts.bits = root; + return 0; + }; + }, {"../utils/common":27}], 37:[function(_dereq_, module, exports) { + module.exports = {2:"need dictionary", 1:"stream end", 0:"", "-1":"file error", "-2":"stream error", "-3":"data error", "-4":"insufficient memory", "-5":"buffer error", "-6":"incompatible version"}; + }, {}], 38:[function(_dereq_, module, exports) { + var utils = _dereq_("../utils/common"); + var Z_FIXED = 4; + var Z_BINARY = 0; + var Z_TEXT = 1; + var Z_UNKNOWN = 2; + function zero(buf) { + var len = buf.length; + while (--len >= 0) { + buf[len] = 0; + } + } + var STORED_BLOCK = 0; + var STATIC_TREES = 1; + var DYN_TREES = 2; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var LENGTH_CODES = 29; + var LITERALS = 256; + var L_CODES = LITERALS + 1 + LENGTH_CODES; + var D_CODES = 30; + var BL_CODES = 19; + var HEAP_SIZE = 2 * L_CODES + 1; + var MAX_BITS = 15; + var Buf_size = 16; + var MAX_BL_BITS = 7; + var END_BLOCK = 256; + var REP_3_6 = 16; + var REPZ_3_10 = 17; + var REPZ_11_138 = 18; + var extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]; + var extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]; + var extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]; + var bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + var DIST_CODE_LEN = 512; + var static_ltree = new Array((L_CODES + 2) * 2); + zero(static_ltree); + var static_dtree = new Array(D_CODES * 2); + zero(static_dtree); + var _dist_code = new Array(DIST_CODE_LEN); + zero(_dist_code); + var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); + zero(_length_code); + var base_length = new Array(LENGTH_CODES); + zero(base_length); + var base_dist = new Array(D_CODES); + zero(base_dist); + var StaticTreeDesc = function(static_tree, extra_bits, extra_base, elems, max_length) { + this.static_tree = static_tree; + this.extra_bits = extra_bits; + this.extra_base = extra_base; + this.elems = elems; + this.max_length = max_length; + this.has_stree = static_tree && static_tree.length; + }; + var static_l_desc; + var static_d_desc; + var static_bl_desc; + var TreeDesc = function(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; + this.max_code = 0; + this.stat_desc = stat_desc; + }; + function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; + } + function put_short(s, w) { + s.pending_buf[s.pending++] = w & 255; + s.pending_buf[s.pending++] = w >>> 8 & 255; + } + function send_bits(s, value, length) { + if (s.bi_valid > Buf_size - length) { + s.bi_buf |= value << s.bi_valid & 65535; + put_short(s, s.bi_buf); + s.bi_buf = value >> Buf_size - s.bi_valid; + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= value << s.bi_valid & 65535; + s.bi_valid += length; + } + } + function send_code(s, c, tree) { + send_bits(s, tree[c * 2], tree[c * 2 + 1]); + } + function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; + } + function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + } else { + if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 255; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } + } + } + function gen_bitlen(s, desc) { + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; + var n, m; + var bits; + var xbits; + var f; + var overflow = 0; + for (bits = 0;bits <= MAX_BITS;bits++) { + s.bl_count[bits] = 0; + } + tree[s.heap[s.heap_max] * 2 + 1] = 0; + for (h = s.heap_max + 1;h < HEAP_SIZE;h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1] = bits; + if (n > max_code) { + continue; + } + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1] + xbits); + } + } + if (overflow === 0) { + return; + } + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { + bits--; + } + s.bl_count[bits]--; + s.bl_count[bits + 1] += 2; + s.bl_count[max_length]--; + overflow -= 2; + } while (overflow > 0); + for (bits = max_length;bits !== 0;bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { + continue; + } + if (tree[m * 2 + 1] !== bits) { + s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2]; + tree[m * 2 + 1] = bits; + } + n--; + } + } + } + function gen_codes(tree, max_code, bl_count) { + var next_code = new Array(MAX_BITS + 1); + var code = 0; + var bits; + var n; + for (bits = 1;bits <= MAX_BITS;bits++) { + next_code[bits] = code = code + bl_count[bits - 1] << 1; + } + for (n = 0;n <= max_code;n++) { + var len = tree[n * 2 + 1]; + if (len === 0) { + continue; + } + tree[n * 2] = bi_reverse(next_code[len]++, len); + } + } + function tr_static_init() { + var n; + var bits; + var length; + var code; + var dist; + var bl_count = new Array(MAX_BITS + 1); + length = 0; + for (code = 0;code < LENGTH_CODES - 1;code++) { + base_length[code] = length; + for (n = 0;n < 1 << extra_lbits[code];n++) { + _length_code[length++] = code; + } + } + _length_code[length - 1] = code; + dist = 0; + for (code = 0;code < 16;code++) { + base_dist[code] = dist; + for (n = 0;n < 1 << extra_dbits[code];n++) { + _dist_code[dist++] = code; + } + } + dist >>= 7; + for (;code < D_CODES;code++) { + base_dist[code] = dist << 7; + for (n = 0;n < 1 << extra_dbits[code] - 7;n++) { + _dist_code[256 + dist++] = code; + } + } + for (bits = 0;bits <= MAX_BITS;bits++) { + bl_count[bits] = 0; + } + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1] = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1] = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1] = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1] = 8; + n++; + bl_count[8]++; + } + gen_codes(static_ltree, L_CODES + 1, bl_count); + for (n = 0;n < D_CODES;n++) { + static_dtree[n * 2 + 1] = 5; + static_dtree[n * 2] = bi_reverse(n, 5); + } + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + } + function init_block(s) { + var n; + for (n = 0;n < L_CODES;n++) { + s.dyn_ltree[n * 2] = 0; + } + for (n = 0;n < D_CODES;n++) { + s.dyn_dtree[n * 2] = 0; + } + for (n = 0;n < BL_CODES;n++) { + s.bl_tree[n * 2] = 0; + } + s.dyn_ltree[END_BLOCK * 2] = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; + } + function bi_windup(s) { + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else { + if (s.bi_valid > 0) { + s.pending_buf[s.pending++] = s.bi_buf; + } + } + s.bi_buf = 0; + s.bi_valid = 0; + } + function copy_block(s, buf, len, header) { + bi_windup(s); + if (header) { + put_short(s, len); + put_short(s, ~len); + } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; + } + function smaller(tree, n, m, depth) { + var _n2 = n * 2; + var _m2 = m * 2; + return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m]; + } + function pqdownheap(s, tree, k) { + var v = s.heap[k]; + var j = k << 1; + while (j <= s.heap_len) { + if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + if (smaller(tree, v, s.heap[j], s.depth)) { + break; + } + s.heap[k] = s.heap[j]; + k = j; + j <<= 1; + } + s.heap[k] = v; + } + function compress_block(s, ltree, dtree) { + var dist; + var lc; + var lx = 0; + var code; + var extra; + if (s.last_lit !== 0) { + do { + dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1]; + lc = s.pending_buf[s.l_buf + lx]; + lx++; + if (dist === 0) { + send_code(s, lc, ltree); + } else { + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); + } + dist--; + code = d_code(dist); + send_code(s, code, dtree); + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); + } + } + } while (lx < s.last_lit); + } + send_code(s, END_BLOCK, ltree); + } + function build_tree(s, desc) { + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; + var max_code = -1; + var node; + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + for (n = 0;n < elems;n++) { + if (tree[n * 2] !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + } else { + tree[n * 2 + 1] = 0; + } + } + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0; + tree[node * 2] = 1; + s.depth[node] = 0; + s.opt_len--; + if (has_stree) { + s.static_len -= stree[node * 2 + 1]; + } + } + desc.max_code = max_code; + for (n = s.heap_len >> 1;n >= 1;n--) { + pqdownheap(s, tree, n); + } + node = elems; + do { + n = s.heap[1]; + s.heap[1] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1); + m = s.heap[1]; + s.heap[--s.heap_max] = n; + s.heap[--s.heap_max] = m; + tree[node * 2] = tree[n * 2] + tree[m * 2]; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1] = tree[m * 2 + 1] = node; + s.heap[1] = node++; + pqdownheap(s, tree, 1); + } while (s.heap_len >= 2); + s.heap[--s.heap_max] = s.heap[1]; + gen_bitlen(s, desc); + gen_codes(tree, max_code, s.bl_count); + } + function scan_tree(s, tree, max_code) { + var n; + var prevlen = -1; + var curlen; + var nextlen = tree[0 * 2 + 1]; + var count = 0; + var max_count = 7; + var min_count = 4; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1] = 65535; + for (n = 0;n <= max_code;n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen === nextlen) { + continue; + } else { + if (count < min_count) { + s.bl_tree[curlen * 2] += count; + } else { + if (curlen !== 0) { + if (curlen !== prevlen) { + s.bl_tree[curlen * 2]++; + } + s.bl_tree[REP_3_6 * 2]++; + } else { + if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]++; + } else { + s.bl_tree[REPZ_11_138 * 2]++; + } + } + } + } + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } else { + if (curlen === nextlen) { + max_count = 6; + min_count = 3; + } else { + max_count = 7; + min_count = 4; + } + } + } + } + function send_tree(s, tree, max_code) { + var n; + var prevlen = -1; + var curlen; + var nextlen = tree[0 * 2 + 1]; + var count = 0; + var max_count = 7; + var min_count = 4; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + for (n = 0;n <= max_code;n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen === nextlen) { + continue; + } else { + if (count < min_count) { + do { + send_code(s, curlen, s.bl_tree); + } while (--count !== 0); + } else { + if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + } else { + if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + } + } + } + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } else { + if (curlen === nextlen) { + max_count = 6; + min_count = 3; + } else { + max_count = 7; + min_count = 4; + } + } + } + } + function build_bl_tree(s) { + var max_blindex; + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + build_tree(s, s.bl_desc); + for (max_blindex = BL_CODES - 1;max_blindex >= 3;max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) { + break; + } + } + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + return max_blindex; + } + function send_all_trees(s, lcodes, dcodes, blcodes) { + var rank; + send_bits(s, lcodes - 257, 5); + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); + for (rank = 0;rank < blcodes;rank++) { + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3); + } + send_tree(s, s.dyn_ltree, lcodes - 1); + send_tree(s, s.dyn_dtree, dcodes - 1); + } + function detect_data_type(s) { + var black_mask = 4093624447; + var n; + for (n = 0;n <= 31;n++, black_mask >>>= 1) { + if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0) { + return Z_BINARY; + } + } + if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) { + return Z_TEXT; + } + for (n = 32;n < LITERALS;n++) { + if (s.dyn_ltree[n * 2] !== 0) { + return Z_TEXT; + } + } + return Z_BINARY; + } + var static_init_done = false; + function _tr_init(s) { + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + s.bi_buf = 0; + s.bi_valid = 0; + init_block(s); + } + function _tr_stored_block(s, buf, stored_len, last) { + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); + copy_block(s, buf, stored_len, true); + } + function _tr_align(s) { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); + } + function _tr_flush_block(s, buf, stored_len, last) { + var opt_lenb, static_lenb; + var max_blindex = 0; + if (s.level > 0) { + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + build_tree(s, s.l_desc); + build_tree(s, s.d_desc); + max_blindex = build_bl_tree(s); + opt_lenb = s.opt_len + 3 + 7 >>> 3; + static_lenb = s.static_len + 3 + 7 >>> 3; + if (static_lenb <= opt_lenb) { + opt_lenb = static_lenb; + } + } else { + opt_lenb = static_lenb = stored_len + 5; + } + if (stored_len + 4 <= opt_lenb && buf !== -1) { + _tr_stored_block(s, buf, stored_len, last); + } else { + if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + } else { + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + } + init_block(s); + if (last) { + bi_windup(s); + } + } + function _tr_tally(s, dist, lc) { + s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255; + s.pending_buf[s.l_buf + s.last_lit] = lc & 255; + s.last_lit++; + if (dist === 0) { + s.dyn_ltree[lc * 2]++; + } else { + s.matches++; + dist--; + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++; + s.dyn_dtree[d_code(dist) * 2]++; + } + return s.last_lit === s.lit_bufsize - 1; + } + exports._tr_init = _tr_init; + exports._tr_stored_block = _tr_stored_block; + exports._tr_flush_block = _tr_flush_block; + exports._tr_tally = _tr_tally; + exports._tr_align = _tr_align; + }, {"../utils/common":27}], 39:[function(_dereq_, module, exports) { + function ZStream() { + this.input = null; + this.next_in = 0; + this.avail_in = 0; + this.total_in = 0; + this.output = null; + this.next_out = 0; + this.avail_out = 0; + this.total_out = 0; + this.msg = ""; + this.state = null; + this.data_type = 2; + this.adler = 0; + } + module.exports = ZStream; + }, {}]}, {}, [9])(9); +}); + diff --git a/api/js/webodf/webodf.js b/api/js/webodf/webodf.js new file mode 100644 index 0000000000..7c7de743f2 --- /dev/null +++ b/api/js/webodf/webodf.js @@ -0,0 +1,936 @@ +/* + + This is a generated file. DO NOT EDIT. + + Copyright (C) 2010-2015 KO GmbH + + @licstart + The code in this file is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License (GNU AGPL) + as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + The code in this file 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with WebODF. If not, see . + + As additional permission under GNU AGPL version 3 section 7, you + may distribute UNMODIFIED VERSIONS OF THIS file without the copy of the GNU AGPL normally + required by section 4, provided you include this license notice and a URL + through which recipients can access the Corresponding Source. + + As a special exception to the AGPL, any HTML file which merely makes function + calls to this code, and for that purpose includes it in unmodified form by reference or in-line shall be + deemed a separate work for copyright law purposes. In addition, the copyright + holders of this code give you permission to combine this code with free + software libraries that are released under the GNU LGPL. You may copy and + distribute such a system following the terms of the GNU AGPL for this code + and the LGPL for the libraries. If you modify this code, you may extend this + exception to your version of the code, but you are not obligated to do so. + If you do not wish to do so, delete this exception statement from your + version. + + This license applies to this entire compilation. + @licend + + @source: http://www.webodf.org/ + @source: https://github.com/kogmbh/WebODF/ +*/ +var webodf_version="0.5.9";function Runtime(){}Runtime.prototype.getVariable=function(g){};Runtime.prototype.toJson=function(g){};Runtime.prototype.fromJson=function(g){};Runtime.prototype.byteArrayFromString=function(g,k){};Runtime.prototype.byteArrayToString=function(g,k){};Runtime.prototype.read=function(g,k,d,b){};Runtime.prototype.readFile=function(g,k,d){};Runtime.prototype.readFileSync=function(g,k){};Runtime.prototype.loadXML=function(g,k){};Runtime.prototype.writeFile=function(g,k,d){}; +Runtime.prototype.deleteFile=function(g,k){};Runtime.prototype.log=function(g,k){};Runtime.prototype.setTimeout=function(g,k){};Runtime.prototype.clearTimeout=function(g){};Runtime.prototype.libraryPaths=function(){};Runtime.prototype.currentDirectory=function(){};Runtime.prototype.setCurrentDirectory=function(g){};Runtime.prototype.type=function(){};Runtime.prototype.getDOMImplementation=function(){};Runtime.prototype.parseXML=function(g){};Runtime.prototype.exit=function(g){}; +Runtime.prototype.getWindow=function(){};Runtime.prototype.requestAnimationFrame=function(g){};Runtime.prototype.cancelAnimationFrame=function(g){};Runtime.prototype.assert=function(g,k){};var IS_COMPILED_CODE=!0; +Runtime.byteArrayToString=function(g,k){function d(b){var d="",r,q=b.length;for(r=0;rl?e.push(l):(r+=1,a=b[r],194<=l&&224>l?e.push((l&31)<<6|a&63):(r+=1,c=b[r],224<=l&&240>l?e.push((l&15)<<12|(a&63)<<6|c&63):(r+=1,m=b[r],240<=l&&245>l&&(l=(l&7)<<18|(a&63)<<12|(c&63)<<6|m&63,l-=65536,e.push((l>>10)+55296,(l&1023)+56320))))),1E3<=e.length&& +(d+=String.fromCharCode.apply(null,e),e.length=0);return d+String.fromCharCode.apply(null,e)}var f;"utf8"===k?f=b(g):("binary"!==k&&this.log("Unsupported encoding: "+k),f=d(g));return f};Runtime.getVariable=function(g){try{return eval(g)}catch(k){}};Runtime.toJson=function(g){return JSON.stringify(g)};Runtime.fromJson=function(g){return JSON.parse(g)};Runtime.getFunctionName=function(g){return void 0===g.name?(g=/function\s+(\w+)/.exec(g))&&g[1]:g.name}; +Runtime.assert=function(g,k){if(!g)throw this.log("alert","ASSERTION FAILED:\n"+k),Error(k);}; +function BrowserRuntime(){function g(b){var e=b.length,l,a,c=0;for(l=0;la&&(c+=1,l+=1);return c}function k(b,e,l){var a=b.length,c,m;e=new Uint8Array(new ArrayBuffer(e));l?(e[0]=239,e[1]=187,e[2]=191,m=3):m=0;for(l=0;lc?(e[m]=c,m+=1):2048>c?(e[m]=192|c>>>6,e[m+1]=128|c&63,m+=2):55040>=c||57344<=c?(e[m]=224|c>>>12&15,e[m+1]=128|c>>>6&63,e[m+2]=128|c&63,m+=3):(l+=1,c=(c-55296<<10|b.charCodeAt(l)-56320)+65536, +e[m]=240|c>>>18&7,e[m+1]=128|c>>>12&63,e[m+2]=128|c>>>6&63,e[m+3]=128|c&63,m+=4);return e}function d(b){var e=b.length,l=new Uint8Array(new ArrayBuffer(e)),a;for(a=0;aa.status||0===a.status?l(null):l("Status "+String(a.status)+": "+a.responseText||a.statusText):l("File "+b+" is empty."))};c=e.buffer&&!a.sendAsBinary?e.buffer:r.byteArrayToString(e,"binary");try{a.sendAsBinary?a.sendAsBinary(c):a.send(c)}catch(m){r.log("HUH? "+ +m+" "+e),l(m.message)}};this.deleteFile=function(b,e){var l=new XMLHttpRequest;l.open("DELETE",b,!0);l.onreadystatechange=function(){4===l.readyState&&(200>l.status&&300<=l.status?e(l.responseText):e(null))};l.send(null)};this.loadXML=function(b,e){var l=new XMLHttpRequest;l.open("GET",b,!0);l.overrideMimeType&&l.overrideMimeType("text/xml");l.onreadystatechange=function(){4===l.readyState&&(0!==l.status||l.responseText?200===l.status||0===l.status?e(null,l.responseXML):e(l.responseText,null):e("File "+ +b+" is empty.",null))};try{l.send(null)}catch(a){e(a.message,null)}};this.log=b;this.enableAlerts=!0;this.assert=Runtime.assert;this.setTimeout=function(b,e){return setTimeout(function(){b()},e)};this.clearTimeout=function(b){clearTimeout(b)};this.libraryPaths=function(){return["lib"]};this.setCurrentDirectory=function(){};this.currentDirectory=function(){return""};this.type=function(){return"BrowserRuntime"};this.getDOMImplementation=function(){return window.document.implementation};this.parseXML= +function(b){return(new DOMParser).parseFromString(b,"text/xml")};this.exit=function(d){b("Calling exit with code "+String(d)+", but exit() is not implemented.")};this.getWindow=function(){return window};this.requestAnimationFrame=function(b){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,l=0;if(e)e.bind(window),l=e(b);else return setTimeout(b,15);return l};this.cancelAnimationFrame=function(b){var e=window.cancelAnimationFrame|| +window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame;e?(e.bind(window),e(b)):clearTimeout(b)}} +function NodeJSRuntime(){function g(b){var e=b.length,l,a=new Uint8Array(new ArrayBuffer(e));for(l=0;l").implementation} +function RhinoRuntime(){var g=this,k={},d=k.javax.xml.parsers.DocumentBuilderFactory.newInstance(),b,f,n="";d.setValidating(!1);d.setNamespaceAware(!0);d.setExpandEntityReferences(!1);d.setSchema(null);f=k.org.xml.sax.EntityResolver({resolveEntity:function(b,d){var f=new k.java.io.FileReader(d);return new k.org.xml.sax.InputSource(f)}});b=d.newDocumentBuilder();b.setEntityResolver(f);this.byteArrayFromString=function(b,d){var f,e=b.length,l=new Uint8Array(new ArrayBuffer(e));for(f=0;f>>18],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>12&63],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6&63],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c& +63];h===b+1?(c=a[h]<<4,m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c&63],m+="=="):h===b&&(c=a[h]<<10|a[h+1]<<2,m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>12],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c>>>6&63],m+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c&63],m+="=");return m}function d(a){a=a.replace(/[^A-Za-z0-9+\/]+/g, +"");var c=a.length,m=new Uint8Array(new ArrayBuffer(3*c)),b=a.length%4,d=0,l,e;for(l=0;l>16,m[d+1]=e>>8&255,m[d+2]=e&255,d+=3;c=3*c-[0,0,2,1][b];return m.subarray(0,c)}function b(a){var c,m,h=a.length,b=0,d=new Uint8Array(new ArrayBuffer(3*h));for(c=0;cm?d[b++]=m:(2048>m?d[b++]=192|m>>>6:(d[b++]=224|m>>>12&15,d[b++]=128|m>>>6&63),d[b++]=128|m&63);return d.subarray(0, +b)}function f(a){var c,m,h,b,d=a.length,l=new Uint8Array(new ArrayBuffer(d)),e=0;for(c=0;cm?l[e++]=m:(c+=1,h=a[c],224>m?l[e++]=(m&31)<<6|h&63:(c+=1,b=a[c],l[e++]=(m&15)<<12|(h&63)<<6|b&63));return l.subarray(0,e)}function n(a){return k(g(a))}function p(a){return String.fromCharCode.apply(String,d(a))}function r(a){return f(g(a))}function q(a){a=f(a);for(var c="",m=0;mc?l+=String.fromCharCode(c):(d+=1,h=a.charCodeAt(d)&255,224>c?l+=String.fromCharCode((c&31)<<6|h&63):(d+=1,b=a.charCodeAt(d)&255,l+=String.fromCharCode((c&15)<<12|(h&63)<<6|b&63)));return l}function l(a,c){function m(){var d=b+1E5;d>a.length&&(d=a.length);h+=e(a,b,d);b=d;d=b===a.length;c(h,d)&&!d&&runtime.setTimeout(m,0)}var h="",b=0;1E5>a.length?c(e(a,0,a.length),!0):("string"!==typeof a&&(a=a.slice()),m())}function a(a){return b(g(a))}function c(a){return String.fromCharCode.apply(String, +b(a))}function m(a){return String.fromCharCode.apply(String,b(g(a)))}var h=function(a){var c={},m,h;m=0;for(h=a.length;m=a.compareBoundaryPoints(Range.START_TO_START,c)&&0<=a.compareBoundaryPoints(Range.END_TO_END,c)}function n(a,c){return 0>=a.compareBoundaryPoints(Range.END_TO_START,c)&&0<=a.compareBoundaryPoints(Range.START_TO_END,c)}function p(a,c){var b=null;a.nodeType===Node.TEXT_NODE&&(0===a.length?(a.parentNode.removeChild(a),c.nodeType===Node.TEXT_NODE&&(b=c)):(c.nodeType===Node.TEXT_NODE&&(a.appendData(c.data),c.parentNode.removeChild(c)),b=a));return b} +function r(a){for(var c=a.parentNode;a.firstChild;)c.insertBefore(a.firstChild,a);c.removeChild(a);return c}function q(a,c){var b=a.parentNode,d=a.firstChild,l=c(a),e;if(l===NodeFilter.FILTER_SKIP)return b;for(;d;)e=d.nextSibling,q(d,c),d=e;b&&l===NodeFilter.FILTER_REJECT&&r(a);return b}function e(a,c){return a===c||Boolean(a.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY)}function l(a,c){return g().unscaledRangeClientRects?a:a/c}function a(c,h,b){Object.keys(h).forEach(function(d){var l= +d.split(":"),e=l[1],f=b(l[0]),l=h[d],n=typeof l;"object"===n?Object.keys(l).length&&(d=f?c.getElementsByTagNameNS(f,e)[0]||c.ownerDocument.createElementNS(f,d):c.getElementsByTagName(e)[0]||c.ownerDocument.createElement(d),c.appendChild(d),a(d,l,b)):f&&(runtime.assert("number"===n||"string"===n,"attempting to map unsupported type '"+n+"' (key: "+d+")"),c.setAttributeNS(f,d,String(l)))})}var c=null;this.splitBoundaries=function(a){var c,d=[],l,e,f;if(a.startContainer.nodeType===Node.TEXT_NODE||a.endContainer.nodeType=== +Node.TEXT_NODE){l=a.endContainer;e=a.endContainer.nodeType!==Node.TEXT_NODE?a.endOffset===a.endContainer.childNodes.length:!1;f=a.endOffset;c=a.endContainer;if(fg))throw runtime.log("alert","watchdog timeout"),"timeout!";if(0k))throw runtime.log("alert","watchdog loop overflow"),"loop overflow";}};core.NodeFilterChain=function(g){var k=NodeFilter.FILTER_REJECT,d=NodeFilter.FILTER_ACCEPT;this.acceptNode=function(b){var f;for(f=0;f "+c.length),runtime.assert(0<=b,"Error in setPosition: "+b+" < 0"),b===c.length&&(l.nextSibling()?a=0:l.parentNode()?a=1:runtime.assert(!1,"Error in setUnfilteredPosition: position not valid."))):ba.value||"%"===a.unit)?null:a}function L(a){return(a=I(a))&&"%"!==a.unit?null:a}function E(a){switch(a.namespaceURI){case odf.Namespaces.drawns:case odf.Namespaces.svgns:case odf.Namespaces.dr3dns:return!1;case odf.Namespaces.textns:switch(a.localName){case "note-body":case "ruby-text":return!1}break;case odf.Namespaces.officens:switch(a.localName){case "annotation":case "binary-data":case "event-listeners":return!1}break;default:switch(a.localName){case "cursor":case "editinfo":return!1}}return!0} +function N(a){return Boolean(n(a)&&(!r(a.textContent)||A(a,0)))}function O(a,c){for(;0=c.value||"%"===c.unit)?null:c;return c||L(a)};this.parseFoLineHeight= +function(a){return K(a)||L(a)};this.isTextContentContainingNode=E;this.getTextNodes=function(a,c){var b;b=aa.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_REJECT;a.nodeType===Node.TEXT_NODE?N(a)&&(c=NodeFilter.FILTER_ACCEPT):E(a)&&(c=NodeFilter.FILTER_SKIP);return c},NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);c||O(a,b);return b};this.getTextElements=D;this.getParagraphElements=function(a){var c;c=aa.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_REJECT;if(f(a))c=NodeFilter.FILTER_ACCEPT; +else if(E(a)||q(a))c=NodeFilter.FILTER_SKIP;return c},NodeFilter.SHOW_ELEMENT);V(a.startContainer,c,f);return c};this.getImageElements=function(a){var c;c=aa.getNodesInRange(a,function(a){var c=NodeFilter.FILTER_SKIP;g(a)&&(c=NodeFilter.FILTER_ACCEPT);return c},NodeFilter.SHOW_ELEMENT);V(a.startContainer,c,g);return c};this.getHyperlinkElements=function(a){var c=[],d=a.cloneRange();a.collapsed&&a.endContainer.nodeType===Node.ELEMENT_NODE&&(a=W(a.endContainer,a.endOffset),a.nodeType===Node.TEXT_NODE&& +d.setEnd(a,1));D(d,!0,!1).forEach(function(a){for(a=a.parentNode;!f(a);){if(b(a)&&-1===c.indexOf(a)){c.push(a);break}a=a.parentNode}});d.detach();return c};this.getNormalizedFontFamilyName=function(a){/^(["'])(?:.|[\n\r])*?\1$/.test(a)||(a=a.replace(/^[ \t\r\n\f]*((?:.|[\n\r])*?)[ \t\r\n\f]*$/,"$1"),/[ \t\r\n\f]/.test(a)&&(a="'"+a.replace(/[ \t\r\n\f]+/g," ")+"'"));return a}};odf.OdfUtils=new odf.OdfUtilsImpl; +gui.OdfTextBodyNodeFilter=function(){var g=odf.OdfUtils,k=Node.TEXT_NODE,d=NodeFilter.FILTER_REJECT,b=NodeFilter.FILTER_ACCEPT,f=odf.Namespaces.textns;this.acceptNode=function(n){if(n.nodeType===k){if(!g.isGroupingElement(n.parentNode))return d}else if(n.namespaceURI===f&&"tracked-changes"===n.localName)return d;return b}};xmldom.LSSerializerFilter=function(){};xmldom.LSSerializerFilter.prototype.acceptNode=function(g){}; +odf.OdfNodeFilter=function(){this.acceptNode=function(g){return"http://www.w3.org/1999/xhtml"===g.namespaceURI?NodeFilter.FILTER_SKIP:g.namespaceURI&&g.namespaceURI.match(/^urn:webodf:/)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}};xmldom.XPathIterator=function(){};xmldom.XPathIterator.prototype.next=function(){};xmldom.XPathIterator.prototype.reset=function(){}; +function createXPathSingleton(){function g(b,a,c){return-1!==b&&(b=e&&c.push(k(b.substring(a,d)))):"["===b[d]&&(0>=e&&(a=d+1),e+=1),d+=1;return d};q=function(d,a,c){var m,h,e,n;for(m=0;m/g,">").replace(/'/g,"'").replace(/"/g,""")}function d(f,n){var g="",r=b.filter?b.filter.acceptNode(n):NodeFilter.FILTER_ACCEPT,q;if(r===NodeFilter.FILTER_ACCEPT&&n.nodeType===Node.ELEMENT_NODE){f.push();q=f.getQName(n);var e,l=n.attributes,a,c,m,h="",y;e="<"+q;a=l.length;for(c=0;c")}if(r===NodeFilter.FILTER_ACCEPT||r===NodeFilter.FILTER_SKIP){for(r=n.firstChild;r;)g+=d(f,r),r=r.nextSibling;n.nodeValue&&(g+=k(n.nodeValue))}q&&(g+="",f.pop());return g}var b=this;this.filter=null;this.writeToString=function(b,n){if(!b)return"";var k=new g(n);return d(k,b)}}; +(function(){function g(b){var a,c=r.length;for(a=0;ac)break;h=h.nextSibling}b.insertBefore(a,h)}}}var f=new odf.StyleInfo,n=core.DomUtils,p=odf.Namespaces.stylens,r="meta settings scripts font-face-decls styles automatic-styles master-styles body".split(" "), +q=Date.now()+"_webodf_",e=new core.Base64;odf.ODFElement=function(){};odf.ODFDocumentElement=function(){};odf.ODFDocumentElement.prototype=new odf.ODFElement;odf.ODFDocumentElement.prototype.constructor=odf.ODFDocumentElement;odf.ODFDocumentElement.prototype.fontFaceDecls=null;odf.ODFDocumentElement.prototype.manifest=null;odf.ODFDocumentElement.prototype.settings=null;odf.ODFDocumentElement.namespaceURI="urn:oasis:names:tc:opendocument:xmlns:office:1.0";odf.ODFDocumentElement.localName="document"; +odf.AnnotationElement=function(){};odf.OdfPart=function(b,a,c,d){var h=this;this.size=0;this.type=null;this.name=b;this.container=c;this.url=null;this.mimetype=a;this.onstatereadychange=this.document=null;this.EMPTY=0;this.LOADING=1;this.DONE=2;this.state=this.EMPTY;this.data="";this.load=function(){null!==d&&(this.mimetype=a,d.loadAsDataURL(b,a,function(a,c){a&&runtime.log(a);h.url=c;if(h.onchange)h.onchange(h);if(h.onstatereadychange)h.onstatereadychange(h)}))}};odf.OdfPart.prototype.load=function(){}; +odf.OdfPart.prototype.getUrl=function(){return this.data?"data:;base64,"+e.toBase64(this.data):null};odf.OdfContainer=function a(c,m){function h(a){for(var c=a.firstChild,b;c;)b=c.nextSibling,c.nodeType===Node.ELEMENT_NODE?h(c):c.nodeType===Node.PROCESSING_INSTRUCTION_NODE&&a.removeChild(c),c=b}function g(a){var c={},b,d,h=a.ownerDocument.createNodeIterator(a,NodeFilter.SHOW_ELEMENT,null,!1);for(a=h.nextNode();a;)"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&("annotation"=== +a.localName?(b=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","name"))&&(c.hasOwnProperty(b)?runtime.log("Warning: annotation name used more than once with : '"+b+"'"):c[b]=a):"annotation-end"===a.localName&&((b=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","name"))?c.hasOwnProperty(b)?(d=c[b],d.annotationEndElement?runtime.log("Warning: annotation name used more than once with : '"+b+"'"):d.annotationEndElement= +a):runtime.log("Warning: annotation end without an annotation start, name: '"+b+"'"):runtime.log("Warning: annotation end without a name found"))),a=h.nextNode()}function r(a,c){for(var b=a&&a.firstChild;b;)b.nodeType===Node.ELEMENT_NODE&&b.setAttributeNS("urn:webodf:names:scope","scope",c),b=b.nextSibling}function z(a,c){for(var b=B.rootElement.meta,b=b&&b.firstChild;b&&(b.namespaceURI!==a||b.localName!==c);)b=b.nextSibling;for(b=b&&b.firstChild;b&&b.nodeType!==Node.TEXT_NODE;)b=b.nextSibling;return b? +b.data:null}function w(a){var c={},b;for(a=a.firstChild;a;)a.nodeType===Node.ELEMENT_NODE&&a.namespaceURI===p&&"font-face"===a.localName&&(b=a.getAttributeNS(p,"name"),c[b]=a),a=a.nextSibling;return c}function v(a,c){var b=null,d,h,e;if(a)for(b=a.cloneNode(!0),d=b.firstElementChild;d;)h=d.nextElementSibling,(e=d.getAttributeNS("urn:webodf:names:scope","scope"))&&e!==c&&b.removeChild(d),d=h;return b}function u(a,c){var b,d,h,e=null,m={};if(a)for(c.forEach(function(a){f.collectUsedFontFaces(m,a)}), +e=a.cloneNode(!0),b=e.firstElementChild;b;)d=b.nextElementSibling,h=b.getAttributeNS(p,"name"),m[h]||e.removeChild(b),b=d;return e}function t(a){var c=B.rootElement.ownerDocument,b;if(a){h(a.documentElement);try{b=c.importNode(a.documentElement,!0)}catch(d){}}return b}function A(a){B.state=a;if(B.onchange)B.onchange(B);if(B.onstatereadychange)B.onstatereadychange(B)}function I(a){Q=null;B.rootElement=a;a.fontFaceDecls=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls"); +a.styles=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles");a.automaticStyles=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");a.masterStyles=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles");a.body=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");a.meta=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta");a.settings=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"settings");a.scripts=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","scripts");g(a)}function K(c){var d=t(c),h=B.rootElement,e;d&&"document-styles"===d.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===d.namespaceURI?(h.fontFaceDecls=n.getDirectChild(d,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls"),b(h,h.fontFaceDecls),e=n.getDirectChild(d,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","styles"),h.styles=e||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0", +"styles"),b(h,h.styles),e=n.getDirectChild(d,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"),h.automaticStyles=e||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles"),r(h.automaticStyles,"document-styles"),b(h,h.automaticStyles),d=n.getDirectChild(d,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),h.masterStyles=d||c.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","master-styles"),b(h,h.masterStyles), +f.prefixStyleNames(h.automaticStyles,q,h.masterStyles)):A(a.INVALID)}function L(c){c=t(c);var d,h,e,m;if(c&&"document-content"===c.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===c.namespaceURI){d=B.rootElement;e=n.getDirectChild(c,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","font-face-decls");if(d.fontFaceDecls&&e){m=d.fontFaceDecls;var g,k,O,q,D={};h=w(m);q=w(e);for(e=e.firstElementChild;e;){g=e.nextElementSibling;if(e.namespaceURI===p&&"font-face"===e.localName)if(k=e.getAttributeNS(p, +"name"),h.hasOwnProperty(k)){if(!e.isEqualNode(h[k])){O=k;for(var y=h,E=q,u=0,W=void 0,W=O=O.replace(/\d+$/,"");y.hasOwnProperty(W)||E.hasOwnProperty(W);)u+=1,W=O+u;O=W;e.setAttributeNS(p,"style:name",O);m.appendChild(e);h[O]=e;delete q[k];D[k]=O}}else m.appendChild(e),h[k]=e,delete q[k];e=g}m=D}else e&&(d.fontFaceDecls=e,b(d,e));h=n.getDirectChild(c,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","automatic-styles");r(h,"document-content");m&&f.changeFontFaceNames(h,m);if(d.automaticStyles&&h)for(m= +h.firstChild;m;)d.automaticStyles.appendChild(m),m=h.firstChild;else h&&(d.automaticStyles=h,b(d,h));c=n.getDirectChild(c,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","body");if(null===c)throw" tag is mising.";d.body=c;b(d,d.body)}else A(a.INVALID)}function E(a){a=t(a);var c;a&&"document-meta"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&(c=B.rootElement,c.meta=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta"), +b(c,c.meta))}function N(a){a=t(a);var c;a&&"document-settings"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===a.namespaceURI&&(c=B.rootElement,c.settings=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","settings"),b(c,c.settings))}function O(a){a=t(a);var c;if(a&&"manifest"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"===a.namespaceURI)for(c=B.rootElement,c.manifest=a,a=c.manifest.firstElementChild;a;)"file-entry"===a.localName&&"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"=== +a.namespaceURI&&(M[a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","full-path")]=a.getAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","media-type")),a=a.nextElementSibling}function D(a,c,b){a=n.getElementsByTagName(a,c);var d;for(d=0;d'}function P(){var a=new xmldom.LSSerializer,c=R("document-meta");a.filter=new odf.OdfNodeFilter;c+=a.writeToString(B.rootElement.meta,odf.Namespaces.namespaceMap);return c+""}function aa(a,c){var b=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:file-entry");b.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0","manifest:full-path",a);b.setAttributeNS("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", +"manifest:media-type",c);return b}function S(){var a=runtime.parseXML(''),c=a.documentElement,b=new xmldom.LSSerializer,d;for(d in M)M.hasOwnProperty(d)&&c.appendChild(aa(d,M[d]));b.filter=new odf.OdfNodeFilter;return'\n'+b.writeToString(a,odf.Namespaces.namespaceMap)}function fa(){var a,c,b,d=odf.Namespaces.namespaceMap, +h=new xmldom.LSSerializer,e=R("document-styles");c=v(B.rootElement.automaticStyles,"document-styles");b=B.rootElement.masterStyles.cloneNode(!0);a=u(B.rootElement.fontFaceDecls,[b,B.rootElement.styles,c]);f.removePrefixFromStyleNames(c,q,b);h.filter=new k(b,c);e+=h.writeToString(a,d);e+=h.writeToString(B.rootElement.styles,d);e+=h.writeToString(c,d);e+=h.writeToString(b,d);return e+""}function ha(){var a,c,b=odf.Namespaces.namespaceMap,h=new xmldom.LSSerializer,e=R("document-content"); +c=v(B.rootElement.automaticStyles,"document-content");a=u(B.rootElement.fontFaceDecls,[c]);h.filter=new d(B.rootElement.body,c);e+=h.writeToString(a,b);e+=h.writeToString(c,b);e+=h.writeToString(B.rootElement.body,b);return e+""}function C(c,b){runtime.loadXML(c,function(c,d){if(c)b(c);else if(d){V(d);W(d.documentElement);var h=t(d);h&&"document"===h.localName&&"urn:oasis:names:tc:opendocument:xmlns:office:1.0"===h.namespaceURI?(I(h),A(a.DONE)):A(a.INVALID)}else b("No DOM was loaded.")})} +function Z(a,c){var d;d=B.rootElement;var h=d.meta;h||(d.meta=h=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0","meta"),b(d,h));d=h;a&&n.mapKeyValObjOntoNode(d,a,odf.Namespaces.lookupNamespaceURI);c&&n.removeKeyElementsFromNode(d,c,odf.Namespaces.lookupNamespaceURI)}function ba(c,b){function d(a,c){var b;c||(c=a);b=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0",c);f[a]=b;f.appendChild(b)}var h=new core.Zip("",null),e="application/vnd.oasis.opendocument."+ +c+(!0===b?"-template":""),m=runtime.byteArrayFromString(e,"utf8"),f=B.rootElement,g=document.createElementNS("urn:oasis:names:tc:opendocument:xmlns:office:1.0",c);h.save("mimetype",m,!1,new Date);d("meta");d("settings");d("scripts");d("fontFaceDecls","font-face-decls");d("styles");d("automaticStyles","automatic-styles");d("masterStyles","master-styles");d("body");f.body.appendChild(g);M["/"]=e;M["settings.xml"]="text/xml";M["meta.xml"]="text/xml";M["styles.xml"]="text/xml";M["content.xml"]="text/xml"; +A(a.DONE);return h}function U(){var a,c=new Date,b="";B.rootElement.settings&&B.rootElement.settings.firstElementChild&&(a=new xmldom.LSSerializer,b=R("document-settings"),a.filter=new odf.OdfNodeFilter,b+=a.writeToString(B.rootElement.settings,odf.Namespaces.namespaceMap),b+="");(a=b)?(a=runtime.byteArrayFromString(a,"utf8"),Y.save("settings.xml",a,!0,c)):Y.remove("settings.xml");b=runtime.getWindow();a="WebODF/"+webodf.Version;b&&(a=a+" "+b.navigator.userAgent);Z({"meta:generator":a}, +null);a=runtime.byteArrayFromString(P(),"utf8");Y.save("meta.xml",a,!0,c);a=runtime.byteArrayFromString(fa(),"utf8");Y.save("styles.xml",a,!0,c);a=runtime.byteArrayFromString(ha(),"utf8");Y.save("content.xml",a,!0,c);a=runtime.byteArrayFromString(S(),"utf8");Y.save("META-INF/manifest.xml",a,!0,c)}function ga(a,c){U();Y.writeAs(a,function(a){c(a)})}var B=this,Y,M={},Q,F="";this.onstatereadychange=m;this.state=this.onchange=null;this.getMetadata=z;this.setRootElement=I;this.getContentElement=function(){var a; +Q||(a=B.rootElement.body,Q=n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","text")||n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","presentation")||n.getDirectChild(a,"urn:oasis:names:tc:opendocument:xmlns:office:1.0","spreadsheet"));if(!Q)throw"Could not find content element in .";return Q};this.getDocumentType=function(){var a=B.getContentElement();return a&&a.localName};this.isTemplate=function(){return"-template"===M["/"].substr(-9)}; +this.setIsTemplate=function(a){var c=M["/"],b="-template"===c.substr(-9);a!==b&&(c=a?c+"-template":c.substr(0,c.length-9),M["/"]=c,a=runtime.byteArrayFromString(c,"utf8"),Y.save("mimetype",a,!1,new Date))};this.getPart=function(a){return new odf.OdfPart(a,M[a],B,Y)};this.getPartData=function(a,c){Y.load(a,c)};this.setMetadata=Z;this.incrementEditingCycles=function(){var a=z(odf.Namespaces.metans,"editing-cycles"),a=a?parseInt(a,10):0;isNaN(a)&&(a=0);Z({"meta:editing-cycles":a+1},null);return a+1}; +this.createByteArray=function(a,c){U();Y.createByteArray(a,c)};this.saveAs=ga;this.save=function(a){ga(F,a)};this.getUrl=function(){return F};this.setBlob=function(a,c,b){b=e.convertBase64ToByteArray(b);Y.save(a,b,!1,new Date);M.hasOwnProperty(a)&&runtime.log(a+" has been overwritten.");M[a]=c};this.removeBlob=function(a){var c=Y.remove(a);runtime.assert(c,"file is not found: "+a);delete M[a]};this.state=a.LOADING;this.rootElement=function(a){var c=document.createElementNS(a.namespaceURI,a.localName), +b;a=new a.Type;for(b in a)a.hasOwnProperty(b)&&(c[b]=a[b]);return c}({Type:odf.ODFDocumentElement,namespaceURI:odf.ODFDocumentElement.namespaceURI,localName:odf.ODFDocumentElement.localName});c===odf.OdfContainer.DocumentType.TEXT?Y=ba("text"):c===odf.OdfContainer.DocumentType.TEXT_TEMPLATE?Y=ba("text",!0):c===odf.OdfContainer.DocumentType.PRESENTATION?Y=ba("presentation"):c===odf.OdfContainer.DocumentType.PRESENTATION_TEMPLATE?Y=ba("presentation",!0):c===odf.OdfContainer.DocumentType.SPREADSHEET? +Y=ba("spreadsheet"):c===odf.OdfContainer.DocumentType.SPREADSHEET_TEMPLATE?Y=ba("spreadsheet",!0):(F=c,Y=new core.Zip(F,function(c,b){Y=b;c?C(F,function(b){c&&(Y.error=c+"\n"+b,A(a.INVALID))}):J([{path:"styles.xml",handler:K},{path:"content.xml",handler:L},{path:"meta.xml",handler:E},{path:"settings.xml",handler:N},{path:"META-INF/manifest.xml",handler:O}])}))};odf.OdfContainer.EMPTY=0;odf.OdfContainer.LOADING=1;odf.OdfContainer.DONE=2;odf.OdfContainer.INVALID=3;odf.OdfContainer.SAVING=4;odf.OdfContainer.MODIFIED= +5;odf.OdfContainer.getContainer=function(a){return new odf.OdfContainer(a,null)}})();odf.OdfContainer.DocumentType={TEXT:1,TEXT_TEMPLATE:2,PRESENTATION:3,PRESENTATION_TEMPLATE:4,SPREADSHEET:5,SPREADSHEET_TEMPLATE:6};gui.AnnotatableCanvas=function(){};gui.AnnotatableCanvas.prototype.refreshSize=function(){};gui.AnnotatableCanvas.prototype.getZoomLevel=function(){};gui.AnnotatableCanvas.prototype.getSizer=function(){}; +gui.AnnotationViewManager=function(g,k,d,b){function f(c){var b=c.annotationEndElement,d=l.createRange(),e=c.getAttributeNS(odf.Namespaces.officens,"name");b&&(d.setStart(c,c.childNodes.length),d.setEnd(b,0),c=a.getTextNodes(d,!1),c.forEach(function(a){var c;a:{for(c=a.parentNode;c.namespaceURI!==odf.Namespaces.officens||"body"!==c.localName;){if("http://www.w3.org/1999/xhtml"===c.namespaceURI&&"webodf-annotationHighlight"===c.className&&c.getAttribute("annotation")===e){c=!0;break a}c=c.parentNode}c= +!1}c||(c=l.createElement("span"),c.className="webodf-annotationHighlight",c.setAttribute("annotation",e),a.parentNode.replaceChild(c,a),c.appendChild(a))}));d.detach()}function n(a){var b=g.getSizer();a?(d.style.display="inline-block",b.style.paddingRight=c.getComputedStyle(d).width):(d.style.display="none",b.style.paddingRight=0);g.refreshSize()}function p(){e.sort(function(a,c){return 0!==(a.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_FOLLOWING)?-1:1})}function r(){var a;for(a=0;a=(n.getBoundingClientRect().top-r.bottom)/c?b.style.top=Math.abs(n.getBoundingClientRect().top-r.bottom)/c+20+"px":b.style.top="0px"): +b.style.top="0px";l.style.left=f.getBoundingClientRect().width/c+"px";var f=l.style,n=l.getBoundingClientRect().left/c,k=l.getBoundingClientRect().top/c,r=b.getBoundingClientRect().left/c,p=b.getBoundingClientRect().top/c,q=0,I=0,q=r-n,q=q*q,I=p-k,I=I*I,n=Math.sqrt(q+I);f.width=n+"px";k=Math.asin((b.getBoundingClientRect().top-l.getBoundingClientRect().top)/(c*parseFloat(l.style.width)));l.style.transform="rotate("+k+"rad)";l.style.MozTransform="rotate("+k+"rad)";l.style.WebkitTransform="rotate("+ +k+"rad)";l.style.msTransform="rotate("+k+"rad)"}}function q(a){var c=e.indexOf(a),b=a.parentNode.parentNode;"div"===b.localName&&(b.parentNode.insertBefore(a,b),b.parentNode.removeChild(b));a=a.getAttributeNS(odf.Namespaces.officens,"name");a=l.querySelectorAll('span.webodf-annotationHighlight[annotation="'+a+'"]');for(var d,b=0;bp||k.bottom>p)g.scrollTop=k.bottom-k.top<=p-f?g.scrollTop+(k.bottom-p):g.scrollTop+(k.top-f);k.leftn&&(g.scrollLeft=k.right-k.left<=n-b?g.scrollLeft+(k.right-n):g.scrollLeft-(b-k.left))}}}; +(function(){function g(d,n,k,r,q){var e,l=0,a;for(a in d)if(d.hasOwnProperty(a)){if(l===k){e=a;break}l+=1}e?n.getPartData(d[e].href,function(a,m){if(a)runtime.log(a);else if(m){var h="@font-face { font-family: "+(d[e].family||e)+"; src: url(data:application/x-font-ttf;charset=binary;base64,"+b.convertUTF8ArrayToBase64(m)+') format("truetype"); }';try{r.insertRule(h,r.cssRules.length)}catch(l){runtime.log("Problem inserting rule in CSS: "+runtime.toJson(l)+"\nRule: "+h)}}else runtime.log("missing font data for "+ +d[e].href);g(d,n,k+1,r,q)}):q&&q()}var k=xmldom.XPath,d=odf.OdfUtils,b=new core.Base64;odf.FontLoader=function(){this.loadFonts=function(b,n){for(var p=b.rootElement.fontFaceDecls;n.cssRules.length;)n.deleteRule(n.cssRules.length-1);if(p){var r={},q,e,l,a;if(p)for(p=k.getODFElementsWithXPath(p,"style:font-face[svg:font-face-src]",odf.Namespaces.lookupNamespaceURI),q=0;q text|list-item:first-child > :not(text|list):first-child:before',u+="{",u+="counter-increment: "+p+" 0;",u+="}",g(b,u));for(;l.counterIdStack.length>=k;)l.counterIdStack.pop();l.counterIdStack.push(p);t=l.contentRules[k.toString()]||"";for(u=1;u<=k;u+=1)t=t.replace(u+"webodf-listLevel",l.counterIdStack[u-1]);u='text|list[webodfhelper|counter-id="'+r+'"] > text|list-item > :not(text|list):first-child:before'; +u+="{";u+=t;u+="counter-increment: "+p+";";u+="}";g(b,u)}for(h=h.firstElementChild;h;)d(c,h,f,l),h=h.nextElementSibling}else l.continuedCounterIdStack=[]}var f=0,a="",c={};this.createCounterRules=function(a,b,n){var g=b.getAttributeNS(p,"id"),r=[];n&&(n=n.getAttributeNS("urn:webodf:names:helper","counter-id"),r=c[n].slice(0));a=new k(a,r);g?g="Y"+g:(f+=1,g="X"+f);d(g,b,0,a);c[g+"-level1-1"]=a.counterIdStack};this.initialiseCreatedCounters=function(){var c;c="office|document{"+("counter-reset: "+a+ +";");c+="}";g(b,c)}}var b=odf.Namespaces.fons,f=odf.Namespaces.stylens,n=odf.Namespaces.textns,p=odf.Namespaces.xmlns,r={1:"decimal",a:"lower-latin",A:"upper-latin",i:"lower-roman",I:"upper-roman"};odf.ListStyleToCss=function(){function k(a){var b=m.parseLength(a);return b?c.convert(b.value,b.unit,"px"):(runtime.log("Could not parse value '"+a+"'."),0)}function e(a){return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function l(a,c){var b;a&&(b=a.getAttributeNS(n,"style-name"));return b===c}function a(a, +c,b){c=c.getElementsByTagNameNS(n,"list");a=new d(a);var m,g,k,q,t,A,I={},K;for(K=0;K text|list-item > text|list",--x;x=E&&E.getAttributeNS(b,"text-align")||"left";switch(x){case "end":x="right";break;case "start":x="left"}"label-alignment"===N?(D=O&&O.getAttributeNS(b,"margin-left")||"0px",J=O&&O.getAttributeNS(b,"text-indent")||"0px",R=O&&O.getAttributeNS(n,"label-followed-by"),O=k(D)):(D=E&&E.getAttributeNS(n,"space-before")||"0px",V=E&&E.getAttributeNS(n,"min-label-width")||"0px", +W=E&&E.getAttributeNS(n,"min-label-distance")||"0px",O=k(D)+k(V));E=p+" > text|list-item";E+="{";E+="margin-left: "+O+"px;";E+="}";g(e,E);E=p+" > text|list-item > text|list";E+="{";E+="margin-left: "+-O+"px;";E+="}";g(e,E);E=p+" > text|list-item > :not(text|list):first-child:before";E+="{";E+="text-align: "+x+";";E+="display: inline-block;";"label-alignment"===N?(E+="margin-left: "+J+";","listtab"===R&&(E+="padding-right: 0.2cm;")):(E+="min-width: "+V+";",E+="margin-left: "+(0===parseFloat(V)?"": +"-")+V+";",E+="padding-right: "+W+";");E+="}";g(e,E)}d=d.nextElementSibling}});a(c,e,m)}}})();odf.LazyStyleProperties=function(g,k){var d={};this.value=function(b){var f;d.hasOwnProperty(b)?f=d[b]:(f=k[b](),void 0===f&&g&&(f=g.value(b)),d[b]=f);return f};this.reset=function(b){g=b;d={}}}; +odf.StyleParseUtils=function(){function g(d){var b,f;d=(d=/(-?[0-9]*[0-9][0-9]*(\.[0-9]*)?|0+\.[0-9]*[1-9][0-9]*|\.[0-9]*[1-9][0-9]*)((cm)|(mm)|(in)|(pt)|(pc)|(px))/.exec(d))?{value:parseFloat(d[1]),unit:d[3]}:null;f=d&&d.unit;"px"===f?b=d.value:"cm"===f?b=d.value/2.54*96:"mm"===f?b=d.value/25.4*96:"in"===f?b=96*d.value:"pt"===f?b=d.value/.75:"pc"===f&&(b=16*d.value);return b}var k=odf.Namespaces.stylens;this.parseLength=g;this.parsePositiveLengthOrPercent=function(d,b,f){var n;d&&(n=parseFloat(d.substr(0, +d.indexOf("%"))),isNaN(n)&&(n=void 0));var k;void 0!==n?(f&&(k=f.value(b)),n=void 0===k?void 0:k/100*n):n=g(d);return n};this.getPropertiesElement=function(d,b,f){for(b=f?f.nextElementSibling:b.firstElementChild;null!==b&&(b.localName!==d||b.namespaceURI!==k);)b=b.nextElementSibling;return b};this.parseAttributeList=function(d){d&&(d=d.replace(/^\s*(.*?)\s*$/g,"$1"));return d&&0n.value&&(m="0.75pt"+h);h=m}else if(V.hasOwnProperty(e[1])){var m= +a,f=e[0],n=e[1],g=J.parseLength(h),r=void 0,p=void 0,q=void 0,O=void 0,q=void 0;if(g&&"%"===g.unit){r=g.value/100;p=k(m.parentNode);for(O="0";p;){if(q=y.getDirectChild(p,l,"paragraph-properties"))if(q=J.parseLength(q.getAttributeNS(f,n))){if("%"!==q.unit){O=q.value*r+q.unit;break}r*=q.value/100}p=k(p)}h=O}}e[2]&&(b+=e[2]+":"+h+";")}return b}function b(a,c,b,d){return c+c+b+b+d+d}function f(a,c){var b=[a],d=c.derivedStyles;Object.keys(d).forEach(function(a){a=f(a,d[a]);b=b.concat(a)});return b}function n(a, +c,b,d){function e(c,b){var d=[],h;c.forEach(function(a){m.forEach(function(c){d.push('draw|page[webodfhelper|page-style-name="'+c+'"] draw|frame[presentation|class="'+a+'"]')})});0 +z&&(a=z);for(c=Math.floor(a/d)*d;!b&&0<=c;)b=m[c],c-=d;for(b=b||x;b.nextBookmark&&b.nextBookmark.steps<=a;)e.check(),b=b.nextBookmark;runtime.assert(-1===a||b.steps<=a,"Bookmark @"+p(b)+" at step "+b.steps+" exceeds requested step of "+a);return b}function a(a){a.previousBookmark&&(a.previousBookmark.nextBookmark=a.nextBookmark);a.nextBookmark&&(a.nextBookmark.previousBookmark=a.previousBookmark)}function c(a){for(var c,b=null;!b&&a&&a!==k;)(c=q(a))&&(b=h[c])&&b.node!==a&&(runtime.log("Cloned node detected. Creating new bookmark"), +b=null,a.removeAttributeNS("urn:webodf:names:steps","nodeId")),a=a.parentNode;return b}var m={},h={},y=core.DomUtils,x,z,w=Node.DOCUMENT_POSITION_FOLLOWING,v=Node.DOCUMENT_POSITION_PRECEDING;this.updateBookmark=function(c,b){var g,n=Math.ceil(c/d)*d,p,v,E;if(void 0!==z&&zp.steps)m[n]=v;r()};this.setToClosestStep=function(a,c){var b;r();b=l(a);b.setIteratorPosition(c); +return b.steps};this.setToClosestDomPoint=function(a,b,d){var e,h;r();if(a===k&&0===b)e=x;else if(a===k&&b===k.childNodes.length)for(h in e=x,m)m.hasOwnProperty(h)&&(a=m[h],a.steps>e.steps&&(e=a));else if(e=c(a.childNodes.item(b)||a),!e)for(d.setUnfilteredPosition(a,b);!e&&d.previousNode();)e=c(d.getCurrentNode());e=e||x;void 0!==z&&e.steps>z&&(e=l(z));e.setIteratorPosition(d);return e.steps};this.damageCacheAfterStep=function(a){0>a&&(a=-1);void 0===z?z=a:aa)throw new RangeError("Requested steps is negative ("+a+")");for(b=p.setToClosestStep(a,k);bq.comparePoints(g,0,a,b),a=g,b=b?0:g.childNodes.length);k.setUnfilteredPosition(a,b);n(k,h)||k.setUnfilteredPosition(a,b);h=k.container();b=k.unfilteredDomOffset();a=p.setToClosestDomPoint(h,b,k);if(0>q.comparePoints(k.container(),k.unfilteredDomOffset(),h,b))return 0=e.textNode.length?null:e.textNode.splitText(e.offset));for(c=e.textNode;c!==a;){c=c.parentNode;m=c.cloneNode(!1);h&&m.appendChild(h);if(y)for(;y&&y.nextSibling;)m.appendChild(y.nextSibling);else for(;c.firstChild;)m.appendChild(c.firstChild);c.parentNode.insertBefore(m,c.nextSibling);y=c;h=m}p.isListItem(h)&&(h=h.childNodes.item(0));n?h.setAttributeNS(r,"text:style-name",n):h.removeAttributeNS(r,"style-name");0===e.textNode.length&& +e.textNode.parentNode.removeChild(e.textNode);d.emit(ops.OdtDocument.signalStepsInserted,{position:b});x&&f&&(d.moveCursor(g,b+1,0),d.emit(ops.Document.signalCursorMoved,x));d.fixCursorPositions();d.getOdfCanvas().refreshSize();d.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:l,memberId:g,timeStamp:k});d.emit(ops.OdtDocument.signalParagraphChanged,{paragraphElement:h,memberId:g,timeStamp:k});d.getOdfCanvas().rerenderAnnotations();return!0};this.spec=function(){return{optype:"SplitParagraph", +memberid:g,timestamp:k,position:b,sourceParagraphPosition:d,paragraphStyleName:n,moveCursor:f}}}; +ops.OpUpdateMember=function(){function g(d){var f="//dc:creator[@editinfo:memberid='"+k+"']";d=xmldom.XPath.getODFElementsWithXPath(d.getRootNode(),f,function(b){return"editinfo"===b?"urn:webodf:names:editinfo":odf.Namespaces.lookupNamespaceURI(b)});for(f=0;f=e.width&&(e=null),g.detach();else if(k.isCharacterElement(f.container)||k.isCharacterFrame(f.container))e=b.getBoundingClientRect(f.container); +return e}var k=odf.OdfUtils,d=new odf.StepUtils,b=core.DomUtils,f=core.StepDirection.NEXT,n=gui.StepInfo.VisualDirection.LEFT_TO_RIGHT,p=gui.StepInfo.VisualDirection.RIGHT_TO_LEFT;this.getContentRect=g;this.moveToFilteredStep=function(b,d,e){function l(a,b){b.process(w,h,k)&&(a=!0,!x&&b.token&&(x=b.token));return a}var a=d===f,c,m,h,k,x,z=b.snapshot();c=!1;var w;do c=g(b),w={token:b.snapshot(),container:b.container,offset:b.offset,direction:d,visualDirection:d===f?n:p},m=b.nextStep()?g(b):null,b.restore(w.token), +a?(h=c,k=m):(h=m,k=c),c=e.reduce(l,!1);while(!c&&b.advanceStep(d));c||e.forEach(function(a){!x&&a.token&&(x=a.token)});b.restore(x||z);return Boolean(x)}}; +gui.Caret=function(g,k,d,b){function f(){a.style.opacity="0"===a.style.opacity?"1":"0";t.trigger()}function n(){y.selectNodeContents(h);return y.getBoundingClientRect()}function p(a){return E[a]!==L[a]}function r(){Object.keys(L).forEach(function(a){E[a]=L[a]})}function q(){if(!1===L.isShown||g.getSelectionType()!==ops.OdtCursor.RangeSelection||!b&&!g.getSelectedRange().collapsed)L.visibility="hidden",a.style.visibility="hidden",t.cancel();else if(L.visibility="visible",a.style.visibility="visible", +!1===L.isFocused)a.style.opacity="1",t.cancel();else{if(A||p("visibility"))a.style.opacity="1",t.cancel();t.trigger()}if(K||I){var d;d=g.getNode();var e,h,f=z.getBoundingClientRect(x.getSizer()),q=!1,y=0;d.removeAttributeNS("urn:webodf:names:cursor","caret-sizer-active");if(0d.height&&(d={top:d.top-(8-d.height)/2,height:8,right:d.right});l.style.height=d.height+"px";l.style.top=d.top+"px"; +l.style.left=d.right-d.width+"px";l.style.width=d.width?d.width+"px":"";m&&(d=runtime.getWindow().getComputedStyle(g.getNode(),null),d.font?m.style.font=d.font:(m.style.fontStyle=d.fontStyle,m.style.fontVariant=d.fontVariant,m.style.fontWeight=d.fontWeight,m.style.fontSize=d.fontSize,m.style.lineHeight=d.lineHeight,m.style.fontFamily=d.fontFamily))}L.isShown&&I&&k.scrollIntoView(a.getBoundingClientRect());p("isFocused")&&c.markAsFocussed(L.isFocused);r();K=I=A=!1}function e(a){l.parentNode.removeChild(l); +h.parentNode.removeChild(h);a()}var l,a,c,m,h,y,x=g.getDocument().getCanvas(),z=core.DomUtils,w=new gui.GuiStepUtils,v,u,t,A=!1,I=!1,K=!1,L={isFocused:!1,isShown:!0,visibility:"hidden"},E={isFocused:!L.isFocused,isShown:!L.isShown,visibility:"hidden"};this.handleUpdate=function(){K=!0;u.trigger()};this.refreshCursorBlinking=function(){A=!0;u.trigger()};this.setFocus=function(){L.isFocused=!0;u.trigger()};this.removeFocus=function(){L.isFocused=!1;u.trigger()};this.show=function(){L.isShown=!0;u.trigger()}; +this.hide=function(){L.isShown=!1;u.trigger()};this.setAvatarImageUrl=function(a){c.setImageUrl(a)};this.setColor=function(b){a.style.borderColor=b;c.setColor(b)};this.getCursor=function(){return g};this.getFocusElement=function(){return a};this.toggleHandleVisibility=function(){c.isVisible()?c.hide():c.show()};this.showHandle=function(){c.show()};this.hideHandle=function(){c.hide()};this.setOverlayElement=function(a){m=a;l.appendChild(a);K=!0;u.trigger()};this.ensureVisible=function(){I=!0;u.trigger()}; +this.getBoundingClientRect=function(){return z.getBoundingClientRect(l)};this.destroy=function(a){core.Async.destroyAll([u.destroy,t.destroy,c.destroy,e],a)};(function(){var b=g.getDocument(),e=[b.createRootFilter(g.getMemberId()),b.getPositionFilter()],m=b.getDOMDocument();y=m.createRange();h=m.createElement("span");h.className="webodf-caretSizer";h.textContent="|";g.getNode().appendChild(h);l=m.createElement("div");l.setAttributeNS("urn:webodf:names:editinfo","editinfo:memberid",g.getMemberId()); +l.className="webodf-caretOverlay";a=m.createElement("div");a.className="caret";l.appendChild(a);c=new gui.Avatar(l,d);x.getSizer().appendChild(l);v=b.createStepIterator(g.getNode(),0,e,b.getRootNode());u=core.Task.createRedrawTask(q);t=core.Task.createTimeoutTask(f,500);u.triggerImmediate()})()}; +odf.TextSerializer=function(){function g(b){var f="",n=k.filter?k.filter.acceptNode(b):NodeFilter.FILTER_ACCEPT,p=b.nodeType,r;if((n===NodeFilter.FILTER_ACCEPT||n===NodeFilter.FILTER_SKIP)&&d.isTextContentContainingNode(b))for(r=b.firstChild;r;)f+=g(r),r=r.nextSibling;n===NodeFilter.FILTER_ACCEPT&&(p===Node.ELEMENT_NODE&&d.isParagraph(b)?f+="\n":p===Node.TEXT_NODE&&b.textContent&&(f+=b.textContent));return f}var k=this,d=odf.OdfUtils;this.filter=null;this.writeToString=function(b){if(!b)return""; +b=g(b);"\n"===b[b.length-1]&&(b=b.substr(0,b.length-1));return b}};gui.MimeDataExporter=function(){var g;this.exportRangeToDataTransfer=function(k,d){var b;b=d.startContainer.ownerDocument.createElement("span");b.appendChild(d.cloneContents());b=g.writeToString(b);try{k.setData("text/plain",b)}catch(f){k.setData("Text",b)}};g=new odf.TextSerializer;g.filter=new odf.OdfNodeFilter}; +gui.Clipboard=function(g){this.setDataFromRange=function(k,d){var b,f=k.clipboardData;b=runtime.getWindow();!f&&b&&(f=b.clipboardData);f?(b=!0,g.exportRangeToDataTransfer(f,d),k.preventDefault()):b=!1;return b}}; +gui.SessionContext=function(g,k){var d=g.getOdtDocument(),b=odf.OdfUtils;this.isLocalCursorWithinOwnAnnotation=function(){var f=d.getCursor(k),g;if(!f)return!1;g=f&&f.getNode();f=d.getMember(k).getProperties().fullName;return(g=b.getParentAnnotation(g,d.getRootNode()))&&b.getAnnotationCreator(g)===f?!0:!1}}; +gui.StyleSummary=function(g){function k(b,d){var k=b+"|"+d,q;f.hasOwnProperty(k)||(q=[],g.forEach(function(e){e=(e=e.styleProperties[b])&&e[d];-1===q.indexOf(e)&&q.push(e)}),f[k]=q);return f[k]}function d(b,d,f){return function(){var g=k(b,d);return f.length>=g.length&&g.every(function(b){return-1!==f.indexOf(b)})}}function b(b,d){var f=k(b,d);return 1===f.length?f[0]:void 0}var f={};this.getPropertyValues=k;this.getCommonValue=b;this.isBold=d("style:text-properties","fo:font-weight",["bold"]);this.isItalic= +d("style:text-properties","fo:font-style",["italic"]);this.hasUnderline=d("style:text-properties","style:text-underline-style",["solid"]);this.hasStrikeThrough=d("style:text-properties","style:text-line-through-style",["solid"]);this.fontSize=function(){var d=b("style:text-properties","fo:font-size");return d&&parseFloat(d)};this.fontName=function(){return b("style:text-properties","style:font-name")};this.isAlignedLeft=d("style:paragraph-properties","fo:text-align",["left","start"]);this.isAlignedCenter= +d("style:paragraph-properties","fo:text-align",["center"]);this.isAlignedRight=d("style:paragraph-properties","fo:text-align",["right","end"]);this.isAlignedJustified=d("style:paragraph-properties","fo:text-align",["justify"]);this.text={isBold:this.isBold,isItalic:this.isItalic,hasUnderline:this.hasUnderline,hasStrikeThrough:this.hasStrikeThrough,fontSize:this.fontSize,fontName:this.fontName};this.paragraph={isAlignedLeft:this.isAlignedLeft,isAlignedCenter:this.isAlignedCenter,isAlignedRight:this.isAlignedRight, +isAlignedJustified:this.isAlignedJustified}}; +gui.DirectFormattingController=function(g,k,d,b,f,n,p){function r(){return U.value().styleSummary}function q(){return U.value().enabledFeatures}function e(a){var b;a.collapsed?(b=a.startContainer,b.hasChildNodes()&&a.startOffseta.clientWidth||a.scrollHeight>a.clientHeight)&&c.push(new l(a)),a=a.parentNode;c.push(new e(v));return c}function w(){var a; +h()||(a=z(K),x(),K.focus(),a.forEach(function(a){a.restore()}))}var v=runtime.getWindow(),u={beforecut:!0,beforepaste:!0,longpress:!0,drag:!0,dragstop:!0},t={mousedown:!0,mouseup:!0,focus:!0},A={},I={},K,L=g.getCanvas().getElement(),E=this,N={};this.addFilter=function(c,b){a(c,!0).filters.push(b)};this.removeFilter=function(c,b){var d=a(c,!0),e=d.filters.indexOf(b);-1!==e&&d.filters.splice(e,1)};this.subscribe=c;this.unsubscribe=m;this.hasFocus=h;this.focus=w;this.getEventTrap=function(){return K}; +this.setEditing=function(a){var c=h();c&&K.blur();a?K.removeAttribute("readOnly"):K.setAttribute("readOnly","true");c&&w()};this.destroy=function(a){m("touchstart",q);Object.keys(N).forEach(function(a){b(parseInt(a,10))});N.length=0;Object.keys(A).forEach(function(a){A[a].destroy()});A={};m("mousedown",y);m("mouseup",x);m("contextmenu",x);Object.keys(I).forEach(function(a){I[a].destroy()});I={};K.parentNode.removeChild(K);a()};(function(){var a=g.getOdfCanvas().getSizer(),b=a.ownerDocument;runtime.assert(Boolean(v), +"EventManager requires a window object to operate correctly");K=b.createElement("textarea");K.id="eventTrap";K.setAttribute("tabindex","-1");K.setAttribute("readOnly","true");K.setAttribute("rows","1");a.appendChild(K);c("mousedown",y);c("mouseup",x);c("contextmenu",x);A.longpress=new d("longpress",["touchstart","touchmove","touchend"],n);A.drag=new d("drag",["touchstart","touchmove","touchend"],p);A.dragstop=new d("dragstop",["drag","touchend"],r);c("touchstart",q)})()}; +gui.IOSSafariSupport=function(g){function k(){d.innerHeight!==d.outerHeight&&(b.style.display="none",runtime.requestAnimationFrame(function(){b.style.display="block"}))}var d=runtime.getWindow(),b=g.getEventTrap();this.destroy=function(d){g.unsubscribe("focus",k);b.removeAttribute("autocapitalize");b.style.WebkitTransform="";d()};g.subscribe("focus",k);b.setAttribute("autocapitalize","off");b.style.WebkitTransform="translateX(-10000px)"}; +gui.HyperlinkController=function(g,k,d,b){function f(){var b=!0;!0===k.getState(gui.CommonConstraints.EDIT.REVIEW_MODE)&&(b=d.isLocalCursorWithinOwnAnnotation());b!==e&&(e=b,q.emit(gui.HyperlinkController.enabledChanged,e))}function n(d){d.getMemberId()===b&&f()}var p=odf.OdfUtils,r=g.getOdtDocument(),q=new core.EventNotifier([gui.HyperlinkController.enabledChanged]),e=!1;this.isEnabled=function(){return e};this.subscribe=function(b,a){q.subscribe(b,a)};this.unsubscribe=function(b,a){q.unsubscribe(b, +a)};this.addHyperlink=function(d,a){if(e){var c=r.getCursorSelection(b),f=new ops.OpApplyHyperlink,h=[];if(0===c.length||a)a=a||d,f=new ops.OpInsertText,f.init({memberid:b,position:c.position,text:a}),c.length=a.length,h.push(f);f=new ops.OpApplyHyperlink;f.init({memberid:b,position:c.position,length:c.length,hyperlink:d});h.push(f);g.enqueue(h)}};this.removeHyperlinks=function(){if(e){var d=r.createPositionIterator(r.getRootNode()),a=r.getCursor(b).getSelectedRange(),c=p.getHyperlinkElements(a), +f=a.collapsed&&1===c.length,h=r.getDOMDocument().createRange(),k=[],n,q;0!==c.length&&(c.forEach(function(a){h.selectNodeContents(a);n=r.convertDomToCursorRange({anchorNode:h.startContainer,anchorOffset:h.startOffset,focusNode:h.endContainer,focusOffset:h.endOffset});q=new ops.OpRemoveHyperlink;q.init({memberid:b,position:n.position,length:n.length});k.push(q)}),f||(f=c[0],-1===a.comparePoint(f,0)&&(h.setStart(f,0),h.setEnd(a.startContainer,a.startOffset),n=r.convertDomToCursorRange({anchorNode:h.startContainer, +anchorOffset:h.startOffset,focusNode:h.endContainer,focusOffset:h.endOffset}),0k.width&&(v=k.width/n.width);n.height>k.height&&(u=k.height/n.height);k=Math.min(v,u);n= +{width:n.width*k,height:n.height*k}}k=p.convert(n.width,"px","cm")+"cm";p=p.convert(n.height,"px","cm")+"cm";u=e.getOdfCanvas().odfContainer().rootElement.styles;n=c.toLowerCase();var v=r.hasOwnProperty(n)?r[n]:null,t;n=[];runtime.assert(null!==v,"Image type is not supported: "+c);v="Pictures/"+f.generateImageName()+v;t=new ops.OpSetBlob;t.init({memberid:b,filename:v,mimetype:c,content:d});n.push(t);a.getStyleElement("Graphics","graphic",[u])||(c=new ops.OpAddStyle,c.init({memberid:b,styleName:"Graphics", +styleFamily:"graphic",isAutomaticStyle:!1,setProperties:{"style:graphic-properties":{"text:anchor-type":"paragraph","svg:x":"0cm","svg:y":"0cm","style:wrap":"dynamic","style:number-wrapped-paragraphs":"no-limit","style:wrap-contour":"false","style:vertical-pos":"top","style:vertical-rel":"paragraph","style:horizontal-pos":"center","style:horizontal-rel":"paragraph"}}}),n.push(c));c=f.generateStyleName();d=new ops.OpAddStyle;d.init({memberid:b,styleName:c,styleFamily:"graphic",isAutomaticStyle:!0, +setProperties:{"style:parent-style-name":"Graphics","style:graphic-properties":{"style:vertical-pos":"top","style:vertical-rel":"baseline","style:horizontal-pos":"center","style:horizontal-rel":"paragraph","fo:background-color":"transparent","style:background-transparency":"100%","style:shadow":"none","style:mirror":"none","fo:clip":"rect(0cm, 0cm, 0cm, 0cm)","draw:luminance":"0%","draw:contrast":"0%","draw:red":"0%","draw:green":"0%","draw:blue":"0%","draw:gamma":"100%","draw:color-inversion":"false", +"draw:image-opacity":"100%","draw:color-mode":"standard"}}});n.push(d);t=new ops.OpInsertImage;t.init({memberid:b,position:e.getCursorPosition(b),filename:v,frameWidth:k,frameHeight:p,frameStyleName:c,frameName:f.generateFrameName()});n.push(t);g.enqueue(n)}};this.destroy=function(a){e.unsubscribe(ops.Document.signalCursorMoved,p);k.unsubscribe(gui.CommonConstraints.EDIT.REVIEW_MODE,n);a()};e.subscribe(ops.Document.signalCursorMoved,p);k.subscribe(gui.CommonConstraints.EDIT.REVIEW_MODE,n);n()}; +gui.ImageController.enabledChanged="enabled/changed"; +gui.ImageSelector=function(g){function k(){var d=g.getSizer(),k=f.createElement("div");k.id="imageSelector";k.style.borderWidth="1px";d.appendChild(k);b.forEach(function(b){var d=f.createElement("div");d.className=b;k.appendChild(d)});return k}var d=odf.Namespaces.svgns,b="topLeft topRight bottomRight bottomLeft topMiddle rightMiddle bottomMiddle leftMiddle".split(" "),f=g.getElement().ownerDocument,n=!1;this.select=function(b){var r,q,e=f.getElementById("imageSelector");e||(e=k());n=!0;r=e.parentNode; +q=b.getBoundingClientRect();var l=r.getBoundingClientRect(),a=g.getZoomLevel();r=(q.left-l.left)/a-1;q=(q.top-l.top)/a-1;e.style.display="block";e.style.left=r+"px";e.style.top=q+"px";e.style.width=b.getAttributeNS(d,"width");e.style.height=b.getAttributeNS(d,"height")};this.clearSelection=function(){var b;n&&(b=f.getElementById("imageSelector"))&&(b.style.display="none");n=!1};this.isSelectorElement=function(b){var d=f.getElementById("imageSelector");return d?b===d||b.parentNode===d:!1}}; +(function(){function g(g){function d(b){p=b.which&&String.fromCharCode(b.which)===n;n=void 0;return!1===p}function b(){p=!1}function f(b){n=b.data;p=!1}var n,p=!1;this.destroy=function(n){g.unsubscribe("textInput",b);g.unsubscribe("compositionend",f);g.removeFilter("keypress",d);n()};g.subscribe("textInput",b);g.subscribe("compositionend",f);g.addFilter("keypress",d)}gui.InputMethodEditor=function(k,d){function b(c){a&&(c?a.getNode().setAttributeNS("urn:webodf:names:cursor","composing","true"):(a.getNode().removeAttributeNS("urn:webodf:names:cursor", +"composing"),h.textContent=""))}function f(){x&&(x=!1,b(!1),w.emit(gui.InputMethodEditor.signalCompositionEnd,{data:z}),z="")}function n(){I||(I=!0,f(),a&&a.getSelectedRange().collapsed?c.value="":c.value=u.writeToString(a.getSelectedRange().cloneContents()),c.setSelectionRange(0,c.value.length),I=!1)}function p(){d.hasFocus()&&y.trigger()}function r(){v=void 0;y.cancel();b(!0);x||w.emit(gui.InputMethodEditor.signalCompositionStart,{data:""})}function q(a){a=v=a.data;x=!0;z+=a;y.trigger()}function e(a){a.data!== +v&&(a=a.data,x=!0,z+=a,y.trigger());v=void 0}function l(){h.textContent=c.value}var a=null,c=d.getEventTrap(),m=c.ownerDocument,h,y,x=!1,z="",w=new core.EventNotifier([gui.InputMethodEditor.signalCompositionStart,gui.InputMethodEditor.signalCompositionEnd]),v,u,t=[],A,I=!1;this.subscribe=w.subscribe;this.unsubscribe=w.unsubscribe;this.registerCursor=function(c){c.getMemberId()===k&&(a=c,a.getNode().appendChild(h),c.subscribe(ops.OdtCursor.signalCursorUpdated,p),d.subscribe("input",l),d.subscribe("compositionupdate", +l))};this.removeCursor=function(c){a&&c===k&&(a.getNode().removeChild(h),a.unsubscribe(ops.OdtCursor.signalCursorUpdated,p),d.unsubscribe("input",l),d.unsubscribe("compositionupdate",l),a=null)};this.destroy=function(a){d.unsubscribe("compositionstart",r);d.unsubscribe("compositionend",q);d.unsubscribe("textInput",e);d.unsubscribe("keypress",f);d.unsubscribe("focus",n);core.Async.destroyAll(A,a)};(function(){u=new odf.TextSerializer;u.filter=new odf.OdfNodeFilter;d.subscribe("compositionstart",r); +d.subscribe("compositionend",q);d.subscribe("textInput",e);d.subscribe("keypress",f);d.subscribe("focus",n);t.push(new g(d));A=t.map(function(a){return a.destroy});h=m.createElement("span");h.setAttribute("id","composer");y=core.Task.createTimeoutTask(n,1);A.push(y.destroy)})()};gui.InputMethodEditor.signalCompositionStart="input/compositionstart";gui.InputMethodEditor.signalCompositionEnd="input/compositionend"})(); +gui.MetadataController=function(g,k){function d(b){n.emit(gui.MetadataController.signalMetadataChanged,b)}function b(b){var d=-1===p.indexOf(b);d||runtime.log("Setting "+b+" is restricted.");return d}var f=g.getOdtDocument(),n=new core.EventNotifier([gui.MetadataController.signalMetadataChanged]),p=["dc:creator","dc:date","meta:editing-cycles","meta:editing-duration","meta:document-statistic"];this.setMetadata=function(d,f){var e={},l="",a;d&&Object.keys(d).filter(b).forEach(function(a){e[a]=d[a]}); +f&&(l=f.filter(b).join(","));if(0f:!1}function d(b){null!==b&&!1===k(b)&&(f=Math.abs(b-g))}var b=this,f,n=gui.StepInfo.VisualDirection.LEFT_TO_RIGHT;this.token=void 0;this.process=function(f,g,q){var e,l;f.visualDirection===n?(e=g&&g.right,l=q&&q.left):(e=g&&g.left,l=q&&q.right);if(k(e)||k(l))return!0;if(g||q)d(e),d(l),b.token=f.token;return!1}}; +gui.LineBoundaryScanner=function(){var g=this,k=null;this.token=void 0;this.process=function(d,b,f){var n;if(n=f)if(k){var p=k;n=Math.min(p.bottom-p.top,f.bottom-f.top);var r=Math.max(p.top,f.top),p=Math.min(p.bottom,f.bottom)-r;n=.4>=(0b?a.previousSibling:a.nextSibling,c(f)===NodeFilter.FILTER_ACCEPT&&(d=f),a=a.parentNode;return d}function b(a,b){var c;return null===a?m.NO_NEIGHBOUR:p.isCharacterElement(a)?m.SPACE_CHAR:a.nodeType===f||p.isTextSpan(a)||p.isHyperlink(a)?(c=a.textContent.charAt(b()),q.test(c)?m.SPACE_CHAR:r.test(c)?m.PUNCTUATION_CHAR:m.WORD_CHAR):m.OTHER}var f=Node.TEXT_NODE,n=Node.ELEMENT_NODE, +p=odf.OdfUtils,r=/[!-#%-*,-\/:-;?-@\[-\]_{}\u00a1\u00ab\u00b7\u00bb\u00bf;\u00b7\u055a-\u055f\u0589-\u058a\u05be\u05c0\u05c3\u05c6\u05f3-\u05f4\u0609-\u060a\u060c-\u060d\u061b\u061e-\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0964-\u0965\u0970\u0df4\u0e4f\u0e5a-\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u104a-\u104f\u10fb\u1361-\u1368\u166d-\u166e\u169b-\u169c\u16eb-\u16ed\u1735-\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944-\u1945\u19de-\u19df\u1a1e-\u1a1f\u1b5a-\u1b60\u1c3b-\u1c3f\u1c7e-\u1c7f\u2000-\u206e\u207d-\u207e\u208d-\u208e\u3008-\u3009\u2768-\u2775\u27c5-\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc-\u29fd\u2cf9-\u2cfc\u2cfe-\u2cff\u2e00-\u2e7e\u3000-\u303f\u30a0\u30fb\ua60d-\ua60f\ua673\ua67e\ua874-\ua877\ua8ce-\ua8cf\ua92e-\ua92f\ua95f\uaa5c-\uaa5f\ufd3e-\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a-\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a-\uff1b\uff1f-\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]|\ud800[\udd00-\udd01\udf9f\udfd0]|\ud802[\udd1f\udd3f\ude50-\ude58]|\ud809[\udc00-\udc7e]/, +q=/\s/,e=core.PositionFilter.FilterResult.FILTER_ACCEPT,l=core.PositionFilter.FilterResult.FILTER_REJECT,a=odf.WordBoundaryFilter.IncludeWhitespace.TRAILING,c=odf.WordBoundaryFilter.IncludeWhitespace.LEADING,m={NO_NEIGHBOUR:0,SPACE_CHAR:1,PUNCTUATION_CHAR:2,WORD_CHAR:3,OTHER:4};this.acceptPosition=function(f){var g=f.container(),p=f.leftNode(),r=f.rightNode(),q=f.unfilteredDomOffset,v=function(){return f.unfilteredDomOffset()-1};g.nodeType===n&&(null===r&&(r=d(g,1,f.getNodeFilter())),null===p&&(p= +d(g,-1,f.getNodeFilter())));g!==r&&(q=function(){return 0});g!==p&&null!==p&&(v=function(){return p.textContent.length-1});g=b(p,v);r=b(r,q);return g===m.WORD_CHAR&&r===m.WORD_CHAR||g===m.PUNCTUATION_CHAR&&r===m.PUNCTUATION_CHAR||k===a&&g!==m.NO_NEIGHBOUR&&r===m.SPACE_CHAR||k===c&&g===m.SPACE_CHAR&&r!==m.NO_NEIGHBOUR?l:e}};odf.WordBoundaryFilter.IncludeWhitespace={None:0,TRAILING:1,LEADING:2}; +gui.SelectionController=function(g,k){function d(a){var b=a.spec();if(a.isEdit||b.memberid===k)I=void 0,K.cancel()}function b(){var a=x.getCursor(k).getNode();return x.createStepIterator(a,0,[v,t],x.getRootElement(a))}function f(a,b,c){c=new odf.WordBoundaryFilter(x,c);var d=x.getRootElement(a)||x.getRootNode(),e=x.createRootFilter(d);return x.createStepIterator(a,b,[v,e,c],d)}function n(a,b){return b?{anchorNode:a.startContainer,anchorOffset:a.startOffset,focusNode:a.endContainer,focusOffset:a.endOffset}: +{anchorNode:a.endContainer,anchorOffset:a.endOffset,focusNode:a.startContainer,focusOffset:a.startOffset}}function p(a,b,c){var d=new ops.OpMoveCursor;d.init({memberid:k,position:a,length:b||0,selectionType:c});return d}function r(a,b,c){var d;d=x.getCursor(k);d=n(d.getSelectedRange(),d.hasForwardSelection());d.focusNode=a;d.focusOffset=b;c||(d.anchorNode=d.focusNode,d.anchorOffset=d.focusOffset);a=x.convertDomToCursorRange(d);g.enqueue([p(a.position,a.length)])}function q(a){var b;b=f(a.startContainer, +a.startOffset,L);b.roundToPreviousStep()&&a.setStart(b.container(),b.offset());b=f(a.endContainer,a.endOffset,E);b.roundToNextStep()&&a.setEnd(b.container(),b.offset())}function e(a){var b=w.getParagraphElements(a),c=b[0],b=b[b.length-1];c&&a.setStart(c,0);b&&(w.isParagraph(a.endContainer)&&0===a.endOffset?a.setEndBefore(b):a.setEnd(b,b.childNodes.length))}function l(a,b,c,d){var e,f;d?(e=c.startContainer,f=c.startOffset):(e=c.endContainer,f=c.endOffset);z.containsNode(a,e)||(f=0>z.comparePoints(a, +0,e,f)?0:a.childNodes.length,e=a);a=x.createStepIterator(e,f,b,w.getParagraphElement(e)||a);a.roundToClosestStep()||runtime.assert(!1,"No step found in requested range");d?c.setStart(a.container(),a.offset()):c.setEnd(a.container(),a.offset())}function a(a,c){var d=b();d.advanceStep(a)&&r(d.container(),d.offset(),c)}function c(a,c){var d,e=I,f=[new gui.LineBoundaryScanner,new gui.ParagraphBoundaryScanner];void 0===e&&A&&(e=A());isNaN(e)||(d=b(),u.moveToFilteredStep(d,a,f)&&d.advanceStep(a)&&(f=[new gui.ClosestXOffsetScanner(e), +new gui.LineBoundaryScanner,new gui.ParagraphBoundaryScanner],u.moveToFilteredStep(d,a,f)&&(r(d.container(),d.offset(),c),I=e,K.restart())))}function m(a,c){var d=b(),e=[new gui.LineBoundaryScanner,new gui.ParagraphBoundaryScanner];u.moveToFilteredStep(d,a,e)&&r(d.container(),d.offset(),c)}function h(a,b){var c=x.getCursor(k),c=n(c.getSelectedRange(),c.hasForwardSelection()),c=f(c.focusNode,c.focusOffset,L);c.advanceStep(a)&&r(c.container(),c.offset(),b)}function y(a,b,c){var d=!1,e=x.getCursor(k), +e=n(e.getSelectedRange(),e.hasForwardSelection()),d=x.getRootElement(e.focusNode);runtime.assert(Boolean(d),"SelectionController: Cursor outside root");e=x.createStepIterator(e.focusNode,e.focusOffset,[v,t],d);e.roundToClosestStep();e.advanceStep(a)&&(c=c(e.container()))&&(a===N?(e.setPosition(c,0),d=e.roundToNextStep()):(e.setPosition(c,c.childNodes.length),d=e.roundToPreviousStep()),d&&r(e.container(),e.offset(),b))}var x=g.getOdtDocument(),z=core.DomUtils,w=odf.OdfUtils,v=x.getPositionFilter(), +u=new gui.GuiStepUtils,t=x.createRootFilter(k),A=null,I,K,L=odf.WordBoundaryFilter.IncludeWhitespace.TRAILING,E=odf.WordBoundaryFilter.IncludeWhitespace.LEADING,N=core.StepDirection.PREVIOUS,O=core.StepDirection.NEXT;this.selectionToRange=function(a){var b=0<=z.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset),c=a.focusNode.ownerDocument.createRange();b?(c.setStart(a.anchorNode,a.anchorOffset),c.setEnd(a.focusNode,a.focusOffset)):(c.setStart(a.focusNode,a.focusOffset),c.setEnd(a.anchorNode, +a.anchorOffset));return{range:c,hasForwardSelection:b}};this.rangeToSelection=n;this.selectImage=function(a){var c=x.getRootElement(a),b=x.createRootFilter(c),c=x.createStepIterator(a,0,[b,x.getPositionFilter()],c),d;c.roundToPreviousStep()||runtime.assert(!1,"No walkable position before frame");b=c.container();d=c.offset();c.setPosition(a,a.childNodes.length);c.roundToNextStep()||runtime.assert(!1,"No walkable position after frame");a=x.convertDomToCursorRange({anchorNode:b,anchorOffset:d,focusNode:c.container(), +focusOffset:c.offset()});a=p(a.position,a.length,ops.OdtCursor.RegionSelection);g.enqueue([a])};this.expandToWordBoundaries=q;this.expandToParagraphBoundaries=e;this.selectRange=function(a,c,b){var d=x.getOdfCanvas().getElement(),f,h=[v];f=z.containsNode(d,a.startContainer);d=z.containsNode(d,a.endContainer);if(f||d)if(f&&d&&(2===b?q(a):3<=b&&e(a)),(b=c?x.getRootElement(a.startContainer):x.getRootElement(a.endContainer))||(b=x.getRootNode()),h.push(x.createRootFilter(b)),l(b,h,a,!0),l(b,h,a,!1),a= +n(a,c),c=x.convertDomToCursorRange(a),a=x.getCursorSelection(k),c.position!==a.position||c.length!==a.length)a=p(c.position,c.length,ops.OdtCursor.RangeSelection),g.enqueue([a])};this.moveCursorToLeft=function(){a(N,!1);return!0};this.moveCursorToRight=function(){a(O,!1);return!0};this.extendSelectionToLeft=function(){a(N,!0);return!0};this.extendSelectionToRight=function(){a(O,!0);return!0};this.setCaretXPositionLocator=function(a){A=a};this.moveCursorUp=function(){c(N,!1);return!0};this.moveCursorDown= +function(){c(O,!1);return!0};this.extendSelectionUp=function(){c(N,!0);return!0};this.extendSelectionDown=function(){c(O,!0);return!0};this.moveCursorBeforeWord=function(){h(N,!1);return!0};this.moveCursorPastWord=function(){h(O,!1);return!0};this.extendSelectionBeforeWord=function(){h(N,!0);return!0};this.extendSelectionPastWord=function(){h(O,!0);return!0};this.moveCursorToLineStart=function(){m(N,!1);return!0};this.moveCursorToLineEnd=function(){m(O,!1);return!0};this.extendSelectionToLineStart= +function(){m(N,!0);return!0};this.extendSelectionToLineEnd=function(){m(O,!0);return!0};this.extendSelectionToParagraphStart=function(){y(N,!0,w.getParagraphElement);return!0};this.extendSelectionToParagraphEnd=function(){y(O,!0,w.getParagraphElement);return!0};this.moveCursorToParagraphStart=function(){y(N,!1,w.getParagraphElement);return!0};this.moveCursorToParagraphEnd=function(){y(O,!1,w.getParagraphElement);return!0};this.moveCursorToDocumentStart=function(){y(N,!1,x.getRootElement);return!0}; +this.moveCursorToDocumentEnd=function(){y(O,!1,x.getRootElement);return!0};this.extendSelectionToDocumentStart=function(){y(N,!0,x.getRootElement);return!0};this.extendSelectionToDocumentEnd=function(){y(O,!0,x.getRootElement);return!0};this.extendSelectionToEntireDocument=function(){var a=x.getCursor(k),a=x.getRootElement(a.getNode()),c,b,d;runtime.assert(Boolean(a),"SelectionController: Cursor outside root");d=x.createStepIterator(a,0,[v,t],a);d.roundToClosestStep();c=d.container();b=d.offset(); +d.setPosition(a,a.childNodes.length);d.roundToClosestStep();a=x.convertDomToCursorRange({anchorNode:c,anchorOffset:b,focusNode:d.container(),focusOffset:d.offset()});g.enqueue([p(a.position,a.length)]);return!0};this.destroy=function(a){x.unsubscribe(ops.OdtDocument.signalOperationStart,d);core.Async.destroyAll([K.destroy],a)};(function(){K=core.Task.createTimeoutTask(function(){I=void 0},2E3);x.subscribe(ops.OdtDocument.signalOperationStart,d)})()}; +gui.TextController=function(g,k,d,b,f,n){function p(){y=!0===k.getState(gui.CommonConstraints.EDIT.REVIEW_MODE)?d.isLocalCursorWithinOwnAnnotation():!0}function r(a){a.getMemberId()===b&&p()}function q(a,b,d){var e=[c.getPositionFilter()];d&&e.push(c.createRootFilter(a.startContainer));d=c.createStepIterator(a.startContainer,a.startOffset,e,b);d.roundToClosestStep()||runtime.assert(!1,"No walkable step found in paragraph element at range start");b=c.convertDomPointToCursorStep(d.container(),d.offset()); +a.collapsed?a=b:(d.setPosition(a.endContainer,a.endOffset),d.roundToClosestStep()||runtime.assert(!1,"No walkable step found in paragraph element at range end"),a=c.convertDomPointToCursorStep(d.container(),d.offset()));return{position:b,length:a-b}}function e(a){var c,d,e,f=m.getParagraphElements(a),g=a.cloneRange(),l=[];c=f[0];1a.length&&(a.position+=a.length,a.length=-a.length);return a}function a(a){if(!y)return!1;var d,f=c.getCursor(b).getSelectedRange().cloneRange(), +h=l(c.getCursorSelection(b)),m;if(0===h.length){h=void 0;d=c.getCursor(b).getNode();m=c.getRootElement(d);var k=[c.getPositionFilter(),c.createRootFilter(m)];m=c.createStepIterator(d,0,k,m);m.roundToClosestStep()&&(a?m.nextStep():m.previousStep())&&(h=l(c.convertDomToCursorRange({anchorNode:d,anchorOffset:0,focusNode:m.container(),focusOffset:m.offset()})),a?(f.setStart(d,0),f.setEnd(m.container(),m.offset())):(f.setStart(m.container(),m.offset()),f.setEnd(d,0)))}h&&g.enqueue(e(f));return void 0!== +h}var c=g.getOdtDocument(),m=odf.OdfUtils,h=core.DomUtils,y=!1,x=odf.Namespaces.textns,z=core.StepDirection.NEXT;this.isEnabled=function(){return y};this.enqueueParagraphSplittingOps=function(){if(!y)return!1;var a=c.getCursor(b),d=a.getSelectedRange(),f=l(c.getCursorSelection(b)),h=[],a=m.getParagraphElement(a.getNode()),k=a.getAttributeNS(x,"style-name")||"";0d.left&&(d=v(e)))c.focusNode=d.container,c.focusOffset=d.offset, +b&&(c.anchorNode=c.focusNode,c.anchorOffset=c.focusOffset)}else S.isImage(c.focusNode.firstChild)&&1===c.focusOffset&&S.isCharacterFrame(c.focusNode)&&(d=v(c.focusNode))&&(c.anchorNode=c.focusNode=d.container,c.anchorOffset=c.focusOffset=d.offset);c.anchorNode&&c.focusNode&&(c=T.selectionToRange(c),T.selectRange(c.range,c.hasForwardSelection,0===a.button?a.detail:0));F.focus()}function t(a){var c;if(c=n(a.clientX,a.clientY))a=c.container,c=c.offset,a={anchorNode:a,anchorOffset:c,focusNode:a,focusOffset:c}, +a=T.selectionToRange(a),T.selectRange(a.range,a.hasForwardSelection,2),F.focus()}function A(a){var c=a.target||a.srcElement||null,d,e,f;ma.processRequests();U&&(S.isImage(c)&&S.isCharacterFrame(c.parentNode)&&W.getSelection().isCollapsed?(T.selectImage(c.parentNode),F.focus()):la.isSelectorElement(c)?F.focus():B?(c=b.getSelectedRange(),e=c.collapsed,S.isImage(c.endContainer)&&0===c.endOffset&&S.isCharacterFrame(c.endContainer.parentNode)&&(f=c.endContainer.parentNode,f=v(f))&&(c.setEnd(f.container, +f.offset),e&&c.collapse(!1)),T.selectRange(c,b.hasForwardSelection(),0===a.button?a.detail:0),F.focus()):ua?u(a):(d=aa.cloneEvent(a),M=runtime.setTimeout(function(){u(d)},0)),oa=0,B=U=!1)}function I(a){var c=J.getCursor(d).getSelectedRange();c.collapsed||fa.exportRangeToDataTransfer(a.dataTransfer,c)}function K(){U&&F.focus();oa=0;B=U=!1}function L(a){A(a)}function E(a){var c=a.target||a.srcElement||null,b=null;"annotationRemoveButton"===c.className?(runtime.assert(ja,"Remove buttons are displayed on annotations while annotation editing is disabled in the controller."), +b=c.parentNode.getElementsByTagNameNS(odf.Namespaces.officens,"annotation").item(0),ca.removeAnnotation(b),F.focus()):"webodf-draggable"!==c.getAttribute("class")&&A(a)}function N(a){(a=a.data)&&(-1===a.indexOf("\n")?da.insertText(a):ea.paste(a))}function O(a){return function(){a();return!0}}function D(a){return function(c){return J.getCursor(d).getSelectionType()===ops.OdtCursor.RangeSelection?a(c):!0}}function V(c){F.unsubscribe("keydown",C.handleEvent);F.unsubscribe("keypress",Z.handleEvent);F.unsubscribe("keyup", +ba.handleEvent);F.unsubscribe("copy",q);F.unsubscribe("mousedown",w);F.unsubscribe("mousemove",ma.trigger);F.unsubscribe("mouseup",E);F.unsubscribe("contextmenu",L);F.unsubscribe("dragstart",I);F.unsubscribe("dragend",K);F.unsubscribe("click",pa.handleClick);F.unsubscribe("longpress",t);F.unsubscribe("drag",y);F.unsubscribe("dragstop",x);J.unsubscribe(ops.OdtDocument.signalOperationEnd,na.trigger);J.unsubscribe(ops.Document.signalCursorAdded,ka.registerCursor);J.unsubscribe(ops.Document.signalCursorRemoved, +ka.removeCursor);J.unsubscribe(ops.OdtDocument.signalOperationEnd,a);c()}var W=runtime.getWindow(),J=k.getOdtDocument(),R=new gui.SessionConstraints,P=new gui.SessionContext(k,d),aa=core.DomUtils,S=odf.OdfUtils,fa=new gui.MimeDataExporter,ha=new gui.Clipboard(fa),C=new gui.KeyboardHandler,Z=new gui.KeyboardHandler,ba=new gui.KeyboardHandler,U=!1,ga=new odf.ObjectNameGenerator(J.getOdfCanvas().odfContainer(),d),B=!1,Y=null,M,Q=null,F=new gui.EventManager(J),ja=f.annotationsEnabled,ca=new gui.AnnotationController(k, +R,d),X=new gui.DirectFormattingController(k,R,P,d,ga,f.directTextStylingEnabled,f.directParagraphStylingEnabled),da=new gui.TextController(k,R,P,d,X.createCursorStyleOp,X.createParagraphStyleOps),qa=new gui.ImageController(k,R,P,d,ga),la=new gui.ImageSelector(J.getOdfCanvas()),ia=J.createPositionIterator(J.getRootNode()),ma,na,ea=new gui.PasteController(k,R,P,d),ka=new gui.InputMethodEditor(d,F),oa=0,pa=new gui.HyperlinkClickHandler(J.getOdfCanvas().getElement,C,ba),ta=new gui.HyperlinkController(k, +R,P,d),T=new gui.SelectionController(k,d),va=new gui.MetadataController(k,d),G=gui.KeyboardHandler.Modifier,H=gui.KeyboardHandler.KeyCode,ra=-1!==W.navigator.appVersion.toLowerCase().indexOf("mac"),ua=-1!==["iPad","iPod","iPhone"].indexOf(W.navigator.platform),sa;runtime.assert(null!==W,"Expected to be run in an environment which has a global window, like a browser.");this.undo=m;this.redo=h;this.insertLocalCursor=function(){runtime.assert(void 0===k.getOdtDocument().getCursor(d),"Inserting local cursor a second time."); +var a=new ops.OpAddCursor;a.init({memberid:d});k.enqueue([a]);F.focus()};this.removeLocalCursor=function(){runtime.assert(void 0!==k.getOdtDocument().getCursor(d),"Removing local cursor without inserting before.");var a=new ops.OpRemoveCursor;a.init({memberid:d});k.enqueue([a])};this.startEditing=function(){ka.subscribe(gui.InputMethodEditor.signalCompositionStart,da.removeCurrentSelection);ka.subscribe(gui.InputMethodEditor.signalCompositionEnd,N);F.subscribe("beforecut",r);F.subscribe("cut",p); +F.subscribe("beforepaste",l);F.subscribe("paste",e);Q&&Q.initialize();F.setEditing(!0);pa.setModifier(ra?G.Meta:G.Ctrl);C.bind(H.Backspace,G.None,O(da.removeTextByBackspaceKey),!0);C.bind(H.Delete,G.None,da.removeTextByDeleteKey);C.bind(H.Tab,G.None,D(function(){da.insertText("\t");return!0}));ra?(C.bind(H.Clear,G.None,da.removeCurrentSelection),C.bind(H.B,G.Meta,D(X.toggleBold)),C.bind(H.I,G.Meta,D(X.toggleItalic)),C.bind(H.U,G.Meta,D(X.toggleUnderline)),C.bind(H.L,G.MetaShift,D(X.alignParagraphLeft)), +C.bind(H.E,G.MetaShift,D(X.alignParagraphCenter)),C.bind(H.R,G.MetaShift,D(X.alignParagraphRight)),C.bind(H.J,G.MetaShift,D(X.alignParagraphJustified)),ja&&C.bind(H.C,G.MetaShift,ca.addAnnotation),C.bind(H.Z,G.Meta,m),C.bind(H.Z,G.MetaShift,h)):(C.bind(H.B,G.Ctrl,D(X.toggleBold)),C.bind(H.I,G.Ctrl,D(X.toggleItalic)),C.bind(H.U,G.Ctrl,D(X.toggleUnderline)),C.bind(H.L,G.CtrlShift,D(X.alignParagraphLeft)),C.bind(H.E,G.CtrlShift,D(X.alignParagraphCenter)),C.bind(H.R,G.CtrlShift,D(X.alignParagraphRight)), +C.bind(H.J,G.CtrlShift,D(X.alignParagraphJustified)),ja&&C.bind(H.C,G.CtrlAlt,ca.addAnnotation),C.bind(H.Z,G.Ctrl,m),C.bind(H.Z,G.CtrlShift,h));Z.setDefault(D(function(a){var c;c=null===a.which||void 0===a.which?String.fromCharCode(a.keyCode):0!==a.which&&0!==a.charCode?String.fromCharCode(a.which):null;return!c||a.altKey||a.ctrlKey||a.metaKey?!1:(da.insertText(c),!0)}));Z.bind(H.Enter,G.None,D(da.enqueueParagraphSplittingOps))};this.endEditing=function(){ka.unsubscribe(gui.InputMethodEditor.signalCompositionStart, +da.removeCurrentSelection);ka.unsubscribe(gui.InputMethodEditor.signalCompositionEnd,N);F.unsubscribe("cut",p);F.unsubscribe("beforecut",r);F.unsubscribe("paste",e);F.unsubscribe("beforepaste",l);F.setEditing(!1);pa.setModifier(G.None);C.bind(H.Backspace,G.None,function(){return!0},!0);C.unbind(H.Delete,G.None);C.unbind(H.Tab,G.None);ra?(C.unbind(H.Clear,G.None),C.unbind(H.B,G.Meta),C.unbind(H.I,G.Meta),C.unbind(H.U,G.Meta),C.unbind(H.L,G.MetaShift),C.unbind(H.E,G.MetaShift),C.unbind(H.R,G.MetaShift), +C.unbind(H.J,G.MetaShift),ja&&C.unbind(H.C,G.MetaShift),C.unbind(H.Z,G.Meta),C.unbind(H.Z,G.MetaShift)):(C.unbind(H.B,G.Ctrl),C.unbind(H.I,G.Ctrl),C.unbind(H.U,G.Ctrl),C.unbind(H.L,G.CtrlShift),C.unbind(H.E,G.CtrlShift),C.unbind(H.R,G.CtrlShift),C.unbind(H.J,G.CtrlShift),ja&&C.unbind(H.C,G.CtrlAlt),C.unbind(H.Z,G.Ctrl),C.unbind(H.Z,G.CtrlShift));Z.setDefault(null);Z.unbind(H.Enter,G.None)};this.getInputMemberId=function(){return d};this.getSession=function(){return k};this.getSessionConstraints=function(){return R}; +this.setUndoManager=function(a){Q&&Q.unsubscribe(gui.UndoManager.signalUndoStackChanged,c);if(Q=a)Q.setDocument(J),Q.setPlaybackFunction(k.enqueue),Q.subscribe(gui.UndoManager.signalUndoStackChanged,c)};this.getUndoManager=function(){return Q};this.getMetadataController=function(){return va};this.getAnnotationController=function(){return ca};this.getDirectFormattingController=function(){return X};this.getHyperlinkClickHandler=function(){return pa};this.getHyperlinkController=function(){return ta}; +this.getImageController=function(){return qa};this.getSelectionController=function(){return T};this.getTextController=function(){return da};this.getEventManager=function(){return F};this.getKeyboardHandlers=function(){return{keydown:C,keypress:Z}};this.destroy=function(a){var c=[ma.destroy,na.destroy,X.destroy,ka.destroy,F.destroy,pa.destroy,ta.destroy,va.destroy,T.destroy,da.destroy,V];sa&&c.unshift(sa.destroy);runtime.clearTimeout(M);core.Async.destroyAll(c,a)};ma=core.Task.createRedrawTask(z); +na=core.Task.createRedrawTask(function(){var a=J.getCursor(d);if(a&&a.getSelectionType()===ops.OdtCursor.RegionSelection&&(a=S.getImageElements(a.getSelectedRange())[0])){la.select(a.parentNode);return}la.clearSelection()});C.bind(H.Left,G.None,D(T.moveCursorToLeft));C.bind(H.Right,G.None,D(T.moveCursorToRight));C.bind(H.Up,G.None,D(T.moveCursorUp));C.bind(H.Down,G.None,D(T.moveCursorDown));C.bind(H.Left,G.Shift,D(T.extendSelectionToLeft));C.bind(H.Right,G.Shift,D(T.extendSelectionToRight));C.bind(H.Up, +G.Shift,D(T.extendSelectionUp));C.bind(H.Down,G.Shift,D(T.extendSelectionDown));C.bind(H.Home,G.None,D(T.moveCursorToLineStart));C.bind(H.End,G.None,D(T.moveCursorToLineEnd));C.bind(H.Home,G.Ctrl,D(T.moveCursorToDocumentStart));C.bind(H.End,G.Ctrl,D(T.moveCursorToDocumentEnd));C.bind(H.Home,G.Shift,D(T.extendSelectionToLineStart));C.bind(H.End,G.Shift,D(T.extendSelectionToLineEnd));C.bind(H.Up,G.CtrlShift,D(T.extendSelectionToParagraphStart));C.bind(H.Down,G.CtrlShift,D(T.extendSelectionToParagraphEnd)); +C.bind(H.Home,G.CtrlShift,D(T.extendSelectionToDocumentStart));C.bind(H.End,G.CtrlShift,D(T.extendSelectionToDocumentEnd));ra?(C.bind(H.Left,G.Alt,D(T.moveCursorBeforeWord)),C.bind(H.Right,G.Alt,D(T.moveCursorPastWord)),C.bind(H.Left,G.Meta,D(T.moveCursorToLineStart)),C.bind(H.Right,G.Meta,D(T.moveCursorToLineEnd)),C.bind(H.Home,G.Meta,D(T.moveCursorToDocumentStart)),C.bind(H.End,G.Meta,D(T.moveCursorToDocumentEnd)),C.bind(H.Left,G.AltShift,D(T.extendSelectionBeforeWord)),C.bind(H.Right,G.AltShift, +D(T.extendSelectionPastWord)),C.bind(H.Left,G.MetaShift,D(T.extendSelectionToLineStart)),C.bind(H.Right,G.MetaShift,D(T.extendSelectionToLineEnd)),C.bind(H.Up,G.AltShift,D(T.extendSelectionToParagraphStart)),C.bind(H.Down,G.AltShift,D(T.extendSelectionToParagraphEnd)),C.bind(H.Up,G.MetaShift,D(T.extendSelectionToDocumentStart)),C.bind(H.Down,G.MetaShift,D(T.extendSelectionToDocumentEnd)),C.bind(H.A,G.Meta,D(T.extendSelectionToEntireDocument))):(C.bind(H.Left,G.Ctrl,D(T.moveCursorBeforeWord)),C.bind(H.Right, +G.Ctrl,D(T.moveCursorPastWord)),C.bind(H.Left,G.CtrlShift,D(T.extendSelectionBeforeWord)),C.bind(H.Right,G.CtrlShift,D(T.extendSelectionPastWord)),C.bind(H.A,G.Ctrl,D(T.extendSelectionToEntireDocument)));ua&&(sa=new gui.IOSSafariSupport(F));F.subscribe("keydown",C.handleEvent);F.subscribe("keypress",Z.handleEvent);F.subscribe("keyup",ba.handleEvent);F.subscribe("copy",q);F.subscribe("mousedown",w);F.subscribe("mousemove",ma.trigger);F.subscribe("mouseup",E);F.subscribe("contextmenu",L);F.subscribe("dragstart", +I);F.subscribe("dragend",K);F.subscribe("click",pa.handleClick);F.subscribe("longpress",t);F.subscribe("drag",y);F.subscribe("dragstop",x);J.subscribe(ops.OdtDocument.signalOperationEnd,na.trigger);J.subscribe(ops.Document.signalCursorAdded,ka.registerCursor);J.subscribe(ops.Document.signalCursorRemoved,ka.removeCursor);J.subscribe(ops.OdtDocument.signalOperationEnd,a)}})(); +gui.CaretManager=function(g,k){function d(b){return n.hasOwnProperty(b)?n[b]:null}function b(){return Object.keys(n).map(function(b){return n[b]})}function f(b){var d=n[b];d&&(delete n[b],b===g.getInputMemberId()?(r.unsubscribe(ops.OdtDocument.signalProcessingBatchEnd,d.ensureVisible),r.unsubscribe(ops.Document.signalCursorMoved,d.refreshCursorBlinking),q.unsubscribe("compositionupdate",d.handleUpdate),q.unsubscribe("compositionend",d.handleUpdate),q.unsubscribe("focus",d.setFocus),q.unsubscribe("blur", +d.removeFocus),p.removeEventListener("focus",d.show,!1),p.removeEventListener("blur",d.hide,!1)):r.unsubscribe(ops.OdtDocument.signalProcessingBatchEnd,d.handleUpdate),d.destroy(function(){}))}var n={},p=runtime.getWindow(),r=g.getSession().getOdtDocument(),q=g.getEventManager();this.registerCursor=function(b,d,a){var c=b.getMemberId();b=new gui.Caret(b,k,d,a);n[c]=b;c===g.getInputMemberId()?(runtime.log("Starting to track input on new cursor of "+c),r.subscribe(ops.OdtDocument.signalProcessingBatchEnd, +b.ensureVisible),r.subscribe(ops.Document.signalCursorMoved,b.refreshCursorBlinking),q.subscribe("compositionupdate",b.handleUpdate),q.subscribe("compositionend",b.handleUpdate),q.subscribe("focus",b.setFocus),q.subscribe("blur",b.removeFocus),p.addEventListener("focus",b.show,!1),p.addEventListener("blur",b.hide,!1),b.setOverlayElement(q.getEventTrap())):r.subscribe(ops.OdtDocument.signalProcessingBatchEnd,b.handleUpdate);return b};this.getCaret=d;this.getCarets=b;this.destroy=function(d){var l= +b().map(function(a){return a.destroy});g.getSelectionController().setCaretXPositionLocator(null);r.unsubscribe(ops.Document.signalCursorRemoved,f);n={};core.Async.destroyAll(l,d)};g.getSelectionController().setCaretXPositionLocator(function(){var b=d(g.getInputMemberId()),f;b&&(f=b.getBoundingClientRect());return f?f.right:void 0});r.subscribe(ops.Document.signalCursorRemoved,f)}; +gui.EditInfoHandle=function(g){var k=[],d,b=g.ownerDocument,f=b.documentElement.namespaceURI;this.setEdits=function(g){k=g;var p,r,q,e;core.DomUtils.removeAllChildNodes(d);for(g=0;gc?(r=d(1,0),q=d(.5,1E4-c),e=d(.2,2E4-c)):1E4<=c&&2E4>c?(r=d(.5,0),e=d(.2,2E4-c)):r=d(.2,0)};this.getEdits=function(){return g.getEdits()};this.clearEdits=function(){g.clearEdits(); +n.setEdits([]);p.hasAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")&&p.removeAttributeNS("urn:webodf:names:editinfo","editinfo:memberid")};this.getEditInfo=function(){return g};this.show=function(){p.style.display="block"};this.hide=function(){b.hideHandle();p.style.display="none"};this.showHandle=function(){n.show()};this.hideHandle=function(){n.hide()};this.destroy=function(b){runtime.clearTimeout(r);runtime.clearTimeout(q);runtime.clearTimeout(e);f.removeChild(p);n.destroy(function(a){a? +b(a):g.destroy(b)})};(function(){var d=g.getOdtDocument().getDOMDocument();p=d.createElementNS(d.documentElement.namespaceURI,"div");p.setAttribute("class","editInfoMarker");p.onmouseover=function(){b.showHandle()};p.onmouseout=function(){b.hideHandle()};f=g.getNode();f.appendChild(p);n=new gui.EditInfoHandle(f);k||b.hide()})()}; +gui.HyperlinkTooltipView=function(g,k){var d=core.DomUtils,b=odf.OdfUtils,f=runtime.getWindow(),n,p,r;runtime.assert(null!==f,"Expected to be run in an environment which has a global window, like a browser.");this.showTooltip=function(q){var e=q.target||q.srcElement,l=g.getSizer(),a=g.getZoomLevel(),c;a:{for(;e;){if(b.isHyperlink(e))break a;if(b.isParagraph(e)||b.isInlineRoot(e))break;e=e.parentNode}e=null}if(e){d.containsNode(l,r)||l.appendChild(r);c=p;var m;switch(k()){case gui.KeyboardHandler.Modifier.Ctrl:m= +runtime.tr("Ctrl-click to follow link");break;case gui.KeyboardHandler.Modifier.Meta:m=runtime.tr("\u2318-click to follow link");break;default:m=""}c.textContent=m;n.textContent=b.getHyperlinkTarget(e);r.style.display="block";c=f.innerWidth-r.offsetWidth-15;e=q.clientX>c?c:q.clientX+15;c=f.innerHeight-r.offsetHeight-10;q=q.clientY>c?c:q.clientY+10;l=l.getBoundingClientRect();e=(e-l.left)/a;q=(q-l.top)/a;r.style.left=e+"px";r.style.top=q+"px"}};this.hideTooltip=function(){r.style.display="none"};this.destroy= +function(b){r.parentNode&&r.parentNode.removeChild(r);b()};(function(){var b=g.getElement().ownerDocument;n=b.createElement("span");p=b.createElement("span");n.className="webodf-hyperlinkTooltipLink";p.className="webodf-hyperlinkTooltipText";r=b.createElement("div");r.className="webodf-hyperlinkTooltip";r.appendChild(n);r.appendChild(p);g.getElement().appendChild(r)})()}; +gui.OdfFieldView=function(g){function k(){var b=odf.OdfSchema.getFields().map(function(b){return b.replace(":","|")}),d=b.join(",\n")+"\n{ background-color: #D0D0D0; }\n",b=b.map(function(b){return b+":empty::after"}).join(",\n")+"\n{ content:' '; white-space: pre; }\n";return d+"\n"+b}var d,b=g.getElement().ownerDocument;this.showFieldHighlight=function(){d.appendChild(b.createTextNode(k()))};this.hideFieldHighlight=function(){for(var b=d.sheet,g=b.cssRules;g.length;)b.deleteRule(g.length-1)};this.destroy= +function(b){d.parentNode&&d.parentNode.removeChild(d);b()};d=function(){var d=b.getElementsByTagName("head").item(0),g=b.createElement("style"),k="";g.type="text/css";g.media="screen, print, handheld, projection";odf.Namespaces.forEachPrefix(function(b,d){k+="@namespace "+b+" url("+d+");\n"});g.appendChild(b.createTextNode(k));d.appendChild(g);return g}()}; +gui.ShadowCursor=function(g){var k=g.getDOMDocument().createRange(),d=!0;this.removeFromDocument=function(){};this.getMemberId=function(){return gui.ShadowCursor.ShadowCursorMemberId};this.getSelectedRange=function(){return k};this.setSelectedRange=function(b,f){k=b;d=!1!==f};this.hasForwardSelection=function(){return d};this.getDocument=function(){return g};this.getSelectionType=function(){return ops.OdtCursor.RangeSelection};k.setStart(g.getRootNode(),0)};gui.ShadowCursor.ShadowCursorMemberId=""; +gui.SelectionView=function(g){};gui.SelectionView.prototype.rerender=function(){};gui.SelectionView.prototype.show=function(){};gui.SelectionView.prototype.hide=function(){};gui.SelectionView.prototype.destroy=function(g){}; +gui.SelectionViewManager=function(g){function k(){return Object.keys(d).map(function(b){return d[b]})}var d={};this.getSelectionView=function(b){return d.hasOwnProperty(b)?d[b]:null};this.getSelectionViews=k;this.removeSelectionView=function(b){d.hasOwnProperty(b)&&(d[b].destroy(function(){}),delete d[b])};this.hideSelectionView=function(b){d.hasOwnProperty(b)&&d[b].hide()};this.showSelectionView=function(b){d.hasOwnProperty(b)&&d[b].show()};this.rerenderSelectionViews=function(){Object.keys(d).forEach(function(b){d[b].rerender()})}; +this.registerCursor=function(b,f){var k=b.getMemberId(),p=new g(b);f?p.show():p.hide();return d[k]=p};this.destroy=function(b){function d(k,r){r?b(r):k .webodf-draggable"),a=gui.ShadowCursor.ShadowCursorMemberId,e(".webodf-selectionOverlay","{ fill: "+b+"; stroke: "+b+";}",""),e(".webodf-touchEnabled .webodf-selectionOverlay","{ display: block; }"," > .webodf-draggable"))}function l(a){var c,b;for(b in t)t.hasOwnProperty(b)&&(c=t[b],a?c.show():c.hide())}function a(a){n.getCarets().forEach(function(c){a?c.showHandle():c.hideHandle()})}function c(a){var c=a.getMemberId();a=a.getProperties();e(c,a.fullName,a.color)}function m(a){var c= +a.getMemberId(),d=b.getOdtDocument().getMember(c).getProperties();n.registerCursor(a,E,N);p.registerCursor(a,!0);if(a=n.getCaret(c))a.setAvatarImageUrl(d.imageUrl),a.setColor(d.color);runtime.log("+++ View here +++ eagerly created an Caret for '"+c+"'! +++")}function h(a){a=a.getMemberId();var c=p.getSelectionView(d),b=p.getSelectionView(gui.ShadowCursor.ShadowCursorMemberId),e=n.getCaret(d);a===d?(b.hide(),c&&c.show(),e&&e.show()):a===gui.ShadowCursor.ShadowCursorMemberId&&(b.show(),c&&c.hide(), +e&&e.hide())}function y(a){p.removeSelectionView(a)}function x(a){var c=a.paragraphElement,d=a.memberId;a=a.timeStamp;var e,f="",h=c.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo").item(0);h?(f=h.getAttributeNS("urn:webodf:names:editinfo","id"),e=t[f]):(f=Math.random().toString(),e=new ops.EditInfo(c,b.getOdtDocument()),e=new gui.EditInfoMarker(e,L),h=c.getElementsByTagNameNS("urn:webodf:names:editinfo","editinfo").item(0),h.setAttributeNS("urn:webodf:names:editinfo","id",f),t[f]=e); +e.addEdit(d,new Date(a));K.trigger()}function z(){var a;u.hasChildNodes()&&core.DomUtils.removeAllChildNodes(u);!0===f.getState(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN)&&(a=b.getOdtDocument().getMember(d))&&(a=a.getProperties().fullName,u.appendChild(document.createTextNode(".annotationWrapper:not([creator = '"+a+"']) .annotationRemoveButton { display: none; }")))}function w(a){var b=Object.keys(t).map(function(a){return t[a]});A.unsubscribe(ops.Document.signalMemberAdded,c);A.unsubscribe(ops.Document.signalMemberUpdated, +c);A.unsubscribe(ops.Document.signalCursorAdded,m);A.unsubscribe(ops.Document.signalCursorRemoved,y);A.unsubscribe(ops.OdtDocument.signalParagraphChanged,x);A.unsubscribe(ops.Document.signalCursorMoved,h);A.unsubscribe(ops.OdtDocument.signalParagraphChanged,p.rerenderSelectionViews);A.unsubscribe(ops.OdtDocument.signalTableAdded,p.rerenderSelectionViews);A.unsubscribe(ops.OdtDocument.signalParagraphStyleModified,p.rerenderSelectionViews);f.unsubscribe(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN, +z);A.unsubscribe(ops.Document.signalMemberAdded,z);A.unsubscribe(ops.Document.signalMemberUpdated,z);v.parentNode.removeChild(v);u.parentNode.removeChild(u);(function W(c,d){d?a(d):ca.length;c&&g(a);return c}function d(a,c){function b(e){a[e]===c&&d.push(e)}var d=[];a&&["style:parent-style-name","style:next-style-name"].forEach(b);return d}function b(a,c){function b(d){a[d]===c&&delete a[d]}a&&["style:parent-style-name","style:next-style-name"].forEach(b)}function f(a){var c={};Object.keys(a).forEach(function(b){c[b]="object"===typeof a[b]?f(a[b]):a[b]});return c}function n(a, +c,b,d){var e,f=!1,g=!1,k,l=[];d&&d.attributes&&(l=d.attributes.split(","));a&&(b||0=a.length?0:a.length-e.length)):void 0!==a.length&&(e=a.position+a.length,d<=e?a.length-=c.length:b=c.position+c.length)){d=b?a:c;e=b?c:a;if(a.position!==c.position||a.length!==c.length)n=f(d),r=f(e);c=q(e.setProperties,null,d.setProperties, +null,"style:text-properties");if(c.majorChanged||c.minorChanged)g=[],a=[],k=d.position+d.length,l=e.position+e.length,e.positionk?c.minorChanged&&(n=r,n.position=k,n.length=l-k,a.push(n),e.length=k-e.position):k>l&&c.majorChanged&&(n.position=l, +n.length=k-l,g.push(n),d.length=l-d.position),d.setProperties&&p(d.setProperties)&&g.push(d),e.setProperties&&p(e.setProperties)&&a.push(e),b?(k=g,g=a):k=a}return{opSpecsA:k,opSpecsB:g}},InsertText:function(a,c){c.position<=a.position?a.position+=c.text.length:c.position<=a.position+a.length&&(a.length+=c.text.length);return{opSpecsA:[a],opSpecsB:[c]}},MergeParagraph:function(a,c){var b=a.position,d=a.position+a.length;b>=c.sourceStartPosition&&--b;d>=c.sourceStartPosition&&--d;a.position=b;a.length= +d-b;return{opSpecsA:[a],opSpecsB:[c]}},MoveCursor:e,RemoveAnnotation:function(a,b){var d=a.position,e=a.position+a.length,f=b.position+b.length,g=[a],k=[b];b.position<=d&&e<=f?g=[]:(fb.position?a.position+=b.text.length:d?b.position+=a.text.length:a.position+= +b.text.length;return{opSpecsA:[a],opSpecsB:[b]}},MergeParagraph:function(a,b){a.position>=b.sourceStartPosition?--a.position:(a.positiona.position&&(b.position+=a.text.length);return{opSpecsA:[a],opSpecsB:[b]}},SplitParagraph:function(a,b){a.position=a.sourceStartPosition&&--f;d>=a.sourceStartPosition&&--d;0<=b.length?(b.position=f,b.length=d-f):(b.position=d,b.length=f-d);return{opSpecsA:[a],opSpecsB:[b]}},RemoveAnnotation:function(a,b){var d=b.position+b.length,e=[a],f=[b];b.position<=a.destinationStartPosition&&a.sourceStartPosition<=d?(e=[],--b.length):a.sourceStartPosition=a.sourceStartPosition?--b.position:(b.positiona.sourceStartPosition)--b.position;else if(b.position===a.destinationStartPosition||b.position===a.sourceStartPosition)b.position=a.destinationStartPosition,a.paragraphStyleName=b.styleName;return{opSpecsA:d,opSpecsB:e}},SplitParagraph:function(a,b){var d,e=[a],f=[b];b.position=a.destinationStartPosition&&b.position=a.sourceStartPosition&&(--b.position,--b.sourceParagraphPosition);return{opSpecsA:e,opSpecsB:f}},UpdateMember:e,UpdateMetadata:e, +UpdateParagraphStyle:e},MoveCursor:{MoveCursor:e,RemoveAnnotation:function(a,b){var d=k(a),e=a.position+a.length,f=b.position+b.length;b.position<=a.position&&e<=f?(a.position=b.position-1,a.length=0):(fb.position?a.position+= +1:a.position===b.sourceParagraphPosition&&(b.paragraphStyleName=a.styleName,g=f(a),g.position=b.position+1,d.push(g));return{opSpecsA:d,opSpecsB:e}},UpdateMember:e,UpdateMetadata:e,UpdateParagraphStyle:e},SplitParagraph:{SplitParagraph:function(a,b,d){var e,f;a.position + +(c) 2009-2014 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/master/LICENSE + @licend +*/ +!function(e){var globalScope=typeof window!=="undefined"?window:typeof global!=="undefined"?global:{},externs=globalScope.externs||(globalScope.externs={});externs.JSZip=e()}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'");}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f, +f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>> +6;enc4=chr3&63;if(isNaN(chr2))enc3=enc4=64;else if(isNaN(chr3))enc4=64;output=output+_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4)}return output};exports.decode=function(input,utf8){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64)output=output+String.fromCharCode(chr2);if(enc4!=64)output=output+String.fromCharCode(chr3)}return output}},{}],2:[function(_dereq_,module,exports){function CompressedObject(){this.compressedSize=0;this.uncompressedSize=0;this.crc32=0;this.compressionMethod=null;this.compressedContent=null}CompressedObject.prototype={getContent:function(){return null},getCompressedContent:function(){return null}}; +module.exports=CompressedObject},{}],3:[function(_dereq_,module,exports){exports.STORE={magic:"\x00\x00",compress:function(content){return content},uncompress:function(content){return content},compressInputType:null,uncompressInputType:null};exports.DEFLATE=_dereq_("./flate")},{"./flate":8}],4:[function(_dereq_,module,exports){var utils=_dereq_("./utils");var table=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021, +3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527, +1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856, +1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626, +1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692, +2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614, +3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];module.exports=function crc32(input,crc){if(typeof input==="undefined"||!input.length)return 0;var isArray=utils.getTypeOf(input)!=="string";if(typeof crc=="undefined")crc=0;var x=0;var y=0;var b=0;crc=crc^-1;for(var i=0,iTop=input.length;i>>8^x}return crc^-1}},{"./utils":21}],5:[function(_dereq_,module,exports){var utils=_dereq_("./utils"); +function DataReader(data){this.data=null;this.length=0;this.index=0}DataReader.prototype={checkOffset:function(offset){this.checkIndex(this.index+offset)},checkIndex:function(newIndex){if(this.length=this.index;i--)result=(result<<8)+this.byteAt(i);this.index+=size;return result},readString:function(size){return utils.transformTo("string",this.readData(size))},readData:function(size){},lastIndexOfSignature:function(sig){},readDate:function(){var dostime=this.readInt(4);return new Date((dostime>>25&127)+1980,(dostime>>21&15)-1,dostime>>16&31,dostime>>11&31,dostime>>5&63,(dostime&31)<<1)}};module.exports=DataReader},{"./utils":21}],6:[function(_dereq_, +module,exports){exports.base64=false;exports.binary=false;exports.dir=false;exports.createFolders=false;exports.date=null;exports.compression=null;exports.comment=null},{}],7:[function(_dereq_,module,exports){var utils=_dereq_("./utils");exports.string2binary=function(str){return utils.string2binary(str)};exports.string2Uint8Array=function(str){return utils.transformTo("uint8array",str)};exports.uint8Array2String=function(array){return utils.transformTo("string",array)};exports.string2Blob=function(str){var buffer= +utils.transformTo("arraybuffer",str);return utils.arrayBuffer2Blob(buffer)};exports.arrayBuffer2Blob=function(buffer){return utils.arrayBuffer2Blob(buffer)};exports.transformTo=function(outputType,input){return utils.transformTo(outputType,input)};exports.getTypeOf=function(input){return utils.getTypeOf(input)};exports.checkSupport=function(type){return utils.checkSupport(type)};exports.MAX_VALUE_16BITS=utils.MAX_VALUE_16BITS;exports.MAX_VALUE_32BITS=utils.MAX_VALUE_32BITS;exports.pretty=function(str){return utils.pretty(str)}; +exports.findCompression=function(compressionMethod){return utils.findCompression(compressionMethod)};exports.isRegExp=function(object){return utils.isRegExp(object)}},{"./utils":21}],8:[function(_dereq_,module,exports){var USE_TYPEDARRAY=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Uint32Array!=="undefined";var pako=_dereq_("pako");exports.uncompressInputType=USE_TYPEDARRAY?"uint8array":"array";exports.compressInputType=USE_TYPEDARRAY?"uint8array":"array";exports.magic= +"\b\x00";exports.compress=function(input){return pako.deflateRaw(input)};exports.uncompress=function(input){return pako.inflateRaw(input)}},{"pako":24}],9:[function(_dereq_,module,exports){var base64=_dereq_("./base64");function JSZip(data,options){if(!(this instanceof JSZip))return new JSZip(data,options);this.files={};this.comment=null;this.root="";if(data)this.load(data,options);this.clone=function(){var newObj=new JSZip;for(var i in this)if(typeof this[i]!=="function")newObj[i]=this[i];return newObj}} +JSZip.prototype=_dereq_("./object");JSZip.prototype.load=_dereq_("./load");JSZip.support=_dereq_("./support");JSZip.defaults=_dereq_("./defaults");JSZip.utils=_dereq_("./deprecatedPublicUtils");JSZip.base64={encode:function(input){return base64.encode(input)},decode:function(input){return base64.decode(input)}};JSZip.compressions=_dereq_("./compressions");module.exports=JSZip},{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(_dereq_, +module,exports){var base64=_dereq_("./base64");var ZipEntries=_dereq_("./zipEntries");module.exports=function(data,options){var files,zipEntries,i,input;options=options||{};if(options.base64)data=base64.decode(data);zipEntries=new ZipEntries(data,options);files=zipEntries.files;for(i=0;i>>8}return hex};var extend=function(){var result={},i,attr;for(i=0;i0?path.substring(0,lastSlash):""};var folderAdd=function(name,createFolders){if(name.slice(-1)!="/")name+="/";createFolders=typeof createFolders!=="undefined"?createFolders:false;if(!this.files[name])fileAdd.call(this,name,null,{dir:true,createFolders:createFolders});return this.files[name]};var generateCompressedObjectFrom=function(file,compression){var result=new CompressedObject,content;if(file._data instanceof +CompressedObject){result.uncompressedSize=file._data.uncompressedSize;result.crc32=file._data.crc32;if(result.uncompressedSize===0||file.dir){compression=compressions["STORE"];result.compressedContent="";result.crc32=0}else if(file._data.compressionMethod===compression.magic)result.compressedContent=file._data.getCompressedContent();else{content=file._data.getContent();result.compressedContent=compression.compress(utils.transformTo(compression.compressInputType,content))}}else{content=getBinaryData(file); +if(!content||content.length===0||file.dir){compression=compressions["STORE"];content=""}result.uncompressedSize=content.length;result.crc32=crc32(content);result.compressedContent=compression.compress(utils.transformTo(compression.compressInputType,content))}result.compressedSize=result.compressedContent.length;result.compressionMethod=compression.magic;return result};var generateZipParts=function(name,file,compressedObject,offset){var data=compressedObject.compressedContent,utfEncodedFileName=utils.transformTo("string", +utf8.utf8encode(file.name)),comment=file.comment||"",utfEncodedComment=utils.transformTo("string",utf8.utf8encode(comment)),useUTF8ForFileName=utfEncodedFileName.length!==file.name.length,useUTF8ForComment=utfEncodedComment.length!==comment.length,o=file.options,dosTime,dosDate,extraFields="",unicodePathExtraField="",unicodeCommentExtraField="",dir,date;if(file._initialMetadata.dir!==file.dir)dir=file.dir;else dir=o.dir;if(file._initialMetadata.date!==file.date)date=file.date;else date=o.date;dosTime= +date.getHours();dosTime=dosTime<<6;dosTime=dosTime|date.getMinutes();dosTime=dosTime<<5;dosTime=dosTime|date.getSeconds()/2;dosDate=date.getFullYear()-1980;dosDate=dosDate<<4;dosDate=dosDate|date.getMonth()+1;dosDate=dosDate<<5;dosDate=dosDate|date.getDate();if(useUTF8ForFileName){unicodePathExtraField=decToHex(1,1)+decToHex(crc32(utfEncodedFileName),4)+utfEncodedFileName;extraFields+="up"+decToHex(unicodePathExtraField.length,2)+unicodePathExtraField}if(useUTF8ForComment){unicodeCommentExtraField= +decToHex(1,1)+decToHex(this.crc32(utfEncodedComment),4)+utfEncodedComment;extraFields+="uc"+decToHex(unicodeCommentExtraField.length,2)+unicodeCommentExtraField}var header="";header+="\n\x00";header+=useUTF8ForFileName||useUTF8ForComment?"\x00\b":"\x00\x00";header+=compressedObject.compressionMethod;header+=decToHex(dosTime,2);header+=decToHex(dosDate,2);header+=decToHex(compressedObject.crc32,4);header+=decToHex(compressedObject.compressedSize,4);header+=decToHex(compressedObject.uncompressedSize, +4);header+=decToHex(utfEncodedFileName.length,2);header+=decToHex(extraFields.length,2);var fileRecord=signature.LOCAL_FILE_HEADER+header+utfEncodedFileName+extraFields;var dirRecord=signature.CENTRAL_FILE_HEADER+"\u0014\x00"+header+decToHex(utfEncodedComment.length,2)+"\x00\x00"+"\x00\x00"+(dir===true?"\u0010\x00\x00\x00":"\x00\x00\x00\x00")+decToHex(offset,4)+utfEncodedFileName+extraFields+utfEncodedComment;return{fileRecord:fileRecord,dirRecord:dirRecord,compressedObject:compressedObject}};var out= +{load:function(stream,options){throw new Error("Load method is not defined. Is the file jszip-load.js included ?");},filter:function(search){var result=[],filename,relativePath,file,fileClone;for(filename in this.files){if(!this.files.hasOwnProperty(filename))continue;file=this.files[filename];fileClone=new ZipObject(file.name,file._data,extend(file.options));relativePath=filename.slice(this.root.length,filename.length);if(filename.slice(0,this.root.length)===this.root&&search(relativePath,fileClone))result.push(fileClone)}return result}, +file:function(name,data,o){if(arguments.length===1)if(utils.isRegExp(name)){var regexp=name;return this.filter(function(relativePath,file){return!file.dir&®exp.test(relativePath)})}else return this.filter(function(relativePath,file){return!file.dir&&relativePath===name})[0]||null;else{name=this.root+name;fileAdd.call(this,name,data,o)}return this},folder:function(arg){if(!arg)return this;if(utils.isRegExp(arg))return this.filter(function(relativePath,file){return file.dir&&arg.test(relativePath)}); +var name=this.root+arg;var newFolder=folderAdd.call(this,name);var ret=this.clone();ret.root=newFolder.name;return ret},remove:function(name){name=this.root+name;var file=this.files[name];if(!file){if(name.slice(-1)!="/")name+="/";file=this.files[name]}if(file&&!file.dir)delete this.files[name];else{var kids=this.filter(function(relativePath,file){return file.name.slice(0,name.length)===name});for(var i=0;i=0;--i)if(this.data[i]===sig0&&this.data[i+1]===sig1&&this.data[i+2]===sig2&&this.data[i+3]===sig3)return i;return-1};Uint8ArrayReader.prototype.readData=function(size){this.checkOffset(size);if(size===0)return new Uint8Array(0);var result=this.data.subarray(this.index, +this.index+size);this.index+=size;return result};module.exports=Uint8ArrayReader},{"./dataReader":5}],19:[function(_dereq_,module,exports){var utils=_dereq_("./utils");var Uint8ArrayWriter=function(length){this.data=new Uint8Array(length);this.index=0};Uint8ArrayWriter.prototype={append:function(input){if(input.length!==0){input=utils.transformTo("uint8array",input);this.data.set(input,this.index);this.index+=input.length}},finalize:function(){return this.data}};module.exports=Uint8ArrayWriter},{"./utils":21}], +20:[function(_dereq_,module,exports){var utils=_dereq_("./utils");var support=_dereq_("./support");var nodeBuffer=_dereq_("./nodeBuffer");var _utf8len=new Array(256);for(var i=0;i<256;i++)_utf8len[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos>>6;buf[i++]=128|c&63}else if(c<65536){buf[i++]=224|c>>>12;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}else{buf[i++]= +240|c>>>18;buf[i++]=128|c>>>12&63;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}}return buf};var utf8border=function(buf,max){var pos;max=max||buf.length;if(max>buf.length)max=buf.length;pos=max-1;while(pos>=0&&(buf[pos]&192)===128)pos--;if(pos<0)return max;if(pos===0)return max;return pos+_utf8len[buf[pos]]>max?pos:max};var buf2string=function(buf){var str,i,out,c,c_len;var len=buf.length;var utf16buf=new Array(len*2);for(out=0,i=0;i4){utf16buf[out++]=65533;i+=c_len-1;continue}c&=c_len===2?31:c_len===3?15:7;while(c_len>1&&i1){utf16buf[out++]=65533;continue}if(c<65536)utf16buf[out++]=c;else{c-=65536;utf16buf[out++]=55296|c>>10&1023;utf16buf[out++]=56320|c&1023}}if(utf16buf.length!==out)if(utf16buf.subarray)utf16buf=utf16buf.subarray(0,out);else utf16buf.length=out;return utils.applyFromCharCode(utf16buf)};exports.utf8encode=function utf8encode(str){if(support.nodebuffer)return nodeBuffer(str, +"utf-8");return string2buf(str)};exports.utf8decode=function utf8decode(buf){if(support.nodebuffer)return utils.transformTo("nodebuffer",buf).toString("utf-8");buf=utils.transformTo(support.uint8array?"uint8array":"array",buf);var result=[],k=0,len=buf.length,chunk=65536;while(k1)try{if(type==="array"||type==="nodebuffer")result.push(String.fromCharCode.apply(null,array.slice(k,Math.min(k+chunk,len))));else result.push(String.fromCharCode.apply(null, +array.subarray(k,Math.min(k+chunk,len))));k+=chunk}catch(e){chunk=Math.floor(chunk/2)}return result.join("")}exports.applyFromCharCode=arrayLikeToString;function arrayLikeToArrayLike(arrayFrom,arrayTo){for(var i=0;i1)throw new Error("Multi-volumes zip are not supported");},readLocalFiles:function(){var i,file;for(i=0;i0)opt.windowBits=-opt.windowBits;else if(opt.gzip&&opt.windowBits>0&&opt.windowBits<16)opt.windowBits+=16;this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new zstream;this.strm.avail_out=0;var status=zlib_deflate.deflateInit2(this.strm,opt.level,opt.method,opt.windowBits,opt.memLevel,opt.strategy);if(status!==Z_OK)throw new Error(msg[status]); +if(opt.header)zlib_deflate.deflateSetHeader(this.strm,opt.header)};Deflate.prototype.push=function(data,mode){var strm=this.strm;var chunkSize=this.options.chunkSize;var status,_mode;if(this.ended)return false;_mode=mode===~~mode?mode:mode===true?Z_FINISH:Z_NO_FLUSH;if(typeof data==="string")strm.input=strings.string2buf(data);else strm.input=data;strm.next_in=0;strm.avail_in=strm.input.length;do{if(strm.avail_out===0){strm.output=new utils.Buf8(chunkSize);strm.next_out=0;strm.avail_out=chunkSize}status= +zlib_deflate.deflate(strm,_mode);if(status!==Z_STREAM_END&&status!==Z_OK){this.onEnd(status);this.ended=true;return false}if(strm.avail_out===0||strm.avail_in===0&&_mode===Z_FINISH)if(this.options.to==="string")this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output,strm.next_out)));else this.onData(utils.shrinkBuf(strm.output,strm.next_out))}while((strm.avail_in>0||strm.avail_out===0)&&status!==Z_STREAM_END);if(_mode===Z_FINISH){status=zlib_deflate.deflateEnd(this.strm);this.onEnd(status); +this.ended=true;return status===Z_OK}return true};Deflate.prototype.onData=function(chunk){this.chunks.push(chunk)};Deflate.prototype.onEnd=function(status){if(status===Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=utils.flattenChunks(this.chunks);this.chunks=[];this.err=status;this.msg=this.strm.msg};function deflate(input,options){var deflator=new Deflate(options);deflator.push(input,true);if(deflator.err)throw deflator.msg;return deflator.result}function deflateRaw(input, +options){options=options||{};options.raw=true;return deflate(input,options)}function gzip(input,options){options=options||{};options.gzip=true;return deflate(input,options)}exports.Deflate=Deflate;exports.deflate=deflate;exports.deflateRaw=deflateRaw;exports.gzip=gzip},{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(_dereq_,module,exports){var zlib_inflate=_dereq_("./zlib/inflate.js");var utils=_dereq_("./utils/common");var strings= +_dereq_("./utils/strings");var c=_dereq_("./zlib/constants");var msg=_dereq_("./zlib/messages");var zstream=_dereq_("./zlib/zstream");var gzheader=_dereq_("./zlib/gzheader");var Inflate=function(options){this.options=utils.assign({chunkSize:16384,windowBits:0,to:""},options||{});var opt=this.options;if(opt.raw&&opt.windowBits>=0&&opt.windowBits<16){opt.windowBits=-opt.windowBits;if(opt.windowBits===0)opt.windowBits=-15}if(opt.windowBits>=0&&opt.windowBits<16&&!(options&&options.windowBits))opt.windowBits+= +32;if(opt.windowBits>15&&opt.windowBits<48)if((opt.windowBits&15)===0)opt.windowBits|=15;this.err=0;this.msg="";this.ended=false;this.chunks=[];this.strm=new zstream;this.strm.avail_out=0;var status=zlib_inflate.inflateInit2(this.strm,opt.windowBits);if(status!==c.Z_OK)throw new Error(msg[status]);this.header=new gzheader;zlib_inflate.inflateGetHeader(this.strm,this.header)};Inflate.prototype.push=function(data,mode){var strm=this.strm;var chunkSize=this.options.chunkSize;var status,_mode;var next_out_utf8, +tail,utf8str;if(this.ended)return false;_mode=mode===~~mode?mode:mode===true?c.Z_FINISH:c.Z_NO_FLUSH;if(typeof data==="string")strm.input=strings.binstring2buf(data);else strm.input=data;strm.next_in=0;strm.avail_in=strm.input.length;do{if(strm.avail_out===0){strm.output=new utils.Buf8(chunkSize);strm.next_out=0;strm.avail_out=chunkSize}status=zlib_inflate.inflate(strm,c.Z_NO_FLUSH);if(status!==c.Z_STREAM_END&&status!==c.Z_OK){this.onEnd(status);this.ended=true;return false}if(strm.next_out)if(strm.avail_out=== +0||status===c.Z_STREAM_END||strm.avail_in===0&&_mode===c.Z_FINISH)if(this.options.to==="string"){next_out_utf8=strings.utf8border(strm.output,strm.next_out);tail=strm.next_out-next_out_utf8;utf8str=strings.buf2string(strm.output,next_out_utf8);strm.next_out=tail;strm.avail_out=chunkSize-tail;if(tail)utils.arraySet(strm.output,strm.output,next_out_utf8,tail,0);this.onData(utf8str)}else this.onData(utils.shrinkBuf(strm.output,strm.next_out))}while(strm.avail_in>0&&status!==c.Z_STREAM_END);if(status=== +c.Z_STREAM_END)_mode=c.Z_FINISH;if(_mode===c.Z_FINISH){status=zlib_inflate.inflateEnd(this.strm);this.onEnd(status);this.ended=true;return status===c.Z_OK}return true};Inflate.prototype.onData=function(chunk){this.chunks.push(chunk)};Inflate.prototype.onEnd=function(status){if(status===c.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=utils.flattenChunks(this.chunks);this.chunks=[];this.err=status;this.msg=this.strm.msg};function inflate(input,options){var inflator= +new Inflate(options);inflator.push(input,true);if(inflator.err)throw inflator.msg;return inflator.result}function inflateRaw(input,options){options=options||{};options.raw=true;return inflate(input,options)}exports.Inflate=Inflate;exports.inflate=inflate;exports.inflateRaw=inflateRaw;exports.ungzip=inflate},{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(_dereq_,module,exports){var TYPED_OK= +typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";exports.assign=function(obj){var sources=Array.prototype.slice.call(arguments,1);while(sources.length){var source=sources.shift();if(!source)continue;if(typeof source!=="object")throw new TypeError(source+"must be non-object");for(var p in source)if(source.hasOwnProperty(p))obj[p]=source[p]}return obj};exports.shrinkBuf=function(buf,size){if(buf.length===size)return buf;if(buf.subarray)return buf.subarray(0, +size);buf.length=size;return buf};var fnTyped={arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray){dest.set(src.subarray(src_offs,src_offs+len),dest_offs);return}for(var i=0;i=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;_utf8len[254]=_utf8len[254]=1;exports.string2buf=function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos>>6;buf[i++]=128|c&63}else if(c<65536){buf[i++]=224|c>>>12;buf[i++]= +128|c>>>6&63;buf[i++]=128|c&63}else{buf[i++]=240|c>>>18;buf[i++]=128|c>>>12&63;buf[i++]=128|c>>>6&63;buf[i++]=128|c&63}}return buf};function buf2binstring(buf,len){if(len<65537)if(buf.subarray&&STR_APPLY_UIA_OK||!buf.subarray&&STR_APPLY_OK)return String.fromCharCode.apply(null,utils.shrinkBuf(buf,len));var result="";for(var i=0;i4){utf16buf[out++]=65533;i+=c_len-1;continue}c&=c_len===2?31:c_len===3?15:7;while(c_len>1&&i1){utf16buf[out++]=65533;continue}if(c<65536)utf16buf[out++]= +c;else{c-=65536;utf16buf[out++]=55296|c>>10&1023;utf16buf[out++]=56320|c&1023}}return buf2binstring(utf16buf,out)};exports.utf8border=function(buf,max){var pos;max=max||buf.length;if(max>buf.length)max=buf.length;pos=max-1;while(pos>=0&&(buf[pos]&192)===128)pos--;if(pos<0)return max;if(pos===0)return max;return pos+_utf8len[buf[pos]]>max?pos:max}},{"./common":27}],29:[function(_dereq_,module,exports){function adler32(adler,buf,len,pos){var s1=adler&65535|0,s2=adler>>>16&65535|0,n=0;while(len!==0){n= +len>2E3?2E3:len;len-=n;do{s1=s1+buf[pos++]|0;s2=s2+s1|0}while(--n);s1%=65521;s2%=65521}return s1|s2<<16|0}module.exports=adler32},{}],30:[function(_dereq_,module,exports){module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4, +Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],31:[function(_dereq_,module,exports){function makeTable(){var c,table=[];for(var n=0;n<256;n++){c=n;for(var k=0;k<8;k++)c=c&1?3988292384^c>>>1:c>>>1;table[n]=c}return table}var crcTable=makeTable();function crc32(crc,buf,len,pos){var t=crcTable,end=pos+len;crc=crc^-1;for(var i=pos;i>>8^t[(crc^buf[i])&255];return crc^-1}module.exports=crc32},{}],32:[function(_dereq_,module,exports){var utils=_dereq_("../utils/common"); +var trees=_dereq_("./trees");var adler32=_dereq_("./adler32");var crc32=_dereq_("./crc32");var msg=_dereq_("./messages");var Z_NO_FLUSH=0;var Z_PARTIAL_FLUSH=1;var Z_FULL_FLUSH=3;var Z_FINISH=4;var Z_BLOCK=5;var Z_OK=0;var Z_STREAM_END=1;var Z_STREAM_ERROR=-2;var Z_DATA_ERROR=-3;var Z_BUF_ERROR=-5;var Z_DEFAULT_COMPRESSION=-1;var Z_FILTERED=1;var Z_HUFFMAN_ONLY=2;var Z_RLE=3;var Z_FIXED=4;var Z_DEFAULT_STRATEGY=0;var Z_UNKNOWN=2;var Z_DEFLATED=8;var MAX_MEM_LEVEL=9;var MAX_WBITS=15;var DEF_MEM_LEVEL= +8;var LENGTH_CODES=29;var LITERALS=256;var L_CODES=LITERALS+1+LENGTH_CODES;var D_CODES=30;var BL_CODES=19;var HEAP_SIZE=2*L_CODES+1;var MAX_BITS=15;var MIN_MATCH=3;var MAX_MATCH=258;var MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1;var PRESET_DICT=32;var INIT_STATE=42;var EXTRA_STATE=69;var NAME_STATE=73;var COMMENT_STATE=91;var HCRC_STATE=103;var BUSY_STATE=113;var FINISH_STATE=666;var BS_NEED_MORE=1;var BS_BLOCK_DONE=2;var BS_FINISH_STARTED=3;var BS_FINISH_DONE=4;var OS_CODE=3;function err(strm,errorCode){strm.msg= +msg[errorCode];return errorCode}function rank(f){return(f<<1)-(f>4?9:0)}function zero(buf){var len=buf.length;while(--len>=0)buf[len]=0}function flush_pending(strm){var s=strm.state;var len=s.pending;if(len>strm.avail_out)len=strm.avail_out;if(len===0)return;utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out);strm.next_out+=len;s.pending_out+=len;strm.total_out+=len;strm.avail_out-=len;s.pending-=len;if(s.pending===0)s.pending_out=0}function flush_block_only(s,last){trees._tr_flush_block(s, +s.block_start>=0?s.block_start:-1,s.strstart-s.block_start,last);s.block_start=s.strstart;flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=b>>>8&255;s.pending_buf[s.pending++]=b&255}function read_buf(strm,buf,start,size){var len=strm.avail_in;if(len>size)len=size;if(len===0)return 0;strm.avail_in-=len;utils.arraySet(buf,strm.input,strm.next_in,len,start);if(strm.state.wrap===1)strm.adler=adler32(strm.adler,buf,len,start); +else if(strm.state.wrap===2)strm.adler=crc32(strm.adler,buf,len,start);strm.next_in+=len;strm.total_in+=len;return len}function longest_match(s,cur_match){var chain_length=s.max_chain_length;var scan=s.strstart;var match;var len;var best_len=s.prev_length;var nice_match=s.nice_match;var limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0;var _win=s.window;var wmask=s.w_mask;var prev=s.prev;var strend=s.strstart+MAX_MATCH;var scan_end1=_win[scan+best_len-1];var scan_end=_win[scan+ +best_len];if(s.prev_length>=s.good_match)chain_length>>=2;if(nice_match>s.lookahead)nice_match=s.lookahead;do{match=cur_match;if(_win[match+best_len]!==scan_end||_win[match+best_len-1]!==scan_end1||_win[match]!==_win[scan]||_win[++match]!==_win[scan+1])continue;scan+=2;match++;do;while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]=== +_win[++match]&&scanbest_len){s.match_start=cur_match;best_len=len;if(len>=nice_match)break;scan_end1=_win[scan+best_len-1];scan_end=_win[scan+best_len]}}while((cur_match=prev[cur_match&wmask])>limit&&--chain_length!==0);if(best_len<=s.lookahead)return best_len;return s.lookahead}function fill_window(s){var _w_size=s.w_size;var p,n,m,more,str;do{more=s.window_size-s.lookahead-s.strstart;if(s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window, +s.window,_w_size,_w_size,0);s.match_start-=_w_size;s.strstart-=_w_size;s.block_start-=_w_size;n=s.hash_size;p=n;do{m=s.head[--p];s.head[p]=m>=_w_size?m-_w_size:0}while(--n);n=_w_size;p=n;do{m=s.prev[--p];s.prev[p]=m>=_w_size?m-_w_size:0}while(--n);more+=_w_size}if(s.strm.avail_in===0)break;n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more);s.lookahead+=n;if(s.lookahead+s.insert>=MIN_MATCH){str=s.strstart-s.insert;s.ins_h=s.window[str];s.ins_h=(s.ins_h<s.pending_buf_size-5)max_block_size=s.pending_buf_size-5;for(;;){if(s.lookahead<=1){fill_window(s);if(s.lookahead===0&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(s.lookahead=== +0)break}s.strstart+=s.lookahead;s.lookahead=0;var max_start=s.block_start+max_block_size;if(s.strstart===0||s.strstart>=max_start){s.lookahead=s.strstart-max_start;s.strstart=max_start;flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0)return BS_FINISH_STARTED;return BS_FINISH_DONE}if(s.strstart> +s.block_start){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}return BS_NEED_MORE}function deflate_fast(s,flush){var hash_head;var bflush;for(;;){if(s.lookahead=MIN_MATCH){s.ins_h=(s.ins_h<=MIN_MATCH){bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;if(s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do{s.strstart++;s.ins_h=(s.ins_h<=MIN_MATCH){s.ins_h=(s.ins_h<4096))s.match_length=MIN_MATCH-1}if(s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH;bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length- +MIN_MATCH);s.lookahead-=s.prev_length-1;s.prev_length-=2;do if(++s.strstart<=max_insert){s.ins_h=(s.ins_h<=MIN_MATCH&&s.strstart>0){scan=s.strstart-1;prev=_win[scan];if(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do;while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&& +prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scans.lookahead)s.match_length=s.lookahead}}if(s.match_length>=MIN_MATCH){bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH);s.lookahead-=s.match_length;s.strstart+=s.match_length;s.match_length=0}else{bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++}if(bflush){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}}s.insert= +0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0)return BS_FINISH_STARTED;return BS_FINISH_DONE}if(s.last_lit){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}return BS_BLOCK_DONE}function deflate_huff(s,flush){var bflush;for(;;){if(s.lookahead===0){fill_window(s);if(s.lookahead===0){if(flush===Z_NO_FLUSH)return BS_NEED_MORE;break}}s.match_length=0;bflush=trees._tr_tally(s,0,s.window[s.strstart]);s.lookahead--;s.strstart++;if(bflush){flush_block_only(s, +false);if(s.strm.avail_out===0)return BS_NEED_MORE}}s.insert=0;if(flush===Z_FINISH){flush_block_only(s,true);if(s.strm.avail_out===0)return BS_FINISH_STARTED;return BS_FINISH_DONE}if(s.last_lit){flush_block_only(s,false);if(s.strm.avail_out===0)return BS_NEED_MORE}return BS_BLOCK_DONE}var Config=function(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length;this.max_lazy=max_lazy;this.nice_length=nice_length;this.max_chain=max_chain;this.func=func};var configuration_table; +configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)];function lm_init(s){s.window_size=2*s.w_size;zero(s.head);s.max_lazy_match=configuration_table[s.level].max_lazy; +s.good_match=configuration_table[s.level].good_length;s.nice_match=configuration_table[s.level].nice_length;s.max_chain_length=configuration_table[s.level].max_chain;s.strstart=0;s.block_start=0;s.lookahead=0;s.insert=0;s.match_length=s.prev_length=MIN_MATCH-1;s.match_available=0;s.ins_h=0}function DeflateState(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=Z_DEFLATED;this.last_flush= +-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new utils.Buf16(HEAP_SIZE*2);this.dyn_dtree= +new utils.Buf16((2*D_CODES+1)*2);this.bl_tree=new utils.Buf16((2*BL_CODES+1)*2);zero(this.dyn_ltree);zero(this.dyn_dtree);zero(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new utils.Buf16(MAX_BITS+1);this.heap=new utils.Buf16(2*L_CODES+1);zero(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new utils.Buf16(2*L_CODES+1);zero(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0; +this.bi_buf=0;this.bi_valid=0}function deflateResetKeep(strm){var s;if(!strm||!strm.state)return err(strm,Z_STREAM_ERROR);strm.total_in=strm.total_out=0;strm.data_type=Z_UNKNOWN;s=strm.state;s.pending=0;s.pending_out=0;if(s.wrap<0)s.wrap=-s.wrap;s.status=s.wrap?INIT_STATE:BUSY_STATE;strm.adler=s.wrap===2?0:1;s.last_flush=Z_NO_FLUSH;trees._tr_init(s);return Z_OK}function deflateReset(strm){var ret=deflateResetKeep(strm);if(ret===Z_OK)lm_init(strm.state);return ret}function deflateSetHeader(strm,head){if(!strm|| +!strm.state)return Z_STREAM_ERROR;if(strm.state.wrap!==2)return Z_STREAM_ERROR;strm.state.gzhead=head;return Z_OK}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm)return Z_STREAM_ERROR;var wrap=1;if(level===Z_DEFAULT_COMPRESSION)level=6;if(windowBits<0){wrap=0;windowBits=-windowBits}else if(windowBits>15){wrap=2;windowBits-=16}if(memLevel<1||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||windowBits<8||windowBits>15||level<0||level>9||strategy<0||strategy>Z_FIXED)return err(strm, +Z_STREAM_ERROR);if(windowBits===8)windowBits=9;var s=new DeflateState;strm.state=s;s.strm=strm;s.wrap=wrap;s.gzhead=null;s.w_bits=windowBits;s.w_size=1<>1;s.l_buf=(1+2)*s.lit_bufsize;s.level=level;s.strategy=strategy;s.method=method;return deflateReset(strm)}function deflateInit(strm,level){return deflateInit2(strm,level,Z_DEFLATED,MAX_WBITS,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY)}function deflate(strm,flush){var old_flush,s;var beg,val;if(!strm||!strm.state||flush>Z_BLOCK||flush<0)return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR;s=strm.state;if(!strm.output||!strm.input&&strm.avail_in!==0||s.status===FINISH_STATE&&flush!==Z_FINISH)return err(strm, +strm.avail_out===0?Z_BUF_ERROR:Z_STREAM_ERROR);s.strm=strm;old_flush=s.last_flush;s.last_flush=flush;if(s.status===INIT_STATE)if(s.wrap===2){strm.adler=0;put_byte(s,31);put_byte(s,139);put_byte(s,8);if(!s.gzhead){put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,0);put_byte(s,s.level===9?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0);put_byte(s,OS_CODE);s.status=BUSY_STATE}else{put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(!s.gzhead.extra?0:4)+(!s.gzhead.name?0:8)+(!s.gzhead.comment? +0:16));put_byte(s,s.gzhead.time&255);put_byte(s,s.gzhead.time>>8&255);put_byte(s,s.gzhead.time>>16&255);put_byte(s,s.gzhead.time>>24&255);put_byte(s,s.level===9?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0);put_byte(s,s.gzhead.os&255);if(s.gzhead.extra&&s.gzhead.extra.length){put_byte(s,s.gzhead.extra.length&255);put_byte(s,s.gzhead.extra.length>>8&255)}if(s.gzhead.hcrc)strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0);s.gzindex=0;s.status=EXTRA_STATE}}else{var header=Z_DEFLATED+(s.w_bits-8<< +4)<<8;var level_flags=-1;if(s.strategy>=Z_HUFFMAN_ONLY||s.level<2)level_flags=0;else if(s.level<6)level_flags=1;else if(s.level===6)level_flags=2;else level_flags=3;header|=level_flags<<6;if(s.strstart!==0)header|=PRESET_DICT;header+=31-header%31;s.status=BUSY_STATE;putShortMSB(s,header);if(s.strstart!==0){putShortMSB(s,strm.adler>>>16);putShortMSB(s,strm.adler&65535)}strm.adler=1}if(s.status===EXTRA_STATE)if(s.gzhead.extra){beg=s.pending;while(s.gzindex<(s.gzhead.extra.length&65535)){if(s.pending=== +s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size)break}put_byte(s,s.gzhead.extra[s.gzindex]&255);s.gzindex++}if(s.gzhead.hcrc&&s.pending>beg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);if(s.gzindex===s.gzhead.extra.length){s.gzindex=0;s.status=NAME_STATE}}else s.status=NAME_STATE;if(s.status===NAME_STATE)if(s.gzhead.name){beg=s.pending;do{if(s.pending=== +s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){val=1;break}}if(s.gzindexbeg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);if(val===0){s.gzindex=0;s.status=COMMENT_STATE}}else s.status=COMMENT_STATE;if(s.status===COMMENT_STATE)if(s.gzhead.comment){beg= +s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>beg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);flush_pending(strm);beg=s.pending;if(s.pending===s.pending_buf_size){val=1;break}}if(s.gzindexbeg)strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg);if(val===0)s.status=HCRC_STATE}else s.status=HCRC_STATE;if(s.status=== +HCRC_STATE)if(s.gzhead.hcrc){if(s.pending+2>s.pending_buf_size)flush_pending(strm);if(s.pending+2<=s.pending_buf_size){put_byte(s,strm.adler&255);put_byte(s,strm.adler>>8&255);strm.adler=0;s.status=BUSY_STATE}}else s.status=BUSY_STATE;if(s.pending!==0){flush_pending(strm);if(strm.avail_out===0){s.last_flush=-1;return Z_OK}}else if(strm.avail_in===0&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH)return err(strm,Z_BUF_ERROR);if(s.status===FINISH_STATE&&strm.avail_in!==0)return err(strm,Z_BUF_ERROR); +if(strm.avail_in!==0||s.lookahead!==0||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?deflate_huff(s,flush):s.strategy===Z_RLE?deflate_rle(s,flush):configuration_table[s.level].func(s,flush);if(bstate===BS_FINISH_STARTED||bstate===BS_FINISH_DONE)s.status=FINISH_STATE;if(bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED){if(strm.avail_out===0)s.last_flush=-1;return Z_OK}if(bstate===BS_BLOCK_DONE){if(flush===Z_PARTIAL_FLUSH)trees._tr_align(s);else if(flush!==Z_BLOCK){trees._tr_stored_block(s, +0,0,false);if(flush===Z_FULL_FLUSH){zero(s.head);if(s.lookahead===0){s.strstart=0;s.block_start=0;s.insert=0}}}flush_pending(strm);if(strm.avail_out===0){s.last_flush=-1;return Z_OK}}}if(flush!==Z_FINISH)return Z_OK;if(s.wrap<=0)return Z_STREAM_END;if(s.wrap===2){put_byte(s,strm.adler&255);put_byte(s,strm.adler>>8&255);put_byte(s,strm.adler>>16&255);put_byte(s,strm.adler>>24&255);put_byte(s,strm.total_in&255);put_byte(s,strm.total_in>>8&255);put_byte(s,strm.total_in>>16&255);put_byte(s,strm.total_in>> +24&255)}else{putShortMSB(s,strm.adler>>>16);putShortMSB(s,strm.adler&65535)}flush_pending(strm);if(s.wrap>0)s.wrap=-s.wrap;return s.pending!==0?Z_OK:Z_STREAM_END}function deflateEnd(strm){var status;if(!strm||!strm.state)return Z_STREAM_ERROR;status=strm.state.status;if(status!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE)return err(strm,Z_STREAM_ERROR);strm.state=null;return status===BUSY_STATE?err(strm, +Z_DATA_ERROR):Z_OK}exports.deflateInit=deflateInit;exports.deflateInit2=deflateInit2;exports.deflateReset=deflateReset;exports.deflateResetKeep=deflateResetKeep;exports.deflateSetHeader=deflateSetHeader;exports.deflate=deflate;exports.deflateEnd=deflateEnd;exports.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(_dereq_,module,exports){function GZheader(){this.text=0;this.time=0;this.xflags=0;this.os=0; +this.extra=null;this.extra_len=0;this.name="";this.comment="";this.hcrc=0;this.done=false}module.exports=GZheader},{}],34:[function(_dereq_,module,exports){var BAD=30;var TYPE=12;module.exports=function inflate_fast(strm,start){var state;var _in;var last;var _out;var beg;var end;var dmax;var wsize;var whave;var wnext;var window;var hold;var bits;var lcode;var dcode;var lmask;var dmask;var here;var op;var len;var dist;var from;var from_source;var input,output;state=strm.state;_in=strm.next_in;input= +strm.input;last=_in+(strm.avail_in-5);_out=strm.next_out;output=strm.output;beg=_out-(start-strm.avail_out);end=_out+(strm.avail_out-257);dmax=state.dmax;wsize=state.wsize;whave=state.whave;wnext=state.wnext;window=state.window;hold=state.hold;bits=state.bits;lcode=state.lencode;dcode=state.distcode;lmask=(1<>>24;hold>>>=op; +bits-=op;op=here>>>16&255;if(op===0)output[_out++]=here&65535;else if(op&16){len=here&65535;op&=15;if(op){if(bits>>=op;bits-=op}if(bits<15){hold+=input[_in++]<>>24;hold>>>=op;bits-=op;op=here>>>16&255;if(op&16){dist=here&65535;op&=15;if(bitsdmax){strm.msg="invalid distance too far back";state.mode=BAD;break top}hold>>>=op;bits-=op;op=_out-beg;if(dist>op){op=dist-op;if(op>whave)if(state.sane){strm.msg="invalid distance too far back";state.mode=BAD;break top}from=0;from_source=window;if(wnext===0){from+=wsize-op;if(op2){output[_out++]=from_source[from++];output[_out++]=from_source[from++];output[_out++]=from_source[from++];len-=3}if(len){output[_out++]=from_source[from++];if(len>1)output[_out++]=from_source[from++]}}else{from=_out-dist;do{output[_out++]=output[from++];output[_out++]= +output[from++];output[_out++]=output[from++];len-=3}while(len>2);if(len){output[_out++]=output[from++];if(len>1)output[_out++]=output[from++]}}}else if((op&64)===0){here=dcode[(here&65535)+(hold&(1<>3;_in-=len;bits-=len<<3;hold&=(1<>>24&255)+(q>>>8&65280)+((q&65280)<<8)+((q&255)<<24)}function InflateState(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset= +0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new utils.Buf16(320);this.work=new utils.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function inflateResetKeep(strm){var state;if(!strm||!strm.state)return Z_STREAM_ERROR;state=strm.state;strm.total_in=strm.total_out=state.total=0;strm.msg="";if(state.wrap)strm.adler=state.wrap&1;state.mode=HEAD;state.last= +0;state.havedict=0;state.dmax=32768;state.head=null;state.hold=0;state.bits=0;state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS);state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS);state.sane=1;state.back=-1;return Z_OK}function inflateReset(strm){var state;if(!strm||!strm.state)return Z_STREAM_ERROR;state=strm.state;state.wsize=0;state.whave=0;state.wnext=0;return inflateResetKeep(strm)}function inflateReset2(strm,windowBits){var wrap;var state;if(!strm||!strm.state)return Z_STREAM_ERROR; +state=strm.state;if(windowBits<0){wrap=0;windowBits=-windowBits}else{wrap=(windowBits>>4)+1;if(windowBits<48)windowBits&=15}if(windowBits&&(windowBits<8||windowBits>15))return Z_STREAM_ERROR;if(state.window!==null&&state.wbits!==windowBits)state.window=null;state.wrap=wrap;state.wbits=windowBits;return inflateReset(strm)}function inflateInit2(strm,windowBits){var ret;var state;if(!strm)return Z_STREAM_ERROR;state=new InflateState;strm.state=state;state.window=null;ret=inflateReset2(strm,windowBits); +if(ret!==Z_OK)strm.state=null;return ret}function inflateInit(strm){return inflateInit2(strm,DEF_WBITS)}var virgin=true;var lenfix,distfix;function fixedtables(state){if(virgin){var sym;lenfix=new utils.Buf32(512);distfix=new utils.Buf32(32);sym=0;while(sym<144)state.lens[sym++]=8;while(sym<256)state.lens[sym++]=9;while(sym<280)state.lens[sym++]=7;while(sym<288)state.lens[sym++]=8;inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9});sym=0;while(sym<32)state.lens[sym++]=5;inflate_table(DISTS, +state.lens,0,32,distfix,0,state.work,{bits:5});virgin=false}state.lencode=lenfix;state.lenbits=9;state.distcode=distfix;state.distbits=5}function updatewindow(strm,src,end,copy){var dist;var state=strm.state;if(state.window===null){state.wsize=1<=state.wsize){utils.arraySet(state.window,src,end-state.wsize,state.wsize,0);state.wnext=0;state.whave=state.wsize}else{dist=state.wsize-state.wnext;if(dist>copy)dist= +copy;utils.arraySet(state.window,src,end-copy,dist,state.wnext);copy-=dist;if(copy){utils.arraySet(state.window,src,end-copy,copy,0);state.wnext=copy;state.whave=state.wsize}else{state.wnext+=dist;if(state.wnext===state.wsize)state.wnext=0;if(state.whave>>8&255;state.check=crc32(state.check,hbuf,2,0);hold=0;bits=0;state.mode=FLAGS;break}state.flags=0;if(state.head)state.head.done=false;if(!(state.wrap&1)||(((hold&255)<<8)+(hold>>8))%31){strm.msg="incorrect header check";state.mode=BAD;break}if((hold&15)!==Z_DEFLATED){strm.msg="unknown compression method";state.mode= +BAD;break}hold>>>=4;bits-=4;len=(hold&15)+8;if(state.wbits===0)state.wbits=len;else if(len>state.wbits){strm.msg="invalid window size";state.mode=BAD;break}state.dmax=1<>8&1;if(state.flags&512){hbuf[0]=hold&255;hbuf[1]=hold>>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0;state.mode=TIME;case TIME:while(bits<32){if(have===0)break inf_leave;have--;hold+=input[next++]<>>8&255;hbuf[2]=hold>>>16&255;hbuf[3]=hold>>>24&255;state.check=crc32(state.check,hbuf,4,0)}hold=0;bits=0;state.mode=OS;case OS:while(bits< +16){if(have===0)break inf_leave;have--;hold+=input[next++]<>8}if(state.flags&512){hbuf[0]=hold&255;hbuf[1]=hold>>>8&255;state.check=crc32(state.check,hbuf,2,0)}hold=0;bits=0;state.mode=EXLEN;case EXLEN:if(state.flags&1024){while(bits<16){if(have===0)break inf_leave;have--;hold+=input[next++]<>>8&255;state.check= +crc32(state.check,hbuf,2,0)}hold=0;bits=0}else if(state.head)state.head.extra=null;state.mode=EXTRA;case EXTRA:if(state.flags&1024){copy=state.length;if(copy>have)copy=have;if(copy){if(state.head){len=state.head.extra_len-state.length;if(!state.head.extra)state.head.extra=new Array(state.head.extra_len);utils.arraySet(state.head.extra,input,next,copy,len)}if(state.flags&512)state.check=crc32(state.check,input,copy,next);have-=copy;next+=copy;state.length-=copy}if(state.length)break inf_leave}state.length= +0;state.mode=NAME;case NAME:if(state.flags&2048){if(have===0)break inf_leave;copy=0;do{len=input[next+copy++];if(state.head&&len&&state.length<65536)state.head.name+=String.fromCharCode(len)}while(len&©>9&1;state.head.done=true}strm.adler=state.check=0;state.mode=TYPE;break;case DICTID:while(bits<32){if(have===0)break inf_leave;have--;hold+=input[next++]<>>=bits&7;bits-=bits&7;state.mode=CHECK;break}while(bits<3){if(have===0)break inf_leave;have--;hold+=input[next++]<>>=1;bits-=1;switch(hold&3){case 0:state.mode=STORED;break;case 1:fixedtables(state);state.mode=LEN_;if(flush===Z_TREES){hold>>>=2;bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type";state.mode=BAD}hold>>>=2;bits-=2;break;case STORED:hold>>>=bits&7;bits-=bits&7;while(bits< +32){if(have===0)break inf_leave;have--;hold+=input[next++]<>>16^65535)){strm.msg="invalid stored block lengths";state.mode=BAD;break}state.length=hold&65535;hold=0;bits=0;state.mode=COPY_;if(flush===Z_TREES)break inf_leave;case COPY_:state.mode=COPY;case COPY:copy=state.length;if(copy){if(copy>have)copy=have;if(copy>left)copy=left;if(copy===0)break inf_leave;utils.arraySet(output,input,next,copy,put);have-=copy;next+=copy;left-=copy;put+=copy;state.length-=copy; +break}state.mode=TYPE;break;case TABLE:while(bits<14){if(have===0)break inf_leave;have--;hold+=input[next++]<>>=5;bits-=5;state.ndist=(hold&31)+1;hold>>>=5;bits-=5;state.ncode=(hold&15)+4;hold>>>=4;bits-=4;if(state.nlen>286||state.ndist>30){strm.msg="too many length or distance symbols";state.mode=BAD;break}state.have=0;state.mode=LENLENS;case LENLENS:while(state.have>>=3;bits-=3}while(state.have<19)state.lens[order[state.have++]]=0;state.lencode=state.lendyn;state.lenbits=7;opts={bits:state.lenbits};ret=inflate_table(CODES,state.lens,0,19,state.lencode,0,state.work,opts);state.lenbits=opts.bits;if(ret){strm.msg="invalid code lengths set";state.mode=BAD;break}state.have=0;state.mode=CODELENS;case CODELENS:while(state.have>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits)break;if(have===0)break inf_leave;have--;hold+=input[next++]<>>=here_bits;bits-=here_bits;state.lens[state.have++]=here_val}else{if(here_val===16){n=here_bits+2;while(bits>>=here_bits;bits-=here_bits;if(state.have===0){strm.msg="invalid bit length repeat";state.mode=BAD;break}len=state.lens[state.have-1];copy=3+(hold& +3);hold>>>=2;bits-=2}else if(here_val===17){n=here_bits+3;while(bits>>=here_bits;bits-=here_bits;len=0;copy=3+(hold&7);hold>>>=3;bits-=3}else{n=here_bits+7;while(bits>>=here_bits;bits-=here_bits;len=0;copy=11+(hold&127);hold>>>=7;bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat";state.mode=BAD;break}while(copy--)state.lens[state.have++]= +len}}if(state.mode===BAD)break;if(state.lens[256]===0){strm.msg="invalid code -- missing end-of-block";state.mode=BAD;break}state.lenbits=9;opts={bits:state.lenbits};ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts);state.lenbits=opts.bits;if(ret){strm.msg="invalid literal/lengths set";state.mode=BAD;break}state.distbits=6;state.distcode=state.distdyn;opts={bits:state.distbits};ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts); +state.distbits=opts.bits;if(ret){strm.msg="invalid distances set";state.mode=BAD;break}state.mode=LEN_;if(flush===Z_TREES)break inf_leave;case LEN_:state.mode=LEN;case LEN:if(have>=6&&left>=258){strm.next_out=put;strm.avail_out=left;strm.next_in=next;strm.avail_in=have;state.hold=hold;state.bits=bits;inflate_fast(strm,_out);put=strm.next_out;output=strm.output;left=strm.avail_out;next=strm.next_in;input=strm.input;have=strm.avail_in;hold=state.hold;bits=state.bits;if(state.mode===TYPE)state.back= +-1;break}state.back=0;for(;;){here=state.lencode[hold&(1<>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits)break;if(have===0)break inf_leave;have--;hold+=input[next++]<>last_bits)];here_bits=here>>>24;here_op=here>>>16&255;here_val=here&65535;if(last_bits+here_bits<=bits)break;if(have=== +0)break inf_leave;have--;hold+=input[next++]<>>=last_bits;bits-=last_bits;state.back+=last_bits}hold>>>=here_bits;bits-=here_bits;state.back+=here_bits;state.length=here_val;if(here_op===0){state.mode=LIT;break}if(here_op&32){state.back=-1;state.mode=TYPE;break}if(here_op&64){strm.msg="invalid literal/length code";state.mode=BAD;break}state.extra=here_op&15;state.mode=LENEXT;case LENEXT:if(state.extra){n=state.extra;while(bits>>=state.extra;bits-=state.extra;state.back+=state.extra}state.was=state.length;state.mode=DIST;case DIST:for(;;){here=state.distcode[hold&(1<>>24;here_op=here>>>16&255;here_val=here&65535;if(here_bits<=bits)break;if(have===0)break inf_leave;have--;hold+=input[next++]<>last_bits)];here_bits=here>>>24;here_op=here>>>16&255;here_val=here&65535;if(last_bits+here_bits<=bits)break;if(have===0)break inf_leave;have--;hold+=input[next++]<>>=last_bits;bits-=last_bits;state.back+=last_bits}hold>>>=here_bits;bits-=here_bits;state.back+=here_bits;if(here_op&64){strm.msg="invalid distance code";state.mode=BAD;break}state.offset=here_val;state.extra=here_op&15;state.mode=DISTEXT;case DISTEXT:if(state.extra){n=state.extra;while(bits>>=state.extra;bits-=state.extra;state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back";state.mode=BAD;break}state.mode=MATCH;case MATCH:if(left===0)break inf_leave;copy=_out-left;if(state.offset>copy){copy=state.offset-copy;if(copy>state.whave)if(state.sane){strm.msg="invalid distance too far back";state.mode=BAD;break}if(copy>state.wnext){copy-=state.wnext; +from=state.wsize-copy}else from=state.wnext-copy;if(copy>state.length)copy=state.length;from_source=state.window}else{from_source=output;from=put-state.offset;copy=state.length}if(copy>left)copy=left;left-=copy;state.length-=copy;do output[put++]=from_source[from++];while(--copy);if(state.length===0)state.mode=LEN;break;case LIT:if(left===0)break inf_leave;output[put++]=state.length;left--;state.mode=LEN;break;case CHECK:if(state.wrap){while(bits<32){if(have===0)break inf_leave;have--;hold|=input[next++]<< +bits;bits+=8}_out-=left;strm.total_out+=_out;state.total+=_out;if(_out)strm.adler=state.check=state.flags?crc32(state.check,output,_out,put-_out):adler32(state.check,output,_out,put-_out);_out=left;if((state.flags?hold:ZSWAP32(hold))!==state.check){strm.msg="incorrect data check";state.mode=BAD;break}hold=0;bits=0}state.mode=LENGTH;case LENGTH:if(state.wrap&&state.flags){while(bits<32){if(have===0)break inf_leave;have--;hold+=input[next++]<=1;max--)if(count[max]!==0)break;if(root>max)root=max;if(max===0){table[table_index++]=1<<24|64<<16|0;table[table_index++]= +1<<24|64<<16|0;opts.bits=1;return 0}for(min=1;min0&&(type===CODES||max!==1))return-1;offs[1]=0;for(len=1;lenENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS)return 1;var i=0;for(;;){i++;here_bits=len-drop;if(work[sym]end){here_op=extra[extra_index+work[sym]];here_val=base[base_index+work[sym]]}else{here_op=32+64;here_val=0}incr=1<>drop)+fill]= +here_bits<<24|here_op<<16|here_val|0}while(fill!==0);incr=1<>=1;if(incr!==0){huff&=incr-1;huff+=incr}else huff=0;sym++;if(--count[len]===0){if(len===max)break;len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){if(drop===0)drop=root;next+=min;curr=len-drop;left=1<ENOUGH_LENS||type===DISTS&&used>ENOUGH_DISTS)return 1;low=huff&mask;table[low]=root<< +24|curr<<16|next-table_index|0}}if(huff!==0)table[next+huff]=len-drop<<24|64<<16|0;opts.bits=root;return 0}},{"../utils/common":27}],37:[function(_dereq_,module,exports){module.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],38:[function(_dereq_,module,exports){var utils=_dereq_("../utils/common");var Z_FIXED=4;var Z_BINARY=0;var Z_TEXT=1;var Z_UNKNOWN=2;function zero(buf){var len= +buf.length;while(--len>=0)buf[len]=0}var STORED_BLOCK=0;var STATIC_TREES=1;var DYN_TREES=2;var MIN_MATCH=3;var MAX_MATCH=258;var LENGTH_CODES=29;var LITERALS=256;var L_CODES=LITERALS+1+LENGTH_CODES;var D_CODES=30;var BL_CODES=19;var HEAP_SIZE=2*L_CODES+1;var MAX_BITS=15;var Buf_size=16;var MAX_BL_BITS=7;var END_BLOCK=256;var REP_3_6=16;var REPZ_3_10=17;var REPZ_11_138=18;var extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7, +7,8,8,9,9,10,10,11,11,12,12,13,13];var extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var DIST_CODE_LEN=512;var static_ltree=new Array((L_CODES+2)*2);zero(static_ltree);var static_dtree=new Array(D_CODES*2);zero(static_dtree);var _dist_code=new Array(DIST_CODE_LEN);zero(_dist_code);var _length_code=new Array(MAX_MATCH-MIN_MATCH+1);zero(_length_code);var base_length=new Array(LENGTH_CODES);zero(base_length);var base_dist=new Array(D_CODES); +zero(base_dist);var StaticTreeDesc=function(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree;this.extra_bits=extra_bits;this.extra_base=extra_base;this.elems=elems;this.max_length=max_length;this.has_stree=static_tree&&static_tree.length};var static_l_desc;var static_d_desc;var static_bl_desc;var TreeDesc=function(dyn_tree,stat_desc){this.dyn_tree=dyn_tree;this.max_code=0;this.stat_desc=stat_desc};function d_code(dist){return dist<256?_dist_code[dist]:_dist_code[256+ +(dist>>>7)]}function put_short(s,w){s.pending_buf[s.pending++]=w&255;s.pending_buf[s.pending++]=w>>>8&255}function send_bits(s,value,length){if(s.bi_valid>Buf_size-length){s.bi_buf|=value<>Buf_size-s.bi_valid;s.bi_valid+=length-Buf_size}else{s.bi_buf|=value<>>=1;res<<=1}while(--len>0); +return res>>>1}function bi_flush(s){if(s.bi_valid===16){put_short(s,s.bi_buf);s.bi_buf=0;s.bi_valid=0}else if(s.bi_valid>=8){s.pending_buf[s.pending++]=s.bi_buf&255;s.bi_buf>>=8;s.bi_valid-=8}}function gen_bitlen(s,desc){var tree=desc.dyn_tree;var max_code=desc.max_code;var stree=desc.stat_desc.static_tree;var has_stree=desc.stat_desc.has_stree;var extra=desc.stat_desc.extra_bits;var base=desc.stat_desc.extra_base;var max_length=desc.stat_desc.max_length;var h;var n,m;var bits;var xbits;var f;var overflow= +0;for(bits=0;bits<=MAX_BITS;bits++)s.bl_count[bits]=0;tree[s.heap[s.heap_max]*2+1]=0;for(h=s.heap_max+1;hmax_length){bits=max_length;overflow++}tree[n*2+1]=bits;if(n>max_code)continue;s.bl_count[bits]++;xbits=0;if(n>=base)xbits=extra[n-base];f=tree[n*2];s.opt_len+=f*(bits+xbits);if(has_stree)s.static_len+=f*(stree[n*2+1]+xbits)}if(overflow===0)return;do{bits=max_length-1;while(s.bl_count[bits]===0)bits--;s.bl_count[bits]--;s.bl_count[bits+ +1]+=2;s.bl_count[max_length]--;overflow-=2}while(overflow>0);for(bits=max_length;bits!==0;bits--){n=s.bl_count[bits];while(n!==0){m=s.heap[--h];if(m>max_code)continue;if(tree[m*2+1]!==bits){s.opt_len+=(bits-tree[m*2+1])*tree[m*2];tree[m*2+1]=bits}n--}}}function gen_codes(tree,max_code,bl_count){var next_code=new Array(MAX_BITS+1);var code=0;var bits;var n;for(bits=1;bits<=MAX_BITS;bits++)next_code[bits]=code=code+bl_count[bits-1]<<1;for(n=0;n<=max_code;n++){var len=tree[n*2+1];if(len===0)continue; +tree[n*2]=bi_reverse(next_code[len]++,len)}}function tr_static_init(){var n;var bits;var length;var code;var dist;var bl_count=new Array(MAX_BITS+1);length=0;for(code=0;code>=7;for(;code8)put_short(s,s.bi_buf);else if(s.bi_valid>0)s.pending_buf[s.pending++]= +s.bi_buf;s.bi_buf=0;s.bi_valid=0}function copy_block(s,buf,len,header){bi_windup(s);if(header){put_short(s,len);put_short(s,~len)}utils.arraySet(s.pending_buf,s.window,buf,len,s.pending);s.pending+=len}function smaller(tree,n,m,depth){var _n2=n*2;var _m2=m*2;return tree[_n2]>1;n>=1;n--)pqdownheap(s,tree,n);node=elems;do{n=s.heap[1];s.heap[1]=s.heap[s.heap_len--];pqdownheap(s,tree,1);m=s.heap[1];s.heap[--s.heap_max]=n;s.heap[--s.heap_max]=m;tree[node*2]=tree[n*2]+tree[m*2];s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1;tree[n*2+1]=tree[m*2+1]=node;s.heap[1]=node++;pqdownheap(s,tree,1)}while(s.heap_len>=2);s.heap[--s.heap_max]=s.heap[1];gen_bitlen(s, +desc);gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var n;var prevlen=-1;var curlen;var nextlen=tree[0*2+1];var count=0;var max_count=7;var min_count=4;if(nextlen===0){max_count=138;min_count=3}tree[(max_code+1)*2+1]=65535;for(n=0;n<=max_code;n++){curlen=nextlen;nextlen=tree[(n+1)*2+1];if(++count=3;max_blindex--)if(s.bl_tree[bl_order[max_blindex]*2+1]!==0)break;s.opt_len+=3*(max_blindex+1)+5+5+4;return max_blindex}function send_all_trees(s,lcodes,dcodes,blcodes){var rank;send_bits(s,lcodes-257,5);send_bits(s,dcodes-1,5);send_bits(s,blcodes-4,4);for(rank=0;rank>>=1)if(black_mask&1&&s.dyn_ltree[n*2]!==0)return Z_BINARY;if(s.dyn_ltree[9*2]!==0||s.dyn_ltree[10*2]!==0||s.dyn_ltree[13*2]!==0)return Z_TEXT;for(n=32;n0){if(s.strm.data_type===Z_UNKNOWN)s.strm.data_type= +detect_data_type(s);build_tree(s,s.l_desc);build_tree(s,s.d_desc);max_blindex=build_bl_tree(s);opt_lenb=s.opt_len+3+7>>>3;static_lenb=s.static_len+3+7>>>3;if(static_lenb<=opt_lenb)opt_lenb=static_lenb}else opt_lenb=static_lenb=stored_len+5;if(stored_len+4<=opt_lenb&&buf!==-1)_tr_stored_block(s,buf,stored_len,last);else if(s.strategy===Z_FIXED||static_lenb===opt_lenb){send_bits(s,(STATIC_TREES<<1)+(last?1:0),3);compress_block(s,static_ltree,static_dtree)}else{send_bits(s,(DYN_TREES<<1)+(last?1:0), +3);send_all_trees(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1);compress_block(s,s.dyn_ltree,s.dyn_dtree)}init_block(s);if(last)bi_windup(s)}function _tr_tally(s,dist,lc){s.pending_buf[s.d_buf+s.last_lit*2]=dist>>>8&255;s.pending_buf[s.d_buf+s.last_lit*2+1]=dist&255;s.pending_buf[s.l_buf+s.last_lit]=lc&255;s.last_lit++;if(dist===0)s.dyn_ltree[lc*2]++;else{s.matches++;dist--;s.dyn_ltree[(_length_code[lc]+LITERALS+1)*2]++;s.dyn_dtree[d_code(dist)*2]++}return s.last_lit===s.lit_bufsize-1} +exports._tr_init=_tr_init;exports._tr_stored_block=_tr_stored_block;exports._tr_flush_block=_tr_flush_block;exports._tr_tally=_tr_tally;exports._tr_align=_tr_align},{"../utils/common":27}],39:[function(_dereq_,module,exports){function ZStream(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}module.exports=ZStream},{}]},{},[9])(9)}); diff --git a/api/js/webodf/wodotexteditor/docs/files.html b/api/js/webodf/wodotexteditor/docs/files.html new file mode 100644 index 0000000000..43da2322c8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/docs/files.html @@ -0,0 +1,220 @@ + + + + + + JsDoc Reference - File Index + + + + + + + + +
+ +
+

Classes

+ +
+
+ +
+

File Index

+ + +
+

wodotexteditor.js

+ +
+ + + + +
+
+
+ + +
+
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST) +
+ + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/docs/index.html b/api/js/webodf/wodotexteditor/docs/index.html new file mode 100644 index 0000000000..6bb95ddae1 --- /dev/null +++ b/api/js/webodf/wodotexteditor/docs/index.html @@ -0,0 +1,226 @@ + + + + + + JsDoc Reference - Index + + + + + + + + +
+ +
+

Classes

+ +
+
+ +
+

Class Index

+ + +
+

_global_

+ +
+
+ +
+

TextEditor

+ +
+
+ +
+

Wodo

+ +
+
+ + +
+
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST) +
+ + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/docs/symbols/TextEditor.html b/api/js/webodf/wodotexteditor/docs/symbols/TextEditor.html new file mode 100644 index 0000000000..83c4b456a0 --- /dev/null +++ b/api/js/webodf/wodotexteditor/docs/symbols/TextEditor.html @@ -0,0 +1,989 @@ + + + + + + + JsDoc Reference - TextEditor + + + + + + + + + + + +
+ + +
+

Classes

+ +
+ +
+ +
+ +

+ + Class TextEditor +

+ + +

+ + + + + + +
Defined in: wodotexteditor.js. + +

+ + + + + + + + + + + + + + + + + +
Class Summary
Constructor AttributesConstructor Name and Description
  +
+ TextEditor(mainContainerElementId, editorOptions) +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
Method AttributesMethod Name and Description
  +
addEventListener(eventId, callback) +
+
Registers a callback which should be called if the given event happens.
+
  +
closeDocument(callback) +
+
Closes the document, and does cleanup.
+
  +
destroy(callback) +
+
Destructs the editor object completely.
+
  + +
+
  +
getMetadata(property) +
+
Returns the value of the requested document metadata field.
+
  + +
Returns the data set for the person that is editing the document.
+
  + +
Returns if the current state of the document matches the unmodified state.
+
  +
openDocumentFromUrl(docUrl, callback) +
+
Loads an ODT document into the editor.
+
  +
removeEventListener(eventId, callback) +
+
Unregisters a callback for the given event.
+
  +
setDocumentModified(modified) +
+
Sets the current state of the document to be either the unmodified state +or a modified state.
+
  +
setMetadata(setProperties, removedProperties) +
+
Sets the metadata fields from the given properties map.
+
  +
setUserData(data) +
+
Sets the data for the person that is editing the document.
+
+ + + + + + + + + +
+
+ Class Detail +
+ +
+ TextEditor(mainContainerElementId, editorOptions) +
+ +
+ + +
+ + + + + +
+
Parameters:
+ +
+ {!string} mainContainerElementId + +
+
+ +
+ {!Object.} editorOptions + +
+
+ +
+ + + + + + + + +
+ + + + + + + +
+ Method Detail +
+ + +
+ + {undefined} + addEventListener(eventId, callback) + +
+
+ Registers a callback which should be called if the given event happens. + + +
+ + + + +
+
Parameters:
+ +
+ {!string} eventId + +
+
+ +
+ {!Function} callback + +
+
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + +
+ + +
+ + {undefined} + closeDocument(callback) + +
+
+ Closes the document, and does cleanup. + + +
+ + + + +
+
Parameters:
+ +
+ {!function(!Error=):undefined} callback + +
+
Called once the document has been closed, passes an error object in case of error
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + +
+ + +
+ + {undefined} + destroy(callback) + +
+
+ Destructs the editor object completely. + + +
+ + + + +
+
Parameters:
+ +
+ {!function(!Error=):undefined} callback + +
+
Called once the destruction has been completed, passes an error object in case of error
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + +
+ + +
+ + {undefined} + getDocumentAsByteArray(callback) + +
+
+ + + +
+ + + + +
+
Parameters:
+ +
+ {!function(err:?Error|file:!Uint8Array=):undefined} callback + +
+
Called with the current document as ODT file as bytearray, passes an error object in case of error
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + +
+ + +
+ + {?string} + getMetadata(property) + +
+
+ Returns the value of the requested document metadata field. + + +
+ + + + +
+
Parameters:
+ +
+ {!string} property + +
+
A namespace-prefixed field name, for example +dc:creator
+ +
+ + + + + +
+
Returns:
+ +
{?string}
+ +
+ + + + +
+ + +
+ + {!Object.} + getUserData() + +
+
+ Returns the data set for the person that is editing the document. + + +
+ + + + + + + + +
+
Returns:
+ +
{!Object.}
+ +
+ + + + +
+ + +
+ + {!boolean} + isDocumentModified() + +
+
+ Returns if the current state of the document matches the unmodified state. + + +
+ + + + + + + + +
+
Returns:
+ +
{!boolean}
+ +
+ + + + +
+ + +
+ + {undefined} + openDocumentFromUrl(docUrl, callback) + +
+
+ Loads an ODT document into the editor. + + +
+ + + + +
+
Parameters:
+ +
+ {!string} docUrl + +
+
url from which the ODT document can be loaded
+ +
+ {!function(!Error=):undefined} callback + +
+
Called once the document has been opened, passes an error object in case of error
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + +
+ + +
+ + {undefined} + removeEventListener(eventId, callback) + +
+
+ Unregisters a callback for the given event. + + +
+ + + + +
+
Parameters:
+ +
+ {!string} eventId + +
+
+ +
+ {!Function} callback + +
+
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + +
+ + +
+ + {undefined} + setDocumentModified(modified) + +
+
+ Sets the current state of the document to be either the unmodified state +or a modified state. +If @p modified is @true and the current state was already a modified state, +this call has no effect and also does not remove the unmodified flag +from the state which has it set. + + +
+ + + + +
+
Parameters:
+ +
+ {!boolean} modified + +
+
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + +
+ + +
+ + {undefined} + setMetadata(setProperties, removedProperties) + +
+
+ Sets the metadata fields from the given properties map. +Avoid setting certain fields since they are automatically set: + dc:creator + dc:date + meta:editing-cycles + +The following properties are never used and will be removed for semantic +consistency from the document: + meta:editing-duration + meta:document-statistic + +Setting any of the above mentioned fields using this method will have no effect. + + +
+ + + + +
+
Parameters:
+ +
+ {?Object.} setProperties + +
+
A flat object that is a string->string map of field name -> value.
+ +
+ {?Array.} removedProperties + +
+
An array of metadata field names (prefixed).
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + +
+ + +
+ + {undefined} + setUserData(data) + +
+
+ Sets the data for the person that is editing the document. +The supported fields are: + "fullName": the full name of the editing person + "color": color to use for the user specific UI elements + + +
+ + + + +
+
Parameters:
+ +
+ {?Object.|undefined} data + +
+
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + + + + + + + + +
+
+ + + +
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST) +
+ + diff --git a/api/js/webodf/wodotexteditor/docs/symbols/Wodo.html b/api/js/webodf/wodotexteditor/docs/symbols/Wodo.html new file mode 100644 index 0000000000..78d5192113 --- /dev/null +++ b/api/js/webodf/wodotexteditor/docs/symbols/Wodo.html @@ -0,0 +1,687 @@ + + + + + + + JsDoc Reference - Wodo + + + + + + + + + + + +
+ + +
+

Classes

+ +
+ +
+ +
+ +

+ + Namespace Wodo +

+ + +

+ + + + + + +
Defined in: wodotexteditor.js. + +

+ + + + + + + + + + + + + + + + + +
Namespace Summary
Constructor AttributesConstructor Name and Description
  +
+ Wodo +
+
Namespace of the Wodo.TextEditor
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Field Summary
Field AttributesField Name and Description
  + +
Id of event if documentModified state changes
+
  + +
Id of event if metadata changes
+
  + +
Id of event for an unkown error
+
  + +
Id of full editing modus
+
  + +
Id of review modus
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
Method AttributesMethod Name and Description
  +
createTextEditor(editorContainerElementId, editorOptions, onEditorCreated) +
+
Creates a text editor object and returns it on success in the passed callback.
+
+ + + + + + + + + +
+
+ Namespace Detail +
+ +
+ Wodo +
+ +
+ Namespace of the Wodo.TextEditor + +
+ + + + + + + + + + + + +
+ + + + +
+ Field Detail +
+ + +
+ + + EVENT_DOCUMENTMODIFIEDCHANGED + +
+
+ Id of event if documentModified state changes + + +
+ + + + + + + + +
+ + +
+ + + EVENT_METADATACHANGED + +
+
+ Id of event if metadata changes + + +
+ + + + + + + + +
+ + +
+ + + EVENT_UNKNOWNERROR + +
+
+ Id of event for an unkown error + + +
+ + + + + + + + +
+ + +
+ + + MODUS_FULLEDITING + +
+
+ Id of full editing modus + + +
+ + + + + + + + +
+ + +
+ + + MODUS_REVIEW + +
+
+ Id of review modus + + +
+ + + + + + + + + + + + + + +
+ Method Detail +
+ + +
+ + {undefined} + createTextEditor(editorContainerElementId, editorOptions, onEditorCreated) + +
+
+ Creates a text editor object and returns it on success in the passed callback. + + +
+ + + + +
+
Parameters:
+ +
+ {!string} editorContainerElementId + +
+
id of the existing div element which will contain the editor (should be empty before)
+ +
+ editorOptions + +
+
options to configure the features of the editor. All entries are optional
+ +
+ editorOptions.modus + Optional, Default: Wodo.MODUS_FULLEDITING +
+
set the editing modus. Current options: Wodo.MODUS_FULLEDITING, Wodo.MODUS_REVIEW
+ +
+ editorOptions.loadCallback + Optional +
+
parameter-less callback method, adds a "Load" button to the toolbar which triggers this method
+ +
+ editorOptions.saveCallback + Optional +
+
parameter-less callback method, adds a "Save" button to the toolbar which triggers this method
+ +
+ editorOptions.saveAsCallback + Optional +
+
parameter-less callback method, adds a "Save as" button to the toolbar which triggers this method
+ +
+ editorOptions.downloadCallback + Optional +
+
parameter-less callback method, adds a "Download" button to the right of the toolbar which triggers this method
+ +
+ editorOptions.closeCallback + Optional +
+
parameter-less callback method, adds a "Save" button to the toolbar which triggers this method
+ +
+ editorOptions.allFeaturesEnabled + Optional, Default: false +
+
if set to 'true', switches the default for all features from 'false' to 'true'
+ +
+ editorOptions.directTextStylingEnabled + Optional, Default: false +
+
if set to 'true', enables the direct styling of text (e.g. bold/italic or font)
+ +
+ editorOptions.directParagraphStylingEnabled + Optional, Default: false +
+
if set to 'true', enables the direct styling of paragraphs (e.g. indentation or alignement)
+ +
+ editorOptions.paragraphStyleSelectingEnabled + Optional, Default: false +
+
if set to 'true', enables setting of defined paragraph styles to paragraphs
+ +
+ editorOptions.paragraphStyleEditingEnabled + Optional, Default: false +
+
if set to 'true', enables the editing of defined paragraph styles
+ +
+ editorOptions.imageEditingEnabled + Optional, Default: false +
+
if set to 'true', enables the insertion of images
+ +
+ editorOptions.hyperlinkEditingEnabled + Optional, Default: false +
+
if set to 'true', enables the editing of hyperlinks
+ +
+ editorOptions.annotationsEnabled + Optional, Default: false +
+
if set to 'true', enables the display and the editing of annotations
+ +
+ editorOptions.undoRedoEnabled + Optional, Default: false +
+
if set to 'true', enables the Undo and Redo of editing actions
+ +
+ editorOptions.zoomingEnabled + Optional, Default: false +
+
if set to 'true', enables the zooming tool
+ +
+ editorOptions.userData + Optional +
+
data about the user editing the document
+ +
+ editorOptions.userData.fullName + Optional +
+
full name of the user, used for annotations and in the metadata of the document
+ +
+ editorOptions.userData.color + Optional, Default: "black" +
+
color to use for any user related indicators like cursor or annotations
+ +
+ {!function(err:?Error|editor:!TextEditor=):undefined} onEditorCreated + +
+
+ +
+ + + + + +
+
Returns:
+ +
{undefined}
+ +
+ + + + + + + + + + + +
+
+ + + +
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST) +
+ + diff --git a/api/js/webodf/wodotexteditor/docs/symbols/_global_.html b/api/js/webodf/wodotexteditor/docs/symbols/_global_.html new file mode 100644 index 0000000000..7ad3ab9423 --- /dev/null +++ b/api/js/webodf/wodotexteditor/docs/symbols/_global_.html @@ -0,0 +1,253 @@ + + + + + + + JsDoc Reference - _global_ + + + + + + + + + + + +
+ + +
+

Classes

+ +
+ +
+ +
+ +

+ + Built-In Namespace _global_ +

+ + +

+ + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Fri Jul 15 2016 10:59:40 GMT+0200 (CEST) +
+ + diff --git a/api/js/webodf/wodotexteditor/docs/symbols/src/wodotexteditor.js.html b/api/js/webodf/wodotexteditor/docs/symbols/src/wodotexteditor.js.html new file mode 100644 index 0000000000..0a6010b72d --- /dev/null +++ b/api/js/webodf/wodotexteditor/docs/symbols/src/wodotexteditor.js.html @@ -0,0 +1,865 @@ +
  1 /**
+  2  * Copyright (C) 2014 KO GmbH <copyright@kogmbh.com>
+  3  *
+  4  * @licstart
+  5  * This file is part of WebODF.
+  6  *
+  7  * WebODF is free software: you can redistribute it and/or modify it
+  8  * under the terms of the GNU Affero General Public License (GNU AGPL)
+  9  * as published by the Free Software Foundation, either version 3 of
+ 10  * the License, or (at your option) any later version.
+ 11  *
+ 12  * WebODF is distributed in the hope that it will be useful, but
+ 13  * WITHOUT ANY WARRANTY; without even the implied warranty of
+ 14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ 15  * GNU Affero General Public License for more details.
+ 16  *
+ 17  * You should have received a copy of the GNU Affero General Public License
+ 18  * along with WebODF.  If not, see <http://www.gnu.org/licenses/>.
+ 19  * @licend
+ 20  *
+ 21  * @source: http://www.webodf.org/
+ 22  * @source: https://github.com/kogmbh/WebODF/
+ 23  */
+ 24 
+ 25 /*global window, document, alert, navigator, require, dojo, runtime, core, gui, ops, odf, WodoFromSource*/
+ 26 
+ 27 /**
+ 28  * Namespace of the Wodo.TextEditor
+ 29  * @namespace
+ 30  * @name Wodo
+ 31  */
+ 32 window.Wodo = window.Wodo || (function () {
+ 33     "use strict";
+ 34 
+ 35     function getInstallationPath() {
+ 36         /**
+ 37          * Sees to get the url of this script on top of the stack trace.
+ 38          * @param {!string|undefined} stack
+ 39          * @return {!string|undefined}
+ 40          */
+ 41         function getScriptUrlFromStack(stack) {
+ 42             var url, matches;
+ 43 
+ 44             if (typeof stack === "string" && stack) {
+ 45                 /*jslint regexp: true*/
+ 46                 matches = stack.match(/((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/);
+ 47                 /*jslint regexp: false*/
+ 48                 url = matches && matches[1];
+ 49             }
+ 50             if (typeof url === "string" && url) {
+ 51                 return url;
+ 52             }
+ 53             return undefined;
+ 54         }
+ 55 
+ 56         /**
+ 57          * Tries by various tricks to get the url of this script.
+ 58          * To be called if document.currentScript is not supported
+ 59          * @return {!string|undefined}
+ 60          */
+ 61         function getCurrentScriptElementSrcByTricks() {
+ 62             var scriptElements = document.getElementsByTagName("script");
+ 63 
+ 64             // if there is only one script, it must be this
+ 65             if (scriptElements.length === 1) {
+ 66                 return scriptElements[0].src;
+ 67             }
+ 68 
+ 69             // otherwise get it from the stacktrace
+ 70             try {
+ 71                 throw new Error();
+ 72             } catch (err) {
+ 73                 return getScriptUrlFromStack(err.stack);
+ 74             }
+ 75         }
+ 76 
+ 77         var path = ".", scriptElementSrc,
+ 78             a, pathname, pos;
+ 79 
+ 80         if (document.currentScript && document.currentScript.src) {
+ 81             scriptElementSrc = document.currentScript.src;
+ 82         } else {
+ 83             scriptElementSrc = getCurrentScriptElementSrcByTricks();
+ 84         }
+ 85 
+ 86         if (scriptElementSrc) {
+ 87             a = document.createElement('a');
+ 88             a.href = scriptElementSrc;
+ 89             pathname = a.pathname;
+ 90             if (pathname.charAt(0) !== "/") {
+ 91                 // Various versions of Internet Explorer seems to neglect the leading slash under some conditions
+ 92                 // (not when watching it with the dev tools of course!). This was confirmed in IE10 + IE11
+ 93                 pathname = "/" + pathname;
+ 94             }
+ 95 
+ 96             pos = pathname.lastIndexOf("/");
+ 97             if (pos !== -1) {
+ 98                 path = pathname.substr(0, pos);
+ 99             }
+100         } else {
+101             alert("Could not estimate installation path of the Wodo.TextEditor.");
+102         }
+103         return path;
+104     }
+105 
+106     var /** @inner @const
+107             @type{!string} */
+108         installationPath = getInstallationPath(),
+109         /** @inner @type{!boolean} */
+110         isInitalized = false,
+111         /** @inner @type{!Array.<!function():undefined>} */
+112         pendingInstanceCreationCalls = [],
+113         /** @inner @type{!number} */
+114         instanceCounter = 0,
+115         // TODO: avatar image url needs base-url setting.
+116         // so far Wodo itself does not have a setup call,
+117         // but then the avatar is also not used yet here
+118         defaultUserData = {
+119             fullName: "",
+120             color:    "black",
+121             imageUrl: "avatar-joe.png"
+122         },
+123         /** @inner @const
+124             @type{!Array.<!string>} */
+125         userDataFieldNames = ["fullName", "color", "imageUrl"],
+126         /** @inner @const
+127             @type{!string} */
+128         memberId = "localuser",
+129         // constructors
+130         BorderContainer, ContentPane, FullWindowZoomHelper, EditorSession, Tools,
+131         /** @inner @const
+132             @type{!string} */
+133         MODUS_FULLEDITING = "fullediting",
+134         /** @inner @const
+135             @type{!string} */
+136         MODUS_REVIEW = "review",
+137         /** @inner @const
+138             @type{!string} */
+139         EVENT_UNKNOWNERROR = "unknownError",
+140         /** @inner @const
+141             @type {!string} */
+142         EVENT_DOCUMENTMODIFIEDCHANGED = "documentModifiedChanged",
+143         /** @inner @const
+144             @type {!string} */
+145         EVENT_METADATACHANGED = "metadataChanged";
+146 
+147     window.dojoConfig = (function () {
+148         var WebODFEditorDojoLocale = "C";
+149 
+150         if (navigator && navigator.language && navigator.language.match(/^(de)/)) {
+151             WebODFEditorDojoLocale = navigator.language.substr(0, 2);
+152         }
+153 
+154         return {
+155             locale: WebODFEditorDojoLocale,
+156             paths: {
+157                 "webodf/editor": installationPath,
+158                 "dijit":         installationPath + "/dijit",
+159                 "dojox":         installationPath + "/dojox",
+160                 "dojo":          installationPath + "/dojo",
+161                 "resources":     installationPath + "/resources"
+162             }
+163         };
+164     }());
+165 
+166     /**
+167      * @return {undefined}
+168      */
+169     function initTextEditor() {
+170         require([
+171             "dijit/layout/BorderContainer",
+172             "dijit/layout/ContentPane",
+173             "webodf/editor/FullWindowZoomHelper",
+174             "webodf/editor/EditorSession",
+175             "webodf/editor/Tools",
+176             "webodf/editor/Translator"],
+177             function (BC, CP, FWZH, ES, T, Translator) {
+178                 var locale = navigator.language || "en-US",
+179                     editorBase = dojo.config && dojo.config.paths && dojo.config.paths["webodf/editor"],
+180                     translationsDir = editorBase + '/translations',
+181                     t;
+182 
+183                 BorderContainer = BC;
+184                 ContentPane = CP;
+185                 FullWindowZoomHelper = FWZH;
+186                 EditorSession = ES;
+187                 Tools = T;
+188 
+189                 // TODO: locale cannot be set by the user, also different for different editors
+190                 t = new Translator(translationsDir, locale, function (editorTranslator) {
+191                     runtime.setTranslator(editorTranslator.translate);
+192                     // Extend runtime with a convenient translation function
+193                     runtime.translateContent = function (node) {
+194                         var i,
+195                             element,
+196                             tag,
+197                             placeholder,
+198                             translatable = node.querySelectorAll("*[text-i18n]");
+199 
+200                         for (i = 0; i < translatable.length; i += 1) {
+201                             element = translatable[i];
+202                             tag = element.localName;
+203                             placeholder = element.getAttribute('text-i18n');
+204                             if (tag === "label"
+205                                     || tag === "span"
+206                                     || /h\d/i.test(tag)) {
+207                                 element.textContent = runtime.tr(placeholder);
+208                             }
+209                         }
+210                     };
+211 
+212                     defaultUserData.fullName = runtime.tr("Unknown Author");
+213 
+214                     isInitalized = true;
+215                     pendingInstanceCreationCalls.forEach(function (create) { create(); });
+216                 });
+217 
+218                 // only done to make jslint see the var used
+219                 return t;
+220             }
+221         );
+222     }
+223 
+224     /**
+225      * Creates a new record with userdata, and for all official fields
+226      * copies over the value from the original or, if not present there,
+227      * sets it to the default value.
+228      * @param {?Object.<!string,!string>|undefined} original, defaults to {}
+229      * @return {!Object.<!string,!string>}
+230      */
+231     function cloneUserData(original) {
+232         var result = {};
+233 
+234         if (!original) {
+235             original = {};
+236         }
+237 
+238         userDataFieldNames.forEach(function (fieldName) {
+239             result[fieldName] = original[fieldName] || defaultUserData[fieldName];
+240         });
+241 
+242         return result;
+243     }
+244 
+245     /**
+246      * @name TextEditor
+247      * @constructor
+248      * @param {!string} mainContainerElementId
+249      * @param {!Object.<!string,!*>} editorOptions
+250      */
+251     function TextEditor(mainContainerElementId, editorOptions) {
+252         instanceCounter = instanceCounter + 1;
+253 
+254         /**
+255         * Returns true if either all features are wanted and this one is not explicitely disabled
+256         * or if not all features are wanted by default and it is explicitely enabled
+257         * @param {?boolean|undefined} isFeatureEnabled explicit flag which enables a feature
+258         * @return {!boolean}
+259         */
+260         function isEnabled(isFeatureEnabled) {
+261             return editorOptions.allFeaturesEnabled ? (isFeatureEnabled !== false) : isFeatureEnabled;
+262         }
+263 
+264         var userData,
+265             //
+266             mainContainerElement = document.getElementById(mainContainerElementId),
+267             canvasElement,
+268             canvasContainerElement,
+269             toolbarElement,
+270             toolbarContainerElement, // needed because dijit toolbar overwrites direct classList
+271             editorElement,
+272             /** @inner @const
+273                 @type{!string} */
+274             canvasElementId = "webodfeditor-canvas" + instanceCounter,
+275             /** @inner @const
+276                 @type{!string} */
+277             canvasContainerElementId = "webodfeditor-canvascontainer" + instanceCounter,
+278             /** @inner @const
+279                 @type{!string} */
+280             toolbarElementId = "webodfeditor-toolbar" + instanceCounter,
+281             /** @inner @const
+282                 @type{!string} */
+283             editorElementId = "webodfeditor-editor" + instanceCounter,
+284             //
+285             fullWindowZoomHelper,
+286             //
+287             mainContainer,
+288             tools,
+289             odfCanvas,
+290             //
+291             editorSession,
+292             session,
+293             //
+294             loadOdtFile = editorOptions.loadCallback,
+295             saveOdtFile = editorOptions.saveCallback,
+296             saveAsOdtFile = editorOptions.saveAsCallback,
+297             downloadOdtFile = editorOptions.downloadCallback,
+298             close =       editorOptions.closeCallback,
+299             //
+300             reviewModeEnabled = (editorOptions.modus === MODUS_REVIEW),
+301             directTextStylingEnabled = isEnabled(editorOptions.directTextStylingEnabled),
+302             directParagraphStylingEnabled = isEnabled(editorOptions.directParagraphStylingEnabled),
+303             paragraphStyleSelectingEnabled = (!reviewModeEnabled) && isEnabled(editorOptions.paragraphStyleSelectingEnabled),
+304             paragraphStyleEditingEnabled =   (!reviewModeEnabled) && isEnabled(editorOptions.paragraphStyleEditingEnabled),
+305             imageEditingEnabled =            (!reviewModeEnabled) && isEnabled(editorOptions.imageEditingEnabled),
+306             hyperlinkEditingEnabled = isEnabled(editorOptions.hyperlinkEditingEnabled),
+307             annotationsEnabled = reviewModeEnabled || isEnabled(editorOptions.annotationsEnabled),
+308             undoRedoEnabled = isEnabled(editorOptions.undoRedoEnabled),
+309             zoomingEnabled = isEnabled(editorOptions.zoomingEnabled),
+310             //
+311             pendingMemberId,
+312             pendingEditorReadyCallback,
+313             //
+314             eventNotifier = new core.EventNotifier([
+315                 EVENT_UNKNOWNERROR,
+316                 EVENT_DOCUMENTMODIFIEDCHANGED,
+317                 EVENT_METADATACHANGED
+318             ]);
+319 
+320         runtime.assert(Boolean(mainContainerElement), "No id of an existing element passed to Wodo.createTextEditor(): " + mainContainerElementId);
+321 
+322         /**
+323          * @param {!Object} changes
+324          * @return {undefined}
+325          */
+326         function relayMetadataSignal(changes) {
+327             eventNotifier.emit(EVENT_METADATACHANGED, changes);
+328         }
+329 
+330         /**
+331          * @param {!Object} changes
+332          * @return {undefined}
+333          */
+334         function relayModifiedSignal(modified) {
+335             eventNotifier.emit(EVENT_DOCUMENTMODIFIEDCHANGED, modified);
+336         }
+337 
+338         /**
+339          * @return {undefined}
+340          */
+341         function createSession() {
+342             var viewOptions = {
+343                     editInfoMarkersInitiallyVisible: false,
+344                     caretAvatarsInitiallyVisible: false,
+345                     caretBlinksOnRangeSelect: true
+346                 };
+347 
+348             // create session around loaded document
+349             session = new ops.Session(odfCanvas);
+350             editorSession = new EditorSession(session, pendingMemberId, {
+351                 viewOptions: viewOptions,
+352                 directTextStylingEnabled: directTextStylingEnabled,
+353                 directParagraphStylingEnabled: directParagraphStylingEnabled,
+354                 paragraphStyleSelectingEnabled: paragraphStyleSelectingEnabled,
+355                 paragraphStyleEditingEnabled: paragraphStyleEditingEnabled,
+356                 imageEditingEnabled: imageEditingEnabled,
+357                 hyperlinkEditingEnabled: hyperlinkEditingEnabled,
+358                 annotationsEnabled: annotationsEnabled,
+359                 zoomingEnabled: zoomingEnabled,
+360                 reviewModeEnabled: reviewModeEnabled
+361             });
+362             if (undoRedoEnabled) {
+363                 editorSession.sessionController.setUndoManager(new gui.TrivialUndoManager());
+364                 editorSession.sessionController.getUndoManager().subscribe(gui.UndoManager.signalDocumentModifiedChanged, relayModifiedSignal);
+365             }
+366 
+367             // Relay any metadata changes to the Editor's consumer as an event
+368             editorSession.sessionController.getMetadataController().subscribe(gui.MetadataController.signalMetadataChanged, relayMetadataSignal);
+369 
+370             // and report back to caller
+371             pendingEditorReadyCallback();
+372             // reset
+373             pendingEditorReadyCallback = null;
+374             pendingMemberId = null;
+375         }
+376 
+377         /**
+378          * @return {undefined}
+379          */
+380         function startEditing() {
+381             runtime.assert(editorSession, "editorSession should exist here.");
+382 
+383             tools.setEditorSession(editorSession);
+384             editorSession.sessionController.insertLocalCursor();
+385             editorSession.sessionController.startEditing();
+386         }
+387 
+388         /**
+389          * @return {undefined}
+390          */
+391         function endEditing() {
+392             runtime.assert(editorSession, "editorSession should exist here.");
+393 
+394             tools.setEditorSession(undefined);
+395             editorSession.sessionController.endEditing();
+396             editorSession.sessionController.removeLocalCursor();
+397         }
+398 
+399         /**
+400          * Loads an ODT document into the editor.
+401          * @name TextEditor#openDocumentFromUrl
+402          * @function
+403          * @param {!string} docUrl url from which the ODT document can be loaded
+404          * @param {!function(!Error=):undefined} callback Called once the document has been opened, passes an error object in case of error
+405          * @return {undefined}
+406          */
+407         this.openDocumentFromUrl = function (docUrl, editorReadyCallback) {
+408             runtime.assert(docUrl, "document should be defined here.");
+409             runtime.assert(!pendingEditorReadyCallback, "pendingEditorReadyCallback should not exist here.");
+410             runtime.assert(!editorSession, "editorSession should not exist here.");
+411             runtime.assert(!session, "session should not exist here.");
+412 
+413             pendingMemberId = memberId;
+414             pendingEditorReadyCallback = function () {
+415                 var op = new ops.OpAddMember();
+416                 op.init({
+417                     memberid: memberId,
+418                     setProperties: userData
+419                 });
+420                 session.enqueue([op]);
+421                 startEditing();
+422                 if (editorReadyCallback) {
+423                     editorReadyCallback();
+424                 }
+425             };
+426 
+427             odfCanvas.load(docUrl);
+428         };
+429 
+430         /**
+431          * Closes the document, and does cleanup.
+432          * @name TextEditor#closeDocument
+433          * @function
+434          * @param {!function(!Error=):undefined} callback  Called once the document has been closed, passes an error object in case of error
+435          * @return {undefined}
+436          */
+437         this.closeDocument = function (callback) {
+438             runtime.assert(session, "session should exist here.");
+439 
+440             endEditing();
+441 
+442             var op = new ops.OpRemoveMember();
+443             op.init({
+444                 memberid: memberId
+445             });
+446             session.enqueue([op]);
+447 
+448             session.close(function (err) {
+449                 if (err) {
+450                     callback(err);
+451                 } else {
+452                     editorSession.sessionController.getMetadataController().unsubscribe(gui.MetadataController.signalMetadataChanged, relayMetadataSignal);
+453                     editorSession.destroy(function (err) {
+454                         if (err) {
+455                             callback(err);
+456                         } else {
+457                             editorSession = undefined;
+458                             session.destroy(function (err) {
+459                                 if (err) {
+460                                     callback(err);
+461                                 } else {
+462                                     session = undefined;
+463                                     callback();
+464                                 }
+465                             });
+466                         }
+467                     });
+468                 }
+469             });
+470         };
+471 
+472         /**
+473          * @name TextEditor#getDocumentAsByteArray
+474          * @function
+475          * @param {!function(err:?Error, file:!Uint8Array=):undefined} callback Called with the current document as ODT file as bytearray, passes an error object in case of error
+476          * @return {undefined}
+477          */
+478         this.getDocumentAsByteArray = function (callback) {
+479             var odfContainer = odfCanvas.odfContainer();
+480 
+481             if (odfContainer) {
+482                 odfContainer.createByteArray(function (ba) {
+483                     callback(null, ba);
+484                 }, function (errorString) {
+485                     callback(new Error(errorString || "Could not create bytearray from OdfContainer."));
+486                 });
+487             } else {
+488                 callback(new Error("No odfContainer set!"));
+489             }
+490         };
+491 
+492         /**
+493          * Sets the metadata fields from the given properties map.
+494          * Avoid setting certain fields since they are automatically set:
+495          *    dc:creator
+496          *    dc:date
+497          *    meta:editing-cycles
+498          *
+499          * The following properties are never used and will be removed for semantic
+500          * consistency from the document:
+501          *     meta:editing-duration
+502          *     meta:document-statistic
+503          *
+504          * Setting any of the above mentioned fields using this method will have no effect.
+505          *
+506          * @name TextEditor#setMetadata
+507          * @function
+508          * @param {?Object.<!string, !string>} setProperties A flat object that is a string->string map of field name -> value.
+509          * @param {?Array.<!string>} removedProperties An array of metadata field names (prefixed).
+510          * @return {undefined}
+511          */
+512         this.setMetadata = function (setProperties, removedProperties) {
+513             runtime.assert(editorSession, "editorSession should exist here.");
+514 
+515             editorSession.sessionController.getMetadataController().setMetadata(setProperties, removedProperties);
+516         };
+517 
+518         /**
+519          * Returns the value of the requested document metadata field.
+520          * @name TextEditor#getMetadata
+521          * @function
+522          * @param {!string} property A namespace-prefixed field name, for example
+523          * dc:creator
+524          * @return {?string}
+525          */
+526         this.getMetadata = function (property) {
+527             runtime.assert(editorSession, "editorSession should exist here.");
+528 
+529             return editorSession.sessionController.getMetadataController().getMetadata(property);
+530         };
+531 
+532         /**
+533          * Sets the data for the person that is editing the document.
+534          * The supported fields are:
+535          *     "fullName": the full name of the editing person
+536          *     "color": color to use for the user specific UI elements
+537          * @name TextEditor#setUserData
+538          * @function
+539          * @param {?Object.<!string,!string>|undefined} data
+540          * @return {undefined}
+541          */
+542         function setUserData(data) {
+543             userData = cloneUserData(data);
+544         }
+545         this.setUserData = setUserData;
+546 
+547         /**
+548          * Returns the data set for the person that is editing the document.
+549          * @name TextEditor#getUserData
+550          * @function
+551          * @return {!Object.<!string,!string>}
+552          */
+553         this.getUserData = function () {
+554             return cloneUserData(userData);
+555         };
+556 
+557         /**
+558          * Sets the current state of the document to be either the unmodified state
+559          * or a modified state.
+560          * If @p modified is @true and the current state was already a modified state,
+561          * this call has no effect and also does not remove the unmodified flag
+562          * from the state which has it set.
+563          *
+564          * @name TextEditor#setDocumentModified
+565          * @function
+566          * @param {!boolean} modified
+567          * @return {undefined}
+568          */
+569         this.setDocumentModified = function (modified) {
+570             runtime.assert(editorSession, "editorSession should exist here.");
+571 
+572             if (undoRedoEnabled) {
+573                 editorSession.sessionController.getUndoManager().setDocumentModified(modified);
+574             }
+575         };
+576 
+577         /**
+578          * Returns if the current state of the document matches the unmodified state.
+579          * @name TextEditor#isDocumentModified
+580          * @function
+581          * @return {!boolean}
+582          */
+583         this.isDocumentModified = function () {
+584             runtime.assert(editorSession, "editorSession should exist here.");
+585 
+586             if (undoRedoEnabled) {
+587                 return editorSession.sessionController.getUndoManager().isDocumentModified();
+588             }
+589 
+590             return false;
+591         };
+592 
+593         /**
+594          * @return {undefined}
+595          */
+596         function setFocusToOdfCanvas() {
+597             editorSession.sessionController.getEventManager().focus();
+598         }
+599 
+600         /**
+601          * @param {!function(!Error=):undefined} callback passes an error object in case of error
+602          * @return {undefined}
+603          */
+604         function destroyInternal(callback) {
+605             mainContainerElement.removeChild(editorElement);
+606 
+607             callback();
+608         }
+609 
+610         /**
+611          * Destructs the editor object completely.
+612          * @name TextEditor#destroy
+613          * @function
+614          * @param {!function(!Error=):undefined} callback Called once the destruction has been completed, passes an error object in case of error
+615          * @return {undefined}
+616          */
+617         this.destroy = function (callback) {
+618             var destroyCallbacks = [];
+619 
+620             // TODO: decide if some forced close should be done here instead of enforcing proper API usage
+621             runtime.assert(!session, "session should not exist here.");
+622 
+623             // TODO: investigate what else needs to be done
+624             mainContainer.destroyRecursive(true);
+625 
+626             destroyCallbacks = destroyCallbacks.concat([
+627                 fullWindowZoomHelper.destroy,
+628                 tools.destroy,
+629                 odfCanvas.destroy,
+630                 destroyInternal
+631             ]);
+632 
+633             core.Async.destroyAll(destroyCallbacks, callback);
+634         };
+635 
+636         // TODO:
+637         // this.openDocumentFromByteArray = openDocumentFromByteArray; see also https://github.com/kogmbh/WebODF/issues/375
+638         // setReadOnly: setReadOnly,
+639 
+640         /**
+641          * Registers a callback which should be called if the given event happens.
+642          * @name TextEditor#addEventListener
+643          * @function
+644          * @param {!string} eventId
+645          * @param {!Function} callback
+646          * @return {undefined}
+647          */
+648         this.addEventListener = eventNotifier.subscribe;
+649         /**
+650          * Unregisters a callback for the given event.
+651          * @name TextEditor#removeEventListener
+652          * @function
+653          * @param {!string} eventId
+654          * @param {!Function} callback
+655          * @return {undefined}
+656          */
+657         this.removeEventListener = eventNotifier.unsubscribe;
+658 
+659 
+660         /**
+661          * @return {undefined}
+662          */
+663         function init() {
+664             var editorPane,
+665                 /** @inner @const
+666                     @type{!string} */
+667                 documentns = document.documentElement.namespaceURI;
+668 
+669             /**
+670              * @param {!string} tagLocalName
+671              * @param {!string|undefined} id
+672              * @param {!string} className
+673              * @return {!Element}
+674              */
+675             function createElement(tagLocalName, id, className) {
+676                 var element;
+677                 element = document.createElementNS(documentns, tagLocalName);
+678                 if (id) {
+679                     element.id = id;
+680                 }
+681                 element.classList.add(className);
+682                 return element;
+683             }
+684 
+685             // create needed tree structure
+686             canvasElement = createElement('div', canvasElementId, "webodfeditor-canvas");
+687             canvasContainerElement = createElement('div', canvasContainerElementId, "webodfeditor-canvascontainer");
+688             toolbarElement = createElement('span', toolbarElementId, "webodfeditor-toolbar");
+689             toolbarContainerElement = createElement('span', undefined, "webodfeditor-toolbarcontainer");
+690             editorElement = createElement('div', editorElementId, "webodfeditor-editor");
+691 
+692             // put into tree
+693             canvasContainerElement.appendChild(canvasElement);
+694             toolbarContainerElement.appendChild(toolbarElement);
+695             editorElement.appendChild(toolbarContainerElement);
+696             editorElement.appendChild(canvasContainerElement);
+697             mainContainerElement.appendChild(editorElement);
+698 
+699             // style all elements with Dojo's claro.
+700             // Not nice to do this on body, but then there is no other way known
+701             // to style also all dialogs, which are attached directly to body
+702             document.body.classList.add("claro");
+703 
+704             // prevent browser translation service messing up internal address system
+705             // TODO: this should be done more centrally, but where exactly?
+706             canvasElement.setAttribute("translate", "no");
+707             canvasElement.classList.add("notranslate");
+708 
+709             // create widgets
+710             mainContainer = new BorderContainer({}, mainContainerElementId);
+711 
+712             editorPane = new ContentPane({
+713                 region: 'center'
+714             }, editorElementId);
+715             mainContainer.addChild(editorPane);
+716 
+717             mainContainer.startup();
+718 
+719             tools = new Tools(toolbarElementId, {
+720                 onToolDone: setFocusToOdfCanvas,
+721                 loadOdtFile: loadOdtFile,
+722                 saveOdtFile: saveOdtFile,
+723                 saveAsOdtFile: saveAsOdtFile,
+724                 downloadOdtFile: downloadOdtFile,
+725                 close: close,
+726                 directTextStylingEnabled: directTextStylingEnabled,
+727                 directParagraphStylingEnabled: directParagraphStylingEnabled,
+728                 paragraphStyleSelectingEnabled: paragraphStyleSelectingEnabled,
+729                 paragraphStyleEditingEnabled: paragraphStyleEditingEnabled,
+730                 imageInsertingEnabled: imageEditingEnabled,
+731                 hyperlinkEditingEnabled: hyperlinkEditingEnabled,
+732                 annotationsEnabled: annotationsEnabled,
+733                 undoRedoEnabled: undoRedoEnabled,
+734                 zoomingEnabled: zoomingEnabled,
+735                 aboutEnabled: true
+736             });
+737 
+738             odfCanvas = new odf.OdfCanvas(canvasElement);
+739             odfCanvas.enableAnnotations(annotationsEnabled, true);
+740 
+741             odfCanvas.addListener("statereadychange", createSession);
+742 
+743             fullWindowZoomHelper = new FullWindowZoomHelper(toolbarContainerElement, canvasContainerElement);
+744 
+745             setUserData(editorOptions.userData);
+746         }
+747 
+748         init();
+749     }
+750 
+751     function loadDojoAndStuff(callback) {
+752         var head = document.getElementsByTagName("head")[0],
+753             frag = document.createDocumentFragment(),
+754             link,
+755             script;
+756 
+757         // append two link and two script elements to the header
+758         link = document.createElement("link");
+759         link.rel = "stylesheet";
+760         link.href = installationPath + "/app/resources/app.css";
+761         link.type = "text/css";
+762         link.async = false;
+763         frag.appendChild(link);
+764         link = document.createElement("link");
+765         link.rel = "stylesheet";
+766         link.href = installationPath + "/wodotexteditor.css";
+767         link.type = "text/css";
+768         link.async = false;
+769         frag.appendChild(link);
+770         script = document.createElement("script");
+771         script.src = installationPath + "/dojo-amalgamation.js";
+772         script["data-dojo-config"] = "async: true";
+773         script.charset = "utf-8";
+774         script.type = "text/javascript";
+775         script.async = false;
+776         frag.appendChild(script);
+777         script = document.createElement("script");
+778         script.src = installationPath + "/webodf.js";
+779         script.charset = "utf-8";
+780         script.type = "text/javascript";
+781         script.async = false;
+782         script.onload = callback;
+783         frag.appendChild(script);
+784         head.appendChild(frag);
+785     }
+786 
+787     /**
+788      * Creates a text editor object and returns it on success in the passed callback.
+789      * @name Wodo#createTextEditor
+790      * @function
+791      * @param {!string} editorContainerElementId id of the existing div element which will contain the editor (should be empty before)
+792      * @param editorOptions options to configure the features of the editor. All entries are optional
+793      * @param [editorOptions.modus=Wodo.MODUS_FULLEDITING] set the editing modus. Current options: Wodo.MODUS_FULLEDITING, Wodo.MODUS_REVIEW
+794      * @param [editorOptions.loadCallback] parameter-less callback method, adds a "Load" button to the toolbar which triggers this method
+795      * @param [editorOptions.saveCallback] parameter-less callback method, adds a "Save" button to the toolbar which triggers this method
+796      * @param [editorOptions.saveAsCallback] parameter-less callback method, adds a "Save as" button to the toolbar which triggers this method
+797      * @param [editorOptions.downloadCallback] parameter-less callback method, adds a "Download" button to the right of the toolbar which triggers this method
+798      * @param [editorOptions.closeCallback] parameter-less callback method, adds a "Save" button to the toolbar which triggers this method
+799      * @param [editorOptions.allFeaturesEnabled=false] if set to 'true', switches the default for all features from 'false' to 'true'
+800      * @param [editorOptions.directTextStylingEnabled=false] if set to 'true', enables the direct styling of text (e.g. bold/italic or font)
+801      * @param [editorOptions.directParagraphStylingEnabled=false] if set to 'true', enables the direct styling of paragraphs (e.g. indentation or alignement)
+802      * @param [editorOptions.paragraphStyleSelectingEnabled=false] if set to 'true', enables setting of defined paragraph styles to paragraphs
+803      * @param [editorOptions.paragraphStyleEditingEnabled=false] if set to 'true', enables the editing of defined paragraph styles
+804      * @param [editorOptions.imageEditingEnabled=false] if set to 'true', enables the insertion of images
+805      * @param [editorOptions.hyperlinkEditingEnabled=false] if set to 'true', enables the editing of hyperlinks
+806      * @param [editorOptions.annotationsEnabled=false] if set to 'true', enables the display and the editing of annotations
+807      * @param [editorOptions.undoRedoEnabled=false] if set to 'true', enables the Undo and Redo of editing actions
+808      * @param [editorOptions.zoomingEnabled=false] if set to 'true', enables the zooming tool
+809      * @param [editorOptions.userData] data about the user editing the document
+810      * @param [editorOptions.userData.fullName] full name of the user, used for annotations and in the metadata of the document
+811      * @param [editorOptions.userData.color="black"] color to use for any user related indicators like cursor or annotations
+812      * @param {!function(err:?Error, editor:!TextEditor=):undefined} onEditorCreated
+813      * @return {undefined}
+814      */
+815     function createTextEditor(editorContainerElementId, editorOptions, onEditorCreated) {
+816         /**
+817          * @return {undefined}
+818          */
+819         function create() {
+820             var editor = new TextEditor(editorContainerElementId, editorOptions);
+821             onEditorCreated(null, editor);
+822         }
+823 
+824         if (!isInitalized) {
+825             pendingInstanceCreationCalls.push(create);
+826             // first request?
+827             if (pendingInstanceCreationCalls.length === 1) {
+828                 if (String(typeof WodoFromSource) === "undefined") {
+829                     loadDojoAndStuff(initTextEditor);
+830                 } else {
+831                     initTextEditor();
+832                 }
+833             }
+834         } else {
+835             create();
+836         }
+837     }
+838 
+839 
+840     /**
+841      * @lends Wodo#
+842      */
+843     return {
+844         createTextEditor: createTextEditor,
+845         // flags
+846         /** Id of full editing modus */
+847         MODUS_FULLEDITING: MODUS_FULLEDITING,
+848         /** Id of review modus */
+849         MODUS_REVIEW: MODUS_REVIEW,
+850         /** Id of event for an unkown error */
+851         EVENT_UNKNOWNERROR: EVENT_UNKNOWNERROR,
+852         /** Id of event if documentModified state changes */
+853         EVENT_DOCUMENTMODIFIEDCHANGED: EVENT_DOCUMENTMODIFIEDCHANGED,
+854         /** Id of event if metadata changes */
+855         EVENT_METADATACHANGED: EVENT_METADATACHANGED
+856     };
+857 }());
+858 
\ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/EditorSession.js b/api/js/webodf/wodotexteditor/wodotexteditor/EditorSession.js new file mode 100644 index 0000000000..f2e91b695e --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/EditorSession.js @@ -0,0 +1,659 @@ +/** + * Copyright (C) 2013 KO GmbH + * + * @licstart + * This file is part of WebODF. + * + * WebODF is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License (GNU AGPL) + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * WebODF 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with WebODF. If not, see . + * @licend + * + * @source: http://www.webodf.org/ + * @source: https://github.com/kogmbh/WebODF/ + */ + +/*global runtime, define, document, core, odf, gui, ops*/ + +define("webodf/editor/EditorSession", [ + "dojo/text!resources/fonts/fonts.css" +], function (fontsCSS) { // fontsCSS is retrieved as a string, using dojo's text retrieval AMD plugin + "use strict"; + + runtime.loadClass("core.Async"); + runtime.loadClass("core.DomUtils"); + runtime.loadClass("odf.OdfUtils"); + runtime.loadClass("ops.OdtDocument"); + runtime.loadClass("ops.OdtStepsTranslator"); + runtime.loadClass("ops.Session"); + runtime.loadClass("odf.Namespaces"); + runtime.loadClass("odf.OdfCanvas"); + runtime.loadClass("odf.OdfUtils"); + runtime.loadClass("gui.CaretManager"); + runtime.loadClass("gui.Caret"); + runtime.loadClass("gui.OdfFieldView"); + runtime.loadClass("gui.SessionController"); + runtime.loadClass("gui.SessionView"); + runtime.loadClass("gui.HyperlinkTooltipView"); + runtime.loadClass("gui.TrivialUndoManager"); + runtime.loadClass("gui.SvgSelectionView"); + runtime.loadClass("gui.SelectionViewManager"); + runtime.loadClass("core.EventNotifier"); + runtime.loadClass("gui.ShadowCursor"); + runtime.loadClass("gui.CommonConstraints"); + + /** + * Instantiate a new editor session attached to an existing operation session + * @constructor + * @implements {core.EventSource} + * @param {!ops.Session} session + * @param {!string} localMemberId + * @param {{viewOptions:gui.SessionViewOptions,directParagraphStylingEnabled:boolean,annotationsEnabled:boolean}} config + */ + var EditorSession = function EditorSession(session, localMemberId, config) { + var self = this, + currentParagraphNode = null, + currentCommonStyleName = null, + currentStyleName = null, + caretManager, + selectionViewManager, + hyperlinkTooltipView, + odtDocument = session.getOdtDocument(), + textns = odf.Namespaces.textns, + fontStyles = document.createElement('style'), + formatting = odtDocument.getFormatting(), + domUtils = core.DomUtils, + odfUtils = odf.OdfUtils, + odfFieldView, + eventNotifier = new core.EventNotifier([ + EditorSession.signalMemberAdded, + EditorSession.signalMemberUpdated, + EditorSession.signalMemberRemoved, + EditorSession.signalCursorAdded, + EditorSession.signalCursorMoved, + EditorSession.signalCursorRemoved, + EditorSession.signalParagraphChanged, + EditorSession.signalCommonStyleCreated, + EditorSession.signalCommonStyleDeleted, + EditorSession.signalParagraphStyleModified, + EditorSession.signalUndoStackChanged]), + shadowCursor = new gui.ShadowCursor(odtDocument), + sessionConstraints, + /**@const*/ + NEXT = core.StepDirection.NEXT; + + /** + * @return {Array.} + */ + function getAvailableFonts() { + var availableFonts, regex, matches; + + availableFonts = {}; + + /*jslint regexp: true*/ + regex = /font-family *: *(?:\'([^']*)\'|\"([^"]*)\")/gm; + /*jslint regexp: false*/ + matches = regex.exec(fontsCSS); + + while (matches) { + availableFonts[matches[1] || matches[2]] = 1; + matches = regex.exec(fontsCSS); + } + availableFonts = Object.keys(availableFonts); + + return availableFonts; + } + + function checkParagraphStyleName() { + var newStyleName, + newCommonStyleName; + + newStyleName = currentParagraphNode.getAttributeNS(textns, 'style-name'); + + if (newStyleName !== currentStyleName) { + currentStyleName = newStyleName; + // check if common style is still the same + newCommonStyleName = formatting.getFirstCommonParentStyleNameOrSelf(newStyleName); + if (!newCommonStyleName) { + // Default style, empty-string name + currentCommonStyleName = newStyleName = currentStyleName = ""; + self.emit(EditorSession.signalParagraphChanged, { + type: 'style', + node: currentParagraphNode, + styleName: currentCommonStyleName + }); + return; + } + // a common style + if (newCommonStyleName !== currentCommonStyleName) { + currentCommonStyleName = newCommonStyleName; + self.emit(EditorSession.signalParagraphChanged, { + type: 'style', + node: currentParagraphNode, + styleName: currentCommonStyleName + }); + } + } + } + /** + * Creates a NCName from the passed string + * @param {!string} name + * @return {!string} + */ + function createNCName(name) { + var letter, + result = "", + i; + + // encode + for (i = 0; i < name.length; i += 1) { + letter = name[i]; + // simple approach, can be improved to not skip other allowed chars + if (letter.match(/[a-zA-Z0-9.-_]/) !== null) { + result += letter; + } else { + result += "_" + letter.charCodeAt(0).toString(16) + "_"; + } + } + // ensure leading char is from proper range + if (result.match(/^[a-zA-Z_]/) === null) { + result = "_" + result; + } + + return result; + } + + function uniqueParagraphStyleNCName(name) { + var result, + i = 0, + ncMemberId = createNCName(localMemberId), + ncName = createNCName(name); + + // create default paragraph style + // localMemberId is used to avoid id conflicts with ids created by other members + result = ncName + "_" + ncMemberId; + // then loop until result is really unique + while (formatting.hasParagraphStyle(result)) { + result = ncName + "_" + i + "_" + ncMemberId; + i += 1; + } + + return result; + } + + function trackCursor(cursor) { + var node; + + node = odfUtils.getParagraphElement(cursor.getNode()); + if (!node) { + return; + } + currentParagraphNode = node; + checkParagraphStyleName(); + } + + function trackCurrentParagraph(info) { + var cursor = odtDocument.getCursor(localMemberId), + range = cursor && cursor.getSelectedRange(), + paragraphRange = odtDocument.getDOMDocument().createRange(); + paragraphRange.selectNode(info.paragraphElement); + if ((range && domUtils.rangesIntersect(range, paragraphRange)) || info.paragraphElement === currentParagraphNode) { + self.emit(EditorSession.signalParagraphChanged, info); + checkParagraphStyleName(); + } + paragraphRange.detach(); + } + + function onMemberAdded(member) { + self.emit(EditorSession.signalMemberAdded, member.getMemberId()); + } + + function onMemberUpdated(member) { + self.emit(EditorSession.signalMemberUpdated, member.getMemberId()); + } + + function onMemberRemoved(memberId) { + self.emit(EditorSession.signalMemberRemoved, memberId); + } + + function onCursorAdded(cursor) { + self.emit(EditorSession.signalCursorAdded, cursor.getMemberId()); + trackCursor(cursor); + } + + function onCursorRemoved(memberId) { + self.emit(EditorSession.signalCursorRemoved, memberId); + } + + function onCursorMoved(cursor) { + // Emit 'cursorMoved' only when *I* am moving the cursor, not the other users + if (cursor.getMemberId() === localMemberId) { + self.emit(EditorSession.signalCursorMoved, cursor); + trackCursor(cursor); + } + } + + function onStyleCreated(newStyleName) { + self.emit(EditorSession.signalCommonStyleCreated, newStyleName); + } + + function onStyleDeleted(styleName) { + self.emit(EditorSession.signalCommonStyleDeleted, styleName); + } + + function onParagraphStyleModified(styleName) { + self.emit(EditorSession.signalParagraphStyleModified, styleName); + } + + /** + * Call all subscribers for the given event with the specified argument + * @param {!string} eventid + * @param {Object} args + */ + this.emit = function (eventid, args) { + eventNotifier.emit(eventid, args); + }; + + /** + * Subscribe to a given event with a callback + * @param {!string} eventid + * @param {!Function} cb + */ + this.subscribe = function (eventid, cb) { + eventNotifier.subscribe(eventid, cb); + }; + + /** + * @param {!string} eventid + * @param {!Function} cb + * @return {undefined} + */ + this.unsubscribe = function (eventid, cb) { + eventNotifier.unsubscribe(eventid, cb); + }; + + this.getCursorPosition = function () { + return odtDocument.getCursorPosition(localMemberId); + }; + + this.getCursorSelection = function () { + return odtDocument.getCursorSelection(localMemberId); + }; + + this.getOdfCanvas = function () { + return odtDocument.getOdfCanvas(); + }; + + this.getCurrentParagraph = function () { + return currentParagraphNode; + }; + + this.getAvailableParagraphStyles = function () { + return formatting.getAvailableParagraphStyles(); + }; + + this.getCurrentParagraphStyle = function () { + return currentCommonStyleName; + }; + + /** + * Applies the paragraph style with the given + * style name to all the paragraphs within + * the cursor selection. + * @param {!string} styleName + * @return {undefined} + */ + this.setCurrentParagraphStyle = function (styleName) { + var range = odtDocument.getCursor(localMemberId).getSelectedRange(), + paragraphs = odfUtils.getParagraphElements(range), + opQueue = []; + + paragraphs.forEach(function (paragraph) { + var paragraphStartPoint = odtDocument.convertDomPointToCursorStep(paragraph, 0, NEXT), + paragraphStyleName = paragraph.getAttributeNS(odf.Namespaces.textns, "style-name"), + opSetParagraphStyle; + + if (paragraphStyleName !== styleName) { + opSetParagraphStyle = new ops.OpSetParagraphStyle(); + opSetParagraphStyle.init({ + memberid: localMemberId, + styleName: styleName, + position: paragraphStartPoint + }); + opQueue.push(opSetParagraphStyle); + } + }); + + if (opQueue.length > 0) { + session.enqueue(opQueue); + } + }; + + this.insertTable = function (initialRows, initialColumns, tableStyleName, tableColumnStyleName, tableCellStyleMatrix) { + var op = new ops.OpInsertTable(); + op.init({ + memberid: localMemberId, + position: self.getCursorPosition(), + initialRows: initialRows, + initialColumns: initialColumns, + tableStyleName: tableStyleName, + tableColumnStyleName: tableColumnStyleName, + tableCellStyleMatrix: tableCellStyleMatrix + }); + session.enqueue([op]); + }; + + /** + * Takes a style name and returns the corresponding paragraph style + * element. If the style name is an empty string, the default style + * is returned. + * @param {!string} styleName + * @return {?Element} + */ + function getParagraphStyleElement(styleName) { + return (styleName === "") + ? formatting.getDefaultStyleElement('paragraph') + : formatting.getStyleElement(styleName, 'paragraph'); + } + + this.getParagraphStyleElement = getParagraphStyleElement; + + /** + * Returns if the style is used anywhere in the document + * @param {!Element} styleElement + * @return {boolean} + */ + this.isStyleUsed = function (styleElement) { + return formatting.isStyleUsed(styleElement); + }; + + /** + * Returns the attributes of a given paragraph style name + * (with inheritance). If the name is an empty string, + * the attributes of the default style are returned. + * @param {!string} styleName + * @return {?odf.Formatting.StyleData} + */ + this.getParagraphStyleAttributes = function (styleName) { + var styleNode = getParagraphStyleElement(styleName), + includeSystemDefault = styleName === ""; + + if (styleNode) { + return formatting.getInheritedStyleAttributes(styleNode, includeSystemDefault); + } + + return null; + }; + + /** + * Creates and enqueues a paragraph-style cloning operation. + * Returns the created id for the new style. + * @param {!string} styleName id of the style to update + * @param {!{paragraphProperties,textProperties}} setProperties properties which are set + * @param {!{paragraphPropertyNames,textPropertyNames}=} removedProperties properties which are removed + * @return {undefined} + */ + this.updateParagraphStyle = function (styleName, setProperties, removedProperties) { + var op; + op = new ops.OpUpdateParagraphStyle(); + op.init({ + memberid: localMemberId, + styleName: styleName, + setProperties: setProperties, + removedProperties: (!removedProperties) ? {} : removedProperties + }); + session.enqueue([op]); + }; + + /** + * Creates and enqueues a paragraph-style cloning operation. + * Returns the created id for the new style. + * @param {!string} styleName id of the style to clone + * @param {!string} newStyleDisplayName display name of the new style + * @return {!string} + */ + this.cloneParagraphStyle = function (styleName, newStyleDisplayName) { + var newStyleName = uniqueParagraphStyleNCName(newStyleDisplayName), + styleNode = getParagraphStyleElement(styleName), + op, setProperties, attributes, i; + + setProperties = formatting.getStyleAttributes(styleNode); + // copy any attributes directly on the style + attributes = styleNode.attributes; + for (i = 0; i < attributes.length; i += 1) { + // skip... + // * style:display-name -> not copied, set to new string below + // * style:name -> not copied, set from op by styleName property + // * style:family -> "paragraph" always, set by op + if (!/^(style:display-name|style:name|style:family)/.test(attributes[i].name)) { + setProperties[attributes[i].name] = attributes[i].value; + } + } + + setProperties['style:display-name'] = newStyleDisplayName; + + op = new ops.OpAddStyle(); + op.init({ + memberid: localMemberId, + styleName: newStyleName, + styleFamily: 'paragraph', + setProperties: setProperties + }); + session.enqueue([op]); + + return newStyleName; + }; + + this.deleteStyle = function (styleName) { + var op; + op = new ops.OpRemoveStyle(); + op.init({ + memberid: localMemberId, + styleName: styleName, + styleFamily: 'paragraph' + }); + session.enqueue([op]); + }; + + /** + * Returns an array of the declared fonts in the ODF document, + * with 'duplicates' like Arial1, Arial2, etc removed. The alphabetically + * first font name for any given family is kept. + * The elements of the array are objects containing the font's name and + * the family. + * @return {Array.} + */ + this.getDeclaredFonts = function () { + var fontMap = formatting.getFontMap(), + usedFamilies = [], + array = [], + sortedNames, + key, + value, + i; + + // Sort all the keys in the font map alphabetically + sortedNames = Object.keys(fontMap); + sortedNames.sort(); + + for (i = 0; i < sortedNames.length; i += 1) { + key = sortedNames[i]; + value = fontMap[key]; + + // Use the font declaration only if the family is not already used. + // Therefore we are able to discard the alphabetic successors of the first + // font name. + if (usedFamilies.indexOf(value) === -1) { + array.push({ + name: key, + family: value + }); + if (value) { + usedFamilies.push(value); + } + } + } + + return array; + }; + + this.getSelectedHyperlinks = function () { + var cursor = odtDocument.getCursor(localMemberId); + // no own cursor yet/currently added? + if (!cursor) { + return []; + } + return odfUtils.getHyperlinkElements(cursor.getSelectedRange()); + }; + + this.getSelectedRange = function () { + var cursor = odtDocument.getCursor(localMemberId); + return cursor && cursor.getSelectedRange(); + }; + + function undoStackModified(e) { + self.emit(EditorSession.signalUndoStackChanged, e); + } + + this.undo = function () { + self.sessionController.undo(); + }; + + this.redo = function () { + self.sessionController.redo(); + }; + + /** + * @param {!string} memberId + * @return {?ops.Member} + */ + this.getMember = function (memberId) { + return odtDocument.getMember(memberId); + }; + + /** + * @param {!function(!Object=)} callback passing an error object in case of error + * @return {undefined} + */ + function destroy(callback) { + var head = document.getElementsByTagName('head')[0], + eventManager = self.sessionController.getEventManager(); + + head.removeChild(fontStyles); + + odtDocument.unsubscribe(ops.Document.signalMemberAdded, onMemberAdded); + odtDocument.unsubscribe(ops.Document.signalMemberUpdated, onMemberUpdated); + odtDocument.unsubscribe(ops.Document.signalMemberRemoved, onMemberRemoved); + odtDocument.unsubscribe(ops.Document.signalCursorAdded, onCursorAdded); + odtDocument.unsubscribe(ops.Document.signalCursorRemoved, onCursorRemoved); + odtDocument.unsubscribe(ops.Document.signalCursorMoved, onCursorMoved); + odtDocument.unsubscribe(ops.OdtDocument.signalCommonStyleCreated, onStyleCreated); + odtDocument.unsubscribe(ops.OdtDocument.signalCommonStyleDeleted, onStyleDeleted); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphStyleModified, onParagraphStyleModified); + odtDocument.unsubscribe(ops.OdtDocument.signalParagraphChanged, trackCurrentParagraph); + odtDocument.unsubscribe(ops.OdtDocument.signalUndoStackChanged, undoStackModified); + + eventManager.unsubscribe("mousemove", hyperlinkTooltipView.showTooltip); + eventManager.unsubscribe("mouseout", hyperlinkTooltipView.hideTooltip); + delete self.sessionView; + delete self.sessionController; + callback(); + } + + /** + * @param {!function(!Error=)} callback passing an error object in case of error + * @return {undefined} + */ + this.destroy = function(callback) { + var cleanup = [ + self.sessionView.destroy, + caretManager.destroy, + selectionViewManager.destroy, + self.sessionController.destroy, + hyperlinkTooltipView.destroy, + odfFieldView.destroy, + destroy + ]; + + core.Async.destroyAll(cleanup, callback); + }; + + function init() { + var head = document.getElementsByTagName('head')[0], + odfCanvas = session.getOdtDocument().getOdfCanvas(), + eventManager; + + // TODO: fonts.css should be rather done by odfCanvas, or? + fontStyles.type = 'text/css'; + fontStyles.media = 'screen, print, handheld, projection'; + fontStyles.appendChild(document.createTextNode(fontsCSS)); + head.appendChild(fontStyles); + + odfFieldView = new gui.OdfFieldView(odfCanvas); + odfFieldView.showFieldHighlight(); + self.sessionController = new gui.SessionController(session, localMemberId, shadowCursor, { + annotationsEnabled: config.annotationsEnabled, + directTextStylingEnabled: config.directTextStylingEnabled, + directParagraphStylingEnabled: config.directParagraphStylingEnabled + }); + sessionConstraints = self.sessionController.getSessionConstraints(); + + eventManager = self.sessionController.getEventManager(); + hyperlinkTooltipView = new gui.HyperlinkTooltipView(odfCanvas, + self.sessionController.getHyperlinkClickHandler().getModifier); + eventManager.subscribe("mousemove", hyperlinkTooltipView.showTooltip); + eventManager.subscribe("mouseout", hyperlinkTooltipView.hideTooltip); + + caretManager = new gui.CaretManager(self.sessionController, odfCanvas.getViewport()); + selectionViewManager = new gui.SelectionViewManager(gui.SvgSelectionView); + self.sessionView = new gui.SessionView(config.viewOptions, localMemberId, session, sessionConstraints, caretManager, selectionViewManager); + self.availableFonts = getAvailableFonts(); + selectionViewManager.registerCursor(shadowCursor, true); + + // Session Constraints can be applied once the controllers are instantiated. + if (config.reviewModeEnabled) { + // Disallow deleting other authors' annotations. + sessionConstraints.setState(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN, true); + sessionConstraints.setState(gui.CommonConstraints.EDIT.REVIEW_MODE, true); + } + + // Custom signals, that make sense in the Editor context. We do not want to expose webodf's ops signals to random bits of the editor UI. + odtDocument.subscribe(ops.Document.signalMemberAdded, onMemberAdded); + odtDocument.subscribe(ops.Document.signalMemberUpdated, onMemberUpdated); + odtDocument.subscribe(ops.Document.signalMemberRemoved, onMemberRemoved); + odtDocument.subscribe(ops.Document.signalCursorAdded, onCursorAdded); + odtDocument.subscribe(ops.Document.signalCursorRemoved, onCursorRemoved); + odtDocument.subscribe(ops.Document.signalCursorMoved, onCursorMoved); + odtDocument.subscribe(ops.OdtDocument.signalCommonStyleCreated, onStyleCreated); + odtDocument.subscribe(ops.OdtDocument.signalCommonStyleDeleted, onStyleDeleted); + odtDocument.subscribe(ops.OdtDocument.signalParagraphStyleModified, onParagraphStyleModified); + odtDocument.subscribe(ops.OdtDocument.signalParagraphChanged, trackCurrentParagraph); + odtDocument.subscribe(ops.OdtDocument.signalUndoStackChanged, undoStackModified); + } + + init(); + }; + + /**@const*/EditorSession.signalMemberAdded = "memberAdded"; + /**@const*/EditorSession.signalMemberUpdated = "memberUpdated"; + /**@const*/EditorSession.signalMemberRemoved = "memberRemoved"; + /**@const*/EditorSession.signalCursorAdded = "cursorAdded"; + /**@const*/EditorSession.signalCursorRemoved = "cursorRemoved"; + /**@const*/EditorSession.signalCursorMoved = "cursorMoved"; + /**@const*/EditorSession.signalParagraphChanged = "paragraphChanged"; + /**@const*/EditorSession.signalCommonStyleCreated = "styleCreated"; + /**@const*/EditorSession.signalCommonStyleDeleted = "styleDeleted"; + /**@const*/EditorSession.signalParagraphStyleModified = "paragraphStyleModified"; + /**@const*/EditorSession.signalUndoStackChanged = "signalUndoStackChanged"; + + return EditorSession; +}); diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/FullWindowZoomHelper.js b/api/js/webodf/wodotexteditor/wodotexteditor/FullWindowZoomHelper.js new file mode 100644 index 0000000000..b3d88b9288 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/FullWindowZoomHelper.js @@ -0,0 +1,83 @@ +/** + * Copyright (C) 2014 KO GmbH + * + * @licstart + * This file is part of WebODF. + * + * WebODF is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License (GNU AGPL) + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * WebODF 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with WebODF. If not, see . + * @licend + * + * @source: http://www.webodf.org/ + * @source: https://github.com/kogmbh/WebODF/ + */ + +/*global define, document, window */ + +define("webodf/editor/FullWindowZoomHelper", [], function () { + "use strict"; + + // fullscreen pinch-zoom adaption + var FullWindowZoomHelper = function FullWindowZoomHelper(toolbarContainerElement, canvasContainerElement) { + + function translateToolbar() { + var y = document.body.scrollTop; + + toolbarContainerElement.style.WebkitTransformOrigin = "center top"; + toolbarContainerElement.style.WebkitTransform = 'translateY(' + y + 'px)'; + } + + function repositionContainer() { + canvasContainerElement.style.top = toolbarContainerElement.getBoundingClientRect().height + 'px'; + } + + this.destroy = function (callback) { + window.removeEventListener('scroll', translateToolbar); + window.removeEventListener('focusout', translateToolbar); + window.removeEventListener('touchmove', translateToolbar); + window.removeEventListener('resize', repositionContainer); + + callback(); + }; + + function init() { + var metaElement, toolbarStyle; + + // prevent any zooming on the window TODO: do not overwrite any other existing content of viewport metadata + metaElement = document.createElement("meta"); + metaElement.setAttribute("name", "viewport"); + metaElement.setAttribute("content", "width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"); + document.head.appendChild(metaElement); + + // set the toolbar absolute and fixed to top + toolbarStyle = toolbarContainerElement.style; + toolbarStyle.top = 0; + toolbarStyle.left = 0; + toolbarStyle.right = 0; + toolbarStyle.position = "absolute"; + toolbarStyle.zIndex = 5; + toolbarStyle.boxShadow = "0 1px 5px rgba(0, 0, 0, 0.25)"; + + repositionContainer(); + + window.addEventListener('scroll', translateToolbar); + window.addEventListener('focusout', translateToolbar); + window.addEventListener('touchmove', translateToolbar); + window.addEventListener('resize', repositionContainer); + } + + init(); + }; + + return FullWindowZoomHelper; +}); diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/Tools.js b/api/js/webodf/wodotexteditor/wodotexteditor/Tools.js new file mode 100644 index 0000000000..e5e2e9bab9 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/Tools.js @@ -0,0 +1,317 @@ +/** + * Copyright (C) 2013 KO GmbH + * + * @licstart + * This file is part of WebODF. + * + * WebODF is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License (GNU AGPL) + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * WebODF 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with WebODF. If not, see . + * @licend + * + * @source: http://www.webodf.org/ + * @source: https://github.com/kogmbh/WebODF/ + */ + +/*global window, define, require, document, dijit, dojo, runtime, ops*/ + +define("webodf/editor/Tools", [ + "dojo/ready", + "dijit/MenuItem", + "dijit/DropDownMenu", + "dijit/form/Button", + "dijit/form/DropDownButton", + "dijit/Toolbar", + "webodf/editor/widgets/paragraphAlignment", + "webodf/editor/widgets/simpleStyles", + "webodf/editor/widgets/undoRedoMenu", + "webodf/editor/widgets/toolbarWidgets/currentStyle", + "webodf/editor/widgets/annotation", + "webodf/editor/widgets/editHyperlinks", + "webodf/editor/widgets/imageInserter", + "webodf/editor/widgets/paragraphStylesDialog", + "webodf/editor/widgets/zoomSlider", + "webodf/editor/widgets/aboutDialog", + "webodf/editor/EditorSession"], + function (ready, MenuItem, DropDownMenu, Button, DropDownButton, Toolbar, ParagraphAlignment, SimpleStyles, UndoRedoMenu, CurrentStyle, AnnotationControl, EditHyperlinks, ImageInserter, ParagraphStylesDialog, ZoomSlider, AboutDialog, EditorSession) { + "use strict"; + + return function Tools(toolbarElementId, args) { + var tr = runtime.tr, + onToolDone = args.onToolDone, + loadOdtFile = args.loadOdtFile, + saveOdtFile = args.saveOdtFile, + saveAsOdtFile = args.saveAsOdtFile, + downloadOdtFile = args.downloadOdtFile, + close = args.close, + toolbar, + loadButton, saveButton, closeButton, aboutButton, + saveAsButton, downloadButton, + formatDropDownMenu, formatMenuButton, + paragraphStylesMenuItem, paragraphStylesDialog, + editorSession, + aboutDialog, + sessionSubscribers = []; + + function placeAndStartUpWidget(widget) { + widget.placeAt(toolbar); + widget.startup(); + } + + /** + * Creates a tool and installs it, if the enabled flag is set to true. + * Only supports tool classes whose constructor has a single argument which + * is a callback to pass the created widget object to. + * @param {!function(new:Object, function(!Object):undefined)} Tool constructor method of the tool + * @param {!boolean} enabled + * @param {!Object|undefined=} config + * @return {?Object} + */ + function createTool(Tool, enabled, config) { + var tool = null; + + if (enabled) { + if (config) { + tool = new Tool(config, placeAndStartUpWidget); + } else { + tool = new Tool(placeAndStartUpWidget); + } + sessionSubscribers.push(tool); + tool.onToolDone = onToolDone; + tool.setEditorSession(editorSession); + } + + return tool; + } + + function handleCursorMoved(cursor) { + var disabled = cursor.getSelectionType() === ops.OdtCursor.RegionSelection; + if (formatMenuButton) { + formatMenuButton.setAttribute('disabled', disabled); + } + } + + function setEditorSession(session) { + if (editorSession) { + editorSession.unsubscribe(EditorSession.signalCursorMoved, handleCursorMoved); + } + + editorSession = session; + if (editorSession) { + editorSession.subscribe(EditorSession.signalCursorMoved, handleCursorMoved); + } + + sessionSubscribers.forEach(function (subscriber) { + subscriber.setEditorSession(editorSession); + }); + + [saveButton, saveAsButton, downloadButton, closeButton, formatMenuButton].forEach(function (button) { + if (button) { + button.setAttribute('disabled', !editorSession); + } + }); + } + + this.setEditorSession = setEditorSession; + + /** + * @param {!function(!Error=)} callback, passing an error object in case of error + * @return {undefined} + */ + this.destroy = function (callback) { + // TODO: + // 1. We don't want to use `document` + // 2. We would like to avoid deleting all widgets + // under document.body because this might interfere with + // other apps that use the editor not-in-an-iframe, + // but dojo always puts its dialogs below the body, + // so this works for now. Perhaps will be obsoleted + // once we move to a better widget toolkit + var widgets = dijit.findWidgets(document.body); + dojo.forEach(widgets, function(w) { + w.destroyRecursive(false); + }); + callback(); + }; + + // init + ready(function () { + toolbar = new Toolbar({}, toolbarElementId); + + // About + if (args.aboutEnabled) { + aboutButton = new Button({ + label: tr('About WebODF Text Editor'), + showLabel: false, + iconClass: 'webodfeditor-dijitWebODFIcon' + }); + aboutDialog = new AboutDialog(function (dialog) { + aboutButton.onClick = function () { + dialog.startup(); + dialog.show(); + }; + }); + aboutDialog.onToolDone = onToolDone; + aboutButton.placeAt(toolbar); + } + + // Load + if (loadOdtFile) { + loadButton = new Button({ + label: tr('Open'), + showLabel: false, + iconClass: 'dijitIcon dijitIconFolderOpen', + onClick: function () { + loadOdtFile(); + } + }); + loadButton.placeAt(toolbar); + } + + // Save + if (saveOdtFile) { + saveButton = new Button({ + label: tr('Save'), + showLabel: false, + disabled: true, + iconClass: 'dijitEditorIcon dijitEditorIconSave', + onClick: function () { + saveOdtFile(); + onToolDone(); + } + }); + saveButton.placeAt(toolbar); + } + + // SaveAs + if (saveAsOdtFile) { + saveAsButton = new Button({ + label: tr('Save as...'), + showLabel: false, + disabled: true, + iconClass: 'webodfeditor-dijitSaveAsIcon', + onClick: function () { + saveAsOdtFile(); + onToolDone(); + } + }); + saveAsButton.placeAt(toolbar); + } + + // Download + if (downloadOdtFile) { + downloadButton = new Button({ + label: tr('Download'), + showLabel: true, + disabled: true, + style: { + float: 'right' + }, + onClick: function () { + downloadOdtFile(); + onToolDone(); + } + }); + downloadButton.placeAt(toolbar); + } + + // Format menu + if (args.paragraphStyleEditingEnabled) { + formatDropDownMenu = new DropDownMenu({}); + paragraphStylesMenuItem = new MenuItem({ + label: tr("Paragraph...") + }); + formatDropDownMenu.addChild(paragraphStylesMenuItem); + + paragraphStylesDialog = new ParagraphStylesDialog(function (dialog) { + paragraphStylesMenuItem.onClick = function () { + if (editorSession) { + dialog.startup(); + dialog.show(); + } + }; + }); + sessionSubscribers.push(paragraphStylesDialog); + paragraphStylesDialog.onToolDone = onToolDone; + + formatMenuButton = new DropDownButton({ + dropDown: formatDropDownMenu, + disabled: true, + label: tr('Format'), + iconClass: "dijitIconEditTask" + }); + formatMenuButton.placeAt(toolbar); + } + + // Undo/Redo + createTool(UndoRedoMenu, args.undoRedoEnabled); + + // Add annotation + createTool(AnnotationControl, args.annotationsEnabled); + + // Simple Style Selector [B, I, U, S] + createTool(SimpleStyles, args.directTextStylingEnabled); + + // Paragraph direct alignment buttons + createTool(ParagraphAlignment, args.directParagraphStylingEnabled); + + // Paragraph Style Selector + createTool(CurrentStyle, args.paragraphStyleSelectingEnabled); + + // Zoom Level Selector + createTool(ZoomSlider, args.zoomingEnabled); + + // hyper links + createTool(EditHyperlinks, args.hyperlinkEditingEnabled); + + // image insertion + createTool(ImageInserter, args.imageInsertingEnabled); + + // close button + if (close) { + closeButton = new Button({ + label: tr('Close'), + showLabel: false, + disabled: true, + iconClass: 'dijitEditorIcon dijitEditorIconCancel', + style: { + float: 'right' + }, + onClick: function () { + close(); + } + }); + closeButton.placeAt(toolbar); + } + + // This is an internal hook for debugging/testing. + // Yes, you discovered something interesting. But: + // Do NOT rely on it, it will not be supported and can and will change in any version. + // It is not officially documented for a reason. A real plugin system is only on the wishlist + // so far, please file your suggestions/needs at the official WebODF issue system. + // You have been warned. + if (window.wodo_plugins) { + window.wodo_plugins.forEach(function (plugin) { + runtime.log("Creating plugin: "+plugin.id); + require([plugin.id], function (Plugin) { + runtime.log("Creating as tool now: "+plugin.id); + createTool(Plugin, true, plugin.config); + }); + }); + + } + + setEditorSession(editorSession); + }); + }; + + }); diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/Translator.js b/api/js/webodf/wodotexteditor/wodotexteditor/Translator.js new file mode 100644 index 0000000000..434fb7b924 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/Translator.js @@ -0,0 +1,81 @@ +/** + * Copyright (C) 2013 KO GmbH + * + * @licstart + * This file is part of WebODF. + * + * WebODF is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License (GNU AGPL) + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * WebODF 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with WebODF. If not, see . + * @licend + * + * @source: http://www.webodf.org/ + * @source: https://github.com/kogmbh/WebODF/ + */ + +/*global define, runtime, XMLHttpRequest */ + +define("webodf/editor/Translator", [], function () { + "use strict"; + + return function Translator(translationsPath, locale, callback) { + var self = this, + dictionary = {}; + + function translate(key) { + return dictionary[key]; + } + function setLocale(newLocale, cb) { + // TODO: Add smarter locale resolution at some point + if (newLocale.split('-')[0] === "de" || newLocale.split('_')[0] === "de") { + newLocale = "de-DE"; + } else if (newLocale.split('-')[0] === "nl" || newLocale.split('_')[0] === "nl") { + newLocale = "nl-NL"; + } else if (newLocale.split('-')[0] === "fr" || newLocale.split('_')[0] === "fr") { + newLocale = "fr-FR"; + } else if (newLocale.split('-')[0] === "it" || newLocale.split('_')[0] === "it") { + newLocale = "it-IT"; + } else if (newLocale.split('-')[0] === "eu" || newLocale.split('_')[0] === "eu") { + newLocale = "eu"; + } else if (newLocale.split('-')[0] === "en" || newLocale.split('_')[0] === "en") { + newLocale = "en-US"; + } else { + newLocale = "en-US"; + } + + var xhr = new XMLHttpRequest(), + path = translationsPath + '/' + newLocale + ".json"; + xhr.open("GET", path); + xhr.onload = function () { + if (xhr.status === 200) {// HTTP OK + dictionary = JSON.parse(xhr.response); + locale = newLocale; + } + cb(); + }; + xhr.send(null); + } + function getLocale() { + return locale; + } + + this.translate = translate; + this.getLocale = getLocale; + + function init() { + setLocale(locale, function () { + callback(self); + }); + } + init(); + }; +}); diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/app/resources/app.css b/api/js/webodf/wodotexteditor/wodotexteditor/app/resources/app.css new file mode 100644 index 0000000000..d964feba95 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/app/resources/app.css @@ -0,0 +1 @@ +body, div, dl, dt, dd, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td {margin: 0; padding: 0;}fieldset, img {border: 0 none;}address, caption, cite, code, dfn, th, var {font-style: normal; font-weight: normal;}caption, th {text-align: left;}q:before, q:after {content:"";}abbr, acronym {border:0;}body {font: 12px Myriad,Helvetica,Tahoma,Arial,clean,sans-serif; *font-size: 75%;}h1 {font-size: 1.5em; font-weight: normal; line-height: 1em; margin-top: 1em; margin-bottom:0;}h2 {font-size: 1.1667em; font-weight: bold; line-height: 1.286em; margin-top: 1.929em; margin-bottom:0.643em;}h3, h4, h5, h6 {font-size: 1em; font-weight: bold; line-height: 1.5em; margin-top: 1.5em; margin-bottom: 0;}p {font-size: 1em; margin-top: 1.5em; margin-bottom: 1.5em; line-height: 1.5em;}blockquote {font-size: 0.916em; margin-top: 3.272em; margin-bottom: 3.272em; line-height: 1.636em; padding: 1.636em; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc;}ol li, ul li {font-size: 1em; line-height: 1.5em; margin: 0;}pre, code {font-size:115%; *font-size:100%; font-family: Courier, "Courier New"; background-color: #efefef; border: 1px solid #ccc;}pre {border-width: 1px 0; padding: 1.5em;}table {font-size:100%;}.dojoTabular {border-collapse: collapse; border-spacing: 0; border: 1px solid #ccc; margin: 0 1.5em;}.dojoTabular th {text-align: center; font-weight: bold;}.dojoTabular thead,.dojoTabular tfoot {background-color: #efefef; border: 1px solid #ccc; border-width: 1px 0;}.dojoTabular th,.dojoTabular td {padding: 0.25em 0.5em;}.dijitReset {margin:0; border:0; padding:0; line-height:normal; font: inherit; color: inherit;}.dj_a11y .dijitReset {-moz-appearance: none;}.dijitInline {display:inline-block; #zoom: 1; #display:inline; border:0; padding:0; vertical-align:middle; #vertical-align: auto;}table.dijitInline {display:inline-table; box-sizing: content-box; -moz-box-sizing: content-box;}.dijitHidden {display: none !important;}.dijitVisible {display: block !important; position: relative;}.dj_ie6 .dijitComboBox .dijitInputContainer,.dijitInputContainer {#zoom: 1; overflow: hidden; float: none !important; position: relative;}.dj_ie7 .dijitInputContainer {float: left !important; clear: left; display: inline-block !important;}.dj_ie .dijitSelect input,.dj_ie input.dijitTextBox,.dj_ie .dijitTextBox input {font-size: 100%;}.dijitSelect .dijitButtonText {float: left; vertical-align: top;}TABLE.dijitSelect {padding: 0 !important;}.dijitTextBox .dijitSpinnerButtonContainer,.dijitTextBox .dijitArrowButtonContainer,.dijitValidationTextBox .dijitValidationContainer {float: right; text-align: center;}.dijitSelect input.dijitInputField,.dijitTextBox input.dijitInputField {padding-left: 0 !important; padding-right: 0 !important;}.dijitValidationTextBox .dijitValidationContainer {display: none;}.dijitTeeny {font-size:1px; line-height:1px;}.dijitOffScreen {position: absolute !important; left: 50% !important; top: -10000px !important;}.dijitPopup {position: absolute; background-color: transparent; margin: 0; border: 0; padding: 0;}.dijitPositionOnly {padding: 0 !important; border: 0 !important; background-color: transparent !important; background-image: none !important; height: auto !important; width: auto !important;}.dijitNonPositionOnly {float: none !important; position: static !important; margin: 0 0 0 0 !important; vertical-align: middle !important;}.dijitBackgroundIframe {position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: -1; border: 0; padding: 0; margin: 0;}.dijitDisplayNone {display:none !important;}.dijitContainer {overflow: hidden;}.dj_a11y .dijitIcon,.dj_a11y div.dijitArrowButtonInner, .dj_a11y span.dijitArrowButtonInner,.dj_a11y img.dijitArrowButtonInner,.dj_a11y .dijitCalendarIncrementControl,.dj_a11y .dijitTreeExpando {display: none;}.dijitSpinner div.dijitArrowButtonInner {display: block;}.dj_a11y .dijitA11ySideArrow {display: inline !important; cursor: pointer;}.dj_a11y .dijitCalendarDateLabel {padding: 1px; border: 0px !important;}.dj_a11y .dijitCalendarSelectedDate .dijitCalendarDateLabel {border-style: solid !important; border-width: 1px !important; padding: 0;}.dj_a11y .dijitCalendarDateTemplate {padding-bottom: 0.1em !important; border: 0px !important;}.dj_a11y .dijitButtonNode {border: black outset medium !important; padding: 0 !important;}.dj_a11y .dijitArrowButton {padding: 0 !important;}.dj_a11y .dijitButtonContents {margin: 0.15em;}.dj_a11y .dijitTextBoxReadOnly .dijitInputField,.dj_a11y .dijitTextBoxReadOnly .dijitButtonNode {border-style: outset!important; border-width: medium!important; border-color: #999 !important; color:#999 !important;}.dijitButtonNode * {vertical-align: middle;}.dijitSelect .dijitArrowButtonInner,.dijitButtonNode .dijitArrowButtonInner {background: no-repeat center; width: 12px; height: 12px; direction: ltr;}.dijitLeft {background-position:left top; background-repeat:no-repeat;}.dijitStretch {white-space:nowrap; background-repeat:repeat-x;}.dijitRight {#display:inline; background-position:right top; background-repeat:no-repeat;}.dj_gecko .dj_a11y .dijitButtonDisabled .dijitButtonNode {opacity: 0.5;}.dijitToggleButton,.dijitButton,.dijitDropDownButton,.dijitComboButton {margin: 0.2em; vertical-align: middle;}.dijitButtonContents {display: block;}td.dijitButtonContents {display: table-cell;}.dijitButtonNode img {vertical-align:middle;}.dijitToolbar .dijitComboButton {border-collapse: separate;}.dijitToolbar .dijitToggleButton,.dijitToolbar .dijitButton,.dijitToolbar .dijitDropDownButton,.dijitToolbar .dijitComboButton {margin: 0;}.dijitToolbar .dijitButtonContents {padding: 1px 2px;}.dj_webkit .dijitToolbar .dijitDropDownButton {padding-left: 0.3em;}.dj_gecko .dijitToolbar .dijitButtonNode::-moz-focus-inner {padding:0;}.dijitSelect {border:1px solid gray;}.dijitButtonNode {border:1px solid gray; margin:0; line-height:normal; vertical-align: middle; #vertical-align: auto; text-align:center; white-space: nowrap;}.dj_webkit .dijitSpinner .dijitSpinnerButtonContainer {line-height:inherit;}.dijitTextBox .dijitButtonNode {border-width: 0;}.dijitSelect,.dijitSelect *,.dijitButtonNode,.dijitButtonNode * {cursor: pointer;}.dj_ie .dijitButtonNode {zoom: 1;}.dj_ie .dijitButtonNode button {overflow: visible;}div.dijitArrowButton {float: right;}.dijitTextBox {border: solid black 1px; #overflow: hidden; width: 15em; vertical-align: middle;}.dijitTextBoxReadOnly,.dijitTextBoxDisabled {color: gray;}.dj_webkit .dijitTextBoxDisabled input {color: #eee;}.dj_webkit textarea.dijitTextAreaDisabled {color: #333;}.dj_gecko .dijitTextBoxReadOnly input.dijitInputField, .dj_gecko .dijitTextBoxDisabled input {-moz-user-input: none;}.dijitPlaceHolder {color: #AAAAAA; font-style: italic; position: absolute; top: 0; left: 0; #filter: "";}.dijitTimeTextBox {width: 8em;}.dijitTextBox input:focus {outline: none;}.dijitTextBoxFocused {outline: 5px -webkit-focus-ring-color;}.dijitSelect input,.dijitTextBox input {float: left;}.dj_ie6 input.dijitTextBox,.dj_ie6 .dijitTextBox input {float: none;}.dijitInputInner {border:0 !important; background-color:transparent !important; width:100% !important; padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important;}.dj_a11y .dijitTextBox input {margin: 0 !important;}.dijitValidationTextBoxError input.dijitValidationInner,.dijitSelect input,.dijitTextBox input.dijitArrowButtonInner {text-indent: -2em !important; direction: ltr !important; text-align: left !important; height: auto !important; #text-indent: 0 !important; #letter-spacing: -5em !important; #text-align: right !important;}.dj_ie .dijitSelect input,.dj_ie .dijitTextBox input,.dj_ie input.dijitTextBox {overflow-y: visible; line-height: normal;}.dijitSelect .dijitSelectLabel span {line-height: 100%;}.dj_ie .dijitSelect .dijitSelectLabel {line-height: normal;}.dj_ie6 .dijitSelect .dijitSelectLabel,.dj_ie7 .dijitSelect .dijitSelectLabel,.dj_ie8 .dijitSelect .dijitSelectLabel,.dj_iequirks .dijitSelect .dijitSelectLabel,.dijitSelect td,.dj_ie6 .dijitSelect input,.dj_iequirks .dijitSelect input,.dj_ie6 .dijitSelect .dijitValidationContainer,.dj_ie6 .dijitTextBox input,.dj_ie6 input.dijitTextBox,.dj_iequirks .dijitTextBox input.dijitValidationInner,.dj_iequirks .dijitTextBox input.dijitArrowButtonInner,.dj_iequirks .dijitTextBox input.dijitSpinnerButtonInner,.dj_iequirks .dijitTextBox input.dijitInputInner,.dj_iequirks input.dijitTextBox {line-height: 100%;}.dj_a11y input.dijitValidationInner,.dj_a11y input.dijitArrowButtonInner {text-indent: 0 !important; width: 1em !important; #text-align: left !important; color: black !important;}.dijitValidationTextBoxError .dijitValidationContainer {display: inline; cursor: default;}.dijitSpinner .dijitSpinnerButtonContainer,.dijitComboBox .dijitArrowButtonContainer {border-width: 0 0 0 1px !important;}.dj_a11y .dijitSelect .dijitArrowButtonContainer,.dijitToolbar .dijitComboBox .dijitArrowButtonContainer {border-width: 0 !important;}.dijitComboBoxMenu {list-style-type: none;}.dijitSpinner .dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0;}.dj_ie .dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitButtonNode {clear: both;}.dj_ie .dijitToolbar .dijitComboBox {vertical-align: middle;}.dijitTextBox .dijitSpinnerButtonContainer {width: 1em; position: relative !important; overflow: hidden;}.dijitSpinner .dijitSpinnerButtonInner {width:1em; visibility:hidden !important; overflow-x:hidden;}.dijitComboBox .dijitButtonNode,.dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0;}.dj_a11y .dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0px !important; border-style: solid !important;}.dj_a11y .dijitTextBox .dijitSpinnerButtonContainer,.dj_a11y .dijitSpinner .dijitArrowButtonInner,.dj_a11y .dijitSpinnerButtonContainer input {width: 1em !important;}.dj_a11y .dijitSpinner .dijitArrowButtonInner {margin: 0 auto !important;}.dj_ie .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {padding-left: 0.3em !important; padding-right: 0.3em !important; margin-left: 0.3em !important; margin-right: 0.3em !important; width: 1.4em !important;}.dj_ie7 .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {padding-left: 0 !important; padding-right: 0 !important; width: 1em !important;}.dj_ie6 .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {margin-left: 0.1em !important; margin-right: 0.1em !important; width: 1em !important;}.dj_iequirks .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {margin-left: 0 !important; margin-right: 0 !important; width: 2em !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {padding: 0; position: absolute !important; right: 0; float: none; height: 50%; width: 100%; bottom: auto; left: 0; right: auto;}.dj_iequirks .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: auto;}.dj_a11y .dijitSpinnerButtonContainer .dijitArrowButton {overflow: visible !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitDownArrowButton {top: 50%; border-top-width: 1px !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitUpArrowButton {#bottom: 50%; top: 0;}.dijitSpinner .dijitArrowButtonInner {margin: auto; overflow-x: hidden; height: 100% !important;}.dj_iequirks .dijitSpinner .dijitArrowButtonInner {height: auto !important;}.dijitSpinner .dijitArrowButtonInner .dijitInputField {-moz-transform: scale(0.5); -moz-transform-origin: center top; -webkit-transform: scale(0.5); -webkit-transform-origin: center top; -o-transform: scale(0.5); -o-transform-origin: center top; transform: scale(0.5); transform-origin: left top; padding-top: 0; padding-bottom: 0; padding-left: 0 !important; padding-right: 0 !important; width: 100%; visibility: hidden;}.dj_ie .dijitSpinner .dijitArrowButtonInner .dijitInputField {zoom: 50%;}.dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButtonInner {overflow: hidden;}.dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: 100%;}.dj_iequirks .dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: 1em;}.dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {vertical-align:top; visibility: visible;}.dj_a11y .dijitSpinnerButtonContainer {width: 1em;}.dijitCheckBox,.dijitRadio,.dijitCheckBoxInput {padding: 0; border: 0; width: 16px; height: 16px; background-position:center center; background-repeat:no-repeat; overflow: hidden;}.dijitCheckBox input,.dijitRadio input {margin: 0; padding: 0; display: block;}.dijitCheckBoxInput {opacity: 0.01;}.dj_ie .dijitCheckBoxInput {filter: alpha(opacity=0);}.dj_a11y .dijitCheckBox,.dj_a11y .dijitRadio {width: auto !important; height: auto !important;}.dj_a11y .dijitCheckBoxInput {opacity: 1; filter: none; width: auto; height: auto;}.dj_a11y .dijitFocusedLabel {border: 1px dotted; outline: 0px !important;}.dijitProgressBar {z-index: 0;}.dijitProgressBarEmpty {position:relative;overflow:hidden; border:1px solid black; z-index:0;}.dijitProgressBarFull {position:absolute; overflow:hidden; z-index:-1; top:0; width:100%;}.dj_ie6 .dijitProgressBarFull {height:1.6em;}.dijitProgressBarTile {position:absolute; overflow:hidden; top:0; left:0; bottom:0; right:0; margin:0; padding:0; width: 100%; height:auto; background-color:#aaa; background-attachment: fixed;}.dj_a11y .dijitProgressBarTile {border-width:2px; border-style:solid; background-color:transparent !important;}.dj_ie6 .dijitProgressBarTile {position:static; height:1.6em;}.dijitProgressBarIndeterminate .dijitProgressBarTile {}.dijitProgressBarIndeterminateHighContrastImage {display:none;}.dj_a11y .dijitProgressBarIndeterminate .dijitProgressBarIndeterminateHighContrastImage {display:block; position:absolute; top:0; bottom:0; margin:0; padding:0; width:100%; height:auto;}.dijitProgressBarLabel {display:block; position:static; width:100%; text-align:center; background-color:transparent !important;}.dijitTooltip {position: absolute; z-index: 2000; display: block; left: 0; top: -10000px; overflow: visible;}.dijitTooltipContainer {border: solid black 2px; background: #b8b5b5; color: black; font-size: small;}.dijitTooltipFocusNode {padding: 2px 2px 2px 2px;}.dijitTooltipConnector {position: absolute;}.dj_a11y .dijitTooltipConnector {display: none;}.dijitTooltipData {display:none;}.dijitLayoutContainer {position: relative; display: block; overflow: hidden;}.dijitAlignTop,.dijitAlignBottom,.dijitAlignLeft,.dijitAlignRight {position: absolute; overflow: hidden;}body .dijitAlignClient {position: absolute;}.dijitBorderContainer, .dijitBorderContainerNoGutter {position:relative; overflow: hidden; z-index: 0;}.dijitBorderContainerPane,.dijitBorderContainerNoGutterPane {position: absolute !important; z-index: 2;}.dijitBorderContainer > .dijitTextArea {resize: none;}.dijitGutter {position: absolute; font-size: 1px;}.dijitSplitter {position: absolute; overflow: hidden; z-index: 10; background-color: #fff; border-color: gray; border-style: solid; border-width: 0;}.dj_ie .dijitSplitter {z-index: 1;}.dijitSplitterActive {z-index: 11 !important;}.dijitSplitterCover {position:absolute; z-index:-1; top:0; left:0; width:100%; height:100%;}.dijitSplitterCoverActive {z-index:3 !important;}.dj_ie .dijitSplitterCover {background: white; filter: alpha(opacity=0);}.dijitSplitterH {height: 7px; border-top:1px; border-bottom:1px; cursor: row-resize;}.dijitSplitterV {width: 7px; border-left:1px; border-right:1px; cursor: col-resize;}.dijitSplitContainer {position: relative; overflow: hidden; display: block;}.dj_ff3 .dj_a11y div.dijitSplitter:focus {outline-style:dotted; outline-width: 2px;}.dijitSplitPane {position: absolute;}.dijitSplitContainerSizerH,.dijitSplitContainerSizerV {position:absolute; font-size: 1px; background-color: ThreeDFace; border: 1px solid; border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight; margin: 0;}.dijitSplitContainerSizerH .thumb, .dijitSplitterV .dijitSplitterThumb {overflow:hidden; position:absolute; top:49%;}.dijitSplitContainerSizerV .thumb, .dijitSplitterH .dijitSplitterThumb {position:absolute; left:49%;}.dijitSplitterShadow,.dijitSplitContainerVirtualSizerH,.dijitSplitContainerVirtualSizerV {font-size: 1px; background-color: ThreeDShadow; -moz-opacity: 0.5; opacity: 0.5; filter: Alpha(Opacity=50); margin: 0;}.dijitSplitContainerSizerH, .dijitSplitContainerVirtualSizerH {cursor: col-resize;}.dijitSplitContainerSizerV, .dijitSplitContainerVirtualSizerV {cursor: row-resize;}.dj_a11y .dijitSplitterH {border-top:1px solid #d3d3d3 !important; border-bottom:1px solid #d3d3d3 !important;}.dj_a11y .dijitSplitterV {border-left:1px solid #d3d3d3 !important; border-right:1px solid #d3d3d3 !important;}.dijitContentPane {display: block; overflow: auto;}.dijitContentPaneSingleChild {overflow: hidden;}.dijitContentPaneLoading .dijitIconLoading,.dijitContentPaneError .dijitIconError {margin-right: 9px;}.dijitTitlePane {display: block; overflow: hidden;}.dijitTitlePaneTitle {cursor: pointer;}.dijitFixedOpen, .dijitFixedClosed {cursor: default;}.dijitFixedOpen .dijitArrowNode, .dijitFixedOpen .dijitArrowNodeInner,.dijitFixedClosed .dijitArrowNode, .dijitFixedClosed .dijitArrowNodeInner{display: none;}.dijitTitlePaneTitle * {vertical-align: middle;}.dijitTitlePane .dijitArrowNodeInner {display: none;}.dj_a11y .dijitTitlePane .dijitArrowNodeInner {display:inline !important; font-family: monospace;}.dj_a11y .dijitTitlePane .dijitArrowNode {display:none;}.dj_ie6 .dijitTitlePaneContentOuter,.dj_ie6 .dijitTitlePane .dijitTitlePaneTitle {zoom: 1;}.dijitColorPalette {border: 1px solid #999; background: #fff; position: relative;}.dijitColorPalette .dijitPaletteTable {padding: 2px 3px 3px 3px; position: relative; overflow: hidden; outline: 0; border-collapse: separate;}.dj_ie6 .dijitColorPalette .dijitPaletteTable,.dj_ie7 .dijitColorPalette .dijitPaletteTable,.dj_iequirks .dijitColorPalette .dijitPaletteTable {padding: 0; margin: 2px 3px 3px 3px;}.dijitColorPalette .dijitPaletteCell {font-size: 1px; vertical-align: middle; text-align: center; background: none;}.dijitColorPalette .dijitPaletteImg {padding: 1px; border: 1px solid #999; margin: 2px 1px; cursor: default; font-size: 1px;}.dj_gecko .dijitColorPalette .dijitPaletteImg {padding-bottom: 0;}.dijitColorPalette .dijitColorPaletteSwatch {width: 14px; height: 12px;}.dijitPaletteTable td {padding: 0;}.dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg {border: 1px solid #000;}.dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg,.dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg {border: 2px solid #000; margin: 1px 0;}.dj_a11y .dijitColorPalette .dijitPaletteTable,.dj_a11y .dijitColorPalette .dijitPaletteTable * {background-color: transparent !important;}.dijitAccordionContainer {border:1px solid #b7b7b7; border-top:0 !important;}.dijitAccordionTitle {cursor: pointer;}.dijitAccordionTitleSelected {cursor: default;}.dijitAccordionTitle .arrowTextUp,.dijitAccordionTitle .arrowTextDown {display: none; font-size: 0.65em; font-weight: normal !important;}.dj_a11y .dijitAccordionTitle .arrowTextUp,.dj_a11y .dijitAccordionTitleSelected .arrowTextDown {display: inline;}.dj_a11y .dijitAccordionTitleSelected .arrowTextUp {display: none;}.dijitAccordionChildWrapper {overflow: hidden;}.dijitCalendarContainer {width: auto;}.dijitCalendarContainer th, .dijitCalendarContainer td {padding: 0; vertical-align: middle;}.dijitCalendarYearLabel {white-space: nowrap;}.dijitCalendarNextYear {margin:0 0 0 0.55em;}.dijitCalendarPreviousYear {margin:0 0.55em 0 0;}.dijitCalendarIncrementControl {vertical-align: middle;}.dijitCalendarIncrementControl,.dijitCalendarDateTemplate,.dijitCalendarMonthLabel,.dijitCalendarPreviousYear,.dijitCalendarNextYear {cursor: pointer;}.dijitCalendarDisabledDate {color: gray; text-decoration: line-through; cursor: default;}.dijitSpacer {position: relative; height: 1px; overflow: hidden; visibility: hidden;}.dijitCalendarMonthMenu .dijitCalendarMonthLabel {text-align:center;}.dijitMenu {border:1px solid black; background-color:white;}.dijitMenuTable {border-collapse:collapse; border-width:0; background-color:white;}.dj_webkit .dijitMenuTable td[colspan="2"]{border-right:hidden;}.dijitMenuItem {text-align: left; white-space: nowrap; padding:.1em .2em; cursor:pointer;}.dijitMenuItem:focus {outline: none}.dijitMenuPassive .dijitMenuItemHover,.dijitMenuItemSelected {background-color:black; color:white;}.dijitMenuItemIcon, .dijitMenuExpand {background-repeat: no-repeat;}.dijitMenuItemDisabled * {opacity:0.5; cursor:default;}.dj_ie .dj_a11y .dijitMenuItemDisabled,.dj_ie .dj_a11y .dijitMenuItemDisabled *,.dj_ie .dijitMenuItemDisabled * {color: gray; filter: alpha(opacity=35);}.dijitMenuItemLabel {position: relative; vertical-align: middle;}.dj_a11y .dijitMenuItemSelected {border: 1px dotted black !important;}.dj_ff3 .dj_a11y .dijitMenuItem td {padding: 0 !important; background:none !important;}.dj_a11y .dijitMenuItemSelected .dijitMenuItemLabel {border-width: 1px; border-style: solid;}.dj_ie8 .dj_a11y .dijitMenuItemLabel {position:static;}.dijitMenuExpandA11y {display: none;}.dj_a11y .dijitMenuExpandA11y {display: inline;}.dijitMenuSeparator td {border: 0; padding: 0;}.dijitMenuSeparatorTop {height: 50%; margin: 0; margin-top:3px; font-size: 1px;}.dijitMenuSeparatorBottom {height: 50%; margin: 0; margin-bottom:3px; font-size: 1px;}.dijitCheckedMenuItemIconChar {vertical-align: middle; visibility:hidden;}.dijitCheckedMenuItemChecked .dijitCheckedMenuItemIconChar {visibility: visible;}.dj_a11y .dijitCheckedMenuItemIconChar {display:inline !important;}.dj_a11y .dijitCheckedMenuItemIcon {display: none;}.dj_ie .dj_a11y .dijitMenuBar .dijitMenuItem {margin: 0;}.dijitStackController .dijitToggleButtonChecked * {cursor: default;}.dijitTabContainer {z-index: 0; overflow-y: visible;}.dj_ie6 .dijitTabContainer {overflow: hidden;}.dijitTabContainerNoLayout {width: 100%;}.dijitTabContainerBottom-tabs,.dijitTabContainerTop-tabs,.dijitTabContainerLeft-tabs,.dijitTabContainerRight-tabs {z-index: 1; overflow: visible !important;}.dijitTabController {z-index: 1;}.dijitTabContainerBottom-container,.dijitTabContainerTop-container,.dijitTabContainerLeft-container,.dijitTabContainerRight-container {z-index:0; overflow: hidden; border: 1px solid black;}.nowrapTabStrip {width: 50000px; display: block; position: relative; text-align: left; z-index: 1;}.dijitTabListWrapper {overflow: hidden; z-index: 1;}.dj_a11y .tabStripButton img {display: none;}.dijitTabContainerTop-tabs {border-bottom: 1px solid black;}.dijitTabContainerTop-container {border-top: 0;}.dijitTabContainerLeft-tabs {border-right: 1px solid black; float: left;}.dijitTabContainerLeft-container {border-left: 0;}.dijitTabContainerBottom-tabs {border-top: 1px solid black;}.dijitTabContainerBottom-container {border-bottom: 0;}.dijitTabContainerRight-tabs {border-left: 1px solid black; float: left;}.dijitTabContainerRight-container {border-right: 0;}div.dijitTabDisabled, .dj_ie div.dijitTabDisabled {cursor: auto;}.dijitTab {position:relative; cursor:pointer; white-space:nowrap; z-index:3;}.dijitTab * {vertical-align: middle;}.dijitTabChecked {cursor: default;}.dijitTabContainerTop-tabs .dijitTab {top: 1px;}.dijitTabContainerBottom-tabs .dijitTab {top: -1px;}.dijitTabContainerLeft-tabs .dijitTab {left: 1px;}.dijitTabContainerRight-tabs .dijitTab {left: -1px;}.dijitTabContainerTop-tabs .dijitTab,.dijitTabContainerBottom-tabs .dijitTab {display:inline-block; #zoom: 1; #display:inline;}.tabStripButton {z-index: 12;}.dijitTabButtonDisabled .tabStripButton {display: none;}.dijitTabCloseButton {margin-left: 1em;}.dijitTabCloseText {display:none;}.dijitTab .tabLabel {min-height: 15px; display: inline-block;}.dijitNoIcon {display: none;}.dj_ie6 .dijitTab .dijitNoIcon {display: inline; height: 15px; width: 1px;}.dj_a11y .dijitTabCloseButton {background-image: none !important; width: auto !important; height: auto !important;}.dj_a11y .dijitTabCloseText {display: inline;}.dijitTabPane,.dijitStackContainer-child,.dijitAccordionContainer-child {border: none !important;}.dijitInlineEditBoxDisplayMode {border: 1px solid transparent; cursor: text;}.dj_a11y .dijitInlineEditBoxDisplayMode,.dj_ie6 .dijitInlineEditBoxDisplayMode {border: none;}.dijitInlineEditBoxDisplayModeHover,.dj_a11y .dijitInlineEditBoxDisplayModeHover,.dj_ie6 .dijitInlineEditBoxDisplayModeHover {background-color: #e2ebf2; border: solid 1px black;}.dijitInlineEditBoxDisplayModeDisabled {cursor: default;}.dijitTree {overflow: auto;}.dijitTreeIndent {width: 19px;}.dijitTreeRow, .dijitTreeContent {white-space: nowrap;}.dijitTreeRow img {vertical-align: middle;}.dijitTreeContent {cursor: default;}.dijitExpandoText {display: none;}.dj_a11y .dijitExpandoText {display: inline; padding-left: 10px; padding-right: 10px; font-family: monospace; border-style: solid; border-width: thin; cursor: pointer;}.dijitTreeLabel {margin: 0 4px;}.dijitDialog {position: absolute; z-index: 999; overflow: hidden;}.dijitDialogTitleBar {cursor: move;}.dijitDialogFixed .dijitDialogTitleBar {cursor:default;}.dijitDialogCloseIcon {cursor: pointer;}.dijitDialogUnderlayWrapper {position: absolute; left: 0; top: 0; z-index: 998; display: none; background: transparent !important;}.dijitDialogUnderlay {background: #eee; opacity: 0.5;}.dj_ie .dijitDialogUnderlay {filter: alpha(opacity=50);}.dj_a11y .dijitSpinnerButtonContainer,.dj_a11y .dijitDialog {opacity: 1 !important; background-color: white !important;}.dijitDialog .closeText {display:none; position:absolute;}.dj_a11y .dijitDialog .closeText {display:inline;}.dijitSliderMoveable {z-index:99; position:absolute !important; display:block; vertical-align:middle;}.dijitSliderMoveableH {right:0;}.dijitSliderMoveableV {right:50%;}.dj_a11y div.dijitSliderImageHandle,.dijitSliderImageHandle {margin:0; padding:0; position:relative !important; border:8px solid gray; width:0; height:0; cursor: pointer;}.dj_iequirks .dj_a11y .dijitSliderImageHandle {font-size: 0;}.dj_ie7 .dijitSliderImageHandle {overflow: hidden;}.dj_ie7 .dj_a11y .dijitSliderImageHandle {overflow: visible;}.dj_a11y .dijitSliderFocused .dijitSliderImageHandle {border:4px solid #000; height:8px; width:8px;}.dijitSliderImageHandleV {top:-8px; right: -50%;}.dijitSliderImageHandleH {left:50%; top:-5px; vertical-align:top;}.dijitSliderBar {border-style:solid; border-color:black; cursor: pointer;}.dijitSliderBarContainerV {position:relative; height:100%; z-index:1;}.dijitSliderBarContainerH {position:relative; z-index:1;}.dijitSliderBarH {height:4px; border-width:1px 0;}.dijitSliderBarV {width:4px; border-width:0 1px;}.dijitSliderProgressBar {background-color:red; z-index:1;}.dijitSliderProgressBarV {position:static !important; height:0; vertical-align:top; text-align:left;}.dijitSliderProgressBarH {position:absolute !important; width:0; vertical-align:middle; overflow:visible;}.dijitSliderRemainingBar {overflow:hidden; background-color:transparent; z-index:1;}.dijitSliderRemainingBarV {height:100%; text-align:left;}.dijitSliderRemainingBarH {width:100% !important;}.dijitSliderBumper {overflow:hidden; z-index:1;}.dijitSliderBumperV {width:4px; height:8px; border-width:0 1px;}.dijitSliderBumperH {width:8px; height:4px; border-width:1px 0;}.dijitSliderBottomBumper,.dijitSliderLeftBumper {background-color:red;}.dijitSliderTopBumper,.dijitSliderRightBumper {background-color:transparent;}.dijitSliderDecoration {text-align:center;}.dijitSliderDecorationC,.dijitSliderDecorationV {position: relative;}.dijitSliderDecorationH {width: 100%;}.dijitSliderDecorationV {height: 100%;}.dijitSliderButton {font-family:monospace; margin:0; padding:0; display:block;}.dj_a11y .dijitSliderButtonInner {visibility:visible !important;}.dijitSliderButtonContainer {text-align:center; height:0;}.dijitSliderButtonContainer * {cursor: pointer;}.dijitSlider .dijitButtonNode {padding:0; display:block;}.dijitRuleContainer {position:relative; overflow:visible;}.dijitRuleContainerV {height:100%; line-height:0; float:left; text-align:left;}.dj_opera .dijitRuleContainerV {line-height:2%;}.dj_ie .dijitRuleContainerV {line-height:normal;}.dj_gecko .dijitRuleContainerV {margin:0 0 1px 0;}.dijitRuleMark {position:absolute; border:1px solid black; line-height:0; height:100%;}.dijitRuleMarkH {width:0; border-top-width:0 !important; border-bottom-width:0 !important; border-left-width:0 !important;}.dijitRuleLabelContainer {position:absolute;}.dijitRuleLabelContainerH {text-align:center; display:inline-block;}.dijitRuleLabelH {position:relative; left:-50%;}.dijitRuleLabelV {text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}.dijitRuleMarkV {height:0; border-right-width:0 !important; border-bottom-width:0 !important; border-left-width:0 !important; width:100%; left:0;}.dj_ie .dijitRuleLabelContainerV {margin-top:-.55em;}.dj_a11y .dijitSliderReadOnly,.dj_a11y .dijitSliderDisabled {opacity:0.6;}.dj_ie .dj_a11y .dijitSliderReadOnly .dijitSliderBar,.dj_ie .dj_a11y .dijitSliderDisabled .dijitSliderBar {filter: alpha(opacity=40);}.dj_a11y .dijitSlider .dijitSliderButtonContainer div {font-family: monospace; font-size: 1em; line-height: 1em; height: auto; width: auto; margin: 0 4px;}.dj_a11y .dijitButtonContents .dijitButtonText,.dj_a11y .dijitTab .tabLabel {display: inline !important;}.dj_a11y .dijitSelect .dijitButtonText {display: inline-block !important;}.dijitSelectError .dijitButtonContents .dijitButtonText {display: none !important;}.dijitTextArea {width:100%; overflow-y: auto;}.dijitTextArea[cols] {width:auto;}.dj_ie .dijitTextAreaCols {width:auto;}.dijitExpandingTextArea {resize: none;}.dijitToolbarSeparator {height: 18px; width: 5px; padding: 0 1px; margin: 0;}.dijitIEFixedToolbar {position:absolute; top: expression(eval((document.documentElement||document.body).scrollTop));}.dijitEditor {display: block;}.dijitEditorDisabled,.dijitEditorReadOnly {color: gray;}.dijitTimePickerItemInner {text-align:center; border:0; padding:2px 8px 2px 8px;}.dijitTimePickerTick,.dijitTimePickerMarker {border-bottom:1px solid gray;}.dijitTimePicker .dijitDownArrowButton {border-top: none !important;}.dijitTimePickerTick {color:#CCC;}.dijitTimePickerMarker {color:black; background-color:#CCC;}.dijitTimePickerItemSelected {font-weight:bold; color:#333; background-color:#b7cdee;}.dijitTimePickerItemHover {background-color:gray; color:white; cursor:pointer;}.dijitTimePickerItemDisabled {color:gray; text-decoration:line-through;}.dj_a11y .dijitTimePickerItemSelected .dijitTimePickerItemInner {border: solid 4px black;}.dj_a11y .dijitTimePickerItemHover .dijitTimePickerItemInner {border: dashed 4px black;}.dijitToggleButtonIconChar {display:none !important;}.dj_a11y .dijitToggleButton .dijitToggleButtonIconChar {display:inline !important; visibility:hidden;}.dj_ie6 .dijitToggleButtonIconChar, .dj_ie6 .tabStripButton .dijitButtonText {font-family: "Arial Unicode MS";}.dj_a11y .dijitToggleButtonChecked .dijitToggleButtonIconChar {display: inline !important; visibility:visible !important;}.dijitArrowButtonChar {display:none !important;}.dj_a11y .dijitArrowButtonChar {display:inline !important;}.dj_a11y .dijitDropDownButton .dijitArrowButtonInner,.dj_a11y .dijitComboButton .dijitArrowButtonInner {display:none !important;}.dj_a11y .dijitSelect {border-collapse: separate !important; border-width: 1px; border-style: solid;}.dj_ie .dijitSelect {vertical-align: middle;}.dj_ie6 .dijitSelect .dijitValidationContainer,.dj_ie8 .dijitSelect .dijitButtonText {vertical-align: top;}.dj_ie6 .dijitTextBox .dijitInputContainer,.dj_iequirks .dijitTextBox .dijitInputContainer,.dj_ie6 .dijitTextBox .dijitArrowButtonInner,.dj_ie6 .dijitSpinner .dijitSpinnerButtonInner,.dijitSelect .dijitSelectLabel {vertical-align: baseline;}.dijitToolbar .dijitSelect {margin: 0;}.dj_webkit .dijitToolbar .dijitSelect {padding-left: 0.3em;}.dijitSelect .dijitButtonContents {padding: 0; white-space: nowrap; text-align: left; border-style: none solid none none; border-width: 1px;}.dijitSelectFixedWidth .dijitButtonContents {width: 100%;}.dijitSelectMenu .dijitMenuItemIcon {display:none;}.dj_ie6 .dijitSelectMenu .dijitMenuItemLabel,.dj_ie7 .dijitSelectMenu .dijitMenuItemLabel {position: static;}.dijitSelectLabel *{vertical-align: baseline;}.dijitSelectSelectedOption * {font-weight: bold;}.dijitSelectMenu {border-width: 1px;}.dijitSelectMenu .dijitMenuTable {margin: 0; background-color: transparent;}.dijitForceStatic {position: static !important;}.dijitReadOnly *,.dijitDisabled *,.dijitReadOnly,.dijitDisabled {cursor: default;}.dojoDndItem {padding: 2px; -webkit-touch-callout: none; -webkit-user-select: none;}.dojoDndHorizontal .dojoDndItem {#display: inline; display: inline-block;}.dojoDndItemBefore,.dojoDndItemAfter {border: 0px solid #369;}.dojoDndItemBefore {border-width: 2px 0 0 0; padding: 0 2px 2px 2px;}.dojoDndItemAfter {border-width: 0 0 2px 0; padding: 2px 2px 0 2px;}.dojoDndHorizontal .dojoDndItemBefore {border-width: 0 0 0 2px; padding: 2px 2px 2px 0;}.dojoDndHorizontal .dojoDndItemAfter {border-width: 0 2px 0 0; padding: 2px 0 2px 2px;}.dojoDndItemOver {cursor:pointer;}.dj_gecko .dijitArrowButtonInner INPUT,.dj_gecko INPUT.dijitArrowButtonInner {-moz-user-focus:ignore;}.dijitIconSave,.dijitIconPrint,.dijitIconCut,.dijitIconCopy,.dijitIconClear,.dijitIconDelete,.dijitIconUndo,.dijitIconEdit,.dijitIconNewTask,.dijitIconEditTask,.dijitIconEditProperty,.dijitIconTask,.dijitIconFilter,.dijitIconConfigure,.dijitIconSearch,.dijitIconApplication,.dijitIconBookmark,.dijitIconChart,.dijitIconConnector,.dijitIconDatabase,.dijitIconDocuments,.dijitIconMail,.dijitLeaf,.dijitIconFile,.dijitIconFunction,.dijitIconKey,.dijitIconPackage,.dijitIconSample,.dijitIconTable,.dijitIconUsers,.dijitFolderClosed,.dijitIconFolderClosed,.dijitFolderOpened,.dijitIconFolderOpen,.dijitIconError {background-image: url("../../dijit/icons/images/commonIconsObjActEnabled.png"); width: 16px; height: 16px;}.dj_ie6 .dijitIconSave,.dj_ie6 .dijitIconPrint,.dj_ie6 .dijitIconCut,.dj_ie6 .dijitIconCopy,.dj_ie6 .dijitIconClear,.dj_ie6 .dijitIconDelete,.dj_ie6 .dijitIconUndo,.dj_ie6 .dijitIconEdit,.dj_ie6 .dijitIconNewTask,.dj_ie6 .dijitIconEditTask,.dj_ie6 .dijitIconEditProperty,.dj_ie6 .dijitIconTask,.dj_ie6 .dijitIconFilter,.dj_ie6 .dijitIconConfigure,.dj_ie6 .dijitIconSearch,.dj_ie6 .dijitIconApplication,.dj_ie6 .dijitIconBookmark,.dj_ie6 .dijitIconChart,.dj_ie6 .dijitIconConnector,.dj_ie6 .dijitIconDatabase,.dj_ie6 .dijitIconDocuments,.dj_ie6 .dijitIconMail,.dj_ie6 .dijitLeaf,.dj_ie6 .dijitIconFile,.dj_ie6 .dijitIconFunction,.dj_ie6 .dijitIconKey,.dj_ie6 .dijitIconPackage,.dj_ie6 .dijitIconSample,.dj_ie6 .dijitIconTable,.dj_ie6 .dijitIconUsers,.dj_ie6 .dijitFolderClosed,.dj_ie6 .dijitIconFolderClosed,.dj_ie6 .dijitFolderOpened,.dj_ie6 .dijitIconFolderOpen,.dj_ie6 .dijitIconError {background-image: url("../../dijit/icons/images/commonIconsObjActEnabled8bit.png");}.dijitDisabled .dijitIconSave,.dijitDisabled .dijitIconPrint,.dijitDisabled .dijitIconCut,.dijitDisabled .dijitIconCopy,.dijitDisabled .dijitIconClear,.dijitDisabled .dijitIconDelete,.dijitDisabled .dijitIconUndo,.dijitDisabled .dijitIconEdit,.dijitDisabled .dijitIconNewTask,.dijitDisabled .dijitIconEditTask,.dijitDisabled .dijitIconEditProperty,.dijitDisabled .dijitIconTask,.dijitDisabled .dijitIconFilter,.dijitDisabled .dijitIconConfigure,.dijitDisabled .dijitIconSearch,.dijitDisabled .dijitIconApplication,.dijitDisabled .dijitIconBookmark,.dijitDisabled .dijitIconChart,.dijitDisabled .dijitIconConnector,.dijitDisabled .dijitIconDatabase,.dijitDisabled .dijitIconDocuments,.dijitDisabled .dijitIconMail,.dijitDisabled .dijitLeaf,.dijitDisabled .dijitIconFile,.dijitDisabled .dijitIconFunction,.dijitDisabled .dijitIconKey,.dijitDisabled .dijitIconPackage,.dijitDisabled .dijitIconSample,.dijitDisabled .dijitIconTable,.dijitDisabled .dijitIconUsers,.dijitDisabled .dijitFolderClosed,.dijitDisabled .dijitIconFolderClosed,.dijitDisabled .dijitFolderOpened,.dijitDisabled .dijitIconFolderOpen,.dijitDisabled .dijitIconError {background-image: url("../../dijit/icons/images/commonIconsObjActDisabled.png");}.dijitIconSave {background-position: 0;}.dijitIconPrint {background-position: -16px;}.dijitIconCut {background-position: -32px;}.dijitIconCopy {background-position: -48px;}.dijitIconClear {background-position: -64px;}.dijitIconDelete {background-position: -80px;}.dijitIconUndo {background-position: -96px;}.dijitIconEdit {background-position: -112px;}.dijitIconNewTask {background-position: -128px;}.dijitIconEditTask {background-position: -144px;}.dijitIconEditProperty {background-position: -160px;}.dijitIconTask {background-position: -176px;}.dijitIconFilter {background-position: -192px;}.dijitIconConfigure {background-position: -208px;}.dijitIconSearch {background-position: -224px;}.dijitIconError {background-position: -496px;} .dijitIconApplication {background-position: -240px;}.dijitIconBookmark {background-position: -256px;}.dijitIconChart {background-position: -272px;}.dijitIconConnector {background-position: -288px;}.dijitIconDatabase {background-position: -304px;}.dijitIconDocuments {background-position: -320px;}.dijitIconMail {background-position: -336px;}.dijitIconFile, .dijitLeaf {background-position: -352px;}.dijitIconFunction {background-position: -368px;}.dijitIconKey {background-position: -384px;}.dijitIconPackage{background-position: -400px;}.dijitIconSample {background-position: -416px;}.dijitIconTable {background-position: -432px;}.dijitIconUsers {background-position: -448px;}.dijitIconFolderClosed, .dijitFolderClosed {background-position: -464px;}.dijitIconFolderOpen, .dijitFolderOpened {background-position: -480px;}.dijitIconLoading {background:url("../../dijit/icons/images/loadingAnimation_rtl.gif") no-repeat; height: 20px; width: 20px;}.claro .dijitPopup {-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);}.claro .dijitTooltipDialogPopup {-webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}.claro .dijitComboBoxHighlightMatch {background-color: #abd6ff;}.claro .dijitFocusedLabel {outline: 1px dotted #494949;}.claro .dojoDndItem {border-color: rgba(0, 0, 0, 0); -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s; -webkit-transition-property: background-color, border-color; -moz-transition-property: background-color, border-color; transition-property: background-color, border-color;}.claro .dojoDndItemOver {background-color: #abd6ff; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px; border: solid 1px #759dc0; color: #000000;}.claro .dojoDndItemAnchor, .claro .dojoDndItemSelected {background-color: #cfe5fa; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px; border: solid 1px #759dc0; color: #000000;}.claro .dojoDndItemBefore, .claro .dojoDndItemAfter {border-color: #759dc0;}.claro table.dojoDndAvatar {border: 1px solid #b5bcc7; border-collapse: collapse; background-color: #ffffff; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);}.claro .dojoDndAvatarHeader td {height: 20px; padding-left: 21px;}.claro.dojoDndMove .dojoDndAvatarHeader, .claro.dojoDndCopy .dojoDndAvatarHeader {background-image: url("../../dijit/themes/claro/images/dnd.png"); background-repeat: no-repeat; background-position: 2px -122px;}.claro .dojoDndAvatarItem td {padding: 5px;}.claro.dojoDndMove .dojoDndAvatarHeader {background-color: #f58383; background-position: 2px -103px;}.claro.dojoDndCopy .dojoDndAvatarHeader {background-color: #f58383; background-position: 2px -68px;}.claro.dojoDndMove .dojoDndAvatarCanDrop .dojoDndAvatarHeader {background-color: #97e68d; background-position: 2px -33px;}.claro.dojoDndCopy .dojoDndAvatarCanDrop .dojoDndAvatarHeader {background-color: #97e68d; background-position: 2px 2px;}.claro .dijitTextBox, .claro .dijitInputInner {color: #000000;}.claro .dijitValidationTextBoxError .dijitValidationContainer {background-color: #d46464; background-image: url("../../dijit/themes/claro/form/images/error.png"); background-position: top center; border: solid #d46464 0; width: 9px;}.claro .dijitTextBoxError .dijitValidationContainer {border-left-width: 1px;}.claro .dijitValidationTextBoxError .dijitValidationIcon {width: 0; background-color: transparent !important;}.claro .dijitTextArea, .claro .dijitInputField .dijitPlaceHolder {padding: 2px;}.claro .dijitSelect .dijitInputField, .claro .dijitTextBox .dijitInputField {padding: 1px 2px;}.dj_gecko .claro .dijitTextBox .dijitInputInner, .dj_webkit .claro .dijitTextBox .dijitInputInner {padding: 1px;}.claro .dijitSelect,.claro .dijitSelect .dijitButtonContents,.claro .dijitTextBox,.claro .dijitTextBox .dijitButtonNode {border-color: #b5bcc7; -webkit-transition-property: background-color, border; -moz-transition-property: background-color, border; transition-property: background-color, border; -webkit-transition-duration: 0.35s; -moz-transition-duration: 0.35s; transition-duration: 0.35s;}.claro .dijitSelect, .claro .dijitTextBox {background-color: #ffffff;}.claro .dijitSelectHover,.claro .dijitSelectHover .dijitButtonContents,.claro .dijitTextBoxHover,.claro .dijitTextBoxHover .dijitButtonNode {border-color: #759dc0; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s;}.claro .dijitTextBoxHover {background-color: #e5f2fe; background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);}.claro .dijitSelectError,.claro .dijitSelectError .dijitButtonContents,.claro .dijitTextBoxError,.claro .dijitTextBoxError .dijitButtonNode {border-color: #d46464;}.claro .dijitSelectFocused,.claro .dijitSelectFocused .dijitButtonContents,.claro .dijitTextBoxFocused,.claro .dijitTextBoxFocused .dijitButtonNode {border-color: #759dc0; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitTextBoxFocused {background-color: #ffffff; background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);}.claro .dijitTextBoxFocused .dijitInputContainer {background: #ffffff;}.claro .dijitSelectErrorFocused,.claro .dijitSelectErrorFocused .dijitButtonContents,.claro .dijitTextBoxErrorFocused,.claro .dijitTextBoxErrorFocused .dijitButtonNode {border-color: #ce5050;}.claro .dijitSelectDisabled,.claro .dijitSelectDisabled .dijitButtonContents,.claro .dijitTextBoxDisabled,.claro .dijitTextBoxDisabled .dijitButtonNode {border-color: #d3d3d3;}.claro .dijitSelectDisabled, .claro .dijitTextBoxDisabled, .claro .dijitTextBoxDisabled .dijitInputContainer {background-color: #efefef; background-image: none;}.claro .dijitSelectDisabled, .claro .dijitTextBoxDisabled, .claro .dijitTextBoxDisabled .dijitInputInner {color: #818181;}.dj_webkit .claro .dijitDisabled input {color: #757575;}.dj_webkit .claro textarea.dijitTextAreaDisabled {color: #1b1b1b;}.claro .dijitSelect .dijitArrowButtonInner, .claro .dijitComboBox .dijitArrowButtonInner {background-image: url("../../dijit/themes/claro/form/images/commonFormArrows.png"); background-position: -35px 53%; background-repeat: no-repeat; margin: 0; width: 16px;}.claro .dijitComboBox .dijitArrowButtonInner {border: 1px solid #ffffff;}.claro .dijitToolbar .dijitComboBox .dijitArrowButtonInner {border: none;}.claro .dijitToolbar .dijitComboBox .dijitArrowButtonInner {border: none;}.claro .dijitSelectLabel, .claro .dijitTextBox .dijitInputInner, .claro .dijitValidationTextBox .dijitValidationContainer {padding: 1px 0;}.claro .dijitComboBox .dijitButtonNode {background-color: #efefef; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitComboBoxOpenOnClickHover .dijitButtonNode, .claro .dijitComboBox .dijitDownArrowButtonHover {background-color: #abd6ff;}.claro .dijitComboBoxOpenOnClickHover .dijitArrowButtonInner, .claro .dijitComboBox .dijitDownArrowButtonHover .dijitArrowButtonInner {background-position: -70px 53%;}.claro .dijitComboBox .dijitHasDropDownOpen {background-color: #7dbdfa; background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px;}.dj_iequirks .claro .dijitComboBox .dijitHasDropDownOpen {padding: 1px 0;}.claro .dijitComboBox .dijitHasDropDownOpen .dijitArrowButtonInner {background-position: -70px 53%; border: 0 none;}.claro div.dijitComboBoxDisabled .dijitArrowButtonInner {background-position: 0 50%; background-color: #efefef;}.dj_ff3 .claro .dijitInputField input[type="hidden"] {display: none; height: 0; width: 0;}.dj_borderbox .claro .dijitComboBox .dijitHasDropDownOpen .dijitArrowButtonInner {width: 18px;}.dj_borderbox .claro .dijitComboBoxFocused .dijitHasDropDownOpen .dijitArrowButtonInner {width: 16px;}.claro .dijitButtonNode {-webkit-transition-property: background-color; -moz-transition-property: background-color; transition-property: background-color; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s;}.claro .dijitButton .dijitButtonNode,.claro .dijitDropDownButton .dijitButtonNode,.claro .dijitComboButton .dijitButtonNode,.claro .dijitToggleButton .dijitButtonNode {border: 1px solid #759dc0; padding: 2px 4px 4px 4px; color: #000000; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); background-color: #bcd8f4; background-image: url("../../dijit/themes/claro/form/images/buttonEnabled.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); background-image: -webkit-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); background-image: -o-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); background-image: -ms-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); _background-image: none;}.claro .dijitComboButton .dijitArrowButton {border-left-width: 0; padding: 4px 2px 4px 2px;}.claro .dijitArrowButtonInner {width: 15px; height: 15px; margin: 0 auto; background-image: url("../../dijit/themes/claro/form/images/buttonArrows.png"); background-repeat: no-repeat; background-position: -51px 53%;}.claro .dijitLeftArrowButton .dijitArrowButtonInner {background-position: -77px 53%;}.claro .dijitRightArrowButton .dijitArrowButtonInner {background-position: -26px 53%;}.claro .dijitUpArrowButton .dijitArrowButtonInner {background-position: 0 53%;}.claro .dijitDisabled .dijitArrowButtonInner {background-position: -151px 53%;}.claro .dijitDisabled .dijitLeftArrowButton .dijitArrowButtonInner {background-position: -177px 53%;}.claro .dijitDisabled .dijitRightArrowButton .dijitArrowButtonInner {background-position: -126px 53%;}.claro .dijitDisabled .dijitUpArrowButton .dijitArrowButtonInner {background-position: -100px 53%;}.claro .dijitButtonText {padding: 0 0.3em; text-align: center;}.claro .dijitButtonHover .dijitButtonNode,.claro .dijitDropDownButtonHover .dijitButtonNode,.claro .dijitComboButton .dijitButtonNodeHover,.claro .dijitComboButton .dijitDownArrowButtonHover,.claro .dijitToggleButtonHover .dijitButtonNode {background-color: #86bdf2; color: #000000; -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s;}.claro .dijitButtonActive .dijitButtonNode,.claro .dijitDropDownButtonActive .dijitButtonNode,.claro .dijitComboButtonActive .dijitButtonNode,.claro .dijitToggleButtonActive .dijitButtonNode,.claro .dijitToggleButtonChecked .dijitButtonNode {background-color: #86bdf2; -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitButtonDisabled,.claro .dijitDropDownButtonDisabled,.claro .dijitComboButtonDisabled,.claro .dijitToggleButtonDisabled {background-image: none; outline: none;}.claro .dijitButtonDisabled .dijitButtonNode,.claro .dijitDropDownButtonDisabled .dijitButtonNode,.claro .dijitComboButtonDisabled .dijitButtonNode,.claro .dijitToggleButtonDisabled .dijitButtonNode {background-color: #efefef; border: solid 1px #d3d3d3; color: #818181; -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0); -moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0); box-shadow: 0 0 0 rgba(0, 0, 0, 0); background-image: url("../../dijit/themes/claro/form/images/buttonDisabled.png"); background-image: -moz-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); background-image: -webkit-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); background-image: -o-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); background-image: -ms-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); _background-image: none;}.claro .dijitComboButtonDisabled .dijitArrowButton {border-left-width: 0;}.claro table.dijitComboButton {border-collapse: separate;}.claro .dijitComboButton .dijitStretch {-moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px;}.claro .dijitComboButton .dijitArrowButton {-moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;}.claro .dijitToggleButton .dijitCheckBoxIcon {background-image: url("../../dijit/themes/claro/images/checkmarkNoBorder.png");}.dj_ie6 .claro .dijitToggleButton .dijitCheckBoxIcon {background-image: url("../../dijit/themes/claro/images/checkmarkNoBorder.gif");}.claro .dijitCheckBox, .claro .dijitCheckBoxIcon {background-image: url("../../dijit/themes/claro/form/images/checkboxRadioButtonStates.png"); background-repeat: no-repeat; width: 15px; height: 16px; margin: 0 2px 0 0; padding: 0;}.dj_ie6 .claro .dijitCheckBox, .dj_ie6 .claro .dijitCheckBoxIcon {background-image: url("../../dijit/themes/claro/form/images/checkboxAndRadioButtons_IE6.png");}.claro .dijitCheckBox, .claro .dijitToggleButton .dijitCheckBoxIcon {background-position: -15px;}.claro .dijitCheckBoxChecked, .claro .dijitToggleButtonChecked .dijitCheckBoxIcon {background-position: 0;}.claro .dijitCheckBoxDisabled {background-position: -75px;}.claro .dijitCheckBoxCheckedDisabled {background-position: -60px;}.claro .dijitCheckBoxHover {background-position: -45px;}.claro .dijitCheckBoxCheckedHover {background-position: -30px;}.claro .dijitToggleButton .dijitRadio, .claro .dijitToggleButton .dijitRadioIcon {background-image: url("../../dijit/themes/claro/form/images/checkboxRadioButtonStates.png");}.dj_ie6 .claro .dijitToggleButton .dijitRadio, .dj_ie6 .claro .dijitToggleButton .dijitRadioIcon {background-image: url("../../dijit/themes/claro/form/images/checkboxAndRadioButtons_IE6.png");}.claro .dijitRadio, .claro .dijitRadioIcon {background-image: url("../../dijit/themes/claro/form/images/checkboxRadioButtonStates.png"); background-repeat: no-repeat; width: 15px; height: 15px; margin: 0 2px 0 0; padding: 0;}.dj_ie6 .claro .dijitRadio, .dj_ie6 .claro .dijitRadioIcon {background-image: url("../../dijit/themes/claro/form/images/checkboxAndRadioButtons_IE6.png");}.claro .dijitRadio {background-position: -105px;}.claro .dijitToggleButton .dijitRadioIcon {background-position: -107px;}.claro .dijitRadioDisabled {background-position: -165px;}.claro .dijitRadioHover {background-position: -135px;}.claro .dijitRadioChecked {background-position: -90px;}.claro .dijitToggleButtonChecked .dijitRadioIcon {background-position: -92px;}.claro .dijitRadioCheckedHover {background-position: -120px;}.claro .dijitRadioCheckedDisabled {background-position: -150px;}.claro .dijitSelect .dijitArrowButtonContainer {border: 1px solid #ffffff;}.claro .dijitSelect .dijitArrowButton {padding: 0; background-color: #efefef; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitSelect .dijitArrowButton .dijitArrowButtonInner {height: 16px;}.claro .dijitSelectHover {background-color: #e5f2fe; background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-repeat: repeat-x;}.claro .dijitSelectFocused, .claro .dijitSelectHover {border-color: #759dc0;}.claro .dijitSelectHover .dijitArrowButton {background-color: #abd6ff;}.claro .dijitSelectHover .dijitArrowButton .dijitArrowButtonInner {background-position: -70px 53%;}.claro .dijitSelectFocused .dijitArrowButton {background-color: #7dbefa; background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitSelectFocused .dijitArrowButton {border: none; padding: 1px;}.claro .dijitSelectFocused .dijitArrowButton .dijitArrowButtonInner {background-position: -70px 53%;}.claro .dijitSelectDisabled {border-color: #d3d3d3; background-color: #efefef; background-image: none; color: #818181;}.claro .dijitSelectDisabled .dijitArrowButton .dijitArrowButtonInner {background-position: 0 53%;}.claro .dijitSelectMenu td.dijitMenuItemIconCell, .claro .dijitSelectMenu td.dijitMenuArrowCell {display: none;}.claro .dijitSelectMenu td.dijitMenuItemLabel {padding: 2px;}.claro .dijitSelectMenu .dijitMenuSeparatorTop {border-bottom: 1px solid #759dc0;}.claro .dijitTabPaneWrapper {background: #ffffff;}.claro .dijitTabPaneWrapper,.claro .dijitTabContainerTop-tabs,.claro .dijitTabContainerBottom-tabs,.claro .dijitTabContainerLeft-tabs,.claro .dijitTabContainerRight-tabs {border-color: #b5bcc7;}.claro .dijitTabCloseButton {background: url("../../dijit/themes/claro/layout/images/tabClose.png") no-repeat; width: 14px; height: 14px; margin-left: 5px; margin-right: -5px;}.claro .dijitTabCloseButtonHover {background-position: -14px;}.claro .dijitTabCloseButtonActive {background-position: -28px;}.claro .dijitTabSpacer {display: none;}.claro .dijitTab {border: 1px solid #b5bcc7; background-color: #efefef; -webkit-transition-property: background-color, border; -moz-transition-property: background-color, border; transition-property: background-color, border; -webkit-transition-duration: 0.35s; -moz-transition-duration: 0.35s; transition-duration: 0.35s; color: #494949;}.claro .dijitTabHover {border-color: #759dc0; background-color: #abd6ff; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s; color: #000000;}.claro .dijitTabActive {border-color: #759dc0; background-color: #7dbdfa; color: #000000; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitTabChecked {border-color: #b5bcc7; background-color: #cfe5fa; color: #000000;}.claro .dijitTabDisabled {background-color: #d3d3d3;}.claro .tabStripButton {background-color: transparent; border: none;}.claro .dijitTabContainerTop-tabs .dijitTab {top: 1px; margin-right: 1px; padding: 3px 6px; border-bottom-width: 0; min-width: 60px; text-align: center; background-image: url("../../dijit/themes/claro/layout/images/tabTopUnselected.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); -webkit-box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04); -moz-box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04); box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04);}.claro .dijitTabContainerTop-tabs .dijitTabChecked {padding-bottom: 4px; padding-top: 9px; background-image: url("../../dijit/themes/claro/layout/images/tabTopSelected.png"); background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); -webkit-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05);}.claro .dijitTabContainerBottom-tabs .dijitTab {top: -1px; margin-right: 1px; padding: 3px 6px; border-top-width: 0; min-width: 60px; text-align: center; background-image: url("../../dijit/themes/claro/layout/images/tabBottomUnselected.png"); background-repeat: repeat-x; background-position: bottom; background-image: -moz-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);}.claro .dijitTabContainerBottom-tabs .dijitTabChecked {padding-bottom: 9px; padding-top: 4px; background-image: url("../../dijit/themes/claro/layout/images/tabBottomSelected.png"); background-image: -moz-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -webkit-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -o-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -ms-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);}.claro .dijitTabContainerLeft-tabs .dijitTab {left: 1px; margin-bottom: 1px; padding: 3px 8px 4px 4px; background-image: url("../../dijit/themes/claro/layout/images/tabLeftUnselected.png"); background-repeat: repeat-y; background-image: -moz-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%);}.claro .dijitTabContainerLeft-tabs .dijitTabChecked {border-right-width: 0; padding-right: 9px; background-image: url("../../dijit/themes/claro/layout/images/tabLeftSelected.png"); background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -o-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); -webkit-box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05); box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05);}.claro .dijitTabContainerRight-tabs .dijitTab {left: -1px; margin-bottom: 1px; padding: 3px 8px 4px 4px; background-image: url("../../dijit/themes/claro/layout/images/tabRightUnselected.png"); background-repeat: repeat-y; background-position: right; background-image: -moz-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%);}.claro .dijitTabContainerRight-tabs .dijitTabChecked {padding-left: 5px; border-left-width: 0; background-image: url("../../dijit/themes/claro/layout/images/tabRightSelected.png"); background-image: -moz-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -webkit-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -o-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -ms-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); -webkit-box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07); -moz-box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07); box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07);}.claro .dijitTabContainerTop-tabs .dijitTab {-moz-border-radius: 2px 2px 0 0; border-radius: 2px 2px 0 0;}.claro .dijitTabContainerBottom-tabs .dijitTab {-moz-border-radius: 0 0 2px 2px; border-radius: 0 0 2px 2px;}.claro .dijitTabContainerLeft-tabs .dijitTab {-moz-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;}.claro .dijitTabContainerRight-tabs .dijitTab {-moz-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0;}.claro .tabStripButton {background-color: #e5f2fe; border: 1px solid #b5bcc7;}.claro .dijitTabListContainer-top .tabStripButton {padding: 4px 3px; margin-top: 7px; background-image: -moz-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%);}.claro .dijitTabListContainer-bottom .tabStripButton {padding: 4px 3px; margin-bottom: 7px; background-image: -moz-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%);}.claro .tabStripButtonHover {background-color: #abd6ff;}.claro .tabStripButtonActive {background-color: #7dbdfa;}.claro .dijitTabStripIcon {height: 15px; width: 15px; margin: 0 auto; background: url("../../dijit/themes/claro/form/images/buttonArrows.png") no-repeat -75px 50%; background-color: transparent;}.claro .dijitTabStripSlideRightIcon {background-position: -24px 50%;}.claro .dijitTabStripMenuIcon {background-position: -51px 50%;}.claro .dijitTabListContainer-top .tabStripButtonDisabled, .claro .dijitTabListContainer-bottom .tabStripButtonDisabled {background-color: #d3d3d3; border: 1px solid #b5bcc7;}.claro .tabStripButtonDisabled .dijitTabStripSlideLeftIcon {background-position: -175px 50%;}.claro .tabStripButtonDisabled .dijitTabStripSlideRightIcon {background-position: -124px 50%;}.claro .tabStripButtonDisabled .dijitTabStripMenuIcon {background-position: -151px 50%;}.claro .dijitTabContainerNested .dijitTabListWrapper {height: auto;}.claro .dijitTabContainerNested .dijitTabContainerTop-tabs {border-bottom: solid 1px #b5bcc7; padding: 2px 2px 4px;}.claro .dijitTabContainerTabListNested .dijitTab {background: rgba(255, 255, 255, 0) none repeat scroll 0 0; border: none; padding: 4px; border-color: rgba(118, 157, 192, 0); -webkit-transition-property: background-color, border-color; -moz-transition-property: background-color, border-color; transition-property: background-color, border-color; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s; -moz-border-radius: 2px; border-radius: 2px;}.claro .dijitTabContainerTabListNested .dijitTab {background: none; border: none; top: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}.claro .dijitTabContainerTabListNested .dijitTabHover {background-color: #e5f2fe; border: solid 1px #cfe5fa; padding: 3px; -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s;}.claro .dijitTabContainerTabListNested .dijitTabHover .tabLabel {text-decoration: none;}.claro .dijitTabContainerTabListNested .dijitTabActive {border: solid 1px #759dc0; padding: 3px; background: #abd6ff url("../../dijit/themes/claro/layout/images/tabNested.png") repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitTabContainerTabListNested .dijitTabChecked {padding: 3px; border: solid 1px #759dc0; background-color: #cfe5fa;}.claro .dijitTabContainerTabListNested .dijitTabChecked .tabLabel {text-decoration: none; background-image: none;}.claro .dijitTabPaneWrapperNested {border: none;}.claro .dijitTab, .claro .tabStripButton {_background-image: none !important;}.claro .dijitDialog {border: 1px solid #759dc0; -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);}.claro .dijitDialogPaneContent {background: #ffffff repeat-x top left; border-top: 1px solid #759dc0; padding: 10px 8px; position: relative;}.claro .dijitDialogPaneContentArea {margin: -10px -8px; padding: 10px 8px;}.claro .dijitDialogPaneActionBar {background-color: #efefef; padding: 3px 5px 2px 7px; text-align: right; border-top: 1px solid #d3d3d3; margin: 10px -8px -10px;}.claro .dijitTooltipDialog .dijitDialogPaneActionBar {-webkit-border-bottom-right-radius: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -moz-border-radius-bottomleft: 4px; margin: 10px -10px -8px;}.claro .dijitDialogPaneActionBar .dijitButton {float: none;}.claro .dijitDialogTitleBar {border: 1px solid #ffffff; border-top: none; background-color: #abd6ff; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 5px 7px 4px 7px;}.claro .dijitDialogTitle {padding: 0 1px; font-size: 1.091em; color: #000000;}.claro .dijitDialogCloseIcon {background: url("../../dijit/themes/claro/images/dialogCloseIcon.png"); background-repeat: no-repeat; position: absolute; right: 5px; height: 15px; width: 21px;}.dj_ie6 .claro .dijitDialogCloseIcon {background-image: url("../../dijit/themes/claro/images/dialogCloseIcon8bit.png");}.claro .dijitDialogCloseIconHover {background-position: -21px;}.claro .dijitDialogCloseIconActive {background-position: -42px;}.claro .dijitTooltip, .claro .dijitTooltipDialog {background: transparent;}.dijitTooltipBelow {padding-top: 13px; padding-left: 3px; padding-right: 3px;}.dijitTooltipAbove {padding-bottom: 13px; padding-left: 3px; padding-right: 3px;}.claro .dijitTooltipContainer {background-color: #ffffff; background-image: -moz-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #ffffff 10px); background-image: -webkit-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #ffffff 10px); background-image: -o-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #ffffff 10px); background-image: -ms-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #ffffff 10px); background-position: bottom; border: 1px solid #759dc0; padding: 6px 8px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); font-size: 1em; color: #000000;}.claro .dijitTooltipConnector {border: 0; z-index: 2; background-image: url("../../dijit/themes/claro/images/tooltip.png"); background-repeat: no-repeat; width: 16px; height: 14px;}.dj_ie6 .claro .dijitTooltipConnector {background-image: url("../../dijit/themes/claro/images/tooltip8bit.png");}.claro .dijitTooltipABRight .dijitTooltipConnector {left: auto !important; right: 3px;}.claro .dijitTooltipBelow .dijitTooltipConnector {top: 0; left: 3px; background-position: -31px 0; width: 16px; height: 14px;}.claro .dijitTooltipAbove .dijitTooltipConnector {bottom: 0; left: 3px; background-position: -15px 0; width: 16px; height: 14px;}.dj_ie7 .claro .dijitTooltipAbove .dijitTooltipConnector, .dj_ie6 .claro .dijitTooltipAbove .dijitTooltipConnector {bottom: -1px;}.claro .dijitTooltipLeft {padding-right: 14px;}.claro .dijitTooltipLeft .dijitTooltipConnector {right: 0; background-position: 0 0; width: 16px; height: 14px;}.claro .dijitTooltipRight {padding-left: 14px;}.claro .dijitTooltipRight .dijitTooltipConnector {left: 0; background-position: -48px 0; width: 16px; height: 14px;}.claro .dijitDialogUnderlay {background: #ffffff;}.claro .dijitAccordionContainer {border: none;}.claro .dijitAccordionInnerContainer {background-color: #efefef; border: solid 1px #b5bcc7; margin-bottom: 1px; -webkit-transition-property: background-color, border; -moz-transition-property: background-color, border; transition-property: background-color, border; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s; -webkit-transition-timing-function: linear; -moz-transition-timing-function: linear; transition-timing-function: linear;}.claro .dijitAccordionTitle {background-color: transparent; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 5px 7px 2px 7px; min-height: 17px; color: #494949;}.claro .dijitAccordionContainer .dijitAccordionChildWrapper {background-color: #ffffff; border: 1px solid #759dc0; margin: 0 2px 2px;}.claro .dijitAccordionContainer .dijitAccordionContainer-child {padding: 9px;}.claro .dijitAccordionInnerContainerActive {border: 1px solid #759dc0; background-color: #7dbdfa; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitAccordionInnerContainerActive .dijitAccordionTitle {background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none; color: #000000;}.claro .dijitAccordionInnerContainerSelected {border-color: #759dc0; background-color: #cfe5fa;}.claro .dijitAccordionInnerContainerSelected .dijitAccordionTitle {color: #000000; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitAccordionInnerContainerHover .dijitAccordionTitle {color: #000000;}.claro .dijitAccordionInnerContainerHover, .claro .dijitAccordionInnerContainerSelectedActive {border: 1px solid #759dc0; background-color: #abd6ff; -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s;}.claro .dijitAccordionInnerContainerSelectedHover .dijitAccordionChildWrapper, .claro .dijitAccordionInnerContainerSelectedActive .dijitAccordionChildWrapper {background-color: #ffffff; border: 1px solid #759dc0; -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25); -moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25);}.claro .dijitContentPane {padding: 8px;}.claro .dijitTabContainerTop-dijitContentPane,.claro .dijitTabContainerLeft-dijitContentPane,.claro .dijitTabContainerBottom-dijitContentPane,.claro .dijitTabContainerRight-dijitContentPane,.claro .dijitAccordionContainer-dijitContentPane {background-color: #ffffff; padding: 8px;}.claro .dijitSplitContainer-dijitContentPane, .claro .dijitBorderContainer-dijitContentPane {background-color: #ffffff; padding: 8px;}.claro .dijitCalendar {border: solid 1px #b5bcc7; border-collapse: separate; -moz-border-radius: 4px; border-radius: 4px; background-color: #cfe5fa; background-image: url("../../dijit/themes/claro/images/calendar.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); text-align: center; padding: 6px 5px 3px 5px;}.dj_ie6 .claro .dijitCalendar {background-image: none;}.claro .dijitCalendar img {border: none;}.claro .dijitCalendarHover, .claro .dijitCalendar:hover, .claro .dijitCalendarActive {background-color: #abd6ff; border: solid 1px #759dc0;}.claro .dijitCalendarMonthContainer th {text-align: center; padding-bottom: 4px; vertical-align: middle;}.claro .dijitCalendarMonthLabel {color: #000000; font-size: 1.091em; padding: 0 4px;}.claro .dijitCalendarIncrementControl {width: 18px; height: 16px; background-image: url("../../dijit/themes/claro/images/calendarArrows.png"); background-repeat: no-repeat;}.dj_ie6 .claro .dijitCalendarIncrementControl {background-image: url("../../dijit/themes/claro/images/calendarArrows8bit.png");}.claro .dijitCalendarIncrease {background-position: -18px 0;}.claro .dijitCalendarArrowHover .dijitCalendarDecrease, .claro .dijitCalendarArrow:hover .dijitCalendarDecrease {background-position: -36px 0;}.claro .dijitCalendarArrowHover .dijitCalendarIncrease, .claro .dijitCalendarArrow:hover .dijitCalendarIncrease {background-position: -55px 0;}.claro .dijitCalendarArrowActive .dijitCalendarDecrease, .claro .dijitCalendarArrow:active .dijitCalendarDecrease {background-position: -72px 0;}.claro .dijitCalendarArrowActive .dijitCalendarIncrease, .claro .dijitCalendarArrow:active .dijitCalendarIncrease {background-position: -91px 0;}.claro .dijitA11ySideArrow {display: none;}.claro .dijitCalendarDayLabelTemplate {padding-bottom: 0; text-align: center; border-bottom: 1px solid #b5bcc7; padding: 0 3px 2px;}.claro .dijitCalendarDayLabel {padding: 0 4px 0 4px; font-weight: bold; font-size: 0.909em; text-align: center; color: #000000;}.claro .dijitCalendarDateTemplate {text-align: center; background-color: #ffffff; border-bottom: 1px solid #d3d3d3; padding-top: 0; font-size: 0.909em; font-family: Arial; font-weight: bold; letter-spacing: .05em; text-align: center; color: #000000;}.dj_ie6 .claro .dijitCalendarDateTemplate {background-image: none;}.claro .dijitCalendarPreviousMonth, .claro .dijitCalendarNextMonth {background-color: #e5f2fe; background-image: none; border-bottom: solid 1px #d3d3d3;}.claro .dijitCalendarDateTemplate .dijitCalendarDateLabel {text-decoration: none; display: block; padding: 3px 5px 3px 4px; border: solid 1px #ffffff; background-color: rgba(171, 212, 251, 0); -webkit-transition-property: background-color, border; -moz-transition-property: background-color, border; transition-property: background-color, border; -webkit-transition-duration: 0.35s; -moz-transition-duration: 0.35s; transition-duration: 0.35s;}.claro .dijitCalendarPreviousMonth .dijitCalendarDateLabel, .claro .dijitCalendarNextMonth .dijitCalendarDateLabel {color: #759dc0; border-color: #e5f2fe;}.claro .dijitCalendarYearContainer {vertical-align: middle;}.claro .dijitCalendarYearControl {padding: 1px 2px 2px 2px;}.claro .dijitCalendarYearLabel {padding: 2px 0 0 0; margin: 0; font-size: 1.17em;}.claro .dijitCalendarYearLabel span {vertical-align: middle;}.claro .dijitCalendarSelectedYear {padding: 0 3px;}.claro .dijitCalendarNextYear, .claro .dijitCalendarPreviousYear {padding: 1px 6px 1px 6px; font-size: 0.909em;}.claro .dijitCalendarSelectedYear {font-size: 1.091em; color: #000000;}.claro .dijitCalendarHoveredDate .dijitCalendarDateLabel, .claro .dijitCalendarEnabledDate:hover .dijitCalendarDateLabel {background-color: #abd6ff; border: solid 1px #759dc0; color: #000000; -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s;}.claro .dijitCalendarNextYearHover,.claro .dijitCalendarNextYear:hover,.claro .dijitCalendarPreviousYearHover,.claro .dijitCalendarPreviousYear:hover {color: #000000; border: solid 1px #ffffff; padding: 0 5px 0 5px; background-color: #e5f2fe;}.claro .dijitCalendarNextYearActive, .claro .dijitCalendarNextYear:active.claro .dijitCalendarPreviousYearActive, .claro .dijitCalendarPreviousYear:active {border: solid 1px #759dc0; padding: 0 5px 0 5px; background-color: #7dbdfa;}.claro .dijitCalendarActiveDate .dijitCalendarDateLabel, .claro .dijitCalendarEnabledDate:active .dijitCalendarDateLabel {background-color: #7dbdfa; border: solid 1px #ffffff; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.dj_ie6 .claro .dijitCalendarActiveDate .dijitCalendarDateLabel {background-image: none;}.claro .dijitCalendarSelectedDate .dijitCalendarDateLabel {color: #000000; background-color: #abd6ff; border-color: #759dc0;}.claro .dijitCalendarDisabledDate .dijitCalendarDateLabel {color: #818181; text-decoration: line-through;}.claro .dijitCalendar .dijitDropDownButton {margin: 0;}.claro .dijitCalendar .dijitButtonText {padding: 1px 0 3px; margin-right: -4px;}.claro .dijitCalendar .dijitDropDownButton .dijitButtonNode {padding: 0 3px 0 2px; border: solid 1px #b5bcc7; -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0); -moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0); box-shadow: 0 0 0 rgba(0, 0, 0, 0); background-color: transparent; background-image: none;}.claro .dijitCalendar .dijitDropDownButtonHover .dijitButtonNode, .claro .dijitCalendar .dijitDropDownButton:hover .dijitButtonNode {background-color: #e5f2fe; border: solid 1px #ffffff;}.claro .dijitCalendarMonthMenu {border-color: #759dc0; background-color: #ffffff; text-align: center; background-image: none;}.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel {border-top: solid 1px #ffffff; border-bottom: solid 1px #ffffff; padding: 2px 0;}.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover, .claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel:hover {border-color: #759dc0; border-width: 1px 0; background-color: #abd6ff; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr= #ffffff , endColorstr= #abd6ff );}.claro .dijitMenuBar {border: 1px solid #b5bcc7; margin: 0; padding: 0; background-color: #efefef; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitMenu {background-color: #ffffff; border: 1px solid #759dc0; margin: -1px 0;}.dj_ie6 .claro .dijitMenu {margin: 0;}.claro .dijitMenuItem {color: #000000;}.claro .dijitMenuBar .dijitMenuItem {padding: 6px 10px 7px; margin: -1px;}.claro .dijitMenuBar .dijitMenuItemHover, .claro .dijitMenuBar .dijitMenuItemSelected {border: solid 1px #759dc0; padding: 5px 9px 6px;}.claro .dijitMenuTable {border-collapse: separate; border-spacing: 0 0; padding: 0;}.claro .dijitMenuItem td {padding: 1px;}.claro .dijitSelectMenu .dijitMenuItemHover td,.claro .dijitSelectMenu .dijitMenuItemSelected td,.claro .dijitMenuItemHover,.claro .dijitMenuItemSelected {background-color: #abd6ff; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitMenuItemActive {background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.dj_ie .claro .dijitMenuActive .dijitMenuItemHover,.dj_ie .claro .dijitMenuActive .dijitMenuItemSelected,.dj_ie .claro .dijitMenuPassive .dijitMenuItemHover,.dj_ie .claro .dijitMenuPassive .dijitMenuItemSelected {padding-top: 6px; padding-bottom: 5px; margin-top: -3px;}.claro td.dijitMenuItemIconCell {padding: 2px; margin: 0 0 0 4px;}.claro td.dijitMenuItemLabel {padding-top: 5px; padding-bottom: 5px;}.claro .dijitMenuExpand {width: 7px; height: 7px; background-image: url("../../dijit/themes/claro/images/spriteArrows.png"); background-position: -14px 0; margin-right: 3px;}.claro .dijitMenuItemDisabled .dijitMenuItemIconCell {opacity: 1;}.claro .dijitMenuSeparatorTop {height: auto; margin-top: 1px; border-bottom: 1px solid #b5bcc7;}.claro .dijitMenuSeparatorBottom {height: auto; margin-bottom: 1px;}.claro .dijitCheckedMenuItemIconChar {display: none;}.claro .dijitCheckedMenuItemIcon {background-image: url("../../dijit/themes/claro/form/images/checkboxRadioButtonStates.png"); background-repeat: no-repeat; background-position: -15px 50%; width: 15px; height: 16px;}.dj_ie6 .claro .dijitCheckedMenuItemIcon {background-image: url("../../dijit/themes/claro/form/images/checkboxAndRadioButtons_IE6.png");}.claro .dijitCheckedMenuItemChecked .dijitCheckedMenuItemIcon {background-position: 0 50%;}.claro .dijitComboBoxMenu {margin-left: 0; background-image: none;}.claro .dijitSelectMenu .dijitMenuItem td, .claro .dijitComboBoxMenu .dijitMenuItem {padding: 2px; border-width: 1px 0 1px 0; border-style: solid; border-color: #ffffff;}.claro .dijitSelectMenu .dijitMenuItemSelected td, .claro .dijitComboBoxMenu .dijitMenuItemSelected {color: #000000; border-color: #759dc0; background-color: #abd6ff;}.claro .dijitSelectMenu .dijitMenuItemHover td, .claro .dijitComboBoxMenu .dijitMenuItemHover {color: #000000; border-color: #769dc0; background-color: #abd6ff;}.claro .dijitComboBoxMenuActive .dijitMenuItemSelected {background-color: #7dbdfa;}.claro .dijitMenuPreviousButton, .claro .dijitMenuNextButton {font-style: italic;}.claro .dijitSliderBar {border-style: solid; outline: 1px;}.claro .dijitSliderFocused .dijitSliderBar {border-color: #759dc0;}.claro .dijitSliderHover .dijitSliderBar {border-color: #759dc0;}.claro .dijitSliderDisabled .dijitSliderBar {background-image: none; border-color: #d3d3d3;}.claro .dijitRuleLabelsContainer {color: #000000;}.claro .dijitRuleLabelsContainerH {padding: 2px 0;}.claro .dijitSlider .dijitSliderProgressBarH, .claro .dijitSlider .dijitSliderLeftBumper {border-color: #b5bcc7; background-color: #cfe5fa; background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px);}.claro .dijitSlider .dijitSliderRemainingBarH, .claro .dijitSlider .dijitSliderRightBumper {border-color: #b5bcc7; background-color: #ffffff;}.claro .dijitSliderRightBumper {border-right: solid 1px #b5bcc7;}.claro .dijitSliderLeftBumper {border-left: solid 1px #b5bcc7;}.claro .dijitSliderHover .dijitSliderProgressBarH, .claro .dijitSliderHover .dijitSliderLeftBumper {background-color: #abd6ff; border-color: #759dc0;}.claro .dijitSliderHover .dijitSliderRemainingBarH, .claro .dijitSliderHover .dijitSliderRightBumper {background-color: #ffffff; border-color: #759dc0;}.claro .dijitSliderFocused .dijitSliderProgressBarH, .claro .dijitSliderFocused .dijitSliderLeftBumper {background-color: #abd6ff; border-color: #759dc0; -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2);}.claro .dijitSliderFocused .dijitSliderRemainingBarH, .claro .dijitSliderFocused .dijitSliderRightBumper {background-color: #ffffff; border-color: #759dc0; -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2);}.claro .dijitSliderDisabled .dijitSliderProgressBarH, .claro .dijitSliderDisabled .dijitSliderLeftBumper {background-color: #d3d3d3; background-image: none;}.claro .dijitSliderDisabled .dijitSliderRemainingBarH, .claro .dijitSliderDisabled .dijitSliderRightBumper {background-color: #efefef;}.claro .dijitRuleLabelsContainerV {padding: 0 2px;}.claro .dijitSlider .dijitSliderProgressBarV, .claro .dijitSlider .dijitSliderBottomBumper {border-color: #b5bcc7; background-color: #cfe5fa; background-image: -moz-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); background-image: -webkit-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); background-image: -o-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); background-image: -ms-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px);}.claro .dijitSlider .dijitSliderRemainingBarV, .claro .dijitSlider .dijitSliderTopBumper {border-color: #b5bcc7; background-color: #ffffff;}.claro .dijitSliderBottomBumper {border-bottom: solid 1px #b5bcc7;}.claro .dijitSliderTopBumper {border-top: solid 1px #b5bcc7;}.claro .dijitSliderHover .dijitSliderProgressBarV, .claro .dijitSliderHover .dijitSliderBottomBumper {background-color: #abd6ff; border-color: #759dc0;}.claro .dijitSliderHover .dijitSliderRemainingBarV, .claro .dijitSliderHover .dijitSliderTopBumper {background-color: #ffffff; border-color: #759dc0;}.claro .dijitSliderFocused .dijitSliderProgressBarV, .claro .dijitSliderFocused .dijitSliderBottomBumper {background-color: #abd6ff; border-color: #759dc0; -webkit-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2);}.claro .dijitSliderFocused .dijitSliderRemainingBarV, .claro .dijitSliderFocused .dijitSliderTopBumper {background-color: #ffffff; border-color: #759dc0; -webkit-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2);}.claro .dijitSliderDisabled .dijitSliderProgressBarV, .claro .dijitSliderDisabled .dijitSliderBottomBumper {background-color: #d3d3d3;}.claro .dijitSliderDisabled .dijitSliderRemainingBarV, .claro .dijitSliderDisabled .dijitSliderTopBumper {background-color: #efefef;}.claro .dijitSliderImageHandleH {border: 0; width: 18px; height: 16px; background-image: url("../../dijit/themes/claro/form/images/sliderThumbs.png"); background-repeat: no-repeat; background-position: 0 0;}.claro .dijitSliderHover .dijitSliderImageHandleH {background-position: -18px 0;}.claro .dijitSliderFocused .dijitSliderImageHandleH {background-position: -36px 0;}.claro .dijitSliderProgressBarH .dijitSliderThumbHover {background-position: -36px 0;}.claro .dijitSliderProgressBarH .dijitSliderThumbActive {background-position: -36px 0;}.claro .dijitSliderReadOnly .dijitSliderImageHandleH, .claro .dijitSliderDisabled .dijitSliderImageHandleH {background-position: -54px 0;}.claro .dijitSliderImageHandleV {border: 0; width: 18px; height: 16px; background-image: url("../../dijit/themes/claro/form/images/sliderThumbs.png"); background-repeat: no-repeat; background-position: -289px 0;}.claro .dijitSliderHover .dijitSliderImageHandleV {background-position: -307px 0;}.claro .dijitSliderFocused .dijitSliderImageHandleV {background-position: -325px 0;}.claro .dijitSliderProgressBarV .dijitSliderThumbHover {background-position: -325px 0;}.claro .dijitSliderProgressBarV .dijitSliderThumbActive {background-position: -325px 0;}.claro .dijitSliderReadOnly .dijitSliderImageHandleV, .claro .dijitSliderDisabled .dijitSliderImageHandleV {background-position: -343px 0;}.claro .dijitSliderButtonContainerH {padding: 1px 3px 1px 2px;}.claro .dijitSliderButtonContainerV {padding: 3px 1px 2px 1px;}.claro .dijitSliderDecrementIconH,.claro .dijitSliderIncrementIconH,.claro .dijitSliderDecrementIconV,.claro .dijitSliderIncrementIconV {background-image: url("../../dijit/themes/claro/form/images/commonFormArrows.png"); background-repeat: no-repeat; background-color: #efefef; -moz-border-radius: 2px; border-radius: 2px; border: solid 1px #b5bcc7; font-size: 1px;}.claro .dijitSliderDecrementIconH, .claro .dijitSliderIncrementIconH {height: 12px; width: 9px;}.claro .dijitSliderDecrementIconV, .claro .dijitSliderIncrementIconV {height: 9px; width: 12px;}.claro .dijitSliderActive .dijitSliderDecrementIconH,.claro .dijitSliderActive .dijitSliderIncrementIconH,.claro .dijitSliderActive .dijitSliderDecrementIconV,.claro .dijitSliderActive .dijitSliderIncrementIconV,.claro .dijitSliderHover .dijitSliderDecrementIconH,.claro .dijitSliderHover .dijitSliderIncrementIconH,.claro .dijitSliderHover .dijitSliderDecrementIconV,.claro .dijitSliderHover .dijitSliderIncrementIconV {border: solid 1px #759dc0; background-color: #ffffff;}.claro .dijitSliderDecrementIconH {background-position: -357px 50%;}.claro .dijitSliderActive .dijitSliderDecrementIconH.claro .dijitSliderHover .dijitSliderDecrementIconH {background-position: -393px 50%;}.claro .dijitSliderIncrementIconH {background-position: -251px 50%;}.claro .dijitSliderActive .dijitSliderIncrementIconH.claro .dijitSliderHover .dijitSliderIncrementIconH {background-position: -283px 50%;}.claro .dijitSliderDecrementIconV {background-position: -38px 50%;}.claro .dijitSliderActive .dijitSliderDecrementIconV.claro .dijitSliderHover .dijitSliderDecrementIconV {background-position: -73px 50%;}.claro .dijitSliderIncrementIconV {background-position: -143px 49%;}.claro .dijitSliderActive .dijitSliderIncrementIconV.claro .dijitSliderHover .dijitSliderIncrementIconV {background-position: -178px 49%;}.claro .dijitSliderButtonContainerV .dijitSliderDecrementButtonHover,.claro .dijitSliderButtonContainerH .dijitSliderDecrementButtonHover,.claro .dijitSliderButtonContainerV .dijitSliderIncrementButtonHover,.claro .dijitSliderButtonContainerH .dijitSliderIncrementButtonHover {background-color: #cfe5fa;}.claro .dijitSliderButtonContainerV .dijitSliderDecrementButtonActive,.claro .dijitSliderButtonContainerH .dijitSliderDecrementButtonActive,.claro .dijitSliderButtonContainerV .dijitSliderIncrementButtonActive,.claro .dijitSliderButtonContainerH .dijitSliderIncrementButtonActive {background-color: #abd6ff; border-color: #759dc0;}.claro .dijitSliderButtonInner {visibility: hidden;}.claro .dijitSliderDisabled .dijitSliderBar {border-color: #d3d3d3;}.claro .dijitSliderReadOnly *, .claro .dijitSliderDisabled * {border-color: #d3d3d3; color: #818181;}.claro .dijitSliderReadOnly .dijitSliderDecrementIconH, .claro .dijitSliderDisabled .dijitSliderDecrementIconH {background-position: -321px 50%; background-color: #efefef;}.claro .dijitSliderReadOnly .dijitSliderIncrementIconH, .claro .dijitSliderDisabled .dijitSliderIncrementIconH {background-position: -215px 50%; background-color: #efefef;}.claro .dijitSliderReadOnly .dijitSliderDecrementIconV, .claro .dijitSliderDisabled .dijitSliderDecrementIconV {background-position: -3px 49%; background-color: #efefef;}.claro .dijitSliderReadOnly .dijitSliderIncrementIconV, .claro .dijitSliderDisabled .dijitSliderIncrementIconV {background-position: -107px 49%; background-color: #efefef;}.claro .dijitColorPalette {border: 1px solid #b5bcc7; background: #ffffff; -moz-border-radius: 0; border-radius: 0;}.claro .dijitColorPalette .dijitPaletteImg {border: 1px solid #d3d3d3;}.claro .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg {border: 1px solid #000000;}.claro .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg, .claro .dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg {border: 2px solid #000000;}.claro .dijitInlineEditBoxDisplayMode {border: 1px solid transparent;}.claro .dijitInlineEditBoxDisplayModeHover {background-color: #e5f2fe; border: solid 1px #759dc0;}.dj_ie6 .claro .dijitInlineEditBoxDisplayMode {border: none;}.claro .dijitProgressBar {margin: 2px 0 2px 0;}.claro .dijitProgressBarEmpty {background-color: #ffffff; border-color: #759dc0;}.claro .dijitProgressBarTile {background-color: #abd6ff; background-image: url("../../dijit/themes/claro/images/progressBarFull.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); background-attachment: scroll;}.dj_ie6 .claro .dijitProgressBarTile {background-image: none;}.claro .dijitProgressBarFull {border-right: 1px solid #759dc0; -webkit-transition-property: width; -moz-transition-property: width; transition-property: width; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s;}.claro .dijitProgressBarLabel {color: #000000;}.claro .dijitProgressBarIndeterminate .dijitProgressBarTile {background: #efefef url("../../dijit/themes/claro/images/progressBarAnim.gif") repeat-x top;}.claro .dijitTimePicker .dijitButtonNode {padding: 0 0; -moz-border-radius: 0; border-radius: 0;}.claro .dijitTimePicker {border: 1px #b5bcc7 solid; border-top: none; border-bottom: none; background-color: #fff;}.claro .dijitTimePickerItem {background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; border-top: solid 1px #b5bcc7; border-bottom: solid 1px #b5bcc7; margin-right: -1px; margin-left: -1px; margin-top: -1px;}.claro .dijitTimePickerTick {color: #818181; background-color: #efefef; font-size: 0.818em;}.claro .dijitTimePickerMarker {background-color: #e5f2fe; font-size: 1em; white-space: nowrap;}.claro .dijitTimePickerTickHover,.claro .dijitTimePickerMarkerHover,.claro .dijitTimePickerMarkerSelected,.claro .dijitTimePickerTickSelected {background-color: #7dbdfa; border: solid 1px #b5bcc7; margin-left: -7px; margin-right: -7px; color: #000000;}.claro .dijitTimePickerMarkerSelected, .claro .dijitTimePickerTickSelected {font-size: 1em;}.dj_ie .claro .dijitTimePickerTickHover,.dj_ie .claro .dijitTimePickerMarkerHover,.dj_ie .claro .dijitTimePickerMarkerSelected,.dj_ie .claro .dijitTimePickerTickSelected {width: 114%;}.dj_ie6 .claro .dijitTimePickerTickHover,.dj_ie6 .claro .dijitTimePickerMarkerHover,.dj_ie6 .claro .dijitTimePickerMarkerSelected,.dj_ie6 .claro .dijitTimePickerTickSelected {position: relative; zoom: 1;}.claro .dijitTimePickerTick .dijitTimePickerItemInner {padding: 1px; margin: 0;}.claro .dijitTimePicker .dijitButtonNode {border-left: none; border-right: none; border-color: #b5bcc7; background-color: #efefef; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitTimePicker .dijitArrowButtonInner {height: 100%; background-image: url("../../dijit/themes/claro/form/images/commonFormArrows.png"); background-repeat: no-repeat; background-position: -140px 45%;}.claro .dijitTimePicker .dijitDownArrowButton .dijitArrowButtonInner {background-position: -35px 45%;}.claro .dijitTimePicker .dijitUpArrowHover, .claro .dijitTimePicker .dijitDownArrowHover {background-color: #abd6ff;}.claro .dijitTimePicker .dijitUpArrowHover .dijitArrowButtonInner {background-position: -175px 45%;}.claro .dijitTimePicker .dijitDownArrowHover .dijitArrowButtonInner {background-position: -70px 45%;}.claro .dijitBorderContainer {padding: 5px;}.claro .dijitSplitContainer-child, .claro .dijitBorderContainer-child {border: 1px #b5bcc7 solid;}.claro .dijitBorderContainer-dijitTabContainerTop,.claro .dijitBorderContainer-dijitTabContainerBottom,.claro .dijitBorderContainer-dijitTabContainerLeft,.claro .dijitBorderContainer-dijitTabContainerRight,.claro .dijitBorderContainer-dijitAccordionContainer {border: none;}.claro .dijitBorderContainer-dijitBorderContainer {border: 0; padding: 0;}.claro .dijitSplitterH, .claro .dijitGutterH {background: none; border: 0; height: 5px;}.claro .dijitSplitterH .dijitSplitterThumb {background: #b5bcc7 none; height: 1px; top: 2px; width: 19px;}.claro .dijitSplitterV, .claro .dijitGutterV {background: none; border: 0; width: 5px; margin: 0;}.claro .dijitSplitterV .dijitSplitterThumb {background: #b5bcc7 none; height: 19px; left: 2px; width: 1px; margin: 0;}.claro .dijitSplitterHHover, .claro .dijitSplitterVHover {font-size: 1px; background-color: #cfe5fa;}.claro .dijitSplitterHHover {background-image: -moz-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -webkit-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -o-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -ms-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%);}.claro .dijitSplitterVHover {background-image: -moz-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -webkit-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -o-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -ms-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%);}.claro .dijitSplitterHHover .dijitSplitterThumb, .claro .dijitSplitterVHover .dijitSplitterThumb {background: #759dc0 none;}.claro .dijitSplitterHActive, .claro .dijitSplitterVActive {font-size: 1px; background-color: #abd6ff; background-image: none;}.claro .dijitTreeNode {zoom: 1;}.claro .dijitTreeIsRoot {background-image: none;}.claro .dijitTreeRow, .claro .dijitTreeNode .dojoDndItemBefore, .claro .dijitTreeNode .dojoDndItemAfter {padding: 4px 0 2px 0; background-color: none; background-color: transparent; background-color: rgba(171, 214, 255, 0); background-position: 0 0; background-repeat: repeat-x; border: solid 0 transparent; color: #000000; -webkit-transition-property: background-color, border-color; -moz-transition-property: background-color, border-color; transition-property: background-color, border-color; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s; -webkit-transition-timing-function: ease-out; -moz-transition-timing-function: ease-out; transition-timing-function: ease-out;}.claro .dijitTreeRowSelected {background-color: #cfe5fa; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 3px 0 1px; border-color: #759dc0; border-width: 1px 0; color: #000000;}.claro .dijitTreeRowHover {background-color: #abd6ff; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 3px 0 1px; border-color: #759dc0; border-width: 1px 0; color: #000000; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s;}.claro .dijitTreeRowActive {background-color: #7dbdfa; background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 3px 0 1px; border-color: #759dc0; border-width: 1px 0; color: #000000;}.claro .dijitTreeRowFocused {background-repeat: repeat;}.claro .dijitTreeExpando {background-image: url("../../dijit/themes/claro/images/treeExpandImages.png"); width: 16px; height: 16px; background-position: -35px 0;}.dj_ie6 .claro .dijitTreeExpando {background-image: url("../../dijit/themes/claro/images/treeExpandImages8bit.png");}.claro .dijitTreeRowHover .dijitTreeExpandoOpened {background-position: -53px 0;}.claro .dijitTreeExpandoClosed {background-position: 1px 0;}.claro .dijitTreeRowHover .dijitTreeExpandoClosed {background-position: -17px 0;}.claro .dijitTreeExpandoLeaf, .dj_ie6 .claro .dijitTreeExpandoLeaf {background-image: none;}.claro .dijitTreeExpandoLoading {background-image: url("../../dijit/themes/claro/images/loadingAnimation.gif");}.claro .dijitTreeNode .dojoDndItemBefore .dijitTreeContent {border-top: 2px solid #759dc0;}.claro .dijitTreeNode .dojoDndItemAfter .dijitTreeContent {border-bottom: 2px solid #759dc0;} .claro .dijitToolbar {border-bottom: 1px solid #b5bcc7; background-color: #efefef; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 2px 0 2px 4px; zoom: 1;}.claro .dijitToolbar label {padding: 0 3px 0 6px;}.claro .dijitToolbar .dijitButton .dijitButtonNode,.claro .dijitToolbar .dijitDropDownButton .dijitButtonNode,.claro .dijitToolbar .dijitComboButton .dijitButtonNode,.claro .dijitToolbar .dijitToggleButton .dijitButtonNode,.claro .dijitToolbar .dijitComboBox .dijitButtonNode {border-width: 0; padding: 2px; -moz-border-radius: 2px; border-radius: 2px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; -webkit-transition-property: background-color; -moz-transition-property: background-color; transition-property: background-color; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s; background-color: rgba(171, 214, 255, 0); background-image: none;}.dj_ie .claro .dijitToolbar .dijitButton .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitDropDownButton .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitComboButton .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitToggleButton .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitComboBox .dijitButtonNode {background-color: transparent;}.dj_ie .claro .dijitToolbar .dijitButtonHover .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitDropDownButtonHover .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitComboButton .dijitButtonNodeHover,.dj_ie .claro .dijitToolbar .dijitComboButton .dijitDownArrowButtonHover,.dj_ie .claro .dijitToolbar .dijitToggleButtonHover .dijitButtonNode {background-color: #abd6ff;}.dj_ie .claro .dijitToolbar .dijitButtonActive .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitDropDownButtonActive .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitComboButtonActive .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitToggleButtonActive .dijitButtonNode {background-color: #abd6ff;}.claro .dijitToolbar .dijitComboButton .dijitStretch {-moz-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;}.claro .dijitToolbar .dijitComboButton .dijitArrowButton {-moz-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0;}.claro .dijitToolbar .dijitComboBox .dijitButtonNode {padding: 0;}.claro .dijitToolbar .dijitButtonHover .dijitButtonNode,.claro .dijitToolbar .dijitDropDownButtonHover .dijitButtonNode,.claro .dijitToolbar .dijitToggleButtonHover .dijitButtonNode,.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNode {border-width: 1px; background-color: #abd6ff; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px;}.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNode, .claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton {background-color: #f3ffff;}.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNodeHover, .claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButtonHover {background-color: #abd6ff;}.claro .dijitToolbar .dijitButtonActive .dijitButtonNode, .claro .dijitToolbar .dijitDropDownButtonActive .dijitButtonNode, .claro .dijitToolbar .dijitToggleButtonActive .dijitButtonNode {border-width: 1px; background-color: #7dbdfa; background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px;}.claro .dijitToolbar .dijitComboButtonActive {-webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s; border-width: 1px; padding: 0;}.claro .dijitToolbar .dijitComboButtonActive .dijitButtonNode, .claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButton {background-color: #f3ffff; padding: 2px;}.claro .dijitToolbar .dijitComboButtonActive .dijitButtonNodeActive {background-color: #7dbdfa; background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButtonActive {background-color: #7dbdfa; background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton, .claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButton {border-left-width: 0;}.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton {padding-left: 2px;}.claro .dijitToolbar .dijitToggleButtonChecked .dijitButtonNode {margin: 0; border-width: 1px; border-style: solid; background-image: none; border-color: #759dc0; background-color: #ffffff; padding: 1px;}.claro .dijitToolbarSeparator {background: url("../../dijit/icons/images/editorIconsEnabled.png");}.claro .dijitDisabled .dijitToolbar {background: none; background-color: #efefef; border-bottom: 1px solid #d3d3d3;}.claro .dijitToolbar .dijitComboBoxDisabled .dijitArrowButtonInner {background-position: 0 50%;}.claro .dijitEditorIFrameContainer {padding: 3px 3px 1px 10px;}.claro .dijitEditorIFrame {background-color: #ffffff;}.claro .dijitEditor {border: 1px solid #b5bcc7;}.claro .dijitEditor .dijitEditorIFrameContainer {background-color: #ffffff; background-repeat: repeat-x;}.claro .dijitEditorHover .dijitEditorIFrameContainer, .claro .dijitEditorHover .dijitEditorIFrameContainer .dijitEditorIFrame {background-color: #e5f2fe;}.claro .dijitEditorFocused .dijitEditorIFrameContainer, .claro .dijitEditorFocused .dijitEditorIFrameContainer .dijitEditorIFrame {background-color: #ffffff;}.claro .dijitEditorHover .dijitEditorIFrameContainer, .claro .dijitEditorFocused .dijitEditorIFrameContainer {background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);}.claro .dijitEditorDisabled {border: 1px solid #d3d3d3; color: #818181;}.claro .dijitDisabled .dijitEditorIFrame, .claro .dijitDisabled .dijitEditorIFrameContainer, .claro .dijitDisabled .dijitEditorIFrameContainer .dijitEditorIFrame {background-color: #efefef; background-image: none;}.dijitEditorIcon {background-image: url("../../dijit/icons/images/editorIconsEnabled.png"); background-repeat: no-repeat; width: 18px; height: 18px; text-align: center;}.dijitDisabled .dijitEditorIcon {background-image: url("../../dijit/icons/images/editorIconsDisabled.png");}.dijitEditorIconSep {background-position: 0;}.dijitEditorIconSave {background-position: -18px;}.dijitEditorIconPrint {background-position: -36px;}.dijitEditorIconCut {background-position: -54px;}.dijitEditorIconCopy {background-position: -72px;}.dijitEditorIconPaste {background-position: -90px;}.dijitEditorIconDelete {background-position: -108px;}.dijitEditorIconCancel {background-position: -126px;}.dijitEditorIconUndo {background-position: -144px;}.dijitEditorIconRedo {background-position: -162px;}.dijitEditorIconSelectAll {background-position: -180px;}.dijitEditorIconBold {background-position: -198px;}.dijitEditorIconItalic {background-position: -216px;}.dijitEditorIconUnderline {background-position: -234px;}.dijitEditorIconStrikethrough {background-position: -252px;}.dijitEditorIconSuperscript {background-position: -270px;}.dijitEditorIconSubscript {background-position: -288px;}.dijitEditorIconJustifyCenter {background-position: -306px;}.dijitEditorIconJustifyFull {background-position: -324px;}.dijitEditorIconJustifyLeft {background-position: -342px;}.dijitEditorIconJustifyRight {background-position: -360px;}.dijitEditorIconIndent {background-position: -378px;}.dijitEditorIconOutdent {background-position: -396px;}.dijitEditorIconListBulletIndent {background-position: -414px;}.dijitEditorIconListBulletOutdent {background-position: -432px;}.dijitEditorIconListNumIndent {background-position: -450px;}.dijitEditorIconListNumOutdent {background-position: -468px;}.dijitEditorIconTabIndent {background-position: -486px;}.dijitEditorIconLeftToRight {background-position: -504px;}.dijitEditorIconRightToLeft, .dijitEditorIconToggleDir {background-position: -522px;}.dijitEditorIconBackColor {background-position: -540px;}.dijitEditorIconForeColor {background-position: -558px;}.dijitEditorIconHiliteColor {background-position: -576px;}.dijitEditorIconNewPage {background-position: -594px;}.dijitEditorIconInsertImage {background-position: -612px;}.dijitEditorIconInsertTable {background-position: -630px;}.dijitEditorIconSpace {background-position: -648px;}.dijitEditorIconInsertHorizontalRule {background-position: -666px;}.dijitEditorIconInsertOrderedList {background-position: -684px;}.dijitEditorIconInsertUnorderedList {background-position: -702px;}.dijitEditorIconCreateLink {background-position: -720px;}.dijitEditorIconUnlink {background-position: -738px;}.dijitEditorIconViewSource {background-position: -756px;}.dijitEditorIconRemoveFormat {background-position: -774px;}.dijitEditorIconFullScreen {background-position: -792px;}.dijitEditorIconWikiword {background-position: -810px;} .claro .dijitTitlePaneTitle {background-color: #efefef; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; border: 1px solid #b5bcc7; padding: 0 7px 3px 7px; min-height: 17px;}.claro .dijitTitlePaneTitleHover {background-color: #abd6ff; border-color: #759dc0;}.claro .dijitTitlePaneTitleActive {background-color: #7dbdfa; border-color: #759dc0; background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitTitlePaneTitleFocus {margin-top: 3px; padding-bottom: 2px;}.claro .dijitTitlePane .dijitArrowNode {background-image: url("../../dijit/themes/claro/images/spriteArrows.png"); background-repeat: no-repeat; height: 8px; width: 7px;}.claro .dijitTitlePane .dijitOpen .dijitArrowNode {background-position: 0 0;}.claro .dijitTitlePane .dijitClosed .dijitArrowNode {background-position: -14px 0;}.claro .dijitTitlePane .dijitTitlePaneTextNode {color: #000000;}.claro .dijitTitlePaneContentOuter {background: #ffffff; border: 1px solid #b5bcc7; border-top: none;}.claro .dijitTitlePaneContentInner {padding: 10px;}.claro .dijitTitlePaneTextNode {margin-left: 4px; margin-right: 4px; vertical-align: text-top;}.claro .dijitSpinnerButtonContainer {overflow: hidden; position: relative; width: auto; padding: 0 2px;}.claro .dijitSpinnerButtonContainer .dijitSpinnerButtonInner {border-width: 1px 0; border-style: solid none;}.claro .dijitSpinner .dijitArrowButton {width: auto; background-color: #efefef; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; overflow: hidden;}.dj_iequirks .claro .dijitSpinner .dijitArrowButton {overflow: visible;}.claro .dijitSpinner .dijitSpinnerButtonInner {width: 15px;}.claro .dijitSpinner .dijitArrowButtonInner {border: solid 1px #ffffff; border-bottom-width: 0; background-image: url("../../dijit/themes/claro/form/images/commonFormArrows.png"); background-repeat: no-repeat; height: 100%; width: 15px; padding-left: 1px; padding-right: 1px; background-position: -139px center; display: block; margin: -1px 0 -1px 0;}.dj_iequirks .claro .dijitSpinner .dijitArrowButtonInner,.dj_ie6 .claro .dijitSpinner .dijitArrowButtonInner,.dj_ie7 .claro .dijitSpinner .dijitArrowButtonInner,.dj_ie8 .claro .dijitSpinner .dijitArrowButtonInner {margin-top: 0;}.dj_iequirks .claro .dijitSpinner .dijitArrowButtonInner {width: 19px;}.claro .dijitSpinner .dijitDownArrowButton .dijitArrowButtonInner {background-position: -34px;}.claro .dijitSpinner .dijitArrowButtonInner .dijitInputField {padding: 0;}.claro .dijitUpArrowButtonActive, .claro .dijitDownArrowButtonActive {background-color: #abd6ff;}.claro .dijitSpinner .dijitUpArrowButtonHover, .claro .dijitSpinner .dijitDownArrowButtonHover, .claro .dijitSpinnerFocused .dijitArrowButton {background-color: #abd6ff;}.claro .dijitSpinner .dijitUpArrowButtonHover .dijitArrowButtonInner {background-position: -174px;}.claro .dijitSpinner .dijitDownArrowButtonHover .dijitArrowButtonInner {background-position: -69px;}.claro .dijitSpinnerFocused {background-color: #ffffff; background-image: none;}.claro .dijitSpinner .dijitDownArrowButtonActive, .claro .dijitSpinner .dijitUpArrowButtonActive {background-color: #7dbefa; background-image: url("../../dijit/themes/claro/images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitSpinner .dijitUpArrowButtonActive .dijitArrowButtonInner, .claro .dijitSpinner .dijitDownArrowButtonActive .dijitArrowButtonInner {border: 0; padding: 1px; margin-right: 2px; margin-bottom: 1px;}.claro .dijitSpinner .dijitUpArrowButtonActive .dijitArrowButtonInner {background-position: -173px;}.claro .dijitSpinner .dijitDownArrowButtonActive .dijitArrowButtonInner {background-position: -68px;}.claro .dijitSpinnerDisabled .dijitArrowButtonInner {background-color: #efefef;}.claro .dijitSpinnerDisabled .dijitUpArrowButton .dijitArrowButtonInner {background-position: -104px;}.claro .dijitSpinnerDisabled .dijitDownArrowButton .dijitArrowButtonInner {background-position: 1px;}.dj_ie7 .claro .dijitSpinner {overflow: visible;}.dijitRtl .dijitPlaceHolder {left: auto; right: 0;}.dijitMenuItemRtl {text-align: right;}.dj_iequirks .dijitComboButtonRtl button {float:left;}.dj_ie .dijitTextBoxRtl .dijitInputContainer {clear: right;}.dijitTextBoxRtl .dijitValidationContainer,.dijitTextBoxRtl .dijitSpinnerButtonContainer,.dijitComboBoxRtl .dijitArrowButtonContainer {border-right-width: 1px !important; border-left-width: 0 !important;}.dijitSpinnerRtl .dijitSpinnerButtonContainer .dijitArrowButton {right: 0; left: auto;}.dijitSelectRtl .dijitButtonText {float: right;}.dijitTextBoxRtl .dijitSpinnerButtonContainer,.dijitValidationTextBoxRtl .dijitValidationContainer,.dijitTextBoxRtl .dijitArrowButtonContainer {float: left;}.dijitCalendarRtl .dijitCalendarNextYear {margin:0 0.55em 0 0;}.dijitCalendarRtl .dijitCalendarPreviousYear {margin:0 0 0 0.55em;}.dijitSliderRtl .dijitSliderImageHandleV {left:auto;}.dijitSliderRtl .dijitSliderImageHandleH {left:-50%;}.dijitSliderRtl .dijitSliderMoveableH {right:auto; left:0;}.dijitSliderRtl .dijitRuleContainerV {float:right;}.dj_ie .dijitSliderRtl .dijitRuleContainerV {text-align:right;}.dj_ie .dijitSliderRtl .dijitRuleLabelV {text-align:left;}.dj_ie .dijitSliderRtl .dijitRuleLabelH {zoom:1;}.dijitSliderRtl .dijitSliderProgressBarH {float:right; right:0; left:auto;}.dijitRtl .dijitContentPaneLoading .dijitIconLoading,.dijitRtl .dijitContentPaneError .dijitIconError {margin-right: 0; margin-left: 9px;}.dijitTabControllerRtl .nowrapTabStrip {text-align: right;}.dijitTabRtl .dijitTabCloseButton {margin-left: 0; margin-right: 1em;}.dj_ie6 .dijitTabRtl .tabLabel,.dj_ie6 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie6 .dijitTabContainerLeft-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerLeft-tabs .dijitTabRtl {zoom: 1;}.dj_ie6 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerRight-tabs .dijitTabRtl {left: 0;}.dj_ie6 .dijitTabContainerRightRtl .dijitTabContainerRight-tabs,.dj_ie6 .dijitTabContainerLeftRtl .dijitTabContainerLeft-tabs {width: 1%;}.dj_ie .dijitTimePickerRtl .dijitTimePickerItem {width:100%;}.dijitColorPaletteRtl .dijitColorPaletteUnder {left: auto; right: 0;}.dijitSelectRtl .dijitButtonContents {border-style: none none none solid; text-align: right;}.dijitRtl .dojoDndHorizontal .dojoDndItemBefore {border-width: 0 2px 0 0; padding: 2px 0 2px 2px;}.dijitRtl .dojoDndHorizontal .dojoDndItemAfter {border-width: 0 0 0 2px; padding: 2px 2px 2px 0;}.claro .dijitTextBoxRtlError .dijitValidationContainer {border-left-width: 0 !important; border-right-width: 1px !important;}.claro .dijitComboButtonRtl .dijitStretch {-moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;}.claro .dijitComboButtonRtl .dijitArrowButton {-moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; padding: 3px 0 4px; border-left-width: 1px; border-right-width: 0;}.claro .dijitTabContainerTop-tabs .dijitTabRtl, .claro .dijitTabContainerBottom-tabs .dijitTabRtl {margin-right: 0; margin-left: 1px;}.claro .dijitSliderRtl .dijitSliderProgressBarH,.claro .dijitSliderRtl .dijitSliderRemainingBarH,.claro .dijitSliderRtl .dijitSliderLeftBumper,.claro .dijitSliderRtl .dijitSliderRightBumper,.claro .dijitSliderRtl .dijitSliderTopBumper {background-position: top right;}.claro .dijitSliderRtl .dijitSliderProgressBarV, .claro .dijitSliderRtl .dijitSliderRemainingBarV, .claro .dijitSliderRtl .dijitSliderBottomBumper {background-position: bottom right;}.claro .dijitSliderRtl .dijitSliderLeftBumper {border-left-width: 0; border-right-width: 1px;}.claro .dijitSliderRtl .dijitSliderRightBumper {border-left-width: 1px; border-right-width: 0;}.claro .dijitSliderRtl .dijitSliderIncrementIconH {background-position: -357px 50%;}.claro .dijitSliderRtl .dijitSliderDecrementIconH {background-position: -251px 50%;}.claro .dijitDialogRtl .dijitDialogCloseIcon {right: auto; left: 5px;}.claro .dijitDialogRtl .dijitDialogPaneActionBar {text-align: left; padding: 3px 7px 2px 5px;}.claro .dijitEditorRtl .dijitEditorIFrameContainer {padding: 3px 10px 1px 3px;}.dijitEditorRtl .dijitEditorIcon {background-image: url("../../dijit/icons/images/editorIconsEnabled_rtl.png");}.dijitEditorRtlDisabled .dijitEditorIcon {background-image: url("../../dijit/icons/images/editorIconsDisabled_rtl.png");}.dijitToolbarRtl .dijitToolbarSeparator {background-image: url("../../dijit/icons/images/editorIconsEnabled_rtl.png");}.dijitRtl .dijitIconSave,.dijitRtl .dijitIconPrint,.dijitRtl .dijitIconCut,.dijitRtl .dijitIconCopy,.dijitRtl .dijitIconClear,.dijitRtl .dijitIconDelete,.dijitRtl .dijitIconUndo,.dijitRtl .dijitIconEdit,.dijitRtl .dijitIconNewTask,.dijitRtl .dijitIconEditTask,.dijitRtl .dijitIconEditProperty,.dijitRtl .dijitIconTask,.dijitRtl .dijitIconFilter,.dijitRtl .dijitIconConfigure,.dijitRtl .dijitIconSearch,.dijitRtl .dijitIconApplication,.dijitRtl .dijitIconBookmark,.dijitRtl .dijitIconChart,.dijitRtl .dijitIconConnector,.dijitRtl .dijitIconDatabase,.dijitRtl .dijitIconDocuments,.dijitRtl .dijitIconMail,.dijitRtl .dijitLeaf,.dijitRtl .dijitIconFile,.dijitRtl .dijitIconFunction,.dijitRtl .dijitIconKey,.dijitRtl .dijitIconPackage,.dijitRtl .dijitIconSample,.dijitRtl .dijitIconTable,.dijitRtl .dijitIconUsers,.dijitRtl .dijitFolderClosed,.dijitRtl .dijitIconFolderClosed,.dijitRtl .dijitFolderOpened,.dijitRtl .dijitIconFolderOpen,.dijitRtl .dijitIconError {background-image: url("../../dijit/icons/images/commonIconsObjActEnabled_rtl.png"); width: 16px; height: 16px;}.dj_ie6 .dijitRtl .dijitIconSave,.dj_ie6 .dijitRtl .dijitIconPrint,.dj_ie6 .dijitRtl .dijitIconCut,.dj_ie6 .dijitRtl .dijitIconCopy,.dj_ie6 .dijitRtl .dijitIconClear,.dj_ie6 .dijitRtl .dijitIconDelete,.dj_ie6 .dijitRtl .dijitIconUndo,.dj_ie6 .dijitRtl .dijitIconEdit,.dj_ie6 .dijitRtl .dijitIconNewTask,.dj_ie6 .dijitRtl .dijitIconEditTask,.dj_ie6 .dijitRtl .dijitIconEditProperty,.dj_ie6 .dijitRtl .dijitIconTask,.dj_ie6 .dijitRtl .dijitIconFilter,.dj_ie6 .dijitRtl .dijitIconConfigure,.dj_ie6 .dijitRtl .dijitIconSearch,.dj_ie6 .dijitRtl .dijitIconApplication,.dj_ie6 .dijitRtl .dijitIconBookmark,.dj_ie6 .dijitRtl .dijitIconChart,.dj_ie6 .dijitRtl .dijitIconConnector,.dj_ie6 .dijitRtl .dijitIconDatabase,.dj_ie6 .dijitRtl .dijitIconDocuments,.dj_ie6 .dijitRtl .dijitIconMail,.dj_ie6 .dijitRtl .dijitLeaf,.dj_ie6 .dijitRtl .dijitIconFile,.dj_ie6 .dijitRtl .dijitIconFunction,.dj_ie6 .dijitRtl .dijitIconKey,.dj_ie6 .dijitRtl .dijitIconPackage,.dj_ie6 .dijitRtl .dijitIconSample,.dj_ie6 .dijitRtl .dijitIconTable,.dj_ie6 .dijitRtl .dijitIconUsers,.dj_ie6 .dijitRtl .dijitFolderClosed,.dj_ie6 .dijitRtl .dijitIconFolderClosed,.dj_ie6 .dijitRtl .dijitFolderOpened,.dj_ie6 .dijitRtl .dijitIconFolderOpen,.dj_ie6 .dijitRtl .dijitIconError {background-image: url("../../dijit/icons/images/commonIconsObjActEnabled8bit_rtl.png");}.dijitRtl .dijitDisabled .dijitIconSave,.dijitRtl .dijitDisabled .dijitIconPrint,.dijitRtl .dijitDisabled .dijitIconCut,.dijitRtl .dijitDisabled .dijitIconCopy,.dijitRtl .dijitDisabled .dijitIconClear,.dijitRtl .dijitDisabled .dijitIconDelete,.dijitRtl .dijitDisabled .dijitIconUndo,.dijitRtl .dijitDisabled .dijitIconEdit,.dijitRtl .dijitDisabled .dijitIconNewTask,.dijitRtl .dijitDisabled .dijitIconEditTask,.dijitRtl .dijitDisabled .dijitIconEditProperty,.dijitRtl .dijitDisabled .dijitIconTask,.dijitRtl .dijitDisabled .dijitIconFilter,.dijitRtl .dijitDisabled .dijitIconConfigure,.dijitRtl .dijitDisabled .dijitIconSearch,.dijitRtl .dijitDisabled .dijitIconApplication,.dijitRtl .dijitDisabled .dijitIconBookmark,.dijitRtl .dijitDisabled .dijitIconChart,.dijitRtl .dijitDisabled .dijitIconConnector,.dijitRtl .dijitDisabled .dijitIconDatabase,.dijitRtl .dijitDisabled .dijitIconDocuments,.dijitRtl .dijitDisabled .dijitIconMail,.dijitRtl .dijitDisabled .dijitLeaf,.dijitRtl .dijitDisabled .dijitIconFile,.dijitRtl .dijitDisabled .dijitIconFunction,.dijitRtl .dijitDisabled .dijitIconKey,.dijitRtl .dijitDisabled .dijitIconPackage,.dijitRtl .dijitDisabled .dijitIconSample,.dijitRtl .dijitDisabled .dijitIconTable,.dijitRtl .dijitDisabled .dijitIconUsers,.dijitRtl .dijitDisabled .dijitFolderClosed,.dijitRtl .dijitDisabled .dijitIconFolderClosed,.dijitRtl .dijitDisabled .dijitFolderOpened,.dijitRtl .dijitDisabled .dijitIconFolderOpen,.dijitRtl .dijitDisabled .dijitIconError {background-image: url("../../dijit/icons/images/commonIconsObjActDisabled_rtl.png");}.claro .dijitTitlePaneRtl .dijitClosed .dijitArrowNode {background-position: -7px 0;}.claro .dijitMenuItemRtl .dijitMenuExpand {background-position: -7px 0; margin-right: 0; margin-left: 3px;}.claro .dijitMenuItemRtl .dijitMenuItemIcon {margin: 0 4px 0 0;}.claro .dijitCalendarRtl .dijitCalendarIncrease {background-position: 0 0;}.claro .dijitCalendarRtl .dijitCalendarDecrease {background-position: -18px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarIncrease {background-position: -36px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarDecrease {background-position: -55px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarIncrease {background-position: -72px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarDecrease {background-position: -91px 0;}.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickHover,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerHover,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerSelected,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickSelected {margin-left: -6px; margin-right: -8px; width: 114%;}.claro .dijitToolbar .dijitComboButtonRtl .dijitButtonNode {border-width: 0; padding: 2px;}.claro .dijitToolbar .dijitComboButtonRtlHover .dijitButtonNode, .claro .dijitToolbar .dijitComboButtonRtlActive .dijitButtonNode {border-width: 1px; padding: 1px;}.claro .dijitToolbar .dijitComboButtonRtl .dijitStretch {-moz-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0;}.claro .dijitToolbar .dijitComboButtonRtl .dijitArrowButton {-moz-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;}.claro .dijitToolbar .dijitComboButtonRtlHover .dijitArrowButton, .claro .dijitToolbar .dijitComboButtonRtlActive .dijitArrowButton {border-left-width: 1px; border-right-width: 0; padding-left: 1px; padding-right: 2px;} .dojoxExpandoPane {overflow:hidden; z-index:440 !important;} .dojoxExpandoPane .dojoxExpandoWrapper {overflow:hidden;} .dojoxExpandoClosed .dojoxExpandoTitleNode {display:none;} .dojoxExpandoClosed .dojoxExpandoWrapper * {overflow:hidden !important;} .dojoxExpandoTitleNode {padding-right:6px; padding-left:6px;} .dojoxExpandoIcon .a11yNode {display:none; visibility:hidden;} .dojoxExpandoBottom .dojoxExpandoIcon, .dojoxExpandoTop .dojoxExpandoIcon, .dojoxExpandoLeft .dojoxExpandoIcon {float:right; margin-right:2px;} .dojoxExpandoRight .dojoxExpandoIcon {float:left; margin-left:2px;} .dojoxExpandoIcon {width:14px; cursor:pointer; background-position:-60px 0px; background-repeat: no-repeat; height:14px;} .dojoxExpandoClosed .dojoxExpandoIcon {background-position: 0px 0px; margin:0 auto;} .dijitBorderContainer-dijitExpandoPane {border: none !important;} .soria .dojoxExpandoTitle {height:16px; font-size:0.9em; font-weight:bold; padding:3px; padding-top:6px; padding-bottom:5px; background:#F0F4FC url("../../dijit/themes/soria/images/tabContainerSprite.gif") repeat-x scroll 0pt -50px; border-left: 1px solid #B1BADF; border-right: 1px solid #B1BADF;} .soria .dojoxExpandoClosed .dojoxExpandoTitle {background: none; background-color: #F0F4FC; border: none;} .soria .dojoxExpandoClosed {background: none; background-color: #F0F4FC; border: 1px solid #B1BADF !important;} .soria .dojoxExpandoIcon {background-image: url("../../dijit/themes/soria/images/spriteRoundedIconsSmall.png");} .dj_ie6 .soria .dojoxExpandoIcon {background-image: url("../../dijit/themes/soria/images/spriteRoundedIconsSmall.gif");} .tundra .dojoxExpandoTitle {font-weight: bold; padding: 5px; padding-top: 6px; padding-bottom: 6px; background: #fafafa url("../../dijit/themes/tundra/images/accordionItemActive.gif") repeat-x scroll left top; border-top: 1px solid #ccc; border-left: 1px solid #ccc; border-right: 1px solid #ccc;} .tundra .dojoxExpandoClosed .dojoxExpandoTitle {background: none; background-color: #fafafa; border: none; padding:3px;} .tundra .dojoxExpandoClosed {background: none; background-color: #fafafa; border: 1px solid #ccc !important;} .tundra .dojoxExpandoRight .dojoxExpandoTitle, .tundra .dojoxExpandoLeft .dojoxExpandoTitle, .tundra .dojoxExpandoClosed .dojoxExpandoTitle, .tundra .dojoxExpandoClosed {background-color: #fafafa;} .tundra .dojoxExpandoIcon {background-image: url("../../dijit/themes/tundra/images/spriteRoundedIconsSmall.gif");} .tundra .dojoxExpandoClosed .dojoxExpandoIconLeft, .tundra .dojoxExpandoClosed .dojoxExpandoIconRight, .tundra .dojoxExpandoClosed .dojoxExpandoIconTop, .tundra .dojoxExpandoClosed .dojoxExpandoIconBottom {margin-top: 3px;} .claro .dojoxExpandoTitle {font-weight: bold; border:1px solid #769DC0; border-bottom:none; background-color:#cde8ff; background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-position:0px 0px; background-repeat:repeat-x; padding: 5px 7px 2px 7px; min-height:17px; color:#4a4a4a;} .claro .dojoxExpandoClosed .dojoxExpandoTitle {background: none; background-color: #E6E6E7; border: none; padding:3px;} .claro .dojoxExpandoClosed {background: none; background-color: #E6E6E7; border: 1px solid #769DC0 !important;} .claro .dojoxExpandoRight .dojoxExpandoTitle, .claro .dojoxExpandoLeft .dojoxExpandoTitle, .claro .dojoxExpandoClosed .dojoxExpandoTitle{background-color: #E6E6E7;} .claro .dojoxExpandoClosed .dojoxExpandoTitle{background-image: url("../../dijit/themes/claro/images/standardGradient.png"); background-position:0 0;} .claro .dojoxExpandoIcon {background-image: url("../../dijit/themes/tundra/images/spriteRoundedIconsSmall.gif");} .claro .dojoxExpandoClosed .dojoxExpandoIconLeft, .claro .dojoxExpandoClosed .dojoxExpandoIconRight, .claro .dojoxExpandoClosed .dojoxExpandoIconTop, .claro .dojoxExpandoClosed .dojoxExpandoIconBottom {margin-top: 3px;} .nihilo .dojoxExpandoPane {background: #fafafa;} .nihilo .dojoxExpandoTitle {height:16px; font-size:0.9em; font-weight:bold; padding:3px; padding-top:6px; padding-bottom:5px; background:#fafafa url("../../dijit/themes/nihilo/images/tabContainerSprite.gif") repeat-x scroll 0pt -50px; border-left: 1px solid #ccc; border-right: 1px solid #ccc;} .nihilo .dojoxExpandoClosed .dojoxExpandoTitle {background: none; background-color: #fafafa; border: none;} .nihilo .dojoxExpandoClosed {background: none; background-color: #fafafa; border: 1px solid #ccc !important;} .nihilo .dojoxExpandoIcon {background-image: url("../../dijit/themes/nihilo/images/spriteRoundedIconsSmall.png");} .dj_ie6 .nihilo .dojoxExpandoIcon {background-image: url("../../dijit/themes/nihilo/images/spriteRoundedIconsSmall.gif");} .nihilo .dojoxExpandoTop {border-bottom:1px solid #ccc; border-left:1px solid #ccc; border-right:1px solid #ccc;} .dojoxExpandoClosed .dojoxExpandoIcon {margin-right:4px;} .dojoxExpandoIconLeft {background-position: 0 0;} .dojoxExpandoClosed .dojoxExpandoIconLeft {background-position: -30px 0; margin-right: 4px;} .dojoxExpandoIconRight {background-position: -30px 0;} .dojoxExpandoClosed .dojoxExpandoIconRight {background-position: 0 0; margin-left: 4px;} .dojoxExpandoIconBottom {background-position: -15px 0;} .dojoxExpandoClosed .dojoxExpandoIconBottom {background-position: -45px 0; margin-top:1px;} .dojoxExpandoIconTop {background-position: -45px 0;} .dojoxExpandoClosed .dojoxExpandoIconTop {background-position: -15px 0;}.dojoxColorPicker {padding:8px; -moz-border-radius:4pt; -webkit-border-radius:5pt; -webkit-drop-shadow:3pt;}.dojoxColorPickerRightPad {padding-right: 8px;}.tundra .dojoxColorPicker {background:#ededed; border:1px solid #ccc;}.dojoxColorPickerBox {position:relative; width:150px; height:150px; margin:0; padding:0;}.dojoxColorPickerUnderlay {position:relative; top:0; left:0; width:150px; height:150px; z-index:1;}.tundra .dojoxColorPickerUnderlay {border:1px solid #a0a0a0;}.claro .dojoxColorPicker {background:#ededed; border:1px solid #cdcdcd;}.claro .dojoxColorPickerUnderlay {border:1px solid #cccccc;}.dojoxHuePickerUnderlay {position:relative; top:0; left:0; height:150px; width:20px; z-index:1; text-align: center;}.dojoxHuePicker {position:relative; top: 0px; left: 0px; padding: 0px;}.dojoxHuePickerPoint {position:absolute; top:0; left:0; width:20px; height:8px; z-index:3; cursor:move;}.dojoxColorPickerPoint {position:absolute; width:10px; height:10px; border:0; z-index:3; cursor:move;}.dojoxColorPickerPreview {display:block; width:45px; height:45px; border:1px solid #333; background-color:#fff; position:relative; top: 0px; left: 0px;}.dojoxColorPickerWebSafePreview {display:block; width:25px; height:25px; position:relative; top: 0px; left: 0px; border:1px solid #333;}.dojoxColorPickerOptional {position:relative; top: 0px; left: 0px; height: 100%;}.dojoxColorPickerOptional table {border-spacing: 4px;}.dojoxColorPickerPreviewContainer table {border-spacing: 6px 0px;}.dojoxColorPickerOptional input {border:1px solid #a7a7a7; width:25px; padding:1px 3px 1px 3px; line-height:1.1em;}.dojoxColorPickerHex input {width:55px;} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/avatar-joe.png b/api/js/webodf/wodotexteditor/wodotexteditor/avatar-joe.png new file mode 100644 index 0000000000..7b2972a50f Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/avatar-joe.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/commonIcons.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/commonIcons.css new file mode 100644 index 0000000000..d07d0051bc --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/commonIcons.css @@ -0,0 +1 @@ +.dijitIconSave,.dijitIconPrint,.dijitIconCut,.dijitIconCopy,.dijitIconClear,.dijitIconDelete,.dijitIconUndo,.dijitIconEdit,.dijitIconNewTask,.dijitIconEditTask,.dijitIconEditProperty,.dijitIconTask,.dijitIconFilter,.dijitIconConfigure,.dijitIconSearch,.dijitIconApplication,.dijitIconBookmark,.dijitIconChart,.dijitIconConnector,.dijitIconDatabase,.dijitIconDocuments,.dijitIconMail,.dijitLeaf,.dijitIconFile,.dijitIconFunction,.dijitIconKey,.dijitIconPackage,.dijitIconSample,.dijitIconTable,.dijitIconUsers,.dijitFolderClosed,.dijitIconFolderClosed,.dijitFolderOpened,.dijitIconFolderOpen,.dijitIconError {background-image: url('images/commonIconsObjActEnabled.png'); width: 16px; height: 16px;}.dj_ie6 .dijitIconSave,.dj_ie6 .dijitIconPrint,.dj_ie6 .dijitIconCut,.dj_ie6 .dijitIconCopy,.dj_ie6 .dijitIconClear,.dj_ie6 .dijitIconDelete,.dj_ie6 .dijitIconUndo,.dj_ie6 .dijitIconEdit,.dj_ie6 .dijitIconNewTask,.dj_ie6 .dijitIconEditTask,.dj_ie6 .dijitIconEditProperty,.dj_ie6 .dijitIconTask,.dj_ie6 .dijitIconFilter,.dj_ie6 .dijitIconConfigure,.dj_ie6 .dijitIconSearch,.dj_ie6 .dijitIconApplication,.dj_ie6 .dijitIconBookmark,.dj_ie6 .dijitIconChart,.dj_ie6 .dijitIconConnector,.dj_ie6 .dijitIconDatabase,.dj_ie6 .dijitIconDocuments,.dj_ie6 .dijitIconMail,.dj_ie6 .dijitLeaf,.dj_ie6 .dijitIconFile,.dj_ie6 .dijitIconFunction,.dj_ie6 .dijitIconKey,.dj_ie6 .dijitIconPackage,.dj_ie6 .dijitIconSample,.dj_ie6 .dijitIconTable,.dj_ie6 .dijitIconUsers,.dj_ie6 .dijitFolderClosed,.dj_ie6 .dijitIconFolderClosed,.dj_ie6 .dijitFolderOpened,.dj_ie6 .dijitIconFolderOpen,.dj_ie6 .dijitIconError {background-image: url('images/commonIconsObjActEnabled8bit.png');}.dijitDisabled .dijitIconSave,.dijitDisabled .dijitIconPrint,.dijitDisabled .dijitIconCut,.dijitDisabled .dijitIconCopy,.dijitDisabled .dijitIconClear,.dijitDisabled .dijitIconDelete,.dijitDisabled .dijitIconUndo,.dijitDisabled .dijitIconEdit,.dijitDisabled .dijitIconNewTask,.dijitDisabled .dijitIconEditTask,.dijitDisabled .dijitIconEditProperty,.dijitDisabled .dijitIconTask,.dijitDisabled .dijitIconFilter,.dijitDisabled .dijitIconConfigure,.dijitDisabled .dijitIconSearch,.dijitDisabled .dijitIconApplication,.dijitDisabled .dijitIconBookmark,.dijitDisabled .dijitIconChart,.dijitDisabled .dijitIconConnector,.dijitDisabled .dijitIconDatabase,.dijitDisabled .dijitIconDocuments,.dijitDisabled .dijitIconMail,.dijitDisabled .dijitLeaf,.dijitDisabled .dijitIconFile,.dijitDisabled .dijitIconFunction,.dijitDisabled .dijitIconKey,.dijitDisabled .dijitIconPackage,.dijitDisabled .dijitIconSample,.dijitDisabled .dijitIconTable,.dijitDisabled .dijitIconUsers,.dijitDisabled .dijitFolderClosed,.dijitDisabled .dijitIconFolderClosed,.dijitDisabled .dijitFolderOpened,.dijitDisabled .dijitIconFolderOpen,.dijitDisabled .dijitIconError {background-image: url('images/commonIconsObjActDisabled.png');}.dijitIconSave {background-position: 0;}.dijitIconPrint {background-position: -16px;}.dijitIconCut {background-position: -32px;}.dijitIconCopy {background-position: -48px;}.dijitIconClear {background-position: -64px;}.dijitIconDelete {background-position: -80px;}.dijitIconUndo {background-position: -96px;}.dijitIconEdit {background-position: -112px;}.dijitIconNewTask {background-position: -128px;}.dijitIconEditTask {background-position: -144px;}.dijitIconEditProperty {background-position: -160px;}.dijitIconTask {background-position: -176px;}.dijitIconFilter {background-position: -192px;}.dijitIconConfigure {background-position: -208px;}.dijitIconSearch {background-position: -224px;}.dijitIconError {background-position: -496px;} .dijitIconApplication {background-position: -240px;}.dijitIconBookmark {background-position: -256px;}.dijitIconChart {background-position: -272px;}.dijitIconConnector {background-position: -288px;}.dijitIconDatabase {background-position: -304px;}.dijitIconDocuments {background-position: -320px;}.dijitIconMail {background-position: -336px;}.dijitIconFile, .dijitLeaf {background-position: -352px;}.dijitIconFunction {background-position: -368px;}.dijitIconKey {background-position: -384px;}.dijitIconPackage{background-position: -400px;}.dijitIconSample {background-position: -416px;}.dijitIconTable {background-position: -432px;}.dijitIconUsers {background-position: -448px;}.dijitIconFolderClosed, .dijitFolderClosed {background-position: -464px;}.dijitIconFolderOpen, .dijitFolderOpened {background-position: -480px;}.dijitIconLoading {background:url('images/loadingAnimation_rtl.gif') no-repeat; height: 20px; width: 20px;} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/commonIcons_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/commonIcons_rtl.css new file mode 100644 index 0000000000..105011a556 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/commonIcons_rtl.css @@ -0,0 +1 @@ +.dijitRtl .dijitIconSave,.dijitRtl .dijitIconPrint,.dijitRtl .dijitIconCut,.dijitRtl .dijitIconCopy,.dijitRtl .dijitIconClear,.dijitRtl .dijitIconDelete,.dijitRtl .dijitIconUndo,.dijitRtl .dijitIconEdit,.dijitRtl .dijitIconNewTask,.dijitRtl .dijitIconEditTask,.dijitRtl .dijitIconEditProperty,.dijitRtl .dijitIconTask,.dijitRtl .dijitIconFilter,.dijitRtl .dijitIconConfigure,.dijitRtl .dijitIconSearch,.dijitRtl .dijitIconApplication,.dijitRtl .dijitIconBookmark,.dijitRtl .dijitIconChart,.dijitRtl .dijitIconConnector,.dijitRtl .dijitIconDatabase,.dijitRtl .dijitIconDocuments,.dijitRtl .dijitIconMail,.dijitRtl .dijitLeaf,.dijitRtl .dijitIconFile,.dijitRtl .dijitIconFunction,.dijitRtl .dijitIconKey,.dijitRtl .dijitIconPackage,.dijitRtl .dijitIconSample,.dijitRtl .dijitIconTable,.dijitRtl .dijitIconUsers,.dijitRtl .dijitFolderClosed,.dijitRtl .dijitIconFolderClosed,.dijitRtl .dijitFolderOpened,.dijitRtl .dijitIconFolderOpen,.dijitRtl .dijitIconError {background-image: url('images/commonIconsObjActEnabled_rtl.png'); width: 16px; height: 16px;}.dj_ie6 .dijitRtl .dijitIconSave,.dj_ie6 .dijitRtl .dijitIconPrint,.dj_ie6 .dijitRtl .dijitIconCut,.dj_ie6 .dijitRtl .dijitIconCopy,.dj_ie6 .dijitRtl .dijitIconClear,.dj_ie6 .dijitRtl .dijitIconDelete,.dj_ie6 .dijitRtl .dijitIconUndo,.dj_ie6 .dijitRtl .dijitIconEdit,.dj_ie6 .dijitRtl .dijitIconNewTask,.dj_ie6 .dijitRtl .dijitIconEditTask,.dj_ie6 .dijitRtl .dijitIconEditProperty,.dj_ie6 .dijitRtl .dijitIconTask,.dj_ie6 .dijitRtl .dijitIconFilter,.dj_ie6 .dijitRtl .dijitIconConfigure,.dj_ie6 .dijitRtl .dijitIconSearch,.dj_ie6 .dijitRtl .dijitIconApplication,.dj_ie6 .dijitRtl .dijitIconBookmark,.dj_ie6 .dijitRtl .dijitIconChart,.dj_ie6 .dijitRtl .dijitIconConnector,.dj_ie6 .dijitRtl .dijitIconDatabase,.dj_ie6 .dijitRtl .dijitIconDocuments,.dj_ie6 .dijitRtl .dijitIconMail,.dj_ie6 .dijitRtl .dijitLeaf,.dj_ie6 .dijitRtl .dijitIconFile,.dj_ie6 .dijitRtl .dijitIconFunction,.dj_ie6 .dijitRtl .dijitIconKey,.dj_ie6 .dijitRtl .dijitIconPackage,.dj_ie6 .dijitRtl .dijitIconSample,.dj_ie6 .dijitRtl .dijitIconTable,.dj_ie6 .dijitRtl .dijitIconUsers,.dj_ie6 .dijitRtl .dijitFolderClosed,.dj_ie6 .dijitRtl .dijitIconFolderClosed,.dj_ie6 .dijitRtl .dijitFolderOpened,.dj_ie6 .dijitRtl .dijitIconFolderOpen,.dj_ie6 .dijitRtl .dijitIconError {background-image: url('images/commonIconsObjActEnabled8bit_rtl.png');}.dijitRtl .dijitDisabled .dijitIconSave,.dijitRtl .dijitDisabled .dijitIconPrint,.dijitRtl .dijitDisabled .dijitIconCut,.dijitRtl .dijitDisabled .dijitIconCopy,.dijitRtl .dijitDisabled .dijitIconClear,.dijitRtl .dijitDisabled .dijitIconDelete,.dijitRtl .dijitDisabled .dijitIconUndo,.dijitRtl .dijitDisabled .dijitIconEdit,.dijitRtl .dijitDisabled .dijitIconNewTask,.dijitRtl .dijitDisabled .dijitIconEditTask,.dijitRtl .dijitDisabled .dijitIconEditProperty,.dijitRtl .dijitDisabled .dijitIconTask,.dijitRtl .dijitDisabled .dijitIconFilter,.dijitRtl .dijitDisabled .dijitIconConfigure,.dijitRtl .dijitDisabled .dijitIconSearch,.dijitRtl .dijitDisabled .dijitIconApplication,.dijitRtl .dijitDisabled .dijitIconBookmark,.dijitRtl .dijitDisabled .dijitIconChart,.dijitRtl .dijitDisabled .dijitIconConnector,.dijitRtl .dijitDisabled .dijitIconDatabase,.dijitRtl .dijitDisabled .dijitIconDocuments,.dijitRtl .dijitDisabled .dijitIconMail,.dijitRtl .dijitDisabled .dijitLeaf,.dijitRtl .dijitDisabled .dijitIconFile,.dijitRtl .dijitDisabled .dijitIconFunction,.dijitRtl .dijitDisabled .dijitIconKey,.dijitRtl .dijitDisabled .dijitIconPackage,.dijitRtl .dijitDisabled .dijitIconSample,.dijitRtl .dijitDisabled .dijitIconTable,.dijitRtl .dijitDisabled .dijitIconUsers,.dijitRtl .dijitDisabled .dijitFolderClosed,.dijitRtl .dijitDisabled .dijitIconFolderClosed,.dijitRtl .dijitDisabled .dijitFolderOpened,.dijitRtl .dijitDisabled .dijitIconFolderOpen,.dijitRtl .dijitDisabled .dijitIconError {background-image: url('images/commonIconsObjActDisabled_rtl.png');} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/editorIcons.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/editorIcons.css new file mode 100644 index 0000000000..e7796a0969 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/editorIcons.css @@ -0,0 +1 @@ +.dijitEditorIcon {background-image: url('images/editorIconsEnabled.png'); background-repeat: no-repeat; width: 18px; height: 18px; text-align: center;}.dijitDisabled .dijitEditorIcon {background-image: url('images/editorIconsDisabled.png');}.dijitEditorIconSep {background-position: 0;}.dijitEditorIconSave {background-position: -18px;}.dijitEditorIconPrint {background-position: -36px;}.dijitEditorIconCut {background-position: -54px;}.dijitEditorIconCopy {background-position: -72px;}.dijitEditorIconPaste {background-position: -90px;}.dijitEditorIconDelete {background-position: -108px;}.dijitEditorIconCancel {background-position: -126px;}.dijitEditorIconUndo {background-position: -144px;}.dijitEditorIconRedo {background-position: -162px;}.dijitEditorIconSelectAll {background-position: -180px;}.dijitEditorIconBold {background-position: -198px;}.dijitEditorIconItalic {background-position: -216px;}.dijitEditorIconUnderline {background-position: -234px;}.dijitEditorIconStrikethrough {background-position: -252px;}.dijitEditorIconSuperscript {background-position: -270px;}.dijitEditorIconSubscript {background-position: -288px;}.dijitEditorIconJustifyCenter {background-position: -306px;}.dijitEditorIconJustifyFull {background-position: -324px;}.dijitEditorIconJustifyLeft {background-position: -342px;}.dijitEditorIconJustifyRight {background-position: -360px;}.dijitEditorIconIndent {background-position: -378px;}.dijitEditorIconOutdent {background-position: -396px;}.dijitEditorIconListBulletIndent {background-position: -414px;}.dijitEditorIconListBulletOutdent {background-position: -432px;}.dijitEditorIconListNumIndent {background-position: -450px;}.dijitEditorIconListNumOutdent {background-position: -468px;}.dijitEditorIconTabIndent {background-position: -486px;}.dijitEditorIconLeftToRight {background-position: -504px;}.dijitEditorIconRightToLeft, .dijitEditorIconToggleDir {background-position: -522px;}.dijitEditorIconBackColor {background-position: -540px;}.dijitEditorIconForeColor {background-position: -558px;}.dijitEditorIconHiliteColor {background-position: -576px;}.dijitEditorIconNewPage {background-position: -594px;}.dijitEditorIconInsertImage {background-position: -612px;}.dijitEditorIconInsertTable {background-position: -630px;}.dijitEditorIconSpace {background-position: -648px;}.dijitEditorIconInsertHorizontalRule {background-position: -666px;}.dijitEditorIconInsertOrderedList {background-position: -684px;}.dijitEditorIconInsertUnorderedList {background-position: -702px;}.dijitEditorIconCreateLink {background-position: -720px;}.dijitEditorIconUnlink {background-position: -738px;}.dijitEditorIconViewSource {background-position: -756px;}.dijitEditorIconRemoveFormat {background-position: -774px;}.dijitEditorIconFullScreen {background-position: -792px;}.dijitEditorIconWikiword {background-position: -810px;} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/editorIcons_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/editorIcons_rtl.css new file mode 100644 index 0000000000..e157b09ed8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/editorIcons_rtl.css @@ -0,0 +1 @@ +.dijitEditorRtl .dijitEditorIcon {background-image: url('images/editorIconsEnabled_rtl.png');}.dijitEditorRtlDisabled .dijitEditorIcon {background-image: url('images/editorIconsDisabled_rtl.png');}.dijitToolbarRtl .dijitToolbarSeparator {background-image: url('images/editorIconsEnabled_rtl.png');} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActDisabled.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActDisabled.png new file mode 100644 index 0000000000..a348e3c104 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActDisabled.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActDisabled_rtl.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActDisabled_rtl.png new file mode 100644 index 0000000000..ea070eb9a6 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActDisabled_rtl.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled.png new file mode 100644 index 0000000000..bd32452347 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled8bit.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled8bit.png new file mode 100644 index 0000000000..d453ea1acb Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled8bit.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled8bit_rtl.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled8bit_rtl.png new file mode 100644 index 0000000000..fe5afd2df3 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled8bit_rtl.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled_rtl.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled_rtl.png new file mode 100644 index 0000000000..fbe891ab92 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/commonIconsObjActEnabled_rtl.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsDisabled.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsDisabled.png new file mode 100644 index 0000000000..3a68d7a47e Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsDisabled.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsDisabled_rtl.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsDisabled_rtl.png new file mode 100644 index 0000000000..9f16646b7e Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsDisabled_rtl.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsEnabled.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsEnabled.png new file mode 100644 index 0000000000..ca9989ab6a Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsEnabled.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsEnabled_rtl.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsEnabled_rtl.png new file mode 100644 index 0000000000..064def3e70 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/editorIconsEnabled_rtl.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/loadingAnimation_rtl.gif b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/loadingAnimation_rtl.gif new file mode 100644 index 0000000000..35b472c8ad Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/icons/images/loadingAnimation_rtl.gif differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/README.txt b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/README.txt new file mode 100644 index 0000000000..a80935429e --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/README.txt @@ -0,0 +1,3 @@ +This folder contains images used by all themes when in "high-contrast" mode. + +If you think you need to put something here, please talk to Becky or Bill first. \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/colors3x4.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/colors3x4.png new file mode 100644 index 0000000000..5125cb6562 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/colors3x4.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/colors7x10.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/colors7x10.png new file mode 100644 index 0000000000..d1354aff56 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/colors7x10.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/indeterminate_progress.gif b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/indeterminate_progress.gif new file mode 100644 index 0000000000..66f535cd89 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/a11y/indeterminate_progress.gif differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar.css new file mode 100644 index 0000000000..85c7929d33 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar.css @@ -0,0 +1,290 @@ +/* Calendar + * + * Styling Calendar mainly includes: + * + * 1. Calendar container + * .dijitCalendar - main container + * .dijitCalendarHover / .dijitCalendarActive - states e.g. hover,active + * + * 2. Month + * .dijitCalendarMonthContainer + * .dijitCalendarMonthLabel + * .dijitCalendarDecrease / .dijitCalendarDecrease - icons for switching to previous/next month + * .dijitCalendarArrowActive .dijitCalendarDecrease - states e.g. hover,active + * + * 3. Date + * .dijitCalendarDayLabelTemplate - week day column header e.g. S M T W T F S + * .dijitCalendarDateTemplate - date label wrapper + * .dijitCalendarPreviousMonth .dijitCalendarDateLabel - special labels for previous or next month + * .dijitCalendarSelectedDate .dijitCalendarDateLabel - styles for selected date + * .dijitCalendarDisabledDate .dijitCalendarDateLabel - styles for disabled date + * .dijitCalendarActiveDate .dijitCalendarDateLabel - states e.g. hover,active + * + * 4. Year + * .dijitCalendarYearContainer + * .dijitCalendarYearLabel + * .dijitCalendarPreviousYear /.dijitCalendarNextYear + * .dijitCalendarNextYearHover / .dijitCalendarPreviousYearHover - states e.g. hover,active + * + * 5. Dropdown Month Menu + * .dijitCalendarMonthMenu - menu container + * .dijitCalendarMonthMenu .dijitCalendarMonthLabel - month label in menu item + * .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover - menu item hover state + */ +.claro .dijitCalendar { + border: solid 1px #b5bcc7; + border-collapse: separate; + -moz-border-radius: 4px; + border-radius: 4px; + background-color: #cfe5fa; + background-image: url("images/calendar.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); + text-align: center; + padding: 6px 5px 3px 5px; +} +.dj_ie6 .claro .dijitCalendar { + background-image: none; +} +.claro .dijitCalendar img { + border: none; +} +.claro .dijitCalendarHover, +.claro .dijitCalendar:hover, +.claro .dijitCalendarActive { + /* treat dijitCalendarActive like hover since there's + * no concept of clicking a Calendar as a whole (although you can click things inside the calendar) + */ + background-color: #abd6ff; + border: solid 1px #759dc0; +} +.claro .dijitCalendarMonthContainer th { + text-align: center; + padding-bottom: 4px; + vertical-align: middle; +} +.claro .dijitCalendarMonthLabel { + color: #000; + font-size: 1.091em; + padding: 0 4px; +} +/* next/previous month arrows */ +.claro .dijitCalendarIncrementControl { + width: 18px; + height: 16px; + background-image: url("images/calendarArrows.png"); + background-repeat: no-repeat; +} +.dj_ie6 .claro .dijitCalendarIncrementControl { + background-image: url("images/calendarArrows8bit.png"); +} +.claro .dijitCalendarIncrease { + background-position: -18px 0; +} +.claro .dijitCalendarArrowHover .dijitCalendarDecrease, +.claro .dijitCalendarArrow:hover .dijitCalendarDecrease { + background-position: -36px 0; +} +.claro .dijitCalendarArrowHover .dijitCalendarIncrease, +.claro .dijitCalendarArrow:hover .dijitCalendarIncrease { + background-position: -55px 0; +} +.claro .dijitCalendarArrowActive .dijitCalendarDecrease, +.claro .dijitCalendarArrow:active .dijitCalendarDecrease { + background-position: -72px 0; +} +.claro .dijitCalendarArrowActive .dijitCalendarIncrease, +.claro .dijitCalendarArrow:active .dijitCalendarIncrease { + background-position: -91px 0; +} +.claro .dijitA11ySideArrow { + /* text +/- labels instead of arrow icons, for high contrast mode */ + display: none; +} +.claro .dijitCalendarDayLabelTemplate { + padding-bottom: 0; + text-align: center; + border-bottom: 1px solid #b5bcc7; + padding: 0 3px 2px; +} +.claro .dijitCalendarDayLabel { + padding: 0 4px 0 4px; + font-weight: bold; + font-size: 0.909em; + text-align: center; + color: #000; +} +.claro .dijitCalendarDateTemplate { + background-color: #fff; + border-bottom: 1px solid #d3d3d3; + padding-top: 0; + font-size: 0.909em; + font-family: Arial; + font-weight: bold; + letter-spacing: .05em; + text-align: center; + color: #000; +} +.dj_ie6 .claro .dijitCalendarDateTemplate { + background-image: none; +} +.claro .dijitCalendarPreviousMonth, +.claro .dijitCalendarNextMonth { + background-color: #e5f2fe; + background-image: none; + border-bottom: solid 1px #d3d3d3; + /* todo: redundant with above .dijitCalendarDateTemplate rule */ +} +.claro .dijitCalendarDateTemplate .dijitCalendarDateLabel { + text-decoration: none; + display: block; + padding: 3px 5px 3px 4px; + border: solid 1px #fff; + /* intentionally matches background-color, no visible border until hover/selection */ + background-color: rgba(171, 212, 251, 0); + /* transparent causes black-flash animation problem on webkit */ + -webkit-transition-property: background-color, border; + -moz-transition-property: background-color, border; + transition-property: background-color, border; + -webkit-transition-duration: 0.35s; + -moz-transition-duration: 0.35s; + transition-duration: 0.35s; +} +.claro .dijitCalendarPreviousMonth .dijitCalendarDateLabel, +.claro .dijitCalendarNextMonth .dijitCalendarDateLabel { + color: #759dc0; + border-color: #e5f2fe; + /* intentionally matches background-color, no visible border until hover/selection */ +} +.claro .dijitCalendarYearContainer { + vertical-align: middle; +} +.claro .dijitCalendarYearControl { + padding: 1px 2px 2px 2px; +} +.claro .dijitCalendarYearLabel { + padding: 2px 0 0 0; + margin: 0; + font-size: 1.17em; +} +.claro .dijitCalendarYearLabel span { + /* trying to center next/current/previous year vertically, doesn't work on IE6/7 though */ + vertical-align: middle; +} +.claro .dijitCalendarSelectedYear { + padding: 0 3px; +} +.claro .dijitCalendarNextYear, +.claro .dijitCalendarPreviousYear { + padding: 1px 6px 1px 6px; + font-size: 0.909em; +} +.claro .dijitCalendarSelectedYear { + font-size: 1.091em; + color: #000; +} +/* End Normal Calendar Style */ +/* Hovered Calendar Style */ +.claro .dijitCalendarHoveredDate .dijitCalendarDateLabel, +.claro .dijitCalendarEnabledDate:hover .dijitCalendarDateLabel { + background-color: #abd6ff; + border: solid 1px #759dc0; + color: #000; + -webkit-transition-duration: 0.2s; + -moz-transition-duration: 0.2s; + transition-duration: 0.2s; +} +.claro .dijitCalendarNextYearHover, +.claro .dijitCalendarNextYear:hover, +.claro .dijitCalendarPreviousYearHover, +.claro .dijitCalendarPreviousYear:hover { + color: #000; + border: solid 1px #fff; + padding: 0 5px 0 5px; + /* reduced by 1 to make room for border */ + background-color: #e5f2fe; +} +/* End Hovered Calendar Style */ +/* Active Calendar Style */ +.claro .dijitCalendarNextYearActive, +.claro .dijitCalendarNextYear:active .claro .dijitCalendarPreviousYearActive, +.claro .dijitCalendarPreviousYear:active { + border: solid 1px #759dc0; + padding: 0 5px 0 5px; + /* reduced by 1 to make room for border */ + background-color: #7dbdfa; +} +.claro .dijitCalendarActiveDate .dijitCalendarDateLabel, +.claro .dijitCalendarEnabledDate:active .dijitCalendarDateLabel { + background-color: #7dbdfa; + border: solid 1px #fff; + -webkit-transition-duration: 0.1s; + -moz-transition-duration: 0.1s; + transition-duration: 0.1s; +} +.dj_ie6 .claro .dijitCalendarActiveDate .dijitCalendarDateLabel { + background-image: none; +} +/* End Active Calendar Style */ +/* Selected Calendar Style */ +.claro .dijitCalendarSelectedDate .dijitCalendarDateLabel { + color: #000; + background-color: #abd6ff; + border-color: #759dc0; +} +/* End Selected Calendar Style */ +/* Disabled Calendar Style*/ +.claro .dijitCalendarDisabledDate .dijitCalendarDateLabel { + color: #818181; + text-decoration: line-through; +} +/* End Disabled Calendar Style */ +/* Styling for month DropDownButton */ +.claro .dijitCalendar .dijitDropDownButton { + margin: 0; +} +.claro .dijitCalendar .dijitButtonText { + padding: 1px 0 3px; + margin-right: -4px; +} +.claro .dijitCalendar .dijitDropDownButton .dijitButtonNode { + padding: 0 3px 0 2px; + border: solid 1px #b5bcc7; + -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0); + -moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0); + box-shadow: 0 0 0 rgba(0, 0, 0, 0); + background-color: transparent; + background-image: none; +} +.claro .dijitCalendar .dijitDropDownButtonHover .dijitButtonNode, +.claro .dijitCalendar .dijitDropDownButton:hover .dijitButtonNode { + background-color: #e5f2fe; + border: solid 1px #fff; +} +/* Styling for month drop down list */ +.claro .dijitCalendarMonthMenu { + border-color: #759dc0; + background-color: #fff; + text-align: center; + background-image: none; +} +.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel { + border-top: solid 1px #fff; + /* intentionally invisible until hover */ + border-bottom: solid 1px #fff; + padding: 2px 0; +} +.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover, +.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel:hover { + border-color: #759dc0; + border-width: 1px 0; + background-color: #abd6ff; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr= #ffffff , endColorstr= #abd6ff ); +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar.less new file mode 100644 index 0000000000..8b8f5794f5 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar.less @@ -0,0 +1,277 @@ +/* Calendar + * + * Styling Calendar mainly includes: + * + * 1. Calendar container + * .dijitCalendar - main container + * .dijitCalendarHover / .dijitCalendarActive - states e.g. hover,active + * + * 2. Month + * .dijitCalendarMonthContainer + * .dijitCalendarMonthLabel + * .dijitCalendarDecrease / .dijitCalendarDecrease - icons for switching to previous/next month + * .dijitCalendarArrowActive .dijitCalendarDecrease - states e.g. hover,active + * + * 3. Date + * .dijitCalendarDayLabelTemplate - week day column header e.g. S M T W T F S + * .dijitCalendarDateTemplate - date label wrapper + * .dijitCalendarPreviousMonth .dijitCalendarDateLabel - special labels for previous or next month + * .dijitCalendarSelectedDate .dijitCalendarDateLabel - styles for selected date + * .dijitCalendarDisabledDate .dijitCalendarDateLabel - styles for disabled date + * .dijitCalendarActiveDate .dijitCalendarDateLabel - states e.g. hover,active + * + * 4. Year + * .dijitCalendarYearContainer + * .dijitCalendarYearLabel + * .dijitCalendarPreviousYear /.dijitCalendarNextYear + * .dijitCalendarNextYearHover / .dijitCalendarPreviousYearHover - states e.g. hover,active + * + * 5. Dropdown Month Menu + * .dijitCalendarMonthMenu - menu container + * .dijitCalendarMonthMenu .dijitCalendarMonthLabel - month label in menu item + * .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover - menu item hover state + */ + +@import "variables"; + +.claro .dijitCalendar { + border: solid 1px @border-color; + border-collapse: separate; // in case user CSS has set border-collapse: collapse for tables + .border-radius(4px); + + // Background color and alpha-gradient + background-color: @calendar-background-color; + background-image: url("images/calendar.png"); // fallback for browsers that don't support CSS gradients + background-repeat: repeat-x; // so bottom of calendar isn't affected by gradient image repeating + .alpha-white-gradient(1, 0px, 0.4, 2px, 0, 100%); + + text-align:center; + padding:6px 5px 3px 5px; +} +.dj_ie6 .claro .dijitCalendar { + background-image:none; // because on IE6 background-image overrides background-color +} +.claro .dijitCalendar img { + border:none; +} +.claro .dijitCalendarHover, .claro .dijitCalendar:hover, +.claro .dijitCalendarActive { + /* treat dijitCalendarActive like hover since there's + * no concept of clicking a Calendar as a whole (although you can click things inside the calendar) + */ + background-color: @hovered-background-color; + border:solid 1px @hovered-border-color; +} +.claro .dijitCalendarMonthContainer th { + text-align:center; + padding-bottom:4px; + vertical-align:middle; +} +.claro .dijitCalendarMonthLabel { + color: @text-color; + font-size: 1.091em; + padding: 0 4px; +} + +/* next/previous month arrows */ +.claro .dijitCalendarIncrementControl { + width:18px; + height:16px; + background-image: url(@image-calendar-arrows); + background-repeat: no-repeat; +} +.dj_ie6 .claro .dijitCalendarIncrementControl { + background-image: url(@image-calendar-arrows-ie6); +} +.claro .dijitCalendarIncrease { + background-position:-18px 0; +} +.claro .dijitCalendarArrowHover .dijitCalendarDecrease, +.claro .dijitCalendarArrow:hover .dijitCalendarDecrease { + background-position:-36px 0; +} +.claro .dijitCalendarArrowHover .dijitCalendarIncrease, +.claro .dijitCalendarArrow:hover .dijitCalendarIncrease { + background-position:-55px 0; +} +.claro .dijitCalendarArrowActive .dijitCalendarDecrease, +.claro .dijitCalendarArrow:active .dijitCalendarDecrease { + background-position:-72px 0; +} +.claro .dijitCalendarArrowActive .dijitCalendarIncrease, +.claro .dijitCalendarArrow:active .dijitCalendarIncrease { + background-position:-91px 0; +} +.claro .dijitA11ySideArrow { + /* text +/- labels instead of arrow icons, for high contrast mode */ + display: none; +} + +.claro .dijitCalendarDayLabelTemplate { + padding-bottom:0; + text-align:center; + border-bottom:1px solid @border-color; + padding:0 3px 2px; +} +.claro .dijitCalendarDayLabel { + padding:0 4px 0 4px; + font-weight:bold; + font-size:0.909em; + text-align:center; + color: @text-color; +} +.claro .dijitCalendarDateTemplate { + text-align:center; + background-color:@calendar-currentmonth-background-color; + border-bottom: 1px solid @minor-border-color; + padding-top:0; + font-size:0.909em; + font-family: Arial; + font-weight:bold; + letter-spacing:.05em; + text-align:center; + color: @text-color; +} +.dj_ie6 .claro .dijitCalendarDateTemplate { + background-image: none; +} +.claro .dijitCalendarPreviousMonth, +.claro .dijitCalendarNextMonth { + background-color: @calendar-adjacentmonth-background-color; + background-image:none; + border-bottom:solid 1px @minor-border-color; /* todo: redundant with above .dijitCalendarDateTemplate rule */ +} +.claro .dijitCalendarDateTemplate .dijitCalendarDateLabel { + text-decoration:none; + display:block; + padding:3px 5px 3px 4px; + border:solid 1px @calendar-currentmonth-background-color; /* intentionally matches background-color, no visible border until hover/selection */ + background-color:rgba(171,212,251,0); /* transparent causes black-flash animation problem on webkit */ + .transition-property(background-color, border); + .transition-duration(.35s); +} +.claro .dijitCalendarPreviousMonth .dijitCalendarDateLabel, +.claro .dijitCalendarNextMonth .dijitCalendarDateLabel{ + color: @calendar-adjacentmonth-text-color; + border-color: @calendar-adjacentmonth-background-color; /* intentionally matches background-color, no visible border until hover/selection */ +} + +.claro .dijitCalendarYearContainer { + vertical-align:middle; +} +.claro .dijitCalendarYearControl { + padding: 1px 2px 2px 2px; +} +.claro .dijitCalendarYearLabel { + padding: 2px 0 0 0; + margin: 0; + font-size: 1.17em; +} +.claro .dijitCalendarYearLabel span { + /* trying to center next/current/previous year vertically, doesn't work on IE6/7 though */ + vertical-align:middle; +} +.claro .dijitCalendarSelectedYear { + padding:0 3px; +} +.claro .dijitCalendarNextYear, +.claro .dijitCalendarPreviousYear { + padding: 1px 6px 1px 6px; + font-size:0.909em; +} +.claro .dijitCalendarSelectedYear { + font-size:1.091em; + color:@selected-text-color; +} +/* End Normal Calendar Style */ +/* Hovered Calendar Style */ +.claro .dijitCalendarHoveredDate .dijitCalendarDateLabel, +.claro .dijitCalendarEnabledDate:hover .dijitCalendarDateLabel { + background-color:@hovered-background-color; + border:solid 1px @hovered-border-color; + color:@hovered-text-color; + .transition-duration(.2s); +} +.claro .dijitCalendarNextYearHover, .claro .dijitCalendarNextYear:hover, +.claro .dijitCalendarPreviousYearHover, .claro .dijitCalendarPreviousYear:hover { + color:@hovered-text-color; + border:solid 1px @calendar-button-hovered-border-color; + padding: 0 5px 0 5px; /* reduced by 1 to make room for border */ + background-color: @calendar-button-hovered-background-color; +} +/* End Hovered Calendar Style */ +/* Active Calendar Style */ +.claro .dijitCalendarNextYearActive, .claro .dijitCalendarNextYear:active +.claro .dijitCalendarPreviousYearActive, .claro .dijitCalendarPreviousYear:active { + border: solid 1px @calendar-button-pressed-border-color; + padding: 0 5px 0 5px; /* reduced by 1 to make room for border */ + background-color:@calendar-button-pressed-background-color; +} +.claro .dijitCalendarActiveDate .dijitCalendarDateLabel, +.claro .dijitCalendarEnabledDate:active .dijitCalendarDateLabel { + background-color: @calendar-date-pressed-background-color; + border:solid 1px @calendar-date-pressed-border-color; + .transition-duration(.1s); +} +.dj_ie6 .claro .dijitCalendarActiveDate .dijitCalendarDateLabel { + background-image:none; +} +/* End Active Calendar Style */ +/* Selected Calendar Style */ +.claro .dijitCalendarSelectedDate .dijitCalendarDateLabel { + color:@selected-text-color; + background-color: @calendar-date-selected-background-color; + border-color: @calendar-date-selected-border-color; +} +/* End Selected Calendar Style */ +/* Disabled Calendar Style*/ +.claro .dijitCalendarDisabledDate .dijitCalendarDateLabel { + color: @disabled-text-color; + text-decoration:line-through; +} + +/* End Disabled Calendar Style */ + +/* Styling for month DropDownButton */ + +.claro .dijitCalendar .dijitDropDownButton { + margin: 0; +} +.claro .dijitCalendar .dijitButtonText { + padding: 1px 0 3px; + margin-right:-4px; +} +.claro .dijitCalendar .dijitDropDownButton .dijitButtonNode { + padding: 0 3px 0 2px; + border:solid 1px @border-color; + .box-shadow(0 0 0 rgba(0,0,0,0)); + + // Override background settings from vanilla .dijitButtonNode. We want to inherit background of Calendar. + background-color: transparent; + background-image: none; +} +.claro .dijitCalendar .dijitDropDownButtonHover .dijitButtonNode, +.claro .dijitCalendar .dijitDropDownButton:hover .dijitButtonNode { + background-color: @calendar-button-hovered-background-color; + border:solid 1px @calendar-button-hovered-border-color; +} + +/* Styling for month drop down list */ + +.claro .dijitCalendarMonthMenu { + border-color: @popup-border-color; + background-color: @menu-background-color; + text-align:center; + background-image: none; +} +.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel { + border-top: solid 1px @menu-background-color; /* intentionally invisible until hover */ + border-bottom: solid 1px @menu-background-color; + padding: 2px 0; +} +.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover, +.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel:hover { + border-color: @hovered-border-color; + border-width:1px 0; + .gradient-and-filter(@hovered-background-color, 70, 0); +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar_rtl.css new file mode 100644 index 0000000000..5892a64bf8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar_rtl.css @@ -0,0 +1,18 @@ +.claro .dijitCalendarRtl .dijitCalendarIncrease { + background-position: 0 0; +} +.claro .dijitCalendarRtl .dijitCalendarDecrease { + background-position: -18px 0; +} +.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarIncrease { + background-position: -36px 0; +} +.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarDecrease { + background-position: -55px 0; +} +.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarIncrease { + background-position: -72px 0; +} +.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarDecrease { + background-position: -91px 0; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar_rtl.less new file mode 100644 index 0000000000..713717bd7d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Calendar_rtl.less @@ -0,0 +1,19 @@ +.claro .dijitCalendarRtl .dijitCalendarIncrease{ + background-position: 0 0; +} +.claro .dijitCalendarRtl .dijitCalendarDecrease { + background-position: -18px 0; +} +.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarIncrease { + background-position: -36px 0; +} +.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarDecrease { + background-position: -55px 0; +} +.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarIncrease { + background-position: -72px 0; +} +.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarDecrease { + background-position: -91px 0; +} + diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ColorPalette.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ColorPalette.css new file mode 100644 index 0000000000..b4e5bd3e73 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ColorPalette.css @@ -0,0 +1,41 @@ +/* ColorPalette + * + * Styling of the ColorPalette consists of the following: + * + * 1. the whole color palette + * .dijitColorPalette - for outline, border, and background color of the whole color palette + * Note: outline does not work for IE + * + * 2. the color swatch + * .dijitColorPalette .dijitPaletteImg + * transparent (but clickable) node inside of each , overlaying the color swatch. + * displays border around a color swatch + * + * 3. hovered swatch + * .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg + * the hovered state of the color swatch - adds border + * + * 4. active and selected swatch + * .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg + * .dijitColorPalette .dijitPaletteCellSelected .dijitPaletteImg + * adds border for active or selected state + */ +.claro .dijitColorPalette { + border: 1px solid #b5bcc7; + background: #fff; + -moz-border-radius: 0; + border-radius: 0; +} +.claro .dijitColorPalette .dijitPaletteImg { + /* transparent (but clickable) node inside of each , overlaying the color swatch. + * displays border around a color swatch + * overrides border color in dijit.css */ + border: 1px solid #d3d3d3; +} +.claro .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg { + border: 1px solid #000; +} +.claro .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg, +.claro .dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg { + border: 2px solid #000; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ColorPalette.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ColorPalette.less new file mode 100644 index 0000000000..ffa3ac0513 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ColorPalette.less @@ -0,0 +1,44 @@ +/* ColorPalette + * + * Styling of the ColorPalette consists of the following: + * + * 1. the whole color palette + * .dijitColorPalette - for outline, border, and background color of the whole color palette + * Note: outline does not work for IE + * + * 2. the color swatch + * .dijitColorPalette .dijitPaletteImg + * transparent (but clickable) node inside of each , overlaying the color swatch. + * displays border around a color swatch + * + * 3. hovered swatch + * .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg + * the hovered state of the color swatch - adds border + * + * 4. active and selected swatch + * .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg + * .dijitColorPalette .dijitPaletteCellSelected .dijitPaletteImg + * adds border for active or selected state + */ + +@import "variables"; + +.claro .dijitColorPalette { + border: 1px solid @border-color; + background: @colorpalette-background-color; + .border-radius(0); +} + +.claro .dijitColorPalette .dijitPaletteImg { + /* transparent (but clickable) node inside of each , overlaying the color swatch. + * displays border around a color swatch + * overrides border color in dijit.css */ + border: 1px solid @minor-border-color; +} +.claro .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg { + border: 1px solid @swatch-hovered-border-color; +} +.claro .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg, +.claro .dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg { + border: 2px solid @swatch-selected-border-color; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Common.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Common.css new file mode 100644 index 0000000000..2d89fff739 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Common.css @@ -0,0 +1,98 @@ +/* ========= Styling rules to affect widgets ========= */ +.claro .dijitPopup { + -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); +} +.claro .dijitTooltipDialogPopup { + /* exception popups: do not use a shadow on these because they aren't rectangular */ + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +/* The highlight is shown in the ComboBox menu. TODO: move to form/Common.less */ +.claro .dijitComboBoxHighlightMatch { + background-color: #abd6ff; +} +.claro .dijitFocusedLabel { + /* for checkboxes or radio buttons, hatch border around the corresponding label, to indicate focus */ + outline: 1px dotted #494949; +} +/* Drag and Drop*/ +.claro .dojoDndItem { + border-color: rgba(0, 0, 0, 0); + -webkit-transition-duration: 0.25s; + -moz-transition-duration: 0.25s; + transition-duration: 0.25s; + -webkit-transition-property: background-color, border-color; + -moz-transition-property: background-color, border-color; + transition-property: background-color, border-color; +} +.claro .dojoDndItemOver { + background-color: #abd6ff; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 1px; + border: solid 1px #759dc0; + color: #000; +} +.claro .dojoDndItemAnchor, +.claro .dojoDndItemSelected { + background-color: #cfe5fa; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 1px; + border: solid 1px #759dc0; + color: #000; +} +.claro .dojoDndItemBefore, +.claro .dojoDndItemAfter { + border-color: #759dc0; +} +.claro table.dojoDndAvatar { + border: 1px solid #b5bcc7; + border-collapse: collapse; + background-color: #fff; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); +} +.claro .dojoDndAvatarHeader td { + height: 20px; + padding-left: 21px; +} +.claro.dojoDndMove .dojoDndAvatarHeader, +.claro.dojoDndCopy .dojoDndAvatarHeader { + background-image: url("images/dnd.png"); + background-repeat: no-repeat; + background-position: 2px -122px; +} +.claro .dojoDndAvatarItem td { + padding: 5px; +} +.claro.dojoDndMove .dojoDndAvatarHeader { + background-color: #f58383; + background-position: 2px -103px; +} +.claro.dojoDndCopy .dojoDndAvatarHeader { + background-color: #f58383; + background-position: 2px -68px; +} +.claro.dojoDndMove .dojoDndAvatarCanDrop .dojoDndAvatarHeader { + background-color: #97e68d; + background-position: 2px -33px; +} +.claro.dojoDndCopy .dojoDndAvatarCanDrop .dojoDndAvatarHeader { + background-color: #97e68d; + background-position: 2px 2px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Common.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Common.less new file mode 100644 index 0000000000..078d6fdca8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Common.less @@ -0,0 +1,86 @@ +/* ========= Styling rules to affect widgets ========= */ + +@import "variables"; + +.claro .dijitPopup { + .box-shadow(0 1px 5px rgba(0,0,0,0.25)); +} +.claro .dijitTooltipDialogPopup { + /* exception popups: do not use a shadow on these because they aren't rectangular */ + .box-shadow(none); +} + +/* The highlight is shown in the ComboBox menu. TODO: move to form/Common.less */ +.claro .dijitComboBoxHighlightMatch { + background-color: @select-matchedtext-background-color; +} + +.claro .dijitFocusedLabel { + /* for checkboxes or radio buttons, hatch border around the corresponding label, to indicate focus */ + outline: 1px dotted @focus-outline-color; +} + +/* Drag and Drop*/ +.claro .dojoDndItem { + border-color: rgba(0,0,0,0); // rgba() instead of none to prevent flash on hover fade-in + .transition-duration(.25s); + .transition-property(background-color, border-color) +} +.claro .dojoDndItemOver { + // Hovered item. Matches dijitTreeRowHover. + background-color:@hovered-background-color; + .standard-gradient; + padding: 1px; // reduce from 2px in dijit.css + border:solid 1px @hovered-border-color; + color:@hovered-text-color; +} +.claro .dojoDndItemAnchor, +.claro .dojoDndItemSelected { + // Selected items(s). Matches dijitTreeRowSelected. + background-color:@selected-background-color; + .standard-gradient; + padding: 1px; // reduce from 2px in dijit.css + border:solid 1px @selected-border-color; + color:@selected-text-color; +} + +.claro .dojoDndItemBefore, +.claro .dojoDndItemAfter { + // line to indicate that user is dropping before/after this dojoDndItem + border-color: @dnd-dropseparator-color; +} + +.claro table.dojoDndAvatar { + border: 1px solid @border-color; + border-collapse: collapse; + background-color: @dnd-avatar-background-color; + .box-shadow(0 1px 3px rgba(0, 0, 0, .25)); +} +.claro .dojoDndAvatarHeader td { + height: 20px; + padding-left:21px; +} +.claro.dojoDndMove .dojoDndAvatarHeader, .claro.dojoDndCopy .dojoDndAvatarHeader { + background-image: url(@image-dnd); + background-repeat: no-repeat; + background-position:2px -122px; +} +.claro .dojoDndAvatarItem td { + padding: 5px; +} +.claro.dojoDndMove .dojoDndAvatarHeader { + background-color: @dnd-avatar-header-background-color; + background-position:2px -103px; +} +.claro.dojoDndCopy .dojoDndAvatarHeader { + background-color: @dnd-avatar-header-background-color; + background-position:2px -68px; +} +.claro.dojoDndMove .dojoDndAvatarCanDrop .dojoDndAvatarHeader { + background-color: @dnd-avatar-candrop-header-background-color; + background-position:2px -33px; +} +.claro.dojoDndCopy .dojoDndAvatarCanDrop .dojoDndAvatarHeader { + background-color: @dnd-avatar-candrop-header-background-color; + background-position:2px 2px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog.css new file mode 100644 index 0000000000..f0e98797d0 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog.css @@ -0,0 +1,205 @@ +/* Dialog + * + * Styling Dialog includes two sections: Dialog and Tooltip & TooltipDialog + * + * Dialog: + * 1. Dialog (default styling): + * .dijitDialog - styles for dialog's bounding box + * + * 2. Dialog title + * .dijitDialogTitleBar - styles for the title container at the top of dialog + * .dijitDialogTitle - the text container in dialog title + * + * 3. Dialog content + * .dijitDialogPaneContent - main container for content area and action bar + * .dijitDialogPaneContentArea - styles for content container + * + * 4. Dialog action bar + * .dijitDialogPaneActionBar - styles for action buttons lie at the bottom of dialog pane content + * + * 5. Dialog underlay + * .dijitDialogUnderlay - div under the dialog which used for separate dialog and page content + * + * + * Tooltip & TooltipDialog: + * 1. tooltip content container: + * .dijitTooltipContainer - tooltip content container + * + * 2. tooltip connector: + * .dijitTooltipConnector - tooltip anchor includes 4 direction(up, down, left, right) + */ +.claro .dijitDialog { + border: 1px solid #759dc0; + -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); +} +.claro .dijitDialogPaneContent { + background: #fff repeat-x top left; + border-top: 1px solid #759dc0; + padding: 10px 8px; + position: relative; +} +.claro .dijitDialogPaneContentArea { + /* trick to get action bar (gray bar at bottom with OK/cancel buttons) to span from + * left to right but still indent dialog content + */ + margin: -10px -8px; + padding: 10px 8px; +} +.claro .dijitDialogPaneActionBar { + /* gray bar at bottom of dialog with OK/Cancel buttons */ + background-color: #efefef; + padding: 3px 5px 2px 7px; + text-align: right; + border-top: 1px solid #d3d3d3; + margin: 10px -8px -10px; +} +.claro .dijitTooltipDialog .dijitDialogPaneActionBar { + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; + margin: 10px -10px -8px; +} +.claro .dijitDialogPaneActionBar .dijitButton { + float: none; +} +.claro .dijitDialogTitleBar { + /* outer container for the titlebar of the dialog */ + border: 1px solid #fff; + border-top: none; + background-color: #abd6ff; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 5px 7px 4px 7px; +} +.claro .dijitDialogTitle { + /* typography and styling of the dialog title */ + padding: 0 1px; + font-size: 1.091em; + color: #000; +} +.claro .dijitDialogCloseIcon { + /* the default close icon for the dialog */ + background: url("images/dialogCloseIcon.png"); + background-repeat: no-repeat; + position: absolute; + right: 5px; + height: 15px; + width: 21px; +} +.dj_ie6 .claro .dijitDialogCloseIcon { + background-image: url("images/dialogCloseIcon8bit.png"); +} +.claro .dijitDialogCloseIconHover { + background-position: -21px; +} +.claro .dijitDialogCloseIconActive { + background-position: -42px; +} +/* Tooltip and TooltipDialog */ +.claro .dijitTooltip, +.claro .dijitTooltipDialog { + /* the outermost dom node, holding the connector and container */ + background: transparent; + /* make the area on the sides of the arrow transparent */ +} +.dijitTooltipBelow { + /* leave room for arrow above content */ + padding-top: 13px; + padding-left: 3px; + padding-right: 3px; +} +.dijitTooltipAbove { + /* leave room for arrow below content */ + padding-bottom: 13px; + padding-left: 3px; + padding-right: 3px; +} +.claro .dijitTooltipContainer { + /* the part with the text */ + background-color: #fff; + background-image: -moz-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #fff 10px); + background-image: -webkit-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #fff 10px); + background-image: -o-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #fff 10px); + background-image: -ms-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #fff 10px); + background-position: bottom; + border: 1px solid #759dc0; + padding: 6px 8px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); + font-size: 1em; + color: #000; +} +.claro .dijitTooltipConnector { + /* the arrow piece */ + border: 0; + z-index: 2; + background-image: url("images/tooltip.png"); + background-repeat: no-repeat; + width: 16px; + height: 14px; +} +.dj_ie6 .claro .dijitTooltipConnector { + background-image: url("images/tooltip8bit.png"); +} +.claro .dijitTooltipABRight .dijitTooltipConnector { + /* above or below tooltip, but the arrow appears on the right, + and the right edges of target and tooltip are aligned rather than the left */ + left: auto !important; + right: 3px; +} +.claro .dijitTooltipBelow .dijitTooltipConnector { + /* the arrow piece for tooltips below an element */ + top: 0; + left: 3px; + background-position: -31px 0; + width: 16px; + height: 14px; +} +.claro .dijitTooltipAbove .dijitTooltipConnector { + /* the arrow piece for tooltips above an element */ + bottom: 0; + left: 3px; + background-position: -15px 0; + width: 16px; + height: 14px; +} +.dj_ie7 .claro .dijitTooltipAbove .dijitTooltipConnector, +.dj_ie6 .claro .dijitTooltipAbove .dijitTooltipConnector { + bottom: -1px; +} +.claro .dijitTooltipLeft { + padding-right: 14px; +} +.claro .dijitTooltipLeft .dijitTooltipConnector { + /* the arrow piece for tooltips to the left of an element, bottom borders aligned */ + right: 0; + background-position: 0 0; + width: 16px; + height: 14px; +} +.claro .dijitTooltipRight { + padding-left: 14px; +} +.claro .dijitTooltipRight .dijitTooltipConnector { + /* the arrow piece for tooltips to the right of an element, bottom borders aligned */ + left: 0; + background-position: -48px 0; + width: 16px; + height: 14px; +} +.claro .dijitDialogUnderlay { + background: #fff; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog.less new file mode 100644 index 0000000000..8b5b386734 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog.less @@ -0,0 +1,209 @@ +/* Dialog + * + * Styling Dialog includes two sections: Dialog and Tooltip & TooltipDialog + * + * Dialog: + * 1. Dialog (default styling): + * .dijitDialog - styles for dialog's bounding box + * + * 2. Dialog title + * .dijitDialogTitleBar - styles for the title container at the top of dialog + * .dijitDialogTitle - the text container in dialog title + * + * 3. Dialog content + * .dijitDialogPaneContent - main container for content area and action bar + * .dijitDialogPaneContentArea - styles for content container + * + * 4. Dialog action bar + * .dijitDialogPaneActionBar - styles for action buttons lie at the bottom of dialog pane content + * + * 5. Dialog underlay + * .dijitDialogUnderlay - div under the dialog which used for separate dialog and page content + * + * + * Tooltip & TooltipDialog: + * 1. tooltip content container: + * .dijitTooltipContainer - tooltip content container + * + * 2. tooltip connector: + * .dijitTooltipConnector - tooltip anchor includes 4 direction(up, down, left, right) + */ + +@import "variables"; + +.claro .dijitDialog { + border: 1px solid @popup-border-color; + .box-shadow(0 1px 5px rgba(0,0,0,0.25)); +} + +.claro .dijitDialogPaneContent { + background: @pane-background-color repeat-x top left; + border-top: 1px solid @popup-border-color; + padding:10px 8px; + position: relative; +} + +.claro .dijitDialogPaneContentArea { + /* trick to get action bar (gray bar at bottom with OK/cancel buttons) to span from + * left to right but still indent dialog content + */ + margin: -10px -8px; + padding: 10px 8px; +} + +.claro .dijitDialogPaneActionBar { + /* gray bar at bottom of dialog with OK/Cancel buttons */ + background-color: @bar-background-color; + padding: 3px 5px 2px 7px; + text-align: right; + border-top: 1px solid @minor-border-color; + margin: 10px -8px -10px; +} +.claro .dijitTooltipDialog .dijitDialogPaneActionBar { + -webkit-border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; + -moz-border-radius-bottomright: 4px; + -moz-border-radius-bottomleft: 4px; + margin: 10px -10px -8px; +} +.claro .dijitDialogPaneActionBar .dijitButton { + float: none; +} + +.claro .dijitDialogTitleBar { + /* outer container for the titlebar of the dialog */ + border: 1px solid @dialog-titlebar-border-color; + border-top:none; + background-color: @dialog-titlebar-background-color; + .standard-gradient; + padding: 5px 7px 4px 7px; +} + +.claro .dijitDialogTitle { + /* typography and styling of the dialog title */ + padding: 0 1px; + font-size:1.091em; + color: @text-color; +} + +.claro .dijitDialogCloseIcon { + /* the default close icon for the dialog */ + background: url(@image-dialog-close); + background-repeat:no-repeat; + position: absolute; + right: 5px; + height: 15px; + width: 21px; +} +.dj_ie6 .claro .dijitDialogCloseIcon { + background-image: url(@image-dialog-close-ie6); +} +.claro .dijitDialogCloseIconHover { + background-position:-21px; +} +.claro .dijitDialogCloseIconActive { + background-position:-42px; +} + +/* Tooltip and TooltipDialog */ + +.claro .dijitTooltip, +.claro .dijitTooltipDialog { + /* the outermost dom node, holding the connector and container */ + background: transparent; /* make the area on the sides of the arrow transparent */ +} +.dijitTooltipBelow { + /* leave room for arrow above content */ + padding-top: 13px; + padding-left:3px; + padding-right:3px; +} + +.dijitTooltipAbove { + /* leave room for arrow below content */ + padding-bottom: 13px; + padding-left:3px; + padding-right:3px; +} + +.claro .dijitTooltipContainer { + /* the part with the text */ + background-color:@popup-background-color; + .linear-gradient(bottom, @tooltip-gradient-color 0px, @popup-background-color 10px); + background-position:bottom; + border:1px solid @popup-border-color; + padding:6px 8px; + .border-radius(4px); + .box-shadow(0 1px 3px rgba(0,0,0,0.25)); + font-size: 1em; + color: @text-color; +} + +.claro .dijitTooltipConnector { + /* the arrow piece */ + border: 0; + z-index: 2; + background-image:url(@image-tooltip); + background-repeat:no-repeat; + width:16px; + height:14px; +} +.dj_ie6 .claro .dijitTooltipConnector { + background-image:url(@image-tooltip-ie6); +} +.claro .dijitTooltipABRight .dijitTooltipConnector { + /* above or below tooltip, but the arrow appears on the right, + and the right edges of target and tooltip are aligned rather than the left */ + left: auto !important; + right: 3px; +} + +.claro .dijitTooltipBelow .dijitTooltipConnector { + /* the arrow piece for tooltips below an element */ + top: 0; + left: 3px; + background-position:-31px 0; + width:16px; + height:14px; +} + +.claro .dijitTooltipAbove .dijitTooltipConnector { + /* the arrow piece for tooltips above an element */ + bottom: 0; + left: 3px; + background-position:-15px 0; + width:16px; + height:14px; +} +.dj_ie7 .claro .dijitTooltipAbove .dijitTooltipConnector, +.dj_ie6 .claro .dijitTooltipAbove .dijitTooltipConnector { + bottom: -1px; +} + +.claro .dijitTooltipLeft { + padding-right: 14px; +} +.claro .dijitTooltipLeft .dijitTooltipConnector { + /* the arrow piece for tooltips to the left of an element, bottom borders aligned */ + right: 0; + background-position:0 0; + width:16px; + height:14px; +} + +.claro .dijitTooltipRight { + padding-left: 14px; +} +.claro .dijitTooltipRight .dijitTooltipConnector { + /* the arrow piece for tooltips to the right of an element, bottom borders aligned */ + left: 0; + background-position:-48px 0; + width:16px; + height:14px; +} + +.claro .dijitDialogUnderlay { + background: @dialog-underlay-color; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog_rtl.css new file mode 100644 index 0000000000..34930eb644 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog_rtl.css @@ -0,0 +1,9 @@ +/* Dialog */ +.claro .dijitDialogRtl .dijitDialogCloseIcon { + right: auto; + left: 5px; +} +.claro .dijitDialogRtl .dijitDialogPaneActionBar { + text-align: left; + padding: 3px 7px 2px 5px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog_rtl.less new file mode 100644 index 0000000000..452fe930b1 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Dialog_rtl.less @@ -0,0 +1,13 @@ +/* Dialog */ + +@import "variables"; + +.claro .dijitDialogRtl .dijitDialogCloseIcon { + right: auto; + left: 5px; +} + +.claro .dijitDialogRtl .dijitDialogPaneActionBar { + text-align: left; + padding: 3px 7px 2px 5px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor.css new file mode 100644 index 0000000000..e9abea9706 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor.css @@ -0,0 +1,55 @@ +/* Editor + * + * Styling Editor means styling the Editor inside iframe container (dijitEditorIFrameContainer) + * + * 1. Editor iframe container (default styling): + * .dijitEditorIFrameContainer - normal state styles: background-color, border, padding + * + * 2. hovered Editor iframe container (ie, mouse hover on editor) + * .dijitEditorHover .dijitEditorIFrameContainer/dijitEditorIFrame - styles when mouse hover on the container + * + * 3. focused Editor iframe container (ie, mouse focus on the editor pane) + * .dijitEditorFocused .dijitEditorIFrameContainer/dijitEditorIFrame - styles when container focused + * + * 3. disabled Editor iframe container + * .dijitEditorDisabled - editor's inner iframe container disable status styles: background, border + */ +.claro .dijitEditorIFrameContainer { + padding: 3px 3px 1px 10px; +} +.claro .dijitEditorIFrame { + background-color: #fff; +} +.claro .dijitEditor { + border: 1px solid #b5bcc7; +} +.claro .dijitEditor .dijitEditorIFrameContainer { + background-color: #fff; + background-repeat: repeat-x; +} +.claro .dijitEditorHover .dijitEditorIFrameContainer, +.claro .dijitEditorHover .dijitEditorIFrameContainer .dijitEditorIFrame { + background-color: #e5f2fe; +} +.claro .dijitEditorFocused .dijitEditorIFrameContainer, +.claro .dijitEditorFocused .dijitEditorIFrameContainer .dijitEditorIFrame { + background-color: #fff; +} +.claro .dijitEditorHover .dijitEditorIFrameContainer, +.claro .dijitEditorFocused .dijitEditorIFrameContainer { + background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); +} +/* Disabled */ +.claro .dijitEditorDisabled { + border: 1px solid #d3d3d3; + color: #818181; +} +.claro .dijitDisabled .dijitEditorIFrame, +.claro .dijitDisabled .dijitEditorIFrameContainer, +.claro .dijitDisabled .dijitEditorIFrameContainer .dijitEditorIFrame { + background-color: #efefef; + background-image: none; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor.less new file mode 100644 index 0000000000..ddc59ccb41 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor.less @@ -0,0 +1,57 @@ +/* Editor + * + * Styling Editor means styling the Editor inside iframe container (dijitEditorIFrameContainer) + * + * 1. Editor iframe container (default styling): + * .dijitEditorIFrameContainer - normal state styles: background-color, border, padding + * + * 2. hovered Editor iframe container (ie, mouse hover on editor) + * .dijitEditorHover .dijitEditorIFrameContainer/dijitEditorIFrame - styles when mouse hover on the container + * + * 3. focused Editor iframe container (ie, mouse focus on the editor pane) + * .dijitEditorFocused .dijitEditorIFrameContainer/dijitEditorIFrame - styles when container focused + * + * 3. disabled Editor iframe container + * .dijitEditorDisabled - editor's inner iframe container disable status styles: background, border + */ + +@import "variables"; + +.claro .dijitEditorIFrameContainer{ + padding:3px 3px 1px 10px; +} +.claro .dijitEditorIFrame { + background-color: @textbox-background-color; +} +.claro .dijitEditor { + border: 1px solid @border-color; +} +.claro .dijitEditor .dijitEditorIFrameContainer{ + background-color: @textbox-background-color; + background-repeat:repeat-x; +} +.claro .dijitEditorHover .dijitEditorIFrameContainer, +.claro .dijitEditorHover .dijitEditorIFrameContainer .dijitEditorIFrame{ + background-color: @textbox-hovered-background-color; +} +.claro .dijitEditorFocused .dijitEditorIFrameContainer, +.claro .dijitEditorFocused .dijitEditorIFrameContainer .dijitEditorIFrame{ + background-color: @textbox-focused-background-color; +} +.claro .dijitEditorHover .dijitEditorIFrameContainer, +.claro .dijitEditorFocused .dijitEditorIFrameContainer { + .textbox-background-image; +} + +/* Disabled */ +.claro .dijitEditorDisabled { + border: 1px solid @disabled-border-color; + color: @disabled-text-color; +} + +.claro .dijitDisabled .dijitEditorIFrame, +.claro .dijitDisabled .dijitEditorIFrameContainer, +.claro .dijitDisabled .dijitEditorIFrameContainer .dijitEditorIFrame { + background-color: @textbox-disabled-background-color; + background-image: none; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor_rtl.css new file mode 100644 index 0000000000..f633558670 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor_rtl.css @@ -0,0 +1,4 @@ +/* Editor */ +.claro .dijitEditorRtl .dijitEditorIFrameContainer { + padding: 3px 10px 1px 3px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor_rtl.less new file mode 100644 index 0000000000..8ebc013d9b --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Editor_rtl.less @@ -0,0 +1,9 @@ +/* Editor */ + +@import "variables"; + +.claro .dijitEditorRtl .dijitEditorIFrameContainer{ + padding:3px 10px 1px 3px; +} + + diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/InlineEditBox.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/InlineEditBox.css new file mode 100644 index 0000000000..0cd14579d9 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/InlineEditBox.css @@ -0,0 +1,20 @@ +/* InlineEditBox + * + * Styling InlineEditBox mainly includes: + * + * 1. Normal state + * .dijitInlineEditBoxDisplayMode - for border + * + * 2. Hover state + * .dijitInlineEditBoxDisplayModeHover - for border and background color + */ +.claro .dijitInlineEditBoxDisplayMode { + border: 1px solid transparent; +} +.claro .dijitInlineEditBoxDisplayModeHover { + background-color: #e5f2fe; + border: solid 1px #759dc0; +} +.dj_ie6 .claro .dijitInlineEditBoxDisplayMode { + border: none; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/InlineEditBox.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/InlineEditBox.less new file mode 100644 index 0000000000..a7162be1b3 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/InlineEditBox.less @@ -0,0 +1,25 @@ +/* InlineEditBox + * + * Styling InlineEditBox mainly includes: + * + * 1. Normal state + * .dijitInlineEditBoxDisplayMode - for border + * + * 2. Hover state + * .dijitInlineEditBoxDisplayModeHover - for border and background color + */ + +@import "variables"; + +.claro .dijitInlineEditBoxDisplayMode { + border: 1px solid transparent; +} + +.claro .dijitInlineEditBoxDisplayModeHover { + background-color: @textbox-hovered-background-color; + border: solid 1px @hovered-border-color; +} + +.dj_ie6 .claro .dijitInlineEditBoxDisplayMode { + border: none; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu.css new file mode 100644 index 0000000000..df087e1936 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu.css @@ -0,0 +1,183 @@ +/* Menu + +There are three areas of styling for the Menu: + + 1. The menu + There are three types of menus: + i) Context Menu + ii) Drop down Menu + iii) Navigation Menu + All three types of menus are affected by the .dijitMenu class in which you can set the background-color, padding and border + .dijitMenu affects the drop down menu in TimeTextBox, Calendar, ComboBox and FilteringSelect + .dijitMenuTable - for padding - also affects Select widget + + 2. The menu bar + .dijitMenuBar - for border, margins, padding, background-color of the menu bar + .dijitMenuBar .dijitMenuItem - for padding, text color of menu items in the menu bar (overrides .dijitMenuItem) + + 3. Menu items - items in the menu. + .dijitMenuItem - for color + .dijitMenuItemHover, .dijitMenuItemSelected - for background-color, border, text color, padding of a menu item or menubar item that has been hovered over or selected + .dijitMenuItemActive - for background-color of an active (mousedown) menu item + td.dijitMenuItemIconCell - for padding around a menu item's icon + td.dijitMenuItemLabel - for padding around a menu item's label + .dijitMenuSeparatorTop - for border, top border, of the separator + .dijitMenuSeparatorBottom - for bottom margin of the separator + + Styles specific to ComboBox and FilteringSelect widgets: + .dijitComboBoxMenu .dijitMenuItem - for padding and border of a menu item in a ComboBox or FilteringSelect widget's menu + .dijitComboBoxMenu .dijitMenuItemSelected- for text color, background-color and border of a menu item in a ComboBox or FilteringSelect widget's menu + +*/ +.claro .dijitMenuBar { + border: 1px solid #b5bcc7; + margin: 0; + padding: 0; + background-color: #efefef; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.claro .dijitMenu { + background-color: #fff; + border: 1px solid #759dc0; + /* so adjoining borders of MenuBar/ComboBox and Menu overlap, avoiding double border */ + margin: -1px 0; +} +.dj_ie6 .claro .dijitMenu { + margin: 0; + /* above -1px makes top/bottom borders disappear on IE6 */ +} +.claro .dijitMenuItem { + color: #000; +} +.claro .dijitMenuBar .dijitMenuItem { + padding: 6px 10px 7px; + margin: -1px; +} +.claro .dijitMenuBar .dijitMenuItemHover, +.claro .dijitMenuBar .dijitMenuItemSelected { + border: solid 1px #759dc0; + padding: 5px 9px 6px; +} +/* this prevents jiggling upon hover of a menu item */ +.claro .dijitMenuTable { + border-collapse: separate; + border-spacing: 0 0; + padding: 0; +} +.claro .dijitMenuItem td { + padding: 1px; +} +/* hover over a MenuItem or MenuBarItem */ +.claro .dijitSelectMenu .dijitMenuItemHover td, +.claro .dijitSelectMenu .dijitMenuItemSelected td, +.claro .dijitMenuItemHover, +.claro .dijitMenuItemSelected { + background-color: #abd6ff; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.claro .dijitMenuItemActive { + background-image: url("images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.dj_ie .claro .dijitMenuActive .dijitMenuItemHover, +.dj_ie .claro .dijitMenuActive .dijitMenuItemSelected, +.dj_ie .claro .dijitMenuPassive .dijitMenuItemHover, +.dj_ie .claro .dijitMenuPassive .dijitMenuItemSelected { + padding-top: 6px; + padding-bottom: 5px; + margin-top: -3px; +} +.claro td.dijitMenuItemIconCell { + padding: 2px; + margin: 0 0 0 4px; +} +.claro td.dijitMenuItemLabel { + padding-top: 5px; + padding-bottom: 5px; +} +.claro .dijitMenuExpand { + width: 7px; + height: 7px; + background-image: url("images/spriteArrows.png"); + background-position: -14px 0; + margin-right: 3px; +} +.claro .dijitMenuItemDisabled .dijitMenuItemIconCell { + opacity: 1; +} +.claro .dijitMenuSeparatorTop { + height: auto; + margin-top: 1px; + /* prevents spacing above/below separator */ + border-bottom: 1px solid #b5bcc7; +} +.claro .dijitMenuSeparatorBottom { + height: auto; + margin-bottom: 1px; +} +/* the checked menu item */ +.claro .dijitCheckedMenuItemIconChar { + display: none; +} +.claro .dijitCheckedMenuItemIcon { + background-image: url("form/images/checkboxRadioButtonStates.png"); + background-repeat: no-repeat; + background-position: -15px 50%; + width: 15px; + height: 16px; +} +.dj_ie6 .claro .dijitCheckedMenuItemIcon { + background-image: url("form/images/checkboxAndRadioButtons_IE6.png"); +} +.claro .dijitCheckedMenuItemChecked .dijitCheckedMenuItemIcon { + background-position: 0 50%; +} +/*ComboBox Menu*/ +.claro .dijitComboBoxMenu { + margin-left: 0; + background-image: none; +} +.claro .dijitSelectMenu .dijitMenuItem td, +.claro .dijitComboBoxMenu .dijitMenuItem { + padding: 2px; + border-width: 1px 0 1px 0; + border-style: solid; + border-color: #fff; +} +.claro .dijitSelectMenu .dijitMenuItemSelected td, +.claro .dijitComboBoxMenu .dijitMenuItemSelected { + color: #000; + border-color: #759dc0; + background-color: #abd6ff; +} +.claro .dijitSelectMenu .dijitMenuItemHover td, +.claro .dijitComboBoxMenu .dijitMenuItemHover { + color: #000000; + border-color: #769dc0; + background-color: #abd6ff; +} +.claro .dijitComboBoxMenuActive .dijitMenuItemSelected { + background-color: #7dbdfa; + /* TODO: why is this a different color than normal .dijitMenuItemSelected? */ +} +.claro .dijitMenuPreviousButton, +.claro .dijitMenuNextButton { + font-style: italic; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu.less new file mode 100644 index 0000000000..9f4f860712 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu.less @@ -0,0 +1,179 @@ +/* Menu + +There are three areas of styling for the Menu: + + 1. The menu + There are three types of menus: + i) Context Menu + ii) Drop down Menu + iii) Navigation Menu + All three types of menus are affected by the .dijitMenu class in which you can set the background-color, padding and border + .dijitMenu affects the drop down menu in TimeTextBox, Calendar, ComboBox and FilteringSelect + .dijitMenuTable - for padding - also affects Select widget + + 2. The menu bar + .dijitMenuBar - for border, margins, padding, background-color of the menu bar + .dijitMenuBar .dijitMenuItem - for padding, text color of menu items in the menu bar (overrides .dijitMenuItem) + + 3. Menu items - items in the menu. + .dijitMenuItem - for color + .dijitMenuItemHover, .dijitMenuItemSelected - for background-color, border, text color, padding of a menu item or menubar item that has been hovered over or selected + .dijitMenuItemActive - for background-color of an active (mousedown) menu item + td.dijitMenuItemIconCell - for padding around a menu item's icon + td.dijitMenuItemLabel - for padding around a menu item's label + .dijitMenuSeparatorTop - for border, top border, of the separator + .dijitMenuSeparatorBottom - for bottom margin of the separator + + Styles specific to ComboBox and FilteringSelect widgets: + .dijitComboBoxMenu .dijitMenuItem - for padding and border of a menu item in a ComboBox or FilteringSelect widget's menu + .dijitComboBoxMenu .dijitMenuItemSelected- for text color, background-color and border of a menu item in a ComboBox or FilteringSelect widget's menu + +*/ + +@import "variables"; + +.claro .dijitMenuBar { + border: 1px solid @border-color; + margin: 0; + padding: 0; + background-color: @bar-background-color; + .standard-gradient; +} + +.claro .dijitMenu { + background-color:@menu-background-color; + border: 1px solid @popup-border-color; + + /* so adjoining borders of MenuBar/ComboBox and Menu overlap, avoiding double border */ + margin: -1px 0; +} +.dj_ie6 .claro .dijitMenu { + margin: 0; /* above -1px makes top/bottom borders disappear on IE6 */ +} + +.claro .dijitMenuItem { + color: @text-color; +} +.claro .dijitMenuBar .dijitMenuItem { + padding: 6px 10px 7px; + margin:-1px; +} +.claro .dijitMenuBar .dijitMenuItemHover, +.claro .dijitMenuBar .dijitMenuItemSelected { + // on hover or selection of MenuBar item, add border and reduce padding to compensate + border:solid 1px @hovered-border-color; + padding: 5px 9px 6px; +} + +/* this prevents jiggling upon hover of a menu item */ +.claro .dijitMenuTable { + border-collapse:separate; + border-spacing:0 0; + padding:0; +} +.claro .dijitMenuItem td{ + padding:1px; +} +/* hover over a MenuItem or MenuBarItem */ +.claro .dijitSelectMenu .dijitMenuItemHover td, +.claro .dijitSelectMenu .dijitMenuItemSelected td, +.claro .dijitMenuItemHover, +.claro .dijitMenuItemSelected { + // note: seems like the selected MenuItem should use @pressed-background-color + // and .active-gradient, but claro didn't to that + background-color: @hovered-background-color; + .standard-gradient; +} +.claro .dijitMenuItemActive { + // todo: seems like the selected MenuItem should come here + // todo: seems like should use @pressed-background-color + .active-gradient; +} +.dj_ie .claro .dijitMenuActive .dijitMenuItemHover, +.dj_ie .claro .dijitMenuActive .dijitMenuItemSelected, +.dj_ie .claro .dijitMenuPassive .dijitMenuItemHover, +.dj_ie .claro .dijitMenuPassive .dijitMenuItemSelected { + // Selectivity set to override ComboBox rules below. + // If this rule isn't present, on IE6 hovering an item in the ComboBox drop down causes two + // items to be highlighted (except when hovering the first item in the list) + padding-top: 6px; + padding-bottom: 5px; + margin-top: -3px; +} + +.claro td.dijitMenuItemIconCell { + padding: 2px; + margin: 0 0 0 4px; +} +.claro td.dijitMenuItemLabel { + padding-top: 5px; + padding-bottom: 5px; +} +.claro .dijitMenuExpand { + width: 7px; + height: 7px; + background-image: url(@image-arrow-sprite); + background-position: -14px 0; + margin-right:3px; +} +.claro .dijitMenuItemDisabled .dijitMenuItemIconCell { + opacity:1; +} +.claro .dijitMenuSeparatorTop { + height: auto; + margin-top:1px; /* prevents spacing above/below separator */ + border-bottom: 1px solid @border-color +} +.claro .dijitMenuSeparatorBottom{ + height: auto; + margin-bottom:1px; +} +/* the checked menu item */ +.claro .dijitCheckedMenuItemIconChar { + display: none; +} +.claro .dijitCheckedMenuItemIcon { + background-image: url(@image-form-checkbox-and-radios); + background-repeat:no-repeat; + background-position: -15px 50%; + width:15px; + height:16px; +} +.dj_ie6 .claro .dijitCheckedMenuItemIcon { + background-image: url(@image-form-checkbox-and-radios-ie6); +} +.claro .dijitCheckedMenuItemChecked .dijitCheckedMenuItemIcon { + background-position: 0 50%; +} + +/*ComboBox Menu*/ +.claro .dijitComboBoxMenu { + margin-left:0; + background-image: none; +} + +.claro .dijitSelectMenu .dijitMenuItem td, +.claro .dijitComboBoxMenu .dijitMenuItem { + padding: @textbox-padding; // Make drop down menu text line up with text in . + border-width:1px 0 1px 0; + border-style:solid; + border-color: @select-dropdownitem-background-color; +} +.claro .dijitSelectMenu .dijitMenuItemSelected td, +.claro .dijitComboBoxMenu .dijitMenuItemSelected { + color:@selected-text-color; + border-color:@hovered-border-color; + background-color:@hovered-background-color; +} +.claro .dijitSelectMenu .dijitMenuItemHover td, +.claro .dijitComboBoxMenu .dijitMenuItemHover { + color: #000000; + border-color: #769dc0; + background-color: #abd6ff; +} +.claro .dijitComboBoxMenuActive .dijitMenuItemSelected { + background-color: @select-dropdownitem-hovered-background-color; /* TODO: why is this a different color than normal .dijitMenuItemSelected? */ +} +.claro .dijitMenuPreviousButton, .claro .dijitMenuNextButton { + font-style: italic; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu_rtl.css new file mode 100644 index 0000000000..2b96cbae73 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu_rtl.css @@ -0,0 +1,8 @@ +.claro .dijitMenuItemRtl .dijitMenuExpand { + background-position: -7px 0; + margin-right: 0; + margin-left: 3px; +} +.claro .dijitMenuItemRtl .dijitMenuItemIcon { + margin: 0 4px 0 0; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu_rtl.less new file mode 100644 index 0000000000..6f669f5fd8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Menu_rtl.less @@ -0,0 +1,11 @@ +@import "variables"; + +.claro .dijitMenuItemRtl .dijitMenuExpand { + background-position: -7px 0; + margin-right: 0; + margin-left: 3px; +} + +.claro .dijitMenuItemRtl .dijitMenuItemIcon { + margin:0 4px 0 0; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ProgressBar.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ProgressBar.css new file mode 100644 index 0000000000..4bb33cc8aa --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ProgressBar.css @@ -0,0 +1,66 @@ +/* ProgressBar + * + * Styling of the ProgressBar consists of the following: + * + * 1. the base progress bar + * .dijitProgressBar - sets margins for the progress bar + * + * 2. the empty bar + * .dijitProgressBarEmpty - sets background img and color for bar or parts of bar that are not finished yet + * Also sets border color for whole bar + * + * 3. tile mode + * .dijitProgressBarTile + * inner container for finished portion when in 'tile' (image) mode + * + * 4. full bar mode + * .dijitProgressBarFull + * adds border to right side of the filled portion of bar + * + * 5. text for label of bar + * .dijitProgressBarLabel - sets text color, which must contrast with both the "Empty" and "Full" parts. + * + * 6. indeterminate mode + * .dijitProgressBarIndeterminate .dijitProgressBarTile + * sets animated gif for the progress bar in 'indeterminate' mode + */ +.claro .dijitProgressBar { + margin: 2px 0 2px 0; +} +.claro .dijitProgressBarEmpty { + /* outer container and background of the bar that's not finished yet*/ + background-color: #fff; + border-color: #759dc0; +} +.claro .dijitProgressBarTile { + /* inner container for finished portion when in 'tile' (image) mode */ + background-color: #abd6ff; + background-image: url("images/progressBarFull.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); + background-attachment: scroll; +} +.dj_ie6 .claro .dijitProgressBarTile { + background-image: none; +} +.claro .dijitProgressBarFull { + border-right: 1px solid #759dc0; + -webkit-transition-property: width; + -moz-transition-property: width; + transition-property: width; + -webkit-transition-duration: 0.25s; + -moz-transition-duration: 0.25s; + transition-duration: 0.25s; +} +.claro .dijitProgressBarLabel { + /* Set to a color that contrasts with both the "Empty" and "Full" parts. */ + color: #000; +} +.claro .dijitProgressBarIndeterminate .dijitProgressBarTile { + /* use an animated gif for the progress bar in 'indeterminate' mode; + background-color won't appear unless user has turned off background images */ + background: #efefef url("images/progressBarAnim.gif") repeat-x top; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ProgressBar.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ProgressBar.less new file mode 100644 index 0000000000..096618f080 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/ProgressBar.less @@ -0,0 +1,64 @@ +/* ProgressBar + * + * Styling of the ProgressBar consists of the following: + * + * 1. the base progress bar + * .dijitProgressBar - sets margins for the progress bar + * + * 2. the empty bar + * .dijitProgressBarEmpty - sets background img and color for bar or parts of bar that are not finished yet + * Also sets border color for whole bar + * + * 3. tile mode + * .dijitProgressBarTile + * inner container for finished portion when in 'tile' (image) mode + * + * 4. full bar mode + * .dijitProgressBarFull + * adds border to right side of the filled portion of bar + * + * 5. text for label of bar + * .dijitProgressBarLabel - sets text color, which must contrast with both the "Empty" and "Full" parts. + * + * 6. indeterminate mode + * .dijitProgressBarIndeterminate .dijitProgressBarTile + * sets animated gif for the progress bar in 'indeterminate' mode + */ + + @import "variables"; + +.claro .dijitProgressBar { + margin:2px 0 2px 0; +} +.claro .dijitProgressBarEmpty { + /* outer container and background of the bar that's not finished yet*/ + background-color: @progressbar-empty-background-color; + border-color: @progressbar-border-color; +} +.claro .dijitProgressBarTile { + /* inner container for finished portion when in 'tile' (image) mode */ + background-color: @progressbar-full-background-color; + + // gradient background using CSS gradient, with fallback to image for IE + background-image: url("images/progressBarFull.png"); + background-repeat: repeat-x; + .alpha-white-gradient(0.93,0px, 0.41,1px, 0.7,2px, 0,100%); + background-attachment: scroll; // override strange "fixed" setting from dijit.css +} +.dj_ie6 .claro .dijitProgressBarTile { + background-image: none; +} +.claro .dijitProgressBarFull { + border-right:1px solid @progressbar-border-color; + .transition-property(width); + .transition-duration(.25s); +} +.claro .dijitProgressBarLabel { + /* Set to a color that contrasts with both the "Empty" and "Full" parts. */ + color: @progressbar-text-color; +} +.claro .dijitProgressBarIndeterminate .dijitProgressBarTile { + /* use an animated gif for the progress bar in 'indeterminate' mode; + background-color won't appear unless user has turned off background images */ + background: @bar-background-color url(@image-progressbar-anim) repeat-x top; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/README b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/README new file mode 100644 index 0000000000..0a254623f2 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/README @@ -0,0 +1,11 @@ +These are "less" files that compile into the CSS of claro. + +1. Install node from http://nodejs.org/#download + +2. To compile all the files: + + $ cd dijit/themes/claro + $ node compile.js + + +See http://lesscss.org/ and https://github.com/cloudhead/less.js/ for more information. diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker.css new file mode 100644 index 0000000000..cb7951194d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker.css @@ -0,0 +1,127 @@ +/* Time Picker + * + * Styling the Time Picker consists of the following: + * + * 1. minor time values + * .dijitTimePickerTick - set text color, size, background color of minor values + * .dijitTimePickerTickHover - set hover style of minor time values + * dijitTimePickerTickSelected - set selected style of minor time values + * + * 2. major time values - 1:00, 2:00, times on the hour + * set text color, size, background color, left/right margins for "zoom" affect + * .dijitTimePickerMarkerHover - to set hover style of major time values + * .dijitTimePickerMarkerSelected - set selected style of major time values + * + * 3. up and down arrow buttons + * .dijitTimePicker .dijitButtonNode - background-color, border + * .dijitTimePicker .dijitUpArrowHover, .dijitTimePicker .dijitDownArrowHover - set background-color for hover state + * + * Other classes provide the fundamental structure of the TimePicker and should not be modified. + */ +/* override Button.css */ +.claro .dijitTimePicker .dijitButtonNode { + padding: 0 0; + -moz-border-radius: 0; + border-radius: 0; +} +.claro .dijitTimePicker { + border: 1px #b5bcc7 solid; + border-top: none; + border-bottom: none; + background-color: #fff; + /* TODO: useless? Appears to be overridden by settings on individual elements */ +} +.claro .dijitTimePickerItem { + /* dijitTimePickerItem refers to both Tick's (minor values like 2:15, 2:30, 2:45) and Marker's (major values like 2PM, 3PM) */ + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + border-top: solid 1px #b5bcc7; + border-bottom: solid 1px #b5bcc7; + margin-right: -1px; + margin-left: -1px; + margin-top: -1px; +} +.claro .dijitTimePickerTick { + /* minor value */ + color: #818181; + background-color: #efefef; + font-size: 0.818em; +} +.claro .dijitTimePickerMarker { + /* major value - 1:00, 2:00, times on the hour */ + background-color: #e5f2fe; + font-size: 1em; + white-space: nowrap; +} +.claro .dijitTimePickerTickHover, +.claro .dijitTimePickerMarkerHover, +.claro .dijitTimePickerMarkerSelected, +.claro .dijitTimePickerTickSelected { + background-color: #7dbdfa; + border: solid 1px #b5bcc7; + margin-left: -7px; + margin-right: -7px; + color: #000; +} +.claro .dijitTimePickerMarkerSelected, +.claro .dijitTimePickerTickSelected { + font-size: 1em; +} +.dj_ie .claro .dijitTimePickerTickHover, +.dj_ie .claro .dijitTimePickerMarkerHover, +.dj_ie .claro .dijitTimePickerMarkerSelected, +.dj_ie .claro .dijitTimePickerTickSelected { + width: 114%; +} +.dj_ie6 .claro .dijitTimePickerTickHover, +.dj_ie6 .claro .dijitTimePickerMarkerHover, +.dj_ie6 .claro .dijitTimePickerMarkerSelected, +.dj_ie6 .claro .dijitTimePickerTickSelected { + position: relative; + /* creates widening of element */ + zoom: 1; + /* creates widening of element */ +} +.claro .dijitTimePickerTick .dijitTimePickerItemInner { + padding: 1px; + margin: 0; +} +.claro .dijitTimePicker .dijitButtonNode { + border-left: none; + border-right: none; + border-color: #b5bcc7; + background-color: #efefef; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.claro .dijitTimePicker .dijitArrowButtonInner { + height: 100%; + /* hack claro.button.css */ + background-image: url("form/images/commonFormArrows.png"); + background-repeat: no-repeat; + background-position: -140px 45%; +} +.claro .dijitTimePicker .dijitDownArrowButton .dijitArrowButtonInner { + background-position: -35px 45%; +} +/* hover */ +.claro .dijitTimePicker .dijitUpArrowHover, +.claro .dijitTimePicker .dijitDownArrowHover { + background-color: #abd6ff; +} +.claro .dijitTimePicker .dijitUpArrowHover .dijitArrowButtonInner { + background-position: -175px 45%; +} +.claro .dijitTimePicker .dijitDownArrowHover .dijitArrowButtonInner { + background-position: -70px 45%; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker.less new file mode 100644 index 0000000000..0f3bf9c1a6 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker.less @@ -0,0 +1,115 @@ +/* Time Picker + * + * Styling the Time Picker consists of the following: + * + * 1. minor time values + * .dijitTimePickerTick - set text color, size, background color of minor values + * .dijitTimePickerTickHover - set hover style of minor time values + * dijitTimePickerTickSelected - set selected style of minor time values + * + * 2. major time values - 1:00, 2:00, times on the hour + * set text color, size, background color, left/right margins for "zoom" affect + * .dijitTimePickerMarkerHover - to set hover style of major time values + * .dijitTimePickerMarkerSelected - set selected style of major time values + * + * 3. up and down arrow buttons + * .dijitTimePicker .dijitButtonNode - background-color, border + * .dijitTimePicker .dijitUpArrowHover, .dijitTimePicker .dijitDownArrowHover - set background-color for hover state + * + * Other classes provide the fundamental structure of the TimePicker and should not be modified. + */ + +@import "variables"; + +/* override Button.css */ +.claro .dijitTimePicker .dijitButtonNode { + padding: 0 0; + .border-radius(0); +} +.claro .dijitTimePicker{ + border:1px @border-color solid; + border-top:none; + border-bottom:none; + background-color:#fff; /* TODO: useless? Appears to be overridden by settings on individual elements */ +} +.claro .dijitTimePickerItem{ + /* dijitTimePickerItem refers to both Tick's (minor values like 2:15, 2:30, 2:45) and Marker's (major values like 2PM, 3PM) */ + .standard-gradient; + border-top:solid 1px @border-color; + border-bottom:solid 1px @border-color; + margin-right:-1px; + margin-left:-1px; + margin-top:-1px; +} +.claro .dijitTimePickerTick { + /* minor value */ + color:@timepicker-minorvalue-text-color; + background-color:@timepicker-minorvalue-background-color; + font-size:0.818em; +} +.claro .dijitTimePickerMarker { + /* major value - 1:00, 2:00, times on the hour */ + background-color: @timepicker-majorvalue-background-color; + font-size: 1em; + white-space: nowrap; +} +.claro .dijitTimePickerTickHover, +.claro .dijitTimePickerMarkerHover, +.claro .dijitTimePickerMarkerSelected, +.claro .dijitTimePickerTickSelected { + background-color: @timepicker-value-hovered-background-color; + border:solid 1px @border-color; + margin-left:-7px; + margin-right:-7px; + color:@timepicker-value-hovered-text-color; +} +.claro .dijitTimePickerMarkerSelected, +.claro .dijitTimePickerTickSelected { + font-size: 1em; +} +.dj_ie .claro .dijitTimePickerTickHover, +.dj_ie .claro .dijitTimePickerMarkerHover, +.dj_ie .claro .dijitTimePickerMarkerSelected, +.dj_ie .claro .dijitTimePickerTickSelected { + width: 114%; +} +.dj_ie6 .claro .dijitTimePickerTickHover, +.dj_ie6 .claro .dijitTimePickerMarkerHover, +.dj_ie6 .claro .dijitTimePickerMarkerSelected, +.dj_ie6 .claro .dijitTimePickerTickSelected { + position: relative; /* creates widening of element */ + zoom: 1; /* creates widening of element */ +} +.claro .dijitTimePickerTick .dijitTimePickerItemInner { + padding:1px; + margin:0; +} +.claro .dijitTimePicker .dijitButtonNode { + border-left:none; + border-right:none; + border-color:@border-color; + background-color: @unselected-background-color; + .standard-gradient; +} +.claro .dijitTimePicker .dijitArrowButtonInner{ + height: 100%; /* hack claro.button.css */ + background-image: url(@image-form-common-arrows); + background-repeat: no-repeat; + background-position:-140px 45%; +} +.claro .dijitTimePicker .dijitDownArrowButton .dijitArrowButtonInner{ + background-position:-35px 45%; +} +/* hover */ +.claro .dijitTimePicker .dijitUpArrowHover, +.claro .dijitTimePicker .dijitDownArrowHover { + background-color: @timepicker-arrow-hovered-background-color; +} +.claro .dijitTimePicker .dijitUpArrowHover .dijitArrowButtonInner { + background-position:-175px 45%; +} +.claro .dijitTimePicker .dijitDownArrowHover .dijitArrowButtonInner { + background-position:-70px 45%; +} + +// TODO: should have active rule, for clicking a .dijitTimePickerItem \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker_rtl.css new file mode 100644 index 0000000000..6dfcf839e9 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker_rtl.css @@ -0,0 +1,9 @@ +/* TimePicker */ +.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickHover, +.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerHover, +.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerSelected, +.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickSelected { + margin-left: -6px; + margin-right: -8px; + width: 114%; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker_rtl.less new file mode 100644 index 0000000000..44f5da5bdf --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TimePicker_rtl.less @@ -0,0 +1,12 @@ +/* TimePicker */ + +@import "variables"; + +.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickHover, +.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerHover, +.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerSelected, +.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickSelected { + margin-left:-6px; + margin-right:-8px; + width: 114%; +} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane.css new file mode 100644 index 0000000000..bceba2830d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane.css @@ -0,0 +1,79 @@ +/* TitlePane + * + * Styling TitlePane means styling the TitlePane title and its content container (dijitTitlePane) + * + * TitlePane title: + * 1. TitlePane title (default styling): + * .dijitTitlePaneTitle - TitlePane's title div style: background-color, border + * + * 2. hovered TitlePane title (ie, mouse hover on a title bar) + * .dijitTitlePaneTitleHover - styles when mouse hover on the title div + * + * 3. active TitlePane title (ie, mouse down on a title bar) + * .dijitTitlePaneTitleActive - styles when mouse down on the title div + * + * + * TitlePane Content Container: + * 1. outer/inner container: + * .dijitTitlePaneContentOuter / dijitTitlePaneContentInner - styles for the content outer div + */ +.claro .dijitTitlePaneTitle { + background-color: #efefef; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + border: 1px solid #b5bcc7; + padding: 0 7px 3px 7px; + min-height: 17px; +} +.claro .dijitTitlePaneTitleHover { + background-color: #abd6ff; + border-color: #759dc0; +} +.claro .dijitTitlePaneTitleActive { + background-color: #7dbdfa; + border-color: #759dc0; + background-image: url("images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.claro .dijitTitlePaneTitleFocus { + margin-top: 3px; + padding-bottom: 2px; +} +.claro .dijitTitlePane .dijitArrowNode { + background-image: url("images/spriteArrows.png"); + background-repeat: no-repeat; + height: 8px; + width: 7px; +} +.claro .dijitTitlePane .dijitOpen .dijitArrowNode { + background-position: 0 0; +} +.claro .dijitTitlePane .dijitClosed .dijitArrowNode { + background-position: -14px 0; +} +.claro .dijitTitlePane .dijitTitlePaneTextNode { + color: #000; +} +.claro .dijitTitlePaneContentOuter { + background: #fff; + border: 1px solid #b5bcc7; + border-top: none; +} +.claro .dijitTitlePaneContentInner { + padding: 10px; +} +.claro .dijitTitlePaneTextNode { + margin-left: 4px; + margin-right: 4px; + vertical-align: text-top; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane.less new file mode 100644 index 0000000000..d899453d65 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane.less @@ -0,0 +1,70 @@ +/* TitlePane + * + * Styling TitlePane means styling the TitlePane title and its content container (dijitTitlePane) + * + * TitlePane title: + * 1. TitlePane title (default styling): + * .dijitTitlePaneTitle - TitlePane's title div style: background-color, border + * + * 2. hovered TitlePane title (ie, mouse hover on a title bar) + * .dijitTitlePaneTitleHover - styles when mouse hover on the title div + * + * 3. active TitlePane title (ie, mouse down on a title bar) + * .dijitTitlePaneTitleActive - styles when mouse down on the title div + * + * + * TitlePane Content Container: + * 1. outer/inner container: + * .dijitTitlePaneContentOuter / dijitTitlePaneContentInner - styles for the content outer div + */ + +@import "variables"; + +.claro .dijitTitlePaneTitle { + background-color: @unselected-background-color; // TODO: Mailed Jason, shouldn't this toggle to @selected-background-color when pane opened? + .standard-gradient; + border:1px solid @border-color; + padding: 0 7px 3px 7px; + min-height:17px; +} +.claro .dijitTitlePaneTitleHover { + background-color: @hovered-background-color; + border-color: @hovered-border-color; +} +.claro .dijitTitlePaneTitleActive { + background-color: @pressed-background-color; + border-color: @pressed-border-color; + .active-gradient; +} +.claro .dijitTitlePaneTitleFocus { + margin-top:3px; + padding-bottom:2px; +} +.claro .dijitTitlePane .dijitArrowNode { + background-image: url(@image-arrow-sprite); + background-repeat: no-repeat; + height: 8px; + width: 7px; +} +.claro .dijitTitlePane .dijitOpen .dijitArrowNode { + background-position: 0 0; +} +.claro .dijitTitlePane .dijitClosed .dijitArrowNode { + background-position: -14px 0; +} +.claro .dijitTitlePane .dijitTitlePaneTextNode { + color:@text-color; +} +.claro .dijitTitlePaneContentOuter { + background: @pane-background-color; + border:1px solid @border-color; + border-top:none; +} +.claro .dijitTitlePaneContentInner { + padding:10px; +} +.claro .dijitTitlePaneTextNode { + margin-left: 4px; + margin-right: 4px; + vertical-align:text-top; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane_rtl.css new file mode 100644 index 0000000000..3f68ab30e5 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane_rtl.css @@ -0,0 +1,4 @@ +/* TitlePane */ +.claro .dijitTitlePaneRtl .dijitClosed .dijitArrowNode { + background-position: -7px 0; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane_rtl.less new file mode 100644 index 0000000000..693584f679 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/TitlePane_rtl.less @@ -0,0 +1,7 @@ +/* TitlePane */ + +@import "variables"; + +.claro .dijitTitlePaneRtl .dijitClosed .dijitArrowNode { + background-position: -7px 0; +} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar.css new file mode 100644 index 0000000000..7e1dc24565 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar.css @@ -0,0 +1,201 @@ +/* Toolbar + * + * Styling Toolbar means styling the toolbar container and the widget inside toolbar (dijitToolbar) + * + * 1. toolbar (default styling): + * .dijitToolbar - styles for outer container + * + * 2. widget inside toolbar + * .dijitToolbar .dijitButtonNode - Button widget + * .dijitComboButton - ComboButton widget + * .dijitDropDownButton - DropDownButton widget + * .dijitToggleButton - ToggleButton widget + * + * 3. hovered widget inside toolbar (ie, mouse hover on the widget inside) + * .dijitToolbar .dijitButtonNodeHover - styles for hovered Button widget + * + * 4. actived widget inside toolbar (ie, mouse down on the widget inside) + * .dijitToolbar .dijitButtonNodeActive - mouse down on Button widget + */ +.claro .dijitToolbar { + border-bottom: 1px solid #b5bcc7; + background-color: #efefef; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 2px 0 2px 4px; + zoom: 1; +} +.claro .dijitToolbar label { + padding: 0 3px 0 6px; +} +/** override claro/form/Button.css, and also ComboBox down arrow **/ +.claro .dijitToolbar .dijitButton .dijitButtonNode, +.claro .dijitToolbar .dijitDropDownButton .dijitButtonNode, +.claro .dijitToolbar .dijitComboButton .dijitButtonNode, +.claro .dijitToolbar .dijitToggleButton .dijitButtonNode, +.claro .dijitToolbar .dijitComboBox .dijitButtonNode { + border-width: 0; + /* on hover/active, border-->1px, padding-->1px */ + padding: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + -webkit-transition-property: background-color; + -moz-transition-property: background-color; + transition-property: background-color; + -webkit-transition-duration: 0.3s; + -moz-transition-duration: 0.3s; + transition-duration: 0.3s; + background-color: rgba(171, 214, 255, 0); + background-image: none; + /* cancel gradient for normal buttons, we don't want any gradient besides toolbar's on non-hovered buttons */ +} +.dj_ie .claro .dijitToolbar .dijitButton .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitDropDownButton .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitComboButton .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitToggleButton .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitComboBox .dijitButtonNode { + background-color: transparent; + /* for IE, which doesn't understand rgba(...) */ +} +/* hover status */ +.dj_ie .claro .dijitToolbar .dijitButtonHover .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitDropDownButtonHover .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitComboButton .dijitButtonNodeHover, +.dj_ie .claro .dijitToolbar .dijitComboButton .dijitDownArrowButtonHover, +.dj_ie .claro .dijitToolbar .dijitToggleButtonHover .dijitButtonNode { + /* button should still turn blue on hover, so need to override .dj_ie rules above */ + background-color: #abd6ff; +} +/* active status */ +.dj_ie .claro .dijitToolbar .dijitButtonActive .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitDropDownButtonActive .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitComboButtonActive .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitToggleButtonActive .dijitButtonNode { + /* button should still turn blue on press, so need to override .dj_ie rules above */ + background-color: #abd6ff; +} +.claro .dijitToolbar .dijitComboButton .dijitStretch { + /* no rounded border on side adjacent to arrow */ + -moz-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.claro .dijitToolbar .dijitComboButton .dijitArrowButton { + /* no rounded border on side adjacent to button */ + -moz-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.claro .dijitToolbar .dijitComboBox .dijitButtonNode { + padding: 0; +} +/* hover status */ +.claro .dijitToolbar .dijitButtonHover .dijitButtonNode, +.claro .dijitToolbar .dijitDropDownButtonHover .dijitButtonNode, +.claro .dijitToolbar .dijitToggleButtonHover .dijitButtonNode, +.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNode { + border-width: 1px; + background-color: #abd6ff; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 1px; +} +.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNode, +.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton { + background-color: #f3ffff; +} +.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNodeHover, +.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButtonHover { + background-color: #abd6ff; +} +/* active status */ +.claro .dijitToolbar .dijitButtonActive .dijitButtonNode, +.claro .dijitToolbar .dijitDropDownButtonActive .dijitButtonNode, +.claro .dijitToolbar .dijitToggleButtonActive .dijitButtonNode { + border-width: 1px; + background-color: #7dbdfa; + background-image: url("images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 1px; +} +.claro .dijitToolbar .dijitComboButtonActive { + -webkit-transition-duration: 0.2s; + -moz-transition-duration: 0.2s; + transition-duration: 0.2s; + border-width: 1px; + padding: 0; +} +.claro .dijitToolbar .dijitComboButtonActive .dijitButtonNode, +.claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButton { + background-color: #f3ffff; + padding: 2px; +} +.claro .dijitToolbar .dijitComboButtonActive .dijitButtonNodeActive { + background-color: #7dbdfa; + background-image: url("images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButtonActive { + background-color: #7dbdfa; + background-image: url("images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +/* Avoid double border between button and arrow */ +.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton, +.claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButton { + border-left-width: 0; +} +.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton { + padding-left: 2px; + /* since there's no left border, don't reduce from 2px --> 1px */ +} +/* toggle button checked status */ +.claro .dijitToolbar .dijitToggleButtonChecked .dijitButtonNode { + margin: 0; + /* remove margin and add a border */ + border-width: 1px; + border-style: solid; + background-image: none; + border-color: #759dc0; + background-color: #fff; + padding: 1px; +} +.claro .dijitToolbarSeparator { + /* separator icon in the editor sprite */ + background: url("../../icons/images/editorIconsEnabled.png"); +} +/* Toolbar inside of disabled Editor */ +.claro .dijitDisabled .dijitToolbar { + background: none; + background-color: #efefef; + border-bottom: 1px solid #d3d3d3; +} +.claro .dijitToolbar .dijitComboBoxDisabled .dijitArrowButtonInner { + background-position: 0 50%; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar.less new file mode 100644 index 0000000000..90b9009e25 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar.less @@ -0,0 +1,173 @@ +/* Toolbar + * + * Styling Toolbar means styling the toolbar container and the widget inside toolbar (dijitToolbar) + * + * 1. toolbar (default styling): + * .dijitToolbar - styles for outer container + * + * 2. widget inside toolbar + * .dijitToolbar .dijitButtonNode - Button widget + * .dijitComboButton - ComboButton widget + * .dijitDropDownButton - DropDownButton widget + * .dijitToggleButton - ToggleButton widget + * + * 3. hovered widget inside toolbar (ie, mouse hover on the widget inside) + * .dijitToolbar .dijitButtonNodeHover - styles for hovered Button widget + * + * 4. actived widget inside toolbar (ie, mouse down on the widget inside) + * .dijitToolbar .dijitButtonNodeActive - mouse down on Button widget + */ + +@import "variables"; + +.claro .dijitToolbar { + border-bottom: 1px solid @border-color; + background-color: @bar-background-color; + .standard-gradient; + padding: 2px 0 2px 4px; + zoom: 1; +} + +.claro .dijitToolbar label { + padding: 0 3px 0 6px; +} + +/** override claro/form/Button.css, and also ComboBox down arrow **/ +.claro .dijitToolbar .dijitButton .dijitButtonNode, +.claro .dijitToolbar .dijitDropDownButton .dijitButtonNode, +.claro .dijitToolbar .dijitComboButton .dijitButtonNode, +.claro .dijitToolbar .dijitToggleButton .dijitButtonNode, +.claro .dijitToolbar .dijitComboBox .dijitButtonNode { + border-width: 0; /* on hover/active, border-->1px, padding-->1px */ + padding: 2px; + .border-radius(@toolbar-button-border-radius); + .box-shadow(none); + .transition-property(background-color); + .transition-duration(.3s); + + background-color:rgba(171,214,255,0); + background-image: none; /* cancel gradient for normal buttons, we don't want any gradient besides toolbar's on non-hovered buttons */ +} +.dj_ie .claro .dijitToolbar .dijitButton .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitDropDownButton .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitComboButton .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitToggleButton .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitComboBox .dijitButtonNode { + background-color: transparent; /* for IE, which doesn't understand rgba(...) */ +} + +/* hover status */ +.dj_ie .claro .dijitToolbar .dijitButtonHover .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitDropDownButtonHover .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitComboButton .dijitButtonNodeHover, +.dj_ie .claro .dijitToolbar .dijitComboButton .dijitDownArrowButtonHover, +.dj_ie .claro .dijitToolbar .dijitToggleButtonHover .dijitButtonNode { + /* button should still turn blue on hover, so need to override .dj_ie rules above */ + background-color: @button-hovered-background-color; +} + +/* active status */ +.dj_ie .claro .dijitToolbar .dijitButtonActive .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitDropDownButtonActive .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitComboButtonActive .dijitButtonNode, +.dj_ie .claro .dijitToolbar .dijitToggleButtonActive .dijitButtonNode { + /* button should still turn blue on press, so need to override .dj_ie rules above */ + background-color: @button-pressed-background-color; +} + +.claro .dijitToolbar .dijitComboButton .dijitStretch { + /* no rounded border on side adjacent to arrow */ + .border-radius(@toolbar-button-border-radius 0 0 @toolbar-button-border-radius); +} +.claro .dijitToolbar .dijitComboButton .dijitArrowButton { + /* no rounded border on side adjacent to button */ + .border-radius(0 @toolbar-button-border-radius @toolbar-button-border-radius 0); +} + +.claro .dijitToolbar .dijitComboBox .dijitButtonNode { + padding: 0; +} + +/* hover status */ +.claro .dijitToolbar .dijitButtonHover .dijitButtonNode, +.claro .dijitToolbar .dijitDropDownButtonHover .dijitButtonNode, +.claro .dijitToolbar .dijitToggleButtonHover .dijitButtonNode, +.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNode { + border-width:1px; + background-color: @hovered-background-color; + .standard-gradient; + padding: 1px; +} +.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNode, +.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton { + background-color: @toolbar-combobutton-hovered-unhoveredsection-background-color; +} +.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNodeHover, +.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButtonHover { + background-color: @hovered-background-color; +} + +/* active status */ +.claro .dijitToolbar .dijitButtonActive .dijitButtonNode, +.claro .dijitToolbar .dijitDropDownButtonActive .dijitButtonNode, +.claro .dijitToolbar .dijitToggleButtonActive .dijitButtonNode { + border-width: 1px; + background-color:@pressed-background-color; + .active-gradient; + padding: 1px; +} +.claro .dijitToolbar .dijitComboButtonActive { + .transition-duration(.2s); + border-width: 1px; + padding: 0; +} +.claro .dijitToolbar .dijitComboButtonActive .dijitButtonNode, +.claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButton { + background-color: @toolbar-combobutton-hovered-unhoveredsection-background-color; + padding: 2px; +} +.claro .dijitToolbar .dijitComboButtonActive .dijitButtonNodeActive { + background-color: @pressed-background-color; + .active-gradient; +} +.claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButtonActive { + background-color: @pressed-background-color; + .active-gradient; +} + +/* Avoid double border between button and arrow */ +.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton, +.claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButton { + border-left-width: 0; +} +.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton { + padding-left: 2px; /* since there's no left border, don't reduce from 2px --> 1px */ +} + +/* toggle button checked status */ +.claro .dijitToolbar .dijitToggleButtonChecked .dijitButtonNode { + margin: 0; /* remove margin and add a border */ + border-width: 1px; + border-style: solid; + background-image: none; + border-color: @selected-border-color; + background-color: @toolbar-button-checked-background-color; + padding: 1px; +} + +.claro .dijitToolbarSeparator { + /* separator icon in the editor sprite */ + background: url(@image-editor-icons-enabled); +} + +/* Toolbar inside of disabled Editor */ +.claro .dijitDisabled .dijitToolbar { + background:none; + background-color:@disabled-background-color; + border-bottom: 1px solid @disabled-border-color; +} + +.claro .dijitToolbar .dijitComboBoxDisabled .dijitArrowButtonInner { + background-position:0 50%; +} + diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar_rtl.css new file mode 100644 index 0000000000..0cbfa3a57c --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar_rtl.css @@ -0,0 +1,29 @@ +/* Toolbar RTL */ +/* Repeated rules from Toolbar.css to override rule from Button_rtl.css, which is loaded after Toolbar.css */ +.claro .dijitToolbar .dijitComboButtonRtl .dijitButtonNode { + border-width: 0; + padding: 2px; +} +.claro .dijitToolbar .dijitComboButtonRtlHover .dijitButtonNode, +.claro .dijitToolbar .dijitComboButtonRtlActive .dijitButtonNode { + border-width: 1px; + padding: 1px; +} +.claro .dijitToolbar .dijitComboButtonRtl .dijitStretch { + /* no rounded border on side adjacent to arrow */ + -moz-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +.claro .dijitToolbar .dijitComboButtonRtl .dijitArrowButton { + /* no rounded border on side adjacent to button */ + -moz-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.claro .dijitToolbar .dijitComboButtonRtlHover .dijitArrowButton, +.claro .dijitToolbar .dijitComboButtonRtlActive .dijitArrowButton { + /* border between button and arrow */ + border-left-width: 1px; + border-right-width: 0; + padding-left: 1px; + padding-right: 2px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar_rtl.less new file mode 100644 index 0000000000..8d31c88f4a --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Toolbar_rtl.less @@ -0,0 +1,32 @@ +/* Toolbar RTL */ + +@import "variables"; + +/* Repeated rules from Toolbar.css to override rule from Button_rtl.css, which is loaded after Toolbar.css */ +.claro .dijitToolbar .dijitComboButtonRtl .dijitButtonNode { + border-width: 0; + padding: 2px; +} +.claro .dijitToolbar .dijitComboButtonRtlHover .dijitButtonNode, +.claro .dijitToolbar .dijitComboButtonRtlActive .dijitButtonNode { + border-width: 1px; + padding: 1px; +} + +.claro .dijitToolbar .dijitComboButtonRtl .dijitStretch { + /* no rounded border on side adjacent to arrow */ + .border-radius(0 2px 2px 0); +} +.claro .dijitToolbar .dijitComboButtonRtl .dijitArrowButton { + /* no rounded border on side adjacent to button */ + .border-radius(2px 0 0 2px); +} + +.claro .dijitToolbar .dijitComboButtonRtlHover .dijitArrowButton, +.claro .dijitToolbar .dijitComboButtonRtlActive .dijitArrowButton { + /* border between button and arrow */ + border-left-width: 1px; + border-right-width: 0; + padding-left: 1px; + padding-right: 2px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Tree.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Tree.css new file mode 100644 index 0000000000..d753c5cd04 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Tree.css @@ -0,0 +1,143 @@ +/* Tree + * + * Styling Tree mostly means styling the TreeRow (dijitTreeRow) + * There are 4 basic states to style: + * + * Tree Row: + * 1. tree row (default styling): + * .dijitTreeRow - styles for each row of the tree + * + * 2. hovered tree row (mouse hover on a tree row) + * .dijitTreeRowHover - styles when mouse over on one row + * + * 3. active tree row (mouse down on a tree row) + * .dijitTreeRowActive - styles when mouse down on one row + * + * 4. selected tree row + * dijitTreeRowSelected - style when the row has been selected + * + * Tree Expando: + * dijitTreeExpando - the expando at the left of the text of each tree row + * + * Drag and Drop on TreeNodes: (insert line on dijitTreeContent node so it'll aligned w/ target element) + * .dijitTreeNode .dojoDndItemBefore/.dojoDndItemAfter - use border style simulate a separate line + */ +.claro .dijitTreeNode { + zoom: 1; + /* force layout on IE (TODO: may not be needed anymore) */ +} +.claro .dijitTreeIsRoot { + background-image: none; +} +/* Styling for basic tree node (unhovered, unselected) + * Also use this styling when dropping between items on the tree (in other words, don't + * use hover effect) + */ +.claro .dijitTreeRow, +.claro .dijitTreeNode .dojoDndItemBefore, +.claro .dijitTreeNode .dojoDndItemAfter { + /* so insert line shows up on IE when dropping after a target element */ + padding: 4px 0 2px 0; + background-color: none; + background-color: transparent; + background-color: rgba(171, 214, 255, 0); + background-position: 0 0; + background-repeat: repeat-x; + border: solid 0 transparent; + color: #000; + -webkit-transition-property: background-color, border-color; + -moz-transition-property: background-color, border-color; + transition-property: background-color, border-color; + -webkit-transition-duration: 0.25s; + -moz-transition-duration: 0.25s; + transition-duration: 0.25s; + -webkit-transition-timing-function: ease-out; + -moz-transition-timing-function: ease-out; + transition-timing-function: ease-out; +} +.claro .dijitTreeRowSelected { + background-color: #cfe5fa; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 3px 0 1px; + border-color: #759dc0; + border-width: 1px 0; + color: #000; +} +.claro .dijitTreeRowHover { + background-color: #abd6ff; + background-image: url("images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 3px 0 1px; + border-color: #759dc0; + border-width: 1px 0; + color: #000; + -webkit-transition-duration: 0.25s; + -moz-transition-duration: 0.25s; + transition-duration: 0.25s; +} +.claro .dijitTreeRowActive { + background-color: #7dbdfa; + background-image: url("images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 3px 0 1px; + border-color: #759dc0; + border-width: 1px 0; + color: #000; +} +.claro .dijitTreeRowFocused { + background-repeat: repeat; +} +/* expando (open/closed) icon */ +.claro .dijitTreeExpando { + background-image: url("images/treeExpandImages.png"); + width: 16px; + height: 16px; + background-position: -35px 0; + /* for dijitTreeExpandoOpened */ +} +.dj_ie6 .claro .dijitTreeExpando { + background-image: url("images/treeExpandImages8bit.png"); +} +.claro .dijitTreeRowHover .dijitTreeExpandoOpened { + background-position: -53px 0; +} +.claro .dijitTreeExpandoClosed { + background-position: 1px 0; +} +.claro .dijitTreeRowHover .dijitTreeExpandoClosed { + background-position: -17px 0; +} +.claro .dijitTreeExpandoLeaf, +.dj_ie6 .claro .dijitTreeExpandoLeaf { + background-image: none; +} +.claro .dijitTreeExpandoLoading { + background-image: url("images/loadingAnimation.gif"); +} +/* Drag and Drop on TreeNodes + * Put insert line on dijitTreeContent node so it's aligned w/ + * (ie, indented equally with) target element, even + * though dijitTreeRowNode is the actual "drag object" + */ +.claro .dijitTreeNode .dojoDndItemBefore .dijitTreeContent { + border-top: 2px solid #759dc0; +} +.claro .dijitTreeNode .dojoDndItemAfter .dijitTreeContent { + border-bottom: 2px solid #759dc0; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Tree.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Tree.less new file mode 100644 index 0000000000..1b027769b1 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/Tree.less @@ -0,0 +1,127 @@ +/* Tree + * + * Styling Tree mostly means styling the TreeRow (dijitTreeRow) + * There are 4 basic states to style: + * + * Tree Row: + * 1. tree row (default styling): + * .dijitTreeRow - styles for each row of the tree + * + * 2. hovered tree row (mouse hover on a tree row) + * .dijitTreeRowHover - styles when mouse over on one row + * + * 3. active tree row (mouse down on a tree row) + * .dijitTreeRowActive - styles when mouse down on one row + * + * 4. selected tree row + * dijitTreeRowSelected - style when the row has been selected + * + * Tree Expando: + * dijitTreeExpando - the expando at the left of the text of each tree row + * + * Drag and Drop on TreeNodes: (insert line on dijitTreeContent node so it'll aligned w/ target element) + * .dijitTreeNode .dojoDndItemBefore/.dojoDndItemAfter - use border style simulate a separate line + */ + +@import "variables"; + +.claro .dijitTreeNode { + zoom: 1; /* force layout on IE (TODO: may not be needed anymore) */ +} +.claro .dijitTreeIsRoot { + background-image: none; +} + +/* Styling for basic tree node (unhovered, unselected) + * Also use this styling when dropping between items on the tree (in other words, don't + * use hover effect) + */ +.claro .dijitTreeRow, +.claro .dijitTreeNode .dojoDndItemBefore, +.claro .dijitTreeNode .dojoDndItemAfter { + /* so insert line shows up on IE when dropping after a target element */ + padding: 4px 0 2px 0; + + background-color: none; // IE6 doesn't understand rgba() or transparent below + background-color: transparent; // IE8 doesn't understand rgba() below + background-color: rgba(171,214,255,0); // rgba() instead of transparent to prevent flash on hover fade-in + background-position:0 0; + background-repeat:repeat-x; + + border: solid 0 transparent; + + color: @text-color; + + .transition-property(background-color, border-color); + .transition-duration(.25s); + .transition-timing-function(ease-out); +} + +.claro .dijitTreeRowSelected { + background-color: @selected-background-color; + .standard-gradient; + padding: 3px 0 1px; + border-color: @selected-border-color; + border-width: 1px 0; + color: @selected-text-color; +} +.claro .dijitTreeRowHover { + background-color: @hovered-background-color; + .standard-gradient; + padding: 3px 0 1px; + border-color: @hovered-border-color; + border-width: 1px 0; + color: @hovered-text-color; + .transition-duration(.25s); +} +.claro .dijitTreeRowActive { + background-color:@pressed-background-color; + .active-gradient; + padding: 3px 0 1px; + border-color: @pressed-border-color; + border-width: 1px 0; + color: @selected-text-color; +} +.claro .dijitTreeRowFocused { + background-repeat: repeat; +} + +/* expando (open/closed) icon */ + +.claro .dijitTreeExpando { + background-image: url(@image-tree-expand); + width: 16px; + height: 16px; + background-position: -35px 0; /* for dijitTreeExpandoOpened */ +} +.dj_ie6 .claro .dijitTreeExpando { + background-image: url(@image-tree-expand-ie6); +} +.claro .dijitTreeRowHover .dijitTreeExpandoOpened { + background-position: -53px 0; +} +.claro .dijitTreeExpandoClosed { + background-position: 1px 0; +} +.claro .dijitTreeRowHover .dijitTreeExpandoClosed { + background-position: -17px 0; +} +.claro .dijitTreeExpandoLeaf, +.dj_ie6 .claro .dijitTreeExpandoLeaf { + background-image:none; +} +.claro .dijitTreeExpandoLoading { + background-image: url(@image-loading-animation); +} + +/* Drag and Drop on TreeNodes + * Put insert line on dijitTreeContent node so it's aligned w/ + * (ie, indented equally with) target element, even + * though dijitTreeRowNode is the actual "drag object" + */ +.claro .dijitTreeNode .dojoDndItemBefore .dijitTreeContent { + border-top: 2px solid @dnd-dropseparator-color; // TODO: normal separator is just 1px, why is this 2px? +} +.claro .dijitTreeNode .dojoDndItemAfter .dijitTreeContent { + border-bottom: 2px solid @dnd-dropseparator-color; // TODO: normal separator is just 1px, why is this 2px? +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/claro.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/claro.css new file mode 100644 index 0000000000..e4bbd014af --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/claro.css @@ -0,0 +1 @@ +.dijitReset {margin:0; border:0; padding:0; line-height:normal; font: inherit; color: inherit;}.dj_a11y .dijitReset {-moz-appearance: none;}.dijitInline {display:inline-block; #zoom: 1; #display:inline; border:0; padding:0; vertical-align:middle; #vertical-align: auto;}table.dijitInline {display:inline-table; box-sizing: content-box; -moz-box-sizing: content-box;}.dijitHidden {display: none !important;}.dijitVisible {display: block !important; position: relative;}.dj_ie6 .dijitComboBox .dijitInputContainer,.dijitInputContainer {#zoom: 1; overflow: hidden; float: none !important; position: relative;}.dj_ie7 .dijitInputContainer {float: left !important; clear: left; display: inline-block !important;}.dj_ie .dijitSelect input,.dj_ie input.dijitTextBox,.dj_ie .dijitTextBox input {font-size: 100%;}.dijitSelect .dijitButtonText {float: left; vertical-align: top;}TABLE.dijitSelect {padding: 0 !important;}.dijitTextBox .dijitSpinnerButtonContainer,.dijitTextBox .dijitArrowButtonContainer,.dijitValidationTextBox .dijitValidationContainer {float: right; text-align: center;}.dijitSelect input.dijitInputField,.dijitTextBox input.dijitInputField {padding-left: 0 !important; padding-right: 0 !important;}.dijitValidationTextBox .dijitValidationContainer {display: none;}.dijitTeeny {font-size:1px; line-height:1px;}.dijitOffScreen {position: absolute !important; left: 50% !important; top: -10000px !important;}.dijitPopup {position: absolute; background-color: transparent; margin: 0; border: 0; padding: 0;}.dijitPositionOnly {padding: 0 !important; border: 0 !important; background-color: transparent !important; background-image: none !important; height: auto !important; width: auto !important;}.dijitNonPositionOnly {float: none !important; position: static !important; margin: 0 0 0 0 !important; vertical-align: middle !important;}.dijitBackgroundIframe {position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: -1; border: 0; padding: 0; margin: 0;}.dijitDisplayNone {display:none !important;}.dijitContainer {overflow: hidden;}.dj_a11y .dijitIcon,.dj_a11y div.dijitArrowButtonInner, .dj_a11y span.dijitArrowButtonInner,.dj_a11y img.dijitArrowButtonInner,.dj_a11y .dijitCalendarIncrementControl,.dj_a11y .dijitTreeExpando {display: none;}.dijitSpinner div.dijitArrowButtonInner {display: block;}.dj_a11y .dijitA11ySideArrow {display: inline !important; cursor: pointer;}.dj_a11y .dijitCalendarDateLabel {padding: 1px; border: 0px !important;}.dj_a11y .dijitCalendarSelectedDate .dijitCalendarDateLabel {border-style: solid !important; border-width: 1px !important; padding: 0;}.dj_a11y .dijitCalendarDateTemplate {padding-bottom: 0.1em !important; border: 0px !important;}.dj_a11y .dijitButtonNode {border: black outset medium !important; padding: 0 !important;}.dj_a11y .dijitArrowButton {padding: 0 !important;}.dj_a11y .dijitButtonContents {margin: 0.15em;}.dj_a11y .dijitTextBoxReadOnly .dijitInputField,.dj_a11y .dijitTextBoxReadOnly .dijitButtonNode {border-style: outset!important; border-width: medium!important; border-color: #999 !important; color:#999 !important;}.dijitButtonNode * {vertical-align: middle;}.dijitSelect .dijitArrowButtonInner,.dijitButtonNode .dijitArrowButtonInner {background: no-repeat center; width: 12px; height: 12px; direction: ltr;}.dijitLeft {background-position:left top; background-repeat:no-repeat;}.dijitStretch {white-space:nowrap; background-repeat:repeat-x;}.dijitRight {#display:inline; background-position:right top; background-repeat:no-repeat;}.dj_gecko .dj_a11y .dijitButtonDisabled .dijitButtonNode {opacity: 0.5;}.dijitToggleButton,.dijitButton,.dijitDropDownButton,.dijitComboButton {margin: 0.2em; vertical-align: middle;}.dijitButtonContents {display: block;}td.dijitButtonContents {display: table-cell;}.dijitButtonNode img {vertical-align:middle;}.dijitToolbar .dijitComboButton {border-collapse: separate;}.dijitToolbar .dijitToggleButton,.dijitToolbar .dijitButton,.dijitToolbar .dijitDropDownButton,.dijitToolbar .dijitComboButton {margin: 0;}.dijitToolbar .dijitButtonContents {padding: 1px 2px;}.dj_webkit .dijitToolbar .dijitDropDownButton {padding-left: 0.3em;}.dj_gecko .dijitToolbar .dijitButtonNode::-moz-focus-inner {padding:0;}.dijitSelect {border:1px solid gray;}.dijitButtonNode {border:1px solid gray; margin:0; line-height:normal; vertical-align: middle; #vertical-align: auto; text-align:center; white-space: nowrap;}.dj_webkit .dijitSpinner .dijitSpinnerButtonContainer {line-height:inherit;}.dijitTextBox .dijitButtonNode {border-width: 0;}.dijitSelect,.dijitSelect *,.dijitButtonNode,.dijitButtonNode * {cursor: pointer;}.dj_ie .dijitButtonNode {zoom: 1;}.dj_ie .dijitButtonNode button {overflow: visible;}div.dijitArrowButton {float: right;}.dijitTextBox {border: solid black 1px; #overflow: hidden; width: 15em; vertical-align: middle;}.dijitTextBoxReadOnly,.dijitTextBoxDisabled {color: gray;}.dj_webkit .dijitTextBoxDisabled input {color: #eee;}.dj_webkit textarea.dijitTextAreaDisabled {color: #333;}.dj_gecko .dijitTextBoxReadOnly input.dijitInputField, .dj_gecko .dijitTextBoxDisabled input {-moz-user-input: none;}.dijitPlaceHolder {color: #AAAAAA; font-style: italic; position: absolute; top: 0; left: 0; #filter: "";}.dijitTimeTextBox {width: 8em;}.dijitTextBox input:focus {outline: none;}.dijitTextBoxFocused {outline: 5px -webkit-focus-ring-color;}.dijitSelect input,.dijitTextBox input {float: left;}.dj_ie6 input.dijitTextBox,.dj_ie6 .dijitTextBox input {float: none;}.dijitInputInner {border:0 !important; background-color:transparent !important; width:100% !important; padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important;}.dj_a11y .dijitTextBox input {margin: 0 !important;}.dijitValidationTextBoxError input.dijitValidationInner,.dijitSelect input,.dijitTextBox input.dijitArrowButtonInner {text-indent: -2em !important; direction: ltr !important; text-align: left !important; height: auto !important; #text-indent: 0 !important; #letter-spacing: -5em !important; #text-align: right !important;}.dj_ie .dijitSelect input,.dj_ie .dijitTextBox input,.dj_ie input.dijitTextBox {overflow-y: visible; line-height: normal;}.dijitSelect .dijitSelectLabel span {line-height: 100%;}.dj_ie .dijitSelect .dijitSelectLabel {line-height: normal;}.dj_ie6 .dijitSelect .dijitSelectLabel,.dj_ie7 .dijitSelect .dijitSelectLabel,.dj_ie8 .dijitSelect .dijitSelectLabel,.dj_iequirks .dijitSelect .dijitSelectLabel,.dijitSelect td,.dj_ie6 .dijitSelect input,.dj_iequirks .dijitSelect input,.dj_ie6 .dijitSelect .dijitValidationContainer,.dj_ie6 .dijitTextBox input,.dj_ie6 input.dijitTextBox,.dj_iequirks .dijitTextBox input.dijitValidationInner,.dj_iequirks .dijitTextBox input.dijitArrowButtonInner,.dj_iequirks .dijitTextBox input.dijitSpinnerButtonInner,.dj_iequirks .dijitTextBox input.dijitInputInner,.dj_iequirks input.dijitTextBox {line-height: 100%;}.dj_a11y input.dijitValidationInner,.dj_a11y input.dijitArrowButtonInner {text-indent: 0 !important; width: 1em !important; #text-align: left !important; color: black !important;}.dijitValidationTextBoxError .dijitValidationContainer {display: inline; cursor: default;}.dijitSpinner .dijitSpinnerButtonContainer,.dijitComboBox .dijitArrowButtonContainer {border-width: 0 0 0 1px !important;}.dj_a11y .dijitSelect .dijitArrowButtonContainer,.dijitToolbar .dijitComboBox .dijitArrowButtonContainer {border-width: 0 !important;}.dijitComboBoxMenu {list-style-type: none;}.dijitSpinner .dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0;}.dj_ie .dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitButtonNode {clear: both;}.dj_ie .dijitToolbar .dijitComboBox {vertical-align: middle;}.dijitTextBox .dijitSpinnerButtonContainer {width: 1em; position: relative !important; overflow: hidden;}.dijitSpinner .dijitSpinnerButtonInner {width:1em; visibility:hidden !important; overflow-x:hidden;}.dijitComboBox .dijitButtonNode,.dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0;}.dj_a11y .dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0px !important; border-style: solid !important;}.dj_a11y .dijitTextBox .dijitSpinnerButtonContainer,.dj_a11y .dijitSpinner .dijitArrowButtonInner,.dj_a11y .dijitSpinnerButtonContainer input {width: 1em !important;}.dj_a11y .dijitSpinner .dijitArrowButtonInner {margin: 0 auto !important;}.dj_ie .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {padding-left: 0.3em !important; padding-right: 0.3em !important; margin-left: 0.3em !important; margin-right: 0.3em !important; width: 1.4em !important;}.dj_ie7 .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {padding-left: 0 !important; padding-right: 0 !important; width: 1em !important;}.dj_ie6 .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {margin-left: 0.1em !important; margin-right: 0.1em !important; width: 1em !important;}.dj_iequirks .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {margin-left: 0 !important; margin-right: 0 !important; width: 2em !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {padding: 0; position: absolute !important; right: 0; float: none; height: 50%; width: 100%; bottom: auto; left: 0; right: auto;}.dj_iequirks .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: auto;}.dj_a11y .dijitSpinnerButtonContainer .dijitArrowButton {overflow: visible !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitDownArrowButton {top: 50%; border-top-width: 1px !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitUpArrowButton {#bottom: 50%; top: 0;}.dijitSpinner .dijitArrowButtonInner {margin: auto; overflow-x: hidden; height: 100% !important;}.dj_iequirks .dijitSpinner .dijitArrowButtonInner {height: auto !important;}.dijitSpinner .dijitArrowButtonInner .dijitInputField {-moz-transform: scale(0.5); -moz-transform-origin: center top; -webkit-transform: scale(0.5); -webkit-transform-origin: center top; -o-transform: scale(0.5); -o-transform-origin: center top; transform: scale(0.5); transform-origin: left top; padding-top: 0; padding-bottom: 0; padding-left: 0 !important; padding-right: 0 !important; width: 100%; visibility: hidden;}.dj_ie .dijitSpinner .dijitArrowButtonInner .dijitInputField {zoom: 50%;}.dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButtonInner {overflow: hidden;}.dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: 100%;}.dj_iequirks .dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: 1em;}.dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {vertical-align:top; visibility: visible;}.dj_a11y .dijitSpinnerButtonContainer {width: 1em;}.dijitCheckBox,.dijitRadio,.dijitCheckBoxInput {padding: 0; border: 0; width: 16px; height: 16px; background-position:center center; background-repeat:no-repeat; overflow: hidden;}.dijitCheckBox input,.dijitRadio input {margin: 0; padding: 0; display: block;}.dijitCheckBoxInput {opacity: 0.01;}.dj_ie .dijitCheckBoxInput {filter: alpha(opacity=0);}.dj_a11y .dijitCheckBox,.dj_a11y .dijitRadio {width: auto !important; height: auto !important;}.dj_a11y .dijitCheckBoxInput {opacity: 1; filter: none; width: auto; height: auto;}.dj_a11y .dijitFocusedLabel {border: 1px dotted; outline: 0px !important;}.dijitProgressBar {z-index: 0;}.dijitProgressBarEmpty {position:relative;overflow:hidden; border:1px solid black; z-index:0;}.dijitProgressBarFull {position:absolute; overflow:hidden; z-index:-1; top:0; width:100%;}.dj_ie6 .dijitProgressBarFull {height:1.6em;}.dijitProgressBarTile {position:absolute; overflow:hidden; top:0; left:0; bottom:0; right:0; margin:0; padding:0; width: 100%; height:auto; background-color:#aaa; background-attachment: fixed;}.dj_a11y .dijitProgressBarTile {border-width:2px; border-style:solid; background-color:transparent !important;}.dj_ie6 .dijitProgressBarTile {position:static; height:1.6em;}.dijitProgressBarIndeterminate .dijitProgressBarTile {}.dijitProgressBarIndeterminateHighContrastImage {display:none;}.dj_a11y .dijitProgressBarIndeterminate .dijitProgressBarIndeterminateHighContrastImage {display:block; position:absolute; top:0; bottom:0; margin:0; padding:0; width:100%; height:auto;}.dijitProgressBarLabel {display:block; position:static; width:100%; text-align:center; background-color:transparent !important;}.dijitTooltip {position: absolute; z-index: 2000; display: block; left: 0; top: -10000px; overflow: visible;}.dijitTooltipContainer {border: solid black 2px; background: #b8b5b5; color: black; font-size: small;}.dijitTooltipFocusNode {padding: 2px 2px 2px 2px;}.dijitTooltipConnector {position: absolute;}.dj_a11y .dijitTooltipConnector {display: none;}.dijitTooltipData {display:none;}.dijitLayoutContainer {position: relative; display: block; overflow: hidden;}.dijitAlignTop,.dijitAlignBottom,.dijitAlignLeft,.dijitAlignRight {position: absolute; overflow: hidden;}body .dijitAlignClient {position: absolute;}.dijitBorderContainer, .dijitBorderContainerNoGutter {position:relative; overflow: hidden; z-index: 0;}.dijitBorderContainerPane,.dijitBorderContainerNoGutterPane {position: absolute !important; z-index: 2;}.dijitBorderContainer > .dijitTextArea {resize: none;}.dijitGutter {position: absolute; font-size: 1px;}.dijitSplitter {position: absolute; overflow: hidden; z-index: 10; background-color: #fff; border-color: gray; border-style: solid; border-width: 0;}.dj_ie .dijitSplitter {z-index: 1;}.dijitSplitterActive {z-index: 11 !important;}.dijitSplitterCover {position:absolute; z-index:-1; top:0; left:0; width:100%; height:100%;}.dijitSplitterCoverActive {z-index:3 !important;}.dj_ie .dijitSplitterCover {background: white; filter: alpha(opacity=0);}.dijitSplitterH {height: 7px; border-top:1px; border-bottom:1px; cursor: row-resize;}.dijitSplitterV {width: 7px; border-left:1px; border-right:1px; cursor: col-resize;}.dijitSplitContainer {position: relative; overflow: hidden; display: block;}.dj_ff3 .dj_a11y div.dijitSplitter:focus {outline-style:dotted; outline-width: 2px;}.dijitSplitPane {position: absolute;}.dijitSplitContainerSizerH,.dijitSplitContainerSizerV {position:absolute; font-size: 1px; background-color: ThreeDFace; border: 1px solid; border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight; margin: 0;}.dijitSplitContainerSizerH .thumb, .dijitSplitterV .dijitSplitterThumb {overflow:hidden; position:absolute; top:49%;}.dijitSplitContainerSizerV .thumb, .dijitSplitterH .dijitSplitterThumb {position:absolute; left:49%;}.dijitSplitterShadow,.dijitSplitContainerVirtualSizerH,.dijitSplitContainerVirtualSizerV {font-size: 1px; background-color: ThreeDShadow; -moz-opacity: 0.5; opacity: 0.5; filter: Alpha(Opacity=50); margin: 0;}.dijitSplitContainerSizerH, .dijitSplitContainerVirtualSizerH {cursor: col-resize;}.dijitSplitContainerSizerV, .dijitSplitContainerVirtualSizerV {cursor: row-resize;}.dj_a11y .dijitSplitterH {border-top:1px solid #d3d3d3 !important; border-bottom:1px solid #d3d3d3 !important;}.dj_a11y .dijitSplitterV {border-left:1px solid #d3d3d3 !important; border-right:1px solid #d3d3d3 !important;}.dijitContentPane {display: block; overflow: auto;}.dijitContentPaneSingleChild {overflow: hidden;}.dijitContentPaneLoading .dijitIconLoading,.dijitContentPaneError .dijitIconError {margin-right: 9px;}.dijitTitlePane {display: block; overflow: hidden;}.dijitTitlePaneTitle {cursor: pointer;}.dijitFixedOpen, .dijitFixedClosed {cursor: default;}.dijitFixedOpen .dijitArrowNode, .dijitFixedOpen .dijitArrowNodeInner,.dijitFixedClosed .dijitArrowNode, .dijitFixedClosed .dijitArrowNodeInner{display: none;}.dijitTitlePaneTitle * {vertical-align: middle;}.dijitTitlePane .dijitArrowNodeInner {display: none;}.dj_a11y .dijitTitlePane .dijitArrowNodeInner {display:inline !important; font-family: monospace;}.dj_a11y .dijitTitlePane .dijitArrowNode {display:none;}.dj_ie6 .dijitTitlePaneContentOuter,.dj_ie6 .dijitTitlePane .dijitTitlePaneTitle {zoom: 1;}.dijitColorPalette {border: 1px solid #999; background: #fff; position: relative;}.dijitColorPalette .dijitPaletteTable {padding: 2px 3px 3px 3px; position: relative; overflow: hidden; outline: 0; border-collapse: separate;}.dj_ie6 .dijitColorPalette .dijitPaletteTable,.dj_ie7 .dijitColorPalette .dijitPaletteTable,.dj_iequirks .dijitColorPalette .dijitPaletteTable {padding: 0; margin: 2px 3px 3px 3px;}.dijitColorPalette .dijitPaletteCell {font-size: 1px; vertical-align: middle; text-align: center; background: none;}.dijitColorPalette .dijitPaletteImg {padding: 1px; border: 1px solid #999; margin: 2px 1px; cursor: default; font-size: 1px;}.dj_gecko .dijitColorPalette .dijitPaletteImg {padding-bottom: 0;}.dijitColorPalette .dijitColorPaletteSwatch {width: 14px; height: 12px;}.dijitPaletteTable td {padding: 0;}.dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg {border: 1px solid #000;}.dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg,.dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg {border: 2px solid #000; margin: 1px 0;}.dj_a11y .dijitColorPalette .dijitPaletteTable,.dj_a11y .dijitColorPalette .dijitPaletteTable * {background-color: transparent !important;}.dijitAccordionContainer {border:1px solid #b7b7b7; border-top:0 !important;}.dijitAccordionTitle {cursor: pointer;}.dijitAccordionTitleSelected {cursor: default;}.dijitAccordionTitle .arrowTextUp,.dijitAccordionTitle .arrowTextDown {display: none; font-size: 0.65em; font-weight: normal !important;}.dj_a11y .dijitAccordionTitle .arrowTextUp,.dj_a11y .dijitAccordionTitleSelected .arrowTextDown {display: inline;}.dj_a11y .dijitAccordionTitleSelected .arrowTextUp {display: none;}.dijitAccordionChildWrapper {overflow: hidden;}.dijitCalendarContainer {width: auto;}.dijitCalendarContainer th, .dijitCalendarContainer td {padding: 0; vertical-align: middle;}.dijitCalendarYearLabel {white-space: nowrap;}.dijitCalendarNextYear {margin:0 0 0 0.55em;}.dijitCalendarPreviousYear {margin:0 0.55em 0 0;}.dijitCalendarIncrementControl {vertical-align: middle;}.dijitCalendarIncrementControl,.dijitCalendarDateTemplate,.dijitCalendarMonthLabel,.dijitCalendarPreviousYear,.dijitCalendarNextYear {cursor: pointer;}.dijitCalendarDisabledDate {color: gray; text-decoration: line-through; cursor: default;}.dijitSpacer {position: relative; height: 1px; overflow: hidden; visibility: hidden;}.dijitCalendarMonthMenu .dijitCalendarMonthLabel {text-align:center;}.dijitMenu {border:1px solid black; background-color:white;}.dijitMenuTable {border-collapse:collapse; border-width:0; background-color:white;}.dj_webkit .dijitMenuTable td[colspan="2"]{border-right:hidden;}.dijitMenuItem {text-align: left; white-space: nowrap; padding:.1em .2em; cursor:pointer;}.dijitMenuItem:focus {outline: none}.dijitMenuPassive .dijitMenuItemHover,.dijitMenuItemSelected {background-color:black; color:white;}.dijitMenuItemIcon, .dijitMenuExpand {background-repeat: no-repeat;}.dijitMenuItemDisabled * {opacity:0.5; cursor:default;}.dj_ie .dj_a11y .dijitMenuItemDisabled,.dj_ie .dj_a11y .dijitMenuItemDisabled *,.dj_ie .dijitMenuItemDisabled * {color: gray; filter: alpha(opacity=35);}.dijitMenuItemLabel {position: relative; vertical-align: middle;}.dj_a11y .dijitMenuItemSelected {border: 1px dotted black !important;}.dj_ff3 .dj_a11y .dijitMenuItem td {padding: 0 !important; background:none !important;}.dj_a11y .dijitMenuItemSelected .dijitMenuItemLabel {border-width: 1px; border-style: solid;}.dj_ie8 .dj_a11y .dijitMenuItemLabel {position:static;}.dijitMenuExpandA11y {display: none;}.dj_a11y .dijitMenuExpandA11y {display: inline;}.dijitMenuSeparator td {border: 0; padding: 0;}.dijitMenuSeparatorTop {height: 50%; margin: 0; margin-top:3px; font-size: 1px;}.dijitMenuSeparatorBottom {height: 50%; margin: 0; margin-bottom:3px; font-size: 1px;}.dijitCheckedMenuItemIconChar {vertical-align: middle; visibility:hidden;}.dijitCheckedMenuItemChecked .dijitCheckedMenuItemIconChar {visibility: visible;}.dj_a11y .dijitCheckedMenuItemIconChar {display:inline !important;}.dj_a11y .dijitCheckedMenuItemIcon {display: none;}.dj_ie .dj_a11y .dijitMenuBar .dijitMenuItem {margin: 0;}.dijitStackController .dijitToggleButtonChecked * {cursor: default;}.dijitTabContainer {z-index: 0; overflow-y: visible;}.dj_ie6 .dijitTabContainer {overflow: hidden;}.dijitTabContainerNoLayout {width: 100%;}.dijitTabContainerBottom-tabs,.dijitTabContainerTop-tabs,.dijitTabContainerLeft-tabs,.dijitTabContainerRight-tabs {z-index: 1; overflow: visible !important;}.dijitTabController {z-index: 1;}.dijitTabContainerBottom-container,.dijitTabContainerTop-container,.dijitTabContainerLeft-container,.dijitTabContainerRight-container {z-index:0; overflow: hidden; border: 1px solid black;}.nowrapTabStrip {width: 50000px; display: block; position: relative; text-align: left; z-index: 1;}.dijitTabListWrapper {overflow: hidden; z-index: 1;}.dj_a11y .tabStripButton img {display: none;}.dijitTabContainerTop-tabs {border-bottom: 1px solid black;}.dijitTabContainerTop-container {border-top: 0;}.dijitTabContainerLeft-tabs {border-right: 1px solid black; float: left;}.dijitTabContainerLeft-container {border-left: 0;}.dijitTabContainerBottom-tabs {border-top: 1px solid black;}.dijitTabContainerBottom-container {border-bottom: 0;}.dijitTabContainerRight-tabs {border-left: 1px solid black; float: left;}.dijitTabContainerRight-container {border-right: 0;}div.dijitTabDisabled, .dj_ie div.dijitTabDisabled {cursor: auto;}.dijitTab {position:relative; cursor:pointer; white-space:nowrap; z-index:3;}.dijitTab * {vertical-align: middle;}.dijitTabChecked {cursor: default;}.dijitTabContainerTop-tabs .dijitTab {top: 1px;}.dijitTabContainerBottom-tabs .dijitTab {top: -1px;}.dijitTabContainerLeft-tabs .dijitTab {left: 1px;}.dijitTabContainerRight-tabs .dijitTab {left: -1px;}.dijitTabContainerTop-tabs .dijitTab,.dijitTabContainerBottom-tabs .dijitTab {display:inline-block; #zoom: 1; #display:inline;}.tabStripButton {z-index: 12;}.dijitTabButtonDisabled .tabStripButton {display: none;}.dijitTabCloseButton {margin-left: 1em;}.dijitTabCloseText {display:none;}.dijitTab .tabLabel {min-height: 15px; display: inline-block;}.dijitNoIcon {display: none;}.dj_ie6 .dijitTab .dijitNoIcon {display: inline; height: 15px; width: 1px;}.dj_a11y .dijitTabCloseButton {background-image: none !important; width: auto !important; height: auto !important;}.dj_a11y .dijitTabCloseText {display: inline;}.dijitTabPane,.dijitStackContainer-child,.dijitAccordionContainer-child {border: none !important;}.dijitInlineEditBoxDisplayMode {border: 1px solid transparent; cursor: text;}.dj_a11y .dijitInlineEditBoxDisplayMode,.dj_ie6 .dijitInlineEditBoxDisplayMode {border: none;}.dijitInlineEditBoxDisplayModeHover,.dj_a11y .dijitInlineEditBoxDisplayModeHover,.dj_ie6 .dijitInlineEditBoxDisplayModeHover {background-color: #e2ebf2; border: solid 1px black;}.dijitInlineEditBoxDisplayModeDisabled {cursor: default;}.dijitTree {overflow: auto;}.dijitTreeIndent {width: 19px;}.dijitTreeRow, .dijitTreeContent {white-space: nowrap;}.dijitTreeRow img {vertical-align: middle;}.dijitTreeContent {cursor: default;}.dijitExpandoText {display: none;}.dj_a11y .dijitExpandoText {display: inline; padding-left: 10px; padding-right: 10px; font-family: monospace; border-style: solid; border-width: thin; cursor: pointer;}.dijitTreeLabel {margin: 0 4px;}.dijitDialog {position: absolute; z-index: 999; overflow: hidden;}.dijitDialogTitleBar {cursor: move;}.dijitDialogFixed .dijitDialogTitleBar {cursor:default;}.dijitDialogCloseIcon {cursor: pointer;}.dijitDialogUnderlayWrapper {position: absolute; left: 0; top: 0; z-index: 998; display: none; background: transparent !important;}.dijitDialogUnderlay {background: #eee; opacity: 0.5;}.dj_ie .dijitDialogUnderlay {filter: alpha(opacity=50);}.dj_a11y .dijitSpinnerButtonContainer,.dj_a11y .dijitDialog {opacity: 1 !important; background-color: white !important;}.dijitDialog .closeText {display:none; position:absolute;}.dj_a11y .dijitDialog .closeText {display:inline;}.dijitSliderMoveable {z-index:99; position:absolute !important; display:block; vertical-align:middle;}.dijitSliderMoveableH {right:0;}.dijitSliderMoveableV {right:50%;}.dj_a11y div.dijitSliderImageHandle,.dijitSliderImageHandle {margin:0; padding:0; position:relative !important; border:8px solid gray; width:0; height:0; cursor: pointer;}.dj_iequirks .dj_a11y .dijitSliderImageHandle {font-size: 0;}.dj_ie7 .dijitSliderImageHandle {overflow: hidden;}.dj_ie7 .dj_a11y .dijitSliderImageHandle {overflow: visible;}.dj_a11y .dijitSliderFocused .dijitSliderImageHandle {border:4px solid #000; height:8px; width:8px;}.dijitSliderImageHandleV {top:-8px; right: -50%;}.dijitSliderImageHandleH {left:50%; top:-5px; vertical-align:top;}.dijitSliderBar {border-style:solid; border-color:black; cursor: pointer;}.dijitSliderBarContainerV {position:relative; height:100%; z-index:1;}.dijitSliderBarContainerH {position:relative; z-index:1;}.dijitSliderBarH {height:4px; border-width:1px 0;}.dijitSliderBarV {width:4px; border-width:0 1px;}.dijitSliderProgressBar {background-color:red; z-index:1;}.dijitSliderProgressBarV {position:static !important; height:0; vertical-align:top; text-align:left;}.dijitSliderProgressBarH {position:absolute !important; width:0; vertical-align:middle; overflow:visible;}.dijitSliderRemainingBar {overflow:hidden; background-color:transparent; z-index:1;}.dijitSliderRemainingBarV {height:100%; text-align:left;}.dijitSliderRemainingBarH {width:100% !important;}.dijitSliderBumper {overflow:hidden; z-index:1;}.dijitSliderBumperV {width:4px; height:8px; border-width:0 1px;}.dijitSliderBumperH {width:8px; height:4px; border-width:1px 0;}.dijitSliderBottomBumper,.dijitSliderLeftBumper {background-color:red;}.dijitSliderTopBumper,.dijitSliderRightBumper {background-color:transparent;}.dijitSliderDecoration {text-align:center;}.dijitSliderDecorationC,.dijitSliderDecorationV {position: relative;}.dijitSliderDecorationH {width: 100%;}.dijitSliderDecorationV {height: 100%;}.dijitSliderButton {font-family:monospace; margin:0; padding:0; display:block;}.dj_a11y .dijitSliderButtonInner {visibility:visible !important;}.dijitSliderButtonContainer {text-align:center; height:0;}.dijitSliderButtonContainer * {cursor: pointer;}.dijitSlider .dijitButtonNode {padding:0; display:block;}.dijitRuleContainer {position:relative; overflow:visible;}.dijitRuleContainerV {height:100%; line-height:0; float:left; text-align:left;}.dj_opera .dijitRuleContainerV {line-height:2%;}.dj_ie .dijitRuleContainerV {line-height:normal;}.dj_gecko .dijitRuleContainerV {margin:0 0 1px 0;}.dijitRuleMark {position:absolute; border:1px solid black; line-height:0; height:100%;}.dijitRuleMarkH {width:0; border-top-width:0 !important; border-bottom-width:0 !important; border-left-width:0 !important;}.dijitRuleLabelContainer {position:absolute;}.dijitRuleLabelContainerH {text-align:center; display:inline-block;}.dijitRuleLabelH {position:relative; left:-50%;}.dijitRuleLabelV {text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}.dijitRuleMarkV {height:0; border-right-width:0 !important; border-bottom-width:0 !important; border-left-width:0 !important; width:100%; left:0;}.dj_ie .dijitRuleLabelContainerV {margin-top:-.55em;}.dj_a11y .dijitSliderReadOnly,.dj_a11y .dijitSliderDisabled {opacity:0.6;}.dj_ie .dj_a11y .dijitSliderReadOnly .dijitSliderBar,.dj_ie .dj_a11y .dijitSliderDisabled .dijitSliderBar {filter: alpha(opacity=40);}.dj_a11y .dijitSlider .dijitSliderButtonContainer div {font-family: monospace; font-size: 1em; line-height: 1em; height: auto; width: auto; margin: 0 4px;}.dj_a11y .dijitButtonContents .dijitButtonText,.dj_a11y .dijitTab .tabLabel {display: inline !important;}.dj_a11y .dijitSelect .dijitButtonText {display: inline-block !important;}.dijitSelectError .dijitButtonContents .dijitButtonText {display: none !important;}.dijitTextArea {width:100%; overflow-y: auto;}.dijitTextArea[cols] {width:auto;}.dj_ie .dijitTextAreaCols {width:auto;}.dijitExpandingTextArea {resize: none;}.dijitToolbarSeparator {height: 18px; width: 5px; padding: 0 1px; margin: 0;}.dijitIEFixedToolbar {position:absolute; top: expression(eval((document.documentElement||document.body).scrollTop));}.dijitEditor {display: block;}.dijitEditorDisabled,.dijitEditorReadOnly {color: gray;}.dijitTimePickerItemInner {text-align:center; border:0; padding:2px 8px 2px 8px;}.dijitTimePickerTick,.dijitTimePickerMarker {border-bottom:1px solid gray;}.dijitTimePicker .dijitDownArrowButton {border-top: none !important;}.dijitTimePickerTick {color:#CCC;}.dijitTimePickerMarker {color:black; background-color:#CCC;}.dijitTimePickerItemSelected {font-weight:bold; color:#333; background-color:#b7cdee;}.dijitTimePickerItemHover {background-color:gray; color:white; cursor:pointer;}.dijitTimePickerItemDisabled {color:gray; text-decoration:line-through;}.dj_a11y .dijitTimePickerItemSelected .dijitTimePickerItemInner {border: solid 4px black;}.dj_a11y .dijitTimePickerItemHover .dijitTimePickerItemInner {border: dashed 4px black;}.dijitToggleButtonIconChar {display:none !important;}.dj_a11y .dijitToggleButton .dijitToggleButtonIconChar {display:inline !important; visibility:hidden;}.dj_ie6 .dijitToggleButtonIconChar, .dj_ie6 .tabStripButton .dijitButtonText {font-family: "Arial Unicode MS";}.dj_a11y .dijitToggleButtonChecked .dijitToggleButtonIconChar {display: inline !important; visibility:visible !important;}.dijitArrowButtonChar {display:none !important;}.dj_a11y .dijitArrowButtonChar {display:inline !important;}.dj_a11y .dijitDropDownButton .dijitArrowButtonInner,.dj_a11y .dijitComboButton .dijitArrowButtonInner {display:none !important;}.dj_a11y .dijitSelect {border-collapse: separate !important; border-width: 1px; border-style: solid;}.dj_ie .dijitSelect {vertical-align: middle;}.dj_ie6 .dijitSelect .dijitValidationContainer,.dj_ie8 .dijitSelect .dijitButtonText {vertical-align: top;}.dj_ie6 .dijitTextBox .dijitInputContainer,.dj_iequirks .dijitTextBox .dijitInputContainer,.dj_ie6 .dijitTextBox .dijitArrowButtonInner,.dj_ie6 .dijitSpinner .dijitSpinnerButtonInner,.dijitSelect .dijitSelectLabel {vertical-align: baseline;}.dijitToolbar .dijitSelect {margin: 0;}.dj_webkit .dijitToolbar .dijitSelect {padding-left: 0.3em;}.dijitSelect .dijitButtonContents {padding: 0; white-space: nowrap; text-align: left; border-style: none solid none none; border-width: 1px;}.dijitSelectFixedWidth .dijitButtonContents {width: 100%;}.dijitSelectMenu .dijitMenuItemIcon {display:none;}.dj_ie6 .dijitSelectMenu .dijitMenuItemLabel,.dj_ie7 .dijitSelectMenu .dijitMenuItemLabel {position: static;}.dijitSelectLabel *{vertical-align: baseline;}.dijitSelectSelectedOption * {font-weight: bold;}.dijitSelectMenu {border-width: 1px;}.dijitSelectMenu .dijitMenuTable {margin: 0; background-color: transparent;}.dijitForceStatic {position: static !important;}.dijitReadOnly *,.dijitDisabled *,.dijitReadOnly,.dijitDisabled {cursor: default;}.dojoDndItem {padding: 2px; -webkit-touch-callout: none; -webkit-user-select: none;}.dojoDndHorizontal .dojoDndItem {#display: inline; display: inline-block;}.dojoDndItemBefore,.dojoDndItemAfter {border: 0px solid #369;}.dojoDndItemBefore {border-width: 2px 0 0 0; padding: 0 2px 2px 2px;}.dojoDndItemAfter {border-width: 0 0 2px 0; padding: 2px 2px 0 2px;}.dojoDndHorizontal .dojoDndItemBefore {border-width: 0 0 0 2px; padding: 2px 2px 2px 0;}.dojoDndHorizontal .dojoDndItemAfter {border-width: 0 2px 0 0; padding: 2px 0 2px 2px;}.dojoDndItemOver {cursor:pointer;}.dj_gecko .dijitArrowButtonInner INPUT,.dj_gecko INPUT.dijitArrowButtonInner {-moz-user-focus:ignore;}.dijitIconSave,.dijitIconPrint,.dijitIconCut,.dijitIconCopy,.dijitIconClear,.dijitIconDelete,.dijitIconUndo,.dijitIconEdit,.dijitIconNewTask,.dijitIconEditTask,.dijitIconEditProperty,.dijitIconTask,.dijitIconFilter,.dijitIconConfigure,.dijitIconSearch,.dijitIconApplication,.dijitIconBookmark,.dijitIconChart,.dijitIconConnector,.dijitIconDatabase,.dijitIconDocuments,.dijitIconMail,.dijitLeaf,.dijitIconFile,.dijitIconFunction,.dijitIconKey,.dijitIconPackage,.dijitIconSample,.dijitIconTable,.dijitIconUsers,.dijitFolderClosed,.dijitIconFolderClosed,.dijitFolderOpened,.dijitIconFolderOpen,.dijitIconError {background-image: url("../../icons/images/commonIconsObjActEnabled.png"); width: 16px; height: 16px;}.dj_ie6 .dijitIconSave,.dj_ie6 .dijitIconPrint,.dj_ie6 .dijitIconCut,.dj_ie6 .dijitIconCopy,.dj_ie6 .dijitIconClear,.dj_ie6 .dijitIconDelete,.dj_ie6 .dijitIconUndo,.dj_ie6 .dijitIconEdit,.dj_ie6 .dijitIconNewTask,.dj_ie6 .dijitIconEditTask,.dj_ie6 .dijitIconEditProperty,.dj_ie6 .dijitIconTask,.dj_ie6 .dijitIconFilter,.dj_ie6 .dijitIconConfigure,.dj_ie6 .dijitIconSearch,.dj_ie6 .dijitIconApplication,.dj_ie6 .dijitIconBookmark,.dj_ie6 .dijitIconChart,.dj_ie6 .dijitIconConnector,.dj_ie6 .dijitIconDatabase,.dj_ie6 .dijitIconDocuments,.dj_ie6 .dijitIconMail,.dj_ie6 .dijitLeaf,.dj_ie6 .dijitIconFile,.dj_ie6 .dijitIconFunction,.dj_ie6 .dijitIconKey,.dj_ie6 .dijitIconPackage,.dj_ie6 .dijitIconSample,.dj_ie6 .dijitIconTable,.dj_ie6 .dijitIconUsers,.dj_ie6 .dijitFolderClosed,.dj_ie6 .dijitIconFolderClosed,.dj_ie6 .dijitFolderOpened,.dj_ie6 .dijitIconFolderOpen,.dj_ie6 .dijitIconError {background-image: url("../../icons/images/commonIconsObjActEnabled8bit.png");}.dijitDisabled .dijitIconSave,.dijitDisabled .dijitIconPrint,.dijitDisabled .dijitIconCut,.dijitDisabled .dijitIconCopy,.dijitDisabled .dijitIconClear,.dijitDisabled .dijitIconDelete,.dijitDisabled .dijitIconUndo,.dijitDisabled .dijitIconEdit,.dijitDisabled .dijitIconNewTask,.dijitDisabled .dijitIconEditTask,.dijitDisabled .dijitIconEditProperty,.dijitDisabled .dijitIconTask,.dijitDisabled .dijitIconFilter,.dijitDisabled .dijitIconConfigure,.dijitDisabled .dijitIconSearch,.dijitDisabled .dijitIconApplication,.dijitDisabled .dijitIconBookmark,.dijitDisabled .dijitIconChart,.dijitDisabled .dijitIconConnector,.dijitDisabled .dijitIconDatabase,.dijitDisabled .dijitIconDocuments,.dijitDisabled .dijitIconMail,.dijitDisabled .dijitLeaf,.dijitDisabled .dijitIconFile,.dijitDisabled .dijitIconFunction,.dijitDisabled .dijitIconKey,.dijitDisabled .dijitIconPackage,.dijitDisabled .dijitIconSample,.dijitDisabled .dijitIconTable,.dijitDisabled .dijitIconUsers,.dijitDisabled .dijitFolderClosed,.dijitDisabled .dijitIconFolderClosed,.dijitDisabled .dijitFolderOpened,.dijitDisabled .dijitIconFolderOpen,.dijitDisabled .dijitIconError {background-image: url("../../icons/images/commonIconsObjActDisabled.png");}.dijitIconSave {background-position: 0;}.dijitIconPrint {background-position: -16px;}.dijitIconCut {background-position: -32px;}.dijitIconCopy {background-position: -48px;}.dijitIconClear {background-position: -64px;}.dijitIconDelete {background-position: -80px;}.dijitIconUndo {background-position: -96px;}.dijitIconEdit {background-position: -112px;}.dijitIconNewTask {background-position: -128px;}.dijitIconEditTask {background-position: -144px;}.dijitIconEditProperty {background-position: -160px;}.dijitIconTask {background-position: -176px;}.dijitIconFilter {background-position: -192px;}.dijitIconConfigure {background-position: -208px;}.dijitIconSearch {background-position: -224px;}.dijitIconError {background-position: -496px;} .dijitIconApplication {background-position: -240px;}.dijitIconBookmark {background-position: -256px;}.dijitIconChart {background-position: -272px;}.dijitIconConnector {background-position: -288px;}.dijitIconDatabase {background-position: -304px;}.dijitIconDocuments {background-position: -320px;}.dijitIconMail {background-position: -336px;}.dijitIconFile, .dijitLeaf {background-position: -352px;}.dijitIconFunction {background-position: -368px;}.dijitIconKey {background-position: -384px;}.dijitIconPackage{background-position: -400px;}.dijitIconSample {background-position: -416px;}.dijitIconTable {background-position: -432px;}.dijitIconUsers {background-position: -448px;}.dijitIconFolderClosed, .dijitFolderClosed {background-position: -464px;}.dijitIconFolderOpen, .dijitFolderOpened {background-position: -480px;}.dijitIconLoading {background:url("../../icons/images/loadingAnimation_rtl.gif") no-repeat; height: 20px; width: 20px;}.claro .dijitPopup {-webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);}.claro .dijitTooltipDialogPopup {-webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}.claro .dijitComboBoxHighlightMatch {background-color: #abd6ff;}.claro .dijitFocusedLabel {outline: 1px dotted #494949;}.claro .dojoDndItem {border-color: rgba(0, 0, 0, 0); -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s; -webkit-transition-property: background-color, border-color; -moz-transition-property: background-color, border-color; transition-property: background-color, border-color;}.claro .dojoDndItemOver {background-color: #abd6ff; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px; border: solid 1px #759dc0; color: #000000;}.claro .dojoDndItemAnchor, .claro .dojoDndItemSelected {background-color: #cfe5fa; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px; border: solid 1px #759dc0; color: #000000;}.claro .dojoDndItemBefore, .claro .dojoDndItemAfter {border-color: #759dc0;}.claro table.dojoDndAvatar {border: 1px solid #b5bcc7; border-collapse: collapse; background-color: #ffffff; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);}.claro .dojoDndAvatarHeader td {height: 20px; padding-left: 21px;}.claro.dojoDndMove .dojoDndAvatarHeader, .claro.dojoDndCopy .dojoDndAvatarHeader {background-image: url("images/dnd.png"); background-repeat: no-repeat; background-position: 2px -122px;}.claro .dojoDndAvatarItem td {padding: 5px;}.claro.dojoDndMove .dojoDndAvatarHeader {background-color: #f58383; background-position: 2px -103px;}.claro.dojoDndCopy .dojoDndAvatarHeader {background-color: #f58383; background-position: 2px -68px;}.claro.dojoDndMove .dojoDndAvatarCanDrop .dojoDndAvatarHeader {background-color: #97e68d; background-position: 2px -33px;}.claro.dojoDndCopy .dojoDndAvatarCanDrop .dojoDndAvatarHeader {background-color: #97e68d; background-position: 2px 2px;}.claro .dijitTextBox, .claro .dijitInputInner {color: #000000;}.claro .dijitValidationTextBoxError .dijitValidationContainer {background-color: #d46464; background-image: url("form/images/error.png"); background-position: top center; border: solid #d46464 0; width: 9px;}.claro .dijitTextBoxError .dijitValidationContainer {border-left-width: 1px;}.claro .dijitValidationTextBoxError .dijitValidationIcon {width: 0; background-color: transparent !important;}.claro .dijitTextArea, .claro .dijitInputField .dijitPlaceHolder {padding: 2px;}.claro .dijitSelect .dijitInputField, .claro .dijitTextBox .dijitInputField {padding: 1px 2px;}.dj_gecko .claro .dijitTextBox .dijitInputInner, .dj_webkit .claro .dijitTextBox .dijitInputInner {padding: 1px;}.claro .dijitSelect,.claro .dijitSelect .dijitButtonContents,.claro .dijitTextBox,.claro .dijitTextBox .dijitButtonNode {border-color: #b5bcc7; -webkit-transition-property: background-color, border; -moz-transition-property: background-color, border; transition-property: background-color, border; -webkit-transition-duration: 0.35s; -moz-transition-duration: 0.35s; transition-duration: 0.35s;}.claro .dijitSelect, .claro .dijitTextBox {background-color: #ffffff;}.claro .dijitSelectHover,.claro .dijitSelectHover .dijitButtonContents,.claro .dijitTextBoxHover,.claro .dijitTextBoxHover .dijitButtonNode {border-color: #759dc0; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s;}.claro .dijitTextBoxHover {background-color: #e5f2fe; background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);}.claro .dijitSelectError,.claro .dijitSelectError .dijitButtonContents,.claro .dijitTextBoxError,.claro .dijitTextBoxError .dijitButtonNode {border-color: #d46464;}.claro .dijitSelectFocused,.claro .dijitSelectFocused .dijitButtonContents,.claro .dijitTextBoxFocused,.claro .dijitTextBoxFocused .dijitButtonNode {border-color: #759dc0; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitTextBoxFocused {background-color: #ffffff; background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);}.claro .dijitTextBoxFocused .dijitInputContainer {background: #ffffff;}.claro .dijitSelectErrorFocused,.claro .dijitSelectErrorFocused .dijitButtonContents,.claro .dijitTextBoxErrorFocused,.claro .dijitTextBoxErrorFocused .dijitButtonNode {border-color: #ce5050;}.claro .dijitSelectDisabled,.claro .dijitSelectDisabled .dijitButtonContents,.claro .dijitTextBoxDisabled,.claro .dijitTextBoxDisabled .dijitButtonNode {border-color: #d3d3d3;}.claro .dijitSelectDisabled, .claro .dijitTextBoxDisabled, .claro .dijitTextBoxDisabled .dijitInputContainer {background-color: #efefef; background-image: none;}.claro .dijitSelectDisabled, .claro .dijitTextBoxDisabled, .claro .dijitTextBoxDisabled .dijitInputInner {color: #818181;}.dj_webkit .claro .dijitDisabled input {color: #757575;}.dj_webkit .claro textarea.dijitTextAreaDisabled {color: #1b1b1b;}.claro .dijitSelect .dijitArrowButtonInner, .claro .dijitComboBox .dijitArrowButtonInner {background-image: url("form/images/commonFormArrows.png"); background-position: -35px 53%; background-repeat: no-repeat; margin: 0; width: 16px;}.claro .dijitComboBox .dijitArrowButtonInner {border: 1px solid #ffffff;}.claro .dijitToolbar .dijitComboBox .dijitArrowButtonInner {border: none;}.claro .dijitToolbar .dijitComboBox .dijitArrowButtonInner {border: none;}.claro .dijitSelectLabel, .claro .dijitTextBox .dijitInputInner, .claro .dijitValidationTextBox .dijitValidationContainer {padding: 1px 0;}.claro .dijitComboBox .dijitButtonNode {background-color: #efefef; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitComboBoxOpenOnClickHover .dijitButtonNode, .claro .dijitComboBox .dijitDownArrowButtonHover {background-color: #abd6ff;}.claro .dijitComboBoxOpenOnClickHover .dijitArrowButtonInner, .claro .dijitComboBox .dijitDownArrowButtonHover .dijitArrowButtonInner {background-position: -70px 53%;}.claro .dijitComboBox .dijitHasDropDownOpen {background-color: #7dbdfa; background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px;}.dj_iequirks .claro .dijitComboBox .dijitHasDropDownOpen {padding: 1px 0;}.claro .dijitComboBox .dijitHasDropDownOpen .dijitArrowButtonInner {background-position: -70px 53%; border: 0 none;}.claro div.dijitComboBoxDisabled .dijitArrowButtonInner {background-position: 0 50%; background-color: #efefef;}.dj_ff3 .claro .dijitInputField input[type="hidden"] {display: none; height: 0; width: 0;}.dj_borderbox .claro .dijitComboBox .dijitHasDropDownOpen .dijitArrowButtonInner {width: 18px;}.dj_borderbox .claro .dijitComboBoxFocused .dijitHasDropDownOpen .dijitArrowButtonInner {width: 16px;}.claro .dijitButtonNode {-webkit-transition-property: background-color; -moz-transition-property: background-color; transition-property: background-color; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s;}.claro .dijitButton .dijitButtonNode,.claro .dijitDropDownButton .dijitButtonNode,.claro .dijitComboButton .dijitButtonNode,.claro .dijitToggleButton .dijitButtonNode {border: 1px solid #759dc0; padding: 2px 4px 4px 4px; color: #000000; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); background-color: #bcd8f4; background-image: url("form/images/buttonEnabled.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); background-image: -webkit-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); background-image: -o-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); background-image: -ms-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); _background-image: none;}.claro .dijitComboButton .dijitArrowButton {border-left-width: 0; padding: 4px 2px 4px 2px;}.claro .dijitArrowButtonInner {width: 15px; height: 15px; margin: 0 auto; background-image: url("form/images/buttonArrows.png"); background-repeat: no-repeat; background-position: -51px 53%;}.claro .dijitLeftArrowButton .dijitArrowButtonInner {background-position: -77px 53%;}.claro .dijitRightArrowButton .dijitArrowButtonInner {background-position: -26px 53%;}.claro .dijitUpArrowButton .dijitArrowButtonInner {background-position: 0 53%;}.claro .dijitDisabled .dijitArrowButtonInner {background-position: -151px 53%;}.claro .dijitDisabled .dijitLeftArrowButton .dijitArrowButtonInner {background-position: -177px 53%;}.claro .dijitDisabled .dijitRightArrowButton .dijitArrowButtonInner {background-position: -126px 53%;}.claro .dijitDisabled .dijitUpArrowButton .dijitArrowButtonInner {background-position: -100px 53%;}.claro .dijitButtonText {padding: 0 0.3em; text-align: center;}.claro .dijitButtonHover .dijitButtonNode,.claro .dijitDropDownButtonHover .dijitButtonNode,.claro .dijitComboButton .dijitButtonNodeHover,.claro .dijitComboButton .dijitDownArrowButtonHover,.claro .dijitToggleButtonHover .dijitButtonNode {background-color: #86bdf2; color: #000000; -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s;}.claro .dijitButtonActive .dijitButtonNode,.claro .dijitDropDownButtonActive .dijitButtonNode,.claro .dijitComboButtonActive .dijitButtonNode,.claro .dijitToggleButtonActive .dijitButtonNode,.claro .dijitToggleButtonChecked .dijitButtonNode {background-color: #86bdf2; -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitButtonDisabled,.claro .dijitDropDownButtonDisabled,.claro .dijitComboButtonDisabled,.claro .dijitToggleButtonDisabled {background-image: none; outline: none;}.claro .dijitButtonDisabled .dijitButtonNode,.claro .dijitDropDownButtonDisabled .dijitButtonNode,.claro .dijitComboButtonDisabled .dijitButtonNode,.claro .dijitToggleButtonDisabled .dijitButtonNode {background-color: #efefef; border: solid 1px #d3d3d3; color: #818181; -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0); -moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0); box-shadow: 0 0 0 rgba(0, 0, 0, 0); background-image: url("form/images/buttonDisabled.png"); background-image: -moz-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); background-image: -webkit-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); background-image: -o-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); background-image: -ms-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); _background-image: none;}.claro .dijitComboButtonDisabled .dijitArrowButton {border-left-width: 0;}.claro table.dijitComboButton {border-collapse: separate;}.claro .dijitComboButton .dijitStretch {-moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px;}.claro .dijitComboButton .dijitArrowButton {-moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;}.claro .dijitToggleButton .dijitCheckBoxIcon {background-image: url("images/checkmarkNoBorder.png");}.dj_ie6 .claro .dijitToggleButton .dijitCheckBoxIcon {background-image: url("images/checkmarkNoBorder.gif");}.claro .dijitCheckBox, .claro .dijitCheckBoxIcon {background-image: url("form/images/checkboxRadioButtonStates.png"); background-repeat: no-repeat; width: 15px; height: 16px; margin: 0 2px 0 0; padding: 0;}.dj_ie6 .claro .dijitCheckBox, .dj_ie6 .claro .dijitCheckBoxIcon {background-image: url("form/images/checkboxAndRadioButtons_IE6.png");}.claro .dijitCheckBox, .claro .dijitToggleButton .dijitCheckBoxIcon {background-position: -15px;}.claro .dijitCheckBoxChecked, .claro .dijitToggleButtonChecked .dijitCheckBoxIcon {background-position: 0;}.claro .dijitCheckBoxDisabled {background-position: -75px;}.claro .dijitCheckBoxCheckedDisabled {background-position: -60px;}.claro .dijitCheckBoxHover {background-position: -45px;}.claro .dijitCheckBoxCheckedHover {background-position: -30px;}.claro .dijitToggleButton .dijitRadio, .claro .dijitToggleButton .dijitRadioIcon {background-image: url("form/images/checkboxRadioButtonStates.png");}.dj_ie6 .claro .dijitToggleButton .dijitRadio, .dj_ie6 .claro .dijitToggleButton .dijitRadioIcon {background-image: url("form/images/checkboxAndRadioButtons_IE6.png");}.claro .dijitRadio, .claro .dijitRadioIcon {background-image: url("form/images/checkboxRadioButtonStates.png"); background-repeat: no-repeat; width: 15px; height: 15px; margin: 0 2px 0 0; padding: 0;}.dj_ie6 .claro .dijitRadio, .dj_ie6 .claro .dijitRadioIcon {background-image: url("form/images/checkboxAndRadioButtons_IE6.png");}.claro .dijitRadio {background-position: -105px;}.claro .dijitToggleButton .dijitRadioIcon {background-position: -107px;}.claro .dijitRadioDisabled {background-position: -165px;}.claro .dijitRadioHover {background-position: -135px;}.claro .dijitRadioChecked {background-position: -90px;}.claro .dijitToggleButtonChecked .dijitRadioIcon {background-position: -92px;}.claro .dijitRadioCheckedHover {background-position: -120px;}.claro .dijitRadioCheckedDisabled {background-position: -150px;}.claro .dijitSelect .dijitArrowButtonContainer {border: 1px solid #ffffff;}.claro .dijitSelect .dijitArrowButton {padding: 0; background-color: #efefef; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitSelect .dijitArrowButton .dijitArrowButtonInner {height: 16px;}.claro .dijitSelectHover {background-color: #e5f2fe; background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-repeat: repeat-x;}.claro .dijitSelectFocused, .claro .dijitSelectHover {border-color: #759dc0;}.claro .dijitSelectHover .dijitArrowButton {background-color: #abd6ff;}.claro .dijitSelectHover .dijitArrowButton .dijitArrowButtonInner {background-position: -70px 53%;}.claro .dijitSelectFocused .dijitArrowButton {background-color: #7dbefa; background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitSelectFocused .dijitArrowButton {border: none; padding: 1px;}.claro .dijitSelectFocused .dijitArrowButton .dijitArrowButtonInner {background-position: -70px 53%;}.claro .dijitSelectDisabled {border-color: #d3d3d3; background-color: #efefef; background-image: none; color: #818181;}.claro .dijitSelectDisabled .dijitArrowButton .dijitArrowButtonInner {background-position: 0 53%;}.claro .dijitSelectMenu td.dijitMenuItemIconCell, .claro .dijitSelectMenu td.dijitMenuArrowCell {display: none;}.claro .dijitSelectMenu td.dijitMenuItemLabel {padding: 2px;}.claro .dijitSelectMenu .dijitMenuSeparatorTop {border-bottom: 1px solid #759dc0;}.claro .dijitTabPaneWrapper {background: #ffffff;}.claro .dijitTabPaneWrapper,.claro .dijitTabContainerTop-tabs,.claro .dijitTabContainerBottom-tabs,.claro .dijitTabContainerLeft-tabs,.claro .dijitTabContainerRight-tabs {border-color: #b5bcc7;}.claro .dijitTabCloseButton {background: url("layout/images/tabClose.png") no-repeat; width: 14px; height: 14px; margin-left: 5px; margin-right: -5px;}.claro .dijitTabCloseButtonHover {background-position: -14px;}.claro .dijitTabCloseButtonActive {background-position: -28px;}.claro .dijitTabSpacer {display: none;}.claro .dijitTab {border: 1px solid #b5bcc7; background-color: #efefef; -webkit-transition-property: background-color, border; -moz-transition-property: background-color, border; transition-property: background-color, border; -webkit-transition-duration: 0.35s; -moz-transition-duration: 0.35s; transition-duration: 0.35s; color: #494949;}.claro .dijitTabHover {border-color: #759dc0; background-color: #abd6ff; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s; color: #000000;}.claro .dijitTabActive {border-color: #759dc0; background-color: #7dbdfa; color: #000000; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitTabChecked {border-color: #b5bcc7; background-color: #cfe5fa; color: #000000;}.claro .dijitTabDisabled {background-color: #d3d3d3;}.claro .tabStripButton {background-color: transparent; border: none;}.claro .dijitTabContainerTop-tabs .dijitTab {top: 1px; margin-right: 1px; padding: 3px 6px; border-bottom-width: 0; min-width: 60px; text-align: center; background-image: url("layout/images/tabTopUnselected.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); -webkit-box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04); -moz-box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04); box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04);}.claro .dijitTabContainerTop-tabs .dijitTabChecked {padding-bottom: 4px; padding-top: 9px; background-image: url("layout/images/tabTopSelected.png"); background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); -webkit-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05);}.claro .dijitTabContainerBottom-tabs .dijitTab {top: -1px; margin-right: 1px; padding: 3px 6px; border-top-width: 0; min-width: 60px; text-align: center; background-image: url("layout/images/tabBottomUnselected.png"); background-repeat: repeat-x; background-position: bottom; background-image: -moz-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);}.claro .dijitTabContainerBottom-tabs .dijitTabChecked {padding-bottom: 9px; padding-top: 4px; background-image: url("layout/images/tabBottomSelected.png"); background-image: -moz-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -webkit-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -o-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); background-image: -ms-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);}.claro .dijitTabContainerLeft-tabs .dijitTab {left: 1px; margin-bottom: 1px; padding: 3px 8px 4px 4px; background-image: url("layout/images/tabLeftUnselected.png"); background-repeat: repeat-y; background-image: -moz-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%);}.claro .dijitTabContainerLeft-tabs .dijitTabChecked {border-right-width: 0; padding-right: 9px; background-image: url("layout/images/tabLeftSelected.png"); background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -o-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); -webkit-box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05); box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05);}.claro .dijitTabContainerRight-tabs .dijitTab {left: -1px; margin-bottom: 1px; padding: 3px 8px 4px 4px; background-image: url("layout/images/tabRightUnselected.png"); background-repeat: repeat-y; background-position: right; background-image: -moz-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%);}.claro .dijitTabContainerRight-tabs .dijitTabChecked {padding-left: 5px; border-left-width: 0; background-image: url("layout/images/tabRightSelected.png"); background-image: -moz-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -webkit-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -o-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); background-image: -ms-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); -webkit-box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07); -moz-box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07); box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07);}.claro .dijitTabContainerTop-tabs .dijitTab {-moz-border-radius: 2px 2px 0 0; border-radius: 2px 2px 0 0;}.claro .dijitTabContainerBottom-tabs .dijitTab {-moz-border-radius: 0 0 2px 2px; border-radius: 0 0 2px 2px;}.claro .dijitTabContainerLeft-tabs .dijitTab {-moz-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;}.claro .dijitTabContainerRight-tabs .dijitTab {-moz-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0;}.claro .tabStripButton {background-color: #e5f2fe; border: 1px solid #b5bcc7;}.claro .dijitTabListContainer-top .tabStripButton {padding: 4px 3px; margin-top: 7px; background-image: -moz-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%);}.claro .dijitTabListContainer-bottom .tabStripButton {padding: 4px 3px; margin-bottom: 7px; background-image: -moz-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%);}.claro .tabStripButtonHover {background-color: #abd6ff;}.claro .tabStripButtonActive {background-color: #7dbdfa;}.claro .dijitTabStripIcon {height: 15px; width: 15px; margin: 0 auto; background: url("form/images/buttonArrows.png") no-repeat -75px 50%; background-color: transparent;}.claro .dijitTabStripSlideRightIcon {background-position: -24px 50%;}.claro .dijitTabStripMenuIcon {background-position: -51px 50%;}.claro .dijitTabListContainer-top .tabStripButtonDisabled, .claro .dijitTabListContainer-bottom .tabStripButtonDisabled {background-color: #d3d3d3; border: 1px solid #b5bcc7;}.claro .tabStripButtonDisabled .dijitTabStripSlideLeftIcon {background-position: -175px 50%;}.claro .tabStripButtonDisabled .dijitTabStripSlideRightIcon {background-position: -124px 50%;}.claro .tabStripButtonDisabled .dijitTabStripMenuIcon {background-position: -151px 50%;}.claro .dijitTabContainerNested .dijitTabListWrapper {height: auto;}.claro .dijitTabContainerNested .dijitTabContainerTop-tabs {border-bottom: solid 1px #b5bcc7; padding: 2px 2px 4px;}.claro .dijitTabContainerTabListNested .dijitTab {background: rgba(255, 255, 255, 0) none repeat scroll 0 0; border: none; padding: 4px; border-color: rgba(118, 157, 192, 0); -webkit-transition-property: background-color, border-color; -moz-transition-property: background-color, border-color; transition-property: background-color, border-color; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s; -moz-border-radius: 2px; border-radius: 2px;}.claro .dijitTabContainerTabListNested .dijitTab {background: none; border: none; top: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none;}.claro .dijitTabContainerTabListNested .dijitTabHover {background-color: #e5f2fe; border: solid 1px #cfe5fa; padding: 3px; -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s;}.claro .dijitTabContainerTabListNested .dijitTabHover .tabLabel {text-decoration: none;}.claro .dijitTabContainerTabListNested .dijitTabActive {border: solid 1px #759dc0; padding: 3px; background: #abd6ff url("layout/images/tabNested.png") repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitTabContainerTabListNested .dijitTabChecked {padding: 3px; border: solid 1px #759dc0; background-color: #cfe5fa;}.claro .dijitTabContainerTabListNested .dijitTabChecked .tabLabel {text-decoration: none; background-image: none;}.claro .dijitTabPaneWrapperNested {border: none;}.claro .dijitTab, .claro .tabStripButton {_background-image: none !important;}.claro .dijitDialog {border: 1px solid #759dc0; -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);}.claro .dijitDialogPaneContent {background: #ffffff repeat-x top left; border-top: 1px solid #759dc0; padding: 10px 8px; position: relative;}.claro .dijitDialogPaneContentArea {margin: -10px -8px; padding: 10px 8px;}.claro .dijitDialogPaneActionBar {background-color: #efefef; padding: 3px 5px 2px 7px; text-align: right; border-top: 1px solid #d3d3d3; margin: 10px -8px -10px;}.claro .dijitTooltipDialog .dijitDialogPaneActionBar {-webkit-border-bottom-right-radius: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -moz-border-radius-bottomleft: 4px; margin: 10px -10px -8px;}.claro .dijitDialogPaneActionBar .dijitButton {float: none;}.claro .dijitDialogTitleBar {border: 1px solid #ffffff; border-top: none; background-color: #abd6ff; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 5px 7px 4px 7px;}.claro .dijitDialogTitle {padding: 0 1px; font-size: 1.091em; color: #000000;}.claro .dijitDialogCloseIcon {background: url("images/dialogCloseIcon.png"); background-repeat: no-repeat; position: absolute; right: 5px; height: 15px; width: 21px;}.dj_ie6 .claro .dijitDialogCloseIcon {background-image: url("images/dialogCloseIcon8bit.png");}.claro .dijitDialogCloseIconHover {background-position: -21px;}.claro .dijitDialogCloseIconActive {background-position: -42px;}.claro .dijitTooltip, .claro .dijitTooltipDialog {background: transparent;}.dijitTooltipBelow {padding-top: 13px; padding-left: 3px; padding-right: 3px;}.dijitTooltipAbove {padding-bottom: 13px; padding-left: 3px; padding-right: 3px;}.claro .dijitTooltipContainer {background-color: #ffffff; background-image: -moz-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #ffffff 10px); background-image: -webkit-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #ffffff 10px); background-image: -o-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #ffffff 10px); background-image: -ms-linear-gradient(bottom, rgba(207, 229, 250, 0.1) 0px, #ffffff 10px); background-position: bottom; border: 1px solid #759dc0; padding: 6px 8px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); font-size: 1em; color: #000000;}.claro .dijitTooltipConnector {border: 0; z-index: 2; background-image: url("images/tooltip.png"); background-repeat: no-repeat; width: 16px; height: 14px;}.dj_ie6 .claro .dijitTooltipConnector {background-image: url("images/tooltip8bit.png");}.claro .dijitTooltipABRight .dijitTooltipConnector {left: auto !important; right: 3px;}.claro .dijitTooltipBelow .dijitTooltipConnector {top: 0; left: 3px; background-position: -31px 0; width: 16px; height: 14px;}.claro .dijitTooltipAbove .dijitTooltipConnector {bottom: 0; left: 3px; background-position: -15px 0; width: 16px; height: 14px;}.dj_ie7 .claro .dijitTooltipAbove .dijitTooltipConnector, .dj_ie6 .claro .dijitTooltipAbove .dijitTooltipConnector {bottom: -1px;}.claro .dijitTooltipLeft {padding-right: 14px;}.claro .dijitTooltipLeft .dijitTooltipConnector {right: 0; background-position: 0 0; width: 16px; height: 14px;}.claro .dijitTooltipRight {padding-left: 14px;}.claro .dijitTooltipRight .dijitTooltipConnector {left: 0; background-position: -48px 0; width: 16px; height: 14px;}.claro .dijitDialogUnderlay {background: #ffffff;}.claro .dijitAccordionContainer {border: none;}.claro .dijitAccordionInnerContainer {background-color: #efefef; border: solid 1px #b5bcc7; margin-bottom: 1px; -webkit-transition-property: background-color, border; -moz-transition-property: background-color, border; transition-property: background-color, border; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s; -webkit-transition-timing-function: linear; -moz-transition-timing-function: linear; transition-timing-function: linear;}.claro .dijitAccordionTitle {background-color: transparent; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 5px 7px 2px 7px; min-height: 17px; color: #494949;}.claro .dijitAccordionContainer .dijitAccordionChildWrapper {background-color: #ffffff; border: 1px solid #759dc0; margin: 0 2px 2px;}.claro .dijitAccordionContainer .dijitAccordionContainer-child {padding: 9px;}.claro .dijitAccordionInnerContainerActive {border: 1px solid #759dc0; background-color: #7dbdfa; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.claro .dijitAccordionInnerContainerActive .dijitAccordionTitle {background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none; color: #000000;}.claro .dijitAccordionInnerContainerSelected {border-color: #759dc0; background-color: #cfe5fa;}.claro .dijitAccordionInnerContainerSelected .dijitAccordionTitle {color: #000000; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitAccordionInnerContainerHover .dijitAccordionTitle {color: #000000;}.claro .dijitAccordionInnerContainerHover, .claro .dijitAccordionInnerContainerSelectedActive {border: 1px solid #759dc0; background-color: #abd6ff; -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s;}.claro .dijitAccordionInnerContainerSelectedHover .dijitAccordionChildWrapper, .claro .dijitAccordionInnerContainerSelectedActive .dijitAccordionChildWrapper {background-color: #ffffff; border: 1px solid #759dc0; -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25); -moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25); box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25);}.claro .dijitContentPane {padding: 8px;}.claro .dijitTabContainerTop-dijitContentPane,.claro .dijitTabContainerLeft-dijitContentPane,.claro .dijitTabContainerBottom-dijitContentPane,.claro .dijitTabContainerRight-dijitContentPane,.claro .dijitAccordionContainer-dijitContentPane {background-color: #ffffff; padding: 8px;}.claro .dijitSplitContainer-dijitContentPane, .claro .dijitBorderContainer-dijitContentPane {background-color: #ffffff; padding: 8px;}.claro .dijitCalendar {border: solid 1px #b5bcc7; border-collapse: separate; -moz-border-radius: 4px; border-radius: 4px; background-color: #cfe5fa; background-image: url("images/calendar.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0.4) 2px, rgba(255, 255, 255, 0) 100%); text-align: center; padding: 6px 5px 3px 5px;}.dj_ie6 .claro .dijitCalendar {background-image: none;}.claro .dijitCalendar img {border: none;}.claro .dijitCalendarHover, .claro .dijitCalendar:hover, .claro .dijitCalendarActive {background-color: #abd6ff; border: solid 1px #759dc0;}.claro .dijitCalendarMonthContainer th {text-align: center; padding-bottom: 4px; vertical-align: middle;}.claro .dijitCalendarMonthLabel {color: #000000; font-size: 1.091em; padding: 0 4px;}.claro .dijitCalendarIncrementControl {width: 18px; height: 16px; background-image: url("images/calendarArrows.png"); background-repeat: no-repeat;}.dj_ie6 .claro .dijitCalendarIncrementControl {background-image: url("images/calendarArrows8bit.png");}.claro .dijitCalendarIncrease {background-position: -18px 0;}.claro .dijitCalendarArrowHover .dijitCalendarDecrease, .claro .dijitCalendarArrow:hover .dijitCalendarDecrease {background-position: -36px 0;}.claro .dijitCalendarArrowHover .dijitCalendarIncrease, .claro .dijitCalendarArrow:hover .dijitCalendarIncrease {background-position: -55px 0;}.claro .dijitCalendarArrowActive .dijitCalendarDecrease, .claro .dijitCalendarArrow:active .dijitCalendarDecrease {background-position: -72px 0;}.claro .dijitCalendarArrowActive .dijitCalendarIncrease, .claro .dijitCalendarArrow:active .dijitCalendarIncrease {background-position: -91px 0;}.claro .dijitA11ySideArrow {display: none;}.claro .dijitCalendarDayLabelTemplate {padding-bottom: 0; text-align: center; border-bottom: 1px solid #b5bcc7; padding: 0 3px 2px;}.claro .dijitCalendarDayLabel {padding: 0 4px 0 4px; font-weight: bold; font-size: 0.909em; text-align: center; color: #000000;}.claro .dijitCalendarDateTemplate {text-align: center; background-color: #ffffff; border-bottom: 1px solid #d3d3d3; padding-top: 0; font-size: 0.909em; font-family: Arial; font-weight: bold; letter-spacing: .05em; text-align: center; color: #000000;}.dj_ie6 .claro .dijitCalendarDateTemplate {background-image: none;}.claro .dijitCalendarPreviousMonth, .claro .dijitCalendarNextMonth {background-color: #e5f2fe; background-image: none; border-bottom: solid 1px #d3d3d3;}.claro .dijitCalendarDateTemplate .dijitCalendarDateLabel {text-decoration: none; display: block; padding: 3px 5px 3px 4px; border: solid 1px #ffffff; background-color: rgba(171, 212, 251, 0); -webkit-transition-property: background-color, border; -moz-transition-property: background-color, border; transition-property: background-color, border; -webkit-transition-duration: 0.35s; -moz-transition-duration: 0.35s; transition-duration: 0.35s;}.claro .dijitCalendarPreviousMonth .dijitCalendarDateLabel, .claro .dijitCalendarNextMonth .dijitCalendarDateLabel {color: #759dc0; border-color: #e5f2fe;}.claro .dijitCalendarYearContainer {vertical-align: middle;}.claro .dijitCalendarYearControl {padding: 1px 2px 2px 2px;}.claro .dijitCalendarYearLabel {padding: 2px 0 0 0; margin: 0; font-size: 1.17em;}.claro .dijitCalendarYearLabel span {vertical-align: middle;}.claro .dijitCalendarSelectedYear {padding: 0 3px;}.claro .dijitCalendarNextYear, .claro .dijitCalendarPreviousYear {padding: 1px 6px 1px 6px; font-size: 0.909em;}.claro .dijitCalendarSelectedYear {font-size: 1.091em; color: #000000;}.claro .dijitCalendarHoveredDate .dijitCalendarDateLabel, .claro .dijitCalendarEnabledDate:hover .dijitCalendarDateLabel {background-color: #abd6ff; border: solid 1px #759dc0; color: #000000; -webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s;}.claro .dijitCalendarNextYearHover,.claro .dijitCalendarNextYear:hover,.claro .dijitCalendarPreviousYearHover,.claro .dijitCalendarPreviousYear:hover {color: #000000; border: solid 1px #ffffff; padding: 0 5px 0 5px; background-color: #e5f2fe;}.claro .dijitCalendarNextYearActive, .claro .dijitCalendarNextYear:active.claro .dijitCalendarPreviousYearActive, .claro .dijitCalendarPreviousYear:active {border: solid 1px #759dc0; padding: 0 5px 0 5px; background-color: #7dbdfa;}.claro .dijitCalendarActiveDate .dijitCalendarDateLabel, .claro .dijitCalendarEnabledDate:active .dijitCalendarDateLabel {background-color: #7dbdfa; border: solid 1px #ffffff; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s;}.dj_ie6 .claro .dijitCalendarActiveDate .dijitCalendarDateLabel {background-image: none;}.claro .dijitCalendarSelectedDate .dijitCalendarDateLabel {color: #000000; background-color: #abd6ff; border-color: #759dc0;}.claro .dijitCalendarDisabledDate .dijitCalendarDateLabel {color: #818181; text-decoration: line-through;}.claro .dijitCalendar .dijitDropDownButton {margin: 0;}.claro .dijitCalendar .dijitButtonText {padding: 1px 0 3px; margin-right: -4px;}.claro .dijitCalendar .dijitDropDownButton .dijitButtonNode {padding: 0 3px 0 2px; border: solid 1px #b5bcc7; -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0); -moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0); box-shadow: 0 0 0 rgba(0, 0, 0, 0); background-color: transparent; background-image: none;}.claro .dijitCalendar .dijitDropDownButtonHover .dijitButtonNode, .claro .dijitCalendar .dijitDropDownButton:hover .dijitButtonNode {background-color: #e5f2fe; border: solid 1px #ffffff;}.claro .dijitCalendarMonthMenu {border-color: #759dc0; background-color: #ffffff; text-align: center; background-image: none;}.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel {border-top: solid 1px #ffffff; border-bottom: solid 1px #ffffff; padding: 2px 0;}.claro .dijitCalendarMonthMenu .dijitCalendarMonthLabelHover, .claro .dijitCalendarMonthMenu .dijitCalendarMonthLabel:hover {border-color: #759dc0; border-width: 1px 0; background-color: #abd6ff; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr= #ffffff , endColorstr= #abd6ff );}.claro .dijitMenuBar {border: 1px solid #b5bcc7; margin: 0; padding: 0; background-color: #efefef; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitMenu {background-color: #ffffff; border: 1px solid #759dc0; margin: -1px 0;}.dj_ie6 .claro .dijitMenu {margin: 0;}.claro .dijitMenuItem {color: #000000;}.claro .dijitMenuBar .dijitMenuItem {padding: 6px 10px 7px; margin: -1px;}.claro .dijitMenuBar .dijitMenuItemHover, .claro .dijitMenuBar .dijitMenuItemSelected {border: solid 1px #759dc0; padding: 5px 9px 6px;}.claro .dijitMenuTable {border-collapse: separate; border-spacing: 0 0; padding: 0;}.claro .dijitMenuItem td {padding: 1px;}.claro .dijitSelectMenu .dijitMenuItemHover td,.claro .dijitSelectMenu .dijitMenuItemSelected td,.claro .dijitMenuItemHover,.claro .dijitMenuItemSelected {background-color: #abd6ff; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitMenuItemActive {background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.dj_ie .claro .dijitMenuActive .dijitMenuItemHover,.dj_ie .claro .dijitMenuActive .dijitMenuItemSelected,.dj_ie .claro .dijitMenuPassive .dijitMenuItemHover,.dj_ie .claro .dijitMenuPassive .dijitMenuItemSelected {padding-top: 6px; padding-bottom: 5px; margin-top: -3px;}.claro td.dijitMenuItemIconCell {padding: 2px; margin: 0 0 0 4px;}.claro td.dijitMenuItemLabel {padding-top: 5px; padding-bottom: 5px;}.claro .dijitMenuExpand {width: 7px; height: 7px; background-image: url("images/spriteArrows.png"); background-position: -14px 0; margin-right: 3px;}.claro .dijitMenuItemDisabled .dijitMenuItemIconCell {opacity: 1;}.claro .dijitMenuSeparatorTop {height: auto; margin-top: 1px; border-bottom: 1px solid #b5bcc7;}.claro .dijitMenuSeparatorBottom {height: auto; margin-bottom: 1px;}.claro .dijitCheckedMenuItemIconChar {display: none;}.claro .dijitCheckedMenuItemIcon {background-image: url("form/images/checkboxRadioButtonStates.png"); background-repeat: no-repeat; background-position: -15px 50%; width: 15px; height: 16px;}.dj_ie6 .claro .dijitCheckedMenuItemIcon {background-image: url("form/images/checkboxAndRadioButtons_IE6.png");}.claro .dijitCheckedMenuItemChecked .dijitCheckedMenuItemIcon {background-position: 0 50%;}.claro .dijitComboBoxMenu {margin-left: 0; background-image: none;}.claro .dijitSelectMenu .dijitMenuItem td, .claro .dijitComboBoxMenu .dijitMenuItem {padding: 2px; border-width: 1px 0 1px 0; border-style: solid; border-color: #ffffff;}.claro .dijitSelectMenu .dijitMenuItemSelected td, .claro .dijitComboBoxMenu .dijitMenuItemSelected {color: #000000; border-color: #759dc0; background-color: #abd6ff;}.claro .dijitSelectMenu .dijitMenuItemHover td, .claro .dijitComboBoxMenu .dijitMenuItemHover {color: #000000; border-color: #769dc0; background-color: #abd6ff;}.claro .dijitComboBoxMenuActive .dijitMenuItemSelected {background-color: #7dbdfa;}.claro .dijitMenuPreviousButton, .claro .dijitMenuNextButton {font-style: italic;}.claro .dijitSliderBar {border-style: solid; outline: 1px;}.claro .dijitSliderFocused .dijitSliderBar {border-color: #759dc0;}.claro .dijitSliderHover .dijitSliderBar {border-color: #759dc0;}.claro .dijitSliderDisabled .dijitSliderBar {background-image: none; border-color: #d3d3d3;}.claro .dijitRuleLabelsContainer {color: #000000;}.claro .dijitRuleLabelsContainerH {padding: 2px 0;}.claro .dijitSlider .dijitSliderProgressBarH, .claro .dijitSlider .dijitSliderLeftBumper {border-color: #b5bcc7; background-color: #cfe5fa; background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px);}.claro .dijitSlider .dijitSliderRemainingBarH, .claro .dijitSlider .dijitSliderRightBumper {border-color: #b5bcc7; background-color: #ffffff;}.claro .dijitSliderRightBumper {border-right: solid 1px #b5bcc7;}.claro .dijitSliderLeftBumper {border-left: solid 1px #b5bcc7;}.claro .dijitSliderHover .dijitSliderProgressBarH, .claro .dijitSliderHover .dijitSliderLeftBumper {background-color: #abd6ff; border-color: #759dc0;}.claro .dijitSliderHover .dijitSliderRemainingBarH, .claro .dijitSliderHover .dijitSliderRightBumper {background-color: #ffffff; border-color: #759dc0;}.claro .dijitSliderFocused .dijitSliderProgressBarH, .claro .dijitSliderFocused .dijitSliderLeftBumper {background-color: #abd6ff; border-color: #759dc0; -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2);}.claro .dijitSliderFocused .dijitSliderRemainingBarH, .claro .dijitSliderFocused .dijitSliderRightBumper {background-color: #ffffff; border-color: #759dc0; -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2);}.claro .dijitSliderDisabled .dijitSliderProgressBarH, .claro .dijitSliderDisabled .dijitSliderLeftBumper {background-color: #d3d3d3; background-image: none;}.claro .dijitSliderDisabled .dijitSliderRemainingBarH, .claro .dijitSliderDisabled .dijitSliderRightBumper {background-color: #efefef;}.claro .dijitRuleLabelsContainerV {padding: 0 2px;}.claro .dijitSlider .dijitSliderProgressBarV, .claro .dijitSlider .dijitSliderBottomBumper {border-color: #b5bcc7; background-color: #cfe5fa; background-image: -moz-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); background-image: -webkit-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); background-image: -o-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); background-image: -ms-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px);}.claro .dijitSlider .dijitSliderRemainingBarV, .claro .dijitSlider .dijitSliderTopBumper {border-color: #b5bcc7; background-color: #ffffff;}.claro .dijitSliderBottomBumper {border-bottom: solid 1px #b5bcc7;}.claro .dijitSliderTopBumper {border-top: solid 1px #b5bcc7;}.claro .dijitSliderHover .dijitSliderProgressBarV, .claro .dijitSliderHover .dijitSliderBottomBumper {background-color: #abd6ff; border-color: #759dc0;}.claro .dijitSliderHover .dijitSliderRemainingBarV, .claro .dijitSliderHover .dijitSliderTopBumper {background-color: #ffffff; border-color: #759dc0;}.claro .dijitSliderFocused .dijitSliderProgressBarV, .claro .dijitSliderFocused .dijitSliderBottomBumper {background-color: #abd6ff; border-color: #759dc0; -webkit-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2);}.claro .dijitSliderFocused .dijitSliderRemainingBarV, .claro .dijitSliderFocused .dijitSliderTopBumper {background-color: #ffffff; border-color: #759dc0; -webkit-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2);}.claro .dijitSliderDisabled .dijitSliderProgressBarV, .claro .dijitSliderDisabled .dijitSliderBottomBumper {background-color: #d3d3d3;}.claro .dijitSliderDisabled .dijitSliderRemainingBarV, .claro .dijitSliderDisabled .dijitSliderTopBumper {background-color: #efefef;}.claro .dijitSliderImageHandleH {border: 0; width: 18px; height: 16px; background-image: url("form/images/sliderThumbs.png"); background-repeat: no-repeat; background-position: 0 0;}.claro .dijitSliderHover .dijitSliderImageHandleH {background-position: -18px 0;}.claro .dijitSliderFocused .dijitSliderImageHandleH {background-position: -36px 0;}.claro .dijitSliderProgressBarH .dijitSliderThumbHover {background-position: -36px 0;}.claro .dijitSliderProgressBarH .dijitSliderThumbActive {background-position: -36px 0;}.claro .dijitSliderReadOnly .dijitSliderImageHandleH, .claro .dijitSliderDisabled .dijitSliderImageHandleH {background-position: -54px 0;}.claro .dijitSliderImageHandleV {border: 0; width: 18px; height: 16px; background-image: url("form/images/sliderThumbs.png"); background-repeat: no-repeat; background-position: -289px 0;}.claro .dijitSliderHover .dijitSliderImageHandleV {background-position: -307px 0;}.claro .dijitSliderFocused .dijitSliderImageHandleV {background-position: -325px 0;}.claro .dijitSliderProgressBarV .dijitSliderThumbHover {background-position: -325px 0;}.claro .dijitSliderProgressBarV .dijitSliderThumbActive {background-position: -325px 0;}.claro .dijitSliderReadOnly .dijitSliderImageHandleV, .claro .dijitSliderDisabled .dijitSliderImageHandleV {background-position: -343px 0;}.claro .dijitSliderButtonContainerH {padding: 1px 3px 1px 2px;}.claro .dijitSliderButtonContainerV {padding: 3px 1px 2px 1px;}.claro .dijitSliderDecrementIconH,.claro .dijitSliderIncrementIconH,.claro .dijitSliderDecrementIconV,.claro .dijitSliderIncrementIconV {background-image: url("form/images/commonFormArrows.png"); background-repeat: no-repeat; background-color: #efefef; -moz-border-radius: 2px; border-radius: 2px; border: solid 1px #b5bcc7; font-size: 1px;}.claro .dijitSliderDecrementIconH, .claro .dijitSliderIncrementIconH {height: 12px; width: 9px;}.claro .dijitSliderDecrementIconV, .claro .dijitSliderIncrementIconV {height: 9px; width: 12px;}.claro .dijitSliderActive .dijitSliderDecrementIconH,.claro .dijitSliderActive .dijitSliderIncrementIconH,.claro .dijitSliderActive .dijitSliderDecrementIconV,.claro .dijitSliderActive .dijitSliderIncrementIconV,.claro .dijitSliderHover .dijitSliderDecrementIconH,.claro .dijitSliderHover .dijitSliderIncrementIconH,.claro .dijitSliderHover .dijitSliderDecrementIconV,.claro .dijitSliderHover .dijitSliderIncrementIconV {border: solid 1px #759dc0; background-color: #ffffff;}.claro .dijitSliderDecrementIconH {background-position: -357px 50%;}.claro .dijitSliderActive .dijitSliderDecrementIconH.claro .dijitSliderHover .dijitSliderDecrementIconH {background-position: -393px 50%;}.claro .dijitSliderIncrementIconH {background-position: -251px 50%;}.claro .dijitSliderActive .dijitSliderIncrementIconH.claro .dijitSliderHover .dijitSliderIncrementIconH {background-position: -283px 50%;}.claro .dijitSliderDecrementIconV {background-position: -38px 50%;}.claro .dijitSliderActive .dijitSliderDecrementIconV.claro .dijitSliderHover .dijitSliderDecrementIconV {background-position: -73px 50%;}.claro .dijitSliderIncrementIconV {background-position: -143px 49%;}.claro .dijitSliderActive .dijitSliderIncrementIconV.claro .dijitSliderHover .dijitSliderIncrementIconV {background-position: -178px 49%;}.claro .dijitSliderButtonContainerV .dijitSliderDecrementButtonHover,.claro .dijitSliderButtonContainerH .dijitSliderDecrementButtonHover,.claro .dijitSliderButtonContainerV .dijitSliderIncrementButtonHover,.claro .dijitSliderButtonContainerH .dijitSliderIncrementButtonHover {background-color: #cfe5fa;}.claro .dijitSliderButtonContainerV .dijitSliderDecrementButtonActive,.claro .dijitSliderButtonContainerH .dijitSliderDecrementButtonActive,.claro .dijitSliderButtonContainerV .dijitSliderIncrementButtonActive,.claro .dijitSliderButtonContainerH .dijitSliderIncrementButtonActive {background-color: #abd6ff; border-color: #759dc0;}.claro .dijitSliderButtonInner {visibility: hidden;}.claro .dijitSliderDisabled .dijitSliderBar {border-color: #d3d3d3;}.claro .dijitSliderReadOnly *, .claro .dijitSliderDisabled * {border-color: #d3d3d3; color: #818181;}.claro .dijitSliderReadOnly .dijitSliderDecrementIconH, .claro .dijitSliderDisabled .dijitSliderDecrementIconH {background-position: -321px 50%; background-color: #efefef;}.claro .dijitSliderReadOnly .dijitSliderIncrementIconH, .claro .dijitSliderDisabled .dijitSliderIncrementIconH {background-position: -215px 50%; background-color: #efefef;}.claro .dijitSliderReadOnly .dijitSliderDecrementIconV, .claro .dijitSliderDisabled .dijitSliderDecrementIconV {background-position: -3px 49%; background-color: #efefef;}.claro .dijitSliderReadOnly .dijitSliderIncrementIconV, .claro .dijitSliderDisabled .dijitSliderIncrementIconV {background-position: -107px 49%; background-color: #efefef;}.claro .dijitColorPalette {border: 1px solid #b5bcc7; background: #ffffff; -moz-border-radius: 0; border-radius: 0;}.claro .dijitColorPalette .dijitPaletteImg {border: 1px solid #d3d3d3;}.claro .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg {border: 1px solid #000000;}.claro .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg, .claro .dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg {border: 2px solid #000000;}.claro .dijitInlineEditBoxDisplayMode {border: 1px solid transparent;}.claro .dijitInlineEditBoxDisplayModeHover {background-color: #e5f2fe; border: solid 1px #759dc0;}.dj_ie6 .claro .dijitInlineEditBoxDisplayMode {border: none;}.claro .dijitProgressBar {margin: 2px 0 2px 0;}.claro .dijitProgressBarEmpty {background-color: #ffffff; border-color: #759dc0;}.claro .dijitProgressBarTile {background-color: #abd6ff; background-image: url("images/progressBarFull.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.93) 0px, rgba(255, 255, 255, 0.41) 1px, rgba(255, 255, 255, 0.7) 2px, rgba(255, 255, 255, 0) 100%); background-attachment: scroll;}.dj_ie6 .claro .dijitProgressBarTile {background-image: none;}.claro .dijitProgressBarFull {border-right: 1px solid #759dc0; -webkit-transition-property: width; -moz-transition-property: width; transition-property: width; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s;}.claro .dijitProgressBarLabel {color: #000000;}.claro .dijitProgressBarIndeterminate .dijitProgressBarTile {background: #efefef url("images/progressBarAnim.gif") repeat-x top;}.claro .dijitTimePicker .dijitButtonNode {padding: 0 0; -moz-border-radius: 0; border-radius: 0;}.claro .dijitTimePicker {border: 1px #b5bcc7 solid; border-top: none; border-bottom: none; background-color: #fff;}.claro .dijitTimePickerItem {background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; border-top: solid 1px #b5bcc7; border-bottom: solid 1px #b5bcc7; margin-right: -1px; margin-left: -1px; margin-top: -1px;}.claro .dijitTimePickerTick {color: #818181; background-color: #efefef; font-size: 0.818em;}.claro .dijitTimePickerMarker {background-color: #e5f2fe; font-size: 1em; white-space: nowrap;}.claro .dijitTimePickerTickHover,.claro .dijitTimePickerMarkerHover,.claro .dijitTimePickerMarkerSelected,.claro .dijitTimePickerTickSelected {background-color: #7dbdfa; border: solid 1px #b5bcc7; margin-left: -7px; margin-right: -7px; color: #000000;}.claro .dijitTimePickerMarkerSelected, .claro .dijitTimePickerTickSelected {font-size: 1em;}.dj_ie .claro .dijitTimePickerTickHover,.dj_ie .claro .dijitTimePickerMarkerHover,.dj_ie .claro .dijitTimePickerMarkerSelected,.dj_ie .claro .dijitTimePickerTickSelected {width: 114%;}.dj_ie6 .claro .dijitTimePickerTickHover,.dj_ie6 .claro .dijitTimePickerMarkerHover,.dj_ie6 .claro .dijitTimePickerMarkerSelected,.dj_ie6 .claro .dijitTimePickerTickSelected {position: relative; zoom: 1;}.claro .dijitTimePickerTick .dijitTimePickerItemInner {padding: 1px; margin: 0;}.claro .dijitTimePicker .dijitButtonNode {border-left: none; border-right: none; border-color: #b5bcc7; background-color: #efefef; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitTimePicker .dijitArrowButtonInner {height: 100%; background-image: url("form/images/commonFormArrows.png"); background-repeat: no-repeat; background-position: -140px 45%;}.claro .dijitTimePicker .dijitDownArrowButton .dijitArrowButtonInner {background-position: -35px 45%;}.claro .dijitTimePicker .dijitUpArrowHover, .claro .dijitTimePicker .dijitDownArrowHover {background-color: #abd6ff;}.claro .dijitTimePicker .dijitUpArrowHover .dijitArrowButtonInner {background-position: -175px 45%;}.claro .dijitTimePicker .dijitDownArrowHover .dijitArrowButtonInner {background-position: -70px 45%;}.claro .dijitBorderContainer {padding: 5px;}.claro .dijitSplitContainer-child, .claro .dijitBorderContainer-child {border: 1px #b5bcc7 solid;}.claro .dijitBorderContainer-dijitTabContainerTop,.claro .dijitBorderContainer-dijitTabContainerBottom,.claro .dijitBorderContainer-dijitTabContainerLeft,.claro .dijitBorderContainer-dijitTabContainerRight,.claro .dijitBorderContainer-dijitAccordionContainer {border: none;}.claro .dijitBorderContainer-dijitBorderContainer {border: 0; padding: 0;}.claro .dijitSplitterH, .claro .dijitGutterH {background: none; border: 0; height: 5px;}.claro .dijitSplitterH .dijitSplitterThumb {background: #b5bcc7 none; height: 1px; top: 2px; width: 19px;}.claro .dijitSplitterV, .claro .dijitGutterV {background: none; border: 0; width: 5px; margin: 0;}.claro .dijitSplitterV .dijitSplitterThumb {background: #b5bcc7 none; height: 19px; left: 2px; width: 1px; margin: 0;}.claro .dijitSplitterHHover, .claro .dijitSplitterVHover {font-size: 1px; background-color: #cfe5fa;}.claro .dijitSplitterHHover {background-image: -moz-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -webkit-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -o-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -ms-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%);}.claro .dijitSplitterVHover {background-image: -moz-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -webkit-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -o-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); background-image: -ms-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%);}.claro .dijitSplitterHHover .dijitSplitterThumb, .claro .dijitSplitterVHover .dijitSplitterThumb {background: #759dc0 none;}.claro .dijitSplitterHActive, .claro .dijitSplitterVActive {font-size: 1px; background-color: #abd6ff; background-image: none;}.claro .dijitTreeNode {zoom: 1;}.claro .dijitTreeIsRoot {background-image: none;}.claro .dijitTreeRow, .claro .dijitTreeNode .dojoDndItemBefore, .claro .dijitTreeNode .dojoDndItemAfter {padding: 4px 0 2px 0; background-color: none; background-color: transparent; background-color: rgba(171, 214, 255, 0); background-position: 0 0; background-repeat: repeat-x; border: solid 0 transparent; color: #000000; -webkit-transition-property: background-color, border-color; -moz-transition-property: background-color, border-color; transition-property: background-color, border-color; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s; -webkit-transition-timing-function: ease-out; -moz-transition-timing-function: ease-out; transition-timing-function: ease-out;}.claro .dijitTreeRowSelected {background-color: #cfe5fa; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 3px 0 1px; border-color: #759dc0; border-width: 1px 0; color: #000000;}.claro .dijitTreeRowHover {background-color: #abd6ff; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 3px 0 1px; border-color: #759dc0; border-width: 1px 0; color: #000000; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; transition-duration: 0.25s;}.claro .dijitTreeRowActive {background-color: #7dbdfa; background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 3px 0 1px; border-color: #759dc0; border-width: 1px 0; color: #000000;}.claro .dijitTreeRowFocused {background-repeat: repeat;}.claro .dijitTreeExpando {background-image: url("images/treeExpandImages.png"); width: 16px; height: 16px; background-position: -35px 0;}.dj_ie6 .claro .dijitTreeExpando {background-image: url("images/treeExpandImages8bit.png");}.claro .dijitTreeRowHover .dijitTreeExpandoOpened {background-position: -53px 0;}.claro .dijitTreeExpandoClosed {background-position: 1px 0;}.claro .dijitTreeRowHover .dijitTreeExpandoClosed {background-position: -17px 0;}.claro .dijitTreeExpandoLeaf, .dj_ie6 .claro .dijitTreeExpandoLeaf {background-image: none;}.claro .dijitTreeExpandoLoading {background-image: url("images/loadingAnimation.gif");}.claro .dijitTreeNode .dojoDndItemBefore .dijitTreeContent {border-top: 2px solid #759dc0;}.claro .dijitTreeNode .dojoDndItemAfter .dijitTreeContent {border-bottom: 2px solid #759dc0;} .claro .dijitToolbar {border-bottom: 1px solid #b5bcc7; background-color: #efefef; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 2px 0 2px 4px; zoom: 1;}.claro .dijitToolbar label {padding: 0 3px 0 6px;}.claro .dijitToolbar .dijitButton .dijitButtonNode,.claro .dijitToolbar .dijitDropDownButton .dijitButtonNode,.claro .dijitToolbar .dijitComboButton .dijitButtonNode,.claro .dijitToolbar .dijitToggleButton .dijitButtonNode,.claro .dijitToolbar .dijitComboBox .dijitButtonNode {border-width: 0; padding: 2px; -moz-border-radius: 2px; border-radius: 2px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; -webkit-transition-property: background-color; -moz-transition-property: background-color; transition-property: background-color; -webkit-transition-duration: 0.3s; -moz-transition-duration: 0.3s; transition-duration: 0.3s; background-color: rgba(171, 214, 255, 0); background-image: none;}.dj_ie .claro .dijitToolbar .dijitButton .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitDropDownButton .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitComboButton .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitToggleButton .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitComboBox .dijitButtonNode {background-color: transparent;}.dj_ie .claro .dijitToolbar .dijitButtonHover .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitDropDownButtonHover .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitComboButton .dijitButtonNodeHover,.dj_ie .claro .dijitToolbar .dijitComboButton .dijitDownArrowButtonHover,.dj_ie .claro .dijitToolbar .dijitToggleButtonHover .dijitButtonNode {background-color: #abd6ff;}.dj_ie .claro .dijitToolbar .dijitButtonActive .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitDropDownButtonActive .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitComboButtonActive .dijitButtonNode,.dj_ie .claro .dijitToolbar .dijitToggleButtonActive .dijitButtonNode {background-color: #abd6ff;}.claro .dijitToolbar .dijitComboButton .dijitStretch {-moz-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;}.claro .dijitToolbar .dijitComboButton .dijitArrowButton {-moz-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0;}.claro .dijitToolbar .dijitComboBox .dijitButtonNode {padding: 0;}.claro .dijitToolbar .dijitButtonHover .dijitButtonNode,.claro .dijitToolbar .dijitDropDownButtonHover .dijitButtonNode,.claro .dijitToolbar .dijitToggleButtonHover .dijitButtonNode,.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNode {border-width: 1px; background-color: #abd6ff; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px;}.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNode, .claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton {background-color: #f3ffff;}.claro .dijitToolbar .dijitComboButtonHover .dijitButtonNodeHover, .claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButtonHover {background-color: #abd6ff;}.claro .dijitToolbar .dijitButtonActive .dijitButtonNode, .claro .dijitToolbar .dijitDropDownButtonActive .dijitButtonNode, .claro .dijitToolbar .dijitToggleButtonActive .dijitButtonNode {border-width: 1px; background-color: #7dbdfa; background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none; padding: 1px;}.claro .dijitToolbar .dijitComboButtonActive {-webkit-transition-duration: 0.2s; -moz-transition-duration: 0.2s; transition-duration: 0.2s; border-width: 1px; padding: 0;}.claro .dijitToolbar .dijitComboButtonActive .dijitButtonNode, .claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButton {background-color: #f3ffff; padding: 2px;}.claro .dijitToolbar .dijitComboButtonActive .dijitButtonNodeActive {background-color: #7dbdfa; background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButtonActive {background-color: #7dbdfa; background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton, .claro .dijitToolbar .dijitComboButtonActive .dijitDownArrowButton {border-left-width: 0;}.claro .dijitToolbar .dijitComboButtonHover .dijitDownArrowButton {padding-left: 2px;}.claro .dijitToolbar .dijitToggleButtonChecked .dijitButtonNode {margin: 0; border-width: 1px; border-style: solid; background-image: none; border-color: #759dc0; background-color: #ffffff; padding: 1px;}.claro .dijitToolbarSeparator {background: url("../../icons/images/editorIconsEnabled.png");}.claro .dijitDisabled .dijitToolbar {background: none; background-color: #efefef; border-bottom: 1px solid #d3d3d3;}.claro .dijitToolbar .dijitComboBoxDisabled .dijitArrowButtonInner {background-position: 0 50%;}.claro .dijitEditorIFrameContainer {padding: 3px 3px 1px 10px;}.claro .dijitEditorIFrame {background-color: #ffffff;}.claro .dijitEditor {border: 1px solid #b5bcc7;}.claro .dijitEditor .dijitEditorIFrameContainer {background-color: #ffffff; background-repeat: repeat-x;}.claro .dijitEditorHover .dijitEditorIFrameContainer, .claro .dijitEditorHover .dijitEditorIFrameContainer .dijitEditorIFrame {background-color: #e5f2fe;}.claro .dijitEditorFocused .dijitEditorIFrameContainer, .claro .dijitEditorFocused .dijitEditorIFrameContainer .dijitEditorIFrame {background-color: #ffffff;}.claro .dijitEditorHover .dijitEditorIFrameContainer, .claro .dijitEditorFocused .dijitEditorIFrameContainer {background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px);}.claro .dijitEditorDisabled {border: 1px solid #d3d3d3; color: #818181;}.claro .dijitDisabled .dijitEditorIFrame, .claro .dijitDisabled .dijitEditorIFrameContainer, .claro .dijitDisabled .dijitEditorIFrameContainer .dijitEditorIFrame {background-color: #efefef; background-image: none;}.dijitEditorIcon {background-image: url("../../icons/images/editorIconsEnabled.png"); background-repeat: no-repeat; width: 18px; height: 18px; text-align: center;}.dijitDisabled .dijitEditorIcon {background-image: url("../../icons/images/editorIconsDisabled.png");}.dijitEditorIconSep {background-position: 0;}.dijitEditorIconSave {background-position: -18px;}.dijitEditorIconPrint {background-position: -36px;}.dijitEditorIconCut {background-position: -54px;}.dijitEditorIconCopy {background-position: -72px;}.dijitEditorIconPaste {background-position: -90px;}.dijitEditorIconDelete {background-position: -108px;}.dijitEditorIconCancel {background-position: -126px;}.dijitEditorIconUndo {background-position: -144px;}.dijitEditorIconRedo {background-position: -162px;}.dijitEditorIconSelectAll {background-position: -180px;}.dijitEditorIconBold {background-position: -198px;}.dijitEditorIconItalic {background-position: -216px;}.dijitEditorIconUnderline {background-position: -234px;}.dijitEditorIconStrikethrough {background-position: -252px;}.dijitEditorIconSuperscript {background-position: -270px;}.dijitEditorIconSubscript {background-position: -288px;}.dijitEditorIconJustifyCenter {background-position: -306px;}.dijitEditorIconJustifyFull {background-position: -324px;}.dijitEditorIconJustifyLeft {background-position: -342px;}.dijitEditorIconJustifyRight {background-position: -360px;}.dijitEditorIconIndent {background-position: -378px;}.dijitEditorIconOutdent {background-position: -396px;}.dijitEditorIconListBulletIndent {background-position: -414px;}.dijitEditorIconListBulletOutdent {background-position: -432px;}.dijitEditorIconListNumIndent {background-position: -450px;}.dijitEditorIconListNumOutdent {background-position: -468px;}.dijitEditorIconTabIndent {background-position: -486px;}.dijitEditorIconLeftToRight {background-position: -504px;}.dijitEditorIconRightToLeft, .dijitEditorIconToggleDir {background-position: -522px;}.dijitEditorIconBackColor {background-position: -540px;}.dijitEditorIconForeColor {background-position: -558px;}.dijitEditorIconHiliteColor {background-position: -576px;}.dijitEditorIconNewPage {background-position: -594px;}.dijitEditorIconInsertImage {background-position: -612px;}.dijitEditorIconInsertTable {background-position: -630px;}.dijitEditorIconSpace {background-position: -648px;}.dijitEditorIconInsertHorizontalRule {background-position: -666px;}.dijitEditorIconInsertOrderedList {background-position: -684px;}.dijitEditorIconInsertUnorderedList {background-position: -702px;}.dijitEditorIconCreateLink {background-position: -720px;}.dijitEditorIconUnlink {background-position: -738px;}.dijitEditorIconViewSource {background-position: -756px;}.dijitEditorIconRemoveFormat {background-position: -774px;}.dijitEditorIconFullScreen {background-position: -792px;}.dijitEditorIconWikiword {background-position: -810px;} .claro .dijitTitlePaneTitle {background-color: #efefef; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; border: 1px solid #b5bcc7; padding: 0 7px 3px 7px; min-height: 17px;}.claro .dijitTitlePaneTitleHover {background-color: #abd6ff; border-color: #759dc0;}.claro .dijitTitlePaneTitleActive {background-color: #7dbdfa; border-color: #759dc0; background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitTitlePaneTitleFocus {margin-top: 3px; padding-bottom: 2px;}.claro .dijitTitlePane .dijitArrowNode {background-image: url("images/spriteArrows.png"); background-repeat: no-repeat; height: 8px; width: 7px;}.claro .dijitTitlePane .dijitOpen .dijitArrowNode {background-position: 0 0;}.claro .dijitTitlePane .dijitClosed .dijitArrowNode {background-position: -14px 0;}.claro .dijitTitlePane .dijitTitlePaneTextNode {color: #000000;}.claro .dijitTitlePaneContentOuter {background: #ffffff; border: 1px solid #b5bcc7; border-top: none;}.claro .dijitTitlePaneContentInner {padding: 10px;}.claro .dijitTitlePaneTextNode {margin-left: 4px; margin-right: 4px; vertical-align: text-top;}.claro .dijitSpinnerButtonContainer {overflow: hidden; position: relative; width: auto; padding: 0 2px;}.claro .dijitSpinnerButtonContainer .dijitSpinnerButtonInner {border-width: 1px 0; border-style: solid none;}.claro .dijitSpinner .dijitArrowButton {width: auto; background-color: #efefef; background-image: url("images/standardGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); _background-image: none; overflow: hidden;}.dj_iequirks .claro .dijitSpinner .dijitArrowButton {overflow: visible;}.claro .dijitSpinner .dijitSpinnerButtonInner {width: 15px;}.claro .dijitSpinner .dijitArrowButtonInner {border: solid 1px #ffffff; border-bottom-width: 0; background-image: url("form/images/commonFormArrows.png"); background-repeat: no-repeat; height: 100%; width: 15px; padding-left: 1px; padding-right: 1px; background-position: -139px center; display: block; margin: -1px 0 -1px 0;}.dj_iequirks .claro .dijitSpinner .dijitArrowButtonInner,.dj_ie6 .claro .dijitSpinner .dijitArrowButtonInner,.dj_ie7 .claro .dijitSpinner .dijitArrowButtonInner,.dj_ie8 .claro .dijitSpinner .dijitArrowButtonInner {margin-top: 0;}.dj_iequirks .claro .dijitSpinner .dijitArrowButtonInner {width: 19px;}.claro .dijitSpinner .dijitDownArrowButton .dijitArrowButtonInner {background-position: -34px;}.claro .dijitSpinner .dijitArrowButtonInner .dijitInputField {padding: 0;}.claro .dijitUpArrowButtonActive, .claro .dijitDownArrowButtonActive {background-color: #abd6ff;}.claro .dijitSpinner .dijitUpArrowButtonHover, .claro .dijitSpinner .dijitDownArrowButtonHover, .claro .dijitSpinnerFocused .dijitArrowButton {background-color: #abd6ff;}.claro .dijitSpinner .dijitUpArrowButtonHover .dijitArrowButtonInner {background-position: -174px;}.claro .dijitSpinner .dijitDownArrowButtonHover .dijitArrowButtonInner {background-position: -69px;}.claro .dijitSpinnerFocused {background-color: #ffffff; background-image: none;}.claro .dijitSpinner .dijitDownArrowButtonActive, .claro .dijitSpinner .dijitUpArrowButtonActive {background-color: #7dbefa; background-image: url("images/activeGradient.png"); background-repeat: repeat-x; background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); _background-image: none;}.claro .dijitSpinner .dijitUpArrowButtonActive .dijitArrowButtonInner, .claro .dijitSpinner .dijitDownArrowButtonActive .dijitArrowButtonInner {border: 0; padding: 1px; margin-right: 2px; margin-bottom: 1px;}.claro .dijitSpinner .dijitUpArrowButtonActive .dijitArrowButtonInner {background-position: -173px;}.claro .dijitSpinner .dijitDownArrowButtonActive .dijitArrowButtonInner {background-position: -68px;}.claro .dijitSpinnerDisabled .dijitArrowButtonInner {background-color: #efefef;}.claro .dijitSpinnerDisabled .dijitUpArrowButton .dijitArrowButtonInner {background-position: -104px;}.claro .dijitSpinnerDisabled .dijitDownArrowButton .dijitArrowButtonInner {background-position: 1px;}.dj_ie7 .claro .dijitSpinner {overflow: visible;}.dijitRtl .dijitPlaceHolder {left: auto; right: 0;}.dijitMenuItemRtl {text-align: right;}.dj_iequirks .dijitComboButtonRtl button {float:left;}.dj_ie .dijitTextBoxRtl .dijitInputContainer {clear: right;}.dijitTextBoxRtl .dijitValidationContainer,.dijitTextBoxRtl .dijitSpinnerButtonContainer,.dijitComboBoxRtl .dijitArrowButtonContainer {border-right-width: 1px !important; border-left-width: 0 !important;}.dijitSpinnerRtl .dijitSpinnerButtonContainer .dijitArrowButton {right: 0; left: auto;}.dijitSelectRtl .dijitButtonText {float: right;}.dijitTextBoxRtl .dijitSpinnerButtonContainer,.dijitValidationTextBoxRtl .dijitValidationContainer,.dijitTextBoxRtl .dijitArrowButtonContainer {float: left;}.dijitCalendarRtl .dijitCalendarNextYear {margin:0 0.55em 0 0;}.dijitCalendarRtl .dijitCalendarPreviousYear {margin:0 0 0 0.55em;}.dijitSliderRtl .dijitSliderImageHandleV {left:auto;}.dijitSliderRtl .dijitSliderImageHandleH {left:-50%;}.dijitSliderRtl .dijitSliderMoveableH {right:auto; left:0;}.dijitSliderRtl .dijitRuleContainerV {float:right;}.dj_ie .dijitSliderRtl .dijitRuleContainerV {text-align:right;}.dj_ie .dijitSliderRtl .dijitRuleLabelV {text-align:left;}.dj_ie .dijitSliderRtl .dijitRuleLabelH {zoom:1;}.dijitSliderRtl .dijitSliderProgressBarH {float:right; right:0; left:auto;}.dijitRtl .dijitContentPaneLoading .dijitIconLoading,.dijitRtl .dijitContentPaneError .dijitIconError {margin-right: 0; margin-left: 9px;}.dijitTabControllerRtl .nowrapTabStrip {text-align: right;}.dijitTabRtl .dijitTabCloseButton {margin-left: 0; margin-right: 1em;}.dj_ie6 .dijitTabRtl .tabLabel,.dj_ie6 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie6 .dijitTabContainerLeft-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerLeft-tabs .dijitTabRtl {zoom: 1;}.dj_ie6 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerRight-tabs .dijitTabRtl {left: 0;}.dj_ie6 .dijitTabContainerRightRtl .dijitTabContainerRight-tabs,.dj_ie6 .dijitTabContainerLeftRtl .dijitTabContainerLeft-tabs {width: 1%;}.dj_ie .dijitTimePickerRtl .dijitTimePickerItem {width:100%;}.dijitColorPaletteRtl .dijitColorPaletteUnder {left: auto; right: 0;}.dijitSelectRtl .dijitButtonContents {border-style: none none none solid; text-align: right;}.dijitRtl .dojoDndHorizontal .dojoDndItemBefore {border-width: 0 2px 0 0; padding: 2px 0 2px 2px;}.dijitRtl .dojoDndHorizontal .dojoDndItemAfter {border-width: 0 0 0 2px; padding: 2px 2px 2px 0;}.claro .dijitTextBoxRtlError .dijitValidationContainer {border-left-width: 0 !important; border-right-width: 1px !important;}.claro .dijitComboButtonRtl .dijitStretch {-moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;}.claro .dijitComboButtonRtl .dijitArrowButton {-moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; padding: 3px 0 4px; border-left-width: 1px; border-right-width: 0;}.claro .dijitTabContainerTop-tabs .dijitTabRtl, .claro .dijitTabContainerBottom-tabs .dijitTabRtl {margin-right: 0; margin-left: 1px;}.claro .dijitSliderRtl .dijitSliderProgressBarH,.claro .dijitSliderRtl .dijitSliderRemainingBarH,.claro .dijitSliderRtl .dijitSliderLeftBumper,.claro .dijitSliderRtl .dijitSliderRightBumper,.claro .dijitSliderRtl .dijitSliderTopBumper {background-position: top right;}.claro .dijitSliderRtl .dijitSliderProgressBarV, .claro .dijitSliderRtl .dijitSliderRemainingBarV, .claro .dijitSliderRtl .dijitSliderBottomBumper {background-position: bottom right;}.claro .dijitSliderRtl .dijitSliderLeftBumper {border-left-width: 0; border-right-width: 1px;}.claro .dijitSliderRtl .dijitSliderRightBumper {border-left-width: 1px; border-right-width: 0;}.claro .dijitSliderRtl .dijitSliderIncrementIconH {background-position: -357px 50%;}.claro .dijitSliderRtl .dijitSliderDecrementIconH {background-position: -251px 50%;}.claro .dijitDialogRtl .dijitDialogCloseIcon {right: auto; left: 5px;}.claro .dijitDialogRtl .dijitDialogPaneActionBar {text-align: left; padding: 3px 7px 2px 5px;}.claro .dijitEditorRtl .dijitEditorIFrameContainer {padding: 3px 10px 1px 3px;}.dijitEditorRtl .dijitEditorIcon {background-image: url("../../icons/images/editorIconsEnabled_rtl.png");}.dijitEditorRtlDisabled .dijitEditorIcon {background-image: url("../../icons/images/editorIconsDisabled_rtl.png");}.dijitToolbarRtl .dijitToolbarSeparator {background-image: url("../../icons/images/editorIconsEnabled_rtl.png");}.dijitRtl .dijitIconSave,.dijitRtl .dijitIconPrint,.dijitRtl .dijitIconCut,.dijitRtl .dijitIconCopy,.dijitRtl .dijitIconClear,.dijitRtl .dijitIconDelete,.dijitRtl .dijitIconUndo,.dijitRtl .dijitIconEdit,.dijitRtl .dijitIconNewTask,.dijitRtl .dijitIconEditTask,.dijitRtl .dijitIconEditProperty,.dijitRtl .dijitIconTask,.dijitRtl .dijitIconFilter,.dijitRtl .dijitIconConfigure,.dijitRtl .dijitIconSearch,.dijitRtl .dijitIconApplication,.dijitRtl .dijitIconBookmark,.dijitRtl .dijitIconChart,.dijitRtl .dijitIconConnector,.dijitRtl .dijitIconDatabase,.dijitRtl .dijitIconDocuments,.dijitRtl .dijitIconMail,.dijitRtl .dijitLeaf,.dijitRtl .dijitIconFile,.dijitRtl .dijitIconFunction,.dijitRtl .dijitIconKey,.dijitRtl .dijitIconPackage,.dijitRtl .dijitIconSample,.dijitRtl .dijitIconTable,.dijitRtl .dijitIconUsers,.dijitRtl .dijitFolderClosed,.dijitRtl .dijitIconFolderClosed,.dijitRtl .dijitFolderOpened,.dijitRtl .dijitIconFolderOpen,.dijitRtl .dijitIconError {background-image: url("../../icons/images/commonIconsObjActEnabled_rtl.png"); width: 16px; height: 16px;}.dj_ie6 .dijitRtl .dijitIconSave,.dj_ie6 .dijitRtl .dijitIconPrint,.dj_ie6 .dijitRtl .dijitIconCut,.dj_ie6 .dijitRtl .dijitIconCopy,.dj_ie6 .dijitRtl .dijitIconClear,.dj_ie6 .dijitRtl .dijitIconDelete,.dj_ie6 .dijitRtl .dijitIconUndo,.dj_ie6 .dijitRtl .dijitIconEdit,.dj_ie6 .dijitRtl .dijitIconNewTask,.dj_ie6 .dijitRtl .dijitIconEditTask,.dj_ie6 .dijitRtl .dijitIconEditProperty,.dj_ie6 .dijitRtl .dijitIconTask,.dj_ie6 .dijitRtl .dijitIconFilter,.dj_ie6 .dijitRtl .dijitIconConfigure,.dj_ie6 .dijitRtl .dijitIconSearch,.dj_ie6 .dijitRtl .dijitIconApplication,.dj_ie6 .dijitRtl .dijitIconBookmark,.dj_ie6 .dijitRtl .dijitIconChart,.dj_ie6 .dijitRtl .dijitIconConnector,.dj_ie6 .dijitRtl .dijitIconDatabase,.dj_ie6 .dijitRtl .dijitIconDocuments,.dj_ie6 .dijitRtl .dijitIconMail,.dj_ie6 .dijitRtl .dijitLeaf,.dj_ie6 .dijitRtl .dijitIconFile,.dj_ie6 .dijitRtl .dijitIconFunction,.dj_ie6 .dijitRtl .dijitIconKey,.dj_ie6 .dijitRtl .dijitIconPackage,.dj_ie6 .dijitRtl .dijitIconSample,.dj_ie6 .dijitRtl .dijitIconTable,.dj_ie6 .dijitRtl .dijitIconUsers,.dj_ie6 .dijitRtl .dijitFolderClosed,.dj_ie6 .dijitRtl .dijitIconFolderClosed,.dj_ie6 .dijitRtl .dijitFolderOpened,.dj_ie6 .dijitRtl .dijitIconFolderOpen,.dj_ie6 .dijitRtl .dijitIconError {background-image: url("../../icons/images/commonIconsObjActEnabled8bit_rtl.png");}.dijitRtl .dijitDisabled .dijitIconSave,.dijitRtl .dijitDisabled .dijitIconPrint,.dijitRtl .dijitDisabled .dijitIconCut,.dijitRtl .dijitDisabled .dijitIconCopy,.dijitRtl .dijitDisabled .dijitIconClear,.dijitRtl .dijitDisabled .dijitIconDelete,.dijitRtl .dijitDisabled .dijitIconUndo,.dijitRtl .dijitDisabled .dijitIconEdit,.dijitRtl .dijitDisabled .dijitIconNewTask,.dijitRtl .dijitDisabled .dijitIconEditTask,.dijitRtl .dijitDisabled .dijitIconEditProperty,.dijitRtl .dijitDisabled .dijitIconTask,.dijitRtl .dijitDisabled .dijitIconFilter,.dijitRtl .dijitDisabled .dijitIconConfigure,.dijitRtl .dijitDisabled .dijitIconSearch,.dijitRtl .dijitDisabled .dijitIconApplication,.dijitRtl .dijitDisabled .dijitIconBookmark,.dijitRtl .dijitDisabled .dijitIconChart,.dijitRtl .dijitDisabled .dijitIconConnector,.dijitRtl .dijitDisabled .dijitIconDatabase,.dijitRtl .dijitDisabled .dijitIconDocuments,.dijitRtl .dijitDisabled .dijitIconMail,.dijitRtl .dijitDisabled .dijitLeaf,.dijitRtl .dijitDisabled .dijitIconFile,.dijitRtl .dijitDisabled .dijitIconFunction,.dijitRtl .dijitDisabled .dijitIconKey,.dijitRtl .dijitDisabled .dijitIconPackage,.dijitRtl .dijitDisabled .dijitIconSample,.dijitRtl .dijitDisabled .dijitIconTable,.dijitRtl .dijitDisabled .dijitIconUsers,.dijitRtl .dijitDisabled .dijitFolderClosed,.dijitRtl .dijitDisabled .dijitIconFolderClosed,.dijitRtl .dijitDisabled .dijitFolderOpened,.dijitRtl .dijitDisabled .dijitIconFolderOpen,.dijitRtl .dijitDisabled .dijitIconError {background-image: url("../../icons/images/commonIconsObjActDisabled_rtl.png");}.claro .dijitTitlePaneRtl .dijitClosed .dijitArrowNode {background-position: -7px 0;}.claro .dijitMenuItemRtl .dijitMenuExpand {background-position: -7px 0; margin-right: 0; margin-left: 3px;}.claro .dijitMenuItemRtl .dijitMenuItemIcon {margin: 0 4px 0 0;}.claro .dijitCalendarRtl .dijitCalendarIncrease {background-position: 0 0;}.claro .dijitCalendarRtl .dijitCalendarDecrease {background-position: -18px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarIncrease {background-position: -36px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarDecrease {background-position: -55px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarIncrease {background-position: -72px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarDecrease {background-position: -91px 0;}.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickHover,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerHover,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerSelected,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickSelected {margin-left: -6px; margin-right: -8px; width: 114%;}.claro .dijitToolbar .dijitComboButtonRtl .dijitButtonNode {border-width: 0; padding: 2px;}.claro .dijitToolbar .dijitComboButtonRtlHover .dijitButtonNode, .claro .dijitToolbar .dijitComboButtonRtlActive .dijitButtonNode {border-width: 1px; padding: 1px;}.claro .dijitToolbar .dijitComboButtonRtl .dijitStretch {-moz-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0;}.claro .dijitToolbar .dijitComboButtonRtl .dijitArrowButton {-moz-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;}.claro .dijitToolbar .dijitComboButtonRtlHover .dijitArrowButton, .claro .dijitToolbar .dijitComboButtonRtlActive .dijitArrowButton {border-left-width: 1px; border-right-width: 0; padding-left: 1px; padding-right: 2px;} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/claro_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/claro_rtl.css new file mode 100644 index 0000000000..07a04631f8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/claro_rtl.css @@ -0,0 +1 @@ +.dijitRtl .dijitPlaceHolder {left: auto; right: 0;}.dijitMenuItemRtl {text-align: right;}.dj_iequirks .dijitComboButtonRtl button {float:left;}.dj_ie .dijitTextBoxRtl .dijitInputContainer {clear: right;}.dijitTextBoxRtl .dijitValidationContainer,.dijitTextBoxRtl .dijitSpinnerButtonContainer,.dijitComboBoxRtl .dijitArrowButtonContainer {border-right-width: 1px !important; border-left-width: 0 !important;}.dijitSpinnerRtl .dijitSpinnerButtonContainer .dijitArrowButton {right: 0; left: auto;}.dijitSelectRtl .dijitButtonText {float: right;}.dijitTextBoxRtl .dijitSpinnerButtonContainer,.dijitValidationTextBoxRtl .dijitValidationContainer,.dijitTextBoxRtl .dijitArrowButtonContainer {float: left;}.dijitCalendarRtl .dijitCalendarNextYear {margin:0 0.55em 0 0;}.dijitCalendarRtl .dijitCalendarPreviousYear {margin:0 0 0 0.55em;}.dijitSliderRtl .dijitSliderImageHandleV {left:auto;}.dijitSliderRtl .dijitSliderImageHandleH {left:-50%;}.dijitSliderRtl .dijitSliderMoveableH {right:auto; left:0;}.dijitSliderRtl .dijitRuleContainerV {float:right;}.dj_ie .dijitSliderRtl .dijitRuleContainerV {text-align:right;}.dj_ie .dijitSliderRtl .dijitRuleLabelV {text-align:left;}.dj_ie .dijitSliderRtl .dijitRuleLabelH {zoom:1;}.dijitSliderRtl .dijitSliderProgressBarH {float:right; right:0; left:auto;}.dijitRtl .dijitContentPaneLoading .dijitIconLoading,.dijitRtl .dijitContentPaneError .dijitIconError {margin-right: 0; margin-left: 9px;}.dijitTabControllerRtl .nowrapTabStrip {text-align: right;}.dijitTabRtl .dijitTabCloseButton {margin-left: 0; margin-right: 1em;}.dj_ie6 .dijitTabRtl .tabLabel,.dj_ie6 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie6 .dijitTabContainerLeft-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerLeft-tabs .dijitTabRtl {zoom: 1;}.dj_ie6 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerRight-tabs .dijitTabRtl {left: 0;}.dj_ie6 .dijitTabContainerRightRtl .dijitTabContainerRight-tabs,.dj_ie6 .dijitTabContainerLeftRtl .dijitTabContainerLeft-tabs {width: 1%;}.dj_ie .dijitTimePickerRtl .dijitTimePickerItem {width:100%;}.dijitColorPaletteRtl .dijitColorPaletteUnder {left: auto; right: 0;}.dijitSelectRtl .dijitButtonContents {border-style: none none none solid; text-align: right;}.dijitRtl .dojoDndHorizontal .dojoDndItemBefore {border-width: 0 2px 0 0; padding: 2px 0 2px 2px;}.dijitRtl .dojoDndHorizontal .dojoDndItemAfter {border-width: 0 0 0 2px; padding: 2px 2px 2px 0;}.claro .dijitTextBoxRtlError .dijitValidationContainer {border-left-width: 0 !important; border-right-width: 1px !important;}.claro .dijitComboButtonRtl .dijitStretch {-moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;}.claro .dijitComboButtonRtl .dijitArrowButton {-moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; padding: 3px 0 4px; border-left-width: 1px; border-right-width: 0;}.claro .dijitTabContainerTop-tabs .dijitTabRtl, .claro .dijitTabContainerBottom-tabs .dijitTabRtl {margin-right: 0; margin-left: 1px;}.claro .dijitSliderRtl .dijitSliderProgressBarH,.claro .dijitSliderRtl .dijitSliderRemainingBarH,.claro .dijitSliderRtl .dijitSliderLeftBumper,.claro .dijitSliderRtl .dijitSliderRightBumper,.claro .dijitSliderRtl .dijitSliderTopBumper {background-position: top right;}.claro .dijitSliderRtl .dijitSliderProgressBarV, .claro .dijitSliderRtl .dijitSliderRemainingBarV, .claro .dijitSliderRtl .dijitSliderBottomBumper {background-position: bottom right;}.claro .dijitSliderRtl .dijitSliderLeftBumper {border-left-width: 0; border-right-width: 1px;}.claro .dijitSliderRtl .dijitSliderRightBumper {border-left-width: 1px; border-right-width: 0;}.claro .dijitSliderRtl .dijitSliderIncrementIconH {background-position: -357px 50%;}.claro .dijitSliderRtl .dijitSliderDecrementIconH {background-position: -251px 50%;}.claro .dijitDialogRtl .dijitDialogCloseIcon {right: auto; left: 5px;}.claro .dijitDialogRtl .dijitDialogPaneActionBar {text-align: left; padding: 3px 7px 2px 5px;}.claro .dijitEditorRtl .dijitEditorIFrameContainer {padding: 3px 10px 1px 3px;}.dijitEditorRtl .dijitEditorIcon {background-image: url("../../icons/images/editorIconsEnabled_rtl.png");}.dijitEditorRtlDisabled .dijitEditorIcon {background-image: url("../../icons/images/editorIconsDisabled_rtl.png");}.dijitToolbarRtl .dijitToolbarSeparator {background-image: url("../../icons/images/editorIconsEnabled_rtl.png");}.dijitRtl .dijitIconSave,.dijitRtl .dijitIconPrint,.dijitRtl .dijitIconCut,.dijitRtl .dijitIconCopy,.dijitRtl .dijitIconClear,.dijitRtl .dijitIconDelete,.dijitRtl .dijitIconUndo,.dijitRtl .dijitIconEdit,.dijitRtl .dijitIconNewTask,.dijitRtl .dijitIconEditTask,.dijitRtl .dijitIconEditProperty,.dijitRtl .dijitIconTask,.dijitRtl .dijitIconFilter,.dijitRtl .dijitIconConfigure,.dijitRtl .dijitIconSearch,.dijitRtl .dijitIconApplication,.dijitRtl .dijitIconBookmark,.dijitRtl .dijitIconChart,.dijitRtl .dijitIconConnector,.dijitRtl .dijitIconDatabase,.dijitRtl .dijitIconDocuments,.dijitRtl .dijitIconMail,.dijitRtl .dijitLeaf,.dijitRtl .dijitIconFile,.dijitRtl .dijitIconFunction,.dijitRtl .dijitIconKey,.dijitRtl .dijitIconPackage,.dijitRtl .dijitIconSample,.dijitRtl .dijitIconTable,.dijitRtl .dijitIconUsers,.dijitRtl .dijitFolderClosed,.dijitRtl .dijitIconFolderClosed,.dijitRtl .dijitFolderOpened,.dijitRtl .dijitIconFolderOpen,.dijitRtl .dijitIconError {background-image: url("../../icons/images/commonIconsObjActEnabled_rtl.png"); width: 16px; height: 16px;}.dj_ie6 .dijitRtl .dijitIconSave,.dj_ie6 .dijitRtl .dijitIconPrint,.dj_ie6 .dijitRtl .dijitIconCut,.dj_ie6 .dijitRtl .dijitIconCopy,.dj_ie6 .dijitRtl .dijitIconClear,.dj_ie6 .dijitRtl .dijitIconDelete,.dj_ie6 .dijitRtl .dijitIconUndo,.dj_ie6 .dijitRtl .dijitIconEdit,.dj_ie6 .dijitRtl .dijitIconNewTask,.dj_ie6 .dijitRtl .dijitIconEditTask,.dj_ie6 .dijitRtl .dijitIconEditProperty,.dj_ie6 .dijitRtl .dijitIconTask,.dj_ie6 .dijitRtl .dijitIconFilter,.dj_ie6 .dijitRtl .dijitIconConfigure,.dj_ie6 .dijitRtl .dijitIconSearch,.dj_ie6 .dijitRtl .dijitIconApplication,.dj_ie6 .dijitRtl .dijitIconBookmark,.dj_ie6 .dijitRtl .dijitIconChart,.dj_ie6 .dijitRtl .dijitIconConnector,.dj_ie6 .dijitRtl .dijitIconDatabase,.dj_ie6 .dijitRtl .dijitIconDocuments,.dj_ie6 .dijitRtl .dijitIconMail,.dj_ie6 .dijitRtl .dijitLeaf,.dj_ie6 .dijitRtl .dijitIconFile,.dj_ie6 .dijitRtl .dijitIconFunction,.dj_ie6 .dijitRtl .dijitIconKey,.dj_ie6 .dijitRtl .dijitIconPackage,.dj_ie6 .dijitRtl .dijitIconSample,.dj_ie6 .dijitRtl .dijitIconTable,.dj_ie6 .dijitRtl .dijitIconUsers,.dj_ie6 .dijitRtl .dijitFolderClosed,.dj_ie6 .dijitRtl .dijitIconFolderClosed,.dj_ie6 .dijitRtl .dijitFolderOpened,.dj_ie6 .dijitRtl .dijitIconFolderOpen,.dj_ie6 .dijitRtl .dijitIconError {background-image: url("../../icons/images/commonIconsObjActEnabled8bit_rtl.png");}.dijitRtl .dijitDisabled .dijitIconSave,.dijitRtl .dijitDisabled .dijitIconPrint,.dijitRtl .dijitDisabled .dijitIconCut,.dijitRtl .dijitDisabled .dijitIconCopy,.dijitRtl .dijitDisabled .dijitIconClear,.dijitRtl .dijitDisabled .dijitIconDelete,.dijitRtl .dijitDisabled .dijitIconUndo,.dijitRtl .dijitDisabled .dijitIconEdit,.dijitRtl .dijitDisabled .dijitIconNewTask,.dijitRtl .dijitDisabled .dijitIconEditTask,.dijitRtl .dijitDisabled .dijitIconEditProperty,.dijitRtl .dijitDisabled .dijitIconTask,.dijitRtl .dijitDisabled .dijitIconFilter,.dijitRtl .dijitDisabled .dijitIconConfigure,.dijitRtl .dijitDisabled .dijitIconSearch,.dijitRtl .dijitDisabled .dijitIconApplication,.dijitRtl .dijitDisabled .dijitIconBookmark,.dijitRtl .dijitDisabled .dijitIconChart,.dijitRtl .dijitDisabled .dijitIconConnector,.dijitRtl .dijitDisabled .dijitIconDatabase,.dijitRtl .dijitDisabled .dijitIconDocuments,.dijitRtl .dijitDisabled .dijitIconMail,.dijitRtl .dijitDisabled .dijitLeaf,.dijitRtl .dijitDisabled .dijitIconFile,.dijitRtl .dijitDisabled .dijitIconFunction,.dijitRtl .dijitDisabled .dijitIconKey,.dijitRtl .dijitDisabled .dijitIconPackage,.dijitRtl .dijitDisabled .dijitIconSample,.dijitRtl .dijitDisabled .dijitIconTable,.dijitRtl .dijitDisabled .dijitIconUsers,.dijitRtl .dijitDisabled .dijitFolderClosed,.dijitRtl .dijitDisabled .dijitIconFolderClosed,.dijitRtl .dijitDisabled .dijitFolderOpened,.dijitRtl .dijitDisabled .dijitIconFolderOpen,.dijitRtl .dijitDisabled .dijitIconError {background-image: url("../../icons/images/commonIconsObjActDisabled_rtl.png");}.claro .dijitTitlePaneRtl .dijitClosed .dijitArrowNode {background-position: -7px 0;}.claro .dijitMenuItemRtl .dijitMenuExpand {background-position: -7px 0; margin-right: 0; margin-left: 3px;}.claro .dijitMenuItemRtl .dijitMenuItemIcon {margin: 0 4px 0 0;}.claro .dijitCalendarRtl .dijitCalendarIncrease {background-position: 0 0;}.claro .dijitCalendarRtl .dijitCalendarDecrease {background-position: -18px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarIncrease {background-position: -36px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowHover .dijitCalendarDecrease {background-position: -55px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarIncrease {background-position: -72px 0;}.claro .dijitCalendarRtl .dijitCalendarArrowActive .dijitCalendarDecrease {background-position: -91px 0;}.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickHover,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerHover,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerMarkerSelected,.dj_ie .claro .dijitTimePickerRtl .dijitTimePickerTickSelected {margin-left: -6px; margin-right: -8px; width: 114%;}.claro .dijitToolbar .dijitComboButtonRtl .dijitButtonNode {border-width: 0; padding: 2px;}.claro .dijitToolbar .dijitComboButtonRtlHover .dijitButtonNode, .claro .dijitToolbar .dijitComboButtonRtlActive .dijitButtonNode {border-width: 1px; padding: 1px;}.claro .dijitToolbar .dijitComboButtonRtl .dijitStretch {-moz-border-radius: 0 2px 2px 0; border-radius: 0 2px 2px 0;}.claro .dijitToolbar .dijitComboButtonRtl .dijitArrowButton {-moz-border-radius: 2px 0 0 2px; border-radius: 2px 0 0 2px;}.claro .dijitToolbar .dijitComboButtonRtlHover .dijitArrowButton, .claro .dijitToolbar .dijitComboButtonRtlActive .dijitArrowButton {border-left-width: 1px; border-right-width: 0; padding-left: 1px; padding-right: 2px;} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/compile.js b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/compile.js new file mode 100644 index 0000000000..08e637561f --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/compile.js @@ -0,0 +1,52 @@ +// Script to process all the less files and convert them to CSS files +// Run from themes/dijit/claro like: +// +// $ node compile.js + +var fs = require('fs'), // file system access + path = require('path'), // get directory from file name + less = require('../../../util/less'); // less processor + +var options = { + compress: false, + optimization: 1, + silent: false +}; + +var allFiles = [].concat( + fs.readdirSync("."), + fs.readdirSync("form").map(function(fname){ return "form/"+fname; }), + fs.readdirSync("layout").map(function(fname){ return "layout/"+fname; }) + ), + lessFiles = allFiles.filter(function(name){ return name && name != "variables.less" && /\.less$/.test(name); }); + +lessFiles.forEach(function(fname){ + console.log("=== " + fname); + fs.readFile(fname, 'utf-8', function(e, data){ + if(e){ + console.error("lessc: " + e.message); + process.exit(1); + } + + new(less.Parser)({ + paths: [path.dirname(fname)], + optimization: options.optimization, + filename: fname + }).parse(data, function(err, tree){ + if(err){ + less.writeError(err, options); + process.exit(1); + }else{ + try{ + var css = tree.toCSS({ compress: options.compress }), + outputFname = fname.replace('.less', '.css'); + var fd = fs.openSync(outputFname, "w"); + fs.writeSync(fd, css, 0, "utf8"); + }catch(e){ + less.writeError(e, options); + process.exit(2); + } + } + }); + }); +}); diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/document.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/document.css new file mode 100644 index 0000000000..c68a5bd6ea --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/document.css @@ -0,0 +1,43 @@ +/* ======= Styling for the document itself (overriding dojo.css) ======== */ +@import url("../../../dojo/resources/dojo.css"); +.claro { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: .688em; + color: #131313; +} +/* Headings */ +.claro h1 { + font-size: 1.545em; + margin-bottom: 0.727em; +} +.claro h2 { + font-size: 1.364em; + line-height: 1.455em; + margin-top: 1em; + margin-bottom: 0.60em; + font-weight: normal; +} +.claro h3, +.claro h4, +.claro h5, +.claro h6 { + font-size: 1.091em; + font-weight: normal; +} +/* paragraphs, quotes and lists */ +.claro p { + line-height: 1.3em; +} +/* pre and code */ +.claro pre, +.claro code { + font-family: inherit; + background-color: #efefef; + border: 1px solid #d3d3d3; +} +/* tables */ +.claro table.dojoTabular thead, +.claro table.dojoTabular tfoot { + background-color: #efefef; + border: 1px solid #d3d3d3; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/document.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/document.less new file mode 100644 index 0000000000..7f86356722 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/document.less @@ -0,0 +1,45 @@ +/* ======= Styling for the document itself (overriding dojo.css) ======== */ + +@import "variables"; +@import url("../../../dojo/resources/dojo.css"); + +.claro { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: .688em; + color: @document-text-color; +} + +/* Headings */ +.claro h1 { + font-size: 1.545em; + margin-bottom:0.727em; +} +.claro h2 { + font-size: 1.364em; + line-height: 1.455em; + margin-top:1em; + margin-bottom:0.60em; + font-weight: normal; +} +.claro h3, .claro h4, .claro h5, .claro h6 { + font-size:1.091em; + font-weight: normal; +} + +/* paragraphs, quotes and lists */ +.claro p { + line-height: 1.3em; +} + +/* pre and code */ +.claro pre, .claro code { + font-family:inherit; + background-color: @document-shadedsection-background-color; + border: 1px solid @document-border-color; +} + +/* tables */ +.claro table.dojoTabular thead, .claro table.dojoTabular tfoot { + background-color: @document-shadedsection-background-color; + border: 1px solid @document-border-color; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button.css new file mode 100644 index 0000000000..4bfdfbf756 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button.css @@ -0,0 +1,164 @@ +/* Button | DropDownButton | ComboButton | ToggleButton + * + * Styling Buttons mainly includes: + * + * 1. Containers + * .dijitButton + * .dijitDropDownButton + * .dijitComboButton + * .dijitButtonNode - common button/arrow wrapper shared across all three button types + * + * 2. Button text + * .dijitButtonText + * + * 3. Arrows - only for DropDownButton and ComboButton + * There are total four directions arrows - down, left, right, up: + * .dijitArrowButtonInner - down arrow by default + * .dijitLeftArrowButton .dijitArrowButtonInner - left arrow + * .dijitRightArrowButton .dijitArrowButtonInner - right arrow + * .dijitUpArrowButton .dijitArrowButtonInner - up arrow + * + * 4. States - Hover, Active, Disabled, e.g. + * .dijitButtonHover .dijitButtonNode + * .dijitButtonActive .dijitButtonNode + * .dijitButtonDisabled .dijitButtonNode + * + * .dijitDisabled .dijitArrowButtonInner - disabled arrow states + */ +.claro .dijitButtonNode { + /* rules for dijit.form.*Button widgets and arrow nodes on ComboBox, Spinner etc. */ + -webkit-transition-property: background-color; + -moz-transition-property: background-color; + transition-property: background-color; + -webkit-transition-duration: 0.3s; + -moz-transition-duration: 0.3s; + transition-duration: 0.3s; +} +.claro .dijitButton .dijitButtonNode, +.claro .dijitDropDownButton .dijitButtonNode, +.claro .dijitComboButton .dijitButtonNode, +.claro .dijitToggleButton .dijitButtonNode { + /* rules for the dijit.form.*Button widgets (see also ComboButton section below) */ + border: 1px solid #759dc0; + padding: 2px 4px 4px 4px; + color: #000; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); + background-color: #bcd8f4; + background-image: url("images/buttonEnabled.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); + background-image: -webkit-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); + background-image: -o-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); + background-image: -ms-linear-gradient(#ffffff 0px, rgba(255, 255, 255, 0) 3px, rgba(255, 255, 255, 0.75) 100%); + _background-image: none; +} +.claro .dijitComboButton .dijitArrowButton { + border-left-width: 0; + padding: 4px 2px 4px 2px; + /* TODO: still needed? */ +} +/*arrow styles for down/up/left/right directions*/ +.claro .dijitArrowButtonInner { + width: 15px; + height: 15px; + margin: 0 auto; + background-image: url("../form/images/buttonArrows.png"); + background-repeat: no-repeat; + background-position: -51px 53%; +} +.claro .dijitLeftArrowButton .dijitArrowButtonInner { + background-position: -77px 53%; +} +.claro .dijitRightArrowButton .dijitArrowButtonInner { + background-position: -26px 53%; +} +.claro .dijitUpArrowButton .dijitArrowButtonInner { + background-position: 0 53%; +} +.claro .dijitDisabled .dijitArrowButtonInner { + background-position: -151px 53%; +} +.claro .dijitDisabled .dijitLeftArrowButton .dijitArrowButtonInner { + background-position: -177px 53%; +} +.claro .dijitDisabled .dijitRightArrowButton .dijitArrowButtonInner { + background-position: -126px 53%; +} +.claro .dijitDisabled .dijitUpArrowButton .dijitArrowButtonInner { + background-position: -100px 53%; +} +.claro .dijitButtonText { + padding: 0 0.3em; + text-align: center; +} +/* hover status */ +.claro .dijitButtonHover .dijitButtonNode, +.claro .dijitDropDownButtonHover .dijitButtonNode, +.claro .dijitComboButton .dijitButtonNodeHover, +.claro .dijitComboButton .dijitDownArrowButtonHover, +.claro .dijitToggleButtonHover .dijitButtonNode { + background-color: #86bdf2; + color: #000; + -webkit-transition-duration: 0.2s; + -moz-transition-duration: 0.2s; + transition-duration: 0.2s; +} +/* active, checked status */ +.claro .dijitButtonActive .dijitButtonNode, +.claro .dijitDropDownButtonActive .dijitButtonNode, +.claro .dijitComboButtonActive .dijitButtonNode, +.claro .dijitToggleButtonActive .dijitButtonNode, +.claro .dijitToggleButtonChecked .dijitButtonNode { + background-color: #86bdf2; + -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); + box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); + -webkit-transition-duration: 0.1s; + -moz-transition-duration: 0.1s; + transition-duration: 0.1s; +} +/* disabled status */ +.claro .dijitButtonDisabled, +.claro .dijitDropDownButtonDisabled, +.claro .dijitComboButtonDisabled, +.claro .dijitToggleButtonDisabled { + background-image: none; + outline: none; +} +.claro .dijitButtonDisabled .dijitButtonNode, +.claro .dijitDropDownButtonDisabled .dijitButtonNode, +.claro .dijitComboButtonDisabled .dijitButtonNode, +.claro .dijitToggleButtonDisabled .dijitButtonNode { + background-color: #efefef; + border: solid 1px #d3d3d3; + color: #818181; + -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0); + -moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0); + box-shadow: 0 0 0 rgba(0, 0, 0, 0); + background-image: url("images/buttonDisabled.png"); + background-image: -moz-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); + background-image: -webkit-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); + background-image: -o-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); + background-image: -ms-linear-gradient(#ffffff 0%, rgba(255, 255, 255, 0) 40%); + _background-image: none; +} +.claro .dijitComboButtonDisabled .dijitArrowButton { + border-left-width: 0; +} +/* for ComboButton */ +.claro table.dijitComboButton { + border-collapse: separate; + /* override dijit.css so that ComboBox rounded corners work */ +} +.claro .dijitComboButton .dijitStretch { + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.claro .dijitComboButton .dijitArrowButton { + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button.less new file mode 100644 index 0000000000..5d59532371 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button.less @@ -0,0 +1,164 @@ +/* Button | DropDownButton | ComboButton | ToggleButton + * + * Styling Buttons mainly includes: + * + * 1. Containers + * .dijitButton + * .dijitDropDownButton + * .dijitComboButton + * .dijitButtonNode - common button/arrow wrapper shared across all three button types + * + * 2. Button text + * .dijitButtonText + * + * 3. Arrows - only for DropDownButton and ComboButton + * There are total four directions arrows - down, left, right, up: + * .dijitArrowButtonInner - down arrow by default + * .dijitLeftArrowButton .dijitArrowButtonInner - left arrow + * .dijitRightArrowButton .dijitArrowButtonInner - right arrow + * .dijitUpArrowButton .dijitArrowButtonInner - up arrow + * + * 4. States - Hover, Active, Disabled, e.g. + * .dijitButtonHover .dijitButtonNode + * .dijitButtonActive .dijitButtonNode + * .dijitButtonDisabled .dijitButtonNode + * + * .dijitDisabled .dijitArrowButtonInner - disabled arrow states + */ + +@import "../variables"; + +.claro .dijitButtonNode { + /* rules for dijit.form.*Button widgets and arrow nodes on ComboBox, Spinner etc. */ + .transition-property(background-color); + .transition-duration(.3s); +} + +.claro .dijitButton .dijitButtonNode, +.claro .dijitDropDownButton .dijitButtonNode, +.claro .dijitComboButton .dijitButtonNode, +.claro .dijitToggleButton .dijitButtonNode { + /* rules for the dijit.form.*Button widgets (see also ComboButton section below) */ + border: 1px solid @button-border-color; + padding: 2px 4px 4px 4px; + color: @text-color; + .border-radius(@button-border-radius); + .box-shadow(0 1px 1px rgba(0,0,0,0.15)); + + background-color: desaturate(darken(@button-background-color, 10), 20); + + // Alpha transparency layer to add gradient to above background color. + // Use CSS gradient with fallback to image for IE. + background-image: url("images/buttonEnabled.png"); + background-repeat: repeat-x; + .alpha-white-gradient(1, 0px, 0, 3px, 0.75, 100%); + _background-image: none; // IE6 can't handle background-color and background-image at once. +} + + +.claro .dijitComboButton .dijitArrowButton { + border-left-width: 0; + padding: 4px 2px 4px 2px; /* TODO: still needed? */ +} + +/*arrow styles for down/up/left/right directions*/ +.claro .dijitArrowButtonInner { + width: 15px; + height: 15px; + margin: 0 auto; + background-image:url("../@{image-form-button-arrows}"); + background-repeat:no-repeat; + background-position:-51px 53%; +} +.claro .dijitLeftArrowButton .dijitArrowButtonInner { + background-position: -77px 53%; +} +.claro .dijitRightArrowButton .dijitArrowButtonInner { + background-position: -26px 53%; +} +.claro .dijitUpArrowButton .dijitArrowButtonInner { + background-position: 0 53%; +} +.claro .dijitDisabled .dijitArrowButtonInner { + background-position: -151px 53%; +} +.claro .dijitDisabled .dijitLeftArrowButton .dijitArrowButtonInner { + background-position: -177px 53%; +} +.claro .dijitDisabled .dijitRightArrowButton .dijitArrowButtonInner { + background-position: -126px 53%; +} +.claro .dijitDisabled .dijitUpArrowButton .dijitArrowButtonInner { + background-position: -100px 53%; +} + +.claro .dijitButtonText { + padding: 0 0.3em; + text-align: center; +} + + + + + +/* hover status */ +.claro .dijitButtonHover .dijitButtonNode, +.claro .dijitDropDownButtonHover .dijitButtonNode, +.claro .dijitComboButton .dijitButtonNodeHover, +.claro .dijitComboButton .dijitDownArrowButtonHover, +.claro .dijitToggleButtonHover .dijitButtonNode { + background-color: desaturate(darken(@button-hovered-background-color, 10), 20); + color:@text-color; + .transition-duration(.2s); +} + +/* active, checked status */ +.claro .dijitButtonActive .dijitButtonNode, +.claro .dijitDropDownButtonActive .dijitButtonNode, +.claro .dijitComboButtonActive .dijitButtonNode, +.claro .dijitToggleButtonActive .dijitButtonNode, +.claro .dijitToggleButtonChecked .dijitButtonNode { + background-color: desaturate(darken(@button-pressed-background-color, 10), 20); + .box-shadow(inset 0px 1px 1px rgba(0, 0, 0, 0.2)); + .transition-duration(.1s); +} + +/* disabled status */ +.claro .dijitButtonDisabled, +.claro .dijitDropDownButtonDisabled, +.claro .dijitComboButtonDisabled, +.claro .dijitToggleButtonDisabled { + background-image: none; + outline: none; +} + +.claro .dijitButtonDisabled .dijitButtonNode, +.claro .dijitDropDownButtonDisabled .dijitButtonNode, +.claro .dijitComboButtonDisabled .dijitButtonNode, +.claro .dijitToggleButtonDisabled .dijitButtonNode { + background-color: @disabled-background-color; + border: solid 1px @disabled-border-color; + color: @disabled-text-color; + .box-shadow(0 0 0 rgba(0,0,0,0)); + + // Change the gradient from light to dark. + // Again using CSS gradient with fallback to image for IE. + background-image: url("images/buttonDisabled.png"); + .alpha-white-gradient(1, 0%, 0, 40%); + _background-image: none; // IE6 can't handle background-color and background-image at once. +} + +.claro .dijitComboButtonDisabled .dijitArrowButton{ + border-left-width: 0; +} +/* for ComboButton */ +.claro table.dijitComboButton { + border-collapse: separate; /* override dijit.css so that ComboBox rounded corners work */ +} + +.claro .dijitComboButton .dijitStretch { + .border-radius(@button-border-radius 0 0 @button-border-radius); +} +.claro .dijitComboButton .dijitArrowButton { + .border-radius(0 @button-border-radius @button-border-radius 0); +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button_rtl.css new file mode 100644 index 0000000000..0f85a4880f --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button_rtl.css @@ -0,0 +1,13 @@ +/* Combo Button */ +.claro .dijitComboButtonRtl .dijitStretch { + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.claro .dijitComboButtonRtl .dijitArrowButton { + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; + padding: 3px 0 4px; + border-left-width: 1px; + border-right-width: 0; +} +/* End Combo Button */ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button_rtl.less new file mode 100644 index 0000000000..6225d6847b --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Button_rtl.less @@ -0,0 +1,16 @@ +@import "../variables"; + +/* Combo Button */ + +.claro .dijitComboButtonRtl .dijitStretch { + .border-radius(0 @button-border-radius @button-border-radius 0); +} + +.claro .dijitComboButtonRtl .dijitArrowButton { + .border-radius(@button-border-radius 0 0 @button-border-radius); + padding:3px 0 4px; + border-left-width: 1px; + border-right-width: 0; +} + +/* End Combo Button */ \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Checkbox.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Checkbox.css new file mode 100644 index 0000000000..ebce9f575d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Checkbox.css @@ -0,0 +1,67 @@ +/* CheckBox + * + * Styling CheckBox mainly includes: + * + * 1. Containers + * .dijitCheckBox|.dijitCheckBoxIcon - for border, padding, width|height and background image + * + * 2. CheckBox within ToggleButton + * .dijitToggleButton|.dijitToggleButtonChecked .* - for background image + * + * 3. Checked state + * .dijitCheckBoxChecked - for checked background-color|image + * .dijitToggleButtonChecked - for border, background-color|image, display and width|height + * + * 4. Hover state + * .dijitCheckBoxHover|.dijitCheckBoxCheckedHover - for background image + * + * 5. Disabled state + * .dijitCheckBoxDisabled|.dijitCheckBoxCheckedDisabled - for background image + */ +.claro .dijitToggleButton .dijitCheckBoxIcon { + background-image: url("../images/checkmarkNoBorder.png"); +} +.dj_ie6 .claro .dijitToggleButton .dijitCheckBoxIcon { + background-image: url("../images/checkmarkNoBorder.gif"); +} +.claro .dijitCheckBox, +.claro .dijitCheckBoxIcon { + background-image: url("../form/images/checkboxRadioButtonStates.png"); + /* checkbox sprite image */ + background-repeat: no-repeat; + width: 15px; + height: 16px; + margin: 0 2px 0 0; + padding: 0; +} +.dj_ie6 .claro .dijitCheckBox, +.dj_ie6 .claro .dijitCheckBoxIcon { + background-image: url("../form/images/checkboxAndRadioButtons_IE6.png"); + /* checkbox sprite image */ +} +.claro .dijitCheckBox, +.claro .dijitToggleButton .dijitCheckBoxIcon { + /* unchecked */ + background-position: -15px; +} +.claro .dijitCheckBoxChecked, +.claro .dijitToggleButtonChecked .dijitCheckBoxIcon { + /* checked */ + background-position: 0; +} +.claro .dijitCheckBoxDisabled { + /* disabled */ + background-position: -75px; +} +.claro .dijitCheckBoxCheckedDisabled { + /* disabled but checked */ + background-position: -60px; +} +.claro .dijitCheckBoxHover { + /* hovering over an unchecked enabled checkbox */ + background-position: -45px; +} +.claro .dijitCheckBoxCheckedHover { + /* hovering over an checked enabled checkbox */ + background-position: -30px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Checkbox.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Checkbox.less new file mode 100644 index 0000000000..6ce444800f --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Checkbox.less @@ -0,0 +1,79 @@ +/* CheckBox + * + * Styling CheckBox mainly includes: + * + * 1. Containers + * .dijitCheckBox|.dijitCheckBoxIcon - for border, padding, width|height and background image + * + * 2. CheckBox within ToggleButton + * .dijitToggleButton|.dijitToggleButtonChecked .* - for background image + * + * 3. Checked state + * .dijitCheckBoxChecked - for checked background-color|image + * .dijitToggleButtonChecked - for border, background-color|image, display and width|height + * + * 4. Hover state + * .dijitCheckBoxHover|.dijitCheckBoxCheckedHover - for background image + * + * 5. Disabled state + * .dijitCheckBoxDisabled|.dijitCheckBoxCheckedDisabled - for background image + */ + +@import "../variables"; + +.claro .dijitToggleButton .dijitCheckBoxIcon { + background-image: url("../@{image-checkmark}"); +} + +.dj_ie6 .claro .dijitToggleButton .dijitCheckBoxIcon { + background-image: url("../@{image-checkmark-ie6}"); +} + +.claro .dijitCheckBox, +.claro .dijitCheckBoxIcon /* inside a toggle button */ { + background-image: url("../@{image-form-checkbox-and-radios}"); /* checkbox sprite image */ + background-repeat: no-repeat; + width: 15px; + height: 16px; + margin: 0 2px 0 0; + padding: 0; +} + +.dj_ie6 .claro .dijitCheckBox, +.dj_ie6 .claro .dijitCheckBoxIcon /* inside a toggle button */ { + background-image: url("../@{image-form-checkbox-and-radios-ie6}"); /* checkbox sprite image */ +} + +.claro .dijitCheckBox, +.claro .dijitToggleButton .dijitCheckBoxIcon { + /* unchecked */ + background-position: -15px; +} + +.claro .dijitCheckBoxChecked, +.claro .dijitToggleButtonChecked .dijitCheckBoxIcon { + /* checked */ + background-position: -0; +} + +.claro .dijitCheckBoxDisabled { + /* disabled */ + background-position: -75px; +} + +.claro .dijitCheckBoxCheckedDisabled { + /* disabled but checked */ + background-position: -60px; +} + +.claro .dijitCheckBoxHover { + /* hovering over an unchecked enabled checkbox */ + background-position: -45px; +} + +.claro .dijitCheckBoxCheckedHover { + /* hovering over an checked enabled checkbox */ + background-position: -30px; +} + + diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common.css new file mode 100644 index 0000000000..fdef5ecc95 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common.css @@ -0,0 +1,220 @@ +/* claro/form/Common.css */ +/*========================= common css =========================*/ +/* 'dijitTextBox' refers to 'dijit(TextBox|DateTextBox|CurrencyTextBox|...)' */ +.claro .dijitTextBox, +.claro .dijitInputInner { + color: #000; +} +.claro .dijitValidationTextBoxError .dijitValidationContainer { + background-color: #d46464; + background-image: url("../form/images/error.png"); + background-position: top center; + border: solid #d46464 0; + width: 9px; +} +.claro .dijitTextBoxError .dijitValidationContainer { + border-left-width: 1px; +} +.claro .dijitValidationTextBoxError .dijitValidationIcon { + width: 0; + background-color: transparent !important; + /* so the INPUT doesn't obscure the border in rtl+a11y */ +} +/* Padding for the input area of TextBox based widgets, and corresponding padding for the + * down arrow button and the placeholder. placeholder is explicitly listed because + * dijitPlaceHolder is absolutely positioned, so padding set on dijitInputField + * won't affect it + */ +.claro .dijitTextArea, +.claro .dijitInputField .dijitPlaceHolder { + padding: 2px; +} +.claro .dijitSelect .dijitInputField, +.claro .dijitTextBox .dijitInputField { + padding: 1px 2px; +} +.dj_gecko .claro .dijitTextBox .dijitInputInner, +.dj_webkit .claro .dijitTextBox .dijitInputInner { + padding: 1px; +} +.claro .dijitSelect, +.claro .dijitSelect .dijitButtonContents, +.claro .dijitTextBox, +.claro .dijitTextBox .dijitButtonNode { + /* color for (outer) border on *TextBox widgets, and border between input and buttons on ComboBox and Spinner */ + border-color: #b5bcc7; + -webkit-transition-property: background-color, border; + -moz-transition-property: background-color, border; + transition-property: background-color, border; + -webkit-transition-duration: 0.35s; + -moz-transition-duration: 0.35s; + transition-duration: 0.35s; +} +.claro .dijitSelect, +.claro .dijitTextBox { + background-color: #fff; +} +/* hover */ +.claro .dijitSelectHover, +.claro .dijitSelectHover .dijitButtonContents, +.claro .dijitTextBoxHover, +.claro .dijitTextBoxHover .dijitButtonNode { + border-color: #759dc0; + -webkit-transition-duration: 0.25s; + -moz-transition-duration: 0.25s; + transition-duration: 0.25s; +} +.claro .dijitTextBoxHover { + background-color: #e5f2fe; + background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); +} +/* error state */ +.claro .dijitSelectError, +.claro .dijitSelectError .dijitButtonContents, +.claro .dijitTextBoxError, +.claro .dijitTextBoxError .dijitButtonNode { + border-color: #d46464; +} +/* focused state */ +.claro .dijitSelectFocused, +.claro .dijitSelectFocused .dijitButtonContents, +.claro .dijitTextBoxFocused, +.claro .dijitTextBoxFocused .dijitButtonNode { + border-color: #759dc0; + -webkit-transition-duration: 0.1s; + -moz-transition-duration: 0.1s; + transition-duration: 0.1s; +} +.claro .dijitTextBoxFocused { + background-color: #fff; + background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); +} +.claro .dijitTextBoxFocused .dijitInputContainer { + background: #fff; +} +.claro .dijitSelectErrorFocused, +.claro .dijitSelectErrorFocused .dijitButtonContents, +.claro .dijitTextBoxErrorFocused, +.claro .dijitTextBoxErrorFocused .dijitButtonNode { + border-color: #ce5050; +} +/* disabled state */ +.claro .dijitSelectDisabled, +.claro .dijitSelectDisabled .dijitButtonContents, +.claro .dijitTextBoxDisabled, +.claro .dijitTextBoxDisabled .dijitButtonNode { + border-color: #d3d3d3; +} +.claro .dijitSelectDisabled, +.claro .dijitTextBoxDisabled, +.claro .dijitTextBoxDisabled .dijitInputContainer { + background-color: #efefef; + background-image: none; +} +.claro .dijitSelectDisabled, +.claro .dijitTextBoxDisabled, +.claro .dijitTextBoxDisabled .dijitInputInner { + color: #818181; +} +.dj_webkit .claro .dijitDisabled input { + /* because WebKit lightens disabled input/textarea no matter what color you specify */ + color: #757575; +} +.dj_webkit .claro textarea.dijitTextAreaDisabled { + /* because WebKit lightens disabled input/textarea no matter what color you specify */ + color: #1b1b1b; +} +/*========================= for special widgets =========================*/ +/* Input boxes with an arrow (for a drop down) */ +.claro .dijitSelect .dijitArrowButtonInner, +.claro .dijitComboBox .dijitArrowButtonInner { + background-image: url("../form/images/commonFormArrows.png"); + background-position: -35px 53%; + background-repeat: no-repeat; + margin: 0; + width: 16px; +} +.claro .dijitComboBox .dijitArrowButtonInner { + border: 1px solid #fff; +} +.claro .dijitToolbar .dijitComboBox .dijitArrowButtonInner { + border: none; +} +.claro .dijitToolbar .dijitComboBox .dijitArrowButtonInner { + border: none; +} +/* Add 1px vertical padding to the where user types and the validation icon, + to match the 1px border on arrow button */ +.claro .dijitSelectLabel, +.claro .dijitTextBox .dijitInputInner, +.claro .dijitValidationTextBox .dijitValidationContainer { + padding: 1px 0; +} +.claro .dijitComboBox .dijitButtonNode { + background-color: #efefef; + background-image: url("../images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +/* Arrow "hover" effect: + * The arrow button should change color whenever the mouse is in a position such that clicking it + * will toggle the drop down. That's either (1) anywhere over the ComboBox or (2) over the arrow + * button, depending on the openOnClick setting for the widget. + */ +.claro .dijitComboBoxOpenOnClickHover .dijitButtonNode, +.claro .dijitComboBox .dijitDownArrowButtonHover { + background-color: #abd6ff; +} +.claro .dijitComboBoxOpenOnClickHover .dijitArrowButtonInner, +.claro .dijitComboBox .dijitDownArrowButtonHover .dijitArrowButtonInner { + background-position: -70px 53%; +} +/* Arrow Button change when drop down is open */ +.claro .dijitComboBox .dijitHasDropDownOpen { + background-color: #7dbdfa; + background-image: url("../images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 1px; +} +.dj_iequirks .claro .dijitComboBox .dijitHasDropDownOpen { + padding: 1px 0; +} +.claro .dijitComboBox .dijitHasDropDownOpen .dijitArrowButtonInner { + background-position: -70px 53%; + border: 0 none; +} +/* disabled state */ +.claro div.dijitComboBoxDisabled .dijitArrowButtonInner { + /* specific selector set to override background-position setting from Button.js + * (.claro .dijitComboBoxDisabled .dijitArrowButtonInner) */ + background-position: 0 50%; + background-color: #efefef; +} +/*========================= hacks for browsers =========================*/ +/* it seems the input[type="hidden"] has a height (16px) too... this may cause the widget's height calculate error */ +.dj_ff3 .claro .dijitInputField input[type="hidden"] { + display: none; + height: 0; + width: 0; +} +.dj_borderbox .claro .dijitComboBox .dijitHasDropDownOpen .dijitArrowButtonInner { + width: 18px; +} +.dj_borderbox .claro .dijitComboBoxFocused .dijitHasDropDownOpen .dijitArrowButtonInner { + width: 16px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common.less new file mode 100644 index 0000000000..3c625f46fd --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common.less @@ -0,0 +1,241 @@ +/* claro/form/Common.css */ + +/*========================= common css =========================*/ + +@import "../variables"; + +/* 'dijitTextBox' refers to 'dijit(TextBox|DateTextBox|CurrencyTextBox|...)' */ + +.claro .dijitTextBox, +.claro .dijitInputInner { + // .dijitInputInner selector needed for ValidationTextBox on IE6 because doesn't inherit + // the color setting from the ancestor div.dijitTextBox + color: @text-color; +} + +.claro .dijitValidationTextBoxError .dijitValidationContainer { + background-color: @erroricon-background-color; + background-image: url("../@{image-form-error}"); + background-position: top center; + border: solid @erroricon-background-color 0; + width: 9px; +} + +.claro .dijitTextBoxError .dijitValidationContainer { + border-left-width: 1px; +} + +.claro .dijitValidationTextBoxError .dijitValidationIcon { + width: 0; + background-color: transparent !important; /* so the INPUT doesn't obscure the border in rtl+a11y */ +} + +/* Padding for the input area of TextBox based widgets, and corresponding padding for the + * down arrow button and the placeholder. placeholder is explicitly listed because + * dijitPlaceHolder is absolutely positioned, so padding set on dijitInputField + * won't affect it + */ +.claro .dijitTextArea, +.claro .dijitInputField .dijitPlaceHolder { + padding: @textbox-padding; +} + +.claro .dijitSelect .dijitInputField, +.claro .dijitTextBox .dijitInputField { + // Subtract 1px from top/bottom because we add 1px to other nodes, see rules below. + // Although we are theoretically only adding 1px to top/bottom browsers seem to pad inputs by 1px on left/right, + // although that varies by so compensate for that too. + padding: @textbox-padding - 1px @textbox-padding; +} + +.dj_gecko .claro .dijitTextBox .dijitInputInner, +.dj_webkit .claro .dijitTextBox .dijitInputInner { + // Although we are theoretically only adding 1px to top/bottom, some browsers seem to pad inputs by 1px on left/right, + // so compensate for that too. + padding: @textbox-padding - 1px; +} + +.claro .dijitSelect, +.claro .dijitSelect .dijitButtonContents, +.claro .dijitTextBox, +.claro .dijitTextBox .dijitButtonNode { + /* color for (outer) border on *TextBox widgets, and border between input and buttons on ComboBox and Spinner */ + border-color: @border-color; + .transition-property(background-color, border); + .transition-duration(.35s); +} + +.claro .dijitSelect, +.claro .dijitTextBox { + background-color: @textbox-background-color; +} + +/* hover */ +.claro .dijitSelectHover, +.claro .dijitSelectHover .dijitButtonContents, +.claro .dijitTextBoxHover, +.claro .dijitTextBoxHover .dijitButtonNode { + border-color: @hovered-border-color; + .transition-duration(.25s); +} + +.claro .dijitTextBoxHover { + background-color: @textbox-hovered-background-color; + .textbox-background-image; +} + +/* error state */ +.claro .dijitSelectError, +.claro .dijitSelectError .dijitButtonContents, +.claro .dijitTextBoxError, +.claro .dijitTextBoxError .dijitButtonNode { + border-color: @error-border-color; +} + +/* focused state */ +.claro .dijitSelectFocused, +.claro .dijitSelectFocused .dijitButtonContents, +.claro .dijitTextBoxFocused, +.claro .dijitTextBoxFocused .dijitButtonNode { + border-color:@focused-border-color; + .transition-duration(.1s); +} + +.claro .dijitTextBoxFocused { + background-color: @textbox-focused-background-color; + .textbox-background-image; +} +.claro .dijitTextBoxFocused .dijitInputContainer { + background: @textbox-focused-background-color; +} + +.claro .dijitSelectErrorFocused, +.claro .dijitSelectErrorFocused .dijitButtonContents, +.claro .dijitTextBoxErrorFocused, +.claro .dijitTextBoxErrorFocused .dijitButtonNode { + border-color: @error-focused-border-color; +} + +/* disabled state */ +.claro .dijitSelectDisabled, +.claro .dijitSelectDisabled .dijitButtonContents, +.claro .dijitTextBoxDisabled, +.claro .dijitTextBoxDisabled .dijitButtonNode { + border-color: @disabled-border-color; +} + +.claro .dijitSelectDisabled, +.claro .dijitTextBoxDisabled, +.claro .dijitTextBoxDisabled .dijitInputContainer { + background-color: @textbox-disabled-background-color; + background-image: none; +} + +.claro .dijitSelectDisabled, +.claro .dijitTextBoxDisabled, +.claro .dijitTextBoxDisabled .dijitInputInner { + color: @disabled-text-color; +} + +.dj_webkit .claro .dijitDisabled input { + /* because WebKit lightens disabled input/textarea no matter what color you specify */ + color: darken(@disabled-text-color, 5%) +} + +.dj_webkit .claro textarea.dijitTextAreaDisabled { + /* because WebKit lightens disabled input/textarea no matter what color you specify */ + color: darken(@disabled-text-color, 40%) +} + +/*========================= for special widgets =========================*/ + +/* Input boxes with an arrow (for a drop down) */ + +.claro .dijitSelect .dijitArrowButtonInner, +.claro .dijitComboBox .dijitArrowButtonInner { + background-image: url("../@{image-form-common-arrows}"); + background-position:-35px 53%; + background-repeat: no-repeat; + margin: 0; + width:16px; +} + +.claro .dijitComboBox .dijitArrowButtonInner { + border: 1px solid @arrowbutton-inner-border-color; // white gutter around the arrow button +} + +.claro .dijitToolbar .dijitComboBox .dijitArrowButtonInner { + border: none; +} + +.claro .dijitToolbar .dijitComboBox .dijitArrowButtonInner { + border: none; +} + +/* Add 1px vertical padding to the where user types and the validation icon, + to match the 1px border on arrow button */ +.claro .dijitSelectLabel, +.claro .dijitTextBox .dijitInputInner, +.claro .dijitValidationTextBox .dijitValidationContainer { + padding: 1px 0; +} + +.claro .dijitComboBox .dijitButtonNode { + background-color: @arrowbutton-background-color; + .standard-gradient("../"); +} + +/* Arrow "hover" effect: + * The arrow button should change color whenever the mouse is in a position such that clicking it + * will toggle the drop down. That's either (1) anywhere over the ComboBox or (2) over the arrow + * button, depending on the openOnClick setting for the widget. + */ +.claro .dijitComboBoxOpenOnClickHover .dijitButtonNode, +.claro .dijitComboBox .dijitDownArrowButtonHover { + background-color:@arrowbutton-hovered-background-color; +} + +.claro .dijitComboBoxOpenOnClickHover .dijitArrowButtonInner, +.claro .dijitComboBox .dijitDownArrowButtonHover .dijitArrowButtonInner { + background-position:-70px 53%; +} + +/* Arrow Button change when drop down is open */ +.claro .dijitComboBox .dijitHasDropDownOpen { // .dijitHasDropDown is on dijitArrowButton node + background-color: @pressed-background-color; + .active-gradient("../"); + padding: 1px; // Since no border on arrow button (see rule below) +} + +.dj_iequirks .claro .dijitComboBox .dijitHasDropDownOpen { + padding: 1px 0; +} + +.claro .dijitComboBox .dijitHasDropDownOpen .dijitArrowButtonInner { + background-position:-70px 53%; + border: 0 none; +} + +/* disabled state */ +.claro div.dijitComboBoxDisabled .dijitArrowButtonInner { + /* specific selector set to override background-position setting from Button.js + * (.claro .dijitComboBoxDisabled .dijitArrowButtonInner) */ + background-position:0 50%; + background-color:@disabled-background-color; +} + +/*========================= hacks for browsers =========================*/ +/* it seems the input[type="hidden"] has a height (16px) too... this may cause the widget's height calculate error */ +.dj_ff3 .claro .dijitInputField input[type="hidden"] { + display: none; + height: 0; + width: 0; +} + +.dj_borderbox .claro .dijitComboBox .dijitHasDropDownOpen .dijitArrowButtonInner { + width:18px; // quirks mode means border-box sizing, so 18px with the border (same as 16px without border) +} + +.dj_borderbox .claro .dijitComboBoxFocused .dijitHasDropDownOpen .dijitArrowButtonInner { + width:16px; // when no border, then back to 16px just like content-box sizing +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common_rtl.css new file mode 100644 index 0000000000..f5206c1964 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common_rtl.css @@ -0,0 +1,5 @@ +/* claro/form/Common_rtl.css */ +.claro .dijitTextBoxRtlError .dijitValidationContainer { + border-left-width: 0 !important; + border-right-width: 1px !important; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common_rtl.less new file mode 100644 index 0000000000..7c9952993d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Common_rtl.less @@ -0,0 +1,8 @@ +/* claro/form/Common_rtl.css */ + +@import "../variables"; + +.claro .dijitTextBoxRtlError .dijitValidationContainer { + border-left-width: 0 !important; + border-right-width: 1px !important; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/NumberSpinner.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/NumberSpinner.css new file mode 100644 index 0000000000..e2d4380cea --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/NumberSpinner.css @@ -0,0 +1,148 @@ +/* NumberSpinner - namespace "dijitSpinner" + * + * Styling NumberSpinner mainly includes: + * + * 1. Arrows + * Outer containers: .dijitSpinnerButtonContainer|.dijitSpinnerButtonInner - for border, padding and position + * Arrows: .dijitArrowButton|.dijitUpArrowButton.|dijitDownArrowButton + * Inner container: .dijitArrowButtonInner - for border, padding, width|height and background image + * + * 2. Hover state + * .dijitUpArrowButtonHover|.dijitDownArrowButtonHover .* - for background color|image + * + * 3. Active state + * .dijitUpArrowButtonActive|.dijitDownArrowButtonActive .* - for border, padding, margin and background color|image + * + * 4. Focused state + * .dijitSpinnerFocused .* - for background color|image + * + * 5. Disabled state + * .dijitSpinnerDisabled .* - for background color|image + */ +.claro .dijitSpinnerButtonContainer { + overflow: hidden; + position: relative; + width: auto; + padding: 0 2px; +} +.claro .dijitSpinnerButtonContainer .dijitSpinnerButtonInner { + border-width: 1px 0; + /* reserve space to match the claro combobox button border with border and not padding to make IE happier */ + border-style: solid none; +} +/* button */ +.claro .dijitSpinner .dijitArrowButton { + width: auto; + background-color: #efefef; + background-image: url("../images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + overflow: hidden; +} +.dj_iequirks .claro .dijitSpinner .dijitArrowButton { + overflow: visible; + /* 0 height w/o this */ +} +.claro .dijitSpinner .dijitSpinnerButtonInner { + width: 15px; +} +/* up & down button icons */ +.claro .dijitSpinner .dijitArrowButtonInner { + border: solid 1px #fff; + border-bottom-width: 0; + /* 2 top borders = 1 top+bottom border in ComboBox */ + background-image: url("../form/images/commonFormArrows.png"); + background-repeat: no-repeat; + height: 100%; + width: 15px; + padding-left: 1px; + padding-right: 1px; + /* for up arrow */ + background-position: -139px center; + /* override button.css (TODO: move to Common.css since ComboBox needs this too) */ + display: block; + margin: -1px 0 -1px 0; + /* compensate for inner border */ +} +.dj_iequirks .claro .dijitSpinner .dijitArrowButtonInner, +.dj_ie6 .claro .dijitSpinner .dijitArrowButtonInner, +.dj_ie7 .claro .dijitSpinner .dijitArrowButtonInner, +.dj_ie8 .claro .dijitSpinner .dijitArrowButtonInner { + margin-top: 0; + /* since its bottom aligned */ +} +.dj_iequirks .claro .dijitSpinner .dijitArrowButtonInner { + width: 19px; +} +.claro .dijitSpinner .dijitDownArrowButton .dijitArrowButtonInner { + background-position: -34px; +} +.claro .dijitSpinner .dijitArrowButtonInner .dijitInputField { + padding: 0; +} +/** hover & focused status **/ +.claro .dijitUpArrowButtonActive, +.claro .dijitDownArrowButtonActive { + background-color: #abd6ff; +} +.claro .dijitSpinner .dijitUpArrowButtonHover, +.claro .dijitSpinner .dijitDownArrowButtonHover, +.claro .dijitSpinnerFocused .dijitArrowButton { + background-color: #abd6ff; +} +.claro .dijitSpinner .dijitUpArrowButtonHover .dijitArrowButtonInner { + background-position: -174px; +} +.claro .dijitSpinner .dijitDownArrowButtonHover .dijitArrowButtonInner { + background-position: -69px; +} +.claro .dijitSpinnerFocused { + background-color: #fff; + background-image: none; +} +/* mouse down status */ +.claro .dijitSpinner .dijitDownArrowButtonActive, +.claro .dijitSpinner .dijitUpArrowButtonActive { + background-color: #7dbefa; + background-image: url("../images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.claro .dijitSpinner .dijitUpArrowButtonActive .dijitArrowButtonInner, +.claro .dijitSpinner .dijitDownArrowButtonActive .dijitArrowButtonInner { + /* hide inner border while button is depressed */ + border: 0; + padding: 1px; + margin-right: 2px; + margin-bottom: 1px; +} +.claro .dijitSpinner .dijitUpArrowButtonActive .dijitArrowButtonInner { + background-position: -173px; +} +.claro .dijitSpinner .dijitDownArrowButtonActive .dijitArrowButtonInner { + background-position: -68px; +} +/* disabled */ +.claro .dijitSpinnerDisabled .dijitArrowButtonInner { + background-color: #efefef; +} +.claro .dijitSpinnerDisabled .dijitUpArrowButton .dijitArrowButtonInner { + background-position: -104px; +} +.claro .dijitSpinnerDisabled .dijitDownArrowButton .dijitArrowButtonInner { + background-position: 1px; +} +/** hacks for browsers **/ +/* for IE 7, when div is enlarged, + * should be no empty space between dijitInputLayoutContainer and dijitSpinner*/ +.dj_ie7 .claro .dijitSpinner { + overflow: visible; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/NumberSpinner.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/NumberSpinner.less new file mode 100644 index 0000000000..e15c7821d8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/NumberSpinner.less @@ -0,0 +1,150 @@ +/* NumberSpinner - namespace "dijitSpinner" + * + * Styling NumberSpinner mainly includes: + * + * 1. Arrows + * Outer containers: .dijitSpinnerButtonContainer|.dijitSpinnerButtonInner - for border, padding and position + * Arrows: .dijitArrowButton|.dijitUpArrowButton.|dijitDownArrowButton + * Inner container: .dijitArrowButtonInner - for border, padding, width|height and background image + * + * 2. Hover state + * .dijitUpArrowButtonHover|.dijitDownArrowButtonHover .* - for background color|image + * + * 3. Active state + * .dijitUpArrowButtonActive|.dijitDownArrowButtonActive .* - for border, padding, margin and background color|image + * + * 4. Focused state + * .dijitSpinnerFocused .* - for background color|image + * + * 5. Disabled state + * .dijitSpinnerDisabled .* - for background color|image + */ + +@import "../variables"; + +.claro .dijitSpinnerButtonContainer { + overflow: hidden; + position: relative; + width: auto; + padding: 0 2px; +} +.claro .dijitSpinnerButtonContainer .dijitSpinnerButtonInner { + border-width: 1px 0; /* reserve space to match the claro combobox button border with border and not padding to make IE happier */ + border-style: solid none; +} + +/* button */ +.claro .dijitSpinner .dijitArrowButton { + width:auto; + background-color: @arrowbutton-background-color; + .standard-gradient("../"); + overflow: hidden; +} +.dj_iequirks .claro .dijitSpinner .dijitArrowButton { + overflow: visible; /* 0 height w/o this */ +} + +.claro .dijitSpinner .dijitSpinnerButtonInner { + width: 15px; +} +/* up & down button icons */ +.claro .dijitSpinner .dijitArrowButtonInner { + border:solid 1px @arrowbutton-inner-border-color; + border-bottom-width: 0; /* 2 top borders = 1 top+bottom border in ComboBox */ + background-image: url("../@{image-form-common-arrows}"); + background-repeat: no-repeat; + height: 100%; + width:15px; + padding-left: 1px; + padding-right: 1px; + + /* for up arrow */ + background-position:-139px center; + + /* override button.css (TODO: move to Common.css since ComboBox needs this too) */ + display: block; + margin: -1px 0 -1px 0; /* compensate for inner border */ +} + +.dj_iequirks .claro .dijitSpinner .dijitArrowButtonInner, +.dj_ie6 .claro .dijitSpinner .dijitArrowButtonInner, +.dj_ie7 .claro .dijitSpinner .dijitArrowButtonInner, +.dj_ie8 .claro .dijitSpinner .dijitArrowButtonInner { + margin-top: 0; /* since its bottom aligned */ +} + +.dj_iequirks .claro .dijitSpinner .dijitArrowButtonInner { + width: 19px; +} +.claro .dijitSpinner .dijitDownArrowButton .dijitArrowButtonInner { + background-position:-34px; +} +.claro .dijitSpinner .dijitArrowButtonInner .dijitInputField { + padding: 0; +} + +/** hover & focused status **/ + +.claro .dijitUpArrowButtonActive, +.claro .dijitDownArrowButtonActive { + background-color:@arrowbutton-pressed-background-color; +} + +.claro .dijitSpinner .dijitUpArrowButtonHover, +.claro .dijitSpinner .dijitDownArrowButtonHover, +.claro .dijitSpinnerFocused .dijitArrowButton { + background-color: @arrowbutton-hovered-background-color; +} + +.claro .dijitSpinner .dijitUpArrowButtonHover .dijitArrowButtonInner { + background-position:-174px; +} +.claro .dijitSpinner .dijitDownArrowButtonHover .dijitArrowButtonInner { + background-position:-69px; +} + +.claro .dijitSpinnerFocused { + background-color: @textbox-focused-background-color; + background-image: none; +} + +/* mouse down status */ +.claro .dijitSpinner .dijitDownArrowButtonActive, +.claro .dijitSpinner .dijitUpArrowButtonActive { + background-color: #7dbefa; // TODO. Mailed Jason about inconsistent ComboBox/Spinner behavior. + .active-gradient("../"); +} +.claro .dijitSpinner .dijitUpArrowButtonActive .dijitArrowButtonInner, +.claro .dijitSpinner .dijitDownArrowButtonActive .dijitArrowButtonInner { + /* hide inner border while button is depressed */ + border: 0; + padding: 1px; + margin-right:2px; + margin-bottom:1px; +} +.claro .dijitSpinner .dijitUpArrowButtonActive .dijitArrowButtonInner { + background-position:-173px; +} +.claro .dijitSpinner .dijitDownArrowButtonActive .dijitArrowButtonInner { + background-position:-68px; +} + +/* disabled */ + +.claro .dijitSpinnerDisabled .dijitArrowButtonInner { + background-color: @disabled-background-color; +} +.claro .dijitSpinnerDisabled .dijitUpArrowButton .dijitArrowButtonInner { + background-position:-104px; +} +.claro .dijitSpinnerDisabled .dijitDownArrowButton .dijitArrowButtonInner { + background-position:1px; +} + +/** hacks for browsers **/ + +/* for IE 7, when div is enlarged, + * should be no empty space between dijitInputLayoutContainer and dijitSpinner*/ +.dj_ie7 .claro .dijitSpinner { + overflow:visible; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/RadioButton.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/RadioButton.css new file mode 100644 index 0000000000..b3f65b5bc9 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/RadioButton.css @@ -0,0 +1,74 @@ +/* RadioButton + * + * Styling RadioButton mainly includes: + * + * 1. Containers + * .dijitRadio|.dijitRadioIcon - for border, padding, width|height and background image + * + * 2. RadioButton within ToggleButton + * .dijitToggleButton|.dijitToggleButtonChecked .* - for background image + * + * 3. Checked state + * .dijitRadioChecked - for checked background-color|image + * .dijitToggleButtonChecked - for border, background-color|image, display and width|height + * + * 4. Hover state + * .dijitRadioHover|.dijitRadioCheckedHover - for background image + * + * 5. Disabled state + * .dijitRadioDisabled|.dijitRadioCheckedDisabled - for background image + */ +.claro .dijitToggleButton .dijitRadio, +.claro .dijitToggleButton .dijitRadioIcon { + background-image: url("../form/images/checkboxRadioButtonStates.png"); +} +.dj_ie6 .claro .dijitToggleButton .dijitRadio, +.dj_ie6 .claro .dijitToggleButton .dijitRadioIcon { + background-image: url("../form/images/checkboxAndRadioButtons_IE6.png"); +} +.claro .dijitRadio, +.claro .dijitRadioIcon { + /* inside a toggle button */ + background-image: url("../form/images/checkboxRadioButtonStates.png"); + /* checkbox sprite image */ + background-repeat: no-repeat; + width: 15px; + height: 15px; + margin: 0 2px 0 0; + padding: 0; +} +.dj_ie6 .claro .dijitRadio, +.dj_ie6 .claro .dijitRadioIcon { + /* inside a toggle button */ + background-image: url("../form/images/checkboxAndRadioButtons_IE6.png"); + /* checkbox sprite image */ +} +.claro .dijitRadio { + /* unselected */ + background-position: -105px; +} +.claro .dijitToggleButton .dijitRadioIcon { + /* unselected */ + background-position: -107px; +} +.claro .dijitRadioDisabled { + /* unselected and disabled */ + background-position: -165px; +} +.claro .dijitRadioHover { + /* hovering over an unselected enabled radio button */ + background-position: -135px; +} +.claro .dijitRadioChecked { + background-position: -90px; +} +.claro .dijitToggleButtonChecked .dijitRadioIcon { + background-position: -92px; +} +.claro .dijitRadioCheckedHover { + background-position: -120px; +} +.claro .dijitRadioCheckedDisabled { + /* selected but disabled */ + background-position: -150px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/RadioButton.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/RadioButton.less new file mode 100644 index 0000000000..f48cb67ecf --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/RadioButton.less @@ -0,0 +1,84 @@ +/* RadioButton + * + * Styling RadioButton mainly includes: + * + * 1. Containers + * .dijitRadio|.dijitRadioIcon - for border, padding, width|height and background image + * + * 2. RadioButton within ToggleButton + * .dijitToggleButton|.dijitToggleButtonChecked .* - for background image + * + * 3. Checked state + * .dijitRadioChecked - for checked background-color|image + * .dijitToggleButtonChecked - for border, background-color|image, display and width|height + * + * 4. Hover state + * .dijitRadioHover|.dijitRadioCheckedHover - for background image + * + * 5. Disabled state + * .dijitRadioDisabled|.dijitRadioCheckedDisabled - for background image + */ + +@import "../variables"; + +.claro .dijitToggleButton .dijitRadio, +.claro .dijitToggleButton .dijitRadioIcon { + background-image: url("../@{image-form-checkbox-and-radios}"); +} + +.dj_ie6 .claro .dijitToggleButton .dijitRadio, +.dj_ie6 .claro .dijitToggleButton .dijitRadioIcon { + background-image: url("../@{image-form-checkbox-and-radios-ie6}"); +} + +.claro .dijitRadio, +.claro .dijitRadioIcon { /* inside a toggle button */ + background-image: url("../@{image-form-checkbox-and-radios}"); /* checkbox sprite image */ + background-repeat: no-repeat; + width: 15px; + height: 15px; + margin: 0 2px 0 0; + padding: 0; +} + +.dj_ie6 .claro .dijitRadio, +.dj_ie6 .claro .dijitRadioIcon { /* inside a toggle button */ + background-image: url("../@{image-form-checkbox-and-radios-ie6}"); /* checkbox sprite image */ +} + +.claro .dijitRadio{ + /* unselected */ + background-position: -105px; +} + +.claro .dijitToggleButton .dijitRadioIcon { + /* unselected */ + background-position: -107px; +} + +.claro .dijitRadioDisabled { + /* unselected and disabled */ + background-position: -165px; +} + +.claro .dijitRadioHover { + /* hovering over an unselected enabled radio button */ + background-position: -135px; +} + +.claro .dijitRadioChecked{ + background-position: -90px; +} + +.claro .dijitToggleButtonChecked .dijitRadioIcon { + background-position: -92px; +} + +.claro .dijitRadioCheckedHover{ + background-position: -120px; +} + +.claro .dijitRadioCheckedDisabled { + /* selected but disabled */ + background-position: -150px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Select.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Select.css new file mode 100644 index 0000000000..0878ff432f --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Select.css @@ -0,0 +1,96 @@ +/* Select + * + * Styling Select mainly includes: + * + * 1. Containers + * .dijitSelect - for border, background-color + * .dijitButtonContents - for border + * + * 2. Arrow + * .dijitArrowButton - for border, padding and background-color|image + * .dijitArrowButtonInner - for border, background-color|image, display and width|height + * + * 3. Menu + * .dijitSelectMenu .* - for border, padding + * + * 4. Various states + * .dijitSelectHover|.dijitSelectFocused|.dijitSelectDisabled .* - for border, padding and background-color|image + */ +/* normal status */ +.claro .dijitSelect .dijitArrowButtonContainer { + border: 1px solid #fff; +} +.claro .dijitSelect .dijitArrowButton { + padding: 0; + background-color: #efefef; + background-image: url("../images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.claro .dijitSelect .dijitArrowButton .dijitArrowButtonInner { + height: 16px; +} +/* hover status */ +.claro .dijitSelectHover { + background-color: #e5f2fe; + background-image: -moz-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -webkit-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -o-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-image: -ms-linear-gradient(rgba(127, 127, 127, 0.2) 0%, rgba(127, 127, 127, 0) 2px); + background-repeat: repeat-x; +} +.claro .dijitSelectFocused, +.claro .dijitSelectHover { + border-color: #759dc0; +} +.claro .dijitSelectHover .dijitArrowButton { + background-color: #abd6ff; +} +.claro .dijitSelectHover .dijitArrowButton .dijitArrowButtonInner { + background-position: -70px 53%; +} +/* focused status */ +.claro .dijitSelectFocused .dijitArrowButton { + background-color: #7dbefa; + background-image: url("../images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; +} +.claro .dijitSelectFocused .dijitArrowButton { + border: none; + padding: 1px; +} +.claro .dijitSelectFocused .dijitArrowButton .dijitArrowButtonInner { + background-position: -70px 53%; +} +/* disable status */ +.claro .dijitSelectDisabled { + border-color: #d3d3d3; + background-color: #efefef; + background-image: none; + color: #818181; +} +.claro .dijitSelectDisabled .dijitArrowButton .dijitArrowButtonInner { + background-position: 0 53%; +} +/* Dropdown menu style for select */ +.claro .dijitSelectMenu td.dijitMenuItemIconCell, +.claro .dijitSelectMenu td.dijitMenuArrowCell { + /* so that arrow and icon cells from MenuItem are not displayed */ + display: none; +} +.claro .dijitSelectMenu td.dijitMenuItemLabel { + /* line up menu text with text in select box (in LTR and RTL modes) */ + padding: 2px; +} +.claro .dijitSelectMenu .dijitMenuSeparatorTop { + border-bottom: 1px solid #759dc0; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Select.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Select.less new file mode 100644 index 0000000000..3c2cac6823 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Select.less @@ -0,0 +1,98 @@ +/* Select + * + * Styling Select mainly includes: + * + * 1. Containers + * .dijitSelect - for border, background-color + * .dijitButtonContents - for border + * + * 2. Arrow + * .dijitArrowButton - for border, padding and background-color|image + * .dijitArrowButtonInner - for border, background-color|image, display and width|height + * + * 3. Menu + * .dijitSelectMenu .* - for border, padding + * + * 4. Various states + * .dijitSelectHover|.dijitSelectFocused|.dijitSelectDisabled .* - for border, padding and background-color|image + */ + +@import "../variables"; + +/* normal status */ +.claro .dijitSelect .dijitArrowButtonContainer { + border: 1px solid @arrowbutton-inner-border-color; +} + +.claro .dijitSelect .dijitArrowButton { + padding: 0; + background-color: @arrowbutton-background-color; + .standard-gradient("../"); +} + +.claro .dijitSelect .dijitArrowButton .dijitArrowButtonInner { + height:16px; +} + +/* hover status */ +.claro .dijitSelectHover { + background-color: @textbox-hovered-background-color; + .textbox-background-image; + background-repeat: repeat-x; +} + +.claro .dijitSelectFocused, +.claro .dijitSelectHover { + border-color:@hovered-border-color; +} + +.claro .dijitSelectHover .dijitArrowButton { + background-color:@arrowbutton-hovered-background-color; +} + +.claro .dijitSelectHover .dijitArrowButton .dijitArrowButtonInner { + background-position:-70px 53%; +} + +/* focused status */ +.claro .dijitSelectFocused .dijitArrowButton { + background-color:#7dbefa; // TODO. Mailed Jason about inconsistent ComboBox/Spinner behavior. + .active-gradient("../"); +} + +.claro .dijitSelectFocused .dijitArrowButton { + border: none; + padding: 1px; +} + +.claro .dijitSelectFocused .dijitArrowButton .dijitArrowButtonInner { + background-position:-70px 53%; +} + +/* disable status */ +.claro .dijitSelectDisabled { + border-color: @disabled-border-color; + background-color: @disabled-background-color; + background-image: none; + color: @disabled-text-color; +} + +.claro .dijitSelectDisabled .dijitArrowButton .dijitArrowButtonInner { + background-position:0 53% +} + +/* Dropdown menu style for select */ +.claro .dijitSelectMenu td.dijitMenuItemIconCell, +.claro .dijitSelectMenu td.dijitMenuArrowCell { + /* so that arrow and icon cells from MenuItem are not displayed */ + display: none; +} + +.claro .dijitSelectMenu td.dijitMenuItemLabel { + /* line up menu text with text in select box (in LTR and RTL modes) */ + padding: @textbox-padding; +} + +.claro .dijitSelectMenu .dijitMenuSeparatorTop { + border-bottom:1px solid @focused-border-color; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider.css new file mode 100644 index 0000000000..593fa94299 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider.css @@ -0,0 +1,345 @@ +/* Slider + * + * Styling Slider mainly includes styling the Slider progress bar (dijitSliderProgressBar) + * + * Slider progress bar: + * 1. Slider progress bar (default styling): + * .dijitSliderProgressBarH - progress bar at the middle of horizontal slider + * .dijitSliderLeftBumper - bar at the left of horizontal slider + * .dijitSliderRightBumper - bar at the right of horizontal slider + * .dijitSliderProgressBarV - progress bar at the middle of vertical slider + * .dijitSliderTopBumper - bar at the top of vertical slider + * .dijitSliderBottomtBumper - bar at the bottom of vertical slider + * + * 2. hovered Slider progress bar (ie, mouse hover on progress bar) + * .dijitSliderHover .dijitSliderProgressBarH(horizontal) - hovered bar style: background, border + * + * 3. focused Slider progress bar (ie, mouse focused on progress bar) + * .dijitSliderFocused .dijitSliderProgressBarH(horizontal) - focus bar style: background, border + * + * 4. disabled/read-only Slider progress bar + * .dijitSliderDisabled .dijitSliderProgressBarH(horizontal) - bar styles when slider is disabled + * + * + * Slider Thumbs: + * 1. Slider Thumbs (default styling): + * .dijitSliderImageHandleH / .dijitSliderImageHandleV - styles for the controller on the progress bar + * + * 2. hovered Slider Thumbs (ie, mouse hover on slider thumbs) + * .dijitSliderHover .dijitSliderImageHandleH - hovered controller style + * + * 3. focused Slider progress bar (ie, mouse focused on slider thumbs) + * .dijitSliderFocused .dijitSliderImageHandleV - focused controller style + * + * + * Slider Increment/Decrement Buttons: + * 1. Slider Increment/Decrement Buttons (default styling): + * .dijitSliderDecrementIconH - decrement icon which lies at the left of horizontal slider + * .dijitSliderIncrementIconH - increment icon which lies at the right of horizontal slider + * .dijitSliderDecrementIconV - decrement icon which lies at the bottom of vertical slider + * .dijitSliderIncrementIconV - increment icon which lies at the top of vertical slider + * + * 2. hovered Slider Increment/Decrement Buttons (mouse hover on the icons) + * .dijitSliderHover .dijitSliderDecrementIconH - for background, border + * + * 3. active Slider Increment/Decrement Buttons (mouse down on the icons) + * .dijitSliderActive .dijitSliderIncrementIconV - for background, border + * + * 4. disabled/read-only Slider Increment/Decrement Buttons + * .dijitSliderDisabled .dijitSliderDecrementIconH - styles for the icons in disabled slider + * .dijitSliderReadOnly .dijitSliderIncrementIconV - styles for the icons in read-only slider + */ +.claro .dijitSliderBar { + border-style: solid; + outline: 1px; +} +.claro .dijitSliderFocused .dijitSliderBar { + border-color: #759dc0; +} +.claro .dijitSliderHover .dijitSliderBar { + border-color: #759dc0; +} +.claro .dijitSliderDisabled .dijitSliderBar { + background-image: none; + border-color: #d3d3d3; +} +.claro .dijitRuleLabelsContainer { + color: #000; +} +/* Horizontal Slider */ +.claro .dijitRuleLabelsContainerH { + padding: 2px 0; +} +.claro .dijitSlider .dijitSliderProgressBarH, +.claro .dijitSlider .dijitSliderLeftBumper { + border-color: #b5bcc7; + background-color: #cfe5fa; + background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); + background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); + background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); + background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px); +} +.claro .dijitSlider .dijitSliderRemainingBarH, +.claro .dijitSlider .dijitSliderRightBumper { + border-color: #b5bcc7; + background-color: #fff; +} +.claro .dijitSliderRightBumper { + border-right: solid 1px #b5bcc7; +} +.claro .dijitSliderLeftBumper { + border-left: solid 1px #b5bcc7; +} +.claro .dijitSliderHover .dijitSliderProgressBarH, +.claro .dijitSliderHover .dijitSliderLeftBumper { + background-color: #abd6ff; + border-color: #759dc0; +} +.claro .dijitSliderHover .dijitSliderRemainingBarH, +.claro .dijitSliderHover .dijitSliderRightBumper { + background-color: #fff; + border-color: #759dc0; +} +.claro .dijitSliderFocused .dijitSliderProgressBarH, +.claro .dijitSliderFocused .dijitSliderLeftBumper { + background-color: #abd6ff; + border-color: #759dc0; + -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); + box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); +} +.claro .dijitSliderFocused .dijitSliderRemainingBarH, +.claro .dijitSliderFocused .dijitSliderRightBumper { + background-color: #fff; + border-color: #759dc0; + -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); + box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2); +} +.claro .dijitSliderDisabled .dijitSliderProgressBarH, +.claro .dijitSliderDisabled .dijitSliderLeftBumper { + background-color: #d3d3d3; + /* left side of slider, fill matches border */ + background-image: none; +} +.claro .dijitSliderDisabled .dijitSliderRemainingBarH, +.claro .dijitSliderDisabled .dijitSliderRightBumper { + background-color: #efefef; +} +/* Vertical Slider */ +.claro .dijitRuleLabelsContainerV { + padding: 0 2px; +} +.claro .dijitSlider .dijitSliderProgressBarV, +.claro .dijitSlider .dijitSliderBottomBumper { + border-color: #b5bcc7; + background-color: #cfe5fa; + background-image: -moz-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); + background-image: -webkit-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); + background-image: -o-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); + background-image: -ms-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 1px); +} +.claro .dijitSlider .dijitSliderRemainingBarV, +.claro .dijitSlider .dijitSliderTopBumper { + border-color: #b5bcc7; + background-color: #fff; +} +.claro .dijitSliderBottomBumper { + border-bottom: solid 1px #b5bcc7; +} +.claro .dijitSliderTopBumper { + border-top: solid 1px #b5bcc7; +} +.claro .dijitSliderHover .dijitSliderProgressBarV, +.claro .dijitSliderHover .dijitSliderBottomBumper { + background-color: #abd6ff; + border-color: #759dc0; +} +.claro .dijitSliderHover .dijitSliderRemainingBarV, +.claro .dijitSliderHover .dijitSliderTopBumper { + background-color: #fff; + border-color: #759dc0; +} +.claro .dijitSliderFocused .dijitSliderProgressBarV, +.claro .dijitSliderFocused .dijitSliderBottomBumper { + background-color: #abd6ff; + border-color: #759dc0; + -webkit-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); + box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); +} +.claro .dijitSliderFocused .dijitSliderRemainingBarV, +.claro .dijitSliderFocused .dijitSliderTopBumper { + background-color: #fff; + border-color: #759dc0; + -webkit-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); + box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 0.2); +} +.claro .dijitSliderDisabled .dijitSliderProgressBarV, +.claro .dijitSliderDisabled .dijitSliderBottomBumper { + background-color: #d3d3d3; + /* bottom side of slider, fill matches border */ +} +.claro .dijitSliderDisabled .dijitSliderRemainingBarV, +.claro .dijitSliderDisabled .dijitSliderTopBumper { + background-color: #efefef; +} +/* ------- Thumbs ------- */ +.claro .dijitSliderImageHandleH { + border: 0; + width: 18px; + height: 16px; + background-image: url("../form/images/sliderThumbs.png"); + background-repeat: no-repeat; + background-position: 0 0; +} +.claro .dijitSliderHover .dijitSliderImageHandleH { + background-position: -18px 0; +} +.claro .dijitSliderFocused .dijitSliderImageHandleH { + background-position: -36px 0; +} +.claro .dijitSliderProgressBarH .dijitSliderThumbHover { + background-position: -36px 0; +} +.claro .dijitSliderProgressBarH .dijitSliderThumbActive { + background-position: -36px 0; +} +.claro .dijitSliderReadOnly .dijitSliderImageHandleH, +.claro .dijitSliderDisabled .dijitSliderImageHandleH { + background-position: -54px 0; +} +.claro .dijitSliderImageHandleV { + border: 0; + width: 18px; + height: 16px; + background-image: url("../form/images/sliderThumbs.png"); + background-repeat: no-repeat; + background-position: -289px 0; +} +.claro .dijitSliderHover .dijitSliderImageHandleV { + background-position: -307px 0; +} +.claro .dijitSliderFocused .dijitSliderImageHandleV { + background-position: -325px 0; +} +.claro .dijitSliderProgressBarV .dijitSliderThumbHover { + background-position: -325px 0; +} +.claro .dijitSliderProgressBarV .dijitSliderThumbActive { + background-position: -325px 0; +} +.claro .dijitSliderReadOnly .dijitSliderImageHandleV, +.claro .dijitSliderDisabled .dijitSliderImageHandleV { + background-position: -343px 0; +} +/* ---- Increment/Decrement Buttons ---- */ +.claro .dijitSliderButtonContainerH { + padding: 1px 3px 1px 2px; +} +.claro .dijitSliderButtonContainerV { + padding: 3px 1px 2px 1px; +} +.claro .dijitSliderDecrementIconH, +.claro .dijitSliderIncrementIconH, +.claro .dijitSliderDecrementIconV, +.claro .dijitSliderIncrementIconV { + background-image: url("../form/images/commonFormArrows.png"); + background-repeat: no-repeat; + background-color: #efefef; + -moz-border-radius: 2px; + border-radius: 2px; + border: solid 1px #b5bcc7; + font-size: 1px; +} +.claro .dijitSliderDecrementIconH, +.claro .dijitSliderIncrementIconH { + height: 12px; + width: 9px; +} +.claro .dijitSliderDecrementIconV, +.claro .dijitSliderIncrementIconV { + height: 9px; + width: 12px; +} +.claro .dijitSliderActive .dijitSliderDecrementIconH, +.claro .dijitSliderActive .dijitSliderIncrementIconH, +.claro .dijitSliderActive .dijitSliderDecrementIconV, +.claro .dijitSliderActive .dijitSliderIncrementIconV, +.claro .dijitSliderHover .dijitSliderDecrementIconH, +.claro .dijitSliderHover .dijitSliderIncrementIconH, +.claro .dijitSliderHover .dijitSliderDecrementIconV, +.claro .dijitSliderHover .dijitSliderIncrementIconV { + /* dijitSliderActive should be treated as dijitSliderHover since "clicking the slider" has no meaning */ + border: solid 1px #759dc0; + background-color: #fff; +} +.claro .dijitSliderDecrementIconH { + background-position: -357px 50%; +} +.claro .dijitSliderActive .dijitSliderDecrementIconH .claro .dijitSliderHover .dijitSliderDecrementIconH { + background-position: -393px 50%; +} +.claro .dijitSliderIncrementIconH { + background-position: -251px 50%; +} +.claro .dijitSliderActive .dijitSliderIncrementIconH .claro .dijitSliderHover .dijitSliderIncrementIconH { + background-position: -283px 50%; +} +.claro .dijitSliderDecrementIconV { + background-position: -38px 50%; +} +.claro .dijitSliderActive .dijitSliderDecrementIconV .claro .dijitSliderHover .dijitSliderDecrementIconV { + background-position: -73px 50%; +} +.claro .dijitSliderIncrementIconV { + background-position: -143px 49%; +} +.claro .dijitSliderActive .dijitSliderIncrementIconV .claro .dijitSliderHover .dijitSliderIncrementIconV { + background-position: -178px 49%; +} +.claro .dijitSliderButtonContainerV .dijitSliderDecrementButtonHover, +.claro .dijitSliderButtonContainerH .dijitSliderDecrementButtonHover, +.claro .dijitSliderButtonContainerV .dijitSliderIncrementButtonHover, +.claro .dijitSliderButtonContainerH .dijitSliderIncrementButtonHover { + background-color: #cfe5fa; +} +.claro .dijitSliderButtonContainerV .dijitSliderDecrementButtonActive, +.claro .dijitSliderButtonContainerH .dijitSliderDecrementButtonActive, +.claro .dijitSliderButtonContainerV .dijitSliderIncrementButtonActive, +.claro .dijitSliderButtonContainerH .dijitSliderIncrementButtonActive { + background-color: #abd6ff; + border-color: #759dc0; +} +.claro .dijitSliderButtonInner { + visibility: hidden; +} +.claro .dijitSliderDisabled .dijitSliderBar { + border-color: #d3d3d3; +} +.claro .dijitSliderReadOnly *, +.claro .dijitSliderDisabled * { + border-color: #d3d3d3; + color: #818181; +} +.claro .dijitSliderReadOnly .dijitSliderDecrementIconH, +.claro .dijitSliderDisabled .dijitSliderDecrementIconH { + background-position: -321px 50%; + background-color: #efefef; +} +.claro .dijitSliderReadOnly .dijitSliderIncrementIconH, +.claro .dijitSliderDisabled .dijitSliderIncrementIconH { + background-position: -215px 50%; + background-color: #efefef; +} +.claro .dijitSliderReadOnly .dijitSliderDecrementIconV, +.claro .dijitSliderDisabled .dijitSliderDecrementIconV { + background-position: -3px 49%; + background-color: #efefef; +} +.claro .dijitSliderReadOnly .dijitSliderIncrementIconV, +.claro .dijitSliderDisabled .dijitSliderIncrementIconV { + background-position: -107px 49%; + background-color: #efefef; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider.less new file mode 100644 index 0000000000..2c5bfe914d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider.less @@ -0,0 +1,344 @@ +/* Slider + * + * Styling Slider mainly includes styling the Slider progress bar (dijitSliderProgressBar) + * + * Slider progress bar: + * 1. Slider progress bar (default styling): + * .dijitSliderProgressBarH - progress bar at the middle of horizontal slider + * .dijitSliderLeftBumper - bar at the left of horizontal slider + * .dijitSliderRightBumper - bar at the right of horizontal slider + * .dijitSliderProgressBarV - progress bar at the middle of vertical slider + * .dijitSliderTopBumper - bar at the top of vertical slider + * .dijitSliderBottomtBumper - bar at the bottom of vertical slider + * + * 2. hovered Slider progress bar (ie, mouse hover on progress bar) + * .dijitSliderHover .dijitSliderProgressBarH(horizontal) - hovered bar style: background, border + * + * 3. focused Slider progress bar (ie, mouse focused on progress bar) + * .dijitSliderFocused .dijitSliderProgressBarH(horizontal) - focus bar style: background, border + * + * 4. disabled/read-only Slider progress bar + * .dijitSliderDisabled .dijitSliderProgressBarH(horizontal) - bar styles when slider is disabled + * + * + * Slider Thumbs: + * 1. Slider Thumbs (default styling): + * .dijitSliderImageHandleH / .dijitSliderImageHandleV - styles for the controller on the progress bar + * + * 2. hovered Slider Thumbs (ie, mouse hover on slider thumbs) + * .dijitSliderHover .dijitSliderImageHandleH - hovered controller style + * + * 3. focused Slider progress bar (ie, mouse focused on slider thumbs) + * .dijitSliderFocused .dijitSliderImageHandleV - focused controller style + * + * + * Slider Increment/Decrement Buttons: + * 1. Slider Increment/Decrement Buttons (default styling): + * .dijitSliderDecrementIconH - decrement icon which lies at the left of horizontal slider + * .dijitSliderIncrementIconH - increment icon which lies at the right of horizontal slider + * .dijitSliderDecrementIconV - decrement icon which lies at the bottom of vertical slider + * .dijitSliderIncrementIconV - increment icon which lies at the top of vertical slider + * + * 2. hovered Slider Increment/Decrement Buttons (mouse hover on the icons) + * .dijitSliderHover .dijitSliderDecrementIconH - for background, border + * + * 3. active Slider Increment/Decrement Buttons (mouse down on the icons) + * .dijitSliderActive .dijitSliderIncrementIconV - for background, border + * + * 4. disabled/read-only Slider Increment/Decrement Buttons + * .dijitSliderDisabled .dijitSliderDecrementIconH - styles for the icons in disabled slider + * .dijitSliderReadOnly .dijitSliderIncrementIconV - styles for the icons in read-only slider + */ + +@import "../variables"; + +.claro .dijitSliderBar { + border-style: solid; + outline: 1px; +} +.claro .dijitSliderFocused .dijitSliderBar { + border-color: @focused-border-color; +} +.claro .dijitSliderHover .dijitSliderBar { + border-color: @hovered-border-color; +} +.claro .dijitSliderDisabled .dijitSliderBar { + background-image: none; + border-color: @disabled-border-color; +} +.claro .dijitRuleLabelsContainer { + color: @text-color; +} + +/* Horizontal Slider */ + +.claro .dijitRuleLabelsContainerH { + padding: 2px 0; +} +.claro .dijitSlider .dijitSliderProgressBarH, +.claro .dijitSlider .dijitSliderLeftBumper{ + border-color: @border-color; + background-color: @slider-fullbar-background-color; + .alpha-white-gradient (top, 1,0px, 1,1px, 0,2px); +} +.claro .dijitSlider .dijitSliderRemainingBarH, +.claro .dijitSlider .dijitSliderRightBumper{ + border-color: @border-color; + background-color: @slider-remainingbar-background-color; +} +.claro .dijitSliderRightBumper { + border-right: solid 1px @border-color; +} +.claro .dijitSliderLeftBumper { + border-left: solid 1px @border-color; +} +.claro .dijitSliderHover .dijitSliderProgressBarH, +.claro .dijitSliderHover .dijitSliderLeftBumper{ + background-color: @slider-hovered-fullbar-background-color; + border-color: @hovered-border-color; +} +.claro .dijitSliderHover .dijitSliderRemainingBarH, +.claro .dijitSliderHover .dijitSliderRightBumper{ + background-color: @slider-hovered-remainingbar-background-color; + border-color: @hovered-border-color; +} +.claro .dijitSliderFocused .dijitSliderProgressBarH, +.claro .dijitSliderFocused .dijitSliderLeftBumper{ + background-color: @slider-focused-fullbar-background-color; + border-color: @focused-border-color; + .box-shadow(inset 0px 1px 1px rgba(0, 0, 0, 0.2)); +} +.claro .dijitSliderFocused .dijitSliderRemainingBarH, +.claro .dijitSliderFocused .dijitSliderRightBumper{ + background-color: @slider-focused-remainingbar-background-color; + border-color: @focused-border-color; + .box-shadow(inset 0px 1px 1px rgba(0, 0, 0, 0.2)); +} +.claro .dijitSliderDisabled .dijitSliderProgressBarH, +.claro .dijitSliderDisabled .dijitSliderLeftBumper{ + background-color: @disabled-border-color; /* left side of slider, fill matches border */ + background-image:none; +} +.claro .dijitSliderDisabled .dijitSliderRemainingBarH, +.claro .dijitSliderDisabled .dijitSliderRightBumper{ + background-color: @disabled-background-color; +} + +/* Vertical Slider */ + +.claro .dijitRuleLabelsContainerV { + padding: 0 2px; +} +.claro .dijitSlider .dijitSliderProgressBarV, +.claro .dijitSlider .dijitSliderBottomBumper{ + border-color: @border-color; + background-color: @slider-fullbar-background-color; + .alpha-white-gradient (left, 1,0px, 0,1px); +} +.claro .dijitSlider .dijitSliderRemainingBarV, +.claro .dijitSlider .dijitSliderTopBumper{ + border-color: @border-color; + background-color: @slider-remainingbar-background-color; +} +.claro .dijitSliderBottomBumper { + border-bottom: solid 1px @border-color; +} +.claro .dijitSliderTopBumper { + border-top: solid 1px @border-color; +} +.claro .dijitSliderHover .dijitSliderProgressBarV, +.claro .dijitSliderHover .dijitSliderBottomBumper{ + background-color: @slider-hovered-fullbar-background-color; + border-color: @hovered-border-color; +} +.claro .dijitSliderHover .dijitSliderRemainingBarV, +.claro .dijitSliderHover .dijitSliderTopBumper{ + background-color: @slider-hovered-remainingbar-background-color; + border-color: @hovered-border-color; +} +.claro .dijitSliderFocused .dijitSliderProgressBarV, +.claro .dijitSliderFocused .dijitSliderBottomBumper{ + background-color: @slider-focused-fullbar-background-color; + border-color: @focused-border-color; + .box-shadow(inset 1px 0px 1px rgba(0, 0, 0, 0.2)); +} +.claro .dijitSliderFocused .dijitSliderRemainingBarV, +.claro .dijitSliderFocused .dijitSliderTopBumper{ + background-color: @slider-focused-remainingbar-background-color; + border-color: @focused-border-color; + .box-shadow(inset 1px 0px 1px rgba(0, 0, 0, 0.2)); +} +.claro .dijitSliderDisabled .dijitSliderProgressBarV, +.claro .dijitSliderDisabled .dijitSliderBottomBumper{ + background-color: @disabled-border-color; /* bottom side of slider, fill matches border */ +} +.claro .dijitSliderDisabled .dijitSliderRemainingBarV, +.claro .dijitSliderDisabled .dijitSliderTopBumper{ + background-color: @disabled-background-color; +} + + +/* ------- Thumbs ------- */ + +.claro .dijitSliderImageHandleH { + border: 0; + width: 18px; + height: 16px; + background-image: url("../@{image-form-slider-thumbs}"); + background-repeat:no-repeat; + background-position:0 0; +} +.claro .dijitSliderHover .dijitSliderImageHandleH { + background-position:-18px 0; +} +.claro .dijitSliderFocused .dijitSliderImageHandleH { + background-position:-36px 0; +} +.claro .dijitSliderProgressBarH .dijitSliderThumbHover{ + background-position:-36px 0; +} +.claro .dijitSliderProgressBarH .dijitSliderThumbActive{ + background-position:-36px 0; +} +.claro .dijitSliderReadOnly .dijitSliderImageHandleH, +.claro .dijitSliderDisabled .dijitSliderImageHandleH { + background-position:-54px 0; +} +.claro .dijitSliderImageHandleV { + border: 0; + width: 18px; + height: 16px; + background-image: url("../@{image-form-slider-thumbs}"); + background-repeat:no-repeat; + background-position:-289px 0; +} +.claro .dijitSliderHover .dijitSliderImageHandleV { + background-position:-307px 0; +} +.claro .dijitSliderFocused .dijitSliderImageHandleV { + background-position:-325px 0; +} +.claro .dijitSliderProgressBarV .dijitSliderThumbHover{ + background-position:-325px 0; +} +.claro .dijitSliderProgressBarV .dijitSliderThumbActive{ + background-position:-325px 0; +} +.claro .dijitSliderReadOnly .dijitSliderImageHandleV, +.claro .dijitSliderDisabled .dijitSliderImageHandleV { + background-position:-343px 0; +} + +/* ---- Increment/Decrement Buttons ---- */ + +.claro .dijitSliderButtonContainerH{ + padding: 1px 3px 1px 2px; +} +.claro .dijitSliderButtonContainerV{ + padding: 3px 1px 2px 1px; +} +.claro .dijitSliderDecrementIconH, +.claro .dijitSliderIncrementIconH, +.claro .dijitSliderDecrementIconV, +.claro .dijitSliderIncrementIconV { + background-image: url("../@{image-form-common-arrows}"); + background-repeat:no-repeat; + background-color: @arrowbutton-background-color; + .border-radius(2px); + border: solid 1px @border-color; + font-size: 1px; +} +.claro .dijitSliderDecrementIconH, +.claro .dijitSliderIncrementIconH { + height: 12px; + width: 9px; +} +.claro .dijitSliderDecrementIconV, +.claro .dijitSliderIncrementIconV { + height: 9px; + width: 12px; +} +.claro .dijitSliderActive .dijitSliderDecrementIconH, +.claro .dijitSliderActive .dijitSliderIncrementIconH, +.claro .dijitSliderActive .dijitSliderDecrementIconV, +.claro .dijitSliderActive .dijitSliderIncrementIconV, +.claro .dijitSliderHover .dijitSliderDecrementIconH, +.claro .dijitSliderHover .dijitSliderIncrementIconH, +.claro .dijitSliderHover .dijitSliderDecrementIconV, +.claro .dijitSliderHover .dijitSliderIncrementIconV { + /* dijitSliderActive should be treated as dijitSliderHover since "clicking the slider" has no meaning */ + border: solid 1px @hovered-border-color; + background-color: @slider-hoveredButton-background-color; +} + +.claro .dijitSliderDecrementIconH { + background-position:-357px 50%; +} +.claro .dijitSliderActive .dijitSliderDecrementIconH +.claro .dijitSliderHover .dijitSliderDecrementIconH { + background-position:-393px 50%; +} +.claro .dijitSliderIncrementIconH { + background-position:-251px 50%; +} +.claro .dijitSliderActive .dijitSliderIncrementIconH +.claro .dijitSliderHover .dijitSliderIncrementIconH { + background-position:-283px 50%; +} +.claro .dijitSliderDecrementIconV { + background-position:-38px 50%; +} +.claro .dijitSliderActive .dijitSliderDecrementIconV +.claro .dijitSliderHover .dijitSliderDecrementIconV { + background-position:-73px 50%; +} +.claro .dijitSliderIncrementIconV { + background-position:-143px 49%; +} +.claro .dijitSliderActive .dijitSliderIncrementIconV +.claro .dijitSliderHover .dijitSliderIncrementIconV { + background-position:-178px 49%; +} +.claro .dijitSliderButtonContainerV .dijitSliderDecrementButtonHover, +.claro .dijitSliderButtonContainerH .dijitSliderDecrementButtonHover, +.claro .dijitSliderButtonContainerV .dijitSliderIncrementButtonHover, +.claro .dijitSliderButtonContainerH .dijitSliderIncrementButtonHover { + background-color: @slider-button-hovered-background-color; +} +.claro .dijitSliderButtonContainerV .dijitSliderDecrementButtonActive, +.claro .dijitSliderButtonContainerH .dijitSliderDecrementButtonActive, +.claro .dijitSliderButtonContainerV .dijitSliderIncrementButtonActive, +.claro .dijitSliderButtonContainerH .dijitSliderIncrementButtonActive { + background-color: @slider-button-pressed-background-color; + border-color:@pressed-border-color; +} +.claro .dijitSliderButtonInner { + visibility: hidden; +} +.claro .dijitSliderDisabled .dijitSliderBar{ + border-color: @disabled-border-color; +} +.claro .dijitSliderReadOnly *,.claro .dijitSliderDisabled * { + border-color: @disabled-border-color; + color: @disabled-text-color; +} +.claro .dijitSliderReadOnly .dijitSliderDecrementIconH, +.claro .dijitSliderDisabled .dijitSliderDecrementIconH { + background-position:-321px 50%; + background-color:@disabled-background-color; +} +.claro .dijitSliderReadOnly .dijitSliderIncrementIconH, +.claro .dijitSliderDisabled .dijitSliderIncrementIconH { + background-position:-215px 50%; + background-color:@disabled-background-color; +} +.claro .dijitSliderReadOnly .dijitSliderDecrementIconV, +.claro .dijitSliderDisabled .dijitSliderDecrementIconV { + background-position:-3px 49%; + background-color:@disabled-background-color; +} +.claro .dijitSliderReadOnly .dijitSliderIncrementIconV, +.claro .dijitSliderDisabled .dijitSliderIncrementIconV { + background-position:-107px 49%; + background-color:@disabled-background-color; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider_rtl.css new file mode 100644 index 0000000000..0f390936c8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider_rtl.css @@ -0,0 +1,26 @@ +.claro .dijitSliderRtl .dijitSliderProgressBarH, +.claro .dijitSliderRtl .dijitSliderRemainingBarH, +.claro .dijitSliderRtl .dijitSliderLeftBumper, +.claro .dijitSliderRtl .dijitSliderRightBumper, +.claro .dijitSliderRtl .dijitSliderTopBumper { + background-position: top right; +} +.claro .dijitSliderRtl .dijitSliderProgressBarV, +.claro .dijitSliderRtl .dijitSliderRemainingBarV, +.claro .dijitSliderRtl .dijitSliderBottomBumper { + background-position: bottom right; +} +.claro .dijitSliderRtl .dijitSliderLeftBumper { + border-left-width: 0; + border-right-width: 1px; +} +.claro .dijitSliderRtl .dijitSliderRightBumper { + border-left-width: 1px; + border-right-width: 0; +} +.claro .dijitSliderRtl .dijitSliderIncrementIconH { + background-position: -357px 50%; +} +.claro .dijitSliderRtl .dijitSliderDecrementIconH { + background-position: -251px 50%; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider_rtl.less new file mode 100644 index 0000000000..66a711668d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/Slider_rtl.less @@ -0,0 +1,33 @@ +@import "../variables"; + +.claro .dijitSliderRtl .dijitSliderProgressBarH, +.claro .dijitSliderRtl .dijitSliderRemainingBarH, +.claro .dijitSliderRtl .dijitSliderLeftBumper, +.claro .dijitSliderRtl .dijitSliderRightBumper, +.claro .dijitSliderRtl .dijitSliderTopBumper { + background-position: top right; +} + +.claro .dijitSliderRtl .dijitSliderProgressBarV, +.claro .dijitSliderRtl .dijitSliderRemainingBarV, +.claro .dijitSliderRtl .dijitSliderBottomBumper { + background-position: bottom right; +} + +.claro .dijitSliderRtl .dijitSliderLeftBumper { + border-left-width: 0; + border-right-width: 1px; +} + +.claro .dijitSliderRtl .dijitSliderRightBumper { + border-left-width: 1px; + border-right-width: 0; +} + +.claro .dijitSliderRtl .dijitSliderIncrementIconH { + background-position:-357px 50%; +} + +.claro .dijitSliderRtl .dijitSliderDecrementIconH { + background-position:-251px 50%; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonArrows.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonArrows.png new file mode 100644 index 0000000000..642eff39be Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonArrows.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonDisabled.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonDisabled.png new file mode 100644 index 0000000000..faf57ba1dc Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonDisabled.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonDisabled.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonDisabled.svg new file mode 100644 index 0000000000..72a51a0179 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonDisabled.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonEnabled.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonEnabled.png new file mode 100644 index 0000000000..0932a99475 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonEnabled.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonEnabled.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonEnabled.svg new file mode 100644 index 0000000000..d9e564ab85 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/buttonEnabled.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/checkboxAndRadioButtons_IE6.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/checkboxAndRadioButtons_IE6.png new file mode 100644 index 0000000000..92d222178d Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/checkboxAndRadioButtons_IE6.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/checkboxRadioButtonStates.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/checkboxRadioButtonStates.png new file mode 100644 index 0000000000..2d06a82883 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/checkboxRadioButtonStates.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/commonFormArrows.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/commonFormArrows.png new file mode 100644 index 0000000000..6d04742edd Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/commonFormArrows.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/error.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/error.png new file mode 100644 index 0000000000..46de1cd8bb Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/error.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/sliderThumbs.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/sliderThumbs.png new file mode 100644 index 0000000000..70ab2fe298 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/form/images/sliderThumbs.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/activeGradient.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/activeGradient.png new file mode 100644 index 0000000000..7e5716c0b5 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/activeGradient.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/activeGradient.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/activeGradient.svg new file mode 100644 index 0000000000..8ab6ce9c13 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/activeGradient.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendar.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendar.png new file mode 100644 index 0000000000..de66cbdb4d Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendar.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendarArrows.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendarArrows.png new file mode 100644 index 0000000000..3f6faa5f4a Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendarArrows.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendarArrows8bit.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendarArrows8bit.png new file mode 100644 index 0000000000..ab9d66cb9d Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/calendarArrows8bit.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/checkmarkNoBorder.gif b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/checkmarkNoBorder.gif new file mode 100644 index 0000000000..324bfb3cd3 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/checkmarkNoBorder.gif differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/checkmarkNoBorder.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/checkmarkNoBorder.png new file mode 100644 index 0000000000..9cec0c0aa6 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/checkmarkNoBorder.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dialogCloseIcon.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dialogCloseIcon.png new file mode 100644 index 0000000000..a605c71de7 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dialogCloseIcon.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dialogCloseIcon8bit.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dialogCloseIcon8bit.png new file mode 100644 index 0000000000..d2b063b166 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dialogCloseIcon8bit.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dnd.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dnd.png new file mode 100644 index 0000000000..29bef4d387 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/dnd.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/loadingAnimation.gif b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/loadingAnimation.gif new file mode 100644 index 0000000000..d76e4cd7f6 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/loadingAnimation.gif differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/progressBarAnim.gif b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/progressBarAnim.gif new file mode 100644 index 0000000000..30c0d9d873 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/progressBarAnim.gif differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/progressBarFull.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/progressBarFull.png new file mode 100644 index 0000000000..280f51d2c4 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/progressBarFull.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/spriteArrows.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/spriteArrows.png new file mode 100644 index 0000000000..608f4c7f75 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/spriteArrows.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/standardGradient.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/standardGradient.png new file mode 100644 index 0000000000..345402f628 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/standardGradient.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/standardGradient.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/standardGradient.svg new file mode 100644 index 0000000000..807c3c70b8 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/standardGradient.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/tooltip.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/tooltip.png new file mode 100644 index 0000000000..2b222739c0 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/tooltip.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/tooltip8bit.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/tooltip8bit.png new file mode 100644 index 0000000000..51f65f1048 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/tooltip8bit.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/treeExpandImages.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/treeExpandImages.png new file mode 100644 index 0000000000..75cf385700 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/treeExpandImages.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/treeExpandImages8bit.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/treeExpandImages8bit.png new file mode 100644 index 0000000000..290b2e14fc Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/images/treeExpandImages8bit.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/AccordionContainer.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/AccordionContainer.css new file mode 100644 index 0000000000..87d4ae47e7 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/AccordionContainer.css @@ -0,0 +1,129 @@ +/* Accordion + * + * Styling AccordionContainer basically means styling the accordion pane (dijitAccordionInnerContainer) + * and the title inside of it (dijitAccordionTitle). There are 4 basic states to style: + * + * 1. closed pane (and default styling): + * .dijitAccordionInnerContainer - container for each accordion child + * .dijitAccordionTitle - title for each accordion child + * + * 2. active closed pane (ie, mouse down on a title bar) + * .dijitAccordionInnerContainerActive - for background-color, border + * .dijitAccordionInnerContainerActive dijitAccordionTitle - for text color + * + * 3. open pane (expanded child) + * .dijitAccordionChildWrapper - wraps around the child widget (typically ContentPane) + * setting a margin so that there's blue trim all the way around the child + * + * These rules need to override the closed pane active: + * + * .dijitAccordionInnerContainerSelected - for background-color, border + * .dijitAccordionInnerContainerSelected .dijitAccordionTitle - for text color + * + * 4. hovered pane, open or closed + * The selectors below affect hovering over both a closed pane (ie, hovering a title bar), + * and hovering over an open pane. Also, treat mouse down on an open pane as a hover: + * + * .dijitAccordionInnerContainerHover, .dijitAccordionInnerContainerSelectedActive - for background-color, border + * .dijitAccordionInnerContainerHover .dijitAccordionTitle - for text color + */ +.claro .dijitAccordionContainer { + border: none; +} +.claro .dijitAccordionInnerContainer { + background-color: #efefef; + /* gray, for closed pane */ + border: solid 1px #b5bcc7; + margin-bottom: 1px; + -webkit-transition-property: background-color, border; + -moz-transition-property: background-color, border; + transition-property: background-color, border; + -webkit-transition-duration: 0.3s; + -moz-transition-duration: 0.3s; + transition-duration: 0.3s; + -webkit-transition-timing-function: linear; + -moz-transition-timing-function: linear; + transition-timing-function: linear; +} +.claro .dijitAccordionTitle { + background-color: transparent; + /* pick up color from dijitAccordionInnerContainer */ + background-image: url("../images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + padding: 5px 7px 2px 7px; + min-height: 17px; + color: #494949; +} +.claro .dijitAccordionContainer .dijitAccordionChildWrapper { + /* this extends the blue trim styling of the title bar to wrapping around the node. + * done by setting margin + */ + background-color: #fff; + border: 1px solid #759dc0; + margin: 0 2px 2px; +} +.claro .dijitAccordionContainer .dijitAccordionContainer-child { + /* this is affecting the child widget itself */ + padding: 9px; +} +/* Active state for closed pane */ +.claro .dijitAccordionInnerContainerActive { + border: 1px solid #759dc0; + background-color: #7dbdfa; + -webkit-transition-duration: 0.1s; + -moz-transition-duration: 0.1s; + transition-duration: 0.1s; +} +.claro .dijitAccordionInnerContainerActive .dijitAccordionTitle { + background-image: url("../images/activeGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(190, 190, 190, 0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%); + _background-image: none; + color: #000; +} +/* Open (a.k.a. selected) pane */ +.claro .dijitAccordionInnerContainerSelected { + border-color: #759dc0; + background-color: #cfe5fa; +} +.claro .dijitAccordionInnerContainerSelected .dijitAccordionTitle { + color: #000; + background-image: url("../images/standardGradient.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%); + _background-image: none; + /* avoid effect when clicking the title of the open pane */ +} +/* Hovering open or closed pane */ +.claro .dijitAccordionInnerContainerHover .dijitAccordionTitle { + /* both open and closed */ + color: #000; +} +.claro .dijitAccordionInnerContainerHover, +.claro .dijitAccordionInnerContainerSelectedActive { + /* note: clicking the currently selected Accordion pane should have no effect, so treating same as hover. */ + border: 1px solid #759dc0; + background-color: #abd6ff; + -webkit-transition-duration: 0.2s; + -moz-transition-duration: 0.2s; + transition-duration: 0.2s; +} +.claro .dijitAccordionInnerContainerSelectedHover .dijitAccordionChildWrapper, +.claro .dijitAccordionInnerContainerSelectedActive .dijitAccordionChildWrapper { + background-color: #fff; + border: 1px solid #759dc0; + -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25); + -moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25); + box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.25); +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/AccordionContainer.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/AccordionContainer.less new file mode 100644 index 0000000000..fd4308c304 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/AccordionContainer.less @@ -0,0 +1,111 @@ +/* Accordion + * + * Styling AccordionContainer basically means styling the accordion pane (dijitAccordionInnerContainer) + * and the title inside of it (dijitAccordionTitle). There are 4 basic states to style: + * + * 1. closed pane (and default styling): + * .dijitAccordionInnerContainer - container for each accordion child + * .dijitAccordionTitle - title for each accordion child + * + * 2. active closed pane (ie, mouse down on a title bar) + * .dijitAccordionInnerContainerActive - for background-color, border + * .dijitAccordionInnerContainerActive dijitAccordionTitle - for text color + * + * 3. open pane (expanded child) + * .dijitAccordionChildWrapper - wraps around the child widget (typically ContentPane) + * setting a margin so that there's blue trim all the way around the child + * + * These rules need to override the closed pane active: + * + * .dijitAccordionInnerContainerSelected - for background-color, border + * .dijitAccordionInnerContainerSelected .dijitAccordionTitle - for text color + * + * 4. hovered pane, open or closed + * The selectors below affect hovering over both a closed pane (ie, hovering a title bar), + * and hovering over an open pane. Also, treat mouse down on an open pane as a hover: + * + * .dijitAccordionInnerContainerHover, .dijitAccordionInnerContainerSelectedActive - for background-color, border + * .dijitAccordionInnerContainerHover .dijitAccordionTitle - for text color + */ + +@import "../variables"; + +.claro .dijitAccordionContainer { + border:none; +} +.claro .dijitAccordionInnerContainer { + background-color: @unselected-background-color; /* gray, for closed pane */ + border:solid 1px @border-color; + margin-bottom:1px; + .transition-property(background-color,border); + .transition-duration(.3s); + .transition-timing-function(linear); +} +.claro .dijitAccordionTitle { + background-color: transparent; /* pick up color from dijitAccordionInnerContainer */ + .standard-gradient("../"); + padding: 5px 7px 2px 7px; + min-height:17px; + color:@unselected-text-color; +} + +.claro .dijitAccordionContainer .dijitAccordionChildWrapper { + /* this extends the blue trim styling of the title bar to wrapping around the node. + * done by setting margin + */ + background-color:@pane-background-color; + border:1px solid @selected-border-color; + margin: 0 2px 2px; +} + +.claro .dijitAccordionContainer .dijitAccordionContainer-child { + /* this is affecting the child widget itself */ + padding: 9px; +} + +/* Active state for closed pane */ + +.claro .dijitAccordionInnerContainerActive { + border:1px solid @selected-border-color; + background-color:@pressed-background-color; + .transition-duration(.1s); +} +.claro .dijitAccordionInnerContainerActive .dijitAccordionTitle { + .active-gradient("../"); + color:@selected-text-color; +} + +/* Open (a.k.a. selected) pane */ + +.claro .dijitAccordionInnerContainerSelected { + border-color:@selected-border-color; + background-color: @selected-background-color; +} +.claro .dijitAccordionInnerContainerSelected .dijitAccordionTitle { + color:@selected-text-color; + .standard-gradient("../"); /* avoid effect when clicking the title of the open pane */ +} + +/* Hovering open or closed pane */ + +.claro .dijitAccordionInnerContainerHover .dijitAccordionTitle { + /* both open and closed */ + color:@hovered-text-color; +} + +// TODO: why do we have any hover effect on the selected pane? +// Since you can't click it, there shouldn't be a hover effect. +.claro .dijitAccordionInnerContainerHover, +.claro .dijitAccordionInnerContainerSelectedActive { + /* note: clicking the currently selected Accordion pane should have no effect, so treating same as hover. */ + border:1px solid @hovered-border-color; + background-color:@hovered-background-color; + .transition-duration(.2s); +} + +.claro .dijitAccordionInnerContainerSelectedHover .dijitAccordionChildWrapper, +.claro .dijitAccordionInnerContainerSelectedActive .dijitAccordionChildWrapper { + background-color:@pane-background-color; + border:1px solid @hovered-border-color; + .box-shadow(inset 0 0 3px rgba(0, 0, 0, .25)); +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/BorderContainer.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/BorderContainer.css new file mode 100644 index 0000000000..e51fb5f229 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/BorderContainer.css @@ -0,0 +1,113 @@ +/* BorderContainer + +Splitters and gutters separate panes within a BorderContainer. Splitters can be moved up and down (horizonal splitters) or left and right (vertical splitters), while Gutters are static. A "thumb" is the slit on a Splitter that indicates it is movable. + +Styling the BorderContainer widget consists of the following: + +.dijitBorderContainer - for border and padding of the entire border container + +.dijitSplitContainer-child, .dijitBorderContainer-child - for border or child panes of the border container. By default borders are put on all children of BorderContainer. + +.dijitBorderContainer-dijitTabContainerTop, +.dijitBorderContainer-dijitTabContainerBottom, +.dijitBorderContainer-dijitTabContainerLeft, +.dijitBorderContainer-dijitTabContainerRight, +.dijitBorderContainer-dijitAccordionContainer -for border of the border containers within TabContainer or AccordionContainer widget + +.dijitBorderContainer-dijitBorderContainer - for border and padding of nested BorderContainers + +Splitters and gutters: + +.dijitSplitterH, .dijitGutterH - for height, background, and border of a horizontal splitter and gutter +.dijitSplitterH .dijitSplitterThumb - for color, height/width of the thumb on a horizontal splitter +.dijitSplitterV, .dijitGutterV - - for height, background, and border of a vertical splitter and gutter +.dijitSplitterV .dijitSplitterThumb - for color, height/width of the thumb on a vertical splitter +.dijitSplitterHHover - for background-color of a hovered horizontal splitter +.dijitSplitterHHover .dijitSplitterThumb - for background-color of a hovered thumb on a horizontal splitter +.dijitSplitterVHover - for background-color of a hovered vertical splitter +.dijitSplitterVHover .dijitSplitterThumb - for background-color of a hovered thumb on a vertical splitter +.dijitSplitterHActive - for background-color of an active horizontal splitter +.dijitSplitterVActive - for background-color of an active horizontal splitter +*/ +.claro .dijitBorderContainer { + /* matches the width of the splitters between panes */ + padding: 5px; +} +.claro .dijitSplitContainer-child, +.claro .dijitBorderContainer-child { + /* By default put borders on all children of BorderContainer, + * to give illusion of borders on the splitters themselves. + */ + border: 1px #b5bcc7 solid; +} +.claro .dijitBorderContainer-dijitTabContainerTop, +.claro .dijitBorderContainer-dijitTabContainerBottom, +.claro .dijitBorderContainer-dijitTabContainerLeft, +.claro .dijitBorderContainer-dijitTabContainerRight, +.claro .dijitBorderContainer-dijitAccordionContainer { + /* except that TabContainer defines borders on it's sub-nodes (tablist and dijitTabPaneWrapper), + * so override rule setting border on domNode + */ + border: none; +} +.claro .dijitBorderContainer-dijitBorderContainer { + /* make nested BorderContainers look like a single big widget with lots of splitters */ + border: 0; + padding: 0; +} +/* Splitters and gutters */ +.claro .dijitSplitterH, +.claro .dijitGutterH { + background: none; + border: 0; + height: 5px; +} +.claro .dijitSplitterH .dijitSplitterThumb { + background: #b5bcc7 none; + height: 1px; + top: 2px; + width: 19px; +} +.claro .dijitSplitterV, +.claro .dijitGutterV { + background: none; + border: 0; + width: 5px; + margin: 0; +} +.claro .dijitSplitterV .dijitSplitterThumb { + background: #b5bcc7 none; + height: 19px; + left: 2px; + width: 1px; + margin: 0; +} +/* hovered splitter */ +.claro .dijitSplitterHHover, +.claro .dijitSplitterVHover { + font-size: 1px; + background-color: #cfe5fa; +} +.claro .dijitSplitterHHover { + background-image: -moz-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); + background-image: -webkit-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); + background-image: -o-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); + background-image: -ms-linear-gradient(left, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); +} +.claro .dijitSplitterVHover { + background-image: -moz-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); + background-image: -webkit-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); + background-image: -o-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); + background-image: -ms-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0) 50%, #ffffff 100%); +} +.claro .dijitSplitterHHover .dijitSplitterThumb, +.claro .dijitSplitterVHover .dijitSplitterThumb { + background: #759dc0 none; +} +/* active splitter */ +.claro .dijitSplitterHActive, +.claro .dijitSplitterVActive { + font-size: 1px; + background-color: #abd6ff; + background-image: none; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/BorderContainer.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/BorderContainer.less new file mode 100644 index 0000000000..f3edcd3c59 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/BorderContainer.less @@ -0,0 +1,124 @@ +/* BorderContainer + +Splitters and gutters separate panes within a BorderContainer. Splitters can be moved up and down (horizonal splitters) or left and right (vertical splitters), while Gutters are static. A "thumb" is the slit on a Splitter that indicates it is movable. + +Styling the BorderContainer widget consists of the following: + +.dijitBorderContainer - for border and padding of the entire border container + +.dijitSplitContainer-child, .dijitBorderContainer-child - for border or child panes of the border container. By default borders are put on all children of BorderContainer. + +.dijitBorderContainer-dijitTabContainerTop, +.dijitBorderContainer-dijitTabContainerBottom, +.dijitBorderContainer-dijitTabContainerLeft, +.dijitBorderContainer-dijitTabContainerRight, +.dijitBorderContainer-dijitAccordionContainer -for border of the border containers within TabContainer or AccordionContainer widget + +.dijitBorderContainer-dijitBorderContainer - for border and padding of nested BorderContainers + +Splitters and gutters: + +.dijitSplitterH, .dijitGutterH - for height, background, and border of a horizontal splitter and gutter +.dijitSplitterH .dijitSplitterThumb - for color, height/width of the thumb on a horizontal splitter +.dijitSplitterV, .dijitGutterV - - for height, background, and border of a vertical splitter and gutter +.dijitSplitterV .dijitSplitterThumb - for color, height/width of the thumb on a vertical splitter +.dijitSplitterHHover - for background-color of a hovered horizontal splitter +.dijitSplitterHHover .dijitSplitterThumb - for background-color of a hovered thumb on a horizontal splitter +.dijitSplitterVHover - for background-color of a hovered vertical splitter +.dijitSplitterVHover .dijitSplitterThumb - for background-color of a hovered thumb on a vertical splitter +.dijitSplitterHActive - for background-color of an active horizontal splitter +.dijitSplitterVActive - for background-color of an active horizontal splitter +*/ + +@import "../variables"; + +.claro .dijitBorderContainer { + /* matches the width of the splitters between panes */ + padding: 5px; +} + +.claro .dijitSplitContainer-child, +.claro .dijitBorderContainer-child { + /* By default put borders on all children of BorderContainer, + * to give illusion of borders on the splitters themselves. + */ + border: 1px @border-color solid; +} + +.claro .dijitBorderContainer-dijitTabContainerTop, +.claro .dijitBorderContainer-dijitTabContainerBottom, +.claro .dijitBorderContainer-dijitTabContainerLeft, +.claro .dijitBorderContainer-dijitTabContainerRight, +.claro .dijitBorderContainer-dijitAccordionContainer { + /* except that TabContainer defines borders on it's sub-nodes (tablist and dijitTabPaneWrapper), + * so override rule setting border on domNode + */ + border: none; + +} +.claro .dijitBorderContainer-dijitBorderContainer { + /* make nested BorderContainers look like a single big widget with lots of splitters */ + border: 0; + padding: 0; +} + +/* Splitters and gutters */ + +.claro .dijitSplitterH, +.claro .dijitGutterH { + background:none; + border:0; + height:5px; +} + +.claro .dijitSplitterH .dijitSplitterThumb { + background:@border-color none; + height:1px; + top:2px; + width:19px; +} + +.claro .dijitSplitterV, +.claro .dijitGutterV { + background:none; + border:0; + width:5px; + margin: 0; +} + +.claro .dijitSplitterV .dijitSplitterThumb { + background:@border-color none; + height:19px; + left:2px; + width:1px; + margin: 0; +} + +/* hovered splitter */ +.claro .dijitSplitterHHover, +.claro .dijitSplitterVHover { + font-size: 1px; + background-color: @splitter-hovered-background-color; +} + +.claro .dijitSplitterHHover { + .alpha-white-gradient (left, 1,0px, 0,50%, 1,100%); +} + +.claro .dijitSplitterVHover { + .alpha-white-gradient (top, 1,0px, 0,50%, 1,100%); +} + +.claro .dijitSplitterHHover .dijitSplitterThumb, +.claro .dijitSplitterVHover .dijitSplitterThumb { + background:@hovered-border-color none; +} + + +/* active splitter */ +.claro .dijitSplitterHActive, +.claro .dijitSplitterVActive { + font-size: 1px; + background-color:@splitter-dragged-background-color; + background-image: none; // color all the way across, not gradient like in hover mode +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/ContentPane.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/ContentPane.css new file mode 100644 index 0000000000..ea0c319148 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/ContentPane.css @@ -0,0 +1,39 @@ +/* ContentPane + * + * .dijitContentPane + * set padding for basic content pane + * + * Nested layouts: + * + * .dijitTabContainerTop-dijitContentPane, + * .dijitTabContainerLeft-dijitContentPane, + * .dijitTabContainerBottom-dijitContentPane, + * .dijitTabContainerRight-dijitContentPane + * set background-color and padding of ContentPanes nested within TabContainer (can do top, left, bottom, or right) or Accordion Container + * + * .dijitAccordionContainer-dijitContentPane + * set background-color and padding of ContentPane nested within Accordion + * + * .dijitSplitContainer-dijitContentPane, + * set background-color and padding of ContentPane nested within a SplitContainer + * + * .dijitBorderContainer-dijitContentPane + * set background-color and padding of ContentPane nested within a BorderContainer + */ +.claro .dijitContentPane { + padding: 8px; +} +/* nested layouts */ +.claro .dijitTabContainerTop-dijitContentPane, +.claro .dijitTabContainerLeft-dijitContentPane, +.claro .dijitTabContainerBottom-dijitContentPane, +.claro .dijitTabContainerRight-dijitContentPane, +.claro .dijitAccordionContainer-dijitContentPane { + background-color: #fff; + padding: 8px; +} +.claro .dijitSplitContainer-dijitContentPane, +.claro .dijitBorderContainer-dijitContentPane { + background-color: #fff; + padding: 8px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/ContentPane.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/ContentPane.less new file mode 100644 index 0000000000..83329bdb7c --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/ContentPane.less @@ -0,0 +1,43 @@ +/* ContentPane + * + * .dijitContentPane + * set padding for basic content pane + * + * Nested layouts: + * + * .dijitTabContainerTop-dijitContentPane, + * .dijitTabContainerLeft-dijitContentPane, + * .dijitTabContainerBottom-dijitContentPane, + * .dijitTabContainerRight-dijitContentPane + * set background-color and padding of ContentPanes nested within TabContainer (can do top, left, bottom, or right) or Accordion Container + * + * .dijitAccordionContainer-dijitContentPane + * set background-color and padding of ContentPane nested within Accordion + * + * .dijitSplitContainer-dijitContentPane, + * set background-color and padding of ContentPane nested within a SplitContainer + * + * .dijitBorderContainer-dijitContentPane + * set background-color and padding of ContentPane nested within a BorderContainer + */ + +@import "../variables"; + +.claro .dijitContentPane { + padding: 8px; +} + +/* nested layouts */ +.claro .dijitTabContainerTop-dijitContentPane, +.claro .dijitTabContainerLeft-dijitContentPane, +.claro .dijitTabContainerBottom-dijitContentPane, +.claro .dijitTabContainerRight-dijitContentPane, +.claro .dijitAccordionContainer-dijitContentPane { + background-color: @pane-background-color; + padding: 8px; +} +.claro .dijitSplitContainer-dijitContentPane, +.claro .dijitBorderContainer-dijitContentPane { + background-color: @pane-background-color; + padding: 8px; +} \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer.css new file mode 100644 index 0000000000..9170abd219 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer.css @@ -0,0 +1,387 @@ +/* TabContainer + * + * Styling TabContainer means styling the TabList and Its content container (dijitTitlePane) + * + * Tab List: (including 4 kinds of tab location) + * .dijitTabContainerTop-tabs - tablist container at top + * .dijitTabContainerBottom-tabs - tablist container at bottom + * .dijitTabContainerLeft-tabs - tablist container at left + * .dijitTabContainerRight-tabs - tablist container at right + * + * Tab Strip Button: + * .dijitTabStripIcon - tab strip button icon + * .dijitTabStripMenuIcon - down arrow icon position + * .dijitTabStripSlideLeftIcon - left arrow icon position + * .dijitTabStripSlideRightIcon - right arrow icon position + * + * .tabStripButtonDisabled - styles for disabled tab strip buttons + * + * Tab Button: + * .dijitTabContainerTop-tabs .dijitTab - styles for top tab button container + * .dijitTabContainerBottom-tabs .dijitTab - styles for bottom tab button container + * .dijitTabContainerLeft-tabs .dijitTab - styles for left tab button container + * .dijitTabContainerRight-tabs .dijitTab - styles for right tab button container + * + * .dijitTabContainerTop-tabs .dijitTabChecked .dijitTab + * - styles for selected status of top tab button + * same to Bottom, Left, Right Tabs + * + * .dijitTabHover .dijitTab - styles when mouse hover on tab buttons + * .dijitTabActive .dijitTab - styles when mouse down on tab buttons + * .dijitTabChecked .dijitTab - styles when on buttons of selected tab + * + * .dijitTabCloseButton - the close action buttons lie at the right top of each tab button on closable tabs + * .dijitTabCloseButtonHover - styles when mouse hover on close action button + * .dijitTabCloseButtonActive - styles when mouse down on close action button + * + * Tab Button: (checked status) + * + * Tab Content Container: + * .dijitTabContainerTop-dijitContentPane + * .dijitTabContainerBottom-dijitContentPane + * .dijitTabContainerLeft-dijitContentPane + * .dijitTabContainerRight-dijitContentPane - for background and padding + * + * Nested Tabs: + * .dijitTabContainerNested - Container for nested tabs + * .dijitTabContainerTabListNested - tab list container for nested tabs + */ +/*** some common features ***/ +.claro .dijitTabPaneWrapper { + background: #fff; +} +.claro .dijitTabPaneWrapper, +.claro .dijitTabContainerTop-tabs, +.claro .dijitTabContainerBottom-tabs, +.claro .dijitTabContainerLeft-tabs, +.claro .dijitTabContainerRight-tabs { + /* todo: add common class name for this div */ + border-color: #b5bcc7; +} +.claro .dijitTabCloseButton { + background: url("../layout/images/tabClose.png") no-repeat; + width: 14px; + height: 14px; + margin-left: 5px; + margin-right: -5px; +} +.claro .dijitTabCloseButtonHover { + background-position: -14px; +} +.claro .dijitTabCloseButtonActive { + background-position: -28px; +} +.claro .dijitTabSpacer { + /* set the spacer invisible. note that height:0 doesn't work on IE/quirks, it's still 10px. */ + display: none; +} +.claro .dijitTab { + border: 1px solid #b5bcc7; + background-color: #efefef; + -webkit-transition-property: background-color, border; + -moz-transition-property: background-color, border; + transition-property: background-color, border; + -webkit-transition-duration: 0.35s; + -moz-transition-duration: 0.35s; + transition-duration: 0.35s; + color: #494949; +} +.claro .dijitTabHover { + border-color: #759dc0; + background-color: #abd6ff; + -webkit-transition-duration: 0.25s; + -moz-transition-duration: 0.25s; + transition-duration: 0.25s; + color: #000; +} +.claro .dijitTabActive { + border-color: #759dc0; + background-color: #7dbdfa; + color: #000; + -webkit-transition-duration: 0.1s; + -moz-transition-duration: 0.1s; + transition-duration: 0.1s; +} +.claro .dijitTabChecked { + border-color: #b5bcc7; + background-color: #cfe5fa; + color: #000; +} +.claro .dijitTabDisabled { + background-color: #d3d3d3; +} +.claro .tabStripButton { + background-color: transparent; + border: none; +} +/*** end common ***/ +/*************** top tab ***************/ +.claro .dijitTabContainerTop-tabs .dijitTab { + /* unselected (and not hovered/pressed) tab */ + top: 1px; + /* used for overlap */ + margin-right: 1px; + padding: 3px 6px; + border-bottom-width: 0; + min-width: 60px; + text-align: center; + background-image: url("images/tabTopUnselected.png"); + background-repeat: repeat-x; + background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + -webkit-box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04); + -moz-box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04); + box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04); +} +.claro .dijitTabContainerTop-tabs .dijitTabChecked { + /* selected tab */ + padding-bottom: 4px; + padding-top: 9px; + background-image: url("images/tabTopSelected.png"); + background-image: -moz-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); + background-image: -webkit-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); + background-image: -o-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); + background-image: -ms-linear-gradient(top, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); + -webkit-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.05); +} +/** end top tab **/ +/*************** bottom tab ***************/ +.claro .dijitTabContainerBottom-tabs .dijitTab { + /* unselected (and not hovered/pressed) tab */ + top: -1px; + /* used for overlap */ + margin-right: 1px; + padding: 3px 6px; + border-top-width: 0; + min-width: 60px; + text-align: center; + background-image: url("images/tabBottomUnselected.png"); + background-repeat: repeat-x; + background-position: bottom; + background-image: -moz-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); +} +/* selected tab */ +.claro .dijitTabContainerBottom-tabs .dijitTabChecked { + padding-bottom: 9px; + padding-top: 4px; + background-image: url("images/tabBottomSelected.png"); + background-image: -moz-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); + background-image: -webkit-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); + background-image: -o-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); + background-image: -ms-linear-gradient(bottom, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0) 2px, #ffffff 7px); + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} +/** end bottom tab **/ +/*************** left tab ***************/ +.claro .dijitTabContainerLeft-tabs .dijitTab { + /* unselected (and not hovered/pressed) tab */ + left: 1px; + /* used for overlap */ + margin-bottom: 1px; + padding: 3px 8px 4px 4px; + background-image: url("images/tabLeftUnselected.png"); + background-repeat: repeat-y; + background-image: -moz-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(left, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); +} +/* selected tab */ +.claro .dijitTabContainerLeft-tabs .dijitTabChecked { + border-right-width: 0; + padding-right: 9px; + background-image: url("images/tabLeftSelected.png"); + background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); + background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); + background-image: -o-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); + background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); + -webkit-box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05); + box-shadow: -1px 0 2px rgba(0, 0, 0, 0.05); +} +/** end left tab **/ +/*************** right tab ***************/ +.claro .dijitTabContainerRight-tabs .dijitTab { + /* unselected (and not hovered/pressed) tab */ + left: -1px; + /* used for overlap */ + margin-bottom: 1px; + padding: 3px 8px 4px 4px; + background-image: url("images/tabRightUnselected.png"); + background-repeat: repeat-y; + background-position: right; + background-image: -moz-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(right, #ffffff 0px, #ffffff 1px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.6) 7px, rgba(255, 255, 255, 0) 100%); +} +.claro .dijitTabContainerRight-tabs .dijitTabChecked { + /* selected tab */ + padding-left: 5px; + border-left-width: 0; + background-image: url("images/tabRightSelected.png"); + background-image: -moz-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); + background-image: -webkit-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); + background-image: -o-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); + background-image: -ms-linear-gradient(right, rgba(255, 255, 255, 0.5) 0px, #ffffff 30px); + -webkit-box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07); + -moz-box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07); + box-shadow: 1px 0 2px rgba(0, 0, 0, 0.07); +} +/** end right tab **/ +/** round corner **/ +.claro .dijitTabContainerTop-tabs .dijitTab { + -moz-border-radius: 2px 2px 0 0; + border-radius: 2px 2px 0 0; +} +.claro .dijitTabContainerBottom-tabs .dijitTab { + -moz-border-radius: 0 0 2px 2px; + border-radius: 0 0 2px 2px; +} +.claro .dijitTabContainerLeft-tabs .dijitTab { + -moz-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; +} +.claro .dijitTabContainerRight-tabs .dijitTab { + -moz-border-radius: 0 2px 2px 0; + border-radius: 0 2px 2px 0; +} +/************ left/right scroll buttons + menu button ************/ +.claro .tabStripButton { + background-color: #e5f2fe; + border: 1px solid #b5bcc7; +} +.claro .dijitTabListContainer-top .tabStripButton { + padding: 4px 3px; + margin-top: 7px; + background-image: -moz-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(top, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); +} +.claro .dijitTabListContainer-bottom .tabStripButton { + padding: 4px 3px; + margin-bottom: 7px; + background-image: -moz-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); + background-image: -webkit-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); + background-image: -o-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); + background-image: -ms-linear-gradient(bottom, #ffffff 0px, rgba(255, 255, 255, 0.1) 1px, rgba(255, 255, 255, 0.6) 6px, rgba(255, 255, 255, 0) 100%); +} +.claro .tabStripButtonHover { + background-color: #abd6ff; +} +.claro .tabStripButtonActive { + background-color: #7dbdfa; +} +.claro .dijitTabStripIcon { + height: 15px; + width: 15px; + margin: 0 auto; + background: url("../form/images/buttonArrows.png") no-repeat -75px 50%; + background-color: transparent; +} +.claro .dijitTabStripSlideRightIcon { + background-position: -24px 50%; +} +.claro .dijitTabStripMenuIcon { + background-position: -51px 50%; +} +/*disabled styles for tab strip buttons*/ +.claro .dijitTabListContainer-top .tabStripButtonDisabled, +.claro .dijitTabListContainer-bottom .tabStripButtonDisabled { + background-color: #d3d3d3; + border: 1px solid #b5bcc7; + /* to match border of TabContainer itself */ +} +.claro .tabStripButtonDisabled .dijitTabStripSlideLeftIcon { + background-position: -175px 50%; +} +.claro .tabStripButtonDisabled .dijitTabStripSlideRightIcon { + background-position: -124px 50%; +} +.claro .tabStripButtonDisabled .dijitTabStripMenuIcon { + background-position: -151px 50%; +} +/* Nested Tabs */ +.claro .dijitTabContainerNested .dijitTabListWrapper { + height: auto; +} +.claro .dijitTabContainerNested .dijitTabContainerTop-tabs { + border-bottom: solid 1px #b5bcc7; + padding: 2px 2px 4px; +} +.claro .dijitTabContainerTabListNested .dijitTab { + background: rgba(255, 255, 255, 0) none repeat scroll 0 0; + border: none; + padding: 4px; + border-color: rgba(118, 157, 192, 0); + -webkit-transition-property: background-color, border-color; + -moz-transition-property: background-color, border-color; + transition-property: background-color, border-color; + -webkit-transition-duration: 0.3s; + -moz-transition-duration: 0.3s; + transition-duration: 0.3s; + -moz-border-radius: 2px; + border-radius: 2px; +} +.claro .dijitTabContainerTabListNested .dijitTab { + background: none; + border: none; + top: 0; + /* to override top: 1px/-1px for normal tabs */ + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.claro .dijitTabContainerTabListNested .dijitTabHover { + background-color: #e5f2fe; + border: solid 1px #cfe5fa; + padding: 3px; + -webkit-transition-duration: 0.2s; + -moz-transition-duration: 0.2s; + transition-duration: 0.2s; +} +.claro .dijitTabContainerTabListNested .dijitTabHover .tabLabel { + text-decoration: none; +} +.claro .dijitTabContainerTabListNested .dijitTabActive { + border: solid 1px #759dc0; + padding: 3px; + background: #abd6ff url("images/tabNested.png") repeat-x; + background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); + background-image: -o-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); + background-image: -ms-linear-gradient(rgba(255, 255, 255, 0.61) 0%, rgba(255, 255, 255, 0) 17%, rgba(255, 255, 255, 0) 83%, rgba(255, 255, 255, 0.61) 100%); + -webkit-transition-duration: 0.1s; + -moz-transition-duration: 0.1s; + transition-duration: 0.1s; +} +.claro .dijitTabContainerTabListNested .dijitTabChecked { + padding: 3px; + border: solid 1px #759dc0; + background-color: #cfe5fa; +} +.claro .dijitTabContainerTabListNested .dijitTabChecked .tabLabel { + text-decoration: none; + background-image: none; +} +.claro .dijitTabPaneWrapperNested { + border: none; + /* prevent double border */ +} +.claro .dijitTab, +.claro .tabStripButton { + _background-image: none !important; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer.less new file mode 100644 index 0000000000..74495b2097 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer.less @@ -0,0 +1,366 @@ +/* TabContainer + * + * Styling TabContainer means styling the TabList and Its content container (dijitTitlePane) + * + * Tab List: (including 4 kinds of tab location) + * .dijitTabContainerTop-tabs - tablist container at top + * .dijitTabContainerBottom-tabs - tablist container at bottom + * .dijitTabContainerLeft-tabs - tablist container at left + * .dijitTabContainerRight-tabs - tablist container at right + * + * Tab Strip Button: + * .dijitTabStripIcon - tab strip button icon + * .dijitTabStripMenuIcon - down arrow icon position + * .dijitTabStripSlideLeftIcon - left arrow icon position + * .dijitTabStripSlideRightIcon - right arrow icon position + * + * .tabStripButtonDisabled - styles for disabled tab strip buttons + * + * Tab Button: + * .dijitTabContainerTop-tabs .dijitTab - styles for top tab button container + * .dijitTabContainerBottom-tabs .dijitTab - styles for bottom tab button container + * .dijitTabContainerLeft-tabs .dijitTab - styles for left tab button container + * .dijitTabContainerRight-tabs .dijitTab - styles for right tab button container + * + * .dijitTabContainerTop-tabs .dijitTabChecked .dijitTab + * - styles for selected status of top tab button + * same to Bottom, Left, Right Tabs + * + * .dijitTabHover .dijitTab - styles when mouse hover on tab buttons + * .dijitTabActive .dijitTab - styles when mouse down on tab buttons + * .dijitTabChecked .dijitTab - styles when on buttons of selected tab + * + * .dijitTabCloseButton - the close action buttons lie at the right top of each tab button on closable tabs + * .dijitTabCloseButtonHover - styles when mouse hover on close action button + * .dijitTabCloseButtonActive - styles when mouse down on close action button + * + * Tab Button: (checked status) + * + * Tab Content Container: + * .dijitTabContainerTop-dijitContentPane + * .dijitTabContainerBottom-dijitContentPane + * .dijitTabContainerLeft-dijitContentPane + * .dijitTabContainerRight-dijitContentPane - for background and padding + * + * Nested Tabs: + * .dijitTabContainerNested - Container for nested tabs + * .dijitTabContainerTabListNested - tab list container for nested tabs + */ + +@import "../variables"; + +.unselected-tab-gradient (@direction) { + // white line, dark line, then fade from light to dark + .alpha-white-gradient (@direction, 1,0px, 1,1px, 0.1,2px, 0.6,7px, 0,100%); +} +.topBottom-selected-tab-gradient (@direction) { + .alpha-white-gradient (@direction, 1,0px, 1,1px, 0,2px, 1,7px); // white line, blue line, remainder white +} +/*** some common features ***/ +.claro .dijitTabPaneWrapper { + background:@pane-background-color; +} +.claro .dijitTabPaneWrapper, +.claro .dijitTabContainerTop-tabs, +.claro .dijitTabContainerBottom-tabs, +.claro .dijitTabContainerLeft-tabs, +.claro .dijitTabContainerRight-tabs { + /* todo: add common class name for this div */ + border-color: @border-color; +} +.claro .dijitTabCloseButton { + background: url("../@{image-layout-tab-close}") no-repeat; + width: 14px; + height: 14px; + margin-left: 5px; + margin-right:-5px; +} +.claro .dijitTabCloseButtonHover { + background-position:-14px; +} +.claro .dijitTabCloseButtonActive { + background-position:-28px; +} +.claro .dijitTabSpacer { + /* set the spacer invisible. note that height:0 doesn't work on IE/quirks, it's still 10px. */ + display: none; +} +.claro .dijitTab { + border: 1px solid @border-color; + background-color:@unselected-background-color; + .transition-property(background-color, border); + .transition-duration(.35s); + color:@unselected-text-color; +} +.claro .dijitTabHover { + border-color: @hovered-border-color; + background-color:@hovered-background-color; + .transition-duration(.25s); + color:@hovered-text-color; +} +.claro .dijitTabActive { + border-color: @pressed-border-color; + background-color:@pressed-background-color; + color:@selected-text-color; + .transition-duration(.1s); +} +.claro .dijitTabChecked { + // selected tab + border-color: @border-color; // don't use @selected-border-color because need to match border of TabContainer + background-color: @selected-background-color; + color: @selected-text-color; +} +.claro .dijitTabDisabled { + background-color: @tab-disabled-background-color; +} + +.claro .tabStripButton { + background-color: transparent; + border: none; +} +/*** end common ***/ + + +/*************** top tab ***************/ +.claro .dijitTabContainerTop-tabs .dijitTab { + /* unselected (and not hovered/pressed) tab */ + top: 1px; /* used for overlap */ + margin-right: 1px; + padding:3px 6px; + border-bottom-width: 0; + min-width: 60px; + text-align: center; + + // gradient (CSS gradient, with backup image for IE6-9) + background-image: url("images/tabTopUnselected.png"); + background-repeat: repeat-x; + .unselected-tab-gradient(top); + + .box-shadow(0 -1px 1px rgba(0, 0, 0, 0.04)); +} + +.claro .dijitTabContainerTop-tabs .dijitTabChecked { + /* selected tab */ + padding-bottom: 4px; + padding-top: 9px; + + // gradient (CSS gradient, with backup image for IE6-9) + background-image: url("images/tabTopSelected.png"); + .topBottom-selected-tab-gradient (top); + + .box-shadow(0 -1px 2px rgba(0, 0, 0, 0.05)); +} + +/** end top tab **/ + + +/*************** bottom tab ***************/ +.claro .dijitTabContainerBottom-tabs .dijitTab { + /* unselected (and not hovered/pressed) tab */ + top: -1px; /* used for overlap */ + margin-right: 1px; + padding:3px 6px; + border-top-width: 0; + min-width: 60px; + text-align: center; + + // gradient (CSS gradient, with backup image for IE6-9) + background-image: url("images/tabBottomUnselected.png"); + background-repeat: repeat-x; + background-position: bottom; + .unselected-tab-gradient(bottom); + + .box-shadow(0 1px 1px rgba(0, 0, 0, 0.04)); +} + +/* selected tab */ +.claro .dijitTabContainerBottom-tabs .dijitTabChecked { + padding-bottom: 9px; + padding-top: 4px; + + // gradient (CSS gradient, with backup image for IE6-9) + background-image: url("images/tabBottomSelected.png"); + .topBottom-selected-tab-gradient (bottom); + + .box-shadow(0 1px 2px rgba(0, 0, 0, 0.05)); +} +/** end bottom tab **/ + +/*************** left tab ***************/ +.claro .dijitTabContainerLeft-tabs .dijitTab { + /* unselected (and not hovered/pressed) tab */ + left: 1px; /* used for overlap */ + margin-bottom: 1px; + padding:3px 8px 4px 4px; + + // gradient (CSS gradient, with backup image for IE6-9) + background-image: url("images/tabLeftUnselected.png"); + background-repeat: repeat-y; + .unselected-tab-gradient(left); +} + +/* selected tab */ +.claro .dijitTabContainerLeft-tabs .dijitTabChecked { + border-right-width: 0; + padding-right: 9px; + + // gradient (CSS gradient, with backup image for IE6-9) + background-image: url("images/tabLeftSelected.png"); + .alpha-white-gradient (left, 0.5,0px, 1,30px); // 1/2 inch blue gradient, remainder white + + .box-shadow(-1px 0 2px rgba(0, 0, 0, .05)); +} +/** end left tab **/ + +/*************** right tab ***************/ +.claro .dijitTabContainerRight-tabs .dijitTab { + /* unselected (and not hovered/pressed) tab */ + left: -1px; /* used for overlap */ + margin-bottom: 1px; + padding:3px 8px 4px 4px; + + // gradient (CSS gradient, with backup image for IE6-9) + background-image: url("images/tabRightUnselected.png"); + background-repeat: repeat-y; + background-position: right; + .unselected-tab-gradient(right); +} +.claro .dijitTabContainerRight-tabs .dijitTabChecked { + /* selected tab */ + padding-left: 5px; + border-left-width: 0; + + // gradient (CSS gradient, with backup image for IE6-9) + background-image: url("images/tabRightSelected.png"); + .alpha-white-gradient (right, 0.5,0px, 1,30px); // 1/2 inch blue gradient, remainder white + + .box-shadow(1px 0 2px rgba(0, 0, 0, 0.07)); +} +/** end right tab **/ + +/** round corner **/ +.claro .dijitTabContainerTop-tabs .dijitTab { + .border-radius(2px 2px 0 0); +} +.claro .dijitTabContainerBottom-tabs .dijitTab { + .border-radius(0 0 2px 2px); +} +.claro .dijitTabContainerLeft-tabs .dijitTab { + .border-radius(2px 0 0 2px); +} + +.claro .dijitTabContainerRight-tabs .dijitTab { + .border-radius(0 2px 2px 0); +} + +/************ left/right scroll buttons + menu button ************/ +.claro .tabStripButton { + background-color:@button-background-color; + border: 1px solid @border-color; +} +.claro .dijitTabListContainer-top .tabStripButton { + padding: 4px 3px; + margin-top:7px; + .alpha-white-gradient (top, 1,0px, 0.1,1px, 0.6,6px, 0,100%); // to match unselected tab, but had to tweak numbers +} +.claro .dijitTabListContainer-bottom .tabStripButton { + padding:4px 3px; + margin-bottom:7px; + .alpha-white-gradient (bottom, 1,0px, 0.1,1px, 0.6,6px, 0,100%); // to match unselected tab, but had to tweak numbers +} +.claro .tabStripButtonHover { + background-color:@hovered-background-color; +} +.claro .tabStripButtonActive { + background-color:@pressed-background-color; +} +.claro .dijitTabStripIcon { + height:15px; + width:15px; + margin: 0 auto; + background:url("../@{image-form-button-arrows}") no-repeat -75px 50%; + background-color: transparent; +} +.claro .dijitTabStripSlideRightIcon{ + background-position: -24px 50%; +} +.claro .dijitTabStripMenuIcon { + background-position: -51px 50%; +} + +/*disabled styles for tab strip buttons*/ +.claro .dijitTabListContainer-top .tabStripButtonDisabled, +.claro .dijitTabListContainer-bottom .tabStripButtonDisabled { + background-color:@tab-disabled-background-color; + border:1px solid @border-color; /* to match border of TabContainer itself */ +} +.claro .tabStripButtonDisabled .dijitTabStripSlideLeftIcon { + background-position:-175px 50%; +} +.claro .tabStripButtonDisabled .dijitTabStripSlideRightIcon { + background-position: -124px 50%; +} +.claro .tabStripButtonDisabled .dijitTabStripMenuIcon { + background-position: -151px 50%; +} +/* Nested Tabs */ +.claro .dijitTabContainerNested .dijitTabListWrapper { + height: auto; +} +.claro .dijitTabContainerNested .dijitTabContainerTop-tabs { + border-bottom:solid 1px @border-color; + padding:2px 2px 4px; +} +.claro .dijitTabContainerTabListNested .dijitTab { + background:rgba(255, 255, 255, 0) none repeat scroll 0 0; + border: none; + padding: 4px; + border-color: rgba(118,157,192,0); + .transition-property(background-color, border-color); + .transition-duration(.3s); + .border-radius(2px); +} +.claro .dijitTabContainerTabListNested .dijitTab { + background: none; + border: none; + top: 0;/* to override top: 1px/-1px for normal tabs */ + .box-shadow(none); +} +.claro .dijitTabContainerTabListNested .dijitTabHover { + background-color: @nestedtab-hovered-background-color; + border:solid 1px @nestedtab-hovered-border-color; + padding: 3px; // 4px above padding - 1px compensation for border + .transition-duration(.2s); +} +.claro .dijitTabContainerTabListNested .dijitTabHover .tabLabel { + text-decoration: none; +} +.claro .dijitTabContainerTabListNested .dijitTabActive { + border:solid 1px @nestedtab-selected-border-color; + padding: 3px; + + // CSS gradient with fallback to image for IE + // this is in a weird place, only for active state; mailed Jason about it + background: @nestedtab-selected-background-color url("images/tabNested.png") repeat-x; + .alpha-white-gradient (0.61,0%, 0,17%, 0,83%, 0.61,100%); + + .transition-duration(.1s); +} +.claro .dijitTabContainerTabListNested .dijitTabChecked { + padding: 3px; + border:solid 1px @selected-border-color; + background-color:@selected-background-color; +} +.claro .dijitTabContainerTabListNested .dijitTabChecked .tabLabel { + text-decoration: none; + background-image:none; +} +.claro .dijitTabPaneWrapperNested { + border: none;/* prevent double border */ +} + +.claro .dijitTab, +.claro .tabStripButton { + // IE6 can't handle background-image and background-color on same node + _background-image: none !important; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer_rtl.css new file mode 100644 index 0000000000..130dc13c8e --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer_rtl.css @@ -0,0 +1,5 @@ +.claro .dijitTabContainerTop-tabs .dijitTabRtl, +.claro .dijitTabContainerBottom-tabs .dijitTabRtl { + margin-right: 0; + margin-left: 1px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer_rtl.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer_rtl.less new file mode 100644 index 0000000000..c6cec49fdf --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/TabContainer_rtl.less @@ -0,0 +1,7 @@ +@import "../variables"; + +.claro .dijitTabContainerTop-tabs .dijitTabRtl, +.claro .dijitTabContainerBottom-tabs .dijitTabRtl { + margin-right: 0; + margin-left: 1px; +} diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomSelected.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomSelected.png new file mode 100644 index 0000000000..f92b05f451 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomSelected.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomSelected.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomSelected.svg new file mode 100644 index 0000000000..4e6ff6d430 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomSelected.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomUnselected.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomUnselected.png new file mode 100644 index 0000000000..7815d9cfb6 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomUnselected.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomUnselected.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomUnselected.svg new file mode 100644 index 0000000000..4193238e80 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabBottomUnselected.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabClose.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabClose.png new file mode 100644 index 0000000000..f3b2363938 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabClose.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftSelected.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftSelected.png new file mode 100644 index 0000000000..9700afb378 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftSelected.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftSelected.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftSelected.svg new file mode 100644 index 0000000000..12e7d8a64d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftSelected.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftUnselected.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftUnselected.png new file mode 100644 index 0000000000..412390e08e Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftUnselected.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftUnselected.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftUnselected.svg new file mode 100644 index 0000000000..e31c211b71 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabLeftUnselected.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabNested.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabNested.png new file mode 100644 index 0000000000..0140cf45b4 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabNested.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightSelected.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightSelected.png new file mode 100644 index 0000000000..1a28434993 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightSelected.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightSelected.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightSelected.svg new file mode 100644 index 0000000000..d8d3d674a3 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightSelected.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightUnselected.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightUnselected.png new file mode 100644 index 0000000000..2bdd00e4d9 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightUnselected.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightUnselected.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightUnselected.svg new file mode 100644 index 0000000000..d1379a7179 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabRightUnselected.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopSelected.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopSelected.png new file mode 100644 index 0000000000..f4d5772581 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopSelected.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopSelected.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopSelected.svg new file mode 100644 index 0000000000..d06e646ea1 --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopSelected.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopUnselected.png b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopUnselected.png new file mode 100644 index 0000000000..8c34545f52 Binary files /dev/null and b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopUnselected.png differ diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopUnselected.svg b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopUnselected.svg new file mode 100644 index 0000000000..c55e92532d --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/layout/images/tabTopUnselected.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/variables.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/variables.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/variables.less b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/variables.less new file mode 100644 index 0000000000..bab59f530f --- /dev/null +++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/claro/variables.less @@ -0,0 +1,384 @@ +// General + +@primary-color: #cfe5fa; // Base color for entire theme +@secondary-color: #efefef; // Base color for bar-backgrounds +@text-color: #000; // Text color for enabled widgets +@disabled-color: #d3d3d3; // Base for disabled backgrounds and borders +@error-color: #d46464; + +@container-background-color:#fff; // Backgrounds for various content areas such as TitlePane, ContentPane and Inputs (if changed, adjust selected tab to match) + +@minor-selected-color: spin(saturate(darken(@primary-color, 6), 19), 0); // Color for various arrows and buttons +@base-border-color: spin(desaturate(darken(@primary-color, 29), 44), -1); // Augmented and used directly by variables to create border colors for various widgets +@unfocused-clickable-color: spin(saturate(lighten(@primary-color, 5), 10), 0); // Background color for enabled buttons, text inputs +@border-color: spin(desaturate(darken(@primary-color, 15), 67), 8); // Border color for (enabled, unhovered) TextBox, Slider, Accordion, BorderContainer, TabContainer +@minor-border-color: @disabled-color; // Color of borders inside widgets: horizontal line in Calendar between weeks, around color swatches in ColorPalette, above Dialog action bar +@popup-border-color: @base-border-color; // Border for Dialog, Menu, Tooltip. Must also update tooltip.png (the arrow image file) to match + + +@disabled-border-color: @disabled-color; // Border color for disabled/readonly Button, TextBox etc. widgets +@disabled-background-color: @secondary-color; // Disabled button, textbox, etc. +@disabled-text-color: darken(@secondary-color, 43); // Text color for disabled/readonly widgets + +@unselected-background-color: @secondary-color; // Background color for unselected/unopened tab button, accordion pane, TitlePane, Menu items +@unselected-text-color: darken(@secondary-color, 65); // Text color for unselected/unopened tab button, accordion pane, TitlePane, Menu items + +@hovered-border-color: @base-border-color; // Hover of textbox, tab label, BorderContainer splitter, Calendar, etc. +@hovered-background-color: @minor-selected-color; // Background color for hover of Button, MenuBar, Accordion pane, Calendar... anything that has a (non-white) color to start with and gets darker on hover +@hovered-text-color: @text-color; // Used for title of select Accordion pane, label of select tab, hovered Menu item, etc. + +@pressed-border-color: @base-border-color; // During click on Calendar day, Slider up/down buttons, tab button, etc. +@pressed-background-color: spin(saturate(darken(@primary-color, 16), 12), 0); // Background color while clicking on Accordion/TitlePane title bar, tab button, Calendar day, Toolbar button, Tree row. + +@selected-border-color: @base-border-color; // Selected AccordionPane, tab of nested TabContainer (but plain TabContainer is special) +@selected-background-color: @primary-color; // Selected Accordion pane, nested tab label, Tree row +@selected-text-color: @text-color; // title of selected Accordion pane, label of selected tab, hovered Menu item, etc. + +@bar-background-color: @secondary-color; // MenuBar, Toolbar, action bar at bottom of dialog +@pane-background-color: @container-background-color; // Background color of Accordion panes, Dialogs, etc. +@popup-background-color: @container-background-color; // Background for Dialog. TODO: currently use for ColorPalette, maybe should change. + + + +// Buttons +@button-border-color: @base-border-color; // Border for (stand-alone) buttons in normal, hovered, or active state +@button-background-color: @unfocused-clickable-color; // Background color for (unhovered) buttons +@button-hovered-background-color: @minor-selected-color; // Background color for hovered buttons +@button-pressed-background-color: @minor-selected-color; // Background color for active buttons +@button-border-radius: 4px; // Rounded corner radius for buttons (except in toolbar) + +// Input widgets +@focused-border-color: @base-border-color; // Focused textbox, editor, select, etc. +@error-border-color: @error-color; // Border for textbox in error state +@error-focused-border-color: darken(@error-color, 5); // Border of textbox in error state, and focused +@erroricon-background-color: @error-color; // Background color for exclamation point validation icon (for TextBox in error state) +@textbox-background-color: @container-background-color; // Default background color of TextBox based widgets +@textbox-hovered-background-color: @unfocused-clickable-color; // Background color when hovering a unfocused TextBox, Select, Editor, or other input widget +@textbox-focused-background-color: @textbox-background-color; +@textbox-error-background-color: @textbox-background-color; +@textbox-disabled-background-color: @disabled-background-color; + +@textbox-padding: 2px; // Padding for Textbox, Textarea, etc. + +// CheckBox, RadioButton +@focus-outline-color: darken(@secondary-color, 65); // Color for artificial focus outline around labels of checkboxes + +// TabContainer +@nestedtab-hovered-background-color: @unfocused-clickable-color; +@nestedtab-hovered-border-color: @primary-color; +@nestedtab-selected-border-color: @selected-border-color; +@nestedtab-selected-background-color: @minor-selected-color; +@tab-disabled-background-color: @disabled-color; // For disabled tabs of a TabContainer (not officially supported) + +// Arrow buttons (stand alone, or inside ComboBox / ComboButton / Spinner / etc. +@arrowbutton-background-color: @secondary-color; +@arrowbutton-hovered-background-color: @minor-selected-color; // Color of arrow when hovering ComboBox. But hovering Spinner doesn't change arrow color (TODO) +@arrowbutton-pressed-background-color: @minor-selected-color; +@arrowbutton-inner-border-color: @container-background-color; // Typically the arrows have an inner white border (a.k.a. padding) and then an outer black-ish border + +// Slider +// Note: any changes here require corresponding changes in form/images/sliderThumbs.png +@slider-fullbar-background-color: @primary-color; // Background color for part of slider bar before (to the left or below) the handle +@slider-remainingbar-background-color: @container-background-color; // Background color for part of slider bar after (to the right or above) the handle +@slider-hovered-fullbar-background-color: @minor-selected-color; // Background color for part of bar of hovered slider before (to the left or below) the handle +@slider-hovered-remainingbar-background-color: @container-background-color; // Background color for part of bar of hovered slider after (to the right or above) the handle +@slider-hoveredButton-background-color: @container-background-color; // Background color of slider increment/decrement buttons when mouse is over slider but not over the buttons +@slider-focused-fullbar-background-color: @minor-selected-color; // Background color for part of bar of focused slider before (to the left or below) the handle +@slider-focused-remainingbar-background-color: @container-background-color; // Background color for part of bar of focused slider after (to the right or above) the handle +@slider-button-hovered-background-color: @primary-color; // Background color of slider increment/decrement buttons when mouse is over the buttons +@slider-button-pressed-background-color: @minor-selected-color; // Background color of slider increment/decrement buttons while button is depressed + +// Select, ComboBox +@select-dropdownitem-background-color: @container-background-color; // Background color for items in the drop down list of a ComboBox/Select +@select-dropdownitem-hovered-background-color: @pressed-background-color; // Background color for the hovered item in the drop down list of a ComboBox/Select +@select-matchedtext-background-color: @minor-selected-color; // Background color of text in ComboBox drop down that matches typed in phrase + +// Menus +@menu-background-color: @popup-background-color; + +// Calendar +@calendar-background-color: @primary-color; +@calendar-currentmonth-background-color: @container-background-color; // Background color for days of the current month +@calendar-adjacentmonth-background-color: @unfocused-clickable-color; // Background color used for days from previous or next month +@calendar-adjacentmonth-text-color: @base-border-color; // Text color used for days from previous or next month +@calendar-date-pressed-border-color: @container-background-color; // For some reason pressing a day of the month (as opposed to hovering it) makes the border go away, is this intentional? +@calendar-date-pressed-background-color: @pressed-background-color; +@calendar-date-selected-border-color: @selected-border-color; +@calendar-date-selected-background-color: @minor-selected-color; +@calendar-button-hovered-background-color: @unfocused-clickable-color; // for hover or next/previous year, and month drop down (TODO: border and background are built in to calendarArrows.png, can't control from here) +@calendar-button-hovered-border-color: @container-background-color; // for hover or next/previous year, and month drop down +@calendar-button-pressed-background-color: @pressed-background-color; +@calendar-button-pressed-border-color: @pressed-border-color; + + +// ProgressBar +@progressbar-border-color: @popup-border-color; // Border color of progress bar +@progressbar-full-background-color:@minor-selected-color; // Background color for part of progress bar indicating amount completed +@progressbar-empty-background-color: @container-background-color; // Background color for part of progress bar indicating amount remaining +@progressbar-text-color: @text-color; // Color of progress bar text (ex: "35%"). Must contrast with both empty and full background colors. + +// TimePicker +@timepicker-minorvalue-background-color: @secondary-color; // For 3:15, 3:30, 3:45 but not 3:00 or 4:00 +@timepicker-minorvalue-text-color: darken(@secondary-color, 43); +@timepicker-majorvalue-background-color: @unfocused-clickable-color; // For 3:00, 4:00, 5:00, etc. +@timepicker-value-hovered-background-color: @pressed-background-color; +@timepicker-value-hovered-text-color: @hovered-text-color; +@timepicker-arrow-hovered-background-color: @minor-selected-color; + +// ColorPalette +@colorpalette-background-color: @container-background-color; +@swatch-border-color: @minor-border-color; +@swatch-hovered-border-color: #000; +@swatch-selected-border-color: #000; + +// Dialog +@dialog-underlay-color: @container-background-color; // the thing that grays out the screen when a dialog is shown +@dialog-titlebar-border-color: @container-background-color; // Inner border around the title sectionof a Dialog, inside the main border of the Dialog and the border between title and content +@dialog-titlebar-background-color: @minor-selected-color; + +// Tooltip +@tooltip-gradient-color: fade(@primary-color,10%); // a little swath of color at the bottom of tooltips + +// BorderContainer +@splitter-hovered-background-color: @primary-color; // Color of splitter when user hovers it, before mouse down +@splitter-dragged-background-color: @minor-selected-color; // Color of splitter while it's being dragged + +// Toolbar +@toolbar-button-checked-background-color: @container-background-color; // a toggled-on button in the toolbar +@toolbar-combobutton-hovered-unhoveredsection-background-color: spin(saturate(lighten(@primary-color, 8), 19), -29); // when user hovers a ComboButton in a Toolbar, the other half of the button turns this color +@toolbar-button-border-radius: 2px; // Rounded corner radius for buttons for buttons in toolbar + +// DnD +@dnd-avatar-background-color: @container-background-color; // Background color of little Dialog-type box indicating dragged items +@dnd-avatar-header-background-color: #f58383; // Title bar for dragged items +@dnd-avatar-candrop-header-background-color: #97e68d;// Title bar for dragged items when they can be dropped +@dnd-dropseparator-color: @base-border-color; // Color of line indicating that user is about to drop between items A & B + +// Document level +@document-text-color: #131313; // Text color for document itself (text outside of widgets) +@document-shadedsection-background-color: @bar-background-color;// background color used for
, , and table header rows
+@document-border-color: @disabled-color;								// Border for 
, , tables, etc.
+
+// Icons, arrows, etc.
+@image-arrow-sprite: "images/spriteArrows.png";
+@image-calendar-arrows: "images/calendarArrows.png";
+@image-calendar-arrows-ie6: "images/calendarArrows8bit.png";
+@image-checkmark: "images/checkmarkNoBorder.png";
+@image-checkmark-ie6: "images/checkmarkNoBorder.gif";
+@image-dialog-close: "images/dialogCloseIcon.png";
+@image-dialog-close-ie6: "images/dialogCloseIcon8bit.png";
+@image-dnd: "images/dnd.png";
+@image-editor-icons-enabled: "../../icons/images/editorIconsEnabled.png";
+@image-form-button-arrows: "form/images/buttonArrows.png";
+@image-form-checkbox-and-radios: "form/images/checkboxRadioButtonStates.png";
+@image-form-checkbox-and-radios-ie6: "form/images/checkboxAndRadioButtons_IE6.png";
+@image-form-common-arrows: "form/images/commonFormArrows.png";
+@image-form-error: "form/images/error.png";
+@image-form-slider-thumbs: "form/images/sliderThumbs.png";
+@image-layout-tab-close: "layout/images/tabClose.png";	// [x] icon to close a tab
+@image-loading-animation: "images/loadingAnimation.gif";
+@image-tooltip: "images/tooltip.png";	// arrow connectors
+@image-tooltip-ie6: "images/tooltip8bit.png";	// arrow connectors (8 bit)
+@image-tree-expand: "images/treeExpandImages.png";
+@image-tree-expand-ie6: "images/treeExpandImages8bit.png";
+@image-progressbar-anim: "images/progressBarAnim.gif";
+
+// Mixins
+
+.border-radius (@radius) {
+	-moz-border-radius: @radius;
+	border-radius: @radius;
+}
+
+.box-shadow (@value) {
+	-webkit-box-shadow: @value;
+	-moz-box-shadow: @value;
+	box-shadow: @value;
+}
+
+.transition-property (@value) {
+	-webkit-transition-property: @value;
+	-moz-transition-property: @value;
+	transition-property: @value;
+}
+
+.transition-property (@value1, @value2) {
+	-webkit-transition-property: @value1, @value2;
+	-moz-transition-property: @value1, @value2;
+	transition-property: @value1, @value2;
+}
+
+.transition-duration (@value) {
+	-webkit-transition-duration: @value;
+	-moz-transition-duration: @value;
+	transition-duration: @value;
+}
+
+.transition-duration (@value1, @value2) {
+	-webkit-transition-duration: @value1, @value2;
+	-moz-transition-duration: @value1, @value2;
+	transition-duration: @value1, @value2;
+}
+
+.transition-timing-function (@value) {
+	-webkit-transition-timing-function: @value;
+	-moz-transition-timing-function: @value;
+	transition-timing-function: @value;
+}
+
+.linear-gradient (@value1, @value2) {
+	// summary:
+	//		Expands to browser specific background-image specifications for a linear-gradient (2 stops)
+ 	background-image: -moz-linear-gradient(@value1, @value2); // FF3.6+
+ 	background-image: -webkit-linear-gradient(@value1, @value2); // Chrome10+, Safari5.1+
+ 	background-image: -o-linear-gradient(@value1, @value2); // Opera 11.10+
+ 	background-image: -ms-linear-gradient(@value1, @value2); // IE10+
+ 	// background-image: linear-gradient(@value1, @value2); // W3C (uncomment when standard is approved)
+}
+.linear-gradient (@value1, @value2, @value3) {
+ 	background-image: -moz-linear-gradient(@value1, @value2, @value3); // FF3.6+
+ 	background-image: -webkit-linear-gradient(@value1, @value2, @value3); // Chrome10+, Safari5.1+
+ 	background-image: -o-linear-gradient(@value1, @value2, @value3); // Opera 11.10+
+ 	background-image: -ms-linear-gradient(@value1, @value2, @value3); // IE10+
+ 	// background-image: linear-gradient(@value1, @value2, @value3); // W3C (uncomment when standard is approved)
+}
+.linear-gradient (@value1, @value2, @value3, @value4) {
+ 	background-image: -moz-linear-gradient(@value1, @value2, @value3, @value4); // FF3.6+
+ 	background-image: -webkit-linear-gradient(@value1, @value2, @value3, @value4); // Chrome10+, Safari5.1+
+ 	background-image: -o-linear-gradient(@value1, @value2, @value3, @value4); // Opera 11.10+
+ 	background-image: -ms-linear-gradient(@value1, @value2, @value3, @value4); // IE10+
+ 	// background-image: linear-gradient(@value1, @value2, @value3, @value4); // W3C (uncomment when standard is approved)
+}
+.linear-gradient (@value1, @value2, @value3, @value4, @value5) {
+ 	background-image: -moz-linear-gradient(@value1, @value2, @value3, @value4, @value5); // FF3.6+
+ 	background-image: -webkit-linear-gradient(@value1, @value2, @value3, @value4, @value5); // Chrome10+, Safari5.1+
+ 	background-image: -o-linear-gradient(@value1, @value2, @value3, @value4, @value5); // Opera 11.10+
+ 	background-image: -ms-linear-gradient(@value1, @value2, @value3, @value4, @value5); // IE10+
+ 	// background-image: linear-gradient(@value1, @value2, @value3, @value4, @value5); // W3C (uncomment when standard is approved)
+}
+.linear-gradient (@value1, @value2, @value3, @value4, @value5, @value6) {
+ 	background-image: -moz-linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6); // FF3.6+
+ 	background-image: -webkit-linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6); // Chrome10+, Safari5.1+
+ 	background-image: -o-linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6); // Opera 11.10+
+ 	background-image: -ms-linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6); // IE10+
+ 	// background-image: linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6); // W3C (uncomment when standard is approved)
+}
+.linear-gradient (@value1, @value2, @value3, @value4, @value5, @value6, @value7) {
+ 	background-image: -moz-linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6, @value7); // FF3.6+
+ 	background-image: -webkit-linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6, @value7); // Chrome10+, Safari5.1+
+ 	background-image: -o-linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6, @value7); // Opera 11.10+
+ 	background-image: -ms-linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6, @value7); // IE10+
+ 	// background-image: linear-gradient(@value1, @value2, @value3, @value4, @value5, @value6, @value7); // W3C (uncomment when standard is approved)
+}
+
+.alpha-white-gradient (@opacity1, @stop1, @opacity2, @stop2) {
+	// summary:
+	//		For setting up white background-image with variable transparency.
+	// example:
+	//		Gradient starts at top (0%) with 30% opacity, and then ends at bottom (100%) with full transparency
+	//		|	.alpha-white-gradient(0.3, 0%, 0, 100%)
+	//
+	.linear-gradient(rgba(255,255,255,@opacity1) @stop1, rgba(255,255,255,@opacity2) @stop2);
+}
+.alpha-white-gradient (@start, @opacity1, @stop1, @opacity2, @stop2) {
+	.linear-gradient(@start, rgba(255,255,255,@opacity1) @stop1, rgba(255,255,255,@opacity2) @stop2);
+}
+.alpha-white-gradient (@opacity1, @stop1, @opacity2, @stop2, @opacity3, @stop3) {
+	.linear-gradient(rgba(255,255,255,@opacity1) @stop1, rgba(255,255,255,@opacity2) @stop2, rgba(255,255,255, @opacity3) @stop3);
+}
+.alpha-white-gradient (@start, @opacity1, @stop1, @opacity2, @stop2, @opacity3, @stop3) {
+	.linear-gradient(@start, rgba(255,255,255,@opacity1) @stop1, rgba(255,255,255,@opacity2) @stop2, rgba(255,255,255, @opacity3) @stop3);
+}
+.alpha-white-gradient (@opacity1, @stop1, @opacity2, @stop2, @opacity3, @stop3, @opacity4, @stop4) {
+	.linear-gradient(rgba(255,255,255,@opacity1) @stop1, rgba(255,255,255,@opacity2) @stop2, rgba(255,255,255, @opacity3) @stop3, rgba(255,255,255, @opacity4) @stop4);
+}
+.alpha-white-gradient (@start, @opacity1, @stop1, @opacity2, @stop2, @opacity3, @stop3, @opacity4, @stop4) {
+	.linear-gradient(@start, rgba(255,255,255,@opacity1) @stop1, rgba(255,255,255,@opacity2) @stop2, rgba(255,255,255, @opacity3) @stop3, rgba(255,255,255, @opacity4) @stop4);
+}
+.alpha-white-gradient (@start, @opacity1, @stop1, @opacity2, @stop2, @opacity3, @stop3, @opacity4, @stop4, @opacity5, @stop5) {
+	.linear-gradient(@start, rgba(255,255,255,@opacity1) @stop1, rgba(255,255,255,@opacity2) @stop2, rgba(255,255,255, @opacity3) @stop3, rgba(255,255,255, @opacity4) @stop4, rgba(255,255,255, @opacity5) @stop5);
+}
+.alpha-white-gradient (@start, @opacity1, @stop1, @opacity2, @stop2, @opacity3, @stop3, @opacity4, @stop4, @opacity5, @stop5, @opacity6, @stop6) {
+	.linear-gradient(@start, rgba(255,255,255,@opacity1) @stop1, rgba(255,255,255,@opacity2) @stop2, rgba(255,255,255, @opacity3) @stop3, rgba(255,255,255, @opacity4) @stop4, rgba(255,255,255, @opacity5) @stop5, rgba(255,255,255, @opacity6) @stop6);
+}
+
+.gradient-and-filter (@color, @fade1, @fade2) {
+	// summary:
+	//		Sets up a background color with a vertical gradient.
+	//		In order to make transitions work properly on mozilla and webkit, this is done by combining
+	//		a background-color which will be changed based on state (ex: hover) with a constant
+	//		white alpha-transparency background-image.  On IE it creates a DXImageTransform filter.
+	// @color:
+	//		The color
+	// @fade1:
+	//		The percent to fade at the top
+	// @fade2:
+	//		The percent to fade at the bottom
+	background-color: @color; // the base color
+	.linear-gradient(fadeout(#fff, 100-@fade1), fadeout(#fff, 100-@fade2));
+	filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr="lighten(@color, @fade1)~", endColorstr="lighten(@color, @fade2)~")"; // IE
+}
+.horizontal-gradient-and-filter (@color, @fade1, @fade2) {
+	// summary:
+	//		Sets up a background color with a horizontal gradient.
+	//		In order to make transitions work properly on mozilla and webkit, this is done by combining
+	//		a background-color which will be changed based on state (ex: hover) with a constant
+	//		white alpha-transparency background-image.  On IE it creates a DXImageTransform filter.
+	// @color:
+	//		The color
+	// @fade1:
+	//		The percent to fade at the top
+	// @fade2:
+	//		The percent to fade at the bottom
+	background-color: @color; // the base color
+	.linear-gradient(left, fadeout(#fff, 100-@fade1), fadeout(#fff, 100-@fade2));
+	filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr="lighten(@color, @fade1)~", endColorstr="lighten(@color, @fade2)~"gradientType=1)"; // IE
+}
+
+
+// Mixins defining gradients
+
+.textbox-background-image () {
+	// summary:
+	//		Background image used for hovered TextBoxes and similar controls.
+	//		It's just a small inset shadow below the top border (inside of the TextBox).
+	.linear-gradient(rgba(127,127,127,0.2) 0%, rgba(127,127,127,0) 2px);
+}
+
+.standard-gradient (@pathToRoot: "") {
+	// summary:
+	//		Light to dark background-image used by widgets with short height (~16px) including:
+	//			- MenuBar, and hovered MenuItem/MenuBarItem
+	//			- arrow icon wrapper for Select, ComboBox, Spinner
+	//			- Toolbar and hovered Toolbar buttons
+	//			- TitlePane title bar, AccordionContainer title bar, Dialog title bar
+
+	// Fallback for IE
+	background-image: url("@{pathToRoot}images/standardGradient.png");
+	background-repeat: repeat-x;
+
+	// CSS gradient for other browsers
+	.alpha-white-gradient(0.7, 0%, 0, 100%);
+
+	// IE6 can't handle a background-image with transparency and a background-color; the color is blocked out
+	_background-image: none;
+}
+.active-gradient (@pathToRoot: "") {
+	// summary:
+	//		Light to dark background-image with an inset gray shadow at the top,
+	//		used by widgets when they are active (ie: mousedown) or selected, including:
+	//			- active MenuItem/MenuBarItem
+	//			- arrow icon wrapper for Select, ComboBox, Spinner when active or drop down is open
+	//			- active Toolbar buttons
+	//			- active TitlePane title bar, AccordionContainer title bar
+
+	// Fallback for IE
+	background-image: url("@{pathToRoot}images/activeGradient.png");
+	background-repeat: repeat-x;
+
+	// CSS gradient for other browsers
+	.linear-gradient(rgba(190,190,190,0.98) 0px, rgba(255, 255, 255, 0.65) 3px, rgba(255, 255, 255, 0) 100%);
+
+	// IE6 can't handle a background-image with transparency and a background-color; the color is blocked out
+	_background-image: none;
+}
diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/dijit.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/dijit.css
new file mode 100644
index 0000000000..4ca6f7ad24
--- /dev/null
+++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/dijit.css
@@ -0,0 +1 @@
+.dijitReset {margin:0; border:0; padding:0; line-height:normal; font: inherit; color: inherit;}.dj_a11y .dijitReset {-moz-appearance: none;}.dijitInline {display:inline-block; #zoom: 1; #display:inline; border:0; padding:0; vertical-align:middle; #vertical-align: auto;}table.dijitInline {display:inline-table; box-sizing: content-box; -moz-box-sizing: content-box;}.dijitHidden {display: none !important;}.dijitVisible {display: block !important; position: relative;}.dj_ie6 .dijitComboBox .dijitInputContainer,.dijitInputContainer {#zoom: 1; overflow: hidden; float: none !important; position: relative;}.dj_ie7 .dijitInputContainer {float: left !important; clear: left; display: inline-block !important;}.dj_ie .dijitSelect input,.dj_ie input.dijitTextBox,.dj_ie .dijitTextBox input {font-size: 100%;}.dijitSelect .dijitButtonText {float: left; vertical-align: top;}TABLE.dijitSelect {padding: 0 !important;}.dijitTextBox .dijitSpinnerButtonContainer,.dijitTextBox .dijitArrowButtonContainer,.dijitValidationTextBox .dijitValidationContainer {float: right; text-align: center;}.dijitSelect input.dijitInputField,.dijitTextBox input.dijitInputField {padding-left: 0 !important; padding-right: 0 !important;}.dijitValidationTextBox .dijitValidationContainer {display: none;}.dijitTeeny {font-size:1px; line-height:1px;}.dijitOffScreen {position: absolute !important; left: 50% !important; top: -10000px !important;}.dijitPopup {position: absolute; background-color: transparent; margin: 0; border: 0; padding: 0;}.dijitPositionOnly {padding: 0 !important; border: 0 !important; background-color: transparent !important; background-image: none !important; height: auto !important; width: auto !important;}.dijitNonPositionOnly {float: none !important; position: static !important; margin: 0 0 0 0 !important; vertical-align: middle !important;}.dijitBackgroundIframe {position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: -1; border: 0; padding: 0; margin: 0;}.dijitDisplayNone {display:none !important;}.dijitContainer {overflow: hidden;}.dj_a11y .dijitIcon,.dj_a11y div.dijitArrowButtonInner, .dj_a11y span.dijitArrowButtonInner,.dj_a11y img.dijitArrowButtonInner,.dj_a11y .dijitCalendarIncrementControl,.dj_a11y .dijitTreeExpando {display: none;}.dijitSpinner div.dijitArrowButtonInner {display: block;}.dj_a11y .dijitA11ySideArrow {display: inline !important; cursor: pointer;}.dj_a11y .dijitCalendarDateLabel {padding: 1px; border: 0px !important;}.dj_a11y .dijitCalendarSelectedDate .dijitCalendarDateLabel {border-style: solid !important; border-width: 1px !important; padding: 0;}.dj_a11y .dijitCalendarDateTemplate {padding-bottom: 0.1em !important; border: 0px !important;}.dj_a11y .dijitButtonNode {border: black outset medium !important; padding: 0 !important;}.dj_a11y .dijitArrowButton {padding: 0 !important;}.dj_a11y .dijitButtonContents {margin: 0.15em;}.dj_a11y .dijitTextBoxReadOnly .dijitInputField,.dj_a11y .dijitTextBoxReadOnly .dijitButtonNode {border-style: outset!important; border-width: medium!important; border-color: #999 !important; color:#999 !important;}.dijitButtonNode * {vertical-align: middle;}.dijitSelect .dijitArrowButtonInner,.dijitButtonNode .dijitArrowButtonInner {background: no-repeat center; width: 12px; height: 12px; direction: ltr;}.dijitLeft {background-position:left top; background-repeat:no-repeat;}.dijitStretch {white-space:nowrap; background-repeat:repeat-x;}.dijitRight {#display:inline; background-position:right top; background-repeat:no-repeat;}.dj_gecko .dj_a11y .dijitButtonDisabled .dijitButtonNode {opacity: 0.5;}.dijitToggleButton,.dijitButton,.dijitDropDownButton,.dijitComboButton {margin: 0.2em; vertical-align: middle;}.dijitButtonContents {display: block;}td.dijitButtonContents {display: table-cell;}.dijitButtonNode img {vertical-align:middle;}.dijitToolbar .dijitComboButton {border-collapse: separate;}.dijitToolbar .dijitToggleButton,.dijitToolbar .dijitButton,.dijitToolbar .dijitDropDownButton,.dijitToolbar .dijitComboButton {margin: 0;}.dijitToolbar .dijitButtonContents {padding: 1px 2px;}.dj_webkit .dijitToolbar .dijitDropDownButton {padding-left: 0.3em;}.dj_gecko .dijitToolbar .dijitButtonNode::-moz-focus-inner {padding:0;}.dijitSelect {border:1px solid gray;}.dijitButtonNode {border:1px solid gray; margin:0; line-height:normal; vertical-align: middle; #vertical-align: auto; text-align:center; white-space: nowrap;}.dj_webkit .dijitSpinner .dijitSpinnerButtonContainer {line-height:inherit;}.dijitTextBox .dijitButtonNode {border-width: 0;}.dijitSelect,.dijitSelect *,.dijitButtonNode,.dijitButtonNode * {cursor: pointer;}.dj_ie .dijitButtonNode {zoom: 1;}.dj_ie .dijitButtonNode button {overflow: visible;}div.dijitArrowButton {float: right;}.dijitTextBox {border: solid black 1px; #overflow: hidden; width: 15em; vertical-align: middle;}.dijitTextBoxReadOnly,.dijitTextBoxDisabled {color: gray;}.dj_webkit .dijitTextBoxDisabled input {color: #eee;}.dj_webkit textarea.dijitTextAreaDisabled {color: #333;}.dj_gecko .dijitTextBoxReadOnly input.dijitInputField, .dj_gecko .dijitTextBoxDisabled input {-moz-user-input: none;}.dijitPlaceHolder {color: #AAAAAA; font-style: italic; position: absolute; top: 0; left: 0; #filter: "";}.dijitTimeTextBox {width: 8em;}.dijitTextBox input:focus {outline: none;}.dijitTextBoxFocused {outline: 5px -webkit-focus-ring-color;}.dijitSelect input,.dijitTextBox input {float: left;}.dj_ie6 input.dijitTextBox,.dj_ie6 .dijitTextBox input {float: none;}.dijitInputInner {border:0 !important; background-color:transparent !important; width:100% !important; padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important;}.dj_a11y .dijitTextBox input {margin: 0 !important;}.dijitValidationTextBoxError input.dijitValidationInner,.dijitSelect input,.dijitTextBox input.dijitArrowButtonInner {text-indent: -2em !important; direction: ltr !important; text-align: left !important; height: auto !important; #text-indent: 0 !important; #letter-spacing: -5em !important; #text-align: right !important;}.dj_ie .dijitSelect input,.dj_ie .dijitTextBox input,.dj_ie input.dijitTextBox {overflow-y: visible; line-height: normal;}.dijitSelect .dijitSelectLabel span {line-height: 100%;}.dj_ie .dijitSelect .dijitSelectLabel {line-height: normal;}.dj_ie6 .dijitSelect .dijitSelectLabel,.dj_ie7 .dijitSelect .dijitSelectLabel,.dj_ie8 .dijitSelect .dijitSelectLabel,.dj_iequirks .dijitSelect .dijitSelectLabel,.dijitSelect td,.dj_ie6 .dijitSelect input,.dj_iequirks .dijitSelect input,.dj_ie6 .dijitSelect .dijitValidationContainer,.dj_ie6 .dijitTextBox input,.dj_ie6 input.dijitTextBox,.dj_iequirks .dijitTextBox input.dijitValidationInner,.dj_iequirks .dijitTextBox input.dijitArrowButtonInner,.dj_iequirks .dijitTextBox input.dijitSpinnerButtonInner,.dj_iequirks .dijitTextBox input.dijitInputInner,.dj_iequirks input.dijitTextBox {line-height: 100%;}.dj_a11y input.dijitValidationInner,.dj_a11y input.dijitArrowButtonInner {text-indent: 0 !important; width: 1em !important; #text-align: left !important; color: black !important;}.dijitValidationTextBoxError .dijitValidationContainer {display: inline; cursor: default;}.dijitSpinner .dijitSpinnerButtonContainer,.dijitComboBox .dijitArrowButtonContainer {border-width: 0 0 0 1px !important;}.dj_a11y .dijitSelect .dijitArrowButtonContainer,.dijitToolbar .dijitComboBox .dijitArrowButtonContainer {border-width: 0 !important;}.dijitComboBoxMenu {list-style-type: none;}.dijitSpinner .dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0;}.dj_ie .dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitButtonNode {clear: both;}.dj_ie .dijitToolbar .dijitComboBox {vertical-align: middle;}.dijitTextBox .dijitSpinnerButtonContainer {width: 1em; position: relative !important; overflow: hidden;}.dijitSpinner .dijitSpinnerButtonInner {width:1em; visibility:hidden !important; overflow-x:hidden;}.dijitComboBox .dijitButtonNode,.dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0;}.dj_a11y .dijitSpinnerButtonContainer .dijitButtonNode {border-width: 0px !important; border-style: solid !important;}.dj_a11y .dijitTextBox .dijitSpinnerButtonContainer,.dj_a11y .dijitSpinner .dijitArrowButtonInner,.dj_a11y .dijitSpinnerButtonContainer input {width: 1em !important;}.dj_a11y .dijitSpinner .dijitArrowButtonInner {margin: 0 auto !important;}.dj_ie .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {padding-left: 0.3em !important; padding-right: 0.3em !important; margin-left: 0.3em !important; margin-right: 0.3em !important; width: 1.4em !important;}.dj_ie7 .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {padding-left: 0 !important; padding-right: 0 !important; width: 1em !important;}.dj_ie6 .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {margin-left: 0.1em !important; margin-right: 0.1em !important; width: 1em !important;}.dj_iequirks .dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {margin-left: 0 !important; margin-right: 0 !important; width: 2em !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {padding: 0; position: absolute !important; right: 0; float: none; height: 50%; width: 100%; bottom: auto; left: 0; right: auto;}.dj_iequirks .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: auto;}.dj_a11y .dijitSpinnerButtonContainer .dijitArrowButton {overflow: visible !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitDownArrowButton {top: 50%; border-top-width: 1px !important;}.dijitSpinner .dijitSpinnerButtonContainer .dijitUpArrowButton {#bottom: 50%; top: 0;}.dijitSpinner .dijitArrowButtonInner {margin: auto; overflow-x: hidden; height: 100% !important;}.dj_iequirks .dijitSpinner .dijitArrowButtonInner {height: auto !important;}.dijitSpinner .dijitArrowButtonInner .dijitInputField {-moz-transform: scale(0.5); -moz-transform-origin: center top; -webkit-transform: scale(0.5); -webkit-transform-origin: center top; -o-transform: scale(0.5); -o-transform-origin: center top; transform: scale(0.5); transform-origin: left top; padding-top: 0; padding-bottom: 0; padding-left: 0 !important; padding-right: 0 !important; width: 100%; visibility: hidden;}.dj_ie .dijitSpinner .dijitArrowButtonInner .dijitInputField {zoom: 50%;}.dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButtonInner {overflow: hidden;}.dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: 100%;}.dj_iequirks .dj_a11y .dijitSpinner .dijitSpinnerButtonContainer .dijitArrowButton {width: 1em;}.dj_a11y .dijitSpinner .dijitArrowButtonInner .dijitInputField {vertical-align:top; visibility: visible;}.dj_a11y .dijitSpinnerButtonContainer {width: 1em;}.dijitCheckBox,.dijitRadio,.dijitCheckBoxInput {padding: 0; border: 0; width: 16px; height: 16px; background-position:center center; background-repeat:no-repeat; overflow: hidden;}.dijitCheckBox input,.dijitRadio input {margin: 0; padding: 0; display: block;}.dijitCheckBoxInput {opacity: 0.01;}.dj_ie .dijitCheckBoxInput {filter: alpha(opacity=0);}.dj_a11y .dijitCheckBox,.dj_a11y .dijitRadio {width: auto !important; height: auto !important;}.dj_a11y .dijitCheckBoxInput {opacity: 1; filter: none; width: auto; height: auto;}.dj_a11y .dijitFocusedLabel {border: 1px dotted; outline: 0px !important;}.dijitProgressBar {z-index: 0;}.dijitProgressBarEmpty {position:relative;overflow:hidden; border:1px solid black; z-index:0;}.dijitProgressBarFull {position:absolute; overflow:hidden; z-index:-1; top:0; width:100%;}.dj_ie6 .dijitProgressBarFull {height:1.6em;}.dijitProgressBarTile {position:absolute; overflow:hidden; top:0; left:0; bottom:0; right:0; margin:0; padding:0; width: 100%; height:auto; background-color:#aaa; background-attachment: fixed;}.dj_a11y .dijitProgressBarTile {border-width:2px; border-style:solid; background-color:transparent !important;}.dj_ie6 .dijitProgressBarTile {position:static; height:1.6em;}.dijitProgressBarIndeterminate .dijitProgressBarTile {}.dijitProgressBarIndeterminateHighContrastImage {display:none;}.dj_a11y .dijitProgressBarIndeterminate .dijitProgressBarIndeterminateHighContrastImage {display:block; position:absolute; top:0; bottom:0; margin:0; padding:0; width:100%; height:auto;}.dijitProgressBarLabel {display:block; position:static; width:100%; text-align:center; background-color:transparent !important;}.dijitTooltip {position: absolute; z-index: 2000; display: block; left: 0; top: -10000px; overflow: visible;}.dijitTooltipContainer {border: solid black 2px; background: #b8b5b5; color: black; font-size: small;}.dijitTooltipFocusNode {padding: 2px 2px 2px 2px;}.dijitTooltipConnector {position: absolute;}.dj_a11y .dijitTooltipConnector {display: none;}.dijitTooltipData {display:none;}.dijitLayoutContainer {position: relative; display: block; overflow: hidden;}.dijitAlignTop,.dijitAlignBottom,.dijitAlignLeft,.dijitAlignRight {position: absolute; overflow: hidden;}body .dijitAlignClient {position: absolute;}.dijitBorderContainer, .dijitBorderContainerNoGutter {position:relative; overflow: hidden; z-index: 0;}.dijitBorderContainerPane,.dijitBorderContainerNoGutterPane {position: absolute !important; z-index: 2;}.dijitBorderContainer > .dijitTextArea {resize: none;}.dijitGutter {position: absolute; font-size: 1px;}.dijitSplitter {position: absolute; overflow: hidden; z-index: 10; background-color: #fff; border-color: gray; border-style: solid; border-width: 0;}.dj_ie .dijitSplitter {z-index: 1;}.dijitSplitterActive {z-index: 11 !important;}.dijitSplitterCover {position:absolute; z-index:-1; top:0; left:0; width:100%; height:100%;}.dijitSplitterCoverActive {z-index:3 !important;}.dj_ie .dijitSplitterCover {background: white; filter: alpha(opacity=0);}.dijitSplitterH {height: 7px; border-top:1px; border-bottom:1px; cursor: row-resize;}.dijitSplitterV {width: 7px; border-left:1px; border-right:1px; cursor: col-resize;}.dijitSplitContainer {position: relative; overflow: hidden; display: block;}.dj_ff3 .dj_a11y div.dijitSplitter:focus {outline-style:dotted; outline-width: 2px;}.dijitSplitPane {position: absolute;}.dijitSplitContainerSizerH,.dijitSplitContainerSizerV {position:absolute; font-size: 1px; background-color: ThreeDFace; border: 1px solid; border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight; margin: 0;}.dijitSplitContainerSizerH .thumb, .dijitSplitterV .dijitSplitterThumb {overflow:hidden; position:absolute; top:49%;}.dijitSplitContainerSizerV .thumb, .dijitSplitterH .dijitSplitterThumb {position:absolute; left:49%;}.dijitSplitterShadow,.dijitSplitContainerVirtualSizerH,.dijitSplitContainerVirtualSizerV {font-size: 1px; background-color: ThreeDShadow; -moz-opacity: 0.5; opacity: 0.5; filter: Alpha(Opacity=50); margin: 0;}.dijitSplitContainerSizerH, .dijitSplitContainerVirtualSizerH {cursor: col-resize;}.dijitSplitContainerSizerV, .dijitSplitContainerVirtualSizerV {cursor: row-resize;}.dj_a11y .dijitSplitterH {border-top:1px solid #d3d3d3 !important; border-bottom:1px solid #d3d3d3 !important;}.dj_a11y .dijitSplitterV {border-left:1px solid #d3d3d3 !important; border-right:1px solid #d3d3d3 !important;}.dijitContentPane {display: block; overflow: auto;}.dijitContentPaneSingleChild {overflow: hidden;}.dijitContentPaneLoading .dijitIconLoading,.dijitContentPaneError .dijitIconError {margin-right: 9px;}.dijitTitlePane {display: block; overflow: hidden;}.dijitTitlePaneTitle {cursor: pointer;}.dijitFixedOpen, .dijitFixedClosed {cursor: default;}.dijitFixedOpen .dijitArrowNode, .dijitFixedOpen .dijitArrowNodeInner,.dijitFixedClosed .dijitArrowNode, .dijitFixedClosed .dijitArrowNodeInner{display: none;}.dijitTitlePaneTitle * {vertical-align: middle;}.dijitTitlePane .dijitArrowNodeInner {display: none;}.dj_a11y .dijitTitlePane .dijitArrowNodeInner {display:inline !important; font-family: monospace;}.dj_a11y .dijitTitlePane .dijitArrowNode {display:none;}.dj_ie6 .dijitTitlePaneContentOuter,.dj_ie6 .dijitTitlePane .dijitTitlePaneTitle {zoom: 1;}.dijitColorPalette {border: 1px solid #999; background: #fff; position: relative;}.dijitColorPalette .dijitPaletteTable {padding: 2px 3px 3px 3px; position: relative; overflow: hidden; outline: 0; border-collapse: separate;}.dj_ie6 .dijitColorPalette .dijitPaletteTable,.dj_ie7 .dijitColorPalette .dijitPaletteTable,.dj_iequirks .dijitColorPalette .dijitPaletteTable {padding: 0; margin: 2px 3px 3px 3px;}.dijitColorPalette .dijitPaletteCell {font-size: 1px; vertical-align: middle; text-align: center; background: none;}.dijitColorPalette .dijitPaletteImg {padding: 1px; border: 1px solid #999; margin: 2px 1px; cursor: default; font-size: 1px;}.dj_gecko .dijitColorPalette .dijitPaletteImg {padding-bottom: 0;}.dijitColorPalette .dijitColorPaletteSwatch {width: 14px; height: 12px;}.dijitPaletteTable td {padding: 0;}.dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg {border: 1px solid #000;}.dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg,.dijitColorPalette .dijitPaletteTable .dijitPaletteCellSelected .dijitPaletteImg {border: 2px solid #000; margin: 1px 0;}.dj_a11y .dijitColorPalette .dijitPaletteTable,.dj_a11y .dijitColorPalette .dijitPaletteTable * {background-color: transparent !important;}.dijitAccordionContainer {border:1px solid #b7b7b7; border-top:0 !important;}.dijitAccordionTitle {cursor: pointer;}.dijitAccordionTitleSelected {cursor: default;}.dijitAccordionTitle .arrowTextUp,.dijitAccordionTitle .arrowTextDown {display: none; font-size: 0.65em; font-weight: normal !important;}.dj_a11y .dijitAccordionTitle .arrowTextUp,.dj_a11y .dijitAccordionTitleSelected .arrowTextDown {display: inline;}.dj_a11y .dijitAccordionTitleSelected .arrowTextUp {display: none;}.dijitAccordionChildWrapper {overflow: hidden;}.dijitCalendarContainer {width: auto;}.dijitCalendarContainer th, .dijitCalendarContainer td {padding: 0; vertical-align: middle;}.dijitCalendarYearLabel {white-space: nowrap;}.dijitCalendarNextYear {margin:0 0 0 0.55em;}.dijitCalendarPreviousYear {margin:0 0.55em 0 0;}.dijitCalendarIncrementControl {vertical-align: middle;}.dijitCalendarIncrementControl,.dijitCalendarDateTemplate,.dijitCalendarMonthLabel,.dijitCalendarPreviousYear,.dijitCalendarNextYear {cursor: pointer;}.dijitCalendarDisabledDate {color: gray; text-decoration: line-through; cursor: default;}.dijitSpacer {position: relative; height: 1px; overflow: hidden; visibility: hidden;}.dijitCalendarMonthMenu .dijitCalendarMonthLabel {text-align:center;}.dijitMenu {border:1px solid black; background-color:white;}.dijitMenuTable {border-collapse:collapse; border-width:0; background-color:white;}.dj_webkit .dijitMenuTable td[colspan="2"]{border-right:hidden;}.dijitMenuItem {text-align: left; white-space: nowrap; padding:.1em .2em; cursor:pointer;}.dijitMenuItem:focus {outline: none}.dijitMenuPassive .dijitMenuItemHover,.dijitMenuItemSelected {background-color:black; color:white;}.dijitMenuItemIcon, .dijitMenuExpand {background-repeat: no-repeat;}.dijitMenuItemDisabled * {opacity:0.5; cursor:default;}.dj_ie .dj_a11y .dijitMenuItemDisabled,.dj_ie .dj_a11y .dijitMenuItemDisabled *,.dj_ie .dijitMenuItemDisabled * {color: gray; filter: alpha(opacity=35);}.dijitMenuItemLabel {position: relative; vertical-align: middle;}.dj_a11y .dijitMenuItemSelected {border: 1px dotted black !important;}.dj_ff3 .dj_a11y .dijitMenuItem td {padding: 0 !important; background:none !important;}.dj_a11y .dijitMenuItemSelected .dijitMenuItemLabel {border-width: 1px; border-style: solid;}.dj_ie8 .dj_a11y .dijitMenuItemLabel {position:static;}.dijitMenuExpandA11y {display: none;}.dj_a11y .dijitMenuExpandA11y {display: inline;}.dijitMenuSeparator td {border: 0; padding: 0;}.dijitMenuSeparatorTop {height: 50%; margin: 0; margin-top:3px; font-size: 1px;}.dijitMenuSeparatorBottom {height: 50%; margin: 0; margin-bottom:3px; font-size: 1px;}.dijitCheckedMenuItemIconChar {vertical-align: middle; visibility:hidden;}.dijitCheckedMenuItemChecked .dijitCheckedMenuItemIconChar {visibility: visible;}.dj_a11y .dijitCheckedMenuItemIconChar {display:inline !important;}.dj_a11y .dijitCheckedMenuItemIcon {display: none;}.dj_ie .dj_a11y .dijitMenuBar .dijitMenuItem {margin: 0;}.dijitStackController .dijitToggleButtonChecked * {cursor: default;}.dijitTabContainer {z-index: 0; overflow-y: visible;}.dj_ie6 .dijitTabContainer {overflow: hidden;}.dijitTabContainerNoLayout {width: 100%;}.dijitTabContainerBottom-tabs,.dijitTabContainerTop-tabs,.dijitTabContainerLeft-tabs,.dijitTabContainerRight-tabs {z-index: 1; overflow: visible !important;}.dijitTabController {z-index: 1;}.dijitTabContainerBottom-container,.dijitTabContainerTop-container,.dijitTabContainerLeft-container,.dijitTabContainerRight-container {z-index:0; overflow: hidden; border: 1px solid black;}.nowrapTabStrip {width: 50000px; display: block; position: relative; text-align: left; z-index: 1;}.dijitTabListWrapper {overflow: hidden; z-index: 1;}.dj_a11y .tabStripButton img {display: none;}.dijitTabContainerTop-tabs {border-bottom: 1px solid black;}.dijitTabContainerTop-container {border-top: 0;}.dijitTabContainerLeft-tabs {border-right: 1px solid black; float: left;}.dijitTabContainerLeft-container {border-left: 0;}.dijitTabContainerBottom-tabs {border-top: 1px solid black;}.dijitTabContainerBottom-container {border-bottom: 0;}.dijitTabContainerRight-tabs {border-left: 1px solid black; float: left;}.dijitTabContainerRight-container {border-right: 0;}div.dijitTabDisabled, .dj_ie div.dijitTabDisabled {cursor: auto;}.dijitTab {position:relative; cursor:pointer; white-space:nowrap; z-index:3;}.dijitTab * {vertical-align: middle;}.dijitTabChecked {cursor: default;}.dijitTabContainerTop-tabs .dijitTab {top: 1px;}.dijitTabContainerBottom-tabs .dijitTab {top: -1px;}.dijitTabContainerLeft-tabs .dijitTab {left: 1px;}.dijitTabContainerRight-tabs .dijitTab {left: -1px;}.dijitTabContainerTop-tabs .dijitTab,.dijitTabContainerBottom-tabs .dijitTab {display:inline-block; #zoom: 1; #display:inline;}.tabStripButton {z-index: 12;}.dijitTabButtonDisabled .tabStripButton {display: none;}.dijitTabCloseButton {margin-left: 1em;}.dijitTabCloseText {display:none;}.dijitTab .tabLabel {min-height: 15px; display: inline-block;}.dijitNoIcon {display: none;}.dj_ie6 .dijitTab .dijitNoIcon {display: inline; height: 15px; width: 1px;}.dj_a11y .dijitTabCloseButton {background-image: none !important; width: auto !important; height: auto !important;}.dj_a11y .dijitTabCloseText {display: inline;}.dijitTabPane,.dijitStackContainer-child,.dijitAccordionContainer-child {border: none !important;}.dijitInlineEditBoxDisplayMode {border: 1px solid transparent; cursor: text;}.dj_a11y .dijitInlineEditBoxDisplayMode,.dj_ie6 .dijitInlineEditBoxDisplayMode {border: none;}.dijitInlineEditBoxDisplayModeHover,.dj_a11y .dijitInlineEditBoxDisplayModeHover,.dj_ie6 .dijitInlineEditBoxDisplayModeHover {background-color: #e2ebf2; border: solid 1px black;}.dijitInlineEditBoxDisplayModeDisabled {cursor: default;}.dijitTree {overflow: auto;}.dijitTreeIndent {width: 19px;}.dijitTreeRow, .dijitTreeContent {white-space: nowrap;}.dijitTreeRow img {vertical-align: middle;}.dijitTreeContent {cursor: default;}.dijitExpandoText {display: none;}.dj_a11y .dijitExpandoText {display: inline; padding-left: 10px; padding-right: 10px; font-family: monospace; border-style: solid; border-width: thin; cursor: pointer;}.dijitTreeLabel {margin: 0 4px;}.dijitDialog {position: absolute; z-index: 999; overflow: hidden;}.dijitDialogTitleBar {cursor: move;}.dijitDialogFixed .dijitDialogTitleBar {cursor:default;}.dijitDialogCloseIcon {cursor: pointer;}.dijitDialogUnderlayWrapper {position: absolute; left: 0; top: 0; z-index: 998; display: none; background: transparent !important;}.dijitDialogUnderlay {background: #eee; opacity: 0.5;}.dj_ie .dijitDialogUnderlay {filter: alpha(opacity=50);}.dj_a11y .dijitSpinnerButtonContainer,.dj_a11y .dijitDialog {opacity: 1 !important; background-color: white !important;}.dijitDialog .closeText {display:none; position:absolute;}.dj_a11y .dijitDialog .closeText {display:inline;}.dijitSliderMoveable {z-index:99; position:absolute !important; display:block; vertical-align:middle;}.dijitSliderMoveableH {right:0;}.dijitSliderMoveableV {right:50%;}.dj_a11y div.dijitSliderImageHandle,.dijitSliderImageHandle {margin:0; padding:0; position:relative !important; border:8px solid gray; width:0; height:0; cursor: pointer;}.dj_iequirks .dj_a11y .dijitSliderImageHandle {font-size: 0;}.dj_ie7 .dijitSliderImageHandle {overflow: hidden;}.dj_ie7 .dj_a11y .dijitSliderImageHandle {overflow: visible;}.dj_a11y .dijitSliderFocused .dijitSliderImageHandle {border:4px solid #000; height:8px; width:8px;}.dijitSliderImageHandleV {top:-8px; right: -50%;}.dijitSliderImageHandleH {left:50%; top:-5px; vertical-align:top;}.dijitSliderBar {border-style:solid; border-color:black; cursor: pointer;}.dijitSliderBarContainerV {position:relative; height:100%; z-index:1;}.dijitSliderBarContainerH {position:relative; z-index:1;}.dijitSliderBarH {height:4px; border-width:1px 0;}.dijitSliderBarV {width:4px; border-width:0 1px;}.dijitSliderProgressBar {background-color:red; z-index:1;}.dijitSliderProgressBarV {position:static !important; height:0; vertical-align:top; text-align:left;}.dijitSliderProgressBarH {position:absolute !important; width:0; vertical-align:middle; overflow:visible;}.dijitSliderRemainingBar {overflow:hidden; background-color:transparent; z-index:1;}.dijitSliderRemainingBarV {height:100%; text-align:left;}.dijitSliderRemainingBarH {width:100% !important;}.dijitSliderBumper {overflow:hidden; z-index:1;}.dijitSliderBumperV {width:4px; height:8px; border-width:0 1px;}.dijitSliderBumperH {width:8px; height:4px; border-width:1px 0;}.dijitSliderBottomBumper,.dijitSliderLeftBumper {background-color:red;}.dijitSliderTopBumper,.dijitSliderRightBumper {background-color:transparent;}.dijitSliderDecoration {text-align:center;}.dijitSliderDecorationC,.dijitSliderDecorationV {position: relative;}.dijitSliderDecorationH {width: 100%;}.dijitSliderDecorationV {height: 100%;}.dijitSliderButton {font-family:monospace; margin:0; padding:0; display:block;}.dj_a11y .dijitSliderButtonInner {visibility:visible !important;}.dijitSliderButtonContainer {text-align:center; height:0;}.dijitSliderButtonContainer * {cursor: pointer;}.dijitSlider .dijitButtonNode {padding:0; display:block;}.dijitRuleContainer {position:relative; overflow:visible;}.dijitRuleContainerV {height:100%; line-height:0; float:left; text-align:left;}.dj_opera .dijitRuleContainerV {line-height:2%;}.dj_ie .dijitRuleContainerV {line-height:normal;}.dj_gecko .dijitRuleContainerV {margin:0 0 1px 0;}.dijitRuleMark {position:absolute; border:1px solid black; line-height:0; height:100%;}.dijitRuleMarkH {width:0; border-top-width:0 !important; border-bottom-width:0 !important; border-left-width:0 !important;}.dijitRuleLabelContainer {position:absolute;}.dijitRuleLabelContainerH {text-align:center; display:inline-block;}.dijitRuleLabelH {position:relative; left:-50%;}.dijitRuleLabelV {text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}.dijitRuleMarkV {height:0; border-right-width:0 !important; border-bottom-width:0 !important; border-left-width:0 !important; width:100%; left:0;}.dj_ie .dijitRuleLabelContainerV {margin-top:-.55em;}.dj_a11y .dijitSliderReadOnly,.dj_a11y .dijitSliderDisabled {opacity:0.6;}.dj_ie .dj_a11y .dijitSliderReadOnly .dijitSliderBar,.dj_ie .dj_a11y .dijitSliderDisabled .dijitSliderBar {filter: alpha(opacity=40);}.dj_a11y .dijitSlider .dijitSliderButtonContainer div {font-family: monospace; font-size: 1em; line-height: 1em; height: auto; width: auto; margin: 0 4px;}.dj_a11y .dijitButtonContents .dijitButtonText,.dj_a11y .dijitTab .tabLabel {display: inline !important;}.dj_a11y .dijitSelect .dijitButtonText {display: inline-block !important;}.dijitSelectError .dijitButtonContents .dijitButtonText {display: none !important;}.dijitTextArea {width:100%; overflow-y: auto;}.dijitTextArea[cols] {width:auto;}.dj_ie .dijitTextAreaCols {width:auto;}.dijitExpandingTextArea {resize: none;}.dijitToolbarSeparator {height: 18px; width: 5px; padding: 0 1px; margin: 0;}.dijitIEFixedToolbar {position:absolute; top: expression(eval((document.documentElement||document.body).scrollTop));}.dijitEditor {display: block;}.dijitEditorDisabled,.dijitEditorReadOnly {color: gray;}.dijitTimePickerItemInner {text-align:center; border:0; padding:2px 8px 2px 8px;}.dijitTimePickerTick,.dijitTimePickerMarker {border-bottom:1px solid gray;}.dijitTimePicker .dijitDownArrowButton {border-top: none !important;}.dijitTimePickerTick {color:#CCC;}.dijitTimePickerMarker {color:black; background-color:#CCC;}.dijitTimePickerItemSelected {font-weight:bold; color:#333; background-color:#b7cdee;}.dijitTimePickerItemHover {background-color:gray; color:white; cursor:pointer;}.dijitTimePickerItemDisabled {color:gray; text-decoration:line-through;}.dj_a11y .dijitTimePickerItemSelected .dijitTimePickerItemInner {border: solid 4px black;}.dj_a11y .dijitTimePickerItemHover .dijitTimePickerItemInner {border: dashed 4px black;}.dijitToggleButtonIconChar {display:none !important;}.dj_a11y .dijitToggleButton .dijitToggleButtonIconChar {display:inline !important; visibility:hidden;}.dj_ie6 .dijitToggleButtonIconChar, .dj_ie6 .tabStripButton .dijitButtonText {font-family: "Arial Unicode MS";}.dj_a11y .dijitToggleButtonChecked .dijitToggleButtonIconChar {display: inline !important; visibility:visible !important;}.dijitArrowButtonChar {display:none !important;}.dj_a11y .dijitArrowButtonChar {display:inline !important;}.dj_a11y .dijitDropDownButton .dijitArrowButtonInner,.dj_a11y .dijitComboButton .dijitArrowButtonInner {display:none !important;}.dj_a11y .dijitSelect {border-collapse: separate !important; border-width: 1px; border-style: solid;}.dj_ie .dijitSelect {vertical-align: middle;}.dj_ie6 .dijitSelect .dijitValidationContainer,.dj_ie8 .dijitSelect .dijitButtonText {vertical-align: top;}.dj_ie6 .dijitTextBox .dijitInputContainer,.dj_iequirks .dijitTextBox .dijitInputContainer,.dj_ie6 .dijitTextBox .dijitArrowButtonInner,.dj_ie6 .dijitSpinner .dijitSpinnerButtonInner,.dijitSelect .dijitSelectLabel {vertical-align: baseline;}.dijitToolbar .dijitSelect {margin: 0;}.dj_webkit .dijitToolbar .dijitSelect {padding-left: 0.3em;}.dijitSelect .dijitButtonContents {padding: 0; white-space: nowrap; text-align: left; border-style: none solid none none; border-width: 1px;}.dijitSelectFixedWidth .dijitButtonContents {width: 100%;}.dijitSelectMenu .dijitMenuItemIcon {display:none;}.dj_ie6 .dijitSelectMenu .dijitMenuItemLabel,.dj_ie7 .dijitSelectMenu .dijitMenuItemLabel {position: static;}.dijitSelectLabel *{vertical-align: baseline;}.dijitSelectSelectedOption * {font-weight: bold;}.dijitSelectMenu {border-width: 1px;}.dijitSelectMenu .dijitMenuTable {margin: 0; background-color: transparent;}.dijitForceStatic {position: static !important;}.dijitReadOnly *,.dijitDisabled *,.dijitReadOnly,.dijitDisabled {cursor: default;}.dojoDndItem {padding: 2px; -webkit-touch-callout: none; -webkit-user-select: none;}.dojoDndHorizontal .dojoDndItem {#display: inline; display: inline-block;}.dojoDndItemBefore,.dojoDndItemAfter {border: 0px solid #369;}.dojoDndItemBefore {border-width: 2px 0 0 0; padding: 0 2px 2px 2px;}.dojoDndItemAfter {border-width: 0 0 2px 0; padding: 2px 2px 0 2px;}.dojoDndHorizontal .dojoDndItemBefore {border-width: 0 0 0 2px; padding: 2px 2px 2px 0;}.dojoDndHorizontal .dojoDndItemAfter {border-width: 0 2px 0 0; padding: 2px 0 2px 2px;}.dojoDndItemOver {cursor:pointer;}.dj_gecko .dijitArrowButtonInner INPUT,.dj_gecko INPUT.dijitArrowButtonInner {-moz-user-focus:ignore;}
\ No newline at end of file
diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/dijit_rtl.css b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/dijit_rtl.css
new file mode 100644
index 0000000000..c81163bfea
--- /dev/null
+++ b/api/js/webodf/wodotexteditor/wodotexteditor/dijit/themes/dijit_rtl.css
@@ -0,0 +1 @@
+.dijitRtl .dijitPlaceHolder {left: auto; right: 0;}.dijitMenuItemRtl {text-align: right;}.dj_iequirks .dijitComboButtonRtl button {float:left;}.dj_ie .dijitTextBoxRtl .dijitInputContainer {clear: right;}.dijitTextBoxRtl .dijitValidationContainer,.dijitTextBoxRtl .dijitSpinnerButtonContainer,.dijitComboBoxRtl .dijitArrowButtonContainer {border-right-width: 1px !important; border-left-width: 0 !important;}.dijitSpinnerRtl .dijitSpinnerButtonContainer .dijitArrowButton {right: 0; left: auto;}.dijitSelectRtl .dijitButtonText {float: right;}.dijitTextBoxRtl .dijitSpinnerButtonContainer,.dijitValidationTextBoxRtl .dijitValidationContainer,.dijitTextBoxRtl .dijitArrowButtonContainer {float: left;}.dijitCalendarRtl .dijitCalendarNextYear {margin:0 0.55em 0 0;}.dijitCalendarRtl .dijitCalendarPreviousYear {margin:0 0 0 0.55em;}.dijitSliderRtl .dijitSliderImageHandleV {left:auto;}.dijitSliderRtl .dijitSliderImageHandleH {left:-50%;}.dijitSliderRtl .dijitSliderMoveableH {right:auto; left:0;}.dijitSliderRtl .dijitRuleContainerV {float:right;}.dj_ie .dijitSliderRtl .dijitRuleContainerV {text-align:right;}.dj_ie .dijitSliderRtl .dijitRuleLabelV {text-align:left;}.dj_ie .dijitSliderRtl .dijitRuleLabelH {zoom:1;}.dijitSliderRtl .dijitSliderProgressBarH {float:right; right:0; left:auto;}.dijitRtl .dijitContentPaneLoading .dijitIconLoading,.dijitRtl .dijitContentPaneError .dijitIconError {margin-right: 0; margin-left: 9px;}.dijitTabControllerRtl .nowrapTabStrip {text-align: right;}.dijitTabRtl .dijitTabCloseButton {margin-left: 0; margin-right: 1em;}.dj_ie6 .dijitTabRtl .tabLabel,.dj_ie6 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie6 .dijitTabContainerLeft-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerLeft-tabs .dijitTabRtl {zoom: 1;}.dj_ie6 .dijitTabContainerRight-tabs .dijitTabRtl,.dj_ie7 .dijitTabContainerRight-tabs .dijitTabRtl {left: 0;}.dj_ie6 .dijitTabContainerRightRtl .dijitTabContainerRight-tabs,.dj_ie6 .dijitTabContainerLeftRtl .dijitTabContainerLeft-tabs {width: 1%;}.dj_ie .dijitTimePickerRtl .dijitTimePickerItem {width:100%;}.dijitColorPaletteRtl .dijitColorPaletteUnder {left: auto; right: 0;}.dijitSelectRtl .dijitButtonContents {border-style: none none none solid; text-align: right;}.dijitRtl .dojoDndHorizontal .dojoDndItemBefore {border-width: 0 2px 0 0; padding: 2px 0 2px 2px;}.dijitRtl .dojoDndHorizontal .dojoDndItemAfter {border-width: 0 0 0 2px; padding: 2px 2px 2px 0;}
\ No newline at end of file
diff --git a/api/js/webodf/wodotexteditor/wodotexteditor/dojo-amalgamation.js b/api/js/webodf/wodotexteditor/wodotexteditor/dojo-amalgamation.js
new file mode 100644
index 0000000000..11df941b88
--- /dev/null
+++ b/api/js/webodf/wodotexteditor/wodotexteditor/dojo-amalgamation.js
@@ -0,0 +1,1269 @@
+//>>built
+(function(f,k){var h,j,e=function(){},c=function(a){for(var b in a)return 0;return 1},i={}.toString,b=function(a){return"[object Function]"==i.call(a)},g=function(a){return"[object String]"==i.call(a)},a=function(a){return"[object Array]"==i.call(a)},l=function(a,b){if(a)for(var d=0;d")]),!a.def||d?ha:a.cjs&&a.cjs.exports;if(!a.executed){if(!a.def)return ha;var l=a.mid,g=a.deps||[],c,e=[],m=0;for(a.executed=4;mf.attributes.length);
+k.clearElement=function(f){f.innerHTML="";return f};k.normalize=function(f,j){var e=f.match(/[\?:]|[^:\?]*/g),c=0,i=function(b){var g=e[c++];if(":"==g)return 0;if("?"==e[c++]){if(!b&&k(g))return i();i(!0);return i(b)}return g||0};return(f=i())&&j(f)};k.load=function(f,j,e){f?j([f],e):e()};return k})},"dojo/_base/config":function(){define(["../has","require"],function(f,k){var h={},j=k.rawConfig,e;for(e in j)h[e]=j[e];return h})},"dojo/_base/array":function(){define(["./kernel","../has","./lang"],
+function(f,k,h){function j(a){return i[a]=new Function("item","index","array",a)}function e(a){var b=!a;return function(d,g,c){var e=0,f=d&&d.length||0,h;f&&"string"==typeof d&&(d=d.split(""));"string"==typeof g&&(g=i[g]||j(g));if(c)for(;ei?
+(i=j+i,0>i&&(i=d)):i=i>=j?j+c:i;for(j&&"string"==typeof e&&(e=e.split(""));i!=h;i+=l)if(e[i]==f)return i;return-1}}var i={},b,g={every:e(!1),some:e(!0),indexOf:c(!0),lastIndexOf:c(!1),forEach:function(a,b,d){var g=0,c=a&&a.length||0;c&&"string"==typeof a&&(a=a.split(""));"string"==typeof b&&(b=i[b]||j(b));if(d)for(;g=u&&(u=0,r.ioPublish&&f.publish&&(!a||a&&!1!==a.ioArgs.args.ioPublish)&&f.publish("/dojo/io/stop"))},u=0;p.after(m,"_onAction",function(){u-=1});p.after(m,"_onInFlight",t);f._ioCancelAll=m.cancelAll;f._ioNotifyStart=function(a){r.ioPublish&&
+f.publish&&!1!==a.ioArgs.args.ioPublish&&(u||f.publish("/dojo/io/start"),u+=1,f.publish("/dojo/io/send",[a]))};f._ioWatch=function(b,d,g,c){b.ioArgs.options=b.ioArgs.args;a.mixin(b,{response:b.ioArgs,isValid:function(){return d(b)},isReady:function(){return g(b)},handleResponse:function(){return c(b)}});m(b);t(b)};f._ioAddQueryToUrl=function(a){if(a.query.length)a.url+=(-1==a.url.indexOf("?")?"?":"&")+a.query,a.query=null};f.xhr=function(a,b,d){var g,c=f._ioSetArgs(b,function(){g&&g.cancel()},v,s),
+l=c.ioArgs;"postData"in b?l.query=b.postData:"putData"in b?l.query=b.putData:"rawBody"in b?l.query=b.rawBody:(2a?(c=j(i),i=""):(c=j(i.slice(0,a)),i=j(i.slice(a+1)));"string"==typeof e[c]&&(e[c]=[e[c]]);f.isArray(e[c])?e[c].push(i):e[c]=i}return e}}})},"dojo/dom":function(){define(["./sniff","./_base/lang","./_base/window"],function(f,k,h){if(7>=f("ie"))try{document.execCommand("BackgroundImageCache",!1,!0)}catch(j){}var e={};e.byId=f("ie")?function(c,e){if("string"!=typeof c)return c;var b=e||h.doc,g=c&&b.getElementById(c);if(g&&(g.attributes.id.value==c||g.id==c))return g;b=b.all[c];if(!b||
+b.nodeName)b=[b];for(var a=0;g=b[a++];)if(g.attributes&&g.attributes.id&&g.attributes.id.value==c||g.id==c)return g}:function(c,e){return("string"==typeof c?(e||h.doc).getElementById(c):c)||null};e.isDescendant=function(c,f){try{c=e.byId(c);for(f=e.byId(f);c;){if(c==f)return!0;c=c.parentNode}}catch(b){}return!1};e.setSelectable=function(c,i){c=e.byId(c);if(f("mozilla"))c.style.MozUserSelect=i?"":"none";else if(f("khtml")||f("webkit"))c.style.KhtmlUserSelect=i?"auto":"none";else if(f("ie"))for(var b=
+c.unselectable=i?"":"on",g=c.getElementsByTagName("*"),a=0,l=g.length;a"file|submit|image|reset|button".indexOf(d)&&!a.disabled){var p=i,m=l,a=e.fieldToObject(a);if(null!==a){var n=p[m];"string"==typeof n?p[m]=[n,a]:f.isArray(n)?n.push(a):p[m]=a}if("image"==d)i[l+".x"]=i[l+".y"]=i[l].x=i[l].y=0}}return i},toQuery:function(c){return h.objectToQuery(e.toObject(c))},toJson:function(c,
+f){return j.stringify(e.toObject(c),null,f?4:0)}};return e})},"dojo/json":function(){define(["./has"],function(f){var k="undefined"!=typeof JSON;f.add("json-parse",k);f.add("json-stringify",k&&'{"a":1}'==JSON.stringify({a:0},function(f,e){return e||1}));if(f("json-stringify"))return JSON;var h=function(f){return('"'+f.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};return{parse:f("json-parse")?JSON.parse:
+function(f,e){if(e&&!/^([\s\[\{]*(?:"(?:\\.|[^"])+"|-?\d[\d\.]*(?:[Ee][+-]?\d+)?|null|true|false|)[\s\]\}]*(?:,|:|$))+$/.test(f))throw new SyntaxError("Invalid characters in JSON");return eval("("+f+")")},stringify:function(f,e,c){function i(g,a,l){e&&(g=e(l,g));var d;d=typeof g;if("number"==d)return isFinite(g)?g+"":"null";if("boolean"==d)return g+"";if(null===g)return"null";if("string"==typeof g)return h(g);if("function"==d||"undefined"==d)return b;if("function"==typeof g.toJSON)return i(g.toJSON(l),
+a,l);if(g instanceof Date)return'"{FullYear}-{Month+}-{Date}T{Hours}:{Minutes}:{Seconds}Z"'.replace(/\{(\w+)(\+)?\}/g,function(a,b,d){a=g["getUTC"+b]()+(d?1:0);return 10>a?"0"+a:a});if(g.valueOf()!==g)return i(g.valueOf(),a,l);var f=c?a+c:"",m=c?" ":"",n=c?"\n":"";if(g instanceof Array){for(var m=g.length,o=[],l=0;l");}}})},"dojo/promise/tracer":function(){define(["../_base/lang","./Promise","../Evented"],function(f,k,h){function j(f){setTimeout(function(){c.apply(e,f)},0)}var e=new h,c=e.emit;
+e.emit=null;k.prototype.trace=function(){var c=f._toArray(arguments);this.then(function(b){j(["resolved",b].concat(c))},function(b){j(["rejected",b].concat(c))},function(b){j(["progress",b].concat(c))});return this};k.prototype.traceRejected=function(){var c=f._toArray(arguments);this.otherwise(function(b){j(["rejected",b].concat(c))});return this};return e})},"dojo/Evented":function(){define("dojo/Evented",["./aspect","./on"],function(f,k){function h(){}var j=f.after;h.prototype={on:function(e,c){return k.parse(this,
+e,c,function(e,b){return j(e,"on"+b,c,!0)})},emit:function(e,c){var f=[this];f.push.apply(f,arguments);return k.emit.apply(k,f)}};return h})},"dojo/aspect":function(){define("dojo/aspect",[],function(){function f(b,g,a,c){var d=b[g],e="around"==g,f;if(e){var i=a(function(){return d.advice(this,arguments)});f={remove:function(){f.cancelled=!0},advice:function(a,b){return f.cancelled?d.advice(a,b):i.apply(a,b)}}}else f={remove:function(){var a=f.previous,d=f.next;if(!d&&!a)delete b[g];else if(a?a.next=
+d:b[g]=d,d)d.previous=a},id:j++,advice:a,receiveArguments:c};if(d&&!e)if("after"==g){for(a=d;a;)d=a,a=a.next;d.next=f;f.previous=d}else{if("before"==g)b[g]=f,f.next=d,d.previous=f}else b[g]=f;return f}function k(b){return function(g,a,c,d){var e=g[a],m;if(!e||e.target!=g){g[a]=m=function(){for(var a=j,b=arguments,d=m.before;d;)b=d.advice.apply(this,b)||b,d=d.next;if(m.around)var g=m.around.advice(this,b);for(d=m.after;d&&d.idh("jscript"))&&!h("config-_allow_leaks")){"undefined"==typeof _dojoIEListeners_&&(_dojoIEListeners_=[]);var g=a[b];if(!g||!g.listeners){var c=g,g=Function("event","var callee = arguments.callee; for(var i = 0; ia||304===a||1223===a||!a}})},"dojo/errors/RequestError":function(){define(["./create"],function(f){return f("RequestError",function(f,h){this.response=h})})},"dojo/errors/RequestTimeoutError":function(){define(["./create","./RequestError"],function(f,
+k){return f("RequestTimeoutError",null,k,{dojoType:"timeout"})})},"dojo/request/xhr":function(){define(["../errors/RequestError","./watch","./handlers","./util","../has"],function(f,k,h,j,e){function c(a,b){var d=a.xhr;a.status=a.xhr.status;a.text=d.responseText;if("xml"===a.options.handleAs)a.data=d.responseXML;if(!b)try{h(a)}catch(g){b=g}b?this.reject(b):j.checkStatus(d.status)?this.resolve(a):(b=new f("Unable to load "+a.url+" status: "+d.status,a),this.reject(b))}function i(m,h,n){var v=j.parseArgs(m,
+j.deepCreate(p,h),e("native-formdata")&&h&&h.data&&h.data instanceof FormData),m=v.url,h=v.options,s,t=j.deferred(v,l,b,g,c,function(){s&&s()}),u=v.xhr=i._create();if(!u)return t.cancel(new f("XHR was not created")),n?t:t.promise;v.getHeader=function(a){return this.xhr.getResponseHeader(a)};a&&(s=a(u,t,v));var y=h.data,z=!h.sync,I=h.method;try{u.open(I,m,z,h.user||d,h.password||d);if(h.withCredentials)u.withCredentials=h.withCredentials;var J=h.headers,N;if(J)for(var E in J)"content-type"===E.toLowerCase()?
+N=J[E]:J[E]&&u.setRequestHeader(E,J[E]);N&&!1!==N&&u.setRequestHeader("Content-Type",N);(!J||!("X-Requested-With"in J))&&u.setRequestHeader("X-Requested-With","XMLHttpRequest");j.notify&&j.notify.emit("send",v,t.promise.cancel);u.send(y)}catch(S){t.reject(S)}k(t);u=null;return n?t:t.promise}e.add("native-xhr",function(){return"undefined"!==typeof XMLHttpRequest});e.add("dojo-force-activex-xhr",function(){return e("activex")&&!document.addEventListener&&"file:"===window.location.protocol});e.add("native-xhr2",
+function(){if(e("native-xhr")){var a=new XMLHttpRequest;return"undefined"!==typeof a.addEventListener&&("undefined"===typeof opera||"undefined"!==typeof a.upload)}});e.add("native-formdata",function(){return"function"===typeof FormData});var b,g,a,l;e("native-xhr2")?(b=function(){return!this.isFulfilled()},l=function(a,b){b.xhr.abort()},a=function(a,b,d){function g(){b.handleResponse(d)}function c(a){a=new f("Unable to load "+d.url+" status: "+a.target.status,d);b.handleResponse(d,a)}function e(a){if(a.lengthComputable)d.loaded=
+a.loaded,d.total=a.total,b.progress(d)}a.addEventListener("load",g,!1);a.addEventListener("error",c,!1);a.addEventListener("progress",e,!1);return function(){a.removeEventListener("load",g,!1);a.removeEventListener("error",c,!1);a.removeEventListener("progress",e,!1)}}):(b=function(a){return a.xhr.readyState},g=function(a){return 4===a.xhr.readyState},l=function(a,b){var d=b.xhr,g=typeof d.abort;("function"===g||"object"===g||"unknown"===g)&&d.abort()});var d,p={data:null,query:null,sync:!1,method:"GET",
+headers:{"Content-Type":"application/x-www-form-urlencoded"}};i._create=function(){throw Error("XMLHTTP not available");};if(e("native-xhr")&&!e("dojo-force-activex-xhr"))i._create=function(){return new XMLHttpRequest};else if(e("activex"))try{new ActiveXObject("Msxml2.XMLHTTP"),i._create=function(){return new ActiveXObject("Msxml2.XMLHTTP")}}catch(m){try{new ActiveXObject("Microsoft.XMLHTTP"),i._create=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}catch(n){}}j.addCommonMethods(i);return i})},
+"dojo/request/handlers":function(){define(["../json","../_base/kernel","../_base/array","../has"],function(f,k,h,j){function e(g){var a=b[g.options.handleAs];g.data=a?a(g):g.data||g.text;return g}j.add("activex","undefined"!==typeof ActiveXObject);var c;if(j("activex")){var i=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML.DOMDocument"];c=function(b){var a=b.data;if(!a||!a.documentElement){var c=b.text;h.some(i,function(b){try{var g=new ActiveXObject(b);g.async=
+!1;g.loadXML(c);a=g}catch(e){return!1}return!0})}return a}}var b={javascript:function(b){return k.eval(b.text||"")},json:function(b){return f.parse(b.text||null)},xml:c};e.register=function(g,a){b[g]=a};return e})},"dojo/main":function(){define("./_base/kernel,./has,require,./sniff,./_base/lang,./_base/array,./_base/config,./ready,./_base/declare,./_base/connect,./_base/Deferred,./_base/json,./_base/Color,./has!dojo-firebug?./_firebug/firebug,./_base/browser,require".split(","),function(f,k,h,j,e,
+c,i,b){i.isDebug&&h(["./_firebug/firebug"]);var g=i.require;g&&(g=c.map(e.isArray(g)?g:[g],function(a){return a.replace(/\./g,"/")}),f.isAsync?h(g):b(1,function(){h(g)}));return f})},"dojo/ready":function(){define(["./_base/kernel","./has","require","./domReady","./_base/lang"],function(f,k,h,j,e){var c=0,i,b=[],g=0,a=function(){if(c&&!g&&b.length){g=1;var d=b.shift();try{d()}finally{g=0}g=0;b.length&&i(a)}};h.on("idle",a);i=function(){h.idle()&&a()};var k=f.ready=f.addOnLoad=function(a,g,c){var l=
+e._toArray(arguments);"number"!=typeof a?(c=g,g=a,a=1E3):l.shift();c=c?e.hitch.apply(f,l):function(){g()};c.priority=a;for(l=0;l=b[l].priority;l++);b.splice(l,0,c);i()},l=f.config.addOnLoad;if(l)k[e.isArray(l)?"apply":"call"](f,l);j(function(){c=1;f._postLoad=f.config.afterOnLoad=!0;b.length&&i(a)});return k})},"dojo/domReady":function(){define(["./has"],function(f){function k(a){i?a(j):b.push(a)}var h=this,j=document,e={loaded:1,complete:1},c="string"!=typeof j.readyState,i=!!e[j.readyState];
+if(c)j.readyState="loading";if(!i){var b=[],g=[],a=function(a){a=a||h.event;if(!(i||"readystatechange"==a.type&&!e[j.readyState])){i=1;if(c)j.readyState="complete";for(;b.length;)b.shift()(j)}},l=function(d,g){d.addEventListener(g,a,!1);b.push(function(){d.removeEventListener(g,a,!1)})};if(!f("dom-addeventlistener")){var l=function(d,g){g="on"+g;d.attachEvent(g,a);b.push(function(){d.detachEvent(g,a)})},d=j.createElement("div");try{d.doScroll&&null===h.frameElement&&g.push(function(){try{return d.doScroll("left"),
+1}catch(a){}})}catch(p){}}l(j,"DOMContentLoaded");l(h,"load");"onreadystatechange"in j?l(j,"readystatechange"):c||g.push(function(){return e[j.readyState]});if(g.length){var m=function(){if(!i){for(var b=g.length;b--;)if(g[b]()){a("poller");return}setTimeout(m,30)}};m()}}k.load=function(a,b,d){k(d)};return k})},"dojo/_base/declare":function(){define(["./kernel","../has","./lang"],function(f,k,h){function j(a,b){throw Error("declare"+(b?" "+b:"")+": "+a);}function e(a,b,d){var g,c,e,l,f,m,i,h=this._inherited=
+this._inherited||{};"string"==typeof a&&(g=a,a=b,b=d);d=0;l=a.callee;(g=g||l.nom)||j("can't deduce a name to call inherited()",this.declaredClass);f=this.constructor._meta;e=f.bases;i=h.p;if(g!=z){if(h.c!==l&&(i=0,m=e[0],f=m._meta,f.hidden[g]!==l)){(c=f.chains)&&"string"==typeof c[g]&&j("calling chained method with inherited: "+g,this.declaredClass);do if(f=m._meta,c=m.prototype,f&&(c[g]===l&&c.hasOwnProperty(g)||f.hidden[g]===l))break;while(m=e[++i]);i=m?i:-1}if(m=e[++i])if(c=m.prototype,m._meta&&
+c.hasOwnProperty(g))d=c[g];else{l=s[g];do if(c=m.prototype,(d=c[g])&&(m._meta?c.hasOwnProperty(g):d!==l))break;while(m=e[++i])}d=m&&d||s[g]}else{if(h.c!==l&&(i=0,(f=e[0]._meta)&&f.ctor!==l)){c=f.chains;for((!c||"manual"!==c.constructor)&&j("calling chained constructor with inherited",this.declaredClass);(m=e[++i])&&!((f=m._meta)&&f.ctor===l););i=m?i:-1}for(;(m=e[++i])&&!(d=(f=m._meta)?f.ctor:m););d=m&&d}h.c=d;h.p=i;if(d)return!0===b?d:d.apply(this,b||a)}function c(a,b){return"string"==typeof a?this.__inherited(a,
+b,!0):this.__inherited(a,!0)}function i(a,b,d){var g=this.getInherited(a,b);if(g)return g.apply(this,d||b||a)}function b(a){for(var b=this.constructor._meta.bases,d=0,g=b.length;dd||90d||111d||192d||222g?g-48:!a.shiftKey&&65<=g&&90>=g?g+32:l[g]||g}d=p(a,{type:"keypress",faux:!0,charCode:g});b.call(a.currentTarget,d);if(i("ie"))try{a.keyCode=d.keyCode}catch(c){}}}),g=k(a,"keypress",function(a){var d=a.charCode,a=p(a,{charCode:32<=d?d:0,faux:!0});return b.call(this,a)});return{remove:function(){d.remove();g.remove()}}}:i("opera")?function(a,b){return k(a,"keypress",function(a){var d=a.which;3==d&&(d=99);d=32>d&&!a.shiftKey?0:d;a.ctrlKey&&!a.shiftKey&&65<=d&&90>=d&&(d+=32);return b.call(this,p(a,
+{charCode:d}))})}:function(b,d){return k(b,"keypress",function(b){a(b);return d.call(this,b)})};var n={_keypress:m,connect:function(a,b,d,c,e){var l=arguments,f=[],i=0;f.push("string"==typeof l[0]?null:l[i++],l[i++]);var m=l[i+1];f.push("string"==typeof m||"function"==typeof m?l[i++]:null,l[i++]);for(m=l.length;if("ie")){var b=a.getBoundingClientRect(),d=b.left,b=b.top;7>f("ie")&&(d+=a.clientLeft,b+=a.clientTop);return{x:0>d?0:d,y:0>b?0:b}}return{x:0,y:0}};b.fixIeBiDiScrollLeft=function(a,g){var g=g||k.doc,d=f("ie");if(d&&!b.isBodyLtr(g)){var c=
+f("quirks"),e=c?k.body(g):g.documentElement,i=k.global;6==d&&!c&&i.frameElement&&e.scrollHeight>e.clientHeight&&(a+=e.clientLeft);return 8>d||c?a+e.clientWidth-e.scrollWidth:-a}return a};b.position=function(a,g){var a=h.byId(a),d=k.body(a.ownerDocument),c=a.getBoundingClientRect(),c={x:c.left,y:c.top,w:c.right-c.left,h:c.bottom-c.top};if(f("ie")){var e=b.getIeDocumentElementOffset(a.ownerDocument);c.x-=e.x+(f("quirks")?d.clientLeft+d.offsetLeft:0);c.y-=e.y+(f("quirks")?d.clientTop+d.offsetTop:0)}g&&
+(d=b.docScroll(a.ownerDocument),c.x+=d.x,c.y+=d.y);return c};b.getMarginSize=function(a,g){var a=h.byId(a),d=b.getMarginExtents(a,g||j.getComputedStyle(a)),c=a.getBoundingClientRect();return{w:c.right-c.left+d.w,h:c.bottom-c.top+d.h}};b.normalizeEvent=function(a){if(!("layerX"in a))a.layerX=a.offsetX,a.layerY=a.offsetY;if(!f("dom-addeventlistener")){var g=a.target,g=g&&g.ownerDocument||document,d=f("quirks")?g.body:g.documentElement,c=b.getIeDocumentElementOffset(g);a.pageX=a.clientX+b.fixIeBiDiScrollLeft(d.scrollLeft||
+0,g)-c.x;a.pageY=a.clientY+(d.scrollTop||0)-c.y}};return b})},"dojo/dom-style":function(){define(["./sniff","./dom"],function(f,k){function h(b,d,g){d=d.toLowerCase();if(f("ie")){if("auto"==g){if("height"==d)return b.offsetHeight;if("width"==d)return b.offsetWidth}if("fontweight"==d)switch(g){case 700:return"bold";default:return"normal"}}d in a||(a[d]=l.test(d));return a[d]?c(b,g):g}var j,e={};j=f("webkit")?function(a){var b;if(1==a.nodeType){var d=a.ownerDocument.defaultView;b=d.getComputedStyle(a,
+null);if(!b&&a.style)a.style.display="",b=d.getComputedStyle(a,null)}return b||{}}:f("ie")&&(9>f("ie")||f("quirks"))?function(a){return 1==a.nodeType&&a.currentStyle?a.currentStyle:{}}:function(a){return 1==a.nodeType?a.ownerDocument.defaultView.getComputedStyle(a,null):{}};e.getComputedStyle=j;var c;c=f("ie")?function(a,b){if(!b)return 0;if("medium"==b)return 4;if(b.slice&&"px"==b.slice(-2))return parseFloat(b);var d=a.style,g=a.runtimeStyle,c=d.left,e=g.left;g.left=a.currentStyle.left;try{d.left=
+b,b=d.pixelLeft}catch(l){b=0}d.left=c;g.left=e;return b}:function(a,b){return parseFloat(b)||0};e.toPixelValue=c;var i=function(a,b){try{return a.filters.item("DXImageTransform.Microsoft.Alpha")}catch(d){return b?{}:null}},b=9>f("ie")||f("ie")&&f("quirks")?function(a){try{return i(a).Opacity/100}catch(b){return 1}}:function(a){return j(a).opacity},g=9>f("ie")||f("ie")&&f("quirks")?function(a,b){var d=100*b,c=1==b;a.style.zoom=c?"":1;if(i(a))i(a,1).Opacity=d;else{if(c)return b;a.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
+d+")"}i(a,1).Enabled=!c;if("tr"==a.tagName.toLowerCase())for(d=a.firstChild;d;d=d.nextSibling)"td"==d.tagName.toLowerCase()&&g(d,b);return b}:function(a,b){return a.style.opacity=b},a={left:!0,top:!0},l=/margin|padding|width|height|max|min|offset/,d=f("ie")?"styleFloat":"cssFloat",p={cssFloat:d,styleFloat:d,"float":d};e.get=function(a,d){var g=k.byId(a),c=arguments.length;if(2==c&&"opacity"==d)return b(g);var d=p[d]||d,l=e.getComputedStyle(g);return 1==c?l:h(g,d,l[d]||g.style[d])};e.set=function(a,
+b,d){var c=k.byId(a),l=arguments.length,f="opacity"==b,b=p[b]||b;if(3==l)return f?g(c,d):c.style[b]=d;for(var i in b)e.set(a,i,b[i]);return e.getComputedStyle(c)};return e})},"dojo/mouse":function(){define(["./_base/kernel","./on","./has","./dom","./_base/window"],function(f,k,h,j,e){function c(e,b){var g=function(a,g){return k(a,e,function(d){if(b)return b(d,g);if(!j.isDescendant(d.relatedTarget,a))return g.call(this,d)})};g.bubble=function(a){return c(e,function(b,d){var g=a(b.target),c=b.relatedTarget;
+if(g&&g!=(c&&1==c.nodeType&&a(c)))return d.call(g,b)})};return g}h.add("dom-quirks",e.doc&&"BackCompat"==e.doc.compatMode);h.add("events-mouseenter",e.doc&&"onmouseenter"in e.doc.createElement("div"));h.add("events-mousewheel",e.doc&&"onmousewheel"in e.doc);e=h("dom-quirks")&&h("ie")||!h("dom-addeventlistener")?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(c,b){return c.button&b},isLeft:function(c){return c.button&1},isMiddle:function(c){return c.button&4},isRight:function(c){return c.button&2}}:{LEFT:0,
+MIDDLE:1,RIGHT:2,isButton:function(c,b){return c.button==b},isLeft:function(c){return 0==c.button},isMiddle:function(c){return 1==c.button},isRight:function(c){return 2==c.button}};f.mouseButtons=e;f=h("events-mousewheel")?"mousewheel":function(c,b){return k(c,"DOMMouseScroll",function(g){g.wheelDelta=-g.detail;b.call(this,g)})};return{_eventHandler:c,enter:c("mouseover"),leave:c("mouseout"),wheel:f,isLeft:e.isLeft,isMiddle:e.isMiddle,isRight:e.isRight}})},"dojo/keys":function(){define(["./_base/kernel",
+"./sniff"],function(f,k){return f.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:k("webkit")?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,
+NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,UP_DPAD:175,DOWN_DPAD:176,LEFT_DPAD:177,RIGHT_DPAD:178,copyKey:k("mac")&&!k("air")?k("safari")?91:224:17}})},"dojo/_base/Color":function(){define(["./kernel","./lang","./array","./config"],function(f,k,h,j){var e=f.Color=function(c){c&&this.setColor(c)};e.named={black:[0,0,0],silver:[192,192,192],gray:[128,
+128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:j.transparentColor||[0,0,0,0]};k.extend(e,{r:255,g:255,b:255,a:1,_set:function(c,e,b,g){this.r=c;this.g=e;this.b=b;this.a=g},setColor:function(c){k.isString(c)?e.fromString(c,this):k.isArray(c)?e.fromArray(c,this):(this._set(c.r,c.g,c.b,c.a),c instanceof e||
+this.sanitize());return this},sanitize:function(){return this},toRgb:function(){return[this.r,this.g,this.b]},toRgba:function(){return[this.r,this.g,this.b,this.a]},toHex:function(){return"#"+h.map(["r","g","b"],function(c){c=this[c].toString(16);return 2>c.length?"0"+c:c},this).join("")},toCss:function(c){var e=this.r+", "+this.g+", "+this.b;return(c?"rgba("+e+", "+this.a:"rgb("+e)+")"},toString:function(){return this.toCss(!0)}});e.blendColors=f.blendColors=function(c,f,b,g){var a=g||new e;h.forEach(["r",
+"g","b","a"],function(g){a[g]=c[g]+(f[g]-c[g])*b;"a"!=g&&(a[g]=Math.round(a[g]))});return a.sanitize()};e.fromRgb=f.colorFromRgb=function(c,f){var b=c.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return b&&e.fromArray(b[1].split(/\s*,\s*/),f)};e.fromHex=f.colorFromHex=function(c,f){var b=f||new e,g=4==c.length?4:8,a=(1<>=g;b[e]=4==g?17*d:d});b.a=1;return b};e.fromArray=f.colorFromArray=function(c,
+f){var b=f||new e;b._set(Number(c[0]),Number(c[1]),Number(c[2]),Number(c[3]));if(isNaN(b.a))b.a=1;return b.sanitize()};e.fromString=f.colorFromString=function(c,f){var b=e.named[c];return b&&e.fromArray(b,f)||e.fromRgb(c,f)||e.fromHex(c,f)};return e})},"dojo/_base/browser":function(){require.has&&require.has.add("config-selectorEngine","acme");define("../ready,./kernel,./connect,./unload,./window,./event,./html,./NodeList,../query,./xhr,./fx".split(","),function(f){return f})},"dojo/_base/unload":function(){define(["./kernel",
+"./lang","../on"],function(f,k,h){var j=window,e={addOnWindowUnload:function(c,e){if(!f.windowUnloaded)h(j,"unload",f.windowUnloaded=function(){});h(j,"unload",k.hitch(c,e))},addOnUnload:function(c,e){h(j,"beforeunload",k.hitch(c,e))}};f.addOnWindowUnload=e.addOnWindowUnload;f.addOnUnload=e.addOnUnload;return e})},"dojo/_base/html":function(){define("./kernel,../dom,../dom-style,../dom-attr,../dom-prop,../dom-class,../dom-construct,../dom-geometry".split(","),function(f,k,h,j,e,c,i,b){f.byId=k.byId;
+f.isDescendant=k.isDescendant;f.setSelectable=k.setSelectable;f.getAttr=j.get;f.setAttr=j.set;f.hasAttr=j.has;f.removeAttr=j.remove;f.getNodeProp=j.getNodeProp;f.attr=function(b,a,c){return 2==arguments.length?j["string"==typeof a?"get":"set"](b,a):j.set(b,a,c)};f.hasClass=c.contains;f.addClass=c.add;f.removeClass=c.remove;f.toggleClass=c.toggle;f.replaceClass=c.replace;f._toDom=f.toDom=i.toDom;f.place=i.place;f.create=i.create;f.empty=function(b){i.empty(b)};f._destroyElement=f.destroy=function(b){i.destroy(b)};
+f._getPadExtents=f.getPadExtents=b.getPadExtents;f._getBorderExtents=f.getBorderExtents=b.getBorderExtents;f._getPadBorderExtents=f.getPadBorderExtents=b.getPadBorderExtents;f._getMarginExtents=f.getMarginExtents=b.getMarginExtents;f._getMarginSize=f.getMarginSize=b.getMarginSize;f._getMarginBox=f.getMarginBox=b.getMarginBox;f.setMarginBox=b.setMarginBox;f._getContentBox=f.getContentBox=b.getContentBox;f.setContentSize=b.setContentSize;f._isBodyLtr=f.isBodyLtr=b.isBodyLtr;f._docScroll=f.docScroll=
+b.docScroll;f._getIeDocumentElementOffset=f.getIeDocumentElementOffset=b.getIeDocumentElementOffset;f._fixIeBiDiScrollLeft=f.fixIeBiDiScrollLeft=b.fixIeBiDiScrollLeft;f.position=b.position;f.marginBox=function(g,a){return a?b.setMarginBox(g,a):b.getMarginBox(g)};f.contentBox=function(g,a){return a?b.setContentSize(g,a):b.getContentBox(g)};f.coords=function(g,a){f.deprecated("dojo.coords()","Use dojo.position() or dojo.marginBox().");var g=k.byId(g),c=h.getComputedStyle(g),c=b.getMarginBox(g,c),d=
+b.position(g,a);c.x=d.x;c.y=d.y;return c};f.getProp=e.get;f.setProp=e.set;f.prop=function(b,a,c){return 2==arguments.length?e["string"==typeof a?"get":"set"](b,a):e.set(b,a,c)};f.getStyle=h.get;f.setStyle=h.set;f.getComputedStyle=h.getComputedStyle;f.__toPixelValue=f.toPixelValue=h.toPixelValue;f.style=function(b,a,c){switch(arguments.length){case 1:return h.get(b);case 2:return h["string"==typeof a?"get":"set"](b,a)}return h.set(b,a,c)};return f})},"dojo/dom-attr":function(){define("exports,./sniff,./_base/lang,./dom,./dom-style,./dom-prop".split(","),
+function(f,k,h,j,e,c){function i(a,b){var d=a.getAttributeNode&&a.getAttributeNode(b);return d&&d.specified}var b={innerHTML:1,className:1,htmlFor:k("ie"),value:1},g={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"};f.has=function(a,e){var d=e.toLowerCase();return b[c.names[d]||e]||i(j.byId(a),g[d]||e)};f.get=function(a,e){var a=j.byId(a),d=e.toLowerCase(),f=c.names[d]||e,m=a[f];if(b[f]&&"undefined"!=typeof m||"href"!=f&&("boolean"==typeof m||h.isFunction(m)))return m;d=g[d]||
+e;return i(a,d)?a.getAttribute(d):null};f.set=function(a,l,d){a=j.byId(a);if(2==arguments.length){for(var i in l)f.set(a,i,l[i]);return a}i=l.toLowerCase();var m=c.names[i]||l,k=b[m];if("style"==m&&"string"!=typeof d)return e.set(a,d),a;if(k||"boolean"==typeof d||h.isFunction(d))return c.set(a,l,d);a.setAttribute(g[i]||l,d);return a};f.remove=function(a,b){j.byId(a).removeAttribute(g[b.toLowerCase()]||b)};f.getNodeProp=function(a,b){var a=j.byId(a),d=b.toLowerCase(),e=c.names[d]||b;if(e in a&&"href"!=
+e)return a[e];d=g[d]||b;return i(a,d)?a.getAttribute(d):null}})},"dojo/dom-prop":function(){define("exports,./_base/kernel,./sniff,./_base/lang,./dom,./dom-style,./dom-construct,./_base/connect".split(","),function(f,k,h,j,e,c,i,b){var g={},a=0,l=k._scopeName+"attrid";f.names={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"};f.get=function(a,b){var a=e.byId(a),g=b.toLowerCase();return a[f.names[g]||
+b]};f.set=function(d,k,m){d=e.byId(d);if(2==arguments.length&&"string"!=typeof k){for(var n in k)f.set(d,n,k[n]);return d}n=k.toLowerCase();n=f.names[n]||k;if("style"==n&&"string"!=typeof m)return c.set(d,m),d;if("innerHTML"==n)return h("ie")&&d.tagName.toLowerCase()in{col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1}?(i.empty(d),d.appendChild(i.toDom(m,d.ownerDocument))):d[n]=m,d;if(j.isFunction(m)){var o=d[l];o||(o=a++,d[l]=o);g[o]||(g[o]={});var r=g[o][n];if(r)b.disconnect(r);else try{delete d[n]}catch(q){}m?
+g[o][n]=b.connect(d,n,m):d[n]=null;return d}d[n]=m;return d}})},"dojo/dom-construct":function(){define("exports,./_base/kernel,./sniff,./_base/window,./dom,./dom-attr,./on".split(","),function(f,k,h,j,e,c,i){function b(a,b){var d=b.parentNode;d&&d.insertBefore(a,b)}var g={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},
+a=/<\s*([\w\:]+)/,l={},d=0,p="__"+k._scopeName+"ToDomId",m;for(m in g)if(g.hasOwnProperty(m))k=g[m],k.pre="option"==m?'',_buttonInputDisabled:c("ie")?"disabled":"",baseClass:"dijitTextBox",postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&"input"==this.templateString.toLowerCase()||("hidden"==a||"file"==a)&&this.templateString==
+this.constructor.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},postCreate:function(){this.inherited(arguments);9>c("ie")&&this.defer(function(){try{var a=h.getComputedStyle(this.domNode);if(a){var b=a.fontFamily;if(b){var c=this.domNode.getElementsByTagName("INPUT");if(c)for(a=0;ab?1:aj("ie")||j("ie")&&j("quirks"))){c.preventDefault();var e=c.srcElement,b=e.ownerDocument.createEventObject();b.keyCode=h.ESCAPE;b.shiftKey=c.shiftKey;e.fireEvent("onkeypress",b)}}})})},"dijit/form/_TextBoxMixin":function(){define("dojo/_base/array,dojo/_base/declare,dojo/dom,dojo/_base/event,dojo/keys,dojo/_base/lang,dojo/on,../main".split(","),function(f,k,h,j,e,c,i,b){var g=
+k("dijit.form._TextBoxMixin",null,{trim:!1,uppercase:!1,lowercase:!1,propercase:!1,maxLength:"",selectOnClick:!1,placeHolder:"",_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,b,c){var g;void 0!==a&&(g=this.filter(a),"string"!=typeof c&&(c=null!==g&&("number"!=typeof g||!isNaN(g))?this.filter(this.format(g,this.constraints)):""));if(null!=c&&("number"!=typeof c||!isNaN(c))&&this.textbox.value!=c)this.textbox.value=c,this._set("displayedValue",
+this.get("displayedValue"));"auto"==this.textDir&&this.applyTextDir(this.focusNode,c);this.inherited(arguments,[g,b])},displayedValue:"",_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},_setDisplayedValueAttr:function(a){null==a?a="":"string"!=typeof a&&(a=""+a);this.textbox.value=a;this._setValueAttr(this.get("value"),void 0);this._set("displayedValue",this.get("displayedValue"));"auto"==this.textDir&&this.applyTextDir(this.focusNode,a)},format:function(a){return null==a?
+"":a.toString?a.toString():a},parse:function(a){return a},_refreshState:function(){},onInput:function(){},__skipInputEvent:!1,_onInput:function(a){"auto"==this.textDir&&this.applyTextDir(this.focusNode,this.focusNode.value);this._processInput(a)},_processInput:function(){this._refreshState();this._set("displayedValue",this.get("displayedValue"))},postCreate:function(){this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);this.own(i(this.textbox,"keydown, keypress, paste, cut, input, compositionend",
+c.hitch(this,function(a){var b;if("keydown"==a.type){b=a.keyCode;switch(b){case e.SHIFT:case e.ALT:case e.CTRL:case e.META:case e.CAPS_LOCK:case e.NUM_LOCK:case e.SCROLL_LOCK:return}if(!a.ctrlKey&&!a.metaKey&&!a.altKey){switch(b){case e.NUMPAD_0:case e.NUMPAD_1:case e.NUMPAD_2:case e.NUMPAD_3:case e.NUMPAD_4:case e.NUMPAD_5:case e.NUMPAD_6:case e.NUMPAD_7:case e.NUMPAD_8:case e.NUMPAD_9:case e.NUMPAD_MULTIPLY:case e.NUMPAD_PLUS:case e.NUMPAD_ENTER:case e.NUMPAD_MINUS:case e.NUMPAD_PERIOD:case e.NUMPAD_DIVIDE:return}if(65<=
+b&&90>=b||48<=b&&57>=b||b==e.SPACE)return;b=!1;for(var d in e)if(e[d]===a.keyCode){b=!0;break}if(!b)return}}(b=32<=a.charCode?String.fromCharCode(a.charCode):a.charCode)||(b=65<=a.keyCode&&90>=a.keyCode||48<=a.keyCode&&57>=a.keyCode||a.keyCode==e.SPACE?String.fromCharCode(a.keyCode):a.keyCode);b||(b=229);if("keypress"==a.type){if("string"!=typeof b)return;if("a"<=b&&"z">=b||"A"<=b&&"Z">=b||"0"<=b&&"9">=b||" "===b)if(a.ctrlKey||a.metaKey||a.altKey)return}if("input"==a.type){if(this.__skipInputEvent){this.__skipInputEvent=
+!1;return}}else this.__skipInputEvent=!0;var g={faux:!0},f;for(f in a)"layerX"!=f&&"layerY"!=f&&(d=a[f],"function"!=typeof d&&"undefined"!=typeof d&&(g[f]=d));c.mixin(g,{charOrCode:b,_wasConsumed:!1,preventDefault:function(){g._wasConsumed=!0;a.preventDefault()},stopPropagation:function(){a.stopPropagation()}});!1===this.onInput(g)&&(g.preventDefault(),g.stopPropagation());g._wasConsumed||this.defer(function(){this._onInput(g)})})))},_blankValue:"",filter:function(a){if(null===a)return this._blankValue;
+if("string"!=typeof a)return a;this.trim&&(a=c.trim(a));this.uppercase&&(a=a.toUpperCase());this.lowercase&&(a=a.toLowerCase());this.propercase&&(a=a.replace(/[^\s]+/g,function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}));return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),!0)},_onBlur:function(a){this.disabled||(this._setBlurValue(),this.inherited(arguments))},_isTextSelected:function(){return this.textbox.selectionStart!=this.textbox.selectionEnd},_onFocus:function(a){if(!this.disabled&&
+!this.readOnly){if(this.selectOnClick&&"mouse"==a)this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);this._selectOnClickHandle=null;this._isTextSelected()||g.selectInputText(this.textbox)}),this.defer(function(){if(this._selectOnClickHandle)this.disconnect(this._selectOnClickHandle),this._selectOnClickHandle=null},500);this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)},
+_setTextDirAttr:function(a){if(!this._created||this.textDir!=a)this._set("textDir",a),this.applyTextDir(this.focusNode,this.focusNode.value)}});g._setSelectionRange=b._setSelectionRange=function(a,b,c){a.setSelectionRange&&a.setSelectionRange(b,c)};g.selectInputText=b.selectInputText=function(a,b,c){a=h.byId(a);isNaN(b)&&(b=0);isNaN(c)&&(c=a.value?a.value.length:0);try{a.focus(),g._setSelectionRange(a,b,c)}catch(e){}};return g})},"url:dijit/form/templates/TextBox.html":'