diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..e5b8bff --- /dev/null +++ b/INSTALL @@ -0,0 +1,55 @@ +SERVER REQUIREMENTS + + * Apache 2.x + * PHP 5.x + * (optional) mod_rewrite (for short URLs) + * (optional) php5-gd (for server-side image resizing) + + The current version of Hotglue was only extensively tested on Linux hosts. + + +CLIENT REQUIREMENTS + + * for editing: Mozilla Firefox (>= 3.6) or Google Chrome (>= 8.0) + + While we haven't tested it, editing could also work on any recent Safari version. + + * for viewing: the above plus Internet Explorer 8 (but keep IE8_COMPAT in the + config set to true) + + +INSTALLING HOTGLUE + + * copy the directory of the tarball to a directory that is accessible to the + server + * make sure the webserver can write to the content directory (e.g. by running + "chmod 0777 content" in the directory that you just copied the files to) + * it is recommended that you create a user-config.inc.php file where you + can overwrite the settings defined in config.inc.php. the former file won't + get overwritten by future updates. + * make sure that you at least set AUTH_PASSWORD to a non-default value. + * (optional) if your hosting environment allows you to use mod_rewrite and + you want to use short URLs for your pages, you can rename the htaccess-dist + file to .htaccess (e.g. by running "move htaccess-dist .htaccess") + + and finally + + * launch the directory's URL from a browser and add "?edit" to the address + (e.g. http://myserver.com/hotglue/?edit) to start editing + + If you are using the optional .htaccess file you can also start editing by + just adding "edit" (e.g. http://myserver.com/hotglue/edit). + + +DEBUGGING HOTGLUE + + If something breaks and you want to troubleshoot the problem it is helpful to + turn on PHP error reporting by setting or adding "error_reporting(E_ALL);" to + your user-config.inc.php file. + You can also set the LOG_LEVEL (see config.inc.php) to 'debug' in order to get + an overwhelming amount of logging information written to your log file, which + by default is in the content directory. + Requests from the client start in the log file with "--- request ---" and AJAX + requests with "--- json request ---". If you report a problem, make sure you + send with it only the relevant pieces of logging information (like the request + and all associated AJAX request that get written when the problem occurs). \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..2326ce8 --- /dev/null +++ b/README @@ -0,0 +1,25 @@ +Hotglue 1.0 + +developed by Gottfried Haider and Danja Vasiliev +and the people from WORM (wormweb.nl) +with support from the Mondriaan Foundation +made for you + + +HOW TO INSTALL ADDITIONAL MODULES + + .. + + +BUNDLED THIRD-PARTY CODE + + * jQuery (MIT, BSD and GPL licensed) + * jQuery UI (MIT, GPLv2 licensed) + * Farbtastic: JQuery color picker plug-in (GPL licensed) + * jQuery xcolor (MIT, GPLv2 licensed) + * the file icon has been taken from gnome-icon-theme (GPL licensed) + + +KNOWN ISSUES + + .. \ No newline at end of file diff --git a/common.inc.php b/common.inc.php new file mode 100644 index 0000000..f364376 --- /dev/null +++ b/common.inc.php @@ -0,0 +1,531 @@ +<?php + +/** + * common.inc.php + * Common hotglue infrastructure + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('html.inc.php'); + + +/** + * save a page in the cache + * + * @param string $category cache category (e.g. 'page') + * @param string $name item name + * @param string $out content + * @return true if successful, false if not + */ +function cache_output($category, $name, $out) +{ + // check if cache dir exists + $f = CONTENT_DIR.'/cache'; + if (!is_dir($f)) { + $m = umask(0000); + if (!@mkdir($f, 0777)) { + umask($m); + log_msg('error', 'common: cannot create cache directory '.quot($f)); + return false; + } + umask($m); + } + + // check if category subdirectory exists + $f .= '/'.$category; + if (!is_dir($f)) { + $m = umask(0000); + if (!@mkdir($f, 0777)) { + umask($m); + log_msg('error', 'common: cannot create cache directory '.quot($f)); + return false; + } + umask($m); + } + + // save file + $f .= '/'.$name; + $m = umask(0111); + if (!file_put_contents($f, $out)) { + umask($m); + log_msg('error', 'common: error writing cache file '.quot($f)); + return false; + } + umask($m); + + log_msg('debug', 'common: cached '.$category.' '.quot($name)); + return true; +} + + +/** + * setup a default html page + * + * see html.inc.php. + * @param bool $add_glue true for adding the glue code + */ +function default_html($add_glue) +{ + html_title(SITE_NAME); + $favicon = FAVICON; + if (!empty($favicon)) { + if (is_url($favicon)) { + html_favicon($favicon); + } else { + html_favicon(base_url().$favicon); + } + } + if (USE_MIN_FILES) { + html_add_css(base_url().'css/reset.min.css', 1); + } else { + html_add_css(base_url().'css/reset.css', 1); + } + // 2 can be used for third-party components + html_add_css(base_url().'css/main.css', 3); + if ($add_glue) { + html_add_css(base_url().'css/glue.css', 4); + } + if ($add_glue) { + $jquery = JQUERY; + if (is_url($jquery)) { + html_add_js($jquery, 1); + } else { + html_add_js(base_url().$jquery, 1); + } + // 2 can be used for third-party components + html_add_js(base_url().'js/glue.js', 3); + html_add_js_var('$.glue.base_url', base_url()); + html_add_js_var('$.glue.version', glue_version()); + } +} + + +/** + * remove a page from the cache + * + * @param string $category cache category (e.g. 'page') + * @param string $name item name + */ +function drop_cache($category, $name) +{ + $f = CONTENT_DIR.'/cache/'.$category.'/'.$name; + if (@unlink($f)) { + log_msg('debug', 'common: dropped cache of '.$category.' '.quot($name)); + } +} + + +/** + * return the glue version with api.version.patchlevel + * + * @return array (with length three) + */ +function glue_version() +{ + $a = expl('.', HOTGLUE_VERSION); + $ret = array(0, 0, 0); + for ($i=0; $i < count($a); $i++) { + $ret[$i] = $a[$i]; + } + return $ret; +} + + +/** + * check if a page can be served from the cache + * + * @param string $category cache category (e.g. 'page') + * @param string $name item name + * @param int $max_age serve from cache when younger than $max_age seconds + * @return bool true if the page can be served from cache, false if not + */ +function is_cached($category, $name, $max_age) +{ + $f = CONTENT_DIR.'/cache/'.$category.'/'.$name; + if (!is_file($f)) { + return false; + } + // check the file's age + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + clearstatcache(true, realpath($f)); + } else { + clearstatcache(); + } + $age = filemtime($f); + if ($max_age < abs(time()-$age)) { + return false; + } else { + return true; + } +} + + +// TODO: document +function resolve_aliases($s, $name = '') +{ + // base url + $s = str_replace('$BASEURL$', base_url(), $s); + $s = str_replace('$baseurl$', base_url(), $s); + // version number + $s = str_replace('$GLUE$', HOTGLUE_VERSION, $s); + $s = str_replace('$glue$', HOTGLUE_VERSION, $s); + if (!empty($name)) { + // current object + $s = str_replace('$OBJ$', $name, $s); + $s = str_replace('$obj$', $name, $s); + // current page + $s = str_replace('$PAGE$', implode('.', array_slice(expl('.', $name), 0, 2)), $s); + $s = str_replace('$page$', implode('.', array_slice(expl('.', $name), 0, 2)), $s); + // pagename + $s = str_replace('$PAGENAME$', array_shift(expl('.', $name)), $s); + $s = str_replace('$pagename$', array_shift(expl('.', $name)), $s); + // revision + $s = str_replace('$REV$', array_shift(array_slice(expl('.', $name), 1, 1)), $s); + $s = str_replace('$rev$', array_shift(array_slice(expl('.', $name), 1, 1)), $s); + } + return $s; +} + + +// TODO: document +function resolve_relative_urls($s) +{ + $attrs = array('href', 'src'); + + foreach ($attrs as $attr) { + $start = 0; + while (($start = strpos($s, $attr.'="', $start)) !== false) { + if (($end = strpos($s, '"', $start+strlen($attr)+2)) !== false) { + $link = substr($s, $start+strlen($attr)+2, $end-$start-strlen($attr)-2); + if (!is_url($link) && substr($link, 0, 1) != '#') { + // add base url for relative links that are not directed towards anchors + log_msg('debug', 'common: resolving relative url '.quot($link)); + if (SHORT_URLS) { + $link = base_url().$link; + } else { + $link = base_url().'?'.$link; + } + } else { + log_msg('debug', 'common: not resolving url '.quot($link)); + } + $start = $end+1; + } else { + break; + } + } + } + return $s; +} + + +/** + * output a cached page to the client + * + * @param string $category cache category (e.g. 'page') + * @param string $name item name + * @return true if successful, false if not + */ +function serve_cached($category, $name) +{ + $f = CONTENT_DIR.'/cache/'.$category.'/'.$name; + if (@readfile($f)) { + log_msg('info', 'common: serving '.$category.' '.quot($name).' from cache'); + return true; + } else { + log_msg('error', 'common: cannot serve '.$category.' '.quot($name).' from cache'); + return false; + } +} + + +/** + * return the starting page + * + * @return string + */ +function startpage() +{ + // read the starting page information from the content dir + // or fall back to the one defined in the configuration + $s = @file_get_contents(CONTENT_DIR.'/startpage'); + if ($s !== false && 0 < strlen($s)) { + return $s; + } else { + $s = DEFAULT_PAGE; + page_canonical($s); + return $s; + } +} + + +/** + * check if the user is authenticated or not + * + * @return true if authenticated, false if not + */ +function is_auth() +{ + if (AUTH_METHOD == 'none') { + log_msg('debug', 'common: auth success (auth_method none)'); + return true; + } elseif (AUTH_METHOD == 'basic') { + if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { + if ($_SERVER['PHP_AUTH_USER'] == AUTH_USER && $_SERVER['PHP_AUTH_PW'] == AUTH_PASSWORD) { + log_msg('debug', 'common: auth success (auth_method basic)'); + return true; + } else { + log_msg('info', 'common: auth failure (auth_method basic)'); + return false; + } + } else { + log_msg('debug', 'common: no auth data (auth_method basic)'); + return false; + } + } elseif (AUTH_METHOD == 'digest') { + if (isset($_SERVER['PHP_AUTH_DIGEST'])) { + log_msg('debug', 'common: auth digest '.var_dump_inl($_SERVER['PHP_AUTH_DIGEST'])); + $res = http_digest_check(array(AUTH_USER=>AUTH_PASSWORD), SITE_NAME); + if ($res == 0) { + log_msg('debug', 'common: auth success (auth_method digest)'); + return true; + } else { + log_msg('info', 'common: auth failure '.$res.' (auth_method digest)'); + return false; + } + } + } else { + log_msg('error', 'common: invalid or missing AUTH_METHOD config setting'); + return false; + } +} + + +/** + * check if an object exists + * + * @param $s object (e.g. page.rev.obj) + * @return bool + */ +function object_exists($s) +{ + $a = expl('.', $s); + // we need not check if any of $a[..] is empty as the resulting string + // cannot be a file anyway + if (2 < count($a) && is_file(CONTENT_DIR.'/'.str_replace('.', '/', $s))) { + return true; + } else { + return false; + } +} + + +/** + * turn short page names into canonical ones + * + * if $s is not a page, the string is not altered. + * @param string &$s reference to the page name + */ +function page_canonical(&$s) +{ + $a = expl('.', $s); + // assume head revision + if (count($a) == 1) { + $s .= '.head'; + } +} + + +/** + * check if a page exists + * + * this function can also be used with object names (e.g. page.rev.obj). + * @param $s page + * @return bool + */ +function page_exists($s) +{ + $a = expl('.', $s); + if (1 < count($a) && !empty($a[0]) && !empty($a[1]) && is_dir(CONTENT_DIR.'/'.$a[0].'/'.$a[1])) { + return true; + } else { + return false; + } +} + + +/** + * return the short pagename if possible, otherwise the long one + * + * @param $s page + * @return string + */ +function page_short($s) +{ + $a = expl('.', $s); + if (count($a) == 1) { + return $s; + } elseif (count($a) == 2 && $a[1] == 'head') { + return $a[0]; + } elseif (count($a) == 2) { + return $s; + } else { + return ''; + } +} + + +/** + * prompt user for authentication + * + * @param bool $header_only only send header information + * this function does not return. + */ +function prompt_auth($header_only = false) +{ + if (AUTH_METHOD == 'none') { + // nothing to do here + } elseif (AUTH_METHOD == 'basic') { + header('WWW-Authenticate: Basic realm="'.str_replace("\"", '', SITE_NAME).'"'); + header($_SERVER['SERVER_PROTOCOL'].' 401 Unauthorized'); + } elseif (AUTH_METHOD == 'digest') { + http_digest_prompt(SITE_NAME); + } else { + log_msg('error', 'common: invalid or missing AUTH_METHOD config setting'); + } + // TODO (listed): we need hotglue theming here + die(); +} + + +/** + * move an uploaded file to the shared directory of a page + * + * this function reuses existing files when possible. + * @param string $fn filename of newly uploaded file (most likely in /tmp) + * @param string $page page or pagename + * @param string $orig_fn the original filename on the client machine (optional) + * @param bool &$existed set to true if the filename returned did already exist + * before + * @return filename inside the shared directory or false in case of error + */ +function upload_file($fn, $page, $orig_fn = '', &$existed = false) +{ + // default to the temporary filename + if ($orig_fn == '') { + $orig_fn = $fn; + } + + $a = expl('.', $page); + if (count($a) < 1 || !is_dir(CONTENT_DIR.'/'.$a[0])) { + log_msg('error', 'common: page '.quot($page).' does not exist, cannot move uploaded file'); + // not sure if we ought to remove the file in /tmp here (probably not) + return false; + } + + // create shared directory if it doesn't exist yet + $d = CONTENT_DIR.'/'.$a[0].'/shared'; + if (!is_dir($d)) { + $m = umask(0000); + if (!@mkdir($d, 0777)) { + umask($m); + log_msg('error', 'common: cannot create shared directory '.quot($d).', cannot move uploaded file'); + // not sure if we ought to remove the file in /tmp here (probably not) + return false; + } + umask($m); + } + + // check if file is already in shared directory + // try the same filename first + $f = $d.'/'.basename($orig_fn); + if (is_file($f)) { + if (!file_is_different($f, $fn)) { + log_msg('info', 'common: reusing file '.quot($f).' instead of newly uploaded file as they don\'t differ'); + @unlink($fn); + $existed = true; + // we only return the basename + return basename($f); + } + } + // we are greedy so check all other files in shared folder too + $files = scandir($d); + foreach ($files as $f) { + if ($f == '.' || $f == '..' || $f == basename($orig_fn)) { + continue; + } + $f = $d.'/'.$f; + if (!file_is_different($f, $fn)) { + log_msg('info', 'common: reusing file '.quot($f).' instead of newly uploaded file as they don\'t differ'); + @unlink($fn); + $existed = true; + // again, only the basename.. + return basename($f); + } + } + + // okay, we give up + // at least find a unique name for the file + $f = basename($orig_fn); + $num = 1; + // the is_link() is there to cover dangling symlinks + while (is_file($d.'/'.$f) || is_link($d.'/'.$f)) { + // find first dot and prepend _2 there + $f = basename($orig_fn); + if (($p = strpos($f, '.')) !== false) { + $f = substr($f, 0, $p).'_'.(++$num).substr($f, $p); + } else { + $f .= '_'.(++$num); + } + } + $m = umask(0111); + if (!@move_uploaded_file($fn, $d.'/'.$f)) { + umask($m); + log_msg('error', 'common: error moving uploaded file to '.quot($d.'/'.$f)); + // not sure if we ought to remove the file in /tmp here (probably not) + return false; + } else { + umask($m); + log_msg('info', 'common: moved uploaded file to '.quot($d.'/'.$f)); + $existed = false; + return $f; + } +} + + +/** + * check whether the string is a valid, canonical page name + * + * the function does not check if the page exists or not. + * @param string $s string to check + * @return bool + */ +function valid_pagename($s) +{ + $a = expl('.', $s); + if (count($a) != 2) { + return false; + } elseif (empty($a[0]) || empty($a[1])) { + return false; + } elseif (in_array($a[0], array('cache', 'startpage'))) { + // reserved page names + // TODO (later): we're missing the log file here + // TODO (later): we're also missing $arg0 of controllers here + return false; + } elseif (in_array($a[1], array('shared'))) { + // reserved revision names + return false; + } elseif (is_file($a[0]) || is_dir($a[0]) || is_link($a[0])) { + // same name as existing file names in the root directory + // this is an issue when using the RewriteRule + return false; + } else { + return true; + } +} + + +?> diff --git a/config.inc.php b/config.inc.php new file mode 100644 index 0000000..afcd3d2 --- /dev/null +++ b/config.inc.php @@ -0,0 +1,86 @@ +<?php + + +/** + * These are the default configuration settings of this hotglue + * installation. Do not edit this file directly but overwrite specific + * variables by setting them in the user-config.inc.php file, which + * will not be overwritten by future updates. + */ + + +error_reporting(E_ALL); // see php documentation +define('AUTH_METHOD', 'digest'); // can be digest, basic or none +define('AUTH_USER', 'admin'); +define('AUTH_PASSWORD', 'changeme'); +define('BASE_URL', ''); // auto-detected if empty (don't use BASE_URL in custom code but rather base_url() below) +define('CACHE_TIME', 60*60); // cache time in seconds (zero to disable) +define('CONTENT_DIR', 'content'); // content directory, must be writable +define('DEFAULT_PAGE', 'start'); +define('FAVICON', 'img/favicon.ico'); // can be empty or an absolute url +define('HOTGLUE_VERSION', '0.99.0'); // expected api.version.patchlevel +define('IE8_COMPAT', true); // try to be compatible with internet explorer 8 in viewing mode +define('JQUERY', 'js/jquery-1.4.4.min.js'); // can be an absolute url +define('LOCK_TIME', 5000); // maximum time in ms to wait for an object lock +define('LOG_FILE', 'content/log.txt'); // log file, must be writable +define('LOG_LEVEL', 'warn'); // minimum log level (can be error, warn, info, debug) +define('SHORT_URLS', false); // use short urls +define('SITE_NAME', 'hotglue 1.0'); +define('SNAPSHOT_MAX_AGE', 60*60*24*7); // auto- revisions are automatically deleted after n seconds (zero to disable) +define('SNAPSHOT_MIN_AGE', 60*60); // auto- revisions are created every n seconds (zero to disable) +define('USE_MIN_FILES', true); // use minified files if possible (see also JQUERY define) +// default modules +define('IMAGE_JPEG_QUAL', 80); // quality for jpeg resizing (0 < 100) +define('IMAGE_PNG_QUAL', 5); // quality for png resizing (9 < 0) +define('IMAGE_RESIZING', true); // resize uploaded images on the server (needs gd installed) +define('OBJECT_DEFAULT_COLORS', '#61b9cf #ff00ff #ffff00'); // default colors for new objects (space-separated string) +define('PAGE_DEFAULT_GRID_X', 50); // default grid x spacing in px +define('PAGE_DEFAULT_GRID_Y', 50); // default grid y spacing in px +define('PAGE_GUIDES_X', ''); // show a grid line after n horizontal px (space-separated string) +define('PAGE_GUIDES_Y', ''); // show a grid line after n vertical px (space-separated string) +define('PAGES_NEED_AUTH', true); // page browser needs authentication +define('REVISIONS_NEED_AUTH', true); // revisions browser needs authentication +define('TEXT_AUTO_BR', true); // automatically add <br> elements for newlines +define('VIDEO_START_ON_CLICK', true); // start video on click when autoplay is off + + + +// try to include user configuration +@include('user-config.inc.php'); + +/** + * use this function to get the site's base url + * + * @return string base url (not html-encoded) + */ +function base_url() +{ + global $base_url_cached; + + $temp = BASE_URL; + if (!empty($temp)) { + return $temp; + } elseif (!isset($base_url_cached)) { + if (empty($_SERVER['HTTPS'])) { + $base_url_cached = 'http://'.$_SERVER['HTTP_HOST']; + if ($_SERVER['SERVER_PORT'] != '80') { + $base_url_cached .= $_SERVER['SERVER_PORT']; + } + } else { + $base_url_cached = 'https://'.$_SERVER['HTTP_HOST']; + if ($_SERVER['SERVER_PORT'] != '443') { + $base_url_cached .= $_SERVER['SERVER_PORT']; + } + } + $base_url_cached .= dirname($_SERVER['PHP_SELF']); + // make sure we have a trailing slash at the end + if (substr($base_url_cached, -1) != '/') { + $base_url_cached .= '/'; + } + } + + return $base_url_cached; +} + + +?> diff --git a/content/.htaccess b/content/.htaccess new file mode 100644 index 0000000..3418e55 --- /dev/null +++ b/content/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file diff --git a/controller.inc.php b/controller.inc.php new file mode 100644 index 0000000..7e11afc --- /dev/null +++ b/controller.inc.php @@ -0,0 +1,392 @@ +<?php + +/** + * controller.inc.php + * Generic dispatcher code mixed with some hotglue-specific controllers + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('common.inc.php'); +require_once('html.inc.php'); +require_once('log.inc.php'); +require_once('modules.inc.php'); +// module glue gets loaded on demand +require_once('util.inc.php'); + +if (!isset($controllers)) { + $controllers = array(); +} + + + +/** + * show a site where authenticated users can create new pages + */ +function controller_create_page($args) +{ + page_canonical($args[0][0]); + $page = $args[0][0]; + if (page_exists($page)) { + log_msg('debug', 'controller_create_page: page '.quot($page).'already exists, invoking controller_edit'); + controller_edit($args); + return; + } + + load_modules('glue'); + default_html(true); + html_add_css(base_url().'css/create_page.css'); + html_add_js(base_url().'js/create_page.js'); + html_add_js_var('$.glue.page', $page); + $bdy = &body(); + elem_attr($bdy, 'id', 'create_page'); + body_append('<form>'); + // TODO (listed): we need hotglue theming here + body_append('<p>The page you are trying to access does not exist yet</p>'); + body_append('<input id="create_page_btn" type="button" value="Create it">'); + body_append('</form>'); + echo html_finalize(); +} + +register_controller('*', 'create_page', 'controller_create_page', array('auth'=>true)); + + +/** + * show a site to edit pages + */ +function controller_edit($args) +{ + // most of these checks are only necessary if the client calls + // page/edit directly + page_canonical($args[0][0]); + $page = $args[0][0]; + if (!page_exists($page)) { + log_msg('debug', 'controller_edit: page '.quot($page).' does not exist, invoking controller_create_page'); + controller_create_page($args); + return; + } + + // create page on the fly + load_modules('glue'); + default_html(true); + html_add_js_var('$.glue.page', $page); + html_add_css(base_url().'css/farbtastic.css', 2); + html_add_css(base_url().'css/edit.css', 5); + if (USE_MIN_FILES) { + html_add_js(base_url().'js/jquery-ui-1.8.6.custom.min.js', 2); + } else { + html_add_js(base_url().'js/jquery-ui-1.8.6.custom.js', 2); + } + if (USE_MIN_FILES) { + html_add_js(base_url().'js/farbtastic.min.js', 2); + } else { + html_add_js(base_url().'js/farbtastic.js', 2); + } + html_add_js(base_url().'js/jquery.xcolor-1.2.1.js', 2); + html_add_js(base_url().'js/edit.js', 4); + render_page(array('page'=>$page, 'edit'=>true)); + echo html_finalize(); + + log_msg('debug', 'controller_edit: invoking check_auto_snapshot'); + check_auto_snapshot(array('page'=>$page)); +} + +register_controller('*', 'edit', 'controller_edit', array('auth'=>true)); + + +/** + * this is the default (fallback) controller + * + * it mainly invokes other controllers or sends error messages + */ +function controller_default($args) +{ + if (empty($args[0][0]) && empty($args[0][1])) { + // take the default page + $args[0][0] = startpage(); + log_msg('debug', 'controller_default: using the default page'); + } elseif ($args[0][0] == 'edit' && empty($args[0][1])) { + // quirk: edit the default page + $args[0][0] = startpage(); + $args[0][1] = 'edit'; + log_msg('debug', 'controller_default: using the default page'); + invoke_controller($args); + return; + } + + page_canonical($args[0][0]); + $obj = expl('.', $args[0][0]); + if (count($obj) == 2) { + // page requested + if (page_exists($args[0][0])) { + log_msg('debug', 'controller_default: invoking controller_show'); + controller_show($args); + } elseif (is_auth()) { + log_msg('debug', 'controller_default: invoking controller_create_page'); + controller_create_page($args); + } else { + log_msg('info', 'controller_default: page '.quot($args[0][0]).' not found, serving 404'); + http_404(); + } + } else { + // possibly object requested + if (object_exists($args[0][0])) { + // try to serve upload + if (isset($args['download']) && $args['download']) { + // prompt file save dialog on client + $dl = true; + } else { + $dl = false; + } + log_msg('debug', 'controller_default: invoking serve_resource'); + if (!serve_resource($args[0][0], $dl)) { + log_msg('info', 'controller_default: object '.quot($args[0][0]).' has no associated resource, serving 404'); + http_404(); + } + } else { + log_msg('info', 'controller_default: object '.quot($args[0][0]).' not found, serving 404'); + http_404(); + } + } +} + +register_controller('*', '*', 'controller_default'); + + +/** + * promt the user to authenticate + * + * this might be helpful as other controller's authentication seem to be only + * valid for the respective directory. (e.g. having privileges in '/foo/edit' + * does not seem to have an effect on the parent directory or any other sibling + * directory. + */ +function controller_login($args) +{ + if (!is_auth()) { + prompt_auth(); + } else { + // redirect + if (SHORT_URLS) { + header('Location: '.base_url().'pages'); + } else { + header('Location: '.base_url().'?pages'); + } + die(); + } +} + +register_controller('login', '', 'controller_login'); + + +/** + * show a page + */ +function controller_show($args) +{ + // most of these checks are only necessary if the client calls + // page/show directly + page_canonical($args[0][0]); + $page = $args[0][0]; + if (!page_exists($page)) { + log_msg('info', 'controller_show: page '.quot($page).' not found, serving 404'); + http_404(); + } + + // serve from page if possible + if (0 < CACHE_TIME && is_cached('page', $page, CACHE_TIME)) { + serve_cached('page', $page); + die(); + } + + // otherwise create page on the fly + load_modules('glue'); + default_html(false); + $cache_page = true; + render_page(array('page'=>$page, 'edit'=>false)); + // the $cache_page parameter is set by the html_finalize() + $html = html_finalize($cache_page); + echo $html; + + // and cache it + if (0 < CACHE_TIME && $cache_page) { + cache_output('page', $page, $html); + } +} + +register_controller('*', 'show_page', 'controller_show'); + + + +/** + * invoke a controller based on the query arguments given + * + * this function does not return in case of an error. + * @param array $args query-arguments array + * @return mixed return value of controller that was called + */ +function invoke_controller($args) +{ + global $controllers; + + // change query-arguments so that we always have a arg0 and arg1 + if (!isset($args[0])) { + $args[0] = array('', ''); + } elseif (is_string($args[0])) { + $args[0] = array($args[0], ''); + } + + // load all modules + // TODO (later): fastpath for serving cached pages or files (the latter one + // is only doable when we store in the object file which module to load) + load_modules(); + + $match = false; + if (isset($controllers[$args[0][0].'-'.$args[0][1]])) { + // foo/bar would match controller for "foo/bar" + $match = $controllers[$args[0][0].'-'.$args[0][1]]; + $reason = $args[0][0].'/'.$args[0][1]; + } elseif (isset($controllers[$args[0][0].'-*'])) { + // foo/bar would match "foo/*" + $match = $controllers[$args[0][0].'-*']; + $reason = $args[0][0].'/*'; + } elseif (isset($controllers['*-'.$args[0][1]])) { + // foo/bar would match "*/bar" + $match = $controllers['*-'.$args[0][1]]; + $reason = '*/'.$args[0][1]; + } elseif (isset($controllers['*-*'])) { + // foo/bar would match "*/*" + $match = $controllers['*-*']; + $reason = '*/*'; + } + + if ($match !== false) { + // check authentication for those controllers that require it + if (isset($match['auth']) && $match['auth']) { + if (!is_auth()) { + prompt_auth(); + } + } + // check the referer to prevent against cross site request forgery (xsrf) + // this is not really optimal, since proxies can filter the referer + // header, but as a first step.. + if (!empty($_SERVER['HTTP_REFERER'])) { + $bu = base_url(); + if (substr($_SERVER['HTTP_REFERER'], 0, strlen($bu)) != $bu) { + log_msg('warn', 'controller: possible xsrf detected, referer is '.quot($_SERVER['HTTP_REFERER']).', arguments '.var_dump_inl($args)); + http_400(); + } + } + log_msg('info', 'controller: invoking controller '.quot($reason).' => '.$match['func']); + return $match['func']($args); + } else { + // normally we won't reach this as some default (*/*) controller will + // be present + log_msg('warn', 'controller: no match for '.quot($args[0][0].'/'.$args[0][1])); + http_400(); + } +} + + +/** + * parse the QUERY_STRING server variable + * + * @return array query-arguments array (key/value and numeric keys) + */ +function parse_query_string() +{ + // QUERY_STRING per se seems not to be affected by magic quotes, only + // the derived $_GET, $_POST etc + $q = $_SERVER['QUERY_STRING']; + $args = array(); + $num_args = array(); + // strip a tailing slash + if (substr($q, -1) == '/') { + $q = substr($q, 0, -1); + } + // explode query string + // this could also be done with parse_str() instead + $temp = expl('&', $q); + foreach ($temp as $a) { + if (($p = strpos($a, '=')) !== false) { + $args[urldecode(substr($a, 0, $p))] = urldecode(substr($a, $p+1)); + } else { + $num_args[] = urldecode($a); + } + } + // merge $num_args into $args + for ($i=0; $i < count($num_args); $i++) { + // explode slashes in arguments without a key + if (($p = strpos($num_args[$i], '/')) !== false) { + $args[$i] = expl('/', $num_args[$i]); + } else { + $args[$i] = $num_args[$i]; + } + } + return $args; +} + + +/** + * register a controller + * + * @param string $arg0 first argument of query to match (* for wildcard) + * @param string $arg1 second argument of query to match (* for widcard) + * @param string $func function name + * @param array $args optional arguments + */ +function register_controller($arg0, $arg1, $func, $args = array()) +{ + global $controllers; + if (!isset($controllers[$arg0])) { + $controllers[$arg0] = array(); + } + $controllers[$arg0.'-'.$arg1] = array_merge($args, array('func'=>$func)); + log_msg('debug', 'controller: registered controller '.quot($arg0.'/'.$arg1).' => '.$func); +} + + +/** + * serve a resource associated with an object + * + * the function might not return (e.g. when a module calls serve_file()). + * @param string $s object (e.g. page.rev.obj) + * @param bool $dl download file + * @return bool + */ +function serve_resource($s, $dl) +{ + load_modules('glue'); + + // resolve symlinks + $ret = object_get_symlink(array('name'=>$s)); + if ($ret['#error'] == false && $ret['#data'] !== false) { + log_msg('debug', 'controller: resolved resource '.quot($s).' into '.quot($ret['#data'])); + $s = $ret['#data']; + } + + $obj = load_object(array('name'=>$s)); + if ($obj['#error']) { + return false; + } else { + $obj = $obj['#data']; + } + + $ret = invoke_hook_while('serve_resource', false, array('obj'=>$obj, 'dl'=>$dl)); + // this is probably not needed as the module will most likely call + // serve_file() on success, which does not return + foreach ($ret as $key=>$val) { + if ($val !== false) { + return true; + } + } + return false; +} + +register_hook('serve_resource', 'serve resources associated with objects'); + + +?> diff --git a/css/.htaccess b/css/.htaccess new file mode 100644 index 0000000..45552cb --- /dev/null +++ b/css/.htaccess @@ -0,0 +1 @@ +Options -Indexes \ No newline at end of file diff --git a/css/create_page.css b/css/create_page.css new file mode 100644 index 0000000..e69de29 diff --git a/css/edit.css b/css/edit.css new file mode 100644 index 0000000..e1f88f0 --- /dev/null +++ b/css/edit.css @@ -0,0 +1,147 @@ +/* this file is being included for editing a page */ + +#glue-colorpicker { + /* colorpicker used for page and objects alike */ + bottom: 20px; + position: fixed; + right: 20px; +} + +#glue-colorpicker-transparent { + /* icon for transparency inside the colorpicker element */ + background-image: url(../img/colorpicker-transparent.png); + border-style: solid; + border-width: 1px; + bottom: 6px; + cursor: pointer; + height: 10px; + position: absolute; + right: 215px; + width: 10px; +} + +.glue-colorpicker-transparent-set { + /* set when color is set to transparent */ + border-color: red; +} + +.glue-colorpicker-transparent-notset { + /* set when color is set to all other colors */ + border-color: white; +} + +.glue-file-upload { + /* a file upload button */ + width: 32px; + height: 32px; + overflow: hidden; +} + +.glue-contextmenu-left { + /* a context menu item to the object's left */ + margin-bottom: 10px; + margin-right: 20px; +} + +.glue-contextmenu-top { + /* a context menu item on top of the object */ + margin-bottom: 20px; + margin-right: 10px; +} + +.glue-grid { + /* a grid line */ +} + +.glue-grid-x { + /* a horizontal grid line */ +} + +.glue-grid-y { + /* a vertical grid line */ +} + +.glue-guide { + /* a guide line */ +} + +.glue-guide-x { + /* a vertical guide line (after n pixels) */ +} + +.glue-guide-y { + /* a horizontal guide line (after n pixels) */ +} + +.glue-menu { + /* a menu item */ + margin-bottom: 5px; + margin-left: 5px; + margin-right: 5px; + margin-top: 5px; + opacity: 1.0; +} + +.glue-menu-enabled { + /* menu items that have an enabled/disabled state should use these classes */ + /* this only works with images that are a bit transparent at least */ + background-color: rgba(0, 255, 0, 0.5); +} + +.glue-menu-disabled { + /* menu items that have an enabled/disabled state should use these classes */ + /* this only works with images that are a bit transparent at least */ +} + +.glue-menu-new { + /* a "new"-menu item (shown when clicking the background once) */ +} + +.glue-menu-page { + /* a "page"-menu item (shown when doubleclicking the background) */ +} + +.glue-selected { + /* class for selected objects */ + border-color: red; + border-style: dashed; + border-width: 2px; +} + +.glue-ui { + /* all ui elements should use this class */ +} + +.glue-upload-statusbar { + /* statusbar for uploading */ + background-color: lightgrey; + border-radius: 2px; + height: 4px; + width: 100px; +} + +.glue-upload-statusbar-done { + /* the "done" part of the statusbar for uploading */ + background-color: green; + border-radius: inherit; + height: 100%; + width: 0%; +} + +.ui-draggable-dragging { + /* class for object being dragged */ +} + +/* taken from jquery-ui-1.8.5.custom.css */ + +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/css/farbtastic.css b/css/farbtastic.css new file mode 100644 index 0000000..f617ad9 --- /dev/null +++ b/css/farbtastic.css @@ -0,0 +1,38 @@ +.farbtastic { + position: relative; +} + +.farbtastic * { + position: absolute; + cursor: crosshair; +} + +.farbtastic, .farbtastic .wheel { + width: 195px; + height: 195px; +} + +.farbtastic .color, .farbtastic .overlay { + top: 47px; + left: 47px; + width: 101px; + height: 101px; +} + +.farbtastic .wheel { + background: url(../img/farbtastic-wheel.png) no-repeat; + width: 195px; + height: 195px; +} + +.farbtastic .overlay { + background: url(../img/farbtastic-mask.png) no-repeat; +} + +.farbtastic .marker { + width: 17px; + height: 17px; + margin: -8px 0 0 -8px; + overflow: hidden; + background: url(../img/farbtastic-marker.png) no-repeat; +} \ No newline at end of file diff --git a/css/glue.css b/css/glue.css new file mode 100644 index 0000000..7163992 --- /dev/null +++ b/css/glue.css @@ -0,0 +1,13 @@ +/* this file is being included for all editing modes */ + +h1, h2, h3, h4, h5, h6 { + /* defaults for headings */ + font-size: 25.5px; + line-height: 37.74px; +} + +p { + /* and paragraphs */ + margin-bottom: 8.5px; + margin-top: 6px; +} \ No newline at end of file diff --git a/css/main.css b/css/main.css new file mode 100644 index 0000000..e83d403 --- /dev/null +++ b/css/main.css @@ -0,0 +1,13 @@ +/* this file is being included for viewing as well as editing modes */ + +html, body { + /* default font */ + font-family: Verdana, Geneva, Tahoma, sans-serif; + font-size: 13px; + line-height: 19.25px; +} + +a, a:link, a:visited, a:active, a:hover { + /* this removes the blue color from links on Chrome 7.0.517.41 */ + color: inherit; +} \ No newline at end of file diff --git a/css/reset.css b/css/reset.css new file mode 100644 index 0000000..60d6a2a --- /dev/null +++ b/css/reset.css @@ -0,0 +1,142 @@ +/* +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.1 +*/ +/** + * YUI Reset + * @module reset + * @namespace + * @requires + */ +html { + color: #000; + background: #FFF; +} + +body, +div, +dl, +dt, +dd, +ul, +ol, +li, +h1, +h2, +h3, +h4, +h5, +h6, +pre, +code, +form, +fieldset, +legend, +input, +button, +textarea, +p, +blockquote, +th, +td { + margin: 0; + padding: 0; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +fieldset, +img { + border: 0; +} + +address, +caption, +cite, +code, +dfn, +em, +strong, +th, +var, +optgroup { + font-style: inherit; + font-weight: inherit; +} + +del, +ins { + text-decoration: none; +} + +li { + list-style: none; +} + +caption, +th { + text-align: left; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 100%; + font-weight: normal; +} + +q:before, +q:after { + content: ''; +} + +abbr, +acronym { + border: 0; + font-variant: normal; +} + +sup { + vertical-align: baseline; +} + +sub { + vertical-align: baseline; +} + +/*because legend doesn't inherit in IE */ +legend { + color: #000; +} + +input, +button, +textarea, +select, +optgroup, +option { + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; +} + +/*@purpose To enable resizing for IE */ +/*@branch For IE6-Win, IE7-Win */ +input, +button, +textarea, +select { + *font-size: 100%; +} + + + diff --git a/css/reset.min.css b/css/reset.min.css new file mode 100644 index 0000000..0d1757b --- /dev/null +++ b/css/reset.min.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.1 +*/ +html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;} \ No newline at end of file diff --git a/doc/.htaccess b/doc/.htaccess new file mode 100644 index 0000000..45552cb --- /dev/null +++ b/doc/.htaccess @@ -0,0 +1 @@ +Options -Indexes \ No newline at end of file diff --git a/doc/Doxyfile b/doc/Doxyfile new file mode 100644 index 0000000..a21f910 --- /dev/null +++ b/doc/Doxyfile @@ -0,0 +1,257 @@ +# Doxyfile 1.5.8 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = hotglue +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../ +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.php +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +HTML_DYNAMIC_SECTIONS = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NONE +TREEVIEW_WIDTH = 250 +FORMULA_FONTSIZE = 10 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +DOT_FONTNAME = FreeSans +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Options related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/doc/html/common_8inc_8php.html b/doc/html/common_8inc_8php.html new file mode 100644 index 0000000..5f5fe09 --- /dev/null +++ b/doc/html/common_8inc_8php.html @@ -0,0 +1,578 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/common.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/common.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#6cceb5c6a3c421c18e925515c78f6dfd">cache_output</a> ($category, $name, $out)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#8916cb6ec34ceeb3f48c86655c305974">default_html</a> ($add_glue)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#7ca47f8aab349971cde2d4b02441cf41">drop_cache</a> ($category, $name)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#0d6d0da45f4adf6283bcccec9fd107e3">glue_version</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#6fb34b9210b43349ca3eb16b2738a28b">is_cached</a> ($category, $name, $max_age)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#78992fdfae6cd9d7d4e8053d004d1709">resolve_aliases</a> ($s, $name= '')</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#81eb70073067db81ab43829870f15e6d">resolve_relative_urls</a> ($s)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#ac90387dcab722e243df2d083f8d6a00">serve_cached</a> ($category, $name)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#0a3ee1e9beca572266648f17b9c4c75f">startpage</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#b3abbb2cd13e01231533e7cdc93da6db">is_auth</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#3d71a269e01b98748fb57719feef27be">object_exists</a> ($s)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#31ed04b0c90ac3077e71743c307d45f8">page_canonical</a> (&$s)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#a71868111dd5b8af98df9cc9c968e523">page_exists</a> ($s)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#da968adfb989aa09adaf29867208f1ab">page_short</a> ($s)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#80c23c9d8ac02159151d6368506b1b54">prompt_auth</a> ($header_only=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#4659077c34b709eec75f9897ea07e55a">upload_file</a> ($fn, $page, $orig_fn= '', &$existed=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="common_8inc_8php.html#0ef613d233a6e62f7e631b8dfcd710bf">valid_pagename</a> ($s)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="6cceb5c6a3c421c18e925515c78f6dfd"></a><!-- doxytag: member="common.inc.php::cache_output" ref="6cceb5c6a3c421c18e925515c78f6dfd" args="($category, $name, $out)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">cache_output </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>category</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>out</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="common_8inc_8php.html">common.inc.php</a> Common hotglue infrastructure<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. save a page in the cache<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$category cache category (e.g. 'page') </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$name item name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$out content </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if successful, false if not </dd></dl> + +</div> +</div><p> +<a class="anchor" name="8916cb6ec34ceeb3f48c86655c305974"></a><!-- doxytag: member="common.inc.php::default_html" ref="8916cb6ec34ceeb3f48c86655c305974" args="($add_glue)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">default_html </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>add_glue</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +setup a default html page<p> +see <a class="el" href="html_8inc_8php.html">html.inc.php</a>. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$add_glue true for adding the glue code </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="7ca47f8aab349971cde2d4b02441cf41"></a><!-- doxytag: member="common.inc.php::drop_cache" ref="7ca47f8aab349971cde2d4b02441cf41" args="($category, $name)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">drop_cache </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>category</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>name</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +remove a page from the cache<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$category cache category (e.g. 'page') </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$name item name </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="0d6d0da45f4adf6283bcccec9fd107e3"></a><!-- doxytag: member="common.inc.php::glue_version" ref="0d6d0da45f4adf6283bcccec9fd107e3" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">glue_version </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return the glue version with api.version.patchlevel<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array (with length three) </dd></dl> + +</div> +</div><p> +<a class="anchor" name="b3abbb2cd13e01231533e7cdc93da6db"></a><!-- doxytag: member="common.inc.php::is_auth" ref="b3abbb2cd13e01231533e7cdc93da6db" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">is_auth </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if the user is authenticated or not<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if authenticated, false if not </dd></dl> + +</div> +</div><p> +<a class="anchor" name="6fb34b9210b43349ca3eb16b2738a28b"></a><!-- doxytag: member="common.inc.php::is_cached" ref="6fb34b9210b43349ca3eb16b2738a28b" args="($category, $name, $max_age)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">is_cached </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>category</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>max_age</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if a page can be served from the cache<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$category cache category (e.g. 'page') </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$name item name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>int</em> </td><td>$max_age serve from cache when younger than $max_age seconds </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool true if the page can be served from cache, false if not </dd></dl> + +</div> +</div><p> +<a class="anchor" name="3d71a269e01b98748fb57719feef27be"></a><!-- doxytag: member="common.inc.php::object_exists" ref="3d71a269e01b98748fb57719feef27be" args="($s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">object_exists </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if an object exists<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>$s</em> </td><td>object (e.g. page.rev.obj) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +<a class="anchor" name="31ed04b0c90ac3077e71743c307d45f8"></a><!-- doxytag: member="common.inc.php::page_canonical" ref="31ed04b0c90ac3077e71743c307d45f8" args="(&$s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">page_canonical </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +turn short page names into canonical ones<p> +if $s is not a page, the string is not altered. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>&$s reference to the page name </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="a71868111dd5b8af98df9cc9c968e523"></a><!-- doxytag: member="common.inc.php::page_exists" ref="a71868111dd5b8af98df9cc9c968e523" args="($s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">page_exists </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if a page exists<p> +this function can also be used with object names (e.g. page.rev.obj). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>$s</em> </td><td>page </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +<a class="anchor" name="da968adfb989aa09adaf29867208f1ab"></a><!-- doxytag: member="common.inc.php::page_short" ref="da968adfb989aa09adaf29867208f1ab" args="($s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">page_short </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return the short pagename if possible, otherwise the long one<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>$s</em> </td><td>page </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +<a class="anchor" name="80c23c9d8ac02159151d6368506b1b54"></a><!-- doxytag: member="common.inc.php::prompt_auth" ref="80c23c9d8ac02159151d6368506b1b54" args="($header_only=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">prompt_auth </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>header_only</em> = <code>false</code> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +prompt user for authentication<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$header_only only send header information this function does not return. </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="78992fdfae6cd9d7d4e8053d004d1709"></a><!-- doxytag: member="common.inc.php::resolve_aliases" ref="78992fdfae6cd9d7d4e8053d004d1709" args="($s, $name= '')" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">resolve_aliases </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>name</em> = <code>''</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="81eb70073067db81ab43829870f15e6d"></a><!-- doxytag: member="common.inc.php::resolve_relative_urls" ref="81eb70073067db81ab43829870f15e6d" args="($s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">resolve_relative_urls </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="ac90387dcab722e243df2d083f8d6a00"></a><!-- doxytag: member="common.inc.php::serve_cached" ref="ac90387dcab722e243df2d083f8d6a00" args="($category, $name)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">serve_cached </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>category</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>name</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +output a cached page to the client<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$category cache category (e.g. 'page') </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$name item name </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>true if successful, false if not </dd></dl> + +</div> +</div><p> +<a class="anchor" name="0a3ee1e9beca572266648f17b9c4c75f"></a><!-- doxytag: member="common.inc.php::startpage" ref="0a3ee1e9beca572266648f17b9c4c75f" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">startpage </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return the starting page<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +<a class="anchor" name="4659077c34b709eec75f9897ea07e55a"></a><!-- doxytag: member="common.inc.php::upload_file" ref="4659077c34b709eec75f9897ea07e55a" args="($fn, $page, $orig_fn= '', &$existed=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">upload_file </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>fn</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>page</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>orig_fn</em> = <code>''</code>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>existed</em> = <code>false</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +move an uploaded file to the shared directory of a page<p> +this function reuses existing files when possible. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$fn filename of newly uploaded file (most likely in /tmp) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$page page or pagename </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$orig_fn the original filename on the client machine (optional) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>&$existed set to true if the filename returned did already exist before </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>filename inside the shared directory or false in case of error </dd></dl> + +</div> +</div><p> +<a class="anchor" name="0ef613d233a6e62f7e631b8dfcd710bf"></a><!-- doxytag: member="common.inc.php::valid_pagename" ref="0ef613d233a6e62f7e631b8dfcd710bf" args="($s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">valid_pagename </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check whether the string is a valid, canonical page name<p> +the function does not check if the page exists or not. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$s string to check </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/config_8inc_8php.html b/doc/html/config_8inc_8php.html new file mode 100644 index 0000000..62b53e4 --- /dev/null +++ b/doc/html/config_8inc_8php.html @@ -0,0 +1,585 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/config.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/config.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#2ee7e30fa45253c5e303994703d3293f">AUTH_METHOD</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#7d3a74ff015a9f789a5a2e554a9fa956">AUTH_USER</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#df2112da607b39714ba9cca31b42a93a">AUTH_PASSWORD</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#16548ab75ed30cbddce178d56d26dbb8">BASE_URL</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#fc454c0433a87811735836800fe3350b">CACHE_TIME</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#9949c9013641bf07cd112607d200d6ff">CONTENT_DIR</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#4208e17d37801abf0982b2d1e625a8f2">DEFAULT_PAGE</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#fd55d95ee6651060397404533516882a">FAVICON</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#7c35565a4692ae46fd1c04340f4f1ca9">HOTGLUE_VERSION</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#1d76a949b348522c90864da5df468d51">IE8_COMPAT</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#5c2fff7e41a0380fb7872627e3a14a29">JQUERY</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#924ae40271cc363050158e36b3823407">LOCK_TIME</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#6de83433b64b24349644a4c2d839dcb7">LOG_FILE</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#a5a9053636a30269210c54e734e0d583">LOG_LEVEL</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#377ac3321785e25215435e8d9802bc34">SHORT_URLS</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#38f8e1265350d7091b55f4cffe629f3a">SITE_NAME</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#a9c8d739795b1000f6ea105992a4e488">SNAPSHOT_MAX_AGE</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#7fb94ff6aaa61e964fe2f90f738d5cb3">SNAPSHOT_MIN_AGE</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#98806af9de0ea41a958d26c7e06b26a9">USE_MIN_FILES</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#f27e0280ef96e9b1d2d968a0d2d208ff">IMAGE_JPEG_QUAL</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#3e161cc5c717f2e23d89b69ec297af9b">IMAGE_PNG_QUAL</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#0654894e46ca07417a6e85e091ed7d1d">IMAGE_RESIZING</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#3e205a45d91d7ef191e53487b6b48b3b">OBJECT_DEFAULT_COLORS</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#bc1c54acdbce897c718854b663517cf9">PAGE_DEFAULT_GRID_X</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#b93c5dcea5ef58747b80594c3d9304d7">PAGE_DEFAULT_GRID_Y</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#81167deb206874270a59273141919fe5">PAGE_GUIDES_X</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#3f78eb981e05f649bfff403c0e595d0b">PAGE_GUIDES_Y</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#11f5534165e1764860b16cc7215b2141">PAGES_NEED_AUTH</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#67b9479d334a4e6c33c0bc3505b3eb5e">REVISIONS_NEED_AUTH</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#6f581226f389510394c592491ebedc0b">TEXT_AUTO_BR</a> </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#e1e42e1baa41f003453356a3747f9fee">VIDEO_START_ON_CLICK</a> </td></tr> + +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="config_8inc_8php.html#8fdfb46e432b25bbdad23971a23a26b5">base_url</a> ()</td></tr> + +</table> +<hr><h2>Enumeration Type Documentation</h2> +<a class="anchor" name="2ee7e30fa45253c5e303994703d3293f"></a><!-- doxytag: member="config.inc.php::AUTH_METHOD" ref="2ee7e30fa45253c5e303994703d3293f" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#2ee7e30fa45253c5e303994703d3293f">AUTH_METHOD</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="df2112da607b39714ba9cca31b42a93a"></a><!-- doxytag: member="config.inc.php::AUTH_PASSWORD" ref="df2112da607b39714ba9cca31b42a93a" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#df2112da607b39714ba9cca31b42a93a">AUTH_PASSWORD</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="7d3a74ff015a9f789a5a2e554a9fa956"></a><!-- doxytag: member="config.inc.php::AUTH_USER" ref="7d3a74ff015a9f789a5a2e554a9fa956" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#7d3a74ff015a9f789a5a2e554a9fa956">AUTH_USER</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="16548ab75ed30cbddce178d56d26dbb8"></a><!-- doxytag: member="config.inc.php::BASE_URL" ref="16548ab75ed30cbddce178d56d26dbb8" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#16548ab75ed30cbddce178d56d26dbb8">BASE_URL</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="fc454c0433a87811735836800fe3350b"></a><!-- doxytag: member="config.inc.php::CACHE_TIME" ref="fc454c0433a87811735836800fe3350b" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#fc454c0433a87811735836800fe3350b">CACHE_TIME</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="9949c9013641bf07cd112607d200d6ff"></a><!-- doxytag: member="config.inc.php::CONTENT_DIR" ref="9949c9013641bf07cd112607d200d6ff" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#9949c9013641bf07cd112607d200d6ff">CONTENT_DIR</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="4208e17d37801abf0982b2d1e625a8f2"></a><!-- doxytag: member="config.inc.php::DEFAULT_PAGE" ref="4208e17d37801abf0982b2d1e625a8f2" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#4208e17d37801abf0982b2d1e625a8f2">DEFAULT_PAGE</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="fd55d95ee6651060397404533516882a"></a><!-- doxytag: member="config.inc.php::FAVICON" ref="fd55d95ee6651060397404533516882a" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#fd55d95ee6651060397404533516882a">FAVICON</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="7c35565a4692ae46fd1c04340f4f1ca9"></a><!-- doxytag: member="config.inc.php::HOTGLUE_VERSION" ref="7c35565a4692ae46fd1c04340f4f1ca9" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#7c35565a4692ae46fd1c04340f4f1ca9">HOTGLUE_VERSION</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="1d76a949b348522c90864da5df468d51"></a><!-- doxytag: member="config.inc.php::IE8_COMPAT" ref="1d76a949b348522c90864da5df468d51" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#1d76a949b348522c90864da5df468d51">IE8_COMPAT</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="f27e0280ef96e9b1d2d968a0d2d208ff"></a><!-- doxytag: member="config.inc.php::IMAGE_JPEG_QUAL" ref="f27e0280ef96e9b1d2d968a0d2d208ff" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#f27e0280ef96e9b1d2d968a0d2d208ff">IMAGE_JPEG_QUAL</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="3e161cc5c717f2e23d89b69ec297af9b"></a><!-- doxytag: member="config.inc.php::IMAGE_PNG_QUAL" ref="3e161cc5c717f2e23d89b69ec297af9b" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#3e161cc5c717f2e23d89b69ec297af9b">IMAGE_PNG_QUAL</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="0654894e46ca07417a6e85e091ed7d1d"></a><!-- doxytag: member="config.inc.php::IMAGE_RESIZING" ref="0654894e46ca07417a6e85e091ed7d1d" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#0654894e46ca07417a6e85e091ed7d1d">IMAGE_RESIZING</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="5c2fff7e41a0380fb7872627e3a14a29"></a><!-- doxytag: member="config.inc.php::JQUERY" ref="5c2fff7e41a0380fb7872627e3a14a29" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#5c2fff7e41a0380fb7872627e3a14a29">JQUERY</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="924ae40271cc363050158e36b3823407"></a><!-- doxytag: member="config.inc.php::LOCK_TIME" ref="924ae40271cc363050158e36b3823407" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#924ae40271cc363050158e36b3823407">LOCK_TIME</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="6de83433b64b24349644a4c2d839dcb7"></a><!-- doxytag: member="config.inc.php::LOG_FILE" ref="6de83433b64b24349644a4c2d839dcb7" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#6de83433b64b24349644a4c2d839dcb7">LOG_FILE</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="a5a9053636a30269210c54e734e0d583"></a><!-- doxytag: member="config.inc.php::LOG_LEVEL" ref="a5a9053636a30269210c54e734e0d583" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#a5a9053636a30269210c54e734e0d583">LOG_LEVEL</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="3e205a45d91d7ef191e53487b6b48b3b"></a><!-- doxytag: member="config.inc.php::OBJECT_DEFAULT_COLORS" ref="3e205a45d91d7ef191e53487b6b48b3b" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#3e205a45d91d7ef191e53487b6b48b3b">OBJECT_DEFAULT_COLORS</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="bc1c54acdbce897c718854b663517cf9"></a><!-- doxytag: member="config.inc.php::PAGE_DEFAULT_GRID_X" ref="bc1c54acdbce897c718854b663517cf9" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#bc1c54acdbce897c718854b663517cf9">PAGE_DEFAULT_GRID_X</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="b93c5dcea5ef58747b80594c3d9304d7"></a><!-- doxytag: member="config.inc.php::PAGE_DEFAULT_GRID_Y" ref="b93c5dcea5ef58747b80594c3d9304d7" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#b93c5dcea5ef58747b80594c3d9304d7">PAGE_DEFAULT_GRID_Y</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="81167deb206874270a59273141919fe5"></a><!-- doxytag: member="config.inc.php::PAGE_GUIDES_X" ref="81167deb206874270a59273141919fe5" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#81167deb206874270a59273141919fe5">PAGE_GUIDES_X</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="3f78eb981e05f649bfff403c0e595d0b"></a><!-- doxytag: member="config.inc.php::PAGE_GUIDES_Y" ref="3f78eb981e05f649bfff403c0e595d0b" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#3f78eb981e05f649bfff403c0e595d0b">PAGE_GUIDES_Y</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="11f5534165e1764860b16cc7215b2141"></a><!-- doxytag: member="config.inc.php::PAGES_NEED_AUTH" ref="11f5534165e1764860b16cc7215b2141" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#11f5534165e1764860b16cc7215b2141">PAGES_NEED_AUTH</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="67b9479d334a4e6c33c0bc3505b3eb5e"></a><!-- doxytag: member="config.inc.php::REVISIONS_NEED_AUTH" ref="67b9479d334a4e6c33c0bc3505b3eb5e" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#67b9479d334a4e6c33c0bc3505b3eb5e">REVISIONS_NEED_AUTH</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="377ac3321785e25215435e8d9802bc34"></a><!-- doxytag: member="config.inc.php::SHORT_URLS" ref="377ac3321785e25215435e8d9802bc34" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#377ac3321785e25215435e8d9802bc34">SHORT_URLS</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="38f8e1265350d7091b55f4cffe629f3a"></a><!-- doxytag: member="config.inc.php::SITE_NAME" ref="38f8e1265350d7091b55f4cffe629f3a" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#38f8e1265350d7091b55f4cffe629f3a">SITE_NAME</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="a9c8d739795b1000f6ea105992a4e488"></a><!-- doxytag: member="config.inc.php::SNAPSHOT_MAX_AGE" ref="a9c8d739795b1000f6ea105992a4e488" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#a9c8d739795b1000f6ea105992a4e488">SNAPSHOT_MAX_AGE</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="7fb94ff6aaa61e964fe2f90f738d5cb3"></a><!-- doxytag: member="config.inc.php::SNAPSHOT_MIN_AGE" ref="7fb94ff6aaa61e964fe2f90f738d5cb3" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#7fb94ff6aaa61e964fe2f90f738d5cb3">SNAPSHOT_MIN_AGE</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="6f581226f389510394c592491ebedc0b"></a><!-- doxytag: member="config.inc.php::TEXT_AUTO_BR" ref="6f581226f389510394c592491ebedc0b" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#6f581226f389510394c592491ebedc0b">TEXT_AUTO_BR</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="98806af9de0ea41a958d26c7e06b26a9"></a><!-- doxytag: member="config.inc.php::USE_MIN_FILES" ref="98806af9de0ea41a958d26c7e06b26a9" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#98806af9de0ea41a958d26c7e06b26a9">USE_MIN_FILES</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="e1e42e1baa41f003453356a3747f9fee"></a><!-- doxytag: member="config.inc.php::VIDEO_START_ON_CLICK" ref="e1e42e1baa41f003453356a3747f9fee" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="config_8inc_8php.html#e1e42e1baa41f003453356a3747f9fee">VIDEO_START_ON_CLICK</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="8fdfb46e432b25bbdad23971a23a26b5"></a><!-- doxytag: member="config.inc.php::base_url" ref="8fdfb46e432b25bbdad23971a23a26b5" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">base_url </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +use this function to get the site's base url<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string base url (not html-encoded) </dd></dl> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/controller_8inc_8php.html b/doc/html/controller_8inc_8php.html new file mode 100644 index 0000000..5878de4 --- /dev/null +++ b/doc/html/controller_8inc_8php.html @@ -0,0 +1,289 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/controller.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/controller.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">if(!isset($controllers)) </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#647d96ea8304771250e8fa4251a4d12e">controller_create_page</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#406fb5b2a2a93bef89e4ba46f8829d2f">controller_edit</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#e9c67435a37f4b70d0769079c9dbf379">controller_default</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#c3e283e26869e2ffd938bdf9775c3e81">controller_login</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#d135971740244b9e81718d4cd0407b11">controller_show</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#170bef82dc4636c51b678276323e4ff4">invoke_controller</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#51a50fbc5165b4ff0a289b2010bb7597">parse_query_string</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#543961dbcd309fa2cb6a887a8666bf1c">register_controller</a> ($arg0, $arg1, $func, $args=array())</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="controller_8inc_8php.html#5d5274c3531eb05a1ea5927ff3cd08d3">serve_resource</a> ($s, $dl)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="647d96ea8304771250e8fa4251a4d12e"></a><!-- doxytag: member="controller.inc.php::controller_create_page" ref="647d96ea8304771250e8fa4251a4d12e" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">if (!isset($controllers)) controller_create_page </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="controller_8inc_8php.html">controller.inc.php</a> Generic dispatcher code mixed with some hotglue-specific controllers<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. show a site where authenticated users can create new pages +</div> +</div><p> +<a class="anchor" name="e9c67435a37f4b70d0769079c9dbf379"></a><!-- doxytag: member="controller.inc.php::controller_default" ref="e9c67435a37f4b70d0769079c9dbf379" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">controller_default </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +this is the default (fallback) controller<p> +it mainly invokes other controllers or sends error messages +</div> +</div><p> +<a class="anchor" name="406fb5b2a2a93bef89e4ba46f8829d2f"></a><!-- doxytag: member="controller.inc.php::controller_edit" ref="406fb5b2a2a93bef89e4ba46f8829d2f" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">controller_edit </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +show a site to edit pages +</div> +</div><p> +<a class="anchor" name="c3e283e26869e2ffd938bdf9775c3e81"></a><!-- doxytag: member="controller.inc.php::controller_login" ref="c3e283e26869e2ffd938bdf9775c3e81" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">controller_login </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +promt the user to authenticate<p> +this might be helpful as other controller's authentication seem to be only valid for the respective directory. (e.g. having privileges in '/foo/edit' does not seem to have an effect on the parent directory or any other sibling directory. +</div> +</div><p> +<a class="anchor" name="d135971740244b9e81718d4cd0407b11"></a><!-- doxytag: member="controller.inc.php::controller_show" ref="d135971740244b9e81718d4cd0407b11" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">controller_show </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +show a page +</div> +</div><p> +<a class="anchor" name="170bef82dc4636c51b678276323e4ff4"></a><!-- doxytag: member="controller.inc.php::invoke_controller" ref="170bef82dc4636c51b678276323e4ff4" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">invoke_controller </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +invoke a controller based on the query arguments given<p> +this function does not return in case of an error. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args query-arguments array </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>mixed return value of controller that was called </dd></dl> + +</div> +</div><p> +<a class="anchor" name="51a50fbc5165b4ff0a289b2010bb7597"></a><!-- doxytag: member="controller.inc.php::parse_query_string" ref="51a50fbc5165b4ff0a289b2010bb7597" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">parse_query_string </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +parse the QUERY_STRING server variable<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array query-arguments array (key/value and numeric keys) </dd></dl> + +</div> +</div><p> +<a class="anchor" name="543961dbcd309fa2cb6a887a8666bf1c"></a><!-- doxytag: member="controller.inc.php::register_controller" ref="543961dbcd309fa2cb6a887a8666bf1c" args="($arg0, $arg1, $func, $args=array())" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">register_controller </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>arg0</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>arg1</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>func</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> = <code>array()</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +register a controller<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$arg0 first argument of query to match (* for wildcard) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$arg1 second argument of query to match (* for widcard) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$func function name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args optional arguments </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="5d5274c3531eb05a1ea5927ff3cd08d3"></a><!-- doxytag: member="controller.inc.php::serve_resource" ref="5d5274c3531eb05a1ea5927ff3cd08d3" args="($s, $dl)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">serve_resource </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>dl</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +serve a resource associated with an object<p> +the function might not return (e.g. when a module calls <a class="el" href="util_8inc_8php.html#9d3ab20fc8b79fb6ab860f93600c745e">serve_file()</a>). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$s object (e.g. page.rev.obj) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$dl download file </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css new file mode 100644 index 0000000..3767dc9 --- /dev/null +++ b/doc/html/doxygen.css @@ -0,0 +1,441 @@ +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + text-align: center; + font-size: 150%; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +/* @end */ + +caption { + font-weight: bold; +} + +div.qindex, div.navtab{ + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #153788; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #1b77c5; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { +} + +a.codeRef { +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + padding: 4px 6px; + margin: 4px 8px 4px 2px; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} + +td.indexkey { + background-color: #e8eef2; + font-weight: bold; + border: 1px solid #CCCCCC; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #e8eef2; + border: 1px solid #CCCCCC; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #f0f0f0; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} + +th.dirtab { + background: #e8eef2; + font-weight: bold; +} + +hr { + height: 0; + border: none; + border-top: 1px solid #666; +} + +/* @group Member Descriptions */ + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #FAFAFA; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #ccc; +} + +.memTemplParams { + color: #606060; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; + margin-left: 3px; +} + +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; +} + +.memname { + white-space: nowrap; + font-weight: bold; +} + +.memproto, .memdoc { + border: 1px solid #84b0c7; +} + +.memproto { + padding: 0; + background-color: #d5e1e8; + font-weight: bold; + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; + -moz-border-radius-topleft: 8px; + -moz-border-radius-topright: 8px; +} + +.memdoc { + padding: 2px 5px; + background-color: #eef3f5; + border-top-width: 0; + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0.5em; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +address { + font-style: normal; + color: #333; +} diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png new file mode 100644 index 0000000..f0a274b Binary files /dev/null and b/doc/html/doxygen.png differ diff --git a/doc/html/files.html b/doc/html/files.html new file mode 100644 index 0000000..c9c9c1c --- /dev/null +++ b/doc/html/files.html @@ -0,0 +1,50 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: File Index</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li class="current"><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>File List</h1>Here is a list of all files with brief descriptions:<table> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="common_8inc_8php.html">common.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="config_8inc_8php.html">config.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="controller_8inc_8php.html">controller.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="html_8inc_8php.html">html.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="html__parse_8inc_8php.html">html_parse.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="index_8php.html">index.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="json_8php.html">json.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="log_8inc_8php.html">log.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__download_8inc_8php.html">module_download.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__glue_8inc_8php.html">module_glue.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__iframe_8inc_8php.html">module_iframe.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__image_8inc_8php.html">module_image.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__object_8inc_8php.html">module_object.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__page_8inc_8php.html">module_page.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__page__browser_8inc_8php.html">module_page_browser.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__revisions__browser_8inc_8php.html">module_revisions_browser.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__text_8inc_8php.html">module_text.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="module__video_8inc_8php.html">module_video.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="modules_8inc_8php.html">modules.inc.php</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey">/srv/www/sukzessiv.net/h/<a class="el" href="util_8inc_8php.html">util.inc.php</a></td><td class="indexvalue"></td></tr> +</table> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/globals.html b/doc/html/globals.html new file mode 100644 index 0000000..5b7882c --- /dev/null +++ b/doc/html/globals.html @@ -0,0 +1,485 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: Class Members</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li class="current"><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li class="current"><a href="globals.html"><span>All</span></a></li> + <li><a href="globals_func.html"><span>Functions</span></a></li> + <li><a href="globals_vars.html"><span>Variables</span></a></li> + <li><a href="globals_enum.html"><span>Enumerations</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="#index_$"><span>$</span></a></li> + <li><a href="#index__"><span>_</span></a></li> + <li><a href="#index_a"><span>a</span></a></li> + <li><a href="#index_b"><span>b</span></a></li> + <li><a href="#index_c"><span>c</span></a></li> + <li><a href="#index_d"><span>d</span></a></li> + <li><a href="#index_e"><span>e</span></a></li> + <li><a href="#index_f"><span>f</span></a></li> + <li><a href="#index_g"><span>g</span></a></li> + <li><a href="#index_h"><span>h</span></a></li> + <li><a href="#index_i"><span>i</span></a></li> + <li><a href="#index_j"><span>j</span></a></li> + <li><a href="#index_l"><span>l</span></a></li> + <li><a href="#index_n"><span>n</span></a></li> + <li><a href="#index_o"><span>o</span></a></li> + <li><a href="#index_p"><span>p</span></a></li> + <li><a href="#index_q"><span>q</span></a></li> + <li><a href="#index_r"><span>r</span></a></li> + <li><a href="#index_s"><span>s</span></a></li> + <li><a href="#index_t"><span>t</span></a></li> + <li><a href="#index_u"><span>u</span></a></li> + <li><a href="#index_v"><span>v</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +Here is a list of all file members with links to the files they belong to: +<p> +<h3><a class="anchor" name="index_$">- $ -</a></h3><ul> +<li>$args +: <a class="el" href="index_8php.html#67e94494731d99ed23b123e95175bc10">index.php</a> +, <a class="el" href="json_8php.html#67e94494731d99ed23b123e95175bc10">json.php</a> +<li>$single_tags +: <a class="el" href="html_8inc_8php.html#0a733c7a281726a879f13e7325881887">html.inc.php</a> +</ul> +<h3><a class="anchor" name="index__">- _ -</a></h3><ul> +<li>_array_sort_by_prio() +: <a class="el" href="html_8inc_8php.html#7fb2b386b2bae219112628971275c225">html.inc.php</a> +<li>_cmp_prio() +: <a class="el" href="html_8inc_8php.html#f8ecadff0a4b78867d4da5eae49615e1">html.inc.php</a> +<li>_cmp_time() +: <a class="el" href="module__glue_8inc_8php.html#5fea6c120a24a298149febcbf3b1df10">module_glue.inc.php</a> +<li>_gd_available() +: <a class="el" href="module__image_8inc_8php.html#574d6d760e50b88ffa815cab30a5e634">module_image.inc.php</a> +<li>_gd_get_imagesize() +: <a class="el" href="module__image_8inc_8php.html#3c76028c34273e722c9691243377a208">module_image.inc.php</a> +<li>_obj_lock() +: <a class="el" href="module__glue_8inc_8php.html#21f260355b875069ca90edf1f9a559d0">module_glue.inc.php</a> +<li>_obj_unlock() +: <a class="el" href="module__glue_8inc_8php.html#73a91facde5362e20df9657d31c2bb06">module_glue.inc.php</a> +<li>_text_render_content() +: <a class="el" href="module__text_8inc_8php.html#0586b5e177a15f5904d49b8b3aaf19ee">module_text.inc.php</a> +</ul> +<h3><a class="anchor" name="index_a">- a -</a></h3><ul> +<li>array_to_js() +: <a class="el" href="util_8inc_8php.html#61d3b2881d9368741c71509017724bc8">util.inc.php</a> +<li>array_unique_element() +: <a class="el" href="util_8inc_8php.html#4647462c98447c6c2842f70d8c313f85">util.inc.php</a> +<li>AUTH_METHOD +: <a class="el" href="config_8inc_8php.html#2ee7e30fa45253c5e303994703d3293f">config.inc.php</a> +<li>AUTH_PASSWORD +: <a class="el" href="config_8inc_8php.html#df2112da607b39714ba9cca31b42a93a">config.inc.php</a> +<li>AUTH_USER +: <a class="el" href="config_8inc_8php.html#7d3a74ff015a9f789a5a2e554a9fa956">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_b">- b -</a></h3><ul> +<li>BASE_URL +: <a class="el" href="config_8inc_8php.html#16548ab75ed30cbddce178d56d26dbb8">config.inc.php</a> +<li>base_url() +: <a class="el" href="config_8inc_8php.html#8fdfb46e432b25bbdad23971a23a26b5">config.inc.php</a> +<li>body() +: <a class="el" href="html_8inc_8php.html#8b842636055e9a5853a7a10a9e002330">html.inc.php</a> +<li>body_append() +: <a class="el" href="html_8inc_8php.html#d27881abf3a2004d287434d8c8d7cdf6">html.inc.php</a> +</ul> +<h3><a class="anchor" name="index_c">- c -</a></h3><ul> +<li>cache_output() +: <a class="el" href="common_8inc_8php.html#6cceb5c6a3c421c18e925515c78f6dfd">common.inc.php</a> +<li>CACHE_TIME +: <a class="el" href="config_8inc_8php.html#fc454c0433a87811735836800fe3350b">config.inc.php</a> +<li>check_auto_snapshot() +: <a class="el" href="module__glue_8inc_8php.html#aa1103a091b9dbca790e77d25a452ca5">module_glue.inc.php</a> +<li>clone_object() +: <a class="el" href="module__glue_8inc_8php.html#9c7f39d87787ce288ce3d8a3e389ba95">module_glue.inc.php</a> +<li>CONTENT_DIR +: <a class="el" href="config_8inc_8php.html#9949c9013641bf07cd112607d200d6ff">config.inc.php</a> +<li>controller_create_page() +: <a class="el" href="controller_8inc_8php.html#647d96ea8304771250e8fa4251a4d12e">controller.inc.php</a> +<li>controller_default() +: <a class="el" href="controller_8inc_8php.html#e9c67435a37f4b70d0769079c9dbf379">controller.inc.php</a> +<li>controller_edit() +: <a class="el" href="controller_8inc_8php.html#406fb5b2a2a93bef89e4ba46f8829d2f">controller.inc.php</a> +<li>controller_login() +: <a class="el" href="controller_8inc_8php.html#c3e283e26869e2ffd938bdf9775c3e81">controller.inc.php</a> +<li>controller_pages() +: <a class="el" href="module__page__browser_8inc_8php.html#7e937f92734b69829f9d3ab5e00f14e0">module_page_browser.inc.php</a> +<li>controller_revisions() +: <a class="el" href="module__revisions__browser_8inc_8php.html#9eda010871ad706aca87cfd7b9dd0f7d">module_revisions_browser.inc.php</a> +<li>controller_show() +: <a class="el" href="controller_8inc_8php.html#d135971740244b9e81718d4cd0407b11">controller.inc.php</a> +<li>create_object() +: <a class="el" href="module__glue_8inc_8php.html#12aa18f28f86274d770ba90aa88e2c3e">module_glue.inc.php</a> +<li>create_page() +: <a class="el" href="module__glue_8inc_8php.html#9806cd2a9b829a24876b149753e819fb">module_glue.inc.php</a> +</ul> +<h3><a class="anchor" name="index_d">- d -</a></h3><ul> +<li>default_html() +: <a class="el" href="common_8inc_8php.html#8916cb6ec34ceeb3f48c86655c305974">common.inc.php</a> +<li>DEFAULT_PAGE +: <a class="el" href="config_8inc_8php.html#4208e17d37801abf0982b2d1e625a8f2">config.inc.php</a> +<li>delete_object() +: <a class="el" href="module__glue_8inc_8php.html#51fdb1d1ff829d6d2d79a9f852b7e0ef">module_glue.inc.php</a> +<li>delete_page() +: <a class="el" href="module__glue_8inc_8php.html#f11541a6869804225793b82e54fa09fe">module_glue.inc.php</a> +<li>delete_upload() +: <a class="el" href="module__glue_8inc_8php.html#a4865d52ac449f8aaadb3a5d425f2efb">module_glue.inc.php</a> +<li>dir_is_different() +: <a class="el" href="util_8inc_8php.html#6309f576f2611237288d0dd3eed09db3">util.inc.php</a> +<li>download_delete_object() +: <a class="el" href="module__download_8inc_8php.html#5fd781bf1e0393667b227abec7169b28">module_download.inc.php</a> +<li>download_has_reference() +: <a class="el" href="module__download_8inc_8php.html#a80da3f3fd41f7f00f97043f7a2431c8">module_download.inc.php</a> +<li>download_render_object() +: <a class="el" href="module__download_8inc_8php.html#57c588f1fd0663aa16fd707a522bcc79">module_download.inc.php</a> +<li>download_render_page_early() +: <a class="el" href="module__download_8inc_8php.html#c980246bec838c65efd59bc25253b005">module_download.inc.php</a> +<li>download_save_state() +: <a class="el" href="module__download_8inc_8php.html#2e9ee6868b80832b40e9072a8c644c88">module_download.inc.php</a> +<li>download_serve_resource() +: <a class="el" href="module__download_8inc_8php.html#930c9545346e8da3f3db5a97dc4d8c74">module_download.inc.php</a> +<li>download_upload_fallback() +: <a class="el" href="module__download_8inc_8php.html#678bcaf9018d772881b4291020894fa0">module_download.inc.php</a> +<li>drop_cache() +: <a class="el" href="common_8inc_8php.html#7ca47f8aab349971cde2d4b02441cf41">common.inc.php</a> +</ul> +<h3><a class="anchor" name="index_e">- e -</a></h3><ul> +<li>elem() +: <a class="el" href="html_8inc_8php.html#a7a1256f84f937f1656195d5ce7b8d91">html.inc.php</a> +<li>elem_add_class() +: <a class="el" href="html_8inc_8php.html#afa12d2b690751666e599fb052e19ca6">html.inc.php</a> +<li>elem_append() +: <a class="el" href="html_8inc_8php.html#ea37c451f5d55e2efbb2656e340c1dae">html.inc.php</a> +<li>elem_attr() +: <a class="el" href="html_8inc_8php.html#894dc22f3b7668c59364599909162b8e">html.inc.php</a> +<li>elem_css() +: <a class="el" href="html_8inc_8php.html#c705ef06deb9e2d49e342ed78ecc1c9a">html.inc.php</a> +<li>elem_finalize() +: <a class="el" href="html_8inc_8php.html#f04b43a4dd09e73ca2cef84a4f2e9381">html.inc.php</a> +<li>elem_has_class() +: <a class="el" href="html_8inc_8php.html#b1019c4b75181c1c1af10e1c1e5e197d">html.inc.php</a> +<li>elem_remove_attr() +: <a class="el" href="html_8inc_8php.html#eb7074172d9164f69e64967b6bcdc643">html.inc.php</a> +<li>elem_remove_class() +: <a class="el" href="html_8inc_8php.html#6a224914e8f32176ca11a31154b1ae13">html.inc.php</a> +<li>elem_val() +: <a class="el" href="html_8inc_8php.html#e28d850c3c906c6884462ca89c06f59b">html.inc.php</a> +<li>elseif +: <a class="el" href="json_8php.html#ffd32ec1771cd364116738727d3a1ed8">json.php</a> +<li>expl() +: <a class="el" href="util_8inc_8php.html#afce787d4b725ac62be6306ff3e352e7">util.inc.php</a> +<li>expl_whitesp() +: <a class="el" href="util_8inc_8php.html#1d2500a5e237e59956b03cbea845c95a">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_f">- f -</a></h3><ul> +<li>FAVICON +: <a class="el" href="config_8inc_8php.html#fd55d95ee6651060397404533516882a">config.inc.php</a> +<li>file_is_different() +: <a class="el" href="util_8inc_8php.html#9c9a81ec9dba8b2870cbb365f8139866">util.inc.php</a> +<li>filext() +: <a class="el" href="util_8inc_8php.html#6d9392e51344c2e8720a0c1982ebea21">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_g">- g -</a></h3><ul> +<li>get_hooks() +: <a class="el" href="modules_8inc_8php.html#dcaa12e356133b7fa0670571698b38cc">modules.inc.php</a> +<li>get_modules() +: <a class="el" href="modules_8inc_8php.html#1b73e435e11b07906d0781b146b4aa21">modules.inc.php</a> +<li>get_service() +: <a class="el" href="modules_8inc_8php.html#bf7633223c2fd4ecb199a8e0dc070802">modules.inc.php</a> +<li>glue_module_info() +: <a class="el" href="module__glue_8inc_8php.html#9b741f04b878cbc03f1aac7d3406d548">module_glue.inc.php</a> +<li>glue_version() +: <a class="el" href="common_8inc_8php.html#0d6d0da45f4adf6283bcccec9fd107e3">common.inc.php</a> +</ul> +<h3><a class="anchor" name="index_h">- h -</a></h3><ul> +<li>HOTGLUE_VERSION +: <a class="el" href="config_8inc_8php.html#7c35565a4692ae46fd1c04340f4f1ca9">config.inc.php</a> +<li>html_add_alternate() +: <a class="el" href="html_8inc_8php.html#e013e8f0bdd681184ee1873a1964c454">html.inc.php</a> +<li>html_add_css() +: <a class="el" href="html_8inc_8php.html#962ef1b29e909a38b9a7b79086d54ab2">html.inc.php</a> +<li>html_add_js() +: <a class="el" href="html_8inc_8php.html#450214704e1bbc2e8849abb54db38a03">html.inc.php</a> +<li>html_add_js_code() +: <a class="el" href="html_8inc_8php.html#90601d141e5751c07b61f32f623ed7d2">html.inc.php</a> +<li>html_add_js_var() +: <a class="el" href="html_8inc_8php.html#84769b7fe7b5454ff46534d0577eb54c">html.inc.php</a> +<li>html_css() +: <a class="el" href="html_8inc_8php.html#d52276fa2a03df7342ba4b8e6a334ce0">html.inc.php</a> +<li>html_disable_caching() +: <a class="el" href="html_8inc_8php.html#b0dafe79ee61164014b0a4d8b4112dbb">html.inc.php</a> +<li>html_encode_str_smart() +: <a class="el" href="html__parse_8inc_8php.html#7eda4037f4b2576b3bcd97408ff95bd5">html_parse.inc.php</a> +<li>html_favicon() +: <a class="el" href="html_8inc_8php.html#5738adf9b56d1ff2b8d02977ed7929ce">html.inc.php</a> +<li>html_finalize() +: <a class="el" href="html_8inc_8php.html#405dc7e3718d4196c05087057ebf69bf">html.inc.php</a> +<li>html_parse() +: <a class="el" href="html__parse_8inc_8php.html#1003b146f08aef5a3a78d75a3538a4d7">html_parse.inc.php</a> +<li>html_parse_elem() +: <a class="el" href="html__parse_8inc_8php.html#6d9c21ee610953fb5b5b64fae3f74ed3">html_parse.inc.php</a> +<li>html_title() +: <a class="el" href="html_8inc_8php.html#3f572f51a815fe19c590fea7d6d3a1a6">html.inc.php</a> +<li>http_400() +: <a class="el" href="util_8inc_8php.html#78288ca93c62ce2b5ef34f40352c7324">util.inc.php</a> +<li>http_404() +: <a class="el" href="util_8inc_8php.html#24f09c2c8205022b013bbee5293a38ae">util.inc.php</a> +<li>http_500() +: <a class="el" href="util_8inc_8php.html#575cc91d803ae46bbc5dfaecbeb3561d">util.inc.php</a> +<li>http_digest_check() +: <a class="el" href="util_8inc_8php.html#ff065fbc9f3abbf9c5a0ebfba22acbf7">util.inc.php</a> +<li>http_digest_prompt() +: <a class="el" href="util_8inc_8php.html#95d221746e2d296434b0d63f78cedf57">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_i">- i -</a></h3><ul> +<li>IE8_COMPAT +: <a class="el" href="config_8inc_8php.html#1d76a949b348522c90864da5df468d51">config.inc.php</a> +<li>iframe_render_object() +: <a class="el" href="module__iframe_8inc_8php.html#40856482f79fb837bc538e8eed66aff4">module_iframe.inc.php</a> +<li>iframe_render_page_early() +: <a class="el" href="module__iframe_8inc_8php.html#d4d8fd8256a19beb570193c2886659e5">module_iframe.inc.php</a> +<li>iframe_save_state() +: <a class="el" href="module__iframe_8inc_8php.html#3034fcc475334b511b91932918fcfe57">module_iframe.inc.php</a> +<li>image_delete_object() +: <a class="el" href="module__image_8inc_8php.html#7cbcf6138ccff16a8b733cfd6f0f1666">module_image.inc.php</a> +<li>image_has_reference() +: <a class="el" href="module__image_8inc_8php.html#0bef6164f5eafe368d251639cf6fe298">module_image.inc.php</a> +<li>IMAGE_JPEG_QUAL +: <a class="el" href="config_8inc_8php.html#f27e0280ef96e9b1d2d968a0d2d208ff">config.inc.php</a> +<li>IMAGE_PNG_QUAL +: <a class="el" href="config_8inc_8php.html#3e161cc5c717f2e23d89b69ec297af9b">config.inc.php</a> +<li>image_render_object() +: <a class="el" href="module__image_8inc_8php.html#4fadded2a225d1b5ea73404a84597620">module_image.inc.php</a> +<li>image_render_page_early() +: <a class="el" href="module__image_8inc_8php.html#8266a74a11a86a73e2aa3709388fd43f">module_image.inc.php</a> +<li>image_resize() +: <a class="el" href="module__image_8inc_8php.html#9e03a71310133176236ae0bd4a0241e0">module_image.inc.php</a> +<li>IMAGE_RESIZING +: <a class="el" href="config_8inc_8php.html#0654894e46ca07417a6e85e091ed7d1d">config.inc.php</a> +<li>image_save_state() +: <a class="el" href="module__image_8inc_8php.html#c26ea1448f0b7ed835907cf7c22b60ca">module_image.inc.php</a> +<li>image_serve_resource() +: <a class="el" href="module__image_8inc_8php.html#bb6646bfaa6a012e620cdaaa0bc3c807">module_image.inc.php</a> +<li>image_upload() +: <a class="el" href="module__image_8inc_8php.html#37dee9de60e2852c0631d8e60e58585c">module_image.inc.php</a> +<li>invoke_controller() +: <a class="el" href="controller_8inc_8php.html#170bef82dc4636c51b678276323e4ff4">controller.inc.php</a> +<li>invoke_hook() +: <a class="el" href="modules_8inc_8php.html#3318fb85bac26e6fb2397c6ea9f02322">modules.inc.php</a> +<li>invoke_hook_while() +: <a class="el" href="modules_8inc_8php.html#66473fc9f24153d85053f1f9c6ed83e4">modules.inc.php</a> +<li>is_auth() +: <a class="el" href="common_8inc_8php.html#b3abbb2cd13e01231533e7cdc93da6db">common.inc.php</a> +<li>is_cached() +: <a class="el" href="common_8inc_8php.html#6fb34b9210b43349ca3eb16b2738a28b">common.inc.php</a> +<li>is_url() +: <a class="el" href="util_8inc_8php.html#0da48011cb68c039aec396c23cb04295">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_j">- j -</a></h3><ul> +<li>JQUERY +: <a class="el" href="config_8inc_8php.html#5c2fff7e41a0380fb7872627e3a14a29">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_l">- l -</a></h3><ul> +<li>load_modules() +: <a class="el" href="modules_8inc_8php.html#23f8be02dc2148a3c860119a1d6ea276">modules.inc.php</a> +<li>load_object() +: <a class="el" href="module__glue_8inc_8php.html#c6b5ed5ff055ccb4d07ad17cf78d5a11">module_glue.inc.php</a> +<li>LOCK_TIME +: <a class="el" href="config_8inc_8php.html#924ae40271cc363050158e36b3823407">config.inc.php</a> +<li>LOG_FILE +: <a class="el" href="config_8inc_8php.html#6de83433b64b24349644a4c2d839dcb7">config.inc.php</a> +<li>LOG_LEVEL +: <a class="el" href="config_8inc_8php.html#a5a9053636a30269210c54e734e0d583">config.inc.php</a> +<li>log_msg() +: <a class="el" href="log_8inc_8php.html#0d59d693ca96c65b67de4b197954ce60">log.inc.php</a> +</ul> +<h3><a class="anchor" name="index_n">- n -</a></h3><ul> +<li>nl() +: <a class="el" href="util_8inc_8php.html#9f9eeab2eb9a39518e80609fc7f83842">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_o">- o -</a></h3><ul> +<li>object_alter_render_early() +: <a class="el" href="module__object_8inc_8php.html#6acc3273ff9872e01527162375d318d8">module_object.inc.php</a> +<li>object_alter_render_late() +: <a class="el" href="module__object_8inc_8php.html#6b5bf16a15b7d5809bd7c6d15cd05a52">module_object.inc.php</a> +<li>object_alter_save() +: <a class="el" href="module__object_8inc_8php.html#ba3a00b339dc7e9831b48a94f4f8e211">module_object.inc.php</a> +<li>OBJECT_DEFAULT_COLORS +: <a class="el" href="config_8inc_8php.html#3e205a45d91d7ef191e53487b6b48b3b">config.inc.php</a> +<li>object_exists() +: <a class="el" href="common_8inc_8php.html#3d71a269e01b98748fb57719feef27be">common.inc.php</a> +<li>object_get_symlink() +: <a class="el" href="module__glue_8inc_8php.html#a9618d306b7ee5bd9e5d6a0be268ed44">module_glue.inc.php</a> +<li>object_make_symlink() +: <a class="el" href="module__glue_8inc_8php.html#14e6da411df5aa9ff38e2d4ea27dd077">module_glue.inc.php</a> +<li>object_remove_attr() +: <a class="el" href="module__glue_8inc_8php.html#e16d748c2d933978daec8bf11acdc34b">module_glue.inc.php</a> +<li>object_render_page_early() +: <a class="el" href="module__object_8inc_8php.html#d06c13f1778d655f4a011d1763c6e618">module_object.inc.php</a> +</ul> +<h3><a class="anchor" name="index_p">- p -</a></h3><ul> +<li>pad() +: <a class="el" href="util_8inc_8php.html#37ef346387afe0af2cf86a8bea887173">util.inc.php</a> +<li>page_browser_render_page_early() +: <a class="el" href="module__page__browser_8inc_8php.html#a94d17bbea100ee50f09c7bf4094a1db">module_page_browser.inc.php</a> +<li>page_canonical() +: <a class="el" href="common_8inc_8php.html#31ed04b0c90ac3077e71743c307d45f8">common.inc.php</a> +<li>PAGE_DEFAULT_GRID_X +: <a class="el" href="config_8inc_8php.html#bc1c54acdbce897c718854b663517cf9">config.inc.php</a> +<li>PAGE_DEFAULT_GRID_Y +: <a class="el" href="config_8inc_8php.html#b93c5dcea5ef58747b80594c3d9304d7">config.inc.php</a> +<li>page_exists() +: <a class="el" href="common_8inc_8php.html#a71868111dd5b8af98df9cc9c968e523">common.inc.php</a> +<li>PAGE_GUIDES_X +: <a class="el" href="config_8inc_8php.html#81167deb206874270a59273141919fe5">config.inc.php</a> +<li>PAGE_GUIDES_Y +: <a class="el" href="config_8inc_8php.html#3f78eb981e05f649bfff403c0e595d0b">config.inc.php</a> +<li>page_render_object() +: <a class="el" href="module__page_8inc_8php.html#53e7091b9a654d0d772cea6e3127820e">module_page.inc.php</a> +<li>page_render_page_early() +: <a class="el" href="module__page_8inc_8php.html#80aff2ea069c7a2ba120e26bb218efa5">module_page.inc.php</a> +<li>page_short() +: <a class="el" href="common_8inc_8php.html#da968adfb989aa09adaf29867208f1ab">common.inc.php</a> +<li>pagenames() +: <a class="el" href="module__glue_8inc_8php.html#354fc85f928484ae3b316bbf0065d9bd">module_glue.inc.php</a> +<li>PAGES_NEED_AUTH +: <a class="el" href="config_8inc_8php.html#11f5534165e1764860b16cc7215b2141">config.inc.php</a> +<li>parse_query_string() +: <a class="el" href="controller_8inc_8php.html#51a50fbc5165b4ff0a289b2010bb7597">controller.inc.php</a> +<li>prompt_auth() +: <a class="el" href="common_8inc_8php.html#80c23c9d8ac02159151d6368506b1b54">common.inc.php</a> +</ul> +<h3><a class="anchor" name="index_q">- q -</a></h3><ul> +<li>quot() +: <a class="el" href="util_8inc_8php.html#3c7d87c658499c1559a6b98cac06f58d">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_r">- r -</a></h3><ul> +<li>register_controller() +: <a class="el" href="controller_8inc_8php.html#543961dbcd309fa2cb6a887a8666bf1c">controller.inc.php</a> +<li>register_hook() +: <a class="el" href="modules_8inc_8php.html#d91a5f96df0655d782404170324e567d">modules.inc.php</a> +<li>register_service() +: <a class="el" href="modules_8inc_8php.html#e6ed600fb2ce39a4b0837bbb01fe8d6e">modules.inc.php</a> +<li>rename_page() +: <a class="el" href="module__glue_8inc_8php.html#cd08b36587528b6f088cafb7d1d6bd29">module_glue.inc.php</a> +<li>render_object() +: <a class="el" href="module__glue_8inc_8php.html#e9103a74e4b40e88536fbc0a52d1c72f">module_glue.inc.php</a> +<li>render_page() +: <a class="el" href="module__glue_8inc_8php.html#ab1981a767de519c6c4afb946d748d0a">module_glue.inc.php</a> +<li>resolve_aliases() +: <a class="el" href="common_8inc_8php.html#78992fdfae6cd9d7d4e8053d004d1709">common.inc.php</a> +<li>resolve_relative_urls() +: <a class="el" href="common_8inc_8php.html#81eb70073067db81ab43829870f15e6d">common.inc.php</a> +<li>response() +: <a class="el" href="modules_8inc_8php.html#361058ff2a03c098045c4442440a2574">modules.inc.php</a> +<li>revert() +: <a class="el" href="module__glue_8inc_8php.html#e69e25beb40feedc02d3b850587d20cc">module_glue.inc.php</a> +<li>revisions() +: <a class="el" href="module__glue_8inc_8php.html#27d90d2ed1b4142554bc4e0e47e9ba0c">module_glue.inc.php</a> +<li>revisions_browser_render_page_early() +: <a class="el" href="module__revisions__browser_8inc_8php.html#eb482f35141c71dd933daeec9e9ce599">module_revisions_browser.inc.php</a> +<li>revisions_info() +: <a class="el" href="module__glue_8inc_8php.html#1dc65b69a920ac4ebc8f7c1df305060b">module_glue.inc.php</a> +<li>REVISIONS_NEED_AUTH +: <a class="el" href="config_8inc_8php.html#67b9479d334a4e6c33c0bc3505b3eb5e">config.inc.php</a> +<li>run_service() +: <a class="el" href="modules_8inc_8php.html#3d581f1636df2e24ffe7b013a12fb1db">modules.inc.php</a> +</ul> +<h3><a class="anchor" name="index_s">- s -</a></h3><ul> +<li>save_object() +: <a class="el" href="module__glue_8inc_8php.html#b294f21c7f6fed0932b65167f180c78c">module_glue.inc.php</a> +<li>save_state() +: <a class="el" href="module__glue_8inc_8php.html#60d03d7a0d8783e926835f0aa6cff698">module_glue.inc.php</a> +<li>serve_cached() +: <a class="el" href="common_8inc_8php.html#ac90387dcab722e243df2d083f8d6a00">common.inc.php</a> +<li>serve_file() +: <a class="el" href="util_8inc_8php.html#9d3ab20fc8b79fb6ab860f93600c745e">util.inc.php</a> +<li>serve_resource() +: <a class="el" href="controller_8inc_8php.html#5d5274c3531eb05a1ea5927ff3cd08d3">controller.inc.php</a> +<li>set_startpage() +: <a class="el" href="module__glue_8inc_8php.html#afa7a8fa046ff6119cb7506d68edf787">module_glue.inc.php</a> +<li>SHORT_URLS +: <a class="el" href="config_8inc_8php.html#377ac3321785e25215435e8d9802bc34">config.inc.php</a> +<li>SITE_NAME +: <a class="el" href="config_8inc_8php.html#38f8e1265350d7091b55f4cffe629f3a">config.inc.php</a> +<li>snapshot() +: <a class="el" href="module__glue_8inc_8php.html#5d3ad02088eee566589cd47fe0dc889a">module_glue.inc.php</a> +<li>SNAPSHOT_MAX_AGE +: <a class="el" href="config_8inc_8php.html#a9c8d739795b1000f6ea105992a4e488">config.inc.php</a> +<li>SNAPSHOT_MIN_AGE +: <a class="el" href="config_8inc_8php.html#7fb94ff6aaa61e964fe2f90f738d5cb3">config.inc.php</a> +<li>startpage() +: <a class="el" href="common_8inc_8php.html#0a3ee1e9beca572266648f17b9c4c75f">common.inc.php</a> +</ul> +<h3><a class="anchor" name="index_t">- t -</a></h3><ul> +<li>tab() +: <a class="el" href="util_8inc_8php.html#74e38925e7162356a2ea14db32664c37">util.inc.php</a> +<li>TEXT_AUTO_BR +: <a class="el" href="config_8inc_8php.html#6f581226f389510394c592491ebedc0b">config.inc.php</a> +<li>text_render_object() +: <a class="el" href="module__text_8inc_8php.html#8e9b1db22ff6cb0f3d20815da6aae6ce">module_text.inc.php</a> +<li>text_render_page_early() +: <a class="el" href="module__text_8inc_8php.html#aaa8b8407d795f6dba9d258f1457ade8">module_text.inc.php</a> +<li>text_save_state() +: <a class="el" href="module__text_8inc_8php.html#7fa0ea2ee517914595d7eda355177289">module_text.inc.php</a> +</ul> +<h3><a class="anchor" name="index_u">- u -</a></h3><ul> +<li>update_object() +: <a class="el" href="module__glue_8inc_8php.html#4aed316adcde13b40c9fc1b35e6537a4">module_glue.inc.php</a> +<li>upload_file() +: <a class="el" href="common_8inc_8php.html#4659077c34b709eec75f9897ea07e55a">common.inc.php</a> +<li>upload_files() +: <a class="el" href="module__glue_8inc_8php.html#43746135e67f614d79317029aced064b">module_glue.inc.php</a> +<li>upload_references() +: <a class="el" href="module__glue_8inc_8php.html#2099347b9bdf5a5973a13e5f7a4be933">module_glue.inc.php</a> +<li>USE_MIN_FILES +: <a class="el" href="config_8inc_8php.html#98806af9de0ea41a958d26c7e06b26a9">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_v">- v -</a></h3><ul> +<li>valid_pagename() +: <a class="el" href="common_8inc_8php.html#0ef613d233a6e62f7e631b8dfcd710bf">common.inc.php</a> +<li>var_dump_inl() +: <a class="el" href="util_8inc_8php.html#a5cc9d5f8a0b5bb76dfe3d15796e5940">util.inc.php</a> +<li>video_delete_object() +: <a class="el" href="module__video_8inc_8php.html#4d25a132251840ed2ade27b636a6694e">module_video.inc.php</a> +<li>video_has_reference() +: <a class="el" href="module__video_8inc_8php.html#dbbede5e492ca7b9457deaf076c887b0">module_video.inc.php</a> +<li>video_render_object() +: <a class="el" href="module__video_8inc_8php.html#14d6bc200a41905ad201a24d9a2d9be5">module_video.inc.php</a> +<li>video_render_page_early() +: <a class="el" href="module__video_8inc_8php.html#223ac9bac4acfb2c9b458b43e45e06e3">module_video.inc.php</a> +<li>video_save_state() +: <a class="el" href="module__video_8inc_8php.html#828b4f740b870b886936a22baf97418e">module_video.inc.php</a> +<li>video_serve_resource() +: <a class="el" href="module__video_8inc_8php.html#5af838d3c4206bbc9bc3b5e57b16655c">module_video.inc.php</a> +<li>VIDEO_START_ON_CLICK +: <a class="el" href="config_8inc_8php.html#e1e42e1baa41f003453356a3747f9fee">config.inc.php</a> +<li>video_upload() +: <a class="el" href="module__video_8inc_8php.html#6ab50ffd184d8dcf84a9783dd6a2f80e">module_video.inc.php</a> +</ul> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/globals_enum.html b/doc/html/globals_enum.html new file mode 100644 index 0000000..d441b41 --- /dev/null +++ b/doc/html/globals_enum.html @@ -0,0 +1,152 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: Class Members</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li class="current"><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="globals.html"><span>All</span></a></li> + <li><a href="globals_func.html"><span>Functions</span></a></li> + <li><a href="globals_vars.html"><span>Variables</span></a></li> + <li class="current"><a href="globals_enum.html"><span>Enumerations</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="#index_a"><span>a</span></a></li> + <li><a href="#index_b"><span>b</span></a></li> + <li><a href="#index_c"><span>c</span></a></li> + <li><a href="#index_d"><span>d</span></a></li> + <li><a href="#index_f"><span>f</span></a></li> + <li><a href="#index_h"><span>h</span></a></li> + <li><a href="#index_i"><span>i</span></a></li> + <li><a href="#index_j"><span>j</span></a></li> + <li><a href="#index_l"><span>l</span></a></li> + <li><a href="#index_o"><span>o</span></a></li> + <li><a href="#index_p"><span>p</span></a></li> + <li><a href="#index_r"><span>r</span></a></li> + <li><a href="#index_s"><span>s</span></a></li> + <li><a href="#index_t"><span>t</span></a></li> + <li><a href="#index_u"><span>u</span></a></li> + <li><a href="#index_v"><span>v</span></a></li> + </ul> + </div> +</div> +<div class="contents"> + +<p> +<h3><a class="anchor" name="index_a">- a -</a></h3><ul> +<li>AUTH_METHOD +: <a class="el" href="config_8inc_8php.html#2ee7e30fa45253c5e303994703d3293f">config.inc.php</a> +<li>AUTH_PASSWORD +: <a class="el" href="config_8inc_8php.html#df2112da607b39714ba9cca31b42a93a">config.inc.php</a> +<li>AUTH_USER +: <a class="el" href="config_8inc_8php.html#7d3a74ff015a9f789a5a2e554a9fa956">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_b">- b -</a></h3><ul> +<li>BASE_URL +: <a class="el" href="config_8inc_8php.html#16548ab75ed30cbddce178d56d26dbb8">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_c">- c -</a></h3><ul> +<li>CACHE_TIME +: <a class="el" href="config_8inc_8php.html#fc454c0433a87811735836800fe3350b">config.inc.php</a> +<li>CONTENT_DIR +: <a class="el" href="config_8inc_8php.html#9949c9013641bf07cd112607d200d6ff">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_d">- d -</a></h3><ul> +<li>DEFAULT_PAGE +: <a class="el" href="config_8inc_8php.html#4208e17d37801abf0982b2d1e625a8f2">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_f">- f -</a></h3><ul> +<li>FAVICON +: <a class="el" href="config_8inc_8php.html#fd55d95ee6651060397404533516882a">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_h">- h -</a></h3><ul> +<li>HOTGLUE_VERSION +: <a class="el" href="config_8inc_8php.html#7c35565a4692ae46fd1c04340f4f1ca9">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_i">- i -</a></h3><ul> +<li>IE8_COMPAT +: <a class="el" href="config_8inc_8php.html#1d76a949b348522c90864da5df468d51">config.inc.php</a> +<li>IMAGE_JPEG_QUAL +: <a class="el" href="config_8inc_8php.html#f27e0280ef96e9b1d2d968a0d2d208ff">config.inc.php</a> +<li>IMAGE_PNG_QUAL +: <a class="el" href="config_8inc_8php.html#3e161cc5c717f2e23d89b69ec297af9b">config.inc.php</a> +<li>IMAGE_RESIZING +: <a class="el" href="config_8inc_8php.html#0654894e46ca07417a6e85e091ed7d1d">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_j">- j -</a></h3><ul> +<li>JQUERY +: <a class="el" href="config_8inc_8php.html#5c2fff7e41a0380fb7872627e3a14a29">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_l">- l -</a></h3><ul> +<li>LOCK_TIME +: <a class="el" href="config_8inc_8php.html#924ae40271cc363050158e36b3823407">config.inc.php</a> +<li>LOG_FILE +: <a class="el" href="config_8inc_8php.html#6de83433b64b24349644a4c2d839dcb7">config.inc.php</a> +<li>LOG_LEVEL +: <a class="el" href="config_8inc_8php.html#a5a9053636a30269210c54e734e0d583">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_o">- o -</a></h3><ul> +<li>OBJECT_DEFAULT_COLORS +: <a class="el" href="config_8inc_8php.html#3e205a45d91d7ef191e53487b6b48b3b">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_p">- p -</a></h3><ul> +<li>PAGE_DEFAULT_GRID_X +: <a class="el" href="config_8inc_8php.html#bc1c54acdbce897c718854b663517cf9">config.inc.php</a> +<li>PAGE_DEFAULT_GRID_Y +: <a class="el" href="config_8inc_8php.html#b93c5dcea5ef58747b80594c3d9304d7">config.inc.php</a> +<li>PAGE_GUIDES_X +: <a class="el" href="config_8inc_8php.html#81167deb206874270a59273141919fe5">config.inc.php</a> +<li>PAGE_GUIDES_Y +: <a class="el" href="config_8inc_8php.html#3f78eb981e05f649bfff403c0e595d0b">config.inc.php</a> +<li>PAGES_NEED_AUTH +: <a class="el" href="config_8inc_8php.html#11f5534165e1764860b16cc7215b2141">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_r">- r -</a></h3><ul> +<li>REVISIONS_NEED_AUTH +: <a class="el" href="config_8inc_8php.html#67b9479d334a4e6c33c0bc3505b3eb5e">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_s">- s -</a></h3><ul> +<li>SHORT_URLS +: <a class="el" href="config_8inc_8php.html#377ac3321785e25215435e8d9802bc34">config.inc.php</a> +<li>SITE_NAME +: <a class="el" href="config_8inc_8php.html#38f8e1265350d7091b55f4cffe629f3a">config.inc.php</a> +<li>SNAPSHOT_MAX_AGE +: <a class="el" href="config_8inc_8php.html#a9c8d739795b1000f6ea105992a4e488">config.inc.php</a> +<li>SNAPSHOT_MIN_AGE +: <a class="el" href="config_8inc_8php.html#7fb94ff6aaa61e964fe2f90f738d5cb3">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_t">- t -</a></h3><ul> +<li>TEXT_AUTO_BR +: <a class="el" href="config_8inc_8php.html#6f581226f389510394c592491ebedc0b">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_u">- u -</a></h3><ul> +<li>USE_MIN_FILES +: <a class="el" href="config_8inc_8php.html#98806af9de0ea41a958d26c7e06b26a9">config.inc.php</a> +</ul> +<h3><a class="anchor" name="index_v">- v -</a></h3><ul> +<li>VIDEO_START_ON_CLICK +: <a class="el" href="config_8inc_8php.html#e1e42e1baa41f003453356a3747f9fee">config.inc.php</a> +</ul> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/globals_func.html b/doc/html/globals_func.html new file mode 100644 index 0000000..a8e5ca9 --- /dev/null +++ b/doc/html/globals_func.html @@ -0,0 +1,410 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: Class Members</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li class="current"><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="globals.html"><span>All</span></a></li> + <li class="current"><a href="globals_func.html"><span>Functions</span></a></li> + <li><a href="globals_vars.html"><span>Variables</span></a></li> + <li><a href="globals_enum.html"><span>Enumerations</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="#index__"><span>_</span></a></li> + <li><a href="#index_a"><span>a</span></a></li> + <li><a href="#index_b"><span>b</span></a></li> + <li><a href="#index_c"><span>c</span></a></li> + <li><a href="#index_d"><span>d</span></a></li> + <li><a href="#index_e"><span>e</span></a></li> + <li><a href="#index_f"><span>f</span></a></li> + <li><a href="#index_g"><span>g</span></a></li> + <li><a href="#index_h"><span>h</span></a></li> + <li><a href="#index_i"><span>i</span></a></li> + <li><a href="#index_l"><span>l</span></a></li> + <li><a href="#index_n"><span>n</span></a></li> + <li><a href="#index_o"><span>o</span></a></li> + <li><a href="#index_p"><span>p</span></a></li> + <li><a href="#index_q"><span>q</span></a></li> + <li><a href="#index_r"><span>r</span></a></li> + <li><a href="#index_s"><span>s</span></a></li> + <li><a href="#index_t"><span>t</span></a></li> + <li><a href="#index_u"><span>u</span></a></li> + <li><a href="#index_v"><span>v</span></a></li> + </ul> + </div> +</div> +<div class="contents"> + +<p> +<h3><a class="anchor" name="index__">- _ -</a></h3><ul> +<li>_array_sort_by_prio() +: <a class="el" href="html_8inc_8php.html#7fb2b386b2bae219112628971275c225">html.inc.php</a> +<li>_cmp_prio() +: <a class="el" href="html_8inc_8php.html#f8ecadff0a4b78867d4da5eae49615e1">html.inc.php</a> +<li>_cmp_time() +: <a class="el" href="module__glue_8inc_8php.html#5fea6c120a24a298149febcbf3b1df10">module_glue.inc.php</a> +<li>_gd_available() +: <a class="el" href="module__image_8inc_8php.html#574d6d760e50b88ffa815cab30a5e634">module_image.inc.php</a> +<li>_gd_get_imagesize() +: <a class="el" href="module__image_8inc_8php.html#3c76028c34273e722c9691243377a208">module_image.inc.php</a> +<li>_obj_lock() +: <a class="el" href="module__glue_8inc_8php.html#21f260355b875069ca90edf1f9a559d0">module_glue.inc.php</a> +<li>_obj_unlock() +: <a class="el" href="module__glue_8inc_8php.html#73a91facde5362e20df9657d31c2bb06">module_glue.inc.php</a> +<li>_text_render_content() +: <a class="el" href="module__text_8inc_8php.html#0586b5e177a15f5904d49b8b3aaf19ee">module_text.inc.php</a> +</ul> +<h3><a class="anchor" name="index_a">- a -</a></h3><ul> +<li>array_to_js() +: <a class="el" href="util_8inc_8php.html#61d3b2881d9368741c71509017724bc8">util.inc.php</a> +<li>array_unique_element() +: <a class="el" href="util_8inc_8php.html#4647462c98447c6c2842f70d8c313f85">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_b">- b -</a></h3><ul> +<li>base_url() +: <a class="el" href="config_8inc_8php.html#8fdfb46e432b25bbdad23971a23a26b5">config.inc.php</a> +<li>body() +: <a class="el" href="html_8inc_8php.html#8b842636055e9a5853a7a10a9e002330">html.inc.php</a> +<li>body_append() +: <a class="el" href="html_8inc_8php.html#d27881abf3a2004d287434d8c8d7cdf6">html.inc.php</a> +</ul> +<h3><a class="anchor" name="index_c">- c -</a></h3><ul> +<li>cache_output() +: <a class="el" href="common_8inc_8php.html#6cceb5c6a3c421c18e925515c78f6dfd">common.inc.php</a> +<li>check_auto_snapshot() +: <a class="el" href="module__glue_8inc_8php.html#aa1103a091b9dbca790e77d25a452ca5">module_glue.inc.php</a> +<li>clone_object() +: <a class="el" href="module__glue_8inc_8php.html#9c7f39d87787ce288ce3d8a3e389ba95">module_glue.inc.php</a> +<li>controller_create_page() +: <a class="el" href="controller_8inc_8php.html#647d96ea8304771250e8fa4251a4d12e">controller.inc.php</a> +<li>controller_default() +: <a class="el" href="controller_8inc_8php.html#e9c67435a37f4b70d0769079c9dbf379">controller.inc.php</a> +<li>controller_edit() +: <a class="el" href="controller_8inc_8php.html#406fb5b2a2a93bef89e4ba46f8829d2f">controller.inc.php</a> +<li>controller_login() +: <a class="el" href="controller_8inc_8php.html#c3e283e26869e2ffd938bdf9775c3e81">controller.inc.php</a> +<li>controller_pages() +: <a class="el" href="module__page__browser_8inc_8php.html#7e937f92734b69829f9d3ab5e00f14e0">module_page_browser.inc.php</a> +<li>controller_revisions() +: <a class="el" href="module__revisions__browser_8inc_8php.html#9eda010871ad706aca87cfd7b9dd0f7d">module_revisions_browser.inc.php</a> +<li>controller_show() +: <a class="el" href="controller_8inc_8php.html#d135971740244b9e81718d4cd0407b11">controller.inc.php</a> +<li>create_object() +: <a class="el" href="module__glue_8inc_8php.html#12aa18f28f86274d770ba90aa88e2c3e">module_glue.inc.php</a> +<li>create_page() +: <a class="el" href="module__glue_8inc_8php.html#9806cd2a9b829a24876b149753e819fb">module_glue.inc.php</a> +</ul> +<h3><a class="anchor" name="index_d">- d -</a></h3><ul> +<li>default_html() +: <a class="el" href="common_8inc_8php.html#8916cb6ec34ceeb3f48c86655c305974">common.inc.php</a> +<li>delete_object() +: <a class="el" href="module__glue_8inc_8php.html#51fdb1d1ff829d6d2d79a9f852b7e0ef">module_glue.inc.php</a> +<li>delete_page() +: <a class="el" href="module__glue_8inc_8php.html#f11541a6869804225793b82e54fa09fe">module_glue.inc.php</a> +<li>delete_upload() +: <a class="el" href="module__glue_8inc_8php.html#a4865d52ac449f8aaadb3a5d425f2efb">module_glue.inc.php</a> +<li>dir_is_different() +: <a class="el" href="util_8inc_8php.html#6309f576f2611237288d0dd3eed09db3">util.inc.php</a> +<li>download_delete_object() +: <a class="el" href="module__download_8inc_8php.html#5fd781bf1e0393667b227abec7169b28">module_download.inc.php</a> +<li>download_has_reference() +: <a class="el" href="module__download_8inc_8php.html#a80da3f3fd41f7f00f97043f7a2431c8">module_download.inc.php</a> +<li>download_render_object() +: <a class="el" href="module__download_8inc_8php.html#57c588f1fd0663aa16fd707a522bcc79">module_download.inc.php</a> +<li>download_render_page_early() +: <a class="el" href="module__download_8inc_8php.html#c980246bec838c65efd59bc25253b005">module_download.inc.php</a> +<li>download_save_state() +: <a class="el" href="module__download_8inc_8php.html#2e9ee6868b80832b40e9072a8c644c88">module_download.inc.php</a> +<li>download_serve_resource() +: <a class="el" href="module__download_8inc_8php.html#930c9545346e8da3f3db5a97dc4d8c74">module_download.inc.php</a> +<li>download_upload_fallback() +: <a class="el" href="module__download_8inc_8php.html#678bcaf9018d772881b4291020894fa0">module_download.inc.php</a> +<li>drop_cache() +: <a class="el" href="common_8inc_8php.html#7ca47f8aab349971cde2d4b02441cf41">common.inc.php</a> +</ul> +<h3><a class="anchor" name="index_e">- e -</a></h3><ul> +<li>elem() +: <a class="el" href="html_8inc_8php.html#a7a1256f84f937f1656195d5ce7b8d91">html.inc.php</a> +<li>elem_add_class() +: <a class="el" href="html_8inc_8php.html#afa12d2b690751666e599fb052e19ca6">html.inc.php</a> +<li>elem_append() +: <a class="el" href="html_8inc_8php.html#ea37c451f5d55e2efbb2656e340c1dae">html.inc.php</a> +<li>elem_attr() +: <a class="el" href="html_8inc_8php.html#894dc22f3b7668c59364599909162b8e">html.inc.php</a> +<li>elem_css() +: <a class="el" href="html_8inc_8php.html#c705ef06deb9e2d49e342ed78ecc1c9a">html.inc.php</a> +<li>elem_finalize() +: <a class="el" href="html_8inc_8php.html#f04b43a4dd09e73ca2cef84a4f2e9381">html.inc.php</a> +<li>elem_has_class() +: <a class="el" href="html_8inc_8php.html#b1019c4b75181c1c1af10e1c1e5e197d">html.inc.php</a> +<li>elem_remove_attr() +: <a class="el" href="html_8inc_8php.html#eb7074172d9164f69e64967b6bcdc643">html.inc.php</a> +<li>elem_remove_class() +: <a class="el" href="html_8inc_8php.html#6a224914e8f32176ca11a31154b1ae13">html.inc.php</a> +<li>elem_val() +: <a class="el" href="html_8inc_8php.html#e28d850c3c906c6884462ca89c06f59b">html.inc.php</a> +<li>expl() +: <a class="el" href="util_8inc_8php.html#afce787d4b725ac62be6306ff3e352e7">util.inc.php</a> +<li>expl_whitesp() +: <a class="el" href="util_8inc_8php.html#1d2500a5e237e59956b03cbea845c95a">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_f">- f -</a></h3><ul> +<li>file_is_different() +: <a class="el" href="util_8inc_8php.html#9c9a81ec9dba8b2870cbb365f8139866">util.inc.php</a> +<li>filext() +: <a class="el" href="util_8inc_8php.html#6d9392e51344c2e8720a0c1982ebea21">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_g">- g -</a></h3><ul> +<li>get_hooks() +: <a class="el" href="modules_8inc_8php.html#dcaa12e356133b7fa0670571698b38cc">modules.inc.php</a> +<li>get_modules() +: <a class="el" href="modules_8inc_8php.html#1b73e435e11b07906d0781b146b4aa21">modules.inc.php</a> +<li>get_service() +: <a class="el" href="modules_8inc_8php.html#bf7633223c2fd4ecb199a8e0dc070802">modules.inc.php</a> +<li>glue_module_info() +: <a class="el" href="module__glue_8inc_8php.html#9b741f04b878cbc03f1aac7d3406d548">module_glue.inc.php</a> +<li>glue_version() +: <a class="el" href="common_8inc_8php.html#0d6d0da45f4adf6283bcccec9fd107e3">common.inc.php</a> +</ul> +<h3><a class="anchor" name="index_h">- h -</a></h3><ul> +<li>html_add_alternate() +: <a class="el" href="html_8inc_8php.html#e013e8f0bdd681184ee1873a1964c454">html.inc.php</a> +<li>html_add_css() +: <a class="el" href="html_8inc_8php.html#962ef1b29e909a38b9a7b79086d54ab2">html.inc.php</a> +<li>html_add_js() +: <a class="el" href="html_8inc_8php.html#450214704e1bbc2e8849abb54db38a03">html.inc.php</a> +<li>html_add_js_code() +: <a class="el" href="html_8inc_8php.html#90601d141e5751c07b61f32f623ed7d2">html.inc.php</a> +<li>html_add_js_var() +: <a class="el" href="html_8inc_8php.html#84769b7fe7b5454ff46534d0577eb54c">html.inc.php</a> +<li>html_css() +: <a class="el" href="html_8inc_8php.html#d52276fa2a03df7342ba4b8e6a334ce0">html.inc.php</a> +<li>html_disable_caching() +: <a class="el" href="html_8inc_8php.html#b0dafe79ee61164014b0a4d8b4112dbb">html.inc.php</a> +<li>html_encode_str_smart() +: <a class="el" href="html__parse_8inc_8php.html#7eda4037f4b2576b3bcd97408ff95bd5">html_parse.inc.php</a> +<li>html_favicon() +: <a class="el" href="html_8inc_8php.html#5738adf9b56d1ff2b8d02977ed7929ce">html.inc.php</a> +<li>html_finalize() +: <a class="el" href="html_8inc_8php.html#405dc7e3718d4196c05087057ebf69bf">html.inc.php</a> +<li>html_parse() +: <a class="el" href="html__parse_8inc_8php.html#1003b146f08aef5a3a78d75a3538a4d7">html_parse.inc.php</a> +<li>html_parse_elem() +: <a class="el" href="html__parse_8inc_8php.html#6d9c21ee610953fb5b5b64fae3f74ed3">html_parse.inc.php</a> +<li>html_title() +: <a class="el" href="html_8inc_8php.html#3f572f51a815fe19c590fea7d6d3a1a6">html.inc.php</a> +<li>http_400() +: <a class="el" href="util_8inc_8php.html#78288ca93c62ce2b5ef34f40352c7324">util.inc.php</a> +<li>http_404() +: <a class="el" href="util_8inc_8php.html#24f09c2c8205022b013bbee5293a38ae">util.inc.php</a> +<li>http_500() +: <a class="el" href="util_8inc_8php.html#575cc91d803ae46bbc5dfaecbeb3561d">util.inc.php</a> +<li>http_digest_check() +: <a class="el" href="util_8inc_8php.html#ff065fbc9f3abbf9c5a0ebfba22acbf7">util.inc.php</a> +<li>http_digest_prompt() +: <a class="el" href="util_8inc_8php.html#95d221746e2d296434b0d63f78cedf57">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_i">- i -</a></h3><ul> +<li>iframe_render_object() +: <a class="el" href="module__iframe_8inc_8php.html#40856482f79fb837bc538e8eed66aff4">module_iframe.inc.php</a> +<li>iframe_render_page_early() +: <a class="el" href="module__iframe_8inc_8php.html#d4d8fd8256a19beb570193c2886659e5">module_iframe.inc.php</a> +<li>iframe_save_state() +: <a class="el" href="module__iframe_8inc_8php.html#3034fcc475334b511b91932918fcfe57">module_iframe.inc.php</a> +<li>image_delete_object() +: <a class="el" href="module__image_8inc_8php.html#7cbcf6138ccff16a8b733cfd6f0f1666">module_image.inc.php</a> +<li>image_has_reference() +: <a class="el" href="module__image_8inc_8php.html#0bef6164f5eafe368d251639cf6fe298">module_image.inc.php</a> +<li>image_render_object() +: <a class="el" href="module__image_8inc_8php.html#4fadded2a225d1b5ea73404a84597620">module_image.inc.php</a> +<li>image_render_page_early() +: <a class="el" href="module__image_8inc_8php.html#8266a74a11a86a73e2aa3709388fd43f">module_image.inc.php</a> +<li>image_resize() +: <a class="el" href="module__image_8inc_8php.html#9e03a71310133176236ae0bd4a0241e0">module_image.inc.php</a> +<li>image_save_state() +: <a class="el" href="module__image_8inc_8php.html#c26ea1448f0b7ed835907cf7c22b60ca">module_image.inc.php</a> +<li>image_serve_resource() +: <a class="el" href="module__image_8inc_8php.html#bb6646bfaa6a012e620cdaaa0bc3c807">module_image.inc.php</a> +<li>image_upload() +: <a class="el" href="module__image_8inc_8php.html#37dee9de60e2852c0631d8e60e58585c">module_image.inc.php</a> +<li>invoke_controller() +: <a class="el" href="controller_8inc_8php.html#170bef82dc4636c51b678276323e4ff4">controller.inc.php</a> +<li>invoke_hook() +: <a class="el" href="modules_8inc_8php.html#3318fb85bac26e6fb2397c6ea9f02322">modules.inc.php</a> +<li>invoke_hook_while() +: <a class="el" href="modules_8inc_8php.html#66473fc9f24153d85053f1f9c6ed83e4">modules.inc.php</a> +<li>is_auth() +: <a class="el" href="common_8inc_8php.html#b3abbb2cd13e01231533e7cdc93da6db">common.inc.php</a> +<li>is_cached() +: <a class="el" href="common_8inc_8php.html#6fb34b9210b43349ca3eb16b2738a28b">common.inc.php</a> +<li>is_url() +: <a class="el" href="util_8inc_8php.html#0da48011cb68c039aec396c23cb04295">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_l">- l -</a></h3><ul> +<li>load_modules() +: <a class="el" href="modules_8inc_8php.html#23f8be02dc2148a3c860119a1d6ea276">modules.inc.php</a> +<li>load_object() +: <a class="el" href="module__glue_8inc_8php.html#c6b5ed5ff055ccb4d07ad17cf78d5a11">module_glue.inc.php</a> +<li>log_msg() +: <a class="el" href="log_8inc_8php.html#0d59d693ca96c65b67de4b197954ce60">log.inc.php</a> +</ul> +<h3><a class="anchor" name="index_n">- n -</a></h3><ul> +<li>nl() +: <a class="el" href="util_8inc_8php.html#9f9eeab2eb9a39518e80609fc7f83842">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_o">- o -</a></h3><ul> +<li>object_alter_render_early() +: <a class="el" href="module__object_8inc_8php.html#6acc3273ff9872e01527162375d318d8">module_object.inc.php</a> +<li>object_alter_render_late() +: <a class="el" href="module__object_8inc_8php.html#6b5bf16a15b7d5809bd7c6d15cd05a52">module_object.inc.php</a> +<li>object_alter_save() +: <a class="el" href="module__object_8inc_8php.html#ba3a00b339dc7e9831b48a94f4f8e211">module_object.inc.php</a> +<li>object_exists() +: <a class="el" href="common_8inc_8php.html#3d71a269e01b98748fb57719feef27be">common.inc.php</a> +<li>object_get_symlink() +: <a class="el" href="module__glue_8inc_8php.html#a9618d306b7ee5bd9e5d6a0be268ed44">module_glue.inc.php</a> +<li>object_make_symlink() +: <a class="el" href="module__glue_8inc_8php.html#14e6da411df5aa9ff38e2d4ea27dd077">module_glue.inc.php</a> +<li>object_remove_attr() +: <a class="el" href="module__glue_8inc_8php.html#e16d748c2d933978daec8bf11acdc34b">module_glue.inc.php</a> +<li>object_render_page_early() +: <a class="el" href="module__object_8inc_8php.html#d06c13f1778d655f4a011d1763c6e618">module_object.inc.php</a> +</ul> +<h3><a class="anchor" name="index_p">- p -</a></h3><ul> +<li>pad() +: <a class="el" href="util_8inc_8php.html#37ef346387afe0af2cf86a8bea887173">util.inc.php</a> +<li>page_browser_render_page_early() +: <a class="el" href="module__page__browser_8inc_8php.html#a94d17bbea100ee50f09c7bf4094a1db">module_page_browser.inc.php</a> +<li>page_canonical() +: <a class="el" href="common_8inc_8php.html#31ed04b0c90ac3077e71743c307d45f8">common.inc.php</a> +<li>page_exists() +: <a class="el" href="common_8inc_8php.html#a71868111dd5b8af98df9cc9c968e523">common.inc.php</a> +<li>page_render_object() +: <a class="el" href="module__page_8inc_8php.html#53e7091b9a654d0d772cea6e3127820e">module_page.inc.php</a> +<li>page_render_page_early() +: <a class="el" href="module__page_8inc_8php.html#80aff2ea069c7a2ba120e26bb218efa5">module_page.inc.php</a> +<li>page_short() +: <a class="el" href="common_8inc_8php.html#da968adfb989aa09adaf29867208f1ab">common.inc.php</a> +<li>pagenames() +: <a class="el" href="module__glue_8inc_8php.html#354fc85f928484ae3b316bbf0065d9bd">module_glue.inc.php</a> +<li>parse_query_string() +: <a class="el" href="controller_8inc_8php.html#51a50fbc5165b4ff0a289b2010bb7597">controller.inc.php</a> +<li>prompt_auth() +: <a class="el" href="common_8inc_8php.html#80c23c9d8ac02159151d6368506b1b54">common.inc.php</a> +</ul> +<h3><a class="anchor" name="index_q">- q -</a></h3><ul> +<li>quot() +: <a class="el" href="util_8inc_8php.html#3c7d87c658499c1559a6b98cac06f58d">util.inc.php</a> +</ul> +<h3><a class="anchor" name="index_r">- r -</a></h3><ul> +<li>register_controller() +: <a class="el" href="controller_8inc_8php.html#543961dbcd309fa2cb6a887a8666bf1c">controller.inc.php</a> +<li>register_hook() +: <a class="el" href="modules_8inc_8php.html#d91a5f96df0655d782404170324e567d">modules.inc.php</a> +<li>register_service() +: <a class="el" href="modules_8inc_8php.html#e6ed600fb2ce39a4b0837bbb01fe8d6e">modules.inc.php</a> +<li>rename_page() +: <a class="el" href="module__glue_8inc_8php.html#cd08b36587528b6f088cafb7d1d6bd29">module_glue.inc.php</a> +<li>render_object() +: <a class="el" href="module__glue_8inc_8php.html#e9103a74e4b40e88536fbc0a52d1c72f">module_glue.inc.php</a> +<li>render_page() +: <a class="el" href="module__glue_8inc_8php.html#ab1981a767de519c6c4afb946d748d0a">module_glue.inc.php</a> +<li>resolve_aliases() +: <a class="el" href="common_8inc_8php.html#78992fdfae6cd9d7d4e8053d004d1709">common.inc.php</a> +<li>resolve_relative_urls() +: <a class="el" href="common_8inc_8php.html#81eb70073067db81ab43829870f15e6d">common.inc.php</a> +<li>response() +: <a class="el" href="modules_8inc_8php.html#361058ff2a03c098045c4442440a2574">modules.inc.php</a> +<li>revert() +: <a class="el" href="module__glue_8inc_8php.html#e69e25beb40feedc02d3b850587d20cc">module_glue.inc.php</a> +<li>revisions() +: <a class="el" href="module__glue_8inc_8php.html#27d90d2ed1b4142554bc4e0e47e9ba0c">module_glue.inc.php</a> +<li>revisions_browser_render_page_early() +: <a class="el" href="module__revisions__browser_8inc_8php.html#eb482f35141c71dd933daeec9e9ce599">module_revisions_browser.inc.php</a> +<li>revisions_info() +: <a class="el" href="module__glue_8inc_8php.html#1dc65b69a920ac4ebc8f7c1df305060b">module_glue.inc.php</a> +<li>run_service() +: <a class="el" href="modules_8inc_8php.html#3d581f1636df2e24ffe7b013a12fb1db">modules.inc.php</a> +</ul> +<h3><a class="anchor" name="index_s">- s -</a></h3><ul> +<li>save_object() +: <a class="el" href="module__glue_8inc_8php.html#b294f21c7f6fed0932b65167f180c78c">module_glue.inc.php</a> +<li>save_state() +: <a class="el" href="module__glue_8inc_8php.html#60d03d7a0d8783e926835f0aa6cff698">module_glue.inc.php</a> +<li>serve_cached() +: <a class="el" href="common_8inc_8php.html#ac90387dcab722e243df2d083f8d6a00">common.inc.php</a> +<li>serve_file() +: <a class="el" href="util_8inc_8php.html#9d3ab20fc8b79fb6ab860f93600c745e">util.inc.php</a> +<li>serve_resource() +: <a class="el" href="controller_8inc_8php.html#5d5274c3531eb05a1ea5927ff3cd08d3">controller.inc.php</a> +<li>set_startpage() +: <a class="el" href="module__glue_8inc_8php.html#afa7a8fa046ff6119cb7506d68edf787">module_glue.inc.php</a> +<li>snapshot() +: <a class="el" href="module__glue_8inc_8php.html#5d3ad02088eee566589cd47fe0dc889a">module_glue.inc.php</a> +<li>startpage() +: <a class="el" href="common_8inc_8php.html#0a3ee1e9beca572266648f17b9c4c75f">common.inc.php</a> +</ul> +<h3><a class="anchor" name="index_t">- t -</a></h3><ul> +<li>tab() +: <a class="el" href="util_8inc_8php.html#74e38925e7162356a2ea14db32664c37">util.inc.php</a> +<li>text_render_object() +: <a class="el" href="module__text_8inc_8php.html#8e9b1db22ff6cb0f3d20815da6aae6ce">module_text.inc.php</a> +<li>text_render_page_early() +: <a class="el" href="module__text_8inc_8php.html#aaa8b8407d795f6dba9d258f1457ade8">module_text.inc.php</a> +<li>text_save_state() +: <a class="el" href="module__text_8inc_8php.html#7fa0ea2ee517914595d7eda355177289">module_text.inc.php</a> +</ul> +<h3><a class="anchor" name="index_u">- u -</a></h3><ul> +<li>update_object() +: <a class="el" href="module__glue_8inc_8php.html#4aed316adcde13b40c9fc1b35e6537a4">module_glue.inc.php</a> +<li>upload_file() +: <a class="el" href="common_8inc_8php.html#4659077c34b709eec75f9897ea07e55a">common.inc.php</a> +<li>upload_files() +: <a class="el" href="module__glue_8inc_8php.html#43746135e67f614d79317029aced064b">module_glue.inc.php</a> +<li>upload_references() +: <a class="el" href="module__glue_8inc_8php.html#2099347b9bdf5a5973a13e5f7a4be933">module_glue.inc.php</a> +</ul> +<h3><a class="anchor" name="index_v">- v -</a></h3><ul> +<li>valid_pagename() +: <a class="el" href="common_8inc_8php.html#0ef613d233a6e62f7e631b8dfcd710bf">common.inc.php</a> +<li>var_dump_inl() +: <a class="el" href="util_8inc_8php.html#a5cc9d5f8a0b5bb76dfe3d15796e5940">util.inc.php</a> +<li>video_delete_object() +: <a class="el" href="module__video_8inc_8php.html#4d25a132251840ed2ade27b636a6694e">module_video.inc.php</a> +<li>video_has_reference() +: <a class="el" href="module__video_8inc_8php.html#dbbede5e492ca7b9457deaf076c887b0">module_video.inc.php</a> +<li>video_render_object() +: <a class="el" href="module__video_8inc_8php.html#14d6bc200a41905ad201a24d9a2d9be5">module_video.inc.php</a> +<li>video_render_page_early() +: <a class="el" href="module__video_8inc_8php.html#223ac9bac4acfb2c9b458b43e45e06e3">module_video.inc.php</a> +<li>video_save_state() +: <a class="el" href="module__video_8inc_8php.html#828b4f740b870b886936a22baf97418e">module_video.inc.php</a> +<li>video_serve_resource() +: <a class="el" href="module__video_8inc_8php.html#5af838d3c4206bbc9bc3b5e57b16655c">module_video.inc.php</a> +<li>video_upload() +: <a class="el" href="module__video_8inc_8php.html#6ab50ffd184d8dcf84a9783dd6a2f80e">module_video.inc.php</a> +</ul> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/globals_vars.html b/doc/html/globals_vars.html new file mode 100644 index 0000000..eb1c0ac --- /dev/null +++ b/doc/html/globals_vars.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: Class Members</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li class="current"><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="globals.html"><span>All</span></a></li> + <li><a href="globals_func.html"><span>Functions</span></a></li> + <li class="current"><a href="globals_vars.html"><span>Variables</span></a></li> + <li><a href="globals_enum.html"><span>Enumerations</span></a></li> + </ul> + </div> +</div> +<div class="contents"> + +<p> +<ul> +<li>$args +: <a class="el" href="index_8php.html#67e94494731d99ed23b123e95175bc10">index.php</a> +, <a class="el" href="json_8php.html#67e94494731d99ed23b123e95175bc10">json.php</a> +<li>$single_tags +: <a class="el" href="html_8inc_8php.html#0a733c7a281726a879f13e7325881887">html.inc.php</a> +<li>elseif +: <a class="el" href="json_8php.html#ffd32ec1771cd364116738727d3a1ed8">json.php</a> +</ul> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/html_8inc_8php.html b/doc/html/html_8inc_8php.html new file mode 100644 index 0000000..903cdf6 --- /dev/null +++ b/doc/html/html_8inc_8php.html @@ -0,0 +1,860 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/html.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/html.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">if(!isset($html)) </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#7fb2b386b2bae219112628971275c225">_array_sort_by_prio</a> (&$a)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#f8ecadff0a4b78867d4da5eae49615e1">_cmp_prio</a> ($a, $b)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">& </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#8b842636055e9a5853a7a10a9e002330">body</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#d27881abf3a2004d287434d8c8d7cdf6">body_append</a> ($c)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#a7a1256f84f937f1656195d5ce7b8d91">elem</a> ($tag)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#afa12d2b690751666e599fb052e19ca6">elem_add_class</a> (&$elem, $c)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#ea37c451f5d55e2efbb2656e340c1dae">elem_append</a> (&$elem, $c)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#894dc22f3b7668c59364599909162b8e">elem_attr</a> (&$elem)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#c705ef06deb9e2d49e342ed78ecc1c9a">elem_css</a> (&$elem)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#f04b43a4dd09e73ca2cef84a4f2e9381">elem_finalize</a> ($elem)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#b1019c4b75181c1c1af10e1c1e5e197d">elem_has_class</a> ($elem, $c)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#eb7074172d9164f69e64967b6bcdc643">elem_remove_attr</a> (&$elem, $a)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#6a224914e8f32176ca11a31154b1ae13">elem_remove_class</a> (&$elem, $c)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#e28d850c3c906c6884462ca89c06f59b">elem_val</a> (&$elem)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#e013e8f0bdd681184ee1873a1964c454">html_add_alternate</a> ($type, $url, $title)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#962ef1b29e909a38b9a7b79086d54ab2">html_add_css</a> ($url, $prio=5, $media= '')</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#450214704e1bbc2e8849abb54db38a03">html_add_js</a> ($url, $prio=5)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#90601d141e5751c07b61f32f623ed7d2">html_add_js_code</a> ($code, $prio=5, $reason= '')</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#84769b7fe7b5454ff46534d0577eb54c">html_add_js_var</a> ($key, $val)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#d52276fa2a03df7342ba4b8e6a334ce0">html_css</a> ($prop)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#b0dafe79ee61164014b0a4d8b4112dbb">html_disable_caching</a> ($reason= '')</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#5738adf9b56d1ff2b8d02977ed7929ce">html_favicon</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#405dc7e3718d4196c05087057ebf69bf">html_finalize</a> (&$cache=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#3f572f51a815fe19c590fea7d6d3a1a6">html_title</a> ()</td></tr> + +<tr><td colspan="2"><br><h2>Variables</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html_8inc_8php.html#0a733c7a281726a879f13e7325881887">$single_tags</a> = array('link', 'meta', 'hr', 'br', 'img', 'param', 'input')</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="7fb2b386b2bae219112628971275c225"></a><!-- doxytag: member="html.inc.php::_array_sort_by_prio" ref="7fb2b386b2bae219112628971275c225" args="(&$a)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">if (!isset($html)) _array_sort_by_prio </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>a</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +helper function for sorting an array of arrays by key 'prio'<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$a reference to an array </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="f8ecadff0a4b78867d4da5eae49615e1"></a><!-- doxytag: member="html.inc.php::_cmp_prio" ref="f8ecadff0a4b78867d4da5eae49615e1" args="($a, $b)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">_cmp_prio </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>a</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>b</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +helper function for _array_sort_prio()<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$a array to compare </td></tr> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$b array to compare </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>int comparison result </dd></dl> + +</div> +</div><p> +<a class="anchor" name="8b842636055e9a5853a7a10a9e002330"></a><!-- doxytag: member="html.inc.php::body" ref="8b842636055e9a5853a7a10a9e002330" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">& body </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get a reference to the body element<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>&array reference to the body element </dd></dl> + +</div> +</div><p> +<a class="anchor" name="d27881abf3a2004d287434d8c8d7cdf6"></a><!-- doxytag: member="html.inc.php::body_append" ref="d27881abf3a2004d287434d8c8d7cdf6" args="($c)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">body_append </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>c</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +helper function for appending content to the body element<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$c content (can be either a string or another element) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="a7a1256f84f937f1656195d5ce7b8d91"></a><!-- doxytag: member="html.inc.php::elem" ref="a7a1256f84f937f1656195d5ce7b8d91" args="($tag)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>tag</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +create a element<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$tag element tag </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array element </dd></dl> + +</div> +</div><p> +<a class="anchor" name="afa12d2b690751666e599fb052e19ca6"></a><!-- doxytag: member="html.inc.php::elem_add_class" ref="afa12d2b690751666e599fb052e19ca6" args="(&$elem, $c)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_add_class </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>elem</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>c</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +add a class to an element<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$elem reference to an element </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$c class </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="ea37c451f5d55e2efbb2656e340c1dae"></a><!-- doxytag: member="html.inc.php::elem_append" ref="ea37c451f5d55e2efbb2656e340c1dae" args="(&$elem, $c)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_append </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>elem</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>c</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +append content to an element<p> +this function is similar to <a class="el" href="html_8inc_8php.html#e28d850c3c906c6884462ca89c06f59b">elem_val()</a>. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$elem reference to an element </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$c content (can be either a string or another element) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="894dc22f3b7668c59364599909162b8e"></a><!-- doxytag: member="html.inc.php::elem_attr" ref="894dc22f3b7668c59364599909162b8e" args="(&$elem)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_attr </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>elem</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get or set an attribute in an element<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$elem reference to an element </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>attribute name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>attribute value (to set it) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="c705ef06deb9e2d49e342ed78ecc1c9a"></a><!-- doxytag: member="html.inc.php::elem_css" ref="c705ef06deb9e2d49e342ed78ecc1c9a" args="(&$elem)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_css </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>elem</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get or set a css property in an element<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$elem reference to an element </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>css property name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>css property value (to set it; empty string to clear it) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="f04b43a4dd09e73ca2cef84a4f2e9381"></a><!-- doxytag: member="html.inc.php::elem_finalize" ref="f04b43a4dd09e73ca2cef84a4f2e9381" args="($elem)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_finalize </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>elem</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +turn an element into a html string<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$elem element </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string html </dd></dl> + +</div> +</div><p> +<a class="anchor" name="b1019c4b75181c1c1af10e1c1e5e197d"></a><!-- doxytag: member="html.inc.php::elem_has_class" ref="b1019c4b75181c1c1af10e1c1e5e197d" args="($elem, $c)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_has_class </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>elem</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>c</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if an element is of a certain class<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$elem element </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$c class to check </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +<a class="anchor" name="eb7074172d9164f69e64967b6bcdc643"></a><!-- doxytag: member="html.inc.php::elem_remove_attr" ref="eb7074172d9164f69e64967b6bcdc643" args="(&$elem, $a)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_remove_attr </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>elem</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>a</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +remove an attribute from an element<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$elem reference to an element </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$a attribute name </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="6a224914e8f32176ca11a31154b1ae13"></a><!-- doxytag: member="html.inc.php::elem_remove_class" ref="6a224914e8f32176ca11a31154b1ae13" args="(&$elem, $c)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_remove_class </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>elem</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>c</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +remove a class from an element<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$elem reference to an element </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$c class </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="e28d850c3c906c6884462ca89c06f59b"></a><!-- doxytag: member="html.inc.php::elem_val" ref="e28d850c3c906c6884462ca89c06f59b" args="(&$elem)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">elem_val </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>elem</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get or set an element's content<p> +this function is similar to <a class="el" href="html_8inc_8php.html#ea37c451f5d55e2efbb2656e340c1dae">elem_append()</a>. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$elem reference to an element </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$c content (to set it, can be either a string or another element) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="e013e8f0bdd681184ee1873a1964c454"></a><!-- doxytag: member="html.inc.php::html_add_alternate" ref="e013e8f0bdd681184ee1873a1964c454" args="($type, $url, $title)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_add_alternate </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>type</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>url</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>title</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +add a link-alternate element to the html header<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$type type attribute </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$url url attribute (url-encoded if necessary) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$title title attribute </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="962ef1b29e909a38b9a7b79086d54ab2"></a><!-- doxytag: member="html.inc.php::html_add_css" ref="962ef1b29e909a38b9a7b79086d54ab2" args="($url, $prio=5, $media= '')" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_add_css </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>url</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>prio</em> = <code>5</code>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>media</em> = <code>''</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +add a reference to a css file to the html header<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$url url attribute (url-encoded if necessary) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>int</em> </td><td>$prio when to insert reference (0 - very early to 9 - late) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$media media attribute (optional) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="450214704e1bbc2e8849abb54db38a03"></a><!-- doxytag: member="html.inc.php::html_add_js" ref="450214704e1bbc2e8849abb54db38a03" args="($url, $prio=5)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_add_js </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>url</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>prio</em> = <code>5</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +add a reference to a javascript file to the html header<p> +duplicate references will be removed from the output. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$url url attribute (url-encoded if necessary) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>int</em> </td><td>$prio when to insert reference (0 - very early to 9 - late) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="90601d141e5751c07b61f32f623ed7d2"></a><!-- doxytag: member="html.inc.php::html_add_js_code" ref="90601d141e5751c07b61f32f623ed7d2" args="($code, $prio=5, $reason= '')" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_add_js_code </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>code</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>prio</em> = <code>5</code>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>reason</em> = <code>''</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +add javascript code to the html header<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$code javscript code </td></tr> + <tr><td valign="top"></td><td valign="top"><em>int</em> </td><td>$prio when to insert code (0 - very early to 9 - late) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$reason (e.g. your module) (optional) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="84769b7fe7b5454ff46534d0577eb54c"></a><!-- doxytag: member="html.inc.php::html_add_js_var" ref="84769b7fe7b5454ff46534d0577eb54c" args="($key, $val)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_add_js_var </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>key</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>val</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +set a variable in the javascript output<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$key variable or object the value will be stored) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$val value </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="d52276fa2a03df7342ba4b8e6a334ce0"></a><!-- doxytag: member="html.inc.php::html_css" ref="d52276fa2a03df7342ba4b8e6a334ce0" args="($prop)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_css </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>prop</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get or set a css property in the html element<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>css property name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>css property value (to set it; empty string to clear it) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="b0dafe79ee61164014b0a4d8b4112dbb"></a><!-- doxytag: member="html.inc.php::html_disable_caching" ref="b0dafe79ee61164014b0a4d8b4112dbb" args="($reason= '')" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_disable_caching </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>reason</em> = <code>''</code> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +disable caching of output<p> +can be used for modules that need the php to be executed every time. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$reason (e.g. your module) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="5738adf9b56d1ff2b8d02977ed7929ce"></a><!-- doxytag: member="html.inc.php::html_favicon" ref="5738adf9b56d1ff2b8d02977ed7929ce" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_favicon </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get or set favicon<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>url (to set it, url-encoded if necessary) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="405dc7e3718d4196c05087057ebf69bf"></a><!-- doxytag: member="html.inc.php::html_finalize" ref="405dc7e3718d4196c05087057ebf69bf" args="(&$cache=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_finalize </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>cache</em> = <code>false</code> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +turn the page into a html string<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>&$cache is output cachable (will only modified if $cache is true before) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string html </dd></dl> + +</div> +</div><p> +<a class="anchor" name="3f572f51a815fe19c590fea7d6d3a1a6"></a><!-- doxytag: member="html.inc.php::html_title" ref="3f572f51a815fe19c590fea7d6d3a1a6" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_title </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get or set title<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>title (to set it) </td></tr> + </table> +</dl> + +</div> +</div><p> +<hr><h2>Variable Documentation</h2> +<a class="anchor" name="0a733c7a281726a879f13e7325881887"></a><!-- doxytag: member="html.inc.php::$single_tags" ref="0a733c7a281726a879f13e7325881887" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">$single_tags = array('link', 'meta', 'hr', 'br', 'img', 'param', 'input') </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="html_8inc_8php.html">html.inc.php</a> Generic html element functions<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/html__parse_8inc_8php.html b/doc/html/html__parse_8inc_8php.html new file mode 100644 index 0000000..b6adcc1 --- /dev/null +++ b/doc/html/html__parse_8inc_8php.html @@ -0,0 +1,134 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/html_parse.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/html_parse.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html__parse_8inc_8php.html#7eda4037f4b2576b3bcd97408ff95bd5">html_encode_str_smart</a> ($html)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html__parse_8inc_8php.html#1003b146f08aef5a3a78d75a3538a4d7">html_parse</a> ($html, $recursive=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="html__parse_8inc_8php.html#6d9c21ee610953fb5b5b64fae3f74ed3">html_parse_elem</a> ($html, $recursive=false)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="7eda4037f4b2576b3bcd97408ff95bd5"></a><!-- doxytag: member="html_parse.inc.php::html_encode_str_smart" ref="7eda4037f4b2576b3bcd97408ff95bd5" args="($html)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_encode_str_smart </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>html</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="html__parse_8inc_8php.html">html_parse.inc.php</a> Generic html parsing functions<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="1003b146f08aef5a3a78d75a3538a4d7"></a><!-- doxytag: member="html_parse.inc.php::html_parse" ref="1003b146f08aef5a3a78d75a3538a4d7" args="($html, $recursive=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_parse </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>html</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>recursive</em> = <code>false</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +parse a string containing html elements<p> +this function decodes html's special characters except for the content (when it too is not being parsed). this function is more fragile than <a class="el" href="html__parse_8inc_8php.html#6d9c21ee610953fb5b5b64fae3f74ed3">html_parse_elem()</a> when it comes to malformatted input. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$html input string </td></tr> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$recursive also parse children elements </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array parsed representation </dd></dl> + +</div> +</div><p> +<a class="anchor" name="6d9c21ee610953fb5b5b64fae3f74ed3"></a><!-- doxytag: member="html_parse.inc.php::html_parse_elem" ref="6d9c21ee610953fb5b5b64fae3f74ed3" args="($html, $recursive=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">html_parse_elem </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>html</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>recursive</em> = <code>false</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +parse exactly one html element<p> +this function decodes html's special characters except for the content (when it too is not being parsed). this function is less fragile than <a class="el" href="html__parse_8inc_8php.html#1003b146f08aef5a3a78d75a3538a4d7">html_parse()</a> when it comes to malformatted input. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$html input string (must start and end with the element's tag) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$recursive also parse children elements </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array parsed representation </dd></dl> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 0000000..e2cfb1d --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: Main Page</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li class="current"><a href="index.html"><span>Main Page</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>hotglue Documentation</h1> +<p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/index_8php.html b/doc/html/index_8php.html new file mode 100644 index 0000000..62d202a --- /dev/null +++ b/doc/html/index_8php.html @@ -0,0 +1,50 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/index.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/index.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Variables</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="index_8php.html#67e94494731d99ed23b123e95175bc10">$args</a> = parse_query_string()</td></tr> + +</table> +<hr><h2>Variable Documentation</h2> +<a class="anchor" name="67e94494731d99ed23b123e95175bc10"></a><!-- doxytag: member="index.php::$args" ref="67e94494731d99ed23b123e95175bc10" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">$args = parse_query_string() </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/json_8php.html b/doc/html/json_8php.html new file mode 100644 index 0000000..cd11be6 --- /dev/null +++ b/doc/html/json_8php.html @@ -0,0 +1,67 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/json.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/json.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Variables</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="json_8php.html#67e94494731d99ed23b123e95175bc10">$args</a> = array()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">if(is_array($ret)&&isset($ret['#error'])&&$ret['#error']) </td><td class="memItemRight" valign="bottom"><a class="el" href="json_8php.html#ffd32ec1771cd364116738727d3a1ed8">elseif</a> (is_array($ret)&&isset($ret['#data']))</td></tr> + +</table> +<hr><h2>Variable Documentation</h2> +<a class="anchor" name="67e94494731d99ed23b123e95175bc10"></a><!-- doxytag: member="json.php::$args" ref="67e94494731d99ed23b123e95175bc10" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">$args = array() </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="ffd32ec1771cd364116738727d3a1ed8"></a><!-- doxytag: member="json.php::elseif" ref="ffd32ec1771cd364116738727d3a1ed8" args="(is_array($ret)&&isset($ret['#data']))" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">if (is_array($ret)&&isset($ret['#error'])&&$ret['#error']) <a class="el" href="json_8php.html#ffd32ec1771cd364116738727d3a1ed8">elseif</a>(is_array($ret)&&isset($ret['#data'])) </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/log_8inc_8php.html b/doc/html/log_8inc_8php.html new file mode 100644 index 0000000..2d85190 --- /dev/null +++ b/doc/html/log_8inc_8php.html @@ -0,0 +1,74 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/log.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/log.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">if(!isset($logfile)) if(!isset($loglevels)) <br class="typebreak"> +if(!isset($request_id)) </td><td class="memItemRight" valign="bottom"><a class="el" href="log_8inc_8php.html#0d59d693ca96c65b67de4b197954ce60">log_msg</a> ($level, $msg)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="0d59d693ca96c65b67de4b197954ce60"></a><!-- doxytag: member="log.inc.php::log_msg" ref="0d59d693ca96c65b67de4b197954ce60" args="($level, $msg)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">if (!isset($logfile)) if (!isset($loglevels)) if (!isset($request_id)) log_msg </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>level</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>msg</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="log_8inc_8php.html">log.inc.php</a> Generic logging infrastructure<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. log a message to file<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$level can be error, warn, info or debug </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$msg message </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool true if successful, false if not </dd></dl> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__download_8inc_8php.html b/doc/html/module__download_8inc_8php.html new file mode 100644 index 0000000..a625a9f --- /dev/null +++ b/doc/html/module__download_8inc_8php.html @@ -0,0 +1,188 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_download.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_download.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__download_8inc_8php.html#5fd781bf1e0393667b227abec7169b28">download_delete_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__download_8inc_8php.html#a80da3f3fd41f7f00f97043f7a2431c8">download_has_reference</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__download_8inc_8php.html#57c588f1fd0663aa16fd707a522bcc79">download_render_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__download_8inc_8php.html#c980246bec838c65efd59bc25253b005">download_render_page_early</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__download_8inc_8php.html#2e9ee6868b80832b40e9072a8c644c88">download_save_state</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__download_8inc_8php.html#930c9545346e8da3f3db5a97dc4d8c74">download_serve_resource</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__download_8inc_8php.html#678bcaf9018d772881b4291020894fa0">download_upload_fallback</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="5fd781bf1e0393667b227abec7169b28"></a><!-- doxytag: member="module_download.inc.php::download_delete_object" ref="5fd781bf1e0393667b227abec7169b28" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">download_delete_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__download_8inc_8php.html">module_download.inc.php</a> Module for allowing to download arbitrary files that were uploaded by the user<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="a80da3f3fd41f7f00f97043f7a2431c8"></a><!-- doxytag: member="module_download.inc.php::download_has_reference" ref="a80da3f3fd41f7f00f97043f7a2431c8" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">download_has_reference </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="57c588f1fd0663aa16fd707a522bcc79"></a><!-- doxytag: member="module_download.inc.php::download_render_object" ref="57c588f1fd0663aa16fd707a522bcc79" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">download_render_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="c980246bec838c65efd59bc25253b005"></a><!-- doxytag: member="module_download.inc.php::download_render_page_early" ref="c980246bec838c65efd59bc25253b005" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">download_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="2e9ee6868b80832b40e9072a8c644c88"></a><!-- doxytag: member="module_download.inc.php::download_save_state" ref="2e9ee6868b80832b40e9072a8c644c88" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">download_save_state </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="930c9545346e8da3f3db5a97dc4d8c74"></a><!-- doxytag: member="module_download.inc.php::download_serve_resource" ref="930c9545346e8da3f3db5a97dc4d8c74" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">download_serve_resource </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="678bcaf9018d772881b4291020894fa0"></a><!-- doxytag: member="module_download.inc.php::download_upload_fallback" ref="678bcaf9018d772881b4291020894fa0" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">download_upload_fallback </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__glue_8inc_8php.html b/doc/html/module__glue_8inc_8php.html new file mode 100644 index 0000000..1b5250e --- /dev/null +++ b/doc/html/module__glue_8inc_8php.html @@ -0,0 +1,864 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_glue.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_glue.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#5fea6c120a24a298149febcbf3b1df10">_cmp_time</a> ($a, $b)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#21f260355b875069ca90edf1f9a559d0">_obj_lock</a> ($name, $wait=true)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#73a91facde5362e20df9657d31c2bb06">_obj_unlock</a> ($f)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#aa1103a091b9dbca790e77d25a452ca5">check_auto_snapshot</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#9c7f39d87787ce288ce3d8a3e389ba95">clone_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#12aa18f28f86274d770ba90aa88e2c3e">create_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#9806cd2a9b829a24876b149753e819fb">create_page</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#51fdb1d1ff829d6d2d79a9f852b7e0ef">delete_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#f11541a6869804225793b82e54fa09fe">delete_page</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#a4865d52ac449f8aaadb3a5d425f2efb">delete_upload</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#c6b5ed5ff055ccb4d07ad17cf78d5a11">load_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#a9618d306b7ee5bd9e5d6a0be268ed44">object_get_symlink</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#14e6da411df5aa9ff38e2d4ea27dd077">object_make_symlink</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#e16d748c2d933978daec8bf11acdc34b">object_remove_attr</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#354fc85f928484ae3b316bbf0065d9bd">pagenames</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#e9103a74e4b40e88536fbc0a52d1c72f">render_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#ab1981a767de519c6c4afb946d748d0a">render_page</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#cd08b36587528b6f088cafb7d1d6bd29">rename_page</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#e69e25beb40feedc02d3b850587d20cc">revert</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#27d90d2ed1b4142554bc4e0e47e9ba0c">revisions</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#1dc65b69a920ac4ebc8f7c1df305060b">revisions_info</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#b294f21c7f6fed0932b65167f180c78c">save_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#60d03d7a0d8783e926835f0aa6cff698">save_state</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#afa7a8fa046ff6119cb7506d68edf787">set_startpage</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#5d3ad02088eee566589cd47fe0dc889a">snapshot</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#4aed316adcde13b40c9fc1b35e6537a4">update_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#43746135e67f614d79317029aced064b">upload_files</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#2099347b9bdf5a5973a13e5f7a4be933">upload_references</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__glue_8inc_8php.html#9b741f04b878cbc03f1aac7d3406d548">glue_module_info</a> ()</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="5fea6c120a24a298149febcbf3b1df10"></a><!-- doxytag: member="module_glue.inc.php::_cmp_time" ref="5fea6c120a24a298149febcbf3b1df10" args="($a, $b)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">_cmp_time </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>a</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>b</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__glue_8inc_8php.html">module_glue.inc.php</a> Main hotglue module<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. helper function for <a class="el" href="module__glue_8inc_8php.html#1dc65b69a920ac4ebc8f7c1df305060b">revisions_info()</a><p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$a array to compare </td></tr> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$b array to compare </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>int comparison result </dd></dl> + +</div> +</div><p> +<a class="anchor" name="21f260355b875069ca90edf1f9a559d0"></a><!-- doxytag: member="module_glue.inc.php::_obj_lock" ref="21f260355b875069ca90edf1f9a559d0" args="($name, $wait=true)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">_obj_lock </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>wait</em> = <code>true</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="73a91facde5362e20df9657d31c2bb06"></a><!-- doxytag: member="module_glue.inc.php::_obj_unlock" ref="73a91facde5362e20df9657d31c2bb06" args="($f)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">_obj_unlock </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>f</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="aa1103a091b9dbca790e77d25a452ca5"></a><!-- doxytag: member="module_glue.inc.php::check_auto_snapshot" ref="aa1103a091b9dbca790e77d25a452ca5" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">check_auto_snapshot </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +create and delete auto- revisions<p> +this function operates on a specific page and takes SNAPSHOT_MIN_AGE and SNAPSHOT_MAX_AGE into account. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' is the page (i.e. page.rev) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response true if successful </dd></dl> + +</div> +</div><p> +<a class="anchor" name="9c7f39d87787ce288ce3d8a3e389ba95"></a><!-- doxytag: member="module_glue.inc.php::clone_object" ref="9c7f39d87787ce288ce3d8a3e389ba95" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">clone_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +duplicate an object<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' name of the object to duplicate </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response string name of new object if successful </dd></dl> + +</div> +</div><p> +<a class="anchor" name="12aa18f28f86274d770ba90aa88e2c3e"></a><!-- doxytag: member="module_glue.inc.php::create_object" ref="12aa18f28f86274d770ba90aa88e2c3e" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">create_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +create an empty object in the content directory<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' is the page (i.e. page.rev) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response key 'name' is the name of the object created </dd></dl> + +</div> +</div><p> +<a class="anchor" name="9806cd2a9b829a24876b149753e819fb"></a><!-- doxytag: member="module_glue.inc.php::create_page" ref="9806cd2a9b829a24876b149753e819fb" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">create_page </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +create a page<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' is the page (i.e. page.rev) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="51fdb1d1ff829d6d2d79a9f852b7e0ef"></a><!-- doxytag: member="module_glue.inc.php::delete_object" ref="51fdb1d1ff829d6d2d79a9f852b7e0ef" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">delete_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +delete an object from the content directory<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="f11541a6869804225793b82e54fa09fe"></a><!-- doxytag: member="module_glue.inc.php::delete_page" ref="f11541a6869804225793b82e54fa09fe" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">delete_page </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +delete a page<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' is the page (i.e. page.rev) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="a4865d52ac449f8aaadb3a5d425f2efb"></a><!-- doxytag: member="module_glue.inc.php::delete_upload" ref="a4865d52ac449f8aaadb3a5d425f2efb" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">delete_upload </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +delete a file in the shared directory of a page<p> +this function only deletes the file when there are no references to it left. this is not meant to be called directly from the frontend, but modules should use it when implementing delete_object. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'max_cnt' delete the file if there are <= max_cnt references (defaults to zero) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response true if the file got deleted for good, false if not </dd></dl> + +</div> +</div><p> +<a class="anchor" name="9b741f04b878cbc03f1aac7d3406d548"></a><!-- doxytag: member="module_glue.inc.php::glue_module_info" ref="9b741f04b878cbc03f1aac7d3406d548" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">glue_module_info </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="c6b5ed5ff055ccb4d07ad17cf78d5a11"></a><!-- doxytag: member="module_glue.inc.php::load_object" ref="c6b5ed5ff055ccb4d07ad17cf78d5a11" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">load_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +load an object from the content directory<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="a9618d306b7ee5bd9e5d6a0be268ed44"></a><!-- doxytag: member="module_glue.inc.php::object_get_symlink" ref="a9618d306b7ee5bd9e5d6a0be268ed44" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">object_get_symlink </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return the target of an object symlink<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response key 'data' either has the target as object name, an empty string if the target is outside the content directory or false if the object is no symlink </dd></dl> + +</div> +</div><p> +<a class="anchor" name="14e6da411df5aa9ff38e2d4ea27dd077"></a><!-- doxytag: member="module_glue.inc.php::object_make_symlink" ref="14e6da411df5aa9ff38e2d4ea27dd077" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">object_make_symlink </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +create a symlink pointing to an object in all other pagename's head revisions<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>response </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="e16d748c2d933978daec8bf11acdc34b"></a><!-- doxytag: member="module_glue.inc.php::object_remove_attr" ref="e16d748c2d933978daec8bf11acdc34b" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">object_remove_attr </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +remove one or more attributes from an object in the content directory<p> +this function takes the object lock. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'attr' is either a string or an array containing the attribute names (keys) to remove </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="354fc85f928484ae3b316bbf0065d9bd"></a><!-- doxytag: member="module_glue.inc.php::pagenames" ref="354fc85f928484ae3b316bbf0065d9bd" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">pagenames </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return an array of all pagenames in the content directory<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args unused </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="cd08b36587528b6f088cafb7d1d6bd29"></a><!-- doxytag: member="module_glue.inc.php::rename_page" ref="cd08b36587528b6f088cafb7d1d6bd29" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">rename_page </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +rename a page <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'old' old page (i.e. page1.rev) key 'new' new page (i.e. page2.rev) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="e9103a74e4b40e88536fbc0a52d1c72f"></a><!-- doxytag: member="module_glue.inc.php::render_object" ref="e9103a74e4b40e88536fbc0a52d1c72f" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">render_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +turn an object into an html string<p> +the function also appends the resulting string to the output in <a class="el" href="html_8inc_8php.html">html.inc.php</a>. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments string 'name' is the object name (i.e. page.rev.obj) bool 'edit' are we editing or not </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response html </dd></dl> + +</div> +</div><p> +<a class="anchor" name="ab1981a767de519c6c4afb946d748d0a"></a><!-- doxytag: member="module_glue.inc.php::render_page" ref="ab1981a767de519c6c4afb946d748d0a" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">render_page </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +turn a page into an html string<p> +the function also appends the resulting string to the output in <a class="el" href="html_8inc_8php.html">html.inc.php</a>. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' is the page (i.e. page.rev) key 'edit' are we editing or not </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response html </dd></dl> + +</div> +</div><p> +<a class="anchor" name="e69e25beb40feedc02d3b850587d20cc"></a><!-- doxytag: member="module_glue.inc.php::revert" ref="e69e25beb40feedc02d3b850587d20cc" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">revert </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +revert to a specific revision of a page<p> +this function makes the revision the page's new head revision by copying it. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' page to revert to (i.e. page.rev) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="27d90d2ed1b4142554bc4e0e47e9ba0c"></a><!-- doxytag: member="module_glue.inc.php::revisions" ref="27d90d2ed1b4142554bc4e0e47e9ba0c" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">revisions </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return an array of all revisions of a page<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'pagename' is the pagename (i.e. page) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="1dc65b69a920ac4ebc8f7c1df305060b"></a><!-- doxytag: member="module_glue.inc.php::revisions_info" ref="1dc65b69a920ac4ebc8f7c1df305060b" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">revisions_info </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return an array with informations about all revisions of a page<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'pagename' is the pagename (i.e. page) key 'sort' can be either 'time' (descending) or 'name' (ascending, the default) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="b294f21c7f6fed0932b65167f180c78c"></a><!-- doxytag: member="module_glue.inc.php::save_object" ref="b294f21c7f6fed0932b65167f180c78c" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">save_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +save an object to the content directory<p> +use <a class="el" href="module__glue_8inc_8php.html#4aed316adcde13b40c9fc1b35e6537a4">update_object()</a> whenever possible as we want to preserve any object metadata that is stored in as attributes. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="60d03d7a0d8783e926835f0aa6cff698"></a><!-- doxytag: member="module_glue.inc.php::save_state" ref="60d03d7a0d8783e926835f0aa6cff698" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">save_state </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +save the state of a html element corresponding to an object to disk<p> +this function takes the object lock. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'html' one html element </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response true if successful </dd></dl> + +</div> +</div><p> +<a class="anchor" name="afa7a8fa046ff6119cb7506d68edf787"></a><!-- doxytag: member="module_glue.inc.php::set_startpage" ref="afa7a8fa046ff6119cb7506d68edf787" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">set_startpage </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +set the startpage<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' is the page (i.e. page.rev) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response true if successful </dd></dl> + +</div> +</div><p> +<a class="anchor" name="5d3ad02088eee566589cd47fe0dc889a"></a><!-- doxytag: member="module_glue.inc.php::snapshot" ref="5d3ad02088eee566589cd47fe0dc889a" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">snapshot </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +create a snapshot from a page<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'page' page to shapshot (i.e. page.rev) key 'rev' (optional) new revision name (i.e. rev2) (if empty or not set a revision starting with 'auto-' and the current date will be created) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response (holding the page of the newly created revision if successful) </dd></dl> + +</div> +</div><p> +<a class="anchor" name="4aed316adcde13b40c9fc1b35e6537a4"></a><!-- doxytag: member="module_glue.inc.php::update_object" ref="4aed316adcde13b40c9fc1b35e6537a4" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">update_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +update an object<p> +this function merges the attributes in $args with the object already on disk. the object need not exist before, though. this function takes the object lock. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response </dd></dl> + +</div> +</div><p> +<a class="anchor" name="43746135e67f614d79317029aced064b"></a><!-- doxytag: member="module_glue.inc.php::upload_files" ref="43746135e67f614d79317029aced064b" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">upload_files </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="2099347b9bdf5a5973a13e5f7a4be933"></a><!-- doxytag: member="module_glue.inc.php::upload_references" ref="2099347b9bdf5a5973a13e5f7a4be933" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">upload_references </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +list all objects referencing a certain file in the shared directory<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'stop_after' n references </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response array of objects (i.e. page.rev.obj) </dd></dl> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__iframe_8inc_8php.html b/doc/html/module__iframe_8inc_8php.html new file mode 100644 index 0000000..41eb4e2 --- /dev/null +++ b/doc/html/module__iframe_8inc_8php.html @@ -0,0 +1,100 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_iframe.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_iframe.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__iframe_8inc_8php.html#40856482f79fb837bc538e8eed66aff4">iframe_render_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__iframe_8inc_8php.html#d4d8fd8256a19beb570193c2886659e5">iframe_render_page_early</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__iframe_8inc_8php.html#3034fcc475334b511b91932918fcfe57">iframe_save_state</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="40856482f79fb837bc538e8eed66aff4"></a><!-- doxytag: member="module_iframe.inc.php::iframe_render_object" ref="40856482f79fb837bc538e8eed66aff4" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">iframe_render_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__iframe_8inc_8php.html">module_iframe.inc.php</a> Module for embedding iframe elements<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="d4d8fd8256a19beb570193c2886659e5"></a><!-- doxytag: member="module_iframe.inc.php::iframe_render_page_early" ref="d4d8fd8256a19beb570193c2886659e5" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">iframe_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="3034fcc475334b511b91932918fcfe57"></a><!-- doxytag: member="module_iframe.inc.php::iframe_save_state" ref="3034fcc475334b511b91932918fcfe57" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">iframe_save_state </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__image_8inc_8php.html b/doc/html/module__image_8inc_8php.html new file mode 100644 index 0000000..1ca5612 --- /dev/null +++ b/doc/html/module__image_8inc_8php.html @@ -0,0 +1,269 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_image.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_image.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#574d6d760e50b88ffa815cab30a5e634">_gd_available</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#3c76028c34273e722c9691243377a208">_gd_get_imagesize</a> ($f)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#7cbcf6138ccff16a8b733cfd6f0f1666">image_delete_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#0bef6164f5eafe368d251639cf6fe298">image_has_reference</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#4fadded2a225d1b5ea73404a84597620">image_render_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#8266a74a11a86a73e2aa3709388fd43f">image_render_page_early</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#9e03a71310133176236ae0bd4a0241e0">image_resize</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#c26ea1448f0b7ed835907cf7c22b60ca">image_save_state</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#bb6646bfaa6a012e620cdaaa0bc3c807">image_serve_resource</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__image_8inc_8php.html#37dee9de60e2852c0631d8e60e58585c">image_upload</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="574d6d760e50b88ffa815cab30a5e634"></a><!-- doxytag: member="module_image.inc.php::_gd_available" ref="574d6d760e50b88ffa815cab30a5e634" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">_gd_available </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__image_8inc_8php.html">module_image.inc.php</a> Module for displaying images uploaded by the user<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. return if GD image functions are available<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +<a class="anchor" name="3c76028c34273e722c9691243377a208"></a><!-- doxytag: member="module_image.inc.php::_gd_get_imagesize" ref="3c76028c34273e722c9691243377a208" args="($f)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">_gd_get_imagesize </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>f</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return the width and height of an image file<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$f filename</td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array with width and height in pixels </dd></dl> + +</div> +</div><p> +<a class="anchor" name="7cbcf6138ccff16a8b733cfd6f0f1666"></a><!-- doxytag: member="module_image.inc.php::image_delete_object" ref="7cbcf6138ccff16a8b733cfd6f0f1666" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">image_delete_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +implements delete_object +</div> +</div><p> +<a class="anchor" name="0bef6164f5eafe368d251639cf6fe298"></a><!-- doxytag: member="module_image.inc.php::image_has_reference" ref="0bef6164f5eafe368d251639cf6fe298" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">image_has_reference </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +implements has_reference +</div> +</div><p> +<a class="anchor" name="4fadded2a225d1b5ea73404a84597620"></a><!-- doxytag: member="module_image.inc.php::image_render_object" ref="4fadded2a225d1b5ea73404a84597620" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">image_render_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +implements render_object +</div> +</div><p> +<a class="anchor" name="8266a74a11a86a73e2aa3709388fd43f"></a><!-- doxytag: member="module_image.inc.php::image_render_page_early" ref="8266a74a11a86a73e2aa3709388fd43f" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">image_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +implements render_page_early +</div> +</div><p> +<a class="anchor" name="9e03a71310133176236ae0bd4a0241e0"></a><!-- doxytag: member="module_image.inc.php::image_resize" ref="9e03a71310133176236ae0bd4a0241e0" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">image_resize </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +resize an image object<p> +this function drops the reference to any currently resized version, saves the resized image together with the original image in the page's shared folder and updates the object file to use the resized version. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments key 'name' name of the objects key 'width' width in px key 'height' height in px </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array response true if the client is advised to reload the image, false if not </dd></dl> + +</div> +</div><p> +<a class="anchor" name="c26ea1448f0b7ed835907cf7c22b60ca"></a><!-- doxytag: member="module_image.inc.php::image_save_state" ref="c26ea1448f0b7ed835907cf7c22b60ca" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">image_save_state </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +implements save_state +</div> +</div><p> +<a class="anchor" name="bb6646bfaa6a012e620cdaaa0bc3c807"></a><!-- doxytag: member="module_image.inc.php::image_serve_resource" ref="bb6646bfaa6a012e620cdaaa0bc3c807" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">image_serve_resource </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +implements serve_resource +</div> +</div><p> +<a class="anchor" name="37dee9de60e2852c0631d8e60e58585c"></a><!-- doxytag: member="module_image.inc.php::image_upload" ref="37dee9de60e2852c0631d8e60e58585c" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">image_upload </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +implements upload +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__object_8inc_8php.html b/doc/html/module__object_8inc_8php.html new file mode 100644 index 0000000..b90c8c4 --- /dev/null +++ b/doc/html/module__object_8inc_8php.html @@ -0,0 +1,122 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_object.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_object.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__object_8inc_8php.html#6acc3273ff9872e01527162375d318d8">object_alter_render_early</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__object_8inc_8php.html#6b5bf16a15b7d5809bd7c6d15cd05a52">object_alter_render_late</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__object_8inc_8php.html#ba3a00b339dc7e9831b48a94f4f8e211">object_alter_save</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__object_8inc_8php.html#d06c13f1778d655f4a011d1763c6e618">object_render_page_early</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="6acc3273ff9872e01527162375d318d8"></a><!-- doxytag: member="module_object.inc.php::object_alter_render_early" ref="6acc3273ff9872e01527162375d318d8" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">object_alter_render_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__object_8inc_8php.html">module_object.inc.php</a> Module for handling general object properties<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="6b5bf16a15b7d5809bd7c6d15cd05a52"></a><!-- doxytag: member="module_object.inc.php::object_alter_render_late" ref="6b5bf16a15b7d5809bd7c6d15cd05a52" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">object_alter_render_late </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="ba3a00b339dc7e9831b48a94f4f8e211"></a><!-- doxytag: member="module_object.inc.php::object_alter_save" ref="ba3a00b339dc7e9831b48a94f4f8e211" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">object_alter_save </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="d06c13f1778d655f4a011d1763c6e618"></a><!-- doxytag: member="module_object.inc.php::object_render_page_early" ref="d06c13f1778d655f4a011d1763c6e618" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">object_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__page_8inc_8php.html b/doc/html/module__page_8inc_8php.html new file mode 100644 index 0000000..6f7b42f --- /dev/null +++ b/doc/html/module__page_8inc_8php.html @@ -0,0 +1,78 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_page.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_page.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__page_8inc_8php.html#53e7091b9a654d0d772cea6e3127820e">page_render_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__page_8inc_8php.html#80aff2ea069c7a2ba120e26bb218efa5">page_render_page_early</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="53e7091b9a654d0d772cea6e3127820e"></a><!-- doxytag: member="module_page.inc.php::page_render_object" ref="53e7091b9a654d0d772cea6e3127820e" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">page_render_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__page_8inc_8php.html">module_page.inc.php</a> Module for managing pages<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="80aff2ea069c7a2ba120e26bb218efa5"></a><!-- doxytag: member="module_page.inc.php::page_render_page_early" ref="80aff2ea069c7a2ba120e26bb218efa5" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">page_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__page__browser_8inc_8php.html b/doc/html/module__page__browser_8inc_8php.html new file mode 100644 index 0000000..608e3b5 --- /dev/null +++ b/doc/html/module__page__browser_8inc_8php.html @@ -0,0 +1,78 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_page_browser.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_page_browser.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__page__browser_8inc_8php.html#7e937f92734b69829f9d3ab5e00f14e0">controller_pages</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__page__browser_8inc_8php.html#a94d17bbea100ee50f09c7bf4094a1db">page_browser_render_page_early</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="7e937f92734b69829f9d3ab5e00f14e0"></a><!-- doxytag: member="module_page_browser.inc.php::controller_pages" ref="7e937f92734b69829f9d3ab5e00f14e0" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">controller_pages </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__page__browser_8inc_8php.html">module_page_browser.inc.php</a> Module for listing and managing all available pages<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="a94d17bbea100ee50f09c7bf4094a1db"></a><!-- doxytag: member="module_page_browser.inc.php::page_browser_render_page_early" ref="a94d17bbea100ee50f09c7bf4094a1db" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">page_browser_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__revisions__browser_8inc_8php.html b/doc/html/module__revisions__browser_8inc_8php.html new file mode 100644 index 0000000..c69aa1f --- /dev/null +++ b/doc/html/module__revisions__browser_8inc_8php.html @@ -0,0 +1,78 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_revisions_browser.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_revisions_browser.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__revisions__browser_8inc_8php.html#9eda010871ad706aca87cfd7b9dd0f7d">controller_revisions</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__revisions__browser_8inc_8php.html#eb482f35141c71dd933daeec9e9ce599">revisions_browser_render_page_early</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="9eda010871ad706aca87cfd7b9dd0f7d"></a><!-- doxytag: member="module_revisions_browser.inc.php::controller_revisions" ref="9eda010871ad706aca87cfd7b9dd0f7d" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">controller_revisions </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__revisions__browser_8inc_8php.html">module_revisions_browser.inc.php</a> Module for browsing through revisions of a page<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="eb482f35141c71dd933daeec9e9ce599"></a><!-- doxytag: member="module_revisions_browser.inc.php::revisions_browser_render_page_early" ref="eb482f35141c71dd933daeec9e9ce599" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">revisions_browser_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__text_8inc_8php.html b/doc/html/module__text_8inc_8php.html new file mode 100644 index 0000000..de5a6e8 --- /dev/null +++ b/doc/html/module__text_8inc_8php.html @@ -0,0 +1,131 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_text.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_text.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__text_8inc_8php.html#0586b5e177a15f5904d49b8b3aaf19ee">_text_render_content</a> ($s, $name)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__text_8inc_8php.html#8e9b1db22ff6cb0f3d20815da6aae6ce">text_render_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__text_8inc_8php.html#aaa8b8407d795f6dba9d258f1457ade8">text_render_page_early</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__text_8inc_8php.html#7fa0ea2ee517914595d7eda355177289">text_save_state</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="0586b5e177a15f5904d49b8b3aaf19ee"></a><!-- doxytag: member="module_text.inc.php::_text_render_content" ref="0586b5e177a15f5904d49b8b3aaf19ee" args="($s, $name)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">_text_render_content </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>name</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__text_8inc_8php.html">module_text.inc.php</a> Module for placing text elements on a page<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="8e9b1db22ff6cb0f3d20815da6aae6ce"></a><!-- doxytag: member="module_text.inc.php::text_render_object" ref="8e9b1db22ff6cb0f3d20815da6aae6ce" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">text_render_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="aaa8b8407d795f6dba9d258f1457ade8"></a><!-- doxytag: member="module_text.inc.php::text_render_page_early" ref="aaa8b8407d795f6dba9d258f1457ade8" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">text_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="7fa0ea2ee517914595d7eda355177289"></a><!-- doxytag: member="module_text.inc.php::text_save_state" ref="7fa0ea2ee517914595d7eda355177289" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">text_save_state </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/module__video_8inc_8php.html b/doc/html/module__video_8inc_8php.html new file mode 100644 index 0000000..6d1ed3f --- /dev/null +++ b/doc/html/module__video_8inc_8php.html @@ -0,0 +1,188 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/module_video.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/module_video.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__video_8inc_8php.html#4d25a132251840ed2ade27b636a6694e">video_delete_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__video_8inc_8php.html#dbbede5e492ca7b9457deaf076c887b0">video_has_reference</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__video_8inc_8php.html#14d6bc200a41905ad201a24d9a2d9be5">video_render_object</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__video_8inc_8php.html#223ac9bac4acfb2c9b458b43e45e06e3">video_render_page_early</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__video_8inc_8php.html#828b4f740b870b886936a22baf97418e">video_save_state</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__video_8inc_8php.html#5af838d3c4206bbc9bc3b5e57b16655c">video_serve_resource</a> ($args)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="module__video_8inc_8php.html#6ab50ffd184d8dcf84a9783dd6a2f80e">video_upload</a> ($args)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="4d25a132251840ed2ade27b636a6694e"></a><!-- doxytag: member="module_video.inc.php::video_delete_object" ref="4d25a132251840ed2ade27b636a6694e" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">video_delete_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="module__video_8inc_8php.html">module_video.inc.php</a> Module for embedding video elements on a page<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. +</div> +</div><p> +<a class="anchor" name="dbbede5e492ca7b9457deaf076c887b0"></a><!-- doxytag: member="module_video.inc.php::video_has_reference" ref="dbbede5e492ca7b9457deaf076c887b0" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">video_has_reference </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="14d6bc200a41905ad201a24d9a2d9be5"></a><!-- doxytag: member="module_video.inc.php::video_render_object" ref="14d6bc200a41905ad201a24d9a2d9be5" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">video_render_object </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="223ac9bac4acfb2c9b458b43e45e06e3"></a><!-- doxytag: member="module_video.inc.php::video_render_page_early" ref="223ac9bac4acfb2c9b458b43e45e06e3" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">video_render_page_early </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="828b4f740b870b886936a22baf97418e"></a><!-- doxytag: member="module_video.inc.php::video_save_state" ref="828b4f740b870b886936a22baf97418e" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">video_save_state </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="5af838d3c4206bbc9bc3b5e57b16655c"></a><!-- doxytag: member="module_video.inc.php::video_serve_resource" ref="5af838d3c4206bbc9bc3b5e57b16655c" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">video_serve_resource </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="6ab50ffd184d8dcf84a9783dd6a2f80e"></a><!-- doxytag: member="module_video.inc.php::video_upload" ref="6ab50ffd184d8dcf84a9783dd6a2f80e" args="($args)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">video_upload </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/modules_8inc_8php.html b/doc/html/modules_8inc_8php.html new file mode 100644 index 0000000..0bde7dd --- /dev/null +++ b/doc/html/modules_8inc_8php.html @@ -0,0 +1,395 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/modules.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/modules.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">if(!isset($hooks)) if(!isset($modules)) <br class="typebreak"> +if(!isset($services)) </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#dcaa12e356133b7fa0670571698b38cc">get_hooks</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#1b73e435e11b07906d0781b146b4aa21">get_modules</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#bf7633223c2fd4ecb199a8e0dc070802">get_service</a> ($service)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#3318fb85bac26e6fb2397c6ea9f02322">invoke_hook</a> ($hook, $args=array())</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#66473fc9f24153d85053f1f9c6ed83e4">invoke_hook_while</a> ($hook, $while, $args=array())</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#23f8be02dc2148a3c860119a1d6ea276">load_modules</a> ($search= '', $optional=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#e6ed600fb2ce39a4b0837bbb01fe8d6e">register_service</a> ($service, $func, $args=array())</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#d91a5f96df0655d782404170324e567d">register_hook</a> ($hook, $info= '')</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#361058ff2a03c098045c4442440a2574">response</a> ($data, $error=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="modules_8inc_8php.html#3d581f1636df2e24ffe7b013a12fb1db">run_service</a> ($service, $args=array())</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="dcaa12e356133b7fa0670571698b38cc"></a><!-- doxytag: member="modules.inc.php::get_hooks" ref="dcaa12e356133b7fa0670571698b38cc" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">if (!isset($hooks)) if (!isset($modules)) if (!isset($services)) get_hooks </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="modules_8inc_8php.html">modules.inc.php</a> Generic modules and services infrastructure<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. get an array of all currently registered hooks<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array </dd></dl> + +</div> +</div><p> +<a class="anchor" name="1b73e435e11b07906d0781b146b4aa21"></a><!-- doxytag: member="modules.inc.php::get_modules" ref="1b73e435e11b07906d0781b146b4aa21" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">get_modules </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get an array of all currently loaded modules<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array </dd></dl> + +</div> +</div><p> +<a class="anchor" name="bf7633223c2fd4ecb199a8e0dc070802"></a><!-- doxytag: member="modules.inc.php::get_service" ref="bf7633223c2fd4ecb199a8e0dc070802" args="($service)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">get_service </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>service</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return a service-array<p> +call <a class="el" href="modules_8inc_8php.html#23f8be02dc2148a3c860119a1d6ea276">load_modules()</a> before calling this function. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$service service name </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array or false if not found </dd></dl> + +</div> +</div><p> +<a class="anchor" name="3318fb85bac26e6fb2397c6ea9f02322"></a><!-- doxytag: member="modules.inc.php::invoke_hook" ref="3318fb85bac26e6fb2397c6ea9f02322" args="($hook, $args=array())" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">invoke_hook </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>hook</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> = <code>array()</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +invoke a hook<p> +this function also takes care of loading all modules. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$hook hook to invoke </td></tr> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments-array (can include references) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array of results (module=>result) </dd></dl> + +</div> +</div><p> +<a class="anchor" name="66473fc9f24153d85053f1f9c6ed83e4"></a><!-- doxytag: member="modules.inc.php::invoke_hook_while" ref="66473fc9f24153d85053f1f9c6ed83e4" args="($hook, $while, $args=array())" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">invoke_hook_while </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>hook</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>while</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> = <code>array()</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +invoke a hook while the returned result is $while<p> +this function also takes care of loading all modules. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$hook hook to invoke </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$while value to compare the returned result with </td></tr> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments-array </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array with result (module=>result) or empty result if there was none </dd></dl> + +</div> +</div><p> +<a class="anchor" name="23f8be02dc2148a3c860119a1d6ea276"></a><!-- doxytag: member="modules.inc.php::load_modules" ref="23f8be02dc2148a3c860119a1d6ea276" args="($search= '', $optional=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">load_modules </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>search</em> = <code>''</code>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>optional</em> = <code>false</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +load modules<p> +use this function instead of including module_* files directly. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$search module to load (by default all modules are loaded) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$optional whether to log any error to locate the module </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool true if successful, false if not </dd></dl> + +</div> +</div><p> +<a class="anchor" name="d91a5f96df0655d782404170324e567d"></a><!-- doxytag: member="modules.inc.php::register_hook" ref="d91a5f96df0655d782404170324e567d" args="($hook, $info= '')" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">register_hook </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>hook</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>info</em> = <code>''</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +register a hook<p> +this function is for information purposes only. you can also use a hook without registering it here. this is not recommended though. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$hook hook name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$info some words on the hook's purpose </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="e6ed600fb2ce39a4b0837bbb01fe8d6e"></a><!-- doxytag: member="modules.inc.php::register_service" ref="e6ed600fb2ce39a4b0837bbb01fe8d6e" args="($service, $func, $args=array())" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">register_service </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>service</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>func</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> = <code>array()</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +register a service<p> +you can specify the service's arguments in $args['args']. see run_services(). <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$service service name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$func function name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args optional arguments </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="361058ff2a03c098045c4442440a2574"></a><!-- doxytag: member="modules.inc.php::response" ref="361058ff2a03c098045c4442440a2574" args="($data, $error=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">response </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>data</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>error</em> = <code>false</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return a response-array<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$data (payload) data (should be the error-message if $error is true) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$error error core or true if an error occurred </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array </dd></dl> + +</div> +</div><p> +<a class="anchor" name="3d581f1636df2e24ffe7b013a12fb1db"></a><!-- doxytag: member="modules.inc.php::run_service" ref="3d581f1636df2e24ffe7b013a12fb1db" args="($service, $args=array())" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">run_service </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>service</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>args</em> = <code>array()</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +run a service<p> +this function checks the arguments in $args against the (optional) declaration given in <a class="el" href="modules_8inc_8php.html#e6ed600fb2ce39a4b0837bbb01fe8d6e">register_service()</a>. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$service service name </td></tr> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$args arguments-array </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>return value of the service function or a response-array in case of an error </dd></dl> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/html/tab_b.gif b/doc/html/tab_b.gif new file mode 100644 index 0000000..0d62348 Binary files /dev/null and b/doc/html/tab_b.gif differ diff --git a/doc/html/tab_l.gif b/doc/html/tab_l.gif new file mode 100644 index 0000000..9b1e633 Binary files /dev/null and b/doc/html/tab_l.gif differ diff --git a/doc/html/tab_r.gif b/doc/html/tab_r.gif new file mode 100644 index 0000000..ce9dd9f Binary files /dev/null and b/doc/html/tab_r.gif differ diff --git a/doc/html/tabs.css b/doc/html/tabs.css new file mode 100644 index 0000000..ab02c62 --- /dev/null +++ b/doc/html/tabs.css @@ -0,0 +1,105 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; + text-align : center; + margin : 2px; + padding : 2px; +} diff --git a/doc/html/util_8inc_8php.html b/doc/html/util_8inc_8php.html new file mode 100644 index 0000000..8c098ad --- /dev/null +++ b/doc/html/util_8inc_8php.html @@ -0,0 +1,663 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>hotglue: /srv/www/sukzessiv.net/h/util.inc.php File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.8 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>/srv/www/sukzessiv.net/h/util.inc.php File Reference</h1><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#61d3b2881d9368741c71509017724bc8">array_to_js</a> ($container)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#4647462c98447c6c2842f70d8c313f85">array_unique_element</a> (&$a, $key)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#6309f576f2611237288d0dd3eed09db3">dir_is_different</a> ($a, $b)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#afce787d4b725ac62be6306ff3e352e7">expl</a> ($delimiter, $string)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#1d2500a5e237e59956b03cbea845c95a">expl_whitesp</a> ($s, $honor_quot=false)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#9c9a81ec9dba8b2870cbb365f8139866">file_is_different</a> ($a, $b)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#6d9392e51344c2e8720a0c1982ebea21">filext</a> ($s)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#78288ca93c62ce2b5ef34f40352c7324">http_400</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#24f09c2c8205022b013bbee5293a38ae">http_404</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#575cc91d803ae46bbc5dfaecbeb3561d">http_500</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#ff065fbc9f3abbf9c5a0ebfba22acbf7">http_digest_check</a> ($users, $realm= '')</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#95d221746e2d296434b0d63f78cedf57">http_digest_prompt</a> ($realm= '')</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#0da48011cb68c039aec396c23cb04295">is_url</a> ($s)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#9f9eeab2eb9a39518e80609fc7f83842">nl</a> ($count=1)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#37ef346387afe0af2cf86a8bea887173">pad</a> ($s, $num, $chr= ' ')</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#3c7d87c658499c1559a6b98cac06f58d">quot</a> ($s)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#9d3ab20fc8b79fb6ab860f93600c745e">serve_file</a> ($fn, $dl, $mime)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#74e38925e7162356a2ea14db32664c37">tab</a> ($count=1)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="util_8inc_8php.html#a5cc9d5f8a0b5bb76dfe3d15796e5940">var_dump_inl</a> ($var)</td></tr> + +</table> +<hr><h2>Function Documentation</h2> +<a class="anchor" name="61d3b2881d9368741c71509017724bc8"></a><!-- doxytag: member="util.inc.php::array_to_js" ref="61d3b2881d9368741c71509017724bc8" args="($container)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">array_to_js </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>container</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="util_8inc_8php.html">util.inc.php</a> Static utility functions<p> +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. convert an associative array to a javascript block<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$container container array </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +<a class="anchor" name="4647462c98447c6c2842f70d8c313f85"></a><!-- doxytag: member="util.inc.php::array_unique_element" ref="4647462c98447c6c2842f70d8c313f85" args="(&$a, $key)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">array_unique_element </td> + <td>(</td> + <td class="paramtype">&$ </td> + <td class="paramname"> <em>a</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>key</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +make an array off associative array unique in a certain key-value<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>&$a reference to array </td></tr> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$key key whose value we compare </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="6309f576f2611237288d0dd3eed09db3"></a><!-- doxytag: member="util.inc.php::dir_is_different" ref="6309f576f2611237288d0dd3eed09db3" args="($a, $b)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">dir_is_different </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>a</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>b</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if two directories are different<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$a filename </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$b filename </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +<a class="anchor" name="afce787d4b725ac62be6306ff3e352e7"></a><!-- doxytag: member="util.inc.php::expl" ref="afce787d4b725ac62be6306ff3e352e7" args="($delimiter, $string)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">expl </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>delimiter</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>string</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +split a string by string<p> +like php's explode() but handles empty strings better. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$delimiter boundary string </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$string input string </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array </dd></dl> + +</div> +</div><p> +<a class="anchor" name="1d2500a5e237e59956b03cbea845c95a"></a><!-- doxytag: member="util.inc.php::expl_whitesp" ref="1d2500a5e237e59956b03cbea845c95a" args="($s, $honor_quot=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">expl_whitesp </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>honor_quot</em> = <code>false</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +explode a string splitting it by whitespace characters<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$s input string </td></tr> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$honor_quot don't split inside quotation marks </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>array of strings </dd></dl> + +</div> +</div><p> +<a class="anchor" name="9c9a81ec9dba8b2870cbb365f8139866"></a><!-- doxytag: member="util.inc.php::file_is_different" ref="9c9a81ec9dba8b2870cbb365f8139866" args="($a, $b)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">file_is_different </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>a</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>b</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if two files are different<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$a filename </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$b filename </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +<a class="anchor" name="6d9392e51344c2e8720a0c1982ebea21"></a><!-- doxytag: member="util.inc.php::filext" ref="6d9392e51344c2e8720a0c1982ebea21" args="($s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">filext </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +get the extension of a file<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$s filename </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +<a class="anchor" name="78288ca93c62ce2b5ef34f40352c7324"></a><!-- doxytag: member="util.inc.php::http_400" ref="78288ca93c62ce2b5ef34f40352c7324" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">http_400 </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return a error 400 message to the client<p> +this function doesn't return. +</div> +</div><p> +<a class="anchor" name="24f09c2c8205022b013bbee5293a38ae"></a><!-- doxytag: member="util.inc.php::http_404" ref="24f09c2c8205022b013bbee5293a38ae" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">http_404 </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return a error 404 message to the client<p> +this function doesn't return. +</div> +</div><p> +<a class="anchor" name="575cc91d803ae46bbc5dfaecbeb3561d"></a><!-- doxytag: member="util.inc.php::http_500" ref="575cc91d803ae46bbc5dfaecbeb3561d" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">http_500 </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return a error 500 message to the client<p> +this function doesn't return. +</div> +</div><p> +<a class="anchor" name="ff065fbc9f3abbf9c5a0ebfba22acbf7"></a><!-- doxytag: member="util.inc.php::http_digest_check" ref="ff065fbc9f3abbf9c5a0ebfba22acbf7" args="($users, $realm= '')" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">http_digest_check </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>users</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>realm</em> = <code>''</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if the user is http digest authenticated<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>array</em> </td><td>$users array of possible users (usernames as keys, password as values) </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$realm realm (e.g. name of the site) </td></tr> + </table> +</dl> +<dl compact><dt><b>Return values:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>authenticated </td></tr> + <tr><td valign="top"></td><td valign="top"><em>-1</em> </td><td>user did not request authentication </td></tr> + <tr><td valign="top"></td><td valign="top"><em>-2</em> </td><td>parts of the response are missing </td></tr> + <tr><td valign="top"></td><td valign="top"><em>-3</em> </td><td>unknown username </td></tr> + <tr><td valign="top"></td><td valign="top"><em>-4</em> </td><td>invalid password </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="95d221746e2d296434b0d63f78cedf57"></a><!-- doxytag: member="util.inc.php::http_digest_prompt" ref="95d221746e2d296434b0d63f78cedf57" args="($realm= '')" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">http_digest_prompt </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>realm</em> = <code>''</code> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +prompt the user for http digest authentication<p> +make sure the script stops execution after calling this function. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$realm realm (e.g. name of the site) </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="0da48011cb68c039aec396c23cb04295"></a><!-- doxytag: member="util.inc.php::is_url" ref="0da48011cb68c039aec396c23cb04295" args="($s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">is_url </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +check if a string is a url<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$s </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>bool </dd></dl> + +</div> +</div><p> +<a class="anchor" name="9f9eeab2eb9a39518e80609fc7f83842"></a><!-- doxytag: member="util.inc.php::nl" ref="9f9eeab2eb9a39518e80609fc7f83842" args="($count=1)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">nl </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>count</em> = <code>1</code> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return a number of newline characters<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>int</em> </td><td>$count count (one is default) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +<a class="anchor" name="37ef346387afe0af2cf86a8bea887173"></a><!-- doxytag: member="util.inc.php::pad" ref="37ef346387afe0af2cf86a8bea887173" args="($s, $num, $chr= ' ')" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">pad </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>num</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>chr</em> = <code>' '</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +pad a string to have at least $num characters<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$s string to operate on </td></tr> + <tr><td valign="top"></td><td valign="top"><em>int</em> </td><td>$num number of characters desired </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$chr character to pad the string with </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +<a class="anchor" name="3c7d87c658499c1559a6b98cac06f58d"></a><!-- doxytag: member="util.inc.php::quot" ref="3c7d87c658499c1559a6b98cac06f58d" args="($s)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">quot </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>s</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return a string with double quotation marks wrapped around<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$s string </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +<a class="anchor" name="9d3ab20fc8b79fb6ab860f93600c745e"></a><!-- doxytag: member="util.inc.php::serve_file" ref="9d3ab20fc8b79fb6ab860f93600c745e" args="($fn, $dl, $mime)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">serve_file </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>fn</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>dl</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>mime</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +serve a file to the client<p> +this function only returns on errors. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$fn filename </td></tr> + <tr><td valign="top"></td><td valign="top"><em>bool</em> </td><td>$dl download file </td></tr> + <tr><td valign="top"></td><td valign="top"><em>string</em> </td><td>$mime mime type </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="74e38925e7162356a2ea14db32664c37"></a><!-- doxytag: member="util.inc.php::tab" ref="74e38925e7162356a2ea14db32664c37" args="($count=1)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">tab </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>count</em> = <code>1</code> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +return a number of tab characters<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>int</em> </td><td>$count count (one is default) </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +<a class="anchor" name="a5cc9d5f8a0b5bb76dfe3d15796e5940"></a><!-- doxytag: member="util.inc.php::var_dump_inl" ref="a5cc9d5f8a0b5bb76dfe3d15796e5940" args="($var)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">var_dump_inl </td> + <td>(</td> + <td class="paramtype">$ </td> + <td class="paramname"> <em>var</em> </td> + <td> ) </td> + <td></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +print human-readable information about a variable in inline format<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>mixed</em> </td><td>$var variable </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>string </dd></dl> + +</div> +</div><p> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Wed Dec 1 14:07:05 2010 for hotglue by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> +</body> +</html> diff --git a/doc/latex/FreeSans.ttf b/doc/latex/FreeSans.ttf new file mode 100644 index 0000000..b550b90 Binary files /dev/null and b/doc/latex/FreeSans.ttf differ diff --git a/doc/latex/Makefile b/doc/latex/Makefile new file mode 100644 index 0000000..8b7c89a --- /dev/null +++ b/doc/latex/Makefile @@ -0,0 +1,19 @@ +all: clean refman.pdf + +pdf: refman.pdf + +refman.pdf: refman.tex + pdflatex refman.tex + makeindex refman.idx + pdflatex refman.tex + latex_count=5 ; \ + while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ + do \ + echo "Rerunning latex...." ;\ + pdflatex refman.tex ;\ + latex_count=`expr $$latex_count - 1` ;\ + done + + +clean: + rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf diff --git a/doc/latex/common_8inc_8php.tex b/doc/latex/common_8inc_8php.tex new file mode 100644 index 0000000..46440a8 --- /dev/null +++ b/doc/latex/common_8inc_8php.tex @@ -0,0 +1,277 @@ +\hypertarget{common_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/common.inc.php File Reference} +\label{common_8inc_8php}\index{/srv/www/sukzessiv.net/h/common.inc.php@{/srv/www/sukzessiv.net/h/common.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{common_8inc_8php_6cceb5c6a3c421c18e925515c78f6dfd}{cache\_\-output} (\$category, \$name, \$out) +\item +\hyperlink{common_8inc_8php_8916cb6ec34ceeb3f48c86655c305974}{default\_\-html} (\$add\_\-glue) +\item +\hyperlink{common_8inc_8php_7ca47f8aab349971cde2d4b02441cf41}{drop\_\-cache} (\$category, \$name) +\item +\hyperlink{common_8inc_8php_0d6d0da45f4adf6283bcccec9fd107e3}{glue\_\-version} () +\item +\hyperlink{common_8inc_8php_6fb34b9210b43349ca3eb16b2738a28b}{is\_\-cached} (\$category, \$name, \$max\_\-age) +\item +\hyperlink{common_8inc_8php_78992fdfae6cd9d7d4e8053d004d1709}{resolve\_\-aliases} (\$s, \$name= '') +\item +\hyperlink{common_8inc_8php_81eb70073067db81ab43829870f15e6d}{resolve\_\-relative\_\-urls} (\$s) +\item +\hyperlink{common_8inc_8php_ac90387dcab722e243df2d083f8d6a00}{serve\_\-cached} (\$category, \$name) +\item +\hyperlink{common_8inc_8php_0a3ee1e9beca572266648f17b9c4c75f}{startpage} () +\item +\hyperlink{common_8inc_8php_b3abbb2cd13e01231533e7cdc93da6db}{is\_\-auth} () +\item +\hyperlink{common_8inc_8php_3d71a269e01b98748fb57719feef27be}{object\_\-exists} (\$s) +\item +\hyperlink{common_8inc_8php_31ed04b0c90ac3077e71743c307d45f8}{page\_\-canonical} (\&\$s) +\item +\hyperlink{common_8inc_8php_a71868111dd5b8af98df9cc9c968e523}{page\_\-exists} (\$s) +\item +\hyperlink{common_8inc_8php_da968adfb989aa09adaf29867208f1ab}{page\_\-short} (\$s) +\item +\hyperlink{common_8inc_8php_80c23c9d8ac02159151d6368506b1b54}{prompt\_\-auth} (\$header\_\-only=false) +\item +\hyperlink{common_8inc_8php_4659077c34b709eec75f9897ea07e55a}{upload\_\-file} (\$fn, \$page, \$orig\_\-fn= '', \&\$existed=false) +\item +\hyperlink{common_8inc_8php_0ef613d233a6e62f7e631b8dfcd710bf}{valid\_\-pagename} (\$s) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{common_8inc_8php_6cceb5c6a3c421c18e925515c78f6dfd}{ +\index{common.inc.php@{common.inc.php}!cache\_\-output@{cache\_\-output}} +\index{cache\_\-output@{cache\_\-output}!common.inc.php@{common.inc.php}} +\subsubsection[{cache\_\-output}]{\setlength{\rightskip}{0pt plus 5cm}cache\_\-output (\$ {\em category}, \/ \$ {\em name}, \/ \$ {\em out})}} +\label{common_8inc_8php_6cceb5c6a3c421c18e925515c78f6dfd} + + +\hyperlink{common_8inc_8php}{common.inc.php} Common hotglue infrastructure + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. save a page in the cache + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$category cache category (e.g. 'page') \item[{\em string}]\$name item name \item[{\em string}]\$out content \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]true if successful, false if not \end{Desc} +\hypertarget{common_8inc_8php_8916cb6ec34ceeb3f48c86655c305974}{ +\index{common.inc.php@{common.inc.php}!default\_\-html@{default\_\-html}} +\index{default\_\-html@{default\_\-html}!common.inc.php@{common.inc.php}} +\subsubsection[{default\_\-html}]{\setlength{\rightskip}{0pt plus 5cm}default\_\-html (\$ {\em add\_\-glue})}} +\label{common_8inc_8php_8916cb6ec34ceeb3f48c86655c305974} + + +setup a default html page + +see \hyperlink{html_8inc_8php}{html.inc.php}. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em bool}]\$add\_\-glue true for adding the glue code \end{description} +\end{Desc} +\hypertarget{common_8inc_8php_7ca47f8aab349971cde2d4b02441cf41}{ +\index{common.inc.php@{common.inc.php}!drop\_\-cache@{drop\_\-cache}} +\index{drop\_\-cache@{drop\_\-cache}!common.inc.php@{common.inc.php}} +\subsubsection[{drop\_\-cache}]{\setlength{\rightskip}{0pt plus 5cm}drop\_\-cache (\$ {\em category}, \/ \$ {\em name})}} +\label{common_8inc_8php_7ca47f8aab349971cde2d4b02441cf41} + + +remove a page from the cache + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$category cache category (e.g. 'page') \item[{\em string}]\$name item name \end{description} +\end{Desc} +\hypertarget{common_8inc_8php_0d6d0da45f4adf6283bcccec9fd107e3}{ +\index{common.inc.php@{common.inc.php}!glue\_\-version@{glue\_\-version}} +\index{glue\_\-version@{glue\_\-version}!common.inc.php@{common.inc.php}} +\subsubsection[{glue\_\-version}]{\setlength{\rightskip}{0pt plus 5cm}glue\_\-version ()}} +\label{common_8inc_8php_0d6d0da45f4adf6283bcccec9fd107e3} + + +return the glue version with api.version.patchlevel + +\begin{Desc} +\item[Returns:]array (with length three) \end{Desc} +\hypertarget{common_8inc_8php_b3abbb2cd13e01231533e7cdc93da6db}{ +\index{common.inc.php@{common.inc.php}!is\_\-auth@{is\_\-auth}} +\index{is\_\-auth@{is\_\-auth}!common.inc.php@{common.inc.php}} +\subsubsection[{is\_\-auth}]{\setlength{\rightskip}{0pt plus 5cm}is\_\-auth ()}} +\label{common_8inc_8php_b3abbb2cd13e01231533e7cdc93da6db} + + +check if the user is authenticated or not + +\begin{Desc} +\item[Returns:]true if authenticated, false if not \end{Desc} +\hypertarget{common_8inc_8php_6fb34b9210b43349ca3eb16b2738a28b}{ +\index{common.inc.php@{common.inc.php}!is\_\-cached@{is\_\-cached}} +\index{is\_\-cached@{is\_\-cached}!common.inc.php@{common.inc.php}} +\subsubsection[{is\_\-cached}]{\setlength{\rightskip}{0pt plus 5cm}is\_\-cached (\$ {\em category}, \/ \$ {\em name}, \/ \$ {\em max\_\-age})}} +\label{common_8inc_8php_6fb34b9210b43349ca3eb16b2738a28b} + + +check if a page can be served from the cache + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$category cache category (e.g. 'page') \item[{\em string}]\$name item name \item[{\em int}]\$max\_\-age serve from cache when younger than \$max\_\-age seconds \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool true if the page can be served from cache, false if not \end{Desc} +\hypertarget{common_8inc_8php_3d71a269e01b98748fb57719feef27be}{ +\index{common.inc.php@{common.inc.php}!object\_\-exists@{object\_\-exists}} +\index{object\_\-exists@{object\_\-exists}!common.inc.php@{common.inc.php}} +\subsubsection[{object\_\-exists}]{\setlength{\rightskip}{0pt plus 5cm}object\_\-exists (\$ {\em s})}} +\label{common_8inc_8php_3d71a269e01b98748fb57719feef27be} + + +check if an object exists + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em \$s}]object (e.g. page.rev.obj) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool \end{Desc} +\hypertarget{common_8inc_8php_31ed04b0c90ac3077e71743c307d45f8}{ +\index{common.inc.php@{common.inc.php}!page\_\-canonical@{page\_\-canonical}} +\index{page\_\-canonical@{page\_\-canonical}!common.inc.php@{common.inc.php}} +\subsubsection[{page\_\-canonical}]{\setlength{\rightskip}{0pt plus 5cm}page\_\-canonical (\&\$ {\em s})}} +\label{common_8inc_8php_31ed04b0c90ac3077e71743c307d45f8} + + +turn short page names into canonical ones + +if \$s is not a page, the string is not altered. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\&\$s reference to the page name \end{description} +\end{Desc} +\hypertarget{common_8inc_8php_a71868111dd5b8af98df9cc9c968e523}{ +\index{common.inc.php@{common.inc.php}!page\_\-exists@{page\_\-exists}} +\index{page\_\-exists@{page\_\-exists}!common.inc.php@{common.inc.php}} +\subsubsection[{page\_\-exists}]{\setlength{\rightskip}{0pt plus 5cm}page\_\-exists (\$ {\em s})}} +\label{common_8inc_8php_a71868111dd5b8af98df9cc9c968e523} + + +check if a page exists + +this function can also be used with object names (e.g. page.rev.obj). \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em \$s}]page \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool \end{Desc} +\hypertarget{common_8inc_8php_da968adfb989aa09adaf29867208f1ab}{ +\index{common.inc.php@{common.inc.php}!page\_\-short@{page\_\-short}} +\index{page\_\-short@{page\_\-short}!common.inc.php@{common.inc.php}} +\subsubsection[{page\_\-short}]{\setlength{\rightskip}{0pt plus 5cm}page\_\-short (\$ {\em s})}} +\label{common_8inc_8php_da968adfb989aa09adaf29867208f1ab} + + +return the short pagename if possible, otherwise the long one + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em \$s}]page \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string \end{Desc} +\hypertarget{common_8inc_8php_80c23c9d8ac02159151d6368506b1b54}{ +\index{common.inc.php@{common.inc.php}!prompt\_\-auth@{prompt\_\-auth}} +\index{prompt\_\-auth@{prompt\_\-auth}!common.inc.php@{common.inc.php}} +\subsubsection[{prompt\_\-auth}]{\setlength{\rightskip}{0pt plus 5cm}prompt\_\-auth (\$ {\em header\_\-only} = {\tt false})}} +\label{common_8inc_8php_80c23c9d8ac02159151d6368506b1b54} + + +prompt user for authentication + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em bool}]\$header\_\-only only send header information this function does not return. \end{description} +\end{Desc} +\hypertarget{common_8inc_8php_78992fdfae6cd9d7d4e8053d004d1709}{ +\index{common.inc.php@{common.inc.php}!resolve\_\-aliases@{resolve\_\-aliases}} +\index{resolve\_\-aliases@{resolve\_\-aliases}!common.inc.php@{common.inc.php}} +\subsubsection[{resolve\_\-aliases}]{\setlength{\rightskip}{0pt plus 5cm}resolve\_\-aliases (\$ {\em s}, \/ \$ {\em name} = {\tt ''})}} +\label{common_8inc_8php_78992fdfae6cd9d7d4e8053d004d1709} + + +\hypertarget{common_8inc_8php_81eb70073067db81ab43829870f15e6d}{ +\index{common.inc.php@{common.inc.php}!resolve\_\-relative\_\-urls@{resolve\_\-relative\_\-urls}} +\index{resolve\_\-relative\_\-urls@{resolve\_\-relative\_\-urls}!common.inc.php@{common.inc.php}} +\subsubsection[{resolve\_\-relative\_\-urls}]{\setlength{\rightskip}{0pt plus 5cm}resolve\_\-relative\_\-urls (\$ {\em s})}} +\label{common_8inc_8php_81eb70073067db81ab43829870f15e6d} + + +\hypertarget{common_8inc_8php_ac90387dcab722e243df2d083f8d6a00}{ +\index{common.inc.php@{common.inc.php}!serve\_\-cached@{serve\_\-cached}} +\index{serve\_\-cached@{serve\_\-cached}!common.inc.php@{common.inc.php}} +\subsubsection[{serve\_\-cached}]{\setlength{\rightskip}{0pt plus 5cm}serve\_\-cached (\$ {\em category}, \/ \$ {\em name})}} +\label{common_8inc_8php_ac90387dcab722e243df2d083f8d6a00} + + +output a cached page to the client + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$category cache category (e.g. 'page') \item[{\em string}]\$name item name \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]true if successful, false if not \end{Desc} +\hypertarget{common_8inc_8php_0a3ee1e9beca572266648f17b9c4c75f}{ +\index{common.inc.php@{common.inc.php}!startpage@{startpage}} +\index{startpage@{startpage}!common.inc.php@{common.inc.php}} +\subsubsection[{startpage}]{\setlength{\rightskip}{0pt plus 5cm}startpage ()}} +\label{common_8inc_8php_0a3ee1e9beca572266648f17b9c4c75f} + + +return the starting page + +\begin{Desc} +\item[Returns:]string \end{Desc} +\hypertarget{common_8inc_8php_4659077c34b709eec75f9897ea07e55a}{ +\index{common.inc.php@{common.inc.php}!upload\_\-file@{upload\_\-file}} +\index{upload\_\-file@{upload\_\-file}!common.inc.php@{common.inc.php}} +\subsubsection[{upload\_\-file}]{\setlength{\rightskip}{0pt plus 5cm}upload\_\-file (\$ {\em fn}, \/ \$ {\em page}, \/ \$ {\em orig\_\-fn} = {\tt ''}, \/ \&\$ {\em existed} = {\tt false})}} +\label{common_8inc_8php_4659077c34b709eec75f9897ea07e55a} + + +move an uploaded file to the shared directory of a page + +this function reuses existing files when possible. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$fn filename of newly uploaded file (most likely in /tmp) \item[{\em string}]\$page page or pagename \item[{\em string}]\$orig\_\-fn the original filename on the client machine (optional) \item[{\em bool}]\&\$existed set to true if the filename returned did already exist before \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]filename inside the shared directory or false in case of error \end{Desc} +\hypertarget{common_8inc_8php_0ef613d233a6e62f7e631b8dfcd710bf}{ +\index{common.inc.php@{common.inc.php}!valid\_\-pagename@{valid\_\-pagename}} +\index{valid\_\-pagename@{valid\_\-pagename}!common.inc.php@{common.inc.php}} +\subsubsection[{valid\_\-pagename}]{\setlength{\rightskip}{0pt plus 5cm}valid\_\-pagename (\$ {\em s})}} +\label{common_8inc_8php_0ef613d233a6e62f7e631b8dfcd710bf} + + +check whether the string is a valid, canonical page name + +the function does not check if the page exists or not. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$s string to check \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool \end{Desc} diff --git a/doc/latex/config_8inc_8php.tex b/doc/latex/config_8inc_8php.tex new file mode 100644 index 0000000..3a31164 --- /dev/null +++ b/doc/latex/config_8inc_8php.tex @@ -0,0 +1,308 @@ +\hypertarget{config_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/config.inc.php File Reference} +\label{config_8inc_8php}\index{/srv/www/sukzessiv.net/h/config.inc.php@{/srv/www/sukzessiv.net/h/config.inc.php}} +} +\subsection*{Enumerations} +\begin{CompactItemize} +\item +enum \hyperlink{config_8inc_8php_2ee7e30fa45253c5e303994703d3293f}{AUTH\_\-METHOD} +\item +enum \hyperlink{config_8inc_8php_7d3a74ff015a9f789a5a2e554a9fa956}{AUTH\_\-USER} +\item +enum \hyperlink{config_8inc_8php_df2112da607b39714ba9cca31b42a93a}{AUTH\_\-PASSWORD} +\item +enum \hyperlink{config_8inc_8php_16548ab75ed30cbddce178d56d26dbb8}{BASE\_\-URL} +\item +enum \hyperlink{config_8inc_8php_fc454c0433a87811735836800fe3350b}{CACHE\_\-TIME} +\item +enum \hyperlink{config_8inc_8php_9949c9013641bf07cd112607d200d6ff}{CONTENT\_\-DIR} +\item +enum \hyperlink{config_8inc_8php_4208e17d37801abf0982b2d1e625a8f2}{DEFAULT\_\-PAGE} +\item +enum \hyperlink{config_8inc_8php_fd55d95ee6651060397404533516882a}{FAVICON} +\item +enum \hyperlink{config_8inc_8php_7c35565a4692ae46fd1c04340f4f1ca9}{HOTGLUE\_\-VERSION} +\item +enum \hyperlink{config_8inc_8php_1d76a949b348522c90864da5df468d51}{IE8\_\-COMPAT} +\item +enum \hyperlink{config_8inc_8php_5c2fff7e41a0380fb7872627e3a14a29}{JQUERY} +\item +enum \hyperlink{config_8inc_8php_924ae40271cc363050158e36b3823407}{LOCK\_\-TIME} +\item +enum \hyperlink{config_8inc_8php_6de83433b64b24349644a4c2d839dcb7}{LOG\_\-FILE} +\item +enum \hyperlink{config_8inc_8php_a5a9053636a30269210c54e734e0d583}{LOG\_\-LEVEL} +\item +enum \hyperlink{config_8inc_8php_377ac3321785e25215435e8d9802bc34}{SHORT\_\-URLS} +\item +enum \hyperlink{config_8inc_8php_38f8e1265350d7091b55f4cffe629f3a}{SITE\_\-NAME} +\item +enum \hyperlink{config_8inc_8php_a9c8d739795b1000f6ea105992a4e488}{SNAPSHOT\_\-MAX\_\-AGE} +\item +enum \hyperlink{config_8inc_8php_7fb94ff6aaa61e964fe2f90f738d5cb3}{SNAPSHOT\_\-MIN\_\-AGE} +\item +enum \hyperlink{config_8inc_8php_98806af9de0ea41a958d26c7e06b26a9}{USE\_\-MIN\_\-FILES} +\item +enum \hyperlink{config_8inc_8php_f27e0280ef96e9b1d2d968a0d2d208ff}{IMAGE\_\-JPEG\_\-QUAL} +\item +enum \hyperlink{config_8inc_8php_3e161cc5c717f2e23d89b69ec297af9b}{IMAGE\_\-PNG\_\-QUAL} +\item +enum \hyperlink{config_8inc_8php_0654894e46ca07417a6e85e091ed7d1d}{IMAGE\_\-RESIZING} +\item +enum \hyperlink{config_8inc_8php_3e205a45d91d7ef191e53487b6b48b3b}{OBJECT\_\-DEFAULT\_\-COLORS} +\item +enum \hyperlink{config_8inc_8php_bc1c54acdbce897c718854b663517cf9}{PAGE\_\-DEFAULT\_\-GRID\_\-X} +\item +enum \hyperlink{config_8inc_8php_b93c5dcea5ef58747b80594c3d9304d7}{PAGE\_\-DEFAULT\_\-GRID\_\-Y} +\item +enum \hyperlink{config_8inc_8php_81167deb206874270a59273141919fe5}{PAGE\_\-GUIDES\_\-X} +\item +enum \hyperlink{config_8inc_8php_3f78eb981e05f649bfff403c0e595d0b}{PAGE\_\-GUIDES\_\-Y} +\item +enum \hyperlink{config_8inc_8php_11f5534165e1764860b16cc7215b2141}{PAGES\_\-NEED\_\-AUTH} +\item +enum \hyperlink{config_8inc_8php_67b9479d334a4e6c33c0bc3505b3eb5e}{REVISIONS\_\-NEED\_\-AUTH} +\item +enum \hyperlink{config_8inc_8php_6f581226f389510394c592491ebedc0b}{TEXT\_\-AUTO\_\-BR} +\item +enum \hyperlink{config_8inc_8php_e1e42e1baa41f003453356a3747f9fee}{VIDEO\_\-START\_\-ON\_\-CLICK} +\end{CompactItemize} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{config_8inc_8php_8fdfb46e432b25bbdad23971a23a26b5}{base\_\-url} () +\end{CompactItemize} + + +\subsection{Enumeration Type Documentation} +\hypertarget{config_8inc_8php_2ee7e30fa45253c5e303994703d3293f}{ +\index{config.inc.php@{config.inc.php}!AUTH\_\-METHOD@{AUTH\_\-METHOD}} +\index{AUTH\_\-METHOD@{AUTH\_\-METHOD}!config.inc.php@{config.inc.php}} +\subsubsection[{AUTH\_\-METHOD}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf AUTH\_\-METHOD}}} +\label{config_8inc_8php_2ee7e30fa45253c5e303994703d3293f} + + +\hypertarget{config_8inc_8php_df2112da607b39714ba9cca31b42a93a}{ +\index{config.inc.php@{config.inc.php}!AUTH\_\-PASSWORD@{AUTH\_\-PASSWORD}} +\index{AUTH\_\-PASSWORD@{AUTH\_\-PASSWORD}!config.inc.php@{config.inc.php}} +\subsubsection[{AUTH\_\-PASSWORD}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf AUTH\_\-PASSWORD}}} +\label{config_8inc_8php_df2112da607b39714ba9cca31b42a93a} + + +\hypertarget{config_8inc_8php_7d3a74ff015a9f789a5a2e554a9fa956}{ +\index{config.inc.php@{config.inc.php}!AUTH\_\-USER@{AUTH\_\-USER}} +\index{AUTH\_\-USER@{AUTH\_\-USER}!config.inc.php@{config.inc.php}} +\subsubsection[{AUTH\_\-USER}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf AUTH\_\-USER}}} +\label{config_8inc_8php_7d3a74ff015a9f789a5a2e554a9fa956} + + +\hypertarget{config_8inc_8php_16548ab75ed30cbddce178d56d26dbb8}{ +\index{config.inc.php@{config.inc.php}!BASE\_\-URL@{BASE\_\-URL}} +\index{BASE\_\-URL@{BASE\_\-URL}!config.inc.php@{config.inc.php}} +\subsubsection[{BASE\_\-URL}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf BASE\_\-URL}}} +\label{config_8inc_8php_16548ab75ed30cbddce178d56d26dbb8} + + +\hypertarget{config_8inc_8php_fc454c0433a87811735836800fe3350b}{ +\index{config.inc.php@{config.inc.php}!CACHE\_\-TIME@{CACHE\_\-TIME}} +\index{CACHE\_\-TIME@{CACHE\_\-TIME}!config.inc.php@{config.inc.php}} +\subsubsection[{CACHE\_\-TIME}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf CACHE\_\-TIME}}} +\label{config_8inc_8php_fc454c0433a87811735836800fe3350b} + + +\hypertarget{config_8inc_8php_9949c9013641bf07cd112607d200d6ff}{ +\index{config.inc.php@{config.inc.php}!CONTENT\_\-DIR@{CONTENT\_\-DIR}} +\index{CONTENT\_\-DIR@{CONTENT\_\-DIR}!config.inc.php@{config.inc.php}} +\subsubsection[{CONTENT\_\-DIR}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf CONTENT\_\-DIR}}} +\label{config_8inc_8php_9949c9013641bf07cd112607d200d6ff} + + +\hypertarget{config_8inc_8php_4208e17d37801abf0982b2d1e625a8f2}{ +\index{config.inc.php@{config.inc.php}!DEFAULT\_\-PAGE@{DEFAULT\_\-PAGE}} +\index{DEFAULT\_\-PAGE@{DEFAULT\_\-PAGE}!config.inc.php@{config.inc.php}} +\subsubsection[{DEFAULT\_\-PAGE}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf DEFAULT\_\-PAGE}}} +\label{config_8inc_8php_4208e17d37801abf0982b2d1e625a8f2} + + +\hypertarget{config_8inc_8php_fd55d95ee6651060397404533516882a}{ +\index{config.inc.php@{config.inc.php}!FAVICON@{FAVICON}} +\index{FAVICON@{FAVICON}!config.inc.php@{config.inc.php}} +\subsubsection[{FAVICON}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf FAVICON}}} +\label{config_8inc_8php_fd55d95ee6651060397404533516882a} + + +\hypertarget{config_8inc_8php_7c35565a4692ae46fd1c04340f4f1ca9}{ +\index{config.inc.php@{config.inc.php}!HOTGLUE\_\-VERSION@{HOTGLUE\_\-VERSION}} +\index{HOTGLUE\_\-VERSION@{HOTGLUE\_\-VERSION}!config.inc.php@{config.inc.php}} +\subsubsection[{HOTGLUE\_\-VERSION}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf HOTGLUE\_\-VERSION}}} +\label{config_8inc_8php_7c35565a4692ae46fd1c04340f4f1ca9} + + +\hypertarget{config_8inc_8php_1d76a949b348522c90864da5df468d51}{ +\index{config.inc.php@{config.inc.php}!IE8\_\-COMPAT@{IE8\_\-COMPAT}} +\index{IE8\_\-COMPAT@{IE8\_\-COMPAT}!config.inc.php@{config.inc.php}} +\subsubsection[{IE8\_\-COMPAT}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf IE8\_\-COMPAT}}} +\label{config_8inc_8php_1d76a949b348522c90864da5df468d51} + + +\hypertarget{config_8inc_8php_f27e0280ef96e9b1d2d968a0d2d208ff}{ +\index{config.inc.php@{config.inc.php}!IMAGE\_\-JPEG\_\-QUAL@{IMAGE\_\-JPEG\_\-QUAL}} +\index{IMAGE\_\-JPEG\_\-QUAL@{IMAGE\_\-JPEG\_\-QUAL}!config.inc.php@{config.inc.php}} +\subsubsection[{IMAGE\_\-JPEG\_\-QUAL}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf IMAGE\_\-JPEG\_\-QUAL}}} +\label{config_8inc_8php_f27e0280ef96e9b1d2d968a0d2d208ff} + + +\hypertarget{config_8inc_8php_3e161cc5c717f2e23d89b69ec297af9b}{ +\index{config.inc.php@{config.inc.php}!IMAGE\_\-PNG\_\-QUAL@{IMAGE\_\-PNG\_\-QUAL}} +\index{IMAGE\_\-PNG\_\-QUAL@{IMAGE\_\-PNG\_\-QUAL}!config.inc.php@{config.inc.php}} +\subsubsection[{IMAGE\_\-PNG\_\-QUAL}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf IMAGE\_\-PNG\_\-QUAL}}} +\label{config_8inc_8php_3e161cc5c717f2e23d89b69ec297af9b} + + +\hypertarget{config_8inc_8php_0654894e46ca07417a6e85e091ed7d1d}{ +\index{config.inc.php@{config.inc.php}!IMAGE\_\-RESIZING@{IMAGE\_\-RESIZING}} +\index{IMAGE\_\-RESIZING@{IMAGE\_\-RESIZING}!config.inc.php@{config.inc.php}} +\subsubsection[{IMAGE\_\-RESIZING}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf IMAGE\_\-RESIZING}}} +\label{config_8inc_8php_0654894e46ca07417a6e85e091ed7d1d} + + +\hypertarget{config_8inc_8php_5c2fff7e41a0380fb7872627e3a14a29}{ +\index{config.inc.php@{config.inc.php}!JQUERY@{JQUERY}} +\index{JQUERY@{JQUERY}!config.inc.php@{config.inc.php}} +\subsubsection[{JQUERY}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf JQUERY}}} +\label{config_8inc_8php_5c2fff7e41a0380fb7872627e3a14a29} + + +\hypertarget{config_8inc_8php_924ae40271cc363050158e36b3823407}{ +\index{config.inc.php@{config.inc.php}!LOCK\_\-TIME@{LOCK\_\-TIME}} +\index{LOCK\_\-TIME@{LOCK\_\-TIME}!config.inc.php@{config.inc.php}} +\subsubsection[{LOCK\_\-TIME}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf LOCK\_\-TIME}}} +\label{config_8inc_8php_924ae40271cc363050158e36b3823407} + + +\hypertarget{config_8inc_8php_6de83433b64b24349644a4c2d839dcb7}{ +\index{config.inc.php@{config.inc.php}!LOG\_\-FILE@{LOG\_\-FILE}} +\index{LOG\_\-FILE@{LOG\_\-FILE}!config.inc.php@{config.inc.php}} +\subsubsection[{LOG\_\-FILE}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf LOG\_\-FILE}}} +\label{config_8inc_8php_6de83433b64b24349644a4c2d839dcb7} + + +\hypertarget{config_8inc_8php_a5a9053636a30269210c54e734e0d583}{ +\index{config.inc.php@{config.inc.php}!LOG\_\-LEVEL@{LOG\_\-LEVEL}} +\index{LOG\_\-LEVEL@{LOG\_\-LEVEL}!config.inc.php@{config.inc.php}} +\subsubsection[{LOG\_\-LEVEL}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf LOG\_\-LEVEL}}} +\label{config_8inc_8php_a5a9053636a30269210c54e734e0d583} + + +\hypertarget{config_8inc_8php_3e205a45d91d7ef191e53487b6b48b3b}{ +\index{config.inc.php@{config.inc.php}!OBJECT\_\-DEFAULT\_\-COLORS@{OBJECT\_\-DEFAULT\_\-COLORS}} +\index{OBJECT\_\-DEFAULT\_\-COLORS@{OBJECT\_\-DEFAULT\_\-COLORS}!config.inc.php@{config.inc.php}} +\subsubsection[{OBJECT\_\-DEFAULT\_\-COLORS}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf OBJECT\_\-DEFAULT\_\-COLORS}}} +\label{config_8inc_8php_3e205a45d91d7ef191e53487b6b48b3b} + + +\hypertarget{config_8inc_8php_bc1c54acdbce897c718854b663517cf9}{ +\index{config.inc.php@{config.inc.php}!PAGE\_\-DEFAULT\_\-GRID\_\-X@{PAGE\_\-DEFAULT\_\-GRID\_\-X}} +\index{PAGE\_\-DEFAULT\_\-GRID\_\-X@{PAGE\_\-DEFAULT\_\-GRID\_\-X}!config.inc.php@{config.inc.php}} +\subsubsection[{PAGE\_\-DEFAULT\_\-GRID\_\-X}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf PAGE\_\-DEFAULT\_\-GRID\_\-X}}} +\label{config_8inc_8php_bc1c54acdbce897c718854b663517cf9} + + +\hypertarget{config_8inc_8php_b93c5dcea5ef58747b80594c3d9304d7}{ +\index{config.inc.php@{config.inc.php}!PAGE\_\-DEFAULT\_\-GRID\_\-Y@{PAGE\_\-DEFAULT\_\-GRID\_\-Y}} +\index{PAGE\_\-DEFAULT\_\-GRID\_\-Y@{PAGE\_\-DEFAULT\_\-GRID\_\-Y}!config.inc.php@{config.inc.php}} +\subsubsection[{PAGE\_\-DEFAULT\_\-GRID\_\-Y}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf PAGE\_\-DEFAULT\_\-GRID\_\-Y}}} +\label{config_8inc_8php_b93c5dcea5ef58747b80594c3d9304d7} + + +\hypertarget{config_8inc_8php_81167deb206874270a59273141919fe5}{ +\index{config.inc.php@{config.inc.php}!PAGE\_\-GUIDES\_\-X@{PAGE\_\-GUIDES\_\-X}} +\index{PAGE\_\-GUIDES\_\-X@{PAGE\_\-GUIDES\_\-X}!config.inc.php@{config.inc.php}} +\subsubsection[{PAGE\_\-GUIDES\_\-X}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf PAGE\_\-GUIDES\_\-X}}} +\label{config_8inc_8php_81167deb206874270a59273141919fe5} + + +\hypertarget{config_8inc_8php_3f78eb981e05f649bfff403c0e595d0b}{ +\index{config.inc.php@{config.inc.php}!PAGE\_\-GUIDES\_\-Y@{PAGE\_\-GUIDES\_\-Y}} +\index{PAGE\_\-GUIDES\_\-Y@{PAGE\_\-GUIDES\_\-Y}!config.inc.php@{config.inc.php}} +\subsubsection[{PAGE\_\-GUIDES\_\-Y}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf PAGE\_\-GUIDES\_\-Y}}} +\label{config_8inc_8php_3f78eb981e05f649bfff403c0e595d0b} + + +\hypertarget{config_8inc_8php_11f5534165e1764860b16cc7215b2141}{ +\index{config.inc.php@{config.inc.php}!PAGES\_\-NEED\_\-AUTH@{PAGES\_\-NEED\_\-AUTH}} +\index{PAGES\_\-NEED\_\-AUTH@{PAGES\_\-NEED\_\-AUTH}!config.inc.php@{config.inc.php}} +\subsubsection[{PAGES\_\-NEED\_\-AUTH}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf PAGES\_\-NEED\_\-AUTH}}} +\label{config_8inc_8php_11f5534165e1764860b16cc7215b2141} + + +\hypertarget{config_8inc_8php_67b9479d334a4e6c33c0bc3505b3eb5e}{ +\index{config.inc.php@{config.inc.php}!REVISIONS\_\-NEED\_\-AUTH@{REVISIONS\_\-NEED\_\-AUTH}} +\index{REVISIONS\_\-NEED\_\-AUTH@{REVISIONS\_\-NEED\_\-AUTH}!config.inc.php@{config.inc.php}} +\subsubsection[{REVISIONS\_\-NEED\_\-AUTH}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf REVISIONS\_\-NEED\_\-AUTH}}} +\label{config_8inc_8php_67b9479d334a4e6c33c0bc3505b3eb5e} + + +\hypertarget{config_8inc_8php_377ac3321785e25215435e8d9802bc34}{ +\index{config.inc.php@{config.inc.php}!SHORT\_\-URLS@{SHORT\_\-URLS}} +\index{SHORT\_\-URLS@{SHORT\_\-URLS}!config.inc.php@{config.inc.php}} +\subsubsection[{SHORT\_\-URLS}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf SHORT\_\-URLS}}} +\label{config_8inc_8php_377ac3321785e25215435e8d9802bc34} + + +\hypertarget{config_8inc_8php_38f8e1265350d7091b55f4cffe629f3a}{ +\index{config.inc.php@{config.inc.php}!SITE\_\-NAME@{SITE\_\-NAME}} +\index{SITE\_\-NAME@{SITE\_\-NAME}!config.inc.php@{config.inc.php}} +\subsubsection[{SITE\_\-NAME}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf SITE\_\-NAME}}} +\label{config_8inc_8php_38f8e1265350d7091b55f4cffe629f3a} + + +\hypertarget{config_8inc_8php_a9c8d739795b1000f6ea105992a4e488}{ +\index{config.inc.php@{config.inc.php}!SNAPSHOT\_\-MAX\_\-AGE@{SNAPSHOT\_\-MAX\_\-AGE}} +\index{SNAPSHOT\_\-MAX\_\-AGE@{SNAPSHOT\_\-MAX\_\-AGE}!config.inc.php@{config.inc.php}} +\subsubsection[{SNAPSHOT\_\-MAX\_\-AGE}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf SNAPSHOT\_\-MAX\_\-AGE}}} +\label{config_8inc_8php_a9c8d739795b1000f6ea105992a4e488} + + +\hypertarget{config_8inc_8php_7fb94ff6aaa61e964fe2f90f738d5cb3}{ +\index{config.inc.php@{config.inc.php}!SNAPSHOT\_\-MIN\_\-AGE@{SNAPSHOT\_\-MIN\_\-AGE}} +\index{SNAPSHOT\_\-MIN\_\-AGE@{SNAPSHOT\_\-MIN\_\-AGE}!config.inc.php@{config.inc.php}} +\subsubsection[{SNAPSHOT\_\-MIN\_\-AGE}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf SNAPSHOT\_\-MIN\_\-AGE}}} +\label{config_8inc_8php_7fb94ff6aaa61e964fe2f90f738d5cb3} + + +\hypertarget{config_8inc_8php_6f581226f389510394c592491ebedc0b}{ +\index{config.inc.php@{config.inc.php}!TEXT\_\-AUTO\_\-BR@{TEXT\_\-AUTO\_\-BR}} +\index{TEXT\_\-AUTO\_\-BR@{TEXT\_\-AUTO\_\-BR}!config.inc.php@{config.inc.php}} +\subsubsection[{TEXT\_\-AUTO\_\-BR}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf TEXT\_\-AUTO\_\-BR}}} +\label{config_8inc_8php_6f581226f389510394c592491ebedc0b} + + +\hypertarget{config_8inc_8php_98806af9de0ea41a958d26c7e06b26a9}{ +\index{config.inc.php@{config.inc.php}!USE\_\-MIN\_\-FILES@{USE\_\-MIN\_\-FILES}} +\index{USE\_\-MIN\_\-FILES@{USE\_\-MIN\_\-FILES}!config.inc.php@{config.inc.php}} +\subsubsection[{USE\_\-MIN\_\-FILES}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf USE\_\-MIN\_\-FILES}}} +\label{config_8inc_8php_98806af9de0ea41a958d26c7e06b26a9} + + +\hypertarget{config_8inc_8php_e1e42e1baa41f003453356a3747f9fee}{ +\index{config.inc.php@{config.inc.php}!VIDEO\_\-START\_\-ON\_\-CLICK@{VIDEO\_\-START\_\-ON\_\-CLICK}} +\index{VIDEO\_\-START\_\-ON\_\-CLICK@{VIDEO\_\-START\_\-ON\_\-CLICK}!config.inc.php@{config.inc.php}} +\subsubsection[{VIDEO\_\-START\_\-ON\_\-CLICK}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf VIDEO\_\-START\_\-ON\_\-CLICK}}} +\label{config_8inc_8php_e1e42e1baa41f003453356a3747f9fee} + + + + +\subsection{Function Documentation} +\hypertarget{config_8inc_8php_8fdfb46e432b25bbdad23971a23a26b5}{ +\index{config.inc.php@{config.inc.php}!base\_\-url@{base\_\-url}} +\index{base\_\-url@{base\_\-url}!config.inc.php@{config.inc.php}} +\subsubsection[{base\_\-url}]{\setlength{\rightskip}{0pt plus 5cm}base\_\-url ()}} +\label{config_8inc_8php_8fdfb46e432b25bbdad23971a23a26b5} + + +use this function to get the site's base url + +\begin{Desc} +\item[Returns:]string base url (not html-encoded) \end{Desc} diff --git a/doc/latex/controller_8inc_8php.tex b/doc/latex/controller_8inc_8php.tex new file mode 100644 index 0000000..339b403 --- /dev/null +++ b/doc/latex/controller_8inc_8php.tex @@ -0,0 +1,126 @@ +\hypertarget{controller_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/controller.inc.php File Reference} +\label{controller_8inc_8php}\index{/srv/www/sukzessiv.net/h/controller.inc.php@{/srv/www/sukzessiv.net/h/controller.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +if(!isset(\$controllers)) \hyperlink{controller_8inc_8php_647d96ea8304771250e8fa4251a4d12e}{controller\_\-create\_\-page} (\$args) +\item +\hyperlink{controller_8inc_8php_406fb5b2a2a93bef89e4ba46f8829d2f}{controller\_\-edit} (\$args) +\item +\hyperlink{controller_8inc_8php_e9c67435a37f4b70d0769079c9dbf379}{controller\_\-default} (\$args) +\item +\hyperlink{controller_8inc_8php_c3e283e26869e2ffd938bdf9775c3e81}{controller\_\-login} (\$args) +\item +\hyperlink{controller_8inc_8php_d135971740244b9e81718d4cd0407b11}{controller\_\-show} (\$args) +\item +\hyperlink{controller_8inc_8php_170bef82dc4636c51b678276323e4ff4}{invoke\_\-controller} (\$args) +\item +\hyperlink{controller_8inc_8php_51a50fbc5165b4ff0a289b2010bb7597}{parse\_\-query\_\-string} () +\item +\hyperlink{controller_8inc_8php_543961dbcd309fa2cb6a887a8666bf1c}{register\_\-controller} (\$arg0, \$arg1, \$func, \$args=array()) +\item +\hyperlink{controller_8inc_8php_5d5274c3531eb05a1ea5927ff3cd08d3}{serve\_\-resource} (\$s, \$dl) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{controller_8inc_8php_647d96ea8304771250e8fa4251a4d12e}{ +\index{controller.inc.php@{controller.inc.php}!controller\_\-create\_\-page@{controller\_\-create\_\-page}} +\index{controller\_\-create\_\-page@{controller\_\-create\_\-page}!controller.inc.php@{controller.inc.php}} +\subsubsection[{controller\_\-create\_\-page}]{\setlength{\rightskip}{0pt plus 5cm}if (!isset(\$controllers)) controller\_\-create\_\-page (\$ {\em args})}} +\label{controller_8inc_8php_647d96ea8304771250e8fa4251a4d12e} + + +\hyperlink{controller_8inc_8php}{controller.inc.php} Generic dispatcher code mixed with some hotglue-specific controllers + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. show a site where authenticated users can create new pages \hypertarget{controller_8inc_8php_e9c67435a37f4b70d0769079c9dbf379}{ +\index{controller.inc.php@{controller.inc.php}!controller\_\-default@{controller\_\-default}} +\index{controller\_\-default@{controller\_\-default}!controller.inc.php@{controller.inc.php}} +\subsubsection[{controller\_\-default}]{\setlength{\rightskip}{0pt plus 5cm}controller\_\-default (\$ {\em args})}} +\label{controller_8inc_8php_e9c67435a37f4b70d0769079c9dbf379} + + +this is the default (fallback) controller + +it mainly invokes other controllers or sends error messages \hypertarget{controller_8inc_8php_406fb5b2a2a93bef89e4ba46f8829d2f}{ +\index{controller.inc.php@{controller.inc.php}!controller\_\-edit@{controller\_\-edit}} +\index{controller\_\-edit@{controller\_\-edit}!controller.inc.php@{controller.inc.php}} +\subsubsection[{controller\_\-edit}]{\setlength{\rightskip}{0pt plus 5cm}controller\_\-edit (\$ {\em args})}} +\label{controller_8inc_8php_406fb5b2a2a93bef89e4ba46f8829d2f} + + +show a site to edit pages \hypertarget{controller_8inc_8php_c3e283e26869e2ffd938bdf9775c3e81}{ +\index{controller.inc.php@{controller.inc.php}!controller\_\-login@{controller\_\-login}} +\index{controller\_\-login@{controller\_\-login}!controller.inc.php@{controller.inc.php}} +\subsubsection[{controller\_\-login}]{\setlength{\rightskip}{0pt plus 5cm}controller\_\-login (\$ {\em args})}} +\label{controller_8inc_8php_c3e283e26869e2ffd938bdf9775c3e81} + + +promt the user to authenticate + +this might be helpful as other controller's authentication seem to be only valid for the respective directory. (e.g. having privileges in '/foo/edit' does not seem to have an effect on the parent directory or any other sibling directory. \hypertarget{controller_8inc_8php_d135971740244b9e81718d4cd0407b11}{ +\index{controller.inc.php@{controller.inc.php}!controller\_\-show@{controller\_\-show}} +\index{controller\_\-show@{controller\_\-show}!controller.inc.php@{controller.inc.php}} +\subsubsection[{controller\_\-show}]{\setlength{\rightskip}{0pt plus 5cm}controller\_\-show (\$ {\em args})}} +\label{controller_8inc_8php_d135971740244b9e81718d4cd0407b11} + + +show a page \hypertarget{controller_8inc_8php_170bef82dc4636c51b678276323e4ff4}{ +\index{controller.inc.php@{controller.inc.php}!invoke\_\-controller@{invoke\_\-controller}} +\index{invoke\_\-controller@{invoke\_\-controller}!controller.inc.php@{controller.inc.php}} +\subsubsection[{invoke\_\-controller}]{\setlength{\rightskip}{0pt plus 5cm}invoke\_\-controller (\$ {\em args})}} +\label{controller_8inc_8php_170bef82dc4636c51b678276323e4ff4} + + +invoke a controller based on the query arguments given + +this function does not return in case of an error. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args query-arguments array \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]mixed return value of controller that was called \end{Desc} +\hypertarget{controller_8inc_8php_51a50fbc5165b4ff0a289b2010bb7597}{ +\index{controller.inc.php@{controller.inc.php}!parse\_\-query\_\-string@{parse\_\-query\_\-string}} +\index{parse\_\-query\_\-string@{parse\_\-query\_\-string}!controller.inc.php@{controller.inc.php}} +\subsubsection[{parse\_\-query\_\-string}]{\setlength{\rightskip}{0pt plus 5cm}parse\_\-query\_\-string ()}} +\label{controller_8inc_8php_51a50fbc5165b4ff0a289b2010bb7597} + + +parse the QUERY\_\-STRING server variable + +\begin{Desc} +\item[Returns:]array query-arguments array (key/value and numeric keys) \end{Desc} +\hypertarget{controller_8inc_8php_543961dbcd309fa2cb6a887a8666bf1c}{ +\index{controller.inc.php@{controller.inc.php}!register\_\-controller@{register\_\-controller}} +\index{register\_\-controller@{register\_\-controller}!controller.inc.php@{controller.inc.php}} +\subsubsection[{register\_\-controller}]{\setlength{\rightskip}{0pt plus 5cm}register\_\-controller (\$ {\em arg0}, \/ \$ {\em arg1}, \/ \$ {\em func}, \/ \$ {\em args} = {\tt array()})}} +\label{controller_8inc_8php_543961dbcd309fa2cb6a887a8666bf1c} + + +register a controller + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$arg0 first argument of query to match ($\ast$ for wildcard) \item[{\em string}]\$arg1 second argument of query to match ($\ast$ for widcard) \item[{\em string}]\$func function name \item[{\em array}]\$args optional arguments \end{description} +\end{Desc} +\hypertarget{controller_8inc_8php_5d5274c3531eb05a1ea5927ff3cd08d3}{ +\index{controller.inc.php@{controller.inc.php}!serve\_\-resource@{serve\_\-resource}} +\index{serve\_\-resource@{serve\_\-resource}!controller.inc.php@{controller.inc.php}} +\subsubsection[{serve\_\-resource}]{\setlength{\rightskip}{0pt plus 5cm}serve\_\-resource (\$ {\em s}, \/ \$ {\em dl})}} +\label{controller_8inc_8php_5d5274c3531eb05a1ea5927ff3cd08d3} + + +serve a resource associated with an object + +the function might not return (e.g. when a module calls \hyperlink{util_8inc_8php_9d3ab20fc8b79fb6ab860f93600c745e}{serve\_\-file()}). \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$s object (e.g. page.rev.obj) \item[{\em bool}]\$dl download file \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool \end{Desc} diff --git a/doc/latex/doxygen.sty b/doc/latex/doxygen.sty new file mode 100644 index 0000000..042697e --- /dev/null +++ b/doc/latex/doxygen.sty @@ -0,0 +1,86 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{doxygen} +\RequirePackage{calc} +\RequirePackage{array} +\pagestyle{fancyplain} +\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}} +\renewcommand{\chaptermark}[1]{\markboth{#1}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} +\lhead[\fancyplain{}{\bfseries\thepage}] + {\fancyplain{}{\bfseries\rightmark}} +\rhead[\fancyplain{}{\bfseries\leftmark}] + {\fancyplain{}{\bfseries\thepage}} +\rfoot[\fancyplain{}{\bfseries\scriptsize Generated on Wed Dec 1 14:07:05 2010 for hotglue by Doxygen }]{} +\lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated on Wed Dec 1 14:07:05 2010 for hotglue by Doxygen }} +\cfoot{} +\newenvironment{Code} +{\footnotesize} +{\normalsize} +\newcommand{\doxyref}[3]{\textbf{#1} (\textnormal{#2}\,\pageref{#3})} +\newenvironment{DocInclude} +{\footnotesize} +{\normalsize} +\newenvironment{VerbInclude} +{\footnotesize} +{\normalsize} +\newenvironment{Image} +{\begin{figure}[H]} +{\end{figure}} +\newenvironment{ImageNoCaption}{}{} +\newenvironment{CompactList} +{\begin{list}{}{ + \setlength{\leftmargin}{0.5cm} + \setlength{\itemsep}{0pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \renewcommand{\makelabel}{\hfill}}} +{\end{list}} +\newenvironment{CompactItemize} +{ + \begin{itemize} + \setlength{\itemsep}{-3pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \setlength{\partopsep}{0pt} +} +{\end{itemize}} +\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp} +\newlength{\tmplength} +\newenvironment{TabularC}[1] +{ +\setlength{\tmplength} + {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)} + \par\begin{tabular*}{\linewidth} + {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|} +} +{\end{tabular*}\par} +\newcommand{\entrylabel}[1]{ + {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\vspace{1.5\baselineskip}}}} +\newenvironment{Desc} +{\begin{list}{} + { + \settowidth{\labelwidth}{40pt} + \setlength{\leftmargin}{\labelwidth} + \setlength{\parsep}{0pt} + \setlength{\itemsep}{-4pt} + \renewcommand{\makelabel}{\entrylabel} + } +} +{\end{list}} +\newenvironment{Indent} + {\begin{list}{}{\setlength{\leftmargin}{0.5cm}} + \item[]\ignorespaces} + {\unskip\end{list}} +\setlength{\parindent}{0cm} +\setlength{\parskip}{0.2cm} +\addtocounter{secnumdepth}{1} +\sloppy +\usepackage[T1]{fontenc} +\makeatletter +\renewcommand{\paragraph}{\@startsection{paragraph}{4}{0ex}% + {-3.25ex plus -1ex minus -0.2ex}% + {1.5ex plus 0.2ex}% + {\normalfont\normalsize\bfseries}} +\makeatother +\stepcounter{secnumdepth} +\stepcounter{tocdepth} diff --git a/doc/latex/files.tex b/doc/latex/files.tex new file mode 100644 index 0000000..453e42c --- /dev/null +++ b/doc/latex/files.tex @@ -0,0 +1,23 @@ +\section{File List} +Here is a list of all files with brief descriptions:\begin{CompactList} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{common_8inc_8php}{common.inc.php} }{\pageref{common_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{config_8inc_8php}{config.inc.php} }{\pageref{config_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{controller_8inc_8php}{controller.inc.php} }{\pageref{controller_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{html_8inc_8php}{html.inc.php} }{\pageref{html_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{html__parse_8inc_8php}{html\_\-parse.inc.php} }{\pageref{html__parse_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{index_8php}{index.php} }{\pageref{index_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{json_8php}{json.php} }{\pageref{json_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{log_8inc_8php}{log.inc.php} }{\pageref{log_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__download_8inc_8php}{module\_\-download.inc.php} }{\pageref{module__download_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__glue_8inc_8php}{module\_\-glue.inc.php} }{\pageref{module__glue_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__iframe_8inc_8php}{module\_\-iframe.inc.php} }{\pageref{module__iframe_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__image_8inc_8php}{module\_\-image.inc.php} }{\pageref{module__image_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__object_8inc_8php}{module\_\-object.inc.php} }{\pageref{module__object_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__page_8inc_8php}{module\_\-page.inc.php} }{\pageref{module__page_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__page__browser_8inc_8php}{module\_\-page\_\-browser.inc.php} }{\pageref{module__page__browser_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__revisions__browser_8inc_8php}{module\_\-revisions\_\-browser.inc.php} }{\pageref{module__revisions__browser_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__text_8inc_8php}{module\_\-text.inc.php} }{\pageref{module__text_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{module__video_8inc_8php}{module\_\-video.inc.php} }{\pageref{module__video_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{modules_8inc_8php}{modules.inc.php} }{\pageref{modules_8inc_8php}}{} +\item\contentsline{section}{/srv/www/sukzessiv.net/h/\hyperlink{util_8inc_8php}{util.inc.php} }{\pageref{util_8inc_8php}}{} +\end{CompactList} diff --git a/doc/latex/html_8inc_8php.tex b/doc/latex/html_8inc_8php.tex new file mode 100644 index 0000000..7752aa0 --- /dev/null +++ b/doc/latex/html_8inc_8php.tex @@ -0,0 +1,419 @@ +\hypertarget{html_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/html.inc.php File Reference} +\label{html_8inc_8php}\index{/srv/www/sukzessiv.net/h/html.inc.php@{/srv/www/sukzessiv.net/h/html.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +if(!isset(\$html)) \hyperlink{html_8inc_8php_7fb2b386b2bae219112628971275c225}{\_\-array\_\-sort\_\-by\_\-prio} (\&\$a) +\item +\hyperlink{html_8inc_8php_f8ecadff0a4b78867d4da5eae49615e1}{\_\-cmp\_\-prio} (\$a, \$b) +\item +\& \hyperlink{html_8inc_8php_8b842636055e9a5853a7a10a9e002330}{body} () +\item +\hyperlink{html_8inc_8php_d27881abf3a2004d287434d8c8d7cdf6}{body\_\-append} (\$c) +\item +\hyperlink{html_8inc_8php_a7a1256f84f937f1656195d5ce7b8d91}{elem} (\$tag) +\item +\hyperlink{html_8inc_8php_afa12d2b690751666e599fb052e19ca6}{elem\_\-add\_\-class} (\&\$elem, \$c) +\item +\hyperlink{html_8inc_8php_ea37c451f5d55e2efbb2656e340c1dae}{elem\_\-append} (\&\$elem, \$c) +\item +\hyperlink{html_8inc_8php_894dc22f3b7668c59364599909162b8e}{elem\_\-attr} (\&\$elem) +\item +\hyperlink{html_8inc_8php_c705ef06deb9e2d49e342ed78ecc1c9a}{elem\_\-css} (\&\$elem) +\item +\hyperlink{html_8inc_8php_f04b43a4dd09e73ca2cef84a4f2e9381}{elem\_\-finalize} (\$elem) +\item +\hyperlink{html_8inc_8php_b1019c4b75181c1c1af10e1c1e5e197d}{elem\_\-has\_\-class} (\$elem, \$c) +\item +\hyperlink{html_8inc_8php_eb7074172d9164f69e64967b6bcdc643}{elem\_\-remove\_\-attr} (\&\$elem, \$a) +\item +\hyperlink{html_8inc_8php_6a224914e8f32176ca11a31154b1ae13}{elem\_\-remove\_\-class} (\&\$elem, \$c) +\item +\hyperlink{html_8inc_8php_e28d850c3c906c6884462ca89c06f59b}{elem\_\-val} (\&\$elem) +\item +\hyperlink{html_8inc_8php_e013e8f0bdd681184ee1873a1964c454}{html\_\-add\_\-alternate} (\$type, \$url, \$title) +\item +\hyperlink{html_8inc_8php_962ef1b29e909a38b9a7b79086d54ab2}{html\_\-add\_\-css} (\$url, \$prio=5, \$media= '') +\item +\hyperlink{html_8inc_8php_450214704e1bbc2e8849abb54db38a03}{html\_\-add\_\-js} (\$url, \$prio=5) +\item +\hyperlink{html_8inc_8php_90601d141e5751c07b61f32f623ed7d2}{html\_\-add\_\-js\_\-code} (\$code, \$prio=5, \$reason= '') +\item +\hyperlink{html_8inc_8php_84769b7fe7b5454ff46534d0577eb54c}{html\_\-add\_\-js\_\-var} (\$key, \$val) +\item +\hyperlink{html_8inc_8php_d52276fa2a03df7342ba4b8e6a334ce0}{html\_\-css} (\$prop) +\item +\hyperlink{html_8inc_8php_b0dafe79ee61164014b0a4d8b4112dbb}{html\_\-disable\_\-caching} (\$reason= '') +\item +\hyperlink{html_8inc_8php_5738adf9b56d1ff2b8d02977ed7929ce}{html\_\-favicon} () +\item +\hyperlink{html_8inc_8php_405dc7e3718d4196c05087057ebf69bf}{html\_\-finalize} (\&\$cache=false) +\item +\hyperlink{html_8inc_8php_3f572f51a815fe19c590fea7d6d3a1a6}{html\_\-title} () +\end{CompactItemize} +\subsection*{Variables} +\begin{CompactItemize} +\item +\hyperlink{html_8inc_8php_0a733c7a281726a879f13e7325881887}{\$single\_\-tags} = array('link', 'meta', 'hr', 'br', 'img', 'param', 'input') +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{html_8inc_8php_7fb2b386b2bae219112628971275c225}{ +\index{html.inc.php@{html.inc.php}!\_\-array\_\-sort\_\-by\_\-prio@{\_\-array\_\-sort\_\-by\_\-prio}} +\index{\_\-array\_\-sort\_\-by\_\-prio@{\_\-array\_\-sort\_\-by\_\-prio}!html.inc.php@{html.inc.php}} +\subsubsection[{\_\-array\_\-sort\_\-by\_\-prio}]{\setlength{\rightskip}{0pt plus 5cm}if (!isset(\$html)) \_\-array\_\-sort\_\-by\_\-prio (\&\$ {\em a})}} +\label{html_8inc_8php_7fb2b386b2bae219112628971275c225} + + +helper function for sorting an array of arrays by key 'prio' + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$a reference to an array \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_f8ecadff0a4b78867d4da5eae49615e1}{ +\index{html.inc.php@{html.inc.php}!\_\-cmp\_\-prio@{\_\-cmp\_\-prio}} +\index{\_\-cmp\_\-prio@{\_\-cmp\_\-prio}!html.inc.php@{html.inc.php}} +\subsubsection[{\_\-cmp\_\-prio}]{\setlength{\rightskip}{0pt plus 5cm}\_\-cmp\_\-prio (\$ {\em a}, \/ \$ {\em b})}} +\label{html_8inc_8php_f8ecadff0a4b78867d4da5eae49615e1} + + +helper function for \_\-array\_\-sort\_\-prio() + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$a array to compare \item[{\em array}]\$b array to compare \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]int comparison result \end{Desc} +\hypertarget{html_8inc_8php_8b842636055e9a5853a7a10a9e002330}{ +\index{html.inc.php@{html.inc.php}!body@{body}} +\index{body@{body}!html.inc.php@{html.inc.php}} +\subsubsection[{body}]{\setlength{\rightskip}{0pt plus 5cm}\& body ()}} +\label{html_8inc_8php_8b842636055e9a5853a7a10a9e002330} + + +get a reference to the body element + +\begin{Desc} +\item[Returns:]\&array reference to the body element \end{Desc} +\hypertarget{html_8inc_8php_d27881abf3a2004d287434d8c8d7cdf6}{ +\index{html.inc.php@{html.inc.php}!body\_\-append@{body\_\-append}} +\index{body\_\-append@{body\_\-append}!html.inc.php@{html.inc.php}} +\subsubsection[{body\_\-append}]{\setlength{\rightskip}{0pt plus 5cm}body\_\-append (\$ {\em c})}} +\label{html_8inc_8php_d27881abf3a2004d287434d8c8d7cdf6} + + +helper function for appending content to the body element + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mixed}]\$c content (can be either a string or another element) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_a7a1256f84f937f1656195d5ce7b8d91}{ +\index{html.inc.php@{html.inc.php}!elem@{elem}} +\index{elem@{elem}!html.inc.php@{html.inc.php}} +\subsubsection[{elem}]{\setlength{\rightskip}{0pt plus 5cm}elem (\$ {\em tag})}} +\label{html_8inc_8php_a7a1256f84f937f1656195d5ce7b8d91} + + +create a element + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$tag element tag \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array element \end{Desc} +\hypertarget{html_8inc_8php_afa12d2b690751666e599fb052e19ca6}{ +\index{html.inc.php@{html.inc.php}!elem\_\-add\_\-class@{elem\_\-add\_\-class}} +\index{elem\_\-add\_\-class@{elem\_\-add\_\-class}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-add\_\-class}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-add\_\-class (\&\$ {\em elem}, \/ \$ {\em c})}} +\label{html_8inc_8php_afa12d2b690751666e599fb052e19ca6} + + +add a class to an element + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$elem reference to an element \item[{\em string}]\$c class \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_ea37c451f5d55e2efbb2656e340c1dae}{ +\index{html.inc.php@{html.inc.php}!elem\_\-append@{elem\_\-append}} +\index{elem\_\-append@{elem\_\-append}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-append}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-append (\&\$ {\em elem}, \/ \$ {\em c})}} +\label{html_8inc_8php_ea37c451f5d55e2efbb2656e340c1dae} + + +append content to an element + +this function is similar to \hyperlink{html_8inc_8php_e28d850c3c906c6884462ca89c06f59b}{elem\_\-val()}. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$elem reference to an element \item[{\em mixed}]\$c content (can be either a string or another element) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_894dc22f3b7668c59364599909162b8e}{ +\index{html.inc.php@{html.inc.php}!elem\_\-attr@{elem\_\-attr}} +\index{elem\_\-attr@{elem\_\-attr}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-attr}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-attr (\&\$ {\em elem})}} +\label{html_8inc_8php_894dc22f3b7668c59364599909162b8e} + + +get or set an attribute in an element + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$elem reference to an element \item[{\em string}]attribute name \item[{\em mixed}]attribute value (to set it) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_c705ef06deb9e2d49e342ed78ecc1c9a}{ +\index{html.inc.php@{html.inc.php}!elem\_\-css@{elem\_\-css}} +\index{elem\_\-css@{elem\_\-css}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-css}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-css (\&\$ {\em elem})}} +\label{html_8inc_8php_c705ef06deb9e2d49e342ed78ecc1c9a} + + +get or set a css property in an element + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$elem reference to an element \item[{\em string}]css property name \item[{\em mixed}]css property value (to set it; empty string to clear it) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_f04b43a4dd09e73ca2cef84a4f2e9381}{ +\index{html.inc.php@{html.inc.php}!elem\_\-finalize@{elem\_\-finalize}} +\index{elem\_\-finalize@{elem\_\-finalize}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-finalize}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-finalize (\$ {\em elem})}} +\label{html_8inc_8php_f04b43a4dd09e73ca2cef84a4f2e9381} + + +turn an element into a html string + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$elem element \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string html \end{Desc} +\hypertarget{html_8inc_8php_b1019c4b75181c1c1af10e1c1e5e197d}{ +\index{html.inc.php@{html.inc.php}!elem\_\-has\_\-class@{elem\_\-has\_\-class}} +\index{elem\_\-has\_\-class@{elem\_\-has\_\-class}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-has\_\-class}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-has\_\-class (\$ {\em elem}, \/ \$ {\em c})}} +\label{html_8inc_8php_b1019c4b75181c1c1af10e1c1e5e197d} + + +check if an element is of a certain class + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$elem element \item[{\em string}]\$c class to check \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool \end{Desc} +\hypertarget{html_8inc_8php_eb7074172d9164f69e64967b6bcdc643}{ +\index{html.inc.php@{html.inc.php}!elem\_\-remove\_\-attr@{elem\_\-remove\_\-attr}} +\index{elem\_\-remove\_\-attr@{elem\_\-remove\_\-attr}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-remove\_\-attr}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-remove\_\-attr (\&\$ {\em elem}, \/ \$ {\em a})}} +\label{html_8inc_8php_eb7074172d9164f69e64967b6bcdc643} + + +remove an attribute from an element + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$elem reference to an element \item[{\em string}]\$a attribute name \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_6a224914e8f32176ca11a31154b1ae13}{ +\index{html.inc.php@{html.inc.php}!elem\_\-remove\_\-class@{elem\_\-remove\_\-class}} +\index{elem\_\-remove\_\-class@{elem\_\-remove\_\-class}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-remove\_\-class}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-remove\_\-class (\&\$ {\em elem}, \/ \$ {\em c})}} +\label{html_8inc_8php_6a224914e8f32176ca11a31154b1ae13} + + +remove a class from an element + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$elem reference to an element \item[{\em string}]\$c class \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_e28d850c3c906c6884462ca89c06f59b}{ +\index{html.inc.php@{html.inc.php}!elem\_\-val@{elem\_\-val}} +\index{elem\_\-val@{elem\_\-val}!html.inc.php@{html.inc.php}} +\subsubsection[{elem\_\-val}]{\setlength{\rightskip}{0pt plus 5cm}elem\_\-val (\&\$ {\em elem})}} +\label{html_8inc_8php_e28d850c3c906c6884462ca89c06f59b} + + +get or set an element's content + +this function is similar to \hyperlink{html_8inc_8php_ea37c451f5d55e2efbb2656e340c1dae}{elem\_\-append()}. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$elem reference to an element \item[{\em mixed}]\$c content (to set it, can be either a string or another element) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_e013e8f0bdd681184ee1873a1964c454}{ +\index{html.inc.php@{html.inc.php}!html\_\-add\_\-alternate@{html\_\-add\_\-alternate}} +\index{html\_\-add\_\-alternate@{html\_\-add\_\-alternate}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-add\_\-alternate}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-add\_\-alternate (\$ {\em type}, \/ \$ {\em url}, \/ \$ {\em title})}} +\label{html_8inc_8php_e013e8f0bdd681184ee1873a1964c454} + + +add a link-alternate element to the html header + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$type type attribute \item[{\em string}]\$url url attribute (url-encoded if necessary) \item[{\em string}]\$title title attribute \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_962ef1b29e909a38b9a7b79086d54ab2}{ +\index{html.inc.php@{html.inc.php}!html\_\-add\_\-css@{html\_\-add\_\-css}} +\index{html\_\-add\_\-css@{html\_\-add\_\-css}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-add\_\-css}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-add\_\-css (\$ {\em url}, \/ \$ {\em prio} = {\tt 5}, \/ \$ {\em media} = {\tt ''})}} +\label{html_8inc_8php_962ef1b29e909a38b9a7b79086d54ab2} + + +add a reference to a css file to the html header + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$url url attribute (url-encoded if necessary) \item[{\em int}]\$prio when to insert reference (0 - very early to 9 - late) \item[{\em string}]\$media media attribute (optional) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_450214704e1bbc2e8849abb54db38a03}{ +\index{html.inc.php@{html.inc.php}!html\_\-add\_\-js@{html\_\-add\_\-js}} +\index{html\_\-add\_\-js@{html\_\-add\_\-js}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-add\_\-js}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-add\_\-js (\$ {\em url}, \/ \$ {\em prio} = {\tt 5})}} +\label{html_8inc_8php_450214704e1bbc2e8849abb54db38a03} + + +add a reference to a javascript file to the html header + +duplicate references will be removed from the output. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$url url attribute (url-encoded if necessary) \item[{\em int}]\$prio when to insert reference (0 - very early to 9 - late) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_90601d141e5751c07b61f32f623ed7d2}{ +\index{html.inc.php@{html.inc.php}!html\_\-add\_\-js\_\-code@{html\_\-add\_\-js\_\-code}} +\index{html\_\-add\_\-js\_\-code@{html\_\-add\_\-js\_\-code}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-add\_\-js\_\-code}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-add\_\-js\_\-code (\$ {\em code}, \/ \$ {\em prio} = {\tt 5}, \/ \$ {\em reason} = {\tt ''})}} +\label{html_8inc_8php_90601d141e5751c07b61f32f623ed7d2} + + +add javascript code to the html header + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$code javscript code \item[{\em int}]\$prio when to insert code (0 - very early to 9 - late) \item[{\em string}]\$reason (e.g. your module) (optional) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_84769b7fe7b5454ff46534d0577eb54c}{ +\index{html.inc.php@{html.inc.php}!html\_\-add\_\-js\_\-var@{html\_\-add\_\-js\_\-var}} +\index{html\_\-add\_\-js\_\-var@{html\_\-add\_\-js\_\-var}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-add\_\-js\_\-var}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-add\_\-js\_\-var (\$ {\em key}, \/ \$ {\em val})}} +\label{html_8inc_8php_84769b7fe7b5454ff46534d0577eb54c} + + +set a variable in the javascript output + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$key variable or object the value will be stored) \item[{\em mixed}]\$val value \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_d52276fa2a03df7342ba4b8e6a334ce0}{ +\index{html.inc.php@{html.inc.php}!html\_\-css@{html\_\-css}} +\index{html\_\-css@{html\_\-css}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-css}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-css (\$ {\em prop})}} +\label{html_8inc_8php_d52276fa2a03df7342ba4b8e6a334ce0} + + +get or set a css property in the html element + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]css property name \item[{\em mixed}]css property value (to set it; empty string to clear it) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_b0dafe79ee61164014b0a4d8b4112dbb}{ +\index{html.inc.php@{html.inc.php}!html\_\-disable\_\-caching@{html\_\-disable\_\-caching}} +\index{html\_\-disable\_\-caching@{html\_\-disable\_\-caching}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-disable\_\-caching}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-disable\_\-caching (\$ {\em reason} = {\tt ''})}} +\label{html_8inc_8php_b0dafe79ee61164014b0a4d8b4112dbb} + + +disable caching of output + +can be used for modules that need the php to be executed every time. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$reason (e.g. your module) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_5738adf9b56d1ff2b8d02977ed7929ce}{ +\index{html.inc.php@{html.inc.php}!html\_\-favicon@{html\_\-favicon}} +\index{html\_\-favicon@{html\_\-favicon}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-favicon}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-favicon ()}} +\label{html_8inc_8php_5738adf9b56d1ff2b8d02977ed7929ce} + + +get or set favicon + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]url (to set it, url-encoded if necessary) \end{description} +\end{Desc} +\hypertarget{html_8inc_8php_405dc7e3718d4196c05087057ebf69bf}{ +\index{html.inc.php@{html.inc.php}!html\_\-finalize@{html\_\-finalize}} +\index{html\_\-finalize@{html\_\-finalize}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-finalize}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-finalize (\&\$ {\em cache} = {\tt false})}} +\label{html_8inc_8php_405dc7e3718d4196c05087057ebf69bf} + + +turn the page into a html string + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em bool}]\&\$cache is output cachable (will only modified if \$cache is true before) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string html \end{Desc} +\hypertarget{html_8inc_8php_3f572f51a815fe19c590fea7d6d3a1a6}{ +\index{html.inc.php@{html.inc.php}!html\_\-title@{html\_\-title}} +\index{html\_\-title@{html\_\-title}!html.inc.php@{html.inc.php}} +\subsubsection[{html\_\-title}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-title ()}} +\label{html_8inc_8php_3f572f51a815fe19c590fea7d6d3a1a6} + + +get or set title + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]title (to set it) \end{description} +\end{Desc} + + +\subsection{Variable Documentation} +\hypertarget{html_8inc_8php_0a733c7a281726a879f13e7325881887}{ +\index{html.inc.php@{html.inc.php}!\$single\_\-tags@{\$single\_\-tags}} +\index{\$single\_\-tags@{\$single\_\-tags}!html.inc.php@{html.inc.php}} +\subsubsection[{\$single\_\-tags}]{\setlength{\rightskip}{0pt plus 5cm}\$single\_\-tags = array('link', 'meta', 'hr', 'br', 'img', 'param', 'input')}} +\label{html_8inc_8php_0a733c7a281726a879f13e7325881887} + + +\hyperlink{html_8inc_8php}{html.inc.php} Generic html element functions + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \ No newline at end of file diff --git a/doc/latex/html__parse_8inc_8php.tex b/doc/latex/html__parse_8inc_8php.tex new file mode 100644 index 0000000..58ac239 --- /dev/null +++ b/doc/latex/html__parse_8inc_8php.tex @@ -0,0 +1,57 @@ +\hypertarget{html__parse_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/html\_\-parse.inc.php File Reference} +\label{html__parse_8inc_8php}\index{/srv/www/sukzessiv.net/h/html\_\-parse.inc.php@{/srv/www/sukzessiv.net/h/html\_\-parse.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{html__parse_8inc_8php_7eda4037f4b2576b3bcd97408ff95bd5}{html\_\-encode\_\-str\_\-smart} (\$html) +\item +\hyperlink{html__parse_8inc_8php_1003b146f08aef5a3a78d75a3538a4d7}{html\_\-parse} (\$html, \$recursive=false) +\item +\hyperlink{html__parse_8inc_8php_6d9c21ee610953fb5b5b64fae3f74ed3}{html\_\-parse\_\-elem} (\$html, \$recursive=false) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{html__parse_8inc_8php_7eda4037f4b2576b3bcd97408ff95bd5}{ +\index{html\_\-parse.inc.php@{html\_\-parse.inc.php}!html\_\-encode\_\-str\_\-smart@{html\_\-encode\_\-str\_\-smart}} +\index{html\_\-encode\_\-str\_\-smart@{html\_\-encode\_\-str\_\-smart}!html_parse.inc.php@{html\_\-parse.inc.php}} +\subsubsection[{html\_\-encode\_\-str\_\-smart}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-encode\_\-str\_\-smart (\$ {\em html})}} +\label{html__parse_8inc_8php_7eda4037f4b2576b3bcd97408ff95bd5} + + +\hyperlink{html__parse_8inc_8php}{html\_\-parse.inc.php} Generic html parsing functions + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{html__parse_8inc_8php_1003b146f08aef5a3a78d75a3538a4d7}{ +\index{html\_\-parse.inc.php@{html\_\-parse.inc.php}!html\_\-parse@{html\_\-parse}} +\index{html\_\-parse@{html\_\-parse}!html_parse.inc.php@{html\_\-parse.inc.php}} +\subsubsection[{html\_\-parse}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-parse (\$ {\em html}, \/ \$ {\em recursive} = {\tt false})}} +\label{html__parse_8inc_8php_1003b146f08aef5a3a78d75a3538a4d7} + + +parse a string containing html elements + +this function decodes html's special characters except for the content (when it too is not being parsed). this function is more fragile than \hyperlink{html__parse_8inc_8php_6d9c21ee610953fb5b5b64fae3f74ed3}{html\_\-parse\_\-elem()} when it comes to malformatted input. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$html input string \item[{\em bool}]\$recursive also parse children elements \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array parsed representation \end{Desc} +\hypertarget{html__parse_8inc_8php_6d9c21ee610953fb5b5b64fae3f74ed3}{ +\index{html\_\-parse.inc.php@{html\_\-parse.inc.php}!html\_\-parse\_\-elem@{html\_\-parse\_\-elem}} +\index{html\_\-parse\_\-elem@{html\_\-parse\_\-elem}!html_parse.inc.php@{html\_\-parse.inc.php}} +\subsubsection[{html\_\-parse\_\-elem}]{\setlength{\rightskip}{0pt plus 5cm}html\_\-parse\_\-elem (\$ {\em html}, \/ \$ {\em recursive} = {\tt false})}} +\label{html__parse_8inc_8php_6d9c21ee610953fb5b5b64fae3f74ed3} + + +parse exactly one html element + +this function decodes html's special characters except for the content (when it too is not being parsed). this function is less fragile than \hyperlink{html__parse_8inc_8php_1003b146f08aef5a3a78d75a3538a4d7}{html\_\-parse()} when it comes to malformatted input. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$html input string (must start and end with the element's tag) \item[{\em bool}]\$recursive also parse children elements \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array parsed representation \end{Desc} diff --git a/doc/latex/index_8php.tex b/doc/latex/index_8php.tex new file mode 100644 index 0000000..2ed28ae --- /dev/null +++ b/doc/latex/index_8php.tex @@ -0,0 +1,19 @@ +\hypertarget{index_8php}{ +\section{/srv/www/sukzessiv.net/h/index.php File Reference} +\label{index_8php}\index{/srv/www/sukzessiv.net/h/index.php@{/srv/www/sukzessiv.net/h/index.php}} +} +\subsection*{Variables} +\begin{CompactItemize} +\item +\hyperlink{index_8php_67e94494731d99ed23b123e95175bc10}{\$args} = parse\_\-query\_\-string() +\end{CompactItemize} + + +\subsection{Variable Documentation} +\hypertarget{index_8php_67e94494731d99ed23b123e95175bc10}{ +\index{index.php@{index.php}!\$args@{\$args}} +\index{\$args@{\$args}!index.php@{index.php}} +\subsubsection[{\$args}]{\setlength{\rightskip}{0pt plus 5cm}\$args = parse\_\-query\_\-string()}} +\label{index_8php_67e94494731d99ed23b123e95175bc10} + + diff --git a/doc/latex/json_8php.tex b/doc/latex/json_8php.tex new file mode 100644 index 0000000..da0bfb9 --- /dev/null +++ b/doc/latex/json_8php.tex @@ -0,0 +1,28 @@ +\hypertarget{json_8php}{ +\section{/srv/www/sukzessiv.net/h/json.php File Reference} +\label{json_8php}\index{/srv/www/sukzessiv.net/h/json.php@{/srv/www/sukzessiv.net/h/json.php}} +} +\subsection*{Variables} +\begin{CompactItemize} +\item +\hyperlink{json_8php_67e94494731d99ed23b123e95175bc10}{\$args} = array() +\item +if(is\_\-array(\$ret)\&\&isset(\$ret\mbox{[}'\#error'\mbox{]})\&\&\$ret\mbox{[}'\#error'\mbox{]}) \hyperlink{json_8php_ffd32ec1771cd364116738727d3a1ed8}{elseif} (is\_\-array(\$ret)\&\&isset(\$ret\mbox{[}'\#data'\mbox{]})) +\end{CompactItemize} + + +\subsection{Variable Documentation} +\hypertarget{json_8php_67e94494731d99ed23b123e95175bc10}{ +\index{json.php@{json.php}!\$args@{\$args}} +\index{\$args@{\$args}!json.php@{json.php}} +\subsubsection[{\$args}]{\setlength{\rightskip}{0pt plus 5cm}\$args = array()}} +\label{json_8php_67e94494731d99ed23b123e95175bc10} + + +\hypertarget{json_8php_ffd32ec1771cd364116738727d3a1ed8}{ +\index{json.php@{json.php}!elseif@{elseif}} +\index{elseif@{elseif}!json.php@{json.php}} +\subsubsection[{elseif}]{\setlength{\rightskip}{0pt plus 5cm}if (is\_\-array(\$ret)\&\&isset(\$ret\mbox{[}'\#error'\mbox{]})\&\&\$ret\mbox{[}'\#error'\mbox{]}) {\bf elseif}(is\_\-array(\$ret)\&\&isset(\$ret\mbox{[}'\#data'\mbox{]}))}} +\label{json_8php_ffd32ec1771cd364116738727d3a1ed8} + + diff --git a/doc/latex/log_8inc_8php.tex b/doc/latex/log_8inc_8php.tex new file mode 100644 index 0000000..9f68015 --- /dev/null +++ b/doc/latex/log_8inc_8php.tex @@ -0,0 +1,30 @@ +\hypertarget{log_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/log.inc.php File Reference} +\label{log_8inc_8php}\index{/srv/www/sukzessiv.net/h/log.inc.php@{/srv/www/sukzessiv.net/h/log.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +if(!isset(\$logfile)) if(!isset(\$loglevels)) if(!isset(\$request\_\-id)) \hyperlink{log_8inc_8php_0d59d693ca96c65b67de4b197954ce60}{log\_\-msg} (\$level, \$msg) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{log_8inc_8php_0d59d693ca96c65b67de4b197954ce60}{ +\index{log.inc.php@{log.inc.php}!log\_\-msg@{log\_\-msg}} +\index{log\_\-msg@{log\_\-msg}!log.inc.php@{log.inc.php}} +\subsubsection[{log\_\-msg}]{\setlength{\rightskip}{0pt plus 5cm}if (!isset(\$logfile)) if (!isset(\$loglevels)) if (!isset(\$request\_\-id)) log\_\-msg (\$ {\em level}, \/ \$ {\em msg})}} +\label{log_8inc_8php_0d59d693ca96c65b67de4b197954ce60} + + +\hyperlink{log_8inc_8php}{log.inc.php} Generic logging infrastructure + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. log a message to file + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$level can be error, warn, info or debug \item[{\em string}]\$msg message \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool true if successful, false if not \end{Desc} diff --git a/doc/latex/module__download_8inc_8php.tex b/doc/latex/module__download_8inc_8php.tex new file mode 100644 index 0000000..9a06c5b --- /dev/null +++ b/doc/latex/module__download_8inc_8php.tex @@ -0,0 +1,75 @@ +\hypertarget{module__download_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-download.inc.php File Reference} +\label{module__download_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-download.inc.php@{/srv/www/sukzessiv.net/h/module\_\-download.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__download_8inc_8php_5fd781bf1e0393667b227abec7169b28}{download\_\-delete\_\-object} (\$args) +\item +\hyperlink{module__download_8inc_8php_a80da3f3fd41f7f00f97043f7a2431c8}{download\_\-has\_\-reference} (\$args) +\item +\hyperlink{module__download_8inc_8php_57c588f1fd0663aa16fd707a522bcc79}{download\_\-render\_\-object} (\$args) +\item +\hyperlink{module__download_8inc_8php_c980246bec838c65efd59bc25253b005}{download\_\-render\_\-page\_\-early} (\$args) +\item +\hyperlink{module__download_8inc_8php_2e9ee6868b80832b40e9072a8c644c88}{download\_\-save\_\-state} (\$args) +\item +\hyperlink{module__download_8inc_8php_930c9545346e8da3f3db5a97dc4d8c74}{download\_\-serve\_\-resource} (\$args) +\item +\hyperlink{module__download_8inc_8php_678bcaf9018d772881b4291020894fa0}{download\_\-upload\_\-fallback} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__download_8inc_8php_5fd781bf1e0393667b227abec7169b28}{ +\index{module\_\-download.inc.php@{module\_\-download.inc.php}!download\_\-delete\_\-object@{download\_\-delete\_\-object}} +\index{download\_\-delete\_\-object@{download\_\-delete\_\-object}!module_download.inc.php@{module\_\-download.inc.php}} +\subsubsection[{download\_\-delete\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}download\_\-delete\_\-object (\$ {\em args})}} +\label{module__download_8inc_8php_5fd781bf1e0393667b227abec7169b28} + + +\hyperlink{module__download_8inc_8php}{module\_\-download.inc.php} Module for allowing to download arbitrary files that were uploaded by the user + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__download_8inc_8php_a80da3f3fd41f7f00f97043f7a2431c8}{ +\index{module\_\-download.inc.php@{module\_\-download.inc.php}!download\_\-has\_\-reference@{download\_\-has\_\-reference}} +\index{download\_\-has\_\-reference@{download\_\-has\_\-reference}!module_download.inc.php@{module\_\-download.inc.php}} +\subsubsection[{download\_\-has\_\-reference}]{\setlength{\rightskip}{0pt plus 5cm}download\_\-has\_\-reference (\$ {\em args})}} +\label{module__download_8inc_8php_a80da3f3fd41f7f00f97043f7a2431c8} + + +\hypertarget{module__download_8inc_8php_57c588f1fd0663aa16fd707a522bcc79}{ +\index{module\_\-download.inc.php@{module\_\-download.inc.php}!download\_\-render\_\-object@{download\_\-render\_\-object}} +\index{download\_\-render\_\-object@{download\_\-render\_\-object}!module_download.inc.php@{module\_\-download.inc.php}} +\subsubsection[{download\_\-render\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}download\_\-render\_\-object (\$ {\em args})}} +\label{module__download_8inc_8php_57c588f1fd0663aa16fd707a522bcc79} + + +\hypertarget{module__download_8inc_8php_c980246bec838c65efd59bc25253b005}{ +\index{module\_\-download.inc.php@{module\_\-download.inc.php}!download\_\-render\_\-page\_\-early@{download\_\-render\_\-page\_\-early}} +\index{download\_\-render\_\-page\_\-early@{download\_\-render\_\-page\_\-early}!module_download.inc.php@{module\_\-download.inc.php}} +\subsubsection[{download\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}download\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__download_8inc_8php_c980246bec838c65efd59bc25253b005} + + +\hypertarget{module__download_8inc_8php_2e9ee6868b80832b40e9072a8c644c88}{ +\index{module\_\-download.inc.php@{module\_\-download.inc.php}!download\_\-save\_\-state@{download\_\-save\_\-state}} +\index{download\_\-save\_\-state@{download\_\-save\_\-state}!module_download.inc.php@{module\_\-download.inc.php}} +\subsubsection[{download\_\-save\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}download\_\-save\_\-state (\$ {\em args})}} +\label{module__download_8inc_8php_2e9ee6868b80832b40e9072a8c644c88} + + +\hypertarget{module__download_8inc_8php_930c9545346e8da3f3db5a97dc4d8c74}{ +\index{module\_\-download.inc.php@{module\_\-download.inc.php}!download\_\-serve\_\-resource@{download\_\-serve\_\-resource}} +\index{download\_\-serve\_\-resource@{download\_\-serve\_\-resource}!module_download.inc.php@{module\_\-download.inc.php}} +\subsubsection[{download\_\-serve\_\-resource}]{\setlength{\rightskip}{0pt plus 5cm}download\_\-serve\_\-resource (\$ {\em args})}} +\label{module__download_8inc_8php_930c9545346e8da3f3db5a97dc4d8c74} + + +\hypertarget{module__download_8inc_8php_678bcaf9018d772881b4291020894fa0}{ +\index{module\_\-download.inc.php@{module\_\-download.inc.php}!download\_\-upload\_\-fallback@{download\_\-upload\_\-fallback}} +\index{download\_\-upload\_\-fallback@{download\_\-upload\_\-fallback}!module_download.inc.php@{module\_\-download.inc.php}} +\subsubsection[{download\_\-upload\_\-fallback}]{\setlength{\rightskip}{0pt plus 5cm}download\_\-upload\_\-fallback (\$ {\em args})}} +\label{module__download_8inc_8php_678bcaf9018d772881b4291020894fa0} + + diff --git a/doc/latex/module__glue_8inc_8php.tex b/doc/latex/module__glue_8inc_8php.tex new file mode 100644 index 0000000..d8d1195 --- /dev/null +++ b/doc/latex/module__glue_8inc_8php.tex @@ -0,0 +1,494 @@ +\hypertarget{module__glue_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-glue.inc.php File Reference} +\label{module__glue_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-glue.inc.php@{/srv/www/sukzessiv.net/h/module\_\-glue.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__glue_8inc_8php_5fea6c120a24a298149febcbf3b1df10}{\_\-cmp\_\-time} (\$a, \$b) +\item +\hyperlink{module__glue_8inc_8php_21f260355b875069ca90edf1f9a559d0}{\_\-obj\_\-lock} (\$name, \$wait=true) +\item +\hyperlink{module__glue_8inc_8php_73a91facde5362e20df9657d31c2bb06}{\_\-obj\_\-unlock} (\$f) +\item +\hyperlink{module__glue_8inc_8php_aa1103a091b9dbca790e77d25a452ca5}{check\_\-auto\_\-snapshot} (\$args) +\item +\hyperlink{module__glue_8inc_8php_9c7f39d87787ce288ce3d8a3e389ba95}{clone\_\-object} (\$args) +\item +\hyperlink{module__glue_8inc_8php_12aa18f28f86274d770ba90aa88e2c3e}{create\_\-object} (\$args) +\item +\hyperlink{module__glue_8inc_8php_9806cd2a9b829a24876b149753e819fb}{create\_\-page} (\$args) +\item +\hyperlink{module__glue_8inc_8php_51fdb1d1ff829d6d2d79a9f852b7e0ef}{delete\_\-object} (\$args) +\item +\hyperlink{module__glue_8inc_8php_f11541a6869804225793b82e54fa09fe}{delete\_\-page} (\$args) +\item +\hyperlink{module__glue_8inc_8php_a4865d52ac449f8aaadb3a5d425f2efb}{delete\_\-upload} (\$args) +\item +\hyperlink{module__glue_8inc_8php_c6b5ed5ff055ccb4d07ad17cf78d5a11}{load\_\-object} (\$args) +\item +\hyperlink{module__glue_8inc_8php_a9618d306b7ee5bd9e5d6a0be268ed44}{object\_\-get\_\-symlink} (\$args) +\item +\hyperlink{module__glue_8inc_8php_14e6da411df5aa9ff38e2d4ea27dd077}{object\_\-make\_\-symlink} (\$args) +\item +\hyperlink{module__glue_8inc_8php_e16d748c2d933978daec8bf11acdc34b}{object\_\-remove\_\-attr} (\$args) +\item +\hyperlink{module__glue_8inc_8php_354fc85f928484ae3b316bbf0065d9bd}{pagenames} (\$args) +\item +\hyperlink{module__glue_8inc_8php_e9103a74e4b40e88536fbc0a52d1c72f}{render\_\-object} (\$args) +\item +\hyperlink{module__glue_8inc_8php_ab1981a767de519c6c4afb946d748d0a}{render\_\-page} (\$args) +\item +\hyperlink{module__glue_8inc_8php_cd08b36587528b6f088cafb7d1d6bd29}{rename\_\-page} (\$args) +\item +\hyperlink{module__glue_8inc_8php_e69e25beb40feedc02d3b850587d20cc}{revert} (\$args) +\item +\hyperlink{module__glue_8inc_8php_27d90d2ed1b4142554bc4e0e47e9ba0c}{revisions} (\$args) +\item +\hyperlink{module__glue_8inc_8php_1dc65b69a920ac4ebc8f7c1df305060b}{revisions\_\-info} (\$args) +\item +\hyperlink{module__glue_8inc_8php_b294f21c7f6fed0932b65167f180c78c}{save\_\-object} (\$args) +\item +\hyperlink{module__glue_8inc_8php_60d03d7a0d8783e926835f0aa6cff698}{save\_\-state} (\$args) +\item +\hyperlink{module__glue_8inc_8php_afa7a8fa046ff6119cb7506d68edf787}{set\_\-startpage} (\$args) +\item +\hyperlink{module__glue_8inc_8php_5d3ad02088eee566589cd47fe0dc889a}{snapshot} (\$args) +\item +\hyperlink{module__glue_8inc_8php_4aed316adcde13b40c9fc1b35e6537a4}{update\_\-object} (\$args) +\item +\hyperlink{module__glue_8inc_8php_43746135e67f614d79317029aced064b}{upload\_\-files} (\$args) +\item +\hyperlink{module__glue_8inc_8php_2099347b9bdf5a5973a13e5f7a4be933}{upload\_\-references} (\$args) +\item +\hyperlink{module__glue_8inc_8php_9b741f04b878cbc03f1aac7d3406d548}{glue\_\-module\_\-info} () +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__glue_8inc_8php_5fea6c120a24a298149febcbf3b1df10}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!\_\-cmp\_\-time@{\_\-cmp\_\-time}} +\index{\_\-cmp\_\-time@{\_\-cmp\_\-time}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{\_\-cmp\_\-time}]{\setlength{\rightskip}{0pt plus 5cm}\_\-cmp\_\-time (\$ {\em a}, \/ \$ {\em b})}} +\label{module__glue_8inc_8php_5fea6c120a24a298149febcbf3b1df10} + + +\hyperlink{module__glue_8inc_8php}{module\_\-glue.inc.php} Main hotglue module + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. helper function for \hyperlink{module__glue_8inc_8php_1dc65b69a920ac4ebc8f7c1df305060b}{revisions\_\-info()} + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$a array to compare \item[{\em array}]\$b array to compare \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]int comparison result \end{Desc} +\hypertarget{module__glue_8inc_8php_21f260355b875069ca90edf1f9a559d0}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!\_\-obj\_\-lock@{\_\-obj\_\-lock}} +\index{\_\-obj\_\-lock@{\_\-obj\_\-lock}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{\_\-obj\_\-lock}]{\setlength{\rightskip}{0pt plus 5cm}\_\-obj\_\-lock (\$ {\em name}, \/ \$ {\em wait} = {\tt true})}} +\label{module__glue_8inc_8php_21f260355b875069ca90edf1f9a559d0} + + +\hypertarget{module__glue_8inc_8php_73a91facde5362e20df9657d31c2bb06}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!\_\-obj\_\-unlock@{\_\-obj\_\-unlock}} +\index{\_\-obj\_\-unlock@{\_\-obj\_\-unlock}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{\_\-obj\_\-unlock}]{\setlength{\rightskip}{0pt plus 5cm}\_\-obj\_\-unlock (\$ {\em f})}} +\label{module__glue_8inc_8php_73a91facde5362e20df9657d31c2bb06} + + +\hypertarget{module__glue_8inc_8php_aa1103a091b9dbca790e77d25a452ca5}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!check\_\-auto\_\-snapshot@{check\_\-auto\_\-snapshot}} +\index{check\_\-auto\_\-snapshot@{check\_\-auto\_\-snapshot}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{check\_\-auto\_\-snapshot}]{\setlength{\rightskip}{0pt plus 5cm}check\_\-auto\_\-snapshot (\$ {\em args})}} +\label{module__glue_8inc_8php_aa1103a091b9dbca790e77d25a452ca5} + + +create and delete auto- revisions + +this function operates on a specific page and takes SNAPSHOT\_\-MIN\_\-AGE and SNAPSHOT\_\-MAX\_\-AGE into account. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'page' is the page (i.e. page.rev) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response true if successful \end{Desc} +\hypertarget{module__glue_8inc_8php_9c7f39d87787ce288ce3d8a3e389ba95}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!clone\_\-object@{clone\_\-object}} +\index{clone\_\-object@{clone\_\-object}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{clone\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}clone\_\-object (\$ {\em args})}} +\label{module__glue_8inc_8php_9c7f39d87787ce288ce3d8a3e389ba95} + + +duplicate an object + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' name of the object to duplicate \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response string name of new object if successful \end{Desc} +\hypertarget{module__glue_8inc_8php_12aa18f28f86274d770ba90aa88e2c3e}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!create\_\-object@{create\_\-object}} +\index{create\_\-object@{create\_\-object}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{create\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}create\_\-object (\$ {\em args})}} +\label{module__glue_8inc_8php_12aa18f28f86274d770ba90aa88e2c3e} + + +create an empty object in the content directory + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'page' is the page (i.e. page.rev) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response key 'name' is the name of the object created \end{Desc} +\hypertarget{module__glue_8inc_8php_9806cd2a9b829a24876b149753e819fb}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!create\_\-page@{create\_\-page}} +\index{create\_\-page@{create\_\-page}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{create\_\-page}]{\setlength{\rightskip}{0pt plus 5cm}create\_\-page (\$ {\em args})}} +\label{module__glue_8inc_8php_9806cd2a9b829a24876b149753e819fb} + + +create a page + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'page' is the page (i.e. page.rev) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_51fdb1d1ff829d6d2d79a9f852b7e0ef}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!delete\_\-object@{delete\_\-object}} +\index{delete\_\-object@{delete\_\-object}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{delete\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}delete\_\-object (\$ {\em args})}} +\label{module__glue_8inc_8php_51fdb1d1ff829d6d2d79a9f852b7e0ef} + + +delete an object from the content directory + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_f11541a6869804225793b82e54fa09fe}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!delete\_\-page@{delete\_\-page}} +\index{delete\_\-page@{delete\_\-page}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{delete\_\-page}]{\setlength{\rightskip}{0pt plus 5cm}delete\_\-page (\$ {\em args})}} +\label{module__glue_8inc_8php_f11541a6869804225793b82e54fa09fe} + + +delete a page + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'page' is the page (i.e. page.rev) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_a4865d52ac449f8aaadb3a5d425f2efb}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!delete\_\-upload@{delete\_\-upload}} +\index{delete\_\-upload@{delete\_\-upload}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{delete\_\-upload}]{\setlength{\rightskip}{0pt plus 5cm}delete\_\-upload (\$ {\em args})}} +\label{module__glue_8inc_8php_a4865d52ac449f8aaadb3a5d425f2efb} + + +delete a file in the shared directory of a page + +this function only deletes the file when there are no references to it left. this is not meant to be called directly from the frontend, but modules should use it when implementing delete\_\-object. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'max\_\-cnt' delete the file if there are $<$= max\_\-cnt references (defaults to zero) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response true if the file got deleted for good, false if not \end{Desc} +\hypertarget{module__glue_8inc_8php_9b741f04b878cbc03f1aac7d3406d548}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!glue\_\-module\_\-info@{glue\_\-module\_\-info}} +\index{glue\_\-module\_\-info@{glue\_\-module\_\-info}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{glue\_\-module\_\-info}]{\setlength{\rightskip}{0pt plus 5cm}glue\_\-module\_\-info ()}} +\label{module__glue_8inc_8php_9b741f04b878cbc03f1aac7d3406d548} + + +\hypertarget{module__glue_8inc_8php_c6b5ed5ff055ccb4d07ad17cf78d5a11}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!load\_\-object@{load\_\-object}} +\index{load\_\-object@{load\_\-object}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{load\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}load\_\-object (\$ {\em args})}} +\label{module__glue_8inc_8php_c6b5ed5ff055ccb4d07ad17cf78d5a11} + + +load an object from the content directory + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_a9618d306b7ee5bd9e5d6a0be268ed44}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!object\_\-get\_\-symlink@{object\_\-get\_\-symlink}} +\index{object\_\-get\_\-symlink@{object\_\-get\_\-symlink}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{object\_\-get\_\-symlink}]{\setlength{\rightskip}{0pt plus 5cm}object\_\-get\_\-symlink (\$ {\em args})}} +\label{module__glue_8inc_8php_a9618d306b7ee5bd9e5d6a0be268ed44} + + +return the target of an object symlink + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response key 'data' either has the target as object name, an empty string if the target is outside the content directory or false if the object is no symlink \end{Desc} +\hypertarget{module__glue_8inc_8php_14e6da411df5aa9ff38e2d4ea27dd077}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!object\_\-make\_\-symlink@{object\_\-make\_\-symlink}} +\index{object\_\-make\_\-symlink@{object\_\-make\_\-symlink}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{object\_\-make\_\-symlink}]{\setlength{\rightskip}{0pt plus 5cm}object\_\-make\_\-symlink (\$ {\em args})}} +\label{module__glue_8inc_8php_14e6da411df5aa9ff38e2d4ea27dd077} + + +create a symlink pointing to an object in all other pagename's head revisions + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) \item[{\em array}]response \end{description} +\end{Desc} +\hypertarget{module__glue_8inc_8php_e16d748c2d933978daec8bf11acdc34b}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!object\_\-remove\_\-attr@{object\_\-remove\_\-attr}} +\index{object\_\-remove\_\-attr@{object\_\-remove\_\-attr}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{object\_\-remove\_\-attr}]{\setlength{\rightskip}{0pt plus 5cm}object\_\-remove\_\-attr (\$ {\em args})}} +\label{module__glue_8inc_8php_e16d748c2d933978daec8bf11acdc34b} + + +remove one or more attributes from an object in the content directory + +this function takes the object lock. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'attr' is either a string or an array containing the attribute names (keys) to remove \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_354fc85f928484ae3b316bbf0065d9bd}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!pagenames@{pagenames}} +\index{pagenames@{pagenames}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{pagenames}]{\setlength{\rightskip}{0pt plus 5cm}pagenames (\$ {\em args})}} +\label{module__glue_8inc_8php_354fc85f928484ae3b316bbf0065d9bd} + + +return an array of all pagenames in the content directory + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args unused \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_cd08b36587528b6f088cafb7d1d6bd29}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!rename\_\-page@{rename\_\-page}} +\index{rename\_\-page@{rename\_\-page}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{rename\_\-page}]{\setlength{\rightskip}{0pt plus 5cm}rename\_\-page (\$ {\em args})}} +\label{module__glue_8inc_8php_cd08b36587528b6f088cafb7d1d6bd29} + + +rename a page \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'old' old page (i.e. page1.rev) key 'new' new page (i.e. page2.rev) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_e9103a74e4b40e88536fbc0a52d1c72f}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!render\_\-object@{render\_\-object}} +\index{render\_\-object@{render\_\-object}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{render\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}render\_\-object (\$ {\em args})}} +\label{module__glue_8inc_8php_e9103a74e4b40e88536fbc0a52d1c72f} + + +turn an object into an html string + +the function also appends the resulting string to the output in \hyperlink{html_8inc_8php}{html.inc.php}. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments string 'name' is the object name (i.e. page.rev.obj) bool 'edit' are we editing or not \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response html \end{Desc} +\hypertarget{module__glue_8inc_8php_ab1981a767de519c6c4afb946d748d0a}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!render\_\-page@{render\_\-page}} +\index{render\_\-page@{render\_\-page}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{render\_\-page}]{\setlength{\rightskip}{0pt plus 5cm}render\_\-page (\$ {\em args})}} +\label{module__glue_8inc_8php_ab1981a767de519c6c4afb946d748d0a} + + +turn a page into an html string + +the function also appends the resulting string to the output in \hyperlink{html_8inc_8php}{html.inc.php}. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'page' is the page (i.e. page.rev) key 'edit' are we editing or not \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response html \end{Desc} +\hypertarget{module__glue_8inc_8php_e69e25beb40feedc02d3b850587d20cc}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!revert@{revert}} +\index{revert@{revert}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{revert}]{\setlength{\rightskip}{0pt plus 5cm}revert (\$ {\em args})}} +\label{module__glue_8inc_8php_e69e25beb40feedc02d3b850587d20cc} + + +revert to a specific revision of a page + +this function makes the revision the page's new head revision by copying it. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'page' page to revert to (i.e. page.rev) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_27d90d2ed1b4142554bc4e0e47e9ba0c}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!revisions@{revisions}} +\index{revisions@{revisions}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{revisions}]{\setlength{\rightskip}{0pt plus 5cm}revisions (\$ {\em args})}} +\label{module__glue_8inc_8php_27d90d2ed1b4142554bc4e0e47e9ba0c} + + +return an array of all revisions of a page + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'pagename' is the pagename (i.e. page) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_1dc65b69a920ac4ebc8f7c1df305060b}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!revisions\_\-info@{revisions\_\-info}} +\index{revisions\_\-info@{revisions\_\-info}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{revisions\_\-info}]{\setlength{\rightskip}{0pt plus 5cm}revisions\_\-info (\$ {\em args})}} +\label{module__glue_8inc_8php_1dc65b69a920ac4ebc8f7c1df305060b} + + +return an array with informations about all revisions of a page + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'pagename' is the pagename (i.e. page) key 'sort' can be either 'time' (descending) or 'name' (ascending, the default) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_b294f21c7f6fed0932b65167f180c78c}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!save\_\-object@{save\_\-object}} +\index{save\_\-object@{save\_\-object}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{save\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}save\_\-object (\$ {\em args})}} +\label{module__glue_8inc_8php_b294f21c7f6fed0932b65167f180c78c} + + +save an object to the content directory + +use \hyperlink{module__glue_8inc_8php_4aed316adcde13b40c9fc1b35e6537a4}{update\_\-object()} whenever possible as we want to preserve any object metadata that is stored in as attributes. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_60d03d7a0d8783e926835f0aa6cff698}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!save\_\-state@{save\_\-state}} +\index{save\_\-state@{save\_\-state}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{save\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}save\_\-state (\$ {\em args})}} +\label{module__glue_8inc_8php_60d03d7a0d8783e926835f0aa6cff698} + + +save the state of a html element corresponding to an object to disk + +this function takes the object lock. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'html' one html element \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response true if successful \end{Desc} +\hypertarget{module__glue_8inc_8php_afa7a8fa046ff6119cb7506d68edf787}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!set\_\-startpage@{set\_\-startpage}} +\index{set\_\-startpage@{set\_\-startpage}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{set\_\-startpage}]{\setlength{\rightskip}{0pt plus 5cm}set\_\-startpage (\$ {\em args})}} +\label{module__glue_8inc_8php_afa7a8fa046ff6119cb7506d68edf787} + + +set the startpage + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'page' is the page (i.e. page.rev) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response true if successful \end{Desc} +\hypertarget{module__glue_8inc_8php_5d3ad02088eee566589cd47fe0dc889a}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!snapshot@{snapshot}} +\index{snapshot@{snapshot}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{snapshot}]{\setlength{\rightskip}{0pt plus 5cm}snapshot (\$ {\em args})}} +\label{module__glue_8inc_8php_5d3ad02088eee566589cd47fe0dc889a} + + +create a snapshot from a page + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'page' page to shapshot (i.e. page.rev) key 'rev' (optional) new revision name (i.e. rev2) (if empty or not set a revision starting with 'auto-' and the current date will be created) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response (holding the page of the newly created revision if successful) \end{Desc} +\hypertarget{module__glue_8inc_8php_4aed316adcde13b40c9fc1b35e6537a4}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!update\_\-object@{update\_\-object}} +\index{update\_\-object@{update\_\-object}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{update\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}update\_\-object (\$ {\em args})}} +\label{module__glue_8inc_8php_4aed316adcde13b40c9fc1b35e6537a4} + + +update an object + +this function merges the attributes in \$args with the object already on disk. the object need not exist before, though. this function takes the object lock. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' is the object name (i.e. page.rev.obj) key 'content' is the object's content all other key/value pairs are treated as attributes \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response \end{Desc} +\hypertarget{module__glue_8inc_8php_43746135e67f614d79317029aced064b}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!upload\_\-files@{upload\_\-files}} +\index{upload\_\-files@{upload\_\-files}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{upload\_\-files}]{\setlength{\rightskip}{0pt plus 5cm}upload\_\-files (\$ {\em args})}} +\label{module__glue_8inc_8php_43746135e67f614d79317029aced064b} + + +\hypertarget{module__glue_8inc_8php_2099347b9bdf5a5973a13e5f7a4be933}{ +\index{module\_\-glue.inc.php@{module\_\-glue.inc.php}!upload\_\-references@{upload\_\-references}} +\index{upload\_\-references@{upload\_\-references}!module_glue.inc.php@{module\_\-glue.inc.php}} +\subsubsection[{upload\_\-references}]{\setlength{\rightskip}{0pt plus 5cm}upload\_\-references (\$ {\em args})}} +\label{module__glue_8inc_8php_2099347b9bdf5a5973a13e5f7a4be933} + + +list all objects referencing a certain file in the shared directory + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'pagename' is the pagename (i.e. page) key 'file' filename of file in the shared directory key 'stop\_\-after' n references \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response array of objects (i.e. page.rev.obj) \end{Desc} diff --git a/doc/latex/module__iframe_8inc_8php.tex b/doc/latex/module__iframe_8inc_8php.tex new file mode 100644 index 0000000..67be0f9 --- /dev/null +++ b/doc/latex/module__iframe_8inc_8php.tex @@ -0,0 +1,39 @@ +\hypertarget{module__iframe_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-iframe.inc.php File Reference} +\label{module__iframe_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-iframe.inc.php@{/srv/www/sukzessiv.net/h/module\_\-iframe.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__iframe_8inc_8php_40856482f79fb837bc538e8eed66aff4}{iframe\_\-render\_\-object} (\$args) +\item +\hyperlink{module__iframe_8inc_8php_d4d8fd8256a19beb570193c2886659e5}{iframe\_\-render\_\-page\_\-early} (\$args) +\item +\hyperlink{module__iframe_8inc_8php_3034fcc475334b511b91932918fcfe57}{iframe\_\-save\_\-state} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__iframe_8inc_8php_40856482f79fb837bc538e8eed66aff4}{ +\index{module\_\-iframe.inc.php@{module\_\-iframe.inc.php}!iframe\_\-render\_\-object@{iframe\_\-render\_\-object}} +\index{iframe\_\-render\_\-object@{iframe\_\-render\_\-object}!module_iframe.inc.php@{module\_\-iframe.inc.php}} +\subsubsection[{iframe\_\-render\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}iframe\_\-render\_\-object (\$ {\em args})}} +\label{module__iframe_8inc_8php_40856482f79fb837bc538e8eed66aff4} + + +\hyperlink{module__iframe_8inc_8php}{module\_\-iframe.inc.php} Module for embedding iframe elements + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__iframe_8inc_8php_d4d8fd8256a19beb570193c2886659e5}{ +\index{module\_\-iframe.inc.php@{module\_\-iframe.inc.php}!iframe\_\-render\_\-page\_\-early@{iframe\_\-render\_\-page\_\-early}} +\index{iframe\_\-render\_\-page\_\-early@{iframe\_\-render\_\-page\_\-early}!module_iframe.inc.php@{module\_\-iframe.inc.php}} +\subsubsection[{iframe\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}iframe\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__iframe_8inc_8php_d4d8fd8256a19beb570193c2886659e5} + + +\hypertarget{module__iframe_8inc_8php_3034fcc475334b511b91932918fcfe57}{ +\index{module\_\-iframe.inc.php@{module\_\-iframe.inc.php}!iframe\_\-save\_\-state@{iframe\_\-save\_\-state}} +\index{iframe\_\-save\_\-state@{iframe\_\-save\_\-state}!module_iframe.inc.php@{module\_\-iframe.inc.php}} +\subsubsection[{iframe\_\-save\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}iframe\_\-save\_\-state (\$ {\em args})}} +\label{module__iframe_8inc_8php_3034fcc475334b511b91932918fcfe57} + + diff --git a/doc/latex/module__image_8inc_8php.tex b/doc/latex/module__image_8inc_8php.tex new file mode 100644 index 0000000..861c7b6 --- /dev/null +++ b/doc/latex/module__image_8inc_8php.tex @@ -0,0 +1,125 @@ +\hypertarget{module__image_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-image.inc.php File Reference} +\label{module__image_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-image.inc.php@{/srv/www/sukzessiv.net/h/module\_\-image.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__image_8inc_8php_574d6d760e50b88ffa815cab30a5e634}{\_\-gd\_\-available} () +\item +\hyperlink{module__image_8inc_8php_3c76028c34273e722c9691243377a208}{\_\-gd\_\-get\_\-imagesize} (\$f) +\item +\hyperlink{module__image_8inc_8php_7cbcf6138ccff16a8b733cfd6f0f1666}{image\_\-delete\_\-object} (\$args) +\item +\hyperlink{module__image_8inc_8php_0bef6164f5eafe368d251639cf6fe298}{image\_\-has\_\-reference} (\$args) +\item +\hyperlink{module__image_8inc_8php_4fadded2a225d1b5ea73404a84597620}{image\_\-render\_\-object} (\$args) +\item +\hyperlink{module__image_8inc_8php_8266a74a11a86a73e2aa3709388fd43f}{image\_\-render\_\-page\_\-early} (\$args) +\item +\hyperlink{module__image_8inc_8php_9e03a71310133176236ae0bd4a0241e0}{image\_\-resize} (\$args) +\item +\hyperlink{module__image_8inc_8php_c26ea1448f0b7ed835907cf7c22b60ca}{image\_\-save\_\-state} (\$args) +\item +\hyperlink{module__image_8inc_8php_bb6646bfaa6a012e620cdaaa0bc3c807}{image\_\-serve\_\-resource} (\$args) +\item +\hyperlink{module__image_8inc_8php_37dee9de60e2852c0631d8e60e58585c}{image\_\-upload} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__image_8inc_8php_574d6d760e50b88ffa815cab30a5e634}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!\_\-gd\_\-available@{\_\-gd\_\-available}} +\index{\_\-gd\_\-available@{\_\-gd\_\-available}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{\_\-gd\_\-available}]{\setlength{\rightskip}{0pt plus 5cm}\_\-gd\_\-available ()}} +\label{module__image_8inc_8php_574d6d760e50b88ffa815cab30a5e634} + + +\hyperlink{module__image_8inc_8php}{module\_\-image.inc.php} Module for displaying images uploaded by the user + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. return if GD image functions are available + +\begin{Desc} +\item[Returns:]bool \end{Desc} +\hypertarget{module__image_8inc_8php_3c76028c34273e722c9691243377a208}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!\_\-gd\_\-get\_\-imagesize@{\_\-gd\_\-get\_\-imagesize}} +\index{\_\-gd\_\-get\_\-imagesize@{\_\-gd\_\-get\_\-imagesize}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{\_\-gd\_\-get\_\-imagesize}]{\setlength{\rightskip}{0pt plus 5cm}\_\-gd\_\-get\_\-imagesize (\$ {\em f})}} +\label{module__image_8inc_8php_3c76028c34273e722c9691243377a208} + + +return the width and height of an image file + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$f filename\end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array with width and height in pixels \end{Desc} +\hypertarget{module__image_8inc_8php_7cbcf6138ccff16a8b733cfd6f0f1666}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!image\_\-delete\_\-object@{image\_\-delete\_\-object}} +\index{image\_\-delete\_\-object@{image\_\-delete\_\-object}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{image\_\-delete\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}image\_\-delete\_\-object (\$ {\em args})}} +\label{module__image_8inc_8php_7cbcf6138ccff16a8b733cfd6f0f1666} + + +implements delete\_\-object \hypertarget{module__image_8inc_8php_0bef6164f5eafe368d251639cf6fe298}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!image\_\-has\_\-reference@{image\_\-has\_\-reference}} +\index{image\_\-has\_\-reference@{image\_\-has\_\-reference}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{image\_\-has\_\-reference}]{\setlength{\rightskip}{0pt plus 5cm}image\_\-has\_\-reference (\$ {\em args})}} +\label{module__image_8inc_8php_0bef6164f5eafe368d251639cf6fe298} + + +implements has\_\-reference \hypertarget{module__image_8inc_8php_4fadded2a225d1b5ea73404a84597620}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!image\_\-render\_\-object@{image\_\-render\_\-object}} +\index{image\_\-render\_\-object@{image\_\-render\_\-object}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{image\_\-render\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}image\_\-render\_\-object (\$ {\em args})}} +\label{module__image_8inc_8php_4fadded2a225d1b5ea73404a84597620} + + +implements render\_\-object \hypertarget{module__image_8inc_8php_8266a74a11a86a73e2aa3709388fd43f}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!image\_\-render\_\-page\_\-early@{image\_\-render\_\-page\_\-early}} +\index{image\_\-render\_\-page\_\-early@{image\_\-render\_\-page\_\-early}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{image\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}image\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__image_8inc_8php_8266a74a11a86a73e2aa3709388fd43f} + + +implements render\_\-page\_\-early \hypertarget{module__image_8inc_8php_9e03a71310133176236ae0bd4a0241e0}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!image\_\-resize@{image\_\-resize}} +\index{image\_\-resize@{image\_\-resize}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{image\_\-resize}]{\setlength{\rightskip}{0pt plus 5cm}image\_\-resize (\$ {\em args})}} +\label{module__image_8inc_8php_9e03a71310133176236ae0bd4a0241e0} + + +resize an image object + +this function drops the reference to any currently resized version, saves the resized image together with the original image in the page's shared folder and updates the object file to use the resized version. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$args arguments key 'name' name of the objects key 'width' width in px key 'height' height in px \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array response true if the client is advised to reload the image, false if not \end{Desc} +\hypertarget{module__image_8inc_8php_c26ea1448f0b7ed835907cf7c22b60ca}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!image\_\-save\_\-state@{image\_\-save\_\-state}} +\index{image\_\-save\_\-state@{image\_\-save\_\-state}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{image\_\-save\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}image\_\-save\_\-state (\$ {\em args})}} +\label{module__image_8inc_8php_c26ea1448f0b7ed835907cf7c22b60ca} + + +implements save\_\-state \hypertarget{module__image_8inc_8php_bb6646bfaa6a012e620cdaaa0bc3c807}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!image\_\-serve\_\-resource@{image\_\-serve\_\-resource}} +\index{image\_\-serve\_\-resource@{image\_\-serve\_\-resource}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{image\_\-serve\_\-resource}]{\setlength{\rightskip}{0pt plus 5cm}image\_\-serve\_\-resource (\$ {\em args})}} +\label{module__image_8inc_8php_bb6646bfaa6a012e620cdaaa0bc3c807} + + +implements serve\_\-resource \hypertarget{module__image_8inc_8php_37dee9de60e2852c0631d8e60e58585c}{ +\index{module\_\-image.inc.php@{module\_\-image.inc.php}!image\_\-upload@{image\_\-upload}} +\index{image\_\-upload@{image\_\-upload}!module_image.inc.php@{module\_\-image.inc.php}} +\subsubsection[{image\_\-upload}]{\setlength{\rightskip}{0pt plus 5cm}image\_\-upload (\$ {\em args})}} +\label{module__image_8inc_8php_37dee9de60e2852c0631d8e60e58585c} + + +implements upload \ No newline at end of file diff --git a/doc/latex/module__object_8inc_8php.tex b/doc/latex/module__object_8inc_8php.tex new file mode 100644 index 0000000..13db12b --- /dev/null +++ b/doc/latex/module__object_8inc_8php.tex @@ -0,0 +1,48 @@ +\hypertarget{module__object_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-object.inc.php File Reference} +\label{module__object_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-object.inc.php@{/srv/www/sukzessiv.net/h/module\_\-object.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__object_8inc_8php_6acc3273ff9872e01527162375d318d8}{object\_\-alter\_\-render\_\-early} (\$args) +\item +\hyperlink{module__object_8inc_8php_6b5bf16a15b7d5809bd7c6d15cd05a52}{object\_\-alter\_\-render\_\-late} (\$args) +\item +\hyperlink{module__object_8inc_8php_ba3a00b339dc7e9831b48a94f4f8e211}{object\_\-alter\_\-save} (\$args) +\item +\hyperlink{module__object_8inc_8php_d06c13f1778d655f4a011d1763c6e618}{object\_\-render\_\-page\_\-early} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__object_8inc_8php_6acc3273ff9872e01527162375d318d8}{ +\index{module\_\-object.inc.php@{module\_\-object.inc.php}!object\_\-alter\_\-render\_\-early@{object\_\-alter\_\-render\_\-early}} +\index{object\_\-alter\_\-render\_\-early@{object\_\-alter\_\-render\_\-early}!module_object.inc.php@{module\_\-object.inc.php}} +\subsubsection[{object\_\-alter\_\-render\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}object\_\-alter\_\-render\_\-early (\$ {\em args})}} +\label{module__object_8inc_8php_6acc3273ff9872e01527162375d318d8} + + +\hyperlink{module__object_8inc_8php}{module\_\-object.inc.php} Module for handling general object properties + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__object_8inc_8php_6b5bf16a15b7d5809bd7c6d15cd05a52}{ +\index{module\_\-object.inc.php@{module\_\-object.inc.php}!object\_\-alter\_\-render\_\-late@{object\_\-alter\_\-render\_\-late}} +\index{object\_\-alter\_\-render\_\-late@{object\_\-alter\_\-render\_\-late}!module_object.inc.php@{module\_\-object.inc.php}} +\subsubsection[{object\_\-alter\_\-render\_\-late}]{\setlength{\rightskip}{0pt plus 5cm}object\_\-alter\_\-render\_\-late (\$ {\em args})}} +\label{module__object_8inc_8php_6b5bf16a15b7d5809bd7c6d15cd05a52} + + +\hypertarget{module__object_8inc_8php_ba3a00b339dc7e9831b48a94f4f8e211}{ +\index{module\_\-object.inc.php@{module\_\-object.inc.php}!object\_\-alter\_\-save@{object\_\-alter\_\-save}} +\index{object\_\-alter\_\-save@{object\_\-alter\_\-save}!module_object.inc.php@{module\_\-object.inc.php}} +\subsubsection[{object\_\-alter\_\-save}]{\setlength{\rightskip}{0pt plus 5cm}object\_\-alter\_\-save (\$ {\em args})}} +\label{module__object_8inc_8php_ba3a00b339dc7e9831b48a94f4f8e211} + + +\hypertarget{module__object_8inc_8php_d06c13f1778d655f4a011d1763c6e618}{ +\index{module\_\-object.inc.php@{module\_\-object.inc.php}!object\_\-render\_\-page\_\-early@{object\_\-render\_\-page\_\-early}} +\index{object\_\-render\_\-page\_\-early@{object\_\-render\_\-page\_\-early}!module_object.inc.php@{module\_\-object.inc.php}} +\subsubsection[{object\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}object\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__object_8inc_8php_d06c13f1778d655f4a011d1763c6e618} + + diff --git a/doc/latex/module__page_8inc_8php.tex b/doc/latex/module__page_8inc_8php.tex new file mode 100644 index 0000000..5b848f3 --- /dev/null +++ b/doc/latex/module__page_8inc_8php.tex @@ -0,0 +1,30 @@ +\hypertarget{module__page_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-page.inc.php File Reference} +\label{module__page_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-page.inc.php@{/srv/www/sukzessiv.net/h/module\_\-page.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__page_8inc_8php_53e7091b9a654d0d772cea6e3127820e}{page\_\-render\_\-object} (\$args) +\item +\hyperlink{module__page_8inc_8php_80aff2ea069c7a2ba120e26bb218efa5}{page\_\-render\_\-page\_\-early} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__page_8inc_8php_53e7091b9a654d0d772cea6e3127820e}{ +\index{module\_\-page.inc.php@{module\_\-page.inc.php}!page\_\-render\_\-object@{page\_\-render\_\-object}} +\index{page\_\-render\_\-object@{page\_\-render\_\-object}!module_page.inc.php@{module\_\-page.inc.php}} +\subsubsection[{page\_\-render\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}page\_\-render\_\-object (\$ {\em args})}} +\label{module__page_8inc_8php_53e7091b9a654d0d772cea6e3127820e} + + +\hyperlink{module__page_8inc_8php}{module\_\-page.inc.php} Module for managing pages + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__page_8inc_8php_80aff2ea069c7a2ba120e26bb218efa5}{ +\index{module\_\-page.inc.php@{module\_\-page.inc.php}!page\_\-render\_\-page\_\-early@{page\_\-render\_\-page\_\-early}} +\index{page\_\-render\_\-page\_\-early@{page\_\-render\_\-page\_\-early}!module_page.inc.php@{module\_\-page.inc.php}} +\subsubsection[{page\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}page\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__page_8inc_8php_80aff2ea069c7a2ba120e26bb218efa5} + + diff --git a/doc/latex/module__page__browser_8inc_8php.tex b/doc/latex/module__page__browser_8inc_8php.tex new file mode 100644 index 0000000..1b83ccd --- /dev/null +++ b/doc/latex/module__page__browser_8inc_8php.tex @@ -0,0 +1,30 @@ +\hypertarget{module__page__browser_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-page\_\-browser.inc.php File Reference} +\label{module__page__browser_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-page\_\-browser.inc.php@{/srv/www/sukzessiv.net/h/module\_\-page\_\-browser.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__page__browser_8inc_8php_7e937f92734b69829f9d3ab5e00f14e0}{controller\_\-pages} (\$args) +\item +\hyperlink{module__page__browser_8inc_8php_a94d17bbea100ee50f09c7bf4094a1db}{page\_\-browser\_\-render\_\-page\_\-early} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__page__browser_8inc_8php_7e937f92734b69829f9d3ab5e00f14e0}{ +\index{module\_\-page\_\-browser.inc.php@{module\_\-page\_\-browser.inc.php}!controller\_\-pages@{controller\_\-pages}} +\index{controller\_\-pages@{controller\_\-pages}!module_page_browser.inc.php@{module\_\-page\_\-browser.inc.php}} +\subsubsection[{controller\_\-pages}]{\setlength{\rightskip}{0pt plus 5cm}controller\_\-pages (\$ {\em args})}} +\label{module__page__browser_8inc_8php_7e937f92734b69829f9d3ab5e00f14e0} + + +\hyperlink{module__page__browser_8inc_8php}{module\_\-page\_\-browser.inc.php} Module for listing and managing all available pages + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__page__browser_8inc_8php_a94d17bbea100ee50f09c7bf4094a1db}{ +\index{module\_\-page\_\-browser.inc.php@{module\_\-page\_\-browser.inc.php}!page\_\-browser\_\-render\_\-page\_\-early@{page\_\-browser\_\-render\_\-page\_\-early}} +\index{page\_\-browser\_\-render\_\-page\_\-early@{page\_\-browser\_\-render\_\-page\_\-early}!module_page_browser.inc.php@{module\_\-page\_\-browser.inc.php}} +\subsubsection[{page\_\-browser\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}page\_\-browser\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__page__browser_8inc_8php_a94d17bbea100ee50f09c7bf4094a1db} + + diff --git a/doc/latex/module__revisions__browser_8inc_8php.tex b/doc/latex/module__revisions__browser_8inc_8php.tex new file mode 100644 index 0000000..836b207 --- /dev/null +++ b/doc/latex/module__revisions__browser_8inc_8php.tex @@ -0,0 +1,30 @@ +\hypertarget{module__revisions__browser_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-revisions\_\-browser.inc.php File Reference} +\label{module__revisions__browser_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-revisions\_\-browser.inc.php@{/srv/www/sukzessiv.net/h/module\_\-revisions\_\-browser.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__revisions__browser_8inc_8php_9eda010871ad706aca87cfd7b9dd0f7d}{controller\_\-revisions} (\$args) +\item +\hyperlink{module__revisions__browser_8inc_8php_eb482f35141c71dd933daeec9e9ce599}{revisions\_\-browser\_\-render\_\-page\_\-early} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__revisions__browser_8inc_8php_9eda010871ad706aca87cfd7b9dd0f7d}{ +\index{module\_\-revisions\_\-browser.inc.php@{module\_\-revisions\_\-browser.inc.php}!controller\_\-revisions@{controller\_\-revisions}} +\index{controller\_\-revisions@{controller\_\-revisions}!module_revisions_browser.inc.php@{module\_\-revisions\_\-browser.inc.php}} +\subsubsection[{controller\_\-revisions}]{\setlength{\rightskip}{0pt plus 5cm}controller\_\-revisions (\$ {\em args})}} +\label{module__revisions__browser_8inc_8php_9eda010871ad706aca87cfd7b9dd0f7d} + + +\hyperlink{module__revisions__browser_8inc_8php}{module\_\-revisions\_\-browser.inc.php} Module for browsing through revisions of a page + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__revisions__browser_8inc_8php_eb482f35141c71dd933daeec9e9ce599}{ +\index{module\_\-revisions\_\-browser.inc.php@{module\_\-revisions\_\-browser.inc.php}!revisions\_\-browser\_\-render\_\-page\_\-early@{revisions\_\-browser\_\-render\_\-page\_\-early}} +\index{revisions\_\-browser\_\-render\_\-page\_\-early@{revisions\_\-browser\_\-render\_\-page\_\-early}!module_revisions_browser.inc.php@{module\_\-revisions\_\-browser.inc.php}} +\subsubsection[{revisions\_\-browser\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}revisions\_\-browser\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__revisions__browser_8inc_8php_eb482f35141c71dd933daeec9e9ce599} + + diff --git a/doc/latex/module__text_8inc_8php.tex b/doc/latex/module__text_8inc_8php.tex new file mode 100644 index 0000000..1c921da --- /dev/null +++ b/doc/latex/module__text_8inc_8php.tex @@ -0,0 +1,48 @@ +\hypertarget{module__text_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-text.inc.php File Reference} +\label{module__text_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-text.inc.php@{/srv/www/sukzessiv.net/h/module\_\-text.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__text_8inc_8php_0586b5e177a15f5904d49b8b3aaf19ee}{\_\-text\_\-render\_\-content} (\$s, \$name) +\item +\hyperlink{module__text_8inc_8php_8e9b1db22ff6cb0f3d20815da6aae6ce}{text\_\-render\_\-object} (\$args) +\item +\hyperlink{module__text_8inc_8php_aaa8b8407d795f6dba9d258f1457ade8}{text\_\-render\_\-page\_\-early} (\$args) +\item +\hyperlink{module__text_8inc_8php_7fa0ea2ee517914595d7eda355177289}{text\_\-save\_\-state} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__text_8inc_8php_0586b5e177a15f5904d49b8b3aaf19ee}{ +\index{module\_\-text.inc.php@{module\_\-text.inc.php}!\_\-text\_\-render\_\-content@{\_\-text\_\-render\_\-content}} +\index{\_\-text\_\-render\_\-content@{\_\-text\_\-render\_\-content}!module_text.inc.php@{module\_\-text.inc.php}} +\subsubsection[{\_\-text\_\-render\_\-content}]{\setlength{\rightskip}{0pt plus 5cm}\_\-text\_\-render\_\-content (\$ {\em s}, \/ \$ {\em name})}} +\label{module__text_8inc_8php_0586b5e177a15f5904d49b8b3aaf19ee} + + +\hyperlink{module__text_8inc_8php}{module\_\-text.inc.php} Module for placing text elements on a page + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__text_8inc_8php_8e9b1db22ff6cb0f3d20815da6aae6ce}{ +\index{module\_\-text.inc.php@{module\_\-text.inc.php}!text\_\-render\_\-object@{text\_\-render\_\-object}} +\index{text\_\-render\_\-object@{text\_\-render\_\-object}!module_text.inc.php@{module\_\-text.inc.php}} +\subsubsection[{text\_\-render\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}text\_\-render\_\-object (\$ {\em args})}} +\label{module__text_8inc_8php_8e9b1db22ff6cb0f3d20815da6aae6ce} + + +\hypertarget{module__text_8inc_8php_aaa8b8407d795f6dba9d258f1457ade8}{ +\index{module\_\-text.inc.php@{module\_\-text.inc.php}!text\_\-render\_\-page\_\-early@{text\_\-render\_\-page\_\-early}} +\index{text\_\-render\_\-page\_\-early@{text\_\-render\_\-page\_\-early}!module_text.inc.php@{module\_\-text.inc.php}} +\subsubsection[{text\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}text\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__text_8inc_8php_aaa8b8407d795f6dba9d258f1457ade8} + + +\hypertarget{module__text_8inc_8php_7fa0ea2ee517914595d7eda355177289}{ +\index{module\_\-text.inc.php@{module\_\-text.inc.php}!text\_\-save\_\-state@{text\_\-save\_\-state}} +\index{text\_\-save\_\-state@{text\_\-save\_\-state}!module_text.inc.php@{module\_\-text.inc.php}} +\subsubsection[{text\_\-save\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}text\_\-save\_\-state (\$ {\em args})}} +\label{module__text_8inc_8php_7fa0ea2ee517914595d7eda355177289} + + diff --git a/doc/latex/module__video_8inc_8php.tex b/doc/latex/module__video_8inc_8php.tex new file mode 100644 index 0000000..468a689 --- /dev/null +++ b/doc/latex/module__video_8inc_8php.tex @@ -0,0 +1,75 @@ +\hypertarget{module__video_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/module\_\-video.inc.php File Reference} +\label{module__video_8inc_8php}\index{/srv/www/sukzessiv.net/h/module\_\-video.inc.php@{/srv/www/sukzessiv.net/h/module\_\-video.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{module__video_8inc_8php_4d25a132251840ed2ade27b636a6694e}{video\_\-delete\_\-object} (\$args) +\item +\hyperlink{module__video_8inc_8php_dbbede5e492ca7b9457deaf076c887b0}{video\_\-has\_\-reference} (\$args) +\item +\hyperlink{module__video_8inc_8php_14d6bc200a41905ad201a24d9a2d9be5}{video\_\-render\_\-object} (\$args) +\item +\hyperlink{module__video_8inc_8php_223ac9bac4acfb2c9b458b43e45e06e3}{video\_\-render\_\-page\_\-early} (\$args) +\item +\hyperlink{module__video_8inc_8php_828b4f740b870b886936a22baf97418e}{video\_\-save\_\-state} (\$args) +\item +\hyperlink{module__video_8inc_8php_5af838d3c4206bbc9bc3b5e57b16655c}{video\_\-serve\_\-resource} (\$args) +\item +\hyperlink{module__video_8inc_8php_6ab50ffd184d8dcf84a9783dd6a2f80e}{video\_\-upload} (\$args) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{module__video_8inc_8php_4d25a132251840ed2ade27b636a6694e}{ +\index{module\_\-video.inc.php@{module\_\-video.inc.php}!video\_\-delete\_\-object@{video\_\-delete\_\-object}} +\index{video\_\-delete\_\-object@{video\_\-delete\_\-object}!module_video.inc.php@{module\_\-video.inc.php}} +\subsubsection[{video\_\-delete\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}video\_\-delete\_\-object (\$ {\em args})}} +\label{module__video_8inc_8php_4d25a132251840ed2ade27b636a6694e} + + +\hyperlink{module__video_8inc_8php}{module\_\-video.inc.php} Module for embedding video elements on a page + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. \hypertarget{module__video_8inc_8php_dbbede5e492ca7b9457deaf076c887b0}{ +\index{module\_\-video.inc.php@{module\_\-video.inc.php}!video\_\-has\_\-reference@{video\_\-has\_\-reference}} +\index{video\_\-has\_\-reference@{video\_\-has\_\-reference}!module_video.inc.php@{module\_\-video.inc.php}} +\subsubsection[{video\_\-has\_\-reference}]{\setlength{\rightskip}{0pt plus 5cm}video\_\-has\_\-reference (\$ {\em args})}} +\label{module__video_8inc_8php_dbbede5e492ca7b9457deaf076c887b0} + + +\hypertarget{module__video_8inc_8php_14d6bc200a41905ad201a24d9a2d9be5}{ +\index{module\_\-video.inc.php@{module\_\-video.inc.php}!video\_\-render\_\-object@{video\_\-render\_\-object}} +\index{video\_\-render\_\-object@{video\_\-render\_\-object}!module_video.inc.php@{module\_\-video.inc.php}} +\subsubsection[{video\_\-render\_\-object}]{\setlength{\rightskip}{0pt plus 5cm}video\_\-render\_\-object (\$ {\em args})}} +\label{module__video_8inc_8php_14d6bc200a41905ad201a24d9a2d9be5} + + +\hypertarget{module__video_8inc_8php_223ac9bac4acfb2c9b458b43e45e06e3}{ +\index{module\_\-video.inc.php@{module\_\-video.inc.php}!video\_\-render\_\-page\_\-early@{video\_\-render\_\-page\_\-early}} +\index{video\_\-render\_\-page\_\-early@{video\_\-render\_\-page\_\-early}!module_video.inc.php@{module\_\-video.inc.php}} +\subsubsection[{video\_\-render\_\-page\_\-early}]{\setlength{\rightskip}{0pt plus 5cm}video\_\-render\_\-page\_\-early (\$ {\em args})}} +\label{module__video_8inc_8php_223ac9bac4acfb2c9b458b43e45e06e3} + + +\hypertarget{module__video_8inc_8php_828b4f740b870b886936a22baf97418e}{ +\index{module\_\-video.inc.php@{module\_\-video.inc.php}!video\_\-save\_\-state@{video\_\-save\_\-state}} +\index{video\_\-save\_\-state@{video\_\-save\_\-state}!module_video.inc.php@{module\_\-video.inc.php}} +\subsubsection[{video\_\-save\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}video\_\-save\_\-state (\$ {\em args})}} +\label{module__video_8inc_8php_828b4f740b870b886936a22baf97418e} + + +\hypertarget{module__video_8inc_8php_5af838d3c4206bbc9bc3b5e57b16655c}{ +\index{module\_\-video.inc.php@{module\_\-video.inc.php}!video\_\-serve\_\-resource@{video\_\-serve\_\-resource}} +\index{video\_\-serve\_\-resource@{video\_\-serve\_\-resource}!module_video.inc.php@{module\_\-video.inc.php}} +\subsubsection[{video\_\-serve\_\-resource}]{\setlength{\rightskip}{0pt plus 5cm}video\_\-serve\_\-resource (\$ {\em args})}} +\label{module__video_8inc_8php_5af838d3c4206bbc9bc3b5e57b16655c} + + +\hypertarget{module__video_8inc_8php_6ab50ffd184d8dcf84a9783dd6a2f80e}{ +\index{module\_\-video.inc.php@{module\_\-video.inc.php}!video\_\-upload@{video\_\-upload}} +\index{video\_\-upload@{video\_\-upload}!module_video.inc.php@{module\_\-video.inc.php}} +\subsubsection[{video\_\-upload}]{\setlength{\rightskip}{0pt plus 5cm}video\_\-upload (\$ {\em args})}} +\label{module__video_8inc_8php_6ab50ffd184d8dcf84a9783dd6a2f80e} + + diff --git a/doc/latex/modules_8inc_8php.tex b/doc/latex/modules_8inc_8php.tex new file mode 100644 index 0000000..04906d1 --- /dev/null +++ b/doc/latex/modules_8inc_8php.tex @@ -0,0 +1,178 @@ +\hypertarget{modules_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/modules.inc.php File Reference} +\label{modules_8inc_8php}\index{/srv/www/sukzessiv.net/h/modules.inc.php@{/srv/www/sukzessiv.net/h/modules.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +if(!isset(\$hooks)) if(!isset(\$modules)) if(!isset(\$services)) \hyperlink{modules_8inc_8php_dcaa12e356133b7fa0670571698b38cc}{get\_\-hooks} () +\item +\hyperlink{modules_8inc_8php_1b73e435e11b07906d0781b146b4aa21}{get\_\-modules} () +\item +\hyperlink{modules_8inc_8php_bf7633223c2fd4ecb199a8e0dc070802}{get\_\-service} (\$service) +\item +\hyperlink{modules_8inc_8php_3318fb85bac26e6fb2397c6ea9f02322}{invoke\_\-hook} (\$hook, \$args=array()) +\item +\hyperlink{modules_8inc_8php_66473fc9f24153d85053f1f9c6ed83e4}{invoke\_\-hook\_\-while} (\$hook, \$while, \$args=array()) +\item +\hyperlink{modules_8inc_8php_23f8be02dc2148a3c860119a1d6ea276}{load\_\-modules} (\$search= '', \$optional=false) +\item +\hyperlink{modules_8inc_8php_e6ed600fb2ce39a4b0837bbb01fe8d6e}{register\_\-service} (\$service, \$func, \$args=array()) +\item +\hyperlink{modules_8inc_8php_d91a5f96df0655d782404170324e567d}{register\_\-hook} (\$hook, \$info= '') +\item +\hyperlink{modules_8inc_8php_361058ff2a03c098045c4442440a2574}{response} (\$data, \$error=false) +\item +\hyperlink{modules_8inc_8php_3d581f1636df2e24ffe7b013a12fb1db}{run\_\-service} (\$service, \$args=array()) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{modules_8inc_8php_dcaa12e356133b7fa0670571698b38cc}{ +\index{modules.inc.php@{modules.inc.php}!get\_\-hooks@{get\_\-hooks}} +\index{get\_\-hooks@{get\_\-hooks}!modules.inc.php@{modules.inc.php}} +\subsubsection[{get\_\-hooks}]{\setlength{\rightskip}{0pt plus 5cm}if (!isset(\$hooks)) if (!isset(\$modules)) if (!isset(\$services)) get\_\-hooks ()}} +\label{modules_8inc_8php_dcaa12e356133b7fa0670571698b38cc} + + +\hyperlink{modules_8inc_8php}{modules.inc.php} Generic modules and services infrastructure + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. get an array of all currently registered hooks + +\begin{Desc} +\item[Returns:]array \end{Desc} +\hypertarget{modules_8inc_8php_1b73e435e11b07906d0781b146b4aa21}{ +\index{modules.inc.php@{modules.inc.php}!get\_\-modules@{get\_\-modules}} +\index{get\_\-modules@{get\_\-modules}!modules.inc.php@{modules.inc.php}} +\subsubsection[{get\_\-modules}]{\setlength{\rightskip}{0pt plus 5cm}get\_\-modules ()}} +\label{modules_8inc_8php_1b73e435e11b07906d0781b146b4aa21} + + +get an array of all currently loaded modules + +\begin{Desc} +\item[Returns:]array \end{Desc} +\hypertarget{modules_8inc_8php_bf7633223c2fd4ecb199a8e0dc070802}{ +\index{modules.inc.php@{modules.inc.php}!get\_\-service@{get\_\-service}} +\index{get\_\-service@{get\_\-service}!modules.inc.php@{modules.inc.php}} +\subsubsection[{get\_\-service}]{\setlength{\rightskip}{0pt plus 5cm}get\_\-service (\$ {\em service})}} +\label{modules_8inc_8php_bf7633223c2fd4ecb199a8e0dc070802} + + +return a service-array + +call \hyperlink{modules_8inc_8php_23f8be02dc2148a3c860119a1d6ea276}{load\_\-modules()} before calling this function. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$service service name \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array or false if not found \end{Desc} +\hypertarget{modules_8inc_8php_3318fb85bac26e6fb2397c6ea9f02322}{ +\index{modules.inc.php@{modules.inc.php}!invoke\_\-hook@{invoke\_\-hook}} +\index{invoke\_\-hook@{invoke\_\-hook}!modules.inc.php@{modules.inc.php}} +\subsubsection[{invoke\_\-hook}]{\setlength{\rightskip}{0pt plus 5cm}invoke\_\-hook (\$ {\em hook}, \/ \$ {\em args} = {\tt array()})}} +\label{modules_8inc_8php_3318fb85bac26e6fb2397c6ea9f02322} + + +invoke a hook + +this function also takes care of loading all modules. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$hook hook to invoke \item[{\em array}]\$args arguments-array (can include references) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array of results (module=$>$result) \end{Desc} +\hypertarget{modules_8inc_8php_66473fc9f24153d85053f1f9c6ed83e4}{ +\index{modules.inc.php@{modules.inc.php}!invoke\_\-hook\_\-while@{invoke\_\-hook\_\-while}} +\index{invoke\_\-hook\_\-while@{invoke\_\-hook\_\-while}!modules.inc.php@{modules.inc.php}} +\subsubsection[{invoke\_\-hook\_\-while}]{\setlength{\rightskip}{0pt plus 5cm}invoke\_\-hook\_\-while (\$ {\em hook}, \/ \$ {\em while}, \/ \$ {\em args} = {\tt array()})}} +\label{modules_8inc_8php_66473fc9f24153d85053f1f9c6ed83e4} + + +invoke a hook while the returned result is \$while + +this function also takes care of loading all modules. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$hook hook to invoke \item[{\em mixed}]\$while value to compare the returned result with \item[{\em array}]\$args arguments-array \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array with result (module=$>$result) or empty result if there was none \end{Desc} +\hypertarget{modules_8inc_8php_23f8be02dc2148a3c860119a1d6ea276}{ +\index{modules.inc.php@{modules.inc.php}!load\_\-modules@{load\_\-modules}} +\index{load\_\-modules@{load\_\-modules}!modules.inc.php@{modules.inc.php}} +\subsubsection[{load\_\-modules}]{\setlength{\rightskip}{0pt plus 5cm}load\_\-modules (\$ {\em search} = {\tt ''}, \/ \$ {\em optional} = {\tt false})}} +\label{modules_8inc_8php_23f8be02dc2148a3c860119a1d6ea276} + + +load modules + +use this function instead of including module\_\-$\ast$ files directly. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$search module to load (by default all modules are loaded) \item[{\em bool}]\$optional whether to log any error to locate the module \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool true if successful, false if not \end{Desc} +\hypertarget{modules_8inc_8php_d91a5f96df0655d782404170324e567d}{ +\index{modules.inc.php@{modules.inc.php}!register\_\-hook@{register\_\-hook}} +\index{register\_\-hook@{register\_\-hook}!modules.inc.php@{modules.inc.php}} +\subsubsection[{register\_\-hook}]{\setlength{\rightskip}{0pt plus 5cm}register\_\-hook (\$ {\em hook}, \/ \$ {\em info} = {\tt ''})}} +\label{modules_8inc_8php_d91a5f96df0655d782404170324e567d} + + +register a hook + +this function is for information purposes only. you can also use a hook without registering it here. this is not recommended though. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$hook hook name \item[{\em string}]\$info some words on the hook's purpose \end{description} +\end{Desc} +\hypertarget{modules_8inc_8php_e6ed600fb2ce39a4b0837bbb01fe8d6e}{ +\index{modules.inc.php@{modules.inc.php}!register\_\-service@{register\_\-service}} +\index{register\_\-service@{register\_\-service}!modules.inc.php@{modules.inc.php}} +\subsubsection[{register\_\-service}]{\setlength{\rightskip}{0pt plus 5cm}register\_\-service (\$ {\em service}, \/ \$ {\em func}, \/ \$ {\em args} = {\tt array()})}} +\label{modules_8inc_8php_e6ed600fb2ce39a4b0837bbb01fe8d6e} + + +register a service + +you can specify the service's arguments in \$args\mbox{[}'args'\mbox{]}. see run\_\-services(). \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$service service name \item[{\em string}]\$func function name \item[{\em array}]\$args optional arguments \end{description} +\end{Desc} +\hypertarget{modules_8inc_8php_361058ff2a03c098045c4442440a2574}{ +\index{modules.inc.php@{modules.inc.php}!response@{response}} +\index{response@{response}!modules.inc.php@{modules.inc.php}} +\subsubsection[{response}]{\setlength{\rightskip}{0pt plus 5cm}response (\$ {\em data}, \/ \$ {\em error} = {\tt false})}} +\label{modules_8inc_8php_361058ff2a03c098045c4442440a2574} + + +return a response-array + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mixed}]\$data (payload) data (should be the error-message if \$error is true) \item[{\em mixed}]\$error error core or true if an error occurred \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array \end{Desc} +\hypertarget{modules_8inc_8php_3d581f1636df2e24ffe7b013a12fb1db}{ +\index{modules.inc.php@{modules.inc.php}!run\_\-service@{run\_\-service}} +\index{run\_\-service@{run\_\-service}!modules.inc.php@{modules.inc.php}} +\subsubsection[{run\_\-service}]{\setlength{\rightskip}{0pt plus 5cm}run\_\-service (\$ {\em service}, \/ \$ {\em args} = {\tt array()})}} +\label{modules_8inc_8php_3d581f1636df2e24ffe7b013a12fb1db} + + +run a service + +this function checks the arguments in \$args against the (optional) declaration given in \hyperlink{modules_8inc_8php_e6ed600fb2ce39a4b0837bbb01fe8d6e}{register\_\-service()}. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$service service name \item[{\em array}]\$args arguments-array \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]return value of the service function or a response-array in case of an error \end{Desc} diff --git a/doc/latex/refman.tex b/doc/latex/refman.tex new file mode 100644 index 0000000..bf057e6 --- /dev/null +++ b/doc/latex/refman.tex @@ -0,0 +1,73 @@ +\documentclass[a4paper]{book} +\usepackage{a4wide} +\usepackage{makeidx} +\usepackage{fancyhdr} +\usepackage{graphicx} +\usepackage{multicol} +\usepackage{float} +\usepackage{textcomp} +\usepackage{alltt} +\usepackage{times} +\usepackage{ifpdf} +\ifpdf +\usepackage[pdftex, + pagebackref=true, + colorlinks=true, + linkcolor=blue, + unicode + ]{hyperref} +\else +\usepackage[ps2pdf, + pagebackref=true, + colorlinks=true, + linkcolor=blue, + unicode + ]{hyperref} +\usepackage{pspicture} +\fi +\usepackage[utf8]{inputenc} +\usepackage{doxygen} +\makeindex +\setcounter{tocdepth}{3} +\renewcommand{\footrulewidth}{0.4pt} +\begin{document} +\begin{titlepage} +\vspace*{7cm} +\begin{center} +{\Large hotglue }\\ +\vspace*{1cm} +{\large Generated by Doxygen 1.5.8}\\ +\vspace*{0.5cm} +{\small Wed Dec 1 14:07:05 2010}\\ +\end{center} +\end{titlepage} +\clearemptydoublepage +\pagenumbering{roman} +\tableofcontents +\clearemptydoublepage +\pagenumbering{arabic} +\chapter{File Index} +\input{files} +\chapter{File Documentation} +\input{common_8inc_8php} +\include{config_8inc_8php} +\include{controller_8inc_8php} +\include{html_8inc_8php} +\include{html__parse_8inc_8php} +\include{index_8php} +\include{json_8php} +\include{log_8inc_8php} +\include{module__download_8inc_8php} +\include{module__glue_8inc_8php} +\include{module__iframe_8inc_8php} +\include{module__image_8inc_8php} +\include{module__object_8inc_8php} +\include{module__page_8inc_8php} +\include{module__page__browser_8inc_8php} +\include{module__revisions__browser_8inc_8php} +\include{module__text_8inc_8php} +\include{module__video_8inc_8php} +\include{modules_8inc_8php} +\include{util_8inc_8php} +\printindex +\end{document} diff --git a/doc/latex/util_8inc_8php.tex b/doc/latex/util_8inc_8php.tex new file mode 100644 index 0000000..5c4236c --- /dev/null +++ b/doc/latex/util_8inc_8php.tex @@ -0,0 +1,330 @@ +\hypertarget{util_8inc_8php}{ +\section{/srv/www/sukzessiv.net/h/util.inc.php File Reference} +\label{util_8inc_8php}\index{/srv/www/sukzessiv.net/h/util.inc.php@{/srv/www/sukzessiv.net/h/util.inc.php}} +} +\subsection*{Functions} +\begin{CompactItemize} +\item +\hyperlink{util_8inc_8php_61d3b2881d9368741c71509017724bc8}{array\_\-to\_\-js} (\$container) +\item +\hyperlink{util_8inc_8php_4647462c98447c6c2842f70d8c313f85}{array\_\-unique\_\-element} (\&\$a, \$key) +\item +\hyperlink{util_8inc_8php_6309f576f2611237288d0dd3eed09db3}{dir\_\-is\_\-different} (\$a, \$b) +\item +\hyperlink{util_8inc_8php_afce787d4b725ac62be6306ff3e352e7}{expl} (\$delimiter, \$string) +\item +\hyperlink{util_8inc_8php_1d2500a5e237e59956b03cbea845c95a}{expl\_\-whitesp} (\$s, \$honor\_\-quot=false) +\item +\hyperlink{util_8inc_8php_9c9a81ec9dba8b2870cbb365f8139866}{file\_\-is\_\-different} (\$a, \$b) +\item +\hyperlink{util_8inc_8php_6d9392e51344c2e8720a0c1982ebea21}{filext} (\$s) +\item +\hyperlink{util_8inc_8php_78288ca93c62ce2b5ef34f40352c7324}{http\_\-400} () +\item +\hyperlink{util_8inc_8php_24f09c2c8205022b013bbee5293a38ae}{http\_\-404} () +\item +\hyperlink{util_8inc_8php_575cc91d803ae46bbc5dfaecbeb3561d}{http\_\-500} () +\item +\hyperlink{util_8inc_8php_ff065fbc9f3abbf9c5a0ebfba22acbf7}{http\_\-digest\_\-check} (\$users, \$realm= '') +\item +\hyperlink{util_8inc_8php_95d221746e2d296434b0d63f78cedf57}{http\_\-digest\_\-prompt} (\$realm= '') +\item +\hyperlink{util_8inc_8php_0da48011cb68c039aec396c23cb04295}{is\_\-url} (\$s) +\item +\hyperlink{util_8inc_8php_9f9eeab2eb9a39518e80609fc7f83842}{nl} (\$count=1) +\item +\hyperlink{util_8inc_8php_37ef346387afe0af2cf86a8bea887173}{pad} (\$s, \$num, \$chr= ' ') +\item +\hyperlink{util_8inc_8php_3c7d87c658499c1559a6b98cac06f58d}{quot} (\$s) +\item +\hyperlink{util_8inc_8php_9d3ab20fc8b79fb6ab860f93600c745e}{serve\_\-file} (\$fn, \$dl, \$mime) +\item +\hyperlink{util_8inc_8php_74e38925e7162356a2ea14db32664c37}{tab} (\$count=1) +\item +\hyperlink{util_8inc_8php_a5cc9d5f8a0b5bb76dfe3d15796e5940}{var\_\-dump\_\-inl} (\$var) +\end{CompactItemize} + + +\subsection{Function Documentation} +\hypertarget{util_8inc_8php_61d3b2881d9368741c71509017724bc8}{ +\index{util.inc.php@{util.inc.php}!array\_\-to\_\-js@{array\_\-to\_\-js}} +\index{array\_\-to\_\-js@{array\_\-to\_\-js}!util.inc.php@{util.inc.php}} +\subsubsection[{array\_\-to\_\-js}]{\setlength{\rightskip}{0pt plus 5cm}array\_\-to\_\-js (\$ {\em container})}} +\label{util_8inc_8php_61d3b2881d9368741c71509017724bc8} + + +\hyperlink{util_8inc_8php}{util.inc.php} Static utility functions + +Copyright Gottfried Haider, Danja Vasiliev 2010. This source code is licensed under the GNU General Public License. See the file COPYING for more details. convert an associative array to a javascript block + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$container container array \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string \end{Desc} +\hypertarget{util_8inc_8php_4647462c98447c6c2842f70d8c313f85}{ +\index{util.inc.php@{util.inc.php}!array\_\-unique\_\-element@{array\_\-unique\_\-element}} +\index{array\_\-unique\_\-element@{array\_\-unique\_\-element}!util.inc.php@{util.inc.php}} +\subsubsection[{array\_\-unique\_\-element}]{\setlength{\rightskip}{0pt plus 5cm}array\_\-unique\_\-element (\&\$ {\em a}, \/ \$ {\em key})}} +\label{util_8inc_8php_4647462c98447c6c2842f70d8c313f85} + + +make an array off associative array unique in a certain key-value + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\&\$a reference to array \item[{\em mixed}]\$key key whose value we compare \end{description} +\end{Desc} +\hypertarget{util_8inc_8php_6309f576f2611237288d0dd3eed09db3}{ +\index{util.inc.php@{util.inc.php}!dir\_\-is\_\-different@{dir\_\-is\_\-different}} +\index{dir\_\-is\_\-different@{dir\_\-is\_\-different}!util.inc.php@{util.inc.php}} +\subsubsection[{dir\_\-is\_\-different}]{\setlength{\rightskip}{0pt plus 5cm}dir\_\-is\_\-different (\$ {\em a}, \/ \$ {\em b})}} +\label{util_8inc_8php_6309f576f2611237288d0dd3eed09db3} + + +check if two directories are different + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$a filename \item[{\em string}]\$b filename \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool \end{Desc} +\hypertarget{util_8inc_8php_afce787d4b725ac62be6306ff3e352e7}{ +\index{util.inc.php@{util.inc.php}!expl@{expl}} +\index{expl@{expl}!util.inc.php@{util.inc.php}} +\subsubsection[{expl}]{\setlength{\rightskip}{0pt plus 5cm}expl (\$ {\em delimiter}, \/ \$ {\em string})}} +\label{util_8inc_8php_afce787d4b725ac62be6306ff3e352e7} + + +split a string by string + +like php's explode() but handles empty strings better. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$delimiter boundary string \item[{\em string}]\$string input string \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array \end{Desc} +\hypertarget{util_8inc_8php_1d2500a5e237e59956b03cbea845c95a}{ +\index{util.inc.php@{util.inc.php}!expl\_\-whitesp@{expl\_\-whitesp}} +\index{expl\_\-whitesp@{expl\_\-whitesp}!util.inc.php@{util.inc.php}} +\subsubsection[{expl\_\-whitesp}]{\setlength{\rightskip}{0pt plus 5cm}expl\_\-whitesp (\$ {\em s}, \/ \$ {\em honor\_\-quot} = {\tt false})}} +\label{util_8inc_8php_1d2500a5e237e59956b03cbea845c95a} + + +explode a string splitting it by whitespace characters + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$s input string \item[{\em bool}]\$honor\_\-quot don't split inside quotation marks \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]array of strings \end{Desc} +\hypertarget{util_8inc_8php_9c9a81ec9dba8b2870cbb365f8139866}{ +\index{util.inc.php@{util.inc.php}!file\_\-is\_\-different@{file\_\-is\_\-different}} +\index{file\_\-is\_\-different@{file\_\-is\_\-different}!util.inc.php@{util.inc.php}} +\subsubsection[{file\_\-is\_\-different}]{\setlength{\rightskip}{0pt plus 5cm}file\_\-is\_\-different (\$ {\em a}, \/ \$ {\em b})}} +\label{util_8inc_8php_9c9a81ec9dba8b2870cbb365f8139866} + + +check if two files are different + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$a filename \item[{\em string}]\$b filename \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool \end{Desc} +\hypertarget{util_8inc_8php_6d9392e51344c2e8720a0c1982ebea21}{ +\index{util.inc.php@{util.inc.php}!filext@{filext}} +\index{filext@{filext}!util.inc.php@{util.inc.php}} +\subsubsection[{filext}]{\setlength{\rightskip}{0pt plus 5cm}filext (\$ {\em s})}} +\label{util_8inc_8php_6d9392e51344c2e8720a0c1982ebea21} + + +get the extension of a file + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$s filename \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string \end{Desc} +\hypertarget{util_8inc_8php_78288ca93c62ce2b5ef34f40352c7324}{ +\index{util.inc.php@{util.inc.php}!http\_\-400@{http\_\-400}} +\index{http\_\-400@{http\_\-400}!util.inc.php@{util.inc.php}} +\subsubsection[{http\_\-400}]{\setlength{\rightskip}{0pt plus 5cm}http\_\-400 ()}} +\label{util_8inc_8php_78288ca93c62ce2b5ef34f40352c7324} + + +return a error 400 message to the client + +this function doesn't return. \hypertarget{util_8inc_8php_24f09c2c8205022b013bbee5293a38ae}{ +\index{util.inc.php@{util.inc.php}!http\_\-404@{http\_\-404}} +\index{http\_\-404@{http\_\-404}!util.inc.php@{util.inc.php}} +\subsubsection[{http\_\-404}]{\setlength{\rightskip}{0pt plus 5cm}http\_\-404 ()}} +\label{util_8inc_8php_24f09c2c8205022b013bbee5293a38ae} + + +return a error 404 message to the client + +this function doesn't return. \hypertarget{util_8inc_8php_575cc91d803ae46bbc5dfaecbeb3561d}{ +\index{util.inc.php@{util.inc.php}!http\_\-500@{http\_\-500}} +\index{http\_\-500@{http\_\-500}!util.inc.php@{util.inc.php}} +\subsubsection[{http\_\-500}]{\setlength{\rightskip}{0pt plus 5cm}http\_\-500 ()}} +\label{util_8inc_8php_575cc91d803ae46bbc5dfaecbeb3561d} + + +return a error 500 message to the client + +this function doesn't return. \hypertarget{util_8inc_8php_ff065fbc9f3abbf9c5a0ebfba22acbf7}{ +\index{util.inc.php@{util.inc.php}!http\_\-digest\_\-check@{http\_\-digest\_\-check}} +\index{http\_\-digest\_\-check@{http\_\-digest\_\-check}!util.inc.php@{util.inc.php}} +\subsubsection[{http\_\-digest\_\-check}]{\setlength{\rightskip}{0pt plus 5cm}http\_\-digest\_\-check (\$ {\em users}, \/ \$ {\em realm} = {\tt ''})}} +\label{util_8inc_8php_ff065fbc9f3abbf9c5a0ebfba22acbf7} + + +check if the user is http digest authenticated + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em array}]\$users array of possible users (usernames as keys, password as values) \item[{\em string}]\$realm realm (e.g. name of the site) \end{description} +\end{Desc} +\begin{Desc} +\item[Return values:] +\begin{description} +\item[{\em 0}]authenticated \item[{\em -1}]user did not request authentication \item[{\em -2}]parts of the response are missing \item[{\em -3}]unknown username \item[{\em -4}]invalid password \end{description} +\end{Desc} +\hypertarget{util_8inc_8php_95d221746e2d296434b0d63f78cedf57}{ +\index{util.inc.php@{util.inc.php}!http\_\-digest\_\-prompt@{http\_\-digest\_\-prompt}} +\index{http\_\-digest\_\-prompt@{http\_\-digest\_\-prompt}!util.inc.php@{util.inc.php}} +\subsubsection[{http\_\-digest\_\-prompt}]{\setlength{\rightskip}{0pt plus 5cm}http\_\-digest\_\-prompt (\$ {\em realm} = {\tt ''})}} +\label{util_8inc_8php_95d221746e2d296434b0d63f78cedf57} + + +prompt the user for http digest authentication + +make sure the script stops execution after calling this function. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$realm realm (e.g. name of the site) \end{description} +\end{Desc} +\hypertarget{util_8inc_8php_0da48011cb68c039aec396c23cb04295}{ +\index{util.inc.php@{util.inc.php}!is\_\-url@{is\_\-url}} +\index{is\_\-url@{is\_\-url}!util.inc.php@{util.inc.php}} +\subsubsection[{is\_\-url}]{\setlength{\rightskip}{0pt plus 5cm}is\_\-url (\$ {\em s})}} +\label{util_8inc_8php_0da48011cb68c039aec396c23cb04295} + + +check if a string is a url + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$s \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]bool \end{Desc} +\hypertarget{util_8inc_8php_9f9eeab2eb9a39518e80609fc7f83842}{ +\index{util.inc.php@{util.inc.php}!nl@{nl}} +\index{nl@{nl}!util.inc.php@{util.inc.php}} +\subsubsection[{nl}]{\setlength{\rightskip}{0pt plus 5cm}nl (\$ {\em count} = {\tt 1})}} +\label{util_8inc_8php_9f9eeab2eb9a39518e80609fc7f83842} + + +return a number of newline characters + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em int}]\$count count (one is default) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string \end{Desc} +\hypertarget{util_8inc_8php_37ef346387afe0af2cf86a8bea887173}{ +\index{util.inc.php@{util.inc.php}!pad@{pad}} +\index{pad@{pad}!util.inc.php@{util.inc.php}} +\subsubsection[{pad}]{\setlength{\rightskip}{0pt plus 5cm}pad (\$ {\em s}, \/ \$ {\em num}, \/ \$ {\em chr} = {\tt '~'})}} +\label{util_8inc_8php_37ef346387afe0af2cf86a8bea887173} + + +pad a string to have at least \$num characters + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$s string to operate on \item[{\em int}]\$num number of characters desired \item[{\em string}]\$chr character to pad the string with \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string \end{Desc} +\hypertarget{util_8inc_8php_3c7d87c658499c1559a6b98cac06f58d}{ +\index{util.inc.php@{util.inc.php}!quot@{quot}} +\index{quot@{quot}!util.inc.php@{util.inc.php}} +\subsubsection[{quot}]{\setlength{\rightskip}{0pt plus 5cm}quot (\$ {\em s})}} +\label{util_8inc_8php_3c7d87c658499c1559a6b98cac06f58d} + + +return a string with double quotation marks wrapped around + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$s string \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string \end{Desc} +\hypertarget{util_8inc_8php_9d3ab20fc8b79fb6ab860f93600c745e}{ +\index{util.inc.php@{util.inc.php}!serve\_\-file@{serve\_\-file}} +\index{serve\_\-file@{serve\_\-file}!util.inc.php@{util.inc.php}} +\subsubsection[{serve\_\-file}]{\setlength{\rightskip}{0pt plus 5cm}serve\_\-file (\$ {\em fn}, \/ \$ {\em dl}, \/ \$ {\em mime})}} +\label{util_8inc_8php_9d3ab20fc8b79fb6ab860f93600c745e} + + +serve a file to the client + +this function only returns on errors. \begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em string}]\$fn filename \item[{\em bool}]\$dl download file \item[{\em string}]\$mime mime type \end{description} +\end{Desc} +\hypertarget{util_8inc_8php_74e38925e7162356a2ea14db32664c37}{ +\index{util.inc.php@{util.inc.php}!tab@{tab}} +\index{tab@{tab}!util.inc.php@{util.inc.php}} +\subsubsection[{tab}]{\setlength{\rightskip}{0pt plus 5cm}tab (\$ {\em count} = {\tt 1})}} +\label{util_8inc_8php_74e38925e7162356a2ea14db32664c37} + + +return a number of tab characters + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em int}]\$count count (one is default) \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string \end{Desc} +\hypertarget{util_8inc_8php_a5cc9d5f8a0b5bb76dfe3d15796e5940}{ +\index{util.inc.php@{util.inc.php}!var\_\-dump\_\-inl@{var\_\-dump\_\-inl}} +\index{var\_\-dump\_\-inl@{var\_\-dump\_\-inl}!util.inc.php@{util.inc.php}} +\subsubsection[{var\_\-dump\_\-inl}]{\setlength{\rightskip}{0pt plus 5cm}var\_\-dump\_\-inl (\$ {\em var})}} +\label{util_8inc_8php_a5cc9d5f8a0b5bb76dfe3d15796e5940} + + +print human-readable information about a variable in inline format + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em mixed}]\$var variable \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]string \end{Desc} diff --git a/htaccess-dist b/htaccess-dist new file mode 100644 index 0000000..13b6df8 --- /dev/null +++ b/htaccess-dist @@ -0,0 +1,9 @@ +# make sure MultiViews is disabled +Options -MultiViews +RewriteEngine on +# shortcut for json +RewriteRule ^json/?$ json.php [L] +# redirect everything that is not a real file or directory towards index.php +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)$ index.php?$1 \ No newline at end of file diff --git a/html.inc.php b/html.inc.php new file mode 100644 index 0000000..6bd2c4c --- /dev/null +++ b/html.inc.php @@ -0,0 +1,597 @@ +<?php + +/** + * html.inc.php + * Generic html element functions + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('util.inc.php'); + +$single_tags = array('link', 'meta', 'hr', 'br', 'img', 'param', 'input'); + +if (!isset($html)) { + $html = array(); + $html['header'] = array('title'=>''); + $html['body'] = array('tag'=>'body'); + $html['cache'] = true; +} + + +/** + * helper function for sorting an array of arrays by key 'prio' + * + * @param array &$a reference to an array + */ +function _array_sort_by_prio(&$a) +{ + // usort makes no guarantee what happens when two entries have the same + // prio + usort($a, '_cmp_prio'); +} + + +/** + * helper function for _array_sort_prio() + * + * @param array $a array to compare + * @param array $b array to compare + * @return int comparison result + */ +function _cmp_prio($a, $b) +{ + if ($a['prio'] == $b['prio']) { + return 0; + } + return ($a['prio'] < $b['prio']) ? -1 : 1; +} + + +/** + * get a reference to the body element + * + * @return &array reference to the body element + */ +function &body() +{ + global $html; + return $html['body']; +} + + +/** + * helper function for appending content to the body element + * + * @param mixed $c content (can be either a string or another element) + */ +function body_append($c) +{ + global $html; + elem_append($html['body'], $c); +} + + +/** + * create a element + * + * @param string $tag element tag + * @return array element + */ +function elem($tag) +{ + return array('tag'=>$tag); +} + + +/** + * add a class to an element + * + * @param array &$elem reference to an element + * @param string $c class + */ +function elem_add_class(&$elem, $c) +{ + if (!@is_array($elem['class'])) { + $elem['class'] = array(); + } + $elem['class'][] = $c; + $elem['class'] = array_unique($elem['class']); +} + + +/** + * append content to an element + * + * this function is similar to elem_val(). + * @param array &$elem reference to an element + * @param mixed $c content (can be either a string or another element) + */ +function elem_append(&$elem, $c) +{ + if (!isset($elem['val'])) { + if (is_array($c)) { + $elem['val'] = array($c); + } else { + $elem['val'] = $c; + } + } elseif (is_array($c) && is_array($elem['val'])) { + $elem['val'][] = $c; + } elseif (is_array($c) && is_string($elem['val'])) { + $elem['val'] = array($elem['val'], $c); + } elseif (is_string($c) && is_array($elem['val'])) { + $elem['val'][] = $c; + } elseif (is_string($c) && is_string($elem['val'])) { + $elem['val'] .= $c; + } +} + + +/** + * get or set an attribute in an element + * + * @param array &$elem reference to an element + * @param string attribute name + * @param mixed attribute value (to set it) + */ +function elem_attr(&$elem) +{ + if (func_num_args() == 2) { + if (isset($elem[func_get_arg(1)])) { + return $elem[func_get_arg(1)]; + } else { + return NULL; + } + } elseif (2 < func_num_args()) { + $elem[func_get_arg(1)] = func_get_arg(2); + } +} + + +/** + * get or set a css property in an element + * + * @param array &$elem reference to an element + * @param string css property name + * @param mixed css property value (to set it; empty string to clear it) + */ +function elem_css(&$elem) +{ + if (func_num_args() == 2) { + if (@is_array($elem['style']) && isset($elem['style'][func_get_arg(1)])) { + return $elem['style'][func_get_arg(1)]; + } else { + return NULL; + } + } elseif (2 < func_num_args()) { + if (!@is_array($elem['style'])) { + $elem['style'] = array(); + } + if (func_get_arg(2) === '') { + // clear css property + unset($elem['style'][func_get_arg(1)]); + } else { + $elem['style'][func_get_arg(1)] = func_get_arg(2); + } + } +} + + +/** + * turn an element into a html string + * + * @param array $elem element + * @return string html + */ +function elem_finalize($elem) +{ + global $single_tags; + + $ret = '<'.$elem['tag']; + if (isset($elem['id'])) { + $ret .= ' id="'.htmlspecialchars($elem['id'], ENT_COMPAT, 'UTF-8').'"'; + unset($elem['id']); + } + if (@is_array($elem['class'])) { + $ret .= ' class="'.htmlspecialchars(implode(' ', $elem['class']), ENT_COMPAT, 'UTF-8').'"'; + unset($elem['class']); + } + foreach ($elem as $key=>$val) { + if ($key == 'tag' || $key == 'id' || $key == 'class' || $key == 'val') { + continue; + } elseif ($key == 'style') { + $ret .= ' style="'; + ksort($val); + foreach ($val as $k=>$v) { + $ret .= htmlspecialchars($k, ENT_COMPAT, 'UTF-8').': '.htmlspecialchars($v, ENT_COMPAT, 'UTF-8').'; '; + } + // strip the last space + $ret = substr($ret, 0, -1); + $ret .= '"'; + } else { + $ret .= ' '.htmlspecialchars($key, ENT_NOQUOTES, 'UTF-8').'="'.htmlspecialchars($val, ENT_COMPAT, 'UTF-8').'"'; + } + } + $ret .= '>'; + + // make block elements have a newline after the opening tag + $block_tags = array('body', 'div', 'script', 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'li', 'blockquote', 'hr', 'pre'); + if (in_array($elem['tag'], $block_tags)) { + $block_tag = true; + $ret .= nl(); + } else { + $block_tag = false; + } + + // handle single-type elements + if (in_array(strtolower($elem['tag']), $single_tags)) { + return $ret; + } + + // handle text, an element array or an array of both + $content = ''; + if (@is_string($elem['val'])) { + $content = $elem['val']; + } elseif (@is_array($elem['val']) && isset($elem['val']['tag'])) { + // this is recursive + $content = elem_finalize($elem['val']); + } elseif (@is_array($elem['val'])) { + foreach ($elem['val'] as $v) { + if (is_string($v)) { + $content .= $v; + } elseif (is_array($v) && isset($v['tag'])) { + // add a newline when appropriate + if (in_array($v['tag'], $block_tags) && 0 < strlen($content) && substr($content, -1) != "\n") { + $content .= nl(); + } + // this is recursive + $content .= elem_finalize($v); + } + } + } + // move block element content in by one tab + if ($block_tag && 0 < strlen($content)) { + // if the content ends with a newline character, remove it + if (substr($content, -1) == "\n") { + $content = substr($content, 0, -1); + } + $content = str_replace("\n", "\n\t", $content); + $ret .= tab().$content.nl(); + } elseif (0 < strlen($content)) { + $ret .= $content; + } + + $ret .= '</'.$elem['tag'].'>'; + // make block elements have a newline after the closing tag + if ($block_tag) { + $ret .= nl(); + } + + return $ret; +} + + +/** + * check if an element is of a certain class + * + * @param array $elem element + * @param string $c class to check + * @return bool + */ +function elem_has_class($elem, $c) +{ + if (@in_array($c, $elem['class'])) { + return true; + } else { + return false; + } +} + + +/** + * remove an attribute from an element + * + * @param array &$elem reference to an element + * @param string $a attribute name + */ +function elem_remove_attr(&$elem, $a) +{ + unset($elem[$a]); +} + + +/** + * remove a class from an element + * + * @param array &$elem reference to an element + * @param string $c class + */ +function elem_remove_class(&$elem, $c) +{ + if (@is_array($elem['class'])) { + if (($k = array_search($c, $elem['class'])) !== false) { + array_splice($elem['class'], $k, 1); + } + } +} + + +/** + * get or set an element's content + * + * this function is similar to elem_append(). + * @param array &$elem reference to an element + * @param mixed $c content (to set it, can be either a string or another element) + */ +function elem_val(&$elem) +{ + if (func_num_args() == 1) { + if (@is_string($elem['val'])) { + return $elem['val']; + } else { + return ''; + } + } elseif (1 < func_num_args()) { + $elem['val'] = func_get_arg(1); + } +} + + +/** + * add a link-alternate element to the html header + * + * @param string $type type attribute + * @param string $url url attribute (url-encoded if necessary) + * @param string $title title attribute + */ +function html_add_alternate($type, $url, $title) +{ + global $html; + if (!@is_array($html['header']['alternate'])) { + $html['header']['alternate'] = array(); + } + $html['header']['alternate'][] = array('type'=>$type, 'url'=>$url, 'title'=>$title); +} + + +/** + * add a reference to a css file to the html header + * + * @param string $url url attribute (url-encoded if necessary) + * @param int $prio when to insert reference (0 - very early to 9 - late) + * @param string $media media attribute (optional) + */ +function html_add_css($url, $prio = 5, $media = '') +{ + global $html; + if (!@is_array($html['header']['css'])) { + $html['header']['css'] = array(); + } + $html['header']['css'][] = array('url'=>$url, 'prio'=>$prio, 'media'=>$media); +} + + +/** + * add a reference to a javascript file to the html header + * + * duplicate references will be removed from the output. + * @param string $url url attribute (url-encoded if necessary) + * @param int $prio when to insert reference (0 - very early to 9 - late) + */ +function html_add_js($url, $prio = 5) +{ + global $html; + if (!@is_array($html['header']['js'])) { + $html['header']['js'] = array(); + } + $html['header']['js'][] = array('url'=>$url, 'prio'=>$prio); +} + + +/** + * add javascript code to the html header + * + * @param string $code javscript code + * @param int $prio when to insert code (0 - very early to 9 - late) + * @param string $reason (e.g. your module) (optional) + */ +function html_add_js_code($code, $prio = 5, $reason = '') +{ + global $html; + if (!@is_array($html['header']['js_code'])) { + $html['header']['js_code'] = array(); + } + $html['header']['js_code'][] = array('code'=>$code, 'prio'=>$prio, 'reason'=>$reason); +} + + +/** + * set a variable in the javascript output + * + * @param string $key variable or object the value will be stored) + * @param mixed $val value + */ +function html_add_js_var($key, $val) +{ + global $html; + if (!@is_array($html['header']['js_var'])) { + $html['header']['js_var'] = array(); + } + $html['header']['js_var'][$key] = $val; +} + + +/** + * get or set a css property in the html element + * + * @param string css property name + * @param mixed css property value (to set it; empty string to clear it) + */ +function html_css($prop) +{ + global $html; + if (func_num_args() == 1) { + if (@is_array($html['header']['style']) && isset($html['header']['style'][$prop])) { + return $html['header']['style'][$prop]; + } else { + return NULL; + } + } elseif (1 < func_num_args()) { + if (!@is_array($html['header']['style'])) { + $html['header']['style'] = array(); + } + if (func_get_arg(1) === '') { + // clear css property + unset($html['header']['style'][$prop]); + } else { + $html['header']['style'][$prop] = func_get_arg(1); + } + } +} + + +/** + * disable caching of output + * + * can be used for modules that need the php to be executed every time. + * @param string $reason (e.g. your module) + */ +function html_disable_caching($reason = '') +{ + global $html; + if ($html['cache']) { + log_msg('info', 'html: disabled caching for this request because of '.quot($reason)); + $html['cache'] = false; + } +} + + +/** + * get or set favicon + * + * @param string url (to set it, url-encoded if necessary) + */ +function html_favicon() +{ + global $html; + if (func_num_args() == 0) { + if (@is_string($html['header']['favicon'])) { + return $html['header']['favicon']; + } else { + return ''; + } + } elseif (0 < func_num_args()) { + $html['header']['favicon'] = func_get_arg(0); + } +} + + +/** + * turn the page into a html string + * + * @param bool &$cache is output cachable (will only modified if $cache is + * true before) + * @return string html + */ +function html_finalize(&$cache = false) +{ + global $html; + // return html5 + $ret = '<!DOCTYPE html>'.nl(); + $ret .= '<html'; + if (@is_array($html['header']['style'])) { + $ret .= ' style="'; + ksort($html['header']['style']); + foreach ($html['header']['style'] as $key=>$val) { + $ret .= htmlspecialchars($key, ENT_COMPAT, 'UTF-8').': '.htmlspecialchars($val, ENT_COMPAT, 'UTF-8').'; '; + } + // strip the last space + $ret = substr($ret, 0, -1); + $ret .= '"'; + } + $ret .= '>'.nl(); + $ret .= '<head>'.nl(); + $ret .= '<title>'.htmlspecialchars($html['header']['title'], ENT_NOQUOTES, 'UTF-8').'</title>'.nl(); + $ret .= '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'.nl(); + if (@is_array($html['header']['alternate'])) { + foreach ($html['header']['alternate'] as $e) { + $ret .= '<link rel="alternate" type="'.htmlspecialchars($e['type'], ENT_COMPAT, 'UTF-8').'" href="'.htmlspecialchars($e['url'], ENT_COMPAT, 'UTF-8').'" title="'.htmlspecialchars($e['title'], ENT_COMPAT, 'UTF-8').'">'.nl(); + } + } + if (!empty($html['header']['favicon'])) { + $ret .= '<link rel="shortcut icon" href="'.htmlspecialchars($html['header']['favicon'], ENT_COMPAT, 'UTF-8').'">'.nl(); + } + if (@is_array($html['header']['css'])) { + _array_sort_by_prio($html['header']['css']); + // removed the removal of duplicates here as two different media might point to the same url + //array_unique_element($html['header']['css'], 'url'); + foreach ($html['header']['css'] as $e) { + $ret .= '<link rel="stylesheet" type="text/css" href="'.htmlspecialchars($e['url'], ENT_COMPAT, 'UTF-8').'"'; + if (!empty($e['media'])) { + $ret .= ' media="'.htmlspecialchars($e['media'], ENT_COMPAT, 'UTF-8').'"'; + } + $ret .= '>'.nl(); + } + } + if (@is_array($html['header']['js'])) { + _array_sort_by_prio($html['header']['js']); + array_unique_element($html['header']['js'], 'url'); + foreach ($html['header']['js'] as $e) { + $ret .= '<script type="text/javascript" src="'.htmlspecialchars($e['url'], ENT_COMPAT, 'UTF-8').'"></script>'.nl(); + } + } + if (@is_array($html['header']['js_var'])) { + $ret .= array_to_js($html['header']['js_var']); + } + if (@is_array($html['header']['js_code'])) { + _array_sort_by_prio($html['header']['js_code']); + foreach ($html['header']['js_code'] as $c) { + if (!empty($c['reason'])) { + $ret .= '<!-- '.$c['reason'].' -->'.nl(); + $ret .= '<script type="text/javascript">'.nl(); + // if the code ends with a newline character, remove it + if (substr($c['code'], -1) == "\n") { + $c['code'] = substr($c['code'], 0, -1); + } + // move code in by one tab + $c = str_replace("\n", "\n\t", $c); + $ret .= tab().$c['code'].nl(); + $ret .= '</script>'.nl(); + } + } + } + $ret .= '</head>'.nl(); + $ret .= elem_finalize($html['body']); + $ret .= '</html>'; + + // pass caching information up if requested + if ($cache) { + if (!$html['cache']) { + $cache = false; + } + } + + return $ret; +} + + +/** + * get or set title + * + * @param string title (to set it) + */ +function html_title() +{ + global $html; + if (func_num_args() == 0) { + return $html['header']['title']; + } elseif (0 < func_num_args()) { + $html['header']['title'] = func_get_arg(0); + } +} + + +?> diff --git a/html_parse.inc.php b/html_parse.inc.php new file mode 100644 index 0000000..b91a5b0 --- /dev/null +++ b/html_parse.inc.php @@ -0,0 +1,404 @@ +<?php + +/** + * html_parse.inc.php + * Generic html parsing functions + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('html.inc.php'); +require_once('util.inc.php'); + + +function html_encode_str_smart($html) +{ + // TODO (later): remove debug code + log_msg('debug', 'html_encode_str_smart: string is '.quot(var_dump_inl($html))); + + // encode ampersand characters where needed + $cur = 0; + while ($cur < strlen($html)) { + // check & + if (substr($html, $cur, 1) == '&') { + $replace = true; + // DEBUG + $reason = false; + + // check &#?? + if ($cur+3 < strlen($html) && substr($html, $cur+1, 1) == '#') { + // check $#x or not + if (strtolower(substr($html, $cur+2, 1)) == 'x') { + // check for hexadecimal characters before ; + $ahead = $cur+3; + while ($ahead < strlen($html)) { + $char = strtolower(substr($html, $ahead, 1)); + if ((48 <= ord($char) && ord($char) <= 57) || (97 <= ord($char) && ord($char) <= 102)) { + // valid hexadecimal character + $ahead++; + } elseif ($char == ';') { + if ($cur+3 < $ahead) { + // valid entitiy + $replace = false; + break; + } else { + // invalid entity + // DEBUG + $reason = 1; + break; + } + } else { + // invalid entity + // DEBUG + $reason = 2; + break; + } + } + if ($ahead == strlen($html)) { + // DEBUG + $reason = 3; + } + } elseif (is_numeric(substr($html, $cur+2, 1))) { + // check for for decimal characters before ; + $ahead = $cur+3; + while ($ahead < strlen($html)) { + $char = substr($html, $ahead, 1); + if (48 <= ord($char) && ord($char) <= 57) { + // valid decimal character + $ahead++; + } elseif ($char == ';') { + // valid entity + $replace = false; + break; + } else { + // invalid entity + $reason = 4; + break; + } + } + if ($ahead == strlen($html)) { + // DEBUG + $reason = 5; + } + } else { + // DEBUG + $reson = 6; + } + } else { + // assume a named entity + // it turns out we can't use get_html_translation_table() + // for this as the HTML_ENTITIES table is not complete + $ahead = $cur+1; + while ($ahead < strlen($html)) { + $char = strtolower(substr($html, $ahead, 1)); + if ((48 <= ord($char) && ord($char) <= 57) || (97 <= ord($char) && ord($char) <= 122)) { + // valid alphanumeric character + $ahead++; + } elseif ($char == ';') { + if ($cur+1 < $ahead) { + // (supposedly) valid entity + $replace = false; + break; + } else { + // invalid entity + // DEBUG + $reason = 7; + break; + } + } else { + // invalid entity + // DEBUG + $reason = 8; + break; + } + } + if ($ahead == strlen($html)) { + $reason = 9; + break; + } + } + + if ($replace) { + log_msg('debug', 'html_encode_str_smart: replacing ampersand at '.$cur.' because of '.$reason); + $html = substr($html, 0, $cur).'&'.substr($html, $cur+1); + log_msg('debug', 'html_encode_str_smart: new string is '.quot(var_dump_inl($html))); + $cur += 5; + } else { + log_msg('debug', 'html_encode_str_smart: not replacing ampersand at '.$cur); + $cur++; + } + } else { + $cur++; + } + } + + // encode < and > where needed + $cur = 0; + while ($cur < strlen($html)) { + $char = substr($html, $cur, 1); + $replace = true; + + if ($char == '<') { + // a possible tag + // search for a closing bracket + $ahead = $cur+1; + while ($ahead < strlen($html)) { + $c = strtolower(substr($html, $ahead, 1)); + if ($c == '<') { + // found another opening bracket + // the first one can't be legit + // DEBUG + $reason = 1; + break; + } elseif ($c == '>') { + if ($cur+1 < $ahead) { + // can be a valid tag + $replace = false; + // forward till after the closing bracket + $cur = $ahead; + break; + } else { + // invalid (empty) tag + // DEBUG + $reason = 2; + break; + } + } elseif ($ahead == $cur+1) { + if ((48 <= ord($c) && ord($c) <= 57) || (97 <= ord($c) && ord($c) <= 102) || $c == '/') { + // starts with an alphanumeric character or a slash, can be valid + } else { + // DEBUG + $reason = 3; + break; + } + } + $ahead++; + } + if ($ahead == strlen($html)) { + // DEBUG + $reason = 4; + } + } else if ($char == '>') { + // we should be getting all valid tags through the code above + // DEBUG + $reason = 5; + } + + if ($replace && $char == '<') { + log_msg('debug', 'html_encode_str_smart: replacing opening bracket at '.$cur.' because of '.$reason); + $html = substr($html, 0, $cur).'<'.substr($html, $cur+1); + log_msg('debug', 'html_encode_str_smart: new string is '.quot(var_dump_inl($html))); + $cur += 4; + } elseif ($replace && $char == '>') { + log_msg('debug', 'html_encode_str_smart: replacing closing bracket at '.$cur.' because of '.$reason); + $html = substr($html, 0, $cur).'>'.substr($html, $cur+1); + log_msg('debug', 'html_encode_str_smart: new string is '.quot(var_dump_inl($html))); + $cur += 4; + } else { + $cur++; + } + } + + return $html; +} + + +/** + * parse a string containing html elements + * + * this function decodes html's special characters except for the content + * (when it too is not being parsed). + * this function is more fragile than html_parse_elem() when it comes to + * malformatted input. + * @param string $html input string + * @param bool $recursive also parse children elements + * @return array parsed representation + */ +function html_parse($html, $recursive = false) +{ + global $single_tags; // from html.inc.php + + $ret = array(); + + $pos = 0; + $open_tag = false; + $open_pos = false; + // can probably be done with -1 and some slightly easier code below + $close_pos = false; + $num_open = 0; + + while ($pos < strlen($html)) { + if ($html[$pos] == '<') { + if (($next = strpos($html, '>', $pos+1)) === false) { + // error: unclosed < + $pos++; + continue; + } + // handle uppercase tags as well + $tag = strtolower(trim(substr($html, $pos+1, $next-$pos-1))); + + if (substr($tag, 0, 1) !== '/') { + // opening tag + if ($num_open == 0) { + $a = expl_whitesp($tag, true); + $open_tag = $a[0]; + $open_pos = $pos; + } + // handle single tags + if (in_array($tag, $single_tags)) { + if ($num_open == 0) { + // check if there was something between the last $close_pos and $open_pos + $text = ''; + if ($close_pos === false && 0 < $open_pos) { + $text = trim(substr($html, 0, $open_pos)); + } elseif ($close_pos !== false && $close_pos+1 < $open_pos) { + $text = trim(substr($html, $close_pos+1, $open_pos-$close_pos-1)); + } + if (0 < strlen($text)) { + $ret[] = $text; + } + $close_pos = $next; + $ret[] = html_parse_elem(substr($html, $open_pos, $close_pos-$open_pos+1), $recursive); + } + } else { + $num_open++; + } + } else { + // closing tag + $num_open--; + if ($num_open == 0) { + // check if opening and closing tag match + if ($open_tag != substr($tag, 1)) { + // error: opening and closing tag do not match + $pos++; + continue; + } + // check if there was something between the last $close_pos and $open_pos + $text = ''; + if ($close_pos === false && 0 < $open_pos) { + $text = trim(substr($html, 0, $open_pos)); + } elseif ($close_pos !== false && $close_pos+1 < $open_pos) { + $text = trim(substr($html, $close_pos+1, $open_pos-$close_pos-1)); + } + if (0 < strlen($text)) { + $ret[] = $text; + } + $close_pos = $next; + $ret[] = html_parse_elem(substr($html, $open_pos, $close_pos-$open_pos+1), $recursive); + } + } + } + $pos++; + } + // check if there was something after the last $close_pos + $text = ''; + if ($close_pos === false && 1 < $pos) { + $text = trim($html); + } elseif ($close_pos !== false && $close_pos+1 < $pos) { + $text = trim(substr($html, $close_pos+1)); + } + if (0 < strlen($text)) { + $ret[] = $text; + } + + return $ret; +} + + +/** + * parse exactly one html element + * + * this function decodes html's special characters except for the content + * (when it too is not being parsed). + * this function is less fragile than html_parse() when it comes to + * malformatted input. + * @param string $html input string (must start and end with the element's tag) + * @param bool $recursive also parse children elements + * @return array parsed representation + */ +function html_parse_elem($html, $recursive = false) +{ + global $single_tags; // from html.inc.php + $quot = array('"', "'"); + + $ret = array(); + + // explode the tag + $next = strpos($html, '>', 1); + $a = expl_whitesp(substr($html, 1, $next-1), true); + if (count($a) < 1) { + return $ret; + } else { + $ret['tag'] = strtolower($a[0]); + } + + // attributes can end up in one to three fields + // combine them + for ($i=1; $i < count($a); $i++) { + if ($a[$i] == '=' && 1 < $i && $i+1 < count($a)) { + $a[$i] = $a[$i-1].'='.$a[$i+1]; + array_splice($a, $i-1, 1); + array_splice($a, $i, 1); + $i--; + } elseif (substr($a[$i], -1) == '=' && $i+1 < count($a)) { + $a[$i] .= $a[$i+1]; + array_splice($a, $i+1, 1); + $i--; + } elseif (substr($a[$i], 0, 1) == '=' && 1 < $i) { + $a[$i] = $a[$i-1].$a[$i]; + array_splice($a, $i-1, 1); + $i--; + } + } + + // put attributes into array + for ($i=1; $i < count($a); $i++) { + if (($equal = strpos($a[$i], '=')) === false) { + $attr = strtolower(htmlspecialchars_decode($a[$i], ENT_QUOTES)); + $ret[$attr] = $attr; + } else { + $attr = strtolower(htmlspecialchars_decode(substr($a[$i], 0, $equal), ENT_QUOTES)); + $val = htmlspecialchars_decode(substr($a[$i], $equal+1), ENT_QUOTES); + // strip optional quotes + if (in_array(substr($val, 0, 1), $quot) && substr($val, 0, 1) == substr($val, -1)) { + $val = substr($val, 1, -1); + } + // special cases for certain attributes + if ($attr == 'class') { + $val = expl(' ', $val); + } elseif ($attr == 'style') { + $styles = expl(';', $val); + $val = array(); + foreach ($styles as $style) { + $temp = expl(':', $style); + if (1 < count($temp)) { + $val[strtolower(trim($temp[0]))] = trim(implode(':', array_slice($temp, 1))); + } + } + } + $ret[$attr] = $val; + } + } + + // handle content + if (!in_array($ret['tag'], $single_tags)) { + // check if there is actually a closing tag + if (($last = strrpos($html, '<')) !== false) { + // check if opening and closing tags match + if (strtolower(substr($html, $last+2, -1)) == $ret['tag']) { + $ret['val'] = trim(substr($html, $next+1, $last-$next-1)); + if ($recursive) { + $ret['val'] = html_parse($ret['val'], true); + } + } + } + } + + return $ret; +} + + +?> diff --git a/img/.htaccess b/img/.htaccess new file mode 100644 index 0000000..45552cb --- /dev/null +++ b/img/.htaccess @@ -0,0 +1 @@ +Options -Indexes \ No newline at end of file diff --git a/img/background-color.png b/img/background-color.png new file mode 100644 index 0000000..eccaac3 Binary files /dev/null and b/img/background-color.png differ diff --git a/img/colorpicker-transparent.png b/img/colorpicker-transparent.png new file mode 100644 index 0000000..73b47ac Binary files /dev/null and b/img/colorpicker-transparent.png differ diff --git a/img/download.png b/img/download.png new file mode 100644 index 0000000..b533ec5 Binary files /dev/null and b/img/download.png differ diff --git a/img/farbtastic-marker.png b/img/farbtastic-marker.png new file mode 100644 index 0000000..3929bbb Binary files /dev/null and b/img/farbtastic-marker.png differ diff --git a/img/farbtastic-mask.png b/img/farbtastic-mask.png new file mode 100644 index 0000000..b0a4d40 Binary files /dev/null and b/img/farbtastic-mask.png differ diff --git a/img/farbtastic-wheel.png b/img/farbtastic-wheel.png new file mode 100644 index 0000000..97b343d Binary files /dev/null and b/img/farbtastic-wheel.png differ diff --git a/img/favicon.ico b/img/favicon.ico new file mode 100644 index 0000000..f5c490c Binary files /dev/null and b/img/favicon.ico differ diff --git a/img/upload.png b/img/upload.png new file mode 100644 index 0000000..3944644 Binary files /dev/null and b/img/upload.png differ diff --git a/index.php b/index.php new file mode 100644 index 0000000..89f0e4e --- /dev/null +++ b/index.php @@ -0,0 +1,25 @@ +<?php + +/** + * index.php + * Main HTTP request handler + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('log.inc.php'); +log_msg('info', '--- request ---'); +require_once('controller.inc.php'); +require_once('modules.inc.php'); + + +$args = parse_query_string(); +log_msg('info', 'index: query arguments '.var_dump_inl($args)); +log_msg('debug', 'index: base url is '.quot(base_url())); +invoke_controller($args); + + +?> diff --git a/js/.htaccess b/js/.htaccess new file mode 100644 index 0000000..45552cb --- /dev/null +++ b/js/.htaccess @@ -0,0 +1 @@ +Options -Indexes \ No newline at end of file diff --git a/js/create_page.js b/js/create_page.js new file mode 100644 index 0000000..7823ae5 --- /dev/null +++ b/js/create_page.js @@ -0,0 +1,17 @@ +/** + * js/create_page.js + * Frontend code for creating new pages + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + $('#create_page_btn').bind('click', function(e) { + $('#create_page_btn').attr('disabled', 'disabled'); + $.glue.backend({ method: 'glue.create_page', page: $.glue.page }, function(data) { + window.location = $.glue.base_url+'?'+$.glue.page+'/edit'; + }); + }); +}); diff --git a/js/edit.js b/js/edit.js new file mode 100644 index 0000000..ca1954b --- /dev/null +++ b/js/edit.js @@ -0,0 +1,1815 @@ +/** + * js/edit.js + * Main hotglue frontend code + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$.glue.canvas = function() +{ + return { + update: function(elem) { + if (elem === undefined) { + elem = $('.object'); + } + var max_x = 0; + var max_y = 0; + $(elem).each(function() { + var p = $(this).position(); + if (max_x < p.left+$(this).outerWidth()) { + max_x = p.left+$(this).outerWidth(); + } + if (max_y < p.top+$(this).outerHeight()) { + max_y = p.top+$(this).outerHeight(); + } + }); + // make body at least match the window width and height but don't + // send these values to the backend in any case + if (max_x < $(window).width()) { + max_x = $(window).width(); + } + if (max_y < $(window).height()) { + max_y = $(window).height(); + } + // resize body + $('body').css('width', max_x+'px'); + $('body').css('height', max_y+'px'); + } + }; +}(); + +$.glue.colorpicker = function() +{ + var change_func = false; + var color = false; + var finish_func = false; + var shown = false; + + // setup element + var elem = $('<div id="glue-colorpicker" class="glue-ui" style="z-index: 202;"><div id="glue-colorpicker-transparent" class="glue-ui"></div><div id="glue-colorpicker-wheel" style="height: 195px; width: 195px;" title="set transparent"></div></div>'); + $(elem).children('#glue-colorpicker-wheel').farbtastic(function(col) { + if (col !== color) { + // update tooltip + $(elem).children('#glue-colorpicker-wheel').find('.marker').attr('title', col); + $(elem).children('#glue-colorpicker-transparent').removeClass('glue-colorpicker-transparent-set'); + $(elem).children('#glue-colorpicker-transparent').addClass('glue-colorpicker-transparent-notset'); + if (typeof change_func == 'function') { + change_func(col); + } + color = col; + } + }); + $(elem).children('#glue-colorpicker-transparent').bind('click', function(e) { + $(this).addClass('glue-colorpicker-transparent-set'); + $(this).removeClass('glue-colorpicker-transparent-notset'); + if (typeof change_func == 'function') { + change_func('transparent'); + } + color = 'transparent'; + }); + + var close_colorpicker = function(e) { + // close colorpicker when clicking outside of it or its children + // note: this handler is also being called right after colorpicker + // creation + if (!$(e.target).hasClass('glue-ui') && $(e.target).parents('.glue-ui').length == 0) { + // this also unregisters the event + $.glue.colorpicker.hide(); + // prevent the menu from firing + e.stopImmediatePropagation(); + } + }; + + return { + hide: function(cancel) { + if (shown) { + if (cancel === undefined || cancel == false) { + if (typeof finish_func == 'function') { + finish_func(color); + } + } + $(elem).detach(); + shown = false; + } + // unregister event + $('body').unbind('click', close_colorpicker); + }, + is_shown: function() { + return shown; + }, + show: function(def, transp, change, finish) { + if (shown) { + $.glue.colorpicker.hide(); + } + color = false; + + // set functions first, as $.farbtastic().setColor() immediately + // triggers a change event + change_func = change; + finish_func = finish; + + if (typeof def != 'string' || def.length == 0) { + // set a sane default + $.farbtastic($(elem).children('#glue-colorpicker-wheel')).setColor('#ff0000'); + $(elem).children('#glue-colorpicker-wheel').find('.marker').removeAttr('title'); + } else { + $.color.setColor(def); + var rgba = $.color.getRGB(); + var hex = $.color.getHex(); + // handle transparency + if (transp) { + $(elem).children('#glue-colorpicker-transparent').css('display', 'block'); + if (rgba.a == 0) { + $(elem).children('#glue-colorpicker-transparent').addClass('glue-colorpicker-transparent-set'); + $(elem).children('#glue-colorpicker-transparent').removeClass('glue-colorpicker-transparent-notset'); + color = 'transparent'; + } else { + $(elem).children('#glue-colorpicker-transparent').removeClass('glue-colorpicker-transparent-set'); + $(elem).children('#glue-colorpicker-transparent').addClass('glue-colorpicker-transparent-notset'); + } + } else { + $(elem).children('#glue-colorpicker-transparent').css('display', 'none'); + // a special case for color 'transparent' + if (rgba.r == 0 && rgba.g == 0 && rgba.b == 0 && rgba.a == 0) { + // set color to white + hex = '#ffffff'; + } + } + // handle color + $.farbtastic($(elem).children('#glue-colorpicker-wheel')).setColor(hex); + $(elem).children('#glue-colorpicker-wheel').find('.marker').attr('title', hex); + color = def; + } + + // add to dom + $('body').append(elem); + shown = true; + // register event + $('body').bind('click', close_colorpicker); + } + }; +}(); + +$.glue.contextmenu = function() +{ + var default_prio = 10; + var left = []; + var m = {}; + var owner = false; + var prev_owner = false; + var top = []; + var veto = {}; + + $('.object').live('glue-deselect', function(e) { + // hide menu when deselecting + $.glue.contextmenu.hide(); + }); + + $('.object').live('glue-movestart', function(e) { + // hide menu when moving the selected object + if (this == owner) { + prev_owner = owner; + $.glue.contextmenu.hide(); + } + }); + + $('.object').live('glue-movestop', function(e) { + // show menu again when we hid the menu because of movement + if (this == prev_owner) { + $.glue.contextmenu.show(prev_owner); + prev_owner = false; + } + }); + + $('.object').live('glue-select', function(e) { + // show menu when one object is selected + if ($('.glue-selected').length == 1) { + $.glue.contextmenu.show(this); + } else { + $.glue.contextmenu.hide(); + } + }); + + return { + hide: function() { + if (owner) { + while (left.length) { + var item = left.shift(); + $(item.elem).trigger('glue-menu-deactivate'); + $(item.elem).detach(); + } + while (top.length) { + var item = top.shift(); + $(item.elem).trigger('glue-menu-deactivate'); + $(item.elem).detach(); + } + owner = false; + } + }, + is_shown: function() { + if (owner) { + return true; + } else { + return false; + } + }, + register: function(cls, name, elem, prio) { + if (!m[cls]) { + m[cls] = []; + } + if (prio === undefined) { + prio = default_prio; + } + m[cls].push({ 'name': name, 'elem': elem, 'prio': prio }); + }, + reuse: function(cls, name, as, prio) { + if (prio === undefined) { + prio = default_prio; + } + for (var cur_m in m) { + for (var i=0; i<m[cur_m].length; i++) { + if (m[cur_m][i].name == name) { + // clone element with data and events + var new_elem = $(m[cur_m][i].elem).clone(true); + $.glue.contextmenu.register(cls, as, new_elem, prio); + // return new element + return new_elem; + } + } + } + return false; + }, + show: function(obj) { + if (owner) { + if (obj == owner) { + return; + } else { + $.glue.contextmenu.hide(); + } + } + for (var cls in m) { + if ($(obj).hasClass(cls)) { + var target; + // add to left or top + if (cls == 'object') { + target = left; + } else { + target = top; + } + // sort by priority ascending + for (var i=0; i < m[cls].length; i++) { + var added = false; + for (var j=0; j < target.length; j++) { + if (m[cls][i].prio < target[j].prio) { + target.splice(j, 0, m[cls][i]); + added = true; + break; + } + } + if (!added) { + target.push(m[cls][i]); + } + } + } + } + // remove specific menu items again + var obj_cls = $(obj).attr('class').replace(/\s+/, ' ').split(' '); + for (var cls in veto) { + for (var i=0; i < obj_cls.length; i++) { + if (cls == obj_cls[i]) { + for (var j=0; j < veto[cls].length; j++) { + for (var k=0; k < left.length; k++) { + if (left[k].name == veto[cls][j]) { + left.splice(k, 1); + k--; + } + } + for (var k=0; k < top.length; k++) { + if (top[k].name == veto[cls][j]) { + top.splice(k, 1); + k--; + } + } + } + } + } + } + // position items + for (var i=0; i < 2; i++) { + var target; + var cur_left; + var cur_top; + if (i == 0) { + target = left; + } else { + target = top; + } + cur_left = $(obj).position().left; + cur_top = $(obj).position().top; + // TODO (later): prevent context menu items from going off-screen + // the following code doesn't do it + if (cur_left < 0) { + cur_left = 0; + } + if (cur_top < 0) { + cur_top = 0; + } + // add items to dom + for (var j=0; j < target.length; j++) { + // set crucial css properties + $(target[j].elem).attr('id', 'glue-contextmenu-'+target[j].name); + if (target == left) { + $(target[j].elem).addClass('glue-contextmenu-left'); + } else { + $(target[j].elem).addClass('glue-contextmenu-top'); + } + $(target[j].elem).addClass('glue-ui'); + $(target[j].elem).css('position', 'absolute'); + $(target[j].elem).css('visibility', 'hidden'); + $(target[j].elem).css('z-index', '201'); + // add to dom and move + $('body').append(target[j].elem); + if (target == left) { + $(target[j].elem).css('left', (cur_left-$(target[j].elem).outerWidth(true))+'px'); + $(target[j].elem).css('top', cur_top+'px'); + var cur_height = $(target[j].elem).outerHeight(true); + } else { + $(target[j].elem).css('left', cur_left+'px'); + $(target[j].elem).css('top', (cur_top-$(target[j].elem).outerHeight(true))+'px'); + var cur_width = $(target[j].elem).outerWidth(true); + } + // set owner and trigger event + $(target[j].elem).data('owner', obj); + $(target[j].elem).trigger('glue-menu-activate'); + // check if we still want to show the icon ;) + if ($(target[j].elem).css('display') == 'none') { + continue; + } + // show it for real + if (target == left) { + cur_top += cur_height; + } else { + cur_left += cur_width; + } + $(target[j].elem).css('visibility', ''); + $(target[j].elem).hide(); + $(target[j].elem).fadeIn(333); + } + } + owner = obj; + // reset prev_owner as well + prev_owner = false; + return true; + }, + veto: function(cls, name) { + if (!veto[cls]) { + veto[cls] = []; + } + veto[cls].push(name); + } + }; +}(); + +$.glue.grid = function() +{ + var guides = []; // list of elements + var guides_x = []; // list of y coordinates for x-guides + var guides_y = []; // list of x coordinates for y-guides + var lines = []; // list of elements + var grid_height = false; + var grid_mode = 0; + var grid_width = false; + var grid_x = 50; + var grid_y = 50; + + var draw = function() { + // bit 0 draws the grid and guides + // i'd have preferred to use the canvas element for this, but as it + // would need to be on top it'd receive all the click events.. + // TODO (later): there seem to be an off-by-one bug in Chrome when rendering the line over an object below + if ((grid_mode & 1)) { + if (grid_height !== $(document).height() || grid_width !== $(document).width()) { + // optimization: only redraw the grid when width & height changes + remove(); + grid_height = $(document).height(); + grid_width = $(document).width(); + // get background color + var bg_color = '#ffffff'; // default to white + if ($('body').css('background-color').length) { + $.color.setColor($('body').css('background-color')); + var bg_a = $.color.getArray(); + // xcolor doesn't handle the complementary of rgba(0, 0, 0, 0) + if (bg_a[3] != 0) { + bg_color = $.color.getHex(); + } + } + // add grid lines + for (var x=grid_x; x <= grid_width; x+=grid_x) { + var elem = $('<div></div>'); + // set crucial css properties + $(elem).addClass('glue-grid-y'); + $(elem).addClass('glue-grid'); + $(elem).addClass('glue-ui'); + // use complementary color + $(elem).css('background-color', $.xcolor.complementary(bg_color)); + $(elem).css('height', grid_height+'px'); + $(elem).css('left', x+'px'); + $(elem).css('position', 'absolute'); + $(elem).css('top', '0px'); + $(elem).css('width', '1px'); + $(elem).css('z-index', '200'); + // add to dom and list + $('body').append(elem); + lines.push(elem); + } + for (var y=grid_y; y <= grid_height; y+=grid_y) { + var elem = $('<div></div>'); + $(elem).addClass('glue-grid-x'); + $(elem).addClass('glue-grid'); + $(elem).addClass('glue-ui'); + // use complementary color + $(elem).css('background-color', $.xcolor.complementary(bg_color)); + $(elem).css('height', '1px'); + $(elem).css('left', '0px'); + $(elem).css('position', 'absolute'); + $(elem).css('top', y+'px'); + $(elem).css('width', grid_width+'px'); + $(elem).css('z-index', '200'); + $('body').append(elem); + lines.push(elem); + } + // and guides + for (var i in guides_x) { + var elem = $('<div></div>'); + $(elem).addClass('glue-guide-x'); + $(elem).addClass('glue-guide'); + $(elem).addClass('glue-ui'); + // use a different color than background and grid lines + $(elem).css('background-color', $.xcolor.average($.xcolor.complementary(bg_color), bg_color)); + $(elem).css('height', grid_height+'px'); + $(elem).css('left', guides_x[i]+'px'); + $(elem).css('position', 'absolute'); + $(elem).css('top', '0px'); + $(elem).css('width', '1px'); + $(elem).css('z-index', '200'); + $('body').append(elem); + guides.push(elem); + } + for (var i in guides_y) { + var elem = $('<div></div>'); + $(elem).addClass('glue-guide-y'); + $(elem).addClass('glue-guide'); + $(elem).addClass('glue-ui'); + // use a different color than background and grid lines + $(elem).css('background-color', $.xcolor.average($.xcolor.complementary(bg_color), bg_color)); + $(elem).css('height', '1px'); + $(elem).css('left', '0px'); + $(elem).css('position', 'absolute'); + $(elem).css('top', guides_y[i]+'px'); + $(elem).css('width', grid_width+'px'); + $(elem).css('z-index', '200'); + $('body').append(elem); + guides.push(elem); + } + } + } else { + remove(); + } + // bit 1 changes drag behavior + // this is not working as expected (the object snaps every x/y pixels + // form the current position, not from 0/0) + // TODO (later): implement this properly + if ((grid_mode & 2)) { + $('.object').draggable('option', 'grid', [grid_x, grid_y]); + } else { + $('.object').draggable('option', 'grid', false); + } + // bit 2 changes resize behavior + // this is not working as expected (the object snaps every x/y pixels + // form the current position, not from 0/0) + // TODO (later): implement this properly + if ((grid_mode & 4)) { + $('.resizable').resizable('option', 'grid', [grid_x, grid_y]); + } else { + $('.resizable').resizable('option', 'grid', false); + } + }; + + var remove = function() { + // remove lines + while (lines.length) { + var line = lines.shift(); + $(line).remove(); + } + // and guides + while (guides.length) { + var guide = guides.shift(); + $(guide).remove(); + } + grid_height = false; + grid_width = false; + }; + + return { + add_guide_x: function(y) { + guides_x.push(y); + }, + add_guide_y: function(x) { + guides_y.push(x); + }, + mode: function(val) { + if (val === undefined) { + return grid_mode; + } else { + grid_mode = val; + // call update() to redraw + } + }, + update: function(force) { + if (force !== undefined && force) { + grid_height = false; + grid_width = false; + } + draw(); + }, + x: function(val) { + if (val === undefined) { + return grid_x; + } else { + grid_x = val; + // call update() to redraw + } + }, + y: function(val) { + if (val === undefined) { + return grid_y; + } else { + grid_y = val; + // call update() to redraw + } + } + }; +}(); + +$.glue.menu = function() +{ + var default_prio = 10; + var cur = false; + var m = {}; + var prev_menu = ''; + var spawn_coords = false; + + var close_menu = function(e) { + // close menu when clicking outside of an ui element + if (!$(e.target).hasClass('glue-ui') && $(e.target).parents('.glue-ui').length == 0) { + // this also unregisters the event + // when we close a menu like this we want to keep the name of the + // previous menu, hence false + $.glue.menu.hide(false); + } + }; + + $('.object').live('glue-select', function(e) { + // hide any menu when an object gets selected + if (cur) { + $.glue.menu.hide(); + } + }); + + return { + // hide any currently shown menus + hide: function(reset_prev_menu) { + // reset the previous menu, so we can launch the same menu immediately + // for almost all callers (except close_menu above) + if (reset_prev_menu === undefined || reset_prev_menu) { + prev_menu = ''; + } + if (cur) { + for (var i=0; i < cur.length; i++) { + $(cur[i].elem).trigger('glue-menu-deactivate'); + $(cur[i].elem).detach(); + } + cur = false; + } + $('body').unbind('click', close_menu); + }, + // return whether or not a menu is shown + // menu .. menu name (if undefined, any menu) + is_shown: function(menu) { + if (menu === undefined) { + if (cur) { + return true; + } else { + return false; + } + } else { + if (m[menu] && m[menu] == cur) { + return true; + } else { + return false; + } + } + }, + prev_menu: function() { + var ret = prev_menu; + prev_menu = ''; + return ret; + }, + // register a menu item + // menu .. menu name + // elem .. element to add + // prio .. priority (ascending) - optional + register: function(menu, elem, prio) { + if (!m[menu]) { + m[menu] = []; + } + if (prio === undefined) { + prio = default_prio; + } + // add sorted by prio ascending + var added = false; + for (var i=0; i < m[menu].length; i++) { + if (prio < m[menu][i].prio) { + m[menu].splice(i, 0, { 'elem': elem, 'prio': prio }); + added = true; + break; + } + } + if (!added) { + m[menu].push({ 'elem': elem, 'prio': prio }); + } + }, + // show a menu + // this also hides any currently shown menus + // menu .. menu name + // x, y .. window coordinates to launch the menu + show: function(menu, x, y) { + if (!m[menu]) { + return false; + } + // hide any active menu + if (cur) { + $.glue.menu.hide(); + } + // default x & y coordinates + if (x === undefined) { + x = $(window).width()/2; + } + if (y === undefined) { + y = $(window).height()/2; + } + var max_w = 0; + var max_h = 0; + cur = m[menu]; + // add items to dom + for (var i=0; i < cur.length; i++) { + var elem = cur[i].elem; + // set crucial css properties + $(elem).addClass('glue-menu-'+menu); + $(elem).addClass('glue-menu'); + $(elem).addClass('glue-ui'); + $(elem).css('left', x+'px'); + $(elem).css('position', 'fixed'); + $(elem).css('top', y+'px'); + $(elem).css('visibility', 'hidden'); + $(elem).css('z-index', '201'); + // add to dom + $('body').append(elem); + // calculate max width & height + // make sure you specify the width & height attribute for images etc + if (max_w < $(elem).outerWidth(true)) { + max_w = $(elem).outerWidth(true); + } + if (max_h < $(elem).outerHeight(true)) { + max_h = $(elem).outerHeight(true); + } + } + // position items + var num_rows = 1; + while (num_rows*num_rows < cur.length) { + num_rows++; + } + var cur_row = 0; + var cur_col = 0; + for (var i=0; i < cur.length; i++) { + var elem = cur[i].elem; + // trigger event + $(elem).trigger('glue-menu-activate'); + // check if we still want to show the icon ;) + if ($(elem).css('display') == 'none') { + continue; + } + if (cur_col == num_rows) { + cur_row++; + cur_col = 0; + } + // make visible + $(elem).css('opacity', '0.0'); + $(elem).css('visibility', ''); + $(elem).animate({ + left: (x-(num_rows*max_w)/2+cur_col*max_w)+'px', + opacity: 1.0, + top: (y-(num_rows*max_h)/2+cur_row*max_h)+'px' + }, 200); + cur_col++; + } + // register close menu event and set prev_menu + $('body').bind('click', close_menu); + prev_menu = menu; + // convert x, y to page and save them + spawn_coords = {x: $(document).scrollLeft()+x, y: $(document).scrollTop()+y}; + return true; + }, + spawn_coords: function() { + return spawn_coords; + } + }; +}(); + +$.glue.object = function() +{ + var alter_pre_save = {}; + var resize_prev_grid = false; + var reg_objs = {}; + + $('.resizable').live('glue-pre-clone', function(e) { + // remove the jqueryui resizable-related stuff from the object + $(this).removeClass('ui-resizable'); + $(this).children('.ui-resizable-handle').remove(); + }); + + $('.object').live('resize', function(e) { + // ignore grid when ctrl is pressed + if (e.ctrlKey) { + if ($(this).resizable('option', 'grid') !== false) { + // save previous setting + resize_prev_grid = $(this).resizable('option', 'grid'); + // disable grid + $(this).resizable('option', 'grid', false); + } + } else { + // reset previous setting + if (resize_prev_grid) { + $(this).resizable('option', 'grid', resize_prev_grid); + resize_prev_grid = false; + } + } + $.glue.object.resizable_update_tooltip(this); + $(this).trigger('glue-resize'); + }); + + $('.object').live('resizestart', function(e) { + $(this).trigger('glue-resizestart'); + }); + + $('.object').live('resizestop', function(e) { + // reset previous grid setting + if (resize_prev_grid) { + $(this).resizable('option', 'grid', resize_prev_grid); + resize_prev_grid = false; + } + $.glue.object.save(this); + $(this).trigger('glue-resizestop'); + $.glue.canvas.update(this); + }); + + $(document).ready(function() { + $.glue.object.register_alter_pre_save('resizable', function(obj, orig) { + // remove the jqueryui resizable-related stuff from the object + $(obj).removeClass('ui-resizable'); + $(obj).children('.ui-resizable-handle').remove(); + }); + $.glue.object.register_alter_pre_save('object', function(obj, orig) { + // remove the jqueryui draggable-related stuff from the object + $(obj).removeClass('ui-draggable-dragging'); + }); + $.glue.object.register_alter_pre_save('glue-selected', function(obj, orig) { + var border = $(orig).outerHeight()-$(orig).innerHeight(); + var p = $(orig).position(); + // remove class + $(obj).removeClass('glue-selected'); + // and remove border offset + $(obj).css('left', (p.left+border/2)+'px'); + $(obj).css('top', (p.top+border/2)+'px'); + //$(obj).css('width', ($(orig).width()+border)+'px'); + //$(obj).css('height', ($(orig).height()+border)+'px'); + }); + }); + + return { + // obj .. element + register: function(obj) { + // prevent double registration + if (reg_objs[$(obj).attr('id')]) { + return false; + } else { + reg_objs[$(obj).attr('id')] = true; + } + // make sure everything has a z-index + if (isNaN(parseInt($(obj).css('z-index')))) { + $(obj).css('z-index', $.glue.stack.default_z()); + } + // obj must have width & height for draggable to work + $(obj).draggable({ addClasses: false }); + // obj must not be an img element (otherwise resizable creates a + // wrapper which fucks things up) + if ($(obj).hasClass('resizable')) { + $(obj).resizable(); + $.glue.object.resizable_update_tooltip(obj); + } + $(obj).trigger('glue-register'); + $.glue.canvas.update(obj); + }, + register_alter_pre_save: function(cls, func) { + alter_pre_save[cls] = func; + }, + resizable_update_tooltip: function(obj) { + var p = $(obj).position(); + $(obj).children('.ui-resizable-handle').attr('title', $(obj).outerWidth()+'x'+$(obj).outerHeight()+' at '+p.left+'x'+p.top); + }, + save: function(obj) { + var elem = $(obj).clone(); + var elem_cls = $(elem).attr('class').replace(/\s+/, ' ').split(' '); + for (var i=0; i < elem_cls.length; i++) { + if (typeof alter_pre_save[elem_cls[i]] == 'function') { + alter_pre_save[elem_cls[i]](elem, obj); + } + } + // trim element content + // necessary, otherwise we'd be sending \n\t back again + $(elem).html($.trim($(elem).html())); + // convert to string + var html = $('<div></div>').html(elem).html(); + // DEBUG + //console.log(html); + $.glue.backend({ method: 'glue.save_state', 'html': html }); + }, + // obj .. element + unregister: function(obj) { + $(obj).trigger('glue-unregister'); + // can't update canvas here as object to be deleted is still in the + // dom + } + }; +}(); + +$.glue.sel = function() +{ + var drag_prev_grid = false; + var drag_prev_x = false; + var drag_prev_y = false; + var drag_start_x = false; + var drag_start_y = false; + var drag_mouse_start_x = false; + var drag_mouse_start_x = false; + var key_moving = false; + + // this could probably also be body + $('html').bind('click', function(e) { + if (e.target == $('body').get(0)) { + if ($('.glue-selected').length) { + // deselect when clicking on background + $.glue.sel.none(); + // prevent the menu from firing + e.stopImmediatePropagation(); + } + } + }); + + $('html').bind('keydown', function(e) { + if (e.which == 9) { + // cycle through all objects with tab key + if ($('.glue-selected').length < 2) { + var next = false; + if ($('.glue-selected').next('.object').length) { + next = $('.glue-selected').next('.object'); + } else { + next = $('.object').first(); + } + if (next) { + $.glue.sel.none(); + $.glue.sel.select(next); + // scroll to the selected objects if not currently visible + var window_min_x = $(document).scrollLeft(); + var window_max_x = window_min_x+$(window).width(); + var window_min_y = $(document).scrollTop(); + var window_max_y = window_min_y+$(window).height(); + var h = $(next).outerHeight(); + var p = $(next).position(); + var w = $(next).outerWidth(); + // fit the entire object on the screen + // TODO (later): scroll a bit more up/left for the any + // context menu to fit in there too + if (p.left < window_min_x) { + $(document).scrollLeft(p.left); + } else if (window_max_x < p.left+w) { + $(document).scrollLeft(window_min_x+p.left+w-window_max_x); + } + if (p.top < window_min_y) { + $(document).scrollTop(p.top); + } else if (window_max_y < p.top+h) { + $(document).scrollTop(window_min_y+p.top+h-window_max_y); + } + } + } + return false; + } else if (33 == e.which && e.shiftKey && $('.glue-selected').length) { + // shift+pageup: move objects to top of stack + // we can't use ctrl+page{up,down} as this cycles through tabs + // only prevent scrolling here + return false; + } else if (34 == e.which && e.shiftKey && $('.glue-selected').length) { + // shift+pageup: move objects to bottom of stack + return false; + } else if (37 <= e.which && e.which <= 40 && $('.glue-selected').length) { + // move selected elements with arrow keys + var add_x = 0; + var add_y = 0; + if (e.which == 38) { + add_y = -1; + } else if (e.which == 39) { + add_x = 1; + } else if (e.which == 40) { + add_y = 1; + } else if (e.which == 37) { + add_x = -1; + } + // shift multiplier + if (e.shiftKey) { + // this depends on the grid size + add_x *= $.glue.grid.x(); + add_y *= $.glue.grid.y(); + } + $('.glue-selected').each(function() { + var p = $(this).position(); + // prevent elements from going completely offscreen + if (1 < p.left+add_x+$(this).outerWidth()) { + $(this).css('left', (p.left+add_x)+'px'); + } + if (1 < p.top+add_y+$(this).outerHeight()) { + $(this).css('top', (p.top+add_y)+'px'); + } + }); + // scroll window if neccessary + // TODO (later): implement for moving multiple objects + if ($('.glue-selected').length == 1) { + var window_min_x = $(document).scrollLeft(); + var window_max_x = window_min_x+$(window).width(); + var window_min_y = $(document).scrollTop(); + var window_max_y = window_min_y+$(window).height(); + var elem = $('.glue-selected'); + var p = $(elem).position(); + var w = $(elem).outerWidth(); + var h = $(elem).outerHeight(); + if (p.left < window_min_x) { + $(document).scrollLeft(p.left); + } else if (window_max_x < p.left+w) { + $(document).scrollLeft(p.left+w); + } + if (p.top < window_min_y) { + $(document).scrollTop(p.top); + } else if (window_max_y < p.top+h) { + $(document).scrollTop(p.top+h); + } + } + // trigger event (once, cleared in keyup) + if (!key_moving) { + $('.glue-selected').trigger('glue-movestart'); + key_moving = true; + } + // prevent window scrolling + return false; + } else if (e.ctrlKey && e.which == 65) { + // select all objects + $('.object').not('.glue-selected').each(function() { + $.glue.sel.select($(this)); + }); + return false; + } else if (e.ctrlKey && e.which == 68) { + // select none + $.glue.sel.none(); + return false; + } else if (e.ctrlKey && e.which == 73) { + // invert selection + var next = $('.object').not('.glue-selected'); + $.glue.sel.none(); + $(next).each(function() { + $.glue.sel.select($(this)); + }); + return false; + } else { + // DEBUG + //console.log('html keydown '+e.which); + } + }); + + $('html').bind('keyup', function(e) { + if (33 == e.which && e.shiftKey && $('.glue-selected').length) { + // shift+pageup: move objects to top of stack + $('.glue-selected').each(function() { + $.glue.stack.to_top($(this)); + $.glue.object.save($(this)); + }); + $.glue.stack.compress(); + return false; + } else if (34 == e.which && e.shiftKey && $('.glue-selected').length) { + // shift+pagedown: move objects to bottom of stack + $('.glue-selected').each(function() { + $.glue.stack.to_bottom($(this)); + $.glue.object.save($(this)); + }); + $.glue.stack.compress(); + return false; + } else if (37 <= e.which && e.which <= 40 && $('.glue-selected').length) { + // move selected elements with arrow keys + $('.glue-selected').trigger('glue-movestop'); + key_moving = false; + return false; + } else if (e.which == 46 && $('.glue-selected').length) { + // delete selected objects + // this is pretty much copied from object-edit.js + var objs = $('.glue-selected'); + $(objs).each(function() { + var id = $(this).attr('id'); + $.glue.object.unregister($(this)); + $(this).remove(); + // delete in backend as well + $.glue.backend({ method: 'glue.delete_object', name: id }); + // update canvas + $.glue.canvas.update(); + }); + return false; + } else { + // DEBUG + //console.log('html keydown '+e.which); + } + }); + + $('.object').live('dragstart', function(e) { + // contrain to axis when dragging with shift key pressed + drag_start_x = $(this).position().left; + drag_start_y = $(this).position().top; + drag_mouse_start_x = e.pageX; + drag_mouse_start_y = e.pageY; + $(this).draggable('option', 'axis', false); + if (!$(this).hasClass('glue-selected')) { + // event for selected objects is triggered in the .glue-selected dragstart + // handler + $(this).trigger('glue-movestart'); + } + }); + + $('.object').live('dragstop', function(e) { + // reset previous grid setting + if (drag_prev_grid) { + $(this).draggable('option', 'grid', drag_prev_grid); + drag_prev_grid = false; + } + }); + + $('.object').live('drag', function(e) { + // ignore grid when ctrl is pressed + if (e.ctrlKey) { + if ($(this).draggable('option', 'grid') !== false) { + // save previous setting + drag_prev_grid = $(this).draggable('option', 'grid'); + // disable grid + $(this).draggable('option', 'grid', false); + } + } else { + // reset previous setting + if (drag_prev_grid) { + $(this).draggable('option', 'grid', drag_prev_grid); + drag_prev_grid = false; + } + } + // contrain to axis when dragging with shift key pressed + if (e.shiftKey) { + var dir; + if (Math.abs(e.pageX-drag_mouse_start_x) < Math.abs(e.pageY-drag_mouse_start_y)) { + dir = 'y'; + } else { + dir = 'x'; + } + var diff = Math.abs(Math.abs(e.pageX-drag_mouse_start_x)-Math.abs(e.pageY-drag_mouse_start_y)); + if ($(this).draggable('option', 'axis') == false) { + // move object back to the starting position + $(this).css('left', drag_start_x+'px'); + $(this).css('top', drag_start_y+'px'); + $(this).draggable('option', 'axis', dir); + } else { + // only change direction if difference is greater than 50 pixels + if (50 < diff && $(this).draggable('option', 'axis') != dir) { + // move object back to the starting position + $(this).css('left', drag_start_x+'px'); + $(this).css('top', drag_start_y+'px'); + $(this).draggable('option', 'axis', dir); + } + } + } else { + $(this).draggable('option', 'axis', false); + } + }); + + $('.object').live('dragstop', function(e) { + if (!$(this).hasClass('glue-selected')) { + // event for selected objects is triggered in the .glue-selected dragstop + // handler + $(this).trigger('glue-movestop'); + } + }); + + $('.glue-selected').live('drag', function(e) { + if (1 < $('.glue-selected').length) { + // dragging multiple selected object + var that = this; + var that_p = $(this).position(); + $('.glue-selected').each(function() { + if (this == that) { + return; + } + var p = $(this).position(); + $(this).css('left', (p.left+that_p.left-drag_prev_x)+'px'); + $(this).css('top', (p.top+that_p.top-drag_prev_y)+'px'); + }); + drag_prev_x = that_p.left; + drag_prev_y = that_p.top; + } + }); + + $('.glue-selected').live('dragstart', function(e) { + if (1 < $('.glue-selected').length) { + var p = $(this).position(); + drag_prev_x = p.left; + drag_prev_y = p.top; + } + $('.glue-selected').trigger('glue-movestart'); + }); + + $('.glue-selected').live('dragstop', function(e) { + // dragging multiple selected object + // there does not seem to be a drag event for the position where the + // mouse button is released, so the following is necessary + var that = this; + var that_p = $(this).position(); + $('.glue-selected').each(function() { + if (this == that) { + return; + } + var p = $(this).position(); + $(this).css('left', (p.left+that_p.left-drag_prev_x)+'px'); + $(this).css('top', (p.top+that_p.top-drag_prev_y)+'px'); + }); + $('.glue-selected').trigger('glue-movestop'); + }); + + $('.object').live('click', function(e) { + // TODO (later): moving objects after shift clicking on them does not seem to work right on Chrome, document and fill a bug upstream + if (!e.shiftKey && !$(this).hasClass('glue-selected')) { + $.glue.sel.none(); + } + if (e.shiftKey && $(this).hasClass('glue-selected')) { + $.glue.sel.deselect($(this)); + } else { + $.glue.sel.select($(this)); + } + }); + + $('.object').live('glue-movestop', function(e) { + // update tooltip + $.glue.object.resizable_update_tooltip(this); + // save object + $.glue.object.save(this); + // update canvas + $.glue.canvas.update(this); + }); + + $('.object').live('glue-unregister', function(e) { + $.glue.sel.deselect($(this)); + }); + + return { + // deselect an object + // obj .. element + deselect: function(obj) { + if ($(obj).hasClass('glue-selected')) { + var border = $(obj).outerHeight()-$(obj).innerHeight(); + $(obj).removeClass('glue-selected'); + $(obj).trigger('glue-deselect'); + var p = $(obj).position(); + $(obj).css('left', (p.left+border/2)+'px'); + $(obj).css('top', (p.top+border/2)+'px'); + //$(obj).css('width', ($(obj).width()+border)+'px'); + //$(obj).css('height', ($(obj).height()+border)+'px'); + // DEBUG + //console.log('deselected '+$(obj).attr('id')); + } + }, + // select none + none: function() { + $('.glue-selected').each(function() { + $.glue.sel.deselect($(this)); + }); + }, + // select an object + // obj .. element + select: function(obj) { + // TODO (later): handle more than one obj (and change callers) + if (!$(obj).hasClass('glue-selected')) { + $(obj).addClass('glue-selected'); + $(obj).trigger('glue-select'); + // TODO (later): the following code works for dashed borders but + // not for solid ones - read out the border-style on the fly and + // act accordingly (there seem to be a problem with getting the + // information through jQuery 1.4.3 however) + // also needs changes above and in register_alter_pre_save + var p = $(obj).position(); + var border = $(obj).outerHeight()-$(obj).innerHeight(); + $(obj).css('left', (p.left-border/2)+'px'); + $(obj).css('top', (p.top-border/2)+'px'); + //$(obj).css('width', ($(obj).width()-border)+'px'); + //$(obj).css('height', ($(obj).height()-border)+'px'); + // DEBUG + //console.log('selected '+$(obj).attr('id')); + } + }, + // return if an object is selected + // obj .. element + selected: function(obj) { + return $(obj).hasClass('glue-selected'); + } + }; +}(); + +$.glue.slider = function() +{ + return function(e, change, stop) { + var old_e = e; + var mousemove = function(e) { + if (typeof change == 'function') { + change(e.pageX-old_e.pageX, e.pageY-old_e.pageY, e); + } + return false; + }; + var mouseup = function(e) { + $('html').unbind('mousemove', mousemove); + $('html').unbind('mouseup', mouseup); + if (typeof change == 'function') { + change(e.pageX-old_e.pageX, e.pageY-old_e.pageY, e); + } + if (typeof stop == 'function') { + stop(e.pageX-old_e.pageX, e.pageY-old_e.pageY, e); + } + return false; + }; + $('html').bind('mousemove', mousemove); + $('html').bind('mouseup', mouseup); + }; +}(); + +$.glue.stack = function() +{ + var default_z = 100; + var max_z = 199; + var min_z = 0; + + var intersecting = function(a, b) { + var a_h = $(a).outerHeight(); + var a_p = $(a).position(); + var a_w = $(a).outerWidth(); + var b_h = $(b).outerHeight(); + var b_p = $(b).position(); + var b_w = $(b).outerWidth(); + if ((a_p.left <= b_p.left+b_w && b_p.left <= a_p.left+a_w) && + (a_p.top <= b_p.top+b_h && b_p.top <= a_p.top+a_h)) { + return true; + } else { + return false; + } + }; + + return { + compress: function() { + var max = min_z-1; + var min = max_z+1; + var shift = 0; + // get min and max z of all objects + $('.object').each(function() { + var z = parseInt($(this).css('z-index')); + if (isNaN(z)) { + return; + } + if (z < min) { + min = z; + } + if (max < z) { + max = z; + } + }); + // compress levels + for (var i=min; i<=max; i++) { + // for each z-index level + // check if there is an object in this level + var found = false; + $('.object').each(function() { + var z = parseInt($(this).css('z-index')); + if (isNaN(z)) { + return; + } else if (z == i) { + found = true; + } + }); + // if not, move all upper levels one down + if (!found) { + // DEBUG + //console.log('compressing level '+i); + max--; + $('.object').each(function() { + var z = parseInt($(this).css('z-index')); + if (isNaN(z)) { + return; + } else if (i < z) { + $(this).css('z-index', --z); + $(this).addClass('need_save'); + } + }); + } + } + // calculcate how much we want to shift all z's + shift = default_z-Math.round((max-min)/2)-min; + // DEBUG + //console.log('shift is '+shift); + if (Math.abs(shift) < 20) { + shift = 0; + } else { + $('.object').addClass('need_save'); + } + // save objects + $('.need_save').each(function() { + var z = parseInt($(this).css('z-index')); + if (!isNaN(z)) { + $(this).css('z-index', z+shift); + $.glue.object.save(this); + } + $(this).removeClass('need_save'); + }); + }, + default_z: function() { + return default_z; + }, + to_bottom: function(obj) { + var local_min_z = max_z+1; + var old_z = parseInt($(obj).css('z-index')); + $('.object').each(function() { + if (this == $(obj).get(0)) { + return; + } + if (!intersecting(obj, this)) { + return; + } else { + // DEBUG + //console.log('object intersects '+$(this).attr('id')); + } + if ($(this).css('z-index').length) { + var z = parseInt($(this).css('z-index')); + if (!isNaN(z) && z < local_min_z) { + local_min_z = z; + } + } + }); + // check if we need to update the object + if (isNaN(old_z) || local_min_z <= old_z) { + // check if we really found an intersecting element (otherwise + // local_min_z is max_z+1) and if we are inside min_z + if (local_min_z <= max_z && min_z < local_min_z) { + $(obj).css('z-index', local_min_z-1); + // DEBUG + //console.log('set z-index to '+(local_min_z-1)); + return true; + } + } + return false; + }, + to_top: function(obj) { + var local_max_z = min_z-1; + var old_z = parseInt($(obj).css('z-index')); + $('.object').each(function() { + if (this == $(obj).get(0)) { + return; + } + if (!intersecting(obj, this)) { + return; + } else { + // DEBUG + //console.log('object intersects '+$(this).attr('id')); + } + if ($(this).css('z-index').length) { + var z = parseInt($(this).css('z-index')); + if (!isNaN(z) && local_max_z < z) { + local_max_z = z; + } + } + }); + // check if we need to update the object + if (isNaN(old_z) || old_z <= local_max_z) { + // check if we really found an intersecting element (otherwise + // local_max_z is min_z-1) and if we are inside max_z + if (min_z <= local_max_z && local_max_z < max_z) { + $(obj).css('z-index', local_max_z+1); + // DEBUG + //console.log('set z-index to '+(local_max_z+1)); + return true; + } + } + return false; + } + }; +}(); + +$.glue.upload = function() +{ + // helper function that provides a default upload + // orig_x .. (page) x position of upload (can be set on the fly in .x) + // orig_y .. (page) y position of upload (can be set on the fly in .y) + // TODO (later): expose this through $.glue.upload.default_upload_handling + var default_upload_handling = function(orig_x, orig_y) { + if (orig_x === undefined) { + orig_x = 0; + } + if (orig_y === undefined) { + orig_y = 0; + } + var uploading = 0; + return { + error: function() { + // remove status indicator if no file uploading anymore + uploading--; + if (uploading == 0) { + $(this.status).detach(); + } + // e.target.status suggested in + // http://developer.mozilla.org/en/XMLHttpRequest/Using_XMLHttpRequest + $.glue.error('There was a problem uploading a file (status '+e.target.status+')'); + }, + finish: function(data) { + // DEBUG + //console.log('finished uploading'); + // remove status indicator if no file uploading anymore + uploading--; + if (uploading == 0) { + // DEBUG + //console.log('no files uploading anymore, removing status indicator'); + $(this.status).detach(); + } + // handle response + $.glue.upload.handle_response(data, this.x, this.y); + }, + progress: function(e) { + // update status indicator + // TODO (later): values are off on Chrome when uploading multiple file, one after another (it jumps back and forth) (report) + $(this.status).children('.glue-upload-statusbar-done').css('width', (e.loaded/e.total*100)+'%'); + $(this.status).attr('title', e.loaded+' of '+e.total+' bytes ('+(e.loaded/e.total*100).toFixed(1)+'%)'); + }, + start: function(e) { + // DEBUG + //console.log('started uploading'); + $.glue.menu.hide(); + uploading++; + // add status indicator to dom + $('body').append(this.status); + $(this.status).children('.glue-upload-statusbar-done').css('width', '0%'); + $(this.status).css('left', (this.x-$(this.status).outerWidth()/2)+'px'); + $(this.status).css('top', (this.y-$(this.status).outerHeight()/2)+'px'); + }, + status: $('<div class="glue-upload-statusbar glue-ui" style="position: absolute; z-index: 202;"><div class="glue-upload-statusbar-done"></div></div>'), + x: orig_x, + y: orig_y + } + }; + + $(document).ready(function() { + // generic upload button + var elem = $('<div style="height: 32px; max-height: 32px; max-width: 32px; overflow: hidden; width: 32px;"><img src="'+$.glue.base_url+'img/upload.png" alt="btn" width="32" height="32"></div>'); + var upload = default_upload_handling(); + upload.multiple = true; + $.glue.upload.button(elem, { method: 'glue.upload_files', page: $.glue.page }, upload); + $(elem).bind('click', function(e) { + // update x, y + var p = $.glue.menu.spawn_coords(); + upload.x = p.x; + upload.y = p.y; + }); + $.glue.menu.register('new', elem); + + // handle drop events on body + // this is based on http://developer.mozilla.org/en/using_files_from_web_applications + // does not seem to be possible in jQuery at the moment + // we use html here as body doesn't get enlarged when zooming out e.g. + $('html').get(0).addEventListener('dragover', function(e) { + e.stopPropagation(); + e.preventDefault(); + }, false); + $('html').get(0).addEventListener('drop', function(e) { + e.stopPropagation(); + e.preventDefault(); + // pageX, pageY are available in Firefox and Chrome + // TODO (later): pageX, pageY does not seem to handle zoomed pages in Chrome (report) + var upload = default_upload_handling(e.pageX, e.pageY); + $.glue.upload.files(e.dataTransfer.files, { method: 'glue.upload_files', page: $.glue.page }, upload); + }, false); + }); + + return { + // elem .. element to turn into a file button + // data .. other parameters to send to the service + // options .. multiple => allow multiple files to be uploaded (boolean, defaults to false) + // tooltip => title attribute on the file button + // abort => function called if the upload didn't start + // start => function called when the upload started + // progress => function called periodically during the upload + // error => function called when an error occured + // finish => function called after the upload has completed + button: function(elem, data, options) { + // add a file input to the element + if (!options) { + options = {}; + } + if (!options.tooltip) { + options.tooltip = 'upload a file'; + } + $(elem).prepend('<input type="file" title="'+options.tooltip+'" style="height: 100%; opacity: 0; position: absolute; width: 100%; z-index: 300;">'); + if (options.multiple) { + $(elem).children('input').first().attr('multiple', 'multiple'); + } + // add event handler + $(elem).children('input').first().bind('change', function(e) { + if (!this.files || this.files.length == 0) { + if (typeof options.abort == 'function') { + options.abort(); + } + return false; + } else { + $.glue.upload.files(this.files, data, options); + return false; + } + }); + }, + // files .. array of file-objects (see $.glue.upload.button) + // data .. other parameters to send to the service + // options .. abort => function called if the upload didn't start + // start => function called when the upload started + // progress => function called periodically during the upload + // error => function called when an error occured + // finish => function called after the upload has completed + files: function(files, data, options) { + // based on http://www.appelsiini.net/2009/10/html5-drag-and-drop-multiple-file-upload + // and jquery-html5-upload + if (!data) { + data = {}; + } + if (!options) { + options = {}; + } + var xhr = new XMLHttpRequest(); + if (typeof options.progress == 'function') { + // this is needed otherwise this is XMLHttpRequestUpload in the + // progress handler + xhr.upload['onprogress'] = function(e) { + options.progress(e); + } + } + if (typeof options.finish == 'function') { + xhr.onload = function(e) { + options.finish($.parseJSON(e.target.responseText)); + }; + } + if (typeof options.error == 'function') { + xhr.onerror = function(e) { + options.error(e); + } + } + xhr.open('POST', $.glue.base_url+'json.php', true); + if (window.FormData) { + // DEBUG + //console.log('upload: using FormData'); + var f = new FormData(); + // other parameters + for (var key in data) { + f.append(key, JSON.stringify(data[key])); + } + // files + for (var i=0; i < files.length; i++) { + f.append('user_file'+i, files[i]); + } + xhr.send(f); + if (typeof options.start == 'function') { + options.start(files); + } + return true; + } else if (files[0] && files[0].getAsBinary) { + // DEBUG + //console.log('upload: using getAsBinary'); + // build RFC2388 string + var boundary = '----multipartformboundary'+(new Date).getTime(); + var builder = ''; + // other parameters + for (var key in data) { + builder += '--'+boundary+'\r\n'; + builder += 'Content-Disposition: form-data; name="'+key+'"'+'\r\n'; + builder += '\r\n'; + builder += JSON.stringify(data[key])+'\r\n'; + } + // files + for (var i=0; i < files.length; i++) { + var file = files[i]; + builder += '--'+boundary+'\r\n'; + builder += 'Content-Disposition: form-data; name="user_file'+i+'"'; + if (file.fileName) { + builder += '; filename="'+file.fileName+'"'; + } + builder += '\r\n'; + if (file.type) { + builder += 'Content-Type: '+file.type+'\r\n'; + } else { + builder += 'Content-Type: application/octet-stream'+'\r\n'; + } + builder += '\r\n'; + builder += file.getAsBinary(); + builder += '\r\n'; + } + // mark end of request + builder += '--'+boundary+'--'+'\r\n'; + xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary='+boundary); + xhr.sendAsBinary(builder); + if (typeof options.start == 'function') { + options.start(files); + } + return true; + } else { + $.glue.error('Your browser is not supported. Update to a recent version of Firefox or Chrome.'); + if (typeof options.abort == 'function') { + options.abort(); + } + return false; + } + }, + handle_response: function(data, x, y) { + if (!data) { + $.glue.error('There was a problem communicating with the server'); + } else if (data['#error']) { + $.glue.error('There was a problem uploading the file ('+data['#data']+')'); + } else { + // add new elements to the dom and register them + if (data['#data'].length == 0) { + // special case for no new elements + $.glue.error('The server did not reply with any object. The file type you were uploading could either not be supported (look around for more modules!) or there could be an internal problem. Check the log file to be sure!'); + return; + } + // we're not selecting the new objects but at least clear the current selection + $.glue.sel.none(); + for (var i=0; i < data['#data'].length; i++) { + var obj = $(data['#data'][i]); + + // load event handler + var content_loaded = function(e) { + // function scope bites us in the ass here + var mode = e.data.mode; + var target_x = e.data.target_x; + var target_y = e.data.target_y; + if ($(this).hasClass('object')) { + var obj = $(this); + } else { + var obj = $(this).parents('.object').first(); + } + // set default width and height + $(obj).css('width', $(obj).width()+'px'); + $(obj).css('height', $(obj).height()+'px'); + // DEBUG + //console.log('glue-upload-dynamic-late: '+$(obj).attr('id')); + // fire handler (can overwrite width and height) + $(obj).trigger('glue-upload-dynamic-late', [ this ]); + // position object + if (mode == 'center') { + // move to the center of mouseclick + $(obj).css('left', (target_x-$(obj).outerWidth()/2)+'px'); + $(obj).css('top', (target_y-$(obj).outerHeight()/2)+'px'); + } else { + // move to stack + $(obj).css('left', (target_x+'px')); + $(obj).css('top', (target_y+'px')); + } + // restore visibility + $(obj).css('visibility', $(obj).data('orig_visibility')); + $(obj).removeData('orig_visibility'); + // register object + $.glue.object.register(obj); + // save object + $.glue.object.save(obj); + } + + // set mode and target x, y + if (data['#data'].length == 1) { + var mode = 'center'; + var target_x = x; + var target_y = y; + } else { + var mode = 'stack'; + var target_x = x+i*$.glue.grid.x(); + var target_y = y+i*$.glue.grid.y(); + } + // check if we have dimensions already + var width = parseInt($(obj).get(0).style.getPropertyValue('width')); + if (isNaN(width) || width === 0) { + // bind load event handlers + $(obj).bind('load', { 'mode': mode, 'target_x': target_x, 'target_y': target_y }, content_loaded); + $(obj).find('*').bind('load', { 'mode': mode, 'target_x': target_x, 'target_y': target_y }, content_loaded); + // save initial visibility and make object invisible + $(obj).data('orig_visibility', $(obj).css('visibility')); + $(obj).css('visibility', 'hidden'); + // add to dom + $('body').append(obj); + // DEBUG + //console.log('glue-upload-dynamic-early: '+$(obj).attr('id')); + // fire handler + $(obj).trigger('glue-upload-dynamic-early', [ mode, target_x, target_y ]); + } else { + // add to dom + $('body').append(obj); + // position object + if (mode == 'center') { + // move to the center of mouseclick + $(obj).css('left', (target_x-$(obj).outerWidth()/2)+'px'); + $(obj).css('top', (target_y-$(obj).outerHeight()/2)+'px'); + } else { + // move to stack + $(obj).css('left', (target_x+'px')); + $(obj).css('top', (target_y+'px')); + } + // register object + $.glue.object.register(obj); + // DEBUG + //console.log('registered static upload: '+$(obj).attr('id')); + // save object + $.glue.object.save(obj); + } + } + } + } + }; +}(); + + +$(document).ready(function() { + // register all objects + $('.object').each(function() { + $.glue.object.register($(this)); + }); + + // make sure we call enlarge body even if there are no objects + $.glue.canvas.update(); + + // enlarge body when we resize the window + var resize_timer; + $(window).bind('resize', function(e) { + clearTimeout(resize_timer); + resize_timer = setTimeout(function() { + $.glue.canvas.update(); + }, 100); + }); + + // trigger menus on click and doubleclick + var menu_dblclick_timeout = false; + $('html').bind('click', function(e) { + // we use 'html' here to give the colorpicker et al a chance to stop the + // propagation of the event in 'body' + if (e.target == $('body').get(0)) { + if (!$.glue.menu.is_shown()) { + if (menu_dblclick_timeout) { + clearTimeout(menu_dblclick_timeout); + menu_dblclick_timeout = false; + // show page menu + $.glue.menu.show('page', e.clientX, e.clientY); + return false; + } + menu_dblclick_timeout = setTimeout(function() { + menu_dblclick_timeout = false; + // prevent the new menu from showing when the user wants to + // simply clear any open menu + if ($.glue.menu.prev_menu() == '') { + // show new menu + $.glue.menu.show('new', e.clientX, e.clientY); + } + }, 300); + } + } + }); + + // I really don't know why, but when we don't handle the mousedown event here + // double-clicking the page does select some object (the first child of body + // on Firefox and the nearest element on Chrome) + $('html').bind('mousedown', function(e) { + return false; + }); +}); diff --git a/js/farbtastic.js b/js/farbtastic.js new file mode 100644 index 0000000..cdfb9e2 --- /dev/null +++ b/js/farbtastic.js @@ -0,0 +1,270 @@ +(function($) { + +$.fn.farbtastic = function (options) { + $.farbtastic(this, options); + return this; +}; + +$.farbtastic = function (container, callback) { + var container = $(container).get(0); + return container.farbtastic || (container.farbtastic = new $._farbtastic(container, callback)); +}; + +$._farbtastic = function (container, callback) { + // Store farbtastic object + var fb = this; + + // Insert markup + $(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>'); + var e = $('.farbtastic', container); + fb.wheel = $('.wheel', container).get(0); + // Dimensions + fb.radius = 84; + fb.square = 100; + fb.width = 194; + + // Fix background PNGs in IE6 + if (navigator.appVersion.match(/MSIE [0-6]\./)) { + $('*', e).each(function () { + if (this.currentStyle.backgroundImage != 'none') { + var image = this.currentStyle.backgroundImage; + image = this.currentStyle.backgroundImage.substring(5, image.length - 2); + $(this).css({ + 'backgroundImage': 'none', + 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')" + }); + } + }); + } + + /** + * Link to the given element(s) or callback. + */ + fb.linkTo = function (callback) { + // Unbind previous nodes + if (typeof fb.callback == 'object') { + $(fb.callback).unbind('keyup', fb.updateValue); + } + + // Reset color + fb.color = null; + + // Bind callback or elements + if (typeof callback == 'function') { + fb.callback = callback; + } + else if (typeof callback == 'object' || typeof callback == 'string') { + fb.callback = $(callback); + fb.callback.bind('keyup', fb.updateValue); + if (fb.callback.get(0).value) { + fb.setColor(fb.callback.get(0).value); + } + } + return this; + }; + fb.updateValue = function (event) { + if (this.value && this.value != fb.color) { + fb.setColor(this.value); + } + }; + + /** + * Change color with HTML syntax #123456 + */ + fb.setColor = function (color) { + var unpack = fb.unpack(color); + if (fb.color != color && unpack) { + fb.color = color; + fb.rgb = unpack; + fb.hsl = fb.RGBToHSL(fb.rgb); + fb.updateDisplay(); + } + return this; + }; + + /** + * Change color with HSL triplet [0..1, 0..1, 0..1] + */ + fb.setHSL = function (hsl) { + fb.hsl = hsl; + fb.rgb = fb.HSLToRGB(hsl); + fb.color = fb.pack(fb.rgb); + fb.updateDisplay(); + return this; + }; + + ///////////////////////////////////////////////////// + + /** + * Retrieve the coordinates of the given event relative to the center + * of the widget. + */ + fb.widgetCoords = function (event) { + var offset = $(fb.wheel).offset(); + return { x: (event.pageX - offset.left) - fb.width / 2, y: (event.pageY - offset.top) - fb.width / 2 }; + }; + + /** + * Mousedown handler + */ + fb.mousedown = function (event) { + // Capture mouse + if (!document.dragging) { + $(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup); + document.dragging = true; + } + + // Check which area is being dragged + var pos = fb.widgetCoords(event); + fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square; + + // Process + fb.mousemove(event); + return false; + }; + + /** + * Mousemove handler + */ + fb.mousemove = function (event) { + // Get coordinates relative to color picker center + var pos = fb.widgetCoords(event); + + // Set new HSL parameters + if (fb.circleDrag) { + var hue = Math.atan2(pos.x, -pos.y) / 6.28; + if (hue < 0) hue += 1; + fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]); + } + else { + var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5)); + var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5)); + fb.setHSL([fb.hsl[0], sat, lum]); + } + return false; + }; + + /** + * Mouseup handler + */ + fb.mouseup = function () { + // Uncapture mouse + $(document).unbind('mousemove', fb.mousemove); + $(document).unbind('mouseup', fb.mouseup); + document.dragging = false; + }; + + /** + * Update the markers and styles + */ + fb.updateDisplay = function () { + // Markers + var angle = fb.hsl[0] * 6.28; + $('.h-marker', e).css({ + left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px', + top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px' + }); + + $('.sl-marker', e).css({ + left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px', + top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px' + }); + + // Saturation/Luminance gradient + $('.color', e).css('backgroundColor', fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5]))); + + // Linked elements or callback + if (typeof fb.callback == 'object') { + // Set background/foreground color + $(fb.callback).css({ + backgroundColor: fb.color, + color: fb.hsl[2] > 0.5 ? '#000' : '#fff' + }); + + // Change linked value + $(fb.callback).each(function() { + if (this.value && this.value != fb.color) { + this.value = fb.color; + } + }); + } + else if (typeof fb.callback == 'function') { + fb.callback.call(fb, fb.color); + } + }; + + /* Various color utility functions */ + fb.pack = function (rgb) { + var r = Math.round(rgb[0] * 255); + var g = Math.round(rgb[1] * 255); + var b = Math.round(rgb[2] * 255); + return '#' + (r < 16 ? '0' : '') + r.toString(16) + + (g < 16 ? '0' : '') + g.toString(16) + + (b < 16 ? '0' : '') + b.toString(16); + }; + + fb.unpack = function (color) { + if (color.length == 7) { + return [parseInt('0x' + color.substring(1, 3)) / 255, + parseInt('0x' + color.substring(3, 5)) / 255, + parseInt('0x' + color.substring(5, 7)) / 255]; + } + else if (color.length == 4) { + return [parseInt('0x' + color.substring(1, 2)) / 15, + parseInt('0x' + color.substring(2, 3)) / 15, + parseInt('0x' + color.substring(3, 4)) / 15]; + } + }; + + fb.HSLToRGB = function (hsl) { + var m1, m2, r, g, b; + var h = hsl[0], s = hsl[1], l = hsl[2]; + m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s; + m1 = l * 2 - m2; + return [this.hueToRGB(m1, m2, h+0.33333), + this.hueToRGB(m1, m2, h), + this.hueToRGB(m1, m2, h-0.33333)]; + }; + + fb.hueToRGB = function (m1, m2, h) { + h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h); + if (h * 6 < 1) return m1 + (m2 - m1) * h * 6; + if (h * 2 < 1) return m2; + if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6; + return m1; + }; + + fb.RGBToHSL = function (rgb) { + var min, max, delta, h, s, l; + var r = rgb[0], g = rgb[1], b = rgb[2]; + min = Math.min(r, Math.min(g, b)); + max = Math.max(r, Math.max(g, b)); + delta = max - min; + l = (min + max) / 2; + s = 0; + if (l > 0 && l < 1) { + s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l)); + } + h = 0; + if (delta > 0) { + if (max == r && max != g) h += (g - b) / delta; + if (max == g && max != b) h += (2 + (b - r) / delta); + if (max == b && max != r) h += (4 + (r - g) / delta); + h /= 6; + } + return [h, s, l]; + }; + + // Install mousedown handler (the others are set on the document on-demand) + $('*', e).mousedown(fb.mousedown); + + // Init color + fb.setColor('#000000'); + + // Set linked elements/callback + if (callback) { + fb.linkTo(callback); + } +}; + +})(jQuery); diff --git a/js/farbtastic.min.js b/js/farbtastic.min.js new file mode 100644 index 0000000..10c9e76 --- /dev/null +++ b/js/farbtastic.min.js @@ -0,0 +1,8 @@ +(function(e){e.fn.farbtastic=function(f){e.farbtastic(this,f);return this};e.farbtastic=function(f,l){f=e(f).get(0);return f.farbtastic||(f.farbtastic=new e._farbtastic(f,l))};e._farbtastic=function(f,l){var a=this;e(f).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');var k=e(".farbtastic",f);a.wheel=e(".wheel",f).get(0);a.radius=84;a.square=100;a.width=194;navigator.appVersion.match(/MSIE [0-6]\./)&& +e("*",k).each(function(){if(this.currentStyle.backgroundImage!="none"){var b=this.currentStyle.backgroundImage;b=this.currentStyle.backgroundImage.substring(5,b.length-2);e(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+b+"')"})}});a.linkTo=function(b){typeof a.callback=="object"&&e(a.callback).unbind("keyup",a.updateValue);a.color=null;if(typeof b=="function")a.callback=b;else if(typeof b=="object"||typeof b=="string"){a.callback= +e(b);a.callback.bind("keyup",a.updateValue);a.callback.get(0).value&&a.setColor(a.callback.get(0).value)}return this};a.updateValue=function(){this.value&&this.value!=a.color&&a.setColor(this.value)};a.setColor=function(b){var c=a.unpack(b);if(a.color!=b&&c){a.color=b;a.rgb=c;a.hsl=a.RGBToHSL(a.rgb);a.updateDisplay()}return this};a.setHSL=function(b){a.hsl=b;a.rgb=a.HSLToRGB(b);a.color=a.pack(a.rgb);a.updateDisplay();return this};a.widgetCoords=function(b){var c=e(a.wheel).offset();return{x:b.pageX- +c.left-a.width/2,y:b.pageY-c.top-a.width/2}};a.mousedown=function(b){if(!document.dragging){e(document).bind("mousemove",a.mousemove).bind("mouseup",a.mouseup);document.dragging=true}var c=a.widgetCoords(b);a.circleDrag=Math.max(Math.abs(c.x),Math.abs(c.y))*2>a.square;a.mousemove(b);return false};a.mousemove=function(b){var c=a.widgetCoords(b);if(a.circleDrag){b=Math.atan2(c.x,-c.y)/6.28;if(b<0)b+=1;a.setHSL([b,a.hsl[1],a.hsl[2]])}else{b=Math.max(0,Math.min(1,-(c.x/a.square)+0.5));c=Math.max(0,Math.min(1, +-(c.y/a.square)+0.5));a.setHSL([a.hsl[0],b,c])}return false};a.mouseup=function(){e(document).unbind("mousemove",a.mousemove);e(document).unbind("mouseup",a.mouseup);document.dragging=false};a.updateDisplay=function(){var b=a.hsl[0]*6.28;e(".h-marker",k).css({left:Math.round(Math.sin(b)*a.radius+a.width/2)+"px",top:Math.round(-Math.cos(b)*a.radius+a.width/2)+"px"});e(".sl-marker",k).css({left:Math.round(a.square*(0.5-a.hsl[1])+a.width/2)+"px",top:Math.round(a.square*(0.5-a.hsl[2])+a.width/2)+"px"}); +e(".color",k).css("backgroundColor",a.pack(a.HSLToRGB([a.hsl[0],1,0.5])));if(typeof a.callback=="object"){e(a.callback).css({backgroundColor:a.color,color:a.hsl[2]>0.5?"#000":"#fff"});e(a.callback).each(function(){if(this.value&&this.value!=a.color)this.value=a.color})}else typeof a.callback=="function"&&a.callback.call(a,a.color)};a.pack=function(b){var c=Math.round(b[0]*255),d=Math.round(b[1]*255);b=Math.round(b[2]*255);return"#"+(c<16?"0":"")+c.toString(16)+(d<16?"0":"")+d.toString(16)+(b<16?"0": +"")+b.toString(16)};a.unpack=function(b){if(b.length==7)return[parseInt("0x"+b.substring(1,3))/255,parseInt("0x"+b.substring(3,5))/255,parseInt("0x"+b.substring(5,7))/255];else if(b.length==4)return[parseInt("0x"+b.substring(1,2))/15,parseInt("0x"+b.substring(2,3))/15,parseInt("0x"+b.substring(3,4))/15]};a.HSLToRGB=function(b){var c,d=b[0];c=b[1];b=b[2];c=b<=0.5?b*(c+1):b+c-b*c;b=b*2-c;return[this.hueToRGB(b,c,d+0.33333),this.hueToRGB(b,c,d),this.hueToRGB(b,c,d-0.33333)]};a.hueToRGB=function(b,c, +d){d=d<0?d+1:d>1?d-1:d;if(d*6<1)return b+(c-b)*d*6;if(d*2<1)return c;if(d*3<2)return b+(c-b)*(0.66666-d)*6;return b};a.RGBToHSL=function(b){var c,d,m,g,h=b[0],i=b[1],j=b[2];c=Math.min(h,Math.min(i,j));b=Math.max(h,Math.max(i,j));d=b-c;g=(c+b)/2;m=0;if(g>0&&g<1)m=d/(g<0.5?2*g:2-2*g);c=0;if(d>0){if(b==h&&b!=i)c+=(i-j)/d;if(b==i&&b!=j)c+=2+(j-h)/d;if(b==j&&b!=h)c+=4+(h-i)/d;c/=6}return[c,m,g]};e("*",k).mousedown(a.mousedown);a.setColor("#000000");l&&a.linkTo(l)}})(jQuery); diff --git a/js/glue.js b/js/glue.js new file mode 100644 index 0000000..ba3e98b --- /dev/null +++ b/js/glue.js @@ -0,0 +1,73 @@ +/** + * js/glue.js + * Auxiliary hotglue frontend code + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +// create dummy console functions +if (!window.console) { + console = {}; +} +console.log = console.log || function(){}; +console.error = console.error || function(){}; +console.warn = console.warn || function(){}; +console.info = console.info || function(){}; + +$.glue = {}; + +// communication with the backend +$.glue.backend = function() +{ + $(document).ready(function() { + $(this).ajaxError(function(e, xhr, options, err) { + if (xhr.readyState == 0 || xhr.status == 0) { + // not really an error + // these happen when navigating away while a ajax request is in flight + // see http://stackoverflow.com/questions/866771/jquery-ambiguous-ajax-error + } else { + $.glue.error('There was a problem communicating with the server (ready state '+xhr.readyState+', status '+ xhr.status+')'); + } + }); + }); + + return function(param, func, print_errors) { + // ten seconds timeout + $.ajaxSetup({ timeout: 10000 }); + // make sure parameters are json encoded + // otherwise we would get complaints from the php parser for empty + // strings, arrays and thelike + for (p in param) { + param[p] = JSON.stringify(param[p]); + } + $.post($.glue.base_url+'json.php', param, function(data) { + if (print_errors === undefined) { + print_errors = true; + } + if (data === null) { + if (print_errors) { + $.glue.error('There was a problem communicating with the server'); + } else if (typeof func == 'function') { + func({ '#error': true, '#data':'There was a problem communicating with the server' }); + } + } else if (print_errors) { + if (data['#error']) { + $.glue.error(data['#data']); + } else if (typeof func == 'function') { + func(data['#data']); + } + } else if (typeof func == 'function') { + func(data); + } + }, 'json'); + }; +}(); + +$.glue.error = function() +{ + return function(s) { + alert('The glue gun manufacturer says: '+s); + }; +}(); diff --git a/js/jquery-1.4.4.js b/js/jquery-1.4.4.js new file mode 100644 index 0000000..a4f1145 --- /dev/null +++ b/js/jquery-1.4.4.js @@ -0,0 +1,7179 @@ +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + rwhite = /\s/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for non-word characters + rnonword = /\W/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && !rnonword.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.4", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + // A third-party is pushing the ready event forwards + if ( wait === true ) { + jQuery.readyWait--; + } + + // Make sure that the DOM is not already loaded + if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, + i = 0, + ready = readyList; + + // Reset the list of functions + readyList = null; + + while ( (fn = ready[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test(data.replace(rvalidescape, "@") + .replace(rvalidtokens, "]") + .replace(rvalidbraces, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() {}, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type(array); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can be optionally by executed if its a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + return indexOf.call( array, elem ); + }; +} + +// Verify that \s matches non-breaking spaces +// (IE fails on this test) +if ( !rwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +// Expose jQuery to the global object +return (window.jQuery = window.$ = jQuery); + +})(); + + +(function() { + + jQuery.support = {}; + + var root = document.documentElement, + script = document.createElement("script"), + div = document.createElement("div"), + id = "script" + jQuery.now(); + + div.style.display = "none"; + div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0], + select = document.createElement("select"), + opt = select.appendChild( document.createElement("option") ); + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType === 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55$/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: div.getElementsByTagName("input")[0].value === "on", + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Will be defined later + deleteExpando: true, + optDisabled: false, + checkClone: false, + scriptEval: false, + noCloneEvent: true, + boxModel: null, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableHiddenOffsets: true + }; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as diabled) + select.disabled = true; + jQuery.support.optDisabled = !opt.disabled; + + script.type = "text/javascript"; + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e) {} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + jQuery.support.scriptEval = true; + delete window[ id ]; + } + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete script.test; + + } catch(e) { + jQuery.support.deleteExpando = false; + } + + root.removeChild( script ); + + if ( div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function click() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", click); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + div = document.createElement("div"); + div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>"; + + var fragment = document.createDocumentFragment(); + fragment.appendChild( div.firstChild ); + + // WebKit doesn't clone checked state correctly in fragments + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function() { + var div = document.createElement("div"); + div.style.width = div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + + if ( "zoom" in div.style ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "<div style='width:4px;'></div>"; + jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + } + + div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>"; + var tds = div.getElementsByTagName("td"); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; + + tds[0].style.display = ""; + tds[1].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE < 8 fail this test) + jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; + div.innerHTML = ""; + + document.body.removeChild( div ).style.display = "none"; + div = tds = null; + }); + + // Technique from Juriy Zaytsev + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; + }; + + jQuery.support.submitBubbles = eventSupported("submit"); + jQuery.support.changeBubbles = eventSupported("change"); + + // release memory in IE + root = script = div = all = a = null; +})(); + + + +var windowData = {}, + rbrace = /^(?:\{.*\}|\[.*\])$/; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + expando: "jQuery" + jQuery.now(), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + data: function( elem, name, data ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : null, + cache = jQuery.cache, thisCache; + + if ( isNode && !id && typeof name === "string" && data === undefined ) { + return; + } + + // Get the data from the object directly + if ( !isNode ) { + cache = elem; + + // Compute a unique ID for the element + } else if ( !id ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + if ( isNode ) { + cache[ id ] = jQuery.extend(cache[ id ], name); + + } else { + jQuery.extend( cache, name ); + } + + } else if ( isNode && !cache[ id ] ) { + cache[ id ] = {}; + } + + thisCache = isNode ? cache[ id ] : cache; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : elem, + cache = jQuery.cache, + thisCache = isNode ? cache[ id ] : id; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( isNode && jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( isNode && jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + + // Completely remove the data cache + } else if ( isNode ) { + delete cache[ id ]; + + // Remove all fields from the object + } else { + for ( var n in elem ) { + delete elem[ n ]; + } + } + } + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + var attr = this[0].attributes, name; + data = jQuery.data( this[0] ); + + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = name.substr( 5 ); + dataAttr( this[0], name, data[ name ] ); + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + data = elem.getAttribute( "data-" + key ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + + + + +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + } +}); + + + + +var rclass = /[\n\t]/g, + rspaces = /\s+/, + rreturn = /\r/g, + rspecialurl = /^(?:href|src|style)$/, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rradiocheck = /^(?:radio|checkbox)$/i; + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", + setClass = elem.className; + + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspaces ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + if ( !arguments.length ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray(val) ) { + val = jQuery.map(val, function (value) { + return value == null ? "" : value + ""; + }); + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + // 'in' checks fail in Blackberry 4.7 #6931 + if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + if ( value === null ) { + if ( elem.nodeType === 1 ) { + elem.removeAttribute( name ); + } + + } else { + elem[ name ] = value; + } + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + // Ensure that missing attributes return undefined + // Blackberry 4.7 returns "" from getAttribute #6938 + if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { + return undefined; + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } +}); + + + + +var rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspace = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }, + focusCounts = { focusin: 0, focusout: 0 }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + // Use a key less likely to result in collisions for plain JS objects. + // Fixes bug #7150. + var eventKey = elem.nodeType ? "events" : "__events__", + events = elemData[ eventKey ], + eventHandle = elemData.handle; + + if ( typeof events === "function" ) { + // On plain objects events is a fn that holds the the data + // which prevents this data from being JSON serialized + // the function does not need to be called, it just contains the data + eventHandle = events.handle; + events = events.events; + + } else if ( !events ) { + if ( !elem.nodeType ) { + // On plain objects, create a fn that acts as the holder + // of the values to avoid JSON serialization of event data + elemData[ eventKey ] = elemData = function(){}; + } + + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, pos ) { + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + eventKey = elem.nodeType ? "events" : "__events__", + elemData = jQuery.data( elem ), + events = elemData && elemData[ eventKey ]; + + if ( !elemData || !events ) { + return; + } + + if ( typeof events === "function" ) { + elemData = events; + events = events.events; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( typeof elemData === "function" ) { + jQuery.removeData( elem, eventKey ); + + } else if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = elem.nodeType ? + jQuery.data( elem, "handle" ) : + (jQuery.data( elem, "__events__" ) || {}).handle; + + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + event.preventDefault(); + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (inlineError) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var old, + target = event.target, + targetType = type.replace( rnamespaces, "" ), + isClick = jQuery.nodeName( target, "a" ) && targetType === "click", + special = jQuery.event.special[ targetType ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ targetType ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + targetType ]; + + if ( old ) { + target[ "on" + targetType ] = null; + } + + jQuery.event.triggered = true; + target[ targetType ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (triggerError) {} + + if ( old ) { + target[ "on" + targetType ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + var all, handlers, namespaces, namespace_re, events, + namespace_sort = [], + args = jQuery.makeArray( arguments ); + + event = args[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace_sort = namespaces.slice(0).sort(); + namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.namespace = event.namespace || namespace_sort.join("."); + + events = jQuery.data(this, this.nodeType ? "events" : "__events__"); + + if ( typeof events === "function" ) { + events = events.events; + } + + handlers = (events || {})[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, + body = document.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + if ( focusCounts[fix]++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --focusCounts[fix] === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.trigger( e, null, e.target ); + } + }); +} + +jQuery.each(["bind", "one"], function( i, name ) { + jQuery.fn[ name ] = function( type, data, fn ) { + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ name ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) || data === false ) { + fn = data; + data = undefined; + } + + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + if ( type === "unload" && name !== "one" ) { + this.one( type, data, fn ); + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.add( this[i], type, handler, data ); + } + } + + return this; + }; +}); + +jQuery.fn.extend({ + unbind: function( type, fn ) { + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +jQuery.each(["live", "die"], function( i, name ) { + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { + var type, i = 0, match, namespaces, preType, + selector = origSelector || this.selector, + context = origSelector ? this : jQuery( this.context ); + + if ( typeof types === "object" && !types.preventDefault ) { + for ( var key in types ) { + context[ name ]( key, data, types[key], selector ); + } + + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split(" "); + + while ( (type = types[ i++ ]) != null ) { + match = rnamespaces.exec( type ); + namespaces = ""; + + if ( match ) { + namespaces = match[0]; + type = type.replace( rnamespaces, "" ); + } + + if ( type === "hover" ) { + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); + continue; + } + + preType = type; + + if ( type === "focus" || type === "blur" ) { + types.push( liveMap[ type ] + namespaces ); + type = type + namespaces; + + } else { + type = (liveMap[ type ] || type) + namespaces; + } + + if ( name === "live" ) { + // bind live handler + for ( var j = 0, l = context.length; j < l; j++ ) { + jQuery.event.add( context[j], "live." + liveConvert( type, selector ), + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); + } + + } else { + // unbind live handler + context.unbind( "live." + liveConvert( type, selector ), fn ); + } + } + + return this; + }; +}); + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery.data( this, this.nodeType ? "events" : "__events__" ); + + if ( typeof events === "function" ) { + events = events.events; + } + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); +} + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.bind( name, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } +}); + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + jQuery(window).bind("unload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} + + +/*! + * Sizzle CSS Selector Engine - v1.0 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName( "*" ); + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !/\W/.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + return context.getElementsByTagName( match[1] ); + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace(/\\/g, ""); + }, + + TAG: function( match, curLoop ) { + return match[1].toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + return "text" === elem.type; + }, + radio: function( elem ) { + return "radio" === elem.type; + }, + + checkbox: function( elem ) { + return "checkbox" === elem.type; + }, + + file: function( elem ) { + return "file" === elem.type; + }, + password: function( elem ) { + return "password" === elem.type; + }, + + submit: function( elem ) { + return "submit" === elem.type; + }, + + image: function( elem ) { + return "image" === elem.type; + }, + + reset: function( elem ) { + return "reset" === elem.type; + }, + + button: function( elem ) { + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // If the nodes are siblings (or identical) we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = "<a name='" + id + "'/>"; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = "<a href='#'></a>"; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "<p class='TEST'></p>"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Make sure that attribute selectors are quoted + query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + if ( context.nodeType === 9 ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var old = context.getAttribute( "id" ), + nid = old || id; + + if ( !old ) { + context.setAttribute( "id", nid ); + } + + try { + return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra ); + + } catch(pseudoError) { + } finally { + if ( !old ) { + context.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + if ( matches ) { + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + return matches.call( node, expr ); + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "<div class='test e'></div><div class='test'></div>"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS; + +jQuery.fn.extend({ + find: function( selector ) { + var ret = this.pushStack( "", "find", selector ), + length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + var pos = POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique(ret) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context || this.context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call(arguments).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /<tbody/i, + rhtml = /<|&#?\w+;/, + rnocache = /<(?:script|object|embed|option|style)/i, + // checked="checked" or checked (html5) + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + raction = /\=([^="'>\s]+\/)>/g, + wrapMap = { + option: [ 1, "<select multiple='multiple'>", "</select>" ], + legend: [ 1, "<fieldset>", "</fieldset>" ], + thead: [ 1, "<table>", "</table>" ], + tr: [ 2, "<table><tbody>", "</tbody></table>" ], + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], + col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], + area: [ 1, "<map>", "</map>" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize <link> and <script> tags normally +if ( !jQuery.support.htmlSerialize ) { + wrapMap._default = [ 1, "div<div>", "</div>" ]; +} + +jQuery.fn.extend({ + text: function( text ) { + if ( jQuery.isFunction(text) ) { + return this.each(function(i) { + var self = jQuery( this ); + + self.text( text.call(this, i, self.text()) ); + }); + } + + if ( typeof text !== "object" && text !== undefined ) { + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + } + + return jQuery.text( this ); + }, + + wrapAll: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapAll( html.call(this, i) ); + }); + } + + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); + + if ( this[0].parentNode ) { + wrap.insertBefore( this[0] ); + } + + wrap.map(function() { + var elem = this; + + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { + elem = elem.firstChild; + } + + return elem; + }).append(this); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapInner( html.call(this, i) ); + }); + } + + return this.each(function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + }); + }, + + wrap: function( html ) { + return this.each(function() { + jQuery( this ).wrapAll( html ); + }); + }, + + unwrap: function() { + return this.parent().each(function() { + if ( !jQuery.nodeName( this, "body" ) ) { + jQuery( this ).replaceWith( this.childNodes ); + } + }).end(); + }, + + append: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 ) { + this.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 ) { + this.insertBefore( elem, this.firstChild ); + } + }); + }, + + before: function() { + if ( this[0] && this[0].parentNode ) { + return this.domManip(arguments, false, function( elem ) { + this.parentNode.insertBefore( elem, this ); + }); + } else if ( arguments.length ) { + var set = jQuery(arguments[0]); + set.push.apply( set, this.toArray() ); + return this.pushStack( set, "before", arguments ); + } + }, + + after: function() { + if ( this[0] && this[0].parentNode ) { + return this.domManip(arguments, false, function( elem ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + } else if ( arguments.length ) { + var set = this.pushStack( this, "after", arguments ); + set.push.apply( set, jQuery(arguments[0]).toArray() ); + return set; + } + }, + + // keepData is for internal use only--do not document + remove: function( selector, keepData ) { + for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { + if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( elem.getElementsByTagName("*") ); + jQuery.cleanData( [ elem ] ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } + } + } + + return this; + }, + + empty: function() { + for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( elem.getElementsByTagName("*") ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + } + + return this; + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function() { + if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var html = this.outerHTML, + ownerDocument = this.ownerDocument; + + if ( !html ) { + var div = ownerDocument.createElement("div"); + div.appendChild( this.cloneNode(true) ); + html = div.innerHTML; + } + + return jQuery.clean([html.replace(rinlinejQuery, "") + // Handle the case in IE 8 where action=/test/> self-closes a tag + .replace(raction, '="$1">') + .replace(rleadingWhitespace, "")], ownerDocument)[0]; + } else { + return this.cloneNode(true); + } + }); + + // Copy the events from the original to the clone + if ( events === true ) { + cloneCopyEvent( this, ret ); + cloneCopyEvent( this.find("*"), ret.find("*") ); + } + + // Return the cloned set + return ret; + }, + + html: function( value ) { + if ( value === undefined ) { + return this[0] && this[0].nodeType === 1 ? + this[0].innerHTML.replace(rinlinejQuery, "") : + null; + + // See if we can take a shortcut and just use innerHTML + } else if ( typeof value === "string" && !rnocache.test( value ) && + (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && + !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { + + value = value.replace(rxhtmlTag, "<$1></$2>"); + + try { + for ( var i = 0, l = this.length; i < l; i++ ) { + // Remove element nodes and prevent memory leaks + if ( this[i].nodeType === 1 ) { + jQuery.cleanData( this[i].getElementsByTagName("*") ); + this[i].innerHTML = value; + } + } + + // If using innerHTML throws an exception, use the fallback method + } catch(e) { + this.empty().append( value ); + } + + } else if ( jQuery.isFunction( value ) ) { + this.each(function(i){ + var self = jQuery( this ); + + self.html( value.call(this, i, self.html()) ); + }); + + } else { + this.empty().append( value ); + } + + return this; + }, + + replaceWith: function( value ) { + if ( this[0] && this[0].parentNode ) { + // Make sure that the elements are removed from the DOM before they are inserted + // this can help fix replacing a parent with child elements + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this), old = self.html(); + self.replaceWith( value.call( this, i, old ) ); + }); + } + + if ( typeof value !== "string" ) { + value = jQuery( value ).detach(); + } + + return this.each(function() { + var next = this.nextSibling, + parent = this.parentNode; + + jQuery( this ).remove(); + + if ( next ) { + jQuery(next).before( value ); + } else { + jQuery(parent).append( value ); + } + }); + } else { + return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ); + } + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, table, callback ) { + var results, first, fragment, parent, + value = args[0], + scripts = []; + + // We can't cloneNode fragments that contain checked, in WebKit + if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { + return this.each(function() { + jQuery(this).domManip( args, table, callback, true ); + }); + } + + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + args[0] = value.call(this, i, table ? self.html() : undefined); + self.domManip( args, table, callback ); + }); + } + + if ( this[0] ) { + parent = value && value.parentNode; + + // If we're in a fragment, just use that instead of building a new one + if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { + results = { fragment: parent }; + + } else { + results = jQuery.buildFragment( args, this, scripts ); + } + + fragment = results.fragment; + + if ( fragment.childNodes.length === 1 ) { + first = fragment = fragment.firstChild; + } else { + first = fragment.firstChild; + } + + if ( first ) { + table = table && jQuery.nodeName( first, "tr" ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + callback.call( + table ? + root(this[i], first) : + this[i], + i > 0 || results.cacheable || this.length > 1 ? + fragment.cloneNode(true) : + fragment + ); + } + } + + if ( scripts.length ) { + jQuery.each( scripts, evalScript ); + } + } + + return this; + } +}); + +function root( elem, cur ) { + return jQuery.nodeName(elem, "table") ? + (elem.getElementsByTagName("tbody")[0] || + elem.appendChild(elem.ownerDocument.createElement("tbody"))) : + elem; +} + +function cloneCopyEvent(orig, ret) { + var i = 0; + + ret.each(function() { + if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) { + return; + } + + var oldData = jQuery.data( orig[i++] ), + curData = jQuery.data( this, oldData ), + events = oldData && oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( var type in events ) { + for ( var handler in events[ type ] ) { + jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); + } + } + } + }); +} + +jQuery.buildFragment = function( args, nodes, scripts ) { + var fragment, cacheable, cacheresults, + doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); + + // Only cache "small" (1/2 KB) strings that are associated with the main document + // Cloning options loses the selected state, so don't cache them + // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment + // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache + if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && + !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { + + cacheable = true; + cacheresults = jQuery.fragments[ args[0] ]; + if ( cacheresults ) { + if ( cacheresults !== 1 ) { + fragment = cacheresults; + } + } + } + + if ( !fragment ) { + fragment = doc.createDocumentFragment(); + jQuery.clean( args, doc, fragment, scripts ); + } + + if ( cacheable ) { + jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; + } + + return { fragment: fragment, cacheable: cacheable }; +}; + +jQuery.fragments = {}; + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var ret = [], + insert = jQuery( selector ), + parent = this.length === 1 && this[0].parentNode; + + if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { + insert[ original ]( this[0] ); + return this; + + } else { + for ( var i = 0, l = insert.length; i < l; i++ ) { + var elems = (i > 0 ? this.clone(true) : this).get(); + jQuery( insert[i] )[ original ]( elems ); + ret = ret.concat( elems ); + } + + return this.pushStack( ret, name, insert.selector ); + } + }; +}); + +jQuery.extend({ + clean: function( elems, context, fragment, scripts ) { + context = context || document; + + // !context.createElement fails in IE with an error but returns typeof 'object' + if ( typeof context.createElement === "undefined" ) { + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + } + + var ret = []; + + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + if ( typeof elem === "number" ) { + elem += ""; + } + + if ( !elem ) { + continue; + } + + // Convert html string into DOM nodes + if ( typeof elem === "string" && !rhtml.test( elem ) ) { + elem = context.createTextNode( elem ); + + } else if ( typeof elem === "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(rxhtmlTag, "<$1></$2>"); + + // Trim whitespace, otherwise indexOf won't work as expected + var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(), + wrap = wrapMap[ tag ] || wrapMap._default, + depth = wrap[0], + div = context.createElement("div"); + + // Go to html and back, then peel off extra wrappers + div.innerHTML = wrap[1] + elem + wrap[2]; + + // Move to the right depth + while ( depth-- ) { + div = div.lastChild; + } + + // Remove IE's autoinserted <tbody> from table fragments + if ( !jQuery.support.tbody ) { + + // String was a <table>, *may* have spurious <tbody> + var hasBody = rtbody.test(elem), + tbody = tag === "table" && !hasBody ? + div.firstChild && div.firstChild.childNodes : + + // String was a bare <thead> or <tfoot> + wrap[1] === "<table>" && !hasBody ? + div.childNodes : + []; + + for ( var j = tbody.length - 1; j >= 0 ; --j ) { + if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { + tbody[ j ].parentNode.removeChild( tbody[ j ] ); + } + } + + } + + // IE completely kills leading whitespace when innerHTML is used + if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { + div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); + } + + elem = div.childNodes; + } + + if ( elem.nodeType ) { + ret.push( elem ); + } else { + ret = jQuery.merge( ret, elem ); + } + } + + if ( fragment ) { + for ( i = 0; ret[i]; i++ ) { + if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { + scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); + + } else { + if ( ret[i].nodeType === 1 ) { + ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); + } + fragment.appendChild( ret[i] ); + } + } + } + + return ret; + }, + + cleanData: function( elems ) { + var data, id, cache = jQuery.cache, + special = jQuery.event.special, + deleteExpando = jQuery.support.deleteExpando; + + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { + continue; + } + + id = elem[ jQuery.expando ]; + + if ( id ) { + data = cache[ id ]; + + if ( data && data.events ) { + for ( var type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + if ( deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + } + + delete cache[ id ]; + } + } + } +}); + +function evalScript( i, elem ) { + if ( elem.src ) { + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + } else { + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } +} + + + + +var ralpha = /alpha\([^)]*\)/i, + ropacity = /opacity=([^)]*)/, + rdashAlpha = /-([a-z])/ig, + rupper = /([A-Z])/g, + rnumpx = /^-?\d+(?:px)?$/i, + rnum = /^-?\d/, + + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssWidth = [ "Left", "Right" ], + cssHeight = [ "Top", "Bottom" ], + curCSS, + + getComputedStyle, + currentStyle, + + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn.css = function( name, value ) { + // Setting 'undefined' is a no-op + if ( arguments.length === 2 && value === undefined ) { + return this; + } + + return jQuery.access( this, name, value, true, function( elem, name, value ) { + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }); +}; + +jQuery.extend({ + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity", "opacity" ); + return ret === "" ? "1" : ret; + + } else { + return elem.style.opacity; + } + } + } + }, + + // Exclude the following css properties to add px + cssNumber: { + "zIndex": true, + "fontWeight": true, + "opacity": true, + "zoom": true, + "lineHeight": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + // normalize float css property + "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, origName = jQuery.camelCase( name ), + style = elem.style, hooks = jQuery.cssHooks[ origName ]; + + name = jQuery.cssProps[ origName ] || origName; + + // Check if we're setting a value + if ( value !== undefined ) { + // Make sure that NaN and null values aren't set. See: #7116 + if ( typeof value === "number" && isNaN( value ) || value == null ) { + return; + } + + // If a number was passed in, add 'px' to the (except for certain CSS properties) + if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) { + value += "px"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) { + // Wrapped to prevent IE from throwing errors when 'invalid' values are provided + // Fixes bug #5509 + try { + style[ name ] = value; + } catch(e) {} + } + + } else { + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra ) { + // Make sure that we're working with the right name + var ret, origName = jQuery.camelCase( name ), + hooks = jQuery.cssHooks[ origName ]; + + name = jQuery.cssProps[ origName ] || origName; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { + return ret; + + // Otherwise, if a way to get the computed value exists, use that + } else if ( curCSS ) { + return curCSS( elem, name, origName ); + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + }, + + camelCase: function( string ) { + return string.replace( rdashAlpha, fcamelCase ); + } +}); + +// DEPRECATED, Use jQuery.css() instead +jQuery.curCSS = jQuery.css; + +jQuery.each(["height", "width"], function( i, name ) { + jQuery.cssHooks[ name ] = { + get: function( elem, computed, extra ) { + var val; + + if ( computed ) { + if ( elem.offsetWidth !== 0 ) { + val = getWH( elem, name, extra ); + + } else { + jQuery.swap( elem, cssShow, function() { + val = getWH( elem, name, extra ); + }); + } + + if ( val <= 0 ) { + val = curCSS( elem, name, name ); + + if ( val === "0px" && currentStyle ) { + val = currentStyle( elem, name, name ); + } + + if ( val != null ) { + // Should return "auto" instead of 0, use 0 for + // temporary backwards-compat + return val === "" || val === "auto" ? "0px" : val; + } + } + + if ( val < 0 || val == null ) { + val = elem.style[ name ]; + + // Should return "auto" instead of 0, use 0 for + // temporary backwards-compat + return val === "" || val === "auto" ? "0px" : val; + } + + return typeof val === "string" ? val : val + "px"; + } + }, + + set: function( elem, value ) { + if ( rnumpx.test( value ) ) { + // ignore negative width and height values #1599 + value = parseFloat(value); + + if ( value >= 0 ) { + return value + "px"; + } + + } else { + return value; + } + } + }; +}); + +if ( !jQuery.support.opacity ) { + jQuery.cssHooks.opacity = { + get: function( elem, computed ) { + // IE uses filters for opacity + return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? + (parseFloat(RegExp.$1) / 100) + "" : + computed ? "1" : ""; + }, + + set: function( elem, value ) { + var style = elem.style; + + // IE has trouble with opacity if it does not have layout + // Force it by setting the zoom level + style.zoom = 1; + + // Set the alpha filter to set the opacity + var opacity = jQuery.isNaN(value) ? + "" : + "alpha(opacity=" + value * 100 + ")", + filter = style.filter || ""; + + style.filter = ralpha.test(filter) ? + filter.replace(ralpha, opacity) : + style.filter + ' ' + opacity; + } + }; +} + +if ( document.defaultView && document.defaultView.getComputedStyle ) { + getComputedStyle = function( elem, newName, name ) { + var ret, defaultView, computedStyle; + + name = name.replace( rupper, "-$1" ).toLowerCase(); + + if ( !(defaultView = elem.ownerDocument.defaultView) ) { + return undefined; + } + + if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) { + ret = computedStyle.getPropertyValue( name ); + if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { + ret = jQuery.style( elem, name ); + } + } + + return ret; + }; +} + +if ( document.documentElement.currentStyle ) { + currentStyle = function( elem, name ) { + var left, rsLeft, + ret = elem.currentStyle && elem.currentStyle[ name ], + style = elem.style; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !rnumpx.test( ret ) && rnum.test( ret ) ) { + // Remember the original values + left = style.left; + rsLeft = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + style.left = name === "fontSize" ? "1em" : (ret || 0); + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + elem.runtimeStyle.left = rsLeft; + } + + return ret === "" ? "auto" : ret; + }; +} + +curCSS = getComputedStyle || currentStyle; + +function getWH( elem, name, extra ) { + var which = name === "width" ? cssWidth : cssHeight, + val = name === "width" ? elem.offsetWidth : elem.offsetHeight; + + if ( extra === "border" ) { + return val; + } + + jQuery.each( which, function() { + if ( !extra ) { + val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0; + } + + if ( extra === "margin" ) { + val += parseFloat(jQuery.css( elem, "margin" + this )) || 0; + + } else { + val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0; + } + }); + + return val; +} + +if ( jQuery.expr && jQuery.expr.filters ) { + jQuery.expr.filters.hidden = function( elem ) { + var width = elem.offsetWidth, + height = elem.offsetHeight; + + return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none"); + }; + + jQuery.expr.filters.visible = function( elem ) { + return !jQuery.expr.filters.hidden( elem ); + }; +} + + + + +var jsc = jQuery.now(), + rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, + rselectTextarea = /^(?:select|textarea)/i, + rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, + rnoContent = /^(?:GET|HEAD)$/, + rbracket = /\[\]$/, + jsre = /\=\?(&|$)/, + rquery = /\?/, + rts = /([?&])_=[^&]*/, + rurl = /^(\w+:)?\/\/([^\/?#]+)/, + r20 = /%20/g, + rhash = /#.*$/, + + // Keep a copy of the old load method + _load = jQuery.fn.load; + +jQuery.fn.extend({ + load: function( url, params, callback ) { + if ( typeof url !== "string" && _load ) { + return _load.apply( this, arguments ); + + // Don't do a request if no elements are being requested + } else if ( !this.length ) { + return this; + } + + var off = url.indexOf(" "); + if ( off >= 0 ) { + var selector = url.slice(off, url.length); + url = url.slice(0, off); + } + + // Default to a GET request + var type = "GET"; + + // If the second parameter was provided + if ( params ) { + // If it's a function + if ( jQuery.isFunction( params ) ) { + // We assume that it's the callback + callback = params; + params = null; + + // Otherwise, build a param string + } else if ( typeof params === "object" ) { + params = jQuery.param( params, jQuery.ajaxSettings.traditional ); + type = "POST"; + } + } + + var self = this; + + // Request the remote document + jQuery.ajax({ + url: url, + type: type, + dataType: "html", + data: params, + complete: function( res, status ) { + // If successful, inject the HTML into all the matched elements + if ( status === "success" || status === "notmodified" ) { + // See if a selector was specified + self.html( selector ? + // Create a dummy div to hold the results + jQuery("<div>") + // inject the contents of the document in, removing the scripts + // to avoid any 'Permission Denied' errors in IE + .append(res.responseText.replace(rscript, "")) + + // Locate the specified elements + .find(selector) : + + // If not, just inject the full result + res.responseText ); + } + + if ( callback ) { + self.each( callback, [res.responseText, status, res] ); + } + } + }); + + return this; + }, + + serialize: function() { + return jQuery.param(this.serializeArray()); + }, + + serializeArray: function() { + return this.map(function() { + return this.elements ? jQuery.makeArray(this.elements) : this; + }) + .filter(function() { + return this.name && !this.disabled && + (this.checked || rselectTextarea.test(this.nodeName) || + rinput.test(this.type)); + }) + .map(function( i, elem ) { + var val = jQuery(this).val(); + + return val == null ? + null : + jQuery.isArray(val) ? + jQuery.map( val, function( val, i ) { + return { name: elem.name, value: val }; + }) : + { name: elem.name, value: val }; + }).get(); + } +}); + +// Attach a bunch of functions for handling common AJAX events +jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) { + jQuery.fn[o] = function( f ) { + return this.bind(o, f); + }; +}); + +jQuery.extend({ + get: function( url, data, callback, type ) { + // shift arguments if data argument was omited + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = null; + } + + return jQuery.ajax({ + type: "GET", + url: url, + data: data, + success: callback, + dataType: type + }); + }, + + getScript: function( url, callback ) { + return jQuery.get(url, null, callback, "script"); + }, + + getJSON: function( url, data, callback ) { + return jQuery.get(url, data, callback, "json"); + }, + + post: function( url, data, callback, type ) { + // shift arguments if data argument was omited + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = {}; + } + + return jQuery.ajax({ + type: "POST", + url: url, + data: data, + success: callback, + dataType: type + }); + }, + + ajaxSetup: function( settings ) { + jQuery.extend( jQuery.ajaxSettings, settings ); + }, + + ajaxSettings: { + url: location.href, + global: true, + type: "GET", + contentType: "application/x-www-form-urlencoded", + processData: true, + async: true, + /* + timeout: 0, + data: null, + username: null, + password: null, + traditional: false, + */ + // This function can be overriden by calling jQuery.ajaxSetup + xhr: function() { + return new window.XMLHttpRequest(); + }, + accepts: { + xml: "application/xml, text/xml", + html: "text/html", + script: "text/javascript, application/javascript", + json: "application/json, text/javascript", + text: "text/plain", + _default: "*/*" + } + }, + + ajax: function( origSettings ) { + var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings), + jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type); + + s.url = s.url.replace( rhash, "" ); + + // Use original (not extended) context object if it was provided + s.context = origSettings && origSettings.context != null ? origSettings.context : s; + + // convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Handle JSONP Parameter Callbacks + if ( s.dataType === "jsonp" ) { + if ( type === "GET" ) { + if ( !jsre.test( s.url ) ) { + s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?"; + } + } else if ( !s.data || !jsre.test(s.data) ) { + s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; + } + s.dataType = "json"; + } + + // Build temporary JSONP function + if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) { + jsonp = s.jsonpCallback || ("jsonp" + jsc++); + + // Replace the =? sequence both in the query string and the data + if ( s.data ) { + s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); + } + + s.url = s.url.replace(jsre, "=" + jsonp + "$1"); + + // We need to make sure + // that a JSONP style response is executed properly + s.dataType = "script"; + + // Handle JSONP-style loading + var customJsonp = window[ jsonp ]; + + window[ jsonp ] = function( tmp ) { + if ( jQuery.isFunction( customJsonp ) ) { + customJsonp( tmp ); + + } else { + // Garbage collect + window[ jsonp ] = undefined; + + try { + delete window[ jsonp ]; + } catch( jsonpError ) {} + } + + data = tmp; + jQuery.handleSuccess( s, xhr, status, data ); + jQuery.handleComplete( s, xhr, status, data ); + + if ( head ) { + head.removeChild( script ); + } + }; + } + + if ( s.dataType === "script" && s.cache === null ) { + s.cache = false; + } + + if ( s.cache === false && noContent ) { + var ts = jQuery.now(); + + // try replacing _= if it is there + var ret = s.url.replace(rts, "$1_=" + ts); + + // if nothing was replaced, add timestamp to the end + s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : ""); + } + + // If data is available, append data to url for GET/HEAD requests + if ( s.data && noContent ) { + s.url += (rquery.test(s.url) ? "&" : "?") + s.data; + } + + // Watch for a new set of requests + if ( s.global && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Matches an absolute URL, and saves the domain + var parts = rurl.exec( s.url ), + remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host); + + // If we're requesting a remote document + // and trying to load JSON or Script with a GET + if ( s.dataType === "script" && type === "GET" && remote ) { + var head = document.getElementsByTagName("head")[0] || document.documentElement; + var script = document.createElement("script"); + if ( s.scriptCharset ) { + script.charset = s.scriptCharset; + } + script.src = s.url; + + // Handle Script loading + if ( !jsonp ) { + var done = false; + + // Attach handlers for all browsers + script.onload = script.onreadystatechange = function() { + if ( !done && (!this.readyState || + this.readyState === "loaded" || this.readyState === "complete") ) { + done = true; + jQuery.handleSuccess( s, xhr, status, data ); + jQuery.handleComplete( s, xhr, status, data ); + + // Handle memory leak in IE + script.onload = script.onreadystatechange = null; + if ( head && script.parentNode ) { + head.removeChild( script ); + } + } + }; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709 and #4378). + head.insertBefore( script, head.firstChild ); + + // We handle everything using the script element injection + return undefined; + } + + var requestDone = false; + + // Create the request object + var xhr = s.xhr(); + + if ( !xhr ) { + return; + } + + // Open the socket + // Passing null username, generates a login popup on Opera (#2865) + if ( s.username ) { + xhr.open(type, s.url, s.async, s.username, s.password); + } else { + xhr.open(type, s.url, s.async); + } + + // Need an extra try/catch for cross domain requests in Firefox 3 + try { + // Set content-type if data specified and content-body is valid for this type + if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) { + xhr.setRequestHeader("Content-Type", s.contentType); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[s.url] ) { + xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]); + } + + if ( jQuery.etag[s.url] ) { + xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]); + } + } + + // Set header so the called script knows that it's an XMLHttpRequest + // Only send the header if it's not a remote XHR + if ( !remote ) { + xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + } + + // Set the Accepts header for the server, depending on the dataType + xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? + s.accepts[ s.dataType ] + ", */*; q=0.01" : + s.accepts._default ); + } catch( headerError ) {} + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) { + // Handle the global AJAX counter + if ( s.global && jQuery.active-- === 1 ) { + jQuery.event.trigger( "ajaxStop" ); + } + + // close opended socket + xhr.abort(); + return false; + } + + if ( s.global ) { + jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] ); + } + + // Wait for a response to come back + var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) { + // The request was aborted + if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) { + // Opera doesn't call onreadystatechange before this point + // so we simulate the call + if ( !requestDone ) { + jQuery.handleComplete( s, xhr, status, data ); + } + + requestDone = true; + if ( xhr ) { + xhr.onreadystatechange = jQuery.noop; + } + + // The transfer is complete and the data is available, or the request timed out + } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) { + requestDone = true; + xhr.onreadystatechange = jQuery.noop; + + status = isTimeout === "timeout" ? + "timeout" : + !jQuery.httpSuccess( xhr ) ? + "error" : + s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? + "notmodified" : + "success"; + + var errMsg; + + if ( status === "success" ) { + // Watch for, and catch, XML document parse errors + try { + // process the data (runs the xml through httpData regardless of callback) + data = jQuery.httpData( xhr, s.dataType, s ); + } catch( parserError ) { + status = "parsererror"; + errMsg = parserError; + } + } + + // Make sure that the request was successful or notmodified + if ( status === "success" || status === "notmodified" ) { + // JSONP handles its own success callback + if ( !jsonp ) { + jQuery.handleSuccess( s, xhr, status, data ); + } + } else { + jQuery.handleError( s, xhr, status, errMsg ); + } + + // Fire the complete handlers + if ( !jsonp ) { + jQuery.handleComplete( s, xhr, status, data ); + } + + if ( isTimeout === "timeout" ) { + xhr.abort(); + } + + // Stop memory leaks + if ( s.async ) { + xhr = null; + } + } + }; + + // Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK) + // Opera doesn't fire onreadystatechange at all on abort + try { + var oldAbort = xhr.abort; + xhr.abort = function() { + if ( xhr ) { + // oldAbort has no call property in IE7 so + // just do it this way, which works in all + // browsers + Function.prototype.call.call( oldAbort, xhr ); + } + + onreadystatechange( "abort" ); + }; + } catch( abortError ) {} + + // Timeout checker + if ( s.async && s.timeout > 0 ) { + setTimeout(function() { + // Check to see if the request is still happening + if ( xhr && !requestDone ) { + onreadystatechange( "timeout" ); + } + }, s.timeout); + } + + // Send the data + try { + xhr.send( noContent || s.data == null ? null : s.data ); + + } catch( sendError ) { + jQuery.handleError( s, xhr, null, sendError ); + + // Fire the complete handlers + jQuery.handleComplete( s, xhr, status, data ); + } + + // firefox 1.5 doesn't fire statechange for sync requests + if ( !s.async ) { + onreadystatechange(); + } + + // return XMLHttpRequest to allow aborting the request etc. + return xhr; + }, + + // Serialize an array of form elements or a set of + // key/values into a query string + param: function( a, traditional ) { + var s = [], + add = function( key, value ) { + // If value is a function, invoke it and return its value + value = jQuery.isFunction(value) ? value() : value; + s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value); + }; + + // Set traditional to true for jQuery <= 1.3.2 behavior. + if ( traditional === undefined ) { + traditional = jQuery.ajaxSettings.traditional; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( jQuery.isArray(a) || a.jquery ) { + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + }); + + } else { + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( var prefix in a ) { + buildParams( prefix, a[prefix], traditional, add ); + } + } + + // Return the resulting serialization + return s.join("&").replace(r20, "+"); + } +}); + +function buildParams( prefix, obj, traditional, add ) { + if ( jQuery.isArray(obj) && obj.length ) { + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + // If array item is non-scalar (array or object), encode its + // numeric index to resolve deserialization ambiguity issues. + // Note that rack (as of 1.0.0) can't currently deserialize + // nested arrays properly, and attempting to do so may cause + // a server error. Possible fixes are to modify rack's + // deserialization algorithm or to provide an option or flag + // to force array serialization to be shallow. + buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); + } + }); + + } else if ( !traditional && obj != null && typeof obj === "object" ) { + if ( jQuery.isEmptyObject( obj ) ) { + add( prefix, "" ); + + // Serialize object item. + } else { + jQuery.each( obj, function( k, v ) { + buildParams( prefix + "[" + k + "]", v, traditional, add ); + }); + } + + } else { + // Serialize scalar item. + add( prefix, obj ); + } +} + +// This is still on the jQuery object... for now +// Want to move this to jQuery.ajax some day +jQuery.extend({ + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + handleError: function( s, xhr, status, e ) { + // If a local callback was specified, fire it + if ( s.error ) { + s.error.call( s.context, xhr, status, e ); + } + + // Fire the global callback + if ( s.global ) { + jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] ); + } + }, + + handleSuccess: function( s, xhr, status, data ) { + // If a local callback was specified, fire it and pass it the data + if ( s.success ) { + s.success.call( s.context, data, status, xhr ); + } + + // Fire the global callback + if ( s.global ) { + jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] ); + } + }, + + handleComplete: function( s, xhr, status ) { + // Process result + if ( s.complete ) { + s.complete.call( s.context, xhr, status ); + } + + // The request was completed + if ( s.global ) { + jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] ); + } + + // Handle the global AJAX counter + if ( s.global && jQuery.active-- === 1 ) { + jQuery.event.trigger( "ajaxStop" ); + } + }, + + triggerGlobal: function( s, type, args ) { + (s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args); + }, + + // Determines if an XMLHttpRequest was successful or not + httpSuccess: function( xhr ) { + try { + // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 + return !xhr.status && location.protocol === "file:" || + xhr.status >= 200 && xhr.status < 300 || + xhr.status === 304 || xhr.status === 1223; + } catch(e) {} + + return false; + }, + + // Determines if an XMLHttpRequest returns NotModified + httpNotModified: function( xhr, url ) { + var lastModified = xhr.getResponseHeader("Last-Modified"), + etag = xhr.getResponseHeader("Etag"); + + if ( lastModified ) { + jQuery.lastModified[url] = lastModified; + } + + if ( etag ) { + jQuery.etag[url] = etag; + } + + return xhr.status === 304; + }, + + httpData: function( xhr, type, s ) { + var ct = xhr.getResponseHeader("content-type") || "", + xml = type === "xml" || !type && ct.indexOf("xml") >= 0, + data = xml ? xhr.responseXML : xhr.responseText; + + if ( xml && data.documentElement.nodeName === "parsererror" ) { + jQuery.error( "parsererror" ); + } + + // Allow a pre-filtering function to sanitize the response + // s is checked to keep backwards compatibility + if ( s && s.dataFilter ) { + data = s.dataFilter( data, type ); + } + + // The filter can actually parse the response + if ( typeof data === "string" ) { + // Get the JavaScript object, if JSON is used. + if ( type === "json" || !type && ct.indexOf("json") >= 0 ) { + data = jQuery.parseJSON( data ); + + // If the type is "script", eval it in global context + } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) { + jQuery.globalEval( data ); + } + } + + return data; + } + +}); + +/* + * Create the request object; Microsoft failed to properly + * implement the XMLHttpRequest in IE7 (can't request local files), + * so we use the ActiveXObject when it is available + * Additionally XMLHttpRequest can be disabled in IE7/IE8 so + * we need a fallback. + */ +if ( window.ActiveXObject ) { + jQuery.ajaxSettings.xhr = function() { + if ( window.location.protocol !== "file:" ) { + try { + return new window.XMLHttpRequest(); + } catch(xhrError) {} + } + + try { + return new window.ActiveXObject("Microsoft.XMLHTTP"); + } catch(activeError) {} + }; +} + +// Does this browser support XHR requests? +jQuery.support.ajax = !!jQuery.ajaxSettings.xhr(); + + + + +var elemdisplay = {}, + rfxtypes = /^(?:toggle|show|hide)$/, + rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/, + timerId, + fxAttrs = [ + // height animations + [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], + // width animations + [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], + // opacity animations + [ "opacity" ] + ]; + +jQuery.fn.extend({ + show: function( speed, easing, callback ) { + var elem, display; + + if ( speed || speed === 0 ) { + return this.animate( genFx("show", 3), speed, easing, callback); + + } else { + for ( var i = 0, j = this.length; i < j; i++ ) { + elem = this[i]; + display = elem.style.display; + + // Reset the inline display of this element to learn if it is + // being hidden by cascaded rules or not + if ( !jQuery.data(elem, "olddisplay") && display === "none" ) { + display = elem.style.display = ""; + } + + // Set elements which have been overridden with display: none + // in a stylesheet to whatever the default browser style is + // for such an element + if ( display === "" && jQuery.css( elem, "display" ) === "none" ) { + jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName)); + } + } + + // Set the display of most of the elements in a second loop + // to avoid the constant reflow + for ( i = 0; i < j; i++ ) { + elem = this[i]; + display = elem.style.display; + + if ( display === "" || display === "none" ) { + elem.style.display = jQuery.data(elem, "olddisplay") || ""; + } + } + + return this; + } + }, + + hide: function( speed, easing, callback ) { + if ( speed || speed === 0 ) { + return this.animate( genFx("hide", 3), speed, easing, callback); + + } else { + for ( var i = 0, j = this.length; i < j; i++ ) { + var display = jQuery.css( this[i], "display" ); + + if ( display !== "none" ) { + jQuery.data( this[i], "olddisplay", display ); + } + } + + // Set the display of the elements in a second loop + // to avoid the constant reflow + for ( i = 0; i < j; i++ ) { + this[i].style.display = "none"; + } + + return this; + } + }, + + // Save the old toggle function + _toggle: jQuery.fn.toggle, + + toggle: function( fn, fn2, callback ) { + var bool = typeof fn === "boolean"; + + if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { + this._toggle.apply( this, arguments ); + + } else if ( fn == null || bool ) { + this.each(function() { + var state = bool ? fn : jQuery(this).is(":hidden"); + jQuery(this)[ state ? "show" : "hide" ](); + }); + + } else { + this.animate(genFx("toggle", 3), fn, fn2, callback); + } + + return this; + }, + + fadeTo: function( speed, to, easing, callback ) { + return this.filter(":hidden").css("opacity", 0).show().end() + .animate({opacity: to}, speed, easing, callback); + }, + + animate: function( prop, speed, easing, callback ) { + var optall = jQuery.speed(speed, easing, callback); + + if ( jQuery.isEmptyObject( prop ) ) { + return this.each( optall.complete ); + } + + return this[ optall.queue === false ? "each" : "queue" ](function() { + // XXX 'this' does not always have a nodeName when running the + // test suite + + var opt = jQuery.extend({}, optall), p, + isElement = this.nodeType === 1, + hidden = isElement && jQuery(this).is(":hidden"), + self = this; + + for ( p in prop ) { + var name = jQuery.camelCase( p ); + + if ( p !== name ) { + prop[ name ] = prop[ p ]; + delete prop[ p ]; + p = name; + } + + if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) { + return opt.complete.call(this); + } + + if ( isElement && ( p === "height" || p === "width" ) ) { + // Make sure that nothing sneaks out + // Record all 3 overflow attributes because IE does not + // change the overflow attribute when overflowX and + // overflowY are set to the same value + opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; + + // Set display property to inline-block for height/width + // animations on inline elements that are having width/height + // animated + if ( jQuery.css( this, "display" ) === "inline" && + jQuery.css( this, "float" ) === "none" ) { + if ( !jQuery.support.inlineBlockNeedsLayout ) { + this.style.display = "inline-block"; + + } else { + var display = defaultDisplay(this.nodeName); + + // inline-level elements accept inline-block; + // block-level elements need to be inline with layout + if ( display === "inline" ) { + this.style.display = "inline-block"; + + } else { + this.style.display = "inline"; + this.style.zoom = 1; + } + } + } + } + + if ( jQuery.isArray( prop[p] ) ) { + // Create (if needed) and add to specialEasing + (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1]; + prop[p] = prop[p][0]; + } + } + + if ( opt.overflow != null ) { + this.style.overflow = "hidden"; + } + + opt.curAnim = jQuery.extend({}, prop); + + jQuery.each( prop, function( name, val ) { + var e = new jQuery.fx( self, opt, name ); + + if ( rfxtypes.test(val) ) { + e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop ); + + } else { + var parts = rfxnum.exec(val), + start = e.cur() || 0; + + if ( parts ) { + var end = parseFloat( parts[2] ), + unit = parts[3] || "px"; + + // We need to compute starting value + if ( unit !== "px" ) { + jQuery.style( self, name, (end || 1) + unit); + start = ((end || 1) / e.cur()) * start; + jQuery.style( self, name, start + unit); + } + + // If a +=/-= token was provided, we're doing a relative animation + if ( parts[1] ) { + end = ((parts[1] === "-=" ? -1 : 1) * end) + start; + } + + e.custom( start, end, unit ); + + } else { + e.custom( start, val, "" ); + } + } + }); + + // For JS strict compliance + return true; + }); + }, + + stop: function( clearQueue, gotoEnd ) { + var timers = jQuery.timers; + + if ( clearQueue ) { + this.queue([]); + } + + this.each(function() { + // go in reverse order so anything added to the queue during the loop is ignored + for ( var i = timers.length - 1; i >= 0; i-- ) { + if ( timers[i].elem === this ) { + if (gotoEnd) { + // force the next step to be the last + timers[i](true); + } + + timers.splice(i, 1); + } + } + }); + + // start the next in the queue if the last step wasn't forced + if ( !gotoEnd ) { + this.dequeue(); + } + + return this; + } + +}); + +function genFx( type, num ) { + var obj = {}; + + jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() { + obj[ this ] = type; + }); + + return obj; +} + +// Generate shortcuts for custom animations +jQuery.each({ + slideDown: genFx("show", 1), + slideUp: genFx("hide", 1), + slideToggle: genFx("toggle", 1), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +}); + +jQuery.extend({ + speed: function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction(easing) && easing + }; + + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : + opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default; + + // Queueing + opt.old = opt.complete; + opt.complete = function() { + if ( opt.queue !== false ) { + jQuery(this).dequeue(); + } + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); + } + }; + + return opt; + }, + + easing: { + linear: function( p, n, firstNum, diff ) { + return firstNum + diff * p; + }, + swing: function( p, n, firstNum, diff ) { + return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; + } + }, + + timers: [], + + fx: function( elem, options, prop ) { + this.options = options; + this.elem = elem; + this.prop = prop; + + if ( !options.orig ) { + options.orig = {}; + } + } + +}); + +jQuery.fx.prototype = { + // Simple function for setting a style value + update: function() { + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); + }, + + // Get the current size + cur: function() { + if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) { + return this.elem[ this.prop ]; + } + + var r = parseFloat( jQuery.css( this.elem, this.prop ) ); + return r && r > -10000 ? r : 0; + }, + + // Start an animation from one number to another + custom: function( from, to, unit ) { + var self = this, + fx = jQuery.fx; + + this.startTime = jQuery.now(); + this.start = from; + this.end = to; + this.unit = unit || this.unit || "px"; + this.now = this.start; + this.pos = this.state = 0; + + function t( gotoEnd ) { + return self.step(gotoEnd); + } + + t.elem = this.elem; + + if ( t() && jQuery.timers.push(t) && !timerId ) { + timerId = setInterval(fx.tick, fx.interval); + } + }, + + // Simple 'show' function + show: function() { + // Remember where we started, so that we can go back to it later + this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); + this.options.show = true; + + // Begin the animation + // Make sure that we start at a small width/height to avoid any + // flash of content + this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()); + + // Start by showing the element + jQuery( this.elem ).show(); + }, + + // Simple 'hide' function + hide: function() { + // Remember where we started, so that we can go back to it later + this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); + this.options.hide = true; + + // Begin the animation + this.custom(this.cur(), 0); + }, + + // Each step of an animation + step: function( gotoEnd ) { + var t = jQuery.now(), done = true; + + if ( gotoEnd || t >= this.options.duration + this.startTime ) { + this.now = this.end; + this.pos = this.state = 1; + this.update(); + + this.options.curAnim[ this.prop ] = true; + + for ( var i in this.options.curAnim ) { + if ( this.options.curAnim[i] !== true ) { + done = false; + } + } + + if ( done ) { + // Reset the overflow + if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { + var elem = this.elem, + options = this.options; + + jQuery.each( [ "", "X", "Y" ], function (index, value) { + elem.style[ "overflow" + value ] = options.overflow[index]; + } ); + } + + // Hide the element if the "hide" operation was done + if ( this.options.hide ) { + jQuery(this.elem).hide(); + } + + // Reset the properties, if the item has been hidden or shown + if ( this.options.hide || this.options.show ) { + for ( var p in this.options.curAnim ) { + jQuery.style( this.elem, p, this.options.orig[p] ); + } + } + + // Execute the complete function + this.options.complete.call( this.elem ); + } + + return false; + + } else { + var n = t - this.startTime; + this.state = n / this.options.duration; + + // Perform the easing function, defaults to swing + var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop]; + var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear"); + this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration); + this.now = this.start + ((this.end - this.start) * this.pos); + + // Perform the next step of the animation + this.update(); + } + + return true; + } +}; + +jQuery.extend( jQuery.fx, { + tick: function() { + var timers = jQuery.timers; + + for ( var i = 0; i < timers.length; i++ ) { + if ( !timers[i]() ) { + timers.splice(i--, 1); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + }, + + interval: 13, + + stop: function() { + clearInterval( timerId ); + timerId = null; + }, + + speeds: { + slow: 600, + fast: 200, + // Default speed + _default: 400 + }, + + step: { + opacity: function( fx ) { + jQuery.style( fx.elem, "opacity", fx.now ); + }, + + _default: function( fx ) { + if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { + fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; + } else { + fx.elem[ fx.prop ] = fx.now; + } + } + } +}); + +if ( jQuery.expr && jQuery.expr.filters ) { + jQuery.expr.filters.animated = function( elem ) { + return jQuery.grep(jQuery.timers, function( fn ) { + return elem === fn.elem; + }).length; + }; +} + +function defaultDisplay( nodeName ) { + if ( !elemdisplay[ nodeName ] ) { + var elem = jQuery("<" + nodeName + ">").appendTo("body"), + display = elem.css("display"); + + elem.remove(); + + if ( display === "none" || display === "" ) { + display = "block"; + } + + elemdisplay[ nodeName ] = display; + } + + return elemdisplay[ nodeName ]; +} + + + + +var rtable = /^t(?:able|d|h)$/i, + rroot = /^(?:body|html)$/i; + +if ( "getBoundingClientRect" in document.documentElement ) { + jQuery.fn.offset = function( options ) { + var elem = this[0], box; + + if ( options ) { + return this.each(function( i ) { + jQuery.offset.setOffset( this, options, i ); + }); + } + + if ( !elem || !elem.ownerDocument ) { + return null; + } + + if ( elem === elem.ownerDocument.body ) { + return jQuery.offset.bodyOffset( elem ); + } + + try { + box = elem.getBoundingClientRect(); + } catch(e) {} + + var doc = elem.ownerDocument, + docElem = doc.documentElement; + + // Make sure we're not dealing with a disconnected DOM node + if ( !box || !jQuery.contains( docElem, elem ) ) { + return box || { top: 0, left: 0 }; + } + + var body = doc.body, + win = getWindow(doc), + clientTop = docElem.clientTop || body.clientTop || 0, + clientLeft = docElem.clientLeft || body.clientLeft || 0, + scrollTop = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ), + scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft), + top = box.top + scrollTop - clientTop, + left = box.left + scrollLeft - clientLeft; + + return { top: top, left: left }; + }; + +} else { + jQuery.fn.offset = function( options ) { + var elem = this[0]; + + if ( options ) { + return this.each(function( i ) { + jQuery.offset.setOffset( this, options, i ); + }); + } + + if ( !elem || !elem.ownerDocument ) { + return null; + } + + if ( elem === elem.ownerDocument.body ) { + return jQuery.offset.bodyOffset( elem ); + } + + jQuery.offset.initialize(); + + var computedStyle, + offsetParent = elem.offsetParent, + prevOffsetParent = elem, + doc = elem.ownerDocument, + docElem = doc.documentElement, + body = doc.body, + defaultView = doc.defaultView, + prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, + top = elem.offsetTop, + left = elem.offsetLeft; + + while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { + if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { + break; + } + + computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; + top -= elem.scrollTop; + left -= elem.scrollLeft; + + if ( elem === offsetParent ) { + top += elem.offsetTop; + left += elem.offsetLeft; + + if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { + top += parseFloat( computedStyle.borderTopWidth ) || 0; + left += parseFloat( computedStyle.borderLeftWidth ) || 0; + } + + prevOffsetParent = offsetParent; + offsetParent = elem.offsetParent; + } + + if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { + top += parseFloat( computedStyle.borderTopWidth ) || 0; + left += parseFloat( computedStyle.borderLeftWidth ) || 0; + } + + prevComputedStyle = computedStyle; + } + + if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { + top += body.offsetTop; + left += body.offsetLeft; + } + + if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { + top += Math.max( docElem.scrollTop, body.scrollTop ); + left += Math.max( docElem.scrollLeft, body.scrollLeft ); + } + + return { top: top, left: left }; + }; +} + +jQuery.offset = { + initialize: function() { + var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0, + html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; + + jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } ); + + container.innerHTML = html; + body.insertBefore( container, body.firstChild ); + innerDiv = container.firstChild; + checkDiv = innerDiv.firstChild; + td = innerDiv.nextSibling.firstChild.firstChild; + + this.doesNotAddBorder = (checkDiv.offsetTop !== 5); + this.doesAddBorderForTableAndCells = (td.offsetTop === 5); + + checkDiv.style.position = "fixed"; + checkDiv.style.top = "20px"; + + // safari subtracts parent border width here which is 5px + this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15); + checkDiv.style.position = checkDiv.style.top = ""; + + innerDiv.style.overflow = "hidden"; + innerDiv.style.position = "relative"; + + this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); + + this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); + + body.removeChild( container ); + body = container = innerDiv = checkDiv = table = td = null; + jQuery.offset.initialize = jQuery.noop; + }, + + bodyOffset: function( body ) { + var top = body.offsetTop, + left = body.offsetLeft; + + jQuery.offset.initialize(); + + if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) { + top += parseFloat( jQuery.css(body, "marginTop") ) || 0; + left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; + } + + return { top: top, left: left }; + }, + + setOffset: function( elem, options, i ) { + var position = jQuery.css( elem, "position" ); + + // set position first, in-case top/left are set even on static elem + if ( position === "static" ) { + elem.style.position = "relative"; + } + + var curElem = jQuery( elem ), + curOffset = curElem.offset(), + curCSSTop = jQuery.css( elem, "top" ), + curCSSLeft = jQuery.css( elem, "left" ), + calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1), + props = {}, curPosition = {}, curTop, curLeft; + + // need to be able to calculate position if either top or left is auto and position is absolute + if ( calculatePosition ) { + curPosition = curElem.position(); + } + + curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0; + curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0; + + if ( jQuery.isFunction( options ) ) { + options = options.call( elem, i, curOffset ); + } + + if (options.top != null) { + props.top = (options.top - curOffset.top) + curTop; + } + if (options.left != null) { + props.left = (options.left - curOffset.left) + curLeft; + } + + if ( "using" in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + } +}; + + +jQuery.fn.extend({ + position: function() { + if ( !this[0] ) { + return null; + } + + var elem = this[0], + + // Get *real* offsetParent + offsetParent = this.offsetParent(), + + // Get correct offsets + offset = this.offset(), + parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; + offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; + + // Add offsetParent borders + parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; + parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + }; + }, + + offsetParent: function() { + return this.map(function() { + var offsetParent = this.offsetParent || document.body; + while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { + offsetParent = offsetParent.offsetParent; + } + return offsetParent; + }); + } +}); + + +// Create scrollLeft and scrollTop methods +jQuery.each( ["Left", "Top"], function( i, name ) { + var method = "scroll" + name; + + jQuery.fn[ method ] = function(val) { + var elem = this[0], win; + + if ( !elem ) { + return null; + } + + if ( val !== undefined ) { + // Set the scroll offset + return this.each(function() { + win = getWindow( this ); + + if ( win ) { + win.scrollTo( + !i ? val : jQuery(win).scrollLeft(), + i ? val : jQuery(win).scrollTop() + ); + + } else { + this[ method ] = val; + } + }); + } else { + win = getWindow( elem ); + + // Return the scroll offset + return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : + jQuery.support.boxModel && win.document.documentElement[ method ] || + win.document.body[ method ] : + elem[ method ]; + } + }; +}); + +function getWindow( elem ) { + return jQuery.isWindow( elem ) ? + elem : + elem.nodeType === 9 ? + elem.defaultView || elem.parentWindow : + false; +} + + + + +// Create innerHeight, innerWidth, outerHeight and outerWidth methods +jQuery.each([ "Height", "Width" ], function( i, name ) { + + var type = name.toLowerCase(); + + // innerHeight and innerWidth + jQuery.fn["inner" + name] = function() { + return this[0] ? + parseFloat( jQuery.css( this[0], type, "padding" ) ) : + null; + }; + + // outerHeight and outerWidth + jQuery.fn["outer" + name] = function( margin ) { + return this[0] ? + parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) : + null; + }; + + jQuery.fn[ type ] = function( size ) { + // Get window width or height + var elem = this[0]; + if ( !elem ) { + return size == null ? null : this; + } + + if ( jQuery.isFunction( size ) ) { + return this.each(function( i ) { + var self = jQuery( this ); + self[ type ]( size.call( this, i, self[ type ]() ) ); + }); + } + + if ( jQuery.isWindow( elem ) ) { + // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode + return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] || + elem.document.body[ "client" + name ]; + + // Get document width or height + } else if ( elem.nodeType === 9 ) { + // Either scroll[Width/Height] or offset[Width/Height], whichever is greater + return Math.max( + elem.documentElement["client" + name], + elem.body["scroll" + name], elem.documentElement["scroll" + name], + elem.body["offset" + name], elem.documentElement["offset" + name] + ); + + // Get or set width or height on the element + } else if ( size === undefined ) { + var orig = jQuery.css( elem, type ), + ret = parseFloat( orig ); + + return jQuery.isNaN( ret ) ? orig : ret; + + // Set the width or height on the element (default to pixels if value is unitless) + } else { + return this.css( type, typeof size === "string" ? size : size + "px" ); + } + }; + +}); + + +})(window); diff --git a/js/jquery-1.4.4.min.js b/js/jquery-1.4.4.min.js new file mode 100644 index 0000000..8f3ca2e --- /dev/null +++ b/js/jquery-1.4.4.min.js @@ -0,0 +1,167 @@ +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= +h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"|| +h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, +"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, +e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, +"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ +a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, +C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, +s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, +j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, +toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== +-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; +if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--; +if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", +b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& +!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& +l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z], +z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j, +s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v= +s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)|| +[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u, +false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), +k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, +scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= +false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= +1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= +"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= +c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); +else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this, +a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e= +c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, +a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan", +colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType=== +1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "), +l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this, +"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; +if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r= +a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, +attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& +b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; +c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, +arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= +d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ +c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b= +w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== +8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== +"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ +d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), +fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| +d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, +Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp= +c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U}; +var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== +"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V, +xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= +B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== +"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== +0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, +a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= +1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d=== +"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}}); +c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); +(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i, +[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; +break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, +q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= +l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*")); +return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!== +B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, +POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()=== +i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m= +i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g, +"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, +m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== +true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== +g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]- +0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n=== +"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== +i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; +if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, +g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1; +for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"), +i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); +n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& +function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| +p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= +t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? +function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML; +c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})}, +not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= +h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): +c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, +2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, +b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& +e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1, +"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; +else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d= +c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a, +b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")): +this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", +prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| +b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length- +1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); +d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, +jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, +zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), +h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); +if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= +d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; +e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, +ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== +"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& +!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, +getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", +script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| +!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= +false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; +A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", +b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& +c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| +c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= +encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", +[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), +e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); +if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", +3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay", +d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b, +d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)=== +"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L|| +1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, +d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* +Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} +var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; +this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| +this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= +c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a=== +b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&& +h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle; +for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+= +parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px", +height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells= +f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a, +"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, +e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& +c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); +c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ +b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/js/jquery-ui-1.8.6.custom.js b/js/jquery-ui-1.8.6.custom.js new file mode 100644 index 0000000..1887556 --- /dev/null +++ b/js/jquery-ui-1.8.6.custom.js @@ -0,0 +1,2578 @@ +/*! + * jQuery UI 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function( $, undefined ) { + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.8.6", + + keyCode: { + ALT: 18, + BACKSPACE: 8, + CAPS_LOCK: 20, + COMMA: 188, + COMMAND: 91, + COMMAND_LEFT: 91, // COMMAND + COMMAND_RIGHT: 93, + CONTROL: 17, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + INSERT: 45, + LEFT: 37, + MENU: 93, // COMMAND_RIGHT + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SHIFT: 16, + SPACE: 32, + TAB: 9, + UP: 38, + WINDOWS: 91 // COMMAND + } +}); + +// plugins +$.fn.extend({ + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; + if ( border ) { + size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; +}); + +// selectors +function visible( element ) { + return !$( element ).parents().andSelf().filter(function() { + return $.curCSS( this, "visibility" ) === "hidden" || + $.expr.filters.hidden( this ); + }).length; +} + +$.extend( $.expr[ ":" ], { + data: function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + var nodeName = element.nodeName.toLowerCase(), + tabIndex = $.attr( element, "tabindex" ); + if ( "area" === nodeName ) { + var map = element.parentNode, + mapName = map.name, + img; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) + ? !element.disabled + : "a" == nodeName + ? element.href || !isNaN( tabIndex ) + : !isNaN( tabIndex )) + // the element and all of its ancestors must be visible + && visible( element ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ); + return ( isNaN( tabIndex ) || tabIndex >= 0 ) && $( element ).is( ":focusable" ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + + + + + +// deprecated +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var proto = $.ui[ module ].prototype; + for ( var i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode ) { + return; + } + + for ( var i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains() + contains: function( a, b ) { + return document.compareDocumentPosition ? + a.compareDocumentPosition( b ) & 16 : + a !== b && a.contains( b ); + }, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); +/*! + * jQuery UI Widget 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + $( elem ).triggerHandler( "remove" ); + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + $( this ).triggerHandler( "remove" ); + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + // TODO: add this back in 1.9 and use $.error() (see #5972) +// if ( !instance ) { +// throw "cannot call methods on " + name + " prior to initialization; " + +// "attempted to call method '" + options + "'"; +// } +// if ( !$.isFunction( instance[options] ) ) { +// throw "no such method '" + options + "' for " + name + " widget instance"; +// } +// var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var callback = this.options[ type ]; + + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + data = data || {}; + + // copy original event properties over to the new event + // this would happen if we could call $.event.fix instead of $.Event + // but we don't have a way to force an event to be fixed multiple times + if ( event.originalEvent ) { + for ( var i = $.event.props.length, prop; i; ) { + prop = $.event.props[ --i ]; + event[ prop ] = event.originalEvent[ prop ]; + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); +/*! + * jQuery UI Mouse 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.mouse", { + options: { + cancel: ':input,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var self = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return self._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if(self._preventClickEvent) { + self._preventClickEvent = false; + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + // TODO: figure out why we have to use originalEvent + event.originalEvent = event.originalEvent || {}; + if (event.originalEvent.mouseHandled) { return; } + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var self = this, + btnIsLeft = (event.which == 1), + elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + self.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return self._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return self._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + event.originalEvent.mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + this._preventClickEvent = (event.target == this._mouseDownEvent.target); + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); +/* + * jQuery UI Position 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var horizontalPositions = /left|center|right/, + verticalPositions = /top|center|bottom/, + center = "center", + _position = $.fn.position, + _offset = $.fn.offset; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var target = $( options.of ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ], + targetWidth, + targetHeight, + basePosition; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: 0, left: 0 }; + // TODO: use $.isWindow() in 1.9 + } else if ( targetElem.setTimeout ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + basePosition = { top: options.of.pageY, left: options.of.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + basePosition = target.offset(); + } + + // force my and at to have valid horizontal and veritcal positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[this] || "" ).split( " " ); + if ( pos.length === 1) { + pos = horizontalPositions.test( pos[0] ) ? + pos.concat( [center] ) : + verticalPositions.test( pos[0] ) ? + [ center ].concat( pos ) : + [ center, center ]; + } + pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center; + pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center; + options[ this ] = pos; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + // normalize offset option + offset[ 0 ] = parseInt( offset[0], 10 ) || 0; + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + offset[ 1 ] = parseInt( offset[1], 10 ) || 0; + + if ( options.at[0] === "right" ) { + basePosition.left += targetWidth; + } else if (options.at[0] === center ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[1] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[1] === center ) { + basePosition.top += targetHeight / 2; + } + + basePosition.left += offset[ 0 ]; + basePosition.top += offset[ 1 ]; + + return this.each(function() { + var elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, + marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, + collisionWidth = elemWidth + marginLeft + + parseInt( $.curCSS( this, "marginRight", true ) ) || 0, + collisionHeight = elemHeight + marginTop + + parseInt( $.curCSS( this, "marginBottom", true ) ) || 0, + position = $.extend( {}, basePosition ), + collisionPosition; + + if ( options.my[0] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[0] === center ) { + position.left -= elemWidth / 2; + } + + if ( options.my[1] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[1] === center ) { + position.top -= elemHeight / 2; + } + + // prevent fractions (see #5280) + position.left = parseInt( position.left ); + position.top = parseInt( position.top ); + + collisionPosition = { + left: position.left - marginLeft, + top: position.top - marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[i] ] ) { + $.ui.position[ collision[i] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: offset, + my: options.my, + at: options.at + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + elem.offset( $.extend( position, { using: options.using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(); + position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left ); + }, + top: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(); + position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top ); + } + }, + + flip: { + left: function( position, data ) { + if ( data.at[0] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(), + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + -data.targetWidth, + offset = -2 * data.offset[ 0 ]; + position.left += data.collisionPosition.left < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + }, + top: function( position, data ) { + if ( data.at[1] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(), + myOffset = data.my[ 1 ] === "top" ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + -data.targetHeight, + offset = -2 * data.offset[ 1 ]; + position.top += data.collisionPosition.top < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + } + } +}; + +// offset setter from jQuery 1.4 +if ( !$.offset.setOffset ) { + $.offset.setOffset = function( elem, options ) { + // set position first, in-case top/left are set even on static elem + if ( /static/.test( $.curCSS( elem, "position" ) ) ) { + elem.style.position = "relative"; + } + var curElem = $( elem ), + curOffset = curElem.offset(), + curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0, + curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0, + props = { + top: (options.top - curOffset.top) + curTop, + left: (options.left - curOffset.left) + curLeft + }; + + if ( 'using' in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + }; + + $.fn.offset = function( options ) { + var elem = this[ 0 ]; + if ( !elem || !elem.ownerDocument ) { return null; } + if ( options ) { + return this.each(function() { + $.offset.setOffset( this, options ); + }); + } + return _offset.call( this ); + }; +} + +}( jQuery )); +/* + * jQuery UI Draggable 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false + }, + _create: function() { + + if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) + this.element[0].style.position = 'relative'; + + (this.options.addClasses && this.element.addClass("ui-draggable")); + (this.options.disabled && this.element.addClass("ui-draggable-disabled")); + + this._mouseInit(); + + }, + + destroy: function() { + if(!this.element.data('draggable')) return; + this.element + .removeData("draggable") + .unbind(".draggable") + .removeClass("ui-draggable" + + " ui-draggable-dragging" + + " ui-draggable-disabled"); + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.helper.addClass("ui-draggable-dragging"); + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.position; + } + + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is removed, don't bother to continue + if(!this.element[0] || !this.element[0].parentNode) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var self = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(self._trigger("stop", event) !== false) { + self._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone() : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var ce = $(o.containment)[0]; if(!ce) return; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.extend($.ui.draggable, { + version: "1.8.6" +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), self = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "iframeFix", { + start: function(event, ui) { + var o = $(this).data('draggable').options; + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + }, + stop: function(event, ui) { + $("div.ui-draggable-iframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); +/* + * jQuery UI Resizable 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var self = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Opera fix for relative positioning + if (/relative/.test(this.element.css('position')) && $.browser.opera) + this.element.css({ position: 'relative', top: 'auto', left: 'auto' }); + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>'); + + // increase zIndex of sw, se, ne, nw axis + //TODO : this modifies original option + if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!self.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + self.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .hover(function() { + $(this).removeClass("ui-resizable-autohide"); + self._handles.show(); + }, + function(){ + if (!self.resizing) { + $(this).addClass("ui-resizable-autohide"); + self._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + wrapper.after( + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }) + ).remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + //Opera fixing relative position + if ($.browser.opera && (/relative/).test(el.css('position'))) + el.css({ position: 'relative', top: 'auto', left: 'auto' }); + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + self = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; + + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, self = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + self.helper.height(self.size.height); + self.helper.width(self.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (data.height) data.width = (csize.height * this.aspectRatio); + else if (data.width) data.height = (csize.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) + continue; + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('<div style="overflow:hidden;"></div>'); + + // fix ie6 offset TODO: This seems broken + var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), + pxyoffset = ( ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +$.extend($.ui.resizable, { + version: "1.8.6" +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10), + position: el.css('position') // to reset Opera on stop() + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; + + var delta = { + height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, + top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + // Opera fixing relative position + if ($.browser.opera && /relative/.test(el.css('position'))) { + self._revertToRelativePosition = true; + el.css({ position: 'absolute', top: 'auto', left: 'auto' }); + } + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var _reset = function (exp) { + $(exp).each(function() { + var el = $(this); + // reset position for Opera - no need to verify it was changed + el.css({ position: el.data("resizable-alsoresize").position }); + }); + }; + + if (self._revertToRelativePosition) { + self._revertToRelativePosition = false; + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp) { _reset(exp); }); + }else{ + _reset(o.alsoResize); + } + } + + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + self.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(self.element.css('width'), 10), + height: parseInt(self.element.css('height'), 10), + top: parseInt(self.element.css('top'), 10), + left: parseInt(self.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + self._updateCache(data); + self._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, el = self.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + self.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + self.containerOffset = { left: 0, top: 0 }; + self.containerPosition = { left: 0, top: 0 }; + + self.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + self.containerOffset = element.offset(); + self.containerPosition = element.position(); + self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + self.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, + ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, + pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (self._helper ? co.left : 0)) { + self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); + if (pRatio) self.size.height = self.size.width / o.aspectRatio; + self.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (self._helper ? co.top : 0)) { + self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); + if (pRatio) self.size.width = self.size.height * o.aspectRatio; + self.position.top = self._helper ? co.top : 0; + } + + self.offset.left = self.parentData.left+self.position.left; + self.offset.top = self.parentData.top+self.position.top; + + var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), + hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); + + var isParent = self.containerElement.get(0) == self.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= self.parentData.left; + + if (woset + self.size.width >= self.parentData.width) { + self.size.width = self.parentData.width - woset; + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + } + + if (hoset + self.size.height >= self.parentData.height) { + self.size.height = self.parentData.height - hoset; + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + } + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options, cp = self.position, + co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; + + var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; + + if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (self._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var self = $(this).data("resizable"), o = self.options, cs = self.size; + + self.ghost = self.originalElement.clone(); + self.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + self.ghost.appendTo(self.helper); + + }, + + resize: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.left = op.left - ox; + } + else { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + self.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); diff --git a/js/jquery-ui-1.8.6.custom.min.js b/js/jquery-ui-1.8.6.custom.min.js new file mode 100644 index 0000000..08f17db --- /dev/null +++ b/js/jquery-ui-1.8.6.custom.min.js @@ -0,0 +1,162 @@ +/*! + * jQuery UI 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.6",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, +NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, +"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); +if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, +"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, +d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); +c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&& +b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery); +;/*! + * jQuery UI Widget 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h, +a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h; +e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options, +this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")}, +widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this}, +enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); +;/*! + * jQuery UI Mouse 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&& +this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault(); +return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&& +this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX- +a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +;/* + * jQuery UI Position 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, +left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= +k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+parseInt(c.curCSS(this,"marginRight",true))||0,w=m+q+parseInt(c.curCSS(this,"marginBottom",true))||0,i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=m/2; +i.left=parseInt(i.left);i.top=parseInt(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=d>0? +b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= +a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), +g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +;/* + * jQuery UI Draggable 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- +this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); +d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| +this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, +b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== +a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| +0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], +this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- +(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== +"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&& +a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"), +10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], +this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft(): +f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+ +this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+ +Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left- +this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs= +this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.6"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable"); +if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper; +c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver= +1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left; +this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper= +this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a= +d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options; +if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!= +"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX- +b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()- +c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this, +width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&& +o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t= +p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&& +(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"), +10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery); +;/* + * jQuery UI Resizable 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element, +_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; +if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), +d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= +this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: +this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", +b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; +f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", +b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top= +a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=l(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=l(b.width)&&a.minWidth&&a.minWidth>b.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, +k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"), +c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset= +this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ +a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this, +arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable, +{version:"1.8.6"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize, +function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n= +(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition= +false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left- +a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize", +b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top", +"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset, +f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left= +a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+ +a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&& +e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative", +height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width= +d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +; \ No newline at end of file diff --git a/js/jquery.xcolor-1.2.1.js b/js/jquery.xcolor-1.2.1.js new file mode 100644 index 0000000..00cb3e2 --- /dev/null +++ b/js/jquery.xcolor-1.2.1.js @@ -0,0 +1,1269 @@ +/** + * jQuery xcolor + * Copyright (c) 2010, Robert Eisele (robert@xarg.org) + * Dual licensed under the MIT or GPL Version 2 licenses. + * Date: 06/21/2010 + * + * @author Robert Eisele + * @version 1.2 + * + * @see http://www.xarg.org/project/jquery-color-plugin-xcolor/ + **/ + +(function ($) { + + // http://www.w3.org/TR/css3-color/#svg-color + var color_names = { + transparent: 16777216, + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074 + }; + + var mR=Math.round; + var mS=Math.sqrt; + var mX=Math.min; + var mY=Math.max; + var mT=Math.random; + + /** + * @constructor + */ + function xColor(color) { + + function _normalize(n, s) { + + var m; + + if (undefined === s) { + n = parseInt(n, 10); + s = 255; + m = 255; + } else { + + if (1 === s) { + + if (undefined === n) { + return 1; + } + + s = 100; + m = 1; + } else { + m = s; + } + + n = parseFloat(n); + } + + if (isNaN(n) || n <= 0) { + return 0; + } + + if (s < n) { + return m; + } + + if (n <= 1) { + if (m === 1) { + return n; + } else { + return (n * m) | 0; + } + } + return n * m / s; + } + + function _hsl(h,s,l) { + + h = _normalize(h, 360) / 360; + s = _normalize(s, 1); + l = _normalize(l, 1); + + if (0 === s) { + l = mR(l * 255); + return [l, l, l]; + } + + function _hue(v1, v2, h) { + if (h < 0) h++; + if (h > 1) h--; + if (6 * h < 1) return v1 + (v2 - v1) * 6 * h; + if (2 * h < 1) return v2; + if (3 * h < 2) return v1 + (v2 - v1) * (4 - 6 * h); + return v1; + } + + var v = l < .5 ? (l * (1 + s)) : (l + s - l * s); + var m = l + l - v; + + return [ + mR(255 *_hue(m, v, h + 1 / 3)), + mR(255 *_hue(m, v, h)), + mR(255 *_hue(m, v, h - 1 / 3)) ]; + } + + function _hsv(h,s,v) { + + h = _normalize(h, 360) / 60; + s = _normalize(s, 1); + v = _normalize(v, 1); + + var hi = h|0; + var f = h - hi; + + if (!(hi & 1)) f = 1 - f; + + var m = mR(255 * (v * (1 - s))); + var n = mR(255 * (v * (1 - s * f))); + + v = mR(255 * v); + + switch (hi) { + case 6: + case 0: + return [v, n, m]; + case 1: + return [n, v, m]; + case 2: + return [m, v, n]; + case 3: + return [m, n, v]; + case 4: + return [n, m, v]; + case 5: + return [v, m, n]; + } + } + + this.setColor = function (color) { + + this.success = true; + + if (typeof color === "number") { + + this.a =((color >> 24) & 0xff) / 255; + this.r = (color >> 16) & 0xff; + this.g = (color >> 8) & 0xff; + this.b = (color ) & 0xff; + return; + } + + while (typeof color === "object") { + + if (0 in color && 1 in color && 2 in color) { + this.a = _normalize(color[3], 1); + this.r = _normalize(color[0]); + this.g = _normalize(color[1]); + this.b = _normalize(color[2]); + return; + } else if ('r' in color && 'g' in color && 'b' in color) { + this.a = _normalize(color.a, 1); + this.r = _normalize(color.r); + this.g = _normalize(color.g); + this.b = _normalize(color.b); + return; + } else if ('h' in color && 's' in color) { + + var rgb; + + if ('l' in color) { + rgb = _hsl(color.h, color.s, color.l); + } else if ('v' in color) { + rgb = _hsv(color.h, color.s, color.v); + } else if ('b' in color) { + rgb = _hsv(color.h, color.s, color.b); + } else { + break; + } + + this.a = _normalize(color.a, 1); + this.r = rgb[0]; + this.g = rgb[1]; + this.b = rgb[2]; + return; + } + break; + } + + if (typeof color !== "string") { + this.success = false; + return; + } + + color = color.toLowerCase().replace(/[^a-z0-9,.()#%]/g, ''); + + var part, c; + + if (color in color_names) { + + c = color_names[color]; + + this.a =(!((c >> 24) & 0xff))|0; + this.r = ((c >> 16) & 0xff); + this.g = ((c >> 8) & 0xff); + this.b = ((c ) & 0xff); + return; + } + + // 53892983 + if (part = /^([1-9]\d*)$/.exec(color)) { + + c = parseInt(part[1], 10); + + this.a =(((c >> 24) & 0xff) || 255) / 255; + this.r = ((c >> 16) & 0xff); + this.g = ((c >> 8) & 0xff); + this.b = ((c ) & 0xff); + return; + } + + // #ff9000, #ff0000 + if (part = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/.exec(color)) { + this.a = 1; + this.r = parseInt(part[1], 16); + this.g = parseInt(part[2], 16); + this.b = parseInt(part[3], 16); + return; + } + + // #f00, fff + if (part = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(color)) { + this.a = 1; + this.r = parseInt(part[1] + part[1], 16); + this.g = parseInt(part[2] + part[2], 16); + this.b = parseInt(part[3] + part[3], 16); + return; + } + + // rgb(1, 234, 56) + if (part = /^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,([0-9.]+))?\)$/.exec(color)) { + this.a = _normalize(part[5], 1); + this.r = _normalize(part[1]); + this.g = _normalize(part[2]); + this.b = _normalize(part[3]); + return; + } + + // rgb(66%, 55%, 44%) in [0,100]%, [0,100]%, [0,100]% + if (part = /^rgba?\(([0-9.]+\%),([0-9.]+\%),([0-9.]+\%)(,([0-9.]+)\%?)?\)$/.exec(color)) { + this.a = _normalize(part[5], 1); + this.r = mR(_normalize(part[1], 100) * 2.55); + this.g = mR(_normalize(part[2], 100) * 2.55); + this.b = mR(_normalize(part[3], 100) * 2.55); + return; + } + + // hsv(64, 40, 16) in [0, 360], [0,100], [0,100] + if (part = /^hs([bvl])a?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,([0-9.]+))?\)$/.exec(color)) { + var func; + if (part[1] === "l") { + func = _hsl; + } else { + func = _hsv; + } + + c = func(parseInt(part[2], 10), parseInt(part[3], 10), parseInt(part[4], 10)); + + this.a = _normalize(part[6], 1); + this.r = c[0]; + this.g = c[1]; + this.b = c[2]; + return; + } + + // 1, 234, 56 + if (part = /^(\d{1,3}),(\d{1,3}),(\d{1,3})(,([0-9.]+))?$/.exec(color)) { + this.a = _normalize(part[5], 1); + this.r = _normalize(part[1]); + this.g = _normalize(part[2]); + this.b = _normalize(part[3]); + return; + } + + this.success = false; + } + + this.getColor = function (type) { + + if (undefined !== type) switch (type.toLowerCase()) { + case "rgb": + return this.getRGB(); + case "hsv": + case "hsb": + return this.getHSV(); + case "hsl": + return this.getHSL(); + case "int": + return this.getInt(); + case "array": + return this.getArray(); + case "fraction": + return this.getFraction(); + case "css": + case "style": + return this.getCSS(); + case "name": + return this.getName(); + } + return this.getHex(); + } + + this.getRGB = function () { + + if (this.success) { + + return { + r: this.r, + g: this.g, + b: this.b, + a: this.a + }; + } + return null; + } + + this.getCSS = function () { + + if (this.success) { + + if (this.a == 1) { + return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')'; + } + return 'rgba(' + this.r + ', ' + this.g + ', ' + this.b + ', ' + this.a + ')'; + } + return null; + } + + this.getArray = function () { + + if (this.success) { + return [this.r, this.g, this.b, this.a * 100 | 0]; + } + return null; + } + + this.getName = function () { + + if (this.success) { + + var lowest = null; + var lowest_ndx; + + var table = color_names; + + var a = this.getHSL(); + + for (var i in table) { + + /* We do not handle transparency */ + var b = new xColor(table[i]).getHSL(); + + var tmp = mS(0.5 * (a.h - b.h) * (a.h - b.h) + 0.5 * (a.s - b.s) * (a.s - b.s) + (a.l - b.l) * (a.l - b.l)); + + if (null === lowest || tmp < lowest) { + lowest = tmp; + lowest_ndx = i; + } + } + return lowest_ndx; + } + return null; + } + + this.getFraction = function () { + + if (this.success) { + + return { + r: this.r / 255, + g: this.g / 255, + b: this.b / 255, + a: this.a + }; + } + return null; + } + + this.getHSL = function () { + + // inspiration: http://130.113.54.154/~monger/hsl-rgb.html + if (this.success) { + + var r = this.r / 255; + var g = this.g / 255; + var b = this.b / 255; + + var min = mX(r, g, b); + var max = mY(r, g, b); + var delta = max - min; + + var h, s, l = (max + min) / 2; + + if (0 == delta) { + h = 0; + s = 0; + } else { + + if (l < .5) { + s = delta / (max + min); + } else { + s = delta / (2.0 - (max + min)); + } + + if (max == r) { + h = (g - b) / delta; + } else if (max == g) { + h = 2.0 + (b - r) / delta; + } else if (max == b) { + h = 4.0 + (r - g) / delta; + } + + if (h < 0) { + h+= 6; + } + } + return { + h: mR(h * 60), + s: mR(s * 100), + l: mR(l * 100), + a: this.a + }; + } + return null; + } + + this.getHSV = function () { + + if (this.success) { + + var r = this.r / 255; + var g = this.g / 255; + var b = this.b / 255; + + var min = mX(r, g, b); + var max = mY(r, g, b); + var delta = max - min; + + var h, s, v = max; + + if (0 == delta) { + h = 0; + s = 0; + } else { + s = delta / max; + + delta*= 6; + + var dR = .5 + (max - r) / delta; + var dG = .5 + (max - g) / delta; + var dB = .5 + (max - b) / delta; + + if (r == max) { + h = dB - dG; + } else if (g == max) { + h = 1 / 3 + dR - dB; + } else if (b == max) { + h = 2 / 3 + dG - dR; + } + + if (h < 0) h++; + if (h > 1) h--; + } + + return { + h: mR(h * 360), + s: mR(s * 100), + v: mR(v * 100), + a: this.a + }; + } + return null; + } + + this.getHex = function () { + + if (this.success) { + + var chars = "0123456789abcdef"; + + var r1 = this.r >> 4; + var g1 = this.g >> 4; + var b1 = this.b >> 4; + + var r2 = this.r & 0xf; + var g2 = this.g & 0xf; + var b2 = this.b & 0xf; + + if (0 === ((r1 ^ r2) | (g1 ^ g2) | (b1 ^ b2))) { + return '#' + chars.charAt(r1) + chars.charAt(g1) + chars.charAt(b1); + } + return '#' + + chars.charAt(r1) + chars.charAt(r2) + + chars.charAt(g1) + chars.charAt(g2) + + chars.charAt(b1) + chars.charAt(b2); + } + return null; + } + + this.getInt = function (alpha) { + + if (this.success) { + if (undefined !== alpha) { + return ((this.a * 100 | 0) << 24 ^ this.r << 16 ^ this.g << 8 ^ this.b); + } + return (this.r << 16 ^ this.g << 8 ^ this.b) & 0xffffff; + } + return null; + } + + this.toString = function () { + return this.getHex(); + } + + this.setColor(color); + } + + $.each(['color', 'backgroundColor', 'borderColor', 'borderTopColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'outlineColor'], function(i, attr) { + + $.fx.step[attr] = function(fx) { + + if (fx.xinit === undefined) { + + if (typeof fx.end === "string" && -1 !== fx.end.indexOf(";")) { + + var x, arr = fx.end.split(";"); + + if (arr.length > 2) { + + for (x in arr) { + if (-1 === arr[x].indexOf('native')) { + arr[x] = new xColor(arr[x]); + } else { + arr[x] = findColor(fx.elem, attr); + } + } + fx.start = null; + fx.end = arr; + } else { + fx.start = new xColor(arr[0]); + fx.end = new xColor(arr[1]); + } + } else { + fx.start = findColor(fx.elem, attr); + fx.end = new xColor(fx.end); + } + + fx.xinit = 1; + } + + var S = fx.start; + var E = fx.end; + var P = fx.pos; + + if (null === S) { + var m = P * (E.length - 1), n = P < 1 ? m | 0 : E.length - 2; + S = E[n]; + E = E[n + 1]; + P = m - n; + } + + if ($.support.opacity) { + fx.elem.style[attr] = "rgba(" + + ((S.r + (E.r - S.r) * P)|0) + "," + + ((S.g + (E.g - S.g) * P)|0) + "," + + ((S.b + (E.b - S.b) * P)|0) + "," + + ((S.a + (E.a - S.a) * P)) + ")"; + } else { + fx.elem.style[attr] = "rgb(" + + ((S.r + (E.r - S.r) * P)|0) + "," + + ((S.g + (E.g - S.g) * P)|0) + "," + + ((S.b + (E.b - S.b) * P)|0) + ")"; + } + } + }); + + function findColor(elem, attr) { + + var color = ""; + + if ($.support.opacity) { + + do { + color = $.curCSS(elem, attr); + + if ("" !== color || $.nodeName(elem, "body")) break; + + } while (elem = elem.parentNode); + + if ("" === color) { + color = "transparent"; + } + + } else { + + do { + color = $.curCSS(elem, attr); + + if ("" !== color && "transparent" !== color && "rgba(0, 0, 0, 0)" !== color || $.nodeName(elem, "body")) break; + + } while (elem = elem.parentNode); + + if ("" === color) { + if ("backgroundColor" === attr) { + color = "white"; + } else { + color = "black"; + } + } + } + + return new xColor(color); + } + + /** + * @constructor + */ + function xColorMix() { + + this.test = function (col) { + + var c = new xColor(col); + + if (c.success) { + return c; + } + return null; + } + + this.red = function (col) { + + var c = new xColor(col); + + if (c.success) { + c.g = 0xff; + c.b = 0xff; + return c; + } + return null; + } + + this.blue = function (col) { + + var c = new xColor(col); + + if (c.success) { + c.r = 0xff; + c.g = 0xff; + return c; + } + return null; + } + + this.green = function (col) { + + var c = new xColor(col); + + if (c.success) { + c.r = 0xff; + c.b = 0xff; + return c; + } + return null; + } + + this.random = function () { + + return new xColor([ + (255 * mT())|0, + (255 * mT())|0, + (255 * mT())|0 + ]); + } + + this.complementary = function (col) { + + var c = new xColor(col); + + if (c.success) { + c.r^= 0xff; + c.g^= 0xff; + c.b^= 0xff; + return c; + } + return null; + } + + this.opacity = function (x, y, o) { + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + + if (o > 1) { + o/= 100; + } + + o = mY(o - 1 + b.a, 0); + + a.r = mR((b.r - a.r) * o + a.r); + a.g = mR((b.g - a.g) * o + a.g); + a.b = mR((b.b - a.b) * o + a.b); + + return a; + } + return null; + } + + this.greyfilter = function (col, formula) { + + var v, c = new xColor(col); + + if (c.success) { + switch (formula) { + case 1: + // My own formula + v = .35 + 13 * (c.r + c.g + c.b) / 60; + break; + case 2: + // Sun's formula: (1 - avg) / (100 / 35) + avg) + v = (13 * (c.r + c.g + c.b) + 5355) / 60; + break; + default: + v = c.r * .3 + c.g * .59 + c.b * .11; + } + c.r = c.g = c.b = mX(v|0, 255); + + return c; + } + return null; + } + + this.webround = function (col) { + + var c = new xColor(col); + + if (c.success) { + if ((c.r+= 0x33 - c.r % 0x33) > 0xff) c.r = 0xff; + if ((c.g+= 0x33 - c.g % 0x33) > 0xff) c.g = 0xff; + if ((c.b+= 0x33 - c.b % 0x33) > 0xff) c.b = 0xff; + return c; + } + return null; + } + + this.distance = function (x, y) { + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + // Approximation attempt of http://www.compuphase.com/cmetric.htm + return mS(3 * (b.r - a.r) * (b.r - a.r) + 4 * (b.g - a.g) * (b.g - a.g) + 2 * (b.b - a.b) * (b.b - a.b)); + } + return null; + } + + this.readable = function (bg, col) { + + var a = new xColor(col); + var b = new xColor(bg); + + if (a.success & b.success) { + return ( + (b.r - a.r) * (b.r - a.r) + + (b.g - a.g) * (b.g - a.g) + + (b.b - a.b) * (b.b - a.b)) > 0x28A4; + } + return null; + } + + this.combine = function (x, y) { + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + a.r^= b.r; + a.g^= b.g; + a.b^= b.b; + return a; + } + return null; + } + + this.breed = function (x, y) { + + var a = new xColor(x); + var b = new xColor(y); + + var mask = 0; + + if (a.success & b.success) { + + for (var i = 0; i < 6; i++) { + if (mT() < .5) { + mask|= 0x0f << (i << 2); + } + } + + a.r = (a.r & ((mask >> 0x10) & 0xff)) | (b.r & (((mask >> 0x10) & 0xff) ^ 0xff)); + a.g = (a.g & ((mask >> 0x08) & 0xff)) | (b.g & (((mask >> 0x08) & 0xff) ^ 0xff)); + a.b = (a.b & ((mask >> 0x00) & 0xff)) | (b.b & (((mask >> 0x00) & 0xff) ^ 0xff)); + return a; + } + return null; + } + + this.additive = function (x, y) { + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + + if ((a.r+= b.r) > 0xff) a.r = 0xff; + if ((a.g+= b.g) > 0xff) a.g = 0xff; + if ((a.b+= b.b) > 0xff) a.b = 0xff; + + return a; + } + return null; + } + + this.subtractive = function (x, y) { + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + + if ((a.r+= b.r - 0xff) < 0) a.r = 0; + if ((a.g+= b.g - 0xff) < 0) a.g = 0; + if ((a.b+= b.b - 0xff) < 0) a.b = 0; + + return a; + } + return null; + } + + this.subtract = function (x, y) { + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + + if ((a.r-= b.r) < 0) a.r = 0; + if ((a.g-= b.g) < 0) a.g = 0; + if ((a.b-= b.b) < 0) a.b = 0; + + return a; + } + return null; + } + + this.multiply = function (x, y) { + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + a.r = (a.r / 255 * b.r)|0; + a.g = (a.g / 255 * b.g)|0; + a.b = (a.b / 255 * b.b)|0; + return a; + } + return null; + } + + this.average = function (x, y) { + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + a.r = (a.r + b.r) >> 1; + a.g = (a.g + b.g) >> 1; + a.b = (a.b + b.b) >> 1; + return a; + } + return null; + } + + this.triad = function (col) { + + var c = new xColor(col); + + if (c.success) { + + return [c, + new xColor([c.b, c.r, c.g]), + new xColor([c.g, c.b, c.r])]; + } + return null; + } + + this.tetrad = function (col) { + + var c = new xColor(col); + + if (c.success) { + + return [c, + new xColor([c.b, c.r, c.b]), + new xColor([c.b, c.g, c.r]), + new xColor([c.r, c.b, c.r])]; + } + return null; + } + + this.gradientlevel = function (x, y, level, deg) { + + if (level > deg) return null; + + var a = new xColor(x); + var b = new xColor(y); + + if (a.success & b.success) { + + a.r = (a.r + ((b.r - a.r) / deg) * level)|0; + a.g = (a.g + ((b.g - a.g) / deg) * level)|0; + a.b = (a.b + ((b.b - a.b) / deg) * level)|0; + + return a; + } + return null; + } + + this.gradientarray = function (arr, ndx, size) { + + if (ndx > size) return null; + + var e = (ndx * (arr.length - 1) / size)|0; + var m = (ndx - size * e / (arr.length - 1)) / size; + + var a = new xColor(arr[e]); + var b = new xColor(arr[e + 1]); + + if (a.success & b.success) { + + a.r = (a.r + arr.length * (b.r - a.r) * m)|0; + a.g = (a.g + arr.length * (b.g - a.g) * m)|0; + a.b = (a.b + arr.length * (b.b - a.b) * m)|0; + + return a; + } + return null; + } + + this.nearestname = function (a) { + + a = new xColor(a); + + if (a.success) { + return a.getName(); + } + return null; + } + + this.darken = function (col, by, shade) { + + if (by === undefined) { + by = 1; + } else if (by < 0) return this.lighten(col, -by, shade); + + if (shade === undefined) { + shade = 32; + } + + var c = new xColor(col); + + if (c.success) { + if ((c.r-= shade * by) < 0) c.r = 0; + if ((c.g-= shade * by) < 0) c.g = 0; + if ((c.b-= shade * by) < 0) c.b = 0; + return c; + } + return null; + } + + this.lighten = function (col, by, shade) { + + if (by === undefined) { + by = 1; + } else if (by < 0) return this.darken(col, -by, shade); + + if (shade === undefined) { + shade = 32; + } + + var c = new xColor(col); + + if (c.success) { + if ((c.r+= shade * by) > 0xff) c.r = 0xff; + if ((c.g+= shade * by) > 0xff) c.g = 0xff; + if ((c.b+= shade * by) > 0xff) c.b = 0xff; + return c; + } + return null; + } + + this.analogous = function (col, results, slices) { + + if (results === undefined) { + results = 8; + } + + if (slices === undefined) { + slices = 30; + } + + var c = new xColor(col); + + if (c.success) { + + var hsv = c.getHSV(); + var part = 360 / slices, ret = [ c ]; + + for (hsv.h = ((hsv.h - (part * results >> 1)) + 720) % 360; --results; ) { + hsv.h+= part; + hsv.h%= 360; + ret.push(new xColor(hsv)); + } + return ret; + } + return null; + } + + this.splitcomplement = function (col) { + + var c = new xColor(col); + + if (c.success) { + + var hsv = c.getHSV(); + var ret = [ c ]; + + hsv.h+= 72; + hsv.h%= 360; + ret.push(new xColor(hsv)); + + hsv.h+= 144; + hsv.h%= 360; + ret.push(new xColor(hsv)); + + return ret; + } + return null; + } + + this.monochromatic = function (col, results) { + + if (results === undefined) { + results = 6; + } + + var c = new xColor(col); + + if (c.success) { + + var hsv = c.getHSV(); + var ret = [ c ]; + + while (--results) { + hsv.v+= 20; + hsv.v%= 100; + ret.push(new xColor(hsv)); + } + return ret; + } + return null; + } + } + + $.xcolor = new xColorMix(); + + // GH: added + $.color = new xColor(); + + $.fn.isReadable = function () { + + var elem = this[0]; + var f = ""; + var b = ""; + + do { + + if ("" === f && ("transparent" === (f = $.curCSS(elem, "color")) || "rgba(0, 0, 0, 0)" === f)) { + f = ""; + } + + if ("" === b && ("transparent" === (b = $.curCSS(elem, "backgroundColor")) || "rgba(0, 0, 0, 0)" === b)) { + b = ""; + } + + if ("" !== f && "" !== b || $.nodeName(elem, "body")) { + break; + } + + } while (elem = elem.parentNode); + + if ("" === f) { + f = "black"; + } + + if ("" === b) { + b = "white"; + } + + // todo: if alpha != 1, use opacity() to calculate correct color on certain element and it's parent + return $.xcolor.readable(b, f); + } + +})(jQuery); diff --git a/json.php b/json.php new file mode 100644 index 0000000..2510fdc --- /dev/null +++ b/json.php @@ -0,0 +1,124 @@ +<?php + +/** + * json.php + * HTTP request handler for JSON-encoded AJAX calls + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('log.inc.php'); +log_msg('info', '--- json request ---'); +require_once('common.inc.php'); +require_once('modules.inc.php'); +require_once('util.inc.php'); + + +// set mime type and encoding first +header('Content-Type: application/json; charset=UTF-8'); + +// get method and arguments +$args = array(); +switch ($_SERVER['REQUEST_METHOD']) { + // we don't use $_REQUEST here because this includes cookies as well + // disable support for GET to make cross site request forgery (xsrf) + // at least harder to do + //case 'GET': + // foreach ($_GET as $key=>$val) { + // if (get_magic_quotes_gpc()) { + // $val = stripslashes($val); + // } + // $dec = @json_decode($val, true); + // if ($dec === NULL) { + // $err = response('Error decoding the argument '.quot($key).' => '.var_dump_inl($val), 400); + // echo json_encode($err); + // log_msg('warn', 'json: '.$err['#data']); + // die(); + // } else { + // $args[$key] = $dec; + // } + // } + // break; + case 'POST': + foreach ($_POST as $key=>$val) { + if (get_magic_quotes_gpc()) { + $val = stripslashes($val); + } + $dec = @json_decode($val, true); + if ($dec === NULL) { + $err = response('Error decoding the argument '.quot($key).' => '.var_dump_inl($val), 400); + echo json_encode($err); + log_msg('warn', 'json: '.$err['#data']); + die(); + } else { + $args[$key] = $dec; + } + } + break; + default: + //$err = response('Only HTTP GET and POST requests supported', 400); + $err = response('Only HTTP POST requests supported', 400); + echo json_encode($err); + log_msg('warn', 'json: '.$err['#data']); + die(); +} + +// check if we got a method argument +if (!empty($args['method'])) { + $method = $args['method']; + unset($args['method']); + log_msg('debug', 'json: method is '.quot($method)); + log_msg('debug', 'json: arguments are '.var_dump_inl($args)); + log_msg('debug', 'json: base url is '.quot(base_url())); +} else { + $err = response('Required argument "method" missing', 400); + echo json_encode($err); + log_msg('warn', 'json: '.$err['#data']); + die(); +} + +load_modules($method); + +if (!($m = get_service($method))) { + $err = response('Unknown method '.quot($method), 400); + echo json_encode($err); + log_msg('warn', 'json: '.$err['#data']); + die(); +} + +// check authentication +if (isset($m['auth']) && $m['auth']) { + if (!is_auth()) { + prompt_auth(true); + } +} + +if (isset($m['cross-origin']) && $m['cross-origin']) { + // output cross-origin header if requested + header('Access-Controll-Allow-Origin: *'); +} else { + // otherwise check the referer to make xsrf harder + if (!empty($_SERVER['HTTP_REFERER'])) { + $bu = base_url(); + if (substr($_SERVER['HTTP_REFERER'], 0, strlen($bu)) != $bu) { + echo json_encode(response('Cross-origin requests not supported for this method', 400)); + log_msg('warn', 'json: possible xsrf detected, referer is '.quot($_SERVER['HTTP_REFERER']).', arguments '.var_dump_inl($args)); + die(); + } + } +} + +// run service and output result +$ret = run_service($method, $args); +if (is_array($ret) && isset($ret['#error']) && $ret['#error']) { + log_msg('warn', 'json: service returned error '.quot($ret['#data'])); +} elseif (is_array($ret) && isset($ret['#data'])) { + log_msg('debug', 'json: service returned '.var_dump_inl($ret['#data'])); +} +echo json_encode($ret); + + +?> diff --git a/log.inc.php b/log.inc.php new file mode 100644 index 0000000..eeec3b7 --- /dev/null +++ b/log.inc.php @@ -0,0 +1,70 @@ +<?php + +/** + * log.inc.php + * Generic logging infrastructure + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('util.inc.php'); + +if (!isset($logfile)) { + $logfile = false; +} +if (!isset($loglevels)) { + $loglevels = array('error', 'warn', 'info', 'debug'); +} +if (!isset($request_id)) { + // mt_rand() is seeded automatically + $request_id = mt_rand(1, 32768); +} + + +/** + * log a message to file + * + * @param string $level can be error, warn, info or debug + * @param string $msg message + * @return bool true if successful, false if not + */ +function log_msg($level, $msg ) +{ + global $logfile; + global $loglevels; + global $request_id; + + // open logfile + if ($logfile === false) { + $m = umask(0111); + // having two processes appending to the same file should + // work fine (at least on Linux) + $logfile = @fopen(LOG_FILE, 'ab'); + umask($m); + } + if ($logfile === false) { + return false; + } + + foreach ($loglevels as $ll) { + if ($ll == $level) { + fwrite($logfile, date('Y-m-d H:i:s').tab().pad($_SERVER['REMOTE_ADDR'], 15).tab().sprintf('%05u', $request_id).tab().$level.tab().$msg.nl()); + fflush($logfile); + break; + } + if ($ll == LOG_LEVEL) { + break; + } + } + return true; +} + + +// we need no extra function to log response-arrays as they are logged further +// down in the server (e.g. json.php) + + +?> diff --git a/module_download.inc.php b/module_download.inc.php new file mode 100644 index 0000000..2e6e8c9 --- /dev/null +++ b/module_download.inc.php @@ -0,0 +1,187 @@ +<?php + +/** + * module_download.inc.php + * Module for allowing to download arbitrary files that were uploaded + * by the user + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('html.inc.php'); +require_once('modules.inc.php'); +// module glue gets loaded on demand +require_once('util.inc.php'); + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +function download_delete_object($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'download') { + return false; + } + + load_modules('glue'); + $a = expl('.', $obj['name']); + $ret = delete_upload(array('pagename'=>$a[0], 'file'=>$obj['download-file'], 'max_cnt'=>1)); + if ($ret['#error']) { + log_error('error', 'upload_delete_object: delete_upload returned '.quot($ret['#error'])); + } +} + + +function download_has_reference($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'download') { + return false; + } + // symlinks have their referenced files in a different page that's why + // they are not relevant here + if (@is_link(CONTENT_DIR.'/'.str_replace('.', '/', $obj['name']))) { + return false; + } + + if ($obj['download-file'] != $args['file']) { + return false; + } else { + return true; + } +} + + +function download_render_object($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'download') { + return false; + } + + if (!$args['edit'] && (!isset($obj['download-public']) || $obj['download-public'] != 'public')) { + // hide it in viewing mode if not public + return ''; + } elseif (!$args['edit']) { + // otherwise add the css only on-demand in viewing mode + html_add_css(base_url().'modules/download/download.css'); + } + + $e = elem('div'); + elem_attr($e, 'id', $obj['name']); + elem_add_class($e, 'download'); + elem_add_class($e, 'object'); + if ($args['edit']) { + elem_attr($e, 'title', 'this is '.$obj['name'].', original file name was '.$obj['download-file']); + } else { + elem_attr($e, 'title', 'download file'); + } + // get file extension + $a = expl('.', $obj['download-file']); + if (1 < count($a)) { + $v = elem('div'); + elem_add_class($v, 'download-ext'); + elem_val($v, htmlspecialchars(array_pop($a), ENT_NOQUOTES, 'UTF-8')); + elem_val($e, $v); + } + + invoke_hook('alter_render_early', array('obj'=>$obj, 'elem'=>&$e, 'edit'=>$args['edit'])); + + $html = elem_finalize($e); + invoke_hook('alter_render_late', array('obj'=>$obj, 'html'=>&$html, 'elem'=>$e, 'edit'=>$args['edit'])); + + if (!$args['edit']) { + // put link to file around the element + if (SHORT_URLS) { + $link = base_url().urlencode($obj['name']).'&download=1'; + } else { + $link = base_url().'?'.urlencode($obj['name']).'&download=1'; + } + $html = '<a href="'.htmlspecialchars($link, ENT_COMPAT, 'UTF-8').'">'."\n\t".str_replace("\n", "\n\t", $html)."\n".'</a>'."\n"; + } + + return $html; +} + + +function download_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/download/download-edit.js'); + html_add_css(base_url().'modules/download/download.css'); + } +} + + +function download_save_state($args) +{ + $elem = $args['elem']; + $obj = $args['obj']; + + if (elem_has_class($elem, 'download')) { + load_modules('glue'); + invoke_hook('alter_save', array('obj'=>&$obj, 'elem'=>$elem)); + // make width and height only be determined by the css + if (isset($obj['object-width'])) { + unset($obj['object-width']); + } + if (isset($obj['object-height'])) { + unset($obj['object-height']); + } + $ret = save_object($obj); + if ($ret['#error']) { + log_msg('error', 'download_save_state: save_object returned '.quot($ret['#data'])); + return false; + } else { + return true; + } + } else { + return false; + } +} + + +function download_serve_resource($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'download') { + return false; + } + + $a = expl('.', $obj['name']); + serve_file(CONTENT_DIR.'/'.$a[0].'/shared/'.$obj['download-file'], $args['dl'], $obj['download-file-mime']); +} + + +function download_upload_fallback($args) +{ + // we handle everything + load_modules('glue'); + + $obj = create_object($args); + if ($obj['#error']) { + return false; + } else { + $obj = $obj['#data']; + } + $obj['type'] = 'download'; + $obj['module'] = 'download'; + $obj['download-file'] = $args['file']; + $obj['download-file-mime'] = $args['mime']; + save_object($obj); + + $ret = render_object(array('name'=>$obj['name'], 'edit'=>true)); + if ($ret['#error']) { + return false; + } else { + return $ret['#data']; + } +} + + +?> diff --git a/module_glue.inc.php b/module_glue.inc.php new file mode 100644 index 0000000..671cdf5 --- /dev/null +++ b/module_glue.inc.php @@ -0,0 +1,1426 @@ +<?php + +/** + * module_glue.inc.php + * Main hotglue module + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('common.inc.php'); +// html{,_parse}.inc.php are only included where needed +require_once('modules.inc.php'); +require_once('util.inc.php'); + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +// TODO (later): switch services to using $args['args'] for input validation? + + +/** + * helper function for revisions_info() + * + * @param array $a array to compare + * @param array $b array to compare + * @return int comparison result + */ +function _cmp_time($a, $b) +{ + if ($a['time'] == $b['time']) { + return 0; + } + return ($a['time'] < $b['time']) ? 1 : -1; +} + + +// TODO: document +// wait in millis +function _obj_lock($name, $wait = true) +{ + $start = intval(microtime(true)*1000.0); + $fn = CONTENT_DIR.'/'.str_replace('.', '/', $name); + // resolve symlinks + if (@is_link($fn)) { + $target = @readlink($fn); + if (substr($target, 0, 1) == '/') { + $fn = $target; + } else { + $fn = dirname($fn).'/'.$target; + } + log_msg('debug', 'lock: resolved '.$name.' -> '.$fn); + } + do { + $f = @fopen($fn, 'rb'); + if ($f === false) { + // file does not exist + log_msg('debug', 'lock: file '.$fn.' does not exist'); + return NULL; + } + // try to acquire lock + if (@flock($f, LOCK_EX|LOCK_NB)) { + // success + log_msg('debug', 'lock: acquired lock for '.$name); + return $f; + } elseif ($wait === false) { + // give up right away + log_msg('debug', 'lock: could not acquire lock'); + return false; + } elseif (is_int($wait) && $wait < abs(intval(microtime(true)*1000.0)-$start)) { + // timeout + log_msg('debug', 'lock: could not acquire lock in '.$wait.'ms'); + return false; + } + // sleep for a tenth of a second (not sure if this works) + usleep(100000); + } while (true); +} + + +// TODO: document +function _obj_unlock($f) +{ + if ($f) { + @flock($f, LOCK_UN); + log_msg('debug', 'lock: released lock'); + @fclose($f); + } +} + + +/** + * create and delete auto- revisions + * + * this function operates on a specific page and takes SNAPSHOT_MIN_AGE and + * SNAPSHOT_MAX_AGE into account. + * @param array $args arguments + * key 'page' is the page (i.e. page.rev) + * @return array response + * true if successful + */ +function check_auto_snapshot($args) +{ + if (!isset($args['page'])) { + return response('Required argument "page" missing', 400); + } + if (!page_exists($args['page'])) { + return response('Page '.quot($args['page']).' does not exist', 400); + } + + $a = expl('.', $args['page']); + $revs = revisions_info(array('pagename'=>$a[0], 'sort'=>'time')); + $revs = $revs['#data']; + + if ($a[1] == 'head' && SNAPSHOT_MIN_AGE != 0) { + // we're dealing with a head revision and taking snapshots + // find the previous auto- revision + for ($i=0; $i < count($revs); $i++) { + if (substr($revs[$i]['revision'], 0, 5) == 'auto-') { + // got it, check age + if (time()-$revs[$i]['time'] < SNAPSHOT_MIN_AGE) { + log_msg('debug', 'check_auto_snapshot: age is '.(time()-$revs[$i]['time']).' seconds, not creating a snapshot'); + break; + } + // check if different + if (dir_is_different(CONTENT_DIR.'/'.str_replace('.', '/', $args['page']), CONTENT_DIR.'/'.str_replace('.', '/', $revs[$i]['page']))) { + snapshot($args); + } else { + log_msg('debug', 'check_auto_snapshot: head is identical to '.$revs[$i]['revision'].', not creating a snapshot'); + } + break; + } + if ($i == count($revs)-1) { + // no auto- revision?, create one now + snapshot($args); + } + } + } + + // delete old auto- revisions + if (SNAPSHOT_MAX_AGE != 0) { + for ($i=count($revs)-1; 0 <= $i; $i--) { + if (substr($revs[$i]['revision'], 0, 5) == 'auto-' && SNAPSHOT_MAX_AGE < time()-$revs[$i]['time']) { + log_msg('info', 'check_auto_snapshot: deleting an old snapshot'); + delete_page(array('page'=>$revs[$i]['page'])); + $i--; + } + } + } + + return response(true); +} + +register_service('glue.check_auto_snapshot', 'check_auto_snapshot', array('auth'=>true)); + + +/** + * duplicate an object + * + * @param array $args arguments + * key 'name' name of the object to duplicate + * @return array response + * string name of new object if successful + */ +function clone_object($args) +{ + // load old object + $old = load_object($args); + if ($old['#error']) { + return $old; + } else { + $old = $old['#data']; + } + + // create new object + $a = expl('.', $old['name']); + $new = create_object(array('page'=>$a[0].'.'.$a[1])); + if ($new['#error']) { + return $new; + } else { + $new = $new['#data']; + } + + // save old object as new + $new = array_merge($old, $new); + $ret = save_object($new); + if ($ret['#error']) { + return $ret; + } else { + // return name + return response($new['name']); + } +} + +register_service('glue.clone_object', 'clone_object', array('auth'=>true)); + + +/** + * create an empty object in the content directory + * + * @param array $args arguments + * key 'page' is the page (i.e. page.rev) + * @return array response + * key 'name' is the name of the object created + */ +function create_object($args) +{ + if (!isset($args['page'])) { + return response('Required argument "page" missing', 400); + } + if (!page_exists($args['page'])) { + return response('Page '.quot($args['page']).' does not exist', 400); + } + + // try to create new file + $f = false; + $tries = 0; + $mtime = intval(microtime(true)*100.0); + do { + // use a finer granularity than unix time by default + $name = $args['page'].'.'.($mtime+$tries); + $m = umask(0111); + $f = @fopen(CONTENT_DIR.'/'.str_replace('.', '/', $name), 'x'); + umask($m); + } + while ($f === false && $tries++ < 9); + + if (!$f) { + return response('Error creating an object in page '.quot($args['page']), 500); + } else { + fclose($f); + log_msg('info', 'create_object: created '.quot($name)); + return response(array('name'=>$name)); + } +} + +register_service('glue.create_object', 'create_object', array('auth'=>true)); + + +/** + * create a page + * + * @param array $args arguments + * key 'page' is the page (i.e. page.rev) + * @return array response + */ +function create_page($args) +{ + if (empty($args['page'])) { + return response('Required argument "page" missing or empty', 400); + } + if (page_exists($args['page'])) { + return response('Page '.quot($args['page']).' already exists', 400); + } + if (!valid_pagename($args['page'])) { + return response('Invalid page name '.quot($args['page']), 400); + } + + $a = expl('.', $args['page']); + $d = CONTENT_DIR.'/'.$a[0]; + if (!is_dir($d)) { + $m = umask(0000); + if (!@mkdir($d, 0777)) { + umask($m); + return response('Error creating directory '.quot($d), 500); + } + umask($m); + } + + $d .= '/'.$a[1]; + if (!is_dir($d)) { + $m = umask(0000); + if (!@mkdir($d, 0777)) { + umask($m); + return response('Error creating directory '.quot($d), 500); + } + umask($m); + } + + log_msg('info', 'create_page: created '.quot($args['page'])); + invoke_hook('create_page', array('page'=>$args['page'])); + return response(true); +} + +register_service('glue.create_page', 'create_page', array('auth'=>true)); +register_hook('create_page', 'invoked when a page has been created'); + + +/** + * delete an object from the content directory + * + * @param array $args arguments + * key 'name' is the object name (i.e. page.rev.obj) + * @return array response + */ +function delete_object($args) +{ + if (empty($args['name'])) { + return response('Required argument "name" missing or empty', 400); + } + if (!object_exists($args['name'])) { + return response('Object '.quot($args['name']).' does not exist', 404); + } + + // call delete_object unless the object is a symlink + // this is because referenced resources are not part of the current page + // anyway, and this way it is easier to handle for the modules + $ret = object_get_symlink($args); + $ret = $ret['#data']; + if ($ret === false) { + $obj = load_object($args); + if ($obj['#error']) { + return $obj; + } else { + $obj = $obj['#data']; + } + invoke_hook('delete_object', array('obj'=>$obj)); + } + + if (!@unlink(CONTENT_DIR.'/'.str_replace('.', '/', $args['name']))) { + return response('Error deleting object '.quot($args['name']), 500); + } else { + log_msg('info', 'delete_object: deleted '.quot($args['name'])); + // drop the object's page from cache + $a = expl('.', $args['name']); + drop_cache('page', $a[0].'.'.$a[1]); + return response(true); + } +} + +register_service('glue.delete_object', 'delete_object', array('auth'=>true)); +register_hook('delete_object', 'invoked when an object is going to be deleted, should be used for deleting referenced resources'); + + +/** + * delete a page + * + * @param array $args arguments + * key 'page' is the page (i.e. page.rev) + * @return array response + */ +function delete_page($args) +{ + if (empty($args['page'])) { + return response('Required argument "page" missing or empty', 400); + } + if (!page_exists($args['page'])) { + return response('Page '.quot($args['page']).' does not exist', 404); + } + + log_msg('info', 'delete_page: deleting '.quot($args['page'])); + invoke_hook('delete_page', array('page'=>$args['page'])); + + // TODO (later): make it possible to delete all revisions at once + // (optimization for frontend) + // it's objects first + $files = @scandir(CONTENT_DIR.'/'.str_replace('.', '/', $args['page'])); + foreach ($files as $f) { + if ($f == '.' || $f == '..') { + continue; + } + $ret = delete_object(array('name'=>$args['page'].'.'.$f)); + if ($ret['#error']) { + // try to delete dangling symlinks + $fn = CONTENT_DIR.'/'.str_replace('.', '/', $args['page']).'/'.$f; + if (is_link($fn) && !is_file($fn) && !is_dir($fn)) { + if (@unlink($fn)) { + log_msg('info', 'delete_page: deleted dangling symlink '.quot($args['page'].'.'.$f)); + } else { + log_msg('error', 'delete_page: error deleting dangling symlink '.quot($args['page'].'.'.$f)); + } + } else { + log_msg('error', 'delete_object: '.$ret['#data']); + } + } + } + + // then the revision directory + if (!@rmdir(CONTENT_DIR.'/'.str_replace('.', '/', $args['page']))) { + return response('Error deleting page '.$args['page'], 500); + } else { + log_msg('debug', 'delete_page: deleted '.quot($args['page'])); + // drop the page from cache + drop_cache('page', $args['page']); + } + + // finally try the shared directory and page directory + $a = expl('.', $args['page']); + @rmdir(CONTENT_DIR.'/'.$a[0].'/shared'); + if (@rmdir(CONTENT_DIR.'/'.$a[0])) { + log_msg('info', 'delete_page: parent page directory empty, removing '.quot($a[0])); + } + + return response(true); +} + +register_service('glue.delete_page', 'delete_page', array('auth'=>true)); +register_hook('delete_page', 'invoked when a page is going to be deleted'); +register_hook('has_reference', 'used for deleting referenced resources'); + + +/** + * delete a file in the shared directory of a page + * + * this function only deletes the file when there are no references to it + * left. this is not meant to be called directly from the frontend, but + * modules should use it when implementing delete_object. + * @param array $args arguments + * key 'pagename' is the pagename (i.e. page) + * key 'file' filename of file in the shared directory + * key 'max_cnt' delete the file if there are <= max_cnt references (defaults to zero) + * @return array response + * true if the file got deleted for good, false if not + */ +function delete_upload($args) +{ + if (@is_numeric($args['max_cnt'])) { + $max_cnt = intval($args['max_cnt']); + } else { + $max_cnt = 0; + } + + $refs = upload_references(array_merge($args, array('stop_after'=>$max_cnt+1))); + if ($refs['#error']) { + return $refs; + } else { + $refs = $refs['#data']; + } + + $f = CONTENT_DIR.'/'.$args['pagename'].'/shared/'.$args['file']; + if (count($refs) <= $max_cnt) { + if (@unlink($f)) { + log_msg('info', 'delete_upload: deleted '.quot($f)); + // being overly tidy, remove the shared dir if empty + @rmdir(CONTENT_DIR.'/'.$args['pagename'].'/shared'); + return response(true); + } else { + return response('Error deleting '.quot($f), 500); + } + } else { + log_msg('info', 'delete_upload: not deleting '.quot($f).' because there are still other objects referencing it'); + return response(false); + } +} + +register_service('glue.delete_upload', 'delete_upload', array('auth'=>true)); + + +/** + * load an object from the content directory + * + * @param array $args arguments + * key 'name' is the object name (i.e. page.rev.obj) + * @return array response + */ +function load_object($args) +{ + if (empty($args['name'])) { + return response('Required argument "name" missing or empty', 400); + } + + // open file for reading + if (($f = @fopen(CONTENT_DIR.'/'.str_replace('.', '/', $args['name']), 'rb')) === false) { + return response('Error opening '.quot($args['name']).' for reading', 404); + } + + // set the name attribute + // TODO (later): declaring arrays like this is probably unnecessary + $ret = array(); + $ret['name'] = $args['name']; + + // read lines and fill object array + $doing_attribs = true; + while (!feof($f)) { + $l = fgets($f, 4096); + if ($doing_attribs) { + // read attributes first + if (substr($l, -2) == "\r\n") { + $l = substr($l, 0, -2); + } elseif (substr($l, -1) == "\n") { + $l = substr($l, 0, -1); + } elseif (substr($l, -1) == "\r") { + $l = substr($l, 0, -1); + } + $a = expl(':', $l); + if (count($a) == 0) { + $doing_attribs = false; + } elseif (count($a) == 1) { + // value missing, ignoring + } else { + $ret[$a[0]] = implode(':', array_slice($a, 1)); + } + } else { + // content starts after the first empty line + if (isset($ret['content'])) { + $ret['content'] .= $l; + } else { + $ret['content'] = $l; + } + } + } + fclose($f); + + // re-set the name attribute (in case it got overwritten) + $ret['name'] = $args['name']; + + return response($ret); +} + +register_service('glue.load_object', 'load_object', array('auth'=>true)); + + +/** + * return the target of an object symlink + * + * @param array $args arguments + * key 'name' is the object name (i.e. page.rev.obj) + * @return array response + * key '#data' either has the target as object name, an + * empty string if the target is outside the content directory or + * false if the object is no symlink + */ +function object_get_symlink($args) +{ + if (empty($args['name'])) { + return response('Required argument "name" missing or empty', 400); + } + + // TODO (later): think the symlink situation on Windows through + if (is_link(CONTENT_DIR.'/'.str_replace('.', '/', $args['name']))) { + $f = readlink(CONTENT_DIR.'/'.str_replace('.', '/', $args['name'])); + if (substr($f, 0, 6) != '../../' || substr($f, 6, 2) == '..') { + log_msg('warn', 'object_get_symlink: target outside of content directory: '.quot($args['name']).' -> '.quot($f)); + return response(''); + } else { + return response(str_replace('/', '.', substr($f, 6))); + } + } else { + return response(false); + } +} + +register_service('glue.object_get_symlink', 'object_get_symlink', array('auth'=>true)); + + +/** + * create a symlink pointing to an object in all other pagename's head revisions + * + * @param array $args arguments + * key 'name' is the object name (i.e. page.rev.obj) + * @param array response + */ +function object_make_symlink($args) +{ + if (empty($args['name'])) { + return response('Required argument "name" missing or empty', 400); + } + if (!object_exists($args['name'])) { + return response('Object '.quot($args['name']).' does not exist', 404); + } + + $a = expl('.', $args['name']); + // see if the object is itself a symlink + $ret = object_get_symlink($args); + $ret = $ret['#data']; + if ($ret !== false && $ret !== '') { + // create a symlink pointing to the object's target instead + $target = '../../'.str_replace('.', '/', $ret); + // skip both the original object's pagename and the new target's pagename + $a_target = expl('.', $ret); + $skip_pns = array($a[0], $a_target[0]); + } else { + $target = '../../'.str_replace('.', '/', $args['name']); + $skip_pns = array($a[0]); + } + + $pns = pagenames(array()); + $pns = $pns['#data']; + // for every pagename + foreach ($pns as $pn) { + if (in_array($pn, $skip_pns)) { + continue; + } + // check if the head revision exists + if (is_dir(CONTENT_DIR.'/'.$pn.'/head')) { + $link = CONTENT_DIR.'/'.$pn.'/head/'.$a[2]; + if (is_file($link) && !is_link($link)) { + // delete objects with the same name + // these should have been created when shapshotting and the + // revision has later been reverted to + delete_object(array('name'=>$pn.'.head.'.$a[2])); + } elseif (is_link($link) && !is_file($link) && !is_dir($link)) { + // delete dangling symlinks too + if (@unlink($link)) { + log_msg('info', 'object_make_symlink: deleted dangling symlink '.quot($pn.'.head.'.$a[2])); + } else { + log_msg('error', 'object_make_symlink: error deleting dangling symlink '.quot($pn.'.head.'.$a[2])); + } + } + + // try to create symlink + if (@symlink($target, $link)) { + log_msg('debug', 'object_make_symlink: '.quot($pn.'.head.'.$a[2]).' -> '.quot($target)); + // drop the page from cache + drop_cache('page', $pn.'.head'); + } + } + } + + return response(true); +} + +register_service('glue.object_make_symlink', 'object_make_symlink', array('auth'=>true)); + + +/** + * remove one or more attributes from an object in the content directory + * + * this function takes the object lock. + * @param array $args arguments + * key 'name' is the object name (i.e. page.rev.obj) + * key 'attr' is either a string or an array containing the attribute + * names (keys) to remove + * @return array response + */ +function object_remove_attr($args) +{ + if (!isset($args['attr'])) { + return response('Required argument "attr" missing', 400); + } + + // LOCK + $_l = _obj_lock($args['name'], LOCK_TIME); + if ($_l === false) { + return response('Could not acquire lock to '.quot($args['name']).' in '.LOCK_TIME.'ms', 500); + } + $obj = load_object($args); + if ($obj['#error']) { + // UNLOCK + _obj_unlock($_l); + return $obj; + } else { + $obj = $obj['#data']; + } + + if (is_array($args['attr'])) { + foreach ($args['attr'] as $a) { + if (isset($obj[$a])) { + unset($obj[$a]); + } + } + } elseif (is_string($args['attr'])) { + if (isset($obj[$args['attr']])) { + unset($obj[$args['attr']]); + } + } else { + // UNLOCK + _obj_unlock($_l); + return response('Argument "attr" need to be either array or string', 400); + } + + $ret = save_object($obj); + // UNLOCK + _obj_unlock($_l); + return $ret; +} + +register_service('glue.object_remove_attr', 'object_remove_attr', array('auth'=>true)); + + +/** + * return an array of all pagenames in the content directory + * + * @param array $args unused + * @return array response + */ +function pagenames($args) +{ + if (is_dir(CONTENT_DIR)) { + $files = @scandir(CONTENT_DIR); + $ret = array(); + foreach ($files as $f) { + if ($f == '.' || $f == '..' || $f == 'cache') { + continue; + } elseif (!is_dir(CONTENT_DIR.'/'.$f)) { + // skip files + continue; + } else { + $ret[] = $f; + } + } + return response($ret); + } else { + return response(array()); + } +} + +register_service('glue.pagenames', 'pagenames'); + + +/** + * turn an object into an html string + * + * the function also appends the resulting string to the output in + * html.inc.php. + * @param array $args arguments + * string 'name' is the object name (i.e. page.rev.obj) + * bool 'edit' are we editing or not + * @return array response + * html + */ +function render_object($args) +{ + // maybe move this to common.inc.php in the future and get rid of some of + // these checks in the beginning + $obj = load_object($args); + if ($obj['#error']) { + return $obj; + } else { + $obj = $obj['#data']; + } + if (!isset($args['edit'])) { + return response('Required argument "edit" missing', 400); + } + if ($args['edit']) { + $args['edit'] = true; + } else { + $args['edit'] = false; + } + + log_msg('debug', 'render_object: rendering '.quot($args['name'])); + $ret = invoke_hook_while('render_object', false, array('obj'=>$obj, 'edit'=>$args['edit'])); + if (empty($ret)) { + log_msg('warn', 'render_object: nobody claimed '.quot($obj['name'])); + return response(''); + } else { + $temp = array_keys($ret); + log_msg('debug', 'render_object: '.quot($obj['name']).' was handled by '.quot($temp[0])); + $temp = array_values($ret); + // make sure object has a tailing newline + if (0 < strlen($temp[0]) && substr($temp[0], -1) != "\n") { + $temp[0] .= nl(); + } + body_append($temp[0]); + // return the element as html-string as well + return response($temp[0]); + } +} + +register_service('glue.render_object', 'render_object'); +register_hook('render_object', 'render an object'); + + +/** + * turn a page into an html string + * + * the function also appends the resulting string to the output in + * html.inc.php. + * @param array $args arguments + * key 'page' is the page (i.e. page.rev) + * key 'edit' are we editing or not + * @return array response + * html + */ +function render_page($args) +{ + // maybe move this to common.inc.php in the future and get rid of some of + // these checks in the beginning + if (empty($args['page'])) { + return response('Required argument "page" missing or empty', 400); + } + if (!page_exists($args['page'])) { + return response('Page '.quot($args['page']).' does not exist', 404); + } + if (!isset($args['edit'])) { + return response('Required argument "edit" missing', 400); + } + if ($args['edit']) { + $args['edit'] = true; + } else { + $args['edit'] = false; + } + + log_msg('debug', 'render_page: rendering '.quot($args['page'])); + $bdy = &body(); + elem_add_class($bdy, 'page'); + elem_attr($bdy, 'id', $args['page']); + invoke_hook('render_page_early', array('page'=>$args['page'], 'edit'=>$args['edit'])); + + // for every file in the page directory + $files = @scandir(CONTENT_DIR.'/'.str_replace('.', '/', $args['page'])); + foreach ($files as $f) { + $fn = CONTENT_DIR.'/'.str_replace('.', '/', $args['page']).'/'.$f; + if ($f == '.' || $f == '..') { + continue; + } elseif (is_link($fn) && !is_file($fn) && !is_dir($fn)) { + // delete dangling symlink + if (@unlink($fn)) { + log_msg('info', 'render_page: deleted dangling symlink '.quot($args['page'].'.'.$f)); + } else { + log_msg('error', 'render_page: error deleting dangling symlink '.quot($args['page'].'.'.$f)); + } + continue; + } + // render object + render_object(array('name'=>$args['page'].'.'.$f, 'edit'=>$args['edit'])); + } + + invoke_hook('render_page_late', array('page'=>$args['page'], 'edit'=>$args['edit'])); + log_msg('debug', 'render_page: finished '.quot($args['page'])); + + // return the body element as html-string as well + return response(elem_finalize($bdy)); +} + +register_service('glue.render_page', 'render_page'); +register_hook('render_page_early', 'invoked early in the page rendering'); +register_hook('render_page_late', 'invoked after the objects have been rendered'); + + +/** + * rename a page + * @param array $args arguments + * key 'old' old page (i.e. page1.rev) + * key 'new' new page (i.e. page2.rev) + * @return array response + */ +function rename_page($args) +{ + if (empty($args['old'])) { + return response('Required argument "old" missing or empty', 400); + } + $pns = pagenames(array()); + $pns = $pns['#data']; + if (!in_array($args['old'], $pns)) { + return response('Page name '.quot($args['old']).' does not exist', 404); + } + if (empty($args['new'])) { + return response('Required argument "new" missing or empty', 400); + } + if (in_array($args['new'], $pns)) { + return response('Page name '.quot($args['new']).' already exists', 400); + } + if (!valid_pagename($args['new'].'.head')) { + return response('Invalid page name '.quot($args['new']), 400); + } + + if (!@rename(CONTENT_DIR.'/'.$args['old'], CONTENT_DIR.'/'.$args['new'])) { + return response('Error renaming page '.quot($args['old']).' to '.quot($args['new']), 500); + } else { + log_msg('info', 'rename_page: renamed '.quot($args['old']).' to '.quot($args['new'])); + // clean up cache as well + $revs = revisions(array('pagename'=>$args['new'])); + $revs = $revs['#data']; + foreach ($revs as $rev) { + drop_cache('page', $args['old'].'.'.$rev); + } + invoke_hook('rename_page', array('pagename'=>$args['new'])); + return response(true); + } +} + +register_service('glue.rename_page', 'rename_page', array('auth'=>true)); +register_hook('rename_page', 'invoked when a page has been renamed'); + + +/** + * revert to a specific revision of a page + * + * this function makes the revision the page's new head revision by copying it. + * @param array $args arguments + * key 'page' page to revert to (i.e. page.rev) + * @return array response + */ +function revert($args) +{ + if (empty($args['page'])) { + return response('Required argument "page" missing or empty', 400); + } + if (!page_exists($args['page'])) { + return response('Page '.quot($args['page']).' does not exist', 404); + } + $a = expl('.', $args['page']); + if ($a[1] == 'head') { + return response('Cannot revert to head revision', 400); + } + + log_msg('info', 'revert: reverting to '.quot($args['page'])); + + // delete current head revision + if (page_exists($a[0].'.head')) { + $ret = delete_page(array('page'=>$a[0].'.head')); + if ($ret['#error']) { + return $ret; + } + } + + // create new head revision + $dest = CONTENT_DIR.'/'.$a[0].'/head'; + $m = umask(0000); + if (!@mkdir($dest, 0777)) { + umask($m); + return response('Error creating directory '.quot($dest), 500); + } + umask($m); + + // copy files + $src = CONTENT_DIR.'/'.$a[0].'/'.$a[1]; + $files = scandir($src); + foreach ($files as $f) { + if ($f == '.' || $f == '..') { + continue; + } elseif (is_file($src.'/'.$f)) { + // copy file + $m = umask(0111); + if (!@copy($src.'/'.$f, $dest.'/'.$f)) { + log_msg('error', 'revert: error copying '.quot($src.'/'.$f).' to '.quot($dest.'/'.$f).', skipping file'); + } + umask($m); + } + } + + log_msg('info', 'revert: reverted to '.quot($args['page'])); + invoke_hook('revert', array('page'=>$args['page'])); + + return response(true); +} + +register_service('glue.revert', 'revert', array('auth'=>true)); +register_hook('revert', 'invoked after a page has been reverted to'); + + +/** + * return an array of all revisions of a page + * + * @param array $args arguments + * key 'pagename' is the pagename (i.e. page) + * @return array response + */ +function revisions($args) +{ + if (empty($args['pagename'])) { + return response('Required argument "pagename" missing or empty', 400); + } + if (!is_dir(CONTENT_DIR.'/'.$args['pagename'])) { + return response('Page name '.quot($args['pagename']).' does not exist', 404); + } + + $files = @scandir(CONTENT_DIR.'/'.$args['pagename']); + $ret = array(); + foreach ($files as $f) { + if ($f == '.' || $f == '..' || $f == 'shared') { + continue; + } elseif (!is_dir(CONTENT_DIR.'/'.$args['pagename'].'/'.$f)) { + // skip files + continue; + } else { + $ret[] = $f; + } + } + return response($ret); +} + +register_service('glue.revisions', 'revisions'); + + +/** + * return an array with informations about all revisions of a page + * + * @param array $args arguments + * key 'pagename' is the pagename (i.e. page) + * key 'sort' can be either 'time' (descending) or 'name' (ascending, the + * default) + * @return array response + */ +function revisions_info($args) +{ + $revs = revisions($args); + if ($revs['#error']) { + return $revs; + } + + $ret = array(); + foreach ($revs['#data'] as $r) { + $d = CONTENT_DIR.'/'.$args['pagename'].'/'.$r; + $ret[] = array('revision'=>$r, 'time'=>@filemtime($d), 'num_objs'=>count(@scandir($d))-2, 'page'=>$args['pagename'].'.'.$r); + } + + if (isset($args['sort']) && $args['sort'] == 'time') { + // make head revision always most recent one + $head = false; + for ($i=0; $i < count($ret); $i++) { + if ($ret[$i]['revision'] == 'head') { + $head = $ret[$i]; + array_splice($ret, $i, 1); + $i--; + } + } + usort($ret, '_cmp_time'); + if ($head !== false) { + $ret = array_merge(array($head), $ret); + } + } + + return response($ret); +} + +register_service('glue.revisions_info', 'revisions_info'); + + +/** + * save an object to the content directory + * + * use update_object() whenever possible as we want to preserve any object + * metadata that is stored in as attributes. + * @param array $args arguments + * key 'name' is the object name (i.e. page.rev.obj) + * key 'content' is the object's content + * all other key/value pairs are treated as attributes + * @return array response + */ +function save_object($args) +{ + if (empty($args['name'])) { + return response('Required argument "name" missing or empty', 400); + } + + // open file for writing + $m = umask(0111); + if (($f = @fopen(CONTENT_DIR.'/'.str_replace('.', '/', $args['name']), 'wb')) === false) { + umask($m); + return response('Error opening '.quot($args['name']).' for writing', 500); + } + umask($m); + + // save attributes + foreach ($args as $key=>$val) { + if ($key == 'name' || $key == 'content') { + continue; + } + // check for delimiter character in key + if (strpos($key, ':') !== false) { + log_msg('warn', 'save_object: skipping attribute '.quot($key).' in object '.quot($args['name'])); + continue; + } + // filter newlines from value + $val = str_replace("\r\n", '', $val); + $val = str_replace("\n", '', $val); + $val = str_replace("\r", '', $val); + fwrite($f, $key.':'.$val."\n"); + } + + // save content + if (isset($args['content'])) { + fwrite($f, "\n"); + fwrite($f, $args['content']); + } + + fclose($f); + // drop the page from cache + // TODO (later): also drop related caches if object is a symlink or target + // of a symlink + $a = expl('.', $args['name']); + drop_cache('page', $a[0].'.'.$a[1]); + + return response(true); +} + +register_service('glue.save_object', 'save_object', array('auth'=>true)); + + +/** + * save the state of a html element corresponding to an object to disk + * + * this function takes the object lock. + * @param array $args arguments + * key 'html' one html element + * @return array response + * true if successful + */ +function save_state($args) +{ + if (empty($args['html'])) { + return response('Required argument "html" missing or empty', 400); + } + + require_once('html.inc.php'); + require_once('html_parse.inc.php'); + + $elem = html_parse_elem($args['html']); + if (!elem_has_class($elem, 'object')) { + return response('Error saving state as class "object" is not set', 400); + } elseif (!object_exists(elem_attr($elem, 'id'))) { + return response('Error saving state as object does not exist', 404); + } + + // LOCK + $L = _obj_lock(elem_attr($elem, 'id'), LOCK_TIME); + if ($L === false) { + return response('Could not acquire lock to '.quot($args['name']).' in '.LOCK_TIME.'ms', 500); + } + $obj = load_object(array('name'=>elem_attr($elem, 'id'))); + if ($obj['#error']) { + // UNLOCK + _obj_unlock($L); + return response('Error saving state, cannot load '.quot(elem_attr($elem, 'id')), 500); + } else { + $obj = $obj['#data']; + } + $ret = invoke_hook_while('save_state', false, array('elem'=>$elem, 'obj'=>$obj)); + // UNLOCK + _obj_unlock($L); + if (count($ret) == 0) { + return response('Error saving state as nobody claimed element', 500); + } else { + $temp = array_keys($ret); + log_msg('info', 'save_state: '.quot($obj['name']).' was handled by '.quot($temp[0])); + return response(true); + } +} + +register_service('glue.save_state', 'save_state', array('auth'=>true)); +// modules handling this hook need to make sure that they are not calling +// either update_object() or object_remove_attr(), but rather save_object() +// directly +register_hook('save_state', 'save the current state of an object to disk'); + + +/** + * set the startpage + * + * @param array $args arguments + * key 'page' is the page (i.e. page.rev) + * @return array response + * true if successful + */ +function set_startpage($args) +{ + if (!isset($args['page'])) { + return response('Required argument "page" missing', 400); + } + + $m = umask(0111); + if (file_put_contents(CONTENT_DIR.'/startpage', $args['page']) === false) { + umask($m); + return response('Error setting start page', 500); + } else { + umask($m); + return response(true); + } +} + +register_service('glue.set_startpage', 'set_startpage', array('auth'=>true)); + + +/** + * create a snapshot from a page + * + * @param array $args arguments + * key 'page' page to shapshot (i.e. page.rev) + * key 'rev' (optional) new revision name (i.e. rev2) (if empty or not set + * a revision starting with 'auto-' and the current date will be + * created) + * @return array response (holding the page of the newly created revision + * if successful) + */ +function snapshot($args) +{ + if (empty($args['page'])) { + return response('Required argument "page" missing or empty', 400); + } + if (!page_exists($args['page'])) { + return response('Page '.quot($args['page']).' does not exist', 404); + } + // setup revision name + $a = expl('.', $args['page']); + if (empty($args['rev'])) { + $args['rev'] = 'auto-'.date('YmdHis'); + } elseif (page_exists($a[0].'.'.$args['rev'])) { + return response('Revision '.quot($args['rev']).' already exists', 400); + } elseif (!valid_pagename($a[0].'.'.$args['rev'])) { + return response('Invalid revision '.quot($args['rev']), 400); + } + + // create revision + $dest = CONTENT_DIR.'/'.$a[0].'/'.$args['rev']; + $m = umask(0000); + if (!@mkdir($dest)) { + umask($m); + return response('Error creating directory '.quot($dest), 500); + } + umask($m); + + // copy files + // we go through the files one by one in order to spot symlinks hiding + $src = CONTENT_DIR.'/'.str_replace('.', '/', $args['page']); + $files = scandir($src); + foreach ($files as $f) { + if ($f == '.' || $f == '..') { + continue; + } elseif (is_dir($src.'/'.$f)) { + log_msg('warn', 'snapshot: skipping '.quot($src.'/'.$f).' as we don\'t support directories inside pages'); + } elseif (is_link($src.'/'.$f) && is_file($src.'/'.$f)) { + // a proper symlink, copy content + $s = @file_get_contents($src.'/'.$f); + $m = umask(0111); + if (!@file_put_contents($dest.'/'.$f, $s)) { + log_msg('error', 'snapshot: error writing to '.quot($dest.'/'.$f). ', skipping file'); + } else { + log_msg('debug', 'snapshot: copied the content of symlink '.quot($args['page'].'.'.$f)); + } + umask($m); + } elseif (is_file($src.'/'.$f)) { + // copy file + $m = umask(0111); + if (!@copy($src.'/'.$f, $dest.'/'.$f)) { + log_msg('error', 'snapshot: error copying '.quot($src.'/'.$f).' to '.quot($dest.'/'.$f).', skipping file'); + } + umask($m); + } + } + + log_msg('info', 'snapshot: created snapshot '.quot($a[0].'.'.$args['rev']).' from '.quot($args['page'])); + return response($a[0].'.'.$args['rev']); +} + +register_service('glue.snapshot', 'snapshot', array('auth'=>true)); + + +/** + * update an object + * + * this function merges the attributes in $args with the object already on + * disk. the object need not exist before, though. + * this function takes the object lock. + * @param array $args arguments + * key 'name' is the object name (i.e. page.rev.obj) + * key 'content' is the object's content + * all other key/value pairs are treated as attributes + * @return array response + */ +function update_object($args) +{ + if (empty($args['name'])) { + return response('Required argument "name" missing or empty', 400); + } + + // LOCK + $L = _obj_lock($args['name'], LOCK_TIME); + // the object need not exist, so we're not checking against + // $L being NULL here + if ($L === false) { + return response('Could not acquire lock to '.quot($args['name']).' in '.LOCK_TIME.'ms', 500); + } + $old = load_object($args); + if ($old['#error']) { + $old = array(); + } else { + $old = $old['#data']; + } + $new = array_merge($old, $args); + + $ret = save_object($new); + // UNLOCK + _obj_unlock($L); + return $ret; +} + +register_service('glue.update_object', 'update_object', array('auth'=>true)); + + +// TODO: document +function upload_files($args) +{ + if (empty($args['page'])) { + return response('Required argument "page" missing or empty', 400); + } + if (!page_exists($args['page'])) { + return response('Page '.quot($args['page']).' does not exist', 404); + } + + $ret = array(); + + log_msg('debug', 'upload_files: $_FILES is '.var_dump_inl($_FILES)); + foreach ($_FILES as $f) { + $existed = false; + $fn = upload_file($f['tmp_name'], $args['page'], $f['name'], $existed); + if ($fn === false) { + continue; + } else { + $args = array_merge($args, array('file'=>$fn, 'mime'=>$f['type'], 'size'=>$f['size'])); + // clear mime type if set to default application/octet-stream + if ($args['mime'] == 'application/octet-stream') { + $args['mime'] = ''; + } + } + $s = false; + // check preferred_module first + if (!empty($args['preferred_module'])) { + $func = $args['preferred_module'].'_upload'; + if (is_callable($func)) { + log_msg('debug', 'upload_files: invoking hook upload, calling '.$func); + $s = $func($args); + if ($s !== false) { + log_msg('info', 'upload_object: '.quot($fn).' was handled by '.quot($args['preferred_module'])); + } + } + } + // check all other modules next + if ($s === false) { + $r = invoke_hook_while('upload', false, $args); + if (count($r) == 1) { + $s = array_pop(array_values($r)); + log_msg('info', 'upload_object: '.quot($fn).' was handled by '.quot(array_pop(array_keys($r)))); + } + } + // check fallback hook last + if ($s === false) { + $r = invoke_hook_while('upload_fallback', false, $args); + if (count($r) == 1) { + $s = array_pop(array_values($r)); + log_msg('info', 'upload_object: '.quot($fn).' was (fallback-) handled by '.quot(array_pop(array_keys($r)))); + } + } + + if ($s === false) { + log_msg('warn', 'upload_files: nobody cared about file '.quot($fn).', type '.$f['type']); + // delete file again unless it did already exist + if (!$existed) { + $a = expl('.', $args['page']); + @unlink(CONTENT_DIR.'/'.$a[0].'/shared/'.$fn); + } + } else { + $ret[] = $s; + } + } + + return response($ret); +} + +register_service('glue.upload_files', 'upload_files', array('auth'=>true)); + + +/** + * list all objects referencing a certain file in the shared directory + * + * @param array $args arguments + * key 'pagename' is the pagename (i.e. page) + * key 'file' filename of file in the shared directory + * key 'stop_after' n references + * @return array response + * array of objects (i.e. page.rev.obj) + */ +function upload_references($args) +{ + $revs = revisions($args); + if ($revs['#error']) { + return $revs; + } else { + $revs = $revs['#data']; + } + if (empty($args['file'])) { + return response('Required argument "file" missing or empty', 400); + } + // this is an optimization for delete_upload() + if (@is_numeric($args['stop_after'])) { + $stop_after = intval($args['stop_after']); + } else { + $stop_after = 0; + } + + $ret = array(); + + // for each revision + foreach ($revs as $rev) { + // load all objects + $files = @scandir(CONTENT_DIR.'/'.$args['pagename'].'/'.$rev); + foreach ($files as $f) { + if ($f == '.' || $f == '..') { + continue; + } + $obj = load_object(array('name'=>$args['pagename'].'.'.$rev.'.'.$f)); + if ($obj['#error']) { + continue; + } else { + $obj = $obj['#data']; + } + // and handle the object to our modules + log_msg('debug', 'upload_references: checking '.quot($obj['name'])); + $revs = invoke_hook_while('has_reference', false, array('file'=>$args['file'], 'obj'=>$obj)); + if (count($revs)) { + $ret[] = $args['pagename'].'.'.$rev.'.'.$f; + if (count($ret) == $stop_after) { + // return prematurely + return response($ret); + } + } + } + } + + return response($ret); +} + +register_service('glue.upload_references', 'upload_references', array('auth'=>true)); +register_hook('has_reference', 'check if an object references an uploaded file'); + + +function glue_module_info() +{ + return array( + 'description' => 'core hotglue functionality, do not remove', + 'author' => 'gohai', + 'version' => 1.0, + 'url' => 'http://hotglue.me/', + 'dependencies' => array() + ); +} + +register_hook('module_info', 'return information about the module'); + + +?> diff --git a/module_iframe.inc.php b/module_iframe.inc.php new file mode 100644 index 0000000..3182019 --- /dev/null +++ b/module_iframe.inc.php @@ -0,0 +1,143 @@ +<?php + +/** + * module_iframe.inc.php + * Module for embedding iframe elements + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('html.inc.php'); +require_once('html_parse.inc.php'); +require_once('modules.inc.php'); +// module glue gets loaded on demand + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +function iframe_render_object($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'iframe') { + return false; + } + + $e = elem('div'); + elem_attr($e, 'id', $obj['name']); + elem_add_class($e, 'iframe'); + elem_add_class($e, 'resizable'); + elem_add_class($e, 'object'); + $i = elem('iframe'); + if (!$args['edit'] && IE8_COMPAT) { + elem_attr($i, 'frameborder', '0'); + } + elem_css($i, 'background-color', 'transparent'); + elem_css($i, 'border-width', '0px'); + elem_css($i, 'height', '100%'); + elem_css($i, 'position', 'absolute'); + elem_css($i, 'width', '100%'); + // url + if (!empty($obj['iframe-url'])) { + elem_attr($i, 'src', $obj['iframe-url']); + } else { + elem_attr($i, 'src', ''); + } + // scrolling + if (isset($obj['iframe-scroll']) && $obj['iframe-scroll'] == 'scroll') { + elem_css($i, 'overflow', 'auto'); + // attribute scrolling is not available in html5 but this effectivly + // removes the scrollbars on Chrome, so.. + elem_attr($i, 'scrolling', 'auto'); + } else { + elem_css($i, 'overflow', 'hidden'); + elem_attr($i, 'scrolling', 'no'); + elem_attr($i, 'seamless', 'seamless'); + } + elem_append($e, $i); + if ($args['edit']) { + // add shield as well + $s = elem('div'); + elem_add_class($s, 'glue-iframe-shield'); + elem_add_class($s, 'glue-ui'); + elem_css($s, 'height', '100%'); + elem_css($s, 'position', 'absolute'); + elem_css($s, 'width', '100%'); + elem_attr($s, 'title', 'visitors will be able to interact with the webpage below'); + elem_append($e, $s); + } + + // hooks + invoke_hook('alter_render_early', array('obj'=>$obj, 'elem'=>&$e, 'edit'=>$args['edit'])); + $html = elem_finalize($e); + invoke_hook('alter_render_late', array('obj'=>$obj, 'html'=>&$html, 'elem'=>$e, 'edit'=>$args['edit'])); + + return $html; +} + + +function iframe_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/iframe/iframe-edit.js'); + html_add_css(base_url().'modules/iframe/iframe-edit.css'); + } +} + + +function iframe_save_state($args) +{ + $elem = $args['elem']; + $obj = $args['obj']; + + if (!elem_has_class($elem, 'iframe')) { + return false; + } + + // parse children elements to find iframe + $childs = html_parse(elem_val($elem)); + $i = false; + foreach ($childs as $c) { + if (isset($c['tag']) && strtolower($c['tag']) == 'iframe') { + $i = $c; + break; + } + } + if (!$i) { + log_msg('warn', 'iframe_save_state: no iframe element found, inner html is '.var_dump_inl($childs)); + return false; + } + + // the object file might currently empty, so make sure type and module + // get set + $obj['type'] = 'iframe'; + $obj['module'] = 'iframe'; + // url + if (elem_attr($i, 'src') !== NULL) { + $obj['iframe-url'] = elem_attr($i, 'src'); + } + // scrolling + if (elem_css($i, 'overflow') == 'hidden' || (elem_css($i, 'overflow-x') == 'hidden' && elem_css($i, 'overflow-y') == 'hidden')) { + unset($obj['iframe-scroll']); + } else { + $obj['iframe-scroll'] = 'scroll'; + } + + // hook + invoke_hook('alter_save', array('obj'=>&$obj, 'elem'=>$elem)); + load_modules('glue'); + $ret = save_object($obj); + if ($ret['#error']) { + log_msg('error', 'iframe_save_state: save_object returned '.quot($ret['#data'])); + return false; + } else { + return true; + } +} + + +?> diff --git a/module_image.inc.php b/module_image.inc.php new file mode 100644 index 0000000..615dfc2 --- /dev/null +++ b/module_image.inc.php @@ -0,0 +1,563 @@ +<?php + +/** + * module_image.inc.php + * Module for displaying images uploaded by the user + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('html.inc.php'); +require_once('modules.inc.php'); +// module glue gets loaded on demand +require_once('util.inc.php'); + + +/** + * return if GD image functions are available + * + * @return bool + */ +function _gd_available() +{ + return function_exists('gd_info'); +} + + +/** + * return the width and height of an image file + * + * @param string $f filename + * + * @return array with width and height in pixels + */ +function _gd_get_imagesize($f) +{ + $ret = @getimagesize($f); + if ($ret === false) { + return array(0, 0); + } else { + return array($ret[0], $ret[1]); + } +} + + +/** + * implements delete_object + */ +function image_delete_object($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'image') { + return false; + } + // we don't have to care about symlinks here as this hook is not called + // for those + + load_modules('glue'); + // delete original file + if (!empty($obj['image-file'])) { + $a = expl('.', $obj['name']); + delete_upload(array('pagename'=>$a[0], 'file'=>$obj['image-file'], 'max_cnt'=>1)); + } + // and resized one + if (!empty($obj['image-resized-file'])) { + $a = expl('.', $obj['name']); + delete_upload(array('pagename'=>$a[0], 'file'=>$obj['image-resized-file'], 'max_cnt'=>1)); + } +} + + +/** + * implements has_reference + */ +function image_has_reference($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'image') { + return false; + } + // symlinks have their referenced files in a different page that's why + // they are not relevant here + if (@is_link(CONTENT_DIR.'/'.str_replace('.', '/', $obj['name']))) { + return false; + } + + if (!empty($obj['image-file']) && $obj['image-file'] == $args['file']) { + return true; + } + if (!empty($obj['image-resized-file']) && $obj['image-resized-file'] == $args['file']) { + return true; + } + + return false; +} + + +/** + * implements render_object + */ +function image_render_object($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'image') { + return false; + } + + // handle the case when we have no file + if (empty($obj['image-file'])) { + return ''; + } + + // try to calculate original-{width,height} if not already set + if (empty($obj['image-file-width']) || intval($obj['image-file-width']) == 0) { + if (_gd_available()) { + $a = expl('.', $obj['name']); + $fn = CONTENT_DIR.'/'.$a[0].'/shared/'.$obj['image-file']; + // resolve symlinks + if (@is_link($fn)) { + $target = @readlink($fn); + if (substr($target, 0, 1) == '/') { + $fn = $target; + } else { + $fn = dirname($fn).'/'.$target; + } + } + $size = _gd_get_imagesize($fn); + $obj['image-file-width'] = $size[0]; + // update regular with as well if not set + if (empty($obj['object-width']) || intval($obj['object-width']) == 0) { + $obj['object-width'] = $size[0].'px'; + } + $obj['image-file-height'] = $size[1]; + if (empty($obj['object-height']) || intval($obj['object-height']) == 0) { + $obj['object-height'] = $size[1].'px'; + } + } + save_object($obj); + } + + // the outer element must be a div or something else that can contain + // other elements + $e = elem('div'); + elem_attr($e, 'id', $obj['name']); + elem_add_class($e, 'image'); + elem_add_class($e, 'resizable'); + elem_add_class($e, 'object'); + + // setup url + // note: the url points to the object name, not the + // filename in the shared directory (the file eventually gets served + // in image_serve_resource()) + // TODO (later): support URLs as well + if (SHORT_URLS) { + $url = base_url().urlencode($obj['name']); + } else { + $url = base_url().'?'.urlencode($obj['name']); + } + + // render a div with background if we have original-{width,height} + // otherwise a div with an img inside + if (empty($obj['image-file-width']) || intval($obj['image-file-width']) == 0) { + // render a div with an img inside + $i = elem('img'); + elem_attr($i, 'src', $url); + if (!empty($obj['image-title'])) { + elem_attr($i, 'alt', $obj['image-title']); + } else { + elem_attr($i, 'alt', ''); + } + elem_val($e, $i); + } else { + if (!$args['edit'] && IE8_COMPAT && (empty($obj['image-background-repeat']) || $obj['image-background-repeat'] == 'no-repeat')) { + // background-size is not supported by IE8, so render a div with an img inside instead + $i = elem('img'); + elem_attr($i, 'src', $url); + if (!empty($obj['image-title'])) { + elem_attr($i, 'alt', $obj['image-title']); + } else { + elem_attr($i, 'alt', ''); + } + elem_css($i, 'width', '100%'); + elem_css($i, 'height', '100%'); + elem_css($i, 'padding', '0px'); + elem_css($i, 'border', '0px'); + if (!empty($obj['image-background-position']) && $obj['image-background-position'] != '0px 0px' && $obj['image-background-position'] != '0% 0%') { + elem_css($e, 'max-width', $obj['object-width']); + elem_css($e, 'max-height', $obj['object-height']); + elem_css($e, 'overflow', 'hidden'); + // assume px + $a = expl(' ', $obj['image-background-position']); + elem_css($i, 'margin-left', @intval($a[0]).'px'); + elem_css($i, 'margin-top', @intval($a[1]).'px'); + elem_css($i, 'margin-right', '0px'); + elem_css($i, 'margin-bottom', '0px'); + } else { + elem_css($i, 'margin', '0px'); + } + elem_val($e, $i); + } else { + // this is the regular case + // render a div with background + elem_css($e, 'background-image', 'url('.$url.')'); + // default to no tiling + if (empty($obj['image-background-repeat']) || $obj['image-background-repeat'] == 'no-repeat') { + elem_css($e, 'background-repeat', 'no-repeat'); + // set hardcoded background-size as well + elem_css($e, 'background-size', '100% 100%'); + // this is for Firefox 3.6 + elem_css($e, '-moz-background-size', '100% 100%'); + } else { + elem_css($e, 'background-repeat', $obj['image-background-repeat']); + } + if (!empty($obj['image-background-position'])) { + elem_css($e, 'background-position', $obj['image-background-position']); + } + } + } + + // additional properties for both + if (!empty($obj['image-title'])) { + elem_attr($e, 'title', $obj['image-title']); + } + + // elem is passed as reference here + invoke_hook('alter_render_early', array('obj'=>$obj, 'elem'=>&$e, 'edit'=>$args['edit'])); + + $html = elem_finalize($e); + // html is passed as reference here + invoke_hook('alter_render_late', array('obj'=>$obj, 'html'=>&$html, 'elem'=>$e, 'edit'=>$args['edit'])); + + return $html; +} + +register_hook('alter_render_early', 'invoked early in the object rendering process (possible to change array representation)'); +register_hook('alter_render_late', 'invoked late in the object rendering process (possible to change html string)'); + + +/** + * implements render_page_early + */ +function image_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/image/image-edit.js'); + if (!_gd_available()) { + html_add_js_var('$.glue.conf.image.resizing', false); + log_msg('debug', 'image: disabling image resizing as gd is not available'); + } else { + html_add_js_var('$.glue.conf.image.resizing', IMAGE_RESIZING); + } + } +} + + +/** + * resize an image object + * + * this function drops the reference to any currently resized version, + * saves the resized image together with the original image in the page's + * shared folder and updates the object file to use the resized version. + * @param array $args arguments + * key 'name' name of the objects + * key 'width' width in px + * key 'height' height in px + * @return array response + * true if the client is advised to reload the image, false if not + */ +function image_resize($args) +{ + // check for gd + if (!_gd_available()) { + return response('Host does not have gd', 500); + } + // set requested width & height + if (($width = @intval($args['width'])) == 0) { + return response('Required argument "width" is zero or does not exist', 400); + } + if (($height = @intval($args['height'])) == 0) { + return response('Required argument "height" is zero or does not exist', 400); + } + load_modules('glue'); + // resolve symlinks + $ret = object_get_symlink($args); + if ($ret['#error']) { + return $ret; + } elseif ($ret['#data'] !== false) { + log_msg('debug', 'image_resize: resolved object '.quot($args['name']).' into '.quot($ret['#data'])); + $args['name'] = $ret['#data']; + } + // load object + $obj = load_object($args); + if ($obj['#error']) { + return $obj; + } else { + $obj = $obj['#data']; + } + if (@intval($obj['image-file-width']) == 0 || @intval($obj['image-file-height']) == 0) { + return response('Original dimensions are not available', 500); + } + // set pagename + $pn = array_shift(expl('.', $obj['name'])); + + // resizing might not be necessary at all + if (!empty($obj['image-resized-file']) && @intval($obj['image-resized-width']) == $width && @intval($obj['image-resized-height'] == $height)) { + log_msg('debug', 'image_resize: width and height match the current resized file, no resize necessary'); + return response(false); + } + + // else remove any currently resized file + if (!empty($obj['image-resized-file'])) { + log_msg('info', 'image_resize: dropping reference to previous resized file '.quot($obj['image-resized-file'])); + delete_upload(array('pagename'=>$pn, 'file'=>$obj['image-resized-file'], 'max_cnt'=>1)); + unset($obj['image-resized-file']); + unset($obj['image-resized-width']); + unset($obj['image-resized-height']); + // update object file as well + object_remove_attr(array('name'=>$obj['name'], 'attr'=>array('resized-file', 'resized-width', 'resized-height'))); + $was_resized = true; + } else { + $was_resized = false; + } + + // check if width or height are larger than the original + if (@intval($obj['image-file-width']) <= $width || @intval($obj['image-file-height']) <= $height) { + log_msg('debug', 'image_resize: dimensions requested are larger or equal than the original file is, no resize necessary'); + // the client need not reload the the image if we were using the + // original before + if (!$was_resized) { + return response(false); + } else { + return response(true); + } + } + + // check if we really have a source image + if (empty($obj['image-file-mime']) && empty($obj['image-file'])) { + return response(false); + } + + // TODO (later): make this a generic function + // load source file + $ext = filext($obj['image-file']); + $fn = CONTENT_DIR.'/'.$pn.'/shared/'.$obj['image-file']; + if ($obj['image-file-mime'] == 'image/jpeg' || in_array($ext, array('jpg', 'jpeg'))) { + $orig = @imagecreatefromjpeg($fn); + $dest_ext = 'jpg'; + } elseif ($obj['image-file-mime'] == 'image/png' || $ext == 'png') { + $orig = @imagecreatefrompng($fn); + $dest_ext = 'png'; + } elseif ($obj['image-file-mime'] == 'image/gif' || $ext == 'gif') { + $orig = @imagecreatefromgif($fn); + // save gifs as png + $dest_ext = 'png'; + } else { + return response('Unsupported source file format '.quot($obj['image-file']), 500); + } + if ($orig === false) { + return response('Error loading source file '.quot($obj['image-file']), 500); + } + // get source file dimensions + $orig_size = @getimagesize($fn); + // create resized image + if (($resized = @imagecreatetruecolor($width, $height)) === false) { + @imagedestroy($orig); + return response('Error creating the resized image', 500); + } + // try to resize + if (!@imagecopyresampled($resized, $orig, 0, 0, 0, 0, $width, $height, $orig_size[0], $orig_size[1])) { + @imagedestroy($resized); + @imagedestroy($orig); + return response('Error resizing the source image', 500); + } + // setup destination filename + $a = expl('.', $obj['image-file']); + if (1 < count($a)) { + // throw the previous extension away + $fn = CONTENT_DIR.'/'.$pn.'/shared/'.implode('.', array_slice($a, 0, -1)).'-'.$width.'x'.$height.'.'.$dest_ext; + } else { + $fn = CONTENT_DIR.'/'.$pn.'/shared/'.$a[0].'-'.$width.'x'.$height.'.'.$dest_ext; + } + $m = umask(0111); + if ($dest_ext == 'jpg') { + $ret = @imagejpeg($resized, $fn, IMAGE_JPEG_QUAL); + } else if ($dest_ext == 'png') { + $ret = @imagepng($resized, $fn, IMAGE_PNG_QUAL); + } + umask($m); + // destroy images again + @imagedestroy($resized); + @imagedestroy($orig); + if (!$ret) { + return response('Error saving the resized image', 500); + } else { + log_msg('info', 'image_resize: created a resized image of '.quot($obj['name']).' -> '.quot(basename($fn))); + } + + // the code above can take a while, so read in the object anew via + // update_object() + $update = array(); + $update['name'] = $obj['name']; + $update['resized-file'] = basename($fn); + $update['resized-width'] = $width; + $update['resized-height'] = $height; + // we change width and height here as well since we are racing with the + // save_object from the frontend after resize + $update['width'] = $width.'px'; + $update['height'] = $height.'px'; + update_object($update); + + return response(true); +} + +register_service('image.resize', 'image_resize', array('auth'=>true)); + + +/** + * implements save_state + */ +function image_save_state($args) +{ + $elem = $args['elem']; + $obj = $args['obj']; + + // obj might be (almost) empty for newly created objects, so rely only + // on $elem + if (elem_has_class($elem, 'image')) { + // save properties that we want to perserve + if (elem_css($elem, 'background-repeat') !== NULL) { + $val = elem_css($elem, 'background-repeat'); + // normalize + if ($val == 'no-repeat no-repeat') { + $val = 'no-repeat'; + } + $obj['image-background-repeat'] = $val; + } else { + unset($obj['image-background-repeat']); + } + if (elem_css($elem, 'background-position') !== NULL) { + $obj['image-background-position'] = elem_css($elem, 'background-position'); + } else { + unset($obj['image-background-position']); + } + // we give other modules (like module_object) a chance to change + // the object + // obj is passed as reference here + invoke_hook('alter_save', array('obj'=>&$obj, 'elem'=>$elem)); + load_modules('glue'); + $ret = save_object($obj); + if ($ret['#error']) { + log_msg('error', 'image_save_state: save_object returned '.quot($ret['#data'])); + return false; + } else { + return true; + } + } else { + return false; + } +} + +register_hook('alter_save', 'invoked in the object saving process (possible to augment the object to be saved)'); + + +/** + * implements serve_resource + */ +function image_serve_resource($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'image') { + return false; + } + // we don't have to care about symlinks here as they are being resolved + // before this hook is called + $pn = array_shift(expl('.', $obj['name'])); + + if (!empty($obj['image-resized-file']) && !$args['dl']) { + // we have a resized file and don't want to download the original + $fn = CONTENT_DIR.'/'.$pn.'/shared/'.$obj['image-resized-file']; + $ext = filext($fn); + if ($ext == 'jpg' || $ext == 'jpeg') { + serve_file($fn, false, 'image/jpeg'); + } else if ($ext == 'png') { + serve_file($fn, false, 'image/png'); + } else { + log_msg('warn', 'image_serve_resource: unsupported resized-file '.quot($fn)); + } + // if we're still alive it means that the resized file has not been + // found + log_msg('warn', 'image_serve_resource: could not serve resized-file '.quot($fn).', falling back to original'); + $need_auth = false; + } elseif (empty($obj['image-resized-file'])) { + // we don't have a resized file + $need_auth = false; + } else { + // we really want to download the original + $need_auth = true; + } + + if (!empty($obj['image-file'])) { + // we have the original file + if ($need_auth && !is_auth()) { + // require authentication + prompt_auth(true); + } + if (empty($obj['image-file-mime'])) { + $obj['image-file-mime'] = ''; + } + serve_file(CONTENT_DIR.'/'.$pn.'/shared/'.$obj['image-file'], $args['dl'], $obj['image-file-mime']); + } + + // if everything fails + return false; +} + + +/** + * implements upload + */ +function image_upload($args) +{ + // check if supported file + if (!in_array($args['mime'], array('image/jpeg', 'image/png', 'image/gif')) || ($args['mime'] == '' && !in_array(filext($args['file']), array('jpg', 'jpeg', 'png', 'gif')))) { + return false; + } + + load_modules('glue'); + // create new object + $obj = create_object($args); + if ($obj['#error']) { + return false; + } else { + $obj = $obj['#data']; + } + $obj['type'] = 'image'; + // this is for a potential future speedup + $obj['module'] = 'image'; + $obj['image-file'] = $args['file']; + $obj['image-file-mime'] = $args['mime']; + // save original-{width,height} if we can calculate it + if (_gd_available()) { + $a = expl('.', $args['page']); + $size = _gd_get_imagesize(CONTENT_DIR.'/'.$a[0].'/shared/'.$obj['image-file']); + $obj['image-file-width'] = $size[0]; + $obj['object-width'] = $size[0].'px'; + $obj['image-file-height'] = $size[1]; + $obj['object-height'] = $size[1].'px'; + } + save_object($obj); + + // render object and return html + $ret = render_object(array('name'=>$obj['name'], 'edit'=>true)); + if ($ret['#error']) { + return false; + } else { + return $ret['#data']; + } +} + + +?> diff --git a/module_object.inc.php b/module_object.inc.php new file mode 100644 index 0000000..ce31d7d --- /dev/null +++ b/module_object.inc.php @@ -0,0 +1,124 @@ +<?php + +/** + * module_object.inc.php + * Module for handling general object properties + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('common.inc.php'); +require_once('html.inc.php'); +require_once('util.inc.php'); + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +function object_alter_render_early($args) +{ + if (!elem_has_class($args['elem'], 'object')) { + return false; + } + + $obj = $args['obj']; + if (!empty($obj['object-height'])) { + elem_css($args['elem'], 'height', $obj['object-height']); + } + if (!empty($obj['object-left'])) { + elem_css($args['elem'], 'left', $obj['object-left']); + } + if (!empty($obj['object-opacity'])) { + elem_css($args['elem'], 'opacity', $obj['object-opacity']); + } + elem_css($args['elem'], 'position', 'absolute'); + if (!empty($obj['object-top'])) { + elem_css($args['elem'], 'top', $obj['object-top']); + } + if (!empty($obj['object-width'])) { + elem_css($args['elem'], 'width', $obj['object-width']); + } + if (!empty($obj['object-zindex'])) { + elem_css($args['elem'], 'z-index', $obj['object-zindex']); + } + return true; +} + + +function object_alter_render_late($args) +{ + if (!elem_has_class($args['elem'], 'object')) { + return false; + } + + if (!$args['edit']) { + // add links only for viewing + if (!empty($args['obj']['object-link'])) { + $link = $args['obj']['object-link']; + // resolve any aliases + $link = resolve_aliases($link, $args['obj']['name']); + if (!is_url($link) && substr($link, 0, 1) != '#') { + // add base url for relative links that are not directed towards anchors + if (SHORT_URLS) { + $link = base_url().urlencode($link); + } else { + $link = base_url().'?'.urlencode($link); + } + } + // <a> can include block elements in html5 + $html = $args['html']; + if (substr($html, -1) == "\n") { + $html = substr($html, 0, -1); + } + $args['html'] = '<a href="'.htmlspecialchars($link, ENT_COMPAT, 'UTF-8').'">'."\n\t".str_replace("\n", "\n\t", $html)."\n".'</a>'."\n"; + return true; + } + } + return false; +} + + +function object_alter_save($args) +{ + if (!elem_has_class($args['elem'], 'object')) { + return false; + } + + if (elem_css($args['elem'], 'height') !== NULL) { + $args['obj']['object-height'] = elem_css($args['elem'], 'height'); + } + if (elem_css($args['elem'], 'left') !== NULL) { + $args['obj']['object-left'] = elem_css($args['elem'], 'left'); + } + if (elem_css($args['elem'], 'opacity') !== NULL) { + $args['obj']['object-opacity'] = elem_css($args['elem'], 'opacity'); + } + if (elem_css($args['elem'], 'top') !== NULL) { + $args['obj']['object-top'] = elem_css($args['elem'], 'top'); + } + if (elem_css($args['elem'], 'width') !== NULL) { + $args['obj']['object-width'] = elem_css($args['elem'], 'width'); + } + if (elem_css($args['elem'], 'z-index') !== NULL) { + $args['obj']['object-zindex'] = elem_css($args['elem'], 'z-index'); + } + return true; +} + + +function object_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/object/object-edit.js'); + + // add default colors + html_add_js_var('$.glue.conf.object.default_colors', expl(' ', OBJECT_DEFAULT_COLORS)); + } +} + + +?> diff --git a/module_page.inc.php b/module_page.inc.php new file mode 100644 index 0000000..85ac810 --- /dev/null +++ b/module_page.inc.php @@ -0,0 +1,66 @@ +<?php + +/** + * module_page.inc.php + * Module for managing pages + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('common.inc.php'); +require_once('html.inc.php'); +require_once('util.inc.php'); + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +function page_render_object($args) +{ + $obj = $args['obj']; + $a = expl('.', $obj['name']); + if ($a[2] != 'page') { + return false; + } + if (isset($obj['page-background-color'])) { + html_css('background-color', $obj['page-background-color']); + } + // set the html title + if (isset($obj['page-title'])) { + html_title($obj['page-title']); + } +} + + +function page_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/page/page-edit.js'); + + // set default grid + html_add_js_var('$.glue.conf.page.default_grid_x', intval(PAGE_DEFAULT_GRID_X)); + html_add_js_var('$.glue.conf.page.default_grid_y', intval(PAGE_DEFAULT_GRID_Y)); + + // set guides + $guide = expl(' ', PAGE_GUIDES_X); + for ($i=0; $i < count($guide); $i++) { + $guide[$i] = intval(trim($guide[$i])); + } + html_add_js_var('$.glue.conf.page.guides_x', $guide); + $guide = expl(' ', PAGE_GUIDES_Y); + for ($i=0; $i < count($guide); $i++) { + $guide[$i] = intval(trim($guide[$i])); + } + html_add_js_var('$.glue.conf.page.guides_y', $guide); + } + + // set the html title to the page name by default + html_title(page_short($args['page'])); +} + + +?> diff --git a/module_page_browser.inc.php b/module_page_browser.inc.php new file mode 100644 index 0000000..257aeb1 --- /dev/null +++ b/module_page_browser.inc.php @@ -0,0 +1,57 @@ +<?php + +/** + * module_page_browser.inc.php + * Module for listing and managing all available pages + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('common.inc.php'); +require_once('controller.inc.php'); +require_once('html.inc.php'); +require_once('modules.inc.php'); +// module glue gets loaded on demand + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +function controller_pages($args) +{ + default_html(true); + html_add_css(base_url().'modules/page_browser/page_browser.css'); + html_add_js(base_url().'modules/page_browser/page_browser.js'); + html_add_js_var('$.glue.conf.page.startpage', startpage()); + $bdy = &body(); + elem_attr($bdy, 'id', 'pages'); + body_append('<h1>All pages</h1>'); + load_modules('glue'); + $pns = pagenames(array()); + $pns = $pns['#data']; + foreach ($pns as $pn) { + body_append('<div class="page_browser_entry" id="'.htmlspecialchars($pn, ENT_COMPAT, 'UTF-8').'"><span class="page_browser_pagename"><a href="'.base_url().'?'.htmlspecialchars(urlencode($pn), ENT_COMPAT, 'UTF-8').'">'.htmlspecialchars($pn, ENT_NOQUOTES, 'UTF-8').'</a></span> '); + if ($pn.'.head' == startpage()) { + body_append('<span id="page_browser_startpage">the start page</span> '); + } + body_append('</div>'); + } + echo html_finalize(); +} + +register_controller('pages', '', 'controller_pages', array('auth'=>PAGES_NEED_AUTH)); + + +function page_browser_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/page_browser/page_browser-edit.js'); + } +} + + +?> diff --git a/module_revisions_browser.inc.php b/module_revisions_browser.inc.php new file mode 100644 index 0000000..a206ef6 --- /dev/null +++ b/module_revisions_browser.inc.php @@ -0,0 +1,92 @@ +<?php + +/** + * module_revisions_browser.inc.php + * Module for browsing through revisions of a page + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('common.inc.php'); +require_once('controller.inc.php'); +require_once('html.inc.php'); +require_once('modules.inc.php'); +// module glue gets loaded on demand +require_once('util.inc.php'); + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +function controller_revisions($args) +{ + page_canonical($args[0][0]); + $page = $args[0][0]; + if (!page_exists($page)) { + http_404(); + } + + // get all revisions of page and determine the current revision's index + load_modules('glue'); + $a = expl('.', $page); + $revs = revisions_info(array('pagename'=>$a[0], 'sort'=>'time')); + $revs = $revs['#data']; + $cur_rev = false; + for ($i=0; $i < count($revs); $i++) { + if ($revs[$i]['revision'] == $a[1]) { + $cur_rev = $i; + break; + } + } + if ($cur_rev === false) { + // we didn't find the current revision + http_500(); + } + + default_html(true); + html_add_css(base_url().'modules/revisions_browser/revisions_browser.css'); + html_add_js(base_url().'modules/revisions_browser/revisions_browser.js'); + html_add_js_var('$.glue.page', $page); + $bdy = &body(); + elem_attr($bdy, 'id', 'revisions'); + render_page(array('page'=>$page, 'edit'=>false)); + body_append('<div id="revisions_browser_ctrl">'); + body_append('<div id="revisions_browser_prev">'); + if ($cur_rev+1 < count($revs)) { + body_append('<a href="'.base_url().'?'.htmlspecialchars(urlencode($revs[$cur_rev+1]['page']), ENT_COMPAT, 'UTF-8').'/revisions">prev</a>'); + } + body_append('</div><div id="revisions_browser_cur">'); + if (substr($revs[$cur_rev]['revision'], 0, 5) == 'auto-') { + body_append(date('d M y H:i', $revs[$cur_rev]['time'])); + } else { + body_append(htmlspecialchars($revs[$cur_rev]['revision'], ENT_NOQUOTES, 'UTF-8')); + } + body_append('<br>'); + if ($a[1] != 'head') { + body_append('<a id="revisions_browser_revert_btn" href="#">revert</a>'); + } + body_append('</div><div id="revisions_browser_next">'); + if (0 < $cur_rev) { + body_append('<a href="'.base_url().'?'.htmlspecialchars(urlencode($revs[$cur_rev-1]['page']), ENT_COMPAT, 'UTF-8').'/revisions">next</a>'); + } + body_append('</div>'); + body_append('</div>'); + echo html_finalize(); +} + +register_controller('*', 'revisions', 'controller_revisions', array('auth'=>REVISIONS_NEED_AUTH)); + + +function revisions_browser_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/revisions_browser/revisions_browser-edit.js'); + } +} + + +?> diff --git a/module_text.inc.php b/module_text.inc.php new file mode 100644 index 0000000..8a837ff --- /dev/null +++ b/module_text.inc.php @@ -0,0 +1,248 @@ +<?php + +/** + * module_text.inc.php + * Module for placing text elements on a page + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('common.inc.php'); +require_once('html.inc.php'); +require_once('html_parse.inc.php'); +require_once('modules.inc.php'); +// module glue gets loaded on demand +require_once('util.inc.php'); + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +// TODO: document +function _text_render_content($s, $name) +{ + // resolve any aliases + $s = resolve_aliases($s, $name); + $s = html_encode_str_smart($s); + // automatically add <br> elements for newlines + if (TEXT_AUTO_BR) { + $s = str_replace("\r\n", "\n", $s); + $s = str_replace("\n", "<br>\n", $s); + } + // encode non-breakable spaces (160, 0xc2 0xa0 in utf-8) + $s = str_replace("\xc2\xa0", ' ', $s); + // resolve any relative urls + $s = resolve_relative_urls($s); + return $s; +} + + +function text_render_object($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'text') { + return false; + } + + $e = elem('div'); + elem_attr($e, 'id', $obj['name']); + elem_add_class($e, 'text'); + elem_add_class($e, 'resizable'); + elem_add_class($e, 'object'); + // background-color + if (!empty($obj['text-background-color'])) { + elem_css($e, 'background-color', $obj['text-background-color']); + } + // content + if (!isset($obj['content'])) { + $obj['content'] = ''; + } + if ($args['edit']) { + // add a textarea + $i = elem('textarea'); + elem_add_class($i, 'glue-text-input'); + elem_css($i, 'width', '100%'); + elem_css($i, 'height', '100%'); + // hide the text area by default + elem_css($i, 'display', 'none'); + // set the context to the textarea to the (unrendered) object content + $content = htmlspecialchars($obj['content'], ENT_NOQUOTES, 'UTF-8'); + // replace newline characters by an entity to prevent render_object() + // from adding some indentation + $content = str_replace("\r\n", ' ', $content); + $content = str_replace("\n", ' ', $content); + // why not replace tabs as well why we are at it + $content = str_replace("\t", '	', $content); + elem_val($i, $content); + elem_append($e, $i); + // and a nested div + $r = elem('div'); + elem_add_class($r, 'glue-text-render'); + elem_css($r, 'width', '100%'); + elem_css($r, 'height', '100%'); + // set the content of the div to the rendered object content + elem_val($r, _text_render_content($obj['content'], $obj['name'])); + elem_append($e, $r); + } else { + elem_val($e, _text_render_content($obj['content'], $obj['name'])); + } + // font-color + if (!empty($obj['text-font-color'])) { + elem_css($e, 'color', $obj['text-font-color']); + } + // font-size + if (!empty($obj['text-font-size'])) { + elem_css($e, 'font-size', $obj['text-font-size']); + } + // font-style + if (!empty($obj['text-font-style'])) { + elem_css($e, 'font-style', $obj['text-font-style']); + } + // font-weight + if (!empty($obj['text-font-weight'])) { + elem_css($e, 'font-weight', $obj['text-font-weight']); + } + // letter-spacing + if (!empty($obj['text-letter-spacing'])) { + elem_css($e, 'letter-spacing', $obj['text-letter-spacing']); + } + // line-height + if (!empty($obj['text-line-height'])) { + elem_css($e, 'line-height', $obj['text-line-height']); + } + // padding-x + if (!empty($obj['text-padding-x'])) { + elem_css($e, 'padding-left', $obj['text-padding-x']); + elem_css($e, 'padding-right', $obj['text-padding-x']); + } + // padding-y + if (!empty($obj['text-padding-y'])) { + elem_css($e, 'padding-top', $obj['text-padding-y']); + elem_css($e, 'padding-bottom', $obj['text-padding-y']); + } + // text-align + if (!empty($obj['text-align'])) { + elem_css($e, 'text-align', $obj['text-align']); + } + // word-spacing + if (!empty($obj['text-word-spacing'])) { + elem_css($e, 'word-spacing', $obj['text-word-spacing']); + } + + // hooks + invoke_hook('alter_render_early', array('obj'=>$obj, 'elem'=>&$e, 'edit'=>$args['edit'])); + $html = elem_finalize($e); + invoke_hook('alter_render_late', array('obj'=>$obj, 'html'=>&$html, 'elem'=>$e, 'edit'=>$args['edit'])); + + return $html; +} + + +function text_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/text/text-edit.js'); + html_add_css(base_url().'modules/text/text-edit.css'); + html_add_js_var('$.glue.conf.text.auto_br', TEXT_AUTO_BR); + } +} + + +function text_save_state($args) +{ + $elem = $args['elem']; + $obj = $args['obj']; + + if (!elem_has_class($elem, 'text')) { + return false; + } + + $obj['type'] = 'text'; + $obj['module'] = 'text'; + // background-color + if (elem_css($elem, 'background-color') !== NULL) { + $obj['text-background-color'] = elem_css($elem, 'background-color'); + } else { + unset($obj['text-background-color']); + } + // we don't handle content here + // see the comments in $.glue.object.register_alter_pre_save (at text-edit.js) + // font-color + if (elem_css($elem, 'color') !== NULL) { + $obj['text-font-color'] = elem_css($elem, 'color'); + } else { + unset($obj['text-font-color']); + } + // font-size + if (elem_css($elem, 'font-size') !== NULL) { + $obj['text-font-size'] = elem_css($elem, 'font-size'); + } else { + unset($obj['text-font-size']); + } + // font-style + if (elem_css($elem, 'font-style') !== NULL) { + $obj['text-font-style'] = elem_css($elem, 'font-style'); + } else { + unset($obj['text-font-style']); + } + // font-weight + if (elem_css($elem, 'font-weight') !== NULL) { + $obj['text-font-weight'] = elem_css($elem, 'font-weight'); + } else { + unset($obj['text-font-weight']); + } + // letter-spacing + if (elem_css($elem, 'letter-spacing') !== NULL) { + $obj['text-letter-spacing'] = elem_css($elem, 'letter-spacing'); + } else { + unset($obj['text-letter-spacing']); + } + // line-height + if (elem_css($elem, 'line-height') !== NULL) { + $obj['text-line-height'] = elem_css($elem, 'line-height'); + } else { + unset($obj['text-line-height']); + } + // padding-x + if (elem_css($elem, 'padding-left') !== NULL) { + $obj['text-padding-x'] = elem_css($elem, 'padding-left'); + } else { + unset($obj['text-padding-x']); + } + // padding-y + if (elem_css($elem, 'padding-top') !== NULL) { + $obj['text-padding-y'] = elem_css($elem, 'padding-top'); + } else { + unset($obj['text-padding-y']); + } + // text-align + if (elem_css($elem, 'text-align') !== NULL) { + $obj['text-align'] = elem_css($elem, 'text-align'); + } else { + unset($obj['text-align']); + } + // word-spacing + if (elem_css($elem, 'word-spacing') !== NULL) { + $obj['text-word-spacing'] = elem_css($elem, 'word-spacing'); + } else { + unset($obj['text-word-spacing']); + } + + // hook + invoke_hook('alter_save', array('obj'=>&$obj, 'elem'=>$elem)); + load_modules('glue'); + $ret = save_object($obj); + if ($ret['#error']) { + load_msg('error', 'text_save_state: save_object returned '.quot($ret['#data'])); + return false; + } else { + return true; + } +} + + +?> \ No newline at end of file diff --git a/module_video.inc.php b/module_video.inc.php new file mode 100644 index 0000000..6c48e85 --- /dev/null +++ b/module_video.inc.php @@ -0,0 +1,260 @@ +<?php + +/** + * module_video.inc.php + * Module for embedding video elements on a page + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('html.inc.php'); +require_once('html_parse.inc.php'); +require_once('modules.inc.php'); +// module glue gets loaded on demand +require_once('util.inc.php'); + + +// module_image.inc.php has more information on what's going on inside modules +// (they can be easier than that one though) + + +function video_delete_object($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'video') { + return false; + } + + load_modules('glue'); + if (!empty($obj['video-file'])) { + $pn = array_shift(expl('.', $obj['name'])); + delete_upload(array('pagename'=>$pn, 'file'=>$obj['video-file'], 'max_cnt'=>1)); + } +} + + +function video_has_reference($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'video') { + return false; + } + // symlinks have their referenced files in a different page that's why + // they are not relevant here + if (@is_link(CONTENT_DIR.'/'.str_replace('.', '/', $obj['name']))) { + return false; + } + + if (!empty($obj['video-file']) && $obj['video-file'] == $args['file']) { + return true; + } else { + return false; + } +} + + +function video_render_object($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'video') { + return false; + } + + // add a css (for viewing as well as editing) + html_add_css(base_url().'modules/video/video.css'); + + $e = elem('div'); + elem_attr($e, 'id', $obj['name']); + elem_add_class($e, 'video'); + elem_add_class($e, 'resizable'); + elem_add_class($e, 'object'); + $v = elem('video'); + if (empty($obj['video-file'])) { + elem_attr($v, 'src', ''); + } else { + // TODO (later): support URLs as well + if (SHORT_URLS) { + elem_attr($v, 'src', base_url().urlencode($obj['name'])); + } else { + elem_attr($v, 'src', base_url().'?'.urlencode($obj['name'])); + } + } + elem_css($v, 'width', '100%'); + elem_css($v, 'height', '100%'); + elem_css($v, 'preload', 'preload'); + // set some fallback text + if (!empty($obj['video-file']) && !empty($obj['video-file-mime'])) { + elem_val($v, '<div class="video-fallback">You are not seeing the video because your browser does not support '.htmlspecialchars($obj['video-file-mime'], ENT_NOQUOTES, 'UTF-8').'. Consider using a contemporary web browser.</div>'); + } else { + elem_val($v, '<div class="video-fallback">You are not seeing the video because your browser does not support it. Consider using a contemporary web browser.</div>'); + } + // autoplay + if (!isset($obj['video-autoplay']) || $obj['video-autoplay'] == 'autoplay') { + // autoplay is the default + elem_attr($v, 'autoplay', 'autoplay'); + } else { + if (VIDEO_START_ON_CLICK) { + elem_attr($v, 'onclick', 'this.play()'); + } + } + // loop + if (!empty($obj['video-loop'])) { + elem_attr($v, 'loop', 'loop'); + } + // controls + if (!empty($obj['video-controls'])) { + elem_attr($v, 'controls', 'controls'); + } + // volume + if (isset($obj['video-volume']) && $obj['video-volume'] == '0') { + elem_attr($v, 'audio', 'muted'); + } + elem_val($e, $v); + + // hooks + invoke_hook('alter_render_early', array('obj'=>$obj, 'elem'=>&$e, 'edit'=>$args['edit'])); + $html = elem_finalize($e); + invoke_hook('alter_render_late', array('obj'=>$obj, 'html'=>&$html, 'elem'=>$e, 'edit'=>$args['edit'])); + + return $html; +} + + +function video_render_page_early($args) +{ + if ($args['edit']) { + html_add_js(base_url().'modules/video/video-edit.js'); + html_add_css(base_url().'modules/video/video-edit.css'); + } +} + + +function video_save_state($args) +{ + $elem = $args['elem']; + $obj = $args['obj']; + + if (!elem_has_class($elem, 'video')) { + return false; + } + + // parse children elements to find video + $childs = html_parse(elem_val($elem)); + $v = false; + foreach ($childs as $c) { + if (isset($c['tag']) && strtolower($c['tag']) == 'video') { + $v = $c; + break; + } + } + if (!$v) { + log_msg('warn', 'video_save_state: no video element found, inner html is '.var_dump_inl($childs)); + return false; + } + + $obj['type'] = 'video'; + $obj['module'] = 'video'; + // autoplay + if (elem_attr($v, 'autoplay') !== NULL) { + $obj['video-autoplay'] = 'autoplay'; + } else { + $obj['video-autoplay'] = ''; + } + // loop + if (elem_attr($v, 'loop') !== NULL) { + $obj['video-loop'] = 'loop'; + } else { + unset($obj['video-loop']); + } + // controls + if (elem_attr($v, 'controls') !== NULL) { + $obj['video-controls'] = 'controls'; + } else { + unset($obj['video-controls']); + } + // volume + if (elem_attr($v, 'audio') == 'muted') { + $obj['video-volume'] = '0'; + } else { + unset($obj['video-volume']); + } + + // hook + invoke_hook('alter_save', array('obj'=>&$obj, 'elem'=>$elem)); + load_modules('glue'); + $ret = save_object($obj); + if ($ret['#error']) { + log_msg('error', 'video_save_state: save_object returned '.quot($ret['#data'])); + return false; + } else { + return true; + } +} + + +function video_serve_resource($args) +{ + $obj = $args['obj']; + if (!isset($obj['type']) || $obj['type'] != 'video') { + return false; + } + + if (!empty($obj['video-file'])) { + $pn = array_shift(expl('.', $obj['name'])); + if (empty($obj['video-file-mime'])) { + $obj['video-file-mime'] = ''; + } + serve_file(CONTENT_DIR.'/'.$pn.'/shared/'.$obj['video-file'], $args['dl'], $obj['video-file-mime']); + } + + return false; +} + + +function video_upload($args) +{ + $ext = filext($args['file']); + if ($args['mime'] == 'video/ogg' || $ext == 'ogv' || $ext == 'ogg') { + // notice: we also handle ogg here although this also could be a + // different mime type + // make sure mime type is set + $mime = 'video/ogg'; + } elseif ($args['mime'] == 'video/h264' || $ext == 'h264') { + // haven't seen these out there + $mime = 'video/h264'; + } elseif ($args['mime'] == 'video/mp4' || $ext == 'mp4') { + // think this need not be h264, but well + $mime = 'video/mp4'; + } elseif ($args['mime'] == 'video/webm' || $ext == 'webm') { + // again, webm could also be audio/webm + $mime = 'video/webm'; + } else { + return false; + } + + load_modules('glue'); + $obj = create_object($args); + if ($obj['#error']) { + return false; + } else { + $obj = $obj['#data']; + } + $obj['type'] = 'video'; + $obj['module'] = 'video'; + $obj['video-file'] = $args['file']; + $obj['video-file-mime'] = $mime; + save_object($obj); + + $ret = render_object(array('name'=>$obj['name'], 'edit'=>true)); + if ($ret['#error']) { + return false; + } else { + return $ret['#data']; + } +} + + +?> \ No newline at end of file diff --git a/modules.inc.php b/modules.inc.php new file mode 100644 index 0000000..670809b --- /dev/null +++ b/modules.inc.php @@ -0,0 +1,331 @@ +<?php + +/** + * modules.inc.php + * Generic modules and services infrastructure + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +@require_once('config.inc.php'); +require_once('log.inc.php'); + +if (!isset($hooks)) { + $hooks = array(); +} +if (!isset($modules)) { + $modules = array(); +} +if (!isset($services)) { + $services = array(); +} + + +/** + * get an array of all currently registered hooks + * + * @return array + */ +function get_hooks() +{ + global $hooks; + return $hooks; +} + + +/** + * get an array of all currently loaded modules + * + * @return array + */ +function get_modules() +{ + global $modules; + // no need to sort the array since the modules were loaded by ordered + // by their filenames anyway + return $modules; +} + + +/** + * return a service-array + * + * call load_modules() before calling this function. + * @param string $service service name + * @return array or false if not found + */ +function get_service($service) +{ + global $services; + if (!isset($services[$service])) { + return false; + } else { + return $services[$service]; + } +} + + +/** + * invoke a hook + * + * this function also takes care of loading all modules. + * @param string $hook hook to invoke + * @param array $args arguments-array (can include references) + * @return array of results (module=>result) + */ +function invoke_hook($hook, $args = array()) +{ + global $modules; + + $ret = array(); + // make sure all modules are loaded + load_modules(); + + foreach ($modules as $m) { + if (is_callable($m.'_'.$hook)) { + $func = $m.'_'.$hook; + // DEBUG + log_msg('debug', 'modules: invoking hook '.$hook.', calling '.$func); + // we can't pass on references with func_get_arg() etc + // so use a container $args array, which can hold references it seems + // tested on PHP 5.2.6, maybe test on others as well + $cur = $func($args); + $ret[$m] = $cur; + } + } + + log_msg('debug', 'modules: invoke_hook on '.$hook.' returned '.var_dump_inl($ret)); + return $ret; +} + + +/** + * invoke a hook while the returned result is $while + * + * this function also takes care of loading all modules. + * @param string $hook hook to invoke + * @param mixed $while value to compare the returned result with + * @param array $args arguments-array + * @return array with result (module=>result) or empty result if there was none + */ +function invoke_hook_while($hook, $while, $args = array()) +{ + global $modules; + + // make sure all modules are loaded + load_modules(); + + foreach ($modules as $m) { + if (is_callable($m.'_'.$hook)) { + $func = $m.'_'.$hook; + // DEBUG + log_msg('debug', 'modules: invoking hook '.$hook.', calling '.$func); + $cur = $func($args); + if ($cur !== $while) { + $ret = array($m=>$cur); + // DEBUG + //log_msg('debug', 'modules: invoke_hook_while on '.$hook.' returned '.var_dump_inl($ret)); + return $ret; + } + } + } + + log_msg('debug', 'modules: invoke_hook_while on '.$hook.' returned '.var_dump_inl(array())); + return array(); +} + + +/** + * load modules + * + * use this function instead of including module_* files directly. + * @param string $search module to load (by default all modules are loaded) + * @param bool $optional whether to log any error to locate the module + * @return bool true if successful, false if not + */ +function load_modules($search = '', $optional = false) +{ + global $modules; + $late_loading = count($modules) ? true : false; + + // we only take $search up to the first dot + if (($p = strpos($search, '.')) !== false) { + $search = substr($search, 0, $p); + } + + $files = scandir('.'); + foreach ($files as $f) { + if (strtolower(substr($f, 0, 7)) != 'module_' || strtolower(substr($f, -4)) != '.php') { + continue; + } + // check if already loaded + if (substr($f, -8) == '.inc.php') { + $name = substr($f, 7, -8); + } else { + $name = substr($f, 7, -4); + } + if (in_array($name, $modules)) { + continue; + } + if ($search != '' && strtolower($name) != $search) { + continue; + } + // TODO (later): log error messages while parsing if possible + ob_start(); + if ($late_loading) { + log_msg('debug', 'modules: late-loading module '.$name); + } else { + log_msg('debug', 'modules: loading module '.$name); + } + @include_once($f); + $s = ob_get_contents(); + log_msg('debug', 'modules: finished loading module '.$name.', output '.quot($s)); + ob_end_clean(); + // add to modules array + $modules[] = $name; + } + + // check if we were successful + if (!empty($search) && empty($modules) && !$optional) { + log_msg('error', 'modules: cannot find required module '.$search.', make sure it is installed in the program directory'); + return false; + } else { + return true; + } +} + + +/** + * register a service + * + * you can specify the service's arguments in $args['args']. see + * run_services(). + * @param string $service service name + * @param string $func function name + * @param array $args optional arguments + */ +function register_service($service, $func, $args = array()) +{ + global $services; + $trace = debug_backtrace(); + $services[$service] = array_merge(array('args'=>array()), array_merge($args, array('func'=>$func, 'file'=>basename($trace[0]['file']), 'line'=>$trace[0]['line']))); + log_msg('debug', 'modules: '.basename($trace[0]['file']).':'.$trace[0]['line'].' registered service '.quot($service)); +} + + +/** + * register a hook + * + * this function is for information purposes only. you can also use a hook + * without registering it here. this is not recommended though. + * @param string $hook hook name + * @param string $info some words on the hook's purpose + */ +function register_hook($hook, $info = '') +{ + global $hooks; + $trace = debug_backtrace(); + $hooks[$hook] = array('file'=>basename($trace[0]['file']), 'line'=>$trace[0]['line'], 'info'=>$info); + log_msg('debug', 'modules: '.basename($trace[0]['file']).':'.$trace[0]['line'].' registered hook '.quot($hook)); +} + + +/** + * return a response-array + * + * @param mixed $data (payload) data (should be the error-message if + * $error is true) + * @param mixed $error error core or true if an error occurred + * @return array + */ +function response($data, $error = false) +{ + $ret = array(); + if ($error === false) { + $ret['#error'] = false; + } else { + $ret['#error'] = true; + } + if (is_numeric($error)) { + $ret['#error_code'] = intval($error); + } + $ret['#data'] = $data; + return $ret; +} + + +/** + * run a service + * + * this function checks the arguments in $args against the (optional) + * declaration given in register_service(). + * @param string $service service name + * @param array $args arguments-array + * @return return value of the service function or a response-array + * in case of an error + */ +function run_service($service, $args = array()) +{ + global $services; + + if (!isset($services[$service])) { + return response('Unknown service '.quot($service), 400); + } + + // check arguments + foreach ($services[$service]['args'] as $key=>$val) { + if (!isset($args[$key])) { + if (isset($val['req']) && $val['req']) { + return response('Required argument '.quot($key).' missing', 400); + } elseif (isset($val['def'])) { + $args[$key] = $val['def']; + } + } + if (isset($val['type'])) { + if ($val['type'] == 'array') { + if (is_array($args[$key])) { + // nothing to do here + } elseif (is_object($args[$key])) { + // convert to array + $args[$key] = (array)$args[$key]; + } else { + return response('Invalid type of argument '.quot($key).', expected array', 400); + } + } elseif ($val['type'] == 'bool') { + if (is_bool($args[$key])) { + // nothing to do here + } elseif (intval($args[$key]) === 1) { + $args[$key] = true; + } elseif (intval($args[$key]) === 0) { + $args[$key] = false; + } else { + return response('Invalid type of argument '.quot($key).', expected bool', 400); + } + } elseif ($val['type'] == 'float') { + if (!is_numeric($args[$key])) { + return response('Invalid type of argument '.quot($key).', expected float', 400); + } else { + $args[$key] = floatval($args[$key]); + } + } elseif ($val['type'] == 'int') { + if (!is_numeric($args[$key])) { + return response('Invalid type of argument '.quot($key).', expected int', 400); + } else { + $args[$key] = intval($args[$key]); + } + } elseif ($val['type'] == 'string') { + $args[$key] = strval($args[$key]); + } else { + log_msg('error', 'modules: invalid type given for argument '.quot($key).' of service '.quot($service)); + } + } + } + + log_msg('info', 'modules: running service '.quot($service)); + return $services[$service]['func']($args); +} + + +?> diff --git a/modules/.htaccess b/modules/.htaccess new file mode 100644 index 0000000..45552cb --- /dev/null +++ b/modules/.htaccess @@ -0,0 +1 @@ +Options -Indexes \ No newline at end of file diff --git a/modules/code/code.png b/modules/code/code.png new file mode 100644 index 0000000..3507957 Binary files /dev/null and b/modules/code/code.png differ diff --git a/modules/download/download-edit.js b/modules/download/download-edit.js new file mode 100644 index 0000000..8aa0168 --- /dev/null +++ b/modules/download/download-edit.js @@ -0,0 +1,84 @@ +/** + * modules/download/download-edit.js + * Frontend code for download objects + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$('.download').live('glue-upload-dynamic-early', function(e, mode, target_x, target_y) { + // there probably is no load event for our div, so make it available + // right away + // position object + if (mode == 'center') { + $(this).css('left', (target_x-$(this).outerWidth()/2)+'px'); + $(this).css('top', (target_y-$(this).outerHeight()/2)+'px'); + } else { + $(this).css('left', target_x+'px'); + $(this).css('top', target_y+'px'); + } + // restore visibility + $(this).css('visibility', $(this).data('orig_visibility')); + $(this).removeData('orig_visibility'); + // register object + $.glue.object.register(this); + // save object + $.glue.object.save(this); +}); + +$(document).ready(function() { + $.glue.contextmenu.veto('download', 'object-link'); + // + // register menu items + // + var elem; + elem = $('<img src="'+$.glue.base_url+'img/download.png" alt="btn" title="download file" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + // initite download + window.location = $.glue.base_url+'?'+$(obj).attr('id')+'&download=1'; + }); + $.glue.contextmenu.register('download', 'download-download', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/download/download-public.png" alt="btn" title="" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var that = this; + // check if object is public + $.glue.backend({ method: 'glue.load_object', name: $(obj).attr('id') }, function(data) { + if (data['download-public'] == 'public') { + $(that).addClass('glue-menu-enabled'); + $(that).removeClass('glue-menu-disabled'); + $(that).attr('title', 'this object is shown to everyone - click to make it private'); + } else { + $(that).removeClass('glue-menu-enabled'); + $(that).addClass('glue-menu-disabled'); + $(that).attr('title', 'this object is only shown while editing - click to make it public'); + } + }); + }); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + // toggle setting + if ($(this).hasClass('glue-menu-enabled')) { + $(this).removeClass('glue-menu-enabled'); + $(this).addClass('glue-menu-disabled'); + $(this).attr('title', 'this object is only shown while editing - click to make it public'); + // clear public attribute + $.glue.backend({ method: 'glue.object_remove_attr', name: $(obj).attr('id'), attr: 'download-public' }); + } else if ($(this).hasClass('glue-menu-disabled')) { + $(this).addClass('glue-menu-enabled'); + $(this).removeClass('glue-menu-disabled'); + $(this).attr('title', 'this object is shown to everyone - click to make it private'); + // set public attribute + $.glue.backend({ method: 'glue.update_object', name: $(obj).attr('id'), 'download-public': 'public' }); + } + }); + $.glue.contextmenu.register('download', 'download-public', elem); + + // make sure we don't send to much over the wire for every save + $.glue.object.register_alter_pre_save('download', function(obj, orig) { + $(obj).children('.download-ext').remove(); + }); +}); diff --git a/modules/download/download-file.png b/modules/download/download-file.png new file mode 100644 index 0000000..47b5e13 Binary files /dev/null and b/modules/download/download-file.png differ diff --git a/modules/download/download-public.png b/modules/download/download-public.png new file mode 100644 index 0000000..35a3aa5 Binary files /dev/null and b/modules/download/download-public.png differ diff --git a/modules/download/download.css b/modules/download/download.css new file mode 100644 index 0000000..2ab66b6 --- /dev/null +++ b/modules/download/download.css @@ -0,0 +1,23 @@ +.download { + background-image:url('download-file.png'); + background-size: 100%; + height: 48px; + max-height: 48px; + max-width: 48px; + width: 48px; +} + +.download-ext { + bottom: 5px; + font-size: 8px; + max-height: 38px; + max-width: 26px; + overflow: hidden; + position: absolute; + right: 12px; + text-align: right; + /* TODO (later): this does not work in viewing mode on Chrome */ + text-decoration: none; + width: 26px; + word-break: break-all; +} \ No newline at end of file diff --git a/modules/iframe/iframe-edit.css b/modules/iframe/iframe-edit.css new file mode 100644 index 0000000..f66e8f0 --- /dev/null +++ b/modules/iframe/iframe-edit.css @@ -0,0 +1,24 @@ +.iframe { + /* these are default widths and heights for new iframe objects */ + height: 300px; + width: 400px; +} + +.glue-iframe-shield { + /* this is the dummy object we place over the iframe for editing */ + background-color: darkgrey; + opacity: 0.5; +} + +#glue-contextmenu-iframe-scroll { + /* overwrite the default greenish hue for .glue-menu-enabled */ + background-color: transparent; +} + +#glue-contextmenu-iframe-scroll.glue-menu-disabled { + background-image: url(iframe-scroll-off.png); +} + +#glue-contextmenu-iframe-scroll.glue-menu-enabled { + background-image: url(iframe-scroll-on.png); +} \ No newline at end of file diff --git a/modules/iframe/iframe-edit.js b/modules/iframe/iframe-edit.js new file mode 100644 index 0000000..1ba76e5 --- /dev/null +++ b/modules/iframe/iframe-edit.js @@ -0,0 +1,113 @@ +/** + * modules/iframe/iframe-edit.js + * Frontend code for iframe objects + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + // + // menu items + // + var elem = $('<img src="'+$.glue.base_url+'modules/iframe/iframe.png" alt="btn" title="add embedded webpage" width="32" height="32">'); + $(elem).bind('click', function(e) { + var url = prompt('Enter the URL to show'); + if (!url) { + return; + } + // create new object + $.glue.backend({ method: 'glue.create_object', 'page': $.glue.page }, function(data) { + var elem = $('<div class="iframe resizable object" style="position: absolute;"></div>'); + $(elem).attr('id', data['name']); + // default width and height is set in the css + child = $('<iframe style="background-color: transparent; border-width: 0px; height: 100%; position: absolute; width: 100%;"></iframe>'); + $(child).attr('src', url); + $(elem).append(child); + // put the iframe behind some shield for editing + var child = $('<div class="glue-iframe-shield glue-ui" style="height: 100%; position: absolute; width: 100%;" title="visitors will be able to interact with the webpage below"></div>'); + $(elem).append(child); + $('body').append(elem); + // make width and height explicit + $(elem).css('width', $(elem).width()+'px'); + $(elem).css('height', $(elem).height()+'px'); + // move to mouseclick + $(elem).css('left', (e.pageX-$(elem).outerWidth()/2)+'px'); + $(elem).css('top', (e.pageY-$(elem).outerHeight()/2)+'px'); + $.glue.object.register(elem); + $.glue.object.save(elem); + }); + $.glue.menu.hide(); + }); + $.glue.menu.register('new', elem); + + // + // context menu items + // + elem = $('<img src="'+$.glue.base_url+'modules/iframe/iframe-url.png" alt="btn" title="change webpage url" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + var child = $(obj).children('iframe').first(); + var url = prompt('Enter the URL to show', $(child).attr('src')); + if (!url) { + return; + } + $(child).attr('src', url); + $.glue.object.save(obj); + }); + $.glue.contextmenu.register('iframe', 'iframe-url', elem); + + elem = $('<div style="height: 32px; width: 32px;" title="toggle scrollbars on and off">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + var child = $(obj).children('iframe').first(); + if ($(child).css('overflow') == 'hidden') { + // show scrollbars + $(child).css('overflow', 'auto'); + // attribute scrolling is not supported in html5 (but works on Chrome) + $(child).attr('scrolling', 'auto'); + $(child).removeAttr('seamless'); + // this does not seem to work on recent Chrome without reloading the + // iframe + if ($.browser.webkit) { + $(child).attr('src', $(child).attr('src')); + } + $(this).addClass('glue-menu-enabled'); + $(this).removeClass('glue-menu-disabled'); + } else { + // hide scrollbars + $(child).css('overflow', 'hidden'); + $(child).attr('scrolling', 'no'); + // this is html5, it supposedly also removes the scrollbars though, + // that's why we don't use it all the time + $(child).attr('seamless', 'seamless'); + // this does not seem to work on recent Chrome without reloading the + // iframe + if ($.browser.webkit) { + $(child).attr('src', $(child).attr('src')); + } + $(this).removeClass('glue-menu-enabled'); + $(this).addClass('glue-menu-disabled'); + } + $.glue.object.save(obj); + }); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var child = $(obj).children('iframe').first(); + if ($(child).css('overflow') == 'hidden') { + $(this).removeClass('glue-menu-enabled'); + $(this).addClass('glue-menu-disabled'); + } else { + $(this).addClass('glue-menu-enabled'); + $(this).removeClass('glue-menu-disabled'); + } + }); + $.glue.contextmenu.register('iframe', 'iframe-scroll', elem); + + // make sure we don't send to much over the wire for every save + $.glue.object.register_alter_pre_save('iframe', function(obj, orig) { + $(obj).children('iframe').html(''); + $(obj).children('.glue-iframe-shield').remove(); + }); +}); diff --git a/modules/iframe/iframe-scroll.png b/modules/iframe/iframe-scroll.png new file mode 100644 index 0000000..f9c9fea Binary files /dev/null and b/modules/iframe/iframe-scroll.png differ diff --git a/modules/iframe/iframe-url.png b/modules/iframe/iframe-url.png new file mode 100644 index 0000000..289261f Binary files /dev/null and b/modules/iframe/iframe-url.png differ diff --git a/modules/iframe/iframe.png b/modules/iframe/iframe.png new file mode 100644 index 0000000..1d2098b Binary files /dev/null and b/modules/iframe/iframe.png differ diff --git a/modules/image/image-edit.js b/modules/image/image-edit.js new file mode 100644 index 0000000..49a4b0a --- /dev/null +++ b/modules/image/image-edit.js @@ -0,0 +1,189 @@ +/** + * modules/image/image-edit.js + * Frontend code for image objects + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +// TODO (later): make this a closure as well +$.glue.image = $.glue.image || {}; +$.glue.image.preload_obj = false; +$.glue.image.preload_timer = false; + +$('.image').live('glue-resizestop', function(e) { + if ($.glue.conf.image.resizing && $(this).css('background-repeat') == 'no-repeat') { + var that = this; + $.glue.backend({ method: 'image.resize', name: $(this).attr('id'), width: $(this).width(), height: $(this).height() }, function(data) { + if (!data) { + // DEBUG + console.error('image.resize returned null'); + } else if (data['#error']) { + // DEBUG + console.error(data['#data']); + } else if (!data['#data']) { + // no refresh necessary + } else { + // try to preload the file to prevent flicker + clearTimeout($.glue.image.preload_timer); + // DEBUG + //console.log('clearing timeout'); + var temp_elem = $(that).clone(); + $(temp_elem).attr('id', ''); + $(temp_elem).attr('class', 'glue-object-copy'); + // this assumes that the borders are equally spaced.. + $(temp_elem).css('left', ($(that).position().left+($(that).outerWidth()-$(that).width())/2)+'px'); + $(temp_elem).css('top', ($(that).position().top+($(that).outerHeight()-$(that).height())/2)+'px'); + // set new url (w & h are only here to prevent caching) + $(temp_elem).css('background-image', 'url('+$.glue.base_url+'?'+$(that).attr('id')+'&w='+$(that).width()+'&h='+$(that).height()+')'); + $(that).before(temp_elem); + // destroy element on move or resize + $(that).one('glue-movestart', function() { + // remove any copies still left + $('.glue-object-copy').remove(); + }); + $(that).one('glue-resizestart', function() { + // remove any copies still left + $('.glue-object-copy').remove(); + }); + $(that).one('glue-unregister', function() { + // remove any copies still left + $('.glue-object-copy').remove(); + }); + $.glue.image.preload_obj = temp_elem; + $.glue.image.preload_timer = setTimeout(function() { + // DEBUG + //console.log('outer timeout'); + $(that).css('background-image', 'url('+$.glue.base_url+'?'+$(that).attr('id')+'&w='+$(that).width()+'&h='+$(that).height()+')'); + var remove = $.glue.image.preload_obj; + setTimeout(function() { + $(remove).remove(); + // DEBUG + //console.log('inner timeout'); + }, 500); + $.glue.image.preload_obj = false; + }, 500); + } + }, false); + } +}); + +$('.image').live('glue-upload-dynamic-late', function(e, loaded) { + var img = loaded; + if ($(img).is('img')) { + // we should have the exact dimensions of the image by now + // resize object + $(this).css('width', $(img).width()+'px'); + $(this).css('height', $(img).height()+'px'); + // update object file + $.glue.backend({ method: 'glue.update_object', name: $(this).attr('id'), 'image-file-width': $(img).width(), 'image-file-height': $(img).height() }); + // set the defaults + $(this).css('background-image', 'url('+$(img).attr('src')+')'); + $(this).css('background-repeat', 'no-repeat'); + $(this).css('background-size', '100% 100%'); + $(this).css('-moz-background-size', '100% 100%'); + // remove the img + $(img).remove(); + } +}); + +$(document).ready(function() { + $.glue.contextmenu.veto('iframe', 'object-link'); + // + // register menu items + // + var elem = $('<img src="'+$.glue.base_url+'modules/image/image-tile.png" alt="btn" title="toggle image tiling" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + if ($(obj).css('background-repeat') != 'no-repeat') { + $(obj).css('background-repeat', 'no-repeat'); + $(obj).css('background-size', '100% 100%'); + $(obj).css('-moz-background-size', '100% 100%'); + } else { + $(obj).css('background-repeat', 'repeat'); + // background-size is automatically set with background-repeat + // so no need to remove this attribute in the backend here + $(obj).css('background-size', ''); + $(obj).css('-moz-background-size', ''); + } + $.glue.object.save(obj); + }); + $.glue.contextmenu.register('image', 'image-tile', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/image/image-ratio.png" alt="btn" title="reset image size" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + // get original-{width,height} from backend + $.glue.backend({ method: 'glue.load_object', name: $(obj).attr('id') }, function(data) { + if (data['image-file-width'] && data['image-file-height']) { + var aspect = data['image-file-width']/data['image-file-height']; + $(obj).trigger('glue-resizestart'); + if (e.shiftKey) { + // shift: only change aspect ratio + // fit height to width + $(obj).css('height', ($(obj).width()*aspect)+'px'); + } else if (e.ctrlKey) { + // ctrl: only change aspect ratio + // fit width to heigth + $(obj).css('width', ($(obj).height()/aspect)+'px'); + } else { + $(obj).css('width', data['image-file-width']+'px'); + $(obj).css('height', data['image-file-height']+'px'); + } + $(obj).trigger('glue-resize'); + $.glue.object.resizable_update_tooltip(obj); + $.glue.object.save(obj); + $(obj).trigger('glue-resizestop'); + $.glue.canvas.update(obj); + } + }); + }); + $.glue.contextmenu.register('image', 'image-ratio', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/image/image-pos.png" alt="btn" title="adjust image selection" width="32" height="32">'); + $(elem).bind('mousedown', function(e) { + var obj = $(this).data('owner'); + var a = $(obj).css('background-position').split(' '); + if (a.length != 2) { + var prev_x_pos = 0; + var prev_y_pos = 0; + } else { + // we assume px (or 0%..) + var prev_x_pos = parseInt(a[0]); + if (isNaN(prev_x_pos)) { + prev_x_pos = 0; + } + var prev_y_pos = parseInt(a[1]); + if (isNaN(prev_y_pos)) { + prev_y_pos = 0; + } + } + var no_change = true; + $.glue.slider(e, function(x, y) { + // background-position-{x,y} does not work in Firefox (but seems to be faster) + $(obj).css('background-position', (prev_x_pos+x)+'px '+(prev_y_pos+y)+'px'); + if (x != 0 || y != 0) { + no_change = false; + } + }, function(x, y) { + // reset background position if there was no change at all + if (no_change) { + $(obj).css('background-position', ''); + $.glue.backend({ method: 'glue.object_remove_attr', name: $(obj).attr('id'), attr: 'image-background-position' }); + } else { + $.glue.object.save(obj); + } + }); + return false; + }); + $.glue.contextmenu.register('image', 'image-pos', elem); + + elem = $('<img src="'+$.glue.base_url+'img/download.png" alt="btn" title="download original file" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + // initiate download + window.location = $.glue.base_url+'?'+$(obj).attr('id')+'&download=1'; + }); + $.glue.contextmenu.register('image', 'image-download', elem); +}); diff --git a/modules/image/image-pos.png b/modules/image/image-pos.png new file mode 100644 index 0000000..fdb0763 Binary files /dev/null and b/modules/image/image-pos.png differ diff --git a/modules/image/image-ratio.png b/modules/image/image-ratio.png new file mode 100644 index 0000000..40633a7 Binary files /dev/null and b/modules/image/image-ratio.png differ diff --git a/modules/image/image-tile.png b/modules/image/image-tile.png new file mode 100644 index 0000000..e2bad65 Binary files /dev/null and b/modules/image/image-tile.png differ diff --git a/modules/object/object-clone.png b/modules/object/object-clone.png new file mode 100644 index 0000000..054eed6 Binary files /dev/null and b/modules/object/object-clone.png differ diff --git a/modules/object/object-delete.png b/modules/object/object-delete.png new file mode 100644 index 0000000..8e620d0 Binary files /dev/null and b/modules/object/object-delete.png differ diff --git a/modules/object/object-edit.js b/modules/object/object-edit.js new file mode 100644 index 0000000..b2c4a49 --- /dev/null +++ b/modules/object/object-edit.js @@ -0,0 +1,146 @@ +/** + * modules/object/object-edit.js + * Frontend code for general object properties + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + // + // register menu items + // + var elem; + elem = $('<img src="'+$.glue.base_url+'modules/object/object-clone.png" alt="btn" title="clone object" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + $.glue.backend({ method: 'glue.clone_object', name: $(obj).attr('id') }, function(data) { + var clone = $(obj).clone(); + // set new id + $(clone).attr('id', data); + // move object a bit + $(clone).css('left', ($(obj).position().left+$.glue.grid.x())+'px'); + $(clone).css('top', ($(obj).position().top+$.glue.grid.y())+'px'); + // add to dom and register + $('body').append(clone); + $(clone).trigger('glue-pre-clone'); + $.glue.object.register(clone); + // select new object + $.glue.sel.none(); + $.glue.sel.select(clone); + $.glue.object.save(clone); + }); + }); + $.glue.contextmenu.register('object', 'object-clone', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/object/object-transparency.png" alt="btn" title="change transparency" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var opacity = parseFloat($(obj).css('opacity'))*100; + var tip = 'change transparency ('+opacity.toFixed(0)+'%)'; + $(this).attr('title', tip); + }); + $(elem).bind('mousedown', function(e) { + var that = this; + var obj = $(this).data('owner'); + $.glue.slider(e, function(x, y) { + if (x < -15) { + x = 1-(Math.abs(x)-15)/300; + } else if (x < 15) { + // dead zone + x = 1; + } else { + x = 1-(Math.abs(x)-15)/300; + } + if (x < 0) { + x = 0; + } + $(obj).css('opacity', x); + }, function(x, y) { + $.glue.object.save(obj); + // update tooltip (see above) + $(that).trigger('glue-menu-activate'); + }); + return false; + }); + $.glue.contextmenu.register('object', 'object-transparency', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/object/object-zindex.png" alt="btn" title="bring object to foreground or background" width="32" height="32">'); + $(elem).bind('mousedown', function(e) { + var obj = $(this).data('owner'); + var old_z = parseInt($(obj).css('z-index')); + $.glue.slider(e, function(x, y) { + if (x < -15) { + $.glue.stack.to_bottom($(obj)); + } else if (x < 15) { + // dead zone + var z = parseInt($(obj).css('z-index')); + if (z !== old_z) { + if (!isNaN(old_z)) { + $(obj).css('z-index', old_z); + } else { + $(obj).css('z-index', ''); + } + // DEBUG + //console.log('set z-index to '+old_z); + } + } else { + $.glue.stack.to_top($(obj)); + } + }, function(x, y) { + $.glue.object.save(obj); + $.glue.stack.compress(); + }); + return false; + }); + $.glue.contextmenu.register('object', 'object-zindex', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/object/object-link.png" alt="btn" title="make the object a link" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + // get link + $.glue.backend({ method: 'glue.load_object', name: $(obj).attr('id') }, function(data) { + if (data['#error']) { + $.glue.error(data['#error']); + } else { + var old_link = ''; + if (data['#data']['object-link'] !== undefined) { + old_link = data['#data']['object-link']; + } + var link = prompt('Enter link (e.g. http://disney.com/, somepage, #someanchor)', old_link); + if (link === null || link == old_link) { + return; + } + if (link == '') { + // delete link + $.glue.backend({ method: 'glue.object_remove_attr', name: $(obj).attr('id'), attr: 'object-link' }); + } else { + // set link + $.glue.backend({ method: 'glue.update_object', name: $(obj).attr('id'), 'object-link': link }); + } + } + }, false); + }); + $.glue.contextmenu.register('object', 'object-link', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/object/object-symlink.png" alt="btn" title="make this object appear on all pages" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + $.glue.backend({ method: 'glue.object_make_symlink', name: $(obj).attr('id') }); + }); + $.glue.contextmenu.register('object', 'object-symlink', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/object/object-delete.png" alt="btn" title="delete object" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + var id = $(obj).attr('id'); + $.glue.object.unregister($(obj)); + $(obj).remove(); + // delete in backend as well + $.glue.backend({ method: 'glue.delete_object', name: id }); + // update canvas + $.glue.canvas.update(); + }); + $.glue.contextmenu.register('object', 'object-delete', elem); +}); diff --git a/modules/object/object-link.png b/modules/object/object-link.png new file mode 100644 index 0000000..2c729ba Binary files /dev/null and b/modules/object/object-link.png differ diff --git a/modules/object/object-symlink.png b/modules/object/object-symlink.png new file mode 100644 index 0000000..a5f9190 Binary files /dev/null and b/modules/object/object-symlink.png differ diff --git a/modules/object/object-transparency.png b/modules/object/object-transparency.png new file mode 100644 index 0000000..35a3aa5 Binary files /dev/null and b/modules/object/object-transparency.png differ diff --git a/modules/object/object-zindex.png b/modules/object/object-zindex.png new file mode 100644 index 0000000..5aa9f6c Binary files /dev/null and b/modules/object/object-zindex.png differ diff --git a/modules/page/page-delete.png b/modules/page/page-delete.png new file mode 100644 index 0000000..58c0e17 Binary files /dev/null and b/modules/page/page-delete.png differ diff --git a/modules/page/page-edit.js b/modules/page/page-edit.js new file mode 100644 index 0000000..70cba6b --- /dev/null +++ b/modules/page/page-edit.js @@ -0,0 +1,111 @@ +/** + * modules/page/page-edit.js + * Frontend code for general page properties + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + // set grid + $.glue.grid.x($.glue.conf.page.default_grid_x); + $.glue.grid.y($.glue.conf.page.default_grid_y); + + // set guides + for (i in $.glue.conf.page.guides_x) { + $.glue.grid.add_guide_x($.glue.conf.page.guides_x[i]); + } + for (i in $.glue.conf.page.guides_y) { + $.glue.grid.add_guide_y($.glue.conf.page.guides_y[i]); + } + + // + // register menu items + // + var elem; + elem = $('<img src="'+$.glue.base_url+'modules/page/page-new.png" alt="btn" title="create a new page" width="32" height="32">'); + $(elem).bind('click', function(e) { + $.glue.menu.hide(); + var pn = prompt('Name the page to be created'); + if (pn === null) { + return; + } + $.glue.backend({ method: 'glue.create_page', page: pn+'.head' }, function(data) { + // redirect to newly created page + window.location = $.glue.base_url+'?'+pn+'/edit'; + }); + }); + $.glue.menu.register('page', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/page/page-title.png" alt="btn" title="change page title" width="32" height="32">'); + $(elem).bind('click', function(e) { + var title = $('title').html(); + title = prompt('Change the page title', title); + if (title === null) { + return; + } + $('title').html(title); + $.glue.backend({ method: 'glue.update_object', name: $.glue.page+'.page', 'page-title': title }); + }); + $.glue.menu.register('page', elem); + + elem = $('<img src="'+$.glue.base_url+'img/background-color.png" alt="btn" title="change the background color" width="32" height="32">'); + $(elem).bind('click', function(e) { + $.glue.colorpicker.show($('html').css('background-color'), false, function(col) { + $('html').css('background-color', col); + }, function(col) { + // update grid as well + $.glue.grid.update(true); + $.glue.backend({ method: 'glue.update_object', name: $.glue.page+'.page', 'page-background-color': col }); + }); + $.glue.menu.hide(); + }); + $.glue.menu.register('page', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/page/page-grid.png" width="32" height="32">'); + // also change tilte below + $(elem).attr('title', 'show/hide grid or change grid size by dragging ('+$.glue.grid.x()+'x'+$.glue.grid.y()+')'); + $(elem).bind('mousedown', function(e) { + $.glue.slider(e, function(x, y, evt) { + // rectangular grid when pressing shift + if (evt.shiftKey) { + if (x < y) { + x = y; + } else { + y = x; + } + } + // only update grid when grid size is <= 10px for performance reasons + var update = false; + if (10 <= Math.abs(x)) { + $.glue.grid.mode(1); + $.glue.grid.x(Math.abs(x)); + update = true; + } + if (10 <= Math.abs(y)) { + $.glue.grid.mode(1); + $.glue.grid.y(Math.abs(y)); + update = true; + } + if (update) { + $.glue.grid.update(true); + } + }, function(x, y) { + if (Math.abs(x) < 10 && Math.abs(y) < 10) { + if ($.glue.grid.mode()) { + $.glue.grid.mode(0); + } else { + $.glue.grid.mode(1); + } + $.glue.grid.update(); + } + // update tooltip + $(elem).attr('title', 'show/hide grid or change grid size by dragging ('+$.glue.grid.x()+'x'+$.glue.grid.y()+')'); + // close menu + $.glue.menu.hide(); + }); + return false; + }); + $.glue.menu.register('page', elem); +}); diff --git a/modules/page/page-grid.png b/modules/page/page-grid.png new file mode 100644 index 0000000..0f15f32 Binary files /dev/null and b/modules/page/page-grid.png differ diff --git a/modules/page/page-new.png b/modules/page/page-new.png new file mode 100644 index 0000000..d8640a8 Binary files /dev/null and b/modules/page/page-new.png differ diff --git a/modules/page/page-title.png b/modules/page/page-title.png new file mode 100644 index 0000000..6b080fd Binary files /dev/null and b/modules/page/page-title.png differ diff --git a/modules/page_browser/page_browser-edit.js b/modules/page_browser/page_browser-edit.js new file mode 100644 index 0000000..c045ed9 --- /dev/null +++ b/modules/page_browser/page_browser-edit.js @@ -0,0 +1,17 @@ +/** + * modules/page_browser/page_browser-edit.js + * Frontend code linking the page browser to the general editing mode + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + elem = $('<img src="'+$.glue.base_url+'modules/page_browser/page_browser.png" alt="list all pages" title="list all pages" width="32" height="32">'); + $(elem).bind('click', function(e) { + $.glue.menu.hide(); + window.location = $.glue.base_url+'?pages'; + }); + $.glue.menu.register('page', elem); +}); diff --git a/modules/page_browser/page_browser.css b/modules/page_browser/page_browser.css new file mode 100644 index 0000000..43253c6 --- /dev/null +++ b/modules/page_browser/page_browser.css @@ -0,0 +1,12 @@ +.page_browser_entry { + margin-bottom: 4.25px; + margin-top: 3px; +} + +.page_browser_pagename > a { + text-decoration: none; +} + +#page_browser_startpage { + color: darkgrey; +} \ No newline at end of file diff --git a/modules/page_browser/page_browser.js b/modules/page_browser/page_browser.js new file mode 100644 index 0000000..f7bacdd --- /dev/null +++ b/modules/page_browser/page_browser.js @@ -0,0 +1,93 @@ +/** + * modules/page_browser/page_browser.js + * Page browser frontend code + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + var span = false; + + $('.page_browser_entry').bind('mouseenter', function(e) { + if (span) { + $(span).remove(); + } + var html = '<span>'; + html += '<a href="'+$.glue.base_url+'?'+$(this).attr('id')+'/edit">edit</a> '; + html += '<a href="#" class="page_browser_rename">rename</a> '; + html += '<a href="#" class="page_browser_delete">delete</a> '; + if ($(this).attr('id')+'.head' != $.glue.conf.page.startpage) { + html += '<a href="#" class="page_browser_set_startpage">as startpage</a> '; + } + html += '</span>'; + + span = $(html); + $(this).append(span); + }); + + $('.page_browser_entry').bind('mouseleave', function(e) { + if (span) { + $(span).remove(); + span = false; + } + }); + + $('.page_browser_rename').live('click', function(e) { + var entry = $(this).parents('.page_browser_entry'); + var old = $(entry).attr('id'); + var pn = prompt('new name', old); + if (pn != null && pn != old) { + $.glue.backend({ method: 'glue.rename_page', 'old': old, 'new': pn }, function(data) { + $(entry).attr('id', pn); + $(entry).children('.page_browser_pagename').html('<a href="'+$.glue.base_url+'?'+pn+'">'+pn+'</a>'); + }); + } + return false; + }); + + $('.page_browser_delete').live('click', function(e) { + var entry = $(this).parents('.page_browser_entry'); + var pn = $(entry).attr('id'); + if (confirm('really delete page '+pn+'?')) { + // get all revisions first + var pages = []; + $.glue.backend({ method: 'glue.revisions', pagename: pn }, function(data) { + for (var rev in data) { + pages.push(pn+'.'+data['#data'][rev]); + } + // delete all revisions + for (var page in pages) { + // DEBUG + //console.log('deleting '+pages[page]); + $.glue.backend({ method: 'glue.delete_page', 'page': pages[page] }, function(data) { + if (data['#error']) { + $.glue.error(data['#data']); + } + }, false); + } + + // TODO (later): check if all revisions were indeed deleted + // remove entry + $(entry).hide('fast', function() { + $(this).remove(); + }); + }); + } + return false; + }); + + $('.page_browser_set_startpage').live('click', function(e) { + var entry = $(this).parents('.page_browser_entry'); + var pn = $(entry).attr('id'); + $.glue.backend({ method: 'glue.set_startpage', page: pn+'.head' }, function(data) { + $('#page_browser_startpage').remove(); + $(entry).children('.page_browser_pagename').after(' <span id="page_browser_startpage">the start page</span>'); + $.glue.conf.page.startpage = pn+'.head'; + if (span) { + $(entry).trigger('mouseenter'); + } + }); + }); +}); diff --git a/modules/page_browser/page_browser.png b/modules/page_browser/page_browser.png new file mode 100644 index 0000000..e60c4cc Binary files /dev/null and b/modules/page_browser/page_browser.png differ diff --git a/modules/revisions_browser/revisions_browser-edit.js b/modules/revisions_browser/revisions_browser-edit.js new file mode 100644 index 0000000..372e7f6 --- /dev/null +++ b/modules/revisions_browser/revisions_browser-edit.js @@ -0,0 +1,18 @@ +/** + * modules/revisions_browser/revisions_browser-edit.js + * Frontend code linking the revisions browser to the general editing + * mode + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + elem = $('<img src="'+$.glue.base_url+'modules/revisions_browser/revisions_browser.png" alt="btn" title="compare revisions of this page" width="32" height="32">'); + $(elem).bind('click', function(e) { + $.glue.menu.hide(); + window.location = $.glue.base_url+'?'+$.glue.page+'/revisions'; + }); + $.glue.menu.register('page', elem); +}); diff --git a/modules/revisions_browser/revisions_browser.css b/modules/revisions_browser/revisions_browser.css new file mode 100644 index 0000000..b4c790c --- /dev/null +++ b/modules/revisions_browser/revisions_browser.css @@ -0,0 +1,34 @@ +.page { + /* always show scrollbars while browsing revisions */ + overflow: scroll; +} + +#revisions_browser_ctrl { + background-color: lightgrey; + border-radius: 3px; + bottom: 20px; + height: 80px; + opacity: 0.7; + position: fixed; + right: 20px; + width: 300px; + z-index: 200; +} + +#revisions_browser_cur { + float: left; + height: 100%; + max-width: 50%; + min-width: 50%; + text-align: center; +} + +#revisions_browser_prev, #revisions_browser_next { + float: left; + height: 100%; + max-width: 25%; + min-width: 25%; + text-align: center; + margin-top: auto; + margin-bottom: auto; +} diff --git a/modules/revisions_browser/revisions_browser.js b/modules/revisions_browser/revisions_browser.js new file mode 100644 index 0000000..0a10058 --- /dev/null +++ b/modules/revisions_browser/revisions_browser.js @@ -0,0 +1,31 @@ +/** + * modules/revisions_browser/revisions_browser.js + * Revisions browser frontend code + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + $('#revisions_browser_revert_btn').bind('click', function(e) { + $.glue.backend({ method: 'glue.revert', page: $.glue.page }, function(data) { + var a = $.glue.page.split('.'); + window.location = $.glue.base_url+'?'+a[0]+'/edit'; + }); + return false; + }); + + $(document).bind('keydown', function(e) { + // keyboard navigation + if (e.which == 37 && $('#revisions_browser_prev > a').length) { + window.location = $('#revisions_browser_prev > a').attr('href'); + } else if (e.which == 39 && $('#revisions_browser_next > a').length) { + window.location = $('#revisions_browser_next > a').attr('href'); + } + // prevent scrolling + if (e.which == 37 || e.which == 39) { + return false; + } + }); +}); diff --git a/modules/revisions_browser/revisions_browser.png b/modules/revisions_browser/revisions_browser.png new file mode 100644 index 0000000..624c8e6 Binary files /dev/null and b/modules/revisions_browser/revisions_browser.png differ diff --git a/modules/text/text-align.png b/modules/text/text-align.png new file mode 100644 index 0000000..08a4e64 Binary files /dev/null and b/modules/text/text-align.png differ diff --git a/modules/text/text-background-color.png b/modules/text/text-background-color.png new file mode 100644 index 0000000..eccaac3 Binary files /dev/null and b/modules/text/text-background-color.png differ diff --git a/modules/text/text-background-transparent.png b/modules/text/text-background-transparent.png new file mode 100644 index 0000000..1e23b2d Binary files /dev/null and b/modules/text/text-background-transparent.png differ diff --git a/modules/text/text-edit.css b/modules/text/text-edit.css new file mode 100644 index 0000000..1c17a61 --- /dev/null +++ b/modules/text/text-edit.css @@ -0,0 +1,33 @@ +.text { + /* these are default widths and heights for new text objects */ + height: 100px; + width: 100px; + + /* other default properties for text objects can be set here as well */ + /* + background-color: ...; + color: ...; + font-size: ...; + font-style: ...; + font-weight: ...; + letter-spacing: ...; + line-height: ...; + text-align: ...; + word-spacing: ...; + */ +} + +.glue-text-input { + /* this is the textarea for editing */ + /* inherit as much as possible */ + background-color: inherit; + border: 0px; + color: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; + letter-spacing: inherit; + line-height: inherit; + text-align: inherit; + word-spacing: inherit; +} \ No newline at end of file diff --git a/modules/text/text-edit.js b/modules/text/text-edit.js new file mode 100644 index 0000000..1843549 --- /dev/null +++ b/modules/text/text-edit.js @@ -0,0 +1,557 @@ +/** + * modules/text/text-edit.js + * Frontend code for text objects + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$.glue.text = function() +{ + var str_replace = function(from, to, s) { + // this naive version doesn't work as from might be included in to again + // e.g. when replacing '\n' to '<br>\n' + //while (s.indexOf(from) != -1) { + // s = s.replace(from, to); + //} + if (typeof to !== 'string') { + if (to.toString) { + to = to.toString(); + } else { + return ''; + } + } + if (typeof s !== 'string') { + if (s.toString) { + s = s.toString(); + } else { + return ''; + } + } + var cur = 0; + while (cur+from.length <= s.length) { + if (s.substring(cur, cur+from.length) == from) { + s = s.substring(0, cur)+to+s.substring(cur+from.length); + // don't subject the added to to checking + cur += to.length; + } else { + cur++; + } + } + return s; + }; + + return { + insert_at_cursor: function(elem, s) { + // inspired from http://forumsblogswikis.com/2008/07/20/how-to-insert-tabs-in-a-textarea/ + // this only includes the code for Firefox and Webkit though + var elem = $(elem).get(0); + var start = elem.selectionStart; + var end = elem.selectionEnd; + elem.value = elem.value.substring(0, start)+s+elem.value.substring(end, elem.value.length); + elem.selectionStart = start+s.length; + elem.selectionEnd = start+s.length; + }, + render_content: function(s, name) { + // base url + s = str_replace('$BASEURL$', $.glue.base_url, s); + s = str_replace('$baseurl$', $.glue.base_url, s); + // version number + s = str_replace('$GLUE$', str_replace(',', '.', $.glue.version), s); + s = str_replace('$glue$', str_replace(',', '.', $.glue.version), s); + // current object + s = str_replace('$OBJ$', name, s); + s = str_replace('$obj$', name, s); + // current page + s = str_replace('$PAGE$', $.glue.page, s); + s = str_replace('$page$', $.glue.page, s); + // pagename + s = str_replace('$PAGENAME$', $.glue.page.split('.').slice(0, 1), s); + s = str_replace('$pagename$', $.glue.page.split('.').slice(0, 1), s); + // revision + s = str_replace('$REV$', $.glue.page.split('.').slice(1, 2), s); + s = str_replace('$rev$', $.glue.page.split('.').slice(1, 2), s); + // automatically add <br> elements for newlines + if ($.glue.conf.text.auto_br) { + s = str_replace('\r\n', '<br>', s); + s = str_replace('\n', '<br>', s); + } + // non-breakable spaces get automatically encoded to it seems + return s; + } + }; +}(); + +$('.text').live('glue-register', function(e) { + // prevent events from bubbling up while we're editing + // and handle a few keycodes + $(this).children('.glue-text-input').bind('keydown', function(e) { + if ($(this).css('display') == 'none') { + // we're not editing + return; + } else { + e.stopPropagation(); + } + + if (e.which == 9) { + // tab (key code 9) + $.glue.text.insert_at_cursor($(this), String.fromCharCode(9)); + e.preventDefault(); + return false; + } else if (e.shiftKey && e.which == 32) { + // shift+space: add a non-breakable space ( or key code 160) + $.glue.text.insert_at_cursor($(this), String.fromCharCode(160)); + e.preventDefault(); + return false; + } + }); + + $(this).children('.glue-text-input').bind('keypress', function(e) { + if ($(this).css('display') == 'none') { + // we're not editing + return; + } else { + e.stopPropagation(); + } + }); + + $(this).children('.glue-text-input').bind('keyup', function(e) { + if ($(this).css('display') == 'none') { + // we're not editing + return; + } else { + e.stopPropagation(); + } + }); + + // disable links + $(this).children('.glue-text-render').find('a').bind('click', function(e) { + return false; + }); + $(this).children('.glue-text-render').find('a').attr('title', 'this link is disabled for editing'); +}); + +$('.text.glue-selected').live('click', function(e) { + // if we are not editing yet + if ($(this).hasClass('glue-text-editing')) { + return; + } + // deselect all other objects + if ($(this).hasClass('glue-selected')) { + $('.glue-selected').not(this).each(function() { + $.glue.sel.deselect(this); + }); + } + // register an event + $(this).one('glue-deselect', function(e) { + if ($(this).hasClass('glue-text-editing')) { + // copy the rendered textarea value + $(this).children('.glue-text-render').html($.glue.text.render_content($(this).children('.glue-text-input').val(), $(this).attr('id'))); + $(this).removeClass('glue-text-editing'); + // disable links + $(this).children('.glue-text-render').find('a').bind('click', function(e) { + return false; + }); + $(this).children('.glue-text-render').find('a').attr('title', 'this link is disabled for editing'); + // resolve relative urls + $(this).children('.glue-text-render').find('a').each(function() { + // check if scheme is set + var url = $(this).attr('href'); + if (url.charAt(0) != '#' && url.indexOf('://') < 1) { + $(this).attr('href', $.glue.base_url+url); + } + }); + // hide the text area again + $(this).children('.glue-text-input').css('display', 'none'); + $(this).children('.glue-text-render').css('display', 'block'); + // update the content on the server + // see the comments in $.glue.object.register_alter_pre_save below + $.glue.backend({ method: 'glue.update_object', name: $(this).attr('id'), 'content': $(this).children('.glue-text-input').val() }); + } + }); + // and make the textarea visible + $(this).children('.glue-text-input').css('display', 'block'); + $(this).children('.glue-text-render').css('display', 'none'); + $(this).addClass('glue-text-editing'); + // set focus and selection + $(this).children('.glue-text-input').focus(); + if ($(this).children('.glue-text-input').get(0).setSelectionRange) { + $(this).children('.glue-text-input').get(0).setSelectionRange(0, 0); + } +}); + +$(document).ready(function() { + // + // menu items + // + var elem = $('<img src="'+$.glue.base_url+'modules/text/text.png" alt="btn" title="add a new text object" width="32" height="32">'); + $(elem).bind('click', function(e) { + // create new object + $.glue.backend({ method: 'glue.create_object', 'page': $.glue.page }, function(data) { + var elem = $('<div class="text resizable object" style="position: absolute;"><textarea class="glue-text-input" style="display: none; height: 100%; width: 100%;"></textarea><div class="glue-text-render" style="height: 100%; width: 100%;"></div></div>'); + $(elem).attr('id', data['name']); + // default width and height is set in the css + // randomly pick one of the default colors + if ($.glue.conf.object.default_colors) { + var rand = Math.floor(Math.random()*$.glue.conf.object.default_colors.length); + $(elem).css('background-color', $.glue.conf.object.default_colors[rand]); + } + $('body').append(elem); + // make width and height explicit + $(elem).css('width', $(elem).width()+'px'); + $(elem).css('height', $(elem).height()+'px'); + // move to mouseclick + $(elem).css('left', (e.pageX-$(elem).outerWidth()/2)+'px'); + $(elem).css('top', (e.pageY-$(elem).outerHeight()/2)+'px'); + $.glue.object.register(elem); + $.glue.object.save(elem); + }); + $.glue.menu.hide(); + }); + $.glue.menu.register('new', elem); + + // + // context menu items + // + elem = $('<img src="'+$.glue.base_url+'modules/text/text-background-color.png" alt="btn" title="change background-color" width="32" height="32">'); + var colorpicker_shown = false; + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + $.glue.colorpicker.show($(obj).css('background-color'), false, function(col) { + $(obj).css('background-color', col); + }, function (col) { + $.glue.object.save(obj); + colorpicker_shown = false; + }); + colorpicker_shown = true; + }); + $(elem).bind('glue-deselect', function(e) { + // hide the colorpicker if we opened it + if (colorpicker_shown) { + $.glue.colorpicker.hide(); + colorpicker_shown = false; + } + }); + $.glue.contextmenu.register('text', 'text-background-color', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-background-transparent.png" alt="btn" title="make background transparent" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + $(obj).css('background-color', 'transparent'); + $.glue.object.save(obj); + }); + $.glue.contextmenu.register('text', 'text-background-transparent', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-font-size.png" alt="btn" title="drag to change font size, click to reset to default one" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + $(this).attr('title', 'drag to change font size ('+$(obj).css('font-size')+'), click to reset to default one'); + }); + $(elem).bind('mousedown', function(e) { + var obj = $(this).data('owner'); + // we assume px here + var orig_val = parseInt($(obj).css('font-size')); + if (isNaN(orig_val)) { + orig_val = 10; + } + var no_change = true; + var that = this; + $.glue.slider(e, function(x, y) { + var val = Math.floor(orig_val+y/6); + if (val < 0) { + val = 0; + } + $(obj).css('font-size', val+'px'); + $(that).attr('title', 'drag to change font size ('+val+'px), click to reset to default one'); + if (x != 0 || y != 0) { + no_change = false; + } + }, function(x, y) { + // reset font-size if there was no change at all + if (no_change) { + $(obj).css('font-size', ''); + $.glue.backend({ method: 'glue.object_remove_attr', name: $(obj).attr('id'), attr: 'text-font-size' }); + $(that).attr('title', 'drag to change font size ('+$(obj).css('font-size')+'px), click to reset to default one'); + } else { + $.glue.object.save(obj); + } + }); + return false; + }); + $.glue.contextmenu.register('text', 'text-font-size', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-font-color.png" alt="btn" title="change font color" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + $.glue.colorpicker.show($(obj).css('color'), false, function(col) { + $(obj).css('color', col); + }, function (col) { + $.glue.object.save(obj); + colorpicker_shown = false; + }); + colorpicker_shown = true; + }); + // this also requires the glue-deselect handler above + $.glue.contextmenu.register('text', 'text-font-color', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-font-style.png" alt="btn" title="change font style" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + if ($(obj).css('font-style') == 'normal' && ($(obj).css('font-weight') == 'bold' || $(obj).css('font-weight') == '700')) { + $(obj).css('font-style', 'italic'); + $(obj).css('font-weight', 'normal'); + } else if ($(obj).css('font-style') == 'italic' && ($(obj).css('font-weight') == 'normal' || $(obj).css('font-weight') == '400')) { + $(obj).css('font-style', 'italic'); + $(obj).css('font-weight', 'bold'); + } else if ($(obj).css('font-style') == 'italic' && ($(obj).css('font-weight') == 'bold' || $(obj).css('font-weight') == '700')) { + $(obj).css('font-style', 'normal'); + $(obj).css('font-weight', 'normal'); + } else { + $(obj).css('font-style', 'normal'); + $(obj).css('font-weight', 'bold'); + } + $.glue.object.save(obj); + }); + $.glue.contextmenu.register('text', 'text-font-style', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-line-height.png" alt="btn" title="change line height, click to reset to default one" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + $(this).attr('title', 'change line height ('+$(obj).css('line-height')+'), click to reset to default one'); + }); + $(elem).bind('mousedown', function(e) { + var obj = $(this).data('owner'); + // we assume px here + var orig_val = parseInt($(obj).css('line-height')); + if (isNaN(orig_val)) { + orig_val = 10; + } + var no_change = true; + var that = this; + $.glue.slider(e, function(x, y) { + var val = Math.floor(orig_val+y/6); + if (val < 0) { + val = 0; + } + $(obj).css('line-height', val+'px'); + $(that).attr('title', 'change line height ('+val+'px), click to reset to default one'); + if (x != 0 || y != 0) { + no_change = false; + } + }, function(x, y) { + // reset line-height if there was no change at all + if (no_change) { + $(obj).css('line-height', ''); + $.glue.backend({ method: 'glue.object_remove_attr', name: $(obj).attr('id'), attr: 'text-line-height' }); + $(that).attr('title', 'change line height ('+$(obj).css('line-height')+'), click to reset to default one'); + } else { + $.glue.object.save(obj); + } + }); + return false; + }); + $.glue.contextmenu.register('text', 'text-line-height', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-letter-spacing.png" alt="btn" title="change letter spacing" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + $(this).attr('title', 'change letter spacing ('+$(obj).css('letter-spacing')+'), click to reset to default one'); + }); + $(elem).bind('mousedown', function(e) { + var obj = $(this).data('owner'); + // we assume px here (but "normal" works just fine too) + var orig_val = parseInt($(obj).css('letter-spacing')); + if (isNaN(orig_val)) { + orig_val = 0; + } + var no_change = true; + var that = this; + $.glue.slider(e, function(x, y) { + var val = Math.floor(orig_val+y/6); + $(obj).css('letter-spacing', val+'px'); + $(that).attr('title', 'change letter spacing ('+val+'px), click to reset to default one'); + if (x != 0 || y != 0) { + no_change = false; + } + }, function(x, y) { + // reset letter-spacing if there was no change at all + if (no_change) { + $(obj).css('letter-spacing', ''); + $.glue.backend({ method: 'glue.object_remove_attr', name: $(obj).attr('id'), attr: 'text-letter-spacing' }); + $(that).attr('title', 'change letter spacing ('+$(obj).css('letter-spacing')+'), click to reset to default one'); + } else { + $.glue.object.save(obj); + } + }); + return false; + }); + $.glue.contextmenu.register('text', 'text-letter-spacing', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-word-spacing.png" alt="btn" title="change word spacing" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + $(this).attr('title', 'change word spacing ('+$(obj).css('word-spacing')+'), click to reset to default one'); + }); + $(elem).bind('mousedown', function(e) { + var obj = $(this).data('owner'); + // we assume px here (but "normal" works just fine too) + var orig_val = parseInt($(obj).css('word-spacing')); + if (isNaN(orig_val)) { + orig_val = 0; + } + var no_change = true; + var that = this; + $.glue.slider(e, function(x, y) { + var val = Math.floor(orig_val+y/6); + $(obj).css('word-spacing', val+'px'); + $(that).attr('title', 'change word spacing ('+val+'px), click to reset to default one'); + if (x != 0 || y != 0) { + no_change = false; + } + }, function(x, y) { + // reset word-spacing if there was no change at all + if (no_change) { + $(obj).css('word-spacing', ''); + $.glue.backend({ method: 'glue.object_remove_attr', name: $(obj).attr('id'), attr: 'text-word-spacing' }); + $(that).attr('title', 'change word spacing ('+$(obj).css('word-spacing')+'), click to reset to default one'); + } else { + $.glue.object.save(obj); + } + }); + return false; + }); + $.glue.contextmenu.register('text', 'text-letter-spacing', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-align.png" alt="btn" title="change text alignment" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var val = $(obj).css('text-align'); + if (val == 'center') { + $(this).attr('title', 'change text alignment (center)'); + } else if (val == 'right') { + $(this).attr('title', 'change text alignment (right)'); + } else if (val == 'justify') { + $(this).attr('title', 'change text alignment (justify)'); + } else { + // default to left + $(this).attr('title', 'change text alignment (left)'); + } + }); + $(elem).bind('mousedown', function(e) { + var obj = $(this).data('owner'); + var that = this; + $.glue.slider(e, function(x, y, e) { + var val = Math.floor(Math.abs(y/6)); + if (val % 4 == 0) { + $(obj).css('text-align', 'left'); + $(that).attr('title', 'change text alignment (left)'); + } else if (val % 4 == 1) { + $(obj).css('text-align', 'center'); + $(that).attr('title', 'change text alignment (center)'); + } else if (val % 4 == 2) { + $(obj).css('text-align', 'right'); + $(that).attr('title', 'change text alignment (right)'); + } else if (val % 4 == 3) { + $(obj).css('text-align', 'justify'); + $(that).attr('title', 'change text alignment (justify)'); + } + }, function(x, y) { + $.glue.object.save(obj); + }); + return false; + }); + $.glue.contextmenu.register('text', 'text-align', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/text/text-padding.png" alt="btn" title="change padding, click to reset to default one" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + $(this).attr('title', 'change padding ('+$(obj).css('padding-left')+', '+$(obj).css('padding-top')+'), click to reset to default one'); + }); + $(elem).bind('mousedown', function(e) { + var obj = $(this).data('owner'); + // we assume px here, and for {left,right} {top,bottom} to be the same + var orig_x = parseInt($(obj).css('padding-left')); + if (isNaN(orig_x)) { + orig_x = 0; + } + var orig_w = $(obj).width(); + var orig_y = parseInt($(obj).css('padding-top')); + if (isNaN(orig_y)) { + orig_y = 0; + } + var orig_h = $(obj).height(); + var no_change = true; + var that = this; + $.glue.slider(e, function(x, y, e) { + var val_x = Math.floor(orig_x+x/6); + if (val_x < 0) { + val_x = 0; + } + var val_y = Math.floor(orig_y+y/6); + if (val_y < 0) { + val_y = 0; + } + // shift: same padding for x and y + if (e.shiftKey) { + if (val_x < val_y) { + val_x = val_y; + } else if (val_y < val_x) { + val_y = val_x; + } + } + $(obj).css('padding-left', val_x+'px'); + $(obj).css('padding-right', val_x+'px'); + // resize object + $(obj).css('width', (orig_w+2*orig_x-2*val_x)+'px'); + $(obj).css('padding-top', val_y+'px'); + $(obj).css('padding-bottom', val_y+'px'); + $(obj).css('height', (orig_h+2*orig_y-2*val_y)+'px'); + $(that).attr('title', 'change padding ('+val_x+'px, '+val_y+'px), click to reset to default one'); + if (x != 0 || y != 0) { + no_change = false; + } + }, function(x, y) { + // reset padding if there was no change at all + if (no_change) { + var var_x = parseInt($(obj).css('padding-left')); + if (!isNaN(var_x)) { + // resize object + $(obj).css('width', ($(obj).width()+2*var_x)+'px'); + } + var var_y = parseInt($(obj).css('padding-top')); + if (!isNaN(var_y)) { + $(obj).css('height', ($(obj).height()+2*var_y)+'px'); + } + $(obj).css('padding-left', ''); + $(obj).css('padding-right', ''); + $(obj).css('padding-top', ''); + $(obj).css('padding-bottom', ''); + $(that).attr('title', 'change padding ('+$(obj).css('padding-left')+', '+$(obj).css('padding-top')+'), click to reset to default one'); + } + // use object.save() in both cases (width and height got changed too) + $.glue.object.save(obj); + }); + return false; + }); + $.glue.contextmenu.register('text', 'text-letter-spacing', elem); + + // make sure we don't send to much over the wire for every save + $.glue.object.register_alter_pre_save('text', function(obj, orig) { + // clear the textarea's background-image that Chrome sends along + $(obj).children('.glue-text-input').css('background-image', ''); + // the textarea's content is automatically not included + // we can read it out using + // $(orig).children('.glue-text-input').val() + // and even set it using + // $(obj).children('.glue-text-input').get(0).innerHTML + // but later on (when turning the element into a string) the content of the + // textarea get's magically encoded + // a la: + // <a href="asd">test</a> + // for this reason we update the object's content not through + // $.glue.object.update + $(obj).children('.glue-text-input').remove(); + $(obj).children('.glue-text-render').remove(); + }); +}); diff --git a/modules/text/text-font-color.png b/modules/text/text-font-color.png new file mode 100644 index 0000000..53fa7de Binary files /dev/null and b/modules/text/text-font-color.png differ diff --git a/modules/text/text-font-face.png b/modules/text/text-font-face.png new file mode 100644 index 0000000..e428dff Binary files /dev/null and b/modules/text/text-font-face.png differ diff --git a/modules/text/text-font-size.png b/modules/text/text-font-size.png new file mode 100644 index 0000000..7103aec Binary files /dev/null and b/modules/text/text-font-size.png differ diff --git a/modules/text/text-font-style.png b/modules/text/text-font-style.png new file mode 100644 index 0000000..74c9836 Binary files /dev/null and b/modules/text/text-font-style.png differ diff --git a/modules/text/text-letter-spacing.png b/modules/text/text-letter-spacing.png new file mode 100644 index 0000000..860ed22 Binary files /dev/null and b/modules/text/text-letter-spacing.png differ diff --git a/modules/text/text-line-height.png b/modules/text/text-line-height.png new file mode 100644 index 0000000..3ec20e2 Binary files /dev/null and b/modules/text/text-line-height.png differ diff --git a/modules/text/text-padding.png b/modules/text/text-padding.png new file mode 100644 index 0000000..029f7d0 Binary files /dev/null and b/modules/text/text-padding.png differ diff --git a/modules/text/text-scroll-off.png b/modules/text/text-scroll-off.png new file mode 100644 index 0000000..3ad68a9 Binary files /dev/null and b/modules/text/text-scroll-off.png differ diff --git a/modules/text/text-scroll-on.png b/modules/text/text-scroll-on.png new file mode 100644 index 0000000..c2d9b3a Binary files /dev/null and b/modules/text/text-scroll-on.png differ diff --git a/modules/text/text-word-spacing.png b/modules/text/text-word-spacing.png new file mode 100644 index 0000000..8838daf Binary files /dev/null and b/modules/text/text-word-spacing.png differ diff --git a/modules/text/text.png b/modules/text/text.png new file mode 100644 index 0000000..291458f Binary files /dev/null and b/modules/text/text.png differ diff --git a/modules/video/video-autoplay-off.png b/modules/video/video-autoplay-off.png new file mode 100644 index 0000000..6066bcb Binary files /dev/null and b/modules/video/video-autoplay-off.png differ diff --git a/modules/video/video-autoplay-on.png b/modules/video/video-autoplay-on.png new file mode 100644 index 0000000..bbd0257 Binary files /dev/null and b/modules/video/video-autoplay-on.png differ diff --git a/modules/video/video-controls-off.png b/modules/video/video-controls-off.png new file mode 100644 index 0000000..9020578 Binary files /dev/null and b/modules/video/video-controls-off.png differ diff --git a/modules/video/video-controls-on.png b/modules/video/video-controls-on.png new file mode 100644 index 0000000..4ac35d0 Binary files /dev/null and b/modules/video/video-controls-on.png differ diff --git a/modules/video/video-edit.css b/modules/video/video-edit.css new file mode 100644 index 0000000..9f44760 --- /dev/null +++ b/modules/video/video-edit.css @@ -0,0 +1,54 @@ +.video { + /* these are default widths and heights for new video objects */ + height: 360px; + width: 480px; +} + +#glue-contextmenu-video-autoplay { + /* overwrite the default greenish hue for .glue-menu-enabled */ + background-color: transparent; +} + +#glue-contextmenu-video-autoplay.glue-menu-disabled { + background-image: url(video-autoplay-off.png); +} + +#glue-contextmenu-video-autoplay.glue-menu-enabled { + background-image: url(video-autoplay-on.png); +} + +#glue-contextmenu-video-controls { + background-color: transparent; +} + +#glue-contextmenu-video-controls.glue-menu-disabled { + background-image: url(video-controls-off.png); +} + +#glue-contextmenu-video-controls.glue-menu-enabled { + background-image: url(video-controls-on.png); +} + +#glue-contextmenu-video-loop { + background-color: transparent; +} + +#glue-contextmenu-video-loop.glue-menu-disabled { + background-image: url(video-loop-off.png); +} + +#glue-contextmenu-video-loop.glue-menu-enabled { + background-image: url(video-loop-on.png); +} + +#glue-contextmenu-video-mute { + background-color: transparent; +} + +#glue-contextmenu-video-mute.glue-menu-disabled { + background-image: url(video-mute-off.png); +} + +#glue-contextmenu-video-mute.glue-menu-enabled { + background-image: url(video-mute-on.png); +} \ No newline at end of file diff --git a/modules/video/video-edit.js b/modules/video/video-edit.js new file mode 100644 index 0000000..ff5435a --- /dev/null +++ b/modules/video/video-edit.js @@ -0,0 +1,205 @@ +/** + * modules/video/video-edit.js + * Frontend code for video objects + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +$(document).ready(function() { + // + // turn video upload into an object + // + $('.video').live('glue-upload-dynamic-early', function(e, mode, target_x, target_y) { + $(this).children('video').get(0).addEventListener('loadedmetadata', function(e) { + // resize the video to it's native size + // DEBUG + //console.log('loadedmetadata'); + var w = e.target.videoWidth; + var h = e.target.videoHeight; + if (typeof w == 'number' && 0 < w && typeof h == 'number' && 0 < h) { + var obj = $(e.target).parent(); + $(obj).css('width', w+'px'); + $(obj).css('height', h+'px'); + $.glue.object.save(obj); + } + }, false); + // default width and height is set in the css + // make it explicit though + $(this).css('width', $(this).width()+'px'); + $(this).css('height', $(this).height()+'px'); + if (mode == 'center') { + $(this).css('left', (target_x-$(this).outerWidth()/2)+'px'); + $(this).css('top', (target_y-$(this).outerHeight()/2)+'px'); + } else { + $(this).css('left', target_x+'px'); + $(this).css('top', target_y+'px'); + } + // restore visibility + $(this).css('visibility', $(this).data('orig_visibility')); + $(this).removeData('orig_visibility'); + $.glue.object.register(this); + $.glue.object.save(this); + }); + + // + // context menu items + // + var elem = $('<div style="height: 32px; width: 32px;" title="toggle automatic playback of video">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + if (!$(video).attr('autoplay')) { + $(video).attr('autoplay', 'autoplay'); + $(this).addClass('glue-menu-enabled'); + $(this).removeClass('glue-menu-disabled'); + // make sure video is playing + $(video).get(0).play(); + } else { + $(video).removeAttr('autoplay'); + $(this).removeClass('glue-menu-enabled'); + $(this).addClass('glue-menu-disabled'); + } + $.glue.object.save(obj); + }); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + if ($(video).attr('autoplay')) { + $('#glue-contextmenu-video-autoplay').addClass('glue-menu-enabled'); + $('#glue-contextmenu-video-autoplay').removeClass('glue-menu-disabled'); + } else { + $('#glue-contextmenu-video-autoplay').removeClass('glue-menu-enabled'); + $('#glue-contextmenu-video-autoplay').addClass('glue-menu-disabled'); + } + }); + $.glue.contextmenu.register('video', 'video-autoplay', elem); + + elem = $('<div style="height: 32px; width: 32px;" title="toggle looping of video">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + if (!$(video).attr('loop')) { + $(video).attr('loop', 'loop'); + $(this).addClass('glue-menu-enabled'); + $(this).removeClass('glue-menu-disabled'); + } else { + $(video).removeAttr('loop'); + $(this).removeClass('glue-menu-enabled'); + $(this).addClass('glue-menu-disabled'); + } + $.glue.object.save(obj); + }); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + if ($(video).attr('loop')) { + $('#glue-contextmenu-video-loop').addClass('glue-menu-enabled'); + $('#glue-contextmenu-video-loop').removeClass('glue-menu-disabled'); + } else { + $('#glue-contextmenu-video-loop').removeClass('glue-menu-enabled'); + $('#glue-contextmenu-video-loop').addClass('glue-menu-disabled'); + } + }); + $.glue.contextmenu.register('video', 'video-loop', elem); + + elem = $('<div style="height: 32px; width: 32px;" title="show or hide control elements">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + if (!$(video).attr('controls')) { + $(video).attr('controls', 'controls'); + $(this).addClass('glue-menu-enabled'); + $(this).removeClass('glue-menu-disabled'); + } else { + $(video).removeAttr('controls'); + $(this).removeClass('glue-menu-enabled'); + $(this).addClass('glue-menu-disabled'); + } + $.glue.object.save(obj); + }); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + if ($(video).attr('controls')) { + $('#glue-contextmenu-video-controls').addClass('glue-menu-enabled'); + $('#glue-contextmenu-video-controls').removeClass('glue-menu-disabled'); + } else { + $('#glue-contextmenu-video-controls').removeClass('glue-menu-enabled'); + $('#glue-contextmenu-video-controls').addClass('glue-menu-disabled'); + } + }); + $.glue.contextmenu.register('video', 'video-controls', elem); + + elem = $('<div style="height: 32px; width: 32px;" title="mute or unmute video">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + if ((video).attr('audio') != 'muted') { + $(video).attr('audio', 'muted'); + $(this).addClass('glue-menu-enabled'); + $(this).removeClass('glue-menu-disabled'); + } else { + $(video).removeAttr('audio'); + $(this).removeClass('glue-menu-enabled'); + $(this).addClass('glue-menu-disabled'); + } + $.glue.object.save(obj); + }); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + if ((video).attr('audio') == 'muted') { + $('#glue-contextmenu-video-mute').addClass('glue-menu-enabled'); + $('#glue-contextmenu-video-mute').removeClass('glue-menu-disabled'); + } else { + $('#glue-contextmenu-video-mute').removeClass('glue-menu-enabled'); + $('#glue-contextmenu-video-mute').addClass('glue-menu-disabled'); + } + }); + $.glue.contextmenu.register('video', 'video-mute', elem); + + elem = $('<img src="'+$.glue.base_url+'modules/video/video-ratio.png" alt="btn" title="reset video size" width="32" height="32">'); + $(elem).bind('glue-menu-activate', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + // only show the icon when we have the native width and height + var w = $(video).get(0).videoWidth; + var h = $(video).get(0).videoHeight; + if (typeof w == 'number' && 0 < w && typeof h == 'number' && 0 < h) { + $(this).css('display', 'block'); + } else { + $(this).css('display', 'none'); + } + }); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + var video = $(obj).children('video').first(); + // get the native width and height + var w = $(video).get(0).videoWidth; + var h = $(video).get(0).videoHeight; + if (typeof w != 'number' || w <= 0 || typeof h != 'number' || h <= 0) { + // return if we don't have them + return; + } + var aspect = w/h; + $(obj).trigger('glue-resizestart'); + $(obj).css('width', w+'px'); + $(obj).css('height', h+'px'); + $(obj).trigger('glue-resize'); + $.glue.object.resizable_update_tooltip(obj); + $.glue.object.save(obj); + $(obj).trigger('glue-resizestop'); + $.glue.canvas.update(obj); + }); + $.glue.contextmenu.register('video', 'video-ratio', elem); + + elem = $('<img src="'+$.glue.base_url+'img/download.png" alt="btn" title="download original file" width="32" height="32">'); + $(elem).bind('click', function(e) { + var obj = $(this).data('owner'); + // initiate download + window.location = $.glue.base_url+'?'+$(obj).attr('id')+'&download=1'; + }); + $.glue.contextmenu.register('video', 'video-download', elem); +}); diff --git a/modules/video/video-loop-off.png b/modules/video/video-loop-off.png new file mode 100644 index 0000000..807d61f Binary files /dev/null and b/modules/video/video-loop-off.png differ diff --git a/modules/video/video-loop-on.png b/modules/video/video-loop-on.png new file mode 100644 index 0000000..b3c89eb Binary files /dev/null and b/modules/video/video-loop-on.png differ diff --git a/modules/video/video-mute-off.png b/modules/video/video-mute-off.png new file mode 100644 index 0000000..688f612 Binary files /dev/null and b/modules/video/video-mute-off.png differ diff --git a/modules/video/video-mute-on.png b/modules/video/video-mute-on.png new file mode 100644 index 0000000..49086e1 Binary files /dev/null and b/modules/video/video-mute-on.png differ diff --git a/modules/video/video-ratio.png b/modules/video/video-ratio.png new file mode 100644 index 0000000..40633a7 Binary files /dev/null and b/modules/video/video-ratio.png differ diff --git a/modules/video/video.css b/modules/video/video.css new file mode 100644 index 0000000..82d5d37 --- /dev/null +++ b/modules/video/video.css @@ -0,0 +1,16 @@ +.video { + /* this is for the fallback below */ + overflow: hidden; +} + +.video-fallback { + /* displayed when the browser can't interpret the video tag */ + height: 100%; + margin-top: -25px; + min-height: 50px; + overflow: hidden; + position: absolute; + text-align: center; + top: 50%; + width: 100%; +} diff --git a/modules/video/video.png b/modules/video/video.png new file mode 100644 index 0000000..f9c9fea Binary files /dev/null and b/modules/video/video.png differ diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..e69de29 diff --git a/util.inc.php b/util.inc.php new file mode 100644 index 0000000..7decabf --- /dev/null +++ b/util.inc.php @@ -0,0 +1,505 @@ +<?php + +/** + * util.inc.php + * Static utility functions + * + * Copyright Gottfried Haider, Danja Vasiliev 2010. + * This source code is licensed under the GNU General Public License. + * See the file COPYING for more details. + */ + +/** + * convert an associative array to a javascript block + * + * @param array $container container array + * @return string + */ +function array_to_js($container) +{ + $ret = '<script type="text/javascript">'.nl(); + // sort container by keys + ksort($container); + $exists = array(); + foreach ($container as $key=>$val) { + // make sure the keys exist + $objs = expl('.', $key); + for ($i=0; $i < count($objs)-1; $i++) { + $obj = implode('.', array_slice($objs, 0, $i+1)); + if (!in_array($obj, $exists)) { + if ($i == 0) { + $ret .= tab().'var '.$obj.' = '.$obj.' || {};'.nl(); + } else { + $ret .= tab().$obj.' = '.$obj.' || {};'.nl(); + } + $exists[] = $obj; + } + } + $ret .= tab().''.$key.' = '.json_encode($val).';'.nl(); + } + $ret .= '</script>'.nl(); + return $ret; +} + + +/** + * make an array off associative array unique in a certain key-value + * + * @param array &$a reference to array + * @param mixed $key key whose value we compare + */ +function array_unique_element(&$a, $key) +{ + // for each row + for ($cur=0; $cur < count($a); $cur++) { + // look in every row further down + for ($i=$cur+1; $i < count($a); $i++) { + // to see if the value of a key in the array is the same as in the + // current row + if ($a[$i][$key] == $a[$cur][$key]) { + // delete the row further down + array_splice($a, $i, 1); + $i--; + } + } + } +} + + +/** + * check if two directories are different + * + * @param string $a filename + * @param string $b filename + * @return bool + */ +function dir_is_different($a, $b) +{ + if (substr($a, -1) == '/') { + $a = substr($a, 0, -1); + } + if (substr($b, -1) == '/') { + $b = substr($b, 0, -1); + } + + $a_fns = @scandir($a); + $b_fns = @scandir($b); + if ($a_fns !== $b_fns) { + return true; + } + + foreach ($a_fns as $fn) { + if ($fn == '.' || $fn == '..') { + continue; + } + if (is_dir($a.'/'.$fn) || is_dir($b.'/'.$fn)) { + if (dir_is_different($a.'/'.$fn, $b.'/'.$fn)) { + return true; + } + } else { + if (file_is_different($a.'/'.$fn, $b.'/'.$fn)) { + return true; + } + } + } + + return false; +} + + +/** + * split a string by string + * + * like php's explode() but handles empty strings better. + * @param string $delimiter boundary string + * @param string $string input string + * @return array + */ +function expl($delimiter, $string) +{ + $ret = explode($delimiter, $string); + if (count($ret) == 1 && empty($ret[0])) { + return array(); + } else { + return $ret; + } +} + + +/** + * explode a string splitting it by whitespace characters + * + * @param string $s input string + * @param bool $honor_quot don't split inside quotation marks + * @return array of strings + */ +function expl_whitesp($s, $honor_quot = false) +{ + // same characters as trim() uses + $whitesp = array(' ', "\t", "\n", "\r", "\0", "\x0B"); + $quot = array('"', "'"); + $ret = array(); + + $prev = -1; + $cur_quot = false; + + for ($i=0; $i < strlen($s); $i++) { + if ($honor_quot && in_array($s[$i], $quot)) { + if ($cur_quot === false) { + // begin of quote + $cur_quot = $s[$i]; + } elseif ($cur_quot == $s[$i] && ($i < 1 || $s[$i-1] != "\\")) { + // end of quote + $cur_quot = false; + } + } + if ($cur_quot !== false) { + // do nothing while on a quote + continue; + } + if (in_array($s[$i], $whitesp)) { + if ($prev+1 == $i) { + $prev++; + } else { + $ret[] = substr($s, $prev+1, $i-$prev-1); + $prev = $i; + } + } + } + if ($prev+2 < $i) { + $ret[] = substr($s, $prev+1); + } + + return $ret; +} + + +/** + * check if two files are different + * + * @param string $a filename + * @param string $b filename + * @return bool + */ +function file_is_different($a, $b) +{ + if (@filesize($a) !== @filesize($b)) { + return true; + } + if (@md5_file($a) !== @md5_file($b)) { + return true; + } else { + return false; + } +} + + +/** + * get the extension of a file + * + * @param string $s filename + * @return string + */ +function filext($s) +{ + $a = expl('.', $s); + if (1 < count($a)) { + return(array_pop($a)); + } else { + return ''; + } +} + + +/** + * return a error 400 message to the client + * + * this function doesn't return. + */ +function http_400() +{ + // TODO (listed): we need hotglue theming here + // TODO (later): turn this into http_error() + header($_SERVER['SERVER_PROTOCOL'].' 400 Bad Request'); + echo 'Bad Request'; + die(); +} + + +/** + * return a error 404 message to the client + * + * this function doesn't return. + */ +function http_404() +{ + // TODO (listed): we need hotglue theming here + // TODO (later): turn this into http_error() + header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); + echo 'Not Found'; + die(); +} + + +/** + * return a error 500 message to the client + * + * this function doesn't return. + */ +function http_500() +{ + // TODO (listed): we need hotglue theming here + // TODO (later): turn this into http_error() + header($_SERVER['SERVER_PROTOCOL'].' 500 Internal Server Error'); + echo 'Internal Server Error'; + die(); +} + + +/** + * check if the user is http digest authenticated + * + * @param array $users array of possible users (usernames as keys, + * password as values) + * @param string $realm realm (e.g. name of the site) + * @retval 0 authenticated + * @retval -1 user did not request authentication + * @retval -2 parts of the response are missing + * @retval -3 unknown username + * @retval -4 invalid password + */ +function http_digest_check($users, $realm = '') +{ + // code based on the php documentation + if (empty($_SERVER['PHP_AUTH_DIGEST'])) { + return -1; + } else { + $auth = $_SERVER['PHP_AUTH_DIGEST']; + } + + // taken from one of the comments + $data = array(); + preg_match("/username=\"([^\"]+)\"/i", $auth, $match); + if (isset($match[1])) { + $data['username'] = $match[1]; + } else { + return -2; + } + preg_match('/nonce=\"([^\"]+)\"/i', $auth, $match); + if (isset($match[1])) { + $data['nonce'] = $match[1]; + } else { + return -2; + } + preg_match('/nc=([0-9a-f]+)/i', $auth, $match); + if (isset($match[1])) { + $data['nc'] = $match[1]; + } else { + return -2; + } + preg_match('/cnonce=\"([^\"]+)\"/i', $auth, $match); + if (isset($match[1])) { + $data['cnonce'] = $match[1]; + } else { + return -2; + } + // fixed for Safari + // qop comes as qop="auth" + preg_match('/qop=\"?([^,\"]+)/i', $auth, $match); + if (isset($match[1])) { + $data['qop'] = $match[1]; + } else { + return -2; + } + preg_match('/uri=\"([^\"]+)\"/i', $auth, $match); + if (isset($match[1])) { + $data['uri'] = $match[1]; + } else { + return -2; + } + preg_match('/response=\"([^\"]+)\"/i', $auth, $match); + if (isset($match[1])) { + $data['response'] = $match[1]; + } else { + return -2; + } + + // check username + if (!array_key_exists($data['username'], $users)) { + return -3; + } + + // generate the valid response + $a1 = md5($data['username'].':'.str_replace("\"", '', $realm).':'.$users[$data['username']]); + $a2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']); + $valid_response = md5($a1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$a2); + + if ($data['response'] != $valid_response) { + return -4; + } else { + return 0; + } +} + + +/** + * prompt the user for http digest authentication + * + * make sure the script stops execution after calling this function. + * @param string $realm realm (e.g. name of the site) + */ +function http_digest_prompt($realm = '') +{ + // code based on the php documentation + header($_SERVER['SERVER_PROTOCOL'].' 401 Unauthorized'); + header('WWW-Authenticate: Digest realm="'.str_replace("\"", '', $realm).'",qop="auth",nonce="'.uniqid().'",opaque="'.md5(str_replace("\"", '', $realm)).'"'); +} + + +/** + * check if a string is a url + * + * @param string $s + * @return bool + */ +function is_url($s) +{ + if (strpos($s, '://')) { + return true; + } else { + return false; + } +} + + +/** + * return a number of newline characters + * + * @param int $count count (one is default) + * @return string + */ +function nl($count = 1) +{ + $s = ''; + while (0 < $count--) { + $s .= "\n"; + } + return $s; +} + + +/** + * pad a string to have at least $num characters + * + * @param string $s string to operate on + * @param int $num number of characters desired + * @param string $chr character to pad the string with + * @return string + */ +function pad($s, $num, $chr = ' ') +{ + for ($i=strlen($s); $i < $num; $i++) { + $s .= $chr; + } + return $s; +} + + +/** + * return a string with double quotation marks wrapped around + * + * @param string $s string + * @return string + */ +function quot($s) +{ + return '"'.$s.'"'; +} + + +/** + * serve a file to the client + * + * this function only returns on errors. + * @param string $fn filename + * @param bool $dl download file + * @param string $mime mime type + */ +function serve_file($fn, $dl, $mime) +{ + if (($size = @filesize($fn)) === false) { + return false; + } + if (empty($mime)) { + // fall back to octet-stream + $mime = 'application/octet-stream'; + } + + // TODO (later): optionally set the mime type based on the file extension only + // see http://www.php.net/manual/en/function.readfile.php#52722 + // TODO (later): handle byte range + // TODO (later): handle if-modified-since etc + // TODO (later): also check apache_request_headers() + + if ($dl) { + // these are taken from the php documentation (on readfile()) + header('Content-Description: File Transfer'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename='.basename($fn)); + header('Content-Transfer-Encoding: binary'); + } else { + header('Content-Type: '.$mime); + } + header('Content-Length: '.$size); + flush(); + @readfile($fn); + die(); +} + + +/** + * return a number of tab characters + * + * @param int $count count (one is default) + * @return string + */ +function tab($count = 1) +{ + $s = ''; + while (0 < $count--) { + $s .= "\t"; + } + return $s; +} + + +/** + * print human-readable information about a variable in inline format + * + * @param mixed $var variable + * @return string + */ +function var_dump_inl($var) +{ + // print_r returns true/false as '1'/'' + // fix this at least for the value of $var itself + if (is_bool($var) && $var) { + return 'true'; + } elseif (is_bool($var)) { + return 'false'; + } + + $ret = print_r($var, true); + // remove control characters + $ret = str_replace("\n", ' ', $ret); + $ret = str_replace("\r", ' ', $ret); + $ret = str_replace("\t", ' ', $ret); + // remove double spaces + do { + $ret = str_replace(' ', ' ', $ret, $cnt); + } while (0 < $cnt); + return trim($ret); +} + + +?>