pieforms-commit Mailing List for Pieforms (Page 12)
Status: Alpha
Brought to you by:
oracleshinoda
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(73) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(16) |
Feb
(19) |
Mar
(12) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(14) |
Sep
(2) |
Oct
(1) |
Nov
(2) |
Dec
(45) |
2008 |
Jan
(20) |
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(2) |
May
(1) |
Jun
(5) |
Jul
(1) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
(7) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ora...@us...> - 2006-11-20 12:02:12
|
Revision: 48 http://svn.sourceforge.net/pieforms/?rev=48&view=rev Author: oracleshinoda Date: 2006-11-20 04:02:08 -0800 (Mon, 20 Nov 2006) Log Message: ----------- Yet more SVN munging Added Paths: ----------- pieforms-php5/trunk/ pieforms-php5/trunk/COPYING pieforms-php5/trunk/INSTALL pieforms-php5/trunk/README pieforms-php5/trunk/doc/ pieforms-php5/trunk/src/ Removed Paths: ------------- pieforms-php5/COPYING pieforms-php5/INSTALL pieforms-php5/README pieforms-php5/doc/ pieforms-php5/src/ Deleted: pieforms-php5/COPYING =================================================================== --- pieforms-php5/COPYING 2006-11-20 11:59:27 UTC (rev 47) +++ pieforms-php5/COPYING 2006-11-20 12:02:08 UTC (rev 48) @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) 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 -this service 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 make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. 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. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the 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 a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE 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. - - 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 -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 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, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision 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, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This 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 Library General -Public License instead of this License. Deleted: pieforms-php5/INSTALL =================================================================== --- pieforms-php5/INSTALL 2006-11-20 11:59:27 UTC (rev 47) +++ pieforms-php5/INSTALL 2006-11-20 12:02:08 UTC (rev 48) @@ -1,46 +0,0 @@ - Pieforms - Advanced web forms made easy - - Nigel McNie - http://nigel.mcnie.name/ - (C) 2006 Catalyst IT Ltd - http://catalyst.net.nz/ - -Requirements ------------- - -Pieforms requires PHP5. PHP4 support may be added later. Perl support may also -be added later. - -Pieforms does not require the JSON extension, as it can use Services_JSON -(included). However, for optimal performance, it is recommended that you have -the native JSON extension for PHP available. This does not apply if you do not -wish to use the AJAX form submission support. - -Pieforms requires the Base, Iter, Style, DOM and Async modules of MochiKit for -AJAX form submission support. A packed version of MochiKit containing just -these modules is available for your convenience in the js/MochiKit directory. - -Installation of Pieforms ------------------------- - -To install Pieforms: - - 1) Copy the 'pieform.php' file and the 'pieform' directory to somewhere in - your application's include path (later versions will remove the requirement - that Pieforms be in your include path). Also copy the 'JSON' directory to the - same place if you do not have the JSON extension for PHP available and want - to use the AJAX form submission support. - - 2) If you wish to use the AJAX form submission support, copy the - 'MochiKit.js' file to wherever you are placing your javascript files for your - application. If you are already using MochiKit, you can skip this step. - -And you're done! - -Using Pieforms on a Page ------------------------- - -On any page where a Pieform is to be made: - - * Make sure that the MochiKit javascript file is sourced by a <script> tag in the output of the page. - * Include the 'pieform.php' file - - -- Nigel McNie <ni...@ca...> Deleted: pieforms-php5/README =================================================================== --- pieforms-php5/README 2006-11-20 11:59:27 UTC (rev 47) +++ pieforms-php5/README 2006-11-20 12:02:08 UTC (rev 48) @@ -1,71 +0,0 @@ - Pieforms - Advanced web forms made easy - - Nigel McNie - http://nigel.mcnie.name/ - (C) 2006 Catalyst IT Ltd - http://catalyst.net.nz/ - - For installation instructions, please see the INSTALL file in this folder - -About Pieforms --------------- - -Pieforms provides a simple, unified way to create, validate and process web -forms all with a common look and field. It supports many more types of form -controls (elements) than the standard HTML controls, for example date pickers -and ajax comboboxes. In addition, each element can have pluggable rules -applied to it, and the elements can be rendered inside custom containers, -allowing a lot of flexibility around form output. - -Pieforms also has a really simple API that makes writing forms very easy. For -most cases, you will simply define a hash describing your form and provide a -callback function that will be called if the form is submitted and passes -validation. However, there are plenty of hooks in place that allow much power -in how the forms are handled, both server and client side. - -No form library is going to have all the widgets you require (and the behaviour -you want), for anything other than a small project. Thankfully, Pieforms has a -very simple API for adding your own widgets. Once they are written, simply drop -them in place and use them just like any other Pieform widget! They can -encapsulate a myriad of functionality all by themselves, and once written you -can reuse them for any form you write. - -Pieforms supports many advanced features, that are as easy to use as flicking -a switch. For example, change one flag and instantly your forms are submitted -by AJAX - validation still works fine, just your forms are submitted a whole -lot faster! - -Currently, Pieforms is under heavy development, but gains new features and -bugfixes almost every day. While releases will be made regularly, it's -probably best to work off of SVN for now. - -Requirements ------------- - -You've downloaded the PHP5 version of Pieforms. With some reasonably minimal -hacking it could be made to work with PHP4 (by making sure that the $form -object is passed around by reference with the & operator, removing some PHP5 -keywords like 'public' and 'private', and changing error handling to not -involve throwing exceptions), I am not going to do the work involved unless I -need it. If you want, you could get it working and provide a patch, which I -would maintain as a separate tree. But in reality, you should think about -moving your project to PHP5. - -License and Copyright ---------------------- - -Pieforms is licensed under the GNU GPL. For more information, please see the -COPYING file that comes with this package. - -Pieforms is copyright (C) 2006 Catalyst IT Ltd. - -Pieforms includes parts of MochiKit [1], which is required for the AJAX post -functionality. MochiKit is dual licensed under the MIT license or Academic -Free License, v2.1. - -Pieforms includes Services_JSON [2], which is required for AJAX post -functionality, if the json extension for PHP is not installed or enabled. -Services_JSON is licensed under the BSD license. - -[1] http://mochikit.com/ -[2] http://pear.php.net/pepr/pepr-proposal-show.php?id=198 - - -- Nigel McNie <ni...@ca...> Copied: pieforms-php5/trunk/COPYING (from rev 47, pieforms-php5/COPYING) =================================================================== --- pieforms-php5/trunk/COPYING (rev 0) +++ pieforms-php5/trunk/COPYING 2006-11-20 12:02:08 UTC (rev 48) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This 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 Library General +Public License instead of this License. Copied: pieforms-php5/trunk/INSTALL (from rev 47, pieforms-php5/INSTALL) =================================================================== --- pieforms-php5/trunk/INSTALL (rev 0) +++ pieforms-php5/trunk/INSTALL 2006-11-20 12:02:08 UTC (rev 48) @@ -0,0 +1,46 @@ + Pieforms - Advanced web forms made easy + + Nigel McNie - http://nigel.mcnie.name/ + (C) 2006 Catalyst IT Ltd - http://catalyst.net.nz/ + +Requirements +------------ + +Pieforms requires PHP5. PHP4 support may be added later. Perl support may also +be added later. + +Pieforms does not require the JSON extension, as it can use Services_JSON +(included). However, for optimal performance, it is recommended that you have +the native JSON extension for PHP available. This does not apply if you do not +wish to use the AJAX form submission support. + +Pieforms requires the Base, Iter, Style, DOM and Async modules of MochiKit for +AJAX form submission support. A packed version of MochiKit containing just +these modules is available for your convenience in the js/MochiKit directory. + +Installation of Pieforms +------------------------ + +To install Pieforms: + + 1) Copy the 'pieform.php' file and the 'pieform' directory to somewhere in + your application's include path (later versions will remove the requirement + that Pieforms be in your include path). Also copy the 'JSON' directory to the + same place if you do not have the JSON extension for PHP available and want + to use the AJAX form submission support. + + 2) If you wish to use the AJAX form submission support, copy the + 'MochiKit.js' file to wherever you are placing your javascript files for your + application. If you are already using MochiKit, you can skip this step. + +And you're done! + +Using Pieforms on a Page +------------------------ + +On any page where a Pieform is to be made: + + * Make sure that the MochiKit javascript file is sourced by a <script> tag in the output of the page. + * Include the 'pieform.php' file + + -- Nigel McNie <ni...@ca...> Copied: pieforms-php5/trunk/README (from rev 47, pieforms-php5/README) =================================================================== --- pieforms-php5/trunk/README (rev 0) +++ pieforms-php5/trunk/README 2006-11-20 12:02:08 UTC (rev 48) @@ -0,0 +1,71 @@ + Pieforms - Advanced web forms made easy + + Nigel McNie - http://nigel.mcnie.name/ + (C) 2006 Catalyst IT Ltd - http://catalyst.net.nz/ + + For installation instructions, please see the INSTALL file in this folder + +About Pieforms +-------------- + +Pieforms provides a simple, unified way to create, validate and process web +forms all with a common look and field. It supports many more types of form +controls (elements) than the standard HTML controls, for example date pickers +and ajax comboboxes. In addition, each element can have pluggable rules +applied to it, and the elements can be rendered inside custom containers, +allowing a lot of flexibility around form output. + +Pieforms also has a really simple API that makes writing forms very easy. For +most cases, you will simply define a hash describing your form and provide a +callback function that will be called if the form is submitted and passes +validation. However, there are plenty of hooks in place that allow much power +in how the forms are handled, both server and client side. + +No form library is going to have all the widgets you require (and the behaviour +you want), for anything other than a small project. Thankfully, Pieforms has a +very simple API for adding your own widgets. Once they are written, simply drop +them in place and use them just like any other Pieform widget! They can +encapsulate a myriad of functionality all by themselves, and once written you +can reuse them for any form you write. + +Pieforms supports many advanced features, that are as easy to use as flicking +a switch. For example, change one flag and instantly your forms are submitted +by AJAX - validation still works fine, just your forms are submitted a whole +lot faster! + +Currently, Pieforms is under heavy development, but gains new features and +bugfixes almost every day. While releases will be made regularly, it's +probably best to work off of SVN for now. + +Requirements +------------ + +You've downloaded the PHP5 version of Pieforms. With some reasonably minimal +hacking it could be made to work with PHP4 (by making sure that the $form +object is passed around by reference with the & operator, removing some PHP5 +keywords like 'public' and 'private', and changing error handling to not +involve throwing exceptions), I am not going to do the work involved unless I +need it. If you want, you could get it working and provide a patch, which I +would maintain as a separate tree. But in reality, you should think about +moving your project to PHP5. + +License and Copyright +--------------------- + +Pieforms is licensed under the GNU GPL. For more information, please see the +COPYING file that comes with this package. + +Pieforms is copyright (C) 2006 Catalyst IT Ltd. + +Pieforms includes parts of MochiKit [1], which is required for the AJAX post +functionality. MochiKit is dual licensed under the MIT license or Academic +Free License, v2.1. + +Pieforms includes Services_JSON [2], which is required for AJAX post +functionality, if the json extension for PHP is not installed or enabled. +Services_JSON is licensed under the BSD license. + +[1] http://mochikit.com/ +[2] http://pear.php.net/pepr/pepr-proposal-show.php?id=198 + + -- Nigel McNie <ni...@ca...> Copied: pieforms-php5/trunk/doc (from rev 47, pieforms-php5/doc) Copied: pieforms-php5/trunk/src (from rev 47, pieforms-php5/src) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-20 11:59:27
|
Revision: 47 http://svn.sourceforge.net/pieforms/?rev=47&view=rev Author: oracleshinoda Date: 2006-11-20 03:59:27 -0800 (Mon, 20 Nov 2006) Log Message: ----------- More repository munging Added Paths: ----------- pieforms-php5/ Removed Paths: ------------- trunk/pieforms-php5/ Copied: pieforms-php5 (from rev 46, trunk/pieforms-php5) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-20 11:56:04
|
Revision: 46 http://svn.sourceforge.net/pieforms/?rev=46&view=rev Author: oracleshinoda Date: 2006-11-20 03:55:52 -0800 (Mon, 20 Nov 2006) Log Message: ----------- Put pieforms PHP5 stuff in its own folder Added Paths: ----------- trunk/pieforms-php5/ Removed Paths: ------------- trunk/pieforms/ Copied: trunk/pieforms-php5 (from rev 44, trunk/pieforms) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-20 11:55:09
|
Revision: 45 http://svn.sourceforge.net/pieforms/?rev=45&view=rev Author: oracleshinoda Date: 2006-11-20 03:55:03 -0800 (Mon, 20 Nov 2006) Log Message: ----------- moving to standard repository layoutt Removed Paths: ------------- pieforms/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-20 11:51:48
|
Revision: 44 http://svn.sourceforge.net/pieforms/?rev=44&view=rev Author: oracleshinoda Date: 2006-11-20 03:51:47 -0800 (Mon, 20 Nov 2006) Log Message: ----------- Try the standardised way of using SVN Added Paths: ----------- trunk/ Copied: trunk (from rev 43, ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-20 00:17:10
|
Revision: 43 http://svn.sourceforge.net/pieforms/?rev=43&view=rev Author: oracleshinoda Date: 2006-11-19 16:17:10 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Pass the form as the first parameter to the renderer, which allows the renderers to access all of the information available to the form Modified Paths: -------------- pieforms/src/pieform/renderers/div.php pieforms/src/pieform/renderers/multicolumntable.php pieforms/src/pieform/renderers/table.php pieforms/src/pieform.php Modified: pieforms/src/pieform/renderers/div.php =================================================================== --- pieforms/src/pieform/renderers/div.php 2006-11-19 22:28:46 UTC (rev 42) +++ pieforms/src/pieform/renderers/div.php 2006-11-20 00:17:10 UTC (rev 43) @@ -27,13 +27,14 @@ /** * Renders form elements inside <div>s. * + * @param Pieform $form The form the element is being rendered for * @param string $builtelement The element, already built * @param array $rawelement The element in raw form, for looking up * information about it. * @return string The element rendered inside an appropriate * container. */ -function pieform_renderer_div($builtelement, $rawelement) { +function pieform_renderer_div(Pieform $form, $builtelement, $rawelement) { // Set the class of the enclosing <div> to match that of the element $result = '<div'; if (isset($rawelement['name'])) { Modified: pieforms/src/pieform/renderers/multicolumntable.php =================================================================== --- pieforms/src/pieform/renderers/multicolumntable.php 2006-11-19 22:28:46 UTC (rev 42) +++ pieforms/src/pieform/renderers/multicolumntable.php 2006-11-20 00:17:10 UTC (rev 43) @@ -34,13 +34,14 @@ * Renders form elements inside a <table>. If elements have the same title, * they will be rendered in the same table row, allowing a grid layout. * + * @param Pieform $form The form the element is being rendered for * @param string $builtelement The element, already built * @param array $rawelement The element in raw form, for looking up * information about it. * @return string The element rendered inside an appropriate * container. */ -function pieform_renderer_multicolumntable($builtelement, $rawelement) { +function pieform_renderer_multicolumntable(Pieform $form, $builtelement, $rawelement) { global $formrenderermct; $formrenderermct->add_element($builtelement, $rawelement); } Modified: pieforms/src/pieform/renderers/table.php =================================================================== --- pieforms/src/pieform/renderers/table.php 2006-11-19 22:28:46 UTC (rev 42) +++ pieforms/src/pieform/renderers/table.php 2006-11-20 00:17:10 UTC (rev 43) @@ -27,13 +27,14 @@ /** * Renders form elements inside a <table>. * - * @param string $builtelement The element, already built - * @param array $rawelement The element in raw form, for looking up - * information about it. - * @return string The element rendered inside an appropriate - * container. + * @param Pieform $form The form the element is being rendered for + * @param string $builtelement The element, already built + * @param array $rawelement The element in raw form, for looking up + * information about it. + * @return string The element rendered inside an appropriate + * container. */ -function pieform_renderer_table($builtelement, $rawelement) { +function pieform_renderer_table(Pieform $form, $builtelement, $rawelement) { if ($rawelement['type'] == 'fieldset') { // Add table tags to the build element, to preserve HTML compliance if (0 === strpos($builtelement, "\n<fieldset>\n<legend>")) { Modified: pieforms/src/pieform.php =================================================================== --- pieforms/src/pieform.php 2006-11-19 22:28:46 UTC (rev 42) +++ pieforms/src/pieform.php 2006-11-20 00:17:10 UTC (rev 43) @@ -1258,7 +1258,7 @@ // itself, not the wrapping HTML $element['class'] = preg_replace('/\s?autofocus/', '', $element['class']); - return $prefix . $rendererfunction($builtelement, $element) . $suffix; + return $prefix . $rendererfunction($form, $builtelement, $element) . $suffix; } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 22:28:46
|
Revision: 42 http://svn.sourceforge.net/pieforms/?rev=42&view=rev Author: oracleshinoda Date: 2006-11-19 14:28:46 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Changed the default language name to en.utf8 instead of en Modified Paths: -------------- pieforms/src/pieform.php Modified: pieforms/src/pieform.php =================================================================== --- pieforms/src/pieform.php 2006-11-19 22:27:55 UTC (rev 41) +++ pieforms/src/pieform.php 2006-11-19 22:28:46 UTC (rev 42) @@ -224,7 +224,7 @@ * * @var string */ - private $language = 'en'; + private $language = 'en.utf8'; /** * Language strings for rules @@ -232,7 +232,7 @@ * @var array */ private $language_strings = array( - 'en' => array( + 'en.utf8' => array( 'required' => 'This field is required', 'email' => 'E-mail address is invalid', 'maxlength' => 'This field must be at most %d characters long', @@ -333,7 +333,7 @@ 'ajaxsuccessfunction' => '', 'ajaxfailurefunction' => '', 'autofocus' => false, - 'language' => 'en', + 'language' => 'en.utf8', 'validate' => true, 'submit' => true, 'elements' => array(), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 22:28:03
|
Revision: 41 http://svn.sourceforge.net/pieforms/?rev=41&view=rev Author: oracleshinoda Date: 2006-11-19 14:27:55 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Store the form data in its own array. Eventually almost all fields will be merged into this. Added a method to get a property from this array. Added a todo about removing prefix and suffix support from core Modified Paths: -------------- pieforms/src/pieform.php Modified: pieforms/src/pieform.php =================================================================== --- pieforms/src/pieform.php 2006-11-19 12:25:31 UTC (rev 40) +++ pieforms/src/pieform.php 2006-11-19 22:27:55 UTC (rev 41) @@ -106,6 +106,14 @@ class Pieform { /** + * Data for the form + * + * @var array + * @todo move all of the member fields here into this field + */ + private $data = array(); + + /** * Maintains a tab index across all created forms, to make it easy for * people to forget about it and have it just work for all of their forms. * @@ -333,6 +341,7 @@ 'validatefunction' => '', ); $data = array_merge($formdefaults, $formconfig, $data); + $this->data = $data; // Set the method - only get/post allowed $data['method'] = strtolower($data['method']); @@ -557,6 +566,18 @@ } /** + * Returns a generic property. This can be used to retrieve any property + * set in the form data array, so developers can pass in random stuff and + * get access to it. + * + * @param string The key of the property to return + * @return mixed + */ + public function get_property($key) { + return $this->data[$key]; + } + + /** * Returns the form name * * @return string @@ -1229,6 +1250,7 @@ $builtelement = $function($element, $form); // Prepare the prefix and suffix + // @tod REMOVE THIS: each renderer should support it seperately $prefix = (isset($element['prefix'])) ? $element['prefix'] : ''; $suffix = (isset($element['suffix'])) ? $element['suffix'] : ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 12:25:34
|
Revision: 40 http://svn.sourceforge.net/pieforms/?rev=40&view=rev Author: oracleshinoda Date: 2006-11-19 04:25:31 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Added COPYING file Added Paths: ----------- pieforms/COPYING Added: pieforms/COPYING =================================================================== --- pieforms/COPYING (rev 0) +++ pieforms/COPYING 2006-11-19 12:25:31 UTC (rev 40) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This 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 Library General +Public License instead of this License. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 11:44:50
|
Revision: 39 http://svn.sourceforge.net/pieforms/?rev=39&view=rev Author: oracleshinoda Date: 2006-11-19 03:44:46 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Added an INSTALL file Added Paths: ----------- pieforms/INSTALL Added: pieforms/INSTALL =================================================================== --- pieforms/INSTALL (rev 0) +++ pieforms/INSTALL 2006-11-19 11:44:46 UTC (rev 39) @@ -0,0 +1,46 @@ + Pieforms - Advanced web forms made easy + + Nigel McNie - http://nigel.mcnie.name/ + (C) 2006 Catalyst IT Ltd - http://catalyst.net.nz/ + +Requirements +------------ + +Pieforms requires PHP5. PHP4 support may be added later. Perl support may also +be added later. + +Pieforms does not require the JSON extension, as it can use Services_JSON +(included). However, for optimal performance, it is recommended that you have +the native JSON extension for PHP available. This does not apply if you do not +wish to use the AJAX form submission support. + +Pieforms requires the Base, Iter, Style, DOM and Async modules of MochiKit for +AJAX form submission support. A packed version of MochiKit containing just +these modules is available for your convenience in the js/MochiKit directory. + +Installation of Pieforms +------------------------ + +To install Pieforms: + + 1) Copy the 'pieform.php' file and the 'pieform' directory to somewhere in + your application's include path (later versions will remove the requirement + that Pieforms be in your include path). Also copy the 'JSON' directory to the + same place if you do not have the JSON extension for PHP available and want + to use the AJAX form submission support. + + 2) If you wish to use the AJAX form submission support, copy the + 'MochiKit.js' file to wherever you are placing your javascript files for your + application. If you are already using MochiKit, you can skip this step. + +And you're done! + +Using Pieforms on a Page +------------------------ + +On any page where a Pieform is to be made: + + * Make sure that the MochiKit javascript file is sourced by a <script> tag in the output of the page. + * Include the 'pieform.php' file + + -- Nigel McNie <ni...@ca...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 11:28:19
|
Revision: 38 http://svn.sourceforge.net/pieforms/?rev=38&view=rev Author: oracleshinoda Date: 2006-11-19 03:28:15 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Added an extra paragraph to the readme. Added licensing information as well Modified Paths: -------------- pieforms/README Modified: pieforms/README =================================================================== --- pieforms/README 2006-11-19 11:20:49 UTC (rev 37) +++ pieforms/README 2006-11-19 11:28:15 UTC (rev 38) @@ -21,6 +21,13 @@ validation. However, there are plenty of hooks in place that allow much power in how the forms are handled, both server and client side. +No form library is going to have all the widgets you require (and the behaviour +you want), for anything other than a small project. Thankfully, Pieforms has a +very simple API for adding your own widgets. Once they are written, simply drop +them in place and use them just like any other Pieform widget! They can +encapsulate a myriad of functionality all by themselves, and once written you +can reuse them for any form you write. + Pieforms supports many advanced features, that are as easy to use as flicking a switch. For example, change one flag and instantly your forms are submitted by AJAX - validation still works fine, just your forms are submitted a whole @@ -50,5 +57,15 @@ Pieforms is copyright (C) 2006 Catalyst IT Ltd. +Pieforms includes parts of MochiKit [1], which is required for the AJAX post +functionality. MochiKit is dual licensed under the MIT license or Academic +Free License, v2.1. +Pieforms includes Services_JSON [2], which is required for AJAX post +functionality, if the json extension for PHP is not installed or enabled. +Services_JSON is licensed under the BSD license. + +[1] http://mochikit.com/ +[2] http://pear.php.net/pepr/pepr-proposal-show.php?id=198 + -- Nigel McNie <ni...@ca...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 11:20:50
|
Revision: 37 http://svn.sourceforge.net/pieforms/?rev=37&view=rev Author: oracleshinoda Date: 2006-11-19 03:20:49 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Added the MochiKit LICENSE.txt file Added Paths: ----------- pieforms/src/js/MochiKit/LICENSE.txt Added: pieforms/src/js/MochiKit/LICENSE.txt =================================================================== --- pieforms/src/js/MochiKit/LICENSE.txt (rev 0) +++ pieforms/src/js/MochiKit/LICENSE.txt 2006-11-19 11:20:49 UTC (rev 37) @@ -0,0 +1,69 @@ +MochiKit is dual-licensed software. It is available under the terms of the +MIT License, or the Academic Free License version 2.1. The full text of +each license is included below. + +MIT License +=========== + +Copyright (c) 2005 Bob Ippolito. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Academic Free License v. 2.1 +============================ + +Copyright (c) 2005 Bob Ippolito. All rights reserved. + +This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work: + +Licensed under the Academic Free License version 2.1 + +1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following: + +a) to reproduce the Original Work in copies; + +b) to prepare derivative works ("Derivative Works") based upon the Original Work; + +c) to distribute copies of the Original Work and Derivative Works to the public; + +d) to perform the Original Work publicly; and + +e) to display the Original Work publicly. + +2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works. + +3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work. + +4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license. + +5) This section intentionally omitted. + +6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + +7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer. + +8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. + +9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions. + +10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + +11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License. + +12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + +13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + +14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + +This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner. + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 10:57:59
|
Revision: 36 http://svn.sourceforge.net/pieforms/?rev=36&view=rev Author: oracleshinoda Date: 2006-11-19 02:57:58 -0800 (Sun, 19 Nov 2006) Log Message: ----------- Include MochiKit.Iter which is required for error messages to work. Made a new javascript function, {}_remove_all_errors, which is used after failed validation, to ensure that if one field has been fixed that the error is removed correctly. Modified Paths: -------------- pieforms/src/js/MochiKit/MochiKit.js pieforms/src/pieform/renderers/table.php pieforms/src/pieform.php Modified: pieforms/src/js/MochiKit/MochiKit.js =================================================================== --- pieforms/src/js/MochiKit/MochiKit.js 2006-11-19 01:53:05 UTC (rev 35) +++ pieforms/src/js/MochiKit/MochiKit.js 2006-11-19 10:57:58 UTC (rev 36) @@ -1767,6 +1767,937 @@ } MochiKit.Base._exportSymbols(this,MochiKit.DOM); if(typeof (dojo)!="undefined"){ +dojo.provide("MochiKit.Style"); +dojo.require("MochiKit.Base"); +dojo.require("MochiKit.DOM"); +} +if(typeof (JSAN)!="undefined"){ +JSAN.use("MochiKit.Base",[]); +} +try{ +if(typeof (MochiKit.Base)=="undefined"){ +throw ""; +} +} +catch(e){ +throw "MochiKit.Style depends on MochiKit.Base!"; +} +try{ +if(typeof (MochiKit.DOM)=="undefined"){ +throw ""; +} +} +catch(e){ +throw "MochiKit.Style depends on MochiKit.DOM!"; +} +if(typeof (MochiKit.Style)=="undefined"){ +MochiKit.Style={}; +} +MochiKit.Style.NAME="MochiKit.Style"; +MochiKit.Style.VERSION="1.4"; +MochiKit.Style.__repr__=function(){ +return "["+this.NAME+" "+this.VERSION+"]"; +}; +MochiKit.Style.toString=function(){ +return this.__repr__(); +}; +MochiKit.Style.EXPORT_OK=[]; +MochiKit.Style.EXPORT=["setOpacity","getOpacity","setStyle","getStyle","computedStyle","getElementDimensions","elementDimensions","setElementDimensions","getElementPosition","elementPosition","setElementPosition","setDisplayForElement","hideElement","showElement","getViewportDimensions","getViewportPosition","Dimensions","Coordinates"]; +MochiKit.Style.Dimensions=function(w,h){ +this.w=w; +this.h=h; +}; +MochiKit.Style.Dimensions.prototype.__repr__=function(){ +var repr=MochiKit.Base.repr; +return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}"; +}; +MochiKit.Style.Dimensions.prototype.toString=function(){ +return this.__repr__(); +}; +MochiKit.Style.Coordinates=function(x,y){ +this.x=x; +this.y=y; +}; +MochiKit.Style.Coordinates.prototype.__repr__=function(){ +var repr=MochiKit.Base.repr; +return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}"; +}; +MochiKit.Style.Coordinates.prototype.toString=function(){ +return this.__repr__(); +}; +MochiKit.Base.update(MochiKit.Style,{computedStyle:function(elem,_263){ +var dom=MochiKit.DOM; +var d=dom._document; +elem=dom.getElement(elem); +_263=MochiKit.Base.camelize(_263); +if(!elem||elem==d){ +return undefined; +} +if(_263=="opacity"&&elem.filters){ +try{ +return elem.filters.item("DXImageTransform.Microsoft.Alpha").opacity/100; +} +catch(e){ +try{ +return elem.filters.item("alpha").opacity/100; +} +catch(e){ +} +} +} +if(elem.currentStyle){ +return elem.currentStyle[_263]; +} +if(typeof (d.defaultView)=="undefined"){ +return undefined; +} +if(d.defaultView===null){ +return undefined; +} +var _264=d.defaultView.getComputedStyle(elem,null); +if(typeof (_264)=="undefined"||_264===null){ +return undefined; +} +var _265=_263.replace(/([A-Z])/g,"-$1").toLowerCase(); +return _264.getPropertyValue(_265); +},getStyle:function(elem,_266){ +elem=MochiKit.DOM.getElement(elem); +var _267=elem.style[MochiKit.Base.camelize(_266)]; +if(!_267){ +if(document.defaultView&&document.defaultView.getComputedStyle){ +var css=document.defaultView.getComputedStyle(elem,null); +_267=css?css.getPropertyValue(_266):null; +}else{ +if(elem.currentStyle){ +_267=elem.currentStyle[MochiKit.Base.camelize(_266)]; +} +} +} +if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.find(["left","top","right","bottom"],_266)!=-1)){ +if(MochiKit.Style.getStyle(elem,"position")=="static"){ +_267="auto"; +} +} +return _267=="auto"?null:_267; +},setStyle:function(elem,_269){ +elem=MochiKit.DOM.getElement(elem); +for(name in _269){ +elem.style[MochiKit.Base.camelize(name)]=_269[name]; +} +},getOpacity:function(elem){ +var _270; +if(_270=MochiKit.Style.getStyle(elem,"opacity")){ +return parseFloat(_270); +} +if(_270=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/)){ +if(_270[1]){ +return parseFloat(_270[1])/100; +} +} +return 1; +},setOpacity:function(elem,o){ +elem=MochiKit.DOM.getElement(elem); +var self=MochiKit.Style; +if(o==1){ +var _271=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|Safari|KHTML/.test(navigator.userAgent)); +self.setStyle(elem,{opacity:_271?0.999999:1}); +if(/MSIE/.test(navigator.userAgent)){ +self.setStyle(elem,{filter:self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")}); +} +}else{ +if(o<0.00001){ +o=0; +} +self.setStyle(elem,{opacity:o}); +if(/MSIE/.test(navigator.userAgent)){ +self.setStyle(elem,{filter:self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+o*100+")"}); +} +} +},getElementPosition:function(elem,_272){ +var self=MochiKit.Style; +var dom=MochiKit.DOM; +elem=dom.getElement(elem); +if(!elem||(!(elem.x&&elem.y)&&(!elem.parentNode==null||self.computedStyle(elem,"display")=="none"))){ +return undefined; +} +var c=new self.Coordinates(0,0); +var box=null; +var _275=null; +var d=MochiKit.DOM._document; +var de=d.documentElement; +var b=d.body; +if(!elem.parentNode&&elem.x&&elem.y){ +c.x+=elem.x||0; +c.y+=elem.y||0; +}else{ +if(elem.getBoundingClientRect){ +box=elem.getBoundingClientRect(); +c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0); +c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0); +}else{ +if(elem.offsetParent){ +c.x+=elem.offsetLeft; +c.y+=elem.offsetTop; +_275=elem.offsetParent; +if(_275!=elem){ +while(_275){ +c.x+=_275.offsetLeft; +c.y+=_275.offsetTop; +_275=_275.offsetParent; +} +} +var ua=navigator.userAgent.toLowerCase(); +if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("safari")!=-1&&self.computedStyle(elem,"position")=="absolute")){ +c.x-=b.offsetLeft; +c.y-=b.offsetTop; +} +} +} +} +if(typeof (_272)!="undefined"){ +_272=arguments.callee(_272); +if(_272){ +c.x-=(_272.x||0); +c.y-=(_272.y||0); +} +} +if(elem.parentNode){ +_275=elem.parentNode; +}else{ +_275=null; +} +while(_275){ +var _278=_275.tagName.toUpperCase(); +if(_278==="BODY"||_278==="HTML"){ +break; +} +c.x-=_275.scrollLeft; +c.y-=_275.scrollTop; +if(_275.parentNode){ +_275=_275.parentNode; +}else{ +_275=null; +} +} +return c; +},setElementPosition:function(elem,_279,_280){ +elem=MochiKit.DOM.getElement(elem); +if(typeof (_280)=="undefined"){ +_280="px"; +} +var _281={}; +var _282=MochiKit.Base.isUndefinedOrNull; +if(!_282(_279.x)){ +_281["left"]=_279.x+_280; +} +if(!_282(_279.y)){ +_281["top"]=_279.y+_280; +} +MochiKit.DOM.updateNodeAttributes(elem,{"style":_281}); +},getElementDimensions:function(elem){ +var self=MochiKit.Style; +var dom=MochiKit.DOM; +if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){ +return new self.Dimensions(elem.w||0,elem.h||0); +} +elem=dom.getElement(elem); +if(!elem){ +return undefined; +} +var disp=self.computedStyle(elem,"display"); +if(disp!="none"&&disp!=""&&typeof (disp)!="undefined"){ +return new self.Dimensions(elem.offsetWidth||0,elem.offsetHeight||0); +} +var s=elem.style; +var _284=s.visibility; +var _285=s.position; +s.visibility="hidden"; +s.position="absolute"; +s.display=""; +var _286=elem.offsetWidth; +var _287=elem.offsetHeight; +s.display="none"; +s.position=_285; +s.visibility=_284; +return new self.Dimensions(_286,_287); +},setElementDimensions:function(elem,_288,_289){ +elem=MochiKit.DOM.getElement(elem); +if(typeof (_289)=="undefined"){ +_289="px"; +} +var _290={}; +var _291=MochiKit.Base.isUndefinedOrNull; +if(!_291(_288.w)){ +_290["width"]=_288.w+_289; +} +if(!_291(_288.h)){ +_290["height"]=_288.h+_289; +} +MochiKit.DOM.updateNodeAttributes(elem,{"style":_290}); +},setDisplayForElement:function(_292,_293){ +var _294=MochiKit.Base.extend(null,arguments,1); +var _295=MochiKit.DOM.getElement; +for(var i=0;i<_294.length;i++){ +var _293=_295(_294[i]); +if(_293){ +_293.style.display=_292; +} +} +},getViewportDimensions:function(){ +var d=new MochiKit.Style.Dimensions(); +var w=MochiKit.DOM._window; +var b=MochiKit.DOM._document.body; +if(w.innerWidth){ +d.w=w.innerWidth; +d.h=w.innerHeight; +}else{ +if(b.parentElement.clientWidth){ +d.w=b.parentElement.clientWidth; +d.h=b.parentElement.clientHeight; +}else{ +if(b&&b.clientWidth){ +d.w=b.clientWidth; +d.h=b.clientHeight; +} +} +} +return d; +},getViewportPosition:function(){ +var c=new MochiKit.Style.Coordinates(0,0); +var d=MochiKit.DOM._document; +var de=d.documentElement; +var db=d.body; +if(de&&(de.scrollTop||de.scrollLeft)){ +c.x=de.scrollLeft; +c.y=de.scrollTop; +}else{ +if(db){ +c.x=db.scrollLeft; +c.y=db.scrollTop; +} +} +return c; +},__new__:function(){ +var m=MochiKit.Base; +this.elementPosition=this.getElementPosition; +this.elementDimensions=this.getElementDimensions; +this.hideElement=m.partial(this.setDisplayForElement,"none"); +this.showElement=m.partial(this.setDisplayForElement,"block"); +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; +m.nameFunctions(this); +}}); +MochiKit.Style.__new__(); +MochiKit.Base._exportSymbols(this,MochiKit.Style); +if(typeof (dojo)!="undefined"){ +dojo.provide("MochiKit.Iter"); +dojo.require("MochiKit.Base"); +} +if(typeof (JSAN)!="undefined"){ +JSAN.use("MochiKit.Base",[]); +} +try{ +if(typeof (MochiKit.Base)=="undefined"){ +throw ""; +} +} +catch(e){ +throw "MochiKit.Iter depends on MochiKit.Base!"; +} +if(typeof (MochiKit.Iter)=="undefined"){ +MochiKit.Iter={}; +} +MochiKit.Iter.NAME="MochiKit.Iter"; +MochiKit.Iter.VERSION="1.4"; +MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){ +return "["+this.NAME+" "+this.VERSION+"]"; +},toString:function(){ +return this.__repr__(); +},registerIteratorFactory:function(name,_297,_298,_299){ +MochiKit.Iter.iteratorRegistry.register(name,_297,_298,_299); +},iter:function(_300,_301){ +var self=MochiKit.Iter; +if(arguments.length==2){ +return self.takewhile(function(a){ +return a!=_301; +},_300); +} +if(typeof (_300.next)=="function"){ +return _300; +}else{ +if(typeof (_300.iter)=="function"){ +return _300.iter(); +} +} +try{ +return self.iteratorRegistry.match(_300); +} +catch(e){ +var m=MochiKit.Base; +if(e==m.NotFound){ +e=new TypeError(typeof (_300)+": "+m.repr(_300)+" is not iterable"); +} +throw e; +} +},count:function(n){ +if(!n){ +n=0; +} +var m=MochiKit.Base; +return {repr:function(){ +return "count("+n+")"; +},toString:m.forwardCall("repr"),next:m.counter(n)}; +},cycle:function(p){ +var self=MochiKit.Iter; +var m=MochiKit.Base; +var lst=[]; +var _303=self.iter(p); +return {repr:function(){ +return "cycle(...)"; +},toString:m.forwardCall("repr"),next:function(){ +try{ +var rval=_303.next(); +lst.push(rval); +return rval; +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +if(lst.length===0){ +this.next=function(){ +throw self.StopIteration; +}; +}else{ +var i=-1; +this.next=function(){ +i=(i+1)%lst.length; +return lst[i]; +}; +} +return this.next(); +} +}}; +},repeat:function(elem,n){ +var m=MochiKit.Base; +if(typeof (n)=="undefined"){ +return {repr:function(){ +return "repeat("+m.repr(elem)+")"; +},toString:m.forwardCall("repr"),next:function(){ +return elem; +}}; +} +return {repr:function(){ +return "repeat("+m.repr(elem)+", "+n+")"; +},toString:m.forwardCall("repr"),next:function(){ +if(n<=0){ +throw MochiKit.Iter.StopIteration; +} +n-=1; +return elem; +}}; +},next:function(_304){ +return _304.next(); +},izip:function(p,q){ +var m=MochiKit.Base; +var self=MochiKit.Iter; +var next=self.next; +var _307=m.map(self.iter,arguments); +return {repr:function(){ +return "izip(...)"; +},toString:m.forwardCall("repr"),next:function(){ +return m.map(next,_307); +}}; +},ifilter:function(pred,seq){ +var m=MochiKit.Base; +seq=MochiKit.Iter.iter(seq); +if(pred===null){ +pred=m.operator.truth; +} +return {repr:function(){ +return "ifilter(...)"; +},toString:m.forwardCall("repr"),next:function(){ +while(true){ +var rval=seq.next(); +if(pred(rval)){ +return rval; +} +} +return undefined; +}}; +},ifilterfalse:function(pred,seq){ +var m=MochiKit.Base; +seq=MochiKit.Iter.iter(seq); +if(pred===null){ +pred=m.operator.truth; +} +return {repr:function(){ +return "ifilterfalse(...)"; +},toString:m.forwardCall("repr"),next:function(){ +while(true){ +var rval=seq.next(); +if(!pred(rval)){ +return rval; +} +} +return undefined; +}}; +},islice:function(seq){ +var self=MochiKit.Iter; +var m=MochiKit.Base; +seq=self.iter(seq); +var _310=0; +var stop=0; +var step=1; +var i=-1; +if(arguments.length==2){ +stop=arguments[1]; +}else{ +if(arguments.length==3){ +_310=arguments[1]; +stop=arguments[2]; +}else{ +_310=arguments[1]; +stop=arguments[2]; +step=arguments[3]; +} +} +return {repr:function(){ +return "islice("+["...",_310,stop,step].join(", ")+")"; +},toString:m.forwardCall("repr"),next:function(){ +var rval; +while(i<_310){ +rval=seq.next(); +i++; +} +if(_310>=stop){ +throw self.StopIteration; +} +_310+=step; +return rval; +}}; +},imap:function(fun,p,q){ +var m=MochiKit.Base; +var self=MochiKit.Iter; +var _314=m.map(self.iter,m.extend(null,arguments,1)); +var map=m.map; +var next=self.next; +return {repr:function(){ +return "imap(...)"; +},toString:m.forwardCall("repr"),next:function(){ +return fun.apply(this,map(next,_314)); +}}; +},applymap:function(fun,seq,self){ +seq=MochiKit.Iter.iter(seq); +var m=MochiKit.Base; +return {repr:function(){ +return "applymap(...)"; +},toString:m.forwardCall("repr"),next:function(){ +return fun.apply(self,seq.next()); +}}; +},chain:function(p,q){ +var self=MochiKit.Iter; +var m=MochiKit.Base; +if(arguments.length==1){ +return self.iter(arguments[0]); +} +var _315=m.map(self.iter,arguments); +return {repr:function(){ +return "chain(...)"; +},toString:m.forwardCall("repr"),next:function(){ +while(_315.length>1){ +try{ +return _315[0].next(); +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +_315.shift(); +} +} +if(_315.length==1){ +var arg=_315.shift(); +this.next=m.bind("next",arg); +return this.next(); +} +throw self.StopIteration; +}}; +},takewhile:function(pred,seq){ +var self=MochiKit.Iter; +seq=self.iter(seq); +return {repr:function(){ +return "takewhile(...)"; +},toString:MochiKit.Base.forwardCall("repr"),next:function(){ +var rval=seq.next(); +if(!pred(rval)){ +this.next=function(){ +throw self.StopIteration; +}; +this.next(); +} +return rval; +}}; +},dropwhile:function(pred,seq){ +seq=MochiKit.Iter.iter(seq); +var m=MochiKit.Base; +var bind=m.bind; +return {"repr":function(){ +return "dropwhile(...)"; +},"toString":m.forwardCall("repr"),"next":function(){ +while(true){ +var rval=seq.next(); +if(!pred(rval)){ +break; +} +} +this.next=bind("next",seq); +return rval; +}}; +},_tee:function(_317,sync,_319){ +sync.pos[_317]=-1; +var m=MochiKit.Base; +var _320=m.listMin; +return {repr:function(){ +return "tee("+_317+", ...)"; +},toString:m.forwardCall("repr"),next:function(){ +var rval; +var i=sync.pos[_317]; +if(i==sync.max){ +rval=_319.next(); +sync.deque.push(rval); +sync.max+=1; +sync.pos[_317]+=1; +}else{ +rval=sync.deque[i-sync.min]; +sync.pos[_317]+=1; +if(i==sync.min&&_320(sync.pos)!=sync.min){ +sync.min+=1; +sync.deque.shift(); +} +} +return rval; +}}; +},tee:function(_321,n){ +var rval=[]; +var sync={"pos":[],"deque":[],"max":-1,"min":-1}; +if(arguments.length==1||typeof (n)=="undefined"||n===null){ +n=2; +} +var self=MochiKit.Iter; +_321=self.iter(_321); +var _tee=self._tee; +for(var i=0;i<n;i++){ +rval.push(_tee(i,sync,_321)); +} +return rval; +},list:function(_323){ +var m=MochiKit.Base; +if(typeof (_323.slice)=="function"){ +return _323.slice(); +}else{ +if(m.isArrayLike(_323)){ +return m.concat(_323); +} +} +var self=MochiKit.Iter; +_323=self.iter(_323); +var rval=[]; +try{ +while(true){ +rval.push(_323.next()); +} +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +return rval; +} +return undefined; +},reduce:function(fn,_324,_325){ +var i=0; +var x=_325; +var self=MochiKit.Iter; +_324=self.iter(_324); +if(arguments.length<3){ +try{ +x=_324.next(); +} +catch(e){ +if(e==self.StopIteration){ +e=new TypeError("reduce() of empty sequence with no initial value"); +} +throw e; +} +i++; +} +try{ +while(true){ +x=fn(x,_324.next()); +} +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +} +return x; +},range:function(){ +var _326=0; +var stop=0; +var step=1; +if(arguments.length==1){ +stop=arguments[0]; +}else{ +if(arguments.length==2){ +_326=arguments[0]; +stop=arguments[1]; +}else{ +if(arguments.length==3){ +_326=arguments[0]; +stop=arguments[1]; +step=arguments[2]; +}else{ +throw new TypeError("range() takes 1, 2, or 3 arguments!"); +} +} +} +if(step===0){ +throw new TypeError("range() step must not be 0"); +} +return {next:function(){ +if((step>0&&_326>=stop)||(step<0&&_326<=stop)){ +throw MochiKit.Iter.StopIteration; +} +var rval=_326; +_326+=step; +return rval; +},repr:function(){ +return "range("+[_326,stop,step].join(", ")+")"; +},toString:MochiKit.Base.forwardCall("repr")}; +},sum:function(_327,_328){ +if(typeof (_328)=="undefined"||_328===null){ +_328=0; +} +var x=_328; +var self=MochiKit.Iter; +_327=self.iter(_327); +try{ +while(true){ +x+=_327.next(); +} +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +} +return x; +},exhaust:function(_329){ +var self=MochiKit.Iter; +_329=self.iter(_329); +try{ +while(true){ +_329.next(); +} +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +} +},forEach:function(_330,func,self){ +var m=MochiKit.Base; +if(arguments.length>2){ +func=m.bind(func,self); +} +if(m.isArrayLike(_330)){ +try{ +for(var i=0;i<_330.length;i++){ +func(_330[i]); +} +} +catch(e){ +if(e!=MochiKit.Iter.StopIteration){ +throw e; +} +} +}else{ +self=MochiKit.Iter; +self.exhaust(self.imap(func,_330)); +} +},every:function(_331,func){ +var self=MochiKit.Iter; +try{ +self.ifilterfalse(func,_331).next(); +return false; +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +return true; +} +},sorted:function(_332,cmp){ +var rval=MochiKit.Iter.list(_332); +if(arguments.length==1){ +cmp=MochiKit.Base.compare; +} +rval.sort(cmp); +return rval; +},reversed:function(_333){ +var rval=MochiKit.Iter.list(_333); +rval.reverse(); +return rval; +},some:function(_334,func){ +var self=MochiKit.Iter; +try{ +self.ifilter(func,_334).next(); +return true; +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +return false; +} +},iextend:function(lst,_335){ +if(MochiKit.Base.isArrayLike(_335)){ +for(var i=0;i<_335.length;i++){ +lst.push(_335[i]); +} +}else{ +var self=MochiKit.Iter; +_335=self.iter(_335); +try{ +while(true){ +lst.push(_335.next()); +} +} +catch(e){ +if(e!=self.StopIteration){ +throw e; +} +} +} +return lst; +},groupby:function(_336,_337){ +var m=MochiKit.Base; +var self=MochiKit.Iter; +if(arguments.length<2){ +_337=m.operator.identity; +} +_336=self.iter(_336); +var pk=undefined; +var k=undefined; +var v; +function fetch(){ +v=_336.next(); +k=_337(v); +} +function eat(){ +var ret=v; +v=undefined; +return ret; +} +var _340=true; +var _341=m.compare; +return {repr:function(){ +return "groupby(...)"; +},next:function(){ +while(_341(k,pk)===0){ +fetch(); +if(_340){ +_340=false; +break; +} +} +pk=k; +return [k,{next:function(){ +if(v==undefined){ +fetch(); +} +if(_341(k,pk)!==0){ +throw self.StopIteration; +} +return eat(); +}}]; +}}; +},groupby_as_array:function(_342,_343){ +var m=MochiKit.Base; +var self=MochiKit.Iter; +if(arguments.length<2){ +_343=m.operator.identity; +} +_342=self.iter(_342); +var _344=[]; +var _345=true; +var _346; +var _347=m.compare; +while(true){ +try{ +var _348=_342.next(); +var key=_343(_348); +} +catch(e){ +if(e==self.StopIteration){ +break; +} +throw e; +} +if(_345||_347(key,_346)!==0){ +var _349=[]; +_344.push([key,_349]); +} +_349.push(_348); +_345=false; +_346=key; +} +return _344; +},arrayLikeIter:function(_350){ +var i=0; +return {repr:function(){ +return "arrayLikeIter(...)"; +},toString:MochiKit.Base.forwardCall("repr"),next:function(){ +if(i>=_350.length){ +throw MochiKit.Iter.StopIteration; +} +return _350[i++]; +}}; +},hasIterateNext:function(_351){ +return (_351&&typeof (_351.iterateNext)=="function"); +},iterateNextIter:function(_352){ +return {repr:function(){ +return "iterateNextIter(...)"; +},toString:MochiKit.Base.forwardCall("repr"),next:function(){ +var rval=_352.iterateNext(); +if(rval===null||rval===undefined){ +throw MochiKit.Iter.StopIteration; +} +return rval; +}}; +}}); +MochiKit.Iter.EXPORT_OK=["iteratorRegistry","arrayLikeIter","hasIterateNext","iterateNextIter",]; +MochiKit.Iter.EXPORT=["StopIteration","registerIteratorFactory","iter","count","cycle","repeat","next","izip","ifilter","ifilterfalse","islice","imap","applymap","chain","takewhile","dropwhile","tee","list","reduce","range","sum","exhaust","forEach","every","sorted","reversed","some","iextend","groupby","groupby_as_array"]; +MochiKit.Iter.__new__=function(){ +var m=MochiKit.Base; +if(typeof (StopIteration)!="undefined"){ +this.StopIteration=StopIteration; +}else{ +this.StopIteration=new m.NamedError("StopIteration"); +} +this.iteratorRegistry=new m.AdapterRegistry(); +this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter); +this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter); +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; +m.nameFunctions(this); +}; +MochiKit.Iter.__new__(); +if(MochiKit.__export__){ +reduce=MochiKit.Iter.reduce; +} +MochiKit.Base._exportSymbols(this,MochiKit.Iter); +if(typeof (dojo)!="undefined"){ dojo.provide("MochiKit.Async"); dojo.require("MochiKit.Base"); } @@ -1792,28 +2723,28 @@ MochiKit.Async.toString=function(){ return this.__repr__(); }; -MochiKit.Async.Deferred=function(_258){ +MochiKit.Async.Deferred=function(_353){ this.chain=[]; this.id=this._nextId(); this.fired=-1; this.paused=0; this.results=[null,null]; -this.canceller=_258; +this.canceller=_353; this.silentlyCancelled=false; this.chained=false; }; MochiKit.Async.Deferred.prototype={repr:function(){ -var _259; +var _354; if(this.fired==-1){ -_259="unfired"; +_354="unfired"; }else{ if(this.fired===0){ -_259="success"; +_354="success"; }else{ -_259="error"; +_354="error"; } } -return "Deferred("+this.id+", "+_259+")"; +return "Deferred("+this.id+", "+_354+")"; },toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){ var self=MochiKit.Async; if(this.fired==-1){ @@ -1883,20 +2814,20 @@ } return this; },_fire:function(){ -var _262=this.chain; -var _263=this.fired; -var res=this.results[_263]; +var _357=this.chain; +var _358=this.fired; +var res=this.results[_358]; var self=this; var cb=null; -while(_262.length>0&&this.paused===0){ -var pair=_262.shift(); -var f=pair[_263]; +while(_357.length>0&&this.paused===0){ +var pair=_357.shift(); +var f=pair[_358]; if(f===null){ continue; } try{ res=f(res); -_263=((res instanceof Error)?1:0); +_358=((res instanceof Error)?1:0); if(res instanceof MochiKit.Async.Deferred){ cb=function(res){ self._resback(res); @@ -1909,15 +2840,15 @@ } } catch(err){ -_263=1; +_358=1; if(!(err instanceof Error)){ err=new MochiKit.Async.GenericError(err); } res=err; } } -this.fired=_263; -this.results[_263]=res; +this.fired=_358; +this.results[_358]=res; if(cb&&this.paused){ res.addBoth(cb); res.chained=true; @@ -1925,18 +2856,18 @@ }}; MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(){ return eval("("+arguments[0].responseText+")"); -},succeed:function(_265){ +},succeed:function(_360){ var d=new MochiKit.Async.Deferred(); d.callback.apply(d,arguments); return d; -},fail:function(_266){ +},fail:function(_361){ var d=new MochiKit.Async.Deferred(); d.errback.apply(d,arguments); return d; },getXMLHttpRequest:function(){ var self=arguments.callee; if(!self.XMLHttpRequest){ -var _267=[function(){ +var _362=[function(){ return new XMLHttpRequest(); },function(){ return new ActiveXObject("Msxml2.XMLHTTP"); @@ -1947,8 +2878,8 @@ },function(){ throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest"); }]; -for(var i=0;i<_267.length;i++){ -var func=_267[i]; +for(var i=0;i<_362.length;i++){ +var func=_362[i]; try{ self.XMLHttpRequest=func; return func(); @@ -1971,16 +2902,16 @@ catch(e){ } } -var _268=null; +var _363=null; try{ -_268=this.status; -if(!_268&&m.isNotEmpty(this.responseText)){ -_268=304; +_363=this.status; +if(!_363&&m.isNotEmpty(this.responseText)){ +_363=304; } } catch(e){ } -if(_268==200||_268==304){ +if(_363==200||_363==304){ d.callback(this); }else{ var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed"); @@ -2003,16 +2934,16 @@ } } req.abort(); -},sendXMLHttpRequest:function(req,_271){ -if(typeof (_271)=="undefined"||_271===null){ -_271=""; +},sendXMLHttpRequest:function(req,_366){ +if(typeof (_366)=="undefined"||_366===null){ +_366=""; } var m=MochiKit.Base; var self=MochiKit.Async; var d=new self.Deferred(m.partial(self._xhr_canceller,req)); try{ req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d); -req.send(_271); +req.send(_366); } catch(e){ try{ @@ -2039,15 +2970,15 @@ req.overrideMimeType(opts.mimeType); } if(opts.headers){ -var _274=opts.headers; -if(!m.isArrayLike(_274)){ -_274=m.items(_274); +var _369=opts.headers; +if(!m.isArrayLike(_369)){ +_369=m.items(_369); } -for(var i=0;i<_274.length;i++){ -var _275=_274[i]; -var name=_275[0]; -var _276=_275[1]; -req.setRequestHeader(name,_276); +for(var i=0;i<_369.length;i++){ +var _370=_369[i]; +var name=_370[0]; +var _371=_370[1]; +req.setRequestHeader(name,_371); } } return self.sendXMLHttpRequest(req,opts.sendContent); @@ -2070,28 +3001,28 @@ var d=self.doXHR(url,{"mimeType":"text/plain","headers":[["Accept","application/json"]]}); d=d.addCallback(self.evalJSONRequest); return d; -},wait:function(_277,_278){ +},wait:function(_372,_373){ var d=new MochiKit.Async.Deferred(); var m=MochiKit.Base; -if(typeof (_278)!="undefined"){ +if(typeof (_373)!="undefined"){ d.addCallback(function(){ -return _278; +return _373; }); } -var _279=setTimeout(m.bind("callback",d),Math.floor(_277*1000)); +var _374=setTimeout(m.bind("callback",d),Math.floor(_372*1000)); d.canceller=function(){ try{ -clearTimeout(_279); +clearTimeout(_374); } catch(e){ } }; return d; -},callLater:function(_280,func){ +},callLater:function(_375,func){ var m=MochiKit.Base; -var _281=m.partial.apply(m,m.extend(null,arguments,1)); -return MochiKit.Async.wait(_280).addCallback(function(res){ -return _281(); +var _376=m.partial.apply(m,m.extend(null,arguments,1)); +return MochiKit.Async.wait(_375).addCallback(function(res){ +return _376(); }); }}); MochiKit.Async.DeferredLock=function(){ @@ -2118,44 +3049,44 @@ this.waiting.shift().callback(this); } },_nextId:MochiKit.Base.counter(),repr:function(){ -var _282; +var _377; if(this.locked){ -_282="locked, "+this.waiting.length+" waiting"; +_377="locked, "+this.waiting.length+" waiting"; }else{ -_282="unlocked"; +_377="unlocked"; } -return "DeferredLock("+this.id+", "+_282+")"; +return "DeferredLock("+this.id+", "+_377+")"; },toString:MochiKit.Base.forwardCall("repr")}; -MochiKit.Async.DeferredList=function(list,_284,_285,_286,_287){ -MochiKit.Async.Deferred.apply(this,[_287]); +MochiKit.Async.DeferredList=function(list,_379,_380,_381,_382){ +MochiKit.Async.Deferred.apply(this,[_382]); this.list=list; -var _288=[]; -this.resultList=_288; +var _383=[]; +this.resultList=_383; this.finishedCount=0; -this.fireOnOneCallback=_284; -this.fireOnOneErrback=_285; -this.consumeErrors=_286; +this.fireOnOneCallback=_379; +this.fireOnOneErrback=_380; +this.consumeErrors=_381; var cb=MochiKit.Base.bind(this._cbDeferred,this); for(var i=0;i<list.length;i++){ var d=list[i]; -_288.push(undefined); +_383.push(undefined); d.addCallback(cb,i,true); d.addErrback(cb,i,false); } -if(list.length===0&&!_284){ +if(list.length===0&&!_379){ this.callback(this.resultList); } }; MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred(); -MochiKit.Async.DeferredList.prototype._cbDeferred=function(_289,_290,_291){ -this.resultList[_289]=[_290,_291]; +MochiKit.Async.DeferredList.prototype._cbDeferred=function(_384,_385,_386){ +this.resultList[_384]=[_385,_386]; this.finishedCount+=1; if(this.fired==-1){ -if(_290&&this.fireOnOneCallback){ -this.callback([_289,_291]); +if(_385&&this.fireOnOneCallback){ +this.callback([_384,_386]); }else{ -if(!_290&&this.fireOnOneErrback){ -this.errback(_291); +if(!_385&&this.fireOnOneErrback){ +this.errback(_386); }else{ if(this.finishedCount==this.list.length){ this.callback(this.resultList); @@ -2163,17 +3094,17 @@ } } } -if(!_290&&this.consumeErrors){ -_291=null; +if(!_385&&this.consumeErrors){ +_386=null; } -return _291; +return _386; }; -MochiKit.Async.gatherResults=function(_292){ -var d=new MochiKit.Async.DeferredList(_292,false,true,false); -d.addCallback(function(_293){ +MochiKit.Async.gatherResults=function(_387){ +var d=new MochiKit.Async.DeferredList(_387,false,true,false); +d.addCallback(function(_388){ var ret=[]; -for(var i=0;i<_293.length;i++){ -ret.push(_293[i][1]); +for(var i=0;i<_388.length;i++){ +ret.push(_388[i][1]); } return ret; }); @@ -2181,34 +3112,34 @@ }; MochiKit.Async.maybeDeferred=function(func){ var self=MochiKit.Async; -var _295; +var _389; try{ var r=func.apply(null,MochiKit.Base.extend([],arguments,1)); if(r instanceof self.Deferred){ -_295=r; +_389=r; }else{ if(r instanceof Error){ -_295=self.fail(r); +_389=self.fail(r); }else{ -_295=self.succeed(r); +_389=self.succeed(r); } } } catch(e){ -_295=self.fail(e); +_389=self.fail(e); } -return _295; +return _389; }; MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred","doXHR"]; MochiKit.Async.EXPORT_OK=["evalJSONRequest"]; MochiKit.Async.__new__=function(){ var m=MochiKit.Base; var ne=m.partial(m._newNamedError,this); -ne("AlreadyCalledError",function(_298){ -this.deferred=_298; +ne("AlreadyCalledError",function(_392){ +this.deferred=_392; }); -ne("CancelledError",function(_299){ -this.deferred=_299; +ne("CancelledError",function(_393){ +this.deferred=_393; }); ne("BrowserComplianceError",function(msg){ this.message=msg; Modified: pieforms/src/pieform/renderers/table.php =================================================================== --- pieforms/src/pieform/renderers/table.php 2006-11-19 01:53:05 UTC (rev 35) +++ pieforms/src/pieform/renderers/table.php 2006-11-19 10:57:58 UTC (rev 36) @@ -121,6 +121,11 @@ removeElement(elem); } } +function {$id}_remove_all_errors() { + forEach(getElementsByTagAndClassName('TD', 'errmsg', $('$id')), function(item) { + removeElement(item.parentNode); + }); +} function {$id}_message(message, type) { var elem = $('{$id}_message'); var msg = TR({'id': '{$id}_message'}, TD({'colspan': 2, 'class': type}, message)); Modified: pieforms/src/pieform.php =================================================================== --- pieforms/src/pieform.php 2006-11-19 01:53:05 UTC (rev 35) +++ pieforms/src/pieform.php 2006-11-19 10:57:58 UTC (rev 36) @@ -852,6 +852,7 @@ var d = sendXMLHttpRequest(req,queryString(data)); d.addCallbacks( function (result) { + {$this->name}_remove_all_errors(); var data = evalJSONRequest(result); if (data.error) { {$this->name}_message(data.message, 'error'); @@ -875,25 +876,24 @@ $result .= " {$this->ajaxsuccessfunction}(data);\n"; } - foreach ($this->get_elements() as $element) { - if ($element['type'] != 'markup') { - $result .= " {$this->name}_remove_error('{$element['name']}');\n"; - } - } - - $result .= " }\n"; + $result .= " {$this->name}_remove_all_errors();\n"; + $result .= " }\n"; if (!empty($this->postajaxsubmitcallback)) { $result .= " $this->postajaxsubmitcallback();\n"; } - // @todo not with get_string! $this->i18n instead $strunknownerror = $this->i18n('ajaxunknownerror'); $strprocessingform = $this->i18n('processingform'); $result .= <<<EOF }, function() { {$this->name}_message('{$strunknownerror}', 'error'); - processingStop(); + +EOF; + if (!empty($this->postajaxsubmitcallback)) { + $result .= " $this->postajaxsubmitcallback();\n"; + } + $result .= <<<EOF }); {$this->name}_message('{$strprocessingform}', 'info'); return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 01:53:05
|
Revision: 35 http://svn.sourceforge.net/pieforms/?rev=35&view=rev Author: oracleshinoda Date: 2006-11-18 17:53:05 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Added Mochikit for ajax submission. Also added Services_JSON for if the user doesn't have the PHP JSON extension installed Modified Paths: -------------- pieforms/src/pieform.php Added Paths: ----------- pieforms/src/JSON/ pieforms/src/JSON/JSON.php pieforms/src/JSON/LICENSE pieforms/src/js/ pieforms/src/js/MochiKit/ pieforms/src/js/MochiKit/MochiKit.js Added: pieforms/src/JSON/JSON.php =================================================================== (Binary files differ) Property changes on: pieforms/src/JSON/JSON.php ___________________________________________________________________ Name: svn:mime-type + application/x-httpd-php Added: pieforms/src/JSON/LICENSE =================================================================== --- pieforms/src/JSON/LICENSE (rev 0) +++ pieforms/src/JSON/LICENSE 2006-11-19 01:53:05 UTC (rev 35) @@ -0,0 +1,21 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN +NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file Property changes on: pieforms/src/JSON/LICENSE ___________________________________________________________________ Name: svn:mime-type + text/plain Added: pieforms/src/js/MochiKit/MochiKit.js =================================================================== --- pieforms/src/js/MochiKit/MochiKit.js (rev 0) +++ pieforms/src/js/MochiKit/MochiKit.js 2006-11-19 01:53:05 UTC (rev 35) @@ -0,0 +1,2234 @@ +/*** + + MochiKit.MochiKit 1.4 : PACKED VERSION + + THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please + diff against the source tree, not this file. + + See <http://mochikit.com/> for documentation, downloads, license, etc. + + (c) 2005 Bob Ippolito. All rights Reserved. + +***/ + +if(typeof (dojo)!="undefined"){ +dojo.provide("MochiKit.Base"); +} +if(typeof (MochiKit)=="undefined"){ +MochiKit={}; +} +if(typeof (MochiKit.Base)=="undefined"){ +MochiKit.Base={}; +} +if(typeof (MochiKit.__export__)=="undefined"){ +MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")); +} +MochiKit.Base.VERSION="1.4"; +MochiKit.Base.NAME="MochiKit.Base"; +MochiKit.Base.update=function(_1,_2){ +if(_1===null){ +_1={}; +} +for(var i=1;i<arguments.length;i++){ +var o=arguments[i]; +if(typeof (o)!="undefined"&&o!==null){ +for(var k in o){ +_1[k]=o[k]; +} +} +} +return _1; +}; +MochiKit.Base.update(MochiKit.Base,{__repr__:function(){ +return "["+this.NAME+" "+this.VERSION+"]"; +},toString:function(){ +return this.__repr__(); +},camelize:function(_6){ +var _7=_6.split("-"); +var cc=_7[0]; +for(var i=1;i<_7.length;i++){ +cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1); +} +return cc; +},counter:function(n){ +if(arguments.length===0){ +n=1; +} +return function(){ +return n++; +}; +},clone:function(obj){ +var me=arguments.callee; +if(arguments.length==1){ +me.prototype=obj; +return new me(); +} +},_flattenArray:function(res,lst){ +for(var i=0;i<lst.length;i++){ +var o=lst[i]; +if(o instanceof Array){ +arguments.callee(res,o); +}else{ +res.push(o); +} +} +return res; +},flattenArray:function(lst){ +return MochiKit.Base._flattenArray([],lst); +},flattenArguments:function(lst){ +var res=[]; +var m=MochiKit.Base; +var _15=m.extend(null,arguments); +while(_15.length){ +var o=_15.shift(); +if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){ +for(var i=o.length-1;i>=0;i--){ +_15.unshift(o[i]); +} +}else{ +res.push(o); +} +} +return res; +},extend:function(_16,obj,_17){ +if(!_17){ +_17=0; +} +if(obj){ +var l=obj.length; +if(typeof (l)!="number"){ +if(typeof (MochiKit.Iter)!="undefined"){ +obj=MochiKit.Iter.list(obj); +l=obj.length; +}else{ +throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); +} +} +if(!_16){ +_16=[]; +} +for(var i=_17;i<l;i++){ +_16.push(obj[i]); +} +} +return _16; +},updatetree:function(_19,obj){ +if(_19===null){ +_19={}; +} +for(var i=1;i<arguments.length;i++){ +var o=arguments[i]; +if(typeof (o)!="undefined"&&o!==null){ +for(var k in o){ +var v=o[k]; +if(typeof (_19[k])=="object"&&typeof (v)=="object"){ +arguments.callee(_19[k],v); +}else{ +_19[k]=v; +} +} +} +} +return _19; +},setdefault:function(_21,obj){ +if(_21===null){ +_21={}; +} +for(var i=1;i<arguments.length;i++){ +var o=arguments[i]; +for(var k in o){ +if(!(k in _21)){ +_21[k]=o[k]; +} +} +} +return _21; +},keys:function(obj){ +var _22=[]; +for(var _23 in obj){ +_22.push(_23); +} +return _22; +},values:function(obj){ +var _24=[]; +for(var _25 in obj){ +_24.push(obj[_25]); +} +return _24; +},items:function(obj){ +var _26=[]; +var e; +for(var _28 in obj){ +var v; +try{ +v=obj[_28]; +} +catch(e){ +continue; +} +_26.push([_28,v]); +} +return _26; +},_newNamedError:function(_29,_30,_31){ +_31.prototype=new MochiKit.Base.NamedError(_29.NAME+"."+_30); +_29[_30]=_31; +},operator:{truth:function(a){ +return !!a; +},lognot:function(a){ +return !a; +},identity:function(a){ +return a; +},not:function(a){ +return ~a; +},neg:function(a){ +return -a; +},add:function(a,b){ +return a+b; +},sub:function(a,b){ +return a-b; +},div:function(a,b){ +return a/b; +},mod:function(a,b){ +return a%b; +},mul:function(a,b){ +return a*b; +},and:function(a,b){ +return a&b; +},or:function(a,b){ +return a|b; +},xor:function(a,b){ +return a^b; +},lshift:function(a,b){ +return a<<b; +},rshift:function(a,b){ +return a>>b; +},zrshift:function(a,b){ +return a>>>b; +},eq:function(a,b){ +return a==b; +},ne:function(a,b){ +return a!=b; +},gt:function(a,b){ +return a>b; +},ge:function(a,b){ +return a>=b; +},lt:function(a,b){ +return a<b; +},le:function(a,b){ +return a<=b; +},seq:function(a,b){ +return a===b; +},sne:function(a,b){ +return a!==b; +},ceq:function(a,b){ +return MochiKit.Base.compare(a,b)===0; +},cne:function(a,b){ +return MochiKit.Base.compare(a,b)!==0; +},cgt:function(a,b){ +return MochiKit.Base.compare(a,b)==1; +},cge:function(a,b){ +return MochiKit.Base.compare(a,b)!=-1; +},clt:function(a,b){ +return MochiKit.Base.compare(a,b)==-1; +},cle:function(a,b){ +return MochiKit.Base.compare(a,b)!=1; +},logand:function(a,b){ +return a&&b; +},logor:function(a,b){ +return a||b; +},contains:function(a,b){ +return b in a; +}},forwardCall:function(_34){ +return function(){ +return this[_34].apply(this,arguments); +}; +},itemgetter:function(_35){ +return function(arg){ +return arg[_35]; +}; +},typeMatcher:function(){ +var _37={}; +for(var i=0;i<arguments.length;i++){ +var typ=arguments[i]; +_37[typ]=typ; +} +return function(){ +for(var i=0;i<arguments.length;i++){ +if(!(typeof (arguments[i]) in _37)){ +return false; +} +} +return true; +}; +},isNull:function(){ +for(var i=0;i<arguments.length;i++){ +if(arguments[i]!==null){ +return false; +} +} +return true; +},isUndefinedOrNull:function(){ +for(var i=0;i<arguments.length;i++){ +var o=arguments[i]; +if(!(typeof (o)=="undefined"||o===null)){ +return false; +} +} +return true; +},isEmpty:function(obj){ +return !MochiKit.Base.isNotEmpty.apply(this,arguments); +},isNotEmpty:function(obj){ +for(var i=0;i<arguments.length;i++){ +var o=arguments[i]; +if(!(o&&o.length)){ +return false; +} +} +return true; +},isArrayLike:function(){ +for(var i=0;i<arguments.length;i++){ +var o=arguments[i]; +var typ=typeof (o); +if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"||o.nodeType===3){ +return false; +} +} +return true; +},isDateLike:function(){ +for(var i=0;i<arguments.length;i++){ +var o=arguments[i]; +if(typeof (o)!="object"||o===null||typeof (o.getTime)!="function"){ +return false; +} +} +return true; +},xmap:function(fn){ +if(fn===null){ +return MochiKit.Base.extend(null,arguments,1); +} +var _40=[]; +for(var i=1;i<arguments.length;i++){ +_40.push(fn(arguments[i])); +} +return _40; +},map:function(fn,lst){ +var m=MochiKit.Base; +var itr=MochiKit.Iter; +var _42=m.isArrayLike; +if(arguments.length<=2){ +if(!_42(lst)){ +if(itr){ +lst=itr.list(lst); +if(fn===null){ +return lst; +} +}else{ +throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); +} +} +if(fn===null){ +return m.extend(null,lst); +} +var _43=[]; +for(var i=0;i<lst.length;i++){ +_43.push(fn(lst[i])); +} +return _43; +}else{ +if(fn===null){ +fn=Array; +} +var _44=null; +for(i=1;i<arguments.length;i++){ +if(!_42(arguments[i])){ +if(itr){ +return itr.list(itr.imap.apply(null,arguments)); +}else{ +throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); +} +} +var l=arguments[i].length; +if(_44===null||_44>l){ +_44=l; +} +} +_43=[]; +for(i=0;i<_44;i++){ +var _45=[]; +for(var j=1;j<arguments.length;j++){ +_45.push(arguments[j][i]); +} +_43.push(fn.apply(this,_45)); +} +return _43; +} +},xfilter:function(fn){ +var _47=[]; +if(fn===null){ +fn=MochiKit.Base.operator.truth; +} +for(var i=1;i<arguments.length;i++){ +var o=arguments[i]; +if(fn(o)){ +_47.push(o); +} +} +return _47; +},filter:function(fn,lst,_48){ +var _49=[]; +var m=MochiKit.Base; +if(!m.isArrayLike(lst)){ +if(MochiKit.Iter){ +lst=MochiKit.Iter.list(lst); +}else{ +throw new TypeError("Argument not an array-like and MochiKit.Iter not present"); +} +} +if(fn===null){ +fn=m.operator.truth; +} +if(typeof (Array.prototype.filter)=="function"){ +return Array.prototype.filter.call(lst,fn,_48); +}else{ +if(typeof (_48)=="undefined"||_48===null){ +for(var i=0;i<lst.length;i++){ +var o=lst[i]; +if(fn(o)){ +_49.push(o); +} +} +}else{ +for(i=0;i<lst.length;i++){ +o=lst[i]; +if(fn.call(_48,o)){ +_49.push(o); +} +} +} +} +return _49; +},_wrapDumbFunction:function(_50){ +return function(){ +switch(arguments.length){ +case 0: +return _50(); +case 1: +return _50(arguments[0]); +case 2: +return _50(arguments[0],arguments[1]); +case 3: +return _50(arguments[0],arguments[1],arguments[2]); +} +var _51=[]; +for(var i=0;i<arguments.length;i++){ +_51.push("arguments["+i+"]"); +} +return eval("(func("+_51.join(",")+"))"); +}; +},methodcaller:function(_52){ +var _53=MochiKit.Base.extend(null,arguments,1); +if(typeof (_52)=="function"){ +return function(obj){ +return _52.apply(obj,_53); +}; +}else{ +return function(obj){ +return obj[_52].apply(obj,_53); +}; +} +},method:function(_54,_55){ +var m=MochiKit.Base; +return m.bind.apply(this,m.extend([_55,_54],arguments,2)); +},compose:function(f1,f2){ +var _58=[]; +var m=MochiKit.Base; +if(arguments.length===0){ +throw new TypeError("compose() requires at least one argument"); +} +for(var i=0;i<arguments.length;i++){ +var fn=arguments[i]; +if(typeof (fn)!="function"){ +throw new TypeError(m.repr(fn)+" is not a function"); +} +_58.push(fn); +} +return function(){ +var _59=arguments; +for(var i=_58.length-1;i>=0;i--){ +_59=[_58[i].apply(this,_59)]; +} +return _59[0]; +}; +},bind:function(_60,_61){ +if(typeof (_60)=="string"){ +_60=_61[_60]; +} +var _62=_60.im_func; +var _63=_60.im_preargs; +var _64=_60.im_self; +var m=MochiKit.Base; +if(typeof (_60)=="function"&&typeof (_60.apply)=="undefined"){ +_60=m._wrapDumbFunction(_60); +} +if(typeof (_62)!="function"){ +_62=_60; +} +if(typeof (_61)!="undefined"){ +_64=_61; +} +if(typeof (_63)=="undefined"){ +_63=[]; +}else{ +_63=_63.slice(); +} +m.extend(_63,arguments,2); +var _65=function(){ +var _66=arguments; +var me=arguments.callee; +if(me.im_preargs.length>0){ +_66=m.concat(me.im_preargs,_66); +} +var _61=me.im_self; +if(!_61){ +_61=this; +} +return me.im_func.apply(_61,_66); +}; +_65.im_self=_64; +_65.im_func=_62; +_65.im_preargs=_63; +return _65; +},bindMethods:function(_67){ +var _68=MochiKit.Base.bind; +for(var k in _67){ +var _69=_67[k]; +if(typeof (_69)=="function"){ +_67[k]=_68(_69,_67); +} +} +},registerComparator:function(_70,_71,_72,_73){ +MochiKit.Base.comparatorRegistry.register(_70,_71,_72,_73); +},_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){ +if(a==b){ +return 0; +} +var _74=(typeof (a)=="undefined"||a===null); +var _75=(typeof (b)=="undefined"||b===null); +if(_74&&_75){ +return 0; +}else{ +if(_74){ +return -1; +}else{ +if(_75){ +return 1; +} +} +} +var m=MochiKit.Base; +var _76=m._primitives; +if(!(typeof (a) in _76&&typeof (b) in _76)){ +try{ +return m.comparatorRegistry.match(a,b); +} +catch(e){ +if(e!=m.NotFound){ +throw e; +} +} +} +if(a<b){ +return -1; +}else{ +if(a>b){ +return 1; +} +} +var _77=m.repr; +throw new TypeError(_77(a)+" and "+_77(b)+" can not be compared"); +},compareDateLike:function(a,b){ +return MochiKit.Base.compare(a.getTime(),b.getTime()); +},compareArrayLike:function(a,b){ +var _78=MochiKit.Base.compare; +var _79=a.length; +var _80=0; +if(_79>b.length){ +_80=1; +_79=b.length; +}else{ +if(_79<b.length){ +_80=-1; +} +} +for(var i=0;i<_79;i++){ +var cmp=_78(a[i],b[i]); +if(cmp){ +return cmp; +} +} +return _80; +},registerRepr:function(_82,_83,_84,_85){ +MochiKit.Base.reprRegistry.register(_82,_83,_84,_85); +},repr:function(o){ +if(typeof (o)=="undefined"){ +return "undefined"; +}else{ +if(o===null){ +return "null"; +} +} +try{ +if(typeof (o.__repr__)=="function"){ +return o.__repr__(); +}else{ +if(typeof (o.repr)=="function"&&o.repr!=arguments.callee){ +return o.repr(); +} +} +return MochiKit.Base.reprRegistry.match(o); +} +catch(e){ +if(typeof (o.NAME)=="string"&&(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){ +return o.NAME; +} +} +try{ +var _86=(o+""); +} +catch(e){ +return "["+typeof (o)+"]"; +} +if(typeof (o)=="function"){ +o=_86.replace(/^\s+/,""); +var idx=o.indexOf("{"); +if(idx!=-1){ +o=o.substr(0,idx)+"{...}"; +} +} +return _86; +},reprArrayLike:function(o){ +var m=MochiKit.Base; +return "["+m.map(m.repr,o).join(", ")+"]"; +},reprString:function(o){ +return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r"); +},reprNumber:function(o){ +return o+""; +},registerJSON:function(_88,_89,_90,_91){ +MochiKit.Base.jsonRegistry.register(_88,_89,_90,_91); +},evalJSON:function(){ +return eval("("+arguments[0]+")"); +},serializeJSON:function(o){ +var _92=typeof (o); +if(_92=="number"||_92=="boolean"){ +return o+""; +}else{ +if(o===null){ +return "null"; +} +} +var m=MochiKit.Base; +var _93=m.reprString; +if(_92=="string"){ +return _93(o); +} +var me=arguments.callee; +var _94; +if(typeof (o.__json__)=="function"){ +_94=o.__json__(); +if(o!==_94){ +return me(_94); +} +} +if(typeof (o.json)=="function"){ +_94=o.json(); +if(o!==_94){ +return me(_94); +} +} +if(_92!="function"&&typeof (o.length)=="number"){ +var res=[]; +for(var i=0;i<o.length;i++){ +var val=me(o[i]); +if(typeof (val)!="string"){ +val="undefined"; +} +res.push(val); +} +return "["+res.join(", ")+"]"; +} +try{ +_94=m.jsonRegistry.match(o); +if(o!==_94){ +return me(_94); +} +} +catch(e){ +if(e!=m.NotFound){ +throw e; +} +} +if(_92=="undefined"){ +throw new TypeError("undefined can not be serialized as JSON"); +} +if(_92=="function"){ +return null; +} +res=[]; +for(var k in o){ +var _96; +if(typeof (k)=="number"){ +_96="\""+k+"\""; +}else{ +if(typeof (k)=="string"){ +_96=_93(k); +}else{ +continue; +} +} +val=me(o[k]); +if(typeof (val)!="string"){ +continue; +} +res.push(_96+":"+val); +} +return "{"+res.join(", ")+"}"; +},objEqual:function(a,b){ +return (MochiKit.Base.compare(a,b)===0); +},arrayEqual:function(_97,arr){ +if(_97.length!=arr.length){ +return false; +} +return (MochiKit.Base.compare(_97,arr)===0); +},concat:function(){ +var _99=[]; +var _100=MochiKit.Base.extend; +for(var i=0;i<arguments.length;i++){ +_100(_99,arguments[i]); +} +return _99; +},keyComparator:function(key){ +var m=MochiKit.Base; +var _102=m.compare; +if(arguments.length==1){ +return function(a,b){ +return _102(a[key],b[key]); +}; +} +var _103=m.extend(null,arguments); +return function(a,b){ +var rval=0; +for(var i=0;(rval===0)&&(i<_103.length);i++){ +var key=_103[i]; +rval=_102(a[key],b[key]); +} +return rval; +}; +},reverseKeyComparator:function(key){ +var _105=MochiKit.Base.keyComparator.apply(this,arguments); +return function(a,b){ +return _105(b,a); +}; +},partial:function(func){ +var m=MochiKit.Base; +return m.bind.apply(this,m.extend([func,undefined],arguments,1)); +},listMinMax:function(_107,lst){ +if(lst.length===0){ +return null; +} +var cur=lst[0]; +var _109=MochiKit.Base.compare; +for(var i=1;i<lst.length;i++){ +var o=lst[i]; +if(_109(o,cur)==_107){ +cur=o; +} +} +return cur; +},objMax:function(){ +return MochiKit.Base.listMinMax(1,arguments); +},objMin:function(){ +return MochiKit.Base.listMinMax(-1,arguments); +},findIdentical:function(lst,_110,_111,end){ +if(typeof (end)=="undefined"||end===null){ +end=lst.length; +} +if(typeof (_111)=="undefined"||_111===null){ +_111=0; +} +for(var i=_111;i<end;i++){ +if(lst[i]===_110){ +return i; +} +} +return -1; +},mean:function(){ +var sum=0; +var m=MochiKit.Base; +var args=m.extend(null,arguments); +var _115=args.length; +while(args.length){ +var o=args.shift(); +if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){ +_115+=o.length-1; +for(var i=o.length-1;i>=0;i--){ +sum+=o[i]; +} +}else{ +sum+=o; +} +} +if(_115<=0){ +throw new TypeError("mean() requires at least one argument"); +} +return sum/_115; +},median:function(){ +var data=MochiKit.Base.flattenArguments(arguments); +if(data.length===0){ +throw new TypeError("median() requires at least one argument"); +} +data.sort(compare); +if(data.length%2==0){ +var _117=data.length/2; +return (data[_117]+data[_117-1])/2; +}else{ +return data[(data.length-1)/2]; +} +},findValue:function(lst,_118,_119,end){ +if(typeof (end)=="undefined"||end===null){ +end=lst.length; +} +if(typeof (_119)=="undefined"||_119===null){ +_119=0; +} +var cmp=MochiKit.Base.compare; +for(var i=_119;i<end;i++){ +if(cmp(lst[i],_118)===0){ +return i; +} +} +return -1; +},nodeWalk:function(node,_121){ +var _122=[node]; +var _123=MochiKit.Base.extend; +while(_122.length){ +var res=_121(_122.shift()); +if(res){ +_123(_122,res); +} +} +},nameFunctions:function(_124){ +var base=_124.NAME; +if(typeof (base)=="undefined"){ +base=""; +}else{ +base=base+"."; +} +for(var name in _124){ +var o=_124[name]; +if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){ +try{ +o.NAME=base+name; +} +catch(e){ +} +} +} +},queryString:function(_127,_128){ +if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_127)=="string"||(typeof (_127.nodeType)!="undefined"&&_127.nodeType>0))){ +var kv=MochiKit.DOM.formContents(_127); +_127=kv[0]; +_128=kv[1]; +}else{ +if(arguments.length==1){ +if(typeof (_127.length)=="number"&&_127.length==2){ +return arguments.callee(_127[0],_127[1]); +} +var o=_127; +_127=[]; +_128=[]; +for(var k in o){ +var v=o[k]; +if(typeof (v)=="function"){ +continue; +}else{ +if(typeof (v)!="string"&&typeof (v.length)=="number"){ +for(var i=0;i<v.length;i++){ +_127.push(k); +_128.push(v[i]); +} +}else{ +_127.push(k); +_128.push(v); +} +} +} +} +} +var rval=[]; +var len=Math.min(_127.length,_128.length); +var _131=MochiKit.Base.urlEncode; +for(var i=0;i<len;i++){ +v=_128[i]; +if(typeof (v)!="undefined"&&v!==null){ +rval.push(_131(_127[i])+"="+_131(v)); +} +} +return rval.join("&"); +},parseQueryString:function(_132,_133){ +var qstr=(_132.charAt(0)=="?")?_132.substring(1):_132; +var _135=qstr.replace(/\+/g,"%20").split(/(\&\;|\&\#38\;|\&|\&)/); +var o={}; +var _136; +if(typeof (decodeURIComponent)!="undefined"){ +_136=decodeURIComponent; +}else{ +_136=unescape; +} +if(_133){ +for(var i=0;i<_135.length;i++){ +var pair=_135[i].split("="); +if(pair.length!==2){ +continue; +} +var name=_136(pair[0]); +var arr=o[name]; +if(!(arr instanceof Array)){ +arr=[]; +o[name]=arr; +} +arr.push(_136(pair[1])); +} +}else{ +for(i=0;i<_135.length;i++){ +pair=_135[i].split("="); +if(pair.length!==2){ +continue; +} +o[_136(pair[0])]=_136(pair[1]); +} +} +return o; +}}); +MochiKit.Base.AdapterRegistry=function(){ +this.pairs=[]; +}; +MochiKit.Base.AdapterRegistry.prototype={register:function(name,_138,wrap,_140){ +if(_140){ +this.pairs.unshift([name,_138,wrap]); +}else{ +this.pairs.push([name,_138,wrap]); +} +},match:function(){ +for(var i=0;i<this.pairs.length;i++){ +var pair=this.pairs[i]; +if(pair[1].apply(this,arguments)){ +return pair[2].apply(this,arguments); +} +} +throw MochiKit.Base.NotFound; +},unregister:function(name){ +for(var i=0;i<this.pairs.length;i++){ +var pair=this.pairs[i]; +if(pair[0]==name){ +this.pairs.splice(i,1); +return true; +} +} +return false; +}}; +MochiKit.Base.EXPORT=["flattenArray","noop","camelize","counter","clone","extend","update","updatetree","setdefault","keys","values","items","NamedError","operator","forwardCall","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","isEmpty","isNotEmpty","isArrayLike","isDateLike","xmap","map","xfilter","filter","methodcaller","compose","bind","bindMethods","NotFound","AdapterRegistry","registerComparator","compare","registerRepr","repr","objEqual","arrayEqual","concat","keyComparator","reverseKeyComparator","partial","merge","listMinMax","listMax","listMin","objMax","objMin","nodeWalk","zip","urlEncode","queryString","serializeJSON","registerJSON","evalJSON","parseQueryString","findValue","findIdentical","flattenArguments","method","average","mean","median"]; +MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"]; +MochiKit.Base._exportSymbols=function(_141,_142){ +if(!MochiKit.__export__){ +return; +} +var all=_142.EXPORT_TAGS[":all"]; +for(var i=0;i<all.length;i++){ +_141[all[i]]=_142[all[i]]; +} +}; +MochiKit.Base.__new__=function(){ +var m=this; +m.noop=m.operator.identity; +m.forward=m.forwardCall; +m.find=m.findValue; +if(typeof (encodeURIComponent)!="undefined"){ +m.urlEncode=function(_144){ +return encodeURIComponent(_144).replace(/\'/g,"%27"); +}; +}else{ +m.urlEncode=function(_145){ +return escape(_145).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27"); +}; +} +m.NamedError=function(name){ +this.message=name; +this.name=name; +}; +m.NamedError.prototype=new Error(); +m.update(m.NamedError.prototype,{repr:function(){ +if(this.message&&this.message!=this.name){ +return this.name+"("+m.repr(this.message)+")"; +}else{ +return this.name+"()"; +} +},toString:m.forwardCall("repr")}); +m.NotFound=new m.NamedError("MochiKit.Base.NotFound"); +m.listMax=m.partial(m.listMinMax,1); +m.listMin=m.partial(m.listMinMax,-1); +m.isCallable=m.typeMatcher("function"); +m.isUndefined=m.typeMatcher("undefined"); +m.merge=m.partial(m.update,null); +m.zip=m.partial(m.map,null); +m.average=m.mean; +m.comparatorRegistry=new m.AdapterRegistry(); +m.registerComparator("dateLike",m.isDateLike,m.compareDateLike); +m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike); +m.reprRegistry=new m.AdapterRegistry(); +m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike); +m.registerRepr("string",m.typeMatcher("string"),m.reprString); +m.registerRepr("numbers",m.typeMatcher("number","boolean"),m.reprNumber); +m.jsonRegistry=new m.AdapterRegistry(); +var all=m.concat(m.EXPORT,m.EXPORT_OK); +m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all}; +m.nameFunctions(this); +}; +MochiKit.Base.__new__(); +if(MochiKit.__export__){ +compare=MochiKit.Base.compare; +compose=MochiKit.Base.compose; +serializeJSON=MochiKit.Base.serializeJSON; +} +MochiKit.Base._exportSymbols(this,MochiKit.Base); +if(typeof (dojo)!="undefined"){ +dojo.provide("MochiKit.DOM"); +dojo.require("MochiKit.Base"); +} +if(typeof (JSAN)!="undefined"){ +JSAN.use("MochiKit.Base",[]); +} +try{ +if(typeof (MochiKit.Base)=="undefined"){ +throw ""; +} +} +catch(e){ +throw "MochiKit.DOM depends on MochiKit.Base!"; +} +if(typeof (MochiKit.DOM)=="undefined"){ +MochiKit.DOM={}; +} +MochiKit.DOM.NAME="MochiKit.DOM"; +MochiKit.DOM.VERSION="1.4"; +MochiKit.DOM.__repr__=function(){ +return "["+this.NAME+" "+this.VERSION+"]"; +}; +MochiKit.DOM.toString=function(){ +return this.__repr__(); +}; +MochiKit.DOM.EXPORT=["removeEmptyTextNodes","formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","isChildNode","getNodeAttribute","setNodeAttribute","updateNodeAttributes","appendChildNodes","replaceChildNodes","removeElement","swapDOM","BUTTON","TT","PRE","H1","H2","H3","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","escapeHTML","toHTML","emitHTML","scrapeText","isParent","makeClipping","undoClipping","makePositioned","undoPositioned","getFirstElementByTagAndClassName"]; +MochiKit.DOM.EXPORT_OK=["domConverters"]; +MochiKit.DOM.DEPRECATED=[["computedStyle","MochiKit.Style.computedStyle","1.4"],["elementDimensions","MochiKit.Style.getElementDimensions","1.4"],["elementPosition","MochiKit.Style.getElementPosition","1.4"],["hideElement","MochiKit.Style.hideElement","1.4"],["setElementDimensions","MochiKit.Style.setElementDimensions","1.4"],["setElementPosition","MochiKit.Style.setElementPosition","1.4"],["setDisplayForElement","MochiKit.Style.setDisplayForElement","1.4"],["setOpacity","MochiKit.Style.setOpacity","1.4"],["showElement","MochiKit.Style.showElement","1.4"],["Coordinates","MochiKit.Style.Coordinates","1.4"],["Dimensions","MochiKit.Style.Dimensions","1.4"]]; +MochiKit.DOM.getViewportDimensions=new Function(""+"if (!MochiKit[\"Style\"]) {"+" throw new Error(\"This function has been deprecated and depends on MochiKit.Style.\");"+"}"+"return MochiKit.Style.getViewportDimensions.apply(this, arguments);"); +MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){ +return MochiKit.DOM._window; +},currentDocument:function(){ +return MochiKit.DOM._document; +},withWindow:function(win,func){ +var self=MochiKit.DOM; +var _148=self._document; +var _149=self._win; +var rval; +try{ +self._window=win; +self._document=win.document; +rval=func(); +} +catch(e){ +self._window=_149; +self._document=_148; +throw e; +} +self._window=_149; +self._document=_148; +return rval; +},formContents:function(elem){ +var _151=[]; +var _152=[]; +var m=MochiKit.Base; +var self=MochiKit.DOM; +if(typeof (elem)=="undefined"||elem===null){ +elem=self._document.body; +}else{ +elem=self.getElement(elem); +} +m.nodeWalk(elem,function(elem){ +var name=elem.name; +if(m.isNotEmpty(name)){ +var _153=elem.tagName.toUpperCase(); +if(_153==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){ +return null; +} +if(_153==="SELECT"){ +if(elem.type=="select-one"){ +if(elem.selectedIndex>=0){ +var opt=elem.options[elem.selectedIndex]; +_151.push(name); +_152.push(opt.value); +return null; +} +_151.push(name); +_152.push(""); +return null; +}else{ +var opts=elem.options; +if(!opts.length){ +_151.push(name); +_152.push(""); +return null; +} +for(var i=0;i<opts.length;i++){ +var opt=opts[i]; +if(!opt.selected){ +continue; +} +_151.push(name); +_152.push(opt.value); +} +return null; +} +} +if(_153==="FORM"||_153==="P"||_153==="SPAN"||_153==="DIV"){ +return elem.childNodes; +} +_151.push(name); +_152.push(elem.value||""); +return null; +} +return elem.childNodes; +}); +return [_151,_152]; +},withDocument:function(doc,func){ +var self=MochiKit.DOM; +var _157=self._document; +var rval; +try{ +self._document=doc; +rval=func(); +} +catch(e){ +self._document=_157; +throw e; +} +self._document=_157; +return rval; +},registerDOMConverter:function(name,_158,wrap,_159){ +MochiKit.DOM.domConverters.register(name,_158,wrap,_159); +},coerceToDOM:function(node,ctx){ +var m=MochiKit.Base; +var im=MochiKit.Iter; +var self=MochiKit.DOM; +if(im){ +var iter=im.iter; +var _163=im.repeat; +var map=m.map; +} +var _165=self.domConverters; +var _166=arguments.callee; +var _167=m.NotFound; +while(true){ +if(typeof (node)=="undefined"||node===null){ +return null; +} +if(typeof (node.nodeType)!="undefined"&&node.nodeType>0){ +return node; +} +if(typeof (node)=="number"||typeof (node)=="boolean"){ +node=node.toString(); +} +if(typeof (node)=="string"){ +return self._document.createTextNode(node); +} +if(typeof (node.__dom__)=="function"){ +node=node.__dom__(ctx); +continue; +} +if(typeof (node.dom)=="function"){ +node=node.dom(ctx); +continue; +} +if(typeof (node)=="function"){ +node=node.apply(ctx,[ctx]); +continue; +} +if(im){ +var _168=null; +try{ +_168=iter(node); +} +catch(e){ +} +if(_168){ +return map(_166,_168,_163(ctx)); +} +} +try{ +node=_165.match(node,ctx); +continue; +} +catch(e){ +if(e!=_167){ +throw e; +} +} +return self._document.createTextNode(node.toString()); +} +return undefined; +},isChildNode:function(node,_169){ +var self=MochiKit.DOM; +if(typeof (node)=="string"){ +node=self.getElement(node); +} +if(typeof (_169)=="string"){ +_169=self.getElement(_169); +} +if(node===_169){ +return true; +} +while(node&&node.tagName.toUpperCase()!="BODY"){ +node=node.parentNode; +if(node===_169){ +return true; +} +} +return false; +},setNodeAttribute:function(node,attr,_171){ +var o={}; +o[attr]=_171; +try{ +return MochiKit.DOM.updateNodeAttributes(node,o); +} +catch(e){ +} +return null; +},getNodeAttribute:function(node,attr){ +var self=MochiKit.DOM; +var _172=self.attributeArray.renames[attr]; +node=self.getElement(node); +try{ +if(_172){ +return node[_172]; +} +return node.getAttribute(attr); +} +catch(e){ +} +return null; +},updateNodeAttributes:function(node,_173){ +var elem=node; +var self=MochiKit.DOM; +if(typeof (node)=="string"){ +elem=self.getElement(node); +} +if(_173){ +var _174=MochiKit.Base.updatetree; +if(self.attributeArray.compliant){ +for(var k in _173){ +var v=_173[k]; +if(typeof (v)=="object"&&typeof (elem[k])=="object"){ +_174(elem[k],v); +}else{ +if(k.substring(0,2)=="on"){ +if(typeof (v)=="string"){ +v=new Function(v); +} +elem[k]=v; +}else{ +elem.setAttribute(k,v); +} +} +} +}else{ +var _175=self.attributeArray.renames; +for(k in _173){ +v=_173[k]; +var _176=_175[k]; +if(k=="style"&&typeof (v)=="string"){ +elem.style.cssText=v; +}else{ +if(typeof (_176)=="string"){ +elem[_176]=v; +}else{ +if(typeof (elem[k])=="object"&&typeof (v)=="object"){ +_174(elem[k],v); +}else{ +if(k.substring(0,2)=="on"){ +if(typeof (v)=="string"){ +v=new Function(v); +} +elem[k]=v; +}else{ +elem.setAttribute(k,v); +} +} +} +} +} +} +} +return elem; +},appendChildNodes:function(node){ +var elem=node; +var self=MochiKit.DOM; +if(typeof (node)=="string"){ +elem=self.getElement(node); +} +var _177=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)]; +var _178=MochiKit.Base.concat; +while(_177.length){ +var n=_177.shift(); +if(typeof (n)=="undefined"||n===null){ +}else{ +if(typeof (n.nodeType)=="number"){ +elem.appendChild(n); +}else{ +_177=_178(n,_177); +} +} +} +return elem; +},replaceChildNodes:function(node){ +var elem=node; +var self=MochiKit.DOM; +if(typeof (node)=="string"){ +elem=self.getElement(node); +arguments[0]=elem; +} +var _179; +while((_179=elem.firstChild)){ +elem.removeChild(_179); +} +if(arguments.length<2){ +return elem; +}else{ +return self.appendChildNodes.apply(this,arguments); +} +},createDOM:function(name,_180){ +var elem; +var self=MochiKit.DOM; +var m=MochiKit.Base; +if(typeof (_180)=="string"||typeof (_180)=="number"){ +var args=m.extend([name,null],arguments,1); +return arguments.callee.apply(this,args); +} +if(typeof (name)=="string"){ +var _181=self._xhtml; +if(_180&&!self.attributeArray.compliant){ +var _182=""; +if("name" in _180){ +_182+=" name=\""+self.escapeHTML(_180.name)+"\""; +} +if(name=="input"&&"type" in _180){ +_182+=" type=\""+self.escapeHTML(_180.type)+"\""; +} +if(_182){ +name="<"+name+_182+">"; +_181=false; +} +} +var d=self._document; +if(_181&&d===document){ +elem=d.createElementNS("http://www.w3.org/1999/xhtml",name); +}else{ +elem=d.createElement(name); +} +}else{ +elem=name; +} +if(_180){ +self.updateNodeAttributes(elem,_180); +} +if(arguments.length<=2){ +return elem; +}else{ +var args=m.extend([elem],arguments,2); +return self.appendChildNodes.apply(this,args); +} +},createDOMFunc:function(){ +var m=MochiKit.Base; +return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments)); +},removeElement:function(elem){ +var e=MochiKit.DOM.getElement(elem); +e.parentNode.removeChild(e); +return e; +},swapDOM:function(dest,src){ +var self=MochiKit.DOM; +dest=self.getElement(dest); +var _186=dest.parentNode; +if(src){ +src=self.getElement(src); +_186.replaceChild(src,dest); +}else{ +_186.removeChild(dest); +} +return src; +},getElement:function(id){ +var self=MochiKit.DOM; +if(arguments.length==1){ +return ((typeof (id)=="string")?self._document.getElementById(id):id); +}else{ +return MochiKit.Base.map(self.getElement,arguments); +} +},getElementsByTagAndClassName:function(_188,_189,_190){ +var self=MochiKit.DOM; +if(typeof (_188)=="undefined"||_188===null){ +_188="*"; +} +if(typeof (_190)=="undefined"||_190===null){ +_190=self._document; +} +_190=self.getElement(_190); +var _191=(_190.getElementsByTagName(_188)||self._document.all); +if(typeof (_189)=="undefined"||_189===null){ +return MochiKit.Base.extend(null,_191); +} +var _192=[]; +for(var i=0;i<_191.length;i++){ +var _193=_191[i]; +var cls=_193.className; +if(!cls){ +continue; +} +var _195=cls.split(" "); +for(var j=0;j<_195.length;j++){ +if(_195[j]==_189){ +_192.push(_193); +break; +} +} +} +return _192; +},_newCallStack:function(path,once){ +var rval=function(){ +var _198=arguments.callee.callStack; +for(var i=0;i<_198.length;i++){ +if(_198[i].apply(this,arguments)===false){ +break; +} +} +if(once){ +try{ +this[path]=null; +} +catch(e){ +} +} +}; +rval.callStack=[]; +return rval; +},addToCallStack:function(_199,path,func,once){ +var self=MochiKit.DOM; +var _200=_199[path]; +var _201=_200; +if(!(typeof (_200)=="function"&&typeof (_200.callStack)=="object"&&_200.callStack!==null)){ +_201=self._newCallStack(path,once); +if(typeof (_200)=="function"){ +_201.callStack.push(_200); +} +_199[path]=_201; +} +_201.callStack.push(func); +},addLoadEvent:function(func){ +var self=MochiKit.DOM; +self.addToCallStack(self._window,"onload",func,true); +},focusOnLoad:function(_202){ +var self=MochiKit.DOM; +self.addLoadEvent(function(){ +_202=self.getElement(_202); +if(_202){ +_202.focus(); +} +}); +},setElementClass:function(_203,_204){ +var self=MochiKit.DOM; +var obj=self.getElement(_203); +if(self.attributeArray.compliant){ +obj.setAttribute("class",_204); +}else{ +obj.setAttribute("className",_204); +} +},toggleElementClass:function(_205){ +var self=MochiKit.DOM; +for(var i=1;i<arguments.length;i++){ +var obj=self.getElement(arguments[i]); +if(!self.addElementClass(obj,_205)){ +self.removeElementClass(obj,_205); +} +} +},addElementClass:function(_206,_207){ +var self=MochiKit.DOM; +var obj=self.getElement(_206); +var cls=obj.className; +if(cls==undefined||cls.length===0){ +self.setElementClass(obj,_207); +return true; +} +if(cls==_207){ +return false; +} +var _208=cls.split(" "); +for(var i=0;i<_208.length;i++){ +if(_208[i]==_207){ +return false; +} +} +self.setElementClass(obj,cls+" "+_207); +return true; +},removeElementClass:function(_209,_210){ +var self=MochiKit.DOM; +var obj=self.getElement(_209); +var cls=obj.className; +if(cls==undefined||cls.length===0){ +return false; +} +if(cls==_210){ +self.setElementClass(obj,""); +return true; +} +var _211=cls.split(" "); +for(var i=0;i<_211.length;i++){ +if(_211[i]==_210){ +_211.splice(i,1); +self.setElementClass(obj,_211.join(" ")); +return true; +} +} +return false; +},swapElementClass:function(_212,_213,_214){ +var obj=MochiKit.DOM.getElement(_212); +var res=MochiKit.DOM.removeElementClass(obj,_213); +if(res){ +MochiKit.DOM.addElementClass(obj,_214); +} +return res; +},hasElementClass:function(_215,_216){ +var obj=MochiKit.DOM.getElement(_215); +var cls=obj.className; +if(!cls){ +return false; +} +var _217=cls.split(" "); +for(var i=1;i<arguments.length;i++){ +var good=false; +for(var j=0;j<_217.length;j++){ +if(_217[j]==arguments[i]){ +good=true; +break; +} +} +if(!good){ +return false; +} +} +return true; +},escapeHTML:function(s){ +return s.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"); +},toHTML:function(dom){ +return MochiKit.DOM.emitHTML(dom).join(""); +},emitHTML:function(dom,lst){ +if(typeof (lst)=="undefined"||lst===null){ +lst=[]; +} +var _221=[dom]; +var self=MochiKit.DOM; +var _222=self.escapeHTML; +var _223=self.attributeArray; +while(_221.length){ +dom=_221.pop(); +if(typeof (dom)=="string"){ +lst.push(dom); +}else{ +if(dom.nodeType==1){ +lst.push("<"+dom.tagName.toLowerCase()); +var _224=[]; +var _225=_223(dom); +for(var i=0;i<_225.length;i++){ +var a=_225[i]; +_224.push([" ",a.name,"=\"",_222(a.value),"\""]); +} +_224.sort(); +for(i=0;i<_224.length;i++){ +var _226=_224[i]; +for(var j=0;j<_226.length;j++){ +lst.push(_226[j]); +} +} +if(dom.hasChildNodes()){ +lst.push(">"); +_221.push("</"+dom.tagName.toLowerCase()+">"); +var _227=dom.childNodes; +for(i=_227.length-1;i>=0;i--){ +_221.push(_227[i]); +} +}else{ +lst.push("/>"); +} +}else{ +if(dom.nodeType==3){ +lst.push(_222(dom.nodeValue)); +} +} +} +} +return lst; +},scrapeText:function(node,_228){ +var rval=[]; +(function(node){ +var cn=node.childNodes; +if(cn){ +for(var i=0;i<cn.length;i++){ +arguments.callee.call(this,cn[i]); +} +} +var _230=node.nodeValue; +if(typeof (_230)=="string"){ +rval.push(_230); +} +})(MochiKit.DOM.getElement(node)); +if(_228){ +return rval; +}else{ +return rval.join(""); +} +},removeEmptyTextNodes:function(_231){ +_231=MochiKit.DOM.getElement(_231); +for(var i=0;i<_231.childNodes.length;i++){ +var node=_231.childNodes[i]; +if(node.nodeType==3&&!/\S/.test(node.nodeValue)){ +node.parentNode.removeChild(node); +} +} +},makeClipping:function(_232){ +_232=MochiKit.DOM.getElement(_232); +var _233=_232.style.overflow; +if((MochiKit.Style.getStyle(_232,"overflow")||"visible")!="hidden"){ +_232.style.overflow="hidden"; +} +return _233; +},undoClipping:function(_234,_235){ +_234=MochiKit.DOM.getElement(_234); +if(!_235){ +return; +} +_234.style.overflow=_235; +},makePositioned:function(_236){ +_236=MochiKit.DOM.getElement(_236); +var pos=MochiKit.Style.getStyle(_236,"position"); +if(pos=="static"||!pos){ +_236.style.position="relative"; +if(/Opera/.test(navigator.userAgent)){ +_236.style.top=0; +_236.style.left=0; +} +} +},undoPositioned:function(_238){ +_238=MochiKit.DOM.getElement(_238); +if(_238.style.position=="relative"){ +_238.style.position=_238.style.top=_238.style.left=_238.style.bottom=_238.style.right=""; +} +},getFirstElementByTagAndClassName:function(_239,_240,_241){ +var self=MochiKit.DOM; +if(typeof (_239)=="undefined"||_239===null){ +_239="*"; +} +if(typeof (_241)=="undefined"||_241===null){ +_241=self._document; +} +_241=self.getElement(_241); +var _242=(_241.getElementsByTagName(_239)||self._document.all); +if(typeof (_240)=="undefined"||_240===null){ +return _242[0]; +} +for(var i=0;i<_242.length;i++){ +var _243=_242[i]; +var _244=_243.className.split(" "); +for(var j=0;j<_244.length;j++){ +if(_244[j]==_240){ +return _243; +} +} +} +},isParent:function(_245,_246){ +if(!_245.parentNode||_245==_246){ +return false; +} +if(_245.parentNode==_246){ +return true; +} +return MochiKit.DOM.isParent(_245.parentNode,_246); +},__new__:function(win){ +var m=MochiKit.Base; +if(typeof (document)!="undefined"){ +this._document=document; +var _247="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; +this._xhtml=(document.documentElement&&document.createElementNS&&document.documentElement.namespaceURI===_247); +}else{ +if(MochiKit.MockDOM){ +this._document=MochiKit.MockDOM.document; +} +} +this._window=win; +this.domConverters=new m.AdapterRegistry(); +var _248=this._document.createElement("span"); +var _249; +if(_248&&_248.attributes&&_248.attributes.length>0){ +var _250=m.filter; +_249=function(node){ +return _250(_249.ignoreAttrFilter,node.attributes); +}; +_249.ignoreAttr={}; +var _251=_248.attributes; +var _252=_249.ignoreAttr; +for(var i=0;i<_251.length;i++){ +var a=_251[i]; +_252[a.name]=a.value; +} +_249.ignoreAttrFilter=function(a){ +return (_249.ignoreAttr[a.name]!=a.value); +}; +_249.compliant=false; +_249.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly","colspan":"colSpan","bgcolor":"bgColor"}; +}else{ +_249=function(node){ +return node.attributes; +}; +_249.compliant=true; +_249.renames={}; +} +this.attributeArray=_249; +var _253=function(_254,arr){ +var _255=arr[1].split("."); +var str=""; +var obj={}; +str+="if (!MochiKit."+_255[1]+") { throw new Error(\""; +str+="This function has been deprecated and depends on MochiKit."; +str+=_255[1]+".\");}"; +str+="return MochiKit."+_255[1]+"."+arr[0]; +str+=".apply(this, arguments);"; +obj[_255[2]]=new Function(str); +MochiKit.Base.update(MochiKit[_254],obj); +}; +for(var i;i<MochiKit.DOM.DEPRECATED.length;i++){ +_253("DOM",MochiKit.DOM.DEPRECATED[i]); +} +var _257=this.createDOMFunc; +this.UL=_257("ul"); +this.OL=_257("ol"); +this.LI=_257("li"); +this.TD=_257("td"); +this.TR=_257("tr"); +this.TBODY=_257("tbody"); +this.THEAD=_257("thead"); +this.TFOOT=_257("tfoot"); +this.TABLE=_257("table"); +this.TH=_257("th"); +this.INPUT=_257("input"); +this.SPAN=_257("span"); +this.A=_257("a"); +this.DIV=_257("div"); +this.IMG=_257("img"); +this.BUTTON=_257("button"); +this.TT=_257("tt"); +this.PRE=_257("pre"); +this.H1=_257("h1"); +this.H2=_257("h2"); +this.H3=_257("h3"); +this.BR=_257("br"); +this.HR=_257("hr"); +this.LABEL=_257("label"); +this.TEXTAREA=_257("textarea"); +this.FORM=_257("form"); +this.P=_257("p"); +this.SELECT=_257("select"); +this.OPTION=_257("option"); +this.OPTGROUP=_257("optgroup"); +this.LEGEND=_257("legend"); +this.FIELDSET=_257("fieldset"); +this.STRONG=_257("strong"); +this.CANVAS=_257("canvas"); +this.$=this.getElement; +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; +m.nameFunctions(this); +}}); +MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window)); +if(MochiKit.__export__){ +withWindow=MochiKit.DOM.withWindow; +withDocument=MochiKit.DOM.withDocument; +} +MochiKit.Base._exportSymbols(this,MochiKit.DOM); +if(typeof (dojo)!="undefined"){ +dojo.provide("MochiKit.Async"); +dojo.require("MochiKit.Base"); +} +if(typeof (JSAN)!="undefined"){ +JSAN.use("MochiKit.Base",[]); +} +try{ +if(typeof (MochiKit.Base)=="undefined"){ +throw ""; +} +} +catch(e){ +throw "MochiKit.Async depends on MochiKit.Base!"; +} +if(typeof (MochiKit.Async)=="undefined"){ +MochiKit.Async={}; +} +MochiKit.Async.NAME="MochiKit.Async"; +MochiKit.Async.VERSION="1.4"; +MochiKit.Async.__repr__=function(){ +return "["+this.NAME+" "+this.VERSION+"]"; +}; +MochiKit.Async.toString=function(){ +return this.__repr__(); +}; +MochiKit.Async.Deferred=function(_258){ +this.chain=[]; +this.id=this._nextId(); +this.fired=-1; +this.paused=0; +this.results=[null,null]; +this.canceller=_258; +this.silentlyCancelled=false; +this.chained=false; +}; +MochiKit.Async.Deferred.prototype={repr:function(){ +var _259; +if(this.fired==-1){ +_259="unfired"; +}else{ +if(this.fired===0){ +_259="success"; +}else{ +_259="error"; +} +} +return "Deferred("+this.id+", "+_259+")"; +},toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){ +var self=MochiKit.Async; +if(this.fired==-1){ +if(this.canceller){ +this.canceller(this); +}else{ +this.silentlyCancelled=true; +} +if(this.fired==-1){ +this.errback(new self.CancelledError(this)); +} +}else{ +if((this.fired===0)&&(this.results[0] instanceof self.Deferred)){ +this.results[0].cancel(); +} +} +},_resback:function(res){ +this.fired=((res instanceof Error)?1:0); +this.results[this.fired]=res; +this._fire(); +},_check:function(){ +if(this.fired!=-1){ +if(!this.silentlyCancelled){ +throw new MochiKit.Async.AlreadyCalledError(this); +} +this.silentlyCancelled=false; +return; +} +},callback:function(res){ +this._check(); +if(res instanceof MochiKit.Async.Deferred){ +throw new Error("Deferred instances can only be chained if they are the result of a callback"); +} +this._resback(res); +},errback:function(res){ +this._check(); +var self=MochiKit.Async; +if(res instanceof self.Deferred){ +throw new Error("Deferred instances can only be chained if they are the result of a callback"); +} +if(!(res instanceof Error)){ +res=new self.GenericError(res); +} +this._resback(res); +},addBoth:function(fn){ +if(arguments.length>1){ +fn=MochiKit.Base.partial.apply(null,arguments); +} +return this.addCallbacks(fn,fn); +},addCallback:function(fn){ +if(arguments.length>1){ +fn=MochiKit.Base.partial.apply(null,arguments); +} +return this.addCallbacks(fn,null); +},addErrback:function(fn){ +if(arguments.length>1){ +fn=MochiKit.Base.partial.apply(null,arguments); +} +return this.addCallbacks(null,fn); +},addCallbacks:function(cb,eb){ +if(this.chained){ +throw new Error("Chained Deferreds can not be re-used"); +} +this.chain.push([cb,eb]); +if(this.fired>=0){ +this._fire(); +} +return this; +},_fire:function(){ +var _262=this.chain; +var _263=this.fired; +var res=this.results[_263]; +var self=this; +var cb=null; +while(_262.length>0&&this.paused===0){ +var pair=_262.shift(); +var f=pair[_263]; +if(f===null){ +continue; +} +try{ +res=f(res); +_263=((res instanceof Error)?1:0); +if(res instanceof MochiKit.Async.Deferred){ +cb=function(res){ +self._resback(res); +self.paused--; +if((self.paused===0)&&(self.fired>=0)){ +self._fire(); +} +}; +this.paused++; +} +} +catch(err){ +_263=1; +if(!(err instanceof Error)){ +err=new MochiKit.Async.GenericError(err); +} +res=err; +} +} +this.fired=_263; +this.results[_263]=res; +if(cb&&this.paused){ +res.addBoth(cb); +res.chained=true; +} +}}; +MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(){ +return eval("("+arguments[0].responseText+")"); +},succeed:function(_265){ +var d=new MochiKit.Async.Deferred(); +d.callback.apply(d,arguments); +return d; +},fail:function(_266){ +var d=new MochiKit.Async.Deferred(); +d.errback.apply(d,arguments); +return d; +},getXMLHttpRequest:function(){ +var self=arguments.callee; +if(!self.XMLHttpRequest){ +var _267=[function(){ +return new XMLHttpRequest(); +},function(){ +return new ActiveXObject("Msxml2.XMLHTTP"); +},function(){ +return new ActiveXObject("Microsoft.XMLHTTP"); +},function(){ +return new ActiveXObject("Msxml2.XMLHTTP.4.0"); +},function(){ +throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest"); +}]; +for(var i=0;i<_267.length;i++){ +var func=_267[i]; +try{ +self.XMLHttpRequest=func; +return func(); +} +catch(e){ +} +} +} +return self.XMLHttpRequest(); +},_xhr_onreadystatechange:function(d){ +var m=MochiKit.Base; +if(this.readyState==4){ +try{ +this.onreadystatechange=null; +} +catch(e){ +try{ +this.onreadystatechange=m.noop; +} +catch(e){ +} +} +var _268=null; +try{ +_268=this.status; +if(!_268&&m.isNotEmpty(this.responseText)){ +_268=304; +} +} +catch(e){ +} +if(_268==200||_268==304){ +d.callback(this); +}else{ +var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed"); +if(err.number){ +d.errback(err); +}else{ +d.errback(err); +} +} +} +},_xhr_canceller:function(req){ +try{ +req.onreadystatechange=null; +} +catch(e){ +try{ +req.onreadystatechange=MochiKit.Base.noop; +} +catch(e){ +} +} +req.abort(); +},sendXMLHttpRequest:function(req,_271){ +if(typeof (_271)=="undefined"||_271===null){ +_271=""; +} +var m=MochiKit.Base; +var self=MochiKit.Async; +var d=new self.Deferred(m.partial(self._xhr_canceller,req)); +try{ +req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d); +req.send(_271); +} +catch(e){ +try{ +req.onreadystatechange=null; +} +catch(ignore){ +} +d.errback(e); +} +return d; +},doXHR:function(url,opts){ +var m=MochiKit.Base; +opts=m.update({method:"GET",sendContent:""},opts); +var self=MochiKit.Async; +var req=self.getXMLHttpRequest(); +if(opts.queryString){ +var qs=m.queryString(opts.queryString); +if(qs){ +url+="?"+qs; +} +} +req.open(opts.method,url,true,opts.username,opts.password); +if(req.overrideMimeType&&opts.mimeType){ +req.overrideMimeType(opts.mimeType); +} +if(opts.headers){ +var _274=opts.headers; +if(!m.isArrayLike(_274)){ +_274=m.items(_274); +} +for(var i=0;i<_274.length;i++){ +var _275=_274[i]; +var name=_275[0]; +var _276=_275[1]; +req.setRequestHeader(name,_276); +} +} +return self.sendXMLHttpRequest(req,opts.sendContent); +},_buildURL:function(url){ +if(arguments.length>1){ +var m=MochiKit.Base; +var qs=m.queryString.apply(null,m.extend(null,arguments,1)); +if(qs){ +return url+"?"+qs; +} +} +return url; +},doSimpleXMLHttpRequest:function(url){ +var self=MochiKit.Async; +url=self._buildURL.apply(self,arguments); +return self.doXHR(url); +},loadJSONDoc:function(url){ +var self=MochiKit.Async; +url=self._buildURL.apply(self,arguments); +var d=self.doXHR(url,{"mimeType":"text/plain","headers":[["Accept","application/json"]]}); +d=d.addCallback(self.evalJSONRequest); +return d; +},wait:function(_277,_278){ +var d=new MochiKit.Async.Deferred(); +var m=MochiKit.Base; +if(typeof (_278)!="undefined"){ +d.addCallback(function(){ +return _278; +}); +} +var _279=setTimeout(m.bind("callback",d),Math.floor(_277*1000)); +d.canceller=function(){ +try{ +clearTimeout(_279); +} +catch(e){ +} +}; +return d; +},callLater:function(_280,func){ +var m=MochiKit.Base; +var _281=m.partial.apply(m,m.extend(null,arguments,1)); +return MochiKit.Async.wait(_280).addCallback(function(res){ +return _281(); +}); +}}); +MochiKit.Async.DeferredLock=function(){ +this.waiting=[]; +this.locked=false; +this.id=this._nextId(); +}; +MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){ +var d=new MochiKit.Async.Deferred(); +if(this.locked){ +this.waiting.push(d); +}else{ +this.locked=true; +d.callback(this); +} +return d; +},release:function(){ +if(!this.locked){ +throw TypeError("Tried to release an unlocked DeferredLock"); +} +this.locked=false; +if(this.waiting.length>0){ +this.locked=true; +this.waiting.shift().callback(this); +} +},_nextId:MochiKit.Base.counter(),repr:function(){ +var _282; +if(this.locked){ +_282="locked, "+this.waiting.length+" waiting"; +}else{ +_282="unlocked"; +} +return "DeferredLock("+this.id+", "+_282+")"; +},toString:MochiKit.Base.forwardCall("repr")}; +MochiKit.Async.DeferredList=function(list,_284,_285,_286,_287){ +MochiKit.Async.Deferred.apply(this,[_287]); +this.list=list; +var _288=[]; +this.resultList=_288; +this.finishedCount=0; +this.fireOnOneCallback=_284; +this.fireOnOneErrback=_285; +this.consumeErrors=_286; +var cb=MochiKit.Base.bind(this._cbDeferred,this); +for(var i=0;i<list.length;i++){ +var d=list[i]; +_288.push(undefined); +d.addCallback(cb,i,true); +d.addErrback(cb,i,false); +} +if(list.length===0&&!_284){ +this.callback(this.resultList); +} +}; +MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred(); +MochiKit.Async.DeferredList.prototype._cbDeferred=function(_289,_290,_291){ +this.resultList[_289]=[_290,_291]; +this.finishedCount+=1; +if(this.fired==-1){ +if(_290&&this.fireOnOneCallback){ +this.callback([_289,_291]); +}else{ +if(!_290&&this.fireOnOneErrback){ +this.errback(_291); +}else{ +if(this.finishedCount==this.list.length){ +this.callback(this.resultList); +} +} +} +} +if(!_290&&this.consumeErrors){ +_291=null; +} +return _291; +}; +MochiKit.Async.gatherResults=function(_292){ +var d=new MochiKit.Async.DeferredList(_292,false,true,false); +d.addCallback(function(_293){ +var ret=[]; +for(var i=0;i<_293.length;i++){ +ret.push(_293[i][1]); +} +return ret; +}); +return d; +}; +MochiKit.Async.maybeDeferred=function(func){ +var self=MochiKit.Async; +var _295; +try{ +var r=func.apply(null,MochiKit.Base.extend([],arguments,1)); +if(r instanceof self.Deferred){ +_295=r; +}else{ +if(r instanceof Error){ +_295=self.fail(r); +}else{ +_295=self.succeed(r); +} +} +} +catch(e){ +_295=self.fail(e); +} +return _295; +}; +MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred","doXHR"]; +MochiKit.Async.EXPORT_OK=["evalJSONRequest"]; +MochiKit.Async.__new__=function(){ +var m=MochiKit.Base; +var ne=m.partial(m._newNamedError,this); +ne("AlreadyCalledError",function(_298){ +this.deferred=_298; +}); +ne("CancelledError",function(_299){ +this.deferred=_299; +}); +ne("BrowserComplianceError",function(msg){ +this.message=msg; +}); +ne("GenericError",function(msg){ +this.message=msg; +}); +ne("XMLHttpRequestError",function(req,msg){ +this.req=req; +this.message=msg; +try{ +this.number=req.status; +} +catch(e){ +} +}); +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)}; +m.nameFunctions(this); +}; +MochiKit.Async.__new__(); +MochiKit.Base._exportSymbols(this,MochiKit.Async); + + Property changes on: pieforms/src/js/MochiKit/MochiKit.js ___________________________________________________________________ Name: svn:mime-type + text/javascript Modified: pieforms/src/pieform.php =================================================================== --- pieforms/src/pieform.php 2006-11-19 01:11:51 UTC (rev 34) +++ pieforms/src/pieform.php 2006-11-19 01:53:05 UTC (rev 35) @@ -79,6 +79,14 @@ // } +if (!function_exists('json_encode')) { + function json_encode($data) { + require_once 'JSON/JSON.php'; + $json = new Services_JSON(); + return $json->encode($data); + } +} + /** * Pieform throws PieformExceptions, so you can catch them specifically */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 01:11:51
|
Revision: 34 http://svn.sourceforge.net/pieforms/?rev=34&view=rev Author: oracleshinoda Date: 2006-11-18 17:11:51 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Disabled cancel buttons for AJAX submission (opened bug 1599046 to track how to implement them properly) Modified Paths: -------------- pieforms/src/pieform/elements/cancel.php Modified: pieforms/src/pieform/elements/cancel.php =================================================================== --- pieforms/src/pieform/elements/cancel.php 2006-11-19 00:41:24 UTC (rev 33) +++ pieforms/src/pieform/elements/cancel.php 2006-11-19 01:11:51 UTC (rev 34) @@ -50,9 +50,10 @@ // or allow the user to specify a javascript function to run... it could do document.location= // @todo also, cancel buttons don't need to be sent around via js... maybe make this return empty string function pieform_get_value_js_cancel($element, Pieform $form) { - $formname = $form->get_name(); - $name = $element['name']; - return " data['{$name}_cancel'] = document.forms['$formname'].elements['{$name}_cancel'].value;\n"; + //$formname = $form->get_name(); + //$name = $element['name']; + //return " data['{$name}_cancel'] = document.forms['$formname'].elements['{$name}_cancel'].value;\n"; + return ''; } ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 00:41:25
|
Revision: 33 http://svn.sourceforge.net/pieforms/?rev=33&view=rev Author: oracleshinoda Date: 2006-11-18 16:41:24 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Prevent HTML elements from returning js for ajax submit Modified Paths: -------------- pieforms/src/pieform/elements/html.php Modified: pieforms/src/pieform/elements/html.php =================================================================== --- pieforms/src/pieform/elements/html.php 2006-11-19 00:36:14 UTC (rev 32) +++ pieforms/src/pieform/elements/html.php 2006-11-19 00:41:24 UTC (rev 33) @@ -41,4 +41,8 @@ return $element; } +function pieform_get_value_js_html() { + return ''; +} + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-19 00:36:14
|
Revision: 32 http://svn.sourceforge.net/pieforms/?rev=32&view=rev Author: oracleshinoda Date: 2006-11-18 16:36:14 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Generalised processingStart and processingStop to be configurable. Now validation of JS callback names is done. Properly i18n'd a couple of ajax related strings Modified Paths: -------------- pieforms/src/pieform.php Modified: pieforms/src/pieform.php =================================================================== --- pieforms/src/pieform.php 2006-11-18 13:04:32 UTC (rev 31) +++ pieforms/src/pieform.php 2006-11-19 00:36:14 UTC (rev 32) @@ -152,6 +152,21 @@ private $ajaxpost = false; /** + * A callback to call before submitting the form via AJAX + * + * @var string + */ + private $preajaxsubmitcallback = ''; + + /** + * A callback to call after submitting the form via AJAX, regardless of + * the result of the submission + * + * @var string + */ + private $postajaxsubmitcallback = ''; + + /** * Name of a javascript function to call on successful ajax submission * * @var string @@ -297,8 +312,10 @@ 'action' => '', 'onsubmit' => '', 'ajaxpost' => false, - 'ajaxsuccessfunction' => '', - 'ajaxfailurefunction' => '', + 'preajaxsubmitcallback' => '', + 'postajaxsubmitcallback' => '', + 'ajaxsuccessfunction' => '', + 'ajaxfailurefunction' => '', 'autofocus' => false, 'language' => 'en', 'validate' => true, @@ -338,8 +355,11 @@ if ($data['ajaxpost']) { $this->ajaxpost = true; - $this->ajaxsuccessfunction = $data['ajaxsuccessfunction']; - $this->ajaxfailurefunction = $data['ajaxfailurefunction']; + $this->preajaxsubmitcallback = self::validate_js_callback($data['preajaxsubmitcallback']); + $this->postajaxsubmitcallback = self::validate_js_callback($data['postajaxsubmitcallback']); + // @todo rename to *callback instead of *function for consistency + $this->ajaxsuccessfunction = self::validate_js_callback($data['ajaxsuccessfunction']); + $this->ajaxfailurefunction = self::validate_js_callback($data['ajaxfailurefunction']); } if (isset($data['renderer'])) { @@ -783,7 +803,11 @@ // Also should only save wysiwyg elements in the form, not all of them... if (typeof(tinyMCE) != 'undefined') { tinyMCE.triggerSave(); } - processingStart(); +EOF; + if (!empty($this->preajaxsubmitcallback)) { + $result .= " $this->preajaxsubmitcallback();\n"; + } + $result .= <<<EOF var data = {}; EOF; @@ -849,15 +873,14 @@ } } - $result .= <<<EOF + $result .= " }\n"; + if (!empty($this->postajaxsubmitcallback)) { + $result .= " $this->postajaxsubmitcallback();\n"; } - processingStop(); -EOF; - // @todo not with get_string! $this->i18n instead - $strunknownerror = get_string('unknownerror'); - $strprocessingform = get_string('processingform'); + $strunknownerror = $this->i18n('ajaxunknownerror'); + $strprocessingform = $this->i18n('processingform'); $result .= <<<EOF }, function() { @@ -1093,6 +1116,15 @@ } } + private static function validate_js_callback($name) { + if ($name == '') { + return ''; + } + if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $name)) { + throw new PieformException("'$name' is not a valid javascript callback name"); + } + } + /** * Returns elements with errors on them * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-18 13:04:34
|
Revision: 31 http://svn.sourceforge.net/pieforms/?rev=31&view=rev Author: oracleshinoda Date: 2006-11-18 05:04:32 -0800 (Sat, 18 Nov 2006) Log Message: ----------- * If the form method is 'get' and a file upload element is in the form, notify the user * Make sure the is_submitted() method is declared public * Added a method for displaying information, which allows a callback function to override its behaviour Modified Paths: -------------- pieforms/src/pieform.php Modified: pieforms/src/pieform.php =================================================================== --- pieforms/src/pieform.php 2006-11-18 12:52:08 UTC (rev 30) +++ pieforms/src/pieform.php 2006-11-18 13:04:32 UTC (rev 31) @@ -378,6 +378,10 @@ } if ($element['type'] == 'file') { $this->fileupload = true; + if ($this->method == 'get') { + $this->method = 'post'; + self::info("Your form '$this->name' had the method 'get' and also a file element - it has been converted to 'post'"); + } } if ($element['type'] == 'fieldset') { foreach ($element['elements'] as $subname => &$subelement) { @@ -393,6 +397,10 @@ } if ($subelement['type'] == 'file') { $this->fileupload = true; + if ($this->method == 'get') { + $this->method = 'post'; + self::info("Your form '$this->name' had the method 'get' and also a file element - it has been converted to 'post'"); + } } if (!$autofocusadded && $this->autofocus === true) { $subelement['autofocus'] = true; @@ -561,7 +569,7 @@ * * @return bool */ - function is_submitted() { + public function is_submitted() { return $this->submitted; } @@ -1073,6 +1081,19 @@ } /** + * Hook for giving information back to the developer + */ + public static function info($message) { + $function = 'pieform_info'; + if (function_exists($function)) { + $function($message); + } + else { + trigger_error($message, E_USER_NOTICE); + } + } + + /** * Returns elements with errors on them * * @return array An array of elements with errors on them, the empty array This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-18 12:52:12
|
Revision: 30 http://svn.sourceforge.net/pieforms/?rev=30&view=rev Author: oracleshinoda Date: 2006-11-18 04:52:08 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Properly fix detection of invalid options, for standard selects, multiselects and radios Modified Paths: -------------- pieforms/src/pieform/rules/validateoptions.php Modified: pieforms/src/pieform/rules/validateoptions.php =================================================================== --- pieforms/src/pieform/rules/validateoptions.php 2006-11-18 12:39:26 UTC (rev 29) +++ pieforms/src/pieform/rules/validateoptions.php 2006-11-18 12:52:08 UTC (rev 30) @@ -37,12 +37,10 @@ function pieform_rule_validateoptions(Pieform $form, $field, $element) { // Get the value into an array as a key if it's a scalar, since // the actual check involves array keys - if (!is_array($field)) { - $field = array($field => ''); - } + $field = (array) $field; $allowedvalues = array_keys($element['options']); - foreach (array_keys($field) as $key) { + foreach ($field as $key) { if (!in_array($key, $allowedvalues)) { return sprintf($form->i18n('validateoptions'), $key); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-18 12:39:35
|
Revision: 29 http://svn.sourceforge.net/pieforms/?rev=29&view=rev Author: oracleshinoda Date: 2006-11-18 04:39:26 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Fixed the validateoptions rule Modified Paths: -------------- pieforms/src/pieform/rules/validateoptions.php Modified: pieforms/src/pieform/rules/validateoptions.php =================================================================== --- pieforms/src/pieform/rules/validateoptions.php 2006-11-18 12:33:21 UTC (rev 28) +++ pieforms/src/pieform/rules/validateoptions.php 2006-11-18 12:39:26 UTC (rev 29) @@ -1,6 +1,6 @@ <?php /** - * This program is part of Mahara + * This program is part of Pieforms * * 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 @@ -16,27 +16,25 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * @package mahara - * @subpackage form-rule + * @package pieform + * @subpackage rule * @author Nigel McNie <ni...@ca...> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL - * @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz * */ -defined('INTERNAL') || die(); - /** * Makes sure that the submitted value is specified in the 'options' index of * the element. This prevents malicious people from doing things like * submitting values that aren't in a select box. * - * @param Form $form The form the rule is being applied to - * @param string $field The field to check - * @param string $element The element being checked - * @return string The error message, if the value is invalid. + * @param Pieform $form The form the rule is being applied to + * @param string $field The field to check + * @param string $element The element being checked + * @return string The error message, if the value is invalid. */ -function form_rule_validateoptions(Form $form, $field, $element) { +function pieform_rule_validateoptions(Pieform $form, $field, $element) { // Get the value into an array as a key if it's a scalar, since // the actual check involves array keys if (!is_array($field)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-18 12:33:28
|
Revision: 28 http://svn.sourceforge.net/pieforms/?rev=28&view=rev Author: oracleshinoda Date: 2006-11-18 04:33:21 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Fixed the required rule Modified Paths: -------------- pieforms/src/pieform/rules/required.php Modified: pieforms/src/pieform/rules/required.php =================================================================== --- pieforms/src/pieform/rules/required.php 2006-11-18 12:30:17 UTC (rev 27) +++ pieforms/src/pieform/rules/required.php 2006-11-18 12:33:21 UTC (rev 28) @@ -1,6 +1,6 @@ <?php /** - * This program is part of Mahara + * This program is part of Pieforms * * 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 @@ -16,26 +16,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * @package mahara - * @subpackage form-rule + * @package pieform + * @subpackage rule * @author Nigel McNie <ni...@ca...> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL - * @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz * */ -defined('INTERNAL') || die(); - /** * Checks whether the field has been specified. * - * @param Form $form The form the rule is being applied to - * @param string $field The field to check - * @param array $element The element to check - * @return string The error message, if the value is invalid. + * @param Pieform $form The form the rule is being applied to + * @param string $field The field to check + * @param array $element The element to check + * @return string The error message, if the value is invalid. */ -function form_rule_required(Form $form, $value, $element) { - // The array test is for using the "required" rule on file elements +function pieform_rule_required(Pieform $form, $value, $element) { $function = 'form_is_empty_' . $element['type']; if (function_exists($function)) { if ($function($value, $element)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-18 12:30:21
|
Revision: 27 http://svn.sourceforge.net/pieforms/?rev=27&view=rev Author: oracleshinoda Date: 2006-11-18 04:30:17 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Fixed the minlength rule Modified Paths: -------------- pieforms/src/pieform/rules/minlength.php Modified: pieforms/src/pieform/rules/minlength.php =================================================================== --- pieforms/src/pieform/rules/minlength.php 2006-11-18 12:26:16 UTC (rev 26) +++ pieforms/src/pieform/rules/minlength.php 2006-11-18 12:30:17 UTC (rev 27) @@ -1,6 +1,6 @@ <?php /** - * This program is part of Mahara + * This program is part of Pieforms * * 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 @@ -16,26 +16,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * @package mahara - * @subpackage form-rule + * @package pieform + * @subpackage rule * @author Nigel McNie <ni...@ca...> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL - * @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz * */ -defined('INTERNAL') || die(); - /** * Checks whether the given value is shorter than the allowed length. * - * @param Form $form The form the rule is being applied to - * @param string $value The value to check - * @param array $element The element to check - * @param int $minlength The length to check for - * @return string The error message, if the value is invalid. + * @param PieForm $form The form the rule is being applied to + * @param string $value The value to check + * @param array $element The element to check + * @param int $minlength The length to check for + * @return string The error message, if the value is invalid. */ -function form_rule_minlength(Form $form, $value, $element, $minlength) { +function pieform_rule_minlength(Pieform $form, $value, $element, $minlength) { if (strlen($value) < $minlength) { return sprintf($form->i18n('minlength'), $minlength); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-18 12:26:18
|
Revision: 26 http://svn.sourceforge.net/pieforms/?rev=26&view=rev Author: oracleshinoda Date: 2006-11-18 04:26:16 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Fixed the maxlength rule Modified Paths: -------------- pieforms/src/pieform/rules/maxlength.php Modified: pieforms/src/pieform/rules/maxlength.php =================================================================== --- pieforms/src/pieform/rules/maxlength.php 2006-11-18 12:21:55 UTC (rev 25) +++ pieforms/src/pieform/rules/maxlength.php 2006-11-18 12:26:16 UTC (rev 26) @@ -1,6 +1,6 @@ <?php /** - * This program is part of Mahara + * This program is part of Pieforms * * 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 @@ -16,26 +16,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * @package mahara - * @subpackage form-rule + * @package pieform + * @subpackage rule * @author Nigel McNie <ni...@ca...> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL - * @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz * */ -defined('INTERNAL') || die(); - /** * Checks whether the given value is longer than the allowed length. * - * @param Form $form The form the rule is being applied to - * @param string $value The value to check - * @param array $element The element to check - * @param int $maxlength The length to check for - * @return string The error message, if the value is invalid. + * @param Pieform $form The form the rule is being applied to + * @param string $value The value to check + * @param array $element The element to check + * @param int $maxlength The length to check for + * @return string The error message, if the value is invalid. */ -function form_rule_maxlength(Form $form, $value, $element, $maxlength) { +function pieform_rule_maxlength(Pieform $form, $value, $element, $maxlength) { if (strlen($value) > $maxlength) { return sprintf($form->i18n('maxlength'), $maxlength); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-18 12:21:57
|
Revision: 25 http://svn.sourceforge.net/pieforms/?rev=25&view=rev Author: oracleshinoda Date: 2006-11-18 04:21:55 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Multicolumntable renderer: * Fixed headers * Re-ordered some functions (so the phpdoc is for the right function) * Added some todo items * One feature request (1598823) and one bug (1598825) as a result of cleaning up the file Modified Paths: -------------- pieforms/src/pieform/renderers/multicolumntable.php Modified: pieforms/src/pieform/renderers/multicolumntable.php =================================================================== --- pieforms/src/pieform/renderers/multicolumntable.php 2006-11-18 12:00:03 UTC (rev 24) +++ pieforms/src/pieform/renderers/multicolumntable.php 2006-11-18 12:21:55 UTC (rev 25) @@ -1,6 +1,6 @@ <?php /** - * This program is part of Mahara + * This program is part of Pieforms * * 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 @@ -16,18 +16,23 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * @package mahara - * @subpackage form-renderer + * @package pieform + * @subpackage renderer * @author Penny Leach <pe...@ca...> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL - * @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz * */ -defined('INTERNAL') || die(); +// @todo this renderer needs to take into account potentially being called more +// than once in the same PHP script (clobbering of the $formrenderermct variable). +// Also, not sure what 'static $var' does in global scope... +require_once(dirname(__FILE__) . '/table.php'); +static $formrenderermct; /** - * Renders form elements inside a <table>. + * Renders form elements inside a <table>. If elements have the same title, + * they will be rendered in the same table row, allowing a grid layout. * * @param string $builtelement The element, already built * @param array $rawelement The element in raw form, for looking up @@ -35,25 +40,21 @@ * @return string The element rendered inside an appropriate * container. */ - -require_once(dirname(__FILE__) . '/table.php'); -static $formrenderermct; - -function form_renderer_multicolumntable_messages_js($id, $submitid) { - return form_renderer_table_messages_js($id, $submitid); -} - -function form_renderer_multicolumntable($builtelement, $rawelement) { +function pieform_renderer_multicolumntable($builtelement, $rawelement) { global $formrenderermct; $formrenderermct->add_element($builtelement, $rawelement); } -function form_renderer_multicolumntable_header() { +function pieform_renderer_multicolumntable_messages_js($id, $submitid) { + return pieform_renderer_table_messages_js($id, $submitid); +} + +function pieform_renderer_multicolumntable_header() { global $formrenderermct; $formrenderermct = new FormRendererMultiColumnTable(); } -function form_renderer_multicolumntable_footer() { +function pieform_renderer_multicolumntable_footer() { global $formrenderermct; return $formrenderermct->build(); } @@ -82,25 +83,34 @@ $result .= ' class="' . $data['settings']['class'] . '"'; } $result .= ">\n\t\t"; + $result .= '<th>'; if (isset($data['settings']['title'])) { - $result .= hsc($data['settings']['title']); + $result .= Pieform::hsc($data['settings']['title']); } $result .= "</th>\n\t"; + foreach ($data['builtelements'] as $k => $builtelement) { $rawelement = $data['rawelements'][$k]; - $result .= "\t<td id=\"" . $rawelement['name'] . '_container"'; + $result .= "\t<td"; + if (isset($rawelement['name'])) { + $result .= " id=\"" . $rawelement['name'] . '_container"'; + } if ($rawelement['class']) { $result .= ' class="' . $rawelement['class'] . '"'; } $result .= '>'; + $result .= $builtelement; + // Contextual help if (!empty($rawelement['help'])) { $result .= ' <span class="help"><a href="#" title="' - . hsc($rawelement['help']) . '">?</a></span>'; + . Pieform::hsc($rawelement['help']) . '">?</a></span>'; } $result .= "</td>\n\t"; + + // @todo description... } $result .= "</tr>\n"; } @@ -110,4 +120,4 @@ } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ora...@us...> - 2006-11-18 12:00:09
|
Revision: 24 http://svn.sourceforge.net/pieforms/?rev=24&view=rev Author: oracleshinoda Date: 2006-11-18 04:00:03 -0800 (Sat, 18 Nov 2006) Log Message: ----------- Cleaned up header and fixed implementation of email rule Modified Paths: -------------- pieforms/src/pieform/rules/email.php Modified: pieforms/src/pieform/rules/email.php =================================================================== --- pieforms/src/pieform/rules/email.php 2006-11-18 11:53:53 UTC (rev 23) +++ pieforms/src/pieform/rules/email.php 2006-11-18 12:00:03 UTC (rev 24) @@ -1,6 +1,6 @@ <?php /** - * This program is part of Mahara + * This program is part of Pieforms * * 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 @@ -16,28 +16,26 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * @package mahara - * @subpackage form-rule + * @package pieform + * @subpackage rule * @author Nigel McNie <ni...@ca...> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL - * @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz * */ -defined('INTERNAL') || die(); - /** * Returns whether the given field is a valid e-mail address. * * Currently, the check is [anything]@[anything]. Someone is welcome to write * something better, this was made just for testing. * - * @param Form $form The form the rule is being applied to - * @param string $value The e-mail address to check - * @return string The error message, if there is something wrong with - * the address. + * @param Pieform $form The form the rule is being applied to + * @param string $value The e-mail address to check + * @return string The error message, if there is something wrong with + * the address. */ -function form_rule_email(Form $form, $value) { +function form_rule_email(Pieform $form, $value) { if (!preg_match('/^(.*)@(.*)\.(.*)$/', $value)) { return $form->i18n('email'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |