commit 486c0770cac939711c133e0fb514e9f1fd97a9ae Author: Stan Ozier Date: Fri May 21 03:00:57 2010 +0200 version 0.2 diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..a76eaf8 --- /dev/null +++ b/.htaccess @@ -0,0 +1,3 @@ +RewriteEngine on +RewriteCond $1 !^(index\.php|phpdoc|skin|asset|plugin|favicon\.ico|robots\.txt) +RewriteRule ^(.*)$ /index.php/$1 [L] \ No newline at end of file diff --git a/README/gpl-3.0.txt b/README/gpl-3.0.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/README/gpl-3.0.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README/lgpl-3.0.txt b/README/lgpl-3.0.txt new file mode 100644 index 0000000..65c5ca8 --- /dev/null +++ b/README/lgpl-3.0.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/README/readme.txt b/README/readme.txt new file mode 100644 index 0000000..38f31aa --- /dev/null +++ b/README/readme.txt @@ -0,0 +1,36 @@ +TaskFreak! Time Tracking +------------------------ +version 0.2 +released on 2010-05-21 +------------------------ + +This is the first official release +status : beta + +Requirements +------------ +- apache with mod_rewrite +- PHP 5.3.x +- mySQL 4.1 or later +- a virtual host + +v0.2 can not run under yourdomain.com/taskfreak, it has to be yourdomain.com + +Setup +----- +1) Set up your virtual host +2) create a mySQL database +3) create tables and data with taskfreak_time.sql +4) open app/config/db.php and change database settings + +You can stop here and have a look. +login is "admin" with no password + +If you don't want multi user support, open app/config/core.php +Search for APP_SETUP_USER_MODEL and set it up to false : +[code] +define('APP_SETUP_USER_MODEL',false); +[/code] + +If you feel like playing so more, open app/config/app.php and look into it + diff --git a/README/taskfreak_timer.sql b/README/taskfreak_timer.sql new file mode 100644 index 0000000..99e16f6 --- /dev/null +++ b/README/taskfreak_timer.sql @@ -0,0 +1,146 @@ +-- phpMyAdmin SQL Dump +-- version 3.3.1 +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: May 21, 2010 at 02:12 AM +-- Server version: 5.0.67 +-- PHP Version: 5.3.0 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `taskfreak_timer` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `acl` +-- + +DROP TABLE IF EXISTS `acl`; +CREATE TABLE `acl` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `name` varchar(127) NOT NULL, + `section` varchar(63) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `acl` +-- + +INSERT INTO `acl` VALUES(1, 'task_see_all', 'general'); +INSERT INTO `acl` VALUES(2, 'admin_user', 'general'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `acl_user` +-- + +DROP TABLE IF EXISTS `acl_user`; +CREATE TABLE `acl_user` ( + `user_id` mediumint(8) unsigned NOT NULL, + `acl_id` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`user_id`,`acl_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `acl_user` +-- + +INSERT INTO `acl_user` VALUES(1, 1); +INSERT INTO `acl_user` VALUES(1, 2); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `member` +-- + +DROP TABLE IF EXISTS `member`; +CREATE TABLE `member` ( + `id` int(10) unsigned NOT NULL auto_increment, + `nickname` varchar(30) NOT NULL, + `email` varchar(255) NOT NULL, + `username` varchar(255) NOT NULL, + `password` varchar(40) NOT NULL, + `salt` varchar(40) NOT NULL, + `auto_login` tinyint(1) unsigned NOT NULL, + `time_zone` varchar(63) NOT NULL, + `date_format_us` tinyint(1) NOT NULL default '0', + `creation_date` datetime NOT NULL, + `expiration_date` date NOT NULL, + `last_login_date` datetime NOT NULL, + `last_login_address` varchar(60) NOT NULL, + `last_change_date` datetime NOT NULL, + `visits` int(10) unsigned NOT NULL, + `bad_access` smallint(5) unsigned NOT NULL, + `activation` varchar(16) NOT NULL, + `enabled` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `member` +-- + +INSERT INTO `member` VALUES(1, 'Administrator', '', 'admin', '', '12345678', 0, 'Asia/Bangkok', 0, '2010-05-21 01:43:21', '0000-00-00', '0000-00-00 00:00:00', '127.0.0.1', '0000-00-00 00:00:00', 0, 0, '', 1); +INSERT INTO `member` VALUES(2, 'Emilie', '', 'emilie', '', '12345678', 0, 'Europe/Paris', 0, '2010-05-21 01:44:17', '0000-00-00', '0000-00-00 00:00:00', '127.0.0.1', '0000-00-00 00:00:00', 0, 0, '', 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `task` +-- + +DROP TABLE IF EXISTS `task`; +CREATE TABLE `task` ( + `id` int(10) unsigned NOT NULL auto_increment, + `title` varchar(255) NOT NULL, + `note` text NOT NULL, + `priority` tinyint(3) unsigned NOT NULL default '5', + `begin` date NOT NULL, + `deadline` date NOT NULL, + `status` tinyint(3) unsigned NOT NULL, + `archived` tinyint(3) unsigned NOT NULL, + `member_id` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `member_id` (`member_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `task` +-- + +INSERT INTO `task` VALUES(1, 'taskfreak : README first about this beta version', 'Please keep in mind that this is an early beta version. There are quite a few known bugs, a handful of unknown bugs.\r\n\r\nHere''s what you can do so far :\r\n- create, edit and archive tasks\r\n- start and stop task timers\r\n- report time spent on a task\r\n- edit your own profile\r\n- see other''s tasks (task manager only)\r\n- create and edit users (user admin only)', 5, '9999-00-00', '2010-05-22', 0, 0, 1); +INSERT INTO `task` VALUES(2, 'taskfreak : another quick notes about v0.2', 'There''s still some work to be done before TaskFreak Time Tracking goes stable.\r\n\r\nThis includes :\r\n- fix found bugs (obviously)\r\n- finish table prefix testing\r\n- add multi language support\r\n- Internet Explorer support (only tested on FireFox, Safari & Chrome)', 4, '9999-00-00', '9999-00-00', 0, 0, 1); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `timer` +-- + +DROP TABLE IF EXISTS `timer`; +CREATE TABLE `timer` ( + `task_id` int(10) unsigned NOT NULL, + `start` datetime NOT NULL, + `stop` datetime NOT NULL, + `spent` int(10) unsigned NOT NULL, + `manual` tinyint(3) unsigned NOT NULL, + KEY `task_id` (`task_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `timer` +-- + diff --git a/app/config/app.php b/app/config/app.php new file mode 100644 index 0000000..b60d03b --- /dev/null +++ b/app/config/app.php @@ -0,0 +1,90 @@ + 'task', + // default controller to call (home page) + 'default_action' => 'main' + // default action to call (home page) +); + +$GLOBALS['config']['pages'] = array( + 'Todo' => 'task/main', + 'Report' => 'task/report', + 'Archives' => 'task/archives' +); + +// ---- LANGUAGE DEFAULTS ----------------------------------------------------- + +$GLOBALS['config']['lang'] = array( + 'default' => 'en', + 'user' => 'en', + 'specialchars' => 2 +); + +// ---- DATE / TIME FORMATS --------------------------------------------------- + +// date/time timezone and formats defaults +$GLOBALS['config']['datetime'] = array( + 'timezone_server' => new DateTimeZone(APP_TIMEZONE_SERVER), + 'timezone_user' => new DateTimeZone(APP_TIMEZONE_SERVER), + 'us_format' => false, +); +$GLOBALS['config']['datetime']['now'] = new DateTime('now', $GLOBALS['config']['datetime']['timezone_server']); + +// --- Specific DATE FORMATS ------------------------------------------------- + +define("APP_DATE","%d/%m"); +define("APP_DATETIME","%d/%m %H:%M"); + +// --- TASKFREAK DEFAULTS --------------------------------------------------------- + +$GLOBALS['config']['task'] = array( + 'date' => APP_SQL_TODAY, // default date is today + 'validate' => true // add validation button +); + +$GLOBALS['config']['task']['priority'] = array( + 'options' => array( + 1 => '1) urgent', + 2 => '2) important', + 3 => '3) quickly', + 4 => '4) pretty soon', + 5 => '5) normal', + 6 => '6) after', + 7 => '7) later', + 8 => '8) anytime', + 9 => '9) whatever' + ), + 'default' => 5 +); + +// ---- DEFAULT Javascript ---------------------------------------------------- + +$GLOBALS['config']['header']['js'] = array( + 'jquery-1.4.2.min.js', + // 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', +); + + +// ---- SKINS and Templates --------------------------------------------------- + +$GLOBALS['config']['skin'] = 'default'; + +// ---- LANGUAGE -------------------------------------------------------------- + +$GLOBALS['config']['lang']['default'] = 'en'; +$GLOBALS['config']['lang']['user'] = 'en'; +$GLOBALS['config']['lang']['specialchars'] = 2; diff --git a/app/config/core.php b/app/config/core.php new file mode 100644 index 0000000..65069f8 --- /dev/null +++ b/app/config/core.php @@ -0,0 +1,151 @@ + true, + // allow auto login (true or false) + 'password_recover' => true, + // allow password recovery (true or false) + 'register' => 2 + // register mode + // 0: no registration, 1: account created directly (no validation) + // 2: user validation (from email), 3: admin validate account +); + +// ---- FILE PATHs ------------------------------------------------------------ + +define('APP_ROOT_PATH',substr(dirname(__FILE__),0,-10)); + +define('APP_WWW_PATH',APP_ROOT_PATH); + +define('APP_CORE_PATH',APP_ROOT_PATH.'app/'); +define('APP_CONFIG_PATH',APP_CORE_PATH.'config/'); +define('APP_MODEL_PATH',APP_CORE_PATH.'model/'); +define('APP_CONTROLLER_PATH',APP_CORE_PATH.'controller/'); +define('APP_VIEW_PATH',APP_CORE_PATH.'view/'); + +define('APP_INCLUDE_PATH', APP_ROOT_PATH); +define('APP_CACHE_PATH',APP_INCLUDE_PATH.'cache/'); +define('APP_LIB_PATH',APP_INCLUDE_PATH.'lib/'); +define('APP_CLASS_PATH',APP_LIB_PATH.'class/'); +define('APP_HELPER_PATH',APP_LIB_PATH.'helper/'); + +define('APP_ASSET_PATH',APP_ROOT_PATH.'asset/'); +define('APP_LANGUAGE_PATH',APP_ASSET_PATH.'lang/'); +define('APP_PLUGIN_PATH',APP_ROOT_PATH.'plugin/'); +define('APP_SKIN_PATH',APP_ROOT_PATH.'skin/'); + +// ---- APPLICATION URLs ------------------------------------------------------ + +define('APP_WWW_URI', '/'); + +if (!defined('APP_WWW_URI')) { + define('APP_WWW_URI',preg_replace('/^\/admin/','',dirname($_SERVER['PHP_SELF'])) + .(preg_match('/\/$/',dirname($_SERVER['PHP_SELF']))?'':'/')); +} +define('APP_WWW_URL','http://'.$_SERVER['SERVER_NAME'].APP_WWW_URI); + +// ---- USER and PASSWORD SETTINGS -------------------------------------------- + +define('APP_USER_ID_LENGTH',8); // length of user ID +define('APP_USER_SANITIZE','/^[a-z0-9_-]+$/i'); +define('APP_USER_NAME_MIN',4); // minimum length for username +define('APP_USER_NAME_MAX',15); // maximum length for username +define('APP_USER_PASS_MIN',4); // minimum length for password +define('APP_USER_PASS_MAX',16); // maximum length for password +define('APP_PASSWORD_SANITIZE','/^[a-z0-9%!@#&*+:;,<>\.\?\|\{\}\(\)\[\]\$_-]+$/i'); + +// ---- FILE UPLOAD Settings -------------------------------------------------- + +define('APP_FILE_SLASH','/'); +define('APP_FILE_RANDOM',false); +define('APP_FILE_FOLDER_SIZE',300); // number of files per folder +define('APP_FILE_GD_VERSION',2); +define('APP_FILE_GD_QUALITY',80); + +// ---- Default DATE/TIME FORMATs --------------------------------------------- + +define("APP_DATE_SQL","%Y-%m-%d"); +define('APP_DATE_EUR', '%d/%m/%y'); +define('APP_DATE_USA', '%m/%d/%y'); +define("APP_DATE_SHT","%d %b %y"); // -TODO- %e bug +define("APP_DATE_SHX","%a %e %b %y"); +define("APP_DATE_LNG","%d %B %Y"); +define("APP_DATE_LNX","%A %d %B %Y"); +define("APP_DATETIME_SQL","%Y-%m-%d %H:%M:%S"); +define("APP_DATETIME_EUR","%d/%m/%y %H:%M"); +define("APP_DATETIME_USA","%m/%d/%y %I:%M%p"); +define("APP_DATETIME_SHT","%d %b %y, %H:%M"); +define("APP_DATETIME_SHX","%a %d %b %y, %H:%M"); +define("APP_DATETIME_LNG","%d %B %Y, %H:%M"); +define("APP_DATETIME_LNX","%A %d %B %Y, %H:%M"); +define("APP_DATETIME_HRS","%H:%M"); + +// date_default_timezone_set('Europe/Paris'); +define('APP_TIMEZONE_SERVER',date_default_timezone_get()); +define('APP_TZSERVER',intval(date('Z'))); +// define('APP_TZSERVER',timezone_offset_get(new DateTimeZone(APP_TIMEZONE_SERVER), new DateTime())); + +define('APP_SQL_NOW', gmdate('Y-m-d H:i:s')); +define('APP_SQL_TODAY',substr(APP_SQL_NOW,0,10)); +define('APP_NOW',strtotime(APP_SQL_NOW)); +define('APP_TODAY',strtotime(APP_SQL_TODAY)); +define('APP_YEAR',substr(APP_SQL_TODAY,0,4)); + +// ---- MISC MODEL PROPERTIES Settings ---------------------------------------- + +define('APP_KEY_LENGTH',8); +define('APP_KEY_STRING','ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); + +define('APP_SANITIZE_SIMPLE','/^[a-z0-9_-]+$/i'); + + +// ----- PHP SESSION Settings ------------------------------------------------- + +define('TZN_TRANS_ID',0); +define('TZN_TRANS_STATUS',1); +if (@constant('APP_TRANS_ID')) { + ini_set("session.use_trans_sid",1); +} else { + ini_set('session.use_trans_sid', 0); + ini_set('session.use_only_cookies', 1); +} \ No newline at end of file diff --git a/app/config/db.php b/app/config/db.php new file mode 100644 index 0000000..bc48e8f --- /dev/null +++ b/app/config/db.php @@ -0,0 +1,21 @@ + + * @version 0.2 + * @copyright GNU General Public License (GPL) version 3 + */ + +/** + * Admin + * + * Administration pages + * @since 0.2 + */ +class Admin extends AppController { + + public function __construct() { + parent::__construct(true); + + $this->fc->setSessionDefault('userlimit',10); + + if ($this->fc->getReqVar('ajax')) { + $this->page->clean('css'); + $this->page->clean('js'); + } else { + $this->page->add('css',array('form.css','freak.css','list.css','tracker.css','colorbox.css')); + // $this->page->add('js',array('jquery.form.min.js','jquery.colorbox-min.js')); + $this->page->add('js','freak.js'); + } + } + + public function mainAction() { + + // check access rights + if (!$this->fc->user->checkAcl('admin_user')) { + $this->fc->redirect(APP_WWW_URI,'access_denied'); + } + + $this->filter = $this->fc->sessionVariable('userfilter'); + $this->limit = $this->fc->sessionVariable('userlimit'); + $this->search = $this->fc->sessionVariable('search'); + + $title = 'All users'; + $filter = ''; + + switch ($this->filter) { + case '1': + $title = 'Task managers'; + $filter = "actags LIKE '%task_see_all%'"; + $this->limit = 0; + break; + case '2': + $title = 'User managers'; + $filter = "actags LIKE '%admin_user%'"; + $this->limit = 0; + break; + default: + break; + } + + + $this->data = new MemberModel(); + $this->data->enableAuthentication(); + $this->data->connectDb(); + $this->data->orderBy('nickname ASC'); + if ($fs = DbQueryHelper::parseSearch($this->search)) { + $this->data->where("nickname LIKE '$fs'"); + } + if ($filter) { + $this->data->having($filter); + } + if ($this->limit) { + $this->data->limit(0, $this->limit); + } + $this->data->loadList(); + + $this->page->set('title',$title.' | TaskFreak! Time Tracker Administration'); + + $this->setView('admin/user-list'); + $this->view(); + } + + public function editAction() { + + $this->_loadUser(); + $this->data->addHelper('html_form'); + + $this->setView('admin/user-edit'); + $this->view(); + } + + public function editReaction() { + + $this->_loadUser(); + + $this->data->fields('nickname,username,time_zone,email'); + $this->data->set($this->fc->request); + + if ($this->fc->chkReqVar('pass1') && $this->fc->chkReqVar('pass2')) { + if ($this->data->setPassword($this->fc->getReqVar('pass1'), $this->fc->getReqVar('pass2'))) { + // save it all + $this->data->ignore(); + } else { + // do not save password + $this->data->ignore('password,salt'); + } + } + + if ($this->data->check()) { + $this->data->set('enabled',1); // always enable for now + $myself = ($this->data->getUid() == $this->fc->user->getUid()); + if ($this->data->save(!$myself)) { + if ($myself) { + // editing own profile need to relogin + $this->data->updateSessionVariables(); + } + $this->fc->autoRedirect('user saved'); + } + } + return true; + } + + public function deleteAction() { + + $this->_loadUser(); + + if ($this->canDeleteThisUser) { + if ($this->data->delete()) { + $db = DbConnector::getConnection(); + // delete this user's rights + $db->query('DELETE FROM '.$this->data->dbTable('acl_user').' WHERE user_id='.$this->data->getUid()); + // delete this user's tasks + $db->query('DELETE FROM '.$this->data->dbTable('task').' WHERE member_id='.$this->data->getUid()); + $this->fc->redirect(APP_WWW_URI.'admin','user deleted'); + } + } + + $this->fc->redirect(APP_WWW_URI.'admin','user deleted'); + + } + + public function switchAction() { + + if (!$this->fc->user->checkAcl('task_see_all')) { + $this->fc->redirect(APP_WWW_URI,'access_denied'); + } + + if ($id = $this->fc->getReqVar('id')) { + // switch has been requested + $obj = new MemberModel(); + $obj->connectDb(); + $obj->setUid($id); + if ($obj->load()) { + $this->fc->setSessionVariable('switch_id', $id); + $this->fc->setSessionVariable('switch_name', $obj->get('nickname')); + } + $this->fc->redirect(APP_WWW_URI,'switched to '.$obj->get('nickname')); + } + + $this->switch_id = $this->fc->getSessionVariable('switch_id'); + + $this->data = new MemberModel(); + $this->data->connectDb(); + $this->data->orderBy('nickname ASC'); + $this->data->loadList(); + + $this->setView('admin/switch'); + $this->view(); + } + + protected function _loadUser() { + if (isset($this->data)) { + // already loaded + return false; + } + + $this->canDeleteThisUser = false; + + $this->data = new MemberModel(); + $this->data->enableAuthentication(); + $this->data->connectDb(); + + // check access rights + if ($this->fc->user->checkAcl('admin_user')) { + if ($id = $this->fc->getReqVar('id')) { + $this->data->setUid($id); + $this->data->load(); + if ($id != $this->fc->user->getUid()) { + $this->canDeleteThisUser = true; + } + } else { + // create a ne user : set defaults + $this->data->set('time_zone', $GLOBALS['config']['datetime']['timezone_server']->getName()); + } + } else { + // not an admin : can only load itself + $this->data = $this->fc->user; + } + + return true; + } + +} diff --git a/app/controller/login.php b/app/controller/login.php new file mode 100644 index 0000000..e3cb402 --- /dev/null +++ b/app/controller/login.php @@ -0,0 +1,56 @@ + + * @version 0.2 + * @copyright GNU General Public License (GPL) version 3 + */ + +/** + * Login + * + * List of current tasks + * @since 0.2 + */ +class Login extends AppController { + + public function __construct() { + parent::__construct(false); + } + + /** + * Login form + */ + public function mainAction() { + $this->fc->user->addHelper('html_form'); + $this->page->set('title','TaskFreak! Login'); + $this->page->add('css',array('form.css','freak.css','login.css')); + $this->page->add('js','form.js'); + $this->setView('login/login'); + $this->view(); + } + + /** + * Logs user in + * @todo redirect to requested page + */ + public function mainReaction() { + $this->fc->user->fields('username,password'); + $this->fc->user->set($this->fc->request); + if ($this->fc->user->login($this->fc->user->get('username'), $this->fc->user->get('password'))) { + NaviHelper::redirect(APP_WWW_URI); + } + return true; // show action again + } + + /** + * Logs user out + * @todo show logout summary page + */ + public function outAction() { + $this->fc->user->logout(); + NaviHelper::redirect(APP_WWW_URI); + } +} \ No newline at end of file diff --git a/app/controller/task.php b/app/controller/task.php new file mode 100644 index 0000000..e05b4e2 --- /dev/null +++ b/app/controller/task.php @@ -0,0 +1,328 @@ + + * @version 0.2 + * @copyright GNU General Public License (GPL) version 3 + */ + +/** + * Task + * + * List of current tasks + * @since 0.1 + */ +class Task extends AppController { + + public function __construct() { + parent::__construct(true); + + $this->fc->setSessionDefault('limit',10); + if (APP_SETUP_USER_MODEL) { + $this->fc->setSessionDefault('switch_id',$this->fc->user->getUid()); + $this->fc->setSessionDefault('switch_name',$this->fc->user->get('nickname')); + $this->switch_id = $this->fc->getSessionVariable('switch_id'); + $this->user_id = $this->fc->user->getUid(); + } else { + $this->switch_id = $this->user_id = 0; + } + + $this->fc->loadModel('TaskModel'); + $this->current = TaskSummary::loadCurrent(); + if ($this->fc->getReqVar('ajax')) { + $this->page->clean('css'); + $this->page->clean('js'); + } else { + $this->page->add('css',array('form.css','freak.css','list.css','tracker.css','colorbox.css')); + // $this->page->add('js',array('jquery.form.min.js','jquery.colorbox-min.js')); + $this->page->add('js','freak.js'); + } + } + + public function mainAction() { + $this->filter = $this->fc->sessionVariable('filter'); + $title = 'Todo'; + $filter = 'status=0 AND archived=0'; + $this->actions = array(); + switch ($this->filter) { + case '1': + $title = 'Completed'; + $filter = 'status=1 AND archived=0'; + $this->actions['open'] = 'Re-open'; + $this->actions['valid'] = 'Validate'; + $this->actions['archive'] = 'Archive'; + break; + case '2': + $title = 'Valid'; // -TODO- check english term + $filter = 'status=2 AND archived=0'; + $this->actions['open'] = 'Re-open'; + $this->actions['archive'] = 'Archive'; + break; + case '3': + $title = 'Archives'; + $filter = 'archived=1'; + $this->actions['unarchive'] = 'Unarchive'; + break; + default: + $this->actions['report'] = 'Report 1 day'; + $this->actions['close'] = 'Mark as done'; + $this->actions['valid'] = 'Validate'; + $this->actions['archive'] = 'Archive'; + break; + } + + $this->_taskList($filter); + + $this->page->set('title',$title.' | TaskFreak! Time Tracker'); + + if ($this->fc->getReqVar('ajax')) { + $this->setView('include/list-'.($this->expand?'expand':'compact')); + } else { + $this->setView('main'); + } + $this->view(); + + } + + public function mainReaction() { + // drop if no checkbox have been checked + if (!isset($_POST['chk'])) { + // -TODO- show error + $this->fc->redirect(APP_WWW_URI.'task/main/','please check at least one task'); + } + // check action request + $action = $this->fc->chkReqVar('report,open,close,valid,archive,unarchive'); + // do it then + TaskModel::updateManyAtOnce($action, $_POST['chk']); + // reload entire page + $this->fc->redirect(APP_WWW_URI.'task/main/'); + } + + /** + * called to start a task (from the task list) + * will only update the timer panel and change the task in the list + * (method called by ajax request only) + */ + public function timerAction() { + if ($id = $this->fc->getReqVar('id')) { + $obj = new TaskSummary(); + $obj->connectDb(); + $obj->setUid($id); + $obj->load(); + if ($obj->getUid()) { + // -TODO- check rights + // first stop any running task (TODO for current user only) + if ($this->current) { + $cid = $this->current->getUid(); + TimerModel::stop($cid); + $this->jsCode = "clockreport('$cid');"; + } + // now start selected task + TimerModel::start($id); + $this->current = TaskSummary::loadCurrent(); + $this->jsCode .= "clockstart('$id')"; + } + $this->setView('include/timer'); + $this->view(); + return false; + } + } + + /** + * change a task status (start, stop, close) or save a new one + * will only update the timer panel and reload the task list + * (method called by ajax request only) + */ + public function timerReaction() { + $this->jsCode = ''; + if ($id = $this->fc->getReqVar('id')) { + // start / stop timer + $obj = new TaskSummary(); + $obj->connectDb(); + $obj->setUid($id); + $obj->load(); + + // what action then ? + $action = $this->fc->chkReqVar('pause,resume,start,stop,close'); + + FC::log_debug('loaded task ID='.$obj->getUid()); + switch($action) { + case 'pause': + // try to pause + if ($this->current && $this->current->getUid() == $id) { + // ok, task is actually running + TimerModel::stop($id); + $this->current->set('stop',APP_SQL_NOW); + $this->jsCode .= "clockreport('$cid');clockstatus('paused');"; + } else { + // nope, requested task is not running, show error + $this->jsCode = "alert('error trying to pause')"; + FC::log_debug('error trying to pause non running task'); + } + break; + case 'resume': + case 'start': + TimerModel::start($id); + $this->current = TaskSummary::loadCurrent(); + $this->jsCode = "clockstart();"; + break; + case 'stop': + if (TimerModel::stop($id)) { + $this->jsCode = "clockstatus();"; + } else { + $this->jsCode = "alert('task already stopped');"; + } + $this->current = false; + break; + case 'close': + if (TimerModel::stop($id)) { + $this->jsCode = "clockstatus();"; + $this->current->updateStatus(1); // mark as done + $this->current = false; + } + break; + } + } else if ($title = $this->fc->getReqVar('title')) { + // creating a new task ? + $obj = TaskModel::parse($title, $def, $dte); + $obj->connectDb(); + if ($this->fc->getReqVar('start')) { + $obj->set('deadline', APP_SQL_TODAY); + } + if ($obj->check($this->switch_id)) { + $obj->insert(); + } + if ($this->fc->chkReqVar('start')) { + TimerModel::start($obj->getUid()); + $this->current = TaskSummary::loadCurrent(); + $this->jsCode = "clockstart();"; + } else { + $this->current = false; + $this->jsCode = "clockstatus();"; + } + } + $this->jsCode .= 'reloadList();'; + $this->setView('include/timer'); + $this->view(); + return false; + } + + protected function _taskList($filter) { + + $this->expand = $this->fc->sessionVariable('expand'); + $this->search = $this->fc->sessionVariable('search'); + $this->limit = $this->fc->sessionVariable('limit'); + + $this->data = new TaskSummary(); + $this->data->connectDb(); + $this->data->where($filter); + if ($this->search) { + $this->data->where("title LIKE '%".$this->search."%'"); + } + if ($this->switch_id) { + // user login enabled, filter by users + $this->data->where('member_id='.$this->switch_id); + } + $this->data->orderBy('deadline ASC, priority ASC, title ASC, start ASC'); + if ($this->expand) { + $this->limit = 0; + $this->data->loadExpandList(); + } else { + $this->data->limit(0,$this->limit); + $this->data->loadCompactList(); + } + } + + public function viewAction() { + $this->data = new TaskSummary(); + $this->data->connectDb(); + + $ok = false; + if ($id = $this->fc->getReqVar('id')) { + $this->data->where('id='.$id); + $this->data->orderBy('start ASC'); + if ($this->data->loadExpandList()) { + $ok = $this->data->next(); + } + } + if (!$ok) { + echo 'Todo not found'; + exit; + } + $this->data->chkDeadline(); + + $this->timer = new TimerModel(); + $this->timer->addHelper('html_form'); + + $this->page->set('title','Todo details | TaskFreak! Time Tracker'); + // $this->page->add('js',array('jquery.dateentry.pack.js','jquery.timeentry.pack.js')); + $this->setView('view'); + $this->view(); + } + + public function createAction() { + $this->_loadTask(); + $this->data->addHelper('html_form'); + $this->page->set('title','Create Multiple Todos | TaskFreak! Time Tracker'); + $this->setView('create'); + $this->view(); + } + + public function createReaction() { + $this->result = array(); + $data = explode("\n",$this->fc->getReqVar('data')); + ArrayHelper::arrayTrim($data); + $t = count($data); // total to parse + $i = 0; // successfully parsed counter + $defDate = ''; // date of previous created task + $defValue = ''; // default value for multiple tasks creation (set by *) + foreach ($data as $val) { + if ($objTask = TaskModel::parse($val, $defValue, $defDate)) { + // really creating a task + $objTask->connectDb(); + if ($objTask->check($this->switch_id)) { + $objTask->insert(); + $i++; + } + } + } + $this->fc->redirect('/task/main',$i.' task(s) created !'); + } + + public function editAction() { + $this->_loadTask(); + $this->data->addHelper('html_form'); + + $this->page->set('title',($this->data->getUid()?'Edit':'Create').' Todo | TaskFreak! Time Tracker'); + $this->setView('edit'); + $this->view(); + } + + public function editReaction() { + $this->_loadTask(); + $this->data->ignore('creation_date'); // do not submit or change creation date + $this->data->set($this->fc->request); + if ($this->data->check($this->switch_id)) { + $this->data->save(); + $this->fc->redirect(APP_WWW_URI,'task_created'); + } + return true; // show action again + } + + protected function _loadTask() { + if (empty($this->data)) { + $this->data = new TaskModel(); + $this->data->connectDb(); + + $uid = $this->data->dbUid(); + if ($id = $this->fc->getReqVar($uid)) { + $this->data->setUid($id); + $this->data->load(); + } + } + return $this->data->getUid(); + } + +} \ No newline at end of file diff --git a/app/controller/timer.php b/app/controller/timer.php new file mode 100644 index 0000000..db0f6d0 --- /dev/null +++ b/app/controller/timer.php @@ -0,0 +1,132 @@ + + * @version 0.2 + * @copyright GNU General Public License (GPL) version 3 + */ + +/** + * Task + * + * List of current tasks + * @since 0.1 + */ +class Timer extends AppController { + + public function __construct() { + parent::__construct(true); + + $this->fc->loadModel('TaskModel'); + + $this->page->clean('css'); + $this->page->clean('js'); + } + + /** + * show timer creation form + */ + public function mainAction() { + $this->setView('include/timer-form.php'); + $this->view(); + } + + /** + * create timer + */ + public function mainReaction() { + $date = VarDte::sanitize($_POST['date'],$err); + $start = VarTim::sanitize($_POST['start_time'],$err); + $stop = VarTim::sanitize($_POST['stop_time'],$err); + $spent = VarDur::sanitize($_POST['spent'],$err); + $this->data = new TimerModel(); + $this->data->set('task_id', $_POST['id']); + if ($start) { + $this->data->set('start',$_POST['date'].' '.$_POST['start_time']); + } + if ($stop) { + $this->data->set('stop',$_POST['date'].' '.$_POST['stop_time']); + } + if ($spent) { + $this->data->set('spent', $_POST['spent']); + } + + /* + echo '
';
+		print_r($_POST);
+		echo "\n\n";
+		echo "date : $date\n";
+		echo "start : $start : ".$this->data->get('start')."\n";
+		echo "stop : $stop : ".$this->data->get('stop')."\n";
+		echo "spent: $spent\n";
+		echo '
'; + */ + + $this->data->setCheck(); + if ($this->data->check()) { + $this->data->connectDb(); + $this->data->set('manual',1); + $this->data->insert(); + } + + /* + echo $this->data; + exit; + */ + + echo ''; + echo '

time added

'; + return false; + } + + public function deleteAction() { + // check stuff + $id = $this->fc->getReqVar('id'); + $start = $this->fc->getReqVar('start'); + + if (empty($id) || empty($start)) { + $this->fc->redirect(CMS_WWW_URI,'ERROR:missing parameters'); + } + + // delete timer + $this->data = new TimerModel(); + $this->data->connectDb(); + if ($this->data->delete('task_id='.$id." AND start='".$start."'")) + { + // successfully deleted + if ($this->fc->getReqVar('ajax')) { + $this->data = new TaskSummary(); + $this->data->connectDb(); + + $ok = false; + if ($id = $this->fc->getReqVar('id')) { + $this->data->where('id='.$id); + if ($this->data->loadExpandList()) { + $ok = $this->data->next(); + } + } + $this->setView('include/timer-list'); + $this->view(); + echo ''; + } else { + $this->fc->redirect(CMS_WWW_URI,'Timer deleted'); + } + } else { + // error deleting + if ($this->fc->getReqVar('ajax')) { + echo ''; + } else { + $this->fc->redirect(CMS_WWW_URI,'Timer NOT deleted'); + } + } + + } +} \ No newline at end of file diff --git a/app/model/member.php b/app/model/member.php new file mode 100644 index 0000000..1eb5f8c --- /dev/null +++ b/app/model/member.php @@ -0,0 +1,44 @@ + + * @version 0.2 + * @copyright GNU General Public License (GPL) version 3 + */ + +/** + * MemberModel + * @since 0.2 + */ +class MemberModel extends UserAclModel { + + public function __construct() { + parent::__construct('member'); + $this->addProperties(array( + 'nickname' => 'STR', + 'email' => 'EML' + )); + } + + public function htmlRights() { + if ($this->isEmpty('actags')) { + return ''; + } + $arr = explode(',', $this->get('actags')); + $arrTrans = array(); + if (in_array('task_see_all', $arr)) { + $arrTrans[] = 'task manager'; + } + if (in_array('admin_user', $arr)) { + $arrTrans[] = 'user admin'; + } + return implode(', ',$arrTrans); + } + + public function check() { + return parent::check('nickname,username'); + } + +} diff --git a/app/model/task.php b/app/model/task.php new file mode 100644 index 0000000..752090e --- /dev/null +++ b/app/model/task.php @@ -0,0 +1,391 @@ + + * @version 0.2 + * @copyright GNU General Public License (GPL) version 3 + */ + +/** + * Task + * + * Class representing a task + * @since 0.1 + */ +class TaskModel extends Model { + + public function __construct() { + parent::__construct('task'); + $this->addProperties(array( + 'id' => 'UID', + 'title' => 'STR', + 'note' => 'BBS', + 'priority' => 'NUM,'.json_encode($GLOBALS['config']['task']['priority']), + 'begin' => 'DTE', + 'deadline' => 'DTE', + 'status' => 'NUM,{"options":["todo","done","valid"],"default":0}', + 'archived' => 'BOL', + 'member_id' => 'NUM' + )); + } + + /** + * check submitted data before saving task + */ + public function check($usrId) { + if ($this->isEmpty('begin')) { + $this->set('begin','9999-00-00'); + } + if ($this->isEmpty('deadline')) { + $this->set('deadline','9999-00-00'); + } + if ($this->isEmpty('member_id') && APP_SETUP_USER_MODEL) { + $this->set('member_id', $usrId); + } + return parent::check('title'); + } + + /** + * parse a single line string for task params + * @return a task object + */ + public static function parse($str, &$def, &$dte) { + if (!preg_match('/^(\* |\*{2,3})?([+|-][0-9]{0,2}|[0-9]{2}\/[0-9]{2})?( ?[0-9]+\))?(.+)?$/',$str, $arr)) { + return false; + } + ArrayHelper::arrayTrim($arr); + $obj = new TaskModel(); + $tst = substr($arr[1],0,1); + switch ($tst) { + case '*': // multiple + if ($arr[1] == '**') { + // reset default date (**) + $dte = ''; + } else if ($arr[1] == '***') { + // reset default title (***) + $def = ''; + } else { + if ($arr[2]) { + // remember date + if ($tst == '+') { + if ($n = substr($arr[2], 1)) { + // number of days later + $obj->set('deadline',$arr[2].' days'); + } else { + // no number, means today + $obj->set('deadline', APP_SQL_TODAY); + } + } else { + $dte = $arr[2]; + } + } + if ($arr[4]) { + // remember title + $def = $arr[4]; + } + } + return false; + break; + case '-': // no deadline + $obj->set('deadline','9999-00-00'); + break; + case '+': // specify deadline + if ($n = substr($arr[2], 1)) { + // number of days later + $obj->set('deadline',$arr[2].' days'); + } else { + // no number, means today + $obj->set('deadline', APP_SQL_TODAY); + } + break; + default: + if ($arr[2]) { + // specific date set + $obj->set('deadline', $arr[2]); + $dte = $obj->get('deadline'); + } else if (!empty($dte)) { + // use default date (from batch) + $obj->set('deadline', $dte); + } else if ($GLOBALS['config']['task']['date']) { + // use default date (config) + $obj->set('deadline', $GLOBALS['config']['task']['date']); + // $dte = $obj->get('deadline'); + } else { + // no date by default (config) + $dte = ''; + } + } + $prio = $GLOBALS['config']['task']['priority']['default']; // default priority + if ($arr[3]) { + // priority ? + $prio = intval(substr($arr[3],0,-1)); + } + $obj->set('priority',$prio); + $title = $arr[4]; + if ($def) { + $title = $def.' : '.$title; + } + $obj->set('title',$title); + return $obj; + } + + /* + * set archive status for multiple tasks + */ + public static function updateManyAtOnce($action, $arr) { + if (!count($arr)) { + return false; + } + $sta = ''; + switch ($action) { + case 'report': + $sta = 'deadline = DATE_ADD(deadline, INTERVAL 1 DAY)'; + break; + case 'open': + $sta = 'status=0'; + break; + case 'close': + $sta = 'status=1'; + break; + case 'valid': + $sta = 'status=2'; + break; + case 'archive': + $sta = 'archived=1'; + break; + case 'unarchive': + $sta = 'archived=0'; + break; + } + if ($sta) { + $filter = 'id IN ('.implode(',',$arr).')'; + DbConnector::query('UPDATE task SET '.$sta.' WHERE '.$filter); + return true; + } + return false; + } +} + +class TaskSummary extends TaskModel { + + public function __construct() { + parent::__construct(); + $this->addProperties(array( + 'start' => 'DTM', + 'stop' => 'DTM', + 'spent' => 'NUM', + 'timers' => 'NUM' + )); + } + + public function htmlPriority() { + $arr = $this->getPropertyOptions('priority'); + $st = $this->get('priority'); + return $arr['options'][$st]; + } + + public function htmlStatus() { + $arr = $this->getPropertyOptions('status'); + $str = $this->get('status'); + $str = $arr['options'][$str]; // -TODO- TRANSLATE + if ($this->get('archived')) { + $str .= ' (archived)'; + } + return $str; + } + + public function htmlBegin() { + if ($this->isEmpty('start')) { + if ($this->isEmpty('begin')) { + return '-'; + } else { + // -TODO- show in grey + return $this->html('begin',APP_DATE); + } + } else { + return $this->html('start',APP_DATETIME); + } + } + + public function getEnd() { + if ($this->isEmpty('stop')) { + if ($this->isEmpty('deadline')) { + return ''; + } else { + return $this->get('deadline'); + } + } else { + return $this->get('stop'); + } + } + + public function htmlEnd($expanded=false) { + if ($this->isEmpty('stop')) { + return '-'; + } else { + return $this->html('stop',APP_DATETIME); + } + } + + public function htmlDeadline() { + if ($this->isEmpty('deadline')) { + return '-'; + } else { + switch ($this->_diff) { + case 9999: + return '-'; + case -1: + return 'yesterday'; + case 0: + return 'today'; + case 1: + return 'tomorrow'; + default: + return $this->html('deadline',APP_DATE); + } + } + } + + public function getTimeSpent() { + return $this->htmlTime($this->get('spent'), $this->isEmpty('start')); + } + + public function getRealSpentSecs() { + return APP_NOW - strtotime($this->get('start')); + } + + public function getRealSpent() { + $spent = $this->getRealSpentSecs(); + $h = floor($spent / 3600); + $m = floor($spent / 60) - ($h*60); + $s = $spent - ($h*3600 + $m*60); + return str_pad($h, 2, '0',STR_PAD_LEFT) + .':'.str_pad($m, 2, '0',STR_PAD_LEFT) + .':'.str_pad($s, 2, '0',STR_PAD_LEFT); + } + + public function chkDeadline() { + if ($this->isEmpty('deadline')) { + $this->_diff = 9999; + } else { + $dead = strtotime($this->get('deadline')); + $this->_diff = ($dead - intval(APP_TODAY)) / 3600 / 24; + } + } + + public function isOpened($user_id) { + // -TODO- if no "validate" option, do not allow on closed tasks + return ($this->get('status') < 2 && (!$this->get('archived')) && ($this->get('member_id') == $user_id)); + } + + public function curCss($default='') { + $arr = array(); + if ($this->_diff < 0) { + $arr[] = 'overdue'; + } else if ($this->_diff == 0) { + $arr[] = 'today'; + } else { + $arr[] = 'future'; + } + if ($default) { + $arr[] = $default; + } + if (count($arr)) { + return ' class="'.implode(' ',$arr).'"'; + } else { + return ''; + } + } + + public function htmlDate() { + $str = $this->html('end_date',APP_DATE_FRM,'no_date'); + if ($css = $this->curCss()) { + return ''.$str.''; + } else { + return $str; + } + } + + public static function htmlTime($spent, $stopped=true) { + if (empty($spent)) { + if ($stopped) { + return '--:--'; + } else { + return 'running'; + } + } + $h = floor($spent / 60); + $m = $spent - ($h*60); + return str_pad($h, 2, '0',STR_PAD_LEFT).':'.str_pad($m, 2, '0',STR_PAD_LEFT); + } + + /** + * update current task status + */ + public function updateStatus($status) { + $this->connectDb(); + $this->set('status',$status); + $this->fields('status'); + return parent::update(); + } + + /** + * override load function + */ + public function load($filter='') { + $this->select('id, title, begin, deadline, start, stop, status, archived, ' + .'CEIL(spent/60) as spent'); + $this->from('task'); + $this->leftJoin('timer','task.id=timer.task_id'); + return parent::load($filter, false); + } + + /** + * load current running timer + */ + public static function loadCurrent($id=0) { + $obj = new TaskSummary(); + $obj->connectDb(); + if ($id) { + $obj->setUid($id); + if ($obj->load()) { + return $obj; + } + } else { + $ftr = "stop='0000-00-00 00:00:00'"; + if (!empty($_SESSION['appUserId'])) { + $ftr .= " AND member_id='".$_SESSION['appUserId']."'"; + } + if ($obj->load($ftr)) { + return $obj; + } + } + return false; + } + + public function loadCompactList() { + /* + SELECT task.*, MIN(start) as start, MAX(stop) as stop, SUM(CEIL(spent/60)) as spent + FROM `task` + LEFT JOIN timer ON task.id = timer.task_id + WHERE status < 2 + GROUP BY id + */ + $this->select('task.*, MIN(start) as start, MAX(stop) as stop, ' + .'SUM(CEIL(spent/60)) as spent, COUNT(timer.task_id) AS timers'); + $this->from('task'); + $this->leftJoin('timer','task.id=timer.task_id'); + $this->groupBy('id'); + return parent::loadList(false); + } + + public function loadExpandList() { + $this->select('task.*, start, stop, CEIL(spent/60) as spent'); + $this->from('task'); + $this->leftJoin('timer','task.id=timer.task_id'); + return parent::loadList(false); + } + +} \ No newline at end of file diff --git a/app/model/timer.php b/app/model/timer.php new file mode 100644 index 0000000..c4928f9 --- /dev/null +++ b/app/model/timer.php @@ -0,0 +1,93 @@ + + * @version 0.1 + * @copyright GNU General Public License (GPL) version 3 + */ + +/** + * Timer + * + * Class representing a task time log + * @since 0.1 + */ +class TimerModel extends Model { + + public function __construct() { + parent::__construct('timer'); + $this->addProperties(array( + 'task_id' => 'NUM', + 'start' => 'DTM', + 'stop' => 'DTM', + 'spent' => 'DUR', + 'manual' => 'BOL', // 0:auto, 1:manual + )); + } + + /** + * check submitted data before saving task + */ + public function check() { + return parent::check('task_id,start,stop,spent'); + } + + /** + * set data and compute missing fields + * @param integer $start number of seconds since midnight + * @param integer $stop number of seconds since midnight + * @param integer $spent number of seconds spent on task + */ + public function setCheck() { + $start = strtotime($this->get('start')); + $stop = strtotime($this->get('stop')); + $spent = intval($this->get('spent')); + if (!$this->isEmpty('start')) { + if (!$this->isEmpty('stop')) { + // calc diff between start and stop + $this->set('spent',$stop-$start); + } else if ($this->get('spent')) { + $this->set('stop',strftime(APP_DATETIME_SQL,$start+$spent)); + } + } else if ($spent) { + if (!$stop) { + $this->set('stop',APP_SQL_NOW); + $stop = APP_NOW; + } + $this->set('start',strftime(APP_DATETIME_SQL,$stop-$spent)); + } + } + + /** + * starts a timer + */ + public static function start($tid) { + $obj = new TimerModel(); + $obj->connectDb(); + $obj->set('task_id',$tid); + $obj->set('start',APP_SQL_NOW); + return $obj->insert(); + } + + /** + * stops a timer + */ + public static function stop($tid) { + if (!($tid = VarUid::sanitize($tid, $err))) { + return false; + } + $filter = "task_id='$tid' AND stop='0000-00-00 00:00:00'"; + $obj = new TimerModel(); + $obj->connectDb(); + if (!$obj->load($filter)) { + return false; + } + $obj->set('stop',APP_SQL_NOW); + $obj->set('spent', strtotime($obj->get('stop')) - strtotime($obj->get('start'))); + $obj->fields('stop,spent'); + return $obj->update($filter); + } + +} diff --git a/app/view/admin/switch.php b/app/view/admin/switch.php new file mode 100644 index 0000000..f09c934 --- /dev/null +++ b/app/view/admin/switch.php @@ -0,0 +1,20 @@ +incView('include/page-top', false); + +?> +

Select user whose tasks you want to see

+
    +data->next()) { + echo '
  • '; + if ($this->data->getUid() == $this->switch_id) { + echo $this->data->html('nickname'); + } else { + echo ''.$this->data->html('nickname').''; + } + echo '
  • '; +} +?> +
+incView('include/page-bot', false); diff --git a/app/view/admin/user-edit.php b/app/view/admin/user-edit.php new file mode 100644 index 0000000..35c66d0 --- /dev/null +++ b/app/view/admin/user-edit.php @@ -0,0 +1,74 @@ +incView('include/page-top', false); + +// echo $this->data->iAutoForm('user_edit','post','','top'); +echo '

'; +if ($id = $this->data->getUid()) { + if ($id == $this->fc->user->getUid()) { + echo 'My preferences'; + } else { + echo 'Edit a user'; + } +} else { + echo 'Create new user'; +} +echo '

'; + + +echo $this->data->iForm('user_edit','post'); +echo $this->data->iHidden('id'); +?> +
    + data->iFieldLabelled('nickname','','','li class="compulsory"'); + echo $this->data->iFieldLabelled('email'); + ?> +
  1. + + data->iTimeZone('time_zone'); ?> +
  2. + data->iFieldLabelled('username','','','li class="compulsory"'); + ?> +
  3. + + data->iPass('pass1', false); ?> +
  4. +
  5. + + data->iPass('pass2', false); ?> +
  6. + data->getUid() != $this->fc->user->getUid()) { + // can only change rights for other users + ?> +
  7. + +
      +
    • data->checkAcl('task_see_all')) echo ' checked="checked"'; + ?> />
    • +
    • data->checkAcl('admin_user')) echo ' checked="checked"'; + ?> />
    • +
    +
  8. + +
  9. + + canDeleteThisUser) { + ?> + Delete + +
  10. +
+incView('include/page-bot', false); + \ No newline at end of file diff --git a/app/view/admin/user-list.php b/app/view/admin/user-list.php new file mode 100644 index 0000000..c2c42f6 --- /dev/null +++ b/app/view/admin/user-list.php @@ -0,0 +1,83 @@ +incView('include/page-top', false); + +?> +
+
+ + Create user + + + + +
+
+ data->count()) { + ?> + + + + + + + + + data->next()) { + $id = $this->data->getUid(); + echo ''; + echo ''; + echo ''; + echo ''; + } + ?> + +
namelast visit
'; + echo 'edit'; + echo $this->data->html('nickname'); + if ($tmp = $this->data->htmlRights()) { + echo ' '.$tmp.''; + } + echo ''.$this->data->html('last_login_date').'
+ +

sorry, no user found

+ +
+
+incView('include/page-bot', false); diff --git a/app/view/create.php b/app/view/create.php new file mode 100644 index 0000000..f060e37 --- /dev/null +++ b/app/view/create.php @@ -0,0 +1,32 @@ +incView('include/page-top', false); +?> +
+

Enter one task per line.

+

Task format

+

Task format : [date] [priority] [label :] task title
+ fields within brackets are optional

+

date can be :

+
    +
  • a date in format dd/mm[/yy]
  • +
  • a + followed by number of days in the future
  • +
  • a - means no deadline
  • +
  • nothing means deadline is today
  • +
+

priority is a number between 1 and 9, followed by a )
+ « 1) » for urgent tasks, « 5) » for normal priority

+

label is optional

+

Defaults for multiple tasks

+

a line starting by a * sets up defaults

+

Format is : * [date] [label]
+ « * +1 taskfreak » or « * 12/04 »

+

reset defaults with a line with « ** »

+
+iForm('task_batch','post',$this->fc->thisUrl()); +echo '

'.$hh->iTextArea('data').'

'; +echo '

'; +echo ''; + +$this->incView('include/page-bot', false); \ No newline at end of file diff --git a/app/view/edit.php b/app/view/edit.php new file mode 100644 index 0000000..7f86ce7 --- /dev/null +++ b/app/view/edit.php @@ -0,0 +1,34 @@ +incView('include/page-top', false); + +// echo $this->data->iAutoForm('task_edit','post','','top'); +echo $this->data->iForm('task_edit','post'); +echo $this->data->iHidden('id'); +?> +
    + data->iFieldLabelled('title','','','li class="nline"'); + // $this->data->iFieldLabelled('begin'); -TODO- unused ATM + echo $this->data->iFieldLabelled('deadline','','','li class="nline"'); + ?> +
  1. + + data->iSelect('priority'); ?> +
  2. + data->iFieldLabelled('note','','','li class="nline"'); + ?> +
  3. + : + data->iSelect('status'); ?> +
  4. +
  5. + data->iCheckBox('archived'); ?> + +
  6. +
  7. + +
  8. +
+incView('include/page-bot', false); diff --git a/app/view/include/list-compact.php b/app/view/include/list-compact.php new file mode 100644 index 0000000..c557760 --- /dev/null +++ b/app/view/include/list-compact.php @@ -0,0 +1,105 @@ +data->count()) { + echo HtmlFormHelper::iForm('tasks'); +?> + + + + + + + + + + + + + current)?$this->current->getUid():0; + while ($this->data->next()) { + $this->data->chkDeadline(); + $id = $this->data->getUid(); + echo 'filter)?$this->data->curCss(($cid == $id)?'current':''):'') + .'>'; + echo ' + + + + + + + + + + + + + + + +
 deadline + data->total(); ?> item(s) found + task + startstopspent
'; + if (!in_array($id, $arr)) { + echo ''; + $i++; + $arr[] = $id; + } else { + echo ''; + } + $total += $this->data->get('spent'); + ?>data->htmlDeadline(); ?> + edit + data->get('priority'); + echo '">'.$this->data->get('priority').' '; + // note + echo 'data->isEmpty('note')) { + echo 'class="ajax box clickme"'; + } else { + echo 'class="note ajax box clickme" '; + echo 'title="'.$this->data->html('note',200).'"'; + } + echo '>'; + // title + echo $this->data->html('title'); + echo ''; + ?> + data->htmlBegin(); ?>data->htmlEnd(); ?> + data->isOpened($this->user_id)) { + echo 'start'; + } + + echo ''; + if (!$this->expand && $cid == $id) { + echo 'running'; + } else { + echo $this->data->getTimeSpent(); + } + echo ''; + ?> +
+ select all | + actions as $key => $label) { + echo ' '; + } + ?> + TOTAL
+ +No Task found

'; +} diff --git a/app/view/include/list-expand.php b/app/view/include/list-expand.php new file mode 100644 index 0000000..2be67e4 --- /dev/null +++ b/app/view/include/list-expand.php @@ -0,0 +1,163 @@ +data->count()) { + + // prepare array of data + $arrData = array(); + $c = $d = $cid = -1; + while ($this->data->next()) { + if ($cid != $this->data->getUid()) { + $c++; + $d=0; + $cid = $this->data->getUid(); + } + $arrData[$c][$d] = clone($this->data); + $d++; + } + + // start list + echo HtmlFormHelper::iForm('tasks'); + +?> + + + + + + + + + + + + + current)?$this->current->getUid():0; + + for($j=0;$j<=$c;$j++) { + $arrObj = $arrData[$j]; + $d = count($arrObj); + $k=0; + $str = ''; + $subtotal = 0; + $obj = $arrObj[0]; + + $id = $obj->getUid(); + + // first loop to get total time spent on task + foreach ($arrObj as $obj) { + $subtotal += $obj->get('spent'); + } + $total += $subtotal; + + $obj->chkDeadline(); + + // first row displays task information + echo 'filter)?$obj->curCss(($d>1)?'noline':''):($d>1?' class="noline"':'')) + .'>'; + + // checkbox + echo ''; + + // deadline + echo ''; + + echo ''; + + // start and end + if ($d>1) { + // many timer, skip info here + echo ''; + echo ''; + } else { + echo ''; + echo ''; + } + + // subtotal + echo ''; + + echo ''; + + if ($d == 1) { + // no timers defined, skip to next task + continue; + } + + // second loop to display timers + foreach ($arrObj as $obj) { + $id = $obj->getUid(); + $k++; + echo ''; + + // checkbox + echo ''; + // deadline + echo ''; + // title + echo ''; + // start + echo ''; + // stop + echo ''; + // time spent + echo ''; + + echo ''; + } + } + ?> + + + + + + + + +
 deadline + item(s) found + task + startstopspent
'.$obj->htmlDeadline().''; + // edit link + echo 'edit'; + // priority + echo ''.$obj->get('priority').' '; + // note + echo 'isEmpty('note')) { + echo 'class="ajax box clickme"'; + } else { + echo 'class="note ajax box clickme" '; + echo 'title="'.$obj->html('note',200).'"'; + } + echo '>'; + // title + echo $obj->html('title'); + echo ''; + echo '  '.$obj->htmlBegin().''.$obj->htmlEnd().''; + if ($obj->isOpened($this->user_id)) { + echo 'start'; + } + echo TaskSummary::htmlTime($subtotal); + echo '
   '.$obj->htmlBegin().''.$obj->htmlEnd().''.$obj->getTimeSpent().'
+ select all | + actions as $key => $label) { + echo ' '; + } + ?> + TOTAL
+ +No Task found

'; +} diff --git a/app/view/include/page-bot.php b/app/view/include/page-bot.php new file mode 100644 index 0000000..ac7ec31 --- /dev/null +++ b/app/view/include/page-bot.php @@ -0,0 +1,18 @@ + + +
+
+ TaskFreak + TT v0.2 +
+ fc->getHelper('messaging'); + $tmp = $tmp->getMessages($err); + if ($tmp) { + echo $tmp; + } else { + echo '...'; + } + ?> +
diff --git a/app/view/include/page-top.php b/app/view/include/page-top.php new file mode 100644 index 0000000..514f0f1 --- /dev/null +++ b/app/view/include/page-top.php @@ -0,0 +1,43 @@ +current)) { +?> +
current) { + echo ' class="running"'; + } + ?> method="post"> + incView('include/timer'); + ?> +
+ +
+
+

TaskFreak

+
+ fc->user->isLoggedIn()) { + echo $this->fc->user->html('nickname'); + if ($this->fc->getSessionVariable('switch_id') != $this->fc->user->getUid()) { + echo ' as '.varStr::html($this->fc->getSessionVariable('switch_name')); + } + echo '
'; + if ($this->fc->user->checkAcl('task_see_all')) { + echo 'switch | '; + } + if ($this->fc->user->checkAcl('admin_user')) { + echo 'admin | '; + } else { + echo 'profile | '; + } + echo 'logout'; + echo ''; + } else { + echo 'TaskFreak!
Time Tracking'; + } + ?> +
+
+
diff --git a/app/view/include/timer-form.php b/app/view/include/timer-form.php new file mode 100644 index 0000000..e1f5c02 --- /dev/null +++ b/app/view/include/timer-form.php @@ -0,0 +1,37 @@ +timer->iForm('task_timer','post',APP_WWW_URI.'timer/main'); +?> + +
    +
  1. + + +
  2. +
  3. + + +
  4. +
  5. + + +
  6. +
  7. + + +
  8. +
  9. + + reset +
  10. +
+
+
+

Enter either :

+
    +
  • A start time only (will calculate time from then until now)
  • +
  • A time spent only (will consider you've just finished the task)
  • +
  • A start time and an stop time
  • +
  • A start time and a time spent
  • +
  • A stop time and a time spent
  • +
+
\ No newline at end of file diff --git a/app/view/include/timer-list.php b/app/view/include/timer-list.php new file mode 100644 index 0000000..a704c49 --- /dev/null +++ b/app/view/include/timer-list.php @@ -0,0 +1,47 @@ +data->get('spent')) { +?> + + + + + + + + + + $this->data->getUid(), + 'start' => $this->data->get('start') + ); + $total += $this->data->get('spent'); + echo ''; + // start + echo ''; + // stop + echo ''; + // time spent + echo ''; + echo ''; + } while ($this->data->next()); + ?> + + + + + + + +
startstopspent
'.$this->data->htmlBegin().''.$this->data->htmlEnd().''; + echo 'delete'; + echo $this->data->getTimeSpent(); + echo '
Total
+No timers yet

'; +} +?> +

Report more time spent

\ No newline at end of file diff --git a/app/view/include/timer.php b/app/view/include/timer.php new file mode 100644 index 0000000..6b10dc7 --- /dev/null +++ b/app/view/include/timer.php @@ -0,0 +1,45 @@ +current) { +?> +
+ current->isEmpty('stop')) { + // task is running + ?> + + + + + + + +
+

+ + + current->getRealSpent(); ?> + current->html('title'); ?> +

+ +
+ + +
+

+ +

+jsCode)) { + echo ''; +} +?> \ No newline at end of file diff --git a/app/view/login/login.php b/app/view/login/login.php new file mode 100644 index 0000000..b0062bb --- /dev/null +++ b/app/view/login/login.php @@ -0,0 +1,30 @@ +incView('include/page-top', false); +?> +
+ fc->user->getAuthError()) { + echo '

Can not login: '.VarStr::html($str).'

'; + } + ?> +
    +
  1. + + fc->user->iText('username'); ?> +
  2. +
  3. + + fc->user->iPass('password'); ?> +
  4. +
  5. + +
  6. +
+
+fc->user->htmlAllErrors(); + echo $this->fc->user; +} + +$this->incView('include/page-bot', false); \ No newline at end of file diff --git a/app/view/main.php b/app/view/main.php new file mode 100644 index 0000000..3a7b5e4 --- /dev/null +++ b/app/view/main.php @@ -0,0 +1,66 @@ +incView('include/page-top', false); +?> +
+
+ + Create task + Create multiple + Reload + + + + + +
+
+ expand) { + $this->incView('include/list-expand'); + } else { + $this->incView('include/list-compact'); + } + ?> +
+
+incView('include/page-bot', false); diff --git a/app/view/view.php b/app/view/view.php new file mode 100644 index 0000000..4079c3d --- /dev/null +++ b/app/view/view.php @@ -0,0 +1,64 @@ +incView('include/page-top', false); +?> +

data->html('title'); ?>

+
+ +
+ + + + + + + + + + + + + + + data->isEmpty('note')) { + ?> + + + + + + +
deadlinedata->htmlDeadline(); ?>
prioritydata->htmlPriority(); ?>
statusdata->htmlStatus(); ?>
notedata->html('note'); ?>
+
+
+ incView('include/timer-list'); + ?> +
+
+ incView('include/timer-form'); + ?> +
+
+ + + +incView('include/page-bot', false); diff --git a/asset/css/form.css b/asset/css/form.css new file mode 100644 index 0000000..39cf570 --- /dev/null +++ b/asset/css/form.css @@ -0,0 +1,297 @@ +/** + * fields should always be under a OL.fields + * OL.side will show labels on the left + * OL.multicol may have multi columns + * -> LI.newrow stars a new row + * SPAN.error for error messages + */ + +/* layout */ +ol.fields { + list-style: none; + padding: 0 0 5px 5px; +} +ol.lined li { + border-bottom: 1px solid #eee; +} +ol li.linefree { + border-bottom: 0px none; +} +ol.side li { + padding-top: 2px; + padding-bottom: 6px; +} +ol.side li label { + float: left; + width: 120px; + padding: 2px 0 0 4px; + color: #333; +} +ol.top li label { + display: block; +} +ol.fields li.compulsory { +} +ol.fields li.compulsory label { + /* color: #600; */ + background: transparent url(../img/compulsory.png) no-repeat right top; +} +ol.fields li span, ol.fields li small.nline { + padding: 2px 0 0 4px; +} +ol.fields li span.ui-icon { + padding: 0; +} +ol.side li span, ol.side li small.nline { + display: block; + margin-left: 120px; +} +ol.fields li.buttons { + border-bottom: 0px none; +} +ol.side li.buttons { + padding-left: 122px; +} +ol.fields ul { + clear: left; + list-style: none; +} +ol.fields ul li { + border-bottom: 0 none; +} +ol.fields li.inline { + padding: 6px 4px; +} +ol.fields li.inline span { + display: inline; +} +ol.side ul { + margin: 0 0 -18px 100px; + position:relative; + top:-18px; +} +ol.side ul li label, ol li.inline label { + padding: 0; + width: auto; + float: none; + display: inline; +} +ol.multicol li { + float: left; + margin-left: 12px; +} +ol.multicol li.nline { + clear: left; + margin-left: 0; +} +ol.side li strong { + display: block; + padding-left: 124px; +} +ol.side li span.error { + display: block; + /* padding-left: 124px; */ + font-size: .917em; + color: #900; +} +/* fields */ +input, textarea, option { + font-style: Helvetica, Arial, sans-serif; + font-size: 1em; +} +ol.styled input, ol.styled select, ol.styled textarea { + padding: 2px; + border: 2px solid #666; + background-color: #fff; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +ol.styled input:focus, ol.styled select:focus, ol.styled textarea:focus { + border-color: #333; + outline: none; +} +.wxxs { + width: 30px; +} +.wxs { + width: 50px; +} +.ws { + width: 80px; +} +.wm { + width: 120px; +} +.wl { + width: 250px; +} +.wxl { + width: 400px; +} +.wxxl { + width: 99%; +} +textarea.hs { + height: 50px; +} +textarea.hm { + height: 100px; +} +textarea.hl { + height: 200px; +} +textarea.hxl { + height: 350px; +} +input.fake, textarea.fake { + border: 1px solid transparent; +} +input.file { + border: 0 none; +} +input.red, textarea.red { + border: 1px solid #933; + background-color: #fff3f3; +} +input.date { + width: 80px; +} +input.time, input.duration { + width: 60px; +} +ol.fields li span.dateEntry_wrap, ol.fields li span.timeEntry_wrap { + padding: 0; + margin-left: 3px; + display: inline; +} +ol.fields li span.dateEntry_control, ol.fields li span.timeEntry_control { + padding: 0; + margin: 0 0 0 3px; + display: inline; +} +/* captcha */ +ol li.form_captcha { +} +ol li.form_captcha span.cms_captcha { + display:block; + margin: 0 0 12px 0; + width: 360px; + height: 40px; + border: 2px solid #369; + background-color: #fff; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +ol li.form_captcha span.cms_captcha img { + float: left; +} +ol li.form_captcha span.cms_captcha input { + float: left; + border: 0 none; + border-left: 2px dotted #69c; + width: 140px; + height: 24px; + padding: 8px 5px; + vertical-align: middle; +} +ol li.form_captcha span.tznError { + display: block; + padding: 3px 0; + font-size: 1em; + color: #900; +} +ol.fields li.form_captcha span.cms_captcha { + margin: 0 0 12px 122px; +} +/* buttons */ +button, a.button { + color: #333; + font-size: 12px; + border: 1px solid #ccc; + padding: 1px 4px; + /* height: 22px; */ + background-image: url(../img/bg-buttons.png); + background-position: 0 0; + background-repeat: repeat-x; + text-decoration: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +a.button { + padding: 2px 4px; + height: auto; +} +button:hover, a.button:hover, button:focus, a.button:focus { + color: #000; + border-color: #999; + cursor: pointer; +} +button.create, a.create { + background-position: -30px -22px; +} +button.submit, a.submit { + background-position: -30px -22px; +} +button.save { + padding-left: 30px; + background-position: 0 -22px; +} +button.saveclose { + padding-left: 30px; + background-position: 0 -44px; +} +button.saveadd { + padding-left: 30px; + background-position: 0 -66px; +} +button.delete, a.delete { + padding-left: 30px; + background-position: 0 -88px; +} +button.warn, a.warn { + background-position: -30px -88px; +} +.close { + margin-left: 10px; + padding: 0 4px 2px 10px; + background: transparent url(../img/cross.png) no-repeat left center; +} +a.close { + color: #333; + text-decoration: underline; +} +a.close:hover { + color: #000; +} +.faded { + opacity: 0.3; + -moz-opacity: 0.3; + filter: alpha(opacity=30); +} +.marge { + margin-left: 10px; +} +/* +#ajax-load { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0.7; + -moz-opacity: 0.7; + filter: alpha(opacity=70); + background: #fff url(../img/loading.gif) no-repeat center center; + z-index: 200; + behavior: url(/assets/css/iedivfix.htc); +} +.loading { + opacity: 0.5; + -moz-opacity: 0.5; + filter: alpha(opacity=50); + background: url(../img/loading.gif) no-repeat center center; +} +*/ \ No newline at end of file diff --git a/asset/html/page-footer.php b/asset/html/page-footer.php new file mode 100644 index 0000000..052264a --- /dev/null +++ b/asset/html/page-footer.php @@ -0,0 +1,3 @@ +callHelper('html_asset','footerStuff'); ?> + + \ No newline at end of file diff --git a/asset/html/page-header.php b/asset/html/page-header.php new file mode 100644 index 0000000..e605b74 --- /dev/null +++ b/asset/html/page-header.php @@ -0,0 +1,22 @@ + + + + +<?php echo $this->html('title'); ?> +isEmpty('description')) { +?> + +isEmpty('keywords')) { +?> + + + +callHelper('html_asset','headerStuff'); ?> + + diff --git a/asset/img/bg-buttons.png b/asset/img/bg-buttons.png new file mode 100644 index 0000000..c1f2d9f Binary files /dev/null and b/asset/img/bg-buttons.png differ diff --git a/asset/img/close.gif b/asset/img/close.gif new file mode 100644 index 0000000..cc21992 Binary files /dev/null and b/asset/img/close.gif differ diff --git a/asset/img/closebox.gif b/asset/img/closebox.gif new file mode 100644 index 0000000..4a75a44 Binary files /dev/null and b/asset/img/closebox.gif differ diff --git a/asset/img/closebox.png b/asset/img/closebox.png new file mode 100644 index 0000000..4de4396 Binary files /dev/null and b/asset/img/closebox.png differ diff --git a/asset/img/compulsory.png b/asset/img/compulsory.png new file mode 100644 index 0000000..f89b066 Binary files /dev/null and b/asset/img/compulsory.png differ diff --git a/asset/img/cross.png b/asset/img/cross.png new file mode 100644 index 0000000..a547fe6 Binary files /dev/null and b/asset/img/cross.png differ diff --git a/asset/img/loading.gif b/asset/img/loading.gif new file mode 100644 index 0000000..46d28e7 Binary files /dev/null and b/asset/img/loading.gif differ diff --git a/asset/img/spinner.gif b/asset/img/spinner.gif new file mode 100644 index 0000000..88fac73 Binary files /dev/null and b/asset/img/spinner.gif differ diff --git a/asset/img/spinnerOrange.png b/asset/img/spinnerOrange.png new file mode 100644 index 0000000..6419e81 Binary files /dev/null and b/asset/img/spinnerOrange.png differ diff --git a/asset/img/spinnerOrangeBig.png b/asset/img/spinnerOrangeBig.png new file mode 100644 index 0000000..a3f050c Binary files /dev/null and b/asset/img/spinnerOrangeBig.png differ diff --git a/asset/img/spinnerSquare.png b/asset/img/spinnerSquare.png new file mode 100644 index 0000000..9292800 Binary files /dev/null and b/asset/img/spinnerSquare.png differ diff --git a/asset/img/vtip_arrow.png b/asset/img/vtip_arrow.png new file mode 100755 index 0000000..672d1cb Binary files /dev/null and b/asset/img/vtip_arrow.png differ diff --git a/asset/js/freak.js b/asset/js/freak.js new file mode 100644 index 0000000..9a24b1f --- /dev/null +++ b/asset/js/freak.js @@ -0,0 +1,270 @@ +var AUTORELOAD=300000; +var AUTODELAY=60000; +var arelc=0; +var alive; +var timer; +var watch; + +function reloadList() { + // console.log('reloading list...'); + stopAlive(); + jQuery.ajax({ + url: "/task/main/ajax/1", + type: "get", + dataType: "html", + success: function(html){ + $("#dlist").empty(); + $("#dlist").html(html); + $('#dlist *[title]').wTip(); + $('a.ajax').makeajax(); + $('#dlist table tbody tr td').makeClickable(); + startAlive(AUTORELOAD); + } + }); +} + +function reloadTimers(id) { + jQuery.ajax({ + url: "/timer/main/id/"+id+"/ajax/1", + type: "get", + dataType: "html", + success: function(html){ + $('a.ajax').makeajax(); + } + }); +} + +function checkAll(id) { + $('#'+id+' input:checkbox').attr("checked", "checked"); +} + +function timertostring(t) { + h = Math.floor(t / 3600); + m = Math.floor(t / 60) - (h*60); + s = t - (h*3600 + m*60); + d = (h<10)?('0'+h):h; + d += ':'+((m<10)?('0'+m):m); + d += ':'+((s<10)?('0'+s):s); + return d; +} + +function ticking() { + $('#dtimer').html(timertostring(++timer)); +} + +function clockstart(id) { + if (id) { + // starting a task from list + timer = 0; + el = $('#tr_'+id); + if (el[0]) { + $('#dlist table tbody tr').removeClass('current'); + el.addClass('current'); + $('#sts_'+id+' span').html('running'); + } + } else { + timer = $('#i_timer').val(); + } + watch = window.setInterval('ticking()',1000); + clockstatus('running'); +} + +function clockstop() { + clearInterval(watch); +} +function clockreport(id) { + clearInterval(watch); + $('#sts_'+id+' span').html(timertostring(timer)); +} +function clockstatus(cl) { + $('#drun').removeClass('running paused'); + $('#drun').addClass(cl); +} +$(document).ready(function(){ + + $('*[title]').wTip(); + bindAjax(); + + $('input:first').focus(); + $('.focus:first').focus(); + if ($('#drun.running').length) { + clockstart(); + } + + // bind form using 'ajaxForm' + $('#drun').ajaxForm({ + target: '#drun', + data: {'ajax':'1'}, + beforeSubmit: clockstop, + complete: function() { + $('#drun input').focus(); + } + }); + + // bind ajax links + $('a.ajax').makeajax(); + + // bind rows/td clicks + $('#dlist table tbody tr td').makeClickable(); + + // focus on first field when opening a cbox + $(document).bind('cbox_complete', function(){ + $('#cboxLoadedContent :input').not(':hidden').first().focus(); + }); + + // reload task list every 5 minutes + startAlive(AUTORELOAD); +}); + +function startAlive(d) { + if ($('#dlist.tasks')[0]) { + // console.log('start alive (delay = '+d+')'); + alive = window.setTimeout('stayingAlive()',d); + } +} +function stopAlive() { + // console.log('clear alive !'); + clearTimeout(alive); +} + +function stayingAlive() { + /* + var currentTime = new Date(); + console.log('staying alive @ '+currentTime.getHours()+':'+currentTime.getMinutes()+':'+currentTime.getSeconds()); + */ + el = $('#colorbox'); + if (el[0] && el.css('display') == 'block') { + // something is being done, + startAlive(AUTODELAY); + } else { + if (arelc++ > 100) { + // full reload to prevent script oveclocking + // it seems that after a few calls some browser start to shake + window.location.reload(); + } else { + reloadList(); + } + } +} + +jQuery.fn.makeClickable = function() { + return this.each(function() { + $(this).click(function(e) { + if (e.target.nodeName == 'A') { + return true; + } + el = $(this); + //first try to find a clickme link + ei = el.find('a.clickme'); + if (ei[0]) { + ei.click(); + return true; + } + $(this).find('a:visible').first().click(); + }) + }); +} + +function bindAjax() { + $('#timerstatus').ajaxStart(function() { + // window.clearInterval(alive); + $(this).addClass('loading'); + }); + $('#timerstatus').ajaxStop(function(){ + $(this).removeClass('loading'); + // alive = window.setInterval('stayingalive()',10000); + }); + // $(document).ajaxComplete(bindAjax); +} + +jQuery.fn.makeajax = function(boxed) { + return this.each(function() { + if (!this.href.match(/(ajax\/1)/)) { + this.href = this.href+'/ajax/1'; + el = $(this); + if (el.hasClass('bigbox')) { + el.colorbox({title:'...',width:"700", height:"400"}); + } else if (el.hasClass('box')) { + el.colorbox({title:'...',width:"400", height:"400"}); + } else { + el.ajaxify(); + } + } + }); +}; + +jQuery.fn.ajaxify = function(target) { + return this.each(function() { + $(this).click(function(e) { + e.preventDefault(); + el = $(this); + if (el.hasClass('confirm')) { + if (!confirm('Really delete this task ?')) { + return false; + } + } + rel = el.attr('rel'); + jQuery.ajax({ + url: this.href, + type: "get", + dataType: "html", + success: function(html){ + if (rel) { + $('#'+rel).html(html); + } else { + $("#dlist").append(html); + } + } + }); + }); + }); +} +/* jQuery Form Plugin */ +;(function($){$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this}if(typeof options=='function')options={success:options};var url=$.trim(this.attr('action'));if(url){url=(url.match(/^([^#]+)/)||[])[1]}url=url||window.location.href||'';options=$.extend({url:url,type:this.attr('method')||'GET',iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},options||{});var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this}var a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(var n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n])a.push({name:n,value:options.data[n][k]})}else a.push({name:n,value:options.data[n]})}}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this}this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this}var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null}else options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm()});if(options.clearForm)callbacks.push(function(){$form.clearForm()});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(oldSuccess,arguments)})}else if(options.success)callbacks.push(options.success);options.success=function(data,status,xhr){for(var i=0,max=callbacks.length;i');var io=$io[0];$io.css({position:'absolute',top:'-1000px',left:'-1000px'});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;$io.attr('src',opts.iframeSrc)}};var g=opts.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,opts]);if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&$.active--;return}if(xhr.aborted)return;var cbInvoked=false;var timedOut=0;var sub=form.clk;if(sub){var n=sub.name;if(n&&!sub.disabled){opts.extraData=opts.extraData||{};opts.extraData[n]=sub.value;if(sub.type=="image"){opts.extraData[n+'.x']=form.clk_x;opts.extraData[n+'.y']=form.clk_y}}}function doSubmit(){var t=$form.attr('target'),a=$form.attr('action');form.setAttribute('target',id);if(form.getAttribute('method')!='POST')form.setAttribute('method','POST');if(form.getAttribute('action')!=opts.url)form.setAttribute('action',opts.url);if(!opts.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'})}if(opts.timeout)setTimeout(function(){timedOut=true;cb()},opts.timeout);var extraInputs=[];try{if(opts.extraData)for(var n in opts.extraData)extraInputs.push($('').appendTo(form)[0]);$io.appendTo('body');$io.data('form-plugin-onload',cb);form.submit()}finally{form.setAttribute('action',a);t?form.setAttribute('target',t):$form.removeAttr('target');$(extraInputs).remove()}};if(opts.forceSync)doSubmit();else setTimeout(doSubmit,10);var domCheckCount=100;function cb(){if(cbInvoked)return;var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;var isXml=opts.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&(doc.body==null||doc.body.innerHTML=='')){if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return}log('Could not access iframe DOM after 100 tries.');return}log('response detected');cbInvoked=true;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;xhr.getResponseHeader=function(header){var headers={'content-type':opts.dataType};return headers[header]};if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];if(ta)xhr.responseText=ta.value;else{var pre=doc.getElementsByTagName('pre')[0];if(pre)xhr.responseText=pre.innerHTML}}else if(opts.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText)}data=$.httpData(xhr,opts.dataType)}catch(e){log('error caught:',e);ok=false;xhr.error=e;$.handleError(opts,xhr,'error',e)}if(ok){opts.success(data,'success');if(g)$.event.trigger("ajaxSuccess",[xhr,opts])}if(g)$.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(opts.complete)opts.complete(xhr,ok?'success':'error');setTimeout(function(){$io.removeData('form-plugin-onload');$io.remove();xhr.responseXML=null},100)};function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s)}else doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.tagName!='parsererror')?doc:null}}};$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().bind('submit.form-plugin',function(e){e.preventDefault();$(this).ajaxSubmit(options)}).bind('click.form-plugin',function(e){var target=e.target;var $el=$(target);if(!($el.is(":submit,input:image"))){var t=$el.closest(':submit');if(t.length==0)return;target=t[0]}var form=this;form.clk=target;if(target.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop}}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null},100)})};$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin')};$.fn.formToArray=function(semantic){var a=[];if(this.length==0)return a;var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els)return a;for(var i=0,max=els.length;i1)if(d.keyCode===37){d.preventDefault();D.click()}else if(d.keyCode===39){d.preventDefault();E.click()}});a.overlayClose&&s.css({cursor:"pointer"}).one("click",e.close);c.event.trigger(aa); a.onOpen&&a.onOpen.call(i);s.css({opacity:a.opacity}).show();a.w=r(a.initialWidth,"x");a.h=r(a.initialHeight,"y");e.position(0);O&&m.bind("resize.cboxie6 scroll.cboxie6",function(){s.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll.cboxie6")}P.add(D).add(E).add(t).add(Q).hide();R.html(a.close).show();e.slideshow();e.load()}var q="colorbox",F="hover",n=true,e,x=c.browser.msie&&!c.support.opacity,O=x&&c.browser.version<7,aa="cbox_open",H="cbox_load",S= "cbox_complete",T="resize.cbox_resize",s,k,u,p,U,V,W,X,g,m,l,I,J,K,Q,P,t,E,D,R,y,z,v,w,i,N,j,a,B,C,$={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,scalePhotos:n,scrolling:n,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:n,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:n, slideshow:false,slideshowAuto:n,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};e=c.fn.colorbox=function(b,d){var h=this;if(!h.length)if(h.selector===""){h=c("");b.open=n}else return this;h.each(function(){var f=c.extend({},c(this).data(q)?c(this).data(q):$,b);c(this).data(q,f).addClass("cboxElement");if(d)c(this).data(q).onComplete=d});b&&b.open&&Z(h);return this};e.init=function(){function b(d){return c('
')}m=c(window);k=c('
');s=b("Overlay").hide();u=b("Wrapper");p=b("Content").append(l=b("LoadedContent").css({width:0,height:0}),J=b("LoadingOverlay"),K=b("LoadingGraphic"),Q=b("Title"),P=b("Current"),t=b("Slideshow"),E=b("Next"),D=b("Previous"),R=b("Close"));u.append(c("
").append(b("TopLeft"),U=b("TopCenter"),b("TopRight")),c("
").append(V=b("MiddleLeft"),p,W=b("MiddleRight")),c("
").append(b("BottomLeft"),X=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"}); I=c("
");c("body").prepend(s,k.append(u,I));if(x){k.addClass("cboxIE");O&&s.css("position","absolute")}p.children().bind("mouseover mouseout",function(){c(this).toggleClass(F)}).addClass(F);y=U.height()+X.height()+p.outerHeight(n)-p.height();z=V.width()+W.width()+p.outerWidth(n)-p.width();v=l.outerHeight(n);w=l.outerWidth(n);k.css({"padding-bottom":y,"padding-right":z}).hide();E.click(e.next);D.click(e.prev);R.click(e.close);p.children().removeClass(F); c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined")return n;else{Z(this);return false}})};e.position=function(b,d){function h(A){U[0].style.width=X[0].style.width=p[0].style.width=A.style.width;K[0].style.height=J[0].style.height=p[0].style.height=V[0].style.height=W[0].style.height=A.style.height}var f=m.height();f=Math.max(f-a.h-v-y,0)/2+m.scrollTop();var o=Math.max(document.documentElement.clientWidth-a.w-w-z,0)/2+m.scrollLeft();b=k.width()===a.w+w&&k.height()=== a.h+v?0:b;u[0].style.width=u[0].style.height="9999px";k.dequeue().animate({width:a.w+w,height:a.h+v,top:f,left:o},{duration:b,complete:function(){h(this);C=false;u[0].style.width=a.w+w+z+"px";u[0].style.height=a.h+v+y+"px";d&&d()},step:function(){h(this)}})};e.resize=function(b){function d(){a.w=a.w||l.width();a.w=a.mw&&a.mw");l.show();Q.show().html(a.title);if(g.length>1){P.html(a.current.replace(/\{current\}/,j+1).replace(/\{total\}/,g.length)).show();E.html(a.next).show();D.html(a.previous).show();a.slideshow&&t.show()}J.hide();K.hide();c.event.trigger(S);a.onComplete&&a.onComplete.call(i);a.transition==="fade"&&k.fadeTo(L,1,function(){x&&k[0].style.removeAttribute("filter")}); m.bind(T,function(){e.position(0)})}})}if(B){var o,A,L=a.transition==="none"?0:a.speed;m.unbind(T);if(b){l.remove();l=c('
').html(b);l.hide().appendTo(I).css({width:d(),overflow:a.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});O&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition=== "fade"&&k.fadeTo(L,0,function(){f(0)})||f(L);if(a.preloading&&g.length>1){b=j>0?g[j-1]:g[g.length-1];o=j").attr("src",o);M(b)&&c("").attr("src",b)}}else setTimeout(function(){var G=l.wrapInner("
").children();a.h=G.height();l.css({height:a.h});G.replaceWith(G.children());e.position(L)},1)}};e.load=function(){var b,d,h,f=e.resize;C=n;i=g[j];a=c.extend({},c(i).data(q)); Y();c.event.trigger(H);a.onLoad&&a.onLoad.call(i);a.h=a.height?r(a.height,"y")-v-y:a.innerHeight?r(a.innerHeight,"y"):false;a.w=a.width?r(a.width,"x")-w-z:a.innerWidth?r(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=r(a.maxWidth,"x")-w-z;a.mw=a.w&&a.w').hide().insertBefore(c(b)[0]).bind(H+" cbox_cleanup",function(){c(this).replaceWith(l.children())}); f(c(b))}else if(a.iframe)f(" ");else if(a.html)f(a.html);else if(M(b)){d=new Image;d.onload=function(){var o;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){h=function(){d.height-=d.height*o;d.width-=d.width*o};if(a.mw&&d.width>a.mw){o=(d.width-a.mw)/d.width;h()}if(a.mh&&d.height>a.mh){o=(d.height-a.mh)/d.height;h()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";f(d);g.length>1&&c(d).css({cursor:"pointer"}).click(e.next); if(x)d.style.msInterpolationMode="bicubic"};d.src=b}else c("
").appendTo(I).load(b,function(o,A){A==="success"?f(this):f(c("

Request unsuccessful.

"))})};e.next=function(){if(!C){j=j0?j-1:g.length-1;e.load()}};e.slideshow=function(){function b(){t.text(a.slideshowStop).bind(S,function(){h=setTimeout(e.next,a.slideshowSpeed)}).bind(H,function(){clearTimeout(h)}).one("click",function(){d();c(this).removeClass(F)});k.removeClass(f+ "off").addClass(f+"on")}var d,h,f="cboxSlideshow_";t.bind("cbox_closed",function(){t.unbind();clearTimeout(h);k.removeClass(f+"off "+f+"on")});d=function(){clearTimeout(h);t.text(a.slideshowStart).unbind(S+" "+H).one("click",function(){b();h=setTimeout(e.next,a.slideshowSpeed);c(this).removeClass(F)});k.removeClass(f+"on").addClass(f+"off")};if(a.slideshow&&g.length>1)a.slideshowAuto?b():d()};e.close=function(){c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(i);B=false;c(document).unbind("keydown.cbox_close keydown.cbox_arrows"); m.unbind(T+" resize.cboxie6 scroll.cboxie6");s.css({cursor:"auto"}).fadeOut("fast");k.stop(n,false).fadeOut("fast",function(){c("#colorbox iframe").attr("src","about:blank");l.remove();k.css({opacity:1});try{N.focus()}catch(b){}c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(i)})};e.element=function(){return c(i)};e.settings=$;c(e.init)})(jQuery); + +/* Yetii - Yet (E)Another Tab Interface Implementation,version 1.6,http://www.kminek.pl/lab/yetii/, +Copyright (c) Grzegorz Wojcik,Code licensed under the BSD License: http://www.kminek.pl/bsdlicense.txt */ +function Yetii(){this.defaults={id:null,active:1,interval:null,wait:null,persist:null,tabclass:'tab',activeclass:'active',callback:null,leavecallback:null};this.activebackup=null;for(var n in arguments[0]){this.defaults[n]=arguments[0][n]};this.getTabs=function(){var a=[];var b=document.getElementById(this.defaults.id).getElementsByTagName('*');var c=new RegExp("(^|\\s)"+this.defaults.tabclass.replace(/\-/g,"\\-")+"(\\s|$)");for(var i=0;ithis.tabs.length)this.defaults.active=1;var b=this;if(this.defaults.wait)clearTimeout(this.timer2);this.timer1=setTimeout(function(){b.rotate(a)},a*1000)};this.next=function(){var a=(this.defaults.active+1>this.tabs.length)?1:this.defaults.active+1;this.show(a);this.defaults.active=a};this.previous=function(){var a=((this.defaults.active-1)==0)?this.tabs.length:this.defaults.active-1;this.show(a);this.defaults.active=a};this.previous=function(){this.defaults.active--;if(!this.defaults.active)this.defaults.active=this.tabs.length;this.show(this.defaults.active)};this.gup=function(a){a=a.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var b="[\\?&]"+a+"=([^&#]*)";var c=new RegExp(b);var d=c.exec(window.location.href);if(d==null)return null;else return d[1]};this.parseurl=function(a){var b=this.gup(a);if(b==null)return null;if(parseInt(b))return parseInt(b);if(document.getElementById(b)){for(var i=0;i' + this.t + '

' ); + $('p#vtip #vtipArrow').attr("src", '/asset/img/vtip_arrow.png'); + $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("slow"); + }, + function() { + this.title = this.t; + $("p#vtip").fadeOut("slow").remove(); + } + ).mousemove( + function(e) { + el = $("p#vtip"); + if (el.hasClass('inv')) { + this.left = (e.pageX + xOffinv); + } else { + this.left = (e.pageX + xOffset); + } + this.top = (e.pageY + yOffset); + el.css("top", this.top+"px").css("left", this.left+"px"); + } + ); + }); +}; \ No newline at end of file diff --git a/asset/js/jquery-1.4.2.min.js b/asset/js/jquery-1.4.2.min.js new file mode 100644 index 0000000..7c24308 --- /dev/null +++ b/asset/js/jquery-1.4.2.min.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * 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: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(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 X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},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 f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)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 Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(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(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.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,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +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:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.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 fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=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 h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.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,h,l){return!!k(l[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,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="
"; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},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){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},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,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===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 Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"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!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).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,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}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,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});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||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).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,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},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,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},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:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+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);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},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=J(),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 f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,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.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;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.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.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(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/asset/js/jquery.colorbox-min.js b/asset/js/jquery.colorbox-min.js new file mode 100755 index 0000000..ec76aa9 --- /dev/null +++ b/asset/js/jquery.colorbox-min.js @@ -0,0 +1,2 @@ +/* ColorBox v1.3.6 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 */ +(function(c){function r(b,d){d=d==="x"?m.width():m.height();return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function M(b){b=c.isFunction(b)?b.call(i):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function Y(){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!=="on")a[b]=a[b].call(i);a.rel=a.rel||i.rel;a.href=a.href||i.href;a.title=a.title||i.title}function Z(b){i=b;a=c.extend({},c(i).data(q));Y();if(a.rel&&a.rel!=="nofollow"){g= c(".cboxElement").filter(function(){return(c(this).data(q).rel||this.rel)===a.rel});j=g.index(i);if(j<0){g=g.add(i);j=g.length-1}}else{g=c(i);j=0}if(!B){C=B=n;N=i;N.blur();c(document).bind("keydown.cbox_close",function(d){if(d.keyCode===27){d.preventDefault();e.close()}}).bind("keydown.cbox_arrows",function(d){if(g.length>1)if(d.keyCode===37){d.preventDefault();D.click()}else if(d.keyCode===39){d.preventDefault();E.click()}});a.overlayClose&&s.css({cursor:"pointer"}).one("click",e.close);c.event.trigger(aa); a.onOpen&&a.onOpen.call(i);s.css({opacity:a.opacity}).show();a.w=r(a.initialWidth,"x");a.h=r(a.initialHeight,"y");e.position(0);O&&m.bind("resize.cboxie6 scroll.cboxie6",function(){s.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll.cboxie6")}P.add(D).add(E).add(t).add(Q).hide();R.html(a.close).show();e.slideshow();e.load()}var q="colorbox",F="hover",n=true,e,x=c.browser.msie&&!c.support.opacity,O=x&&c.browser.version<7,aa="cbox_open",H="cbox_load",S= "cbox_complete",T="resize.cbox_resize",s,k,u,p,U,V,W,X,g,m,l,I,J,K,Q,P,t,E,D,R,y,z,v,w,i,N,j,a,B,C,$={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,scalePhotos:n,scrolling:n,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:n,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:n, slideshow:false,slideshowAuto:n,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};e=c.fn.colorbox=function(b,d){var h=this;if(!h.length)if(h.selector===""){h=c("");b.open=n}else return this;h.each(function(){var f=c.extend({},c(this).data(q)?c(this).data(q):$,b);c(this).data(q,f).addClass("cboxElement");if(d)c(this).data(q).onComplete=d});b&&b.open&&Z(h);return this};e.init=function(){function b(d){return c('
')}m=c(window);k=c('
');s=b("Overlay").hide();u=b("Wrapper");p=b("Content").append(l=b("LoadedContent").css({width:0,height:0}),J=b("LoadingOverlay"),K=b("LoadingGraphic"),Q=b("Title"),P=b("Current"),t=b("Slideshow"),E=b("Next"),D=b("Previous"),R=b("Close"));u.append(c("
").append(b("TopLeft"),U=b("TopCenter"),b("TopRight")),c("
").append(V=b("MiddleLeft"),p,W=b("MiddleRight")),c("
").append(b("BottomLeft"),X=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"}); I=c("
");c("body").prepend(s,k.append(u,I));if(x){k.addClass("cboxIE");O&&s.css("position","absolute")}p.children().bind("mouseover mouseout",function(){c(this).toggleClass(F)}).addClass(F);y=U.height()+X.height()+p.outerHeight(n)-p.height();z=V.width()+W.width()+p.outerWidth(n)-p.width();v=l.outerHeight(n);w=l.outerWidth(n);k.css({"padding-bottom":y,"padding-right":z}).hide();E.click(e.next);D.click(e.prev);R.click(e.close);p.children().removeClass(F); c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined")return n;else{Z(this);return false}})};e.position=function(b,d){function h(A){U[0].style.width=X[0].style.width=p[0].style.width=A.style.width;K[0].style.height=J[0].style.height=p[0].style.height=V[0].style.height=W[0].style.height=A.style.height}var f=m.height();f=Math.max(f-a.h-v-y,0)/2+m.scrollTop();var o=Math.max(document.documentElement.clientWidth-a.w-w-z,0)/2+m.scrollLeft();b=k.width()===a.w+w&&k.height()=== a.h+v?0:b;u[0].style.width=u[0].style.height="9999px";k.dequeue().animate({width:a.w+w,height:a.h+v,top:f,left:o},{duration:b,complete:function(){h(this);C=false;u[0].style.width=a.w+w+z+"px";u[0].style.height=a.h+v+y+"px";d&&d()},step:function(){h(this)}})};e.resize=function(b){function d(){a.w=a.w||l.width();a.w=a.mw&&a.mw");l.show();Q.show().html(a.title);if(g.length>1){P.html(a.current.replace(/\{current\}/,j+1).replace(/\{total\}/,g.length)).show();E.html(a.next).show();D.html(a.previous).show();a.slideshow&&t.show()}J.hide();K.hide();c.event.trigger(S);a.onComplete&&a.onComplete.call(i);a.transition==="fade"&&k.fadeTo(L,1,function(){x&&k[0].style.removeAttribute("filter")}); m.bind(T,function(){e.position(0)})}})}if(B){var o,A,L=a.transition==="none"?0:a.speed;m.unbind(T);if(b){l.remove();l=c('
').html(b);l.hide().appendTo(I).css({width:d(),overflow:a.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});O&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition=== "fade"&&k.fadeTo(L,0,function(){f(0)})||f(L);if(a.preloading&&g.length>1){b=j>0?g[j-1]:g[g.length-1];o=j").attr("src",o);M(b)&&c("").attr("src",b)}}else setTimeout(function(){var G=l.wrapInner("
").children();a.h=G.height();l.css({height:a.h});G.replaceWith(G.children());e.position(L)},1)}};e.load=function(){var b,d,h,f=e.resize;C=n;i=g[j];a=c.extend({},c(i).data(q)); Y();c.event.trigger(H);a.onLoad&&a.onLoad.call(i);a.h=a.height?r(a.height,"y")-v-y:a.innerHeight?r(a.innerHeight,"y"):false;a.w=a.width?r(a.width,"x")-w-z:a.innerWidth?r(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=r(a.maxWidth,"x")-w-z;a.mw=a.w&&a.w').hide().insertBefore(c(b)[0]).bind(H+" cbox_cleanup",function(){c(this).replaceWith(l.children())}); f(c(b))}else if(a.iframe)f(" ");else if(a.html)f(a.html);else if(M(b)){d=new Image;d.onload=function(){var o;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){h=function(){d.height-=d.height*o;d.width-=d.width*o};if(a.mw&&d.width>a.mw){o=(d.width-a.mw)/d.width;h()}if(a.mh&&d.height>a.mh){o=(d.height-a.mh)/d.height;h()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";f(d);g.length>1&&c(d).css({cursor:"pointer"}).click(e.next); if(x)d.style.msInterpolationMode="bicubic"};d.src=b}else c("
").appendTo(I).load(b,function(o,A){A==="success"?f(this):f(c("

Request unsuccessful.

"))})};e.next=function(){if(!C){j=j0?j-1:g.length-1;e.load()}};e.slideshow=function(){function b(){t.text(a.slideshowStop).bind(S,function(){h=setTimeout(e.next,a.slideshowSpeed)}).bind(H,function(){clearTimeout(h)}).one("click",function(){d();c(this).removeClass(F)});k.removeClass(f+ "off").addClass(f+"on")}var d,h,f="cboxSlideshow_";t.bind("cbox_closed",function(){t.unbind();clearTimeout(h);k.removeClass(f+"off "+f+"on")});d=function(){clearTimeout(h);t.text(a.slideshowStart).unbind(S+" "+H).one("click",function(){b();h=setTimeout(e.next,a.slideshowSpeed);c(this).removeClass(F)});k.removeClass(f+"on").addClass(f+"off")};if(a.slideshow&&g.length>1)a.slideshowAuto?b():d()};e.close=function(){c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(i);B=false;c(document).unbind("keydown.cbox_close keydown.cbox_arrows"); m.unbind(T+" resize.cboxie6 scroll.cboxie6");s.css({cursor:"auto"}).fadeOut("fast");k.stop(n,false).fadeOut("fast",function(){c("#colorbox iframe").attr("src","about:blank");l.remove();k.css({opacity:1});try{N.focus()}catch(b){}c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(i)})};e.element=function(){return c(i)};e.settings=$;c(e.init)})(jQuery); \ No newline at end of file diff --git a/asset/js/jquery.dateentry.pack.js b/asset/js/jquery.dateentry.pack.js new file mode 100644 index 0000000..4c2d107 --- /dev/null +++ b/asset/js/jquery.dateentry.pack.js @@ -0,0 +1,10 @@ +/* http://keith-wood.name/dateEntry.html + Date entry for jQuery v1.0.5. + Written by Keith Wood (kbwood{at}iinet.com.au) March 2009. + Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and + MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. + Please attribute the author if you use it. */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(r($){r 1o(){q.11=[];q.23=[];q.23[\'\']={13:\'3K/\',1E:[\'3L\',\'3M\',\'3N\',\'3O\',\'2A\',\'3P\',\'3Q\',\'3R\',\'3S\',\'3T\',\'3U\',\'3V\'],1F:[\'3W\',\'3X\',\'3Y\',\'3Z\',\'2A\',\'41\',\'42\',\'43\',\'44\',\'45\',\'47\',\'49\'],1G:[\'4a\',\'4b\',\'4c\',\'4d\',\'4e\',\'4f\',\'4g\'],1H:[\'4h\',\'4i\',\'4j\',\'4k\',\'4l\',\'4m\',\'4n\'],2B:[\'4o\',\'4p 2C\',\'4q 2C\',\'4r\',\'4s\']};q.1I={2D:\'\',2E:0,2F:P,24:C,2G:C,2H:C,2I:\'4t.4u\',1p:[20,20,8],2J:\'\',1J:[40,40,16],2K:F,25:[4v,4w],2L:C};$.1q(q.1I,q.23[\'\'])}o m=\'p\';$.1q(1o.2M,{1c:\'4x\',4y:r(a){1K(q.1I,a||{});u q},2N:r(b,c){o d=$(b);t(d.2O(q.1c)){u}o e={};e.1r=$.1q({},c);e.Q=0;e.I=0;e.J=0;e.H=0;e.B=$(b);$.D(b,m,e);o f=q.x(e,\'2I\');o g=q.x(e,\'4z\');o h=q.x(e,\'1p\');o i=q.x(e,\'2D\');o j=(!f?C:$(\'<14 1L="4A" 2P="4B: 4C-4D; \'+\'26: 2Q(\\\'\'+f+\'\\\') 0 0 2R-2S; \'+\'27: \'+h[0]+\'R; 2T: \'+h[1]+\'R;\'+($.K.2U&&$.K.4E<\'1.9\'?\' 2V-U: \'+h[0]+\'R; 2V-4F: \'+(h[1]-18)+\'R;\':\'\')+\'">\'));d.4G(\'<14 1L="4H">\').2W(i?\'<14 1L="4I">\'+i+\'\':\'\').2W(j||\'\');d.4J(q.1c).15(\'28.p\',q.29).15(\'4K.p\',q.2X).15(\'4L.p\',q.2Y).15(\'4M.p\',q.2Z).15(\'4N.p\',q.30);t($.K.2U){d.15(\'B.p\',r(a){$.p.1d(e)})}t($.K.2a){d.15(\'4O.p\',r(a){1M(r(){$.p.1d(e)},1)})}t(q.x(e,\'2F\')&&$.1N.2b){d.2b(q.31)}t(j){j.33(q.2c).2d(q.1O).4P(q.34).2e(q.1O).3a(q.2f)}},4Q:r(a){q.2g(a,F)},4R:r(a){q.2g(a,P)},2g:r(b,c){o d=$.D(b,m);t(!d){u}b.3b=c;t(b.2h&&b.2h.1P.1Q()==\'14\'){$.p.1R(d,b.2h,(c?5:-1))}$.p.11=$.3c($.p.11,r(a){u(a==b?C:a)});t(c){$.p.11.4S(b)}},1s:r(a){u $.3d(a,q.11)>-1},4T:r(a,b,c){o d=$.D(a,m);t(d){o e=b;t(1e b==\'1S\'){e={};e[b]=c}o f=q.1t(d.B.L(),d);1K(d.1r,e||{});t(f){q.17(d,f)}}$.D(a,m,d)},4U:r(b){$B=$(b);t(!$B.2O(q.1c)){u}$B.4V(q.1c).4W(\'.p\');t($.1N.2b){$B.4X()}q.11=$.3c(q.11,r(a){u(a==b?C:a)});$B.4Y().4Z($B);$.50(b,m)},51:r(a,b){o c=$.D(a,m);t(c){q.17(c,b?(1e b==\'52\'?q.M(E G(b.53())):b):C)}},54:r(a){o b=$.D(a,m);u(b?q.1t(b.B.L(),b):C)},29:r(a){o b=(a.1P&&a.1P.1Q()==\'B\'?a:q);t($.p.S==b||$.p.1s(b)){$.p.1T=F;u}o c=$.D(b,m);$.p.1T=P;$.p.S=b;$.p.1f=C;o d=$.p.x(c,\'2L\');1K(c.1r,(d?d.2i(b,[b]):{}));$.D(b,m,c);$.p.1d(c);1M(r(){$.p.1g(c)},10)},2X:r(a){$.p.1f=$.p.S;$.p.S=C},2Y:r(b){o c=b.1h;o d=$.D(c,m);t(!$.p.1T){o e=$.p.x(d,\'13\');d.H=0;t(c.3e!=C){o f=0;1i(o g=0;g<3;g++){f+=$.p.1u(d,g,e)+1;d.H=g;t(c.3e=48){u P}o b=$.D(a.1h,m);1j(a.2m){v 9:u(a.5b?$.p.V(b,-1,P):$.p.V(b,+1,P));v 35:t(a.3i){$.p.1W(b,\'\')}19{b.H=2;$.p.X(b,0)}A;v 36:t(a.3i){$.p.17(b)}19{b.H=0;$.p.X(b,0)}A;v 37:$.p.V(b,-1,F);A;v 38:$.p.X(b,+1);A;v 39:$.p.V(b,+1,F);A;v 40:$.p.X(b,-1);A;v 46:$.p.1W(b,\'\');A}u F},30:r(a){o b=5c.5d(a.3j==5e?a.2m:a.3j);t(b<\' \'){u P}o c=$.D(a.1h,m);$.p.3k(c,b);u F},31:r(a,b){t($.p.1s(a.1h)){u}b=($.K.3l?-b/T.1X(b):($.K.2n?b/T.1X(b):b));o c=$.D(a.1h,m);c.B.28();t(!c.B.L()){$.p.1d(c)}$.p.X(c,b);a.5f()},34:r(b){o c=$.p.1a(b);o d=$.D($.p.1k(c),m);o e=$.p.x(d,\'2J\');t(e){d.1Y=P;o f=$(c).1V();o g=C;$(c).3m().2o(r(){o a=$(q);t(a.1x(\'1y\')==\'5g\'||a.1x(\'1y\')==\'3n\'){g=a.1V()}u!g});o h=$.p.x(d,\'1p\');o i=$.p.x(d,\'1J\');$(\'<3o 1L="5h" 2P="1y: 3n; U: \'+(f.U-(i[0]-h[0])/2-(g?g.U:0))+\'R; 1z: \'+(f.1z-(i[1]-h[1])/2-(g?g.1z:0))+\'R; 27: \'+i[0]+\'R; 2T: \'+i[1]+\'R; 26: 5i 2Q(\'+e+\') 2R-2S 2p 2p; z-5j: 10;">\').33($.p.2c).2d($.p.1O).2e($.p.3p).3a($.p.2f).5k(c)}},1k:r(a){u $(a).5l(\'.\'+$.p.1c)[0]},2f:r(a){o b=$.p.1a(a);o c=$.D($.p.1k(b),m);b.5m=$.p.x(c,\'2B\')[$.p.2q(c,a)]},2c:r(a){o b=$.p.1a(a);o c=$.p.1k(b);t($.p.1s(c)){u}t(c==$.p.1f){$.p.S=c;$.p.1f=C}o d=$.D(c,m);$.p.29(c);o e=$.p.2q(d,a);$.p.1R(d,b,e);$.p.2r(d,e);$.p.Z=C;$.p.1Z=P;o f=$.p.x(d,\'25\');t(e>=3&&f[0]){$.p.Z=1M(r(){$.p.2s(d,e)},f[0]);$(b).3q(\'2e\',$.p.2t).3q(\'2d\',$.p.2t)}},2r:r(a,b){t(!a.B.L()){$.p.1d(a)}1j(b){v 0:q.17(a);A;v 1:q.V(a,-1,F);A;v 2:q.V(a,+1,F);A;v 3:q.X(a,+1);A;v 4:q.X(a,-1);A}},2s:r(a,b){t(!$.p.Z){u}$.p.S=$.p.1f;q.2r(a,b);q.Z=1M(r(){$.p.2s(a,b)},q.x(a,\'25\')[1])},2t:r(a){5n($.p.Z);$.p.Z=C},3p:r(a){$.p.Z=C;o b=$.p.1a(a);o c=$.p.1k(b);o d=$.D(c,m);$(b).5o();d.1Y=F},1O:r(a){$.p.Z=C;o b=$.p.1a(a);o c=$.p.1k(b);o d=$.D(c,m);t(!$.p.1s(c)){$.p.1R(d,b,-1)}t($.p.1Z){$.p.S=$.p.1f}t($.p.S&&$.p.1Z){$.p.1g(d)}$.p.1Z=F},1a:r(a){u a.1h||a.3f},2q:r(a,b){o c=q.1a(b);o d=($.K.3l||$.K.2n?$.p.3r(c):$(c).1V());o e=($.K.2n?$.p.3s(c):[1v.2j.1w||1v.3t.1w,1v.2j.21||1v.3t.21]);o f=q.x(a,\'2K\');o g=(f?3u:b.3g+e[0]-d.U-($.K.2a?2:0));o h=b.5p+e[1]-d.1z-($.K.2a?2:0);o i=q.x(a,(a.1Y?\'1J\':\'1p\'));o j=(f?3u:i[0]-1-g);o k=i[1]-1-h;t(i[2]>0&&T.1X(g-j)<=i[2]&&T.1X(h-k)<=i[2]){u 0}o l=T.2u(g,h,j,k);u(l==g?1:(l==j?2:(l==h?3:4)))},1R:r(a,b,c){$(b).1x(\'26-1y\',\'-\'+((c+1)*q.x(a,(a.1Y?\'1J\':\'1p\'))[0])+\'R 2p\')},3r:r(a){o b=22=0;t(a.3v){b=a.2k;22=a.3w;2v(a=a.3v){o c=b;b+=a.2k;t(b<0){b=c}22+=a.3w}}u{U:b,1z:22}},3s:r(a){o b=F;$(a).3m().2o(r(){b|=$(q).1x(\'1y\')==\'5q\'});t(b){u[0,0]}o c=a.1w;o d=a.21;2v(a=a.5r){c+=a.1w||0;d+=a.21||0}u[c,d]},x:r(a,b){u(a.1r[b]!=C?a.1r[b]:$.p.1I[b])},1d:r(a){o b=q.1t(a.B.L(),a)||q.1A(q.1B(q.x(a,\'24\'),a)||q.M(E G()));a.Q=b.1C();a.I=b.2w();a.J=b.1l();a.1m=\'\';a.H=T.3x(0,T.2u(2,q.x(a,\'2E\')));t(a.B.L()!=\'\'){q.2x(a)}},1t:r(a,b){o c=q.x(b,\'13\');o d=a.3y(E 5s(\'[\\\\\'+c.3z(3).3y(\'\').5t(\'\\\\\')+\']\'));o e=0;o f=0;o g=0;1i(o i=0;i<3;i++){o h=O(d[i],10);h=(3A(h)?0:h);o j=c.1b(i);1j(j){v\'y\':e=h;A;v\'Y\':e=(h%2y)+(E G().1C()-E G().1C()%2y);A;v\'m\':f=h;A;v\'n\':v\'N\':f=$.3d(d[i],q.x(b,(j==\'N\'?\'1E\':\'1F\')))+1;A;v\'w\':v\'W\':t(c.1b(3)==\' \'){d.5u(i,1);h=O(d[i],10)}19{h=O(d[i].3B(q.x(b,(j==\'W\'?\'1G\':\'1H\'))[0].1D+1),10)}h=(3A(h)?0:h);v\'d\':g=h;A}}u(e&&f&&g?q.M(E G(e,f-1,g)):C)},2x:r(a){o b=q.x(a,\'13\');o c=\'\';1i(o i=0;i<3;i++){c+=(i==0?\'\':b.1b(3));o d=b.1b(i);1j(d){v\'y\':c+=q.1n(a.Q);A;v\'Y\':c+=q.1n(a.Q%2y);A;v\'m\':c+=q.1n(a.I+1);A;v\'n\':v\'N\':c+=q.x(a,(d==\'N\'?\'1E\':\'1F\'))[a.I];A;v\'d\':c+=q.1n(a.J);A;v\'w\':v\'W\':c+=q.x(a,(d==\'W\'?\'1G\':\'1H\'))[q.M(E G(a.Q,a.I,a.J)).3C()]+\' \'+q.1n(a.J);A}}q.1W(a,c);q.1g(a)},1g:r(a){o b=a.B[0];t(a.B.5v(\':5w\')||$.p.S!=b){u}o c=q.x(a,\'13\');o d=0;1i(o i=0;id?d:b));a.Q=b.1C();a.I=b.2w();a.J=b.1l();q.2x(a);$.D(a.B[0],m,a)},1B:r(h,i){o j=r(a){o b=E G();b.5C(b.1l()+a);u b};o k=r(a){o b=$.p.1t(a,i);t(b){u b}a=a.1Q();b=E G();o c=b.1C();o d=b.2w();o e=b.1l();o f=/([+-]?[0-9]+)\\s*(d|w|m|y)?/g;o g=f.3E(a);2v(g){1j(g[2]||\'d\'){v\'d\':e+=O(g[1],10);A;v\'w\':e+=O(g[1],10)*7;A;v\'m\':d+=O(g[1],10);A;v\'y\':c+=O(g[1],10);A}g=f.3E(a)}u $.p.M(E G(c,d,e))};u(h?(1e h==\'1S\'?k(h):(1e h==\'5D\'?j(h):h)):C)},1A:r(a){t(!a){u C}a.3F(0);a.5E(0);a.5F(0);a.5G(0);u q.M(a)},M:r(a){t(!a)u C;a.3F(a.3G()>12?a.3G()+2:0);u a},3k:r(a,b){o c=q.x(a,\'13\');t(c.3z(3).5H(b)>-1){q.V(a,+1,F)}19 t(b>=\'0\'&&b<=\'9\'){o d=c.1b(a.H);o e=O(b,10);o f=O((a.1m||\'\')+b,10);o g=(d!=\'y\'&&d!=\'Y\'?a.Q:f);o h=(d!=\'m\'&&d!=\'n\'&&d!=\'N\'?a.I+1:(f>=1&&f<=12?f:(e>0?e:a.I+1)));o i=(d!=\'d\'&&d!=\'w\'&&d!=\'W\'?a.J:(f>=1&&f<=q.2z(g,h-1)?f:(e>0?e:a.J)));q.17(a,q.M(E G(g,h-1,i)));a.1m=(d!=\'y\'?\'\':a.1m.3B(T.3x(0,a.1m.1D-2)))+b}}});r 1K(a,b){$.1q(a,b);1i(o c 5I b){t(b[c]==C){a[c]=C}}u a}$.1N.p=r(c){o d=5J.2M.5K.5L(5M,1);t(1e c==\'1S\'&&(c==\'5N\'||c==\'1l\')){u $.p[\'3H\'+c+\'1o\'].2i($.p,[q[0]].3I(d))}u q.2o(r(){o a=q.1P.1Q();t(a==\'B\'){t(1e c==\'1S\'){$.p[\'3H\'+c+\'1o\'].2i($.p,[q].3I(d))}19{o b=($.1N.3J?$(q).3J():{});$.p.2N(q,$.1q(b,c))}}})};$.p=E 1o()})(5O);',62,361,'||||||||||||||||||||||||var|dateEntry|this|function||if|return|case||_get|||break|input|null|data|new|false|Date|_field|_selectedMonth|_selectedDay|browser|val|_daylightSavingAdjust||parseInt|true|_selectedYear|px|_lastInput|Math|left|_changeField||_adjustField||_timer||_disabledInputs||dateFormat|span|bind||_setDate||else|_getSpinnerTarget|charAt|markerClassName|_parseDate|typeof|_blurredInput|_showField|target|for|switch|_getInput|getDate|_lastChr|_formatNumber|DateEntry|spinnerSize|extend|options|_isDisabledDateEntry|_extractDate|_fieldLength|document|scrollLeft|css|position|top|_normaliseDate|_determineDate|getFullYear|length|monthNames|monthNamesShort|dayNames|dayNamesShort|_defaults|spinnerBigSize|extendRemove|class|setTimeout|fn|_endSpinner|nodeName|toLowerCase|_changeSpinner|string|_focussed|createTextRange|offset|_setValue|abs|_expanded|_handlingSpinner||scrollTop|curTop|regional|defaultDate|spinnerRepeat|background|width|focus|_doFocus|msie|mousewheel|_handleSpinner|mouseup|mouseout|_describeSpinner|_enableDisable|nextSibling|apply|documentElement|offsetLeft|character|keyCode|safari|each|0px|_getSpinnerRegion|_actionSpinner|_repeatSpinner|_releaseSpinner|min|while|getMonth|_showDate|100|_getDaysInMonth|May|spinnerTexts|field|appendText|initialField|useMouseWheel|minDate|maxDate|spinnerImage|spinnerBigImage|spinnerIncDecOnly|beforeShow|prototype|_connectDateEntry|hasClass|style|url|no|repeat|height|mozilla|padding|after|_doBlur|_doClick|_doKeyDown|_doKeyPress|_doMouseWheel||mousedown|_expandSpinner||||||mousemove|disabled|map|inArray|selectionStart|srcElement|clientX|moveEnd|ctrlKey|charCode|_handleKeyPress|opera|parents|absolute|div|_endExpand|one|_findPos|_findScroll|body|99|offsetParent|offsetTop|max|split|substring|isNaN|substr|getDay|setSelectionRange|exec|setHours|getHours|_|concat|metadata|mdy|January|February|March|April|June|July|August|September|October|November|December|Jan|Feb|Mar|Apr||Jun|Jul|Aug|Sep|Oct||Nov||Dec|Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat|Today|Previous|Next|Increment|Decrement|spinnerDefault|png|500|250|hasDateEntry|setDefaults|spinnerText|dateEntry_control|display|inline|block|version|bottom|wrap|dateEntry_wrap|dateEntry_append|addClass|blur|click|keydown|keypress|paste|mouseover|_enableDateEntry|_disableDateEntry|push|_changeDateEntry|_destroyDateEntry|removeClass|unbind|unmousewheel|parent|replaceWith|removeData|_setDateDateEntry|object|getTime|_getDateDateEntry|thin|medium|thick|border|collapse|boundingWidth|shiftKey|String|fromCharCode|undefined|preventDefault|relative|dateEntry_expand|transparent|index|insertAfter|siblings|title|clearTimeout|remove|clientY|fixed|parentNode|RegExp|join|splice|is|hidden|moveStart|select|default|trigger|change|setDate|number|setMinutes|setSeconds|setMilliseconds|indexOf|in|Array|slice|call|arguments|isDisabled|jQuery'.split('|'),0,{})); +$(document).ready(function(){ + $('.date').dateEntry({useMouseWheel: true,dateFormat: 'dmy/',spinnerImage: '/asset/img/spinnerOrange.png'}); +}); diff --git a/asset/js/jquery.form.js b/asset/js/jquery.form.js new file mode 100644 index 0000000..be8c0b6 --- /dev/null +++ b/asset/js/jquery.form.js @@ -0,0 +1,675 @@ +/*! + * jQuery Form Plugin + * version: 2.43 (12-MAR-2010) + * @requires jQuery v1.3.2 or later + * + * Examples and documentation at: http://malsup.com/jquery/form/ + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +;(function($) { + +/* + Usage Note: + ----------- + Do not use both ajaxSubmit and ajaxForm on the same form. These + functions are intended to be exclusive. Use ajaxSubmit if you want + to bind your own submit handler to the form. For example, + + $(document).ready(function() { + $('#myForm').bind('submit', function() { + $(this).ajaxSubmit({ + target: '#output' + }); + return false; // <-- important! + }); + }); + + Use ajaxForm when you want the plugin to manage all the event binding + for you. For example, + + $(document).ready(function() { + $('#myForm').ajaxForm({ + target: '#output' + }); + }); + + When using ajaxForm, the ajaxSubmit function will be invoked for you + at the appropriate time. +*/ + +/** + * ajaxSubmit() provides a mechanism for immediately submitting + * an HTML form using AJAX. + */ +$.fn.ajaxSubmit = function(options) { + // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) + if (!this.length) { + log('ajaxSubmit: skipping submit process - no element selected'); + return this; + } + + if (typeof options == 'function') + options = { success: options }; + + var url = $.trim(this.attr('action')); + if (url) { + // clean url (don't include hash vaue) + url = (url.match(/^([^#]+)/)||[])[1]; + } + url = url || window.location.href || ''; + + options = $.extend({ + url: url, + type: this.attr('method') || 'GET', + iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' + }, options || {}); + + // hook for manipulating the form data before it is extracted; + // convenient for use with rich editors like tinyMCE or FCKEditor + var veto = {}; + this.trigger('form-pre-serialize', [this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); + return this; + } + + // provide opportunity to alter form data before it is serialized + if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSerialize callback'); + return this; + } + + var a = this.formToArray(options.semantic); + if (options.data) { + options.extraData = options.data; + for (var n in options.data) { + if(options.data[n] instanceof Array) { + for (var k in options.data[n]) + a.push( { name: n, value: options.data[n][k] } ); + } + else + a.push( { name: n, value: options.data[n] } ); + } + } + + // give pre-submit callback an opportunity to abort the submit + if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSubmit callback'); + return this; + } + + // fire vetoable 'validate' event + this.trigger('form-submit-validate', [a, this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); + return this; + } + + var q = $.param(a); + + if (options.type.toUpperCase() == 'GET') { + options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; + options.data = null; // data is null for 'get' + } + else + options.data = q; // data is the query string for 'post' + + var $form = this, callbacks = []; + if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); + if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); + + // perform a load on the target only if dataType is not provided + if (!options.dataType && options.target) { + var oldSuccess = options.success || function(){}; + callbacks.push(function(data) { + var fn = options.replaceTarget ? 'replaceWith' : 'html'; + $(options.target)[fn](data).each(oldSuccess, arguments); + }); + } + else if (options.success) + callbacks.push(options.success); + + options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg + for (var i=0, max=callbacks.length; i < max; i++) + callbacks[i].apply(options, [data, status, xhr || $form, $form]); + }; + + // are there files to upload? + var files = $('input:file', this).fieldValue(); + var found = false; + for (var j=0; j < files.length; j++) + if (files[j]) + found = true; + + var multipart = false; +// var mp = 'multipart/form-data'; +// multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); + + // options.iframe allows user to force iframe mode + // 06-NOV-09: now defaulting to iframe mode if file input is detected + if ((files.length && options.iframe !== false) || options.iframe || found || multipart) { + // hack to fix Safari hang (thanks to Tim Molendijk for this) + // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d + if (options.closeKeepAlive) + $.get(options.closeKeepAlive, fileUpload); + else + fileUpload(); + } + else + $.ajax(options); + + // fire 'notify' event + this.trigger('form-submit-notify', [this, options]); + return this; + + + // private function for handling file uploads (hat tip to YAHOO!) + function fileUpload() { + var form = $form[0]; + + if ($(':input[name=submit]', form).length) { + alert('Error: Form elements must not be named "submit".'); + return; + } + + var opts = $.extend({}, $.ajaxSettings, options); + var s = $.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts); + + var id = 'jqFormIO' + (new Date().getTime()); + var $io = $('