diff options
Diffstat (limited to 'ui')
84 files changed, 11235 insertions, 11235 deletions
diff --git a/ui/GPL-LICENSE.txt b/ui/GPL-LICENSE.txt index 4f3d3e82c..11dddd00e 100644 --- a/ui/GPL-LICENSE.txt +++ b/ui/GPL-LICENSE.txt @@ -1,278 +1,278 @@ - GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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.
+ GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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. diff --git a/ui/MIT-LICENSE.txt b/ui/MIT-LICENSE.txt index a9b0515ea..965a83130 100644 --- a/ui/MIT-LICENSE.txt +++ b/ui/MIT-LICENSE.txt @@ -1,20 +1,20 @@ -Copyright (c) 2007 John Resig, http://jquery.com/
-
-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.
+Copyright (c) 2007 John Resig, http://jquery.com/ + +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. diff --git a/ui/demos/real-world/accordion-drawers/index.html b/ui/demos/real-world/accordion-drawers/index.html index 48a396472..80c4df95d 100644 --- a/ui/demos/real-world/accordion-drawers/index.html +++ b/ui/demos/real-world/accordion-drawers/index.html @@ -1,257 +1,257 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>Slide Demo - Fixed Drawer</title>
- <style type="text/css" media="screen">
- <!--
-/*************************************/
-/* Blueprint: reset.css */
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, font, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- font-weight: inherit;
- font-style: inherit;
- font-size: 100%;
- font-family: inherit;
- vertical-align: baseline;
-}
-
-/* Remember to define focus styles! */
-:focus {
- outline: 0;
-}
-body {
- line-height: 1;
- color: black;
- background: white;
-}
-ol, ul {
- list-style: none;
-}
-
-/* Tables still need 'cellspacing="0"' in the markup. */
-table {
- border-collapse: separate;
- border-spacing: 0;
-}
-caption, th, td {
- text-align: left;
- font-weight: normal;
-}
-
-/* Remove possible quote marks (") from <q>, <blockquote>. */
-blockquote:before, blockquote:after,
-q:before, q:after {
- content: "";
-}
-blockquote, q {
- quotes: "" "";
-}
-
-/*************************************/
-/* Demo Styles */
- .capt,
- .capb {
- background: url("images/caps.gif") no-repeat;
- height:4px;
- width:100%;
- /*position:absolute;*/
- z-index:100;
- margin:0px;
- padding:0px;
- }
- .capt {
- position:absolute;
- background-position:0 -4px;
- }
- .capb {
- margin-top:-19px;
- }
- #content {
- float:left;
- }
- .drawers-wrapper {
- position: relative;
- width: 188px;
- float:left;
- margin:10px;
- }
- .drawers {
- margin-bottom:15px;
- color:#76797C;
- font-size:11px;
- line-height: 18px;
- }
- .drawer {
- background:transparent url(images/sideboxlight_bg.gif) repeat-y scroll 0pt;
- color:#76797C;
- font-size:11px;
- line-height:1.3em;
- }
- .drawer-handle {
- background:#939393 url(images/slider_handlebg.png) no-repeat scroll 0pt;
- color:#333333;
- cursor:default;
- height:25px;
- line-height:25px;
- text-indent:15px;
- font-size:12px;
- width:100%;
- }
- .drawer-handle.open {
- background-color:#72839D;
- background-position:-188px 0pt;
- color:#FFFFFF;
- }
-
- /* nasty, but it fixes the indent on the first one. */
- h2.drawer-handle span {
-
- }
- .drawer ul {
- padding: 0 12px;
- padding-bottom:0pt;
- }
- .drawer li {
- border-bottom:1px solid #E5E5E5;
- line-height:16px;
- padding:6px 0pt;
- }
- .drawer-content ul {
- padding-top: 7px;
- }
- .drawer-content li a {
- display:block;
- overflow:hidden;
- }
- .alldownloads li {
- border:0pt none;
- line-height:18px;
- padding:0pt;
- }
-
- .drawers a {
- color:#666666;
- text-decoration:none;
- font-family:"Lucida Grande",Geneva,Arial,Verdana,sans-serif;
- }
- -->
- </style>
-
- <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script>
-
- <script type="text/javascript" src="../../../source/ui.core.js"></script>
- <script type="text/javascript" src="../../../source/ui.accordion.js"></script>
-
-
- <script type="text/javascript">
- <!--
- $(function () {
- $('ul.drawers').accordion({
- header: 'h2.drawer-handle',
- selectedClass: 'open',
- event: 'mouseover'
- });
- });
- //-->
- </script>
-</head>
-<body id="page">
- <div id="content">
- <h1>Fixed drawer slide out demo (using accordion plugin)</h1>
- <p>This example demonstrates the Apple downloads slider/accordion effect using the jQuery Accordion plugin.</p>
- <p>Mouse over the headings to reveal the list of available links.</p>
-
- <p>
- <a href="http://jqueryfordesigners.com/slide-out-and-drawer-effect/">Read the article this demonstration relates to</a>
- </p>
- </div>
- <div class="drawers-wrapper">
- <ul class="drawers">
- <li class="drawer">
- <h2 class="drawer-handle open">
- <div class="capt"></div>
- <span>Downloads</span>
- </h2>
- <ul class="alldownloads">
- <li id="sn-downloadsmacosx"><a href="/downloads/macosx/">All Categories</a></li>
- <li id="sn-aperture"><a href="/downloads/macosx/aperture/">Aperture</a></li>
- <li id="sn-apple"><a href="/downloads/macosx/apple/">Apple</a></li>
- <li id="sn-audio"><a href="/downloads/macosx/audio/">Audio</a></li>
- <li id="sn-automator"><a href="/downloads/macosx/automator/">Automator Actions</a></li>
- <li id="sn-businessfinance"><a href="/downloads/macosx/business_finance/">Business & Finance</a></li>
- <li id="sn-calendars"><a href="/downloads/macosx/calendars/">Calendars</a></li>
- <li id="sn-developmenttools"><a href="/downloads/macosx/development_tools/">Development Tools</a></li>
- <li id="sn-drivers"><a href="/downloads/macosx/drivers/">Drivers</a></li>
- <li id="sn-emailchat"><a href="/downloads/macosx/email_chat/">Email & Chat</a></li>
- <li id="sn-finalcutstudio"><a href="/downloads/macosx/finalcutstudio/">Final Cut Studio</a></li>
- <li id="sn-games"><a href="/downloads/macosx/games/">Games</a></li>
- <li id="sn-homelearning"><a href="/downloads/macosx/home_learning/">Home & Learning</a></li>
- <li id="sn-iconsscreensavers"><a href="/downloads/macosx/icons_screensavers/">Icons, Screensavers, etc.</a></li>
- <li id="sn-imaging3d"><a href="/downloads/macosx/imaging_3d/">Imaging & 3D</a></li>
- <li id="sn-internetutilities"><a href="/downloads/macosx/internet_utilities/">Internet Utilities</a></li>
- <li id="sn-ipoditunes"><a href="/downloads/macosx/ipod_itunes/">iPod + iTunes</a></li>
- <li id="sn-mathscience"><a href="/downloads/macosx/math_science/">Math & Science</a></li>
- <li id="sn-networkingsecurity"><a href="/downloads/macosx/networking_security/">Networking & Security</a></li>
- <li id="sn-productivitytools"><a href="/downloads/macosx/productivity_tools/">Productivity Tools</a></li>
- <li id="sn-spotlight"><a href="/downloads/macosx/spotlight/">Spotlight Plugins</a></li>
- <li id="sn-systemdiskutilities"><a href="/downloads/macosx/system_disk_utilities/">System/Disk Utilities</a></li>
- <li id="sn-unixopensource"><a href="/downloads/macosx/unix_open_source/">UNIX & Open Source</a></li>
- <li id="sn-video"><a href="/downloads/macosx/video/">Video</a></li>
- <li id="sn-dashboard"><a href="/downloads/dashboard/" class="bottom">Widgets</a></li>
- </ul>
- </li>
- <li class="drawer">
- <h2 class="drawer-handle">Top Downloads</h2>
- <ul>
- <li><a title="iTunes 7.5" href="http://www.apple.com/itunes/download/">1. iTunes 7.5</a></li>
- <li><a title="QuickTime 7.3.1" href="http://www.apple.com/quicktime/download/">2. QuickTime 7.3.1</a></li>
- <li><a title="Safari 3 Public Beta" href="http://www.apple.com/safari/download/">3. Safari 3 Public Beta</a></li>
- <li><a title="MacPool" href="/downloads/macosx/games/simulation_and_sports/macpool.html">4. MacPool Realistic and easy to play computer simu…</a></li>
- <li><a title="Guitar Hero III: Legends of Rock" href="/downloads/macosx/games/demos_updates/guitarheroiiilegendsofrock.html">5. Guitar Hero III: L…</a></li>
- <li><a title="Messenger for Mac" href="/downloads/macosx/email_chat/messengerformac.html">6. Messenger for Mac</a></li>
- <li><a title="Google Earth" href="/downloads/macosx/home_learning/googleearth.html">7. Google Earth</a></li>
- <li><a title="Monopoly" href="/downloads/macosx/games/cards_puzzle/monopoly.html">8. Monopoly</a></li>
- <li><a title="Litho System Icons" href="/downloads/macosx/icons_screensavers/lithosystemicons.html">9. Litho System Icons</a></li>
- <li><a title="Battlefield 2142" href="/downloads/macosx/games/demos_updates/battlefield2142.html">10. Battlefield 2142</a></li>
- <li><a title="More iChat Effects" href="/downloads/macosx/email_chat/moreichateffects.html">11. More iChat Effects</a></li>
- <li><a title="Dragster" href="/downloads/macosx/internet_utilities/dragster.html">12. Dragster</a></li>
- <li><a title="iSquint" href="/downloads/macosx/ipod_itunes/isquint.html">13. iSquint</a></li>
- <li class="last"><a title="US Holiday Calendar" href="/downloads/macosx/calendars/usholidaycalendar.html">14. US Holiday Calendar</a></li>
- </ul>
- </li>
- <li class="drawer last">
- <h2 class="drawer-handle">Top Apple Downloads</h2>
- <ul>
- <li><a title="iTunes 7.5" href="http://www.apple.com/itunes/download/">1. iTunes 7.5</a></li>
- <li><a title="QuickTime 7.3.1" href="http://www.apple.com/quicktime/download/">2. QuickTime 7.3.1</a></li>
- <li><a title="Safari 3 Public Beta" href="http://www.apple.com/safari/download/">3. Safari 3 Public Beta</a></li>
- <li><a title="Mac OS X 10.5.1 Update" href="/downloads/macosx/apple/macosx_updates/macosx1051update.html">4. Mac OS X 10.5.1 Up…</a></li>
- <li><a title="Java for Mac OS X 10.4 Release 5" href="/downloads/macosx/apple/macosx_updates/javaformacosx104release5.html">5. Java for Mac OS X …</a></li>
- <li><a title="iPod Reset Utility 1.0.2 for Windows" href="/downloads/macosx/apple/ipod_itunes/ipodresetutility102forwindows.html">6. iPod Reset Utility…</a></li>
- <li><a title="iPhoto 7.1.1" href="/downloads/macosx/apple/application_updates/iphoto711.html">7. iPhoto 7.1.1</a></li>
- <li><a title="Bonjour for Windows" href="/downloads/macosx/apple/windows/bonjourforwindows.html">8. Bonjour for Windows</a></li>
- <li><a title="Mac OS X 10.4.11 Combo Update (PPC)" href="/downloads/macosx/apple/macosx_updates/macosx10411comboupdateppc.html">9. Mac OS X 10.4.11 C…<br/>The 10.4.11 Update is recommended for al…</a></li>
- <li><a title="Java for Mac OS X 10.4, Release 6" href="/downloads/macosx/apple/macosx_updates/javaformacosx104release6.html">10. Java for Mac OS X …</a></li>
- <li><a title="GarageBand 4.1.1" href="/downloads/macosx/apple/application_updates/garageband411.html">11. GarageBand 4.1.1</a></li>
- <li><a title="iPod Updater 2006-06-28 for Windows" href="/downloads/macosx/apple/ipod_itunes/ipodupdater20060628forwindows.html">12. iPod Updater 2006-…</a></li>
- <li><a title="Security Update 2007-009 1.1 (10.4.11 Universal)" href="/downloads/macosx/apple/security_updates/securityupdate20070091110411universal.html">13. Security Update 20…</a></li>
- <li class="last"><a title="Security Update 2007-009 1.1 (10.5.1)" href="/downloads/macosx/apple/security_updates/securityupdate2007009111051.html">14. Security Update 20…</a></li>
- </ul>
- </li>
- </ul>
- <div class="capb"></div>
- </div>
-</body>
-</html>
+<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title>Slide Demo - Fixed Drawer</title> + <style type="text/css" media="screen"> + <!-- +/*************************************/ +/* Blueprint: reset.css */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +/* Remember to define focus styles! */ +:focus { + outline: 0; +} +body { + line-height: 1; + color: black; + background: white; +} +ol, ul { + list-style: none; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { + border-collapse: separate; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; +} + +/* Remove possible quote marks (") from <q>, <blockquote>. */ +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +blockquote, q { + quotes: "" ""; +} + +/*************************************/ +/* Demo Styles */ + .capt, + .capb { + background: url("images/caps.gif") no-repeat; + height:4px; + width:100%; + /*position:absolute;*/ + z-index:100; + margin:0px; + padding:0px; + } + .capt { + position:absolute; + background-position:0 -4px; + } + .capb { + margin-top:-19px; + } + #content { + float:left; + } + .drawers-wrapper { + position: relative; + width: 188px; + float:left; + margin:10px; + } + .drawers { + margin-bottom:15px; + color:#76797C; + font-size:11px; + line-height: 18px; + } + .drawer { + background:transparent url(images/sideboxlight_bg.gif) repeat-y scroll 0pt; + color:#76797C; + font-size:11px; + line-height:1.3em; + } + .drawer-handle { + background:#939393 url(images/slider_handlebg.png) no-repeat scroll 0pt; + color:#333333; + cursor:default; + height:25px; + line-height:25px; + text-indent:15px; + font-size:12px; + width:100%; + } + .drawer-handle.open { + background-color:#72839D; + background-position:-188px 0pt; + color:#FFFFFF; + } + + /* nasty, but it fixes the indent on the first one. */ + h2.drawer-handle span { + + } + .drawer ul { + padding: 0 12px; + padding-bottom:0pt; + } + .drawer li { + border-bottom:1px solid #E5E5E5; + line-height:16px; + padding:6px 0pt; + } + .drawer-content ul { + padding-top: 7px; + } + .drawer-content li a { + display:block; + overflow:hidden; + } + .alldownloads li { + border:0pt none; + line-height:18px; + padding:0pt; + } + + .drawers a { + color:#666666; + text-decoration:none; + font-family:"Lucida Grande",Geneva,Arial,Verdana,sans-serif; + } + --> + </style> + + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + + <script type="text/javascript" src="../../../source/ui.core.js"></script> + <script type="text/javascript" src="../../../source/ui.accordion.js"></script> + + + <script type="text/javascript"> + <!-- + $(function () { + $('ul.drawers').accordion({ + header: 'h2.drawer-handle', + selectedClass: 'open', + event: 'mouseover' + }); + }); + //--> + </script> +</head> +<body id="page"> + <div id="content"> + <h1>Fixed drawer slide out demo (using accordion plugin)</h1> + <p>This example demonstrates the Apple downloads slider/accordion effect using the jQuery Accordion plugin.</p> + <p>Mouse over the headings to reveal the list of available links.</p> + + <p> + <a href="http://jqueryfordesigners.com/slide-out-and-drawer-effect/">Read the article this demonstration relates to</a> + </p> + </div> + <div class="drawers-wrapper"> + <ul class="drawers"> + <li class="drawer"> + <h2 class="drawer-handle open"> + <div class="capt"></div> + <span>Downloads</span> + </h2> + <ul class="alldownloads"> + <li id="sn-downloadsmacosx"><a href="/downloads/macosx/">All Categories</a></li> + <li id="sn-aperture"><a href="/downloads/macosx/aperture/">Aperture</a></li> + <li id="sn-apple"><a href="/downloads/macosx/apple/">Apple</a></li> + <li id="sn-audio"><a href="/downloads/macosx/audio/">Audio</a></li> + <li id="sn-automator"><a href="/downloads/macosx/automator/">Automator Actions</a></li> + <li id="sn-businessfinance"><a href="/downloads/macosx/business_finance/">Business & Finance</a></li> + <li id="sn-calendars"><a href="/downloads/macosx/calendars/">Calendars</a></li> + <li id="sn-developmenttools"><a href="/downloads/macosx/development_tools/">Development Tools</a></li> + <li id="sn-drivers"><a href="/downloads/macosx/drivers/">Drivers</a></li> + <li id="sn-emailchat"><a href="/downloads/macosx/email_chat/">Email & Chat</a></li> + <li id="sn-finalcutstudio"><a href="/downloads/macosx/finalcutstudio/">Final Cut Studio</a></li> + <li id="sn-games"><a href="/downloads/macosx/games/">Games</a></li> + <li id="sn-homelearning"><a href="/downloads/macosx/home_learning/">Home & Learning</a></li> + <li id="sn-iconsscreensavers"><a href="/downloads/macosx/icons_screensavers/">Icons, Screensavers, etc.</a></li> + <li id="sn-imaging3d"><a href="/downloads/macosx/imaging_3d/">Imaging & 3D</a></li> + <li id="sn-internetutilities"><a href="/downloads/macosx/internet_utilities/">Internet Utilities</a></li> + <li id="sn-ipoditunes"><a href="/downloads/macosx/ipod_itunes/">iPod + iTunes</a></li> + <li id="sn-mathscience"><a href="/downloads/macosx/math_science/">Math & Science</a></li> + <li id="sn-networkingsecurity"><a href="/downloads/macosx/networking_security/">Networking & Security</a></li> + <li id="sn-productivitytools"><a href="/downloads/macosx/productivity_tools/">Productivity Tools</a></li> + <li id="sn-spotlight"><a href="/downloads/macosx/spotlight/">Spotlight Plugins</a></li> + <li id="sn-systemdiskutilities"><a href="/downloads/macosx/system_disk_utilities/">System/Disk Utilities</a></li> + <li id="sn-unixopensource"><a href="/downloads/macosx/unix_open_source/">UNIX & Open Source</a></li> + <li id="sn-video"><a href="/downloads/macosx/video/">Video</a></li> + <li id="sn-dashboard"><a href="/downloads/dashboard/" class="bottom">Widgets</a></li> + </ul> + </li> + <li class="drawer"> + <h2 class="drawer-handle">Top Downloads</h2> + <ul> + <li><a title="iTunes 7.5" href="http://www.apple.com/itunes/download/">1. iTunes 7.5</a></li> + <li><a title="QuickTime 7.3.1" href="http://www.apple.com/quicktime/download/">2. QuickTime 7.3.1</a></li> + <li><a title="Safari 3 Public Beta" href="http://www.apple.com/safari/download/">3. Safari 3 Public Beta</a></li> + <li><a title="MacPool" href="/downloads/macosx/games/simulation_and_sports/macpool.html">4. MacPool Realistic and easy to play computer simu…</a></li> + <li><a title="Guitar Hero III: Legends of Rock" href="/downloads/macosx/games/demos_updates/guitarheroiiilegendsofrock.html">5. Guitar Hero III: L…</a></li> + <li><a title="Messenger for Mac" href="/downloads/macosx/email_chat/messengerformac.html">6. Messenger for Mac</a></li> + <li><a title="Google Earth" href="/downloads/macosx/home_learning/googleearth.html">7. Google Earth</a></li> + <li><a title="Monopoly" href="/downloads/macosx/games/cards_puzzle/monopoly.html">8. Monopoly</a></li> + <li><a title="Litho System Icons" href="/downloads/macosx/icons_screensavers/lithosystemicons.html">9. Litho System Icons</a></li> + <li><a title="Battlefield 2142" href="/downloads/macosx/games/demos_updates/battlefield2142.html">10. Battlefield 2142</a></li> + <li><a title="More iChat Effects" href="/downloads/macosx/email_chat/moreichateffects.html">11. More iChat Effects</a></li> + <li><a title="Dragster" href="/downloads/macosx/internet_utilities/dragster.html">12. Dragster</a></li> + <li><a title="iSquint" href="/downloads/macosx/ipod_itunes/isquint.html">13. iSquint</a></li> + <li class="last"><a title="US Holiday Calendar" href="/downloads/macosx/calendars/usholidaycalendar.html">14. US Holiday Calendar</a></li> + </ul> + </li> + <li class="drawer last"> + <h2 class="drawer-handle">Top Apple Downloads</h2> + <ul> + <li><a title="iTunes 7.5" href="http://www.apple.com/itunes/download/">1. iTunes 7.5</a></li> + <li><a title="QuickTime 7.3.1" href="http://www.apple.com/quicktime/download/">2. QuickTime 7.3.1</a></li> + <li><a title="Safari 3 Public Beta" href="http://www.apple.com/safari/download/">3. Safari 3 Public Beta</a></li> + <li><a title="Mac OS X 10.5.1 Update" href="/downloads/macosx/apple/macosx_updates/macosx1051update.html">4. Mac OS X 10.5.1 Up…</a></li> + <li><a title="Java for Mac OS X 10.4 Release 5" href="/downloads/macosx/apple/macosx_updates/javaformacosx104release5.html">5. Java for Mac OS X …</a></li> + <li><a title="iPod Reset Utility 1.0.2 for Windows" href="/downloads/macosx/apple/ipod_itunes/ipodresetutility102forwindows.html">6. iPod Reset Utility…</a></li> + <li><a title="iPhoto 7.1.1" href="/downloads/macosx/apple/application_updates/iphoto711.html">7. iPhoto 7.1.1</a></li> + <li><a title="Bonjour for Windows" href="/downloads/macosx/apple/windows/bonjourforwindows.html">8. Bonjour for Windows</a></li> + <li><a title="Mac OS X 10.4.11 Combo Update (PPC)" href="/downloads/macosx/apple/macosx_updates/macosx10411comboupdateppc.html">9. Mac OS X 10.4.11 C…<br/>The 10.4.11 Update is recommended for al…</a></li> + <li><a title="Java for Mac OS X 10.4, Release 6" href="/downloads/macosx/apple/macosx_updates/javaformacosx104release6.html">10. Java for Mac OS X …</a></li> + <li><a title="GarageBand 4.1.1" href="/downloads/macosx/apple/application_updates/garageband411.html">11. GarageBand 4.1.1</a></li> + <li><a title="iPod Updater 2006-06-28 for Windows" href="/downloads/macosx/apple/ipod_itunes/ipodupdater20060628forwindows.html">12. iPod Updater 2006-…</a></li> + <li><a title="Security Update 2007-009 1.1 (10.4.11 Universal)" href="/downloads/macosx/apple/security_updates/securityupdate20070091110411universal.html">13. Security Update 20…</a></li> + <li class="last"><a title="Security Update 2007-009 1.1 (10.5.1)" href="/downloads/macosx/apple/security_updates/securityupdate2007009111051.html">14. Security Update 20…</a></li> + </ul> + </li> + </ul> + <div class="capb"></div> + </div> +</body> +</html> diff --git a/ui/demos/real-world/effects/demo.js b/ui/demos/real-world/effects/demo.js index ebf0ad082..b52b23726 100644 --- a/ui/demos/real-world/effects/demo.js +++ b/ui/demos/real-world/effects/demo.js @@ -1,65 +1,65 @@ -$(document).ready(function() {
-
- $("div.effect")
- .hover(function() {
- $(this).addClass("hover");
- }, function() {
- $(this).removeClass("hover");
- })
- ;
-
-
- var effect = function(el, n, o) {
-
- $.extend(o, {
- easing: "easeOutQuint"
- });
-
- $(el).bind("click", function() {
-
- $(this).addClass("current").hide(n, o, 1000, function() {
- var self = this;
- window.setTimeout(function() {
- $(self).show(n, o, 1000, function() { $(this).removeClass("current"); });
- },500);
- });
- });
-
- };
-
-
- effect("#blindHorizontally", "blind", { direction: "horizontal" });
- effect("#blindVertically", "blind", { direction: "vertical" });
-
- effect("#bounce3times", "bounce", { times: 3 });
-
- effect("#clipHorizontally", "clip", { direction: "horizontal" });
- effect("#clipVertically", "clip", { direction: "vertical" });
-
- effect("#dropDown", "drop", { direction: "down" });
- effect("#dropUp", "drop", { direction: "up" });
- effect("#dropLeft", "drop", { direction: "left" });
- effect("#dropRight", "drop", { direction: "right" });
-
- effect("#explode9", "explode", { });
- effect("#explode36", "explode", { pieces: 36 });
-
- effect("#fold", "fold", { size: 50 });
-
- effect("#highlight", "highlight", { });
-
- effect("#pulsate", "pulsate", { times: 2 });
-
- effect("#puff", "puff", { times: 2 });
- effect("#scale", "scale", { });
-
- $("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); });
-
- effect("#slideDown", "slide", { direction: "down" });
- effect("#slideUp", "slide", { direction: "up" });
- effect("#slideLeft", "slide", { direction: "left" });
- effect("#slideRight", "slide", { direction: "right" });
-
- $("#transfer").bind("click", function() { $(this).addClass("current").effect("transfer", { to: "div:eq(0)" }, 1000, function() { $(this).removeClass("current"); }); });
-
+$(document).ready(function() { + + $("div.effect") + .hover(function() { + $(this).addClass("hover"); + }, function() { + $(this).removeClass("hover"); + }) + ; + + + var effect = function(el, n, o) { + + $.extend(o, { + easing: "easeOutQuint" + }); + + $(el).bind("click", function() { + + $(this).addClass("current").hide(n, o, 1000, function() { + var self = this; + window.setTimeout(function() { + $(self).show(n, o, 1000, function() { $(this).removeClass("current"); }); + },500); + }); + }); + + }; + + + effect("#blindHorizontally", "blind", { direction: "horizontal" }); + effect("#blindVertically", "blind", { direction: "vertical" }); + + effect("#bounce3times", "bounce", { times: 3 }); + + effect("#clipHorizontally", "clip", { direction: "horizontal" }); + effect("#clipVertically", "clip", { direction: "vertical" }); + + effect("#dropDown", "drop", { direction: "down" }); + effect("#dropUp", "drop", { direction: "up" }); + effect("#dropLeft", "drop", { direction: "left" }); + effect("#dropRight", "drop", { direction: "right" }); + + effect("#explode9", "explode", { }); + effect("#explode36", "explode", { pieces: 36 }); + + effect("#fold", "fold", { size: 50 }); + + effect("#highlight", "highlight", { }); + + effect("#pulsate", "pulsate", { times: 2 }); + + effect("#puff", "puff", { times: 2 }); + effect("#scale", "scale", { }); + + $("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); }); + + effect("#slideDown", "slide", { direction: "down" }); + effect("#slideUp", "slide", { direction: "up" }); + effect("#slideLeft", "slide", { direction: "left" }); + effect("#slideRight", "slide", { direction: "right" }); + + $("#transfer").bind("click", function() { $(this).addClass("current").effect("transfer", { to: "div:eq(0)" }, 1000, function() { $(this).removeClass("current"); }); }); + });
\ No newline at end of file diff --git a/ui/demos/real-world/effects/index.html b/ui/demos/real-world/effects/index.html index bffad1746..15ebbece2 100644 --- a/ui/demos/real-world/effects/index.html +++ b/ui/demos/real-world/effects/index.html @@ -1,120 +1,120 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>Effects Test Suite</title>
- <link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8" />
-
- <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../../source/effects.core.js"></script>
-
- <script type="text/javascript" src="../../../source/effects.blind.js"></script>
- <script type="text/javascript" src="../../../source/effects.bounce.js"></script>
- <script type="text/javascript" src="../../../source/effects.clip.js"></script>
- <script type="text/javascript" src="../../../source/effects.drop.js"></script>
- <script type="text/javascript" src="../../../source/effects.explode.js"></script>
- <script type="text/javascript" src="../../../source/effects.fold.js"></script>
- <script type="text/javascript" src="../../../source/effects.highlight.js"></script>
- <script type="text/javascript" src="../../../source/effects.pulsate.js"></script>
- <script type="text/javascript" src="../../../source/effects.scale.js"></script>
- <script type="text/javascript" src="../../../source/effects.shake.js"></script>
- <script type="text/javascript" src="../../../source/effects.slide.js"></script>
- <script type="text/javascript" src="../../../source/effects.transfer.js"></script>
-
- <script type="text/javascript" src="demo.js"></script>
-
-
- </head>
- <body>
-
- <div class="effect" id="blindHorizontally">
- <p>Blind horizontally</p>
- </div>
-
- <div class="effect" id="blindVertically">
- <p>Blind vertically</p>
- </div>
-
- <div class="effect" id="bounce3times">
- <p>Bounce 3 times</p>
- </div>
-
- <div class="effect" id="clipHorizontally">
- <p>Clip horizontally</p>
- </div>
-
- <div class="effect" id="clipVertically">
- <p>Clip vertically</p>
- </div>
-
- <div class="effect" id="dropDown">
- <p>Drop down</p>
- </div>
-
- <div class="effect" id="dropUp">
- <p>Drop up</p>
- </div>
-
- <div class="effect" id="dropLeft">
- <p>Drop left</p>
- </div>
-
- <div class="effect" id="dropRight">
- <p>Drop right</p>
- </div>
-
- <div class="effect" id="explode9">
- <p>Explode in 9 pieces</p>
- </div>
-
- <div class="effect" id="explode36">
- <p>Explode in 36 pieces</p>
- </div>
-
- <div class="effect" id="fold">
- <p>Fold</p>
- </div>
-
- <div class="effect" id="highlight">
- <p>Highlight</p>
- </div>
-
- <div class="effect" id="pulsate">
- <p>Pulsate 2 times</p>
- </div>
-
- <div class="effect" id="puff">
- <p>Puff</p>
- </div>
-
- <div class="effect" id="scale">
- <p>Scale</p>
- </div>
-
- <div class="effect" id="shake">
- <p>Shake</p>
- </div>
-
- <div class="effect" id="slideDown">
- <p>Slide down</p>
- </div>
-
- <div class="effect" id="slideUp">
- <p>Slide up</p>
- </div>
-
- <div class="effect" id="slideLeft">
- <p>Slide left</p>
- </div>
-
- <div class="effect" id="slideRight">
- <p>Slide right</p>
- </div>
-
- <div class="effect" id="transfer">
- <p>Transfer to first element</p>
- </div>
-
- </body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title>Effects Test Suite</title> + <link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8" /> + + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../../source/effects.core.js"></script> + + <script type="text/javascript" src="../../../source/effects.blind.js"></script> + <script type="text/javascript" src="../../../source/effects.bounce.js"></script> + <script type="text/javascript" src="../../../source/effects.clip.js"></script> + <script type="text/javascript" src="../../../source/effects.drop.js"></script> + <script type="text/javascript" src="../../../source/effects.explode.js"></script> + <script type="text/javascript" src="../../../source/effects.fold.js"></script> + <script type="text/javascript" src="../../../source/effects.highlight.js"></script> + <script type="text/javascript" src="../../../source/effects.pulsate.js"></script> + <script type="text/javascript" src="../../../source/effects.scale.js"></script> + <script type="text/javascript" src="../../../source/effects.shake.js"></script> + <script type="text/javascript" src="../../../source/effects.slide.js"></script> + <script type="text/javascript" src="../../../source/effects.transfer.js"></script> + + <script type="text/javascript" src="demo.js"></script> + + + </head> + <body> + + <div class="effect" id="blindHorizontally"> + <p>Blind horizontally</p> + </div> + + <div class="effect" id="blindVertically"> + <p>Blind vertically</p> + </div> + + <div class="effect" id="bounce3times"> + <p>Bounce 3 times</p> + </div> + + <div class="effect" id="clipHorizontally"> + <p>Clip horizontally</p> + </div> + + <div class="effect" id="clipVertically"> + <p>Clip vertically</p> + </div> + + <div class="effect" id="dropDown"> + <p>Drop down</p> + </div> + + <div class="effect" id="dropUp"> + <p>Drop up</p> + </div> + + <div class="effect" id="dropLeft"> + <p>Drop left</p> + </div> + + <div class="effect" id="dropRight"> + <p>Drop right</p> + </div> + + <div class="effect" id="explode9"> + <p>Explode in 9 pieces</p> + </div> + + <div class="effect" id="explode36"> + <p>Explode in 36 pieces</p> + </div> + + <div class="effect" id="fold"> + <p>Fold</p> + </div> + + <div class="effect" id="highlight"> + <p>Highlight</p> + </div> + + <div class="effect" id="pulsate"> + <p>Pulsate 2 times</p> + </div> + + <div class="effect" id="puff"> + <p>Puff</p> + </div> + + <div class="effect" id="scale"> + <p>Scale</p> + </div> + + <div class="effect" id="shake"> + <p>Shake</p> + </div> + + <div class="effect" id="slideDown"> + <p>Slide down</p> + </div> + + <div class="effect" id="slideUp"> + <p>Slide up</p> + </div> + + <div class="effect" id="slideLeft"> + <p>Slide left</p> + </div> + + <div class="effect" id="slideRight"> + <p>Slide right</p> + </div> + + <div class="effect" id="transfer"> + <p>Transfer to first element</p> + </div> + + </body> </html>
\ No newline at end of file diff --git a/ui/demos/real-world/effects/style.css b/ui/demos/real-world/effects/style.css index e2a184466..f7ae220ef 100644 --- a/ui/demos/real-world/effects/style.css +++ b/ui/demos/real-world/effects/style.css @@ -1,36 +1,36 @@ -body,html {
- margin: 0;
- padding: 0;
- font-size: 12px;
- font-family: Arial;
- background: #000;
-}
-
-div.effect {
- width: 120px;
- height: 100px;
- background: #333;
- border: 5px outset #aaa;
- float: left;
- margin-top: 20px;
- margin-left: 20px;
- cursor: pointer;
- cursor: hand;
-}
-
-div.current {
- border: 5px outset #FF0000;
- background: #660000;
-}
-
-div.effect p {
- color: #eee;
- margin: 0px;
- padding: 10px;
-}
-
-.ui-effects-transfer {
- border: 1px dotted #fff;
- background: #666;
- opacity: 0.5;
+body,html { + margin: 0; + padding: 0; + font-size: 12px; + font-family: Arial; + background: #000; +} + +div.effect { + width: 120px; + height: 100px; + background: #333; + border: 5px outset #aaa; + float: left; + margin-top: 20px; + margin-left: 20px; + cursor: pointer; + cursor: hand; +} + +div.current { + border: 5px outset #FF0000; + background: #660000; +} + +div.effect p { + color: #eee; + margin: 0px; + padding: 10px; +} + +.ui-effects-transfer { + border: 1px dotted #fff; + background: #666; + opacity: 0.5; }
\ No newline at end of file diff --git a/ui/demos/real-world/image-cropper/index.html b/ui/demos/real-world/image-cropper/index.html index 528575aef..afa85ae3c 100644 --- a/ui/demos/real-world/image-cropper/index.html +++ b/ui/demos/real-world/image-cropper/index.html @@ -1,231 +1,231 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Language" content="en" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Image Cropper: jQuery Real-world Demo</title>
-<script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script>
-<script type="text/javascript" src="../../../source/ui.core.js"></script>
-<script type="text/javascript" src="../../../source/ui.resizable.js"></script>
-<script type="text/javascript" src="../../../source/ui.draggable.js"></script>
-
-<script type="text/javascript" src="../../../source/effects.core.js"></script>
-<script type="text/javascript" src="../../../source/effects.bounce.js"></script>
-<script type="text/javascript" src="../../../source/effects.scale.js"></script>
-
-
-<style type="text/css">
-<!--
-/*************************************/
-/* Real-World CSS */
-
-@import "real-world.css";
-
-/*************************************/
-/* Demo CSS */
-
-#sidebar div {
- text-align:center;
-}
-.thumb ul {
- padding:10px 0 0 0;
-}
-.thumbs li {
- margin:4px 20px;
-}
-.thumbs li a,
-.thumbs li a img{
- height: 75px;
- width: 75px;
- display: block;
-}
-.thumbs li a:hover,
-.thumbs li a:hover img{
- height: 130px;
- width: 130px;
-}
-.thumbs li a:hover {
- border: 4px solid #E8EEF7;
-}
-
-#break strong {
- margin:0 0 4px 0;
-}
-#break ul {
- padding:6px;
-}
-#break ul li {
- padding:3px 0px;
- font-style: italic;
-}
-#break ul li span {
- font-style: normal;
-}
-
-.ui-resizable-knob {
- border: 1px #fff dashed;
-}
-
-/*************************************/
-/* Cropper CSS */
-
-#resizeme_containment_wrap_image {
- position: relative;
-}
-#resizeme_containment_div {
- position: absolute;
- top:0px;
- left:0px;
- width: 150px;
- height:150px;
-}
-
-#resizeme_containment_div_wrapper {
- position: relative;
-}
-
-
--->
-</style>
-<script type="text/javascript">
- var getSizeImg = function(src) {
- var timg = $('<img>').attr('src', src).css({ position: 'absolute', top: '-1000px', left: '-1000px' }).appendTo('body');
- var size = [ timg.get(0).offsetWidth, timg.get(0).offsetHeight ];
-
- try { document.body.removeChild(timg[0]); }
- catch(e) {};
-
- return size;
- };
-
- $().ready(function(){
-
- $('#resizeme_containment_div').resizable({
-
- containment: $('#resizeme_containment_div_wrapper'),
-
- //proxy: 'proxy',
-
- //ghost: true,
-
- //animate:true,
-
- handles: 'all',
-
- knobHandles: true,
-
- //transparent: true,
-
- //aspectRatio: true,
-
- autoHide: true,
-
- minWidth: 100,
-
- minHeight: 100,
-
- resize: function(e, ui) {
- var self = $(this).data("resizable");
-
- this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px';
-
-
- $("#log-top").html(self.position.top+"px");
-
- $("#log-left").html(self.position.left+"px");
-
- $("#log-height").html(self.size.height+"px");
-
- $("#log-width").html(self.size.width+"px");
-
- },
- stop: function(e, ui) {
- var self = $(this).data("resizable");
- this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px';
- }
- })
-
- .draggable({
-
- cursor: 'move',
-
- containment: $('#resizeme_containment_div_wrapper'),
-
- drag: function(e, ui) {
- var self = $(this).data("draggable");
- this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px';
-
- $("#log-top").html(self.position.top+"px");
-
- $("#log-left").html(self.position.left+"px");
-
- }
-
- });
-
- $('.thumbs').find("li a").click(function(e){
-
- $('#resizeme_containment_div').css('top', '0');
-
- $('#resizeme_containment_div').css('left', '0');
-
- var size = getSizeImg($(this).find("img").attr("src"));
-
- $('#resizeme_containment_wrap_image').css( { width: size[0], height: size[1], background: 'transparent url('+$(this).find("img").attr("src")+') no-repeat scroll 0%' } );
- $('#resizeme_containment_div_wrapper').css( { width: size[0], height: size[1] } );
- $('#resizeme_containment_div').css('background', 'transparent url('+$(this).find("img").attr("src")+') no-repeat scroll 0px 0px');
-
- return false;
-
- });
-
-
- $('#resizeme_containment_wrap_image').css({ opacity: 0.5 });
-
- $("#log-height").html($('#resizeme_containment_div').height()+"px");
-
- $("#log-width").html($('#resizeme_containment_div').width()+"px");
-
- });
-
- $(window).load(function(){
- var size = getSizeImg("img/img01.jpg");
- $('#resizeme_containment_div').css('background', 'transparent url(img/img01.jpg) no-repeat scroll 0px 0px');
- $('#resizeme_containment_div_wrapper').css( { width: size[0], height: size[1] } );
- $('#resizeme_containment_wrap_image').css( { width: size[0], height: size[1], background: 'transparent url(img/img01.jpg) no-repeat scroll 0%' } );
-
- });
-</script>
-</head>
-<body>
- <div id="sidebar">
- <ul class="thumbs">
- <li><a href="#" title="Open This Image"><img src="img/img01.jpg"/></a></li>
- <li><a href="#" title="Open This Image"><img src="img/img02.jpg"/></a></li>
- <li><a href="#" title="Open This Image"><img src="img/img03.jpg"/></a></li>
- <li><a href="#" title="Open This Image"><img src="img/img04.jpg"/></a></li>
- <li><a href="#" title="Open This Image"><img src="img/img05.jpg"/></a></li>
- </div>
- </div>
- <div id="main">
- <div id="header">
- <h2>jQuery Real-world Demo: Image Cropper</h2>
- </div>
- <div id="content">
- <div id="resizeme_containment_div_wrapper">
- <div id="resizeme_containment_wrap_image"></div>
- <div id="resizeme_containment_div"></div>
- </div>
- </div>
- <div id="break">
- <strong>Properties:</strong>
- <ul>
- <li>width: <span id="log-width">0px</span></li>
- <li>height: <span id="log-height">0px</span></li>
- <li>top: <span id="log-top">0px</span></li>
- <li>left: <span id="log-left">0px</span></li>
- </ul>
- </div>
- </div>
-</body>
-</html>
+<!DOCTYPE html> +<html lang="en"> +<head> +<meta http-equiv="Content-Language" content="en" /> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Image Cropper: jQuery Real-world Demo</title> +<script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> +<script type="text/javascript" src="../../../source/ui.core.js"></script> +<script type="text/javascript" src="../../../source/ui.resizable.js"></script> +<script type="text/javascript" src="../../../source/ui.draggable.js"></script> + +<script type="text/javascript" src="../../../source/effects.core.js"></script> +<script type="text/javascript" src="../../../source/effects.bounce.js"></script> +<script type="text/javascript" src="../../../source/effects.scale.js"></script> + + +<style type="text/css"> +<!-- +/*************************************/ +/* Real-World CSS */ + +@import "real-world.css"; + +/*************************************/ +/* Demo CSS */ + +#sidebar div { + text-align:center; +} +.thumb ul { + padding:10px 0 0 0; +} +.thumbs li { + margin:4px 20px; +} +.thumbs li a, +.thumbs li a img{ + height: 75px; + width: 75px; + display: block; +} +.thumbs li a:hover, +.thumbs li a:hover img{ + height: 130px; + width: 130px; +} +.thumbs li a:hover { + border: 4px solid #E8EEF7; +} + +#break strong { + margin:0 0 4px 0; +} +#break ul { + padding:6px; +} +#break ul li { + padding:3px 0px; + font-style: italic; +} +#break ul li span { + font-style: normal; +} + +.ui-resizable-knob { + border: 1px #fff dashed; +} + +/*************************************/ +/* Cropper CSS */ + +#resizeme_containment_wrap_image { + position: relative; +} +#resizeme_containment_div { + position: absolute; + top:0px; + left:0px; + width: 150px; + height:150px; +} + +#resizeme_containment_div_wrapper { + position: relative; +} + + +--> +</style> +<script type="text/javascript"> + var getSizeImg = function(src) { + var timg = $('<img>').attr('src', src).css({ position: 'absolute', top: '-1000px', left: '-1000px' }).appendTo('body'); + var size = [ timg.get(0).offsetWidth, timg.get(0).offsetHeight ]; + + try { document.body.removeChild(timg[0]); } + catch(e) {}; + + return size; + }; + + $().ready(function(){ + + $('#resizeme_containment_div').resizable({ + + containment: $('#resizeme_containment_div_wrapper'), + + //proxy: 'proxy', + + //ghost: true, + + //animate:true, + + handles: 'all', + + knobHandles: true, + + //transparent: true, + + //aspectRatio: true, + + autoHide: true, + + minWidth: 100, + + minHeight: 100, + + resize: function(e, ui) { + var self = $(this).data("resizable"); + + this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px'; + + + $("#log-top").html(self.position.top+"px"); + + $("#log-left").html(self.position.left+"px"); + + $("#log-height").html(self.size.height+"px"); + + $("#log-width").html(self.size.width+"px"); + + }, + stop: function(e, ui) { + var self = $(this).data("resizable"); + this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px'; + } + }) + + .draggable({ + + cursor: 'move', + + containment: $('#resizeme_containment_div_wrapper'), + + drag: function(e, ui) { + var self = $(this).data("draggable"); + this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px'; + + $("#log-top").html(self.position.top+"px"); + + $("#log-left").html(self.position.left+"px"); + + } + + }); + + $('.thumbs').find("li a").click(function(e){ + + $('#resizeme_containment_div').css('top', '0'); + + $('#resizeme_containment_div').css('left', '0'); + + var size = getSizeImg($(this).find("img").attr("src")); + + $('#resizeme_containment_wrap_image').css( { width: size[0], height: size[1], background: 'transparent url('+$(this).find("img").attr("src")+') no-repeat scroll 0%' } ); + $('#resizeme_containment_div_wrapper').css( { width: size[0], height: size[1] } ); + $('#resizeme_containment_div').css('background', 'transparent url('+$(this).find("img").attr("src")+') no-repeat scroll 0px 0px'); + + return false; + + }); + + + $('#resizeme_containment_wrap_image').css({ opacity: 0.5 }); + + $("#log-height").html($('#resizeme_containment_div').height()+"px"); + + $("#log-width").html($('#resizeme_containment_div').width()+"px"); + + }); + + $(window).load(function(){ + var size = getSizeImg("img/img01.jpg"); + $('#resizeme_containment_div').css('background', 'transparent url(img/img01.jpg) no-repeat scroll 0px 0px'); + $('#resizeme_containment_div_wrapper').css( { width: size[0], height: size[1] } ); + $('#resizeme_containment_wrap_image').css( { width: size[0], height: size[1], background: 'transparent url(img/img01.jpg) no-repeat scroll 0%' } ); + + }); +</script> +</head> +<body> + <div id="sidebar"> + <ul class="thumbs"> + <li><a href="#" title="Open This Image"><img src="img/img01.jpg"/></a></li> + <li><a href="#" title="Open This Image"><img src="img/img02.jpg"/></a></li> + <li><a href="#" title="Open This Image"><img src="img/img03.jpg"/></a></li> + <li><a href="#" title="Open This Image"><img src="img/img04.jpg"/></a></li> + <li><a href="#" title="Open This Image"><img src="img/img05.jpg"/></a></li> + </div> + </div> + <div id="main"> + <div id="header"> + <h2>jQuery Real-world Demo: Image Cropper</h2> + </div> + <div id="content"> + <div id="resizeme_containment_div_wrapper"> + <div id="resizeme_containment_wrap_image"></div> + <div id="resizeme_containment_div"></div> + </div> + </div> + <div id="break"> + <strong>Properties:</strong> + <ul> + <li>width: <span id="log-width">0px</span></li> + <li>height: <span id="log-height">0px</span></li> + <li>top: <span id="log-top">0px</span></li> + <li>left: <span id="log-left">0px</span></li> + </ul> + </div> + </div> +</body> +</html> diff --git a/ui/demos/real-world/image-cropper/real-world.css b/ui/demos/real-world/image-cropper/real-world.css index f7630bd8f..683033351 100644 --- a/ui/demos/real-world/image-cropper/real-world.css +++ b/ui/demos/real-world/image-cropper/real-world.css @@ -1,104 +1,104 @@ -/*************************************/
-/* Blueprint: reset.css */
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, font, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- font-size: 100%;
- font-family: inherit;
- vertical-align: baseline;
-}
-
-/* Remember to define focus styles! */
-:focus {
- outline: 0;
-}
-body {
- line-height: 1;
- color: black;
- background: white;
-}
-ol, ul {
- list-style: none;
-}
-
-/* Tables still need 'cellspacing="0"' in the markup. */
-table {
- border-collapse: separate;
- border-spacing: 0;
-}
-caption, th, td {
- text-align: left;
- font-weight: normal;
-}
-
-/* Remove possible quote marks (") from <q>, <blockquote>. */
-blockquote:before, blockquote:after,
-q:before, q:after {
- content: "";
-}
-blockquote, q {
- quotes: "" "";
-}
-
-.clear {
- clear:both;
-}
-
-/*************************************/
-/* Layout */
-body, html {
- height: 100%;
- font-family:sans-serif;
- font-size:13px;
- margin:0px;
- padding:0px;
-}
-body, html {
- height: 100%;
- font-family:sans-serif;
- font-size:13px;
-
-}
-#main {
- height:auto;
- background: #E8EEF7;
- border-left:1px solid #ccc;
- border-bottom:1px solid #ccc;
- margin:0 0 0 200px;
-}
- #header {
- height:30px;
- padding:10px;
- font-size:2em;
- font-weight:bold;
- text-align: center;
- border-bottom:1px solid #ccc;
- background: #E8EEF7;
- }
- #main #content {
- padding:10px;
- background: #FFF;
- }
- #main #break {
- padding:10px;
- border-top:1px solid #ccc;
- }
-#sidebar {
- float:left;
- width:200px;
- height:100%;
- border-right:1px solid #ccc;
-}
- #sidebar div {
- padding:10px;
- }
+/*************************************/ +/* Blueprint: reset.css */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +/* Remember to define focus styles! */ +:focus { + outline: 0; +} +body { + line-height: 1; + color: black; + background: white; +} +ol, ul { + list-style: none; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { + border-collapse: separate; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; +} + +/* Remove possible quote marks (") from <q>, <blockquote>. */ +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +blockquote, q { + quotes: "" ""; +} + +.clear { + clear:both; +} + +/*************************************/ +/* Layout */ +body, html { + height: 100%; + font-family:sans-serif; + font-size:13px; + margin:0px; + padding:0px; +} +body, html { + height: 100%; + font-family:sans-serif; + font-size:13px; + +} +#main { + height:auto; + background: #E8EEF7; + border-left:1px solid #ccc; + border-bottom:1px solid #ccc; + margin:0 0 0 200px; +} + #header { + height:30px; + padding:10px; + font-size:2em; + font-weight:bold; + text-align: center; + border-bottom:1px solid #ccc; + background: #E8EEF7; + } + #main #content { + padding:10px; + background: #FFF; + } + #main #break { + padding:10px; + border-top:1px solid #ccc; + } +#sidebar { + float:left; + width:200px; + height:100%; + border-right:1px solid #ccc; +} + #sidebar div { + padding:10px; + } diff --git a/ui/demos/real-world/layout/demo.css b/ui/demos/real-world/layout/demo.css index 010f09db5..a7b108623 100644 --- a/ui/demos/real-world/layout/demo.css +++ b/ui/demos/real-world/layout/demo.css @@ -1,42 +1,42 @@ -body { background-color:#666; color:#FFF; font:11px/1.5 Arial, sans-serif; margin:0; overflow:hidden; padding:30px 0 0 30px; }
-h1 { font-size:18px; margin:0 0 20px; }
-a { color:#FFF; }
-
-.clear { clear:both; font-size:1px; line-height:1px; }
-
-#overlay { background:#666; height:100%; left:0; position:absolute; top:0; width:100%; z-index:2000; }
-#overlay #preloader { background:url(loader_bg.gif) no-repeat; height:50px; left:50%; line-height:50px; margin:-25px 0 0 -25px; position:absolute; text-align:center; top:50%; width:50px; }
-#overlay #preloader img { margin:11px 0 0 0; vertical-align:middle; }
-
-.ui-sortable { background-color:#FFF; border:1px solid #555; color:#222; margin:0 15px 15px 0; padding:0 10px 10px; width:175px; }
-.ui-sortable h2 { background-color:#555; border-top:3px solid #666; color:#FFF; font-size:11px; margin:0 -10px 10px; line-height:2; padding:0 10px; }
-
-dl.sort { color:#222; margin:10px 0; }
-#uidemo dl.first { margin-top:0; }
-#uidemo dl.last { margin-bottom:0; }
-
-dl.sort dt { background-color:#666; color:#FFF; cursor:move; height:2em; line-height:2; padding:0 6px; position:relative; }
-dl.sort dd { background-color:#FFF; margin:0; padding:3px 6px; }
-
-.ui-sortable-helper { width:175px; }
-.placeholder { border:1px dashed #AAA; }
-
-span.options { cursor:default; font-size:1px; line-height:1px; position:absolute; }
-span.options a { background-color:#FFF; cursor:pointer; display:block; float:left; text-indent:-9000px; }
-
-.ui-sortable h2 span.options { right:10px; top:8px; width:30px; }
-.ui-sortable h2 span.options a { height:12px; width:30px; }
-
-dl.sort dt span.options { right:5px; top:5px; width:27px; }
-dl.sort dt span.options a { height:12px; width:12px; }
-dl.sort dt span.options a.up { margin-right:3px; }
-dl.sort dt span.options a.disabled { background-color:#555; cursor:default; }
-
-#container { float:left; }
-#header { width:638px; }
-#content { float:left; width:400px; }
-#sidebar { float:left; width:200px; }
-#footer { width:638px; }
-#trashcan { float:left; }
-
+body { background-color:#666; color:#FFF; font:11px/1.5 Arial, sans-serif; margin:0; overflow:hidden; padding:30px 0 0 30px; } +h1 { font-size:18px; margin:0 0 20px; } +a { color:#FFF; } + +.clear { clear:both; font-size:1px; line-height:1px; } + +#overlay { background:#666; height:100%; left:0; position:absolute; top:0; width:100%; z-index:2000; } +#overlay #preloader { background:url(loader_bg.gif) no-repeat; height:50px; left:50%; line-height:50px; margin:-25px 0 0 -25px; position:absolute; text-align:center; top:50%; width:50px; } +#overlay #preloader img { margin:11px 0 0 0; vertical-align:middle; } + +.ui-sortable { background-color:#FFF; border:1px solid #555; color:#222; margin:0 15px 15px 0; padding:0 10px 10px; width:175px; } +.ui-sortable h2 { background-color:#555; border-top:3px solid #666; color:#FFF; font-size:11px; margin:0 -10px 10px; line-height:2; padding:0 10px; } + +dl.sort { color:#222; margin:10px 0; } +#uidemo dl.first { margin-top:0; } +#uidemo dl.last { margin-bottom:0; } + +dl.sort dt { background-color:#666; color:#FFF; cursor:move; height:2em; line-height:2; padding:0 6px; position:relative; } +dl.sort dd { background-color:#FFF; margin:0; padding:3px 6px; } + +.ui-sortable-helper { width:175px; } +.placeholder { border:1px dashed #AAA; } + +span.options { cursor:default; font-size:1px; line-height:1px; position:absolute; } +span.options a { background-color:#FFF; cursor:pointer; display:block; float:left; text-indent:-9000px; } + +.ui-sortable h2 span.options { right:10px; top:8px; width:30px; } +.ui-sortable h2 span.options a { height:12px; width:30px; } + +dl.sort dt span.options { right:5px; top:5px; width:27px; } +dl.sort dt span.options a { height:12px; width:12px; } +dl.sort dt span.options a.up { margin-right:3px; } +dl.sort dt span.options a.disabled { background-color:#555; cursor:default; } + +#container { float:left; } +#header { width:638px; } +#content { float:left; width:400px; } +#sidebar { float:left; width:200px; } +#footer { width:638px; } +#trashcan { float:left; } + #trashcan p { margin:0; }
\ No newline at end of file diff --git a/ui/demos/real-world/layout/demo.js b/ui/demos/real-world/layout/demo.js index a17478d2f..695863f25 100644 --- a/ui/demos/real-world/layout/demo.js +++ b/ui/demos/real-world/layout/demo.js @@ -1,97 +1,97 @@ -(function($){
- var updateUpDown = function(sortable){
- $('dl:not(.ui-sortable-helper)', sortable)
- .removeClass('first').removeClass('last')
- .find('.up, .down').removeClass('disabled').end()
- .filter(':first').addClass('first').find('.up').addClass('disabled').end().end()
- .filter(':last').addClass('last').find('.down').addClass('disabled').end().end();
- };
-
- var moveUpDown = function(){
- var link = $(this),
- dl = link.parents('dl'),
- prev = dl.prev('dl'),
- next = dl.next('dl');
-
- if(link.is('.up') && prev.length > 0)
- dl.insertBefore(prev);
-
- if(link.is('.down') && next.length > 0)
- dl.insertAfter(next);
-
- updateUpDown(dl.parent());
- };
-
- var addItem = function(){
- var sortable = $(this).parents('.ui-sortable');
- var options = '<span class="options"><a class="up">up</a><a class="down">down</a></span>';
- var tpl = '<dl class="sort"><dt>{name}' + options + '</dt><dd>{desc}</dd></dl>';
- var html = tpl.replace(/{name}/g, 'Dynamic name :D').replace(/{desc}/g, 'Description');
-
- sortable.append(html).sortable('refresh').find('a.up, a.down').bind('click', moveUpDown);
- updateUpDown(sortable);
- };
-
- var emptyTrashCan = function(item){
- item.remove();
- };
-
- var sortableChange = function(e, ui){
- if(ui.sender){
- var w = ui.element.width();
- ui.placeholder.width(w);
- ui.helper.css("width",ui.element.children().width());
- }
- };
-
- var sortableUpdate = function(e, ui){
- if(ui.element[0].id == 'trashcan'){
- emptyTrashCan(ui.item);
- } else {
- updateUpDown(ui.element[0]);
- if(ui.sender)
- updateUpDown(ui.sender[0]);
- }
- };
-
- $(document).ready(function(){
- var els = ['#header', '#content', '#sidebar', '#footer', '#trashcan'];
- var $els = $(els.toString());
-
- $('h2', $els.slice(0,-1)).append('<span class="options"><a class="add">add</a></span>');
- $('dt', $els).append('<span class="options"><a class="up">up</a><a class="down">down</a></span>');
-
- $('a.add').bind('click', addItem);
- $('a.up, a.down').bind('click', moveUpDown);
-
- $els.each(function(){
- updateUpDown(this);
- });
-
- $els.sortable({
- items: '> dl',
- handle: 'dt',
- cursor: 'move',
- //cursorAt: { top: 2, left: 2 },
- //opacity: 0.8,
- //helper: 'clone',
- appendTo: 'body',
- //placeholder: 'clone',
- //placeholder: 'placeholder',
- connectWith: els,
- start: function(e,ui) {
- ui.helper.css("width", ui.item.width());
- },
- change: sortableChange,
- update: sortableUpdate
- });
- });
-
- $(window).bind('load',function(){
- setTimeout(function(){
- $('#overlay').fadeOut(function(){
- $('body').css('overflow', 'auto');
- });
- }, 750);
- });
+(function($){ + var updateUpDown = function(sortable){ + $('dl:not(.ui-sortable-helper)', sortable) + .removeClass('first').removeClass('last') + .find('.up, .down').removeClass('disabled').end() + .filter(':first').addClass('first').find('.up').addClass('disabled').end().end() + .filter(':last').addClass('last').find('.down').addClass('disabled').end().end(); + }; + + var moveUpDown = function(){ + var link = $(this), + dl = link.parents('dl'), + prev = dl.prev('dl'), + next = dl.next('dl'); + + if(link.is('.up') && prev.length > 0) + dl.insertBefore(prev); + + if(link.is('.down') && next.length > 0) + dl.insertAfter(next); + + updateUpDown(dl.parent()); + }; + + var addItem = function(){ + var sortable = $(this).parents('.ui-sortable'); + var options = '<span class="options"><a class="up">up</a><a class="down">down</a></span>'; + var tpl = '<dl class="sort"><dt>{name}' + options + '</dt><dd>{desc}</dd></dl>'; + var html = tpl.replace(/{name}/g, 'Dynamic name :D').replace(/{desc}/g, 'Description'); + + sortable.append(html).sortable('refresh').find('a.up, a.down').bind('click', moveUpDown); + updateUpDown(sortable); + }; + + var emptyTrashCan = function(item){ + item.remove(); + }; + + var sortableChange = function(e, ui){ + if(ui.sender){ + var w = ui.element.width(); + ui.placeholder.width(w); + ui.helper.css("width",ui.element.children().width()); + } + }; + + var sortableUpdate = function(e, ui){ + if(ui.element[0].id == 'trashcan'){ + emptyTrashCan(ui.item); + } else { + updateUpDown(ui.element[0]); + if(ui.sender) + updateUpDown(ui.sender[0]); + } + }; + + $(document).ready(function(){ + var els = ['#header', '#content', '#sidebar', '#footer', '#trashcan']; + var $els = $(els.toString()); + + $('h2', $els.slice(0,-1)).append('<span class="options"><a class="add">add</a></span>'); + $('dt', $els).append('<span class="options"><a class="up">up</a><a class="down">down</a></span>'); + + $('a.add').bind('click', addItem); + $('a.up, a.down').bind('click', moveUpDown); + + $els.each(function(){ + updateUpDown(this); + }); + + $els.sortable({ + items: '> dl', + handle: 'dt', + cursor: 'move', + //cursorAt: { top: 2, left: 2 }, + //opacity: 0.8, + //helper: 'clone', + appendTo: 'body', + //placeholder: 'clone', + //placeholder: 'placeholder', + connectWith: els, + start: function(e,ui) { + ui.helper.css("width", ui.item.width()); + }, + change: sortableChange, + update: sortableUpdate + }); + }); + + $(window).bind('load',function(){ + setTimeout(function(){ + $('#overlay').fadeOut(function(){ + $('body').css('overflow', 'auto'); + }); + }, 750); + }); })(jQuery);
\ No newline at end of file diff --git a/ui/demos/real-world/layout/index.html b/ui/demos/real-world/layout/index.html index c988e9c0a..83f9d0378 100644 --- a/ui/demos/real-world/layout/index.html +++ b/ui/demos/real-world/layout/index.html @@ -1,94 +1,94 @@ -<!DOCTYPE html>
-<html lang="en">
- <head>
- <title>UI Sortable: Layout Demo</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
- <meta name="title" content="UI Sortable: Layout Demo" />
- <meta name="description" content="A sortable layout created with the jQuery UI suite" />
-
- <meta name="author" content="Joan Piedra" />
- <meta name="author-url" content="http://www.joanpiedra.com/" />
- <meta name="author-url" content="http://www.justaquit.com/" />
- <meta name="author-url" content="http://jquery.com/" />
-
- <link rel="shortcut icon" href="http://jquery.com/favicon.ico" />
- <link rel="icon" href="http://jquery.com/favicon.ico" type="image/x-icon" />
-
- <link rel="stylesheet" href="demo.css" type="text/css" media="screen" />
- <!-- saved from url=(0013)about:internet -->
- </head>
-
- <body id="uidemo">
- <h1>UI Sortable: <em>Layout demo</em></h1>
-
- <div id="container">
- <div id="header" class="ui-sortable">
- <h2>Header</h2>
- <dl class="sort">
- <dt>Pages</dt>
- <dd>Main Navigation</dd>
- </dl>
- </div>
-
- <div id="content" class="ui-sortable">
- <h2>Content</h2>
- <dl class="sort">
- <dt>Blog</dt>
- <dd>Main blog post</dd>
- </dl>
- </div>
-
- <div id="sidebar" class="ui-sortable">
- <h2>Sidebar</h2>
- <dl class="sort">
- <dt>Pages</dt>
- <dd>Mini About</dd>
- </dl>
- <dl class="sort">
- <dt>Blog</dt>
- <dd>Monthly Archives</dd>
- </dl>
- <dl class="sort">
- <dt>Links</dt>
- <dd>Random Links</dd>
- </dl>
- </div>
-
- <div class="clear"></div>
-
- <div id="footer" class="ui-sortable">
- <h2>Footer</h2>
- <dl class="sort">
- <dt>Pages</dt>
- <dd>Copyright</dd>
- </dl>
- </div>
- </div>
-
- <div id="trashcan" class="ui-sortable">
- <h2>Trash can</h2>
- <p>Drag modules here to delete them.</p>
- </div>
-
- <div class="clear"></div>
- <div id="overlay">
- <div id="preloader"><img src="loader.gif" alt="" /></div>
- </div>
-
- <!-- jQuery Core -->
- <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script>
-
- <!-- jQuery UI Base -->
- <script type="text/javascript" src="../../../source/ui.core.js"></script>
-
- <!-- jQuery UI Plugins -->
- <script type="text/javascript" src="../../../source/ui.draggable.js"></script>
- <script type="text/javascript" src="../../../source/ui.droppable.js"></script>
- <script type="text/javascript" src="../../../source/ui.sortable.js"></script>
-
-
- <!-- jQuery UI Demo -->
- <script type="text/javascript" src="demo.js"></script>
- </body>
+<!DOCTYPE html> +<html lang="en"> + <head> + <title>UI Sortable: Layout Demo</title> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> + + <meta name="title" content="UI Sortable: Layout Demo" /> + <meta name="description" content="A sortable layout created with the jQuery UI suite" /> + + <meta name="author" content="Joan Piedra" /> + <meta name="author-url" content="http://www.joanpiedra.com/" /> + <meta name="author-url" content="http://www.justaquit.com/" /> + <meta name="author-url" content="http://jquery.com/" /> + + <link rel="shortcut icon" href="http://jquery.com/favicon.ico" /> + <link rel="icon" href="http://jquery.com/favicon.ico" type="image/x-icon" /> + + <link rel="stylesheet" href="demo.css" type="text/css" media="screen" /> + <!-- saved from url=(0013)about:internet --> + </head> + + <body id="uidemo"> + <h1>UI Sortable: <em>Layout demo</em></h1> + + <div id="container"> + <div id="header" class="ui-sortable"> + <h2>Header</h2> + <dl class="sort"> + <dt>Pages</dt> + <dd>Main Navigation</dd> + </dl> + </div> + + <div id="content" class="ui-sortable"> + <h2>Content</h2> + <dl class="sort"> + <dt>Blog</dt> + <dd>Main blog post</dd> + </dl> + </div> + + <div id="sidebar" class="ui-sortable"> + <h2>Sidebar</h2> + <dl class="sort"> + <dt>Pages</dt> + <dd>Mini About</dd> + </dl> + <dl class="sort"> + <dt>Blog</dt> + <dd>Monthly Archives</dd> + </dl> + <dl class="sort"> + <dt>Links</dt> + <dd>Random Links</dd> + </dl> + </div> + + <div class="clear"></div> + + <div id="footer" class="ui-sortable"> + <h2>Footer</h2> + <dl class="sort"> + <dt>Pages</dt> + <dd>Copyright</dd> + </dl> + </div> + </div> + + <div id="trashcan" class="ui-sortable"> + <h2>Trash can</h2> + <p>Drag modules here to delete them.</p> + </div> + + <div class="clear"></div> + <div id="overlay"> + <div id="preloader"><img src="loader.gif" alt="" /></div> + </div> + + <!-- jQuery Core --> + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + + <!-- jQuery UI Base --> + <script type="text/javascript" src="../../../source/ui.core.js"></script> + + <!-- jQuery UI Plugins --> + <script type="text/javascript" src="../../../source/ui.draggable.js"></script> + <script type="text/javascript" src="../../../source/ui.droppable.js"></script> + <script type="text/javascript" src="../../../source/ui.sortable.js"></script> + + + <!-- jQuery UI Demo --> + <script type="text/javascript" src="demo.js"></script> + </body> </html>
\ No newline at end of file diff --git a/ui/demos/real-world/photo-manager/index.html b/ui/demos/real-world/photo-manager/index.html index ec6568fe3..ecc9a5500 100644 --- a/ui/demos/real-world/photo-manager/index.html +++ b/ui/demos/real-world/photo-manager/index.html @@ -1,126 +1,126 @@ -<!DOCTYPE html>
-<html lang="en">
- <head>
- <title>jQuery UI Draggables and Droppables playground</title>
-
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <meta http-equiv="content-language" content="en" />
-
- <meta name="keywords" content="jquery, ui, droppables, draggables, demo" />
- <meta name="description" content="Demonstration of jQuery UI Droppables and Dragables. More to come." />
- <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script>
- <script type="text/javascript" src="js/jquery.livequery.js"></script>
- <script type="text/javascript" src="js/jquery.blockUI.js"></script>
-
- <script type="text/javascript" src="../../../source/ui.core.js"></script>
- <script type="text/javascript" src="../../../source/ui.draggable.js"></script>
- <script type="text/javascript" src="../../../source/ui.droppable.js"></script>
-
- <script type="text/javascript" src="./js/demo.js"></script>
-
- <link rel="stylesheet" type="text/css" href="./theme/css/screen.css" media="screen, projection" />
- </head>
- <body>
- <h1>Manage Your Photos</h1>
- <div id="body_wrap">
- <div id="content">
- <h2>Drag photos to the Trash or waste them in the Shredder:</h2>
- <ul class="gallery">
- <li>
- <img src="./img/thumbs/P1010020.JPG" alt="Tatry 1" title="Drag me!" />
- <p>Tatry 1</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010020.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010036.JPG" alt="Tatry 2" title="Drag me!" />
- <p>Tatry 2</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010036.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010039.JPG" alt="Tatry 3" title="Drag me!" />
- <p>Tatry 3</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010039.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010044.JPG" alt="Tatry 4" title="Drag me!" />
- <p>Tatry 4</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010044.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010050.JPG" alt="Tatry 5" title="Drag me!" />
- <p>Tatry 5</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010050.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010055.JPG" alt="Tatry 6" title="Drag me!" />
- <p>Tatry 6</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010055.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010058.JPG" alt="Tatry 7" title="Drag me!" />
- <p>Tatry 7</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010058.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010059.JPG" alt="Tatry 8" title="Drag me!" />
- <p>Tatry 8</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010059.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010061.JPG" alt="Tatry 9" title="Drag me!" />
- <p>Tatry 9</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010061.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- <li>
- <img src="./img/thumbs/P1010063.JPG" alt="Tatry 10" title="Drag me!" />
- <p>Tatry 10</p>
- <div>
- <a href="#" title="Trash me." class="tb_trash">Trash me</a>
- <a href="./img/P1010063.JPG" title="See me supersized." class="tb_supersize">See me supersized</a>
- </div>
- </li>
- </ul>
- </div>
- <div id="sidebar">
- <div class="box" id="trash">
- <h2>Trash (drag me back)</h2>
- <div></div>
- </div>
- <div class="box" id="shred">
- <h2>Shredder (see me no more)</h2>
- <div></div>
- </div>
- </div>
- </div>
- <div id="footer">
- <p>Demo footer here :)</p>
- </div>
- </body>
-</html>
+<!DOCTYPE html> +<html lang="en"> + <head> + <title>jQuery UI Draggables and Droppables playground</title> + + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <meta http-equiv="content-language" content="en" /> + + <meta name="keywords" content="jquery, ui, droppables, draggables, demo" /> + <meta name="description" content="Demonstration of jQuery UI Droppables and Dragables. More to come." /> + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + <script type="text/javascript" src="js/jquery.livequery.js"></script> + <script type="text/javascript" src="js/jquery.blockUI.js"></script> + + <script type="text/javascript" src="../../../source/ui.core.js"></script> + <script type="text/javascript" src="../../../source/ui.draggable.js"></script> + <script type="text/javascript" src="../../../source/ui.droppable.js"></script> + + <script type="text/javascript" src="./js/demo.js"></script> + + <link rel="stylesheet" type="text/css" href="./theme/css/screen.css" media="screen, projection" /> + </head> + <body> + <h1>Manage Your Photos</h1> + <div id="body_wrap"> + <div id="content"> + <h2>Drag photos to the Trash or waste them in the Shredder:</h2> + <ul class="gallery"> + <li> + <img src="./img/thumbs/P1010020.JPG" alt="Tatry 1" title="Drag me!" /> + <p>Tatry 1</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010020.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010036.JPG" alt="Tatry 2" title="Drag me!" /> + <p>Tatry 2</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010036.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010039.JPG" alt="Tatry 3" title="Drag me!" /> + <p>Tatry 3</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010039.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010044.JPG" alt="Tatry 4" title="Drag me!" /> + <p>Tatry 4</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010044.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010050.JPG" alt="Tatry 5" title="Drag me!" /> + <p>Tatry 5</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010050.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010055.JPG" alt="Tatry 6" title="Drag me!" /> + <p>Tatry 6</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010055.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010058.JPG" alt="Tatry 7" title="Drag me!" /> + <p>Tatry 7</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010058.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010059.JPG" alt="Tatry 8" title="Drag me!" /> + <p>Tatry 8</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010059.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010061.JPG" alt="Tatry 9" title="Drag me!" /> + <p>Tatry 9</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010061.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010063.JPG" alt="Tatry 10" title="Drag me!" /> + <p>Tatry 10</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010063.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + </ul> + </div> + <div id="sidebar"> + <div class="box" id="trash"> + <h2>Trash (drag me back)</h2> + <div></div> + </div> + <div class="box" id="shred"> + <h2>Shredder (see me no more)</h2> + <div></div> + </div> + </div> + </div> + <div id="footer"> + <p>Demo footer here :)</p> + </div> + </body> +</html> diff --git a/ui/demos/real-world/photo-manager/js/demo.js b/ui/demos/real-world/photo-manager/js/demo.js index 437191e2c..fac91ca1c 100644 --- a/ui/demos/real-world/photo-manager/js/demo.js +++ b/ui/demos/real-world/photo-manager/js/demo.js @@ -1,130 +1,130 @@ -/*
- * The very first increment of Droppables&Draggables demo. The code is going to
- * be more concise (remove unnecessary code repetitions etc.). And imho the
- * photo management is a good candidate for demonstration of more jQuery UI
- * components (sortables, selectables...). More to come...
- *
- */
-
-$(window).bind('load', function() {
- // make images in the gallery draggable
- $('ul.gallery img').addClass('img_content').draggable({
- helper: 'clone'
- });
-
- // make the trash box droppable, accepting images from the content section only
- $('#trash div').droppable({
- accept: '.img_content',
- activeClass: 'active',
- drop: function(ev, ui) {
- var $that = $(this);
- ui.draggable.parent().fadeOut('slow', function() {
- ui.draggable
- .hide()
- .appendTo($that)
- .fadeIn('slow')
- .animate({
- width: '72px',
- height: '54px'
- })
- .removeClass('img_content')
- .addClass('img_trash');
- $(this).remove();
- });
- }
- });
-
- // make the shredder box droppable, accepting images from both content and trash sections
- $('#shred div').droppable({
- accept: '.img_content, .img_trash',
- activeClass: 'active',
- drop: function(ev, ui) {
- var $that = $(this);
- // images from the content
- if (ui.draggable.hasClass('img_content')) {
- ui.draggable.parent().fadeOut('slow', function() {
- ui.draggable
- .appendTo($that)
- .animate({
- width: '0',
- height: '0'
- }, 'slow', function(){
- $(this).remove();
- });
- $(this).remove();
- });
- }
- // images from the trash
- else if (ui.draggable.hasClass('img_trash')) {
- ui.draggable
- .appendTo($that)
- .animate({
- width: '0',
- height: '0'
- }, 'slow', function(){
- $(this).remove();
- });
- }
- }
- });
-
- // make the gallery droppable as well, accepting images from the trash only
- $('ul.gallery').droppable({
- accept: '.img_trash',
- activeClass: 'active',
- drop: function(ev, ui) {
- var $that = $(this);
- ui.draggable.fadeOut('slow', function() {
- var $item = createGalleryItem(this).appendTo($that);
- $(this)
- .removeClass('img_trash')
- .addClass('img_content')
- .css({ width: '144px', height: '108px' })
- .show();
- $item.fadeIn('slow');
- });
- }
- });
-
- // handle the trash icon behavior
- $('a.tb_trash').livequery('click', function() {
- var $this = $(this);
- var $img = $this.parent().siblings('img');
- var $item = $this.parents('li');
-
- $item.fadeOut('slow', function() {
- $img
- .hide()
- .appendTo('#trash div')
- .fadeIn('slow')
- .animate({
- width: '72px',
- height: '54px'
- })
- .removeClass('img_content')
- .addClass('img_trash');
- $(this).remove();
- });
-
- return false;
- });
-
- // handle the magnify button
- $('a.tb_supersize').livequery('click', function() {
- $('<img width="576" height="432">')
- .attr('src', $(this).attr('href'))
- .appendTo('#body_wrap')
- .displayBox();
- return false;
- });
-});
-
-function createGalleryItem(img) {
- var title = img.getAttribute('alt');
- var href = img.getAttribute('src').replace(/thumbs\//, '');
-
- var $item = $('<li><p>'+title+'</p><div><a href="#" title="Trash me" class="tb_trash">Trash me</a><a href="'+href+'" title="See me supersized" class="tb_supersize">See me supersized</a></div></li>').hide();
- $item.prepend($(img));
-
- return $item;
-}
+/* + * The very first increment of Droppables&Draggables demo. The code is going to + * be more concise (remove unnecessary code repetitions etc.). And imho the + * photo management is a good candidate for demonstration of more jQuery UI + * components (sortables, selectables...). More to come... + * + */ + +$(window).bind('load', function() { + // make images in the gallery draggable + $('ul.gallery img').addClass('img_content').draggable({ + helper: 'clone' + }); + + // make the trash box droppable, accepting images from the content section only + $('#trash div').droppable({ + accept: '.img_content', + activeClass: 'active', + drop: function(ev, ui) { + var $that = $(this); + ui.draggable.parent().fadeOut('slow', function() { + ui.draggable + .hide() + .appendTo($that) + .fadeIn('slow') + .animate({ + width: '72px', + height: '54px' + }) + .removeClass('img_content') + .addClass('img_trash'); + $(this).remove(); + }); + } + }); + + // make the shredder box droppable, accepting images from both content and trash sections + $('#shred div').droppable({ + accept: '.img_content, .img_trash', + activeClass: 'active', + drop: function(ev, ui) { + var $that = $(this); + // images from the content + if (ui.draggable.hasClass('img_content')) { + ui.draggable.parent().fadeOut('slow', function() { + ui.draggable + .appendTo($that) + .animate({ + width: '0', + height: '0' + }, 'slow', function(){ + $(this).remove(); + }); + $(this).remove(); + }); + } + // images from the trash + else if (ui.draggable.hasClass('img_trash')) { + ui.draggable + .appendTo($that) + .animate({ + width: '0', + height: '0' + }, 'slow', function(){ + $(this).remove(); + }); + } + } + }); + + // make the gallery droppable as well, accepting images from the trash only + $('ul.gallery').droppable({ + accept: '.img_trash', + activeClass: 'active', + drop: function(ev, ui) { + var $that = $(this); + ui.draggable.fadeOut('slow', function() { + var $item = createGalleryItem(this).appendTo($that); + $(this) + .removeClass('img_trash') + .addClass('img_content') + .css({ width: '144px', height: '108px' }) + .show(); + $item.fadeIn('slow'); + }); + } + }); + + // handle the trash icon behavior + $('a.tb_trash').livequery('click', function() { + var $this = $(this); + var $img = $this.parent().siblings('img'); + var $item = $this.parents('li'); + + $item.fadeOut('slow', function() { + $img + .hide() + .appendTo('#trash div') + .fadeIn('slow') + .animate({ + width: '72px', + height: '54px' + }) + .removeClass('img_content') + .addClass('img_trash'); + $(this).remove(); + }); + + return false; + }); + + // handle the magnify button + $('a.tb_supersize').livequery('click', function() { + $('<img width="576" height="432">') + .attr('src', $(this).attr('href')) + .appendTo('#body_wrap') + .displayBox(); + return false; + }); +}); + +function createGalleryItem(img) { + var title = img.getAttribute('alt'); + var href = img.getAttribute('src').replace(/thumbs\//, ''); + + var $item = $('<li><p>'+title+'</p><div><a href="#" title="Trash me" class="tb_trash">Trash me</a><a href="'+href+'" title="See me supersized" class="tb_supersize">See me supersized</a></div></li>').hide(); + $item.prepend($(img)); + + return $item; +} diff --git a/ui/demos/real-world/photo-manager/js/jquery.blockUI.js b/ui/demos/real-world/photo-manager/js/jquery.blockUI.js index 1c338ebb5..b24c2dd05 100644 --- a/ui/demos/real-world/photo-manager/js/jquery.blockUI.js +++ b/ui/demos/real-world/photo-manager/js/jquery.blockUI.js @@ -1,361 +1,361 @@ -/*
- * jQuery blockUI plugin
- * Version 1.33 (09/14/2007)
- * @requires jQuery v1.1.1
- *
- * $Id: jquery.blockUI.js 3291 2007-09-14 23:56:25Z malsup $
- *
- * Examples at: http://malsup.com/jquery/block/
- * Copyright (c) 2007 M. Alsup
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- */
- (function($) {
-/**
- * blockUI provides a mechanism for blocking user interaction with a page (or parts of a page).
- * This can be an effective way to simulate synchronous behavior during ajax operations without
- * locking the browser. It will prevent user operations for the current page while it is
- * active ane will return the page to normal when it is deactivate. blockUI accepts the following
- * two optional arguments:
- *
- * message (String|Element|jQuery): The message to be displayed while the UI is blocked. The message
- * argument can be a plain text string like "Processing...", an HTML string like
- * "<h1><img src="busy.gif" /> Please wait...</h1>", a DOM element, or a jQuery object.
- * The default message is "<h1>Please wait...</h1>"
- *
- * css (Object): Object which contains css property/values to override the default styles of
- * the message. Use this argument if you wish to override the default
- * styles. The css Object should be in a format suitable for the jQuery.css
- * function. For example:
- * $.blockUI({
- * backgroundColor: '#ff8',
- * border: '5px solid #f00,
- * fontWeight: 'bold'
- * });
- *
- * The default blocking message used when blocking the entire page is "<h1>Please wait...</h1>"
- * but this can be overridden by assigning a value to $.blockUI.defaults.pageMessage in your
- * own code. For example:
- *
- * $.blockUI.defaults.pageMessage = "<h1>Bitte Wartezeit</h1>";
- *
- * The default message styling can also be overridden. For example:
- *
- * $.extend($.blockUI.defaults.pageMessageCSS, { color: '#00a', backgroundColor: '#0f0' });
- *
- * The default styles work well for simple messages like "Please wait", but for longer messages
- * style overrides may be necessary.
- *
- * @example $.blockUI();
- * @desc prevent user interaction with the page (and show the default message of 'Please wait...')
- *
- * @example $.blockUI( { backgroundColor: '#f00', color: '#fff'} );
- * @desc prevent user interaction and override the default styles of the message to use a white on red color scheme
- *
- * @example $.blockUI('Processing...');
- * @desc prevent user interaction and display the message "Processing..." instead of the default message
- *
- * @name blockUI
- * @param String|jQuery|Element message Message to display while the UI is blocked
- * @param Object css Style object to control look of the message
- * @cat Plugins/blockUI
- */
-$.blockUI = function(msg, css, opts) {
- $.blockUI.impl.install(window, msg, css, opts);
-};
-
-// expose version number so other plugins can interogate
-$.blockUI.version = 1.33;
-
-/**
- * unblockUI removes the UI block that was put in place by blockUI
- *
- * @example $.unblockUI();
- * @desc unblocks the page
- *
- * @name unblockUI
- * @cat Plugins/blockUI
- */
-$.unblockUI = function(opts) {
- $.blockUI.impl.remove(window, opts);
-};
-
-/**
- * Blocks user interaction with the selected elements. (Hat tip: Much of
- * this logic comes from Brandon Aaron's bgiframe plugin. Thanks, Brandon!)
- * By default, no message is displayed when blocking elements.
- *
- * @example $('div.special').block();
- * @desc prevent user interaction with all div elements with the 'special' class.
- *
- * @example $('div.special').block('Please wait');
- * @desc prevent user interaction with all div elements with the 'special' class
- * and show a message over the blocked content.
- *
- * @name block
- * @type jQuery
- * @param String|jQuery|Element message Message to display while the element is blocked
- * @param Object css Style object to control look of the message
- * @cat Plugins/blockUI
- */
-$.fn.block = function(msg, css, opts) {
- return this.each(function() {
- if (!this.$pos_checked) {
- if ($.css(this,"position") == 'static')
- this.style.position = 'relative';
- if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' in IE
- this.$pos_checked = 1;
- }
- $.blockUI.impl.install(this, msg, css, opts);
- });
-};
-
-/**
- * Unblocks content that was blocked by "block()"
- *
- * @example $('div.special').unblock();
- * @desc unblocks all div elements with the 'special' class.
- *
- * @name unblock
- * @type jQuery
- * @cat Plugins/blockUI
- */
-$.fn.unblock = function(opts) {
- return this.each(function() {
- $.blockUI.impl.remove(this, opts);
- });
-};
-
-/**
- * displays the first matched element in a "display box" above a page overlay.
- *
- * @example $('#myImage').displayBox();
- * @desc displays "myImage" element in a box
- *
- * @name displayBox
- * @type jQuery
- * @cat Plugins/blockUI
- */
-$.fn.displayBox = function(css, fn, isFlash) {
- var msg = this[0];
- if (!msg) return;
- var $msg = $(msg);
- css = css || {};
-
- var w = $msg.width() || $msg.attr('width') || css.width || $.blockUI.defaults.displayBoxCSS.width;
- var h = $msg.height() || $msg.attr('height') || css.height || $.blockUI.defaults.displayBoxCSS.height ;
- if (w[w.length-1] == '%') {
- var ww = document.documentElement.clientWidth || document.body.clientWidth;
- w = parseInt(w) || 100;
- w = (w * ww) / 100;
- }
- if (h[h.length-1] == '%') {
- var hh = document.documentElement.clientHeight || document.body.clientHeight;
- h = parseInt(h) || 100;
- h = (h * hh) / 100;
- }
-
- var ml = '-' + parseInt(w)/2 + 'px';
- var mt = '-' + parseInt(h)/2 + 'px';
-
- // supress opacity on overlay if displaying flash content on mac/ff platform
- var ua = navigator.userAgent.toLowerCase();
- var opts = {
- displayMode: fn || 1,
- noalpha: isFlash && /mac/.test(ua) && /firefox/.test(ua)
- };
-
- $.blockUI.impl.install(window, msg, { width: w, height: h, marginTop: mt, marginLeft: ml }, opts);
-};
-
-
-// override these in your code to change the default messages and styles
-$.blockUI.defaults = {
- // the message displayed when blocking the entire page
- pageMessage: '<h1>Please wait...</h1>',
- // the message displayed when blocking an element
- elementMessage: '', // none
- // styles for the overlay iframe
- overlayCSS: { backgroundColor: '#fff', opacity: '0.5' },
- // styles for the message when blocking the entire page
- pageMessageCSS: { width:'250px', margin:'-50px 0 0 -125px', top:'50%', left:'50%', textAlign:'center', color:'#000', backgroundColor:'#fff', border:'3px solid #aaa' },
- // styles for the message when blocking an element
- elementMessageCSS: { width:'250px', padding:'10px', textAlign:'center', backgroundColor:'#fff'},
- // styles for the displayBox
- displayBoxCSS: { width: '400px', height: '400px', top:'50%', left:'50%' },
- // allow body element to be stetched in ie6
- ie6Stretch: 1,
- // supress tab nav from leaving blocking content?
- allowTabToLeave: 0,
- // Title attribute for overlay when using displayBox
- closeMessage: 'Click to close',
- // use fadeOut effect when unblocking (can be overridden on unblock call)
- fadeOut: 1,
- // fadeOut transition time in millis
- fadeTime: 400
-};
-
-// the gory details
-$.blockUI.impl = {
- box: null,
- boxCallback: null,
- pageBlock: null,
- pageBlockEls: [],
- op8: window.opera && window.opera.version() < 9,
- ie6: $.browser.msie && /MSIE 6.0/.test(navigator.userAgent),
- install: function(el, msg, css, opts) {
- opts = opts || {};
- this.boxCallback = typeof opts.displayMode == 'function' ? opts.displayMode : null;
- this.box = opts.displayMode ? msg : null;
- var full = (el == window);
-
- // use logical settings for opacity support based on browser but allow overrides via opts arg
- var noalpha = this.op8 || $.browser.mozilla && /Linux/.test(navigator.platform);
- if (typeof opts.alphaOverride != 'undefined')
- noalpha = opts.alphaOverride == 0 ? 1 : 0;
-
- if (full && this.pageBlock) this.remove(window, {fadeOut:0});
- // check to see if we were only passed the css object (a literal)
- if (msg && typeof msg == 'object' && !msg.jquery && !msg.nodeType) {
- css = msg;
- msg = null;
- }
- msg = msg ? (msg.nodeType ? $(msg) : msg) : full ? $.blockUI.defaults.pageMessage : $.blockUI.defaults.elementMessage;
- if (opts.displayMode)
- var basecss = jQuery.extend({}, $.blockUI.defaults.displayBoxCSS);
- else
- var basecss = jQuery.extend({}, full ? $.blockUI.defaults.pageMessageCSS : $.blockUI.defaults.elementMessageCSS);
- css = jQuery.extend(basecss, css || {});
- var f = ($.browser.msie) ? $('<iframe class="blockUI" style="z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>')
- : $('<div class="blockUI" style="display:none"></div>');
- var w = $('<div class="blockUI" style="z-index:1001;cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
- var m = full ? $('<div class="blockUI blockMsg" style="z-index:1002;cursor:wait;padding:0;position:fixed"></div>')
- : $('<div class="blockUI" style="display:none;z-index:1002;cursor:wait;position:absolute"></div>');
- w.css('position', full ? 'fixed' : 'absolute');
- if (msg) m.css(css);
- if (!noalpha) w.css($.blockUI.defaults.overlayCSS);
- if (this.op8) w.css({ width:''+el.clientWidth,height:''+el.clientHeight }); // lame
- if ($.browser.msie) f.css('opacity','0.0');
-
- $([f[0],w[0],m[0]]).appendTo(full ? 'body' : el);
-
- // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
- var expr = $.browser.msie && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
- if (this.ie6 || expr) {
- // stretch content area if it's short
- if (full && $.blockUI.defaults.ie6Stretch && $.boxModel)
- $('html,body').css('height','100%');
-
- // fix ie6 problem when blocked element has a border width
- if ((this.ie6 || !$.boxModel) && !full) {
- var t = this.sz(el,'borderTopWidth'), l = this.sz(el,'borderLeftWidth');
- var fixT = t ? '(0 - '+t+')' : 0;
- var fixL = l ? '(0 - '+l+')' : 0;
- }
-
- // simulate fixed position
- $.each([f,w,m], function(i,o) {
- var s = o[0].style;
- s.position = 'absolute';
- if (i < 2) {
- full ? s.setExpression('height','document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"')
- : s.setExpression('height','this.parentNode.offsetHeight + "px"');
- full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
- : s.setExpression('width','this.parentNode.offsetWidth + "px"');
- if (fixL) s.setExpression('left', fixL);
- if (fixT) s.setExpression('top', fixT);
- }
- else {
- if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
- s.marginTop = 0;
- }
- });
- }
- if (opts.displayMode) {
- w.css('cursor','default').attr('title', $.blockUI.defaults.closeMessage);
- m.css('cursor','default');
- $([f[0],w[0],m[0]]).removeClass('blockUI').addClass('displayBox');
- $().click($.blockUI.impl.boxHandler).bind('keypress', $.blockUI.impl.boxHandler);
- }
- else
- this.bind(1, el);
- m.append(msg).show();
- if (msg.jquery) msg.show();
- if (opts.displayMode) return;
- if (full) {
- this.pageBlock = m[0];
- this.pageBlockEls = $(':input:enabled:visible',this.pageBlock);
- setTimeout(this.focus, 20);
- }
- else this.center(m[0]);
- },
- remove: function(el, opts) {
- var o = $.extend({}, $.blockUI.defaults, opts);
- this.bind(0, el);
- var full = el == window;
- var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el);
- if (full) this.pageBlock = this.pageBlockEls = null;
-
- if (o.fadeOut) {
- els.fadeOut(o.fadeTime, function() {
- if (this.parentNode) this.parentNode.removeChild(this);
- });
- }
- else els.remove();
- },
- boxRemove: function(el) {
- $().unbind('click',$.blockUI.impl.boxHandler).unbind('keypress', $.blockUI.impl.boxHandler);
- if (this.boxCallback)
- this.boxCallback(this.box);
- $('body .displayBox').hide().remove();
- },
- // event handler to suppress keyboard/mouse events when blocking
- handler: function(e) {
- if (e.keyCode && e.keyCode == 9) {
- if ($.blockUI.impl.pageBlock && !$.blockUI.defaults.allowTabToLeave) {
- var els = $.blockUI.impl.pageBlockEls;
- var fwd = !e.shiftKey && e.target == els[els.length-1];
- var back = e.shiftKey && e.target == els[0];
- if (fwd || back) {
- setTimeout(function(){$.blockUI.impl.focus(back)},10);
- return false;
- }
- }
- }
- if ($(e.target).parents('div.blockMsg').length > 0)
- return true;
- return $(e.target).parents().children().filter('div.blockUI').length == 0;
- },
- boxHandler: function(e) {
- if ((e.keyCode && e.keyCode == 27) || (e.type == 'click' && $(e.target).parents('div.blockMsg').length == 0))
- $.blockUI.impl.boxRemove();
- return true;
- },
- // bind/unbind the handler
- bind: function(b, el) {
- var full = el == window;
- // don't bother unbinding if there is nothing to unbind
- if (!b && (full && !this.pageBlock || !full && !el.$blocked)) return;
- if (!full) el.$blocked = b;
- var $e = $(el).find('a,:input');
- $.each(['mousedown','mouseup','keydown','keypress','click'], function(i,o) {
- $e[b?'bind':'unbind'](o, $.blockUI.impl.handler);
- });
- },
- focus: function(back) {
- if (!$.blockUI.impl.pageBlockEls) return;
- var e = $.blockUI.impl.pageBlockEls[back===true ? $.blockUI.impl.pageBlockEls.length-1 : 0];
- if (e) e.focus();
- },
- center: function(el) {
- var p = el.parentNode, s = el.style;
- var l = ((p.offsetWidth - el.offsetWidth)/2) - this.sz(p,'borderLeftWidth');
- var t = ((p.offsetHeight - el.offsetHeight)/2) - this.sz(p,'borderTopWidth');
- s.left = l > 0 ? (l+'px') : '0';
- s.top = t > 0 ? (t+'px') : '0';
- },
- sz: function(el, p) { return parseInt($.css(el,p))||0; }
-};
-
-})(jQuery);
+/* + * jQuery blockUI plugin + * Version 1.33 (09/14/2007) + * @requires jQuery v1.1.1 + * + * $Id: jquery.blockUI.js 3291 2007-09-14 23:56:25Z malsup $ + * + * Examples at: http://malsup.com/jquery/block/ + * Copyright (c) 2007 M. Alsup + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + (function($) { +/** + * blockUI provides a mechanism for blocking user interaction with a page (or parts of a page). + * This can be an effective way to simulate synchronous behavior during ajax operations without + * locking the browser. It will prevent user operations for the current page while it is + * active ane will return the page to normal when it is deactivate. blockUI accepts the following + * two optional arguments: + * + * message (String|Element|jQuery): The message to be displayed while the UI is blocked. The message + * argument can be a plain text string like "Processing...", an HTML string like + * "<h1><img src="busy.gif" /> Please wait...</h1>", a DOM element, or a jQuery object. + * The default message is "<h1>Please wait...</h1>" + * + * css (Object): Object which contains css property/values to override the default styles of + * the message. Use this argument if you wish to override the default + * styles. The css Object should be in a format suitable for the jQuery.css + * function. For example: + * $.blockUI({ + * backgroundColor: '#ff8', + * border: '5px solid #f00, + * fontWeight: 'bold' + * }); + * + * The default blocking message used when blocking the entire page is "<h1>Please wait...</h1>" + * but this can be overridden by assigning a value to $.blockUI.defaults.pageMessage in your + * own code. For example: + * + * $.blockUI.defaults.pageMessage = "<h1>Bitte Wartezeit</h1>"; + * + * The default message styling can also be overridden. For example: + * + * $.extend($.blockUI.defaults.pageMessageCSS, { color: '#00a', backgroundColor: '#0f0' }); + * + * The default styles work well for simple messages like "Please wait", but for longer messages + * style overrides may be necessary. + * + * @example $.blockUI(); + * @desc prevent user interaction with the page (and show the default message of 'Please wait...') + * + * @example $.blockUI( { backgroundColor: '#f00', color: '#fff'} ); + * @desc prevent user interaction and override the default styles of the message to use a white on red color scheme + * + * @example $.blockUI('Processing...'); + * @desc prevent user interaction and display the message "Processing..." instead of the default message + * + * @name blockUI + * @param String|jQuery|Element message Message to display while the UI is blocked + * @param Object css Style object to control look of the message + * @cat Plugins/blockUI + */ +$.blockUI = function(msg, css, opts) { + $.blockUI.impl.install(window, msg, css, opts); +}; + +// expose version number so other plugins can interogate +$.blockUI.version = 1.33; + +/** + * unblockUI removes the UI block that was put in place by blockUI + * + * @example $.unblockUI(); + * @desc unblocks the page + * + * @name unblockUI + * @cat Plugins/blockUI + */ +$.unblockUI = function(opts) { + $.blockUI.impl.remove(window, opts); +}; + +/** + * Blocks user interaction with the selected elements. (Hat tip: Much of + * this logic comes from Brandon Aaron's bgiframe plugin. Thanks, Brandon!) + * By default, no message is displayed when blocking elements. + * + * @example $('div.special').block(); + * @desc prevent user interaction with all div elements with the 'special' class. + * + * @example $('div.special').block('Please wait'); + * @desc prevent user interaction with all div elements with the 'special' class + * and show a message over the blocked content. + * + * @name block + * @type jQuery + * @param String|jQuery|Element message Message to display while the element is blocked + * @param Object css Style object to control look of the message + * @cat Plugins/blockUI + */ +$.fn.block = function(msg, css, opts) { + return this.each(function() { + if (!this.$pos_checked) { + if ($.css(this,"position") == 'static') + this.style.position = 'relative'; + if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' in IE + this.$pos_checked = 1; + } + $.blockUI.impl.install(this, msg, css, opts); + }); +}; + +/** + * Unblocks content that was blocked by "block()" + * + * @example $('div.special').unblock(); + * @desc unblocks all div elements with the 'special' class. + * + * @name unblock + * @type jQuery + * @cat Plugins/blockUI + */ +$.fn.unblock = function(opts) { + return this.each(function() { + $.blockUI.impl.remove(this, opts); + }); +}; + +/** + * displays the first matched element in a "display box" above a page overlay. + * + * @example $('#myImage').displayBox(); + * @desc displays "myImage" element in a box + * + * @name displayBox + * @type jQuery + * @cat Plugins/blockUI + */ +$.fn.displayBox = function(css, fn, isFlash) { + var msg = this[0]; + if (!msg) return; + var $msg = $(msg); + css = css || {}; + + var w = $msg.width() || $msg.attr('width') || css.width || $.blockUI.defaults.displayBoxCSS.width; + var h = $msg.height() || $msg.attr('height') || css.height || $.blockUI.defaults.displayBoxCSS.height ; + if (w[w.length-1] == '%') { + var ww = document.documentElement.clientWidth || document.body.clientWidth; + w = parseInt(w) || 100; + w = (w * ww) / 100; + } + if (h[h.length-1] == '%') { + var hh = document.documentElement.clientHeight || document.body.clientHeight; + h = parseInt(h) || 100; + h = (h * hh) / 100; + } + + var ml = '-' + parseInt(w)/2 + 'px'; + var mt = '-' + parseInt(h)/2 + 'px'; + + // supress opacity on overlay if displaying flash content on mac/ff platform + var ua = navigator.userAgent.toLowerCase(); + var opts = { + displayMode: fn || 1, + noalpha: isFlash && /mac/.test(ua) && /firefox/.test(ua) + }; + + $.blockUI.impl.install(window, msg, { width: w, height: h, marginTop: mt, marginLeft: ml }, opts); +}; + + +// override these in your code to change the default messages and styles +$.blockUI.defaults = { + // the message displayed when blocking the entire page + pageMessage: '<h1>Please wait...</h1>', + // the message displayed when blocking an element + elementMessage: '', // none + // styles for the overlay iframe + overlayCSS: { backgroundColor: '#fff', opacity: '0.5' }, + // styles for the message when blocking the entire page + pageMessageCSS: { width:'250px', margin:'-50px 0 0 -125px', top:'50%', left:'50%', textAlign:'center', color:'#000', backgroundColor:'#fff', border:'3px solid #aaa' }, + // styles for the message when blocking an element + elementMessageCSS: { width:'250px', padding:'10px', textAlign:'center', backgroundColor:'#fff'}, + // styles for the displayBox + displayBoxCSS: { width: '400px', height: '400px', top:'50%', left:'50%' }, + // allow body element to be stetched in ie6 + ie6Stretch: 1, + // supress tab nav from leaving blocking content? + allowTabToLeave: 0, + // Title attribute for overlay when using displayBox + closeMessage: 'Click to close', + // use fadeOut effect when unblocking (can be overridden on unblock call) + fadeOut: 1, + // fadeOut transition time in millis + fadeTime: 400 +}; + +// the gory details +$.blockUI.impl = { + box: null, + boxCallback: null, + pageBlock: null, + pageBlockEls: [], + op8: window.opera && window.opera.version() < 9, + ie6: $.browser.msie && /MSIE 6.0/.test(navigator.userAgent), + install: function(el, msg, css, opts) { + opts = opts || {}; + this.boxCallback = typeof opts.displayMode == 'function' ? opts.displayMode : null; + this.box = opts.displayMode ? msg : null; + var full = (el == window); + + // use logical settings for opacity support based on browser but allow overrides via opts arg + var noalpha = this.op8 || $.browser.mozilla && /Linux/.test(navigator.platform); + if (typeof opts.alphaOverride != 'undefined') + noalpha = opts.alphaOverride == 0 ? 1 : 0; + + if (full && this.pageBlock) this.remove(window, {fadeOut:0}); + // check to see if we were only passed the css object (a literal) + if (msg && typeof msg == 'object' && !msg.jquery && !msg.nodeType) { + css = msg; + msg = null; + } + msg = msg ? (msg.nodeType ? $(msg) : msg) : full ? $.blockUI.defaults.pageMessage : $.blockUI.defaults.elementMessage; + if (opts.displayMode) + var basecss = jQuery.extend({}, $.blockUI.defaults.displayBoxCSS); + else + var basecss = jQuery.extend({}, full ? $.blockUI.defaults.pageMessageCSS : $.blockUI.defaults.elementMessageCSS); + css = jQuery.extend(basecss, css || {}); + var f = ($.browser.msie) ? $('<iframe class="blockUI" style="z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>') + : $('<div class="blockUI" style="display:none"></div>'); + var w = $('<div class="blockUI" style="z-index:1001;cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'); + var m = full ? $('<div class="blockUI blockMsg" style="z-index:1002;cursor:wait;padding:0;position:fixed"></div>') + : $('<div class="blockUI" style="display:none;z-index:1002;cursor:wait;position:absolute"></div>'); + w.css('position', full ? 'fixed' : 'absolute'); + if (msg) m.css(css); + if (!noalpha) w.css($.blockUI.defaults.overlayCSS); + if (this.op8) w.css({ width:''+el.clientWidth,height:''+el.clientHeight }); // lame + if ($.browser.msie) f.css('opacity','0.0'); + + $([f[0],w[0],m[0]]).appendTo(full ? 'body' : el); + + // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) + var expr = $.browser.msie && (!$.boxModel || $('object,embed', full ? null : el).length > 0); + if (this.ie6 || expr) { + // stretch content area if it's short + if (full && $.blockUI.defaults.ie6Stretch && $.boxModel) + $('html,body').css('height','100%'); + + // fix ie6 problem when blocked element has a border width + if ((this.ie6 || !$.boxModel) && !full) { + var t = this.sz(el,'borderTopWidth'), l = this.sz(el,'borderLeftWidth'); + var fixT = t ? '(0 - '+t+')' : 0; + var fixL = l ? '(0 - '+l+')' : 0; + } + + // simulate fixed position + $.each([f,w,m], function(i,o) { + var s = o[0].style; + s.position = 'absolute'; + if (i < 2) { + full ? s.setExpression('height','document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"') + : s.setExpression('height','this.parentNode.offsetHeight + "px"'); + full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') + : s.setExpression('width','this.parentNode.offsetWidth + "px"'); + if (fixL) s.setExpression('left', fixL); + if (fixT) s.setExpression('top', fixT); + } + else { + if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); + s.marginTop = 0; + } + }); + } + if (opts.displayMode) { + w.css('cursor','default').attr('title', $.blockUI.defaults.closeMessage); + m.css('cursor','default'); + $([f[0],w[0],m[0]]).removeClass('blockUI').addClass('displayBox'); + $().click($.blockUI.impl.boxHandler).bind('keypress', $.blockUI.impl.boxHandler); + } + else + this.bind(1, el); + m.append(msg).show(); + if (msg.jquery) msg.show(); + if (opts.displayMode) return; + if (full) { + this.pageBlock = m[0]; + this.pageBlockEls = $(':input:enabled:visible',this.pageBlock); + setTimeout(this.focus, 20); + } + else this.center(m[0]); + }, + remove: function(el, opts) { + var o = $.extend({}, $.blockUI.defaults, opts); + this.bind(0, el); + var full = el == window; + var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el); + if (full) this.pageBlock = this.pageBlockEls = null; + + if (o.fadeOut) { + els.fadeOut(o.fadeTime, function() { + if (this.parentNode) this.parentNode.removeChild(this); + }); + } + else els.remove(); + }, + boxRemove: function(el) { + $().unbind('click',$.blockUI.impl.boxHandler).unbind('keypress', $.blockUI.impl.boxHandler); + if (this.boxCallback) + this.boxCallback(this.box); + $('body .displayBox').hide().remove(); + }, + // event handler to suppress keyboard/mouse events when blocking + handler: function(e) { + if (e.keyCode && e.keyCode == 9) { + if ($.blockUI.impl.pageBlock && !$.blockUI.defaults.allowTabToLeave) { + var els = $.blockUI.impl.pageBlockEls; + var fwd = !e.shiftKey && e.target == els[els.length-1]; + var back = e.shiftKey && e.target == els[0]; + if (fwd || back) { + setTimeout(function(){$.blockUI.impl.focus(back)},10); + return false; + } + } + } + if ($(e.target).parents('div.blockMsg').length > 0) + return true; + return $(e.target).parents().children().filter('div.blockUI').length == 0; + }, + boxHandler: function(e) { + if ((e.keyCode && e.keyCode == 27) || (e.type == 'click' && $(e.target).parents('div.blockMsg').length == 0)) + $.blockUI.impl.boxRemove(); + return true; + }, + // bind/unbind the handler + bind: function(b, el) { + var full = el == window; + // don't bother unbinding if there is nothing to unbind + if (!b && (full && !this.pageBlock || !full && !el.$blocked)) return; + if (!full) el.$blocked = b; + var $e = $(el).find('a,:input'); + $.each(['mousedown','mouseup','keydown','keypress','click'], function(i,o) { + $e[b?'bind':'unbind'](o, $.blockUI.impl.handler); + }); + }, + focus: function(back) { + if (!$.blockUI.impl.pageBlockEls) return; + var e = $.blockUI.impl.pageBlockEls[back===true ? $.blockUI.impl.pageBlockEls.length-1 : 0]; + if (e) e.focus(); + }, + center: function(el) { + var p = el.parentNode, s = el.style; + var l = ((p.offsetWidth - el.offsetWidth)/2) - this.sz(p,'borderLeftWidth'); + var t = ((p.offsetHeight - el.offsetHeight)/2) - this.sz(p,'borderTopWidth'); + s.left = l > 0 ? (l+'px') : '0'; + s.top = t > 0 ? (t+'px') : '0'; + }, + sz: function(el, p) { return parseInt($.css(el,p))||0; } +}; + +})(jQuery); diff --git a/ui/demos/real-world/photo-manager/theme/css/screen.css b/ui/demos/real-world/photo-manager/theme/css/screen.css index 71e38dcfb..3866beb8e 100644 --- a/ui/demos/real-world/photo-manager/theme/css/screen.css +++ b/ui/demos/real-world/photo-manager/theme/css/screen.css @@ -1,179 +1,179 @@ -body {
- padding: 0;
- margin: 0;
- line-height: 1.5em;
- font-size: 75%; /* gives us 12px in most browsers */
- font-family: "Helvetica Neue", "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
- background: #aefe05 url('../img/side_top.jpg') repeat-x top; /* body background from ui.jquery.com */
- color: 222;
-}
-
-/*
-================================
-=LAYOUT
-================================ */
-h1 {
- padding: 0 0 0 52px;
- margin: 0;
- font-size: 1.5em; /* 18px */
- line-height: 2em; /* 36px */
- background: url('../img/photos_gold_32.gif') no-repeat 8px 50%; /* Thanks to Iconbuffet.com */
- color: #fff;
-}
-#body_wrap {
- width: 960px;
- margin: 0 auto;
- background: #fff url('../img/body_wrap_bg.gif') repeat-y;
-}
-#content {
- float: left;
- width: 632px;
-}
-#sidebar {
- float: right;
- width: 320px;
-}
-#footer {
- clear: both;
- background: #32342f;
- color: #fff;
-}
-
-/*
-================================
-=SECTIONS
-================================ */
-/*
-----------------
-=HEADER
----------------- */
-/*
-----------------
-=CONTENT
----------------- */
-#content h2 {
- padding-left: 25px;
-}
-/*
-=gallery
--------- */
-.gallery {
- min-height: 108px;
- padding: 0;
- margin: 18px 0;
- list-style: none;
-}
-* html .gallery {
- height: 108px; /* min-height for lte IE6 */
-}
-.gallery.active {
- background: #eee;
-}
-.gallery li {
- float: left;
- width: 160px;
- padding: 0 25px;
- margin: 0 0 8px;
-}
-.gallery img {
- display: block;
- padding: 7px;
- border: 1px solid #ccc;
- background: #fff;
-}
-.displayBox img {
- border: 25px solid #222;
-}
-/* img title */
-.gallery p {
- float: left;
- padding: 0;
- margin: 0;
-}
-/* img toolbar */
-.gallery div {
- float: right;
-}
-.gallery div a {
- float: left;
- width: 24px;
- height: 24px;
- background-repeat: no-repeat;
- background-position: center;
- text-indent: -9999px; /* Phark revisited image replacement */
-}
-.gallery div a:focus {
- outline: 0;
-}
-.tb_supersize {
- background-image: url('../img/search_16.gif'); /* Thanks to Iconbuffet.com */
-}
-.tb_trash {
- background-image: url('../img/trash_16.gif'); /* Thanks to Iconbuffet.com */
-}
-
-/*
-----------------
-=SIDEBAR
----------------- */
-.box {
- margin: 18px;
- border: 1px solid #ccc;
- background: #fff;
-}
-.box h2 {
- padding: 0 8px;
- margin: 0;
- font-size: 1.5em;
- line-height: 2em;
- background: #525252 url('../img/header_bg.png') repeat-x bottom;
- color: #fff;
-}
-.box div {
- min-height: 128px;
- border: 2px solid #fff;
-}
-* html #sidebar .box div {
- height: 128px; /* min-height for lte IE6 */
-}
-#trash div.active {
- border-color: green;
-}
-#shred div.active {
- border-color: red;
-}
-#trash div img {
- float: left;
- margin: 4px;
-}
-
-/*
-----------------
-=FOOTER
----------------- */
-#footer p {
- margin: 0;
- text-align: right;
-}
-
-
-/*
-================================
-=FLOAT CLEARING
-================================ */
-#body_wrap, ul.gallery, #trash div {
- display: inline-block;
-}
-#body_wrap:after, ul.gallery:after, #trash div:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
-}
-* html #body_wrap, * html ul.gallery, * html #trash div {
- height: 1%;
-}
-#body_wrap, ul.gallery, #trash div {
- display: block;
-}
+body { + padding: 0; + margin: 0; + line-height: 1.5em; + font-size: 75%; /* gives us 12px in most browsers */ + font-family: "Helvetica Neue", "Lucida Grande", Helvetica, Arial, Verdana, sans-serif; + background: #aefe05 url('../img/side_top.jpg') repeat-x top; /* body background from ui.jquery.com */ + color: 222; +} + +/* +================================ +=LAYOUT +================================ */ +h1 { + padding: 0 0 0 52px; + margin: 0; + font-size: 1.5em; /* 18px */ + line-height: 2em; /* 36px */ + background: url('../img/photos_gold_32.gif') no-repeat 8px 50%; /* Thanks to Iconbuffet.com */ + color: #fff; +} +#body_wrap { + width: 960px; + margin: 0 auto; + background: #fff url('../img/body_wrap_bg.gif') repeat-y; +} +#content { + float: left; + width: 632px; +} +#sidebar { + float: right; + width: 320px; +} +#footer { + clear: both; + background: #32342f; + color: #fff; +} + +/* +================================ +=SECTIONS +================================ */ +/* +---------------- +=HEADER +---------------- */ +/* +---------------- +=CONTENT +---------------- */ +#content h2 { + padding-left: 25px; +} +/* +=gallery +-------- */ +.gallery { + min-height: 108px; + padding: 0; + margin: 18px 0; + list-style: none; +} +* html .gallery { + height: 108px; /* min-height for lte IE6 */ +} +.gallery.active { + background: #eee; +} +.gallery li { + float: left; + width: 160px; + padding: 0 25px; + margin: 0 0 8px; +} +.gallery img { + display: block; + padding: 7px; + border: 1px solid #ccc; + background: #fff; +} +.displayBox img { + border: 25px solid #222; +} +/* img title */ +.gallery p { + float: left; + padding: 0; + margin: 0; +} +/* img toolbar */ +.gallery div { + float: right; +} +.gallery div a { + float: left; + width: 24px; + height: 24px; + background-repeat: no-repeat; + background-position: center; + text-indent: -9999px; /* Phark revisited image replacement */ +} +.gallery div a:focus { + outline: 0; +} +.tb_supersize { + background-image: url('../img/search_16.gif'); /* Thanks to Iconbuffet.com */ +} +.tb_trash { + background-image: url('../img/trash_16.gif'); /* Thanks to Iconbuffet.com */ +} + +/* +---------------- +=SIDEBAR +---------------- */ +.box { + margin: 18px; + border: 1px solid #ccc; + background: #fff; +} +.box h2 { + padding: 0 8px; + margin: 0; + font-size: 1.5em; + line-height: 2em; + background: #525252 url('../img/header_bg.png') repeat-x bottom; + color: #fff; +} +.box div { + min-height: 128px; + border: 2px solid #fff; +} +* html #sidebar .box div { + height: 128px; /* min-height for lte IE6 */ +} +#trash div.active { + border-color: green; +} +#shred div.active { + border-color: red; +} +#trash div img { + float: left; + margin: 4px; +} + +/* +---------------- +=FOOTER +---------------- */ +#footer p { + margin: 0; + text-align: right; +} + + +/* +================================ +=FLOAT CLEARING +================================ */ +#body_wrap, ul.gallery, #trash div { + display: inline-block; +} +#body_wrap:after, ul.gallery:after, #trash div:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +* html #body_wrap, * html ul.gallery, * html #trash div { + height: 1%; +} +#body_wrap, ul.gallery, #trash div { + display: block; +} diff --git a/ui/demos/real-world/product-slider/index.html b/ui/demos/real-world/product-slider/index.html index a6f855adc..07cae0de7 100644 --- a/ui/demos/real-world/product-slider/index.html +++ b/ui/demos/real-world/product-slider/index.html @@ -1,185 +1,185 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>Slider Gallery</title>
- <style type="text/css" media="screen">
- <!--
- body {
- padding: 0;
- font: 1em "Trebuchet MS", verdana, arial, sans-serif;
- font-size: 100%;
- background-color: #212121;
- margin: 0;
- }
-
- h1 {
- margin-bottom: 2px;
- }
-
- #container {
- background-color: #fff;
- width: 580px;
- margin: 15px auto;
- padding: 50px;
- }
-
- /* slider specific CSS */
- .sliderGallery {
- background: url(images/productbrowser_background_20070622.jpg) no-repeat;
- overflow: hidden;
- position: relative;
- padding: 10px;
- height: 160px;
- width: 560px;
- }
-
- .sliderGallery UL {
- position: absolute;
- list-style: none;
- overflow: none;
- white-space: nowrap;
- padding: 0;
- margin: 0;
- }
-
- .sliderGallery UL LI {
- display: inline;
- }
-
- .slider {
- width: 542px;
- height: 17px;
- margin-top: 140px;
- margin-left: 5px;
- padding: 1px;
- position: relative;
- background: url(images/productbrowser_scrollbar_20070622.png) no-repeat;
- }
-
- .handle {
- position: absolute;
- cursor: move;
- height: 17px;
- width: 181px;
- top: 0;
- background: url(images/productbrowser_scroller_20080115.png) no-repeat;
- z-index: 100;
- }
-
- .slider span {
- color: #bbb;
- font-size: 80%;
- cursor: pointer;
- position: absolute;
- z-index: 110;
- top: 3px;
- }
-
- .slider .slider-lbl1 {
- left: 50px;
- }
-
- .slider .slider-lbl2 {
- left: 107px;
- }
-
- .slider .slider-lbl3 {
- left: 156px;
- }
-
- .slider .slider-lbl4 {
- left: 280px;
- }
-
- .slider .slider-lbl5 {
- left: 455px;
- }
- -->
- </style>
-
- <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../../source/ui.core.js"></script>
- <script type="text/javascript" src="../../../source/ui.slider.js"></script>
-
- <script type="text/javascript" charset="utf-8">
- /**
- * Note that we have to use window.onload because $(document).ready() fires before images are loaded
- * and ul.innerWidth() - container.outerWidth(); doesn't give the correct width because the width
- * of the UL hasn't expanded out until the images have finished rendering.
- */
- window.onload = function () {
- var container = $('div.sliderGallery');
- var ul = $('ul', container);
-
- var itemsWidth = ul.innerWidth() - container.outerWidth();
-
- $('.slider', container).slider({
- min: 0,
- max: itemsWidth,
- handle: '.handle',
- stop: function (event, ui) {
- ul.animate({'left' : ui.value * -1}, 500);
- },
- slide: function (event, ui) {
- ul.css('left', ui.value * -1);
- }
- });
- };
- </script>
-</head>
-<body>
- <div id="container">
- <h1>Slider Gallery</h1>
- <p>This shows a demonstration of a slider widget from the jQuery UI library used to create the same effect used on <a href="http://www.apple.com/mac/">Apple's web site</a>.</p>
- <p><a href="http://jqueryfordesigners.com/slider-gallery">Read the article, and see the screencast this demonstration relates to</a></p>
-
- <div class="sliderGallery">
- <ul>
- <li><img class="pb-airportexpress" src="images/pb_airport_express.jpg" /></li>
- <li><img src="images/pb_airport_extreme.jpg" /></li>
- <li><img src="images/pb_timecapsule_20080115.jpg" /></li>
- <li><img src="images/pb_keyboards20070807.jpg" /></li>
- <li><img src="images/pb_mighty_mouse.jpg" /></li>
- <li><img src="images/pb_cinema_display20071026.jpg" /></li>
- <li><img src="images/pb_mac_pro_20070622.jpg" /></li>
-
- <li><img class="pb-macmini" src="images/pb_mac_mini.jpg" /></li>
- <li><img src="images/pb_macbook20071026.jpg" /></li>
- <li><img class="pb-macbookair" src="images/pb_macbookair_20080115.jpg" /></li>
- <li><img class="pb-macbookpro" src="images/pb_macbook_pro20071026.jpg" /></li>
- <li><img class="pb-imac" src="images/pb_imac20071026.jpg" /></li>
- <li><img src="images/pb_macosx_20080115.jpg" /></li>
- <li><img src="images/pb_ilife_20080115.jpg" /></li>
- <li><img src="images/pb_dot_mac_20080115.jpg" /></li>
- <li><img src="images/pb_iwork_20080115.jpg" /></li>
-
- <li><img src="images/pb_quicktime.jpg" /></li>
- <li><img src="images/pb_aperture20080212.jpg" /></li>
- <li><img src="images/pb_final_cut_studio2_20080115.jpg" /></li>
- <li><img src="images/pb_final_cut_express_20080115.jpg" /></li>
- <li><img src="images/pb_logic_studio_20080115.jpg" /></li>
- <li><img src="images/pb_logic_express_20080115.jpg" /></li>
- <li><img src="images/pb_shake_20080115.jpg" /></li>
- <li><img src="images/pb_apple_remote_desktop_20080115.jpg" /></li>
- <li><img src="images/pb_xserve.jpg" /></li>
-
- <li><img src="images/pb_xserve_raid.jpg" /></li>
- <li><img class="pb-xsan" src="images/pb_xsan_20080115.jpg" /></li>
- <li><img class="pb-macosxserver" src="images/pb_macosx_server20071016.jpg" /></li>
- </ul>
- <div class="slider">
- <div class="handle"></div>
- <span class="slider-lbl1">Wi-Fi</span>
- <span class="slider-lbl3">Macs</span>
- <span class="slider-lbl4">Applications</span>
- <span class="slider-lbl5">Servers</span>
- </div>
- </div>
- </div>
-</body>
-</html>
-
-
-
-
+<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title>Slider Gallery</title> + <style type="text/css" media="screen"> + <!-- + body { + padding: 0; + font: 1em "Trebuchet MS", verdana, arial, sans-serif; + font-size: 100%; + background-color: #212121; + margin: 0; + } + + h1 { + margin-bottom: 2px; + } + + #container { + background-color: #fff; + width: 580px; + margin: 15px auto; + padding: 50px; + } + + /* slider specific CSS */ + .sliderGallery { + background: url(images/productbrowser_background_20070622.jpg) no-repeat; + overflow: hidden; + position: relative; + padding: 10px; + height: 160px; + width: 560px; + } + + .sliderGallery UL { + position: absolute; + list-style: none; + overflow: none; + white-space: nowrap; + padding: 0; + margin: 0; + } + + .sliderGallery UL LI { + display: inline; + } + + .slider { + width: 542px; + height: 17px; + margin-top: 140px; + margin-left: 5px; + padding: 1px; + position: relative; + background: url(images/productbrowser_scrollbar_20070622.png) no-repeat; + } + + .handle { + position: absolute; + cursor: move; + height: 17px; + width: 181px; + top: 0; + background: url(images/productbrowser_scroller_20080115.png) no-repeat; + z-index: 100; + } + + .slider span { + color: #bbb; + font-size: 80%; + cursor: pointer; + position: absolute; + z-index: 110; + top: 3px; + } + + .slider .slider-lbl1 { + left: 50px; + } + + .slider .slider-lbl2 { + left: 107px; + } + + .slider .slider-lbl3 { + left: 156px; + } + + .slider .slider-lbl4 { + left: 280px; + } + + .slider .slider-lbl5 { + left: 455px; + } + --> + </style> + + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../../source/ui.core.js"></script> + <script type="text/javascript" src="../../../source/ui.slider.js"></script> + + <script type="text/javascript" charset="utf-8"> + /** + * Note that we have to use window.onload because $(document).ready() fires before images are loaded + * and ul.innerWidth() - container.outerWidth(); doesn't give the correct width because the width + * of the UL hasn't expanded out until the images have finished rendering. + */ + window.onload = function () { + var container = $('div.sliderGallery'); + var ul = $('ul', container); + + var itemsWidth = ul.innerWidth() - container.outerWidth(); + + $('.slider', container).slider({ + min: 0, + max: itemsWidth, + handle: '.handle', + stop: function (event, ui) { + ul.animate({'left' : ui.value * -1}, 500); + }, + slide: function (event, ui) { + ul.css('left', ui.value * -1); + } + }); + }; + </script> +</head> +<body> + <div id="container"> + <h1>Slider Gallery</h1> + <p>This shows a demonstration of a slider widget from the jQuery UI library used to create the same effect used on <a href="http://www.apple.com/mac/">Apple's web site</a>.</p> + <p><a href="http://jqueryfordesigners.com/slider-gallery">Read the article, and see the screencast this demonstration relates to</a></p> + + <div class="sliderGallery"> + <ul> + <li><img class="pb-airportexpress" src="images/pb_airport_express.jpg" /></li> + <li><img src="images/pb_airport_extreme.jpg" /></li> + <li><img src="images/pb_timecapsule_20080115.jpg" /></li> + <li><img src="images/pb_keyboards20070807.jpg" /></li> + <li><img src="images/pb_mighty_mouse.jpg" /></li> + <li><img src="images/pb_cinema_display20071026.jpg" /></li> + <li><img src="images/pb_mac_pro_20070622.jpg" /></li> + + <li><img class="pb-macmini" src="images/pb_mac_mini.jpg" /></li> + <li><img src="images/pb_macbook20071026.jpg" /></li> + <li><img class="pb-macbookair" src="images/pb_macbookair_20080115.jpg" /></li> + <li><img class="pb-macbookpro" src="images/pb_macbook_pro20071026.jpg" /></li> + <li><img class="pb-imac" src="images/pb_imac20071026.jpg" /></li> + <li><img src="images/pb_macosx_20080115.jpg" /></li> + <li><img src="images/pb_ilife_20080115.jpg" /></li> + <li><img src="images/pb_dot_mac_20080115.jpg" /></li> + <li><img src="images/pb_iwork_20080115.jpg" /></li> + + <li><img src="images/pb_quicktime.jpg" /></li> + <li><img src="images/pb_aperture20080212.jpg" /></li> + <li><img src="images/pb_final_cut_studio2_20080115.jpg" /></li> + <li><img src="images/pb_final_cut_express_20080115.jpg" /></li> + <li><img src="images/pb_logic_studio_20080115.jpg" /></li> + <li><img src="images/pb_logic_express_20080115.jpg" /></li> + <li><img src="images/pb_shake_20080115.jpg" /></li> + <li><img src="images/pb_apple_remote_desktop_20080115.jpg" /></li> + <li><img src="images/pb_xserve.jpg" /></li> + + <li><img src="images/pb_xserve_raid.jpg" /></li> + <li><img class="pb-xsan" src="images/pb_xsan_20080115.jpg" /></li> + <li><img class="pb-macosxserver" src="images/pb_macosx_server20071016.jpg" /></li> + </ul> + <div class="slider"> + <div class="handle"></div> + <span class="slider-lbl1">Wi-Fi</span> + <span class="slider-lbl3">Macs</span> + <span class="slider-lbl4">Applications</span> + <span class="slider-lbl5">Servers</span> + </div> + </div> + </div> +</body> +</html> + + + + diff --git a/ui/demos/real-world/splitpane/css/demo.css b/ui/demos/real-world/splitpane/css/demo.css index 72ed40afc..d30c33149 100644 --- a/ui/demos/real-world/splitpane/css/demo.css +++ b/ui/demos/real-world/splitpane/css/demo.css @@ -1,149 +1,149 @@ -/* --------------------------------------------------------------
-
- jQuery UI: Demo Viewer
-
--------------------------------------------------------------- */
-
-
-/*************************************/
-/* Blueprint: reset.css */
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, font, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-dl, dt, dd, ol,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- font-weight: inherit;
- font-style: inherit;
- font-size: 100%;
- font-family: inherit;
- vertical-align: baseline;
-}
-
-label {
- margin-right: 5px;
-}
-
-/* Remember to define focus styles! */
-:focus {
- outline: 0;
-}
-body {
- line-height: 1;
- color: black;
- background: white;
- font-family: Arial,Sans-serif; font-size: 0.9em;
- background-color: white;
- overflow: hidden;
-}
-ol, ul {
- list-style: none;
-}
-
-/* Tables still need 'cellspacing="0"' in the markup. */
-table {
- border-collapse: separate;
- border-spacing: 0;
-}
-caption, th, td {
- text-align: left;
- font-weight: normal;
-}
-
-/* Remove possible quote marks (") from <q>, <blockquote>. */
-blockquote:before, blockquote:after,
-q:before, q:after {
- content: "";
-}
-blockquote, q {
- quotes: "" "";
-}
-
-/*************************************/
-/* Viewer: Layout */
-
-#wrapper {
- background: #e1e7f2 url(../images/bg_gradient.gif) repeat-x;
- }
- #header {
- padding: 10px;
- background: #67A7E3; color: #fff;
- position: relative;
- }
- #container {
- height: 500px;
- }
- #container td {
- overflow: hidden;
- }
- #container td div {
- overflow: hidden;
- padding: 0 15px 0 10px;
- background: #fff;
- height:475px;
- font-size: 90%;
- }
- #container .ui-split-side-box {
- width: 200px;
- }
- #container .ui-split-side {
- overflow: hidden;
- }
- #container .ui-split-side ul {
- margin: 0; padding: 0; padding-top: 3px;
- }
- #container .ui-split-side li {
- margin: 0; padding: 0; border: 0; outline: 0;
- list-style: none;
- }
- #container .ui-split-side li a {
- height: 15px;
- display:block;
- padding: 3px 3px 3px 12px;
- border-bottom: 1px solid #E8EEF7;
- color: #000;
- font-size: 90%;
- text-decoration: none;
- }
- #container .ui-split-side li a:hover {
- background: #E8EEF7;
- border-color: #C3D9FF;
- }
- #container .ui-split-main-box {
-
- }
-
- #container .ui-resizable-e {
- width: 10px; height: 475px;
- background:#e1e7f2 url(../images/splitpane_handle-ew.gif) no-repeat scroll 75% 50% !important;
- cursor:col-resize !important;
- border-left: #bbb 1px solid;
- padding: 3px;
- }
- #container .ui-resizable-n {
- height: 10px;
- background:#e1e7f2 url(../images/splitpane_handle-sn.gif) no-repeat scroll 50% 55% !important;
- border-top: #bbb 1px solid;
- padding: 3px;
- }
-
-
-
- .ui-toolbar-item-hide-icon {
- padding-left: 16px; height: 16px;
- background-image: url(../images/icons_2.png);
- background-repeat: no-repeat; margin: 0 2px;
- display: inline-block;
- }
-
- .ui-toolbar-item-hide-icon { background-position: -64px 50%; }
-
- .proxy { border: 1px dashed #000; };
-
+/* -------------------------------------------------------------- + + jQuery UI: Demo Viewer + +-------------------------------------------------------------- */ + + +/*************************************/ +/* Blueprint: reset.css */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +label { + margin-right: 5px; +} + +/* Remember to define focus styles! */ +:focus { + outline: 0; +} +body { + line-height: 1; + color: black; + background: white; + font-family: Arial,Sans-serif; font-size: 0.9em; + background-color: white; + overflow: hidden; +} +ol, ul { + list-style: none; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { + border-collapse: separate; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; +} + +/* Remove possible quote marks (") from <q>, <blockquote>. */ +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +blockquote, q { + quotes: "" ""; +} + +/*************************************/ +/* Viewer: Layout */ + +#wrapper { + background: #e1e7f2 url(../images/bg_gradient.gif) repeat-x; + } + #header { + padding: 10px; + background: #67A7E3; color: #fff; + position: relative; + } + #container { + height: 500px; + } + #container td { + overflow: hidden; + } + #container td div { + overflow: hidden; + padding: 0 15px 0 10px; + background: #fff; + height:475px; + font-size: 90%; + } + #container .ui-split-side-box { + width: 200px; + } + #container .ui-split-side { + overflow: hidden; + } + #container .ui-split-side ul { + margin: 0; padding: 0; padding-top: 3px; + } + #container .ui-split-side li { + margin: 0; padding: 0; border: 0; outline: 0; + list-style: none; + } + #container .ui-split-side li a { + height: 15px; + display:block; + padding: 3px 3px 3px 12px; + border-bottom: 1px solid #E8EEF7; + color: #000; + font-size: 90%; + text-decoration: none; + } + #container .ui-split-side li a:hover { + background: #E8EEF7; + border-color: #C3D9FF; + } + #container .ui-split-main-box { + + } + + #container .ui-resizable-e { + width: 10px; height: 475px; + background:#e1e7f2 url(../images/splitpane_handle-ew.gif) no-repeat scroll 75% 50% !important; + cursor:col-resize !important; + border-left: #bbb 1px solid; + padding: 3px; + } + #container .ui-resizable-n { + height: 10px; + background:#e1e7f2 url(../images/splitpane_handle-sn.gif) no-repeat scroll 50% 55% !important; + border-top: #bbb 1px solid; + padding: 3px; + } + + + + .ui-toolbar-item-hide-icon { + padding-left: 16px; height: 16px; + background-image: url(../images/icons_2.png); + background-repeat: no-repeat; margin: 0 2px; + display: inline-block; + } + + .ui-toolbar-item-hide-icon { background-position: -64px 50%; } + + .proxy { border: 1px dashed #000; }; + diff --git a/ui/demos/real-world/splitpane/index.html b/ui/demos/real-world/splitpane/index.html index d2f9e109e..2800b206f 100644 --- a/ui/demos/real-world/splitpane/index.html +++ b/ui/demos/real-world/splitpane/index.html @@ -1,96 +1,96 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="Content-Language" content="en" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>jQuery UI: SplitPane</title>
-
- <!-- jQuery -->
- <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script>
-
- <!-- jQuery UI -->
- <script type="text/javascript" src="../../../source/ui.core.js"></script>
- <script type="text/javascript" src="../../../source/ui.resizable.js"></script>
-
- <script src="js/demo.js" type="text/javascript" charset="utf-8"></script>
-
- <style type="text/css">
- @import "css/demo.css";
- </style>
-
-</head>
-<body>
-
-<div id="wrapper">
- <div id="header">
- <span class="ui-toolbar-item-hide-icon"></span> <span>jQuery UI Resizable SplitPanel</span>
- </div>
- <table id="container" cellpadding="0" cellspacing="0" border="0">
-
- <tr>
-
- <td class="ui-split-side-box">
- <div class="ui-split-side">
- <ul id="component-links">
- <li><a href="#ui.accordion" title="Goto Accordion's Component Page">Accordion</a></li>
- <li><a href="#ui.dialog" title="Goto Dialog's Component Page">Dialog</a></li>
- <li><a href="#ui.draggable" title="Goto Draggable's Component Page">Draggable</a></li>
- <li><a href="#ui.droppable" title="Goto Droppable's Component Page">Droppable</a></li>
- <li><a href="#ui.resizable" title="Goto Resizable's Component Page">Resizable</a></li>
- <li><a href="#ui.selectable" title="Goto Selectable's Component Page">Selectable</a></li>
- <li><a href="#ui.sortable" title="Goto Sortable's Component Page">Sortable</a></li>
- <li><a href="#ui.tabs" title="Goto Tabs Component Page">Tabs</a></li>
- </ul>
- </div>
- </td>
-
-
- <td class="ui-split-main-box">
- <div class="ui-split-main1">
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien.
- <br><br>
- Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus.
-
- </div>
- </td>
-
- <td class="ui-split-main-box">
- <div class="ui-split-main2">
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien.
- <br><br>
- Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus.
- </div>
- </td>
-
- <td class="ui-split-main-box">
- <div class="ui-split-main3">
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien.
- <br><br>
- Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus.
- </div>
- </td>
-
- </tr>
-
- </table>
-</div>
-<script type="text/javascript">
- $(function() {
-
- $('div.ui-split-main1, div.ui-split-main2').resizable({
- handles: 'e',
- minWidth: 200,
- maxWidth: 800
- });
-
- $('div.ui-split-side').resizable({
- handles: 'e',
- proxy: 'proxy',
- minWidth: 200,
- maxWidth: 300
- });
-
- });
-</script>
-</body>
-</html>
+<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-Language" content="en" /> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>jQuery UI: SplitPane</title> + + <!-- jQuery --> + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + + <!-- jQuery UI --> + <script type="text/javascript" src="../../../source/ui.core.js"></script> + <script type="text/javascript" src="../../../source/ui.resizable.js"></script> + + <script src="js/demo.js" type="text/javascript" charset="utf-8"></script> + + <style type="text/css"> + @import "css/demo.css"; + </style> + +</head> +<body> + +<div id="wrapper"> + <div id="header"> + <span class="ui-toolbar-item-hide-icon"></span> <span>jQuery UI Resizable SplitPanel</span> + </div> + <table id="container" cellpadding="0" cellspacing="0" border="0"> + + <tr> + + <td class="ui-split-side-box"> + <div class="ui-split-side"> + <ul id="component-links"> + <li><a href="#ui.accordion" title="Goto Accordion's Component Page">Accordion</a></li> + <li><a href="#ui.dialog" title="Goto Dialog's Component Page">Dialog</a></li> + <li><a href="#ui.draggable" title="Goto Draggable's Component Page">Draggable</a></li> + <li><a href="#ui.droppable" title="Goto Droppable's Component Page">Droppable</a></li> + <li><a href="#ui.resizable" title="Goto Resizable's Component Page">Resizable</a></li> + <li><a href="#ui.selectable" title="Goto Selectable's Component Page">Selectable</a></li> + <li><a href="#ui.sortable" title="Goto Sortable's Component Page">Sortable</a></li> + <li><a href="#ui.tabs" title="Goto Tabs Component Page">Tabs</a></li> + </ul> + </div> + </td> + + + <td class="ui-split-main-box"> + <div class="ui-split-main1"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien. + <br><br> + Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus. + + </div> + </td> + + <td class="ui-split-main-box"> + <div class="ui-split-main2"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien. + <br><br> + Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus. + </div> + </td> + + <td class="ui-split-main-box"> + <div class="ui-split-main3"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien. + <br><br> + Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus. + </div> + </td> + + </tr> + + </table> +</div> +<script type="text/javascript"> + $(function() { + + $('div.ui-split-main1, div.ui-split-main2').resizable({ + handles: 'e', + minWidth: 200, + maxWidth: 800 + }); + + $('div.ui-split-side').resizable({ + handles: 'e', + proxy: 'proxy', + minWidth: 200, + maxWidth: 300 + }); + + }); +</script> +</body> +</html> diff --git a/ui/source/effects.clip.js b/ui/source/effects.clip.js index 99951b7ca..41ba05dc5 100644 --- a/ui/source/effects.clip.js +++ b/ui/source/effects.clip.js @@ -1,41 +1,41 @@ -;(function($) {
-
- $.effects.clip = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left','width','height'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'vertical'; // Default direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var ref = {
- size: (direction == 'vertical') ? 'height' : 'width',
- position: (direction == 'vertical') ? 'top' : 'left'
- };
- var distance = (direction == 'vertical') ? el.height() : el.width();
- if(mode == 'show') { el.css(ref.size, 0); el.css(ref.position, distance / 2); } // Shift
-
- // Animation
- var animation = {};
- animation[ref.size] = mode == 'show' ? distance : 0;
- animation[ref.position] = mode == 'show' ? 0 : distance / 2;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
- };
-
-})(jQuery);
+;(function($) { + + $.effects.clip = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left','width','height']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'vertical'; // Default direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = { + size: (direction == 'vertical') ? 'height' : 'width', + position: (direction == 'vertical') ? 'top' : 'left' + }; + var distance = (direction == 'vertical') ? el.height() : el.width(); + if(mode == 'show') { el.css(ref.size, 0); el.css(ref.position, distance / 2); } // Shift + + // Animation + var animation = {}; + animation[ref.size] = mode == 'show' ? distance : 0; + animation[ref.position] = mode == 'show' ? 0 : distance / 2; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + + }; + +})(jQuery); diff --git a/ui/source/effects.drop.js b/ui/source/effects.drop.js index 3e55bdd8c..b81216aec 100644 --- a/ui/source/effects.drop.js +++ b/ui/source/effects.drop.js @@ -1,38 +1,38 @@ -;(function($) {
-
- $.effects.drop = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left','opacity'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'left'; // Default Direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
- if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
-
- // Animation
- var animation = {opacity: mode == 'show' ? 1 : 0};
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
- };
-
-})(jQuery);
+;(function($) { + + $.effects.drop = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left','opacity']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + + // Animation + var animation = {opacity: mode == 'show' ? 1 : 0}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + + }; + +})(jQuery); diff --git a/ui/source/effects.explode.js b/ui/source/effects.explode.js index 78d37e7ff..429f48823 100644 --- a/ui/source/effects.explode.js +++ b/ui/source/effects.explode.js @@ -1,67 +1,67 @@ -;(function($) {
-
- $.effects.explode = function(o) {
-
- return this.queue(function() {
-
- var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
- var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
-
- o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
- var el = $(this).show().css('visibility', 'hidden');
- var offset = el.offset();
-
- //Substract the margins - not fixing the problem yet.
- offset.top -= parseInt(el.css("marginTop")) || 0;
- offset.left -= parseInt(el.css("marginLeft")) || 0;
-
- var width = el.outerWidth(true);
- var height = el.outerHeight(true);
-
- for(var i=0;i<rows;i++) { // =
- for(var j=0;j<cells;j++) { // ||
- el
- .clone()
- .appendTo('body')
- .wrap('<div></div>')
- .css({
- position: 'absolute',
- visibility: 'visible',
- left: -j*(width/cells),
- top: -i*(height/rows)
- })
- .parent()
- .addClass('ec-explode')
- .css({
- position: 'absolute',
- overflow: 'hidden',
- width: width/cells,
- height: height/rows,
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
- opacity: o.options.mode == 'show' ? 0 : 1
- }).animate({
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
- opacity: o.options.mode == 'show' ? 1 : 0
- }, o.duration || 500);
- }
- }
-
- // Set a timeout, to call the callback approx. when the other animations have finished
- setTimeout(function() {
-
- o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
- if(o.callback) o.callback.apply(el[0]); // Callback
- el.dequeue();
-
- $('.ec-explode').remove();
-
- }, o.duration || 500);
-
-
- });
-
- };
-
+;(function($) { + + $.effects.explode = function(o) { + + return this.queue(function() { + + var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3; + + o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode; + var el = $(this).show().css('visibility', 'hidden'); + var offset = el.offset(); + + //Substract the margins - not fixing the problem yet. + offset.top -= parseInt(el.css("marginTop")) || 0; + offset.left -= parseInt(el.css("marginLeft")) || 0; + + var width = el.outerWidth(true); + var height = el.outerHeight(true); + + for(var i=0;i<rows;i++) { // = + for(var j=0;j<cells;j++) { // || + el + .clone() + .appendTo('body') + .wrap('<div></div>') + .css({ + position: 'absolute', + visibility: 'visible', + left: -j*(width/cells), + top: -i*(height/rows) + }) + .parent() + .addClass('ec-explode') + .css({ + position: 'absolute', + overflow: 'hidden', + width: width/cells, + height: height/rows, + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0), + opacity: o.options.mode == 'show' ? 0 : 1 + }).animate({ + left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)), + top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)), + opacity: o.options.mode == 'show' ? 1 : 0 + }, o.duration || 500); + } + } + + // Set a timeout, to call the callback approx. when the other animations have finished + setTimeout(function() { + + o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide(); + if(o.callback) o.callback.apply(el[0]); // Callback + el.dequeue(); + + $('.ec-explode').remove(); + + }, o.duration || 500); + + + }); + + }; + })(jQuery);
\ No newline at end of file diff --git a/ui/source/effects.highlight.js b/ui/source/effects.highlight.js index 404b1b7fd..464780166 100644 --- a/ui/source/effects.highlight.js +++ b/ui/source/effects.highlight.js @@ -1,36 +1,36 @@ -;(function($) {
-
- $.effects.highlight = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['backgroundImage','backgroundColor','opacity'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var color = o.options.color || "#ffff99"; // Default highlight color
- var oldColor = el.css("backgroundColor");
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- el.css({backgroundImage: 'none', backgroundColor: color}); // Shift
-
- // Animation
- var animation = {backgroundColor: oldColor };
- if (mode == "hide") animation['opacity'] = 0;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == "hide") el.hide();
- $.effects.restore(el, props);
- if (mode == "show" && jQuery.browser.msie) this.style.removeAttribute('filter');
- if(o.callback) o.callback.apply(this, arguments);
- el.dequeue();
- }});
-
- });
-
- };
-
+;(function($) { + + $.effects.highlight = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['backgroundImage','backgroundColor','opacity']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var color = o.options.color || "#ffff99"; // Default highlight color + var oldColor = el.css("backgroundColor"); + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + el.css({backgroundImage: 'none', backgroundColor: color}); // Shift + + // Animation + var animation = {backgroundColor: oldColor }; + if (mode == "hide") animation['opacity'] = 0; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == "hide") el.hide(); + $.effects.restore(el, props); + if (mode == "show" && jQuery.browser.msie) this.style.removeAttribute('filter'); + if(o.callback) o.callback.apply(this, arguments); + el.dequeue(); + }}); + + }); + + }; + })(jQuery);
\ No newline at end of file diff --git a/ui/source/effects.pulsate.js b/ui/source/effects.pulsate.js index aee1525ff..3e964c175 100644 --- a/ui/source/effects.pulsate.js +++ b/ui/source/effects.pulsate.js @@ -1,43 +1,43 @@ -;(function($) {
-
- $.effects.pulsate = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var times = o.options.times || 5; // Default # of times
-
- // Adjust
- if (mode != 'hide') times--;
- if (el.is(':hidden')) { // Show fadeIn
- el.css('opacity', 0);
- el.show(); // Show
- el.animate({opacity: 1}, o.duration / 2, o.options.easing);
- times--;
- }
-
- // Animate
- for (var i = 0; i < times; i++) { // Pulsate
- el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing);
- };
- if (mode == 'hide') { // Last Pulse
- el.animate({opacity: 0}, o.duration / 2, o.options.easing, function(){
- el.hide(); // Hide
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- } else {
- el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing, function(){
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- };
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
- };
-
+;(function($) { + + $.effects.pulsate = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var times = o.options.times || 5; // Default # of times + + // Adjust + if (mode != 'hide') times--; + if (el.is(':hidden')) { // Show fadeIn + el.css('opacity', 0); + el.show(); // Show + el.animate({opacity: 1}, o.duration / 2, o.options.easing); + times--; + } + + // Animate + for (var i = 0; i < times; i++) { // Pulsate + el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing); + }; + if (mode == 'hide') { // Last Pulse + el.animate({opacity: 0}, o.duration / 2, o.options.easing, function(){ + el.hide(); // Hide + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + } else { + el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing, function(){ + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + }; + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + + }; + })(jQuery);
\ No newline at end of file diff --git a/ui/source/effects.shake.js b/ui/source/effects.shake.js index ae7635ac3..2133911ce 100644 --- a/ui/source/effects.shake.js +++ b/ui/source/effects.shake.js @@ -1,45 +1,45 @@ -;(function($) {
-
- $.effects.shake = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var direction = o.options.direction || 'left'; // Default direction
- var distance = o.options.distance || 20; // Default distance
- var times = o.options.times || 3; // Default # of times
- var speed = o.duration || o.options.duration || 140; // Default speed per shake
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
-
- // Animation
- var animation = {}, animation1 = {}, animation2 = {};
- animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2;
- animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2;
-
- // Animate
- el.animate(animation, speed, o.options.easing);
- for (var i = 1; i < times; i++) { // Shakes
- el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
- };
- el.animate(animation1, speed, o.options.easing).
- animate(animation, speed / 2, o.options.easing, function(){ // Last shake
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
- };
-
-})(jQuery);
+;(function($) { + + $.effects.shake = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'left'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 3; // Default # of times + var speed = o.duration || o.options.duration || 140; // Default speed per shake + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + + // Animation + var animation = {}, animation1 = {}, animation2 = {}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2; + animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2; + + // Animate + el.animate(animation, speed, o.options.easing); + for (var i = 1; i < times; i++) { // Shakes + el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing); + }; + el.animate(animation1, speed, o.options.easing). + animate(animation, speed / 2, o.options.easing, function(){ // Last shake + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + el.queue('fx', function() { el.dequeue(); }); + el.dequeue(); + }); + + }; + +})(jQuery); diff --git a/ui/source/effects.slide.js b/ui/source/effects.slide.js index 80e3f5a8b..5437666f3 100644 --- a/ui/source/effects.slide.js +++ b/ui/source/effects.slide.js @@ -1,38 +1,38 @@ -;(function($) {
-
- $.effects.slide = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','left'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var direction = o.options.direction || 'left'; // Default Direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
- if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift
-
- // Animation
- var animation = {};
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
- };
-
+;(function($) { + + $.effects.slide = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','left']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode + var direction = o.options.direction || 'left'; // Default Direction + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; + var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; + var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); + if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift + + // Animation + var animation = {}; + animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance; + + // Animate + el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + + }; + })(jQuery);
\ No newline at end of file diff --git a/ui/source/effects.transfer.js b/ui/source/effects.transfer.js index c2a26128a..87c731508 100644 --- a/ui/source/effects.transfer.js +++ b/ui/source/effects.transfer.js @@ -1,46 +1,46 @@ -;(function($) {
-
- $.effects.transfer = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var target = $(o.options.to); // Find Target
- var position = el.offset();
- var transfer = $('<div class="ui-effects-transfer"></div>').appendTo(document.body);
-
- // Set target css
- transfer.addClass(o.options.className);
- transfer.css({
- top: position.top,
- left: position.left,
- height: el.outerHeight(true) - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')),
- width: el.outerWidth(true) - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')),
- position: 'absolute'
- });
-
- // Animation
- position = target.offset();
- animation = {
- top: position.top,
- left: position.top,
- height: target.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')),
- width: target.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth'))
- };
-
- // Animate
- transfer.animate(animation, o.duration, o.options.easing, function() {
- transfer.remove(); // Remove div
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
- };
-
-})(jQuery);
+;(function($) { + + $.effects.transfer = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var target = $(o.options.to); // Find Target + var position = el.offset(); + var transfer = $('<div class="ui-effects-transfer"></div>').appendTo(document.body); + + // Set target css + transfer.addClass(o.options.className); + transfer.css({ + top: position.top, + left: position.left, + height: el.outerHeight(true) - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')), + width: el.outerWidth(true) - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')), + position: 'absolute' + }); + + // Animation + position = target.offset(); + animation = { + top: position.top, + left: position.top, + height: target.outerHeight() - parseInt(transfer.css('borderTopWidth')) - parseInt(transfer.css('borderBottomWidth')), + width: target.outerWidth() - parseInt(transfer.css('borderLeftWidth')) - parseInt(transfer.css('borderRightWidth')) + }; + + // Animate + transfer.animate(animation, o.duration, o.options.easing, function() { + transfer.remove(); // Remove div + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + + }; + +})(jQuery); diff --git a/ui/source/i18n/ui.datepicker-am.js b/ui/source/i18n/ui.datepicker-am.js index f9cf64d70..32ba8c27a 100644 --- a/ui/source/i18n/ui.datepicker-am.js +++ b/ui/source/i18n/ui.datepicker-am.js @@ -1,22 +1,22 @@ -/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
-/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/
-jQuery(function($){
- $.datepicker.regional['am'] = {clearText: 'Õ„Õ¡Ö„Ö€Õ¥Õ¬', clearStatus: '',
- closeText: 'Õ“Õ¡Õ¯Õ¥Õ¬', closeStatus: '',
- prevText: '<Õ†Õ¡Õ.', prevStatus: '',
- nextText: 'Õ€Õ¡Õ».>', nextStatus: '',
- currentText: 'Ô±ÕµÕ½Ö…Ö€', currentStatus: '',
- monthNames: ['Õ€Õ¸Ö‚Õ¶Õ¾Õ¡Ö€','Õ“Õ¥Õ¿Ö€Õ¾Õ¡Ö€','Õ„Õ¡Ö€Õ¿','Ô±ÕºÖ€Õ«Õ¬','Õ„Õ¡ÕµÕ«Õ½','Õ€Õ¸Ö‚Õ¶Õ«Õ½',
- 'Õ€Õ¸Ö‚Õ¬Õ«Õ½','Õ•Õ£Õ¸Õ½Õ¿Õ¸Õ½','ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö€','Õ€Õ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€','Õ†Õ¸ÕµÕ¥Õ´Õ¢Õ¥Ö€','Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€'],
- monthNamesShort: ['Õ€Õ¸Ö‚Õ¶Õ¾','Õ“Õ¥Õ¿Ö€','Õ„Õ¡Ö€Õ¿','Ô±ÕºÖ€','Õ„Õ¡ÕµÕ«Õ½','Õ€Õ¸Ö‚Õ¶Õ«Õ½',
- 'Õ€Õ¸Ö‚Õ¬','Õ•Õ£Õ½','ÕÕ¥Õº','Õ€Õ¸Õ¯','Õ†Õ¸Õµ','Ô´Õ¥Õ¯'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Õ‡Ô²Õ', weekStatus: '',
- dayNames: ['Õ¯Õ«Ö€Õ¡Õ¯Õ«','Õ¥Õ¯Õ¸Ö‚Õ·Õ¡Õ¢Õ©Õ«','Õ¥Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«','Õ¹Õ¸Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«','Õ°Õ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«','Õ¸Ö‚Ö€Õ¢Õ¡Õ©','Õ·Õ¡Õ¢Õ¡Õ©'],
- dayNamesShort: ['Õ¯Õ«Ö€','Õ¥Ö€Õ¯','Õ¥Ö€Ö„','Õ¹Ö€Ö„','Õ°Õ¶Õ£','Õ¸Ö‚Ö€Õ¢','Õ·Õ¢Õ©'],
- dayNamesMin: ['Õ¯Õ«Ö€','Õ¥Ö€Õ¯','Õ¥Ö€Ö„','Õ¹Ö€Ö„','Õ°Õ¶Õ£','Õ¸Ö‚Ö€Õ¢','Õ·Õ¢Õ©'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['am']);
+/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/ +jQuery(function($){ + $.datepicker.regional['am'] = {clearText: 'Õ„Õ¡Ö„Ö€Õ¥Õ¬', clearStatus: '', + closeText: 'Õ“Õ¡Õ¯Õ¥Õ¬', closeStatus: '', + prevText: '<Õ†Õ¡Õ.', prevStatus: '', + nextText: 'Õ€Õ¡Õ».>', nextStatus: '', + currentText: 'Ô±ÕµÕ½Ö…Ö€', currentStatus: '', + monthNames: ['Õ€Õ¸Ö‚Õ¶Õ¾Õ¡Ö€','Õ“Õ¥Õ¿Ö€Õ¾Õ¡Ö€','Õ„Õ¡Ö€Õ¿','Ô±ÕºÖ€Õ«Õ¬','Õ„Õ¡ÕµÕ«Õ½','Õ€Õ¸Ö‚Õ¶Õ«Õ½', + 'Õ€Õ¸Ö‚Õ¬Õ«Õ½','Õ•Õ£Õ¸Õ½Õ¿Õ¸Õ½','ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö€','Õ€Õ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€','Õ†Õ¸ÕµÕ¥Õ´Õ¢Õ¥Ö€','Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€'], + monthNamesShort: ['Õ€Õ¸Ö‚Õ¶Õ¾','Õ“Õ¥Õ¿Ö€','Õ„Õ¡Ö€Õ¿','Ô±ÕºÖ€','Õ„Õ¡ÕµÕ«Õ½','Õ€Õ¸Ö‚Õ¶Õ«Õ½', + 'Õ€Õ¸Ö‚Õ¬','Õ•Õ£Õ½','ÕÕ¥Õº','Õ€Õ¸Õ¯','Õ†Õ¸Õµ','Ô´Õ¥Õ¯'], + monthStatus: '', yearStatus: '', + weekHeader: 'Õ‡Ô²Õ', weekStatus: '', + dayNames: ['Õ¯Õ«Ö€Õ¡Õ¯Õ«','Õ¥Õ¯Õ¸Ö‚Õ·Õ¡Õ¢Õ©Õ«','Õ¥Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«','Õ¹Õ¸Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«','Õ°Õ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«','Õ¸Ö‚Ö€Õ¢Õ¡Õ©','Õ·Õ¡Õ¢Õ¡Õ©'], + dayNamesShort: ['Õ¯Õ«Ö€','Õ¥Ö€Õ¯','Õ¥Ö€Ö„','Õ¹Ö€Ö„','Õ°Õ¶Õ£','Õ¸Ö‚Ö€Õ¢','Õ·Õ¢Õ©'], + dayNamesMin: ['Õ¯Õ«Ö€','Õ¥Ö€Õ¯','Õ¥Ö€Ö„','Õ¹Ö€Ö„','Õ°Õ¶Õ£','Õ¸Ö‚Ö€Õ¢','Õ·Õ¢Õ©'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['am']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-ar.js b/ui/source/i18n/ui.datepicker-ar.js index 1c38f4f05..8e4e08562 100644 --- a/ui/source/i18n/ui.datepicker-ar.js +++ b/ui/source/i18n/ui.datepicker-ar.js @@ -1,31 +1,31 @@ -/* Arabic Translation for jQuery UI date picker plugin. */
-/* Khaled Al Horani -- koko.dw@gmail.com */
-jQuery(function($){
- $.datepicker.regional['ar'] = {
- clearText: 'äÙíÝ',
- clearStatus: 'ÇãÓÍ ÇáÊÇÑíÎ ÇáÍÇáí',
- closeText: 'ÅÛáÇÞ',
- closeStatus: 'ÅÛáÇÞ ÈÏæä ÍÝÙ',
- prevText: '<ÇáÓÇÈÞ',
- prevStatus: 'ÚÑÖ ÇáÔåÑ ÇáÓÇÈÞ',
- nextText: 'ÇáÊÇáí>',
- nextStatus: 'ÚÑÖ ÇáÔåÑ ÇáÞÇÏã',
- currentText: 'Çáíæã',
- currentStatus: 'ÚÑÖ ÇáÔåÑ ÇáÍÇáí',
- monthNames: ['ßÇäæä ÇáËÇäí', 'ÔÈÇØ', 'ÂÐÇÑ', 'äíÓÇä', 'ÂÐÇÑ', 'ÍÒíÑÇä', 'ÊãæÒ', 'ÂÈ', 'Ãíáæá', 'ÊÔÑíä ÇáÃæá', 'ÊÔÑíä ÇáËÇäí', 'ßÇäæä ÇáÃæá'],
- monthNamesShort: ['ßÇäæä ÇáËÇäí', 'ÔÈÇØ', 'ÂÐÇÑ', 'äíÓÇä', 'ÂÐÇÑ', 'ÍÒíÑÇä', 'ÊãæÒ', 'ÂÈ', 'Ãíáæá', 'ÊÔÑíä ÇáÃæá', 'ÊÔÑíä ÇáËÇäí', 'ßÇäæä ÇáÃæá'],
- monthStatus: 'ÚÑÖ ÔåÑ ÂÎÑ',
- yearStatus: 'ÚÑÖ ÓäÉ ÂÎÑì',
- weekHeader: 'ÃÓÈæÚ',
- weekStatus: 'ÃÓÈæÚ ÇáÓäÉ',
- dayNames: ['ÇáÓÈÊ', 'ÇáÃÍÏ', 'ÇáÇËäíä', 'ÇáËáÇËÇÁ', 'ÇáÃÑÈÚÇÁ', 'ÇáÎãíÓ', 'ÇáÌãÚÉ'],
- dayNamesShort: ['ÇáÓÈÊ', 'ÇáÃÍÏ', 'ÇáÇËäíä', 'ÇáËáÇËÇÁ', 'ÇáÃÑÈÚÇÁ', 'ÇáÎãíÓ', 'ÇáÌãÚÉ'],
- dayNamesMin: ['ÇáÓÈÊ', 'ÇáÃÍÏ', 'ÇáÇËäíä', 'ÇáËáÇËÇÁ', 'ÇáÃÑÈÚÇÁ', 'ÇáÎãíÓ', 'ÇáÌãÚÉ'],
- dayStatus: 'ÇÎÊÑ DD ááíæã ÇáÃæá ãä ÇáÃÓÈæÚ',
- dateStatus: 'ÇÎÊÑ D, M d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: 'ÇÎÊÑ íæã',
- isRTL: true
- };
- $.datepicker.setDefaults($.datepicker.regional['ar']);
+/* Arabic Translation for jQuery UI date picker plugin. */ +/* Khaled Al Horani -- koko.dw@gmail.com */ +jQuery(function($){ + $.datepicker.regional['ar'] = { + clearText: 'äÙíÝ', + clearStatus: 'ÇãÓÍ ÇáÊÇÑíÎ ÇáÍÇáí', + closeText: 'ÅÛáÇÞ', + closeStatus: 'ÅÛáÇÞ ÈÏæä ÍÝÙ', + prevText: '<ÇáÓÇÈÞ', + prevStatus: 'ÚÑÖ ÇáÔåÑ ÇáÓÇÈÞ', + nextText: 'ÇáÊÇáí>', + nextStatus: 'ÚÑÖ ÇáÔåÑ ÇáÞÇÏã', + currentText: 'Çáíæã', + currentStatus: 'ÚÑÖ ÇáÔåÑ ÇáÍÇáí', + monthNames: ['ßÇäæä ÇáËÇäí', 'ÔÈÇØ', 'ÂÐÇÑ', 'äíÓÇä', 'ÂÐÇÑ', 'ÍÒíÑÇä', 'ÊãæÒ', 'ÂÈ', 'Ãíáæá', 'ÊÔÑíä ÇáÃæá', 'ÊÔÑíä ÇáËÇäí', 'ßÇäæä ÇáÃæá'], + monthNamesShort: ['ßÇäæä ÇáËÇäí', 'ÔÈÇØ', 'ÂÐÇÑ', 'äíÓÇä', 'ÂÐÇÑ', 'ÍÒíÑÇä', 'ÊãæÒ', 'ÂÈ', 'Ãíáæá', 'ÊÔÑíä ÇáÃæá', 'ÊÔÑíä ÇáËÇäí', 'ßÇäæä ÇáÃæá'], + monthStatus: 'ÚÑÖ ÔåÑ ÂÎÑ', + yearStatus: 'ÚÑÖ ÓäÉ ÂÎÑì', + weekHeader: 'ÃÓÈæÚ', + weekStatus: 'ÃÓÈæÚ ÇáÓäÉ', + dayNames: ['ÇáÓÈÊ', 'ÇáÃÍÏ', 'ÇáÇËäíä', 'ÇáËáÇËÇÁ', 'ÇáÃÑÈÚÇÁ', 'ÇáÎãíÓ', 'ÇáÌãÚÉ'], + dayNamesShort: ['ÇáÓÈÊ', 'ÇáÃÍÏ', 'ÇáÇËäíä', 'ÇáËáÇËÇÁ', 'ÇáÃÑÈÚÇÁ', 'ÇáÎãíÓ', 'ÇáÌãÚÉ'], + dayNamesMin: ['ÇáÓÈÊ', 'ÇáÃÍÏ', 'ÇáÇËäíä', 'ÇáËáÇËÇÁ', 'ÇáÃÑÈÚÇÁ', 'ÇáÎãíÓ', 'ÇáÌãÚÉ'], + dayStatus: 'ÇÎÊÑ DD ááíæã ÇáÃæá ãä ÇáÃÓÈæÚ', + dateStatus: 'ÇÎÊÑ D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'ÇÎÊÑ íæã', + isRTL: true + }; + $.datepicker.setDefaults($.datepicker.regional['ar']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-ca.js b/ui/source/i18n/ui.datepicker-ca.js index 5ecfdd6bc..709a96ae8 100644 --- a/ui/source/i18n/ui.datepicker-ca.js +++ b/ui/source/i18n/ui.datepicker-ca.js @@ -1,22 +1,22 @@ -/* Inicialització en català per a l'extenció 'calendar' per jQuery. */
-/* Writers: (joan.leon@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['ca'] = {clearText: 'Netejar', clearStatus: '',
- closeText: 'Tancar', closeStatus: '',
- prevText: '<Ant', prevStatus: '',
- nextText: 'Seg>', nextStatus: '',
- currentText: 'Avui', currentStatus: '',
- monthNames: ['Gener','Febrer','Març','Abril','Maig','Juny',
- 'Juliol','Agost','Setembre','Octubre','Novembre','Decembre'],
- monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
- 'Jul','Ago','Set','Oct','Nov','Dec'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Sm', weekStatus: '',
- dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
- dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
- dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'mm/dd/yy', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['ca']);
+/* Inicialització en català per a l'extenció 'calendar' per jQuery. */ +/* Writers: (joan.leon@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ca'] = {clearText: 'Netejar', clearStatus: '', + closeText: 'Tancar', closeStatus: '', + prevText: '<Ant', prevStatus: '', + nextText: 'Seg>', nextStatus: '', + currentText: 'Avui', currentStatus: '', + monthNames: ['Gener','Febrer','Març','Abril','Maig','Juny', + 'Juliol','Agost','Setembre','Octubre','Novembre','Decembre'], + monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Oct','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'], + dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'], + dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'mm/dd/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ca']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-cs.js b/ui/source/i18n/ui.datepicker-cs.js index e62531044..e195deb43 100644 --- a/ui/source/i18n/ui.datepicker-cs.js +++ b/ui/source/i18n/ui.datepicker-cs.js @@ -1,22 +1,22 @@ -/* Czech initialisation for the jQuery UI date picker plugin. */
-/* Written by Tomas Muller (tomas@tomas-muller.net). */
-jQuery(function($){
- $.datepicker.regional['cs'] = {clearText: 'Vymazat', clearStatus: 'Vymaže zadané datum',
- closeText: 'ZavÅ™Ãt', closeStatus: 'ZavÅ™e kalendář beze zmÄ›ny',
- prevText: '<DÅ™Ãve', prevStatus: 'PÅ™ejÃt na pÅ™edchozà mÄ›sÃ',
- nextText: 'PozdÄ›ji>', nextStatus: 'PÅ™ejÃt na dalšà mÄ›sÃc',
- currentText: 'NynÃ', currentStatus: 'PÅ™ejde na aktuálnà mÄ›sÃc',
- monthNames: ['leden','únor','bÅ™ezen','duben','kvÄ›ten','Äerven',
- 'Äervenec','srpen','zářÃ','Å™Ãjen','listopad','prosinec'],
- monthNamesShort: ['led','úno','bÅ™e','dub','kvÄ›','Äer',
- 'Ävc','srp','zář','Å™Ãj','lis','pro'],
- monthStatus: 'PÅ™ejÃt na jiný mÄ›sÃc', yearStatus: 'PÅ™ejÃt na jiný rok',
- weekHeader: 'Týd', weekStatus: 'Týden v roce',
- dayNames: ['nedÄ›le', 'pondÄ›lÃ', 'úterý', 'stÅ™eda', 'Ätvrtek', 'pátek', 'sobota'],
- dayNamesShort: ['ne', 'po', 'út', 'st', 'Ät', 'pá', 'so'],
- dayNamesMin: ['ne','po','út','st','Ät','pá','so'],
- dayStatus: 'Nastavit DD jako prvnà den v týdnu', dateStatus: '\'Vyber\' DD, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: 'Vyberte datum', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['cs']);
-});
+/* Czech initialisation for the jQuery UI date picker plugin. */ +/* Written by Tomas Muller (tomas@tomas-muller.net). */ +jQuery(function($){ + $.datepicker.regional['cs'] = {clearText: 'Vymazat', clearStatus: 'Vymaže zadané datum', + closeText: 'ZavÅ™Ãt', closeStatus: 'ZavÅ™e kalendář beze zmÄ›ny', + prevText: '<DÅ™Ãve', prevStatus: 'PÅ™ejÃt na pÅ™edchozà mÄ›sÃ', + nextText: 'PozdÄ›ji>', nextStatus: 'PÅ™ejÃt na dalšà mÄ›sÃc', + currentText: 'NynÃ', currentStatus: 'PÅ™ejde na aktuálnà mÄ›sÃc', + monthNames: ['leden','únor','bÅ™ezen','duben','kvÄ›ten','Äerven', + 'Äervenec','srpen','zářÃ','Å™Ãjen','listopad','prosinec'], + monthNamesShort: ['led','úno','bÅ™e','dub','kvÄ›','Äer', + 'Ävc','srp','zář','Å™Ãj','lis','pro'], + monthStatus: 'PÅ™ejÃt na jiný mÄ›sÃc', yearStatus: 'PÅ™ejÃt na jiný rok', + weekHeader: 'Týd', weekStatus: 'Týden v roce', + dayNames: ['nedÄ›le', 'pondÄ›lÃ', 'úterý', 'stÅ™eda', 'Ätvrtek', 'pátek', 'sobota'], + dayNamesShort: ['ne', 'po', 'út', 'st', 'Ät', 'pá', 'so'], + dayNamesMin: ['ne','po','út','st','Ät','pá','so'], + dayStatus: 'Nastavit DD jako prvnà den v týdnu', dateStatus: '\'Vyber\' DD, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Vyberte datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['cs']); +}); diff --git a/ui/source/i18n/ui.datepicker-da.js b/ui/source/i18n/ui.datepicker-da.js index d71b99600..794f6ef44 100644 --- a/ui/source/i18n/ui.datepicker-da.js +++ b/ui/source/i18n/ui.datepicker-da.js @@ -1,22 +1,22 @@ -/* Danish initialisation for the jQuery UI date picker plugin. */
-/* Written by Jan Christensen ( deletestuff@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['da'] = {clearText: 'Nulstil', clearStatus: 'Nulstil den aktuelle dato',
- closeText: 'Luk', closeStatus: 'Luk uden ændringer',
- prevText: '<Forrige', prevStatus: 'Vis forrige måned',
- nextText: 'Næste>', nextStatus: 'Vis næste måned',
- currentText: 'Idag', currentStatus: 'Vis aktuel måned',
- monthNames: ['Januar','Februar','Marts','April','Maj','Juni',
- 'Juli','August','September','Oktober','November','December'],
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
- 'Jul','Aug','Sep','Okt','Nov','Dec'],
- monthStatus: 'Vis en anden måned', yearStatus: 'Vis et andet år',
- weekHeader: 'Uge', weekStatus: 'Ã…rets uge',
- dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
- dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
- dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
- dayStatus: 'Sæt DD som første ugedag', dateStatus: 'Vælg D, M d',
- dateFormat: 'dd-mm-yy', firstDay: 0,
- initStatus: 'Vælg en dato', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['da']);
-});
+/* Danish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jan Christensen ( deletestuff@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['da'] = {clearText: 'Nulstil', clearStatus: 'Nulstil den aktuelle dato', + closeText: 'Luk', closeStatus: 'Luk uden ændringer', + prevText: '<Forrige', prevStatus: 'Vis forrige måned', + nextText: 'Næste>', nextStatus: 'Vis næste måned', + currentText: 'Idag', currentStatus: 'Vis aktuel måned', + monthNames: ['Januar','Februar','Marts','April','Maj','Juni', + 'Juli','August','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: 'Vis en anden måned', yearStatus: 'Vis et andet år', + weekHeader: 'Uge', weekStatus: 'Årets uge', + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + dayStatus: 'Sæt DD som første ugedag', dateStatus: 'Vælg D, M d', + dateFormat: 'dd-mm-yy', firstDay: 0, + initStatus: 'Vælg en dato', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['da']); +}); diff --git a/ui/source/i18n/ui.datepicker-de.js b/ui/source/i18n/ui.datepicker-de.js index 75064eee1..d31af3a1b 100644 --- a/ui/source/i18n/ui.datepicker-de.js +++ b/ui/source/i18n/ui.datepicker-de.js @@ -1,22 +1,22 @@ -/* German initialisation for the jQuery UI date picker plugin. */
-/* Written by Milian Wolff (mail@milianw.de). */
-jQuery(function($){
- $.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
- closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
- prevText: '<zurück', prevStatus: 'letzten Monat zeigen',
- nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen',
- currentText: 'heute', currentStatus: '',
- monthNames: ['Januar','Februar','März','April','Mai','Juni',
- 'Juli','August','September','Oktober','November','Dezember'],
- monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
- 'Jul','Aug','Sep','Okt','Nov','Dez'],
- monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
- weekHeader: 'Wo', weekStatus: 'Woche des Monats',
- dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
- dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
- dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
- dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: 'Wähle ein Datum', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['de']);
-});
+/* German initialisation for the jQuery UI date picker plugin. */ +/* Written by Milian Wolff (mail@milianw.de). */ +jQuery(function($){ + $.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen', + closeText: 'schließen', closeStatus: 'ohne Änderungen schließen', + prevText: '<zurück', prevStatus: 'letzten Monat zeigen', + nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen', + currentText: 'heute', currentStatus: '', + monthNames: ['Januar','Februar','März','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Dezember'], + monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dez'], + monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen', + weekHeader: 'Wo', weekStatus: 'Woche des Monats', + dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], + dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], + dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Wähle ein Datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['de']); +}); diff --git a/ui/source/i18n/ui.datepicker-es.js b/ui/source/i18n/ui.datepicker-es.js index d104f6793..c5fdd719d 100644 --- a/ui/source/i18n/ui.datepicker-es.js +++ b/ui/source/i18n/ui.datepicker-es.js @@ -1,22 +1,22 @@ -/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
-/* Traducido por Vester (xvester@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['es'] = {clearText: 'Limpiar', clearStatus: '',
- closeText: 'Cerrar', closeStatus: '',
- prevText: '<Ant', prevStatus: '',
- nextText: 'Sig>', nextStatus: '',
- currentText: 'Hoy', currentStatus: '',
- monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
- 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
- monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
- 'Jul','Ago','Sep','Oct','Nov','Dic'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Sm', weekStatus: '',
- dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sádabo'],
- dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
- dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['es']);
+/* Inicialización en español para la extensión 'UI date picker' para jQuery. */ +/* Traducido por Vester (xvester@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['es'] = {clearText: 'Limpiar', clearStatus: '', + closeText: 'Cerrar', closeStatus: '', + prevText: '<Ant', prevStatus: '', + nextText: 'Sig>', nextStatus: '', + currentText: 'Hoy', currentStatus: '', + monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', + 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], + monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', + 'Jul','Ago','Sep','Oct','Nov','Dic'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sádabo'], + dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], + dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['es']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-fi.js b/ui/source/i18n/ui.datepicker-fi.js index 95b11e09e..550a980aa 100644 --- a/ui/source/i18n/ui.datepicker-fi.js +++ b/ui/source/i18n/ui.datepicker-fi.js @@ -1,24 +1,24 @@ -/* Finnish initialisation for the jQuery UI date picker plugin. */
-/* Written by Harri Kilpiö (harrikilpio@gmail.com). */
-
-$(document).ready(function(){
- $.datepicker.regional['fi'] = {
- clearText: 'Tyhjennä', clearStatus: '',
- closeText: 'Sulje', closeStatus: '',
- prevText: '«Edellinen', prevStatus: '',
- nextText: 'Seuraava»', nextStatus: '',
- currentText: 'Tänään', currentStatus: '',
- monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu',
- 'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
- monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä',
- 'Heinä','Elo','Syys','Loka','Marras','Joulu'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Vk', weekStatus: '',
- dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'],
- dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
- dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['fi']);
-});
+/* Finnish initialisation for the jQuery UI date picker plugin. */ +/* Written by Harri Kilpiö (harrikilpio@gmail.com). */ + +$(document).ready(function(){ + $.datepicker.regional['fi'] = { + clearText: 'Tyhjennä', clearStatus: '', + closeText: 'Sulje', closeStatus: '', + prevText: '«Edellinen', prevStatus: '', + nextText: 'Seuraava»', nextStatus: '', + currentText: 'Tänään', currentStatus: '', + monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kesäkuu', + 'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'], + monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä', + 'Heinä','Elo','Syys','Loka','Marras','Joulu'], + monthStatus: '', yearStatus: '', + weekHeader: 'Vk', weekStatus: '', + dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'], + dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'], + dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['fi']); +}); diff --git a/ui/source/i18n/ui.datepicker-fr.js b/ui/source/i18n/ui.datepicker-fr.js index e27dee8bf..b3e390706 100644 --- a/ui/source/i18n/ui.datepicker-fr.js +++ b/ui/source/i18n/ui.datepicker-fr.js @@ -1,22 +1,22 @@ -/* French initialisation for the jQuery UI date picker plugin. */
-/* Written by Keith Wood (kbwood@iprimus.com.au) and Stéphane Nahmani (sholby@sholby.net). */
-jQuery(function($){
- $.datepicker.regional['fr'] = {clearText: 'Effacer', clearStatus: '',
- closeText: 'Fermer', closeStatus: 'Fermer sans modifier',
- prevText: '<Préc', prevStatus: 'Voir le mois précédent',
- nextText: 'Suiv>', nextStatus: 'Voir le mois suivant',
- currentText: 'Courant', currentStatus: 'Voir le mois courant',
- monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
- 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
- monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
- 'Jul','Aoû','Sep','Oct','Nov','Déc'],
- monthStatus: 'Voir un autre mois', yearStatus: 'Voir un autre année',
- weekHeader: 'Sm', weekStatus: '',
- dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
- dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
- dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
- dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: 'Choisir la date', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['fr']);
+/* French initialisation for the jQuery UI date picker plugin. */ +/* Written by Keith Wood (kbwood@iprimus.com.au) and Stéphane Nahmani (sholby@sholby.net). */ +jQuery(function($){ + $.datepicker.regional['fr'] = {clearText: 'Effacer', clearStatus: '', + closeText: 'Fermer', closeStatus: 'Fermer sans modifier', + prevText: '<Préc', prevStatus: 'Voir le mois précédent', + nextText: 'Suiv>', nextStatus: 'Voir le mois suivant', + currentText: 'Courant', currentStatus: 'Voir le mois courant', + monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', + 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], + monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', + 'Jul','Aoû','Sep','Oct','Nov','Déc'], + monthStatus: 'Voir un autre mois', yearStatus: 'Voir un autre année', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], + dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], + dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'Choisir la date', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['fr']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-he.js b/ui/source/i18n/ui.datepicker-he.js index fb7ff74fc..87f55f729 100644 --- a/ui/source/i18n/ui.datepicker-he.js +++ b/ui/source/i18n/ui.datepicker-he.js @@ -1,22 +1,22 @@ -/* Hebrew initialisation for the UI Datepicker extension. */
-/* Written by Amir Hardon (ahardon at gmail dot com). */
-jQuery(document).ready(function(){
- jQuery.datepicker.regional['he'] = {clearText: '× ×§×”', clearStatus: '',
- closeText: 'סגור', closeStatus: '',
- prevText: '<הקוד×', prevStatus: '',
- nextText: 'הב×>', nextStatus: '',
- currentText: 'היו×', currentStatus: '',
- monthNames: ['×™× ×•×ר','פברו×ר','מרץ','×פריל','מ××™','×™×•× ×™',
- 'יולי','×וגוסט','ספטמבר','×וקטובר','× ×•×‘×ž×‘×¨','דצמבר'],
- monthNamesShort: ['1','2','3','4','5','6',
- '7','8','9','10','11','12'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Sm', weekStatus: '',
- dayNames: ['ר×שון','×©× ×™','שלישי','רביעי','חמישי','שישי','שבת'],
- dayNamesShort: ['×\'','ב\'','×’\'','ד\'','×”\'','ו\'','שבת'],
- dayNamesMin: ['×\'','ב\'','×’\'','ד\'','×”\'','ו\'','שבת'],
- dayStatus: 'DD', dateStatus: 'DD, M d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: '', isRTL: true};
- jQuery.datepicker.setDefaults($.datepicker.regional['he']);
-});
+/* Hebrew initialisation for the UI Datepicker extension. */ +/* Written by Amir Hardon (ahardon at gmail dot com). */ +jQuery(document).ready(function(){ + jQuery.datepicker.regional['he'] = {clearText: '× ×§×”', clearStatus: '', + closeText: 'סגור', closeStatus: '', + prevText: '<הקוד×', prevStatus: '', + nextText: 'הב×>', nextStatus: '', + currentText: 'היו×', currentStatus: '', + monthNames: ['×™× ×•×ר','פברו×ר','מרץ','×פריל','מ××™','×™×•× ×™', + 'יולי','×וגוסט','ספטמבר','×וקטובר','× ×•×‘×ž×‘×¨','דצמבר'], + monthNamesShort: ['1','2','3','4','5','6', + '7','8','9','10','11','12'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['ר×שון','×©× ×™','שלישי','רביעי','חמישי','שישי','שבת'], + dayNamesShort: ['×\'','ב\'','×’\'','ד\'','×”\'','ו\'','שבת'], + dayNamesMin: ['×\'','ב\'','×’\'','ד\'','×”\'','ו\'','שבת'], + dayStatus: 'DD', dateStatus: 'DD, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: true}; + jQuery.datepicker.setDefaults($.datepicker.regional['he']); +}); diff --git a/ui/source/i18n/ui.datepicker-hu.js b/ui/source/i18n/ui.datepicker-hu.js index a39611b41..1d71a3ddf 100644 --- a/ui/source/i18n/ui.datepicker-hu.js +++ b/ui/source/i18n/ui.datepicker-hu.js @@ -1,22 +1,22 @@ -/* Hungarian initialisation for the jQuery UI date picker plugin. */
-/* Written by Istvan Karaszi (jquerycalendar@spam.raszi.hu). */
-jQuery(function($){
- $.datepicker.regional['hu'] = {clearText: 'törlés', clearStatus: '',
- closeText: 'bezárás', closeStatus: '',
- prevText: '« vissza', prevStatus: '',
- nextText: 'elÅ‘re »', nextStatus: '',
- currentText: 'ma', currentStatus: '',
- monthNames: ['Január', 'Február', 'Március', 'Ãprilis', 'Május', 'Június',
- 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'],
- monthNamesShort: ['Jan', 'Feb', 'Már', 'Ãpr', 'Máj', 'Jún',
- 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Hé', weekStatus: '',
- dayNames: ['Vasámap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'],
- dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'],
- dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'yy-mm-dd', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['hu']);
-});
+/* Hungarian initialisation for the jQuery UI date picker plugin. */ +/* Written by Istvan Karaszi (jquerycalendar@spam.raszi.hu). */ +jQuery(function($){ + $.datepicker.regional['hu'] = {clearText: 'törlés', clearStatus: '', + closeText: 'bezárás', closeStatus: '', + prevText: '« vissza', prevStatus: '', + nextText: 'elÅ‘re »', nextStatus: '', + currentText: 'ma', currentStatus: '', + monthNames: ['Január', 'Február', 'Március', 'Ãprilis', 'Május', 'Június', + 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], + monthNamesShort: ['Jan', 'Feb', 'Már', 'Ãpr', 'Máj', 'Jún', + 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Hé', weekStatus: '', + dayNames: ['Vasámap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], + dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], + dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['hu']); +}); diff --git a/ui/source/i18n/ui.datepicker-id.js b/ui/source/i18n/ui.datepicker-id.js index 4e4ef9598..6c14e2fc4 100644 --- a/ui/source/i18n/ui.datepicker-id.js +++ b/ui/source/i18n/ui.datepicker-id.js @@ -1,22 +1,22 @@ -/* Indonesian initialisation for the jQuery UI date picker plugin. */
-/* Written by Deden Fathurahman (dedenf@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['id'] = {clearText: 'kosongkan', clearStatus: 'bersihkan tanggal yang sekarang',
- closeText: 'Tutup', closeStatus: 'Tutup tanpa mengubah',
- prevText: '<mundur', prevStatus: 'Tampilkan bulan sebelumnya',
- nextText: 'maju>', nextStatus: 'Tampilkan bulan berikutnya',
- currentText: 'hari ini', currentStatus: 'Tampilkan bulan sekarang',
- monthNames: ['Januari','Februari','Maret','April','Mei','Juni',
- 'Juli','Agustus','September','Oktober','Nopember','Desember'],
- monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun',
- 'Jul','Agus','Sep','Okt','Nop','Des'],
- monthStatus: 'Tampilkan bulan yang berbeda', yearStatus: 'Tampilkan tahun yang berbeda',
- weekHeader: 'Mg', weekStatus: 'Minggu dalam tahun',
- dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'],
- dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'],
- dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'],
- dayStatus: 'gunakan DD sebagai awal hari dalam minggu', dateStatus: 'pilih le DD, MM d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: 'Pilih Tanggal', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['id']);
+/* Indonesian initialisation for the jQuery UI date picker plugin. */ +/* Written by Deden Fathurahman (dedenf@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['id'] = {clearText: 'kosongkan', clearStatus: 'bersihkan tanggal yang sekarang', + closeText: 'Tutup', closeStatus: 'Tutup tanpa mengubah', + prevText: '<mundur', prevStatus: 'Tampilkan bulan sebelumnya', + nextText: 'maju>', nextStatus: 'Tampilkan bulan berikutnya', + currentText: 'hari ini', currentStatus: 'Tampilkan bulan sekarang', + monthNames: ['Januari','Februari','Maret','April','Mei','Juni', + 'Juli','Agustus','September','Oktober','Nopember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', + 'Jul','Agus','Sep','Okt','Nop','Des'], + monthStatus: 'Tampilkan bulan yang berbeda', yearStatus: 'Tampilkan tahun yang berbeda', + weekHeader: 'Mg', weekStatus: 'Minggu dalam tahun', + dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], + dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], + dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], + dayStatus: 'gunakan DD sebagai awal hari dalam minggu', dateStatus: 'pilih le DD, MM d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'Pilih Tanggal', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['id']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-is.js b/ui/source/i18n/ui.datepicker-is.js index d39de93de..65316eed0 100644 --- a/ui/source/i18n/ui.datepicker-is.js +++ b/ui/source/i18n/ui.datepicker-is.js @@ -1,22 +1,22 @@ -/* Icelandic initialisation for the jQuery UI date picker plugin. */
-/* Written by Haukur H. Thorsson (haukur@eskill.is). */
-jQuery(function($){
- $.datepicker.regional['is'] = {clearText: 'Hreinsa', clearStatus: '',
- closeText: 'Loka', closeStatus: '',
- prevText: '< Fyrri', prevStatus: '',
- nextText: 'Næsti >', nextStatus: '',
- currentText: 'Í dag', currentStatus: '',
- monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní',
- 'Júlí','Ágúst','September','Október','Nóvember','Desember'],
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún',
- 'Júl','Ágú','Sep','Okt','Nóv','Des'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Vika', weekStatus: '',
- dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'],
- dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'],
- dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['is']);
+/* Icelandic initialisation for the jQuery UI date picker plugin. */ +/* Written by Haukur H. Thorsson (haukur@eskill.is). */ +jQuery(function($){ + $.datepicker.regional['is'] = {clearText: 'Hreinsa', clearStatus: '', + closeText: 'Loka', closeStatus: '', + prevText: '< Fyrri', prevStatus: '', + nextText: 'Næsti >', nextStatus: '', + currentText: 'Í dag', currentStatus: '', + monthNames: ['Janúar','Febrúar','Mars','Apríl','Maí','Júní', + 'Júlí','Ágúst','September','Október','Nóvember','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maí','Jún', + 'Júl','Ágú','Sep','Okt','Nóv','Des'], + monthStatus: '', yearStatus: '', + weekHeader: 'Vika', weekStatus: '', + dayNames: ['Sunnudagur','Mánudagur','Þriðjudagur','Miðvikudagur','Fimmtudagur','Föstudagur','Laugardagur'], + dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'], + dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['is']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-it.js b/ui/source/i18n/ui.datepicker-it.js index dde4e1e48..a1ee89599 100644 --- a/ui/source/i18n/ui.datepicker-it.js +++ b/ui/source/i18n/ui.datepicker-it.js @@ -1,22 +1,22 @@ -/* Italian initialisation for the jQuery UI date picker plugin. */
-/* Written by Apaella (apaella@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['it'] = {clearText: 'Svuota', clearStatus: '',
- closeText: 'Chiudi', closeStatus: '',
- prevText: '<Prec', prevStatus: '',
- nextText: 'Succ>', nextStatus: '',
- currentText: 'Oggi', currentStatus: '',
- monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
- 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
- monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
- 'Lug','Ago','Set','Ott','Nov','Dic'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Sm', weekStatus: '',
- dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
- dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
- dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd/mm/yy', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['it']);
-});
+/* Italian initialisation for the jQuery UI date picker plugin. */ +/* Written by Apaella (apaella@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['it'] = {clearText: 'Svuota', clearStatus: '', + closeText: 'Chiudi', closeStatus: '', + prevText: '<Prec', prevStatus: '', + nextText: 'Succ>', nextStatus: '', + currentText: 'Oggi', currentStatus: '', + monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', + 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], + monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', + 'Lug','Ago','Set','Ott','Nov','Dic'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'], + dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], + dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['it']); +}); diff --git a/ui/source/i18n/ui.datepicker-ja.js b/ui/source/i18n/ui.datepicker-ja.js index 070ff86ef..e33909fe5 100644 --- a/ui/source/i18n/ui.datepicker-ja.js +++ b/ui/source/i18n/ui.datepicker-ja.js @@ -1,22 +1,22 @@ -/* Japanese (UTF-8) initialisation for the jQuery UI date picker plugin. */
-/* Written by Milly. */
-jQuery(function($){
- $.datepicker.regional['ja'] = {clearText: '削除', clearStatus: '',
- closeText: '閉じる', closeStatus: '',
- prevText: '<前月', prevStatus: '',
- nextText: '次月>', nextStatus: '',
- currentText: '今日', currentStatus: '',
- monthNames: ['1月','2月','3月','4月','5月','6月',
- '7月','8月','9月','10月','11月','12月'],
- monthNamesShort: ['1月','2月','3月','4月','5月','6月',
- '7月','8月','9月','10月','11月','12月'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Wk', weekStatus: '',
- dayNames: ['日','月','火','水','木','金','土'],
- dayNamesShort: ['日','月','火','水','木','金','土'],
- dayNamesMin: ['日','月','火','水','木','金','土'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'yy/mm/dd', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['ja']);
+/* Japanese (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Milly. */ +jQuery(function($){ + $.datepicker.regional['ja'] = {clearText: '削除', clearStatus: '', + closeText: '閉じる', closeStatus: '', + prevText: '<前月', prevStatus: '', + nextText: '次月>', nextStatus: '', + currentText: '今日', currentStatus: '', + monthNames: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + monthNamesShort: ['1月','2月','3月','4月','5月','6月', + '7月','8月','9月','10月','11月','12月'], + monthStatus: '', yearStatus: '', + weekHeader: 'Wk', weekStatus: '', + dayNames: ['日','月','火','水','木','金','土'], + dayNamesShort: ['日','月','火','水','木','金','土'], + dayNamesMin: ['日','月','火','水','木','金','土'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy/mm/dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ja']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-ko.js b/ui/source/i18n/ui.datepicker-ko.js index 545f5b602..1381e66b7 100644 --- a/ui/source/i18n/ui.datepicker-ko.js +++ b/ui/source/i18n/ui.datepicker-ko.js @@ -1,22 +1,22 @@ -/* Korean initialisation for the jQuery calendar extension. */
-/* Written by DaeKwon Kang (ncrash.dk@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['ko'] = {clearText: '지우기', clearStatus: '',
- closeText: '닫기', closeStatus: '',
- prevText: 'ì´ì „달', prevStatus: '',
- nextText: '다ìŒë‹¬', nextStatus: '',
- currentText: '오늘', currentStatus: '',
- monthNames: ['1ì›”(JAN)','2ì›”(FEB)','3ì›”(MAR)','4ì›”(APR)','5ì›”(MAY)','6ì›”(JUN)',
- '7ì›”(JUL)','8ì›”(AUG)','9ì›”(SEP)','10ì›”(OCT)','11ì›”(NOV)','12ì›”(DEC)'],
- monthNamesShort: ['1ì›”(JAN)','2ì›”(FEB)','3ì›”(MAR)','4ì›”(APR)','5ì›”(MAY)','6ì›”(JUN)',
- '7ì›”(JUL)','8ì›”(AUG)','9ì›”(SEP)','10ì›”(OCT)','11ì›”(NOV)','12ì›”(DEC)'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Wk', weekStatus: '',
- dayNames: ['ì¼','ì›”','í™”','수','목','금','í† '],
- dayNamesShort: ['ì¼','ì›”','í™”','수','목','금','í† '],
- dayNamesMin: ['ì¼','ì›”','í™”','수','목','금','í† '],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'yy-mm-dd', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['ko']);
+/* Korean initialisation for the jQuery calendar extension. */ +/* Written by DaeKwon Kang (ncrash.dk@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ko'] = {clearText: '지우기', clearStatus: '', + closeText: '닫기', closeStatus: '', + prevText: 'ì´ì „달', prevStatus: '', + nextText: '다ìŒë‹¬', nextStatus: '', + currentText: '오늘', currentStatus: '', + monthNames: ['1ì›”(JAN)','2ì›”(FEB)','3ì›”(MAR)','4ì›”(APR)','5ì›”(MAY)','6ì›”(JUN)', + '7ì›”(JUL)','8ì›”(AUG)','9ì›”(SEP)','10ì›”(OCT)','11ì›”(NOV)','12ì›”(DEC)'], + monthNamesShort: ['1ì›”(JAN)','2ì›”(FEB)','3ì›”(MAR)','4ì›”(APR)','5ì›”(MAY)','6ì›”(JUN)', + '7ì›”(JUL)','8ì›”(AUG)','9ì›”(SEP)','10ì›”(OCT)','11ì›”(NOV)','12ì›”(DEC)'], + monthStatus: '', yearStatus: '', + weekHeader: 'Wk', weekStatus: '', + dayNames: ['ì¼','ì›”','í™”','수','목','금','í† '], + dayNamesShort: ['ì¼','ì›”','í™”','수','목','금','í† '], + dayNamesMin: ['ì¼','ì›”','í™”','수','목','금','í† '], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ko']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-lt.js b/ui/source/i18n/ui.datepicker-lt.js index 45682d2d0..120e82b2f 100644 --- a/ui/source/i18n/ui.datepicker-lt.js +++ b/ui/source/i18n/ui.datepicker-lt.js @@ -1,25 +1,25 @@ -/**
- * Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin.
- *
- * @author Arturas Paleicikas <arturas@avalon.lt>
- */
-jQuery(function($){
- $.datepicker.regional['lt'] = {clearText: 'Išvalyti', clearStatus: '',
- closeText: 'Uždaryti', closeStatus: '',
- prevText: '<Atgal', prevStatus: '',
- nextText: 'Pirmyn>', nextStatus: '',
- currentText: 'Å iandien', currentStatus: '',
- monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis',
- 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'],
- monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir',
- 'Lie','Rugp','Rugs','Spa','Lap','Gru'],
- monthStatus: '', yearStatus: '',
- weekHeader: '', weekStatus: '',
- dayNames: ['sekmadienis','pirmadienis','antradienis','treÄiadienis','ketvirtadienis','penktadienis','Å¡eÅ¡tadienis'],
- dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'],
- dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Å e'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'yy-mm-dd', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['lt']);
+/** + * Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. + * + * @author Arturas Paleicikas <arturas@avalon.lt> + */ +jQuery(function($){ + $.datepicker.regional['lt'] = {clearText: 'IÅ¡valyti', clearStatus: '', + closeText: 'Uždaryti', closeStatus: '', + prevText: '<Atgal', prevStatus: '', + nextText: 'Pirmyn>', nextStatus: '', + currentText: 'Å iandien', currentStatus: '', + monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis', + 'Liepa','RugpjÅ«tis','RugsÄ—jis','Spalis','Lapkritis','Gruodis'], + monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir', + 'Lie','Rugp','Rugs','Spa','Lap','Gru'], + monthStatus: '', yearStatus: '', + weekHeader: '', weekStatus: '', + dayNames: ['sekmadienis','pirmadienis','antradienis','treÄiadienis','ketvirtadienis','penktadienis','Å¡eÅ¡tadienis'], + dayNamesShort: ['sek','pir','ant','tre','ket','pen','Å¡eÅ¡'], + dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Å e'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['lt']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-lv.js b/ui/source/i18n/ui.datepicker-lv.js index 0aaa3c73a..809185df5 100644 --- a/ui/source/i18n/ui.datepicker-lv.js +++ b/ui/source/i18n/ui.datepicker-lv.js @@ -1,24 +1,24 @@ -/**
- * @author Arturas Paleicikas <arturas.paleicikas@metasite.net>
- */
-jQuery(function($){
- $.datepicker.regional['lv'] = {
- clearText: 'Notīrīt', clearStatus: '',
- closeText: 'Aizvērt', closeStatus: '',
- prevText: 'Iepr', prevStatus: '',
- nextText: 'NÄka', nextStatus: '',
- currentText: 'Å odien', currentStatus: '',
- monthNames: ['JanvÄris','FebruÄris','Marts','AprÄ«lis','Maijs','JÅ«nijs',
- 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'],
- monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn',
- 'Jūl','Aug','Sep','Okt','Nov','Dec'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Nav', weekStatus: '',
- dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'],
- dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'],
- dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd-mm-yy', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['lv']);
+/** + * @author Arturas Paleicikas <arturas.paleicikas@metasite.net> + */ +jQuery(function($){ + $.datepicker.regional['lv'] = { + clearText: 'NotÄ«rÄ«t', clearStatus: '', + closeText: 'AizvÄ“rt', closeStatus: '', + prevText: 'Iepr', prevStatus: '', + nextText: 'NÄka', nextStatus: '', + currentText: 'Å odien', currentStatus: '', + monthNames: ['JanvÄris','FebruÄris','Marts','AprÄ«lis','Maijs','JÅ«nijs', + 'JÅ«lijs','Augusts','Septembris','Oktobris','Novembris','Decembris'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','JÅ«n', + 'JÅ«l','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Nav', weekStatus: '', + dayNames: ['svÄ“tdiena','pirmdiena','otrdiena','treÅ¡diena','ceturtdiena','piektdiena','sestdiena'], + dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'], + dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd-mm-yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['lv']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-nl.js b/ui/source/i18n/ui.datepicker-nl.js index 226b36b8f..0d52d6f33 100644 --- a/ui/source/i18n/ui.datepicker-nl.js +++ b/ui/source/i18n/ui.datepicker-nl.js @@ -1,21 +1,21 @@ -/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */
-jQuery(function($){
- $.datepicker.regional['nl'] = {clearText: 'Wissen', clearStatus: 'Wis de huidige datum',
- closeText: 'Sluiten', closeStatus: 'Sluit zonder verandering',
- prevText: '<Terug', prevStatus: 'Laat de voorgaande maand zien',
- nextText: 'Volgende>', nextStatus: 'Laat de volgende maand zien',
- currentText: 'Vandaag', currentStatus: 'Laat de huidige maand zien',
- monthNames: ['Januari','Februari','Maart','April','Mei','Juni',
- 'Juli','Augustus','September','Oktober','November','December'],
- monthNamesShort: ['Jan','Feb','Mrt','Apr','Mei','Jun',
- 'Jul','Aug','Sep','Okt','Nov','Dec'],
- monthStatus: 'Laat een andere maand zien', yearStatus: 'Laat een ander jaar zien',
- weekHeader: 'Wk', weekStatus: 'Week van het jaar',
- dayNames: ['Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'],
- dayNamesShort: ['Zon','Maa','Din','Woe','Don','Vri','Zat'],
- dayNamesMin: ['Zo','Ma','Di','Wo','Do','Vr','Za'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: 'Kies een datum', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['nl']);
+/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ +jQuery(function($){ + $.datepicker.regional['nl'] = {clearText: 'Wissen', clearStatus: 'Wis de huidige datum', + closeText: 'Sluiten', closeStatus: 'Sluit zonder verandering', + prevText: '<Terug', prevStatus: 'Laat de voorgaande maand zien', + nextText: 'Volgende>', nextStatus: 'Laat de volgende maand zien', + currentText: 'Vandaag', currentStatus: 'Laat de huidige maand zien', + monthNames: ['Januari','Februari','Maart','April','Mei','Juni', + 'Juli','Augustus','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mrt','Apr','Mei','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: 'Laat een andere maand zien', yearStatus: 'Laat een ander jaar zien', + weekHeader: 'Wk', weekStatus: 'Week van het jaar', + dayNames: ['Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'], + dayNamesShort: ['Zon','Maa','Din','Woe','Don','Vri','Zat'], + dayNamesMin: ['Zo','Ma','Di','Wo','Do','Vr','Za'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Kies een datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['nl']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-no.js b/ui/source/i18n/ui.datepicker-no.js index 9890968d0..42932b0f9 100644 --- a/ui/source/i18n/ui.datepicker-no.js +++ b/ui/source/i18n/ui.datepicker-no.js @@ -1,23 +1,23 @@ -/* Norwegian initialisation for the jQuery UI date picker plugin. */
-/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */
-
-$(document).ready(function(){
- $.datepicker.regional['no'] = {clearText: 'Tøm', clearStatus: '',
- closeText: 'Lukk', closeStatus: '',
- prevText: '«Forrige', prevStatus: '',
- nextText: 'Neste»', nextStatus: '',
- currentText: 'I dag', currentStatus: '',
- monthNames: ['Januar','Februar','Mars','April','Mai','Juni',
- 'Juli','August','September','Oktober','November','Desember'],
- monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun',
- 'Jul','Aug','Sep','Okt','Nov','Des'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Uke', weekStatus: '',
- dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'],
- dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'],
- dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'yy-mm-dd', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['no']);
-});
+/* Norwegian initialisation for the jQuery UI date picker plugin. */ +/* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ + +$(document).ready(function(){ + $.datepicker.regional['no'] = {clearText: 'Tøm', clearStatus: '', + closeText: 'Lukk', closeStatus: '', + prevText: '«Forrige', prevStatus: '', + nextText: 'Neste»', nextStatus: '', + currentText: 'I dag', currentStatus: '', + monthNames: ['Januar','Februar','Mars','April','Mai','Juni', + 'Juli','August','September','Oktober','November','Desember'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun', + 'Jul','Aug','Sep','Okt','Nov','Des'], + monthStatus: '', yearStatus: '', + weekHeader: 'Uke', weekStatus: '', + dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], + dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], + dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['no']); +}); diff --git a/ui/source/i18n/ui.datepicker-pl.js b/ui/source/i18n/ui.datepicker-pl.js index 14b6c3a45..bb3112d96 100644 --- a/ui/source/i18n/ui.datepicker-pl.js +++ b/ui/source/i18n/ui.datepicker-pl.js @@ -1,22 +1,22 @@ -/* Polish initialisation for the jQuery UI date picker plugin. */
-/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['pl'] = {clearText: 'Wyczyść', clearStatus: 'Wyczyść obecną datę',
- closeText: 'Zamknij', closeStatus: 'Zamknij bez zapisywania',
- prevText: '<Poprzedni', prevStatus: 'Pokaż poprzedni miesiąc',
- nextText: 'Następny>', nextStatus: 'Pokaż następny miesiąc',
- currentText: 'Dziś', currentStatus: 'Pokaż aktualny miesiąc',
- monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
- 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
- monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
- 'Lip','Sie','Wrz','Pa','Lis','Gru'],
- monthStatus: 'Pokaż inny miesiąc', yearStatus: 'Pokaż inny rok',
- weekHeader: 'Tydz', weekStatus: 'Tydzień roku',
- dayNames: ['Niedziela','Poniedzialek','Wtorek','Åšroda','Czwartek','PiÄ…tek','Sobota'],
- dayNamesShort: ['Nie','Pn','Wt','Åšr','Czw','Pt','So'],
- dayNamesMin: ['N','Pn','Wt','Åšr','Cz','Pt','So'],
- dayStatus: 'Ustaw DD jako pierwszy dzień tygodnia', dateStatus: 'Wybierz D, M d',
- dateFormat: 'yy-mm-dd', firstDay: 1,
- initStatus: 'Wybierz datÄ™', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['pl']);
-});
+/* Polish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pl'] = {clearText: 'Wyczyść', clearStatus: 'Wyczyść obecną datę', + closeText: 'Zamknij', closeStatus: 'Zamknij bez zapisywania', + prevText: '<Poprzedni', prevStatus: 'Pokaż poprzedni miesiąc', + nextText: 'Następny>', nextStatus: 'Pokaż następny miesiąc', + currentText: 'Dziś', currentStatus: 'Pokaż aktualny miesiąc', + monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', + 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], + monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', + 'Lip','Sie','Wrz','Pa','Lis','Gru'], + monthStatus: 'Pokaż inny miesiąc', yearStatus: 'Pokaż inny rok', + weekHeader: 'Tydz', weekStatus: 'Tydzień roku', + dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'], + dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], + dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], + dayStatus: 'Ustaw DD jako pierwszy dzień tygodnia', dateStatus: 'Wybierz D, M d', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: 'Wybierz datę', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['pl']); +}); diff --git a/ui/source/i18n/ui.datepicker-pt-BR.js b/ui/source/i18n/ui.datepicker-pt-BR.js index 6b6f9e746..457341983 100644 --- a/ui/source/i18n/ui.datepicker-pt-BR.js +++ b/ui/source/i18n/ui.datepicker-pt-BR.js @@ -1,22 +1,22 @@ -/* Brazilian initialisation for the jQuery UI date picker plugin. */
-/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['pt-BR'] = {clearText: 'Limpar', clearStatus: '',
- closeText: 'Fechar', closeStatus: '',
- prevText: '<Anterior', prevStatus: '',
- nextText: 'Próximo>', nextStatus: '',
- currentText: 'Hoje', currentStatus: '',
- monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
- 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
- monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
- 'Jul','Ago','Set','Out','Nov','Dez'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Sm', weekStatus: '',
- dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'],
- dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
- dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['pt-BR']);
+/* Brazilian initialisation for the jQuery UI date picker plugin. */ +/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pt-BR'] = {clearText: 'Limpar', clearStatus: '', + closeText: 'Fechar', closeStatus: '', + prevText: '<Anterior', prevStatus: '', + nextText: 'Próximo>', nextStatus: '', + currentText: 'Hoje', currentStatus: '', + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', + 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', + 'Jul','Ago','Set','Out','Nov','Dez'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], + dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['pt-BR']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-ro.js b/ui/source/i18n/ui.datepicker-ro.js index bdbef2a2d..5902596af 100644 --- a/ui/source/i18n/ui.datepicker-ro.js +++ b/ui/source/i18n/ui.datepicker-ro.js @@ -1,22 +1,22 @@ -/* Romanian initialisation for the jQuery UI date picker plugin. */
-/* Written by Edmond L. (ll_edmond@walla.com). */
-jQuery(function($){
- $.datepicker.regional['ro'] = {clearText: 'Curat', clearStatus: 'Sterge data curenta',
- closeText: 'Inchide', closeStatus: 'Inchide fara schimbare',
- prevText: '<Anterior', prevStatus: 'Arata luna trecuta',
- nextText: 'Urmator>', nextStatus: 'Arata luna urmatoare',
- currentText: 'Azi', currentStatus: 'Arata luna curenta',
- monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Junie',
- 'Julie','August','Septembrie','Octobrie','Noiembrie','Decembrie'],
- monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Noi', 'Dec'],
- monthStatus: 'Arata o luna diferita', yearStatus: 'Arat un an diferit',
- weekHeader: 'Sapt', weekStatus: 'Saptamana anului',
- dayNames: ['Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'],
- dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'],
- dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sa'],
- dayStatus: 'Seteaza DD ca prima saptamana zi', dateStatus: 'Selecteaza D, M d',
- dateFormat: 'mm/dd/yy', firstDay: 0,
- initStatus: 'Selecteaza o data', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['ro']);
-});
+/* Romanian initialisation for the jQuery UI date picker plugin. */ +/* Written by Edmond L. (ll_edmond@walla.com). */ +jQuery(function($){ + $.datepicker.regional['ro'] = {clearText: 'Curat', clearStatus: 'Sterge data curenta', + closeText: 'Inchide', closeStatus: 'Inchide fara schimbare', + prevText: '<Anterior', prevStatus: 'Arata luna trecuta', + nextText: 'Urmator>', nextStatus: 'Arata luna urmatoare', + currentText: 'Azi', currentStatus: 'Arata luna curenta', + monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Junie', + 'Julie','August','Septembrie','Octobrie','Noiembrie','Decembrie'], + monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Noi', 'Dec'], + monthStatus: 'Arata o luna diferita', yearStatus: 'Arat un an diferit', + weekHeader: 'Sapt', weekStatus: 'Saptamana anului', + dayNames: ['Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'], + dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'], + dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sa'], + dayStatus: 'Seteaza DD ca prima saptamana zi', dateStatus: 'Selecteaza D, M d', + dateFormat: 'mm/dd/yy', firstDay: 0, + initStatus: 'Selecteaza o data', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ro']); +}); diff --git a/ui/source/i18n/ui.datepicker-ru.js b/ui/source/i18n/ui.datepicker-ru.js index 0b693b9f9..1b6518c50 100644 --- a/ui/source/i18n/ui.datepicker-ru.js +++ b/ui/source/i18n/ui.datepicker-ru.js @@ -1,22 +1,22 @@ -/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
-/* Written by Andrew Stromnov (stromnov@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['ru'] = {clearText: 'ОчиÑтить', clearStatus: '',
- closeText: 'Закрыть', closeStatus: '',
- prevText: '<Пред', prevStatus: '',
- nextText: 'След>', nextStatus: '',
- currentText: 'СегоднÑ', currentStatus: '',
- monthNames: ['Январь','Февраль','Март','Ðпрель','Май','Июнь',
- 'Июль','ÐвгуÑÑ‚','СентÑбрь','ОктÑбрь','ÐоÑбрь','Декабрь'],
- monthNamesShort: ['Янв','Фев','Мар','Ðпр','Май','Июн',
- 'Июл','Ðвг','Сен','Окт','ÐоÑ','Дек'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Ðе', weekStatus: '',
- dayNames: ['воÑкреÑенье','понедельник','вторник','Ñреда','четверг','пÑтница','Ñуббота'],
- dayNamesShort: ['вÑк','пнд','втр','Ñрд','чтв','птн','Ñбт'],
- dayNamesMin: ['Ð’Ñ','Пн','Ð’Ñ‚','Ср','Чт','Пт','Сб'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['ru']);
+/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Andrew Stromnov (stromnov@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ru'] = {clearText: 'ОчиÑтить', clearStatus: '', + closeText: 'Закрыть', closeStatus: '', + prevText: '<Пред', prevStatus: '', + nextText: 'След>', nextStatus: '', + currentText: 'СегоднÑ', currentStatus: '', + monthNames: ['Январь','Февраль','Март','Ðпрель','Май','Июнь', + 'Июль','ÐвгуÑÑ‚','СентÑбрь','ОктÑбрь','ÐоÑбрь','Декабрь'], + monthNamesShort: ['Янв','Фев','Мар','Ðпр','Май','Июн', + 'Июл','Ðвг','Сен','Окт','ÐоÑ','Дек'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ðе', weekStatus: '', + dayNames: ['воÑкреÑенье','понедельник','вторник','Ñреда','четверг','пÑтница','Ñуббота'], + dayNamesShort: ['вÑк','пнд','втр','Ñрд','чтв','птн','Ñбт'], + dayNamesMin: ['Ð’Ñ','Пн','Ð’Ñ‚','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ru']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-sk.js b/ui/source/i18n/ui.datepicker-sk.js index c130d4b57..c486fd7bb 100644 --- a/ui/source/i18n/ui.datepicker-sk.js +++ b/ui/source/i18n/ui.datepicker-sk.js @@ -1,22 +1,22 @@ -/* Slovak initialisation for the jQuery UI date picker plugin. */
-/* Written by Vojtech Rinik (vojto@hmm.sk). */
-jQuery(function($){
- $.datepicker.regional['sk'] = {clearText: 'Zmazať', clearStatus: '',
- closeText: 'Zavrieť', closeStatus: '',
- prevText: '<Predchádzajúci', prevStatus: '',
- nextText: 'Nasledujúci>', nextStatus: '',
- currentText: 'Dnes', currentStatus: '',
- monthNames: ['Január','Február','Marec','AprÃl','Máj','Jún',
- 'Júl','August','September','Október','November','December'],
- monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
- 'Júl','Aug','Sep','Okt','Nov','Dec'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Ty', weekStatus: '',
- dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Å tvrtok','Piatok','Sobota'],
- dayNamesShort: ['Ned','Pon','Uto','Str','Å tv','Pia','Sob'],
- dayNamesMin: ['Ne','Po','Ut','St','Å t','Pia','So'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['sk']);
-});
+/* Slovak initialisation for the jQuery UI date picker plugin. */ +/* Written by Vojtech Rinik (vojto@hmm.sk). */ +jQuery(function($){ + $.datepicker.regional['sk'] = {clearText: 'ZmazaÅ¥', clearStatus: '', + closeText: 'ZavrieÅ¥', closeStatus: '', + prevText: '<Predchádzajúci', prevStatus: '', + nextText: 'Nasledujúci>', nextStatus: '', + currentText: 'Dnes', currentStatus: '', + monthNames: ['Január','Február','Marec','AprÃl','Máj','Jún', + 'Júl','August','September','Október','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', + 'Júl','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ty', weekStatus: '', + dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Å tvrtok','Piatok','Sobota'], + dayNamesShort: ['Ned','Pon','Uto','Str','Å tv','Pia','Sob'], + dayNamesMin: ['Ne','Po','Ut','St','Å t','Pia','So'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sk']); +}); diff --git a/ui/source/i18n/ui.datepicker-sv.js b/ui/source/i18n/ui.datepicker-sv.js index fac2e51a6..87befa260 100644 --- a/ui/source/i18n/ui.datepicker-sv.js +++ b/ui/source/i18n/ui.datepicker-sv.js @@ -1,22 +1,22 @@ -/* Swedish initialisation for the jQuery UI date picker plugin. */
-/* Written by Anders Ekdahl ( anders@nomadiz.se). */
-jQuery(function($){
- $.datepicker.regional['sv'] = {clearText: 'Rensa', clearStatus: '',
- closeText: 'Stäng', closeStatus: '',
- prevText: '«Förra', prevStatus: '',
- nextText: 'Nästa»', nextStatus: '',
- currentText: 'Idag', currentStatus: '',
- monthNames: ['Januari','Februari','Mars','April','Maj','Juni',
- 'Juli','Augusti','September','Oktober','November','December'],
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
- 'Jul','Aug','Sep','Okt','Nov','Dec'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Ve', weekStatus: '',
- dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'],
- dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'],
- dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'yy-mm-dd', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['sv']);
-});
+/* Swedish initialisation for the jQuery UI date picker plugin. */ +/* Written by Anders Ekdahl ( anders@nomadiz.se). */ +jQuery(function($){ + $.datepicker.regional['sv'] = {clearText: 'Rensa', clearStatus: '', + closeText: 'Stäng', closeStatus: '', + prevText: '«Förra', prevStatus: '', + nextText: 'Nästa»', nextStatus: '', + currentText: 'Idag', currentStatus: '', + monthNames: ['Januari','Februari','Mars','April','Maj','Juni', + 'Juli','Augusti','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aug','Sep','Okt','Nov','Dec'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ve', weekStatus: '', + dayNamesShort: ['Sön','MÃ¥n','Tis','Ons','Tor','Fre','Lör'], + dayNames: ['Söndag','MÃ¥ndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'], + dayNamesMin: ['Sö','MÃ¥','Ti','On','To','Fr','Lö'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'yy-mm-dd', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['sv']); +}); diff --git a/ui/source/i18n/ui.datepicker-th.js b/ui/source/i18n/ui.datepicker-th.js index 312f70585..cfbf0ccc7 100644 --- a/ui/source/i18n/ui.datepicker-th.js +++ b/ui/source/i18n/ui.datepicker-th.js @@ -1,22 +1,22 @@ -/* Thai initialisation for the jQuery UI date picker plugin. */
-/* Written by pipo (pipo@sixhead.com). */
-jQuery(function($){
- $.datepicker.regional['th'] = {clearText: 'ลบ', clearStatus: '',
- closeText: 'ปิด', closeStatus: '',
- prevText: '« ย้à¸à¸™', prevStatus: '',
- nextText: 'ถัดไป »', nextStatus: '',
- currentText: 'วันนี้', currentStatus: '',
- monthNames: ['มà¸à¸£à¸²à¸„ม','à¸à¸¸à¸¡à¸ าพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน',
- 'à¸à¸£à¸à¸à¸²à¸„ม','สิงหาคม','à¸à¸±à¸™à¸¢à¸²à¸¢à¸™','ตุลาคม','พฤศจิà¸à¸²à¸¢à¸™','ธันวาคม'],
- monthNamesShort: ['ม.ค.','à¸.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.',
- 'à¸.ค.','ส.ค.','à¸.ย.','ต.ค.','พ.ย.','ธ.ค.'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Sm', weekStatus: '',
- dayNames: ['à¸à¸²à¸—ิตย์','จันทร์','à¸à¸±à¸‡à¸„าร','พุธ','พฤหัสบดี','ศุà¸à¸£à¹Œ','เสาร์'],
- dayNamesShort: ['à¸à¸².','จ.','à¸.','พ.','พฤ.','ศ.','ส.'],
- dayNamesMin: ['à¸à¸².','จ.','à¸.','พ.','พฤ.','ศ.','ส.'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['th']);
+/* Thai initialisation for the jQuery UI date picker plugin. */ +/* Written by pipo (pipo@sixhead.com). */ +jQuery(function($){ + $.datepicker.regional['th'] = {clearText: 'ลบ', clearStatus: '', + closeText: 'ปิด', closeStatus: '', + prevText: '« ย้à¸à¸™', prevStatus: '', + nextText: 'ถัดไป »', nextStatus: '', + currentText: 'วันนี้', currentStatus: '', + monthNames: ['มà¸à¸£à¸²à¸„ม','à¸à¸¸à¸¡à¸ าพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', + 'à¸à¸£à¸à¸à¸²à¸„ม','สิงหาคม','à¸à¸±à¸™à¸¢à¸²à¸¢à¸™','ตุลาคม','พฤศจิà¸à¸²à¸¢à¸™','ธันวาคม'], + monthNamesShort: ['ม.ค.','à¸.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', + 'à¸.ค.','ส.ค.','à¸.ย.','ต.ค.','พ.ย.','ธ.ค.'], + monthStatus: '', yearStatus: '', + weekHeader: 'Sm', weekStatus: '', + dayNames: ['à¸à¸²à¸—ิตย์','จันทร์','à¸à¸±à¸‡à¸„าร','พุธ','พฤหัสบดี','ศุà¸à¸£à¹Œ','เสาร์'], + dayNamesShort: ['à¸à¸².','จ.','à¸.','พ.','พฤ.','ศ.','ส.'], + dayNamesMin: ['à¸à¸².','จ.','à¸.','พ.','พฤ.','ศ.','ส.'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['th']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-tr.js b/ui/source/i18n/ui.datepicker-tr.js index 5b4c3cd1c..80670d14b 100644 --- a/ui/source/i18n/ui.datepicker-tr.js +++ b/ui/source/i18n/ui.datepicker-tr.js @@ -1,22 +1,22 @@ -/* Turkish initialisation for the jQuery UI date picker plugin. */
-/* Written by Izzet Emre Erkan (kara@karalamalar.net). */
-jQuery(function($){
- $.datepicker.regional['tr'] = {clearText: 'temizle', clearStatus: 'geçerli tarihi temizler',
- closeText: 'kapat', closeStatus: 'sadece göstergeyi kapat',
- prevText: '<geri', prevStatus: 'önceki ayı göster',
- nextText: 'ileri>', nextStatus: 'sonraki ayı göster',
- currentText: 'bugün', currentStatus: '',
- monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran',
- 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
- monthNamesShort: ['Oca','Åžub','Mar','Nis','May','Haz',
- 'Tem','AÄŸu','Eyl','Eki','Kas','Ara'],
- monthStatus: 'başka ay', yearStatus: 'başka yıl',
- weekHeader: 'Hf', weekStatus: 'Ayın haftaları',
- dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'],
- dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
- dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'],
- dayStatus: 'Haftanın ilk gününü belirleyin', dateStatus: 'D, M d seçiniz',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: 'Bir tarih seçiniz', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['tr']);
+/* Turkish initialisation for the jQuery UI date picker plugin. */ +/* Written by Izzet Emre Erkan (kara@karalamalar.net). */ +jQuery(function($){ + $.datepicker.regional['tr'] = {clearText: 'temizle', clearStatus: 'geçerli tarihi temizler', + closeText: 'kapat', closeStatus: 'sadece göstergeyi kapat', + prevText: '<geri', prevStatus: 'önceki ayı göster', + nextText: 'ileri>', nextStatus: 'sonraki ayı göster', + currentText: 'bugün', currentStatus: '', + monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', + 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], + monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', + 'Tem','Ağu','Eyl','Eki','Kas','Ara'], + monthStatus: 'başka ay', yearStatus: 'başka yıl', + weekHeader: 'Hf', weekStatus: 'Ayın haftaları', + dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], + dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], + dayStatus: 'Haftanın ilk gününü belirleyin', dateStatus: 'D, M d seçiniz', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: 'Bir tarih seçiniz', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['tr']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-ua.js b/ui/source/i18n/ui.datepicker-ua.js index 86db42122..f233c6395 100644 --- a/ui/source/i18n/ui.datepicker-ua.js +++ b/ui/source/i18n/ui.datepicker-ua.js @@ -1,22 +1,22 @@ -/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
-/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['ua'] = {clearText: 'ОчиÑтити', clearStatus: '',
- closeText: 'Закрити', closeStatus: '',
- prevText: '<<', prevStatus: '',
- nextText: '>>', nextStatus: '',
- currentText: 'Сьогодні', currentStatus: '',
- monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
- 'Липень','Серпень','ВереÑень','Жовтень','ЛиÑтопад','Грудень'],
- monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
- 'Лип','Сер','Вер','Жов','ЛиÑ','Гру'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Ðе', weekStatus: '',
- dayNames: ['неділÑ','понеділок','вівторок','Ñереда','четвер','пÑтницÑ','Ñуббота'],
- dayNamesShort: ['нед','пнд','вів','Ñрд','чтв','птн','Ñбт'],
- dayNamesMin: ['Ðд','Пн','Ð’Ñ‚','Ср','Чт','Пт','Сб'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['ua']);
+/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ua'] = {clearText: 'ОчиÑтити', clearStatus: '', + closeText: 'Закрити', closeStatus: '', + prevText: '<<', prevStatus: '', + nextText: '>>', nextStatus: '', + currentText: 'Сьогодні', currentStatus: '', + monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', + 'Липень','Серпень','ВереÑень','Жовтень','ЛиÑтопад','Грудень'], + monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', + 'Лип','Сер','Вер','Жов','ЛиÑ','Гру'], + monthStatus: '', yearStatus: '', + weekHeader: 'Ðе', weekStatus: '', + dayNames: ['неділÑ','понеділок','вівторок','Ñереда','четвер','пÑтницÑ','Ñуббота'], + dayNamesShort: ['нед','пнд','вів','Ñрд','чтв','птн','Ñбт'], + dayNamesMin: ['Ðд','Пн','Ð’Ñ‚','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['ua']); });
\ No newline at end of file diff --git a/ui/source/i18n/ui.datepicker-zh-CN.js b/ui/source/i18n/ui.datepicker-zh-CN.js index c8c28f0c2..05dad7244 100644 --- a/ui/source/i18n/ui.datepicker-zh-CN.js +++ b/ui/source/i18n/ui.datepicker-zh-CN.js @@ -1,22 +1,22 @@ -/* Chinese initialisation for the jQuery UI date picker plugin. */
-/* Written by Cloudream (cloudream@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['zh-CN'] = {clearText: '清除', clearStatus: '清除已选日期',
- closeText: 'å…³é—', closeStatus: '䏿”¹å˜å½“å‰é€‰æ‹©',
- prevText: '<上月', prevStatus: '显示上月',
- nextText: '下月>', nextStatus: '显示下月',
- currentText: '今天', currentStatus: '显示本月',
- monthNames: ['一月','二月','三月','四月','五月','å…æœˆ',
- '七月','八月','乿œˆ','åæœˆ','å一月','å二月'],
- monthNamesShort: ['一','二','三','å››','五','å…',
- '七','å…«','ä¹','å','å一','å二'],
- monthStatus: '选择月份', yearStatus: '选择年份',
- weekHeader: '周', weekStatus: '年内周次',
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期å…'],
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周å…'],
- dayNamesMin: ['æ—¥','一','二','三','å››','五','å…'],
- dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD',
- dateFormat: 'yy-mm-dd', firstDay: 1,
- initStatus: '请选择日期', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
-});
+/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Cloudream (cloudream@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-CN'] = {clearText: '清除', clearStatus: '清除已选日期', + closeText: 'å…³é—', closeStatus: '䏿”¹å˜å½“å‰é€‰æ‹©', + prevText: '<上月', prevStatus: '显示上月', + nextText: '下月>', nextStatus: '显示下月', + currentText: '今天', currentStatus: '显示本月', + monthNames: ['一月','二月','三月','四月','五月','å…æœˆ', + '七月','八月','乿œˆ','åæœˆ','å一月','å二月'], + monthNamesShort: ['一','二','三','å››','五','å…', + '七','å…«','ä¹','å','å一','å二'], + monthStatus: '选择月份', yearStatus: '选择年份', + weekHeader: '周', weekStatus: '年内周次', + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期å…'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周å…'], + dayNamesMin: ['æ—¥','一','二','三','å››','五','å…'], + dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 dæ—¥, DD', + dateFormat: 'yy-mm-dd', firstDay: 1, + initStatus: '请选择日期', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['zh-CN']); +}); diff --git a/ui/source/i18n/ui.datepicker-zh-TW.js b/ui/source/i18n/ui.datepicker-zh-TW.js index 929626c30..d1bca8d04 100644 --- a/ui/source/i18n/ui.datepicker-zh-TW.js +++ b/ui/source/i18n/ui.datepicker-zh-TW.js @@ -1,23 +1,23 @@ -/* Chinese initialisation for the jQuery UI date picker plugin. */
-/* Written by Ressol (ressol@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['zh-TW'] = {
- clearText: '清除', clearStatus: 'æ¸…é™¤å·²é¸æ—¥æœŸ',
- closeText: '關閉', closeStatus: '䏿”¹è®Šç›®å‰çš„鏿“‡',
- prevText: '<上月', prevStatus: '顯示上月',
- nextText: '下月>', nextStatus: '顯示下月',
- currentText: '今天', currentStatus: '顯示本月',
- monthNames: ['一月','二月','三月','四月','五月','å…æœˆ',
- '七月','八月','乿œˆ','åæœˆ','å一月','å二月'],
- monthNamesShort: ['一','二','三','å››','五','å…',
- '七','å…«','ä¹','å','å一','å二'],
- monthStatus: '鏿“‡æœˆä»½', yearStatus: '鏿“‡å¹´ä»½',
- weekHeader: '周', weekStatus: '年內周次',
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期å…'],
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周å…'],
- dayNamesMin: ['æ—¥','一','二','三','å››','五','å…'],
- dayStatus: 'è¨å®š DD 為一周起始', dateStatus: '鏿“‡ m月 dæ—¥, DD',
- dateFormat: 'yy/mm/dd', firstDay: 1,
- initStatus: 'è«‹é¸æ“‡æ—¥æœŸ', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['zh-TW']);
-});
+/* Chinese initialisation for the jQuery UI date picker plugin. */ +/* Written by Ressol (ressol@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['zh-TW'] = { + clearText: '清除', clearStatus: 'æ¸…é™¤å·²é¸æ—¥æœŸ', + closeText: '關閉', closeStatus: '䏿”¹è®Šç›®å‰çš„鏿“‡', + prevText: '<上月', prevStatus: '顯示上月', + nextText: '下月>', nextStatus: '顯示下月', + currentText: '今天', currentStatus: '顯示本月', + monthNames: ['一月','二月','三月','四月','五月','å…æœˆ', + '七月','八月','乿œˆ','åæœˆ','å一月','å二月'], + monthNamesShort: ['一','二','三','å››','五','å…', + '七','å…«','ä¹','å','å一','å二'], + monthStatus: '鏿“‡æœˆä»½', yearStatus: '鏿“‡å¹´ä»½', + weekHeader: '周', weekStatus: '年內周次', + dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期å…'], + dayNamesShort: ['周日','周一','周二','周三','周四','周五','周å…'], + dayNamesMin: ['æ—¥','一','二','三','å››','五','å…'], + dayStatus: 'è¨å®š DD 為一周起始', dateStatus: '鏿“‡ m月 dæ—¥, DD', + dateFormat: 'yy/mm/dd', firstDay: 1, + initStatus: 'è«‹é¸æ“‡æ—¥æœŸ', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['zh-TW']); +}); diff --git a/ui/source/ui.accordion.js b/ui/source/ui.accordion.js index bf46714f6..0e4b04d2b 100644 --- a/ui/source/ui.accordion.js +++ b/ui/source/ui.accordion.js @@ -1,302 +1,302 @@ -/*
- * jQuery UI Accordion
- *
- * Copyright (c) 2007, 2008 Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Accordion
- *
- * Depends:
- * ui.core.js
- *
- * Revision: $Id: ui.accordion.js 5656 2008-05-21 19:35:33Z braeker $
- */
-;(function($) {
-
-$.widget("ui.accordion", {
- init: function() {
- var options = this.options;
-
- if ( options.navigation ) {
- var current = this.element.find("a").filter(options.navigationFilter);
- if ( current.length ) {
- if ( current.filter(options.header).length ) {
- options.active = current;
- } else {
- options.active = current.parent().parent().prev();
- current.addClass("current");
- }
- }
- }
-
- // calculate active if not specified, using the first header
- options.headers = this.element.find(options.header);
- options.active = findActive(options.headers, options.active);
-
- // IE7-/Win - Extra vertical space in Lists fixed
- if ($.browser.msie) {
- this.element.find('a').css('zoom', '1');
- }
-
- if (!this.element.hasClass("ui-accordion")) {
- this.element.addClass("ui-accordion");
- $("<span class='ui-accordion-left'/>").insertBefore(options.headers);
- $("<span class='ui-accordion-right'/>").appendTo(options.headers);
- options.headers.addClass("ui-accordion-header").attr("tabindex", "0");
- }
-
- var maxHeight;
- if ( options.fillSpace ) {
- maxHeight = this.element.parent().height();
- options.headers.each(function() {
- maxHeight -= $(this).outerHeight();
- });
- var maxPadding = 0;
- options.headers.next().each(function() {
- maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
- }).height(maxHeight - maxPadding);
- } else if ( options.autoHeight ) {
- maxHeight = 0;
- options.headers.next().each(function() {
- maxHeight = Math.max(maxHeight, $(this).outerHeight());
- }).height(maxHeight);
- }
-
- options.headers
- .not(options.active || "")
- .next()
- .hide();
- options.active.parent().andSelf().addClass(options.selectedClass);
-
- if (options.event) {
- this.element.bind((options.event) + ".accordion", clickHandler);
- }
- },
- activate: function(index) {
- // call clickHandler with custom event
- clickHandler.call(this.element[0], {
- target: findActive( this.options.headers, index )[0]
- });
- },
- destroy: function() {
- this.options.headers.next().css("display", "");
- if ( this.options.fillSpace || this.options.autoHeight ) {
- this.options.headers.next().css("height", "");
- }
- $.removeData(this.element[0], "accordion");
- this.element.removeClass("ui-accordion").unbind(".accordion");
- }
-});
-
-function scopeCallback(callback, scope) {
- return function() {
- return callback.apply(scope, arguments);
- };
-};
-
-function completed(cancel) {
- // if removed while animated data can be empty
- if (!$.data(this, "accordion")) {
- return;
- }
-
- var instance = $.data(this, "accordion");
- var options = instance.options;
- options.running = cancel ? 0 : --options.running;
- if ( options.running ) {
- return;
- }
- if ( options.clearStyle ) {
- options.toShow.add(options.toHide).css({
- height: "",
- overflow: ""
- });
- }
- $(this).triggerHandler("accordionchange", [options.data], options.change);
-}
-
-function toggle(toShow, toHide, data, clickedActive, down) {
- var options = $.data(this, "accordion").options;
- options.toShow = toShow;
- options.toHide = toHide;
- options.data = data;
- var complete = scopeCallback(completed, this);
-
- // count elements to animate
- options.running = toHide.size() === 0 ? toShow.size() : toHide.size();
-
- if ( options.animated ) {
- if ( !options.alwaysOpen && clickedActive ) {
- $.ui.accordion.animations[options.animated]({
- toShow: jQuery([]),
- toHide: toHide,
- complete: complete,
- down: down,
- autoHeight: options.autoHeight
- });
- } else {
- $.ui.accordion.animations[options.animated]({
- toShow: toShow,
- toHide: toHide,
- complete: complete,
- down: down,
- autoHeight: options.autoHeight
- });
- }
- } else {
- if ( !options.alwaysOpen && clickedActive ) {
- toShow.toggle();
- } else {
- toHide.hide();
- toShow.show();
- }
- complete(true);
- }
-}
-
-function clickHandler(event) {
- var options = $.data(this, "accordion").options;
- if (options.disabled) {
- return false;
- }
-
- // called only when using activate(false) to close all parts programmatically
- if ( !event.target && !options.alwaysOpen ) {
- options.active.parent().andSelf().toggleClass(options.selectedClass);
- var toHide = options.active.next(),
- data = {
- instance: this,
- options: options,
- newHeader: jQuery([]),
- oldHeader: options.active,
- newContent: jQuery([]),
- oldContent: toHide
- },
- toShow = (options.active = $([]));
- toggle.call(this, toShow, toHide, data );
- return false;
- }
- // get the click target
- var clicked = $(event.target);
-
- // due to the event delegation model, we have to check if one
- // of the parent elements is our actual header, and find that
- if ( clicked.parents(options.header).length ) {
- while ( !clicked.is(options.header) ) {
- clicked = clicked.parent();
- }
- }
-
- var clickedActive = clicked[0] == options.active[0];
-
- // if animations are still active, or the active header is the target, ignore click
- if (options.running || (options.alwaysOpen && clickedActive)) {
- return false;
- }
- if (!clicked.is(options.header)) {
- return;
- }
-
- // switch classes
- options.active.parent().andSelf().toggleClass(options.selectedClass);
- if ( !clickedActive ) {
- clicked.parent().andSelf().addClass(options.selectedClass);
- }
-
- // find elements to show and hide
- var toShow = clicked.next(),
- toHide = options.active.next(),
- //data = [clicked, options.active, toShow, toHide],
- data = {
- instance: this,
- options: options,
- newHeader: clicked,
- oldHeader: options.active,
- newContent: toShow,
- oldContent: toHide
- },
- down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] );
-
- options.active = clickedActive ? $([]) : clicked;
- toggle.call(this, toShow, toHide, data, clickedActive, down );
-
- return false;
-};
-
-function findActive(headers, selector) {
- return selector != undefined
- ? typeof selector == "number"
- ? headers.filter(":eq(" + selector + ")")
- : headers.not(headers.not(selector))
- : selector === false
- ? $([])
- : headers.filter(":eq(0)");
-}
-
-$.extend($.ui.accordion, {
- defaults: {
- selectedClass: "selected",
- alwaysOpen: true,
- animated: 'slide',
- event: "click",
- header: "a",
- autoHeight: true,
- running: 0,
- navigationFilter: function() {
- return this.href.toLowerCase() == location.href.toLowerCase();
- }
- },
- animations: {
- slide: function(options, additions) {
- options = $.extend({
- easing: "swing",
- duration: 300
- }, options, additions);
- if ( !options.toHide.size() ) {
- options.toShow.animate({height: "show"}, options);
- return;
- }
- var hideHeight = options.toHide.height(),
- showHeight = options.toShow.height(),
- difference = showHeight / hideHeight;
- options.toShow.css({ height: 0, overflow: 'hidden' }).show();
- options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{
- step: function(now) {
- var current = (hideHeight - now) * difference;
- if ($.browser.msie || $.browser.opera) {
- current = Math.ceil(current);
- }
- options.toShow.height( current );
- },
- duration: options.duration,
- easing: options.easing,
- complete: function() {
- if ( !options.autoHeight ) {
- options.toShow.css("height", "auto");
- }
- options.complete();
- }
- });
- },
- bounceslide: function(options) {
- this.slide(options, {
- easing: options.down ? "bounceout" : "swing",
- duration: options.down ? 1000 : 200
- });
- },
- easeslide: function(options) {
- this.slide(options, {
- easing: "easeinout",
- duration: 700
- });
- }
- }
-});
-
-// deprecated, use accordion("activate", index) instead
-$.fn.activate = function(index) {
- return this.accordion("activate", index);
-};
-
-})(jQuery);
+/* + * jQuery UI Accordion + * + * Copyright (c) 2007, 2008 Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Accordion + * + * Depends: + * ui.core.js + * + * Revision: $Id: ui.accordion.js 5656 2008-05-21 19:35:33Z braeker $ + */ +;(function($) { + +$.widget("ui.accordion", { + init: function() { + var options = this.options; + + if ( options.navigation ) { + var current = this.element.find("a").filter(options.navigationFilter); + if ( current.length ) { + if ( current.filter(options.header).length ) { + options.active = current; + } else { + options.active = current.parent().parent().prev(); + current.addClass("current"); + } + } + } + + // calculate active if not specified, using the first header + options.headers = this.element.find(options.header); + options.active = findActive(options.headers, options.active); + + // IE7-/Win - Extra vertical space in Lists fixed + if ($.browser.msie) { + this.element.find('a').css('zoom', '1'); + } + + if (!this.element.hasClass("ui-accordion")) { + this.element.addClass("ui-accordion"); + $("<span class='ui-accordion-left'/>").insertBefore(options.headers); + $("<span class='ui-accordion-right'/>").appendTo(options.headers); + options.headers.addClass("ui-accordion-header").attr("tabindex", "0"); + } + + var maxHeight; + if ( options.fillSpace ) { + maxHeight = this.element.parent().height(); + options.headers.each(function() { + maxHeight -= $(this).outerHeight(); + }); + var maxPadding = 0; + options.headers.next().each(function() { + maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height()); + }).height(maxHeight - maxPadding); + } else if ( options.autoHeight ) { + maxHeight = 0; + options.headers.next().each(function() { + maxHeight = Math.max(maxHeight, $(this).outerHeight()); + }).height(maxHeight); + } + + options.headers + .not(options.active || "") + .next() + .hide(); + options.active.parent().andSelf().addClass(options.selectedClass); + + if (options.event) { + this.element.bind((options.event) + ".accordion", clickHandler); + } + }, + activate: function(index) { + // call clickHandler with custom event + clickHandler.call(this.element[0], { + target: findActive( this.options.headers, index )[0] + }); + }, + destroy: function() { + this.options.headers.next().css("display", ""); + if ( this.options.fillSpace || this.options.autoHeight ) { + this.options.headers.next().css("height", ""); + } + $.removeData(this.element[0], "accordion"); + this.element.removeClass("ui-accordion").unbind(".accordion"); + } +}); + +function scopeCallback(callback, scope) { + return function() { + return callback.apply(scope, arguments); + }; +}; + +function completed(cancel) { + // if removed while animated data can be empty + if (!$.data(this, "accordion")) { + return; + } + + var instance = $.data(this, "accordion"); + var options = instance.options; + options.running = cancel ? 0 : --options.running; + if ( options.running ) { + return; + } + if ( options.clearStyle ) { + options.toShow.add(options.toHide).css({ + height: "", + overflow: "" + }); + } + $(this).triggerHandler("accordionchange", [options.data], options.change); +} + +function toggle(toShow, toHide, data, clickedActive, down) { + var options = $.data(this, "accordion").options; + options.toShow = toShow; + options.toHide = toHide; + options.data = data; + var complete = scopeCallback(completed, this); + + // count elements to animate + options.running = toHide.size() === 0 ? toShow.size() : toHide.size(); + + if ( options.animated ) { + if ( !options.alwaysOpen && clickedActive ) { + $.ui.accordion.animations[options.animated]({ + toShow: jQuery([]), + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight + }); + } else { + $.ui.accordion.animations[options.animated]({ + toShow: toShow, + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight + }); + } + } else { + if ( !options.alwaysOpen && clickedActive ) { + toShow.toggle(); + } else { + toHide.hide(); + toShow.show(); + } + complete(true); + } +} + +function clickHandler(event) { + var options = $.data(this, "accordion").options; + if (options.disabled) { + return false; + } + + // called only when using activate(false) to close all parts programmatically + if ( !event.target && !options.alwaysOpen ) { + options.active.parent().andSelf().toggleClass(options.selectedClass); + var toHide = options.active.next(), + data = { + instance: this, + options: options, + newHeader: jQuery([]), + oldHeader: options.active, + newContent: jQuery([]), + oldContent: toHide + }, + toShow = (options.active = $([])); + toggle.call(this, toShow, toHide, data ); + return false; + } + // get the click target + var clicked = $(event.target); + + // due to the event delegation model, we have to check if one + // of the parent elements is our actual header, and find that + if ( clicked.parents(options.header).length ) { + while ( !clicked.is(options.header) ) { + clicked = clicked.parent(); + } + } + + var clickedActive = clicked[0] == options.active[0]; + + // if animations are still active, or the active header is the target, ignore click + if (options.running || (options.alwaysOpen && clickedActive)) { + return false; + } + if (!clicked.is(options.header)) { + return; + } + + // switch classes + options.active.parent().andSelf().toggleClass(options.selectedClass); + if ( !clickedActive ) { + clicked.parent().andSelf().addClass(options.selectedClass); + } + + // find elements to show and hide + var toShow = clicked.next(), + toHide = options.active.next(), + //data = [clicked, options.active, toShow, toHide], + data = { + instance: this, + options: options, + newHeader: clicked, + oldHeader: options.active, + newContent: toShow, + oldContent: toHide + }, + down = options.headers.index( options.active[0] ) > options.headers.index( clicked[0] ); + + options.active = clickedActive ? $([]) : clicked; + toggle.call(this, toShow, toHide, data, clickedActive, down ); + + return false; +}; + +function findActive(headers, selector) { + return selector != undefined + ? typeof selector == "number" + ? headers.filter(":eq(" + selector + ")") + : headers.not(headers.not(selector)) + : selector === false + ? $([]) + : headers.filter(":eq(0)"); +} + +$.extend($.ui.accordion, { + defaults: { + selectedClass: "selected", + alwaysOpen: true, + animated: 'slide', + event: "click", + header: "a", + autoHeight: true, + running: 0, + navigationFilter: function() { + return this.href.toLowerCase() == location.href.toLowerCase(); + } + }, + animations: { + slide: function(options, additions) { + options = $.extend({ + easing: "swing", + duration: 300 + }, options, additions); + if ( !options.toHide.size() ) { + options.toShow.animate({height: "show"}, options); + return; + } + var hideHeight = options.toHide.height(), + showHeight = options.toShow.height(), + difference = showHeight / hideHeight; + options.toShow.css({ height: 0, overflow: 'hidden' }).show(); + options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{ + step: function(now) { + var current = (hideHeight - now) * difference; + if ($.browser.msie || $.browser.opera) { + current = Math.ceil(current); + } + options.toShow.height( current ); + }, + duration: options.duration, + easing: options.easing, + complete: function() { + if ( !options.autoHeight ) { + options.toShow.css("height", "auto"); + } + options.complete(); + } + }); + }, + bounceslide: function(options) { + this.slide(options, { + easing: options.down ? "bounceout" : "swing", + duration: options.down ? 1000 : 200 + }); + }, + easeslide: function(options) { + this.slide(options, { + easing: "easeinout", + duration: 700 + }); + } + } +}); + +// deprecated, use accordion("activate", index) instead +$.fn.activate = function(index) { + return this.accordion("activate", index); +}; + +})(jQuery); diff --git a/ui/source/ui.core.js b/ui/source/ui.core.js index 3fe21523d..5fabd9ae8 100644 --- a/ui/source/ui.core.js +++ b/ui/source/ui.core.js @@ -1,277 +1,277 @@ -/*
- * jQuery UI @VERSION
- *
- * Copyright (c) 2008 Paul Bakaus (ui.jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI
- *
- * $Id: ui.core.js 5587 2008-05-13 19:56:42Z scott.gonzalez $
- */
-;(function($) {
-
-$.ui = {
- plugin: {
- add: function(module, option, set) {
- var proto = $.ui[module].prototype;
- for(var i in set) {
- proto.plugins[i] = proto.plugins[i] || [];
- proto.plugins[i].push([option, set[i]]);
- }
- },
- call: function(instance, name, args) {
- var set = instance.plugins[name];
- if(!set) { return; }
-
- for (var i = 0; i < set.length; i++) {
- if (instance.options[set[i][0]]) {
- set[i][1].apply(instance.element, args);
- }
- }
- }
- },
- cssCache: {},
- css: function(name) {
- if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; }
- var tmp = $('<div class="ui-resizable-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body');
-
- //if (!$.browser.safari)
- //tmp.appendTo('body');
-
- //Opera and Safari set width and height to 0px instead of auto
- //Safari returns rgba(0,0,0,0) when bgcolor is not set
- $.ui.cssCache[name] = !!(
- (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) ||
- !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor')))
- );
- try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){}
- return $.ui.cssCache[name];
- },
- disableSelection: function(e) {
- e.unselectable = "on";
- e.onselectstart = function() { return false; };
- if (e.style) { e.style.MozUserSelect = "none"; }
- },
- enableSelection: function(e) {
- e.unselectable = "off";
- e.onselectstart = function() { return true; };
- if (e.style) { e.style.MozUserSelect = ""; }
- },
- hasScroll: function(e, a) {
- var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false;
- if (e[scroll] > 0) return true; e[scroll] = 1;
- has = e[scroll] > 0 ? true : false; e[scroll] = 0;
- return has;
- }
-};
-
-
-/** jQuery core modifications and additions **/
-
-var _remove = $.fn.remove;
-$.fn.remove = function() {
- $("*", this).add(this).trigger("remove");
- return _remove.apply(this, arguments );
-};
-
-// $.widget is a factory to create jQuery plugins
-// taking some boilerplate code out of the plugin code
-// created by Scott González and Jörn Zaefferer
-function getter(namespace, plugin, method) {
- var methods = $[namespace][plugin].getter || [];
- methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods);
- return ($.inArray(method, methods) != -1);
-}
-
-var widgetPrototype = {
- init: function() {},
- destroy: function() {
- this.element.removeData(this.widgetName);
- },
-
- getData: function(key) {
- return this.options[key];
- },
- setData: function(key, value) {
- this.options[key] = value;
- },
-
- enable: function() {
- this.setData('disabled', false);
- },
- disable: function() {
- this.setData('disabled', true);
- }
-};
-
-$.widget = function(name, prototype) {
- var namespace = name.split(".")[0];
- name = name.split(".")[1];
- // create plugin method
- $.fn[name] = function(options) {
- var isMethodCall = (typeof options == 'string'),
- args = Array.prototype.slice.call(arguments, 1);
-
- if (isMethodCall && getter(namespace, name, options)) {
- var instance = $.data(this[0], name);
- return (instance ? instance[options].apply(instance, args)
- : undefined);
- }
-
- return this.each(function() {
- var instance = $.data(this, name);
- if (!instance) {
- $.data(this, name, new $[namespace][name](this, options));
- } else if (isMethodCall) {
- instance[options].apply(instance, args);
- }
- });
- };
-
- // create widget constructor
- $[namespace][name] = function(element, options) {
- var self = this;
-
- this.widgetName = name;
-
- this.options = $.extend({}, $[namespace][name].defaults, options);
- this.element = $(element)
- .bind('setData.' + name, function(e, key, value) {
- return self.setData(key, value);
- })
- .bind('getData.' + name, function(e, key) {
- return self.getData(key);
- })
- .bind('remove', function() {
- return self.destroy();
- });
- this.init();
- };
-
- // add widget prototype
- $[namespace][name].prototype = $.extend({}, widgetPrototype, prototype);
-};
-
-
-/** Mouse Interaction Plugin **/
-
-$.ui.mouse = {
- mouseInit: function() {
- var self = this;
-
- this.element.bind('mousedown.'+this.widgetName, function(e) {
- return self.mouseDown(e);
- });
-
- // Prevent text selection in IE
- if ($.browser.msie) {
- this._mouseUnselectable = this.element.attr('unselectable');
- this.element.attr('unselectable', 'on');
- }
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
-
- // Restore text selection in IE
- ($.browser.msie
- && this.element.attr('unselectable', this._mouseUnselectable));
- },
-
- mouseDown: function(e) {
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this.mouseUp(e));
-
- this._mouseDownEvent = e;
-
- var self = this,
- btnIsLeft = (e.which == 1),
- elIsCancel = ($(e.target).is(this.options.cancel));
- if (!btnIsLeft || elIsCancel) {
- return true;
- }
-
- this._mouseDelayMet = !this.options.delay;
- if (!this._mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self._mouseDelayMet = true;
- }, this.options.delay);
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(e) {
- return self.mouseMove(e);
- };
- this._mouseUpDelegate = function(e) {
- return self.mouseUp(e);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- return false;
- },
-
- mouseMove: function(e) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !e.button) {
- return this.mouseUp(e);
- }
-
- if (this._mouseStarted) {
- this.mouseDrag(e);
- return false;
- }
-
- if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
- this._mouseStarted =
- (this.mouseStart(this._mouseDownEvent, e) !== false);
- (this._mouseStarted || this.mouseUp(e));
- }
-
- return !this._mouseStarted;
- },
-
- mouseUp: function(e) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
- this.mouseStop(e);
- }
-
- return false;
- },
-
- mouseDistanceMet: function(e) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - e.pageX),
- Math.abs(this._mouseDownEvent.pageY - e.pageY)
- ) >= this.options.distance
- );
- },
-
- mouseDelayMet: function(e) {
- return this._mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- mouseStart: function(e) {},
- mouseDrag: function(e) {},
- mouseStop: function(e) {}
-};
-
-$.ui.mouse.defaults = {
- cancel: null,
- distance: 0,
- delay: 0
-};
-
+/* + * jQuery UI @VERSION + * + * Copyright (c) 2008 Paul Bakaus (ui.jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + * + * $Id: ui.core.js 5587 2008-05-13 19:56:42Z scott.gonzalez $ + */ +;(function($) { + +$.ui = { + plugin: { + add: function(module, option, set) { + var proto = $.ui[module].prototype; + for(var i in set) { + proto.plugins[i] = proto.plugins[i] || []; + proto.plugins[i].push([option, set[i]]); + } + }, + call: function(instance, name, args) { + var set = instance.plugins[name]; + if(!set) { return; } + + for (var i = 0; i < set.length; i++) { + if (instance.options[set[i][0]]) { + set[i][1].apply(instance.element, args); + } + } + } + }, + cssCache: {}, + css: function(name) { + if ($.ui.cssCache[name]) { return $.ui.cssCache[name]; } + var tmp = $('<div class="ui-resizable-gen">').addClass(name).css({position:'absolute', top:'-5000px', left:'-5000px', display:'block'}).appendTo('body'); + + //if (!$.browser.safari) + //tmp.appendTo('body'); + + //Opera and Safari set width and height to 0px instead of auto + //Safari returns rgba(0,0,0,0) when bgcolor is not set + $.ui.cssCache[name] = !!( + (!(/auto|default/).test(tmp.css('cursor')) || (/^[1-9]/).test(tmp.css('height')) || (/^[1-9]/).test(tmp.css('width')) || + !(/none/).test(tmp.css('backgroundImage')) || !(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))) + ); + try { $('body').get(0).removeChild(tmp.get(0)); } catch(e){} + return $.ui.cssCache[name]; + }, + disableSelection: function(e) { + e.unselectable = "on"; + e.onselectstart = function() { return false; }; + if (e.style) { e.style.MozUserSelect = "none"; } + }, + enableSelection: function(e) { + e.unselectable = "off"; + e.onselectstart = function() { return true; }; + if (e.style) { e.style.MozUserSelect = ""; } + }, + hasScroll: function(e, a) { + var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false; + if (e[scroll] > 0) return true; e[scroll] = 1; + has = e[scroll] > 0 ? true : false; e[scroll] = 0; + return has; + } +}; + + +/** jQuery core modifications and additions **/ + +var _remove = $.fn.remove; +$.fn.remove = function() { + $("*", this).add(this).trigger("remove"); + return _remove.apply(this, arguments ); +}; + +// $.widget is a factory to create jQuery plugins +// taking some boilerplate code out of the plugin code +// created by Scott González and Jörn Zaefferer +function getter(namespace, plugin, method) { + var methods = $[namespace][plugin].getter || []; + methods = (typeof methods == "string" ? methods.split(/,?\s+/) : methods); + return ($.inArray(method, methods) != -1); +} + +var widgetPrototype = { + init: function() {}, + destroy: function() { + this.element.removeData(this.widgetName); + }, + + getData: function(key) { + return this.options[key]; + }, + setData: function(key, value) { + this.options[key] = value; + }, + + enable: function() { + this.setData('disabled', false); + }, + disable: function() { + this.setData('disabled', true); + } +}; + +$.widget = function(name, prototype) { + var namespace = name.split(".")[0]; + name = name.split(".")[1]; + // create plugin method + $.fn[name] = function(options) { + var isMethodCall = (typeof options == 'string'), + args = Array.prototype.slice.call(arguments, 1); + + if (isMethodCall && getter(namespace, name, options)) { + var instance = $.data(this[0], name); + return (instance ? instance[options].apply(instance, args) + : undefined); + } + + return this.each(function() { + var instance = $.data(this, name); + if (!instance) { + $.data(this, name, new $[namespace][name](this, options)); + } else if (isMethodCall) { + instance[options].apply(instance, args); + } + }); + }; + + // create widget constructor + $[namespace][name] = function(element, options) { + var self = this; + + this.widgetName = name; + + this.options = $.extend({}, $[namespace][name].defaults, options); + this.element = $(element) + .bind('setData.' + name, function(e, key, value) { + return self.setData(key, value); + }) + .bind('getData.' + name, function(e, key) { + return self.getData(key); + }) + .bind('remove', function() { + return self.destroy(); + }); + this.init(); + }; + + // add widget prototype + $[namespace][name].prototype = $.extend({}, widgetPrototype, prototype); +}; + + +/** Mouse Interaction Plugin **/ + +$.ui.mouse = { + mouseInit: function() { + var self = this; + + this.element.bind('mousedown.'+this.widgetName, function(e) { + return self.mouseDown(e); + }); + + // Prevent text selection in IE + if ($.browser.msie) { + this._mouseUnselectable = this.element.attr('unselectable'); + this.element.attr('unselectable', 'on'); + } + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + + // Restore text selection in IE + ($.browser.msie + && this.element.attr('unselectable', this._mouseUnselectable)); + }, + + mouseDown: function(e) { + // we may have missed mouseup (out of window) + (this._mouseStarted && this.mouseUp(e)); + + this._mouseDownEvent = e; + + var self = this, + btnIsLeft = (e.which == 1), + elIsCancel = ($(e.target).is(this.options.cancel)); + if (!btnIsLeft || elIsCancel) { + return true; + } + + this._mouseDelayMet = !this.options.delay; + if (!this._mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + self._mouseDelayMet = true; + }, this.options.delay); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(e) { + return self.mouseMove(e); + }; + this._mouseUpDelegate = function(e) { + return self.mouseUp(e); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + return false; + }, + + mouseMove: function(e) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.browser.msie && !e.button) { + return this.mouseUp(e); + } + + if (this._mouseStarted) { + this.mouseDrag(e); + return false; + } + + if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) { + this._mouseStarted = + (this.mouseStart(this._mouseDownEvent, e) !== false); + (this._mouseStarted || this.mouseUp(e)); + } + + return !this._mouseStarted; + }, + + mouseUp: function(e) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + this.mouseStop(e); + } + + return false; + }, + + mouseDistanceMet: function(e) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - e.pageX), + Math.abs(this._mouseDownEvent.pageY - e.pageY) + ) >= this.options.distance + ); + }, + + mouseDelayMet: function(e) { + return this._mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + mouseStart: function(e) {}, + mouseDrag: function(e) {}, + mouseStop: function(e) {} +}; + +$.ui.mouse.defaults = { + cancel: null, + distance: 0, + delay: 0 +}; + })(jQuery);
\ No newline at end of file diff --git a/ui/source/ui.datepicker.js b/ui/source/ui.datepicker.js index 3f0b629ca..5a55fc97c 100644 --- a/ui/source/ui.datepicker.js +++ b/ui/source/ui.datepicker.js @@ -1,1446 +1,1446 @@ -/*
- * jQuery UI Datepicker
- *
- * Copyright (c) 2006, 2007, 2008 Marc Grabanski
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Datepicker
- * Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au).
- */
-
-;(function($) { // hide the namespace
-
-/* Date picker manager.
- Use the singleton instance of this class, $.datepicker, to interact with the date picker.
- Settings for (groups of) date pickers are maintained in an instance object
- (DatepickerInstance), allowing multiple different settings on the same page. */
-
-function Datepicker() {
- this.debug = false; // Change this to true to start debugging
- this._nextId = 0; // Next ID for a date picker instance
- this._inst = []; // List of instances indexed by ID
- this._curInst = null; // The current instance in use
- this._disabledInputs = []; // List of date picker inputs that have been disabled
- this._datepickerShowing = false; // True if the popup picker is showing , false if not
- this._inDialog = false; // True if showing within a "dialog", false if not
- this.regional = []; // Available regional settings, indexed by language code
- this.regional[''] = { // Default regional settings
- clearText: 'Clear', // Display text for clear link
- clearStatus: 'Erase the current date', // Status text for clear link
- closeText: 'Close', // Display text for close link
- closeStatus: 'Close without change', // Status text for close link
- prevText: '<Prev', // Display text for previous month link
- prevStatus: 'Show the previous month', // Status text for previous month link
- nextText: 'Next>', // Display text for next month link
- nextStatus: 'Show the next month', // Status text for next month link
- currentText: 'Today', // Display text for current month link
- currentStatus: 'Show the current month', // Status text for current month link
- monthNames: ['January','February','March','April','May','June',
- 'July','August','September','October','November','December'], // Names of months for drop-down and formatting
- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
- monthStatus: 'Show a different month', // Status text for selecting a month
- yearStatus: 'Show a different year', // Status text for selecting a year
- weekHeader: 'Wk', // Header for the week of the year column
- weekStatus: 'Week of the year', // Status text for the week of the year column
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
- dayStatus: 'Set DD as first week day', // Status text for the day of the week selection
- dateStatus: 'Select DD, M d', // Status text for the date selection
- dateFormat: 'mm/dd/yy', // See format options on parseDate
- firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
- initStatus: 'Select a date', // Initial Status text on opening
- isRTL: false // True if right-to-left language, false if left-to-right
- };
- this._defaults = { // Global defaults for all the date picker instances
- showOn: 'focus', // 'focus' for popup on focus,
- // 'button' for trigger button, or 'both' for either
- showAnim: 'show', // Name of jQuery animation for popup
- defaultDate: null, // Used when field is blank: actual date,
- // +/-number for offset from today, null for today
- appendText: '', // Display text following the input box, e.g. showing the format
- buttonText: '...', // Text for trigger button
- buttonImage: '', // URL for trigger button image
- buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
- closeAtTop: true, // True to have the clear/close at the top,
- // false to have them at the bottom
- mandatory: false, // True to hide the Clear link, false to include it
- hideIfNoPrevNext: false, // True to hide next/previous month links
- // if not applicable, false to just disable them
- changeMonth: true, // True if month can be selected directly, false if only prev/next
- changeYear: true, // True if year can be selected directly, false if only prev/next
- yearRange: '-10:+10', // Range of years to display in drop-down,
- // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
- changeFirstDay: true, // True to click on day name to change, false to remain as set
- showOtherMonths: false, // True to show dates in other months, false to leave blank
- showWeeks: false, // True to show week of the year, false to omit
- calculateWeek: this.iso8601Week, // How to calculate the week of the year,
- // takes a Date and returns the number of the week for it
- shortYearCutoff: '+10', // Short year values < this are in the current century,
- // > this are in the previous century,
- // string value starting with '+' for current year + value
- showStatus: false, // True to show status bar at bottom, false to not show it
- statusForDate: this.dateStatus, // Function to provide status text for a date -
- // takes date and instance as parameters, returns display text
- minDate: null, // The earliest selectable date, or null for no limit
- maxDate: null, // The latest selectable date, or null for no limit
- speed: 'normal', // Speed of display/closure
- beforeShowDay: null, // Function that takes a date and returns an array with
- // [0] = true if selectable, false if not,
- // [1] = custom CSS class name(s) or '', e.g. $.datepicker.noWeekends
- beforeShow: null, // Function that takes an input field and
- // returns a set of custom settings for the date picker
- onSelect: null, // Define a callback function when a date is selected
- onClose: null, // Define a callback function when the datepicker is closed
- numberOfMonths: 1, // Number of months to show at a time
- stepMonths: 1, // Number of months to step back/forward
- rangeSelect: false, // Allows for selecting a date range on one date picker
- rangeSeparator: ' - ' // Text between two dates in a range
- };
- $.extend(this._defaults, this.regional['']);
- this._datepickerDiv = $('<div id="ui-datepicker-div"></div>');
-}
-
-$.extend(Datepicker.prototype, {
- /* Class name added to elements to indicate already configured with a date picker. */
- markerClassName: 'hasDatepicker',
-
- /* Debug logging (if enabled). */
- log: function () {
- if (this.debug)
- console.log.apply('', arguments);
- },
-
- /* Register a new date picker instance - with custom settings. */
- _register: function(inst) {
- var id = this._nextId++;
- this._inst[id] = inst;
- return id;
- },
-
- /* Retrieve a particular date picker instance based on its ID. */
- _getInst: function(id) {
- return this._inst[id] || id;
- },
-
- /* Override the default settings for all instances of the date picker.
- @param settings object - the new settings to use as defaults (anonymous object)
- @return the manager object */
- setDefaults: function(settings) {
- extendRemove(this._defaults, settings || {});
- return this;
- },
-
- /* Attach the date picker to a jQuery selection.
- @param target element - the target input field or division or span
- @param settings object - the new settings to use for this date picker instance (anonymous) */
- _attachDatepicker: function(target, settings) {
- // check for settings on the control itself - in namespace 'date:'
- var inlineSettings = null;
- for (attrName in this._defaults) {
- var attrValue = target.getAttribute('date:' + attrName);
- if (attrValue) {
- inlineSettings = inlineSettings || {};
- try {
- inlineSettings[attrName] = eval(attrValue);
- } catch (err) {
- inlineSettings[attrName] = attrValue;
- }
- }
- }
- var nodeName = target.nodeName.toLowerCase();
- var instSettings = (inlineSettings ?
- $.extend(settings || {}, inlineSettings || {}) : settings);
- if (nodeName == 'input') {
- var inst = (inst && !inlineSettings ? inst :
- new DatepickerInstance(instSettings, false));
- this._connectDatepicker(target, inst);
- } else if (nodeName == 'div' || nodeName == 'span') {
- var inst = new DatepickerInstance(instSettings, true);
- this._inlineDatepicker(target, inst);
- }
- },
-
- /* Detach a datepicker from its control.
- @param target element - the target input field or division or span */
- _destroyDatepicker: function(target) {
- var nodeName = target.nodeName.toLowerCase();
- var calId = target._calId;
- target._calId = null;
- var $target = $(target);
- if (nodeName == 'input') {
- $target.siblings('.ui-datepicker-append').replaceWith('').end()
- .siblings('.ui-datepicker-trigger').replaceWith('').end()
- .removeClass(this.markerClassName)
- .unbind('focus', this._showDatepicker)
- .unbind('keydown', this._doKeyDown)
- .unbind('keypress', this._doKeyPress);
- var wrapper = $target.parents('.ui-datepicker-wrap');
- if (wrapper)
- wrapper.replaceWith(wrapper.html());
- } else if (nodeName == 'div' || nodeName == 'span')
- $target.removeClass(this.markerClassName).empty();
- if ($('input[_calId=' + calId + ']').length == 0)
- // clean up if last for this ID
- this._inst[calId] = null;
- },
-
- /* Enable the date picker to a jQuery selection.
- @param target element - the target input field or division or span */
- _enableDatepicker: function(target) {
- target.disabled = false;
- $(target).siblings('button.ui-datepicker-trigger').each(function() { this.disabled = false; }).end()
- .siblings('img.ui-datepicker-trigger').css({opacity: '1.0', cursor: ''});
- this._disabledInputs = $.map(this._disabledInputs,
- function(value) { return (value == target ? null : value); }); // delete entry
- },
-
- /* Disable the date picker to a jQuery selection.
- @param target element - the target input field or division or span */
- _disableDatepicker: function(target) {
- target.disabled = true;
- $(target).siblings('button.ui-datepicker-trigger').each(function() { this.disabled = true; }).end()
- .siblings('img.ui-datepicker-trigger').css({opacity: '0.5', cursor: 'default'});
- this._disabledInputs = $.map($.datepicker._disabledInputs,
- function(value) { return (value == target ? null : value); }); // delete entry
- this._disabledInputs[$.datepicker._disabledInputs.length] = target;
- },
-
- /* Is the first field in a jQuery collection disabled as a datepicker?
- @param target element - the target input field or division or span
- @return boolean - true if disabled, false if enabled */
- _isDisabledDatepicker: function(target) {
- if (!target)
- return false;
- for (var i = 0; i < this._disabledInputs.length; i++) {
- if (this._disabledInputs[i] == target)
- return true;
- }
- return false;
- },
-
- /* Update the settings for a date picker attached to an input field or division.
- @param target element - the target input field or division or span
- @param name string - the name of the setting to change or
- object - the new settings to update
- @param value any - the new value for the setting (omit if above is an object) */
- _changeDatepicker: function(target, name, value) {
- var settings = name || {};
- if (typeof name == 'string') {
- settings = {};
- settings[name] = value;
- }
- if (inst = this._getInst(target._calId)) {
- extendRemove(inst._settings, settings);
- this._updateDatepicker(inst);
- }
- },
-
- /* Set the dates for a jQuery selection.
- @param target element - the target input field or division or span
- @param date Date - the new date
- @param endDate Date - the new end date for a range (optional) */
- _setDateDatepicker: function(target, date, endDate) {
- if (inst = this._getInst(target._calId)) {
- inst._setDate(date, endDate);
- this._updateDatepicker(inst);
- }
- },
-
- /* Get the date(s) for the first entry in a jQuery selection.
- @param target element - the target input field or division or span
- @return Date - the current date or
- Date[2] - the current dates for a range */
- _getDateDatepicker: function(target) {
- var inst = this._getInst(target._calId);
- if (inst) {
- inst._setDateFromField($(target));
- }
- return (inst ? inst._getDate() : null);
- },
-
- /* Handle keystrokes. */
- _doKeyDown: function(e) {
- var inst = $.datepicker._getInst(this._calId);
- if ($.datepicker._datepickerShowing)
- switch (e.keyCode) {
- case 9: $.datepicker._hideDatepicker(null, '');
- break; // hide on tab out
- case 13: $.datepicker._selectDay(inst, inst._selectedMonth, inst._selectedYear,
- $('td.ui-datepicker-daysCellOver', inst._datepickerDiv)[0]);
- return false; // don't submit the form
- break; // select the value on enter
- case 27: $.datepicker._hideDatepicker(null, inst._get('speed'));
- break; // hide on escape
- case 33: $.datepicker._adjustDate(inst,
- (e.ctrlKey ? -1 : -inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
- break; // previous month/year on page up/+ ctrl
- case 34: $.datepicker._adjustDate(inst,
- (e.ctrlKey ? +1 : +inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M'));
- break; // next month/year on page down/+ ctrl
- case 35: if (e.ctrlKey) $.datepicker._clearDate(inst);
- break; // clear on ctrl+end
- case 36: if (e.ctrlKey) $.datepicker._gotoToday(inst);
- break; // current on ctrl+home
- case 37: if (e.ctrlKey) $.datepicker._adjustDate(inst, -1, 'D');
- break; // -1 day on ctrl+left
- case 38: if (e.ctrlKey) $.datepicker._adjustDate(inst, -7, 'D');
- break; // -1 week on ctrl+up
- case 39: if (e.ctrlKey) $.datepicker._adjustDate(inst, +1, 'D');
- break; // +1 day on ctrl+right
- case 40: if (e.ctrlKey) $.datepicker._adjustDate(inst, +7, 'D');
- break; // +1 week on ctrl+down
- }
- else if (e.keyCode == 36 && e.ctrlKey) // display the date picker on ctrl+home
- $.datepicker._showDatepicker(this);
- },
-
- /* Filter entered characters - based on date format. */
- _doKeyPress: function(e) {
- var inst = $.datepicker._getInst(this._calId);
- var chars = $.datepicker._possibleChars(inst._get('dateFormat'));
- var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode);
- return e.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
- },
-
- /* Attach the date picker to an input field. */
- _connectDatepicker: function(target, inst) {
- var input = $(target);
- if (input.is('.' + this.markerClassName))
- return;
- var appendText = inst._get('appendText');
- var isRTL = inst._get('isRTL');
- if (appendText) {
- if (isRTL)
- input.before('<span class="ui-datepicker-append">' + appendText);
- else
- input.after('<span class="ui-datepicker-append">' + appendText);
- }
- var showOn = inst._get('showOn');
- if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
- input.focus(this._showDatepicker);
- if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
- input.wrap('<span class="ui-datepicker-wrap">');
- var buttonText = inst._get('buttonText');
- var buttonImage = inst._get('buttonImage');
- var trigger = $(inst._get('buttonImageOnly') ?
- $('<img>').addClass('ui-datepicker-trigger').attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
- $('<button>').addClass('ui-datepicker-trigger').attr({ type: 'button' }).html(buttonImage != '' ?
- $('<img>').attr({ src:buttonImage, alt:buttonText, title:buttonText }) : buttonText));
- if (isRTL)
- input.before(trigger);
- else
- input.after(trigger);
- trigger.click(function() {
- if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
- $.datepicker._hideDatepicker();
- else
- $.datepicker._showDatepicker(target);
- });
- }
- input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress)
- .bind("setData.datepicker", function(event, key, value) {
- inst._settings[key] = value;
- }).bind("getData.datepicker", function(event, key) {
- return inst._get(key);
- });
- input[0]._calId = inst._id;
- },
-
- /* Attach an inline date picker to a div. */
- _inlineDatepicker: function(target, inst) {
- var input = $(target);
- if (input.is('.' + this.markerClassName))
- return;
- input.addClass(this.markerClassName).append(inst._datepickerDiv)
- .bind("setData.datepicker", function(event, key, value){
- inst._settings[key] = value;
- }).bind("getData.datepicker", function(event, key){
- return inst._get(key);
- });
- input[0]._calId = inst._id;
- this._updateDatepicker(inst);
- },
-
- /* Tidy up after displaying the date picker. */
- _inlineShow: function(inst) {
- var numMonths = inst._getNumberOfMonths(); // fix width for dynamic number of date pickers
- inst._datepickerDiv.width(numMonths[1] * $('.ui-datepicker', inst._datepickerDiv[0]).width());
- },
-
- /* Pop-up the date picker in a "dialog" box.
- @param input element - ignored
- @param dateText string - the initial date to display (in the current format)
- @param onSelect function - the function(dateText) to call when a date is selected
- @param settings object - update the dialog date picker instance's settings (anonymous object)
- @param pos int[2] - coordinates for the dialog's position within the screen or
- event - with x/y coordinates or
- leave empty for default (screen centre)
- @return the manager object */
- _dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
- var inst = this._dialogInst; // internal instance
- if (!inst) {
- inst = this._dialogInst = new DatepickerInstance({}, false);
- this._dialogInput = $('<input type="text" size="1" style="position: absolute; top: -100px;"/>');
- this._dialogInput.keydown(this._doKeyDown);
- $('body').append(this._dialogInput);
- this._dialogInput[0]._calId = inst._id;
- }
- extendRemove(inst._settings, settings || {});
- this._dialogInput.val(dateText);
-
- this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
- if (!this._pos) {
- var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
- var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
- var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
- var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
- this._pos = // should use actual width/height below
- [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
- }
-
- // move input on screen for focus, but hidden behind dialog
- this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
- inst._settings.onSelect = onSelect;
- this._inDialog = true;
- this._datepickerDiv.addClass('ui-datepicker-dialog');
- this._showDatepicker(this._dialogInput[0]);
- if ($.blockUI)
- $.blockUI(this._datepickerDiv);
- return this;
- },
-
- /* Pop-up the date picker for a given input field.
- @param input element - the input field attached to the date picker or
- event - if triggered by focus */
- _showDatepicker: function(input) {
- input = input.target || input;
- if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
- input = $('input', input.parentNode)[0];
- if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
- return;
- var inst = $.datepicker._getInst(input._calId);
- var beforeShow = inst._get('beforeShow');
- extendRemove(inst._settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
- $.datepicker._hideDatepicker(null, '');
- $.datepicker._lastInput = input;
- inst._setDateFromField(input);
- if ($.datepicker._inDialog) // hide cursor
- input.value = '';
- if (!$.datepicker._pos) { // position below input
- $.datepicker._pos = $.datepicker._findPos(input);
- $.datepicker._pos[1] += input.offsetHeight; // add the height
- }
- var isFixed = false;
- $(input).parents().each(function() {
- isFixed |= $(this).css('position') == 'fixed';
- });
- if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
- $.datepicker._pos[0] -= document.documentElement.scrollLeft;
- $.datepicker._pos[1] -= document.documentElement.scrollTop;
- }
- inst._datepickerDiv.css('position', ($.datepicker._inDialog && $.blockUI ?
- 'static' : (isFixed ? 'fixed' : 'absolute')))
- .css({ left: $.datepicker._pos[0] + 'px', top: $.datepicker._pos[1] + 'px' });
- $.datepicker._pos = null;
- inst._rangeStart = null;
- $.datepicker._updateDatepicker(inst);
- if (!inst._inline) {
- var speed = inst._get('speed');
- var postProcess = function() {
- $.datepicker._datepickerShowing = true;
- $.datepicker._afterShow(inst);
- };
- var showAnim = inst._get('showAnim') || 'show';
- inst._datepickerDiv[showAnim](speed, postProcess);
- if (speed == '')
- postProcess();
- if (inst._input[0].type != 'hidden')
- inst._input[0].focus();
- $.datepicker._curInst = inst;
- }
- },
-
- /* Generate the date picker content. */
- _updateDatepicker: function(inst) {
- inst._datepickerDiv.empty().append(inst._generateDatepicker());
- var numMonths = inst._getNumberOfMonths();
- if (numMonths[0] != 1 || numMonths[1] != 1)
- inst._datepickerDiv.addClass('ui-datepicker-multi');
- else
- inst._datepickerDiv.removeClass('ui-datepicker-multi');
-
- if (inst._get('isRTL'))
- inst._datepickerDiv.addClass('ui-datepicker-rtl');
- else
- inst._datepickerDiv.removeClass('ui-datepicker-rtl');
-
- if (inst._input && inst._input[0].type != 'hidden')
- $(inst._input[0]).focus();
- },
-
- /* Tidy up after displaying the date picker. */
- _afterShow: function(inst) {
- var numMonths = inst._getNumberOfMonths(); // fix width for dynamic number of date pickers
- inst._datepickerDiv.width(numMonths[1] * $('.ui-datepicker', inst._datepickerDiv[0])[0].offsetWidth);
- if ($.browser.msie && parseInt($.browser.version) < 7) { // fix IE < 7 select problems
- $('iframe.ui-datepicker-cover').css({width: inst._datepickerDiv.width() + 4,
- height: inst._datepickerDiv.height() + 4});
- }
- // re-position on screen if necessary
- var isFixed = inst._datepickerDiv.css('position') == 'fixed';
- var pos = inst._input ? $.datepicker._findPos(inst._input[0]) : null;
- var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
- var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
- var scrollX = (isFixed ? 0 : document.documentElement.scrollLeft || document.body.scrollLeft);
- var scrollY = (isFixed ? 0 : document.documentElement.scrollTop || document.body.scrollTop);
- // reposition date picker horizontally if outside the browser window
- if ((inst._datepickerDiv.offset().left + inst._datepickerDiv.width() -
- (isFixed && $.browser.msie ? document.documentElement.scrollLeft : 0)) >
- (browserWidth + scrollX)) {
- inst._datepickerDiv.css('left', Math.max(scrollX,
- pos[0] + (inst._input ? $(inst._input[0]).width() : null) - inst._datepickerDiv.width() -
- (isFixed && $.browser.opera ? document.documentElement.scrollLeft : 0)) + 'px');
- }
- // reposition date picker vertically if outside the browser window
- if ((inst._datepickerDiv.offset().top + inst._datepickerDiv.height() -
- (isFixed && $.browser.msie ? document.documentElement.scrollTop : 0)) >
- (browserHeight + scrollY) ) {
- inst._datepickerDiv.css('top', Math.max(scrollY,
- pos[1] - (this._inDialog ? 0 : inst._datepickerDiv.height()) -
- (isFixed && $.browser.opera ? document.documentElement.scrollTop : 0)) + 'px');
- }
- },
-
- /* Find an object's position on the screen. */
- _findPos: function(obj) {
- while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
- obj = obj.nextSibling;
- }
- var position = $(obj).offset();
- return [position.left, position.top];
- },
-
- /* Hide the date picker from view.
- @param input element - the input field attached to the date picker
- @param speed string - the speed at which to close the date picker */
- _hideDatepicker: function(input, speed) {
- var inst = this._curInst;
- if (!inst)
- return;
- var rangeSelect = inst._get('rangeSelect');
- if (rangeSelect && this._stayOpen) {
- this._selectDate(inst, inst._formatDate(
- inst._currentDay, inst._currentMonth, inst._currentYear));
- }
- this._stayOpen = false;
- if (this._datepickerShowing) {
- speed = (speed != null ? speed : inst._get('speed'));
- var showAnim = inst._get('showAnim');
- inst._datepickerDiv[(showAnim == 'slideDown' ? 'slideUp' :
- (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))](speed, function() {
- $.datepicker._tidyDialog(inst);
- });
- if (speed == '')
- this._tidyDialog(inst);
- var onClose = inst._get('onClose');
- if (onClose) {
- onClose.apply((inst._input ? inst._input[0] : null),
- [inst._getDate(), inst]); // trigger custom callback
- }
- this._datepickerShowing = false;
- this._lastInput = null;
- inst._settings.prompt = null;
- if (this._inDialog) {
- this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
- if ($.blockUI) {
- $.unblockUI();
- $('body').append(this._datepickerDiv);
- }
- }
- this._inDialog = false;
- }
- this._curInst = null;
- },
-
- /* Tidy up after a dialog display. */
- _tidyDialog: function(inst) {
- inst._datepickerDiv.removeClass('ui-datepicker-dialog').unbind('.ui-datepicker');
- $('.ui-datepicker-prompt', inst._datepickerDiv).remove();
- },
-
- /* Close date picker if clicked elsewhere. */
- _checkExternalClick: function(event) {
- if (!$.datepicker._curInst)
- return;
- var $target = $(event.target);
- if (($target.parents("#ui-datepicker-div").length == 0) &&
- !$target.hasClass('hasDatepicker') &&
- !$target.hasClass('ui-datepicker-trigger') &&
- $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) {
- $.datepicker._hideDatepicker(null, '');
- }
- },
-
- /* Adjust one of the date sub-fields. */
- _adjustDate: function(id, offset, period) {
- var inst = this._getInst(id);
- inst._adjustDate(offset, period);
- this._updateDatepicker(inst);
- },
-
- /* Action for current link. */
- _gotoToday: function(id) {
- var date = new Date();
- var inst = this._getInst(id);
- inst._selectedDay = date.getDate();
- inst._drawMonth = inst._selectedMonth = date.getMonth();
- inst._drawYear = inst._selectedYear = date.getFullYear();
- this._adjustDate(inst);
- },
-
- /* Action for selecting a new month/year. */
- _selectMonthYear: function(id, select, period) {
- var inst = this._getInst(id);
- inst._selectingMonthYear = false;
- inst[period == 'M' ? '_drawMonth' : '_drawYear'] =
- select.options[select.selectedIndex].value - 0;
- this._adjustDate(inst);
- },
-
- /* Restore input focus after not changing month/year. */
- _clickMonthYear: function(id) {
- var inst = this._getInst(id);
- if (inst._input && inst._selectingMonthYear && !$.browser.msie)
- inst._input[0].focus();
- inst._selectingMonthYear = !inst._selectingMonthYear;
- },
-
- /* Action for changing the first week day. */
- _changeFirstDay: function(id, day) {
- var inst = this._getInst(id);
- inst._settings.firstDay = day;
- this._updateDatepicker(inst);
- },
-
- /* Action for selecting a day. */
- _selectDay: function(id, month, year, td) {
- if ($(td).is('.ui-datepicker-unselectable'))
- return;
- var inst = this._getInst(id);
- var rangeSelect = inst._get('rangeSelect');
- if (rangeSelect) {
- if (!this._stayOpen) {
- $('.ui-datepicker td').removeClass('ui-datepicker-currentDay');
- $(td).addClass('ui-datepicker-currentDay');
- }
- this._stayOpen = !this._stayOpen;
- }
- inst._selectedDay = inst._currentDay = $('a', td).html();
- inst._selectedMonth = inst._currentMonth = month;
- inst._selectedYear = inst._currentYear = year;
- this._selectDate(id, inst._formatDate(
- inst._currentDay, inst._currentMonth, inst._currentYear));
- if (this._stayOpen) {
- inst._endDay = inst._endMonth = inst._endYear = null;
- inst._rangeStart = new Date(inst._currentYear, inst._currentMonth, inst._currentDay);
- this._updateDatepicker(inst);
- }
- else if (rangeSelect) {
- inst._endDay = inst._currentDay;
- inst._endMonth = inst._currentMonth;
- inst._endYear = inst._currentYear;
- inst._selectedDay = inst._currentDay = inst._rangeStart.getDate();
- inst._selectedMonth = inst._currentMonth = inst._rangeStart.getMonth();
- inst._selectedYear = inst._currentYear = inst._rangeStart.getFullYear();
- inst._rangeStart = null;
- if (inst._inline)
- this._updateDatepicker(inst);
- }
- },
-
- /* Erase the input field and hide the date picker. */
- _clearDate: function(id) {
- var inst = this._getInst(id);
- if (inst._get('mandatory'))
- return;
- this._stayOpen = false;
- inst._endDay = inst._endMonth = inst._endYear = inst._rangeStart = null;
- this._selectDate(inst, '');
- },
-
- /* Update the input field with the selected date. */
- _selectDate: function(id, dateStr) {
- var inst = this._getInst(id);
- dateStr = (dateStr != null ? dateStr : inst._formatDate());
- if (inst._rangeStart)
- dateStr = inst._formatDate(inst._rangeStart) + inst._get('rangeSeparator') + dateStr;
- if (inst._input)
- inst._input.val(dateStr);
- var onSelect = inst._get('onSelect');
- if (onSelect)
- onSelect.apply((inst._input ? inst._input[0] : null), [dateStr, inst]); // trigger custom callback
- else if (inst._input)
- inst._input.trigger('change'); // fire the change event
- if (inst._inline)
- this._updateDatepicker(inst);
- else if (!this._stayOpen) {
- this._hideDatepicker(null, inst._get('speed'));
- this._lastInput = inst._input[0];
- if (typeof(inst._input[0]) != 'object')
- inst._input[0].focus(); // restore focus
- this._lastInput = null;
- }
- },
-
- /* Set as beforeShowDay function to prevent selection of weekends.
- @param date Date - the date to customise
- @return [boolean, string] - is this date selectable?, what is its CSS class? */
- noWeekends: function(date) {
- var day = date.getDay();
- return [(day > 0 && day < 6), ''];
- },
-
- /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
- @param date Date - the date to get the week for
- @return number - the number of the week within the year that contains this date */
- iso8601Week: function(date) {
- var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), (date.getTimezoneOffset() / -60));
- var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan
- var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7
- firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday
- if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary
- checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year
- return $.datepicker.iso8601Week(checkDate);
- } else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year
- firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
- if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary
- checkDate.setDate(checkDate.getDate() + 3); // Generate for next year
- return $.datepicker.iso8601Week(checkDate);
- }
- }
- return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date
- },
-
- /* Provide status text for a particular date.
- @param date the date to get the status for
- @param inst the current datepicker instance
- @return the status display text for this date */
- dateStatus: function(date, inst) {
- return $.datepicker.formatDate(inst._get('dateStatus'), date, inst._getFormatConfig());
- },
-
- /* Parse a string value into a date object.
- The format can be combinations of the following:
- d - day of month (no leading zero)
- dd - day of month (two digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
- '...' - literal text
- '' - single quote
-
- @param format String - the expected format of the date
- @param value String - the date in the above format
- @param settings Object - attributes include:
- shortYearCutoff Number - the cutoff year for determining the century (optional)
- dayNamesShort String[7] - abbreviated names of the days from Sunday (optional)
- dayNames String[7] - names of the days from Sunday (optional)
- monthNamesShort String[12] - abbreviated names of the months (optional)
- monthNames String[12] - names of the months (optional)
- @return Date - the extracted date value or null if value is blank */
- parseDate: function (format, value, settings) {
- if (format == null || value == null)
- throw 'Invalid arguments';
- value = (typeof value == 'object' ? value.toString() : value + '');
- if (value == '')
- return null;
- var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
- var year = -1;
- var month = -1;
- var day = -1;
- var literal = false;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- // Extract a number from the string value
- var getNumber = function(match) {
- lookAhead(match);
- var size = (match == 'y' ? 4 : 2);
- var num = 0;
- while (size > 0 && iValue < value.length &&
- value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
- num = num * 10 + (value.charAt(iValue++) - 0);
- size--;
- }
- if (size == (match == 'y' ? 4 : 2))
- throw 'Missing number at position ' + iValue;
- return num;
- };
- // Extract a name from the string value and convert to an index
- var getName = function(match, shortNames, longNames) {
- var names = (lookAhead(match) ? longNames : shortNames);
- var size = 0;
- for (var j = 0; j < names.length; j++)
- size = Math.max(size, names[j].length);
- var name = '';
- var iInit = iValue;
- while (size > 0 && iValue < value.length) {
- name += value.charAt(iValue++);
- for (var i = 0; i < names.length; i++)
- if (name == names[i])
- return i + 1;
- size--;
- }
- throw 'Unknown name at position ' + iInit;
- };
- // Confirm that a literal character matches the string value
- var checkLiteral = function() {
- if (value.charAt(iValue) != format.charAt(iFormat))
- throw 'Unexpected literal at position ' + iValue;
- iValue++;
- };
- var iValue = 0;
- for (var iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- checkLiteral();
- else
- switch (format.charAt(iFormat)) {
- case 'd':
- day = getNumber('d');
- break;
- case 'D':
- getName('D', dayNamesShort, dayNames);
- break;
- case 'm':
- month = getNumber('m');
- break;
- case 'M':
- month = getName('M', monthNamesShort, monthNames);
- break;
- case 'y':
- year = getNumber('y');
- break;
- case "'":
- if (lookAhead("'"))
- checkLiteral();
- else
- literal = true;
- break;
- default:
- checkLiteral();
- }
- }
- if (year < 100) {
- year += new Date().getFullYear() - new Date().getFullYear() % 100 +
- (year <= shortYearCutoff ? 0 : -100);
- }
- var date = new Date(year, month - 1, day);
- if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) {
- throw 'Invalid date'; // E.g. 31/02/*
- }
- return date;
- },
-
- /* Format a date object into a string value.
- The format can be combinations of the following:
- d - day of month (no leading zero)
- dd - day of month (two digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
- '...' - literal text
- '' - single quote
-
- @param format String - the desired format of the date
- @param date Date - the date value to format
- @param settings Object - attributes include:
- dayNamesShort String[7] - abbreviated names of the days from Sunday (optional)
- dayNames String[7] - names of the days from Sunday (optional)
- monthNamesShort String[12] - abbreviated names of the months (optional)
- monthNames String[12] - names of the months (optional)
- @return String - the date in the above format */
- formatDate: function (format, date, settings) {
- if (!date)
- return '';
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- // Format a number, with leading zero if necessary
- var formatNumber = function(match, value) {
- return (lookAhead(match) && value < 10 ? '0' : '') + value;
- };
- // Format a name, short or long as requested
- var formatName = function(match, value, shortNames, longNames) {
- return (lookAhead(match) ? longNames[value] : shortNames[value]);
- };
- var output = '';
- var literal = false;
- if (date) {
- for (var iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- output += format.charAt(iFormat);
- else
- switch (format.charAt(iFormat)) {
- case 'd':
- output += formatNumber('d', date.getDate());
- break;
- case 'D':
- output += formatName('D', date.getDay(), dayNamesShort, dayNames);
- break;
- case 'm':
- output += formatNumber('m', date.getMonth() + 1);
- break;
- case 'M':
- output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
- break;
- case 'y':
- output += (lookAhead('y') ? date.getFullYear() :
- (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
- break;
- case "'":
- if (lookAhead("'"))
- output += "'";
- else
- literal = true;
- break;
- default:
- output += format.charAt(iFormat);
- }
- }
- }
- return output;
- },
-
- /* Extract all possible characters from the date format. */
- _possibleChars: function (format) {
- var chars = '';
- var literal = false;
- for (var iFormat = 0; iFormat < format.length; iFormat++)
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- chars += format.charAt(iFormat);
- else
- switch (format.charAt(iFormat)) {
- case 'd' || 'm' || 'y':
- chars += '0123456789';
- break;
- case 'D' || 'M':
- return null; // Accept anything
- case "'":
- if (lookAhead("'"))
- chars += "'";
- else
- literal = true;
- break;
- default:
- chars += format.charAt(iFormat);
- }
- return chars;
- }
-});
-
-/* Individualised settings for date picker functionality applied to one or more related inputs.
- Instances are managed and manipulated through the Datepicker manager. */
-function DatepickerInstance(settings, inline) {
- this._id = $.datepicker._register(this);
- this._selectedDay = 0; // Current date for selection
- this._selectedMonth = 0; // 0-11
- this._selectedYear = 0; // 4-digit year
- this._drawMonth = 0; // Current month at start of datepicker
- this._drawYear = 0;
- this._input = null; // The attached input field
- this._inline = inline; // True if showing inline, false if used in a popup
- this._datepickerDiv = (!inline ? $.datepicker._datepickerDiv :
- $('<div id="ui-datepicker-div-' + this._id + '" class="ui-datepicker-inline">'));
- // customise the date picker object - uses manager defaults if not overridden
- this._settings = extendRemove(settings || {}); // clone
- if (inline)
- this._setDate(this._getDefaultDate());
-}
-
-$.extend(DatepickerInstance.prototype, {
- /* Get a setting value, defaulting if necessary. */
- _get: function(name) {
- return this._settings[name] !== undefined ? this._settings[name] : $.datepicker._defaults[name];
- },
-
- /* Parse existing date and initialise date picker. */
- _setDateFromField: function(input) {
- this._input = $(input);
- var dateFormat = this._get('dateFormat');
- var dates = this._input ? this._input.val().split(this._get('rangeSeparator')) : null;
- this._endDay = this._endMonth = this._endYear = null;
- var date = defaultDate = this._getDefaultDate();
- if (dates.length > 0) {
- var settings = this._getFormatConfig();
- if (dates.length > 1) {
- date = $.datepicker.parseDate(dateFormat, dates[1], settings) || defaultDate;
- this._endDay = date.getDate();
- this._endMonth = date.getMonth();
- this._endYear = date.getFullYear();
- }
- try {
- date = $.datepicker.parseDate(dateFormat, dates[0], settings) || defaultDate;
- } catch (e) {
- $.datepicker.log(e);
- date = defaultDate;
- }
- }
- this._selectedDay = date.getDate();
- this._drawMonth = this._selectedMonth = date.getMonth();
- this._drawYear = this._selectedYear = date.getFullYear();
- this._currentDay = (dates[0] ? date.getDate() : 0);
- this._currentMonth = (dates[0] ? date.getMonth() : 0);
- this._currentYear = (dates[0] ? date.getFullYear() : 0);
- this._adjustDate();
- },
-
- /* Retrieve the default date shown on opening. */
- _getDefaultDate: function() {
- var date = this._determineDate('defaultDate', new Date());
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- date = (minDate && date < minDate ? minDate : date);
- date = (maxDate && date > maxDate ? maxDate : date);
- return date;
- },
-
- /* A date may be specified as an exact value or a relative one. */
- _determineDate: function(name, defaultDate) {
- var offsetNumeric = function(offset) {
- var date = new Date();
- date.setDate(date.getDate() + offset);
- return date;
- };
- var offsetString = function(offset, getDaysInMonth) {
- var date = new Date();
- var matches = /^([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?$/.exec(offset);
- if (matches) {
- var year = date.getFullYear();
- var month = date.getMonth();
- var day = date.getDate();
- switch (matches[2] || 'd') {
- case 'd' : case 'D' :
- day += (matches[1] - 0); break;
- case 'w' : case 'W' :
- day += (matches[1] * 7); break;
- case 'm' : case 'M' :
- month += (matches[1] - 0);
- day = Math.min(day, getDaysInMonth(year, month));
- break;
- case 'y': case 'Y' :
- year += (matches[1] - 0);
- day = Math.min(day, getDaysInMonth(year, month));
- break;
- }
- date = new Date(year, month, day);
- }
- return date;
- };
- var date = this._get(name);
- return (date == null ? defaultDate :
- (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
- (typeof date == 'number' ? offsetNumeric(date) : date)));
- },
-
- /* Set the date(s) directly. */
- _setDate: function(date, endDate) {
- this._selectedDay = this._currentDay = date.getDate();
- this._drawMonth = this._selectedMonth = this._currentMonth = date.getMonth();
- this._drawYear = this._selectedYear = this._currentYear = date.getFullYear();
- if (this._get('rangeSelect')) {
- if (endDate) {
- this._endDay = endDate.getDate();
- this._endMonth = endDate.getMonth();
- this._endYear = endDate.getFullYear();
- } else {
- this._endDay = this._currentDay;
- this._endMonth = this._currentMonth;
- this._endYear = this._currentYear;
- }
- }
- this._adjustDate();
- },
-
- /* Retrieve the date(s) directly. */
- _getDate: function() {
- var startDate = (!this._currentYear || (this._input && this._input.val() == '') ? null :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- if (this._get('rangeSelect')) {
- return [startDate, (!this._endYear ? null :
- new Date(this._endYear, this._endMonth, this._endDay))];
- } else
- return startDate;
- },
-
- /* Generate the HTML for the current state of the date picker. */
- _generateDatepicker: function() {
- var today = new Date();
- today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); // clear time
- var showStatus = this._get('showStatus');
- var isRTL = this._get('isRTL');
- // build the date picker HTML
- var clear = (this._get('mandatory') ? '' :
- '<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('clearStatus') || ' ') : '') + '>' +
- this._get('clearText') + '</a></div>');
- var controls = '<div class="ui-datepicker-control">' + (isRTL ? '' : clear) +
- '<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"' +
- (showStatus ? this._addStatus(this._get('closeStatus') || ' ') : '') + '>' +
- this._get('closeText') + '</a></div>' + (isRTL ? clear : '') + '</div>';
- var prompt = this._get('prompt');
- var closeAtTop = this._get('closeAtTop');
- var hideIfNoPrevNext = this._get('hideIfNoPrevNext');
- var numMonths = this._getNumberOfMonths();
- var stepMonths = this._get('stepMonths');
- var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- var drawMonth = this._drawMonth;
- var drawYear = this._drawYear;
- if (maxDate) {
- var maxDraw = new Date(maxDate.getFullYear(),
- maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate());
- maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
- while (new Date(drawYear, drawMonth, 1) > maxDraw) {
- drawMonth--;
- if (drawMonth < 0) {
- drawMonth = 11;
- drawYear--;
- }
- }
- }
- // controls and links
- var prev = '<div class="ui-datepicker-prev">' + (this._canAdjustMonth(-1, drawYear, drawMonth) ?
- '<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', -' + stepMonths + ', \'M\');"' +
- (showStatus ? this._addStatus(this._get('prevStatus') || ' ') : '') + '>' +
- this._get('prevText') + '</a>' :
- (hideIfNoPrevNext ? '' : '<label>' + this._get('prevText') + '</label>')) + '</div>';
- var next = '<div class="ui-datepicker-next">' + (this._canAdjustMonth(+1, drawYear, drawMonth) ?
- '<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', +' + stepMonths + ', \'M\');"' +
- (showStatus ? this._addStatus(this._get('nextStatus') || ' ') : '') + '>' +
- this._get('nextText') + '</a>' :
- (hideIfNoPrevNext ? '>' : '<label>' + this._get('nextText') + '</label>')) + '</div>';
- var html = (prompt ? '<div class="ui-datepicker-prompt">' + prompt + '</div>' : '') +
- (closeAtTop && !this._inline ? controls : '') +
- '<div class="ui-datepicker-links">' + (isRTL ? next : prev) +
- (this._isInRange(today) ? '<div class="ui-datepicker-current">' +
- '<a onclick="jQuery.datepicker._gotoToday(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('currentStatus') || ' ') : '') + '>' +
- this._get('currentText') + '</a></div>' : '') + (isRTL ? prev : next) + '</div>';
- var showWeeks = this._get('showWeeks');
- for (var row = 0; row < numMonths[0]; row++)
- for (var col = 0; col < numMonths[1]; col++) {
- var selectedDate = new Date(drawYear, drawMonth, this._selectedDay);
- html += '<div class="ui-datepicker-oneMonth' + (col == 0 ? ' ui-datepicker-newRow' : '') + '">' +
- this._generateMonthYearHeader(drawMonth, drawYear, minDate, maxDate,
- selectedDate, row > 0 || col > 0) + // draw month headers
- '<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead>' +
- '<tr class="ui-datepicker-titleRow">' +
- (showWeeks ? '<td>' + this._get('weekHeader') + '</td>' : '');
- var firstDay = this._get('firstDay');
- var changeFirstDay = this._get('changeFirstDay');
- var dayNames = this._get('dayNames');
- var dayNamesShort = this._get('dayNamesShort');
- var dayNamesMin = this._get('dayNamesMin');
- for (var dow = 0; dow < 7; dow++) { // days of the week
- var day = (dow + firstDay) % 7;
- var status = this._get('dayStatus') || ' ';
- status = (status.indexOf('DD') > -1 ? status.replace(/DD/, dayNames[day]) :
- status.replace(/D/, dayNamesShort[day]));
- html += '<td' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-weekEndCell"' : '') + '>' +
- (!changeFirstDay ? '<span' :
- '<a onclick="jQuery.datepicker._changeFirstDay(' + this._id + ', ' + day + ');"') +
- (showStatus ? this._addStatus(status) : '') + ' title="' + dayNames[day] + '">' +
- dayNamesMin[day] + (changeFirstDay ? '</a>' : '</span>') + '</td>';
- }
- html += '</tr></thead><tbody>';
- var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
- if (drawYear == this._selectedYear && drawMonth == this._selectedMonth) {
- this._selectedDay = Math.min(this._selectedDay, daysInMonth);
- }
- var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
- var currentDate = (!this._currentDay ? new Date(9999, 9, 9) :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- var endDate = this._endDay ? new Date(this._endYear, this._endMonth, this._endDay) : currentDate;
- var printDate = new Date(drawYear, drawMonth, 1 - leadDays);
- var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
- var beforeShowDay = this._get('beforeShowDay');
- var showOtherMonths = this._get('showOtherMonths');
- var calculateWeek = this._get('calculateWeek') || $.datepicker.iso8601Week;
- var dateStatus = this._get('statusForDate') || $.datepicker.dateStatus;
- for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
- html += '<tr class="ui-datepicker-daysRow">' +
- (showWeeks ? '<td class="ui-datepicker-weekCol">' + calculateWeek(printDate) + '</td>' : '');
- for (var dow = 0; dow < 7; dow++) { // create date picker days
- var daySettings = (beforeShowDay ?
- beforeShowDay.apply((this._input ? this._input[0] : null), [printDate]) : [true, '']);
- var otherMonth = (printDate.getMonth() != drawMonth);
- var unselectable = otherMonth || !daySettings[0] ||
- (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
- html += '<td class="ui-datepicker-daysCell' +
- ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-weekEndCell' : '') + // highlight weekends
- (otherMonth ? ' ui-datepicker-otherMonth' : '') + // highlight days from other months
- (printDate.getTime() == selectedDate.getTime() && drawMonth == this._selectedMonth ?
- ' ui-datepicker-daysCellOver' : '') + // highlight selected day
- (unselectable ? ' ui-datepicker-unselectable' : '') + // highlight unselectable days
- (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
- (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
- ' ui-datepicker-currentDay' : '') + // highlight selected day
- (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
- (unselectable ? '' : ' onmouseover="jQuery(this).addClass(\'ui-datepicker-daysCellOver\');' +
- (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' +
- this._id + '\').html(\'' + (dateStatus.apply((this._input ? this._input[0] : null),
- [printDate, this]) || ' ') +'\');') + '"' +
- ' onmouseout="jQuery(this).removeClass(\'ui-datepicker-daysCellOver\');' +
- (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' +
- this._id + '\').html(\' \');') + '" onclick="jQuery.datepicker._selectDay(' +
- this._id + ',' + drawMonth + ',' + drawYear + ', this);"') + '>' + // actions
- (otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months
- (unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
- printDate.setDate(printDate.getDate() + 1);
- }
- html += '</tr>';
- }
- drawMonth++;
- if (drawMonth > 11) {
- drawMonth = 0;
- drawYear++;
- }
- html += '</tbody></table></div>';
- }
- html += (showStatus ? '<div style="clear: both;"></div><div id="ui-datepicker-status-' + this._id +
- '" class="ui-datepicker-status">' + (this._get('initStatus') || ' ') + '</div>' : '') +
- (!closeAtTop && !this._inline ? controls : '') +
- '<div style="clear: both;"></div>' +
- ($.browser.msie && parseInt($.browser.version) < 7 && !this._inline ?
- '<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>' : '');
- return html;
- },
-
- /* Generate the month and year header. */
- _generateMonthYearHeader: function(drawMonth, drawYear, minDate, maxDate, selectedDate, secondary) {
- minDate = (this._rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
- var showStatus = this._get('showStatus');
- var html = '<div class="ui-datepicker-header">';
- // month selection
- var monthNames = this._get('monthNames');
- if (secondary || !this._get('changeMonth'))
- html += monthNames[drawMonth] + ' ';
-
- else {
- var inMinYear = (minDate && minDate.getFullYear() == drawYear);
- var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
- html += '<select class="ui-datepicker-newMonth" ' +
- 'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'M\');" ' +
- 'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('monthStatus') || ' ') : '') + '>';
- for (var month = 0; month < 12; month++) {
- if ((!inMinYear || month >= minDate.getMonth()) &&
- (!inMaxYear || month <= maxDate.getMonth())) {
- html += '<option value="' + month + '"' +
- (month == drawMonth ? ' selected="selected"' : '') +
- '>' + monthNames[month] + '</option>';
- }
- }
- html += '</select>';
- }
- // year selection
- if (secondary || !this._get('changeYear'))
- html += drawYear;
- else {
- // determine range of years to display
- var years = this._get('yearRange').split(':');
- var year = 0;
- var endYear = 0;
- if (years.length != 2) {
- year = drawYear - 10;
- endYear = drawYear + 10;
- } else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
- year = new Date().getFullYear() + parseInt(years[0], 10);
- endYear = new Date().getFullYear() + parseInt(years[1], 10);
- } else {
- year = parseInt(years[0], 10);
- endYear = parseInt(years[1], 10);
- }
- year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
- endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
- html += '<select class="ui-datepicker-newYear" ' +
- 'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'Y\');" ' +
- 'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' +
- (showStatus ? this._addStatus(this._get('yearStatus') || ' ') : '') + '>';
- for (; year <= endYear; year++) {
- html += '<option value="' + year + '"' +
- (year == drawYear ? ' selected="selected"' : '') +
- '>' + year + '</option>';
- }
- html += '</select>';
- }
- html += '</div>'; // Close datepicker_header
- return html;
- },
-
- /* Provide code to set and clear the status panel. */
- _addStatus: function(text) {
- return ' onmouseover="jQuery(\'#ui-datepicker-status-' + this._id + '\').html(\'' + text + '\');" ' +
- 'onmouseout="jQuery(\'#ui-datepicker-status-' + this._id + '\').html(\' \');"';
- },
-
- /* Adjust one of the date sub-fields. */
- _adjustDate: function(offset, period) {
- var year = this._drawYear + (period == 'Y' ? offset : 0);
- var month = this._drawMonth + (period == 'M' ? offset : 0);
- var day = Math.min(this._selectedDay, this._getDaysInMonth(year, month)) +
- (period == 'D' ? offset : 0);
- var date = new Date(year, month, day);
- // ensure it is within the bounds set
- var minDate = this._getMinMaxDate('min', true);
- var maxDate = this._getMinMaxDate('max');
- date = (minDate && date < minDate ? minDate : date);
- date = (maxDate && date > maxDate ? maxDate : date);
- this._selectedDay = date.getDate();
- this._drawMonth = this._selectedMonth = date.getMonth();
- this._drawYear = this._selectedYear = date.getFullYear();
- },
-
- /* Determine the number of months to show. */
- _getNumberOfMonths: function() {
- var numMonths = this._get('numberOfMonths');
- return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
- },
-
- /* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */
- _getMinMaxDate: function(minMax, checkRange) {
- var date = this._determineDate(minMax + 'Date', null);
- if (date) {
- date.setHours(0);
- date.setMinutes(0);
- date.setSeconds(0);
- date.setMilliseconds(0);
- }
- return date || (checkRange ? this._rangeStart : null);
- },
-
- /* Find the number of days in a given month. */
- _getDaysInMonth: function(year, month) {
- return 32 - new Date(year, month, 32).getDate();
- },
-
- /* Find the day of the week of the first of a month. */
- _getFirstDayOfMonth: function(year, month) {
- return new Date(year, month, 1).getDay();
- },
-
- /* Determines if we should allow a "next/prev" month display change. */
- _canAdjustMonth: function(offset, curYear, curMonth) {
- var numMonths = this._getNumberOfMonths();
- var date = new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1);
- if (offset < 0)
- date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
- return this._isInRange(date);
- },
-
- /* Is the given date in the accepted range? */
- _isInRange: function(date) {
- // during range selection, use minimum of selected date and range start
- var newMinDate = (!this._rangeStart ? null :
- new Date(this._selectedYear, this._selectedMonth, this._selectedDay));
- newMinDate = (newMinDate && this._rangeStart < newMinDate ? this._rangeStart : newMinDate);
- var minDate = newMinDate || this._getMinMaxDate('min');
- var maxDate = this._getMinMaxDate('max');
- return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
- },
-
- /* Provide the configuration settings for formatting/parsing. */
- _getFormatConfig: function() {
- var shortYearCutoff = this._get('shortYearCutoff');
- shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
- return {shortYearCutoff: shortYearCutoff,
- dayNamesShort: this._get('dayNamesShort'), dayNames: this._get('dayNames'),
- monthNamesShort: this._get('monthNamesShort'), monthNames: this._get('monthNames')};
- },
-
- /* Format the given date for display. */
- _formatDate: function(day, month, year) {
- if (!day) {
- this._currentDay = this._selectedDay;
- this._currentMonth = this._selectedMonth;
- this._currentYear = this._selectedYear;
- }
- var date = (day ? (typeof day == 'object' ? day : new Date(year, month, day)) :
- new Date(this._currentYear, this._currentMonth, this._currentDay));
- return $.datepicker.formatDate(this._get('dateFormat'), date, this._getFormatConfig());
- }
-});
-
-/* jQuery extend now ignores nulls! */
-function extendRemove(target, props) {
- $.extend(target, props);
- for (var name in props)
- if (props[name] == null)
- target[name] = null;
- return target;
-};
-
-/* Invoke the datepicker functionality.
- @param options String - a command, optionally followed by additional parameters or
- Object - settings for attaching new datepicker functionality
- @return jQuery object */
-$.fn.datepicker = function(options){
- var otherArgs = Array.prototype.slice.call(arguments, 1);
- if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate')) {
- return $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this[0]].concat(otherArgs));
- }
- return this.each(function() {
- typeof options == 'string' ?
- $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this].concat(otherArgs)) :
- $.datepicker._attachDatepicker(this, options);
- });
-};
-
-$.datepicker = new Datepicker(); // singleton instance
-
-/* Initialise the date picker. */
-$(document).ready(function() {
- $(document.body).append($.datepicker._datepickerDiv)
- .mousedown($.datepicker._checkExternalClick);
-});
-
-})(jQuery);
+/* + * jQuery UI Datepicker + * + * Copyright (c) 2006, 2007, 2008 Marc Grabanski + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Datepicker + * Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au). + */ + +;(function($) { // hide the namespace + +/* Date picker manager. + Use the singleton instance of this class, $.datepicker, to interact with the date picker. + Settings for (groups of) date pickers are maintained in an instance object + (DatepickerInstance), allowing multiple different settings on the same page. */ + +function Datepicker() { + this.debug = false; // Change this to true to start debugging + this._nextId = 0; // Next ID for a date picker instance + this._inst = []; // List of instances indexed by ID + this._curInst = null; // The current instance in use + this._disabledInputs = []; // List of date picker inputs that have been disabled + this._datepickerShowing = false; // True if the popup picker is showing , false if not + this._inDialog = false; // True if showing within a "dialog", false if not + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + clearText: 'Clear', // Display text for clear link + clearStatus: 'Erase the current date', // Status text for clear link + closeText: 'Close', // Display text for close link + closeStatus: 'Close without change', // Status text for close link + prevText: '<Prev', // Display text for previous month link + prevStatus: 'Show the previous month', // Status text for previous month link + nextText: 'Next>', // Display text for next month link + nextStatus: 'Show the next month', // Status text for next month link + currentText: 'Today', // Display text for current month link + currentStatus: 'Show the current month', // Status text for current month link + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], // Names of months for drop-down and formatting + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting + monthStatus: 'Show a different month', // Status text for selecting a month + yearStatus: 'Show a different year', // Status text for selecting a year + weekHeader: 'Wk', // Header for the week of the year column + weekStatus: 'Week of the year', // Status text for the week of the year column + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday + dayStatus: 'Set DD as first week day', // Status text for the day of the week selection + dateStatus: 'Select DD, M d', // Status text for the date selection + dateFormat: 'mm/dd/yy', // See format options on parseDate + firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... + initStatus: 'Select a date', // Initial Status text on opening + isRTL: false // True if right-to-left language, false if left-to-right + }; + this._defaults = { // Global defaults for all the date picker instances + showOn: 'focus', // 'focus' for popup on focus, + // 'button' for trigger button, or 'both' for either + showAnim: 'show', // Name of jQuery animation for popup + defaultDate: null, // Used when field is blank: actual date, + // +/-number for offset from today, null for today + appendText: '', // Display text following the input box, e.g. showing the format + buttonText: '...', // Text for trigger button + buttonImage: '', // URL for trigger button image + buttonImageOnly: false, // True if the image appears alone, false if it appears on a button + closeAtTop: true, // True to have the clear/close at the top, + // false to have them at the bottom + mandatory: false, // True to hide the Clear link, false to include it + hideIfNoPrevNext: false, // True to hide next/previous month links + // if not applicable, false to just disable them + changeMonth: true, // True if month can be selected directly, false if only prev/next + changeYear: true, // True if year can be selected directly, false if only prev/next + yearRange: '-10:+10', // Range of years to display in drop-down, + // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn) + changeFirstDay: true, // True to click on day name to change, false to remain as set + showOtherMonths: false, // True to show dates in other months, false to leave blank + showWeeks: false, // True to show week of the year, false to omit + calculateWeek: this.iso8601Week, // How to calculate the week of the year, + // takes a Date and returns the number of the week for it + shortYearCutoff: '+10', // Short year values < this are in the current century, + // > this are in the previous century, + // string value starting with '+' for current year + value + showStatus: false, // True to show status bar at bottom, false to not show it + statusForDate: this.dateStatus, // Function to provide status text for a date - + // takes date and instance as parameters, returns display text + minDate: null, // The earliest selectable date, or null for no limit + maxDate: null, // The latest selectable date, or null for no limit + speed: 'normal', // Speed of display/closure + beforeShowDay: null, // Function that takes a date and returns an array with + // [0] = true if selectable, false if not, + // [1] = custom CSS class name(s) or '', e.g. $.datepicker.noWeekends + beforeShow: null, // Function that takes an input field and + // returns a set of custom settings for the date picker + onSelect: null, // Define a callback function when a date is selected + onClose: null, // Define a callback function when the datepicker is closed + numberOfMonths: 1, // Number of months to show at a time + stepMonths: 1, // Number of months to step back/forward + rangeSelect: false, // Allows for selecting a date range on one date picker + rangeSeparator: ' - ' // Text between two dates in a range + }; + $.extend(this._defaults, this.regional['']); + this._datepickerDiv = $('<div id="ui-datepicker-div"></div>'); +} + +$.extend(Datepicker.prototype, { + /* Class name added to elements to indicate already configured with a date picker. */ + markerClassName: 'hasDatepicker', + + /* Debug logging (if enabled). */ + log: function () { + if (this.debug) + console.log.apply('', arguments); + }, + + /* Register a new date picker instance - with custom settings. */ + _register: function(inst) { + var id = this._nextId++; + this._inst[id] = inst; + return id; + }, + + /* Retrieve a particular date picker instance based on its ID. */ + _getInst: function(id) { + return this._inst[id] || id; + }, + + /* Override the default settings for all instances of the date picker. + @param settings object - the new settings to use as defaults (anonymous object) + @return the manager object */ + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + /* Attach the date picker to a jQuery selection. + @param target element - the target input field or division or span + @param settings object - the new settings to use for this date picker instance (anonymous) */ + _attachDatepicker: function(target, settings) { + // check for settings on the control itself - in namespace 'date:' + var inlineSettings = null; + for (attrName in this._defaults) { + var attrValue = target.getAttribute('date:' + attrName); + if (attrValue) { + inlineSettings = inlineSettings || {}; + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + var nodeName = target.nodeName.toLowerCase(); + var instSettings = (inlineSettings ? + $.extend(settings || {}, inlineSettings || {}) : settings); + if (nodeName == 'input') { + var inst = (inst && !inlineSettings ? inst : + new DatepickerInstance(instSettings, false)); + this._connectDatepicker(target, inst); + } else if (nodeName == 'div' || nodeName == 'span') { + var inst = new DatepickerInstance(instSettings, true); + this._inlineDatepicker(target, inst); + } + }, + + /* Detach a datepicker from its control. + @param target element - the target input field or division or span */ + _destroyDatepicker: function(target) { + var nodeName = target.nodeName.toLowerCase(); + var calId = target._calId; + target._calId = null; + var $target = $(target); + if (nodeName == 'input') { + $target.siblings('.ui-datepicker-append').replaceWith('').end() + .siblings('.ui-datepicker-trigger').replaceWith('').end() + .removeClass(this.markerClassName) + .unbind('focus', this._showDatepicker) + .unbind('keydown', this._doKeyDown) + .unbind('keypress', this._doKeyPress); + var wrapper = $target.parents('.ui-datepicker-wrap'); + if (wrapper) + wrapper.replaceWith(wrapper.html()); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + if ($('input[_calId=' + calId + ']').length == 0) + // clean up if last for this ID + this._inst[calId] = null; + }, + + /* Enable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _enableDatepicker: function(target) { + target.disabled = false; + $(target).siblings('button.ui-datepicker-trigger').each(function() { this.disabled = false; }).end() + .siblings('img.ui-datepicker-trigger').css({opacity: '1.0', cursor: ''}); + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _disableDatepicker: function(target) { + target.disabled = true; + $(target).siblings('button.ui-datepicker-trigger').each(function() { this.disabled = true; }).end() + .siblings('img.ui-datepicker-trigger').css({opacity: '0.5', cursor: 'default'}); + this._disabledInputs = $.map($.datepicker._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + this._disabledInputs[$.datepicker._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + @param target element - the target input field or division or span + @return boolean - true if disabled, false if enabled */ + _isDisabledDatepicker: function(target) { + if (!target) + return false; + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] == target) + return true; + } + return false; + }, + + /* Update the settings for a date picker attached to an input field or division. + @param target element - the target input field or division or span + @param name string - the name of the setting to change or + object - the new settings to update + @param value any - the new value for the setting (omit if above is an object) */ + _changeDatepicker: function(target, name, value) { + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst = this._getInst(target._calId)) { + extendRemove(inst._settings, settings); + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + @param target element - the target input field or division or span + @param date Date - the new date + @param endDate Date - the new end date for a range (optional) */ + _setDateDatepicker: function(target, date, endDate) { + if (inst = this._getInst(target._calId)) { + inst._setDate(date, endDate); + this._updateDatepicker(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + @param target element - the target input field or division or span + @return Date - the current date or + Date[2] - the current dates for a range */ + _getDateDatepicker: function(target) { + var inst = this._getInst(target._calId); + if (inst) { + inst._setDateFromField($(target)); + } + return (inst ? inst._getDate() : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(e) { + var inst = $.datepicker._getInst(this._calId); + if ($.datepicker._datepickerShowing) + switch (e.keyCode) { + case 9: $.datepicker._hideDatepicker(null, ''); + break; // hide on tab out + case 13: $.datepicker._selectDay(inst, inst._selectedMonth, inst._selectedYear, + $('td.ui-datepicker-daysCellOver', inst._datepickerDiv)[0]); + return false; // don't submit the form + break; // select the value on enter + case 27: $.datepicker._hideDatepicker(null, inst._get('speed')); + break; // hide on escape + case 33: $.datepicker._adjustDate(inst, + (e.ctrlKey ? -1 : -inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M')); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(inst, + (e.ctrlKey ? +1 : +inst._get('stepMonths')), (e.ctrlKey ? 'Y' : 'M')); + break; // next month/year on page down/+ ctrl + case 35: if (e.ctrlKey) $.datepicker._clearDate(inst); + break; // clear on ctrl+end + case 36: if (e.ctrlKey) $.datepicker._gotoToday(inst); + break; // current on ctrl+home + case 37: if (e.ctrlKey) $.datepicker._adjustDate(inst, -1, 'D'); + break; // -1 day on ctrl+left + case 38: if (e.ctrlKey) $.datepicker._adjustDate(inst, -7, 'D'); + break; // -1 week on ctrl+up + case 39: if (e.ctrlKey) $.datepicker._adjustDate(inst, +1, 'D'); + break; // +1 day on ctrl+right + case 40: if (e.ctrlKey) $.datepicker._adjustDate(inst, +7, 'D'); + break; // +1 week on ctrl+down + } + else if (e.keyCode == 36 && e.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(e) { + var inst = $.datepicker._getInst(this._calId); + var chars = $.datepicker._possibleChars(inst._get('dateFormat')); + var chr = String.fromCharCode(e.charCode == undefined ? e.keyCode : e.charCode); + return e.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + }, + + /* Attach the date picker to an input field. */ + _connectDatepicker: function(target, inst) { + var input = $(target); + if (input.is('.' + this.markerClassName)) + return; + var appendText = inst._get('appendText'); + var isRTL = inst._get('isRTL'); + if (appendText) { + if (isRTL) + input.before('<span class="ui-datepicker-append">' + appendText); + else + input.after('<span class="ui-datepicker-append">' + appendText); + } + var showOn = inst._get('showOn'); + if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field + input.focus(this._showDatepicker); + if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked + input.wrap('<span class="ui-datepicker-wrap">'); + var buttonText = inst._get('buttonText'); + var buttonImage = inst._get('buttonImage'); + var trigger = $(inst._get('buttonImageOnly') ? + $('<img>').addClass('ui-datepicker-trigger').attr({ src: buttonImage, alt: buttonText, title: buttonText }) : + $('<button>').addClass('ui-datepicker-trigger').attr({ type: 'button' }).html(buttonImage != '' ? + $('<img>').attr({ src:buttonImage, alt:buttonText, title:buttonText }) : buttonText)); + if (isRTL) + input.before(trigger); + else + input.after(trigger); + trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target) + $.datepicker._hideDatepicker(); + else + $.datepicker._showDatepicker(target); + }); + } + input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress) + .bind("setData.datepicker", function(event, key, value) { + inst._settings[key] = value; + }).bind("getData.datepicker", function(event, key) { + return inst._get(key); + }); + input[0]._calId = inst._id; + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var input = $(target); + if (input.is('.' + this.markerClassName)) + return; + input.addClass(this.markerClassName).append(inst._datepickerDiv) + .bind("setData.datepicker", function(event, key, value){ + inst._settings[key] = value; + }).bind("getData.datepicker", function(event, key){ + return inst._get(key); + }); + input[0]._calId = inst._id; + this._updateDatepicker(inst); + }, + + /* Tidy up after displaying the date picker. */ + _inlineShow: function(inst) { + var numMonths = inst._getNumberOfMonths(); // fix width for dynamic number of date pickers + inst._datepickerDiv.width(numMonths[1] * $('.ui-datepicker', inst._datepickerDiv[0]).width()); + }, + + /* Pop-up the date picker in a "dialog" box. + @param input element - ignored + @param dateText string - the initial date to display (in the current format) + @param onSelect function - the function(dateText) to call when a date is selected + @param settings object - update the dialog date picker instance's settings (anonymous object) + @param pos int[2] - coordinates for the dialog's position within the screen or + event - with x/y coordinates or + leave empty for default (screen centre) + @return the manager object */ + _dialogDatepicker: function(input, dateText, onSelect, settings, pos) { + var inst = this._dialogInst; // internal instance + if (!inst) { + inst = this._dialogInst = new DatepickerInstance({}, false); + this._dialogInput = $('<input type="text" size="1" style="position: absolute; top: -100px;"/>'); + this._dialogInput.keydown(this._doKeyDown); + $('body').append(this._dialogInput); + this._dialogInput[0]._calId = inst._id; + } + extendRemove(inst._settings, settings || {}); + this._dialogInput.val(dateText); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; + var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + var scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px'); + inst._settings.onSelect = onSelect; + this._inDialog = true; + this._datepickerDiv.addClass('ui-datepicker-dialog'); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) + $.blockUI(this._datepickerDiv); + return this; + }, + + /* Pop-up the date picker for a given input field. + @param input element - the input field attached to the date picker or + event - if triggered by focus */ + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger + input = $('input', input.parentNode)[0]; + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here + return; + var inst = $.datepicker._getInst(input._calId); + var beforeShow = inst._get('beforeShow'); + extendRemove(inst._settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {})); + $.datepicker._hideDatepicker(null, ''); + $.datepicker._lastInput = input; + inst._setDateFromField(input); + if ($.datepicker._inDialog) // hide cursor + input.value = ''; + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + var isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css('position') == 'fixed'; + }); + if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled + $.datepicker._pos[0] -= document.documentElement.scrollLeft; + $.datepicker._pos[1] -= document.documentElement.scrollTop; + } + inst._datepickerDiv.css('position', ($.datepicker._inDialog && $.blockUI ? + 'static' : (isFixed ? 'fixed' : 'absolute'))) + .css({ left: $.datepicker._pos[0] + 'px', top: $.datepicker._pos[1] + 'px' }); + $.datepicker._pos = null; + inst._rangeStart = null; + $.datepicker._updateDatepicker(inst); + if (!inst._inline) { + var speed = inst._get('speed'); + var postProcess = function() { + $.datepicker._datepickerShowing = true; + $.datepicker._afterShow(inst); + }; + var showAnim = inst._get('showAnim') || 'show'; + inst._datepickerDiv[showAnim](speed, postProcess); + if (speed == '') + postProcess(); + if (inst._input[0].type != 'hidden') + inst._input[0].focus(); + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + inst._datepickerDiv.empty().append(inst._generateDatepicker()); + var numMonths = inst._getNumberOfMonths(); + if (numMonths[0] != 1 || numMonths[1] != 1) + inst._datepickerDiv.addClass('ui-datepicker-multi'); + else + inst._datepickerDiv.removeClass('ui-datepicker-multi'); + + if (inst._get('isRTL')) + inst._datepickerDiv.addClass('ui-datepicker-rtl'); + else + inst._datepickerDiv.removeClass('ui-datepicker-rtl'); + + if (inst._input && inst._input[0].type != 'hidden') + $(inst._input[0]).focus(); + }, + + /* Tidy up after displaying the date picker. */ + _afterShow: function(inst) { + var numMonths = inst._getNumberOfMonths(); // fix width for dynamic number of date pickers + inst._datepickerDiv.width(numMonths[1] * $('.ui-datepicker', inst._datepickerDiv[0])[0].offsetWidth); + if ($.browser.msie && parseInt($.browser.version) < 7) { // fix IE < 7 select problems + $('iframe.ui-datepicker-cover').css({width: inst._datepickerDiv.width() + 4, + height: inst._datepickerDiv.height() + 4}); + } + // re-position on screen if necessary + var isFixed = inst._datepickerDiv.css('position') == 'fixed'; + var pos = inst._input ? $.datepicker._findPos(inst._input[0]) : null; + var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; + var scrollX = (isFixed ? 0 : document.documentElement.scrollLeft || document.body.scrollLeft); + var scrollY = (isFixed ? 0 : document.documentElement.scrollTop || document.body.scrollTop); + // reposition date picker horizontally if outside the browser window + if ((inst._datepickerDiv.offset().left + inst._datepickerDiv.width() - + (isFixed && $.browser.msie ? document.documentElement.scrollLeft : 0)) > + (browserWidth + scrollX)) { + inst._datepickerDiv.css('left', Math.max(scrollX, + pos[0] + (inst._input ? $(inst._input[0]).width() : null) - inst._datepickerDiv.width() - + (isFixed && $.browser.opera ? document.documentElement.scrollLeft : 0)) + 'px'); + } + // reposition date picker vertically if outside the browser window + if ((inst._datepickerDiv.offset().top + inst._datepickerDiv.height() - + (isFixed && $.browser.msie ? document.documentElement.scrollTop : 0)) > + (browserHeight + scrollY) ) { + inst._datepickerDiv.css('top', Math.max(scrollY, + pos[1] - (this._inDialog ? 0 : inst._datepickerDiv.height()) - + (isFixed && $.browser.opera ? document.documentElement.scrollTop : 0)) + 'px'); + } + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { + obj = obj.nextSibling; + } + var position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. + @param input element - the input field attached to the date picker + @param speed string - the speed at which to close the date picker */ + _hideDatepicker: function(input, speed) { + var inst = this._curInst; + if (!inst) + return; + var rangeSelect = inst._get('rangeSelect'); + if (rangeSelect && this._stayOpen) { + this._selectDate(inst, inst._formatDate( + inst._currentDay, inst._currentMonth, inst._currentYear)); + } + this._stayOpen = false; + if (this._datepickerShowing) { + speed = (speed != null ? speed : inst._get('speed')); + var showAnim = inst._get('showAnim'); + inst._datepickerDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))](speed, function() { + $.datepicker._tidyDialog(inst); + }); + if (speed == '') + this._tidyDialog(inst); + var onClose = inst._get('onClose'); + if (onClose) { + onClose.apply((inst._input ? inst._input[0] : null), + [inst._getDate(), inst]); // trigger custom callback + } + this._datepickerShowing = false; + this._lastInput = null; + inst._settings.prompt = null; + if (this._inDialog) { + this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); + if ($.blockUI) { + $.unblockUI(); + $('body').append(this._datepickerDiv); + } + } + this._inDialog = false; + } + this._curInst = null; + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst._datepickerDiv.removeClass('ui-datepicker-dialog').unbind('.ui-datepicker'); + $('.ui-datepicker-prompt', inst._datepickerDiv).remove(); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) + return; + var $target = $(event.target); + if (($target.parents("#ui-datepicker-div").length == 0) && + !$target.hasClass('hasDatepicker') && + !$target.hasClass('ui-datepicker-trigger') && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI)) { + $.datepicker._hideDatepicker(null, ''); + } + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var inst = this._getInst(id); + inst._adjustDate(offset, period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var date = new Date(); + var inst = this._getInst(id); + inst._selectedDay = date.getDate(); + inst._drawMonth = inst._selectedMonth = date.getMonth(); + inst._drawYear = inst._selectedYear = date.getFullYear(); + this._adjustDate(inst); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var inst = this._getInst(id); + inst._selectingMonthYear = false; + inst[period == 'M' ? '_drawMonth' : '_drawYear'] = + select.options[select.selectedIndex].value - 0; + this._adjustDate(inst); + }, + + /* Restore input focus after not changing month/year. */ + _clickMonthYear: function(id) { + var inst = this._getInst(id); + if (inst._input && inst._selectingMonthYear && !$.browser.msie) + inst._input[0].focus(); + inst._selectingMonthYear = !inst._selectingMonthYear; + }, + + /* Action for changing the first week day. */ + _changeFirstDay: function(id, day) { + var inst = this._getInst(id); + inst._settings.firstDay = day; + this._updateDatepicker(inst); + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + if ($(td).is('.ui-datepicker-unselectable')) + return; + var inst = this._getInst(id); + var rangeSelect = inst._get('rangeSelect'); + if (rangeSelect) { + if (!this._stayOpen) { + $('.ui-datepicker td').removeClass('ui-datepicker-currentDay'); + $(td).addClass('ui-datepicker-currentDay'); + } + this._stayOpen = !this._stayOpen; + } + inst._selectedDay = inst._currentDay = $('a', td).html(); + inst._selectedMonth = inst._currentMonth = month; + inst._selectedYear = inst._currentYear = year; + this._selectDate(id, inst._formatDate( + inst._currentDay, inst._currentMonth, inst._currentYear)); + if (this._stayOpen) { + inst._endDay = inst._endMonth = inst._endYear = null; + inst._rangeStart = new Date(inst._currentYear, inst._currentMonth, inst._currentDay); + this._updateDatepicker(inst); + } + else if (rangeSelect) { + inst._endDay = inst._currentDay; + inst._endMonth = inst._currentMonth; + inst._endYear = inst._currentYear; + inst._selectedDay = inst._currentDay = inst._rangeStart.getDate(); + inst._selectedMonth = inst._currentMonth = inst._rangeStart.getMonth(); + inst._selectedYear = inst._currentYear = inst._rangeStart.getFullYear(); + inst._rangeStart = null; + if (inst._inline) + this._updateDatepicker(inst); + } + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var inst = this._getInst(id); + if (inst._get('mandatory')) + return; + this._stayOpen = false; + inst._endDay = inst._endMonth = inst._endYear = inst._rangeStart = null; + this._selectDate(inst, ''); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var inst = this._getInst(id); + dateStr = (dateStr != null ? dateStr : inst._formatDate()); + if (inst._rangeStart) + dateStr = inst._formatDate(inst._rangeStart) + inst._get('rangeSeparator') + dateStr; + if (inst._input) + inst._input.val(dateStr); + var onSelect = inst._get('onSelect'); + if (onSelect) + onSelect.apply((inst._input ? inst._input[0] : null), [dateStr, inst]); // trigger custom callback + else if (inst._input) + inst._input.trigger('change'); // fire the change event + if (inst._inline) + this._updateDatepicker(inst); + else if (!this._stayOpen) { + this._hideDatepicker(null, inst._get('speed')); + this._lastInput = inst._input[0]; + if (typeof(inst._input[0]) != 'object') + inst._input[0].focus(); // restore focus + this._lastInput = null; + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. + @param date Date - the date to customise + @return [boolean, string] - is this date selectable?, what is its CSS class? */ + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), '']; + }, + + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + @param date Date - the date to get the week for + @return number - the number of the week within the year that contains this date */ + iso8601Week: function(date) { + var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), (date.getTimezoneOffset() / -60)); + var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan + var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7 + firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday + if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary + checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year + return $.datepicker.iso8601Week(checkDate); + } else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year + firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7; + if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary + checkDate.setDate(checkDate.getDate() + 3); // Generate for next year + return $.datepicker.iso8601Week(checkDate); + } + } + return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date + }, + + /* Provide status text for a particular date. + @param date the date to get the status for + @param inst the current datepicker instance + @return the status display text for this date */ + dateStatus: function(date, inst) { + return $.datepicker.formatDate(inst._get('dateStatus'), date, inst._getFormatConfig()); + }, + + /* Parse a string value into a date object. + The format can be combinations of the following: + d - day of month (no leading zero) + dd - day of month (two digit) + D - day name short + DD - day name long + m - month of year (no leading zero) + mm - month of year (two digit) + M - month name short + MM - month name long + y - year (two digit) + yy - year (four digit) + '...' - literal text + '' - single quote + + @param format String - the expected format of the date + @param value String - the date in the above format + @param settings Object - attributes include: + shortYearCutoff Number - the cutoff year for determining the century (optional) + dayNamesShort String[7] - abbreviated names of the days from Sunday (optional) + dayNames String[7] - names of the days from Sunday (optional) + monthNamesShort String[12] - abbreviated names of the months (optional) + monthNames String[12] - names of the months (optional) + @return Date - the extracted date value or null if value is blank */ + parseDate: function (format, value, settings) { + if (format == null || value == null) + throw 'Invalid arguments'; + value = (typeof value == 'object' ? value.toString() : value + ''); + if (value == '') + return null; + var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + var year = -1; + var month = -1; + var day = -1; + var literal = false; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Extract a number from the string value + var getNumber = function(match) { + lookAhead(match); + var size = (match == 'y' ? 4 : 2); + var num = 0; + while (size > 0 && iValue < value.length && + value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') { + num = num * 10 + (value.charAt(iValue++) - 0); + size--; + } + if (size == (match == 'y' ? 4 : 2)) + throw 'Missing number at position ' + iValue; + return num; + }; + // Extract a name from the string value and convert to an index + var getName = function(match, shortNames, longNames) { + var names = (lookAhead(match) ? longNames : shortNames); + var size = 0; + for (var j = 0; j < names.length; j++) + size = Math.max(size, names[j].length); + var name = ''; + var iInit = iValue; + while (size > 0 && iValue < value.length) { + name += value.charAt(iValue++); + for (var i = 0; i < names.length; i++) + if (name == names[i]) + return i + 1; + size--; + } + throw 'Unknown name at position ' + iInit; + }; + // Confirm that a literal character matches the string value + var checkLiteral = function() { + if (value.charAt(iValue) != format.charAt(iFormat)) + throw 'Unexpected literal at position ' + iValue; + iValue++; + }; + var iValue = 0; + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + checkLiteral(); + else + switch (format.charAt(iFormat)) { + case 'd': + day = getNumber('d'); + break; + case 'D': + getName('D', dayNamesShort, dayNames); + break; + case 'm': + month = getNumber('m'); + break; + case 'M': + month = getName('M', monthNamesShort, monthNames); + break; + case 'y': + year = getNumber('y'); + break; + case "'": + if (lookAhead("'")) + checkLiteral(); + else + literal = true; + break; + default: + checkLiteral(); + } + } + if (year < 100) { + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + } + var date = new Date(year, month - 1, day); + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) { + throw 'Invalid date'; // E.g. 31/02/* + } + return date; + }, + + /* Format a date object into a string value. + The format can be combinations of the following: + d - day of month (no leading zero) + dd - day of month (two digit) + D - day name short + DD - day name long + m - month of year (no leading zero) + mm - month of year (two digit) + M - month name short + MM - month name long + y - year (two digit) + yy - year (four digit) + '...' - literal text + '' - single quote + + @param format String - the desired format of the date + @param date Date - the date value to format + @param settings Object - attributes include: + dayNamesShort String[7] - abbreviated names of the days from Sunday (optional) + dayNames String[7] - names of the days from Sunday (optional) + monthNamesShort String[12] - abbreviated names of the months (optional) + monthNames String[12] - names of the months (optional) + @return String - the date in the above format */ + formatDate: function (format, date, settings) { + if (!date) + return ''; + var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; + var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; + var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; + var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames; + // Check whether a format character is doubled + var lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match); + if (matches) + iFormat++; + return matches; + }; + // Format a number, with leading zero if necessary + var formatNumber = function(match, value) { + return (lookAhead(match) && value < 10 ? '0' : '') + value; + }; + // Format a name, short or long as requested + var formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }; + var output = ''; + var literal = false; + if (date) { + for (var iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + output += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd': + output += formatNumber('d', date.getDate()); + break; + case 'D': + output += formatName('D', date.getDay(), dayNamesShort, dayNames); + break; + case 'm': + output += formatNumber('m', date.getMonth() + 1); + break; + case 'M': + output += formatName('M', date.getMonth(), monthNamesShort, monthNames); + break; + case 'y': + output += (lookAhead('y') ? date.getFullYear() : + (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100); + break; + case "'": + if (lookAhead("'")) + output += "'"; + else + literal = true; + break; + default: + output += format.charAt(iFormat); + } + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var chars = ''; + var literal = false; + for (var iFormat = 0; iFormat < format.length; iFormat++) + if (literal) + if (format.charAt(iFormat) == "'" && !lookAhead("'")) + literal = false; + else + chars += format.charAt(iFormat); + else + switch (format.charAt(iFormat)) { + case 'd' || 'm' || 'y': + chars += '0123456789'; + break; + case 'D' || 'M': + return null; // Accept anything + case "'": + if (lookAhead("'")) + chars += "'"; + else + literal = true; + break; + default: + chars += format.charAt(iFormat); + } + return chars; + } +}); + +/* Individualised settings for date picker functionality applied to one or more related inputs. + Instances are managed and manipulated through the Datepicker manager. */ +function DatepickerInstance(settings, inline) { + this._id = $.datepicker._register(this); + this._selectedDay = 0; // Current date for selection + this._selectedMonth = 0; // 0-11 + this._selectedYear = 0; // 4-digit year + this._drawMonth = 0; // Current month at start of datepicker + this._drawYear = 0; + this._input = null; // The attached input field + this._inline = inline; // True if showing inline, false if used in a popup + this._datepickerDiv = (!inline ? $.datepicker._datepickerDiv : + $('<div id="ui-datepicker-div-' + this._id + '" class="ui-datepicker-inline">')); + // customise the date picker object - uses manager defaults if not overridden + this._settings = extendRemove(settings || {}); // clone + if (inline) + this._setDate(this._getDefaultDate()); +} + +$.extend(DatepickerInstance.prototype, { + /* Get a setting value, defaulting if necessary. */ + _get: function(name) { + return this._settings[name] !== undefined ? this._settings[name] : $.datepicker._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(input) { + this._input = $(input); + var dateFormat = this._get('dateFormat'); + var dates = this._input ? this._input.val().split(this._get('rangeSeparator')) : null; + this._endDay = this._endMonth = this._endYear = null; + var date = defaultDate = this._getDefaultDate(); + if (dates.length > 0) { + var settings = this._getFormatConfig(); + if (dates.length > 1) { + date = $.datepicker.parseDate(dateFormat, dates[1], settings) || defaultDate; + this._endDay = date.getDate(); + this._endMonth = date.getMonth(); + this._endYear = date.getFullYear(); + } + try { + date = $.datepicker.parseDate(dateFormat, dates[0], settings) || defaultDate; + } catch (e) { + $.datepicker.log(e); + date = defaultDate; + } + } + this._selectedDay = date.getDate(); + this._drawMonth = this._selectedMonth = date.getMonth(); + this._drawYear = this._selectedYear = date.getFullYear(); + this._currentDay = (dates[0] ? date.getDate() : 0); + this._currentMonth = (dates[0] ? date.getMonth() : 0); + this._currentYear = (dates[0] ? date.getFullYear() : 0); + this._adjustDate(); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function() { + var date = this._determineDate('defaultDate', new Date()); + var minDate = this._getMinMaxDate('min', true); + var maxDate = this._getMinMaxDate('max'); + date = (minDate && date < minDate ? minDate : date); + date = (maxDate && date > maxDate ? maxDate : date); + return date; + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(name, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }; + var offsetString = function(offset, getDaysInMonth) { + var date = new Date(); + var matches = /^([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?$/.exec(offset); + if (matches) { + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + switch (matches[2] || 'd') { + case 'd' : case 'D' : + day += (matches[1] - 0); break; + case 'w' : case 'W' : + day += (matches[1] * 7); break; + case 'm' : case 'M' : + month += (matches[1] - 0); + day = Math.min(day, getDaysInMonth(year, month)); + break; + case 'y': case 'Y' : + year += (matches[1] - 0); + day = Math.min(day, getDaysInMonth(year, month)); + break; + } + date = new Date(year, month, day); + } + return date; + }; + var date = this._get(name); + return (date == null ? defaultDate : + (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) : + (typeof date == 'number' ? offsetNumeric(date) : date))); + }, + + /* Set the date(s) directly. */ + _setDate: function(date, endDate) { + this._selectedDay = this._currentDay = date.getDate(); + this._drawMonth = this._selectedMonth = this._currentMonth = date.getMonth(); + this._drawYear = this._selectedYear = this._currentYear = date.getFullYear(); + if (this._get('rangeSelect')) { + if (endDate) { + this._endDay = endDate.getDate(); + this._endMonth = endDate.getMonth(); + this._endYear = endDate.getFullYear(); + } else { + this._endDay = this._currentDay; + this._endMonth = this._currentMonth; + this._endYear = this._currentYear; + } + } + this._adjustDate(); + }, + + /* Retrieve the date(s) directly. */ + _getDate: function() { + var startDate = (!this._currentYear || (this._input && this._input.val() == '') ? null : + new Date(this._currentYear, this._currentMonth, this._currentDay)); + if (this._get('rangeSelect')) { + return [startDate, (!this._endYear ? null : + new Date(this._endYear, this._endMonth, this._endDay))]; + } else + return startDate; + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateDatepicker: function() { + var today = new Date(); + today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); // clear time + var showStatus = this._get('showStatus'); + var isRTL = this._get('isRTL'); + // build the date picker HTML + var clear = (this._get('mandatory') ? '' : + '<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate(' + this._id + ');"' + + (showStatus ? this._addStatus(this._get('clearStatus') || ' ') : '') + '>' + + this._get('clearText') + '</a></div>'); + var controls = '<div class="ui-datepicker-control">' + (isRTL ? '' : clear) + + '<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"' + + (showStatus ? this._addStatus(this._get('closeStatus') || ' ') : '') + '>' + + this._get('closeText') + '</a></div>' + (isRTL ? clear : '') + '</div>'; + var prompt = this._get('prompt'); + var closeAtTop = this._get('closeAtTop'); + var hideIfNoPrevNext = this._get('hideIfNoPrevNext'); + var numMonths = this._getNumberOfMonths(); + var stepMonths = this._get('stepMonths'); + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); + var minDate = this._getMinMaxDate('min', true); + var maxDate = this._getMinMaxDate('max'); + var drawMonth = this._drawMonth; + var drawYear = this._drawYear; + if (maxDate) { + var maxDraw = new Date(maxDate.getFullYear(), + maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate()); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (new Date(drawYear, drawMonth, 1) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + // controls and links + var prev = '<div class="ui-datepicker-prev">' + (this._canAdjustMonth(-1, drawYear, drawMonth) ? + '<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', -' + stepMonths + ', \'M\');"' + + (showStatus ? this._addStatus(this._get('prevStatus') || ' ') : '') + '>' + + this._get('prevText') + '</a>' : + (hideIfNoPrevNext ? '' : '<label>' + this._get('prevText') + '</label>')) + '</div>'; + var next = '<div class="ui-datepicker-next">' + (this._canAdjustMonth(+1, drawYear, drawMonth) ? + '<a onclick="jQuery.datepicker._adjustDate(' + this._id + ', +' + stepMonths + ', \'M\');"' + + (showStatus ? this._addStatus(this._get('nextStatus') || ' ') : '') + '>' + + this._get('nextText') + '</a>' : + (hideIfNoPrevNext ? '>' : '<label>' + this._get('nextText') + '</label>')) + '</div>'; + var html = (prompt ? '<div class="ui-datepicker-prompt">' + prompt + '</div>' : '') + + (closeAtTop && !this._inline ? controls : '') + + '<div class="ui-datepicker-links">' + (isRTL ? next : prev) + + (this._isInRange(today) ? '<div class="ui-datepicker-current">' + + '<a onclick="jQuery.datepicker._gotoToday(' + this._id + ');"' + + (showStatus ? this._addStatus(this._get('currentStatus') || ' ') : '') + '>' + + this._get('currentText') + '</a></div>' : '') + (isRTL ? prev : next) + '</div>'; + var showWeeks = this._get('showWeeks'); + for (var row = 0; row < numMonths[0]; row++) + for (var col = 0; col < numMonths[1]; col++) { + var selectedDate = new Date(drawYear, drawMonth, this._selectedDay); + html += '<div class="ui-datepicker-oneMonth' + (col == 0 ? ' ui-datepicker-newRow' : '') + '">' + + this._generateMonthYearHeader(drawMonth, drawYear, minDate, maxDate, + selectedDate, row > 0 || col > 0) + // draw month headers + '<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead>' + + '<tr class="ui-datepicker-titleRow">' + + (showWeeks ? '<td>' + this._get('weekHeader') + '</td>' : ''); + var firstDay = this._get('firstDay'); + var changeFirstDay = this._get('changeFirstDay'); + var dayNames = this._get('dayNames'); + var dayNamesShort = this._get('dayNamesShort'); + var dayNamesMin = this._get('dayNamesMin'); + for (var dow = 0; dow < 7; dow++) { // days of the week + var day = (dow + firstDay) % 7; + var status = this._get('dayStatus') || ' '; + status = (status.indexOf('DD') > -1 ? status.replace(/DD/, dayNames[day]) : + status.replace(/D/, dayNamesShort[day])); + html += '<td' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-weekEndCell"' : '') + '>' + + (!changeFirstDay ? '<span' : + '<a onclick="jQuery.datepicker._changeFirstDay(' + this._id + ', ' + day + ');"') + + (showStatus ? this._addStatus(status) : '') + ' title="' + dayNames[day] + '">' + + dayNamesMin[day] + (changeFirstDay ? '</a>' : '</span>') + '</td>'; + } + html += '</tr></thead><tbody>'; + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear == this._selectedYear && drawMonth == this._selectedMonth) { + this._selectedDay = Math.min(this._selectedDay, daysInMonth); + } + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + var currentDate = (!this._currentDay ? new Date(9999, 9, 9) : + new Date(this._currentYear, this._currentMonth, this._currentDay)); + var endDate = this._endDay ? new Date(this._endYear, this._endMonth, this._endDay) : currentDate; + var printDate = new Date(drawYear, drawMonth, 1 - leadDays); + var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate + var beforeShowDay = this._get('beforeShowDay'); + var showOtherMonths = this._get('showOtherMonths'); + var calculateWeek = this._get('calculateWeek') || $.datepicker.iso8601Week; + var dateStatus = this._get('statusForDate') || $.datepicker.dateStatus; + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows + html += '<tr class="ui-datepicker-daysRow">' + + (showWeeks ? '<td class="ui-datepicker-weekCol">' + calculateWeek(printDate) + '</td>' : ''); + for (var dow = 0; dow < 7; dow++) { // create date picker days + var daySettings = (beforeShowDay ? + beforeShowDay.apply((this._input ? this._input[0] : null), [printDate]) : [true, '']); + var otherMonth = (printDate.getMonth() != drawMonth); + var unselectable = otherMonth || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + html += '<td class="ui-datepicker-daysCell' + + ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-weekEndCell' : '') + // highlight weekends + (otherMonth ? ' ui-datepicker-otherMonth' : '') + // highlight days from other months + (printDate.getTime() == selectedDate.getTime() && drawMonth == this._selectedMonth ? + ' ui-datepicker-daysCellOver' : '') + // highlight selected day + (unselectable ? ' ui-datepicker-unselectable' : '') + // highlight unselectable days + (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates + (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range + ' ui-datepicker-currentDay' : '') + // highlight selected day + (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different) + (unselectable ? '' : ' onmouseover="jQuery(this).addClass(\'ui-datepicker-daysCellOver\');' + + (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' + + this._id + '\').html(\'' + (dateStatus.apply((this._input ? this._input[0] : null), + [printDate, this]) || ' ') +'\');') + '"' + + ' onmouseout="jQuery(this).removeClass(\'ui-datepicker-daysCellOver\');' + + (!showStatus || (otherMonth && !showOtherMonths) ? '' : 'jQuery(\'#ui-datepicker-status-' + + this._id + '\').html(\' \');') + '" onclick="jQuery.datepicker._selectDay(' + + this._id + ',' + drawMonth + ',' + drawYear + ', this);"') + '>' + // actions + (otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months + (unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; // display for this month + printDate.setDate(printDate.getDate() + 1); + } + html += '</tr>'; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + html += '</tbody></table></div>'; + } + html += (showStatus ? '<div style="clear: both;"></div><div id="ui-datepicker-status-' + this._id + + '" class="ui-datepicker-status">' + (this._get('initStatus') || ' ') + '</div>' : '') + + (!closeAtTop && !this._inline ? controls : '') + + '<div style="clear: both;"></div>' + + ($.browser.msie && parseInt($.browser.version) < 7 && !this._inline ? + '<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>' : ''); + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(drawMonth, drawYear, minDate, maxDate, selectedDate, secondary) { + minDate = (this._rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate); + var showStatus = this._get('showStatus'); + var html = '<div class="ui-datepicker-header">'; + // month selection + var monthNames = this._get('monthNames'); + if (secondary || !this._get('changeMonth')) + html += monthNames[drawMonth] + ' '; + + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + html += '<select class="ui-datepicker-newMonth" ' + + 'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'M\');" ' + + 'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' + + (showStatus ? this._addStatus(this._get('monthStatus') || ' ') : '') + '>'; + for (var month = 0; month < 12; month++) { + if ((!inMinYear || month >= minDate.getMonth()) && + (!inMaxYear || month <= maxDate.getMonth())) { + html += '<option value="' + month + '"' + + (month == drawMonth ? ' selected="selected"' : '') + + '>' + monthNames[month] + '</option>'; + } + } + html += '</select>'; + } + // year selection + if (secondary || !this._get('changeYear')) + html += drawYear; + else { + // determine range of years to display + var years = this._get('yearRange').split(':'); + var year = 0; + var endYear = 0; + if (years.length != 2) { + year = drawYear - 10; + endYear = drawYear + 10; + } else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') { + year = new Date().getFullYear() + parseInt(years[0], 10); + endYear = new Date().getFullYear() + parseInt(years[1], 10); + } else { + year = parseInt(years[0], 10); + endYear = parseInt(years[1], 10); + } + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + html += '<select class="ui-datepicker-newYear" ' + + 'onchange="jQuery.datepicker._selectMonthYear(' + this._id + ', this, \'Y\');" ' + + 'onclick="jQuery.datepicker._clickMonthYear(' + this._id + ');"' + + (showStatus ? this._addStatus(this._get('yearStatus') || ' ') : '') + '>'; + for (; year <= endYear; year++) { + html += '<option value="' + year + '"' + + (year == drawYear ? ' selected="selected"' : '') + + '>' + year + '</option>'; + } + html += '</select>'; + } + html += '</div>'; // Close datepicker_header + return html; + }, + + /* Provide code to set and clear the status panel. */ + _addStatus: function(text) { + return ' onmouseover="jQuery(\'#ui-datepicker-status-' + this._id + '\').html(\'' + text + '\');" ' + + 'onmouseout="jQuery(\'#ui-datepicker-status-' + this._id + '\').html(\' \');"'; + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(offset, period) { + var year = this._drawYear + (period == 'Y' ? offset : 0); + var month = this._drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(this._selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = new Date(year, month, day); + // ensure it is within the bounds set + var minDate = this._getMinMaxDate('min', true); + var maxDate = this._getMinMaxDate('max'); + date = (minDate && date < minDate ? minDate : date); + date = (maxDate && date > maxDate ? maxDate : date); + this._selectedDay = date.getDate(); + this._drawMonth = this._selectedMonth = date.getMonth(); + this._drawYear = this._selectedYear = date.getFullYear(); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function() { + var numMonths = this._get('numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */ + _getMinMaxDate: function(minMax, checkRange) { + var date = this._determineDate(minMax + 'Date', null); + if (date) { + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + date.setMilliseconds(0); + } + return date || (checkRange ? this._rangeStart : null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - new Date(year, month, 32).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(); + var date = new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(date) { + // during range selection, use minimum of selected date and range start + var newMinDate = (!this._rangeStart ? null : + new Date(this._selectedYear, this._selectedMonth, this._selectedDay)); + newMinDate = (newMinDate && this._rangeStart < newMinDate ? this._rangeStart : newMinDate); + var minDate = newMinDate || this._getMinMaxDate('min'); + var maxDate = this._getMinMaxDate('max'); + return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate)); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function() { + var shortYearCutoff = this._get('shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get('dayNamesShort'), dayNames: this._get('dayNames'), + monthNamesShort: this._get('monthNamesShort'), monthNames: this._get('monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(day, month, year) { + if (!day) { + this._currentDay = this._selectedDay; + this._currentMonth = this._selectedMonth; + this._currentYear = this._selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : new Date(year, month, day)) : + new Date(this._currentYear, this._currentMonth, this._currentDay)); + return $.datepicker.formatDate(this._get('dateFormat'), date, this._getFormatConfig()); + } +}); + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null) + target[name] = null; + return target; +}; + +/* Invoke the datepicker functionality. + @param options String - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate')) { + return $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this[0]].concat(otherArgs)); + } + return this.each(function() { + typeof options == 'string' ? + $.datepicker['_' + options + 'Datepicker'].apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance + +/* Initialise the date picker. */ +$(document).ready(function() { + $(document.body).append($.datepicker._datepickerDiv) + .mousedown($.datepicker._checkExternalClick); +}); + +})(jQuery); diff --git a/ui/source/ui.dialog.js b/ui/source/ui.dialog.js index 04ae309ed..40356e518 100644 --- a/ui/source/ui.dialog.js +++ b/ui/source/ui.dialog.js @@ -1,442 +1,442 @@ -/*
- * jQuery UI Dialog
- *
- * Copyright (c) 2008 Richard D. Worth (rdworth.org)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
- *
- * Revision: $Id: ui.dialog.js 5608 2008-05-15 14:41:12Z scott.gonzalez $
- */
-;(function($) {
-
-var setDataSwitch = {
- dragStart: "start.draggable",
- drag: "drag.draggable",
- dragStop: "stop.draggable",
- maxHeight: "maxHeight.resizable",
- minHeight: "minHeight.resizable",
- maxWidth: "maxWidth.resizable",
- minWidth: "minWidth.resizable",
- resizeStart: "start.resizable",
- resize: "drag.resizable",
- resizeStop: "stop.resizable"
-};
-
-$.widget("ui.dialog", {
- init: function() {
- var self = this,
- options = this.options,
- resizeHandles = typeof options.resizable == 'string'
- ? options.resizable
- : 'n,e,s,w,se,sw,ne,nw',
-
- uiDialogContent = this.element
- .addClass('ui-dialog-content')
- .wrap('<div/>')
- .wrap('<div/>'),
-
- uiDialogContainer = uiDialogContent.parent()
- .addClass('ui-dialog-container')
- .css({position: 'relative'}),
-
- title = options.title || uiDialogContent.attr('title') || '',
- uiDialogTitlebar = (this.uiDialogTitlebar =
- $('<div class="ui-dialog-titlebar"/>'))
- .append('<span class="ui-dialog-title">' + title + '</span>')
- .append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>')
- .prependTo(uiDialogContainer),
-
- uiDialog = (this.uiDialog = uiDialogContainer.parent())
- .hide()
- .appendTo(document.body)
- .addClass('ui-dialog')
- .addClass(options.dialogClass)
- // add content classes to dialog
- // to inherit theme at top level of element
- .addClass(uiDialogContent.attr('className'))
- .removeClass('ui-dialog-content')
- .css({
- position: 'absolute',
- width: options.width,
- height: options.height,
- overflow: 'hidden',
- zIndex: options.zIndex
- })
- // setting tabIndex makes the div focusable
- // setting outline to 0 prevents a border on focus in Mozilla
- .attr('tabIndex', -1).css('outline', 0).keydown(function(ev) {
- if (options.closeOnEscape) {
- var ESC = 27;
- (ev.keyCode && ev.keyCode == ESC && self.close());
- }
- })
- .mousedown(function() {
- self.moveToTop();
- });
-
- this.uiDialogTitlebarClose = $('.ui-dialog-titlebar-close', uiDialogTitlebar)
- .hover(
- function() {
- $(this).addClass('ui-dialog-titlebar-close-hover');
- },
- function() {
- $(this).removeClass('ui-dialog-titlebar-close-hover');
- }
- )
- .mousedown(function(ev) {
- ev.stopPropagation();
- })
- .click(function() {
- self.close();
- return false;
- });
-
- var hasButtons = false;
- $.each(options.buttons, function() { return !(hasButtons = true); });
- if (hasButtons) {
- var uiDialogButtonPane = $('<div class="ui-dialog-buttonpane"/>')
- .appendTo(uiDialog);
- $.each(options.buttons, function(name, fn) {
- $('<button/>')
- .text(name)
- .click(function() { fn.apply(self.element, arguments); })
- .appendTo(uiDialogButtonPane);
- });
- }
-
- if ($.fn.draggable) {
- uiDialog.draggable({
- handle: '.ui-dialog-titlebar',
- start: function(e, ui) {
- self.moveToTop();
- (options.dragStart && options.dragStart.apply(this, arguments));
- },
- drag: options.drag,
- stop: function(e, ui) {
- (options.dragStop && options.dragStop.apply(this, arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- (options.draggable || uiDialog.draggable('disable'));
- }
-
- if ($.fn.resizable) {
- uiDialog.resizable({
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: options.minHeight,
- start: options.resizeStart,
- resize: options.resize,
- handles: resizeHandles,
- stop: function(e, ui) {
- (options.resizeStop && options.resizeStop.apply(this, arguments));
- $.ui.dialog.overlay.resize();
- }
- });
- (options.resizable || uiDialog.resizable('disable'));
- }
-
- (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe());
- (options.autoOpen && this.open());
- },
-
- setData: function(key, value){
- (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value));
- switch (key) {
- case "draggable":
- this.uiDialog.draggable(value ? 'enable' : 'disable');
- break;
- case "height":
- this.uiDialog.height(value);
- break;
- case "position":
- this.position(value);
- break;
- case "resizable":
- (typeof value == 'string' && this.uiDialog.data('handles.resizable', value));
- this.uiDialog.resizable(value ? 'enable' : 'disable');
- break;
- case "title":
- $(".ui-dialog-title", this.uiDialogTitlebar).text(value);
- break;
- case "width":
- this.uiDialog.width(value);
- break;
- }
- this.options[key] = value;
- },
-
- position: function(pos) {
- var wnd = $(window), doc = $(document),
- pTop = doc.scrollTop(), pLeft = doc.scrollLeft(),
- minTop = pTop;
-
- if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) {
- pos = [
- pos == 'right' || pos == 'left' ? pos : 'center',
- pos == 'top' || pos == 'bottom' ? pos : 'middle'
- ];
- }
- if (pos.constructor != Array) {
- pos = ['center', 'middle'];
- }
- if (pos[0].constructor == Number) {
- pLeft += pos[0];
- } else {
- switch (pos[0]) {
- case 'left':
- pLeft += 0;
- break;
- case 'right':
- pLeft += (wnd.width()) - (this.uiDialog.width());
- break;
- default:
- case 'center':
- pLeft += (wnd.width() / 2) - (this.uiDialog.width() / 2);
- }
- }
- if (pos[1].constructor == Number) {
- pTop += pos[1];
- } else {
- switch (pos[1]) {
- case 'top':
- pTop += 0;
- break;
- case 'bottom':
- pTop += (wnd.height()) - (this.uiDialog.height());
- break;
- default:
- case 'middle':
- pTop += (wnd.height() / 2) - (this.uiDialog.height() / 2);
- }
- }
-
- // prevent the dialog from being too high (make sure the titlebar
- // is accessible)
- pTop = Math.max(pTop, minTop);
- this.uiDialog.css({top: pTop, left: pLeft});
- },
-
- open: function() {
- this.overlay = this.options.modal ? new $.ui.dialog.overlay(this) : null;
- this.uiDialog.appendTo('body');
- this.position(this.options.position);
- this.uiDialog.show();
- this.moveToTop();
-
- // CALLBACK: open
- var openEV = null;
- var openUI = {
- options: this.options
- };
- this.uiDialogTitlebarClose.focus();
- this.element.triggerHandler("dialogopen", [openEV, openUI], this.options.open);
- },
-
- moveToTop: function() {
- if (this.options.modal || !this.options.stack) { return; }
-
- var maxZ = this.options.zIndex, options = this.options;
- $('.ui-dialog:visible').each(function() {
- maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex);
- });
- (this.overlay && this.overlay.$el.css('z-index', ++maxZ));
- this.uiDialog.css('z-index', ++maxZ);
- },
-
- close: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide();
-
- // CALLBACK: close
- var closeEV = null;
- var closeUI = {
- options: this.options
- };
- this.element.triggerHandler("dialogclose", [closeEV, closeUI], this.options.close);
- $.ui.dialog.overlay.resize();
- },
-
- destroy: function() {
- (this.overlay && this.overlay.destroy());
- this.uiDialog.hide();
- this.element
- .unbind('.dialog')
- .removeData('dialog')
- .removeClass('ui-dialog-content')
- .hide().appendTo('body');
- this.uiDialog.remove();
- }
-});
-
-$.extend($.ui.dialog, {
- defaults: {
- autoOpen: true,
- bgiframe: false,
- buttons: {},
- closeOnEscape: true,
- draggable: true,
- height: 200,
- minHeight: 100,
- minWidth: 150,
- modal: false,
- overlay: {},
- position: 'center',
- resizable: true,
- stack: true,
- width: 300,
- zIndex: 1000
- },
-
- overlay: function(dialog) {
- this.$el = $.ui.dialog.overlay.create(dialog);
- }
-});
-
-$.extend($.ui.dialog.overlay, {
- instances: [],
- events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- function(e) { return e + '.dialog-overlay'; }).join(' '),
- create: function(dialog) {
- if (this.instances.length === 0) {
- // prevent use of anchors and inputs
- // we use a setTimeout in case the overlay is created from an
- // event that we're going to be cancelling (see #2804)
- setTimeout(function() {
- $('a, :input').bind($.ui.dialog.overlay.events, function() {
- // allow use of the element if inside a dialog and
- // - there are no modal dialogs
- // - there are modal dialogs, but we are in front of the topmost modal
- var allow = false;
- var $dialog = $(this).parents('.ui-dialog');
- if ($dialog.length) {
- var $overlays = $('.ui-dialog-overlay');
- if ($overlays.length) {
- var maxZ = parseInt($overlays.css('z-index'), 10);
- $overlays.each(function() {
- maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10));
- });
- allow = parseInt($dialog.css('z-index'), 10) > maxZ;
- } else {
- allow = true;
- }
- }
- return allow;
- });
- }, 1);
-
- // allow closing by pressing the escape key
- $(document).bind('keydown.dialog-overlay', function(e) {
- var ESC = 27;
- (e.keyCode && e.keyCode == ESC && dialog.close());
- });
-
- // handle window resize
- $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
- }
-
- var $el = $('<div/>').appendTo(document.body)
- .addClass('ui-dialog-overlay').css($.extend({
- borderWidth: 0, margin: 0, padding: 0,
- position: 'absolute', top: 0, left: 0,
- width: this.width(),
- height: this.height()
- }, dialog.options.overlay));
-
- (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe());
-
- this.instances.push($el);
- return $el;
- },
-
- destroy: function($el) {
- this.instances.splice($.inArray(this.instances, $el), 1);
-
- if (this.instances.length === 0) {
- $('a, :input').add([document, window]).unbind('.dialog-overlay');
- }
-
- $el.remove();
- },
-
- height: function() {
- if ($.browser.msie && $.browser.version < 7) {
- var scrollHeight = Math.max(
- document.documentElement.scrollHeight,
- document.body.scrollHeight
- );
- var offsetHeight = Math.max(
- document.documentElement.offsetHeight,
- document.body.offsetHeight
- );
-
- if (scrollHeight < offsetHeight) {
- return $(window).height() + 'px';
- } else {
- return scrollHeight + 'px';
- }
- } else {
- return $(document).height() + 'px';
- }
- },
-
- width: function() {
- if ($.browser.msie && $.browser.version < 7) {
- var scrollWidth = Math.max(
- document.documentElement.scrollWidth,
- document.body.scrollWidth
- );
- var offsetWidth = Math.max(
- document.documentElement.offsetWidth,
- document.body.offsetWidth
- );
-
- if (scrollWidth < offsetWidth) {
- return $(window).width() + 'px';
- } else {
- return scrollWidth + 'px';
- }
- } else {
- return $(document).width() + 'px';
- }
- },
-
- resize: function() {
- /* If the dialog is draggable and the user drags it past the
- * right edge of the window, the document becomes wider so we
- * need to stretch the overlay. If the user then drags the
- * dialog back to the left, the document will become narrower,
- * so we need to shrink the overlay to the appropriate size.
- * This is handled by shrinking the overlay before setting it
- * to the full document size.
- */
- var $overlays = $([]);
- $.each($.ui.dialog.overlay.instances, function() {
- $overlays = $overlays.add(this);
- });
-
- $overlays.css({
- width: 0,
- height: 0
- }).css({
- width: $.ui.dialog.overlay.width(),
- height: $.ui.dialog.overlay.height()
- });
- }
-});
-
-$.extend($.ui.dialog.overlay.prototype, {
- destroy: function() {
- $.ui.dialog.overlay.destroy(this.$el);
- }
-});
-
-})(jQuery);
+/* + * jQuery UI Dialog + * + * Copyright (c) 2008 Richard D. Worth (rdworth.org) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * ui.core.js + * ui.draggable.js + * ui.resizable.js + * + * Revision: $Id: ui.dialog.js 5608 2008-05-15 14:41:12Z scott.gonzalez $ + */ +;(function($) { + +var setDataSwitch = { + dragStart: "start.draggable", + drag: "drag.draggable", + dragStop: "stop.draggable", + maxHeight: "maxHeight.resizable", + minHeight: "minHeight.resizable", + maxWidth: "maxWidth.resizable", + minWidth: "minWidth.resizable", + resizeStart: "start.resizable", + resize: "drag.resizable", + resizeStop: "stop.resizable" +}; + +$.widget("ui.dialog", { + init: function() { + var self = this, + options = this.options, + resizeHandles = typeof options.resizable == 'string' + ? options.resizable + : 'n,e,s,w,se,sw,ne,nw', + + uiDialogContent = this.element + .addClass('ui-dialog-content') + .wrap('<div/>') + .wrap('<div/>'), + + uiDialogContainer = uiDialogContent.parent() + .addClass('ui-dialog-container') + .css({position: 'relative'}), + + title = options.title || uiDialogContent.attr('title') || '', + uiDialogTitlebar = (this.uiDialogTitlebar = + $('<div class="ui-dialog-titlebar"/>')) + .append('<span class="ui-dialog-title">' + title + '</span>') + .append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>') + .prependTo(uiDialogContainer), + + uiDialog = (this.uiDialog = uiDialogContainer.parent()) + .hide() + .appendTo(document.body) + .addClass('ui-dialog') + .addClass(options.dialogClass) + // add content classes to dialog + // to inherit theme at top level of element + .addClass(uiDialogContent.attr('className')) + .removeClass('ui-dialog-content') + .css({ + position: 'absolute', + width: options.width, + height: options.height, + overflow: 'hidden', + zIndex: options.zIndex + }) + // setting tabIndex makes the div focusable + // setting outline to 0 prevents a border on focus in Mozilla + .attr('tabIndex', -1).css('outline', 0).keydown(function(ev) { + if (options.closeOnEscape) { + var ESC = 27; + (ev.keyCode && ev.keyCode == ESC && self.close()); + } + }) + .mousedown(function() { + self.moveToTop(); + }); + + this.uiDialogTitlebarClose = $('.ui-dialog-titlebar-close', uiDialogTitlebar) + .hover( + function() { + $(this).addClass('ui-dialog-titlebar-close-hover'); + }, + function() { + $(this).removeClass('ui-dialog-titlebar-close-hover'); + } + ) + .mousedown(function(ev) { + ev.stopPropagation(); + }) + .click(function() { + self.close(); + return false; + }); + + var hasButtons = false; + $.each(options.buttons, function() { return !(hasButtons = true); }); + if (hasButtons) { + var uiDialogButtonPane = $('<div class="ui-dialog-buttonpane"/>') + .appendTo(uiDialog); + $.each(options.buttons, function(name, fn) { + $('<button/>') + .text(name) + .click(function() { fn.apply(self.element, arguments); }) + .appendTo(uiDialogButtonPane); + }); + } + + if ($.fn.draggable) { + uiDialog.draggable({ + handle: '.ui-dialog-titlebar', + start: function(e, ui) { + self.moveToTop(); + (options.dragStart && options.dragStart.apply(this, arguments)); + }, + drag: options.drag, + stop: function(e, ui) { + (options.dragStop && options.dragStop.apply(this, arguments)); + $.ui.dialog.overlay.resize(); + } + }); + (options.draggable || uiDialog.draggable('disable')); + } + + if ($.fn.resizable) { + uiDialog.resizable({ + maxWidth: options.maxWidth, + maxHeight: options.maxHeight, + minWidth: options.minWidth, + minHeight: options.minHeight, + start: options.resizeStart, + resize: options.resize, + handles: resizeHandles, + stop: function(e, ui) { + (options.resizeStop && options.resizeStop.apply(this, arguments)); + $.ui.dialog.overlay.resize(); + } + }); + (options.resizable || uiDialog.resizable('disable')); + } + + (options.bgiframe && $.fn.bgiframe && uiDialog.bgiframe()); + (options.autoOpen && this.open()); + }, + + setData: function(key, value){ + (setDataSwitch[key] && this.uiDialog.data(setDataSwitch[key], value)); + switch (key) { + case "draggable": + this.uiDialog.draggable(value ? 'enable' : 'disable'); + break; + case "height": + this.uiDialog.height(value); + break; + case "position": + this.position(value); + break; + case "resizable": + (typeof value == 'string' && this.uiDialog.data('handles.resizable', value)); + this.uiDialog.resizable(value ? 'enable' : 'disable'); + break; + case "title": + $(".ui-dialog-title", this.uiDialogTitlebar).text(value); + break; + case "width": + this.uiDialog.width(value); + break; + } + this.options[key] = value; + }, + + position: function(pos) { + var wnd = $(window), doc = $(document), + pTop = doc.scrollTop(), pLeft = doc.scrollLeft(), + minTop = pTop; + + if ($.inArray(pos, ['center','top','right','bottom','left']) >= 0) { + pos = [ + pos == 'right' || pos == 'left' ? pos : 'center', + pos == 'top' || pos == 'bottom' ? pos : 'middle' + ]; + } + if (pos.constructor != Array) { + pos = ['center', 'middle']; + } + if (pos[0].constructor == Number) { + pLeft += pos[0]; + } else { + switch (pos[0]) { + case 'left': + pLeft += 0; + break; + case 'right': + pLeft += (wnd.width()) - (this.uiDialog.width()); + break; + default: + case 'center': + pLeft += (wnd.width() / 2) - (this.uiDialog.width() / 2); + } + } + if (pos[1].constructor == Number) { + pTop += pos[1]; + } else { + switch (pos[1]) { + case 'top': + pTop += 0; + break; + case 'bottom': + pTop += (wnd.height()) - (this.uiDialog.height()); + break; + default: + case 'middle': + pTop += (wnd.height() / 2) - (this.uiDialog.height() / 2); + } + } + + // prevent the dialog from being too high (make sure the titlebar + // is accessible) + pTop = Math.max(pTop, minTop); + this.uiDialog.css({top: pTop, left: pLeft}); + }, + + open: function() { + this.overlay = this.options.modal ? new $.ui.dialog.overlay(this) : null; + this.uiDialog.appendTo('body'); + this.position(this.options.position); + this.uiDialog.show(); + this.moveToTop(); + + // CALLBACK: open + var openEV = null; + var openUI = { + options: this.options + }; + this.uiDialogTitlebarClose.focus(); + this.element.triggerHandler("dialogopen", [openEV, openUI], this.options.open); + }, + + moveToTop: function() { + if (this.options.modal || !this.options.stack) { return; } + + var maxZ = this.options.zIndex, options = this.options; + $('.ui-dialog:visible').each(function() { + maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10) || options.zIndex); + }); + (this.overlay && this.overlay.$el.css('z-index', ++maxZ)); + this.uiDialog.css('z-index', ++maxZ); + }, + + close: function() { + (this.overlay && this.overlay.destroy()); + this.uiDialog.hide(); + + // CALLBACK: close + var closeEV = null; + var closeUI = { + options: this.options + }; + this.element.triggerHandler("dialogclose", [closeEV, closeUI], this.options.close); + $.ui.dialog.overlay.resize(); + }, + + destroy: function() { + (this.overlay && this.overlay.destroy()); + this.uiDialog.hide(); + this.element + .unbind('.dialog') + .removeData('dialog') + .removeClass('ui-dialog-content') + .hide().appendTo('body'); + this.uiDialog.remove(); + } +}); + +$.extend($.ui.dialog, { + defaults: { + autoOpen: true, + bgiframe: false, + buttons: {}, + closeOnEscape: true, + draggable: true, + height: 200, + minHeight: 100, + minWidth: 150, + modal: false, + overlay: {}, + position: 'center', + resizable: true, + stack: true, + width: 300, + zIndex: 1000 + }, + + overlay: function(dialog) { + this.$el = $.ui.dialog.overlay.create(dialog); + } +}); + +$.extend($.ui.dialog.overlay, { + instances: [], + events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','), + function(e) { return e + '.dialog-overlay'; }).join(' '), + create: function(dialog) { + if (this.instances.length === 0) { + // prevent use of anchors and inputs + // we use a setTimeout in case the overlay is created from an + // event that we're going to be cancelling (see #2804) + setTimeout(function() { + $('a, :input').bind($.ui.dialog.overlay.events, function() { + // allow use of the element if inside a dialog and + // - there are no modal dialogs + // - there are modal dialogs, but we are in front of the topmost modal + var allow = false; + var $dialog = $(this).parents('.ui-dialog'); + if ($dialog.length) { + var $overlays = $('.ui-dialog-overlay'); + if ($overlays.length) { + var maxZ = parseInt($overlays.css('z-index'), 10); + $overlays.each(function() { + maxZ = Math.max(maxZ, parseInt($(this).css('z-index'), 10)); + }); + allow = parseInt($dialog.css('z-index'), 10) > maxZ; + } else { + allow = true; + } + } + return allow; + }); + }, 1); + + // allow closing by pressing the escape key + $(document).bind('keydown.dialog-overlay', function(e) { + var ESC = 27; + (e.keyCode && e.keyCode == ESC && dialog.close()); + }); + + // handle window resize + $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize); + } + + var $el = $('<div/>').appendTo(document.body) + .addClass('ui-dialog-overlay').css($.extend({ + borderWidth: 0, margin: 0, padding: 0, + position: 'absolute', top: 0, left: 0, + width: this.width(), + height: this.height() + }, dialog.options.overlay)); + + (dialog.options.bgiframe && $.fn.bgiframe && $el.bgiframe()); + + this.instances.push($el); + return $el; + }, + + destroy: function($el) { + this.instances.splice($.inArray(this.instances, $el), 1); + + if (this.instances.length === 0) { + $('a, :input').add([document, window]).unbind('.dialog-overlay'); + } + + $el.remove(); + }, + + height: function() { + if ($.browser.msie && $.browser.version < 7) { + var scrollHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight + ); + var offsetHeight = Math.max( + document.documentElement.offsetHeight, + document.body.offsetHeight + ); + + if (scrollHeight < offsetHeight) { + return $(window).height() + 'px'; + } else { + return scrollHeight + 'px'; + } + } else { + return $(document).height() + 'px'; + } + }, + + width: function() { + if ($.browser.msie && $.browser.version < 7) { + var scrollWidth = Math.max( + document.documentElement.scrollWidth, + document.body.scrollWidth + ); + var offsetWidth = Math.max( + document.documentElement.offsetWidth, + document.body.offsetWidth + ); + + if (scrollWidth < offsetWidth) { + return $(window).width() + 'px'; + } else { + return scrollWidth + 'px'; + } + } else { + return $(document).width() + 'px'; + } + }, + + resize: function() { + /* If the dialog is draggable and the user drags it past the + * right edge of the window, the document becomes wider so we + * need to stretch the overlay. If the user then drags the + * dialog back to the left, the document will become narrower, + * so we need to shrink the overlay to the appropriate size. + * This is handled by shrinking the overlay before setting it + * to the full document size. + */ + var $overlays = $([]); + $.each($.ui.dialog.overlay.instances, function() { + $overlays = $overlays.add(this); + }); + + $overlays.css({ + width: 0, + height: 0 + }).css({ + width: $.ui.dialog.overlay.width(), + height: $.ui.dialog.overlay.height() + }); + } +}); + +$.extend($.ui.dialog.overlay.prototype, { + destroy: function() { + $.ui.dialog.overlay.destroy(this.$el); + } +}); + +})(jQuery); diff --git a/ui/source/ui.draggable.js b/ui/source/ui.draggable.js index b95194078..36f9d1ac3 100644 --- a/ui/source/ui.draggable.js +++ b/ui/source/ui.draggable.js @@ -1,555 +1,555 @@ -/*
- * jQuery UI Draggable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * ui.core.js
- *
- * Revision: $Id: ui.draggable.js 5672 2008-05-23 04:11:30Z braeker $
- */
-;(function($) {
-
-$.widget("ui.draggable", $.extend($.ui.mouse, {
- init: function() {
-
- //Initialize needed constants
- var o = this.options;
-
- //Position the node
- if (o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position')))
- this.element.css('position', 'relative');
-
- this.element.addClass('ui-draggable');
- (o.disabled && this.element.addClass('ui-draggable-disabled'));
-
- this.mouseInit();
-
- },
- setData: function(key, value) {
- (key == 'disabled' && this.element[(value ? 'add' : 'remove') + 'Class']('ui-draggable-disabled'));
- this.options[key] = value;
- },
- mouseStart: function(e) {
- var o = this.options;
-
- if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) return false;
-
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
- if(!handle) $(this.options.handle, this.element).each(function() {
- if(this == e.target) handle = true;
- });
- if (!handle) return false;
-
- if($.ui.ddmanager) $.ui.ddmanager.current = this;
-
- //Create and append the visible helper
- this.helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [e])) : (o.helper == 'clone' ? this.element.clone() : this.element);
- if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
- if(this.helper[0] != this.element[0] && !(/(fixed|absolute)/).test(this.helper.css("position"))) this.helper.css("position", "absolute");
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- this.margins = { //Cache the margins
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
- top: (parseInt(this.element.css("marginTop"),10) || 0)
- };
-
- this.cssPosition = this.helper.css("position"); //Store the helper's css position
- this.offset = this.element.offset(); //The element's absolute position on the page
- this.offset = { //Substract the margins from the element's absolute offset
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- this.offset.click = { //Where the click happened, relative to the element
- left: e.pageX - this.offset.left,
- top: e.pageY - this.offset.top
- };
-
- this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position
- this.offset.parent = { //Store its position plus border
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- var p = this.element.position(); //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helpers
- this.offset.relative = this.cssPosition == "relative" ? {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.offsetParent[0].scrollTop,
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.offsetParent[0].scrollLeft
- } : { top: 0, left: 0 };
-
- this.originalPosition = this.generatePosition(e); //Generate the original position
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size
-
- if(o.cursorAt) {
- if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left;
- if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right;
- if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top;
- if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom;
- }
-
-
- /*
- * - Position constraining -
- * Here we prepare position constraining like grid and containment.
- */
-
- if(o.containment) {
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document') this.containment = [0,0,$(document).width(), ($(document).height() || document.body.parentNode.scrollHeight)];
- if(!(/^(document|window|parent)$/).test(o.containment)) {
- var ce = $(o.containment)[0];
- var co = $(o.containment).offset();
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top,
- co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0),
- co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0)
- ];
- }
- }
-
- //Call plugins and callbacks
- this.propagate("start", e);
-
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
- if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e);
-
- this.helper.addClass("ui-draggable-dragging");
- this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
- },
- convertPositionTo: function(d, pos) {
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- return {
- top: (
- pos.top // the calculated relative position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position, not if the element is fixed
- + (this.cssPosition == "fixed" ? this.offsetParent[0].scrollTop : 0) * mod
- + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods)
- ),
- left: (
- pos.left // the calculated relative position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position, not if the element is fixed
- + (this.cssPosition == "fixed" ? this.offsetParent[0].scrollLeft : 0) * mod
- + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods)
- )
- };
- },
- generatePosition: function(e) {
-
- var o = this.options;
- var position = {
- top: (
- e.pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed
- - (this.cssPosition == "fixed" ? this.offsetParent[0].scrollTop : 0)
- ),
- left: (
- e.pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed
- - (this.cssPosition == "fixed" ? this.offsetParent[0].scrollLeft : 0)
- )
- };
-
- if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
- if(this.containment) {
- if(position.left < this.containment[0]) position.left = this.containment[0];
- if(position.top < this.containment[1]) position.top = this.containment[1];
- if(position.left > this.containment[2]) position.left = this.containment[2];
- if(position.top > this.containment[3]) position.top = this.containment[3];
- }
-
- if(o.grid) {
- var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1];
- position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0];
- position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- return position;
- },
- mouseDrag: function(e) {
-
- //Compute the helpers position
- this.position = this.generatePosition(e);
- this.positionAbs = this.convertPositionTo("absolute");
-
- //Call plugins and callbacks and use the resulting position if something is returned
- this.position = this.propagate("drag", e) || this.position;
-
- if(!this.options.axis || this.options.axis == "x") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis == "y") this.helper[0].style.top = this.position.top+'px';
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, e);
-
- return false;
- },
- mouseStop: function(e) {
-
- //If we are using droppables, inform the manager about the drop
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- $.ui.ddmanager.drop(this, e);
-
- if(this.options.revert) {
- var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revert, 10) || 500, function() {
- self.propagate("stop", e);
- self.clear();
- });
- } else {
- this.propagate("stop", e);
- this.clear();
- }
-
- return false;
- },
- clear: function() {
- this.helper.removeClass("ui-draggable-dragging");
- if(this.options.helper != 'original' && !this.cancelHelperRemoval) this.helper.remove();
- if($.ui.ddmanager) $.ui.ddmanager.current = null;
- this.helper = null;
- this.cancelHelperRemoval = false;
- },
-
- // From now on bulk stuff - mainly helpers
- plugins: {},
- uiHash: function(e) {
- return {
- helper: this.helper,
- position: this.position,
- absolutePosition: this.positionAbs,
- options: this.options
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.uiHash()]);
- return this.element.triggerHandler(n == "drag" ? n : "drag"+n, [e, this.uiHash()], this.options[n]);
- },
- destroy: function() {
- if(!this.element.data('draggable')) return;
- this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable');
- this.mouseDestroy();
- }
-}));
-
-$.extend($.ui.draggable, {
- defaults: {
- distance: 0,
- delay: 0,
- cancel: ":input,button",
- helper: "original",
- appendTo: "parent"
- }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
- start: function(e, ui) {
- var t = $('body');
- if (t.css("cursor")) ui.options._cursor = t.css("cursor");
- t.css("cursor", ui.options.cursor);
- },
- stop: function(e, ui) {
- if (ui.options._cursor) $('body').css("cursor", ui.options._cursor);
- }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
- start: function(e, ui) {
- var t = $(ui.helper);
- if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex");
- t.css('zIndex', ui.options.zIndex);
- },
- stop: function(e, ui) {
- if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex);
- }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
- start: function(e, ui) {
- var t = $(ui.helper);
- if(t.css("opacity")) ui.options._opacity = t.css("opacity");
- t.css('opacity', ui.options.opacity);
- },
- stop: function(e, ui) {
- if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity);
- }
-});
-
-$.ui.plugin.add("draggable", "iframeFix", {
- start: function(e, ui) {
- $(ui.options.iframeFix === true ? "iframe" : ui.options.iframeFix).each(function() {
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
- .css({
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
- position: "absolute", opacity: "0.001", zIndex: 1000
- })
- .css($(this).offset())
- .appendTo("body");
- });
- },
- stop: function(e, ui) {
- $("div.DragDropIframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers
- }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
- start: function(e, ui) {
- var o = ui.options;
- var i = $(this).data("draggable");
- o.scrollSensitivity = o.scrollSensitivity || 20;
- o.scrollSpeed = o.scrollSpeed || 20;
-
- i.overflowY = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(this);
- i.overflowX = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(this);
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset();
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset();
-
- },
- drag: function(e, ui) {
-
- var o = ui.options;
- var i = $(this).data("draggable");
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') {
- if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed;
- if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed;
-
- } else {
- if(e.pageY - $(document).scrollTop() < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') {
- if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed;
- if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed;
- } else {
- if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-});
-
-$.ui.plugin.add("draggable", "snap", {
- start: function(e, ui) {
-
- var inst = $(this).data("draggable");
- inst.snapElements = [];
- $(ui.options.snap === true ? '.ui-draggable' : ui.options.snap).each(function() {
- var $t = $(this); var $o = $t.offset();
- if(this != inst.element[0]) inst.snapElements.push({
- item: this,
- width: $t.outerWidth(), height: $t.outerHeight(),
- top: $o.top, left: $o.left
- });
- });
-
- },
- drag: function(e, ui) {
-
- var inst = $(this).data("draggable");
- var d = ui.options.snapTolerance || 20;
- var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width,
- y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height;
-
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
-
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
-
- //Yes, I know, this is insane ;)
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) continue;
-
- if(ui.options.snapMode != 'inner') {
- var ts = Math.abs(t - y2) <= 20;
- var bs = Math.abs(b - y1) <= 20;
- var ls = Math.abs(l - x2) <= 20;
- var rs = Math.abs(r - x1) <= 20;
- if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
- if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b, left: 0 }).top;
- if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
- if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r }).left;
- }
-
- if(ui.options.snapMode != 'outer') {
- var ts = Math.abs(t - y1) <= 20;
- var bs = Math.abs(b - y2) <= 20;
- var ls = Math.abs(l - x1) <= 20;
- var rs = Math.abs(r - x2) <= 20;
- if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t, left: 0 }).top;
- if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
- if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l }).left;
- if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
- }
-
- };
- }
-});
-
-$.ui.plugin.add("draggable", "connectToSortable", {
- start: function(e,ui) {
-
- var inst = $(this).data("draggable");
- inst.sortables = [];
- $(ui.options.connectToSortable).each(function() {
- if($.data(this, 'sortable')) {
- var sortable = $.data(this, 'sortable');
- inst.sortables.push({
- instance: sortable,
- shouldRevert: sortable.options.revert
- });
- sortable.refresh(); //Do a one-time refresh at start to refresh the containerCache
- sortable.propagate("activate", e, inst);
- }
- });
-
- },
- stop: function(e,ui) {
-
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("draggable");
-
- $.each(inst.sortables, function() {
- if(this.instance.isOver) {
- this.instance.isOver = 0;
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
- if(this.shouldRevert) this.instance.options.revert = true; //revert here
- this.instance.mouseStop(e);
-
- //Also propagate receive event, since the sortable is actually receiving a element
- this.instance.element.triggerHandler("sortreceive", [e, $.extend(this.instance.ui(), { sender: inst.element })], this.instance.options["receive"]);
-
- this.instance.options.helper = this.instance.options._helper;
- } else {
- this.instance.propagate("deactivate", e, inst);
- }
-
- });
-
- },
- drag: function(e,ui) {
-
- var inst = $(this).data("draggable"), self = this;
-
- var checkPos = function(o) {
-
- var l = o.left, r = l + o.width,
- t = o.top, b = t + o.height;
-
- return (l < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < r
- && t < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < b);
- };
-
- $.each(inst.sortables, function(i) {
-
- if(checkPos.call(inst, this.instance.containerCache)) {
-
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
- if(!this.instance.isOver) {
- this.instance.isOver = 1;
-
- //Now we fake the start of dragging for the sortable instance,
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true);
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
- this.instance.options.helper = function() { return ui.helper[0]; };
-
- e.target = this.instance.currentItem[0];
- this.instance.mouseStart(e, true, true);
-
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
- this.instance.offset.click.top = inst.offset.click.top;
- this.instance.offset.click.left = inst.offset.click.left;
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
-
- inst.propagate("toSortable", e);
-
- }
-
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
- if(this.instance.currentItem) this.instance.mouseDrag(e);
-
- } else {
-
- //If it doesn't intersect with the sortable, and it intersected before,
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
- if(this.instance.isOver) {
- this.instance.isOver = 0;
- this.instance.cancelHelperRemoval = true;
- this.instance.options.revert = false; //No revert here
- this.instance.mouseStop(e, true);
- this.instance.options.helper = this.instance.options._helper;
-
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
- this.instance.currentItem.remove();
- this.instance.placeholder.remove();
-
- inst.propagate("fromSortable", e);
- }
-
- };
-
- });
-
- }
-});
-
-$.ui.plugin.add("draggable", "stack", {
- start: function(e,ui) {
- var group = $.makeArray($(ui.options.stack.group)).sort(function(a,b) {
- return (parseInt($(a).css("zIndex"),10) || ui.options.stack.min) - (parseInt($(b).css("zIndex"),10) || ui.options.stack.min);
- });
-
- $(group).each(function(i) {
- this.style.zIndex = ui.options.stack.min + i;
- });
-
- this[0].style.zIndex = ui.options.stack.min + group.length;
- }
-});
-
-})(jQuery);
+/* + * jQuery UI Draggable + * + * Copyright (c) 2008 Paul Bakaus + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * ui.core.js + * + * Revision: $Id: ui.draggable.js 5672 2008-05-23 04:11:30Z braeker $ + */ +;(function($) { + +$.widget("ui.draggable", $.extend($.ui.mouse, { + init: function() { + + //Initialize needed constants + var o = this.options; + + //Position the node + if (o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position'))) + this.element.css('position', 'relative'); + + this.element.addClass('ui-draggable'); + (o.disabled && this.element.addClass('ui-draggable-disabled')); + + this.mouseInit(); + + }, + setData: function(key, value) { + (key == 'disabled' && this.element[(value ? 'add' : 'remove') + 'Class']('ui-draggable-disabled')); + this.options[key] = value; + }, + mouseStart: function(e) { + var o = this.options; + + if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) return false; + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + if(!handle) $(this.options.handle, this.element).each(function() { + if(this == e.target) handle = true; + }); + if (!handle) return false; + + if($.ui.ddmanager) $.ui.ddmanager.current = this; + + //Create and append the visible helper + this.helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [e])) : (o.helper == 'clone' ? this.element.clone() : this.element); + if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + if(this.helper[0] != this.element[0] && !(/(fixed|absolute)/).test(this.helper.css("position"))) this.helper.css("position", "absolute"); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + this.margins = { //Cache the margins + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0) + }; + + this.cssPosition = this.helper.css("position"); //Store the helper's css position + this.offset = this.element.offset(); //The element's absolute position on the page + this.offset = { //Substract the margins from the element's absolute offset + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + this.offset.click = { //Where the click happened, relative to the element + left: e.pageX - this.offset.left, + top: e.pageY - this.offset.top + }; + + this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position + this.offset.parent = { //Store its position plus border + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + var p = this.element.position(); //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helpers + this.offset.relative = this.cssPosition == "relative" ? { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.offsetParent[0].scrollTop, + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.offsetParent[0].scrollLeft + } : { top: 0, left: 0 }; + + this.originalPosition = this.generatePosition(e); //Generate the original position + this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size + + if(o.cursorAt) { + if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left; + if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right; + if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top; + if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom; + } + + + /* + * - Position constraining - + * Here we prepare position constraining like grid and containment. + */ + + if(o.containment) { + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document') this.containment = [0,0,$(document).width(), ($(document).height() || document.body.parentNode.scrollHeight)]; + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top, + co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0), + co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0) + ]; + } + } + + //Call plugins and callbacks + this.propagate("start", e); + + this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size + if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e); + + this.helper.addClass("ui-draggable-dragging"); + this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + }, + convertPositionTo: function(d, pos) { + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + return { + top: ( + pos.top // the calculated relative position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position, not if the element is fixed + + (this.cssPosition == "fixed" ? this.offsetParent[0].scrollTop : 0) * mod + + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods) + ), + left: ( + pos.left // the calculated relative position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position, not if the element is fixed + + (this.cssPosition == "fixed" ? this.offsetParent[0].scrollLeft : 0) * mod + + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods) + ) + }; + }, + generatePosition: function(e) { + + var o = this.options; + var position = { + top: ( + e.pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed + - (this.cssPosition == "fixed" ? this.offsetParent[0].scrollTop : 0) + ), + left: ( + e.pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + (this.cssPosition == "fixed" || (this.cssPosition == "absolute" && this.offsetParent[0] == document.body) ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed + - (this.cssPosition == "fixed" ? this.offsetParent[0].scrollLeft : 0) + ) + }; + + if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + if(this.containment) { + if(position.left < this.containment[0]) position.left = this.containment[0]; + if(position.top < this.containment[1]) position.top = this.containment[1]; + if(position.left > this.containment[2]) position.left = this.containment[2]; + if(position.top > this.containment[3]) position.top = this.containment[3]; + } + + if(o.grid) { + var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1]; + position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0]; + position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + return position; + }, + mouseDrag: function(e) { + + //Compute the helpers position + this.position = this.generatePosition(e); + this.positionAbs = this.convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + this.position = this.propagate("drag", e) || this.position; + + if(!this.options.axis || this.options.axis == "x") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis == "y") this.helper[0].style.top = this.position.top+'px'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, e); + + return false; + }, + mouseStop: function(e) { + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, e); + + if(this.options.revert) { + var self = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revert, 10) || 500, function() { + self.propagate("stop", e); + self.clear(); + }); + } else { + this.propagate("stop", e); + this.clear(); + } + + return false; + }, + clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.options.helper != 'original' && !this.cancelHelperRemoval) this.helper.remove(); + if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + plugins: {}, + uiHash: function(e) { + return { + helper: this.helper, + position: this.position, + absolutePosition: this.positionAbs, + options: this.options + }; + }, + propagate: function(n,e) { + $.ui.plugin.call(this, n, [e, this.uiHash()]); + return this.element.triggerHandler(n == "drag" ? n : "drag"+n, [e, this.uiHash()], this.options[n]); + }, + destroy: function() { + if(!this.element.data('draggable')) return; + this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable'); + this.mouseDestroy(); + } +})); + +$.extend($.ui.draggable, { + defaults: { + distance: 0, + delay: 0, + cancel: ":input,button", + helper: "original", + appendTo: "parent" + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(e, ui) { + var t = $('body'); + if (t.css("cursor")) ui.options._cursor = t.css("cursor"); + t.css("cursor", ui.options.cursor); + }, + stop: function(e, ui) { + if (ui.options._cursor) $('body').css("cursor", ui.options._cursor); + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(e, ui) { + var t = $(ui.helper); + if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex"); + t.css('zIndex', ui.options.zIndex); + }, + stop: function(e, ui) { + if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex); + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(e, ui) { + var t = $(ui.helper); + if(t.css("opacity")) ui.options._opacity = t.css("opacity"); + t.css('opacity', ui.options.opacity); + }, + stop: function(e, ui) { + if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity); + } +}); + +$.ui.plugin.add("draggable", "iframeFix", { + start: function(e, ui) { + $(ui.options.iframeFix === true ? "iframe" : ui.options.iframeFix).each(function() { + $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + }, + stop: function(e, ui) { + $("div.DragDropIframeFix").each(function() { this.parentNode.removeChild(this); }); //Remove frame helpers + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(e, ui) { + var o = ui.options; + var i = $(this).data("draggable"); + o.scrollSensitivity = o.scrollSensitivity || 20; + o.scrollSpeed = o.scrollSpeed || 20; + + i.overflowY = function(el) { + do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode); + return $(document); + }(this); + i.overflowX = function(el) { + do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode); + return $(document); + }(this); + + if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset(); + if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset(); + + }, + drag: function(e, ui) { + + var o = ui.options; + var i = $(this).data("draggable"); + + if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') { + if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity) + i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed; + if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity) + i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed; + + } else { + if(e.pageY - $(document).scrollTop() < o.scrollSensitivity) + $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity) + $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') { + if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity) + i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed; + if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity) + i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed; + } else { + if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity) + $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(e, ui) { + + var inst = $(this).data("draggable"); + inst.snapElements = []; + $(ui.options.snap === true ? '.ui-draggable' : ui.options.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != inst.element[0]) inst.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(e, ui) { + + var inst = $(this).data("draggable"); + var d = ui.options.snapTolerance || 20; + var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) continue; + + if(ui.options.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= 20; + var bs = Math.abs(b - y1) <= 20; + var ls = Math.abs(l - x2) <= 20; + var rs = Math.abs(r - x1) <= 20; + if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top; + if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b, left: 0 }).top; + if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left; + if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r }).left; + } + + if(ui.options.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= 20; + var bs = Math.abs(b - y2) <= 20; + var ls = Math.abs(l - x1) <= 20; + var rs = Math.abs(r - x2) <= 20; + if(ts) ui.position.top = inst.convertPositionTo("relative", { top: t, left: 0 }).top; + if(bs) ui.position.top = inst.convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top; + if(ls) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: l }).left; + if(rs) ui.position.left = inst.convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left; + } + + }; + } +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(e,ui) { + + var inst = $(this).data("draggable"); + inst.sortables = []; + $(ui.options.connectToSortable).each(function() { + if($.data(this, 'sortable')) { + var sortable = $.data(this, 'sortable'); + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refresh(); //Do a one-time refresh at start to refresh the containerCache + sortable.propagate("activate", e, inst); + } + }); + + }, + stop: function(e,ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + this.instance.isOver = 0; + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + if(this.shouldRevert) this.instance.options.revert = true; //revert here + this.instance.mouseStop(e); + + //Also propagate receive event, since the sortable is actually receiving a element + this.instance.element.triggerHandler("sortreceive", [e, $.extend(this.instance.ui(), { sender: inst.element })], this.instance.options["receive"]); + + this.instance.options.helper = this.instance.options._helper; + } else { + this.instance.propagate("deactivate", e, inst); + } + + }); + + }, + drag: function(e,ui) { + + var inst = $(this).data("draggable"), self = this; + + var checkPos = function(o) { + + var l = o.left, r = l + o.width, + t = o.top, b = t + o.height; + + return (l < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < r + && t < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < b); + }; + + $.each(inst.sortables, function(i) { + + if(checkPos.call(inst, this.instance.containerCache)) { + + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + this.instance.isOver = 1; + + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + e.target = this.instance.currentItem[0]; + this.instance.mouseStart(e, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst.propagate("toSortable", e); + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance.mouseDrag(e); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + this.instance.options.revert = false; //No revert here + this.instance.mouseStop(e, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + this.instance.placeholder.remove(); + + inst.propagate("fromSortable", e); + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(e,ui) { + var group = $.makeArray($(ui.options.stack.group)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || ui.options.stack.min) - (parseInt($(b).css("zIndex"),10) || ui.options.stack.min); + }); + + $(group).each(function(i) { + this.style.zIndex = ui.options.stack.min + i; + }); + + this[0].style.zIndex = ui.options.stack.min + group.length; + } +}); + +})(jQuery); diff --git a/ui/source/ui.droppable.js b/ui/source/ui.droppable.js index fd664ff82..f2ef209da 100644 --- a/ui/source/ui.droppable.js +++ b/ui/source/ui.droppable.js @@ -1,291 +1,291 @@ -/*
- * jQuery UI Droppable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * ui.core.js
- * ui.draggable.js
- *
- * Revision: $Id: ui.droppable.js 5568 2008-05-12 15:07:16Z paul.bakaus $
- */
-;(function($) {
-
-$.widget("ui.droppable", {
- init: function() {
-
- this.element.addClass("ui-droppable");
- this.isover = 0; this.isout = 1;
-
- //Prepare the passed options
- var o = this.options, accept = o.accept;
- o = $.extend(o, {
- accept: o.accept && o.accept.constructor == Function ? o.accept : function(d) {
- return $(d).is(accept);
- }
- });
-
- //Store the droppable's proportions
- this.proportions = { width: this.element.outerWidth(), height: this.element.outerHeight() };
-
- // Add the reference and positions to the manager
- $.ui.ddmanager.droppables.push(this);
-
- },
- plugins: {},
- ui: function(c) {
- return {
- instance: this,
- draggable: (c.currentItem || c.element),
- helper: c.helper,
- position: c.position,
- absolutePosition: c.positionAbs,
- options: this.options,
- element: this.element
- };
- },
- destroy: function() {
- var drop = $.ui.ddmanager.droppables;
- for ( var i = 0; i < drop.length; i++ )
- if ( drop[i] == this )
- drop.splice(i, 1);
-
- this.element
- .removeClass("ui-droppable ui-droppable-disabled")
- .removeData("droppable")
- .unbind(".droppable");
- },
- enable: function() {
- this.element.removeClass("ui-droppable-disabled");
- this.options.disabled = false;
- },
- disable: function() {
- this.element.addClass("ui-droppable-disabled");
- this.options.disabled = true;
- },
- over: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'over', [e, this.ui(draggable)]);
- this.element.triggerHandler("dropover", [e, this.ui(draggable)], this.options.over);
- }
-
- },
- out: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'out', [e, this.ui(draggable)]);
- this.element.triggerHandler("dropout", [e, this.ui(draggable)], this.options.out);
- }
-
- },
- drop: function(e,custom) {
-
- var draggable = custom || $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
-
- var childrenIntersection = false;
- this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function() {
- var inst = $.data(this, 'droppable');
- if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) {
- childrenIntersection = true; return false;
- }
- });
- if(childrenIntersection) return false;
-
- if(this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- $.ui.plugin.call(this, 'drop', [e, this.ui(draggable)]);
- this.element.triggerHandler("drop", [e, this.ui(draggable)], this.options.drop);
- return true;
- }
-
- return false;
-
- },
- activate: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- $.ui.plugin.call(this, 'activate', [e, this.ui(draggable)]);
- if(draggable) this.element.triggerHandler("dropactivate", [e, this.ui(draggable)], this.options.activate);
-
- },
- deactivate: function(e) {
-
- var draggable = $.ui.ddmanager.current;
- $.ui.plugin.call(this, 'deactivate', [e, this.ui(draggable)]);
- if(draggable) this.element.triggerHandler("dropdeactivate", [e, this.ui(draggable)], this.options.deactivate);
-
- }
-});
-
-$.extend($.ui.droppable, {
- defaults: {
- disabled: false,
- tolerance: 'intersect'
- }
-});
-
-$.ui.intersect = function(draggable, droppable, toleranceMode) {
-
- if (!droppable.offset) return false;
-
- var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
- y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
- var l = droppable.offset.left, r = l + droppable.proportions.width,
- t = droppable.offset.top, b = t + droppable.proportions.height;
-
- switch (toleranceMode) {
- case 'fit':
- return (l < x1 && x2 < r
- && t < y1 && y2 < b);
- break;
- case 'intersect':
- return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
- && x2 - (draggable.helperProportions.width / 2) < r // Left Half
- && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
- && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
- break;
- case 'pointer':
- return (l < ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left) && ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left) < r
- && t < ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top) && ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top) < b);
- break;
- case 'touch':
- return (
- (y1 >= t && y1 <= b) || // Top edge touching
- (y2 >= t && y2 <= b) || // Bottom edge touching
- (y1 < t && y2 > b) // Surrounded vertically
- ) && (
- (x1 >= l && x1 <= r) || // Left edge touching
- (x2 >= l && x2 <= r) || // Right edge touching
- (x1 < l && x2 > r) // Surrounded horizontally
- );
- break;
- default:
- return false;
- break;
- }
-
-};
-
-/*
- This manager tracks offsets of draggables and droppables
-*/
-$.ui.ddmanager = {
- current: null,
- droppables: [],
- prepareOffsets: function(t, e) {
-
- var m = $.ui.ddmanager.droppables;
- var type = e ? e.type : null; // workaround for #2317
- for (var i = 0; i < m.length; i++) {
-
- if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element,(t.currentItem || t.element)))) continue;
- m[i].visible = m[i].element.is(":visible"); if(!m[i].visible) continue; //If the element is not visible, continue
- m[i].offset = m[i].element.offset();
- m[i].proportions = { width: m[i].element.outerWidth(), height: m[i].element.outerHeight() };
-
- if(type == "dragstart" || type == "sortactivate") m[i].activate.call(m[i], e); //Activate the droppable if used directly from draggables
- }
-
- },
- drop: function(draggable, e) {
-
- var dropped = false;
- $.each($.ui.ddmanager.droppables, function() {
-
- if(!this.options) return;
- if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
- dropped = this.drop.call(this, e);
-
- if (!this.options.disabled && this.visible && this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
- this.isout = 1; this.isover = 0;
- this.deactivate.call(this, e);
- }
-
- });
- return dropped;
-
- },
- drag: function(draggable, e) {
-
- //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
- if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, e);
-
- //Run through all droppables and check their positions based on specific tolerance options
- $.each($.ui.ddmanager.droppables, function() {
-
- if(this.disabled || this.greedyChild || !this.visible) return;
- var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
-
- var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
- if(!c) return;
-
- var parentInstance;
- if (this.options.greedy) {
- var parent = this.element.parents('.ui-droppable:eq(0)');
- if (parent.length) {
- parentInstance = $.data(parent[0], 'droppable');
- parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
- }
- }
-
- // we just moved into a greedy child
- if (parentInstance && c == 'isover') {
- parentInstance['isover'] = 0;
- parentInstance['isout'] = 1;
- parentInstance.out.call(parentInstance, e);
- }
-
- this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
- this[c == "isover" ? "over" : "out"].call(this, e);
-
- // we just moved out of a greedy child
- if (parentInstance && c == 'isout') {
- parentInstance['isout'] = 0;
- parentInstance['isover'] = 1;
- parentInstance.over.call(parentInstance, e);
- }
- });
-
- }
-};
-
-/*
- * Droppable Extensions
- */
-
-$.ui.plugin.add("droppable", "activeClass", {
- activate: function(e, ui) {
- $(this).addClass(ui.options.activeClass);
- },
- deactivate: function(e, ui) {
- $(this).removeClass(ui.options.activeClass);
- },
- drop: function(e, ui) {
- $(this).removeClass(ui.options.activeClass);
- }
-});
-
-$.ui.plugin.add("droppable", "hoverClass", {
- over: function(e, ui) {
- $(this).addClass(ui.options.hoverClass);
- },
- out: function(e, ui) {
- $(this).removeClass(ui.options.hoverClass);
- },
- drop: function(e, ui) {
- $(this).removeClass(ui.options.hoverClass);
- }
-});
-
-})(jQuery);
+/* + * jQuery UI Droppable + * + * Copyright (c) 2008 Paul Bakaus + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Droppables + * + * Depends: + * ui.core.js + * ui.draggable.js + * + * Revision: $Id: ui.droppable.js 5568 2008-05-12 15:07:16Z paul.bakaus $ + */ +;(function($) { + +$.widget("ui.droppable", { + init: function() { + + this.element.addClass("ui-droppable"); + this.isover = 0; this.isout = 1; + + //Prepare the passed options + var o = this.options, accept = o.accept; + o = $.extend(o, { + accept: o.accept && o.accept.constructor == Function ? o.accept : function(d) { + return $(d).is(accept); + } + }); + + //Store the droppable's proportions + this.proportions = { width: this.element.outerWidth(), height: this.element.outerHeight() }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables.push(this); + + }, + plugins: {}, + ui: function(c) { + return { + instance: this, + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + absolutePosition: c.positionAbs, + options: this.options, + element: this.element + }; + }, + destroy: function() { + var drop = $.ui.ddmanager.droppables; + for ( var i = 0; i < drop.length; i++ ) + if ( drop[i] == this ) + drop.splice(i, 1); + + this.element + .removeClass("ui-droppable ui-droppable-disabled") + .removeData("droppable") + .unbind(".droppable"); + }, + enable: function() { + this.element.removeClass("ui-droppable-disabled"); + this.options.disabled = false; + }, + disable: function() { + this.element.addClass("ui-droppable-disabled"); + this.options.disabled = true; + }, + over: function(e) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) { + $.ui.plugin.call(this, 'over', [e, this.ui(draggable)]); + this.element.triggerHandler("dropover", [e, this.ui(draggable)], this.options.over); + } + + }, + out: function(e) { + + var draggable = $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element + + if (this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) { + $.ui.plugin.call(this, 'out', [e, this.ui(draggable)]); + this.element.triggerHandler("dropout", [e, this.ui(draggable)], this.options.out); + } + + }, + drop: function(e,custom) { + + var draggable = custom || $.ui.ddmanager.current; + if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element + + var childrenIntersection = false; + this.element.find(".ui-droppable").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if(inst.options.greedy && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)) { + childrenIntersection = true; return false; + } + }); + if(childrenIntersection) return false; + + if(this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) { + $.ui.plugin.call(this, 'drop', [e, this.ui(draggable)]); + this.element.triggerHandler("drop", [e, this.ui(draggable)], this.options.drop); + return true; + } + + return false; + + }, + activate: function(e) { + + var draggable = $.ui.ddmanager.current; + $.ui.plugin.call(this, 'activate', [e, this.ui(draggable)]); + if(draggable) this.element.triggerHandler("dropactivate", [e, this.ui(draggable)], this.options.activate); + + }, + deactivate: function(e) { + + var draggable = $.ui.ddmanager.current; + $.ui.plugin.call(this, 'deactivate', [e, this.ui(draggable)]); + if(draggable) this.element.triggerHandler("dropdeactivate", [e, this.ui(draggable)], this.options.deactivate); + + } +}); + +$.extend($.ui.droppable, { + defaults: { + disabled: false, + tolerance: 'intersect' + } +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) return false; + + var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, + y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; + var l = droppable.offset.left, r = l + droppable.proportions.width, + t = droppable.offset.top, b = t + droppable.proportions.height; + + switch (toleranceMode) { + case 'fit': + return (l < x1 && x2 < r + && t < y1 && y2 < b); + break; + case 'intersect': + return (l < x1 + (draggable.helperProportions.width / 2) // Right Half + && x2 - (draggable.helperProportions.width / 2) < r // Left Half + && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half + && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + break; + case 'pointer': + return (l < ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left) && ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left) < r + && t < ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top) && ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top) < b); + break; + case 'touch': + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + break; + default: + return false; + break; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: [], + prepareOffsets: function(t, e) { + + var m = $.ui.ddmanager.droppables; + var type = e ? e.type : null; // workaround for #2317 + for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element,(t.currentItem || t.element)))) continue; + m[i].visible = m[i].element.is(":visible"); if(!m[i].visible) continue; //If the element is not visible, continue + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element.outerWidth(), height: m[i].element.outerHeight() }; + + if(type == "dragstart" || type == "sortactivate") m[i].activate.call(m[i], e); //Activate the droppable if used directly from draggables + } + + }, + drop: function(draggable, e) { + + var dropped = false; + $.each($.ui.ddmanager.droppables, function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = this.drop.call(this, e); + + if (!this.options.disabled && this.visible && this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this.deactivate.call(this, e); + } + + }); + return dropped; + + }, + drag: function(draggable, e) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, e); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables, function() { + + if(this.disabled || this.greedyChild || !this.visible) return; + var intersects = $.ui.intersect(draggable, this, this.options.tolerance); + + var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null); + if(!c) return; + + var parentInstance; + if (this.options.greedy) { + var parent = this.element.parents('.ui-droppable:eq(0)'); + if (parent.length) { + parentInstance = $.data(parent[0], 'droppable'); + parentInstance.greedyChild = (c == 'isover' ? 1 : 0); + } + } + + // we just moved into a greedy child + if (parentInstance && c == 'isover') { + parentInstance['isover'] = 0; + parentInstance['isout'] = 1; + parentInstance.out.call(parentInstance, e); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "over" : "out"].call(this, e); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance.over.call(parentInstance, e); + } + }); + + } +}; + +/* + * Droppable Extensions + */ + +$.ui.plugin.add("droppable", "activeClass", { + activate: function(e, ui) { + $(this).addClass(ui.options.activeClass); + }, + deactivate: function(e, ui) { + $(this).removeClass(ui.options.activeClass); + }, + drop: function(e, ui) { + $(this).removeClass(ui.options.activeClass); + } +}); + +$.ui.plugin.add("droppable", "hoverClass", { + over: function(e, ui) { + $(this).addClass(ui.options.hoverClass); + }, + out: function(e, ui) { + $(this).removeClass(ui.options.hoverClass); + }, + drop: function(e, ui) { + $(this).removeClass(ui.options.hoverClass); + } +}); + +})(jQuery); diff --git a/ui/source/ui.resizable.js b/ui/source/ui.resizable.js index 2203f3945..0bb7cf4bb 100644 --- a/ui/source/ui.resizable.js +++ b/ui/source/ui.resizable.js @@ -1,734 +1,734 @@ -/*
- * jQuery UI Resizable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * ui.core.js
- *
- * Revision: $Id: ui.resizable.js 5668 2008-05-22 18:17:30Z rdworth $
- */
-;(function($) {
-
-$.widget("ui.resizable", $.extend($.ui.mouse, {
- init: function() {
-
- var self = this, o = this.options;
-
- var elpos = this.element.css('position');
-
- // simulate .ui-resizable { position: relative; }
- this.element.addClass("ui-resizable").css({ position: /static/.test(elpos) ? 'relative' : elpos });
-
- $.extend(o, {
- _aspectRatio: !!(o.aspectRatio),
- proxy: o.proxy || o.ghost || o.animate ? o.proxy || 'proxy' : null,
- knobHandles: o.knobHandles === true ? 'ui-resizable-knob-handle' : o.knobHandles
- });
-
- //Default Theme
- var aBorder = '1px solid #DEDEDE';
-
- o.defaultTheme = {
- 'ui-resizable': { display: 'block' },
- 'ui-resizable-handle': { position: 'absolute', background: '#F2F2F2', fontSize: '0.1px' },
- 'ui-resizable-n': { cursor: 'n-resize', height: '4px', left: '0px', right: '0px', borderTop: aBorder },
- 'ui-resizable-s': { cursor: 's-resize', height: '4px', left: '0px', right: '0px', borderBottom: aBorder },
- 'ui-resizable-e': { cursor: 'e-resize', width: '4px', top: '0px', bottom: '0px', borderRight: aBorder },
- 'ui-resizable-w': { cursor: 'w-resize', width: '4px', top: '0px', bottom: '0px', borderLeft: aBorder },
- 'ui-resizable-se': { cursor: 'se-resize', width: '4px', height: '4px', borderRight: aBorder, borderBottom: aBorder },
- 'ui-resizable-sw': { cursor: 'sw-resize', width: '4px', height: '4px', borderBottom: aBorder, borderLeft: aBorder },
- 'ui-resizable-ne': { cursor: 'ne-resize', width: '4px', height: '4px', borderRight: aBorder, borderTop: aBorder },
- 'ui-resizable-nw': { cursor: 'nw-resize', width: '4px', height: '4px', borderLeft: aBorder, borderTop: aBorder }
- };
-
- o.knobTheme = {
- 'ui-resizable-handle': { background: '#F2F2F2', border: '1px solid #808080', height: '8px', width: '8px' },
- 'ui-resizable-n': { cursor: 'n-resize', top: '0px', left: '45%' },
- 'ui-resizable-s': { cursor: 's-resize', bottom: '0px', left: '45%' },
- 'ui-resizable-e': { cursor: 'e-resize', right: '0px', top: '45%' },
- 'ui-resizable-w': { cursor: 'w-resize', left: '0px', top: '45%' },
- 'ui-resizable-se': { cursor: 'se-resize', right: '0px', bottom: '0px' },
- 'ui-resizable-sw': { cursor: 'sw-resize', left: '0px', bottom: '0px' },
- 'ui-resizable-nw': { cursor: 'nw-resize', left: '0px', top: '0px' },
- 'ui-resizable-ne': { cursor: 'ne-resize', right: '0px', top: '0px' }
- };
-
- o._nodeName = this.element[0].nodeName;
-
- //Wrap the element if it cannot hold child nodes
- if(o._nodeName.match(/canvas|textarea|input|select|button|img/i)) {
- var el = this.element;
-
- //Opera fixing relative position
- if (/relative/.test(el.css('position')) && $.browser.opera)
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- //Create a wrapper element and set the wrapper to the new current internal element
- el.wrap(
- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css( {
- position: el.css('position'),
- width: el.outerWidth(),
- height: el.outerHeight(),
- top: el.css('top'),
- left: el.css('left')
- })
- );
-
- var oel = this.element; this.element = this.element.parent();
-
- //Move margins to the wrapper
- this.element.css({ marginLeft: oel.css("marginLeft"), marginTop: oel.css("marginTop"),
- marginRight: oel.css("marginRight"), marginBottom: oel.css("marginBottom")
- });
-
- oel.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
-
- //Prevent Safari textarea resize
- if ($.browser.safari && o.preventDefault) oel.css('resize', 'none');
-
- o.proportionallyResize = oel.css({ position: 'static', zoom: 1, display: 'block' });
-
- // avoid IE jump
- this.element.css({ margin: oel.css('margin') });
-
- // fix handlers offset
- this._proportionallyResize();
- }
-
- if(!o.handles) o.handles = !$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' };
- if(o.handles.constructor == String) {
-
- o.zIndex = o.zIndex || 1000;
-
- if(o.handles == 'all') o.handles = 'n,e,s,w,se,sw,ne,nw';
-
- var n = o.handles.split(","); o.handles = {};
-
- // insertions are applied when don't have theme loaded
- var insertionsDefault = {
- handle: 'position: absolute; display: none; overflow:hidden;',
- n: 'top: 0pt; width:100%;',
- e: 'right: 0pt; height:100%;',
- s: 'bottom: 0pt; width:100%;',
- w: 'left: 0pt; height:100%;',
- se: 'bottom: 0pt; right: 0px;',
- sw: 'bottom: 0pt; left: 0px;',
- ne: 'top: 0pt; right: 0px;',
- nw: 'top: 0pt; left: 0px;'
- };
-
- for(var i = 0; i < n.length; i++) {
- var handle = $.trim(n[i]), dt = o.defaultTheme, hname = 'ui-resizable-'+handle, loadDefault = !$.ui.css(hname) && !o.knobHandles, userKnobClass = $.ui.css('ui-resizable-knob-handle'),
- allDefTheme = $.extend(dt[hname], dt['ui-resizable-handle']), allKnobTheme = $.extend(o.knobTheme[hname], !userKnobClass ? o.knobTheme['ui-resizable-handle'] : {});
-
- // increase zIndex of sw, se, ne, nw axis
- var applyZIndex = /sw|se|ne|nw/.test(handle) ? { zIndex: ++o.zIndex } : {};
-
- var defCss = (loadDefault ? insertionsDefault[handle] : ''),
- axis = $(['<div class="ui-resizable-handle ', hname, '" style="', defCss, insertionsDefault.handle, '"></div>'].join('')).css( applyZIndex );
- o.handles[handle] = '.ui-resizable-'+handle;
-
- this.element.append(
- //Theme detection, if not loaded, load o.defaultTheme
- axis.css( loadDefault ? allDefTheme : {} )
- // Load the knobHandle css, fix width, height, top, left...
- .css( o.knobHandles ? allKnobTheme : {} ).addClass(o.knobHandles ? 'ui-resizable-knob-handle' : '').addClass(o.knobHandles)
- );
- }
-
- if (o.knobHandles) this.element.addClass('ui-resizable-knob').css( !$.ui.css('ui-resizable-knob') ? { /*border: '1px #fff dashed'*/ } : {} );
- }
-
- this._renderAxis = function(target) {
- target = target || this.element;
-
- for(var i in o.handles) {
- if(o.handles[i].constructor == String)
- o.handles[i] = $(o.handles[i], this.element).show();
-
- if (o.transparent)
- o.handles[i].css({opacity:0});
-
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
- if (this.element.is('.ui-wrapper') &&
- o._nodeName.match(/textarea|input|select|button/i)) {
-
- var axis = $(o.handles[i], this.element), padWrapper = 0;
-
- //Checking the correct pad and border
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
- //The padding type i have to apply...
- var padPos = [ 'padding',
- /ne|nw|n/.test(i) ? 'Top' :
- /se|sw|s/.test(i) ? 'Bottom' :
- /^e$/.test(i) ? 'Right' : 'Left' ].join("");
-
- if (!o.transparent)
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
- }
- if(!$(o.handles[i]).length) continue;
- }
- };
-
- this._renderAxis(this.element);
- o._handles = $('.ui-resizable-handle', self.element);
-
- if (o.disableSelection)
- o._handles.each(function(i, e) { $.ui.disableSelection(e); });
-
- //Matching axis name
- o._handles.mouseover(function() {
- if (!o.resizing) {
- if (this.className)
- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- //Axis, default = se
- self.axis = o.axis = axis && axis[1] ? axis[1] : 'se';
- }
- });
-
- //If we want to auto hide the elements
- if (o.autohide) {
- o._handles.hide();
- $(self.element).addClass("ui-resizable-autohide").hover(function() {
- $(this).removeClass("ui-resizable-autohide");
- o._handles.show();
- },
- function(){
- if (!o.resizing) {
- $(this).addClass("ui-resizable-autohide");
- o._handles.hide();
- }
- });
- }
-
- this.mouseInit();
- },
- plugins: {},
- ui: function() {
- return {
- axis: this.options.axis,
- options: this.options
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.ui()]);
- this.element.triggerHandler(n == "resize" ? n : ["resize", n].join(""), [e, this.ui()], this.options[n]);
- },
- destroy: function() {
- var el = this.element, wrapped = el.children(".ui-resizable").get(0);
-
- this.mouseDestroy();
-
- var _destroy = function(exp) {
- $(exp).removeClass("ui-resizable ui-resizable-disabled")
- .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
- };
-
- _destroy(el);
-
- if (el.is('.ui-wrapper') && wrapped) {
- el.parent().append(
- $(wrapped).css({
- position: el.css('position'),
- width: el.outerWidth(),
- height: el.outerHeight(),
- top: el.css('top'),
- left: el.css('left')
- })
- ).end().remove();
-
- _destroy(wrapped);
- }
- },
- enable: function() {
- this.element.removeClass("ui-resizable-disabled");
- this.options.disabled = false;
- },
- disable: function() {
- this.element.addClass("ui-resizable-disabled");
- this.options.disabled = true;
- },
- mouseStart: function(e) {
- if(this.options.disabled) return false;
-
- var handle = false;
- for(var i in this.options.handles) {
- if($(this.options.handles[i])[0] == e.target) handle = true;
- }
- if (!handle) return false;
-
- var o = this.options, iniPos = this.element.position(), el = this.element,
- num = function(v) { return parseInt(v, 10) || 0; }, ie6 = $.browser.msie && $.browser.version < 7;
- o.resizing = true;
- o.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
-
- // bugfix #1749
- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
-
- // sOffset decides if document scrollOffset will be added to the top/left of the resizable element
- var sOffset = $.browser.msie && !o.containment && (/absolute/).test(el.css('position')) && !(/relative/).test(el.parent().css('position'));
- var dscrollt = sOffset ? o.documentScroll.top : 0, dscrolll = sOffset ? o.documentScroll.left : 0;
-
- el.css({ position: 'absolute', top: (iniPos.top + dscrollt), left: (iniPos.left + dscrolll) });
- }
-
- //Opera fixing relative position
- if ($.browser.opera && /relative/.test(el.css('position')))
- el.css({ position: 'relative', top: 'auto', left: 'auto' });
-
- this._renderProxy();
-
- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
-
- //Store needed variables
- this.offset = this.helper.offset();
- this.position = { left: curleft, top: curtop };
- this.size = o.proxy || ie6 ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalSize = o.proxy || ie6 ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalPosition = { left: curleft, top: curtop };
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
- this.originalMousePosition = { left: e.pageX, top: e.pageY };
-
- //Aspect Ratio
- o.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.height / this.originalSize.width)||1);
-
- if (o.preserveCursor)
- $('body').css('cursor', this.axis + '-resize');
-
- this.propagate("start", e);
- return true;
- },
- mouseDrag: function(e) {
-
- //Increase performance, avoid regex
- var el = this.helper, o = this.options, props = {},
- self = this, smp = this.originalMousePosition, a = this.axis;
-
- var dx = (e.pageX-smp.left)||0, dy = (e.pageY-smp.top)||0;
- var trigger = this._change[a];
- if (!trigger) return false;
-
- // Calculate the attrs that will be change
- var data = trigger.apply(this, [e, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
-
- if (o._aspectRatio || e.shiftKey)
- data = this._updateRatio(data, e);
-
- data = this._respectSize(data, e);
-
- this.propagate("resize", e);
-
- el.css({
- top: this.position.top + "px", left: this.position.left + "px",
- width: this.size.width + "px", height: this.size.height + "px"
- });
-
- if (!o.proxy && o.proportionallyResize)
- this._proportionallyResize();
-
- this._updateCache(data);
-
- return false;
- },
- mouseStop: function(e) {
-
- this.options.resizing = false;
- var o = this.options, num = function(v) { return parseInt(v, 10) || 0; }, self = this;
-
- if(o.proxy) {
- var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName),
- soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- if (!o.animate)
- this.element.css($.extend(s, { top: top, left: left }));
-
- if (o.proxy && !o.animate) this._proportionallyResize();
- this.helper.remove();
- }
-
- if (o.preserveCursor)
- $('body').css('cursor', 'auto');
-
- this.propagate("stop", e);
- return false;
- },
- _updateCache: function(data) {
- var o = this.options;
- this.offset = this.helper.offset();
- if (data.left) this.position.left = data.left;
- if (data.top) this.position.top = data.top;
- if (data.height) this.size.height = data.height;
- if (data.width) this.size.width = data.width;
- },
- _updateRatio: function(data, e) {
- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
-
- if (data.height) data.width = (csize.height / o.aspectRatio);
- else if (data.width) data.height = (csize.width * o.aspectRatio);
-
- if (a == 'sw') {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
- if (a == 'nw') {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
- _respectSize: function(data, e) {
-
- var el = this.helper, o = this.options, pRatio = o._aspectRatio || e.shiftKey, a = this.axis,
- ismaxw = data.width && o.maxWidth && o.maxWidth < data.width, ismaxh = data.height && o.maxHeight && o.maxHeight < data.height,
- isminw = data.width && o.minWidth && o.minWidth > data.width, isminh = data.height && o.minHeight && o.minHeight > data.height;
-
- if (isminw) data.width = o.minWidth;
- if (isminh) data.height = o.minHeight;
- if (ismaxw) data.width = o.maxWidth;
- if (ismaxh) data.height = o.maxHeight;
-
- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-
- if (isminw && cw) data.left = dw - o.minWidth;
- if (ismaxw && cw) data.left = dw - o.maxWidth;
- if (isminh && ch) data.top = dh - o.minHeight;
- if (ismaxh && ch) data.top = dh - o.maxHeight;
-
- // fixing jump error on top/left - bug #2330
- var isNotwh = !data.width && !data.height;
- if (isNotwh && !data.left && data.top) data.top = null;
- else if (isNotwh && !data.top && data.left) data.left = null;
-
- return data;
- },
- _proportionallyResize: function() {
- var o = this.options;
- if (!o.proportionallyResize) return;
- var prel = o.proportionallyResize, el = this.helper || this.element;
-
- if (!o.borderDif) {
- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
-
- o.borderDif = $.map(b, function(v, i) {
- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
- return border + padding;
- });
- }
- prel.css({
- height: (el.height() - o.borderDif[0] - o.borderDif[2]) + "px",
- width: (el.width() - o.borderDif[1] - o.borderDif[3]) + "px"
- });
- },
- _renderProxy: function() {
- var el = this.element, o = this.options;
- this.elementOffset = el.offset();
-
- if(o.proxy) {
- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
-
- // fix ie6 offset
- var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
- pxyoffset = ( ie6 ? 2 : -1 );
-
- this.helper.addClass(o.proxy).css({
- width: el.outerWidth() + pxyoffset,
- height: el.outerHeight() + pxyoffset,
- position: 'absolute',
- left: this.elementOffset.left - ie6offset +'px',
- top: this.elementOffset.top - ie6offset +'px',
- zIndex: ++o.zIndex
- });
-
- this.helper.appendTo("body");
-
- if (o.disableSelection)
- $.ui.disableSelection(this.helper.get(0));
-
- } else {
- this.helper = el;
- }
- },
- _change: {
- e: function(e, dx, dy) {
- return { width: this.originalSize.width + dx };
- },
- w: function(e, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { left: sp.left + dx, width: cs.width - dx };
- },
- n: function(e, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { top: sp.top + dy, height: cs.height - dy };
- },
- s: function(e, dx, dy) {
- return { height: this.originalSize.height + dy };
- },
- se: function(e, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, dx, dy]));
- },
- sw: function(e, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, dx, dy]));
- },
- ne: function(e, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, dx, dy]));
- },
- nw: function(e, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, dx, dy]));
- }
- }
-}));
-
-$.extend($.ui.resizable, {
- defaults: {
- cancel: ":input,button",
- distance: 0,
- delay: 0,
- preventDefault: true,
- transparent: false,
- minWidth: 10,
- minHeight: 10,
- aspectRatio: false,
- disableSelection: true,
- preserveCursor: true,
- autohide: false,
- knobHandles: false
- }
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "containment", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), el = self.element;
- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
- if (!ce) return;
-
- if (/document/.test(oc) || oc == document) {
- self.containerOffset = { left: 0, top: 0 };
-
- self.parentData = {
- element: $(document), left: 0, top: 0, width: $(document).width(),
- height: $(document).height() || document.body.parentNode.scrollHeight
- };
- }
-
- // i'm a node, so compute top, left, right, bottom
- else{
- self.containerOffset = $(ce).offset();
- self.containerSize = { height: $(ce).innerHeight(), width: $(ce).innerWidth() };
-
- var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
-
- self.parentData = {
- element: ce, left: co.left, top: co.top, width: width, height: height
- };
- }
- },
-
- resize: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), ps = self.containerSize,
- co = self.containerOffset, cs = self.size, cp = self.position,
- pRatio = o._aspectRatio || e.shiftKey;
-
- if (cp.left < (o.proxy ? co.left : 0)) {
- self.size.width = self.size.width + (o.proxy ? (self.position.left - co.left) : self.position.left);
- if (pRatio) self.size.height = self.size.width * o.aspectRatio;
- self.position.left = o.proxy ? co.left : 0;
- }
-
- if (cp.top < (o.proxy ? co.top : 0)) {
- self.size.height = self.size.height + (o.proxy ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height / o.aspectRatio;
- self.position.top = o.proxy ? co.top : 0;
- }
-
- var woset = (o.proxy ? self.offset.left - co.left : self.position.left) + self.sizeDiff.width,
- hoset = (o.proxy ? self.offset.top - co.top : self.position.top) + self.sizeDiff.height;
-
- if (woset + self.size.width >= self.parentData.width) {
- self.size.width = self.parentData.width - woset;
- if (pRatio) self.size.height = self.size.width * o.aspectRatio;
- }
-
- if (hoset + self.size.height >= self.parentData.height) {
- self.size.height = self.parentData.height - hoset;
- if (pRatio) self.size.width = self.size.height / o.aspectRatio;
- }
- }
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
- resize: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || e.shiftKey;
- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
-
- if (/^(se|s|e)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- }
- else if (/^(ne)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- }
- else if (/^(sw)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.left = op.left - ox;
- }
- else {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- self.position.left = op.left - ox;
- }
- }
-
-});
-
-$.ui.plugin.add("resizable", "animate", {
-
- stop: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable");
-
- var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName),
- soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- self.element.animate(
- $.extend(style, top && left ? { top: top, left: left } : {}), {
- duration: o.animateDuration || "slow", easing: o.animateEasing || "swing",
- step: function() {
-
- var data = {
- width: parseInt(self.element.css('width'), 10),
- height: parseInt(self.element.css('height'), 10),
- top: parseInt(self.element.css('top'), 10),
- left: parseInt(self.element.css('left'), 10)
- };
-
- if (pr) pr.css({ width: data.width, height: data.height });
-
- // propagating resize, and updating values for each animation step
- self._updateCache(data);
- self.propagate("animate", e);
-
- }
- }
- );
- }
-
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize, cs = self.size;
-
- if (!pr) self.ghost = self.element.clone();
- else self.ghost = pr.clone();
-
- self.ghost.css(
- { opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }
- )
- .addClass('ui-resizable-ghost').addClass(typeof o.ghost == 'string' ? o.ghost : '');
-
- self.ghost.appendTo(self.helper);
-
- },
-
- resize: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize;
-
- if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
-
- },
-
- stop: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize;
- if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
- }
-
-});
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
- start: function(e, ui) {
- var o = ui.options, self = $(this).data("resizable"),
-
- _store = function(exp) {
- $(exp).each(function() {
- $(this).data("resizable-alsoresize", {
- width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10),
- left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10)
- });
- });
- };
-
- if (typeof(o.alsoResize) == 'object') {
- $.each(o.alsoResize, function(exp, c) { _store(exp); });
- }else{
- _store(o.alsoResize);
- }
- },
-
- resize: function(e, ui){
- var o = ui.options, self = $(this).data("resizable"), os = self.originalSize, op = self.originalPosition;
-
- var delta = {
- height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
- top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
- },
-
- _alsoResize = function(exp, c) {
- $(exp).each(function() {
- var start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left'];
-
- $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) {
- var sum = (start[prop]||0) + (delta[prop]||0);
- if (sum && sum >= 0)
- style[prop] = sum || null;
- });
- $(this).css(style);
- });
- };
-
- if (typeof(o.alsoResize) == 'object') {
- $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); });
- }else{
- _alsoResize(o.alsoResize);
- }
- },
-
- stop: function(e, ui){
- $(this).removeData("resizable-alsoresize-start");
- }
-});
-
-})(jQuery);
+/* + * jQuery UI Resizable + * + * Copyright (c) 2008 Paul Bakaus + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * ui.core.js + * + * Revision: $Id: ui.resizable.js 5668 2008-05-22 18:17:30Z rdworth $ + */ +;(function($) { + +$.widget("ui.resizable", $.extend($.ui.mouse, { + init: function() { + + var self = this, o = this.options; + + var elpos = this.element.css('position'); + + // simulate .ui-resizable { position: relative; } + this.element.addClass("ui-resizable").css({ position: /static/.test(elpos) ? 'relative' : elpos }); + + $.extend(o, { + _aspectRatio: !!(o.aspectRatio), + proxy: o.proxy || o.ghost || o.animate ? o.proxy || 'proxy' : null, + knobHandles: o.knobHandles === true ? 'ui-resizable-knob-handle' : o.knobHandles + }); + + //Default Theme + var aBorder = '1px solid #DEDEDE'; + + o.defaultTheme = { + 'ui-resizable': { display: 'block' }, + 'ui-resizable-handle': { position: 'absolute', background: '#F2F2F2', fontSize: '0.1px' }, + 'ui-resizable-n': { cursor: 'n-resize', height: '4px', left: '0px', right: '0px', borderTop: aBorder }, + 'ui-resizable-s': { cursor: 's-resize', height: '4px', left: '0px', right: '0px', borderBottom: aBorder }, + 'ui-resizable-e': { cursor: 'e-resize', width: '4px', top: '0px', bottom: '0px', borderRight: aBorder }, + 'ui-resizable-w': { cursor: 'w-resize', width: '4px', top: '0px', bottom: '0px', borderLeft: aBorder }, + 'ui-resizable-se': { cursor: 'se-resize', width: '4px', height: '4px', borderRight: aBorder, borderBottom: aBorder }, + 'ui-resizable-sw': { cursor: 'sw-resize', width: '4px', height: '4px', borderBottom: aBorder, borderLeft: aBorder }, + 'ui-resizable-ne': { cursor: 'ne-resize', width: '4px', height: '4px', borderRight: aBorder, borderTop: aBorder }, + 'ui-resizable-nw': { cursor: 'nw-resize', width: '4px', height: '4px', borderLeft: aBorder, borderTop: aBorder } + }; + + o.knobTheme = { + 'ui-resizable-handle': { background: '#F2F2F2', border: '1px solid #808080', height: '8px', width: '8px' }, + 'ui-resizable-n': { cursor: 'n-resize', top: '0px', left: '45%' }, + 'ui-resizable-s': { cursor: 's-resize', bottom: '0px', left: '45%' }, + 'ui-resizable-e': { cursor: 'e-resize', right: '0px', top: '45%' }, + 'ui-resizable-w': { cursor: 'w-resize', left: '0px', top: '45%' }, + 'ui-resizable-se': { cursor: 'se-resize', right: '0px', bottom: '0px' }, + 'ui-resizable-sw': { cursor: 'sw-resize', left: '0px', bottom: '0px' }, + 'ui-resizable-nw': { cursor: 'nw-resize', left: '0px', top: '0px' }, + 'ui-resizable-ne': { cursor: 'ne-resize', right: '0px', top: '0px' } + }; + + o._nodeName = this.element[0].nodeName; + + //Wrap the element if it cannot hold child nodes + if(o._nodeName.match(/canvas|textarea|input|select|button|img/i)) { + var el = this.element; + + //Opera fixing relative position + if (/relative/.test(el.css('position')) && $.browser.opera) + el.css({ position: 'relative', top: 'auto', left: 'auto' }); + + //Create a wrapper element and set the wrapper to the new current internal element + el.wrap( + $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css( { + position: el.css('position'), + width: el.outerWidth(), + height: el.outerHeight(), + top: el.css('top'), + left: el.css('left') + }) + ); + + var oel = this.element; this.element = this.element.parent(); + + //Move margins to the wrapper + this.element.css({ marginLeft: oel.css("marginLeft"), marginTop: oel.css("marginTop"), + marginRight: oel.css("marginRight"), marginBottom: oel.css("marginBottom") + }); + + oel.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + if ($.browser.safari && o.preventDefault) oel.css('resize', 'none'); + + o.proportionallyResize = oel.css({ position: 'static', zoom: 1, display: 'block' }); + + // avoid IE jump + this.element.css({ margin: oel.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + } + + if(!o.handles) o.handles = !$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }; + if(o.handles.constructor == String) { + + o.zIndex = o.zIndex || 1000; + + if(o.handles == 'all') o.handles = 'n,e,s,w,se,sw,ne,nw'; + + var n = o.handles.split(","); o.handles = {}; + + // insertions are applied when don't have theme loaded + var insertionsDefault = { + handle: 'position: absolute; display: none; overflow:hidden;', + n: 'top: 0pt; width:100%;', + e: 'right: 0pt; height:100%;', + s: 'bottom: 0pt; width:100%;', + w: 'left: 0pt; height:100%;', + se: 'bottom: 0pt; right: 0px;', + sw: 'bottom: 0pt; left: 0px;', + ne: 'top: 0pt; right: 0px;', + nw: 'top: 0pt; left: 0px;' + }; + + for(var i = 0; i < n.length; i++) { + var handle = $.trim(n[i]), dt = o.defaultTheme, hname = 'ui-resizable-'+handle, loadDefault = !$.ui.css(hname) && !o.knobHandles, userKnobClass = $.ui.css('ui-resizable-knob-handle'), + allDefTheme = $.extend(dt[hname], dt['ui-resizable-handle']), allKnobTheme = $.extend(o.knobTheme[hname], !userKnobClass ? o.knobTheme['ui-resizable-handle'] : {}); + + // increase zIndex of sw, se, ne, nw axis + var applyZIndex = /sw|se|ne|nw/.test(handle) ? { zIndex: ++o.zIndex } : {}; + + var defCss = (loadDefault ? insertionsDefault[handle] : ''), + axis = $(['<div class="ui-resizable-handle ', hname, '" style="', defCss, insertionsDefault.handle, '"></div>'].join('')).css( applyZIndex ); + o.handles[handle] = '.ui-resizable-'+handle; + + this.element.append( + //Theme detection, if not loaded, load o.defaultTheme + axis.css( loadDefault ? allDefTheme : {} ) + // Load the knobHandle css, fix width, height, top, left... + .css( o.knobHandles ? allKnobTheme : {} ).addClass(o.knobHandles ? 'ui-resizable-knob-handle' : '').addClass(o.knobHandles) + ); + } + + if (o.knobHandles) this.element.addClass('ui-resizable-knob').css( !$.ui.css('ui-resizable-knob') ? { /*border: '1px #fff dashed'*/ } : {} ); + } + + this._renderAxis = function(target) { + target = target || this.element; + + for(var i in o.handles) { + if(o.handles[i].constructor == String) + o.handles[i] = $(o.handles[i], this.element).show(); + + if (o.transparent) + o.handles[i].css({opacity:0}); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.element.is('.ui-wrapper') && + o._nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(o.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + if (!o.transparent) + target.css(padPos, padWrapper); + + this._proportionallyResize(); + } + if(!$(o.handles[i]).length) continue; + } + }; + + this._renderAxis(this.element); + o._handles = $('.ui-resizable-handle', self.element); + + if (o.disableSelection) + o._handles.each(function(i, e) { $.ui.disableSelection(e); }); + + //Matching axis name + o._handles.mouseover(function() { + if (!o.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + self.axis = o.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autohide) { + o._handles.hide(); + $(self.element).addClass("ui-resizable-autohide").hover(function() { + $(this).removeClass("ui-resizable-autohide"); + o._handles.show(); + }, + function(){ + if (!o.resizing) { + $(this).addClass("ui-resizable-autohide"); + o._handles.hide(); + } + }); + } + + this.mouseInit(); + }, + plugins: {}, + ui: function() { + return { + axis: this.options.axis, + options: this.options + }; + }, + propagate: function(n,e) { + $.ui.plugin.call(this, n, [e, this.ui()]); + this.element.triggerHandler(n == "resize" ? n : ["resize", n].join(""), [e, this.ui()], this.options[n]); + }, + destroy: function() { + var el = this.element, wrapped = el.children(".ui-resizable").get(0); + + this.mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled") + .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + _destroy(el); + + if (el.is('.ui-wrapper') && wrapped) { + el.parent().append( + $(wrapped).css({ + position: el.css('position'), + width: el.outerWidth(), + height: el.outerHeight(), + top: el.css('top'), + left: el.css('left') + }) + ).end().remove(); + + _destroy(wrapped); + } + }, + enable: function() { + this.element.removeClass("ui-resizable-disabled"); + this.options.disabled = false; + }, + disable: function() { + this.element.addClass("ui-resizable-disabled"); + this.options.disabled = true; + }, + mouseStart: function(e) { + if(this.options.disabled) return false; + + var handle = false; + for(var i in this.options.handles) { + if($(this.options.handles[i])[0] == e.target) handle = true; + } + if (!handle) return false; + + var o = this.options, iniPos = this.element.position(), el = this.element, + num = function(v) { return parseInt(v, 10) || 0; }, ie6 = $.browser.msie && $.browser.version < 7; + o.resizing = true; + o.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix #1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + + // sOffset decides if document scrollOffset will be added to the top/left of the resizable element + var sOffset = $.browser.msie && !o.containment && (/absolute/).test(el.css('position')) && !(/relative/).test(el.parent().css('position')); + var dscrollt = sOffset ? o.documentScroll.top : 0, dscrolll = sOffset ? o.documentScroll.left : 0; + + el.css({ position: 'absolute', top: (iniPos.top + dscrollt), left: (iniPos.left + dscrolll) }); + } + + //Opera fixing relative position + if ($.browser.opera && /relative/.test(el.css('position'))) + el.css({ position: 'relative', top: 'auto', left: 'auto' }); + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = o.proxy || ie6 ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = o.proxy || ie6 ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: e.pageX, top: e.pageY }; + + //Aspect Ratio + o.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.height / this.originalSize.width)||1); + + if (o.preserveCursor) + $('body').css('cursor', this.axis + '-resize'); + + this.propagate("start", e); + return true; + }, + mouseDrag: function(e) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + self = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (e.pageX-smp.left)||0, dy = (e.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [e, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; + + if (o._aspectRatio || e.shiftKey) + data = this._updateRatio(data, e); + + data = this._respectSize(data, e); + + this.propagate("resize", e); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!o.proxy && o.proportionallyResize) + this._proportionallyResize(); + + this._updateCache(data); + + return false; + }, + mouseStop: function(e) { + + this.options.resizing = false; + var o = this.options, num = function(v) { return parseInt(v, 10) || 0; }, self = this; + + if(o.proxy) { + var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName), + soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + if (o.proxy && !o.animate) this._proportionallyResize(); + this.helper.remove(); + } + + if (o.preserveCursor) + $('body').css('cursor', 'auto'); + + this.propagate("stop", e); + return false; + }, + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (data.left) this.position.left = data.left; + if (data.top) this.position.top = data.top; + if (data.height) this.size.height = data.height; + if (data.width) this.size.width = data.width; + }, + _updateRatio: function(data, e) { + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (data.height) data.width = (csize.height / o.aspectRatio); + else if (data.width) data.height = (csize.width * o.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + _respectSize: function(data, e) { + + var el = this.helper, o = this.options, pRatio = o._aspectRatio || e.shiftKey, a = this.axis, + ismaxw = data.width && o.maxWidth && o.maxWidth < data.width, ismaxh = data.height && o.maxHeight && o.maxHeight < data.height, + isminw = data.width && o.minWidth && o.minWidth > data.width, isminh = data.height && o.minHeight && o.minHeight > data.height; + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + _proportionallyResize: function() { + var o = this.options; + if (!o.proportionallyResize) return; + var prel = o.proportionallyResize, el = this.helper || this.element; + + if (!o.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + o.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + prel.css({ + height: (el.height() - o.borderDif[0] - o.borderDif[2]) + "px", + width: (el.width() - o.borderDif[1] - o.borderDif[3]) + "px" + }); + }, + _renderProxy: function() { + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(o.proxy) { + this.helper = this.helper || $('<div style="overflow:hidden;"></div>'); + + // fix ie6 offset + var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), + pxyoffset = ( ie6 ? 2 : -1 ); + + this.helper.addClass(o.proxy).css({ + width: el.outerWidth() + pxyoffset, + height: el.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex + }); + + this.helper.appendTo("body"); + + if (o.disableSelection) + $.ui.disableSelection(this.helper.get(0)); + + } else { + this.helper = el; + } + }, + _change: { + e: function(e, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(e, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(e, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(e, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(e, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, dx, dy])); + }, + sw: function(e, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, dx, dy])); + }, + ne: function(e, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, dx, dy])); + }, + nw: function(e, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, dx, dy])); + } + } +})); + +$.extend($.ui.resizable, { + defaults: { + cancel: ":input,button", + distance: 0, + delay: 0, + preventDefault: true, + transparent: false, + minWidth: 10, + minHeight: 10, + aspectRatio: false, + disableSelection: true, + preserveCursor: true, + autohide: false, + knobHandles: false + } +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "containment", { + + start: function(e, ui) { + var o = ui.options, self = $(this).data("resizable"), el = self.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + if (/document/.test(oc) || oc == document) { + self.containerOffset = { left: 0, top: 0 }; + + self.parentData = { + element: $(document), left: 0, top: 0, width: $(document).width(), + height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else{ + self.containerOffset = $(ce).offset(); + self.containerSize = { height: $(ce).innerHeight(), width: $(ce).innerWidth() }; + + var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + self.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(e, ui) { + var o = ui.options, self = $(this).data("resizable"), ps = self.containerSize, + co = self.containerOffset, cs = self.size, cp = self.position, + pRatio = o._aspectRatio || e.shiftKey; + + if (cp.left < (o.proxy ? co.left : 0)) { + self.size.width = self.size.width + (o.proxy ? (self.position.left - co.left) : self.position.left); + if (pRatio) self.size.height = self.size.width * o.aspectRatio; + self.position.left = o.proxy ? co.left : 0; + } + + if (cp.top < (o.proxy ? co.top : 0)) { + self.size.height = self.size.height + (o.proxy ? (self.position.top - co.top) : self.position.top); + if (pRatio) self.size.width = self.size.height / o.aspectRatio; + self.position.top = o.proxy ? co.top : 0; + } + + var woset = (o.proxy ? self.offset.left - co.left : self.position.left) + self.sizeDiff.width, + hoset = (o.proxy ? self.offset.top - co.top : self.position.top) + self.sizeDiff.height; + + if (woset + self.size.width >= self.parentData.width) { + self.size.width = self.parentData.width - woset; + if (pRatio) self.size.height = self.size.width * o.aspectRatio; + } + + if (hoset + self.size.height >= self.parentData.height) { + self.size.height = self.parentData.height - hoset; + if (pRatio) self.size.width = self.size.height / o.aspectRatio; + } + } +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(e, ui) { + var o = ui.options, self = $(this).data("resizable"), cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || e.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.left = op.left - ox; + } + else { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + self.position.left = op.left - ox; + } + } + +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(e, ui) { + var o = ui.options, self = $(this).data("resizable"); + + var pr = o.proportionallyResize, ista = pr && (/textarea/i).test(pr.get(0).nodeName), + soffseth = ista && $.ui.hasScroll(pr.get(0), 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + self.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration || "slow", easing: o.animateEasing || "swing", + step: function() { + + var data = { + width: parseInt(self.element.css('width'), 10), + height: parseInt(self.element.css('height'), 10), + top: parseInt(self.element.css('top'), 10), + left: parseInt(self.element.css('left'), 10) + }; + + if (pr) pr.css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + self._updateCache(data); + self.propagate("animate", e); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(e, ui) { + var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize, cs = self.size; + + if (!pr) self.ghost = self.element.clone(); + else self.ghost = pr.clone(); + + self.ghost.css( + { opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 } + ) + .addClass('ui-resizable-ghost').addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + self.ghost.appendTo(self.helper); + + }, + + resize: function(e, ui){ + var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize; + + if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); + + }, + + stop: function(e, ui){ + var o = ui.options, self = $(this).data("resizable"), pr = o.proportionallyResize; + if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function(e, ui) { + var o = ui.options, self = $(this).data("resizable"), + + _store = function(exp) { + $(exp).each(function() { + $(this).data("resizable-alsoresize", { + width: parseInt($(this).width(), 10), height: parseInt($(this).height(), 10), + left: parseInt($(this).css('left'), 10), top: parseInt($(this).css('top'), 10) + }); + }); + }; + + if (typeof(o.alsoResize) == 'object') { + $.each(o.alsoResize, function(exp, c) { _store(exp); }); + }else{ + _store(o.alsoResize); + } + }, + + resize: function(e, ui){ + var o = ui.options, self = $(this).data("resizable"), os = self.originalSize, op = self.originalPosition; + + var delta = { + height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, + top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 + }, + + _alsoResize = function(exp, c) { + $(exp).each(function() { + var start = $(this).data("resizable-alsoresize"), style = {}, css = c && c.length ? c : ['width', 'height', 'top', 'left']; + + $.each(css || ['width', 'height', 'top', 'left'], function(i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + $(this).css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object') { + $.each(o.alsoResize, function(exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function(e, ui){ + $(this).removeData("resizable-alsoresize-start"); + } +}); + +})(jQuery); diff --git a/ui/source/ui.selectable.js b/ui/source/ui.selectable.js index 3c46ce2c5..5e1683ca7 100644 --- a/ui/source/ui.selectable.js +++ b/ui/source/ui.selectable.js @@ -1,274 +1,274 @@ -/*
- * jQuery UI Selectable
- *
- * Copyright (c) 2008 Richard D. Worth (rdworth.org)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Selectables
- *
- * Depends:
- * ui.core.js
- *
- * Revision: $Id: ui.selectable.js 5581 2008-05-13 16:58:03Z scott.gonzalez $
- */
-;(function($) {
-
-$.widget("ui.selectable", $.extend($.ui.mouse, {
- init: function() {
- var self = this;
-
- this.element.addClass("ui-selectable");
-
- this.dragged = false;
-
- // cache selectee children based on filter
- var selectees;
- this.refresh = function() {
- selectees = $(self.options.filter, self.element[0]);
- selectees.each(function() {
- var $this = $(this);
- var pos = $this.offset();
- $.data(this, "selectable-item", {
- element: this,
- $element: $this,
- left: pos.left,
- top: pos.top,
- right: pos.left + $this.width(),
- bottom: pos.top + $this.height(),
- startselected: false,
- selected: $this.hasClass('ui-selected'),
- selecting: $this.hasClass('ui-selecting'),
- unselecting: $this.hasClass('ui-unselecting')
- });
- });
- };
- this.refresh();
-
- this.selectees = selectees.addClass("ui-selectee");
-
- this.mouseInit();
-
- this.helper = $(document.createElement('div')).css({border:'1px dotted black'});
- },
- toggle: function() {
- if(this.options.disabled){
- this.enable();
- } else {
- this.disable();
- }
- },
- destroy: function() {
- this.element
- .removeClass("ui-selectable ui-selectable-disabled")
- .removeData("selectable")
- .unbind(".selectable");
- this.mouseDestroy();
- },
- enable: function() {
- this.element.removeClass("ui-selectable-disabled");
- this.options.disabled = false;
- },
- disable: function() {
- this.element.addClass("ui-selectable-disabled");
- this.options.disabled = true;
- },
- mouseStart: function(e) {
- var self = this;
-
- this.opos = [e.pageX, e.pageY];
-
- if (this.options.disabled)
- return;
-
- var options = this.options;
-
- this.selectees = $(options.filter, this.element[0]);
-
- // selectable START callback
- this.element.triggerHandler("selectablestart", [e, {
- "selectable": this.element[0],
- "options": options
- }], options.start);
-
- $('body').append(this.helper);
- // position helper (lasso)
- this.helper.css({
- "z-index": 100,
- "position": "absolute",
- "left": e.clientX,
- "top": e.clientY,
- "width": 0,
- "height": 0
- });
-
- if (options.autoRefresh) {
- this.refresh();
- }
-
- this.selectees.filter('.ui-selected').each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.startselected = true;
- if (!e.ctrlKey) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- });
-
- var isSelectee = false;
- $(e.target).parents().andSelf().each(function() {
- if($.data(this, "selectable-item")) isSelectee = true;
- });
- return this.options.keyboard ? !isSelectee : true;
- },
- mouseDrag: function(e) {
- var self = this;
- this.dragged = true;
-
- if (this.options.disabled)
- return;
-
- var options = this.options;
-
- var x1 = this.opos[0], y1 = this.opos[1], x2 = e.pageX, y2 = e.pageY;
- if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
- if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
- this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
-
- this.selectees.each(function() {
- var selectee = $.data(this, "selectable-item");
- //prevent helper from being selected if appendTo: selectable
- if (!selectee || selectee.element == self.element[0])
- return;
- var hit = false;
- if (options.tolerance == 'touch') {
- hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
- } else if (options.tolerance == 'fit') {
- hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
- }
-
- if (hit) {
- // SELECT
- if (selectee.selected) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
- }
- if (selectee.unselecting) {
- selectee.$element.removeClass('ui-unselecting');
- selectee.unselecting = false;
- }
- if (!selectee.selecting) {
- selectee.$element.addClass('ui-selecting');
- selectee.selecting = true;
- // selectable SELECTING callback
- self.element.triggerHandler("selectableselecting", [e, {
- selectable: self.element[0],
- selecting: selectee.element,
- options: options
- }], options.selecting);
- }
- } else {
- // UNSELECT
- if (selectee.selecting) {
- if (e.ctrlKey && selectee.startselected) {
- selectee.$element.removeClass('ui-selecting');
- selectee.selecting = false;
- selectee.$element.addClass('ui-selected');
- selectee.selected = true;
- } else {
- selectee.$element.removeClass('ui-selecting');
- selectee.selecting = false;
- if (selectee.startselected) {
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- }
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- }
- if (selectee.selected) {
- if (!e.ctrlKey && !selectee.startselected) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
-
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- // selectable UNSELECTING callback
- self.element.triggerHandler("selectableunselecting", [e, {
- selectable: self.element[0],
- unselecting: selectee.element,
- options: options
- }], options.unselecting);
- }
- }
- }
- });
-
- return false;
- },
- mouseStop: function(e) {
- var self = this;
-
- this.dragged = false;
-
- var options = this.options;
-
- $('.ui-unselecting', this.element[0]).each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.$element.removeClass('ui-unselecting');
- selectee.unselecting = false;
- selectee.startselected = false;
- self.element.triggerHandler("selectableunselected", [e, {
- selectable: self.element[0],
- unselected: selectee.element,
- options: options
- }], options.unselected);
- });
- $('.ui-selecting', this.element[0]).each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
- selectee.selecting = false;
- selectee.selected = true;
- selectee.startselected = true;
- self.element.triggerHandler("selectableselected", [e, {
- selectable: self.element[0],
- selected: selectee.element,
- options: options
- }], options.selected);
- });
- this.element.triggerHandler("selectablestop", [e, {
- selectable: self.element[0],
- options: this.options
- }], this.options.stop);
-
- this.helper.remove();
-
- return false;
- }
-}));
-
-$.extend($.ui.selectable, {
- defaults: {
- distance: 0,
- delay: 0,
- cancel: ":input,button",
- appendTo: 'body',
- autoRefresh: true,
- filter: '*',
- tolerance: 'touch'
- }
-});
-
-})(jQuery);
+/* + * jQuery UI Selectable + * + * Copyright (c) 2008 Richard D. Worth (rdworth.org) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * ui.core.js + * + * Revision: $Id: ui.selectable.js 5581 2008-05-13 16:58:03Z scott.gonzalez $ + */ +;(function($) { + +$.widget("ui.selectable", $.extend($.ui.mouse, { + init: function() { + var self = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + var selectees; + this.refresh = function() { + selectees = $(self.options.filter, self.element[0]); + selectees.each(function() { + var $this = $(this); + var pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.width(), + bottom: pos.top + $this.height(), + startselected: false, + selected: $this.hasClass('ui-selected'), + selecting: $this.hasClass('ui-selecting'), + unselecting: $this.hasClass('ui-unselecting') + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this.mouseInit(); + + this.helper = $(document.createElement('div')).css({border:'1px dotted black'}); + }, + toggle: function() { + if(this.options.disabled){ + this.enable(); + } else { + this.disable(); + } + }, + destroy: function() { + this.element + .removeClass("ui-selectable ui-selectable-disabled") + .removeData("selectable") + .unbind(".selectable"); + this.mouseDestroy(); + }, + enable: function() { + this.element.removeClass("ui-selectable-disabled"); + this.options.disabled = false; + }, + disable: function() { + this.element.addClass("ui-selectable-disabled"); + this.options.disabled = true; + }, + mouseStart: function(e) { + var self = this; + + this.opos = [e.pageX, e.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + // selectable START callback + this.element.triggerHandler("selectablestart", [e, { + "selectable": this.element[0], + "options": options + }], options.start); + + $('body').append(this.helper); + // position helper (lasso) + this.helper.css({ + "z-index": 100, + "position": "absolute", + "left": e.clientX, + "top": e.clientY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter('.ui-selected').each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!e.ctrlKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self.element.triggerHandler("selectableunselecting", [e, { + selectable: self.element[0], + unselecting: selectee.element, + options: options + }], options.unselecting); + } + }); + + var isSelectee = false; + $(e.target).parents().andSelf().each(function() { + if($.data(this, "selectable-item")) isSelectee = true; + }); + return this.options.keyboard ? !isSelectee : true; + }, + mouseDrag: function(e) { + var self = this; + this.dragged = true; + + if (this.options.disabled) + return; + + var options = this.options; + + var x1 = this.opos[0], y1 = this.opos[1], x2 = e.pageX, y2 = e.pageY; + if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"); + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element == self.element[0]) + return; + var hit = false; + if (options.tolerance == 'touch') { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance == 'fit') { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass('ui-selecting'); + selectee.selecting = true; + // selectable SELECTING callback + self.element.triggerHandler("selectableselecting", [e, { + selectable: self.element[0], + selecting: selectee.element, + options: options + }], options.selecting); + } + } else { + // UNSELECT + if (selectee.selecting) { + if (e.ctrlKey && selectee.startselected) { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + selectee.$element.addClass('ui-selected'); + selectee.selected = true; + } else { + selectee.$element.removeClass('ui-selecting'); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + self.element.triggerHandler("selectableunselecting", [e, { + selectable: self.element[0], + unselecting: selectee.element, + options: options + }], options.unselecting); + } + } + if (selectee.selected) { + if (!e.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self.element.triggerHandler("selectableunselecting", [e, { + selectable: self.element[0], + unselecting: selectee.element, + options: options + }], options.unselecting); + } + } + } + }); + + return false; + }, + mouseStop: function(e) { + var self = this; + + this.dragged = false; + + var options = this.options; + + $('.ui-unselecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-unselecting'); + selectee.unselecting = false; + selectee.startselected = false; + self.element.triggerHandler("selectableunselected", [e, { + selectable: self.element[0], + unselected: selectee.element, + options: options + }], options.unselected); + }); + $('.ui-selecting', this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass('ui-selecting').addClass('ui-selected'); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + self.element.triggerHandler("selectableselected", [e, { + selectable: self.element[0], + selected: selectee.element, + options: options + }], options.selected); + }); + this.element.triggerHandler("selectablestop", [e, { + selectable: self.element[0], + options: this.options + }], this.options.stop); + + this.helper.remove(); + + return false; + } +})); + +$.extend($.ui.selectable, { + defaults: { + distance: 0, + delay: 0, + cancel: ":input,button", + appendTo: 'body', + autoRefresh: true, + filter: '*', + tolerance: 'touch' + } +}); + +})(jQuery); diff --git a/ui/source/ui.slider.js b/ui/source/ui.slider.js index 02c21b9fd..b836cc710 100644 --- a/ui/source/ui.slider.js +++ b/ui/source/ui.slider.js @@ -1,430 +1,430 @@ -/*
- * jQuery UI Slider
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Slider
- *
- * Depends:
- * ui.core.js
- *
- * Revision: $Id: ui.slider.js 5539 2008-05-09 16:48:33Z paul.bakaus $
- */
-;(function($) {
-
-$.fn.unwrap = $.fn.unwrap || function(expr) {
- return this.each(function(){
- $(this).parents(expr).eq(0).after(this).remove();
- });
-};
-
-
-$.widget("ui.slider", {
- plugins: {},
- ui: function(e) {
- return {
- instance: this,
- options: this.options,
- handle: this.currentHandle,
- value: this.options.axis != "both" || !this.options.axis ? Math.round(this.value(null,this.options.axis == "vertical" ? "y" : "x")) : {
- x: Math.round(this.value(null,"x")),
- y: Math.round(this.value(null,"y"))
- },
- range: this.getRange()
- };
- },
- propagate: function(n,e) {
- $.ui.plugin.call(this, n, [e, this.ui()]);
- this.element.triggerHandler(n == "slide" ? n : "slide"+n, [e, this.ui()], this.options[n]);
- },
- destroy: function() {
- this.element
- .removeClass("ui-slider ui-slider-disabled")
- .removeData("slider")
- .unbind(".slider");
- this.handle
- .unwrap("a")
- .mouse("destroy");
- this.generated && this.generated.remove();
- },
- enable: function() {
- this.element.removeClass("ui-slider-disabled");
- this.disabled = false;
- },
- disable: function() {
- this.element.addClass("ui-slider-disabled");
- this.disabled = true;
- },
- setData: function(key, value) {
- this.options[key] = value;
- if (/min|max|steps/.test(key)) {
- this.initBoundaries();
- }
- },
-
- init: function() {
-
- var self = this;
- this.element.addClass("ui-slider");
- this.initBoundaries();
-
- // Initialize mouse and key events for interaction
- this.handle = $(this.options.handle, this.element);
- if (!this.handle.length) {
- self.handle = self.generated = $(self.options.handles || [0]).map(function() {
- var handle = $("<div/>").addClass("ui-slider-handle").appendTo(self.element);
- if (this.id)
- handle.attr("id", this.id);
- return handle[0];
- });
- }
-
-
- var handleclass = function(el) {
- this.element = $(el);
- this.element.data("mouse", this);
- this.options = self.options;
-
- this.element.bind("mousedown", function() {
- if(self.currentHandle) this.blur(self.currentHandle);
- self.focus(this,1);
- });
-
- this.mouseInit();
- };
-
- $.extend(handleclass.prototype, $.ui.mouse, {
- mouseStart: function(e) { return self.start.call(self, e, this.element[0]); },
- mouseStop: function(e) { return self.stop.call(self, e, this.element[0]); },
- mouseDrag: function(e) { return self.drag.call(self, e, this.element[0]); },
- trigger: function(e) { this.mouseDown(e); }
- });
-
-
- $(this.handle)
- .each(function() {
- new handleclass(this);
- })
- .wrap('<a href="javascript:void(0)" style="cursor:default;"></a>')
- .parent()
- .bind('focus', function(e) { self.focus(this.firstChild); })
- .bind('blur', function(e) { self.blur(this.firstChild); })
- .bind('keydown', function(e) { if(!self.options.noKeyboard) self.keydown(e.keyCode, this.firstChild); })
- ;
-
- // Bind the click to the slider itself
- this.element.bind('mousedown.slider', function(e) {
- self.click.apply(self, [e]);
- self.currentHandle.data("mouse").trigger(e);
- self.firstValue = self.firstValue + 1; //This is for always triggering the change event
- });
-
- // Move the first handle to the startValue
- $.each(this.options.handles || [], function(index, handle) {
- self.moveTo(handle.start, index, true);
- });
- if (!isNaN(this.options.startValue))
- this.moveTo(this.options.startValue, 0, true);
-
- this.previousHandle = $(this.handle[0]); //set the previous handle to the first to allow clicking before selecting the handle
- if(this.handle.length == 2 && this.options.range) this.createRange();
- },
- initBoundaries: function() {
-
- var element = this.element[0], o = this.options;
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- $.extend(o, {
- axis: o.axis || (element.offsetWidth < element.offsetHeight ? 'vertical' : 'horizontal'),
- max: !isNaN(parseInt(o.max,10)) ? { x: parseInt(o.max, 10), y: parseInt(o.max, 10) } : ({ x: o.max && o.max.x || 100, y: o.max && o.max.y || 100 }),
- min: !isNaN(parseInt(o.min,10)) ? { x: parseInt(o.min, 10), y: parseInt(o.min, 10) } : ({ x: o.min && o.min.x || 0, y: o.min && o.min.y || 0 })
- });
- //Prepare the real maxValue
- o.realMax = {
- x: o.max.x - o.min.x,
- y: o.max.y - o.min.y
- };
- //Calculate stepping based on steps
- o.stepping = {
- x: o.stepping && o.stepping.x || parseInt(o.stepping, 10) || (o.steps ? o.realMax.x/(o.steps.x || parseInt(o.steps, 10) || o.realMax.x) : 0),
- y: o.stepping && o.stepping.y || parseInt(o.stepping, 10) || (o.steps ? o.realMax.y/(o.steps.y || parseInt(o.steps, 10) || o.realMax.y) : 0)
- };
- },
-
-
- keydown: function(keyCode, handle) {
- if(/(37|38|39|40)/.test(keyCode)) {
- this.moveTo({
- x: /(37|39)/.test(keyCode) ? (keyCode == 37 ? '-' : '+') + '=' + this.oneStep("x") : 0,
- y: /(38|40)/.test(keyCode) ? (keyCode == 38 ? '-' : '+') + '=' + this.oneStep("y") : 0
- }, handle);
- }
- },
- focus: function(handle,hard) {
- this.currentHandle = $(handle).addClass('ui-slider-handle-active');
- if (hard)
- this.currentHandle.parent()[0].focus();
- },
- blur: function(handle) {
- $(handle).removeClass('ui-slider-handle-active');
- if(this.currentHandle && this.currentHandle[0] == handle) { this.previousHandle = this.currentHandle; this.currentHandle = null; };
- },
- click: function(e) {
- // This method is only used if:
- // - The user didn't click a handle
- // - The Slider is not disabled
- // - There is a current, or previous selected handle (otherwise we wouldn't know which one to move)
-
- var pointer = [e.pageX,e.pageY];
-
- var clickedHandle = false;
- this.handle.each(function() {
- if(this == e.target)
- clickedHandle = true;
- });
- if (clickedHandle || this.disabled || !(this.currentHandle || this.previousHandle))
- return;
-
- // If a previous handle was focussed, focus it again
- if (!this.currentHandle && this.previousHandle)
- this.focus(this.previousHandle, true);
-
- // propagate only for distance > 0, otherwise propagation is done my drag
- this.offset = this.element.offset();
-
- this.moveTo({
- y: this.convertValue(e.pageY - this.offset.top - this.currentHandle[0].offsetHeight/2, "y"),
- x: this.convertValue(e.pageX - this.offset.left - this.currentHandle[0].offsetWidth/2, "x")
- }, null, !this.options.distance);
- },
-
-
-
- createRange: function() {
- this.rangeElement = $('<div></div>')
- .addClass('ui-slider-range')
- .css({ position: 'absolute' })
- .appendTo(this.element);
- this.updateRange();
- },
- updateRange: function() {
- var prop = this.options.axis == "vertical" ? "top" : "left";
- var size = this.options.axis == "vertical" ? "height" : "width";
- this.rangeElement.css(prop, parseInt($(this.handle[0]).css(prop),10) + this.handleSize(0, this.options.axis == "vertical" ? "y" : "x")/2);
- this.rangeElement.css(size, parseInt($(this.handle[1]).css(prop),10) - parseInt($(this.handle[0]).css(prop),10));
- },
- getRange: function() {
- return this.rangeElement ? this.convertValue(parseInt(this.rangeElement.css(this.options.axis == "vertical" ? "height" : "width"),10), this.options.axis == "vertical" ? "y" : "x") : null;
- },
-
- handleIndex: function() {
- return this.handle.index(this.currentHandle[0]);
- },
- value: function(handle, axis) {
- if(this.handle.length == 1) this.currentHandle = this.handle;
- if(!axis) axis = this.options.axis == "vertical" ? "y" : "x";
-
- var curHandle = $(handle != undefined && handle !== null ? this.handle[handle] || handle : this.currentHandle);
-
- if(curHandle.data("mouse").sliderValue) {
- return parseInt(curHandle.data("mouse").sliderValue[axis],10);
- } else {
- return parseInt(((parseInt(curHandle.css(axis == "x" ? "left" : "top"),10) / (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(handle,axis))) * this.options.realMax[axis]) + this.options.min[axis],10);
- }
-
- },
- convertValue: function(value,axis) {
- return this.options.min[axis] + (value / (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis))) * this.options.realMax[axis];
- },
-
- translateValue: function(value,axis) {
- return ((value - this.options.min[axis]) / this.options.realMax[axis]) * (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis));
- },
- translateRange: function(value,axis) {
- if (this.rangeElement) {
- if (this.currentHandle[0] == this.handle[0] && value >= this.translateValue(this.value(1),axis))
- value = this.translateValue(this.value(1,axis) - this.oneStep(axis), axis);
- if (this.currentHandle[0] == this.handle[1] && value <= this.translateValue(this.value(0),axis))
- value = this.translateValue(this.value(0,axis) + this.oneStep(axis), axis);
- }
- if (this.options.handles) {
- var handle = this.options.handles[this.handleIndex()];
- if (value < this.translateValue(handle.min,axis)) {
- value = this.translateValue(handle.min,axis);
- } else if (value > this.translateValue(handle.max,axis)) {
- value = this.translateValue(handle.max,axis);
- }
- }
- return value;
- },
- translateLimits: function(value,axis) {
- if (value >= this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis))
- value = this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis);
- if (value <= 0)
- value = 0;
- return value;
- },
- handleSize: function(handle,axis) {
- return $(handle != undefined && handle !== null ? this.handle[handle] : this.currentHandle)[0]["offset"+(axis == "x" ? "Width" : "Height")];
- },
- oneStep: function(axis) {
- return this.options.stepping[axis] || 1;
- },
-
-
- start: function(e, handle) {
-
- var o = this.options;
- if(this.disabled) return false;
-
- // Prepare the outer size
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- // This is a especially ugly fix for strange blur events happening on mousemove events
- if (!this.currentHandle)
- this.focus(this.previousHandle, true);
-
- this.offset = this.element.offset();
-
- this.handleOffset = this.currentHandle.offset();
- this.clickOffset = { top: e.pageY - this.handleOffset.top, left: e.pageX - this.handleOffset.left };
-
- this.firstValue = this.value();
-
- this.propagate('start', e);
- return true;
-
- },
- stop: function(e) {
- this.propagate('stop', e);
- if (this.firstValue != this.value())
- this.propagate('change', e);
- // This is a especially ugly fix for strange blur events happening on mousemove events
- this.focus(this.currentHandle, true);
- return false;
- },
- drag: function(e, handle) {
-
- var o = this.options;
- var position = { top: e.pageY - this.offset.top - this.clickOffset.top, left: e.pageX - this.offset.left - this.clickOffset.left};
- if(!this.currentHandle) this.focus(this.previousHandle, true); //This is a especially ugly fix for strange blur events happening on mousemove events
-
- position.left = this.translateLimits(position.left, "x");
- position.top = this.translateLimits(position.top, "y");
-
- if (o.stepping.x) {
- var value = this.convertValue(position.left, "x");
- value = Math.round(value / o.stepping.x) * o.stepping.x;
- position.left = this.translateValue(value, "x");
- }
- if (o.stepping.y) {
- var value = this.convertValue(position.top, "y");
- value = Math.round(value / o.stepping.y) * o.stepping.y;
- position.top = this.translateValue(value, "y");
- }
-
- position.left = this.translateRange(position.left, "x");
- position.top = this.translateRange(position.top, "y");
-
- if(o.axis != "vertical") this.currentHandle.css({ left: position.left });
- if(o.axis != "horizontal") this.currentHandle.css({ top: position.top });
-
- //Store the slider's value
- this.currentHandle.data("mouse").sliderValue = {
- x: Math.round(this.convertValue(position.left, "x")) || 0,
- y: Math.round(this.convertValue(position.top, "y")) || 0
- };
-
- if (this.rangeElement)
- this.updateRange();
- this.propagate('slide', e);
- return false;
- },
-
- moveTo: function(value, handle, noPropagation) {
-
- var o = this.options;
-
- // Prepare the outer size
- this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
-
- //If no handle has been passed, no current handle is available and we have multiple handles, return false
- if (handle == undefined && !this.currentHandle && this.handle.length != 1)
- return false;
-
- //If only one handle is available, use it
- if (handle == undefined && !this.currentHandle)
- handle = 0;
-
- if (handle != undefined)
- this.currentHandle = this.previousHandle = $(this.handle[handle] || handle);
-
-
- if(value.x !== undefined && value.y !== undefined) {
- var x = value.x, y = value.y;
- } else {
- var x = value, y = value;
- }
-
- if(x !== undefined && x.constructor != Number) {
- var me = /^\-\=/.test(x), pe = /^\+\=/.test(x);
- if(me || pe) {
- x = this.value(null, "x") + parseInt(x.replace(me ? '=' : '+=', ''), 10);
- } else {
- x = isNaN(parseInt(x, 10)) ? undefined : parseInt(x, 10);
- }
- }
-
- if(y !== undefined && y.constructor != Number) {
- var me = /^\-\=/.test(y), pe = /^\+\=/.test(y);
- if(me || pe) {
- y = this.value(null, "y") + parseInt(y.replace(me ? '=' : '+=', ''), 10);
- } else {
- y = isNaN(parseInt(y, 10)) ? undefined : parseInt(y, 10);
- }
- }
-
- if(o.axis != "vertical" && x !== undefined) {
- if(o.stepping.x) x = Math.round(x / o.stepping.x) * o.stepping.x;
- x = this.translateValue(x, "x");
- x = this.translateLimits(x, "x");
- x = this.translateRange(x, "x");
- this.currentHandle.css({ left: x });
- }
-
- if(o.axis != "horizontal" && y !== undefined) {
- if(o.stepping.y) y = Math.round(y / o.stepping.y) * o.stepping.y;
- y = this.translateValue(y, "y");
- y = this.translateLimits(y, "y");
- y = this.translateRange(y, "y");
- this.currentHandle.css({ top: y });
- }
-
- if (this.rangeElement)
- this.updateRange();
-
- //Store the slider's value
- this.currentHandle.data("mouse").sliderValue = {
- x: Math.round(this.convertValue(x, "x")) || 0,
- y: Math.round(this.convertValue(y, "y")) || 0
- };
-
- if (!noPropagation) {
- this.propagate('start', null);
- this.propagate('stop', null);
- this.propagate('change', null);
- this.propagate("slide", null);
- }
- }
-});
-
-$.ui.slider.getter = "value";
-
-$.ui.slider.defaults = {
- handle: ".ui-slider-handle",
- distance: 1
-};
-
-})(jQuery);
+/* + * jQuery UI Slider + * + * Copyright (c) 2008 Paul Bakaus + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Slider + * + * Depends: + * ui.core.js + * + * Revision: $Id: ui.slider.js 5539 2008-05-09 16:48:33Z paul.bakaus $ + */ +;(function($) { + +$.fn.unwrap = $.fn.unwrap || function(expr) { + return this.each(function(){ + $(this).parents(expr).eq(0).after(this).remove(); + }); +}; + + +$.widget("ui.slider", { + plugins: {}, + ui: function(e) { + return { + instance: this, + options: this.options, + handle: this.currentHandle, + value: this.options.axis != "both" || !this.options.axis ? Math.round(this.value(null,this.options.axis == "vertical" ? "y" : "x")) : { + x: Math.round(this.value(null,"x")), + y: Math.round(this.value(null,"y")) + }, + range: this.getRange() + }; + }, + propagate: function(n,e) { + $.ui.plugin.call(this, n, [e, this.ui()]); + this.element.triggerHandler(n == "slide" ? n : "slide"+n, [e, this.ui()], this.options[n]); + }, + destroy: function() { + this.element + .removeClass("ui-slider ui-slider-disabled") + .removeData("slider") + .unbind(".slider"); + this.handle + .unwrap("a") + .mouse("destroy"); + this.generated && this.generated.remove(); + }, + enable: function() { + this.element.removeClass("ui-slider-disabled"); + this.disabled = false; + }, + disable: function() { + this.element.addClass("ui-slider-disabled"); + this.disabled = true; + }, + setData: function(key, value) { + this.options[key] = value; + if (/min|max|steps/.test(key)) { + this.initBoundaries(); + } + }, + + init: function() { + + var self = this; + this.element.addClass("ui-slider"); + this.initBoundaries(); + + // Initialize mouse and key events for interaction + this.handle = $(this.options.handle, this.element); + if (!this.handle.length) { + self.handle = self.generated = $(self.options.handles || [0]).map(function() { + var handle = $("<div/>").addClass("ui-slider-handle").appendTo(self.element); + if (this.id) + handle.attr("id", this.id); + return handle[0]; + }); + } + + + var handleclass = function(el) { + this.element = $(el); + this.element.data("mouse", this); + this.options = self.options; + + this.element.bind("mousedown", function() { + if(self.currentHandle) this.blur(self.currentHandle); + self.focus(this,1); + }); + + this.mouseInit(); + }; + + $.extend(handleclass.prototype, $.ui.mouse, { + mouseStart: function(e) { return self.start.call(self, e, this.element[0]); }, + mouseStop: function(e) { return self.stop.call(self, e, this.element[0]); }, + mouseDrag: function(e) { return self.drag.call(self, e, this.element[0]); }, + trigger: function(e) { this.mouseDown(e); } + }); + + + $(this.handle) + .each(function() { + new handleclass(this); + }) + .wrap('<a href="javascript:void(0)" style="cursor:default;"></a>') + .parent() + .bind('focus', function(e) { self.focus(this.firstChild); }) + .bind('blur', function(e) { self.blur(this.firstChild); }) + .bind('keydown', function(e) { if(!self.options.noKeyboard) self.keydown(e.keyCode, this.firstChild); }) + ; + + // Bind the click to the slider itself + this.element.bind('mousedown.slider', function(e) { + self.click.apply(self, [e]); + self.currentHandle.data("mouse").trigger(e); + self.firstValue = self.firstValue + 1; //This is for always triggering the change event + }); + + // Move the first handle to the startValue + $.each(this.options.handles || [], function(index, handle) { + self.moveTo(handle.start, index, true); + }); + if (!isNaN(this.options.startValue)) + this.moveTo(this.options.startValue, 0, true); + + this.previousHandle = $(this.handle[0]); //set the previous handle to the first to allow clicking before selecting the handle + if(this.handle.length == 2 && this.options.range) this.createRange(); + }, + initBoundaries: function() { + + var element = this.element[0], o = this.options; + this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() }; + + $.extend(o, { + axis: o.axis || (element.offsetWidth < element.offsetHeight ? 'vertical' : 'horizontal'), + max: !isNaN(parseInt(o.max,10)) ? { x: parseInt(o.max, 10), y: parseInt(o.max, 10) } : ({ x: o.max && o.max.x || 100, y: o.max && o.max.y || 100 }), + min: !isNaN(parseInt(o.min,10)) ? { x: parseInt(o.min, 10), y: parseInt(o.min, 10) } : ({ x: o.min && o.min.x || 0, y: o.min && o.min.y || 0 }) + }); + //Prepare the real maxValue + o.realMax = { + x: o.max.x - o.min.x, + y: o.max.y - o.min.y + }; + //Calculate stepping based on steps + o.stepping = { + x: o.stepping && o.stepping.x || parseInt(o.stepping, 10) || (o.steps ? o.realMax.x/(o.steps.x || parseInt(o.steps, 10) || o.realMax.x) : 0), + y: o.stepping && o.stepping.y || parseInt(o.stepping, 10) || (o.steps ? o.realMax.y/(o.steps.y || parseInt(o.steps, 10) || o.realMax.y) : 0) + }; + }, + + + keydown: function(keyCode, handle) { + if(/(37|38|39|40)/.test(keyCode)) { + this.moveTo({ + x: /(37|39)/.test(keyCode) ? (keyCode == 37 ? '-' : '+') + '=' + this.oneStep("x") : 0, + y: /(38|40)/.test(keyCode) ? (keyCode == 38 ? '-' : '+') + '=' + this.oneStep("y") : 0 + }, handle); + } + }, + focus: function(handle,hard) { + this.currentHandle = $(handle).addClass('ui-slider-handle-active'); + if (hard) + this.currentHandle.parent()[0].focus(); + }, + blur: function(handle) { + $(handle).removeClass('ui-slider-handle-active'); + if(this.currentHandle && this.currentHandle[0] == handle) { this.previousHandle = this.currentHandle; this.currentHandle = null; }; + }, + click: function(e) { + // This method is only used if: + // - The user didn't click a handle + // - The Slider is not disabled + // - There is a current, or previous selected handle (otherwise we wouldn't know which one to move) + + var pointer = [e.pageX,e.pageY]; + + var clickedHandle = false; + this.handle.each(function() { + if(this == e.target) + clickedHandle = true; + }); + if (clickedHandle || this.disabled || !(this.currentHandle || this.previousHandle)) + return; + + // If a previous handle was focussed, focus it again + if (!this.currentHandle && this.previousHandle) + this.focus(this.previousHandle, true); + + // propagate only for distance > 0, otherwise propagation is done my drag + this.offset = this.element.offset(); + + this.moveTo({ + y: this.convertValue(e.pageY - this.offset.top - this.currentHandle[0].offsetHeight/2, "y"), + x: this.convertValue(e.pageX - this.offset.left - this.currentHandle[0].offsetWidth/2, "x") + }, null, !this.options.distance); + }, + + + + createRange: function() { + this.rangeElement = $('<div></div>') + .addClass('ui-slider-range') + .css({ position: 'absolute' }) + .appendTo(this.element); + this.updateRange(); + }, + updateRange: function() { + var prop = this.options.axis == "vertical" ? "top" : "left"; + var size = this.options.axis == "vertical" ? "height" : "width"; + this.rangeElement.css(prop, parseInt($(this.handle[0]).css(prop),10) + this.handleSize(0, this.options.axis == "vertical" ? "y" : "x")/2); + this.rangeElement.css(size, parseInt($(this.handle[1]).css(prop),10) - parseInt($(this.handle[0]).css(prop),10)); + }, + getRange: function() { + return this.rangeElement ? this.convertValue(parseInt(this.rangeElement.css(this.options.axis == "vertical" ? "height" : "width"),10), this.options.axis == "vertical" ? "y" : "x") : null; + }, + + handleIndex: function() { + return this.handle.index(this.currentHandle[0]); + }, + value: function(handle, axis) { + if(this.handle.length == 1) this.currentHandle = this.handle; + if(!axis) axis = this.options.axis == "vertical" ? "y" : "x"; + + var curHandle = $(handle != undefined && handle !== null ? this.handle[handle] || handle : this.currentHandle); + + if(curHandle.data("mouse").sliderValue) { + return parseInt(curHandle.data("mouse").sliderValue[axis],10); + } else { + return parseInt(((parseInt(curHandle.css(axis == "x" ? "left" : "top"),10) / (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(handle,axis))) * this.options.realMax[axis]) + this.options.min[axis],10); + } + + }, + convertValue: function(value,axis) { + return this.options.min[axis] + (value / (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis))) * this.options.realMax[axis]; + }, + + translateValue: function(value,axis) { + return ((value - this.options.min[axis]) / this.options.realMax[axis]) * (this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis)); + }, + translateRange: function(value,axis) { + if (this.rangeElement) { + if (this.currentHandle[0] == this.handle[0] && value >= this.translateValue(this.value(1),axis)) + value = this.translateValue(this.value(1,axis) - this.oneStep(axis), axis); + if (this.currentHandle[0] == this.handle[1] && value <= this.translateValue(this.value(0),axis)) + value = this.translateValue(this.value(0,axis) + this.oneStep(axis), axis); + } + if (this.options.handles) { + var handle = this.options.handles[this.handleIndex()]; + if (value < this.translateValue(handle.min,axis)) { + value = this.translateValue(handle.min,axis); + } else if (value > this.translateValue(handle.max,axis)) { + value = this.translateValue(handle.max,axis); + } + } + return value; + }, + translateLimits: function(value,axis) { + if (value >= this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis)) + value = this.actualSize[axis == "x" ? "width" : "height"] - this.handleSize(null,axis); + if (value <= 0) + value = 0; + return value; + }, + handleSize: function(handle,axis) { + return $(handle != undefined && handle !== null ? this.handle[handle] : this.currentHandle)[0]["offset"+(axis == "x" ? "Width" : "Height")]; + }, + oneStep: function(axis) { + return this.options.stepping[axis] || 1; + }, + + + start: function(e, handle) { + + var o = this.options; + if(this.disabled) return false; + + // Prepare the outer size + this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() }; + + // This is a especially ugly fix for strange blur events happening on mousemove events + if (!this.currentHandle) + this.focus(this.previousHandle, true); + + this.offset = this.element.offset(); + + this.handleOffset = this.currentHandle.offset(); + this.clickOffset = { top: e.pageY - this.handleOffset.top, left: e.pageX - this.handleOffset.left }; + + this.firstValue = this.value(); + + this.propagate('start', e); + return true; + + }, + stop: function(e) { + this.propagate('stop', e); + if (this.firstValue != this.value()) + this.propagate('change', e); + // This is a especially ugly fix for strange blur events happening on mousemove events + this.focus(this.currentHandle, true); + return false; + }, + drag: function(e, handle) { + + var o = this.options; + var position = { top: e.pageY - this.offset.top - this.clickOffset.top, left: e.pageX - this.offset.left - this.clickOffset.left}; + if(!this.currentHandle) this.focus(this.previousHandle, true); //This is a especially ugly fix for strange blur events happening on mousemove events + + position.left = this.translateLimits(position.left, "x"); + position.top = this.translateLimits(position.top, "y"); + + if (o.stepping.x) { + var value = this.convertValue(position.left, "x"); + value = Math.round(value / o.stepping.x) * o.stepping.x; + position.left = this.translateValue(value, "x"); + } + if (o.stepping.y) { + var value = this.convertValue(position.top, "y"); + value = Math.round(value / o.stepping.y) * o.stepping.y; + position.top = this.translateValue(value, "y"); + } + + position.left = this.translateRange(position.left, "x"); + position.top = this.translateRange(position.top, "y"); + + if(o.axis != "vertical") this.currentHandle.css({ left: position.left }); + if(o.axis != "horizontal") this.currentHandle.css({ top: position.top }); + + //Store the slider's value + this.currentHandle.data("mouse").sliderValue = { + x: Math.round(this.convertValue(position.left, "x")) || 0, + y: Math.round(this.convertValue(position.top, "y")) || 0 + }; + + if (this.rangeElement) + this.updateRange(); + this.propagate('slide', e); + return false; + }, + + moveTo: function(value, handle, noPropagation) { + + var o = this.options; + + // Prepare the outer size + this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() }; + + //If no handle has been passed, no current handle is available and we have multiple handles, return false + if (handle == undefined && !this.currentHandle && this.handle.length != 1) + return false; + + //If only one handle is available, use it + if (handle == undefined && !this.currentHandle) + handle = 0; + + if (handle != undefined) + this.currentHandle = this.previousHandle = $(this.handle[handle] || handle); + + + if(value.x !== undefined && value.y !== undefined) { + var x = value.x, y = value.y; + } else { + var x = value, y = value; + } + + if(x !== undefined && x.constructor != Number) { + var me = /^\-\=/.test(x), pe = /^\+\=/.test(x); + if(me || pe) { + x = this.value(null, "x") + parseInt(x.replace(me ? '=' : '+=', ''), 10); + } else { + x = isNaN(parseInt(x, 10)) ? undefined : parseInt(x, 10); + } + } + + if(y !== undefined && y.constructor != Number) { + var me = /^\-\=/.test(y), pe = /^\+\=/.test(y); + if(me || pe) { + y = this.value(null, "y") + parseInt(y.replace(me ? '=' : '+=', ''), 10); + } else { + y = isNaN(parseInt(y, 10)) ? undefined : parseInt(y, 10); + } + } + + if(o.axis != "vertical" && x !== undefined) { + if(o.stepping.x) x = Math.round(x / o.stepping.x) * o.stepping.x; + x = this.translateValue(x, "x"); + x = this.translateLimits(x, "x"); + x = this.translateRange(x, "x"); + this.currentHandle.css({ left: x }); + } + + if(o.axis != "horizontal" && y !== undefined) { + if(o.stepping.y) y = Math.round(y / o.stepping.y) * o.stepping.y; + y = this.translateValue(y, "y"); + y = this.translateLimits(y, "y"); + y = this.translateRange(y, "y"); + this.currentHandle.css({ top: y }); + } + + if (this.rangeElement) + this.updateRange(); + + //Store the slider's value + this.currentHandle.data("mouse").sliderValue = { + x: Math.round(this.convertValue(x, "x")) || 0, + y: Math.round(this.convertValue(y, "y")) || 0 + }; + + if (!noPropagation) { + this.propagate('start', null); + this.propagate('stop', null); + this.propagate('change', null); + this.propagate("slide", null); + } + } +}); + +$.ui.slider.getter = "value"; + +$.ui.slider.defaults = { + handle: ".ui-slider-handle", + distance: 1 +}; + +})(jQuery); diff --git a/ui/source/ui.sortable.js b/ui/source/ui.sortable.js index 81135eff8..f5867aec5 100644 --- a/ui/source/ui.sortable.js +++ b/ui/source/ui.sortable.js @@ -1,672 +1,672 @@ -/*
- * jQuery UI Sortable
- *
- * Copyright (c) 2008 Paul Bakaus
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Sortables
- *
- * Depends:
- * ui.core.js
- *
- * Revision: $Id: ui.sortable.js 5433 2008-05-04 20:07:17Z joern.zaefferer $
- */
-;(function($) {
-
-function contains(a, b) {
- var safari2 = $.browser.safari && $.browser.version < 522;
- if (a.contains && !safari2) {
- return a.contains(b);
- }
- if (a.compareDocumentPosition)
- return !!(a.compareDocumentPosition(b) & 16);
- while (b = b.parentNode)
- if (b == a) return true;
- return false;
-};
-
-$.widget("ui.sortable", $.extend($.ui.mouse, {
- init: function() {
-
- var o = this.options;
- this.containerCache = {};
- this.element.addClass("ui-sortable");
-
- //Get the items
- this.refresh();
-
- //Let's determine if the items are floating
- this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;
-
- //Let's determine the parent's offset
- if(!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position', 'relative');
- this.offset = this.element.offset();
-
- //Initialize mouse events for interaction
- this.mouseInit();
-
- },
- plugins: {},
- ui: function(inst) {
- return {
- helper: (inst || this)["helper"],
- placeholder: (inst || this)["placeholder"] || $([]),
- position: (inst || this)["position"],
- absolutePosition: (inst || this)["positionAbs"],
- options: this.options,
- element: this.element,
- item: (inst || this)["currentItem"],
- sender: inst ? inst.element : null
- };
- },
- propagate: function(n,e,inst, noPropagation) {
- $.ui.plugin.call(this, n, [e, this.ui(inst)]);
- if(!noPropagation) this.element.triggerHandler(n == "sort" ? n : "sort"+n, [e, this.ui(inst)], this.options[n]);
- },
- serialize: function(o) {
-
-
-
- var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself
- var str = []; o = o || {};
-
- items.each(function() {
- var res = ($(this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
- if(res) str.push((o.key || res[1])+'[]='+(o.key ? res[1] : res[2]));
- });
-
- return str.join('&');
-
- },
- toArray: function(attr) {
- var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself
- var ret = [];
-
- items.each(function() { ret.push($(this).attr(attr || 'id')); });
- return ret;
- },
- enable: function() {
- this.element.removeClass("ui-sortable-disabled");
- this.options.disabled = false;
- },
- disable: function() {
- this.element.addClass("ui-sortable-disabled");
- this.options.disabled = true;
- },
- /* Be careful with the following core functions */
- intersectsWith: function(item) {
-
- var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width,
- y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height;
- var l = item.left, r = l + item.width,
- t = item.top, b = t + item.height;
-
- if(this.options.tolerance == "pointer") {
- return (y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r);
- } else {
-
- return (l < x1 + (this.helperProportions.width / 2) // Right Half
- && x2 - (this.helperProportions.width / 2) < r // Left Half
- && t < y1 + (this.helperProportions.height / 2) // Bottom Half
- && y2 - (this.helperProportions.height / 2) < b ); // Top Half
-
- }
-
- },
- intersectsWithEdge: function(item) {
- var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width,
- y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height;
- var l = item.left, r = l + item.width,
- t = item.top, b = t + item.height;
-
- if(this.options.tolerance == "pointer" || (this.options.tolerance == "guess" && this.currentItem[0]['offset'+(this.floating ? 'Width' : 'Height')] > item.item[0]['offset'+(this.floating ? 'Width' : 'Height')])) {
-
- if(!(y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r)) return false;
-
- if(this.floating) {
- if(x1 + this.offset.click.left > l && x1 + this.offset.click.left < l + item.width/2) return 2;
- if(x1 + this.offset.click.left > l+item.width/2 && x1 + this.offset.click.left < r) return 1;
- } else {
- if(y1 + this.offset.click.top > t && y1 + this.offset.click.top < t + item.height/2) return 2;
- if(y1 + this.offset.click.top > t+item.height/2 && y1 + this.offset.click.top < b) return 1;
- }
-
- } else {
-
- if (!(l < x1 + (this.helperProportions.width / 2) // Right Half
- && x2 - (this.helperProportions.width / 2) < r // Left Half
- && t < y1 + (this.helperProportions.height / 2) // Bottom Half
- && y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half
-
- if(this.floating) {
- if(x2 > l && x1 < l) return 2; //Crosses left edge
- if(x1 < r && x2 > r) return 1; //Crosses right edge
- } else {
- if(y2 > t && y1 < t) return 1; //Crosses top edge
- if(y1 < b && y2 > b) return 2; //Crosses bottom edge
- }
-
- }
-
- return false;
-
- },
- refresh: function() {
- this.refreshItems();
- this.refreshPositions();
- },
- refreshItems: function() {
-
- this.items = [];
- this.containers = [this];
- var items = this.items;
- var queries = [$.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)];
-
- if(this.options.connectWith) {
- for (var i = this.options.connectWith.length - 1; i >= 0; i--){
- var cur = $(this.options.connectWith[i]);
- for (var j = cur.length - 1; j >= 0; j--){
- var inst = $.data(cur[j], 'sortable');
- if(inst && !inst.options.disabled) {
- queries.push($.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element));
- this.containers.push(inst);
- }
- };
- };
- }
-
- for (var i = queries.length - 1; i >= 0; i--){
- queries[i].each(function() {
- $.data(this, 'sortable-item', true); // Data for target checking (mouse manager)
- items.push({
- item: $(this),
- width: 0, height: 0,
- left: 0, top: 0
- });
- });
- };
-
- },
- refreshPositions: function(fast) {
- for (var i = this.items.length - 1; i >= 0; i--){
- var t = this.items[i].item;
- if(!fast) this.items[i].width = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).outerWidth();
- if(!fast) this.items[i].height = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).outerHeight();
- var p = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).offset();
- this.items[i].left = p.left;
- this.items[i].top = p.top;
- };
- for (var i = this.containers.length - 1; i >= 0; i--){
- var p =this.containers[i].element.offset();
- this.containers[i].containerCache.left = p.left;
- this.containers[i].containerCache.top = p.top;
- this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
- this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
- };
- },
- destroy: function() {
- this.element
- .removeClass("ui-sortable ui-sortable-disabled")
- .removeData("sortable")
- .unbind(".sortable");
- this.mouseDestroy();
-
- for ( var i = this.items.length - 1; i >= 0; i-- )
- this.items[i].item.removeData("sortable-item");
- },
- createPlaceholder: function(that) {
-
- var self = that || this, o = self.options;
-
- if(o.placeholder.constructor == String) {
- var className = o.placeholder;
- o.placeholder = {
- element: function() {
- return $('<div></div>').addClass(className)[0];
- },
- update: function(i, p) {
- p.css(i.offset()).css({ width: i.outerWidth(), height: i.outerHeight() });
- }
- };
- }
-
- self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)).appendTo('body').css({ position: 'absolute' });
- o.placeholder.update.call(self.element, self.currentItem, self.placeholder);
- },
- contactContainers: function(e) {
- for (var i = this.containers.length - 1; i >= 0; i--){
-
- if(this.intersectsWith(this.containers[i].containerCache)) {
- if(!this.containers[i].containerCache.over) {
-
-
- if(this.currentContainer != this.containers[i]) {
-
- //When entering a new container, we will find the item with the least distance and append our item near it
- var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[i].floating ? 'left' : 'top'];
- for (var j = this.items.length - 1; j >= 0; j--) {
- if(!contains(this.containers[i].element[0], this.items[j].item[0])) continue;
- var cur = this.items[j][this.containers[i].floating ? 'left' : 'top'];
- if(Math.abs(cur - base) < dist) {
- dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
- }
- }
-
- if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
- continue;
-
- //We also need to exchange the placeholder
- if(this.placeholder) this.placeholder.remove();
- if(this.containers[i].options.placeholder) {
- this.containers[i].createPlaceholder(this);
- } else {
- this.placeholder = null;;
- }
-
-
- itemWithLeastDistance ? this.rearrange(e, itemWithLeastDistance) : this.rearrange(e, null, this.containers[i].element);
- this.propagate("change", e); //Call plugins and callbacks
- this.containers[i].propagate("change", e, this); //Call plugins and callbacks
- this.currentContainer = this.containers[i];
-
- }
-
- this.containers[i].propagate("over", e, this);
- this.containers[i].containerCache.over = 1;
- }
- } else {
- if(this.containers[i].containerCache.over) {
- this.containers[i].propagate("out", e, this);
- this.containers[i].containerCache.over = 0;
- }
- }
-
- };
- },
- mouseStart: function(e, overrideHandle, noActivation) {
-
- var o = this.options;
- this.currentContainer = this;
-
- if(this.options.disabled || this.options.type == 'static') return false;
-
- //Find out if the clicked node (or one of its parents) is a actual item in this.items
- var currentItem = null, nodes = $(e.target).parents().each(function() {
- if($.data(this, 'sortable-item')) {
- currentItem = $(this);
- return false;
- }
- });
- if($.data(e.target, 'sortable-item')) currentItem = $(e.target);
-
- if(!currentItem) return false;
- if(this.options.handle && !overrideHandle) {
- var validHandle = false;
- $(this.options.handle, currentItem).each(function() { if(this == e.target) validHandle = true; });
- if(!validHandle) return false;
- }
-
- this.currentItem = currentItem;
-
- this.refresh();
-
- //Create and append the visible helper
- this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone();
- if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)); //Add the helper to the DOM if that didn't happen already
- this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortable-helper'); //Position it absolutely and add a helper class
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- this.margins = { //Cache the margins
- left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
- top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
- };
-
- this.offset = this.currentItem.offset(); //The element's absolute position on the page
- this.offset = { //Substract the margins from the element's absolute offset
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- this.offset.click = { //Where the click happened, relative to the element
- left: e.pageX - this.offset.left,
- top: e.pageY - this.offset.top
- };
-
- this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position
-
- this.offset.parent = { //Store its position plus border
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- this.originalPosition = this.generatePosition(e); //Generate the original position
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size
-
- if(o.cursorAt) {
- if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left;
- if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right;
- if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top;
- if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom;
- }
-
- this.domPosition = this.currentItem.prev()[0]; //Cache the former DOM position
-
- /*
- * - Position constraining -
- * Here we prepare position constraining like grid and containment.
- */
-
- if(o.containment) {
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document') this.containment = [0,0,$(document).width(), ($(document).height() || document.body.parentNode.scrollHeight)];
- if(!(/^(document|window|parent)$/).test(o.containment)) {
- var ce = $(o.containment)[0];
- var co = $(o.containment).offset();
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top,
- co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0),
- co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0)
- ];
- }
- }
-
- //If o.placeholder is used, create a new element at the given position with the class
- if(o.placeholder) this.createPlaceholder();
-
- //Call plugins and callbacks
- this.propagate("start", e);
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
-
- if(this.options.placeholder != 'clone') this.currentItem.css('visibility', 'hidden'); //Set the original element visibility to hidden to still fill out the white space
-
- if(!noActivation) {
- for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i].propagate("activate", e, this); } //Post 'activate' events to possible containers
- }
-
- //Prepare possible droppables
- if($.ui.ddmanager) $.ui.ddmanager.current = this;
- if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e);
-
- this.dragging = true;
-
- this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
-
-
- },
- convertPositionTo: function(d, pos) {
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- return {
- top: (
- pos.top // the calculated relative position
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position
- + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods)
- ),
- left: (
- pos.left // the calculated relative position
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position
- + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods)
- )
- };
- },
- generatePosition: function(e) {
-
- var o = this.options;
- var position = {
- top: (
- e.pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed
- ),
- left: (
- e.pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed
- )
- };
-
- if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
- if(this.containment) {
- if(position.left < this.containment[0]) position.left = this.containment[0];
- if(position.top < this.containment[1]) position.top = this.containment[1];
- if(position.left > this.containment[2]) position.left = this.containment[2];
- if(position.top > this.containment[3]) position.top = this.containment[3];
- }
-
- if(o.grid) {
- var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1];
- position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0];
- position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- return position;
- },
- mouseDrag: function(e) {
-
-
- //Compute the helpers position
- this.position = this.generatePosition(e);
- this.positionAbs = this.convertPositionTo("absolute");
-
- //Rearrange
- for (var i = this.items.length - 1; i >= 0; i--) {
- var intersection = this.intersectsWithEdge(this.items[i]);
- if(!intersection) continue;
-
- if(this.items[i].item[0] != this.currentItem[0] //cannot intersect with itself
- && this.currentItem[intersection == 1 ? "next" : "prev"]()[0] != this.items[i].item[0] //no useless actions that have been done before
- && !contains(this.currentItem[0], this.items[i].item[0]) //no action if the item moved is the parent of the item checked
- && (this.options.type == 'semi-dynamic' ? !contains(this.element[0], this.items[i].item[0]) : true)
- ) {
-
- this.direction = intersection == 1 ? "down" : "up";
- this.rearrange(e, this.items[i]);
- this.propagate("change", e); //Call plugins and callbacks
- break;
- }
- }
-
- //Post events to containers
- this.contactContainers(e);
-
- //Call plugins and callbacks
- this.propagate("sort", e);
-
- if(!this.options.axis || this.options.axis == "x") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis == "y") this.helper[0].style.top = this.position.top+'px';
-
- //Interconnect with droppables
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, e);
-
- return false;
-
- },
- mouseStop: function(e, noPropagation) {
-
- //If we are using droppables, inform the manager about the drop
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- $.ui.ddmanager.drop(this, e);
-
- if(this.options.revert) {
- var self = this;
- var cur = self.currentItem.offset();
-
- //Also animate the placeholder if we have one
- if(self.placeholder) self.placeholder.animate({ opacity: 'hide' }, (parseInt(this.options.revert, 10) || 500)-50);
-
- $(this.helper).animate({
- left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
- top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
- }, parseInt(this.options.revert, 10) || 500, function() {
- self.propagate("stop", e, null, noPropagation);
- self.clear(e);
- });
- } else {
- this.propagate("stop", e, null, noPropagation);
- this.clear(e, noPropagation);
- }
-
- return false;
-
- },
- clear: function(e, noPropagation) {
-
- if(this.domPosition != this.currentItem.prev()[0]) this.propagate("update", e, null, noPropagation); //Trigger update callback if the DOM position has changed
- if(!contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
- this.propagate("remove", e, null, noPropagation);
- for (var i = this.containers.length - 1; i >= 0; i--){
- if(contains(this.containers[i].element[0], this.currentItem[0])) {
- this.containers[i].propagate("update", e, this, noPropagation);
- this.containers[i].propagate("receive", e, this, noPropagation);
- }
- };
- };
-
- //Post events to containers
- for (var i = this.containers.length - 1; i >= 0; i--){
- this.containers[i].propagate("deactivate", e, this, noPropagation);
- if(this.containers[i].containerCache.over) {
- this.containers[i].propagate("out", e, this);
- this.containers[i].containerCache.over = 0;
- }
- }
-
- this.dragging = false;
- if(this.cancelHelperRemoval) return false;
- $(this.currentItem).css('visibility', '');
- if(this.placeholder) this.placeholder.remove();
- this.helper.remove();
-
- return true;
-
- },
- rearrange: function(e, i, a) {
- a ? a.append(this.currentItem) : i.item[this.direction == 'down' ? 'before' : 'after'](this.currentItem);
- this.refreshPositions(true); //Precompute after each DOM insertion, NOT on mousemove
- if(this.options.placeholder) this.options.placeholder.update.call(this.element, this.currentItem, this.placeholder);
- }
-}));
-
-$.extend($.ui.sortable, {
- getter: "serialize toArray",
- defaults: {
- tolerance: "guess",
- distance: 0,
- delay: 0,
- cancel: ":input,button",
- items: '> *',
- zIndex: 1000,
- dropOnEmpty: true,
- appendTo: "parent"
- }
-});
-
-/*
- * Sortable Extensions
- */
-
-$.ui.plugin.add("sortable", "cursor", {
- start: function(e, ui) {
- var t = $('body');
- if (t.css("cursor")) ui.options._cursor = t.css("cursor");
- t.css("cursor", ui.options.cursor);
- },
- stop: function(e, ui) {
- if (ui.options._cursor) $('body').css("cursor", ui.options._cursor);
- }
-});
-
-$.ui.plugin.add("sortable", "zIndex", {
- start: function(e, ui) {
- var t = ui.helper;
- if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex");
- t.css('zIndex', ui.options.zIndex);
- },
- stop: function(e, ui) {
- if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex);
- }
-});
-
-$.ui.plugin.add("sortable", "opacity", {
- start: function(e, ui) {
- var t = ui.helper;
- if(t.css("opacity")) ui.options._opacity = t.css("opacity");
- t.css('opacity', ui.options.opacity);
- },
- stop: function(e, ui) {
- if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity);
- }
-});
-
-$.ui.plugin.add("sortable", "scroll", {
- start: function(e, ui) {
- var o = ui.options;
- var i = $(this).data("sortable");
- o.scrollSensitivity = o.scrollSensitivity || 20;
- o.scrollSpeed = o.scrollSpeed || 20;
-
- i.overflowY = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(i.currentItem);
- i.overflowX = function(el) {
- do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode);
- return $(document);
- }(i.currentItem);
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset();
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset();
-
- },
- sort: function(e, ui) {
-
- var o = ui.options;
- var i = $(this).data("sortable");
-
- if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') {
- if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed;
- if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity)
- i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed;
- } else {
- if(e.pageY - $(document).scrollTop() < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') {
- if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed;
- if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity)
- i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed;
- } else {
- if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-});
-
-})(jQuery);
+/* + * jQuery UI Sortable + * + * Copyright (c) 2008 Paul Bakaus + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Sortables + * + * Depends: + * ui.core.js + * + * Revision: $Id: ui.sortable.js 5433 2008-05-04 20:07:17Z joern.zaefferer $ + */ +;(function($) { + +function contains(a, b) { + var safari2 = $.browser.safari && $.browser.version < 522; + if (a.contains && !safari2) { + return a.contains(b); + } + if (a.compareDocumentPosition) + return !!(a.compareDocumentPosition(b) & 16); + while (b = b.parentNode) + if (b == a) return true; + return false; +}; + +$.widget("ui.sortable", $.extend($.ui.mouse, { + init: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are floating + this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false; + + //Let's determine the parent's offset + if(!(/(relative|absolute|fixed)/).test(this.element.css('position'))) this.element.css('position', 'relative'); + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this.mouseInit(); + + }, + plugins: {}, + ui: function(inst) { + return { + helper: (inst || this)["helper"], + placeholder: (inst || this)["placeholder"] || $([]), + position: (inst || this)["position"], + absolutePosition: (inst || this)["positionAbs"], + options: this.options, + element: this.element, + item: (inst || this)["currentItem"], + sender: inst ? inst.element : null + }; + }, + propagate: function(n,e,inst, noPropagation) { + $.ui.plugin.call(this, n, [e, this.ui(inst)]); + if(!noPropagation) this.element.triggerHandler(n == "sort" ? n : "sort"+n, [e, this.ui(inst)], this.options[n]); + }, + serialize: function(o) { + + + + var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself + var str = []; o = o || {}; + + items.each(function() { + var res = ($(this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1])+'[]='+(o.key ? res[1] : res[2])); + }); + + return str.join('&'); + + }, + toArray: function(attr) { + var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself + var ret = []; + + items.each(function() { ret.push($(this).attr(attr || 'id')); }); + return ret; + }, + enable: function() { + this.element.removeClass("ui-sortable-disabled"); + this.options.disabled = false; + }, + disable: function() { + this.element.addClass("ui-sortable-disabled"); + this.options.disabled = true; + }, + /* Be careful with the following core functions */ + intersectsWith: function(item) { + + var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height; + var l = item.left, r = l + item.width, + t = item.top, b = t + item.height; + + if(this.options.tolerance == "pointer") { + return (y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r); + } else { + + return (l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + + }, + intersectsWithEdge: function(item) { + var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height; + var l = item.left, r = l + item.width, + t = item.top, b = t + item.height; + + if(this.options.tolerance == "pointer" || (this.options.tolerance == "guess" && this.currentItem[0]['offset'+(this.floating ? 'Width' : 'Height')] > item.item[0]['offset'+(this.floating ? 'Width' : 'Height')])) { + + if(!(y1 + this.offset.click.top > t && y1 + this.offset.click.top < b && x1 + this.offset.click.left > l && x1 + this.offset.click.left < r)) return false; + + if(this.floating) { + if(x1 + this.offset.click.left > l && x1 + this.offset.click.left < l + item.width/2) return 2; + if(x1 + this.offset.click.left > l+item.width/2 && x1 + this.offset.click.left < r) return 1; + } else { + if(y1 + this.offset.click.top > t && y1 + this.offset.click.top < t + item.height/2) return 2; + if(y1 + this.offset.click.top > t+item.height/2 && y1 + this.offset.click.top < b) return 1; + } + + } else { + + if (!(l < x1 + (this.helperProportions.width / 2) // Right Half + && x2 - (this.helperProportions.width / 2) < r // Left Half + && t < y1 + (this.helperProportions.height / 2) // Bottom Half + && y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half + + if(this.floating) { + if(x2 > l && x1 < l) return 2; //Crosses left edge + if(x1 < r && x2 > r) return 1; //Crosses right edge + } else { + if(y2 > t && y1 < t) return 1; //Crosses top edge + if(y1 < b && y2 > b) return 2; //Crosses bottom edge + } + + } + + return false; + + }, + refresh: function() { + this.refreshItems(); + this.refreshPositions(); + }, + refreshItems: function() { + + this.items = []; + this.containers = [this]; + var items = this.items; + var queries = [$.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)]; + + if(this.options.connectWith) { + for (var i = this.options.connectWith.length - 1; i >= 0; i--){ + var cur = $(this.options.connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], 'sortable'); + if(inst && !inst.options.disabled) { + queries.push($.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element)); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i].each(function() { + $.data(this, 'sortable-item', true); // Data for target checking (mouse manager) + items.push({ + item: $(this), + width: 0, height: 0, + left: 0, top: 0 + }); + }); + }; + + }, + refreshPositions: function(fast) { + for (var i = this.items.length - 1; i >= 0; i--){ + var t = this.items[i].item; + if(!fast) this.items[i].width = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).outerWidth(); + if(!fast) this.items[i].height = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).outerHeight(); + var p = (this.options.toleranceElement ? $(this.options.toleranceElement, t) : t).offset(); + this.items[i].left = p.left; + this.items[i].top = p.top; + }; + for (var i = this.containers.length - 1; i >= 0; i--){ + var p =this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + }; + }, + destroy: function() { + this.element + .removeClass("ui-sortable ui-sortable-disabled") + .removeData("sortable") + .unbind(".sortable"); + this.mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData("sortable-item"); + }, + createPlaceholder: function(that) { + + var self = that || this, o = self.options; + + if(o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + return $('<div></div>').addClass(className)[0]; + }, + update: function(i, p) { + p.css(i.offset()).css({ width: i.outerWidth(), height: i.outerHeight() }); + } + }; + } + + self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)).appendTo('body').css({ position: 'absolute' }); + o.placeholder.update.call(self.element, self.currentItem, self.placeholder); + }, + contactContainers: function(e) { + for (var i = this.containers.length - 1; i >= 0; i--){ + + if(this.intersectsWith(this.containers[i].containerCache)) { + if(!this.containers[i].containerCache.over) { + + + if(this.currentContainer != this.containers[i]) { + + //When entering a new container, we will find the item with the least distance and append our item near it + var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[i].floating ? 'left' : 'top']; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!contains(this.containers[i].element[0], this.items[j].item[0])) continue; + var cur = this.items[j][this.containers[i].floating ? 'left' : 'top']; + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + continue; + + //We also need to exchange the placeholder + if(this.placeholder) this.placeholder.remove(); + if(this.containers[i].options.placeholder) { + this.containers[i].createPlaceholder(this); + } else { + this.placeholder = null;; + } + + + itemWithLeastDistance ? this.rearrange(e, itemWithLeastDistance) : this.rearrange(e, null, this.containers[i].element); + this.propagate("change", e); //Call plugins and callbacks + this.containers[i].propagate("change", e, this); //Call plugins and callbacks + this.currentContainer = this.containers[i]; + + } + + this.containers[i].propagate("over", e, this); + this.containers[i].containerCache.over = 1; + } + } else { + if(this.containers[i].containerCache.over) { + this.containers[i].propagate("out", e, this); + this.containers[i].containerCache.over = 0; + } + } + + }; + }, + mouseStart: function(e, overrideHandle, noActivation) { + + var o = this.options; + this.currentContainer = this; + + if(this.options.disabled || this.options.type == 'static') return false; + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, nodes = $(e.target).parents().each(function() { + if($.data(this, 'sortable-item')) { + currentItem = $(this); + return false; + } + }); + if($.data(e.target, 'sortable-item')) currentItem = $(e.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + $(this.options.handle, currentItem).each(function() { if(this == e.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + + this.refresh(); + + //Create and append the visible helper + this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone(); + if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)); //Add the helper to the DOM if that didn't happen already + this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortable-helper'); //Position it absolutely and add a helper class + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + this.margins = { //Cache the margins + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + + this.offset = this.currentItem.offset(); //The element's absolute position on the page + this.offset = { //Substract the margins from the element's absolute offset + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + this.offset.click = { //Where the click happened, relative to the element + left: e.pageX - this.offset.left, + top: e.pageY - this.offset.top + }; + + this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); //Get the offsetParent and cache its position + + this.offset.parent = { //Store its position plus border + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + this.originalPosition = this.generatePosition(e); //Generate the original position + this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size + + if(o.cursorAt) { + if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left; + if(o.cursorAt.right != undefined) this.offset.click.left = this.helperProportions.width - o.cursorAt.right; + if(o.cursorAt.top != undefined) this.offset.click.top = o.cursorAt.top; + if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom; + } + + this.domPosition = this.currentItem.prev()[0]; //Cache the former DOM position + + /* + * - Position constraining - + * Here we prepare position constraining like grid and containment. + */ + + if(o.containment) { + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document') this.containment = [0,0,$(document).width(), ($(document).height() || document.body.parentNode.scrollHeight)]; + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top, + co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.currentItem.css("marginRight"),10) || 0), + co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.currentItem.css("marginBottom"),10) || 0) + ]; + } + } + + //If o.placeholder is used, create a new element at the given position with the class + if(o.placeholder) this.createPlaceholder(); + + //Call plugins and callbacks + this.propagate("start", e); + this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size + + if(this.options.placeholder != 'clone') this.currentItem.css('visibility', 'hidden'); //Set the original element visibility to hidden to still fill out the white space + + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i].propagate("activate", e, this); } //Post 'activate' events to possible containers + } + + //Prepare possible droppables + if($.ui.ddmanager) $.ui.ddmanager.current = this; + if ($.ui.ddmanager && !o.dropBehaviour) $.ui.ddmanager.prepareOffsets(this, e); + + this.dragging = true; + + this.mouseDrag(e); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + + }, + convertPositionTo: function(d, pos) { + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + return { + top: ( + pos.top // the calculated relative position + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) * mod // The offsetParent's scroll position + + this.margins.top * mod //Add the margin (you don't want the margin counting in intersection methods) + ), + left: ( + pos.left // the calculated relative position + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) * mod // The offsetParent's scroll position + + this.margins.left * mod //Add the margin (you don't want the margin counting in intersection methods) + ) + }; + }, + generatePosition: function(e) { + + var o = this.options; + var position = { + top: ( + e.pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) // The offsetParent's scroll position, not if the element is fixed + ), + left: ( + e.pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft) // The offsetParent's scroll position, not if the element is fixed + ) + }; + + if(!this.originalPosition) return position; //If we are not dragging yet, we won't check for options + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + if(this.containment) { + if(position.left < this.containment[0]) position.left = this.containment[0]; + if(position.top < this.containment[1]) position.top = this.containment[1]; + if(position.left > this.containment[2]) position.left = this.containment[2]; + if(position.top > this.containment[3]) position.top = this.containment[3]; + } + + if(o.grid) { + var top = this.originalPosition.top + Math.round((position.top - this.originalPosition.top) / o.grid[1]) * o.grid[1]; + position.top = this.containment ? (!(top < this.containment[1] || top > this.containment[3]) ? top : (!(top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPosition.left + Math.round((position.left - this.originalPosition.left) / o.grid[0]) * o.grid[0]; + position.left = this.containment ? (!(left < this.containment[0] || left > this.containment[2]) ? left : (!(left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + return position; + }, + mouseDrag: function(e) { + + + //Compute the helpers position + this.position = this.generatePosition(e); + this.positionAbs = this.convertPositionTo("absolute"); + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + var intersection = this.intersectsWithEdge(this.items[i]); + if(!intersection) continue; + + if(this.items[i].item[0] != this.currentItem[0] //cannot intersect with itself + && this.currentItem[intersection == 1 ? "next" : "prev"]()[0] != this.items[i].item[0] //no useless actions that have been done before + && !contains(this.currentItem[0], this.items[i].item[0]) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !contains(this.element[0], this.items[i].item[0]) : true) + ) { + + this.direction = intersection == 1 ? "down" : "up"; + this.rearrange(e, this.items[i]); + this.propagate("change", e); //Call plugins and callbacks + break; + } + } + + //Post events to containers + this.contactContainers(e); + + //Call plugins and callbacks + this.propagate("sort", e); + + if(!this.options.axis || this.options.axis == "x") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis == "y") this.helper[0].style.top = this.position.top+'px'; + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, e); + + return false; + + }, + mouseStop: function(e, noPropagation) { + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, e); + + if(this.options.revert) { + var self = this; + var cur = self.currentItem.offset(); + + //Also animate the placeholder if we have one + if(self.placeholder) self.placeholder.animate({ opacity: 'hide' }, (parseInt(this.options.revert, 10) || 500)-50); + + $(this.helper).animate({ + left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), + top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) + }, parseInt(this.options.revert, 10) || 500, function() { + self.propagate("stop", e, null, noPropagation); + self.clear(e); + }); + } else { + this.propagate("stop", e, null, noPropagation); + this.clear(e, noPropagation); + } + + return false; + + }, + clear: function(e, noPropagation) { + + if(this.domPosition != this.currentItem.prev()[0]) this.propagate("update", e, null, noPropagation); //Trigger update callback if the DOM position has changed + if(!contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element + this.propagate("remove", e, null, noPropagation); + for (var i = this.containers.length - 1; i >= 0; i--){ + if(contains(this.containers[i].element[0], this.currentItem[0])) { + this.containers[i].propagate("update", e, this, noPropagation); + this.containers[i].propagate("receive", e, this, noPropagation); + } + }; + }; + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i].propagate("deactivate", e, this, noPropagation); + if(this.containers[i].containerCache.over) { + this.containers[i].propagate("out", e, this); + this.containers[i].containerCache.over = 0; + } + } + + this.dragging = false; + if(this.cancelHelperRemoval) return false; + $(this.currentItem).css('visibility', ''); + if(this.placeholder) this.placeholder.remove(); + this.helper.remove(); + + return true; + + }, + rearrange: function(e, i, a) { + a ? a.append(this.currentItem) : i.item[this.direction == 'down' ? 'before' : 'after'](this.currentItem); + this.refreshPositions(true); //Precompute after each DOM insertion, NOT on mousemove + if(this.options.placeholder) this.options.placeholder.update.call(this.element, this.currentItem, this.placeholder); + } +})); + +$.extend($.ui.sortable, { + getter: "serialize toArray", + defaults: { + tolerance: "guess", + distance: 0, + delay: 0, + cancel: ":input,button", + items: '> *', + zIndex: 1000, + dropOnEmpty: true, + appendTo: "parent" + } +}); + +/* + * Sortable Extensions + */ + +$.ui.plugin.add("sortable", "cursor", { + start: function(e, ui) { + var t = $('body'); + if (t.css("cursor")) ui.options._cursor = t.css("cursor"); + t.css("cursor", ui.options.cursor); + }, + stop: function(e, ui) { + if (ui.options._cursor) $('body').css("cursor", ui.options._cursor); + } +}); + +$.ui.plugin.add("sortable", "zIndex", { + start: function(e, ui) { + var t = ui.helper; + if(t.css("zIndex")) ui.options._zIndex = t.css("zIndex"); + t.css('zIndex', ui.options.zIndex); + }, + stop: function(e, ui) { + if(ui.options._zIndex) $(ui.helper).css('zIndex', ui.options._zIndex); + } +}); + +$.ui.plugin.add("sortable", "opacity", { + start: function(e, ui) { + var t = ui.helper; + if(t.css("opacity")) ui.options._opacity = t.css("opacity"); + t.css('opacity', ui.options.opacity); + }, + stop: function(e, ui) { + if(ui.options._opacity) $(ui.helper).css('opacity', ui.options._opacity); + } +}); + +$.ui.plugin.add("sortable", "scroll", { + start: function(e, ui) { + var o = ui.options; + var i = $(this).data("sortable"); + o.scrollSensitivity = o.scrollSensitivity || 20; + o.scrollSpeed = o.scrollSpeed || 20; + + i.overflowY = function(el) { + do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode); + return $(document); + }(i.currentItem); + i.overflowX = function(el) { + do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-x'))) return el; el = el.parent(); } while (el[0].parentNode); + return $(document); + }(i.currentItem); + + if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') i.overflowYOffset = i.overflowY.offset(); + if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') i.overflowXOffset = i.overflowX.offset(); + + }, + sort: function(e, ui) { + + var o = ui.options; + var i = $(this).data("sortable"); + + if(i.overflowY[0] != document && i.overflowY[0].tagName != 'HTML') { + if((i.overflowYOffset.top + i.overflowY[0].offsetHeight) - e.pageY < o.scrollSensitivity) + i.overflowY[0].scrollTop = i.overflowY[0].scrollTop + o.scrollSpeed; + if(e.pageY - i.overflowYOffset.top < o.scrollSensitivity) + i.overflowY[0].scrollTop = i.overflowY[0].scrollTop - o.scrollSpeed; + } else { + if(e.pageY - $(document).scrollTop() < o.scrollSensitivity) + $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + if($(window).height() - (e.pageY - $(document).scrollTop()) < o.scrollSensitivity) + $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(i.overflowX[0] != document && i.overflowX[0].tagName != 'HTML') { + if((i.overflowXOffset.left + i.overflowX[0].offsetWidth) - e.pageX < o.scrollSensitivity) + i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft + o.scrollSpeed; + if(e.pageX - i.overflowXOffset.left < o.scrollSensitivity) + i.overflowX[0].scrollLeft = i.overflowX[0].scrollLeft - o.scrollSpeed; + } else { + if(e.pageX - $(document).scrollLeft() < o.scrollSensitivity) + $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + if($(window).width() - (e.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } +}); + +})(jQuery); diff --git a/ui/source/ui.tabs.js b/ui/source/ui.tabs.js index 3492848f3..a675b4de7 100644 --- a/ui/source/ui.tabs.js +++ b/ui/source/ui.tabs.js @@ -1,595 +1,595 @@ -/*
- * jQuery UI Tabs
- *
- * Copyright (c) 2007, 2008 Klaus Hartl (stilbuero.de)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * http://docs.jquery.com/UI/Tabs
- *
- * Depends:
- * ui.core.js
- *
- * Revision: $Id: ui.tabs.js 5641 2008-05-20 02:53:23Z scott.gonzalez $
- */
-;(function($) {
-
-$.widget("ui.tabs", {
- init: function() {
- this.options.event += '.tabs'; // namespace event
-
- // create tabs
- this.tabify(true);
- },
- setData: function(key, value) {
- if ((/^selected/).test(key))
- this.select(value);
- else {
- this.options[key] = value;
- this.tabify();
- }
- },
- length: function() {
- return this.$tabs.length;
- },
- tabId: function(a) {
- return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '')
- || this.options.idPrefix + $.data(a);
- },
- ui: function(tab, panel) {
- return {
- instance: this,
- options: this.options,
- tab: tab,
- panel: panel
- };
- },
- tabify: function(init) {
-
- this.$lis = $('li:has(a[href])', this.element);
- this.$tabs = this.$lis.map(function() { return $('a', this)[0]; });
- this.$panels = $([]);
-
- var self = this, o = this.options;
-
- this.$tabs.each(function(i, a) {
- // inline tab
- if (a.hash && a.hash.replace('#', '')) // Safari 2 reports '#' for an empty hash
- self.$panels = self.$panels.add(a.hash);
- // remote tab
- else if ($(a).attr('href') != '#') { // prevent loading the page itself if href is just "#"
- $.data(a, 'href.tabs', a.href); // required for restore on destroy
- $.data(a, 'load.tabs', a.href); // mutable
- var id = self.tabId(a);
- a.href = '#' + id;
- var $panel = $('#' + id);
- if (!$panel.length) {
- $panel = $(o.panelTemplate).attr('id', id).addClass(o.panelClass)
- .insertAfter( self.$panels[i - 1] || self.element );
- $panel.data('destroy.tabs', true);
- }
- self.$panels = self.$panels.add( $panel );
- }
- // invalid tab href
- else
- o.disabled.push(i + 1);
- });
-
- if (init) {
-
- // attach necessary classes for styling if not present
- this.element.addClass(o.navClass);
- this.$panels.each(function() {
- var $this = $(this);
- $this.addClass(o.panelClass);
- });
-
- // Selected tab
- // use "selected" option or try to retrieve:
- // 1. from fragment identifier in url
- // 2. from cookie
- // 3. from selected class attribute on <li>
- if (o.selected === undefined) {
- if (location.hash) {
- this.$tabs.each(function(i, a) {
- if (a.hash == location.hash) {
- o.selected = i;
- // prevent page scroll to fragment
- if ($.browser.msie || $.browser.opera) { // && !o.remote
- var $toShow = $(location.hash), toShowId = $toShow.attr('id');
- $toShow.attr('id', '');
- setTimeout(function() {
- $toShow.attr('id', toShowId); // restore id
- }, 500);
- }
- scrollTo(0, 0);
- return false; // break
- }
- });
- }
- else if (o.cookie) {
- var index = parseInt($.cookie('ui-tabs' + $.data(self.element)),10);
- if (index && self.$tabs[index])
- o.selected = index;
- }
- else if (self.$lis.filter('.' + o.selectedClass).length)
- o.selected = self.$lis.index( self.$lis.filter('.' + o.selectedClass)[0] );
- }
- o.selected = o.selected === null || o.selected !== undefined ? o.selected : 0; // first tab selected by default
-
- // Take disabling tabs via class attribute from HTML
- // into account and update option properly.
- // A selected tab cannot become disabled.
- o.disabled = $.unique(o.disabled.concat(
- $.map(this.$lis.filter('.' + o.disabledClass),
- function(n, i) { return self.$lis.index(n); } )
- )).sort();
- if ($.inArray(o.selected, o.disabled) != -1)
- o.disabled.splice($.inArray(o.selected, o.disabled), 1);
-
- // highlight selected tab
- this.$panels.addClass(o.hideClass);
- this.$lis.removeClass(o.selectedClass);
- if (o.selected !== null) {
- this.$panels.eq(o.selected).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before
- this.$lis.eq(o.selected).addClass(o.selectedClass);
-
- // seems to be expected behavior that the show callback is fired
- var onShow = function() {
- $(self.element).triggerHandler('tabsshow',
- [self.ui(self.$tabs[o.selected], self.$panels[o.selected])], o.show);
- };
-
- // load if remote tab
- if ($.data(this.$tabs[o.selected], 'load.tabs'))
- this.load(o.selected, onShow);
- // just trigger show event
- else
- onShow();
-
- }
-
- // clean up to avoid memory leaks in certain versions of IE 6
- $(window).bind('unload', function() {
- self.$tabs.unbind('.tabs');
- self.$lis = self.$tabs = self.$panels = null;
- });
-
- }
-
- // disable tabs
- for (var i = 0, li; li = this.$lis[i]; i++)
- $(li)[$.inArray(i, o.disabled) != -1 && !$(li).hasClass(o.selectedClass) ? 'addClass' : 'removeClass'](o.disabledClass);
-
- // reset cache if switching from cached to not cached
- if (o.cache === false)
- this.$tabs.removeData('cache.tabs');
-
- // set up animations
- var hideFx, showFx, baseFx = { 'min-width': 0, duration: 1 }, baseDuration = 'normal';
- if (o.fx && o.fx.constructor == Array)
- hideFx = o.fx[0] || baseFx, showFx = o.fx[1] || baseFx;
- else
- hideFx = showFx = o.fx || baseFx;
-
- // reset some styles to maintain print style sheets etc.
- var resetCSS = { display: '', overflow: '', height: '' };
- if (!$.browser.msie) // not in IE to prevent ClearType font issue
- resetCSS.opacity = '';
-
- // Hide a tab, animation prevents browser scrolling to fragment,
- // $show is optional.
- function hideTab(clicked, $hide, $show) {
- $hide.animate(hideFx, hideFx.duration || baseDuration, function() { //
- $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && hideFx.opacity)
- $hide[0].style.filter = '';
- if ($show)
- showTab(clicked, $show, $hide);
- });
- }
-
- // Show a tab, animation prevents browser scrolling to fragment,
- // $hide is optional.
- function showTab(clicked, $show, $hide) {
- if (showFx === baseFx)
- $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab panels
- $show.animate(showFx, showFx.duration || baseDuration, function() {
- $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
- if ($.browser.msie && showFx.opacity)
- $show[0].style.filter = '';
-
- // callback
- $(self.element).triggerHandler('tabsshow',
- [self.ui(clicked, $show[0])], o.show);
-
- });
- }
-
- // switch a tab
- function switchTab(clicked, $li, $hide, $show) {
- /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
- $.ajaxHistory.update(clicked.hash);
- }*/
- $li.addClass(o.selectedClass)
- .siblings().removeClass(o.selectedClass);
- hideTab(clicked, $hide, $show);
- }
-
- // attach tab event handler, unbind to avoid duplicates from former tabifying...
- this.$tabs.unbind('.tabs').bind(o.event, function() {
-
- //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
- var $li = $(this).parents('li:eq(0)'),
- $hide = self.$panels.filter(':visible'),
- $show = $(this.hash);
-
- // If tab is already selected and not unselectable or tab disabled or
- // or is already loading or click callback returns false stop here.
- // Check if click handler returns false last so that it is not executed
- // for a disabled or loading tab!
- if (($li.hasClass(o.selectedClass) && !o.unselect)
- || $li.hasClass(o.disabledClass)
- || $(this).hasClass(o.loadingClass)
- || $(self.element).triggerHandler('tabsselect', [self.ui(this, $show[0])], o.select) === false
- ) {
- this.blur();
- return false;
- }
-
- self.options.selected = self.$tabs.index(this);
-
- // if tab may be closed
- if (o.unselect) {
- if ($li.hasClass(o.selectedClass)) {
- self.options.selected = null;
- $li.removeClass(o.selectedClass);
- self.$panels.stop();
- hideTab(this, $hide);
- this.blur();
- return false;
- } else if (!$hide.length) {
- self.$panels.stop();
- var a = this;
- self.load(self.$tabs.index(this), function() {
- $li.addClass(o.selectedClass).addClass(o.unselectClass);
- showTab(a, $show);
- });
- this.blur();
- return false;
- }
- }
-
- if (o.cookie)
- $.cookie('ui-tabs' + $.data(self.element), self.options.selected, o.cookie);
-
- // stop possibly running animations
- self.$panels.stop();
-
- // show new tab
- if ($show.length) {
-
- // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
- /*if ($.browser.msie && o.bookmarkable) {
- var showId = this.hash.replace('#', '');
- $show.attr('id', '');
- setTimeout(function() {
- $show.attr('id', showId); // restore id
- }, 0);
- }*/
-
- var a = this;
- self.load(self.$tabs.index(this), $hide.length ?
- function() {
- switchTab(a, $li, $hide, $show);
- } :
- function() {
- $li.addClass(o.selectedClass);
- showTab(a, $show);
- }
- );
-
- // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
- /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
- var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
- setTimeout(function() {
- scrollTo(scrollX, scrollY);
- }, 0);*/
-
- } else
- throw 'jQuery UI Tabs: Mismatching fragment identifier.';
-
- // Prevent IE from keeping other link focussed when using the back button
- // and remove dotted border from clicked link. This is controlled in modern
- // browsers via CSS, also blur removes focus from address bar in Firefox
- // which can become a usability and annoying problem with tabsRotate.
- if ($.browser.msie)
- this.blur();
-
- //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
- return false;
-
- });
-
- // disable click if event is configured to something else
- if (!(/^click/).test(o.event))
- this.$tabs.bind('click.tabs', function() { return false; });
-
- },
- add: function(url, label, index) {
- if (index == undefined)
- index = this.$tabs.length; // append by default
-
- var o = this.options;
- var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label));
- $li.data('destroy.tabs', true);
-
- var id = url.indexOf('#') == 0 ? url.replace('#', '') : this.tabId( $('a:first-child', $li)[0] );
-
- // try to find an existing element before creating a new one
- var $panel = $('#' + id);
- if (!$panel.length) {
- $panel = $(o.panelTemplate).attr('id', id)
- .addClass(o.hideClass)
- .data('destroy.tabs', true);
- }
- $panel.addClass(o.panelClass);
- if (index >= this.$lis.length) {
- $li.appendTo(this.element);
- $panel.appendTo(this.element[0].parentNode);
- } else {
- $li.insertBefore(this.$lis[index]);
- $panel.insertBefore(this.$panels[index]);
- }
-
- o.disabled = $.map(o.disabled,
- function(n, i) { return n >= index ? ++n : n });
-
- this.tabify();
-
- if (this.$tabs.length == 1) {
- $li.addClass(o.selectedClass);
- $panel.removeClass(o.hideClass);
- var href = $.data(this.$tabs[0], 'load.tabs');
- if (href)
- this.load(index, href);
- }
-
- // callback
- this.element.triggerHandler('tabsadd',
- [this.ui(this.$tabs[index], this.$panels[index])], o.add
- );
- },
- remove: function(index) {
- var o = this.options, $li = this.$lis.eq(index).remove(),
- $panel = this.$panels.eq(index).remove();
-
- // If selected tab was removed focus tab to the right or
- // in case the last tab was removed the tab to the left.
- if ($li.hasClass(o.selectedClass) && this.$tabs.length > 1)
- this.select(index + (index + 1 < this.$tabs.length ? 1 : -1));
-
- o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),
- function(n, i) { return n >= index ? --n : n });
-
- this.tabify();
-
- // callback
- this.element.triggerHandler('tabsremove',
- [this.ui($li.find('a')[0], $panel[0])], o.remove
- );
- },
- enable: function(index) {
- var o = this.options;
- if ($.inArray(index, o.disabled) == -1)
- return;
-
- var $li = this.$lis.eq(index).removeClass(o.disabledClass);
- if ($.browser.safari) { // fix disappearing tab (that used opacity indicating disabling) after enabling in Safari 2...
- $li.css('display', 'inline-block');
- setTimeout(function() {
- $li.css('display', 'block');
- }, 0);
- }
-
- o.disabled = $.grep(o.disabled, function(n, i) { return n != index; });
-
- // callback
- this.element.triggerHandler('tabsenable',
- [this.ui(this.$tabs[index], this.$panels[index])], o.enable
- );
-
- },
- disable: function(index) {
- var self = this, o = this.options;
- if (index != o.selected) { // cannot disable already selected tab
- this.$lis.eq(index).addClass(o.disabledClass);
-
- o.disabled.push(index);
- o.disabled.sort();
-
- // callback
- this.element.triggerHandler('tabsdisable',
- [this.ui(this.$tabs[index], this.$panels[index])], o.disable
- );
- }
- },
- select: function(index) {
- if (typeof index == 'string')
- index = this.$tabs.index( this.$tabs.filter('[href$=' + index + ']')[0] );
- this.$tabs.eq(index).trigger(this.options.event);
- },
- load: function(index, callback) { // callback is for internal usage only
-
- var self = this, o = this.options, $a = this.$tabs.eq(index), a = $a[0],
- bypassCache = callback == undefined || callback === false, url = $a.data('load.tabs');
-
- callback = callback || function() {};
-
- // no remote or from cache - just finish with callback
- if (!url || !bypassCache && $.data(a, 'cache.tabs')) {
- callback();
- return;
- }
-
- // load remote from here on
-
- var inner = function(parent) {
- var $parent = $(parent), $inner = $parent.find('*:last');
- return $inner.length && $inner || $parent;
- };
- var cleanup = function() {
- self.$tabs.filter('.' + o.loadingClass).removeClass(o.loadingClass)
- .each(function() {
- if (o.spinner)
- inner(this).parent().html(inner(this).data('label.tabs'));
- });
- self.xhr = null;
- };
-
- if (o.spinner) {
- var label = inner(a).html();
- inner(a).wrapInner('<em></em>')
- .find('em').data('label.tabs', label).html(o.spinner);
- }
-
- var ajaxOptions = $.extend({}, o.ajaxOptions, {
- url: url,
- success: function(r, s) {
- $(a.hash).html(r);
- cleanup();
-
- if (o.cache)
- $.data(a, 'cache.tabs', true); // if loaded once do not load them again
-
- // callbacks
- $(self.element).triggerHandler('tabsload',
- [self.ui(self.$tabs[index], self.$panels[index])], o.load
- );
- o.ajaxOptions.success && o.ajaxOptions.success(r, s);
-
- // This callback is required because the switch has to take
- // place after loading has completed. Call last in order to
- // fire load before show callback...
- callback();
- }
- });
- if (this.xhr) {
- // terminate pending requests from other tabs and restore tab label
- this.xhr.abort();
- cleanup();
- }
- $a.addClass(o.loadingClass);
- setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
- self.xhr = $.ajax(ajaxOptions);
- }, 0);
-
- },
- url: function(index, url) {
- this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs', url);
- },
- destroy: function() {
- var o = this.options;
- this.element.unbind('.tabs')
- .removeClass(o.navClass).removeData('tabs');
- this.$tabs.each(function() {
- var href = $.data(this, 'href.tabs');
- if (href)
- this.href = href;
- var $this = $(this).unbind('.tabs');
- $.each(['href', 'load', 'cache'], function(i, prefix) {
- $this.removeData(prefix + '.tabs');
- });
- });
- this.$lis.add(this.$panels).each(function() {
- if ($.data(this, 'destroy.tabs'))
- $(this).remove();
- else
- $(this).removeClass([o.selectedClass, o.unselectClass,
- o.disabledClass, o.panelClass, o.hideClass].join(' '));
- });
- }
-});
-
-$.ui.tabs.defaults = {
- // basic setup
- unselect: false,
- event: 'click',
- disabled: [],
- cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
- // TODO history: false,
-
- // Ajax
- spinner: 'Loading…',
- cache: false,
- idPrefix: 'ui-tabs-',
- ajaxOptions: {},
-
- // animations
- fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
-
- // templates
- tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>',
- panelTemplate: '<div></div>',
-
- // CSS classes
- navClass: 'ui-tabs-nav',
- selectedClass: 'ui-tabs-selected',
- unselectClass: 'ui-tabs-unselect',
- disabledClass: 'ui-tabs-disabled',
- panelClass: 'ui-tabs-panel',
- hideClass: 'ui-tabs-hide',
- loadingClass: 'ui-tabs-loading'
-};
-
-$.ui.tabs.getter = "length";
-
-/*
- * Tabs Extensions
- */
-
-/*
- * Rotate
- */
-$.extend($.ui.tabs.prototype, {
- rotation: null,
- rotate: function(ms, continuing) {
-
- continuing = continuing || false;
-
- var self = this, t = this.options.selected;
-
- function start() {
- self.rotation = setInterval(function() {
- t = ++t < self.$tabs.length ? t : 0;
- self.select(t);
- }, ms);
- }
-
- function stop(e) {
- if (!e || e.clientX) { // only in case of a true click
- clearInterval(self.rotation);
- }
- }
-
- // start interval
- if (ms) {
- start();
- if (!continuing)
- this.$tabs.bind(this.options.event, stop);
- else
- this.$tabs.bind(this.options.event, function() {
- stop();
- t = self.options.selected;
- start();
- });
- }
- // stop interval
- else {
- stop();
- this.$tabs.unbind(this.options.event, stop);
- }
- }
-});
-
-})(jQuery);
+/* + * jQuery UI Tabs + * + * Copyright (c) 2007, 2008 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * ui.core.js + * + * Revision: $Id: ui.tabs.js 5641 2008-05-20 02:53:23Z scott.gonzalez $ + */ +;(function($) { + +$.widget("ui.tabs", { + init: function() { + this.options.event += '.tabs'; // namespace event + + // create tabs + this.tabify(true); + }, + setData: function(key, value) { + if ((/^selected/).test(key)) + this.select(value); + else { + this.options[key] = value; + this.tabify(); + } + }, + length: function() { + return this.$tabs.length; + }, + tabId: function(a) { + return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '') + || this.options.idPrefix + $.data(a); + }, + ui: function(tab, panel) { + return { + instance: this, + options: this.options, + tab: tab, + panel: panel + }; + }, + tabify: function(init) { + + this.$lis = $('li:has(a[href])', this.element); + this.$tabs = this.$lis.map(function() { return $('a', this)[0]; }); + this.$panels = $([]); + + var self = this, o = this.options; + + this.$tabs.each(function(i, a) { + // inline tab + if (a.hash && a.hash.replace('#', '')) // Safari 2 reports '#' for an empty hash + self.$panels = self.$panels.add(a.hash); + // remote tab + else if ($(a).attr('href') != '#') { // prevent loading the page itself if href is just "#" + $.data(a, 'href.tabs', a.href); // required for restore on destroy + $.data(a, 'load.tabs', a.href); // mutable + var id = self.tabId(a); + a.href = '#' + id; + var $panel = $('#' + id); + if (!$panel.length) { + $panel = $(o.panelTemplate).attr('id', id).addClass(o.panelClass) + .insertAfter( self.$panels[i - 1] || self.element ); + $panel.data('destroy.tabs', true); + } + self.$panels = self.$panels.add( $panel ); + } + // invalid tab href + else + o.disabled.push(i + 1); + }); + + if (init) { + + // attach necessary classes for styling if not present + this.element.addClass(o.navClass); + this.$panels.each(function() { + var $this = $(this); + $this.addClass(o.panelClass); + }); + + // Selected tab + // use "selected" option or try to retrieve: + // 1. from fragment identifier in url + // 2. from cookie + // 3. from selected class attribute on <li> + if (o.selected === undefined) { + if (location.hash) { + this.$tabs.each(function(i, a) { + if (a.hash == location.hash) { + o.selected = i; + // prevent page scroll to fragment + if ($.browser.msie || $.browser.opera) { // && !o.remote + var $toShow = $(location.hash), toShowId = $toShow.attr('id'); + $toShow.attr('id', ''); + setTimeout(function() { + $toShow.attr('id', toShowId); // restore id + }, 500); + } + scrollTo(0, 0); + return false; // break + } + }); + } + else if (o.cookie) { + var index = parseInt($.cookie('ui-tabs' + $.data(self.element)),10); + if (index && self.$tabs[index]) + o.selected = index; + } + else if (self.$lis.filter('.' + o.selectedClass).length) + o.selected = self.$lis.index( self.$lis.filter('.' + o.selectedClass)[0] ); + } + o.selected = o.selected === null || o.selected !== undefined ? o.selected : 0; // first tab selected by default + + // Take disabling tabs via class attribute from HTML + // into account and update option properly. + // A selected tab cannot become disabled. + o.disabled = $.unique(o.disabled.concat( + $.map(this.$lis.filter('.' + o.disabledClass), + function(n, i) { return self.$lis.index(n); } ) + )).sort(); + if ($.inArray(o.selected, o.disabled) != -1) + o.disabled.splice($.inArray(o.selected, o.disabled), 1); + + // highlight selected tab + this.$panels.addClass(o.hideClass); + this.$lis.removeClass(o.selectedClass); + if (o.selected !== null) { + this.$panels.eq(o.selected).show().removeClass(o.hideClass); // use show and remove class to show in any case no matter how it has been hidden before + this.$lis.eq(o.selected).addClass(o.selectedClass); + + // seems to be expected behavior that the show callback is fired + var onShow = function() { + $(self.element).triggerHandler('tabsshow', + [self.ui(self.$tabs[o.selected], self.$panels[o.selected])], o.show); + }; + + // load if remote tab + if ($.data(this.$tabs[o.selected], 'load.tabs')) + this.load(o.selected, onShow); + // just trigger show event + else + onShow(); + + } + + // clean up to avoid memory leaks in certain versions of IE 6 + $(window).bind('unload', function() { + self.$tabs.unbind('.tabs'); + self.$lis = self.$tabs = self.$panels = null; + }); + + } + + // disable tabs + for (var i = 0, li; li = this.$lis[i]; i++) + $(li)[$.inArray(i, o.disabled) != -1 && !$(li).hasClass(o.selectedClass) ? 'addClass' : 'removeClass'](o.disabledClass); + + // reset cache if switching from cached to not cached + if (o.cache === false) + this.$tabs.removeData('cache.tabs'); + + // set up animations + var hideFx, showFx, baseFx = { 'min-width': 0, duration: 1 }, baseDuration = 'normal'; + if (o.fx && o.fx.constructor == Array) + hideFx = o.fx[0] || baseFx, showFx = o.fx[1] || baseFx; + else + hideFx = showFx = o.fx || baseFx; + + // reset some styles to maintain print style sheets etc. + var resetCSS = { display: '', overflow: '', height: '' }; + if (!$.browser.msie) // not in IE to prevent ClearType font issue + resetCSS.opacity = ''; + + // Hide a tab, animation prevents browser scrolling to fragment, + // $show is optional. + function hideTab(clicked, $hide, $show) { + $hide.animate(hideFx, hideFx.duration || baseDuration, function() { // + $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc. + if ($.browser.msie && hideFx.opacity) + $hide[0].style.filter = ''; + if ($show) + showTab(clicked, $show, $hide); + }); + } + + // Show a tab, animation prevents browser scrolling to fragment, + // $hide is optional. + function showTab(clicked, $show, $hide) { + if (showFx === baseFx) + $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab panels + $show.animate(showFx, showFx.duration || baseDuration, function() { + $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc. + if ($.browser.msie && showFx.opacity) + $show[0].style.filter = ''; + + // callback + $(self.element).triggerHandler('tabsshow', + [self.ui(clicked, $show[0])], o.show); + + }); + } + + // switch a tab + function switchTab(clicked, $li, $hide, $show) { + /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click + $.ajaxHistory.update(clicked.hash); + }*/ + $li.addClass(o.selectedClass) + .siblings().removeClass(o.selectedClass); + hideTab(clicked, $hide, $show); + } + + // attach tab event handler, unbind to avoid duplicates from former tabifying... + this.$tabs.unbind('.tabs').bind(o.event, function() { + + //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click + var $li = $(this).parents('li:eq(0)'), + $hide = self.$panels.filter(':visible'), + $show = $(this.hash); + + // If tab is already selected and not unselectable or tab disabled or + // or is already loading or click callback returns false stop here. + // Check if click handler returns false last so that it is not executed + // for a disabled or loading tab! + if (($li.hasClass(o.selectedClass) && !o.unselect) + || $li.hasClass(o.disabledClass) + || $(this).hasClass(o.loadingClass) + || $(self.element).triggerHandler('tabsselect', [self.ui(this, $show[0])], o.select) === false + ) { + this.blur(); + return false; + } + + self.options.selected = self.$tabs.index(this); + + // if tab may be closed + if (o.unselect) { + if ($li.hasClass(o.selectedClass)) { + self.options.selected = null; + $li.removeClass(o.selectedClass); + self.$panels.stop(); + hideTab(this, $hide); + this.blur(); + return false; + } else if (!$hide.length) { + self.$panels.stop(); + var a = this; + self.load(self.$tabs.index(this), function() { + $li.addClass(o.selectedClass).addClass(o.unselectClass); + showTab(a, $show); + }); + this.blur(); + return false; + } + } + + if (o.cookie) + $.cookie('ui-tabs' + $.data(self.element), self.options.selected, o.cookie); + + // stop possibly running animations + self.$panels.stop(); + + // show new tab + if ($show.length) { + + // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled + /*if ($.browser.msie && o.bookmarkable) { + var showId = this.hash.replace('#', ''); + $show.attr('id', ''); + setTimeout(function() { + $show.attr('id', showId); // restore id + }, 0); + }*/ + + var a = this; + self.load(self.$tabs.index(this), $hide.length ? + function() { + switchTab(a, $li, $hide, $show); + } : + function() { + $li.addClass(o.selectedClass); + showTab(a, $show); + } + ); + + // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash + /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0; + var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0; + setTimeout(function() { + scrollTo(scrollX, scrollY); + }, 0);*/ + + } else + throw 'jQuery UI Tabs: Mismatching fragment identifier.'; + + // Prevent IE from keeping other link focussed when using the back button + // and remove dotted border from clicked link. This is controlled in modern + // browsers via CSS, also blur removes focus from address bar in Firefox + // which can become a usability and annoying problem with tabsRotate. + if ($.browser.msie) + this.blur(); + + //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE + return false; + + }); + + // disable click if event is configured to something else + if (!(/^click/).test(o.event)) + this.$tabs.bind('click.tabs', function() { return false; }); + + }, + add: function(url, label, index) { + if (index == undefined) + index = this.$tabs.length; // append by default + + var o = this.options; + var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label)); + $li.data('destroy.tabs', true); + + var id = url.indexOf('#') == 0 ? url.replace('#', '') : this.tabId( $('a:first-child', $li)[0] ); + + // try to find an existing element before creating a new one + var $panel = $('#' + id); + if (!$panel.length) { + $panel = $(o.panelTemplate).attr('id', id) + .addClass(o.hideClass) + .data('destroy.tabs', true); + } + $panel.addClass(o.panelClass); + if (index >= this.$lis.length) { + $li.appendTo(this.element); + $panel.appendTo(this.element[0].parentNode); + } else { + $li.insertBefore(this.$lis[index]); + $panel.insertBefore(this.$panels[index]); + } + + o.disabled = $.map(o.disabled, + function(n, i) { return n >= index ? ++n : n }); + + this.tabify(); + + if (this.$tabs.length == 1) { + $li.addClass(o.selectedClass); + $panel.removeClass(o.hideClass); + var href = $.data(this.$tabs[0], 'load.tabs'); + if (href) + this.load(index, href); + } + + // callback + this.element.triggerHandler('tabsadd', + [this.ui(this.$tabs[index], this.$panels[index])], o.add + ); + }, + remove: function(index) { + var o = this.options, $li = this.$lis.eq(index).remove(), + $panel = this.$panels.eq(index).remove(); + + // If selected tab was removed focus tab to the right or + // in case the last tab was removed the tab to the left. + if ($li.hasClass(o.selectedClass) && this.$tabs.length > 1) + this.select(index + (index + 1 < this.$tabs.length ? 1 : -1)); + + o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }), + function(n, i) { return n >= index ? --n : n }); + + this.tabify(); + + // callback + this.element.triggerHandler('tabsremove', + [this.ui($li.find('a')[0], $panel[0])], o.remove + ); + }, + enable: function(index) { + var o = this.options; + if ($.inArray(index, o.disabled) == -1) + return; + + var $li = this.$lis.eq(index).removeClass(o.disabledClass); + if ($.browser.safari) { // fix disappearing tab (that used opacity indicating disabling) after enabling in Safari 2... + $li.css('display', 'inline-block'); + setTimeout(function() { + $li.css('display', 'block'); + }, 0); + } + + o.disabled = $.grep(o.disabled, function(n, i) { return n != index; }); + + // callback + this.element.triggerHandler('tabsenable', + [this.ui(this.$tabs[index], this.$panels[index])], o.enable + ); + + }, + disable: function(index) { + var self = this, o = this.options; + if (index != o.selected) { // cannot disable already selected tab + this.$lis.eq(index).addClass(o.disabledClass); + + o.disabled.push(index); + o.disabled.sort(); + + // callback + this.element.triggerHandler('tabsdisable', + [this.ui(this.$tabs[index], this.$panels[index])], o.disable + ); + } + }, + select: function(index) { + if (typeof index == 'string') + index = this.$tabs.index( this.$tabs.filter('[href$=' + index + ']')[0] ); + this.$tabs.eq(index).trigger(this.options.event); + }, + load: function(index, callback) { // callback is for internal usage only + + var self = this, o = this.options, $a = this.$tabs.eq(index), a = $a[0], + bypassCache = callback == undefined || callback === false, url = $a.data('load.tabs'); + + callback = callback || function() {}; + + // no remote or from cache - just finish with callback + if (!url || !bypassCache && $.data(a, 'cache.tabs')) { + callback(); + return; + } + + // load remote from here on + + var inner = function(parent) { + var $parent = $(parent), $inner = $parent.find('*:last'); + return $inner.length && $inner || $parent; + }; + var cleanup = function() { + self.$tabs.filter('.' + o.loadingClass).removeClass(o.loadingClass) + .each(function() { + if (o.spinner) + inner(this).parent().html(inner(this).data('label.tabs')); + }); + self.xhr = null; + }; + + if (o.spinner) { + var label = inner(a).html(); + inner(a).wrapInner('<em></em>') + .find('em').data('label.tabs', label).html(o.spinner); + } + + var ajaxOptions = $.extend({}, o.ajaxOptions, { + url: url, + success: function(r, s) { + $(a.hash).html(r); + cleanup(); + + if (o.cache) + $.data(a, 'cache.tabs', true); // if loaded once do not load them again + + // callbacks + $(self.element).triggerHandler('tabsload', + [self.ui(self.$tabs[index], self.$panels[index])], o.load + ); + o.ajaxOptions.success && o.ajaxOptions.success(r, s); + + // This callback is required because the switch has to take + // place after loading has completed. Call last in order to + // fire load before show callback... + callback(); + } + }); + if (this.xhr) { + // terminate pending requests from other tabs and restore tab label + this.xhr.abort(); + cleanup(); + } + $a.addClass(o.loadingClass); + setTimeout(function() { // timeout is again required in IE, "wait" for id being restored + self.xhr = $.ajax(ajaxOptions); + }, 0); + + }, + url: function(index, url) { + this.$tabs.eq(index).removeData('cache.tabs').data('load.tabs', url); + }, + destroy: function() { + var o = this.options; + this.element.unbind('.tabs') + .removeClass(o.navClass).removeData('tabs'); + this.$tabs.each(function() { + var href = $.data(this, 'href.tabs'); + if (href) + this.href = href; + var $this = $(this).unbind('.tabs'); + $.each(['href', 'load', 'cache'], function(i, prefix) { + $this.removeData(prefix + '.tabs'); + }); + }); + this.$lis.add(this.$panels).each(function() { + if ($.data(this, 'destroy.tabs')) + $(this).remove(); + else + $(this).removeClass([o.selectedClass, o.unselectClass, + o.disabledClass, o.panelClass, o.hideClass].join(' ')); + }); + } +}); + +$.ui.tabs.defaults = { + // basic setup + unselect: false, + event: 'click', + disabled: [], + cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } + // TODO history: false, + + // Ajax + spinner: 'Loading…', + cache: false, + idPrefix: 'ui-tabs-', + ajaxOptions: {}, + + // animations + fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 } + + // templates + tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>', + panelTemplate: '<div></div>', + + // CSS classes + navClass: 'ui-tabs-nav', + selectedClass: 'ui-tabs-selected', + unselectClass: 'ui-tabs-unselect', + disabledClass: 'ui-tabs-disabled', + panelClass: 'ui-tabs-panel', + hideClass: 'ui-tabs-hide', + loadingClass: 'ui-tabs-loading' +}; + +$.ui.tabs.getter = "length"; + +/* + * Tabs Extensions + */ + +/* + * Rotate + */ +$.extend($.ui.tabs.prototype, { + rotation: null, + rotate: function(ms, continuing) { + + continuing = continuing || false; + + var self = this, t = this.options.selected; + + function start() { + self.rotation = setInterval(function() { + t = ++t < self.$tabs.length ? t : 0; + self.select(t); + }, ms); + } + + function stop(e) { + if (!e || e.clientX) { // only in case of a true click + clearInterval(self.rotation); + } + } + + // start interval + if (ms) { + start(); + if (!continuing) + this.$tabs.bind(this.options.event, stop); + else + this.$tabs.bind(this.options.event, function() { + stop(); + t = self.options.selected; + start(); + }); + } + // stop interval + else { + stop(); + this.$tabs.unbind(this.options.event, stop); + } + } +}); + +})(jQuery); diff --git a/ui/tests/accordion.html b/ui/tests/accordion.html index f2792df81..66913ba2b 100644 --- a/ui/tests/accordion.html +++ b/ui/tests/accordion.html @@ -1,170 +1,170 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>jQuery UI Accordion Test Suite</title>
-
- <link rel="stylesheet" href="../../qunit/testsuite.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script>
-
- <script type="text/javascript" src="../source/ui.core.js"></script>
- <script type="text/javascript" src="../source/ui.accordion.js"></script>
-
- <script type="text/javascript" src="../../qunit/testrunner.js"></script>
-
- <script type="text/javascript" src="accordion.js"></script>
- <style type="text/css">
- .xerror, .error { display: none }
- </style>
-
-</head>
-<body class="flora">
- <h1>jQuery UI Accordion Test Suite</h1>
- <h2 id="banner"></h2>
- <h2 id="userAgent"></h2>
-
- <ol id="tests"></ol>
-
-<div id="main" style="position:absolute;top:-2000000px;">
-
- <fieldset>
- <legend>Standard, container is a div, header is h3 and content p</legend>
-
- <div id="list1">
- <a>There is one obvious advantage:</a>
- <div>
- <p>
- You've seen it coming!<br/>
- Buy now and get nothing for free!<br/>
- Well, at least no free beer. Perhaps a bear, if you can afford it.
- </p>
- </div>
- <a>Now that you've got...</a>
- <div>
- <p>
- your bear, you have to admit it!<br/>
- No, we aren't selling bears.
- </p>
- <p>
- We could talk about renting one.
- </p>
- </div>
- <a>Rent one bear, ...</a>
- <div>
- <p>
- get two for three beer.
- </p>
- <p>
- And now, for something completely different.
- </p>
- </div>
- </div>
-
- </fieldset>
-
- <fieldset>
- <legend>Navigation - Unordered List with anchors and nested lists.</legend>
- <p>The first item is cloned to allow the user to select it. The
- active element is choosen based on location.hash: Open Drums and click
- the first item ('Drums'), then reload the page.</p>
-
- <ul id="navigation">
- <li>
- <a class="head" href="?p=1.1.1">Guitar</a>
- <ul>
- <li><a href="?p=1.1.1.1">Electric</a></li>
- <li><a href="?p=1.1.1.2">Acoustic</a></li>
- <li><a href="?p=1.1.1.3">Amps</a></li>
- <li><a href="?p=1.1.1.4">Effects</a></li>
- <li><a href="?p=1.1.1.5">Accessories</a></li>
- </ul>
- </li>
- <li>
- <a class="head" href="?p=1.1.2">Bass</a>
- <ul>
- <li><a href="?p=1.1.2.1">Electric</a></li>
- <li><a href="?p=1.1.2.2">Acoustic</a></li>
- <li><a href="?p=1.1.2.3">Amps</a></li>
- <li><a href="?p=1.1.2.4">Effects</a></li>
- <li><a href="?p=1.1.2.5">Accessories</a></li>
- <li><a href="?p=1.1.2.5">Accessories</a></li>
- <li><a href="?p=1.1.2.5">Accessories</a></li>
- </ul>
- </li>
- <li>
- <a class="head" href="?p=1.1.3">Drums</a>
- <ul>
- <li><a href="?p=1.1.3.2">Acoustic Drums</a></li>
- <li><a href="?p=1.1.3.3">Electronic Drums</a></li>
- <li><a href="?p=1.1.3.6">Accessories</a></li>
- </ul>
- </li>
- </ul>
-
- </fieldset>
-
- <fieldset>
- <legend>With options, container is a definition list, header dt, content dd</legend>
-
- <dl id="list2">
- <dt class="red">Red</dt>
- <dd>
- Fancy stuff about red thingies.
- </dd>
- <dt class="green selected">Green</dt>
- <dd>
- Green! Green! Green!
- </dd>
- <dt class="blue">Blue</dt>
- <dd>
- Cool kids are blue.
- </dd>
- </dl>
-
- </fieldset>
-
- <fieldset>
- <legend>Divitus structure, div container, div header (class title), div
- content, no active on startup and can be completely closed</legend>
-
- <div id="list3">
- <div>
- <div class="title">Tennis</div>
- <div>
- One ball, two players. Lots of fun.
- </div>
- </div>
- <div>
- <div class="title">Soccer</div>
- <div>
- One ball, 22 players. Lots of fun.
- </div>
- </div>
- <div>
- <div class="title">Baseball</div>
- <div>
- Well, one ball, some guys running around, some guys hitting others with a stick.<br/>
- Sounds like fun, doesn't it?
- </div>
- <div>
- Well, apart from the running part.
- </div>
- </div>
- </div>
-
- </fieldset>
-
- <div id="switch">
- <select>
- <option>Switch to...</option>
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- </select>
- <button id="close">Close all</button>
- Activate via selector, eg. ':first' or 'a:first': <input id="switch2" />
- </div>
-
- <div id="log"><div><strong>Log of the 2nd accordion</strong></div></div>
-</div>
- </body>
+<!DOCTYPE html> +<html lang="en"> +<head> + <title>jQuery UI Accordion Test Suite</title> + + <link rel="stylesheet" href="../../qunit/testsuite.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script> + + <script type="text/javascript" src="../source/ui.core.js"></script> + <script type="text/javascript" src="../source/ui.accordion.js"></script> + + <script type="text/javascript" src="../../qunit/testrunner.js"></script> + + <script type="text/javascript" src="accordion.js"></script> + <style type="text/css"> + .xerror, .error { display: none } + </style> + +</head> +<body class="flora"> + <h1>jQuery UI Accordion Test Suite</h1> + <h2 id="banner"></h2> + <h2 id="userAgent"></h2> + + <ol id="tests"></ol> + +<div id="main" style="position:absolute;top:-2000000px;"> + + <fieldset> + <legend>Standard, container is a div, header is h3 and content p</legend> + + <div id="list1"> + <a>There is one obvious advantage:</a> + <div> + <p> + You've seen it coming!<br/> + Buy now and get nothing for free!<br/> + Well, at least no free beer. Perhaps a bear, if you can afford it. + </p> + </div> + <a>Now that you've got...</a> + <div> + <p> + your bear, you have to admit it!<br/> + No, we aren't selling bears. + </p> + <p> + We could talk about renting one. + </p> + </div> + <a>Rent one bear, ...</a> + <div> + <p> + get two for three beer. + </p> + <p> + And now, for something completely different. + </p> + </div> + </div> + + </fieldset> + + <fieldset> + <legend>Navigation - Unordered List with anchors and nested lists.</legend> + <p>The first item is cloned to allow the user to select it. The + active element is choosen based on location.hash: Open Drums and click + the first item ('Drums'), then reload the page.</p> + + <ul id="navigation"> + <li> + <a class="head" href="?p=1.1.1">Guitar</a> + <ul> + <li><a href="?p=1.1.1.1">Electric</a></li> + <li><a href="?p=1.1.1.2">Acoustic</a></li> + <li><a href="?p=1.1.1.3">Amps</a></li> + <li><a href="?p=1.1.1.4">Effects</a></li> + <li><a href="?p=1.1.1.5">Accessories</a></li> + </ul> + </li> + <li> + <a class="head" href="?p=1.1.2">Bass</a> + <ul> + <li><a href="?p=1.1.2.1">Electric</a></li> + <li><a href="?p=1.1.2.2">Acoustic</a></li> + <li><a href="?p=1.1.2.3">Amps</a></li> + <li><a href="?p=1.1.2.4">Effects</a></li> + <li><a href="?p=1.1.2.5">Accessories</a></li> + <li><a href="?p=1.1.2.5">Accessories</a></li> + <li><a href="?p=1.1.2.5">Accessories</a></li> + </ul> + </li> + <li> + <a class="head" href="?p=1.1.3">Drums</a> + <ul> + <li><a href="?p=1.1.3.2">Acoustic Drums</a></li> + <li><a href="?p=1.1.3.3">Electronic Drums</a></li> + <li><a href="?p=1.1.3.6">Accessories</a></li> + </ul> + </li> + </ul> + + </fieldset> + + <fieldset> + <legend>With options, container is a definition list, header dt, content dd</legend> + + <dl id="list2"> + <dt class="red">Red</dt> + <dd> + Fancy stuff about red thingies. + </dd> + <dt class="green selected">Green</dt> + <dd> + Green! Green! Green! + </dd> + <dt class="blue">Blue</dt> + <dd> + Cool kids are blue. + </dd> + </dl> + + </fieldset> + + <fieldset> + <legend>Divitus structure, div container, div header (class title), div + content, no active on startup and can be completely closed</legend> + + <div id="list3"> + <div> + <div class="title">Tennis</div> + <div> + One ball, two players. Lots of fun. + </div> + </div> + <div> + <div class="title">Soccer</div> + <div> + One ball, 22 players. Lots of fun. + </div> + </div> + <div> + <div class="title">Baseball</div> + <div> + Well, one ball, some guys running around, some guys hitting others with a stick.<br/> + Sounds like fun, doesn't it? + </div> + <div> + Well, apart from the running part. + </div> + </div> + </div> + + </fieldset> + + <div id="switch"> + <select> + <option>Switch to...</option> + <option value="1">1</option> + <option value="2">2</option> + <option value="3">3</option> + </select> + <button id="close">Close all</button> + Activate via selector, eg. ':first' or 'a:first': <input id="switch2" /> + </div> + + <div id="log"><div><strong>Log of the 2nd accordion</strong></div></div> +</div> + </body> </html>
\ No newline at end of file diff --git a/ui/tests/accordion.js b/ui/tests/accordion.js index c0a42697a..c0e3edfc5 100644 --- a/ui/tests/accordion.js +++ b/ui/tests/accordion.js @@ -1,78 +1,78 @@ -module("accordion");
-
-jQuery.ui.accordion.defaults.animated = false;
-
-function state(accordion) {
- var args = $.makeArray(arguments).slice(1);
- $.each(args, function(i, n) {
- equals(n, accordion.find("div").eq(i).is(":visible"));
- });
-}
-
-test("basics", function() {
- state($('#list1').accordion(), 1, 0, 0);
-});
-
-test("autoheight", function() {
- $('#navigation').accordion({ header: '.head', autoHeight: false });
- equals( 90, $('#navigation ul:first').height() );
- equals( 126, $('#navigation ul:eq(1)').height() );
- equals( 54, $('#navigation ul:last').height() );
- $('#navigation').accordion("destroy").accordion({ header: '.head', autoHeight: true });
- equals( 126, $('#navigation ul:first').height() );
- equals( 126, $('#navigation ul:eq(1)').height() );
- equals( 126, $('#navigation ul:last').height() );
-});
-
-test("activate, numeric", function() {
- var ac = $('#list1').accordion({ active: 1 });
- state(ac, 0, 1, 0);
- ac.accordion("activate", 2);
- state(ac, 0, 0, 1);
- ac.accordion("activate", 0);
- state(ac, 1, 0, 0);
- ac.accordion("activate", 1);
- state(ac, 0, 1, 0);
- ac.accordion("activate", 2);
- state(ac, 0, 0, 1);
- ac.accordion("activate", -1);
- state(ac, 0, 0, 1);
-});
-
-test("activate, boolean and numeric, alwaysOpen:false", function() {
- var ac = $('#list1').accordion({alwaysOpen: false}).accordion("activate", 2);
- state(ac, 0, 0, 1);
- ok("x", "----");
- ac.accordion("activate", 0);
- state(ac, 1, 0, 0);
- ok("x", "----");
- ac.accordion("activate", -1);
- state(ac, 0, 0, 0);
-});
-
-test("activate, boolean, alwaysOpen:true", function() {
- var ac = $('#list1').accordion().accordion("activate", 2);
- state(ac, 0, 0, 1);
- ac.accordion("activate", -1);
- state(ac, 0, 0, 1);
-});
-
-test("activate, string expression", function() {
- var ac = $('#list1').accordion({ active: ":last" });
- state(ac, 0, 0, 1);
- ac.accordion("activate", ":first");
- state(ac, 1, 0, 0);
- ac.accordion("activate", ":eq(1)");
- state(ac, 0, 1, 0);
- ac.accordion("activate", ":last");
- state(ac, 0, 0, 1);
-});
-
-test("activate, jQuery or DOM element", function() {
- var ac = $('#list1').accordion({ active: $("#list1 a:last") });
- state(ac, 0, 0, 1);
- ac.accordion("activate", $("#list1 a:first"));
- state(ac, 1, 0, 0);
- ac.accordion("activate", $("#list1 a")[1]);
- state(ac, 0, 1, 0);
+module("accordion"); + +jQuery.ui.accordion.defaults.animated = false; + +function state(accordion) { + var args = $.makeArray(arguments).slice(1); + $.each(args, function(i, n) { + equals(n, accordion.find("div").eq(i).is(":visible")); + }); +} + +test("basics", function() { + state($('#list1').accordion(), 1, 0, 0); +}); + +test("autoheight", function() { + $('#navigation').accordion({ header: '.head', autoHeight: false }); + equals( 90, $('#navigation ul:first').height() ); + equals( 126, $('#navigation ul:eq(1)').height() ); + equals( 54, $('#navigation ul:last').height() ); + $('#navigation').accordion("destroy").accordion({ header: '.head', autoHeight: true }); + equals( 126, $('#navigation ul:first').height() ); + equals( 126, $('#navigation ul:eq(1)').height() ); + equals( 126, $('#navigation ul:last').height() ); +}); + +test("activate, numeric", function() { + var ac = $('#list1').accordion({ active: 1 }); + state(ac, 0, 1, 0); + ac.accordion("activate", 2); + state(ac, 0, 0, 1); + ac.accordion("activate", 0); + state(ac, 1, 0, 0); + ac.accordion("activate", 1); + state(ac, 0, 1, 0); + ac.accordion("activate", 2); + state(ac, 0, 0, 1); + ac.accordion("activate", -1); + state(ac, 0, 0, 1); +}); + +test("activate, boolean and numeric, alwaysOpen:false", function() { + var ac = $('#list1').accordion({alwaysOpen: false}).accordion("activate", 2); + state(ac, 0, 0, 1); + ok("x", "----"); + ac.accordion("activate", 0); + state(ac, 1, 0, 0); + ok("x", "----"); + ac.accordion("activate", -1); + state(ac, 0, 0, 0); +}); + +test("activate, boolean, alwaysOpen:true", function() { + var ac = $('#list1').accordion().accordion("activate", 2); + state(ac, 0, 0, 1); + ac.accordion("activate", -1); + state(ac, 0, 0, 1); +}); + +test("activate, string expression", function() { + var ac = $('#list1').accordion({ active: ":last" }); + state(ac, 0, 0, 1); + ac.accordion("activate", ":first"); + state(ac, 1, 0, 0); + ac.accordion("activate", ":eq(1)"); + state(ac, 0, 1, 0); + ac.accordion("activate", ":last"); + state(ac, 0, 0, 1); +}); + +test("activate, jQuery or DOM element", function() { + var ac = $('#list1').accordion({ active: $("#list1 a:last") }); + state(ac, 0, 0, 1); + ac.accordion("activate", $("#list1 a:first")); + state(ac, 1, 0, 0); + ac.accordion("activate", $("#list1 a")[1]); + state(ac, 0, 1, 0); });
\ No newline at end of file diff --git a/ui/tests/all.html b/ui/tests/all.html index 4ad64b998..82000437d 100644 --- a/ui/tests/all.html +++ b/ui/tests/all.html @@ -1,182 +1,182 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>jQuery UI All Tests</title>
- <link rel="stylesheet" href="../../qunit/testsuite.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script>
-
- <script type="text/javascript" src="../source/ui.core.js"></script>
- <script type="text/javascript" src="../source/ui.accordion.js"></script>
- <script type="text/javascript" src="../source/ui.slider.js"></script>
-
- <script type="text/javascript" src="../../qunit/testrunner.js"></script>
-
- <script type="text/javascript" src="accordion.js"></script>
- <script type="text/javascript" src="slider.js"></script>
- <style type="text/css">
- .xerror, .error { display: none }
- </style>
-
-</head>
-<body class="flora">
- <h1>jQuery UI All Tests</h1>
- <h2 id="banner"></h2>
- <h2 id="userAgent"></h2>
-
- <h4>Run individual testsuites or doubleclick a test below</h4>
- <ul>
- <li><a href="accordion.html">Accordion</a></li>
- <li><a href="slider.html">Slider</a></li>
- </ul>
-
- <ol id="tests"></ol>
-
-<div id="main" style="position:absolute;top:-2000000px;">
-
- <div id='slider1'></div>
- <div id='slider3' style="position: relative; margin: 40px; width: 217px; height: 28px; background: url(http://developer.yahoo.com/yui/examples/slider/assets/bg-fader.gif) no-repeat scroll 5px 0px;">
- <div class='ui-slider-handle' style='position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px; background-image: url(http://developer.yahoo.com/yui/examples/slider/assets/thumb-n.gif);'></div>
- </div>
-
- <fieldset>
- <legend>Standard, container is a div, header is h3 and content p</legend>
-
- <div id="list1">
- <a>There is one obvious advantage:</a>
- <div>
- <p>
- You've seen it coming!<br/>
- Buy now and get nothing for free!<br/>
- Well, at least no free beer. Perhaps a bear, if you can afford it.
- </p>
- </div>
- <a>Now that you've got...</a>
- <div>
- <p>
- your bear, you have to admit it!<br/>
- No, we aren't selling bears.
- </p>
- <p>
- We could talk about renting one.
- </p>
- </div>
- <a>Rent one bear, ...</a>
- <div>
- <p>
- get two for three beer.
- </p>
- <p>
- And now, for something completely different.
- </p>
- </div>
- </div>
-
- </fieldset>
-
- <fieldset>
- <legend>Navigation - Unordered List with anchors and nested lists.</legend>
- <p>The first item is cloned to allow the user to select it. The
- active element is choosen based on location.hash: Open Drums and click
- the first item ('Drums'), then reload the page.</p>
-
- <ul id="navigation">
- <li>
- <a class="head" href="?p=1.1.1">Guitar</a>
- <ul>
- <li><a href="?p=1.1.1.1">Electric</a></li>
- <li><a href="?p=1.1.1.2">Acoustic</a></li>
- <li><a href="?p=1.1.1.3">Amps</a></li>
- <li><a href="?p=1.1.1.4">Effects</a></li>
- <li><a href="?p=1.1.1.5">Accessories</a></li>
- </ul>
- </li>
- <li>
- <a class="head" href="?p=1.1.2">Bass</a>
- <ul>
- <li><a href="?p=1.1.2.1">Electric</a></li>
- <li><a href="?p=1.1.2.2">Acoustic</a></li>
- <li><a href="?p=1.1.2.3">Amps</a></li>
- <li><a href="?p=1.1.2.4">Effects</a></li>
- <li><a href="?p=1.1.2.5">Accessories</a></li>
- <li><a href="?p=1.1.2.5">Accessories</a></li>
- <li><a href="?p=1.1.2.5">Accessories</a></li>
- </ul>
- </li>
- <li>
- <a class="head" href="?p=1.1.3">Drums</a>
- <ul>
- <li><a href="?p=1.1.3.2">Acoustic Drums</a></li>
- <li><a href="?p=1.1.3.3">Electronic Drums</a></li>
- <li><a href="?p=1.1.3.6">Accessories</a></li>
- </ul>
- </li>
- </ul>
-
- </fieldset>
-
- <fieldset>
- <legend>With options, container is a definition list, header dt, content dd</legend>
-
- <dl id="list2">
- <dt class="red">Red</dt>
- <dd>
- Fancy stuff about red thingies.
- </dd>
- <dt class="green selected">Green</dt>
- <dd>
- Green! Green! Green!
- </dd>
- <dt class="blue">Blue</dt>
- <dd>
- Cool kids are blue.
- </dd>
- </dl>
-
- </fieldset>
-
- <fieldset>
- <legend>Divitus structure, div container, div header (class title), div
- content, no active on startup and can be completely closed</legend>
-
- <div id="list3">
- <div>
- <div class="title">Tennis</div>
- <div>
- One ball, two players. Lots of fun.
- </div>
- </div>
- <div>
- <div class="title">Soccer</div>
- <div>
- One ball, 22 players. Lots of fun.
- </div>
- </div>
- <div>
- <div class="title">Baseball</div>
- <div>
- Well, one ball, some guys running around, some guys hitting others with a stick.<br/>
- Sounds like fun, doesn't it?
- </div>
- <div>
- Well, apart from the running part.
- </div>
- </div>
- </div>
-
- </fieldset>
-
- <div id="switch">
- <select>
- <option>Switch to...</option>
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- </select>
- <button id="close">Close all</button>
- Activate via selector, eg. ':first' or 'a:first': <input id="switch2" />
- </div>
-
- <div id="log"><div><strong>Log of the 2nd accordion</strong></div></div>
-</div>
- </body>
+<!DOCTYPE html> +<html lang="en"> +<head> + <title>jQuery UI All Tests</title> + <link rel="stylesheet" href="../../qunit/testsuite.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script> + + <script type="text/javascript" src="../source/ui.core.js"></script> + <script type="text/javascript" src="../source/ui.accordion.js"></script> + <script type="text/javascript" src="../source/ui.slider.js"></script> + + <script type="text/javascript" src="../../qunit/testrunner.js"></script> + + <script type="text/javascript" src="accordion.js"></script> + <script type="text/javascript" src="slider.js"></script> + <style type="text/css"> + .xerror, .error { display: none } + </style> + +</head> +<body class="flora"> + <h1>jQuery UI All Tests</h1> + <h2 id="banner"></h2> + <h2 id="userAgent"></h2> + + <h4>Run individual testsuites or doubleclick a test below</h4> + <ul> + <li><a href="accordion.html">Accordion</a></li> + <li><a href="slider.html">Slider</a></li> + </ul> + + <ol id="tests"></ol> + +<div id="main" style="position:absolute;top:-2000000px;"> + + <div id='slider1'></div> + <div id='slider3' style="position: relative; margin: 40px; width: 217px; height: 28px; background: url(http://developer.yahoo.com/yui/examples/slider/assets/bg-fader.gif) no-repeat scroll 5px 0px;"> + <div class='ui-slider-handle' style='position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px; background-image: url(http://developer.yahoo.com/yui/examples/slider/assets/thumb-n.gif);'></div> + </div> + + <fieldset> + <legend>Standard, container is a div, header is h3 and content p</legend> + + <div id="list1"> + <a>There is one obvious advantage:</a> + <div> + <p> + You've seen it coming!<br/> + Buy now and get nothing for free!<br/> + Well, at least no free beer. Perhaps a bear, if you can afford it. + </p> + </div> + <a>Now that you've got...</a> + <div> + <p> + your bear, you have to admit it!<br/> + No, we aren't selling bears. + </p> + <p> + We could talk about renting one. + </p> + </div> + <a>Rent one bear, ...</a> + <div> + <p> + get two for three beer. + </p> + <p> + And now, for something completely different. + </p> + </div> + </div> + + </fieldset> + + <fieldset> + <legend>Navigation - Unordered List with anchors and nested lists.</legend> + <p>The first item is cloned to allow the user to select it. The + active element is choosen based on location.hash: Open Drums and click + the first item ('Drums'), then reload the page.</p> + + <ul id="navigation"> + <li> + <a class="head" href="?p=1.1.1">Guitar</a> + <ul> + <li><a href="?p=1.1.1.1">Electric</a></li> + <li><a href="?p=1.1.1.2">Acoustic</a></li> + <li><a href="?p=1.1.1.3">Amps</a></li> + <li><a href="?p=1.1.1.4">Effects</a></li> + <li><a href="?p=1.1.1.5">Accessories</a></li> + </ul> + </li> + <li> + <a class="head" href="?p=1.1.2">Bass</a> + <ul> + <li><a href="?p=1.1.2.1">Electric</a></li> + <li><a href="?p=1.1.2.2">Acoustic</a></li> + <li><a href="?p=1.1.2.3">Amps</a></li> + <li><a href="?p=1.1.2.4">Effects</a></li> + <li><a href="?p=1.1.2.5">Accessories</a></li> + <li><a href="?p=1.1.2.5">Accessories</a></li> + <li><a href="?p=1.1.2.5">Accessories</a></li> + </ul> + </li> + <li> + <a class="head" href="?p=1.1.3">Drums</a> + <ul> + <li><a href="?p=1.1.3.2">Acoustic Drums</a></li> + <li><a href="?p=1.1.3.3">Electronic Drums</a></li> + <li><a href="?p=1.1.3.6">Accessories</a></li> + </ul> + </li> + </ul> + + </fieldset> + + <fieldset> + <legend>With options, container is a definition list, header dt, content dd</legend> + + <dl id="list2"> + <dt class="red">Red</dt> + <dd> + Fancy stuff about red thingies. + </dd> + <dt class="green selected">Green</dt> + <dd> + Green! Green! Green! + </dd> + <dt class="blue">Blue</dt> + <dd> + Cool kids are blue. + </dd> + </dl> + + </fieldset> + + <fieldset> + <legend>Divitus structure, div container, div header (class title), div + content, no active on startup and can be completely closed</legend> + + <div id="list3"> + <div> + <div class="title">Tennis</div> + <div> + One ball, two players. Lots of fun. + </div> + </div> + <div> + <div class="title">Soccer</div> + <div> + One ball, 22 players. Lots of fun. + </div> + </div> + <div> + <div class="title">Baseball</div> + <div> + Well, one ball, some guys running around, some guys hitting others with a stick.<br/> + Sounds like fun, doesn't it? + </div> + <div> + Well, apart from the running part. + </div> + </div> + </div> + + </fieldset> + + <div id="switch"> + <select> + <option>Switch to...</option> + <option value="1">1</option> + <option value="2">2</option> + <option value="3">3</option> + </select> + <button id="close">Close all</button> + Activate via selector, eg. ':first' or 'a:first': <input id="switch2" /> + </div> + + <div id="log"><div><strong>Log of the 2nd accordion</strong></div></div> +</div> + </body> </html>
\ No newline at end of file diff --git a/ui/tests/autodrag.html b/ui/tests/autodrag.html index 8f436576f..df7590761 100644 --- a/ui/tests/autodrag.html +++ b/ui/tests/autodrag.html @@ -1,154 +1,154 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>jQuery UI - Automated Tests</title>
- <script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/source/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/source/ui.draggable.js"></script>
- <script type="text/javascript" src="../../ui/source/ui.selectable.js"></script>
-
- <script type="text/javascript" src="ui.testmouse.js"></script>
-
-<style type="text/css">
-
-html, body { height: 100%; }
-#main { height: 100%; }
-
-#foo { position: relative; margin: 10px; padding: 10px; border: 3px solid gray; width: 200px; height: 200px; background: #eef; text-align: center; }
-#foo * { margin: 4px; }
-.ui-draggable .msg-missing-class { display: none !important; background: red; color: white; font-weight: bold; }
-.ui-draggable .msg-enabled { display: block; }
-.ui-draggable .msg-disabled { display: none; }
-.ui-draggable-disabled .msg-enabled { display: none !important; }
-.ui-draggable-disabled .msg-disabled { display: block !important; }
-.ui-selectable .msg-missing-class { display: none !important; background: red; color: white; font-weight: bold; }
-.ui-selectable .msg-enabled { display: block; }
-.ui-selectable .msg-disabled { display: none; }
-.ui-selectable-disabled .msg-enabled { display: none !important; }
-.ui-selectable-disabled .msg-disabled { display: block !important; }
-//.ui-selectee { border: 1px solid white; }
-.ui-selecting { background: Highlight; color: HighlightText; outline: 1px dotted white; }
-.ui-selected { background: Highlight; color: HighlightText; outline: 1px dotted black; }
-
-</style>
-
-<script type="text/javascript">
-$(function() {
-
- var speed = "fast";
-
- var queue;
- var start = function() {
- queue = tests.slice().reverse(); // clone
- $("#status").text("Running...");
- nextTest();
- }
- var stop = function() {
- $("#status").text("Ready");
- teardown();
- }
-
- var tests = [];
- var nextTest = function() {
- if (queue.length) {
- var nTest = queue.pop();
- teardown(function() {
- setupAndRun(nTest);
- });
- } else {
- stop();
- }
- }
-
- var num = 0;
-
- var addTest = function(fn) {
- num += 1;
- tests.push({
- num: num,
- fn: fn
- });
- }
-
- var setupAndRun = function(nTest) {
- $('#testnum').text(nTest.num);
- $('#sandbox').hide()
- .append('<ul id="foo">' +
- '<li class="msg-missing-class">THIS TEXT SHOULD NOT BE VISIBLE</li>' +
- '<li class="msg-enabled">enabled</li>' +
- '<li class="msg-disabled">disabled</li>' +
- '<li>Item 2</li>' +
- '<li>Item 3</li>' +
- '<li>Item 4</li>' +
- '<li>Item 5</li>' +
- '<li>Item 6</li>' +
- '<li>Item 7</li>' +
- '<li>Item 8</li>' +
- '</ul>')
- $('#foo').testMouse({
- speed: speed,
- complete: nextTest
- });
- $('#sandbox').show();
- nTest.fn.apply(nTest.fn);
- }
-
- var teardown = function(fn) {
- $('#sandbox').hide();
- $('#foo').remove();
- if ($.isFunction(fn)) fn.apply();
- }
- var plugin = "draggable";
- plugin = "selectable"
- var testFn = "testMouse";
- var testArgs = ["drag", 40, 50];
- //1
- addTest(function() { $("#foo")[plugin]()[testFn].apply($("#foo"), testArgs); });
- //2
- addTest(function() { $("#foo")[plugin]({ disabled: true })[testFn].apply($("#foo"), testArgs); });
- addTest(function() { $("#foo")[plugin]({ disabled: false })[testFn].apply($("#foo"), testArgs); });
- //4
- addTest(function() { $("#foo")[plugin]()[plugin]('disable')[testFn].apply($("#foo"), testArgs); });
- addTest(function() { $("#foo")[plugin]()[plugin]('enable')[testFn].apply($("#foo"), testArgs); });
- //6
- addTest(function() { $("#foo")[plugin]()[plugin]('enable')[plugin]('disable')[testFn].apply($("#foo"), testArgs); });
- addTest(function() { $("#foo")[plugin]()[plugin]('disable')[plugin]('enable')[testFn].apply($("#foo"), testArgs); });
- //8
- addTest(function() { $("#foo")[plugin]({ disabled: false })[plugin]('disable')[testFn].apply($("#foo"), testArgs); });
- addTest(function() { $("#foo")[plugin]({ disabled: true })[plugin]('enable')[testFn].apply($("#foo"), testArgs); });
- //10
- addTest(function() { $("#foo")[plugin]({ disabled: false }).data('disabled.' + plugin, true)[testFn].apply($("#foo"), testArgs); });
- addTest(function() { $("#foo")[plugin]({ disabled: true }).data('disabled.' + plugin, false)[testFn].apply($("#foo"), testArgs); });
-
- $('#begin').click(function() {
- start();
- });
-
-});
-</script>
-
-</head>
-<body>
-
-<div id="main">
-
- <h1>jQuery UI - Automated Tests</h1>
-
- <div>
- Status: <span id="status">Ready</span>
- </div>
-
- <div>
- Test: <span id="testnum"></span>
- </div>
-
- <div style="height: 3em;"><button id="begin">Run Test</button></div>
-
- <div id="sandbox">
-
- </div>
-
-</div>
-
-</body>
-</html>
+<!DOCTYPE html> +<html lang="en"> +<head> + <title>jQuery UI - Automated Tests</title> + <script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/source/ui.core.js"></script> + <script type="text/javascript" src="../../ui/source/ui.draggable.js"></script> + <script type="text/javascript" src="../../ui/source/ui.selectable.js"></script> + + <script type="text/javascript" src="ui.testmouse.js"></script> + +<style type="text/css"> + +html, body { height: 100%; } +#main { height: 100%; } + +#foo { position: relative; margin: 10px; padding: 10px; border: 3px solid gray; width: 200px; height: 200px; background: #eef; text-align: center; } +#foo * { margin: 4px; } +.ui-draggable .msg-missing-class { display: none !important; background: red; color: white; font-weight: bold; } +.ui-draggable .msg-enabled { display: block; } +.ui-draggable .msg-disabled { display: none; } +.ui-draggable-disabled .msg-enabled { display: none !important; } +.ui-draggable-disabled .msg-disabled { display: block !important; } +.ui-selectable .msg-missing-class { display: none !important; background: red; color: white; font-weight: bold; } +.ui-selectable .msg-enabled { display: block; } +.ui-selectable .msg-disabled { display: none; } +.ui-selectable-disabled .msg-enabled { display: none !important; } +.ui-selectable-disabled .msg-disabled { display: block !important; } +//.ui-selectee { border: 1px solid white; } +.ui-selecting { background: Highlight; color: HighlightText; outline: 1px dotted white; } +.ui-selected { background: Highlight; color: HighlightText; outline: 1px dotted black; } + +</style> + +<script type="text/javascript"> +$(function() { + + var speed = "fast"; + + var queue; + var start = function() { + queue = tests.slice().reverse(); // clone + $("#status").text("Running..."); + nextTest(); + } + var stop = function() { + $("#status").text("Ready"); + teardown(); + } + + var tests = []; + var nextTest = function() { + if (queue.length) { + var nTest = queue.pop(); + teardown(function() { + setupAndRun(nTest); + }); + } else { + stop(); + } + } + + var num = 0; + + var addTest = function(fn) { + num += 1; + tests.push({ + num: num, + fn: fn + }); + } + + var setupAndRun = function(nTest) { + $('#testnum').text(nTest.num); + $('#sandbox').hide() + .append('<ul id="foo">' + + '<li class="msg-missing-class">THIS TEXT SHOULD NOT BE VISIBLE</li>' + + '<li class="msg-enabled">enabled</li>' + + '<li class="msg-disabled">disabled</li>' + + '<li>Item 2</li>' + + '<li>Item 3</li>' + + '<li>Item 4</li>' + + '<li>Item 5</li>' + + '<li>Item 6</li>' + + '<li>Item 7</li>' + + '<li>Item 8</li>' + + '</ul>') + $('#foo').testMouse({ + speed: speed, + complete: nextTest + }); + $('#sandbox').show(); + nTest.fn.apply(nTest.fn); + } + + var teardown = function(fn) { + $('#sandbox').hide(); + $('#foo').remove(); + if ($.isFunction(fn)) fn.apply(); + } + var plugin = "draggable"; + plugin = "selectable" + var testFn = "testMouse"; + var testArgs = ["drag", 40, 50]; + //1 + addTest(function() { $("#foo")[plugin]()[testFn].apply($("#foo"), testArgs); }); + //2 + addTest(function() { $("#foo")[plugin]({ disabled: true })[testFn].apply($("#foo"), testArgs); }); + addTest(function() { $("#foo")[plugin]({ disabled: false })[testFn].apply($("#foo"), testArgs); }); + //4 + addTest(function() { $("#foo")[plugin]()[plugin]('disable')[testFn].apply($("#foo"), testArgs); }); + addTest(function() { $("#foo")[plugin]()[plugin]('enable')[testFn].apply($("#foo"), testArgs); }); + //6 + addTest(function() { $("#foo")[plugin]()[plugin]('enable')[plugin]('disable')[testFn].apply($("#foo"), testArgs); }); + addTest(function() { $("#foo")[plugin]()[plugin]('disable')[plugin]('enable')[testFn].apply($("#foo"), testArgs); }); + //8 + addTest(function() { $("#foo")[plugin]({ disabled: false })[plugin]('disable')[testFn].apply($("#foo"), testArgs); }); + addTest(function() { $("#foo")[plugin]({ disabled: true })[plugin]('enable')[testFn].apply($("#foo"), testArgs); }); + //10 + addTest(function() { $("#foo")[plugin]({ disabled: false }).data('disabled.' + plugin, true)[testFn].apply($("#foo"), testArgs); }); + addTest(function() { $("#foo")[plugin]({ disabled: true }).data('disabled.' + plugin, false)[testFn].apply($("#foo"), testArgs); }); + + $('#begin').click(function() { + start(); + }); + +}); +</script> + +</head> +<body> + +<div id="main"> + + <h1>jQuery UI - Automated Tests</h1> + + <div> + Status: <span id="status">Ready</span> + </div> + + <div> + Test: <span id="testnum"></span> + </div> + + <div style="height: 3em;"><button id="begin">Run Test</button></div> + + <div id="sandbox"> + + </div> + +</div> + +</body> +</html> diff --git a/ui/tests/draggable.html b/ui/tests/draggable.html index a99cec5bb..46b487d4f 100644 --- a/ui/tests/draggable.html +++ b/ui/tests/draggable.html @@ -1,40 +1,40 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Language" content="en" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Draggable Test Page</title>
-<link rel="stylesheet" href="../../qunit/testsuite.css" type="text/css" media="screen">
-
-<script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script>
-<script type="text/javascript" src="../source/ui.core.js"></script>
-<script type="text/javascript" src="../source/ui.draggable.js"></script>
-
-<script type="text/javascript" src="../../qunit/testrunner.js"></script>
-<script type="text/javascript" src="draggable.js"></script>
-<script type="text/javascript" src="jquery.useraction.js"></script>
-
-<style>
- #main {
- position:absolute !important;
- top: -1000px !important;
- left: -1000px !important;
- }
-</style>
-
-</head>
-<body>
-
- <h1 id="header">Draggable Test Suite</h1>
- <h2 id="banner"></h2>
- <h2 id="userAgent"></h2>
-
- <div id="main" style="border: 1px solid black; padding: 10px; margin: 10px;">
- <div id='draggable1' style="background: green; width: 200px; height: 100px;">Static</div>
- <div id='draggable2' style="background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;"><span>Absolute</span></div>
- </div>
-
- <ol id="tests"></ol>
-
-</body>
-</html>
+<!DOCTYPE html> +<html lang="en"> +<head> +<meta http-equiv="Content-Language" content="en" /> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Draggable Test Page</title> +<link rel="stylesheet" href="../../qunit/testsuite.css" type="text/css" media="screen"> + +<script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script> +<script type="text/javascript" src="../source/ui.core.js"></script> +<script type="text/javascript" src="../source/ui.draggable.js"></script> + +<script type="text/javascript" src="../../qunit/testrunner.js"></script> +<script type="text/javascript" src="draggable.js"></script> +<script type="text/javascript" src="jquery.useraction.js"></script> + +<style> + #main { + position:absolute !important; + top: -1000px !important; + left: -1000px !important; + } +</style> + +</head> +<body> + + <h1 id="header">Draggable Test Suite</h1> + <h2 id="banner"></h2> + <h2 id="userAgent"></h2> + + <div id="main" style="border: 1px solid black; padding: 10px; margin: 10px;"> + <div id='draggable1' style="background: green; width: 200px; height: 100px;">Static</div> + <div id='draggable2' style="background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;"><span>Absolute</span></div> + </div> + + <ol id="tests"></ol> + +</body> +</html> diff --git a/ui/tests/draggable.js b/ui/tests/draggable.js index ba6eaa7f1..a246d4747 100644 --- a/ui/tests/draggable.js +++ b/ui/tests/draggable.js @@ -1,322 +1,322 @@ -var drag = function(el, dx, dy, complete) {
-
- // speed = sync -> Drag syncrhonously.
- // speed = fast|slow -> Drag asyncrhonously - animated.
-
- return $(el).userAction("drag", {
- dx: dx||0, dy: dy||0, speed: 'sync', complete: complete
- });
-};
-
-
-module("Draggable");
-
-test("create and destroy", function() {
-
- expect(2);
-
- $("#draggable1").draggable();
- ok($("#draggable1").data("draggable"), "Accessing draggable instance after creation");
-
- $("#draggable1").draggable("destroy");
- ok(!$("#draggable1").data("draggable"), "Accessing draggable instance after destroy");
-
-});
-
-test("No options, relative", function() {
-
- expect(4);
-
- $("#draggable1").draggable();
-
- var offset = $("#draggable1").data("draggable").element.offset();
- equals(offset.left, -979, "Checking initial left position");
- equals(offset.top, -979, "Checking initial top position");
-
- drag("#draggable1", 50, 50);
-
- var offset = $("#draggable1").data("draggable").element.offset();
- equals(offset.left, -929, "Checking new left position");
- equals(offset.top, -929, "Checking new top position");
-
-
-});
-
-test("No options, absolute", function() {
-
- expect(4);
-
- $("#draggable2").draggable();
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -979, "Checking initial left position");
- equals(offset.top, -979, "Checking initial top position");
-
- drag("#draggable2", 50, 50);
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -929, "Checking new left position");
- equals(offset.top, -929, "Checking new top position");
-
-
-});
-
-test("{ helper: 'clone' }", function() {
-
- expect(4);
-
- $("#draggable1, #draggable2").draggable({ helper: "clone" });
-
- drag("#draggable1, #draggable2", 50, 50);
-
- var offset = $("#draggable1").data("draggable").element.offset();
- equals(offset.left, -979, "Relative: Original position should be untouched");
- equals(offset.top, -979, "Relative: Original position should be untouched");
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -979, "Absolute: Original position should be untouched");
- equals(offset.top, -979, "Absolute: Original position should be untouched");
-
-
-});
-
-test("{ grid: [50,50] }", function() {
-
- expect(4);
-
- $("#draggable1, #draggable2").draggable({ grid: [50,50] });
-
- drag("#draggable1, #draggable2", 30, 30);
-
- var offset = $("#draggable1").data("draggable").element.offset();
- equals(offset.left, -929, "Relative: 50px move in grid");
- equals(offset.top, -929, "Relative: 50px move in grid");
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -929, "Absolute: 50px move in grid");
- equals(offset.top, -929, "Absolute: 50px move in grid");
-
-
-});
-
-test("{ axis: 'y' }", function() {
-
- expect(4);
-
- $("#draggable1, #draggable2").draggable({ axis: "y" });
-
- drag("#draggable1, #draggable2", 50, 50);
-
- var offset = $("#draggable1").data("draggable").element.offset();
- equals(offset.left, -979, "Relative: 0px move");
- equals(offset.top, -929, "Relative: 50px move");
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -979, "Absolute: 0px move");
- equals(offset.top, -929, "Absolute: 50px move");
-
-
-});
-
-test("{ axis: 'x' }", function() {
-
- expect(4);
-
- $("#draggable1, #draggable2").draggable({ axis: "x" });
-
- drag("#draggable1, #draggable2", 50, 50);
-
- var offset = $("#draggable1").data("draggable").element.offset();
- equals(offset.left, -929, "Relative: 50px move");
- equals(offset.top, -979, "Relative: 0px move");
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -929, "Absolute: 50px move");
- equals(offset.top, -979, "Absolute: 0px move");
-
-
-});
-
-test("{ cancel: 'span' }", function() {
-
- expect(2);
-
- $("#draggable2").draggable({ cancel: 'span' });
-
- drag("#draggable2 span", 50, 50);
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -979, "Trigger on span: 0px move");
- equals(offset.top, -979, "Trigger on span: 0px move");
-
-
-});
-
-test("{ handle: 'span' }", function() {
-
- expect(4);
-
- $("#draggable2").draggable({ handle: 'span' });
-
- drag("#draggable2 span", 50, 50);
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -929, "Trigger on span: 50px move");
- equals(offset.top, -929, "Trigger on span: 50px move");
-
- drag("#draggable2", 50, 50);
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -929, "Trigger on element: 0px move");
- equals(offset.top, -929, "Trigger on element: 0px move");
-
-
-});
-
-test("{ containment: 'parent' }", function() {
-
- expect(4);
-
- $("#draggable2, #draggable1").draggable({ containment: 'parent' });
-
- drag("#draggable2, #draggable1", -100, -100);
-
- var offset = $("#draggable2").data("draggable").element.offset();
- equals(offset.left, -989, "Absolute: 10px move (to parent's margin end)");
- equals(offset.top, -989, "Absolute: 10px move (to parent's margin end)");
-
- var offset = $("#draggable1").data("draggable").element.offset();
- equals(offset.left, -989, "Relative: 10px move (to parent's margin end)");
- equals(offset.top, -989, "Relative: 10px move (to parent's margin end)");
-
-
-});
-
-test("{ cursorAt: { left: -5, top: -5 } }", function() {
-
- expect(4);
-
- var position = null;
- $("#draggable2").draggable({
- cursorAt: { left: -5, top: -5 },
- drag: function(e, ui) {
- position = ui.absolutePosition;
- }
- });
-
- drag("#draggable2", -1, -1);
-
- equals(position.left, -875, "Absolute: -1px move");
- equals(position.top, -925, "Absolute: -1px move");
-
- var position = null;
- $("#draggable1").draggable({
- cursorAt: { left: -5, top: -5 },
- drag: function(e, ui) {
- position = ui.absolutePosition;
- }
- });
-
- drag("#draggable1", -1, -1);
-
- equals(position.left, -875, "Relative: -1px move");
- equals(position.top, -925, "Relative: -1px move");
-
-});
-
-test("{ cursor: 'move' }", function() {
-
- expect(2);
-
- var cursor = null;
- $("#draggable2").draggable({
- cursor: "move",
- start: function(e, ui) {
- cursor = $("body").css("cursor");
- }
- });
-
- drag("#draggable2", -1, -1);
-
- equals(cursor, "move", "start callback: cursor 'move'");
- equals($("body").css("cursor"), "auto", "after drag: cursor restored");
-
-});
-
-test("{ distance: 10 }", function() {
-
- expect(2);
-
- var dragged = false;
- $("#draggable2").draggable({
- distance: 10,
- start: function(e, ui) {
- dragged = true;
- }
- });
-
- drag("#draggable2", -9, -9);
- equals(dragged, false, "The draggable should not have moved when moving -9px");
-
- drag("#draggable2", -10, -10);
- equals(dragged, true, "The draggable should have moved when moving -10px");
-
-});
-
-test("{ opacity: 0.5 }", function() {
-
- expect(1);
-
- var opacity = null;
- $("#draggable2").draggable({
- opacity: 0.5,
- start: function(e, ui) {
- opacity = $(this).css("opacity");
- }
- });
-
- drag("#draggable2", -1, -1);
-
- equals(opacity, "0.5", "start callback: opacity is 0.5");
-
-});
-
-test("{ zIndex: 10 }", function() {
-
- expect(1);
-
- var zIndex = null;
- $("#draggable2").draggable({
- zIndex: 10,
- start: function(e, ui) {
- zIndex = $(this).css("zIndex");
- }
- });
-
- drag("#draggable2", -1, -1);
-
- equals(zIndex, "10", "start callback: zIndex is 10");
-
-});
-
-test("callbacks occurance count", function() {
-
- expect(3);
-
- var start = 0, stop = 0, dragc = 0;
- $("#draggable2").draggable({
- start: function() { start++; },
- drag: function() { dragc++; },
- stop: function() { stop++; }
- });
-
- drag("#draggable2", 10, 10);
-
- equals(start, 1, "start callback should happen exactly once");
- equals(dragc, 11, "drag callback should happen exactly 1+10 times (first simultaneously with start)");
- equals(stop, 1, "stop callback should happen exactly once");
-
-});
-
-
-
+var drag = function(el, dx, dy, complete) { + + // speed = sync -> Drag syncrhonously. + // speed = fast|slow -> Drag asyncrhonously - animated. + + return $(el).userAction("drag", { + dx: dx||0, dy: dy||0, speed: 'sync', complete: complete + }); +}; + + +module("Draggable"); + +test("create and destroy", function() { + + expect(2); + + $("#draggable1").draggable(); + ok($("#draggable1").data("draggable"), "Accessing draggable instance after creation"); + + $("#draggable1").draggable("destroy"); + ok(!$("#draggable1").data("draggable"), "Accessing draggable instance after destroy"); + +}); + +test("No options, relative", function() { + + expect(4); + + $("#draggable1").draggable(); + + var offset = $("#draggable1").data("draggable").element.offset(); + equals(offset.left, -979, "Checking initial left position"); + equals(offset.top, -979, "Checking initial top position"); + + drag("#draggable1", 50, 50); + + var offset = $("#draggable1").data("draggable").element.offset(); + equals(offset.left, -929, "Checking new left position"); + equals(offset.top, -929, "Checking new top position"); + + +}); + +test("No options, absolute", function() { + + expect(4); + + $("#draggable2").draggable(); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -979, "Checking initial left position"); + equals(offset.top, -979, "Checking initial top position"); + + drag("#draggable2", 50, 50); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -929, "Checking new left position"); + equals(offset.top, -929, "Checking new top position"); + + +}); + +test("{ helper: 'clone' }", function() { + + expect(4); + + $("#draggable1, #draggable2").draggable({ helper: "clone" }); + + drag("#draggable1, #draggable2", 50, 50); + + var offset = $("#draggable1").data("draggable").element.offset(); + equals(offset.left, -979, "Relative: Original position should be untouched"); + equals(offset.top, -979, "Relative: Original position should be untouched"); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -979, "Absolute: Original position should be untouched"); + equals(offset.top, -979, "Absolute: Original position should be untouched"); + + +}); + +test("{ grid: [50,50] }", function() { + + expect(4); + + $("#draggable1, #draggable2").draggable({ grid: [50,50] }); + + drag("#draggable1, #draggable2", 30, 30); + + var offset = $("#draggable1").data("draggable").element.offset(); + equals(offset.left, -929, "Relative: 50px move in grid"); + equals(offset.top, -929, "Relative: 50px move in grid"); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -929, "Absolute: 50px move in grid"); + equals(offset.top, -929, "Absolute: 50px move in grid"); + + +}); + +test("{ axis: 'y' }", function() { + + expect(4); + + $("#draggable1, #draggable2").draggable({ axis: "y" }); + + drag("#draggable1, #draggable2", 50, 50); + + var offset = $("#draggable1").data("draggable").element.offset(); + equals(offset.left, -979, "Relative: 0px move"); + equals(offset.top, -929, "Relative: 50px move"); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -979, "Absolute: 0px move"); + equals(offset.top, -929, "Absolute: 50px move"); + + +}); + +test("{ axis: 'x' }", function() { + + expect(4); + + $("#draggable1, #draggable2").draggable({ axis: "x" }); + + drag("#draggable1, #draggable2", 50, 50); + + var offset = $("#draggable1").data("draggable").element.offset(); + equals(offset.left, -929, "Relative: 50px move"); + equals(offset.top, -979, "Relative: 0px move"); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -929, "Absolute: 50px move"); + equals(offset.top, -979, "Absolute: 0px move"); + + +}); + +test("{ cancel: 'span' }", function() { + + expect(2); + + $("#draggable2").draggable({ cancel: 'span' }); + + drag("#draggable2 span", 50, 50); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -979, "Trigger on span: 0px move"); + equals(offset.top, -979, "Trigger on span: 0px move"); + + +}); + +test("{ handle: 'span' }", function() { + + expect(4); + + $("#draggable2").draggable({ handle: 'span' }); + + drag("#draggable2 span", 50, 50); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -929, "Trigger on span: 50px move"); + equals(offset.top, -929, "Trigger on span: 50px move"); + + drag("#draggable2", 50, 50); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -929, "Trigger on element: 0px move"); + equals(offset.top, -929, "Trigger on element: 0px move"); + + +}); + +test("{ containment: 'parent' }", function() { + + expect(4); + + $("#draggable2, #draggable1").draggable({ containment: 'parent' }); + + drag("#draggable2, #draggable1", -100, -100); + + var offset = $("#draggable2").data("draggable").element.offset(); + equals(offset.left, -989, "Absolute: 10px move (to parent's margin end)"); + equals(offset.top, -989, "Absolute: 10px move (to parent's margin end)"); + + var offset = $("#draggable1").data("draggable").element.offset(); + equals(offset.left, -989, "Relative: 10px move (to parent's margin end)"); + equals(offset.top, -989, "Relative: 10px move (to parent's margin end)"); + + +}); + +test("{ cursorAt: { left: -5, top: -5 } }", function() { + + expect(4); + + var position = null; + $("#draggable2").draggable({ + cursorAt: { left: -5, top: -5 }, + drag: function(e, ui) { + position = ui.absolutePosition; + } + }); + + drag("#draggable2", -1, -1); + + equals(position.left, -875, "Absolute: -1px move"); + equals(position.top, -925, "Absolute: -1px move"); + + var position = null; + $("#draggable1").draggable({ + cursorAt: { left: -5, top: -5 }, + drag: function(e, ui) { + position = ui.absolutePosition; + } + }); + + drag("#draggable1", -1, -1); + + equals(position.left, -875, "Relative: -1px move"); + equals(position.top, -925, "Relative: -1px move"); + +}); + +test("{ cursor: 'move' }", function() { + + expect(2); + + var cursor = null; + $("#draggable2").draggable({ + cursor: "move", + start: function(e, ui) { + cursor = $("body").css("cursor"); + } + }); + + drag("#draggable2", -1, -1); + + equals(cursor, "move", "start callback: cursor 'move'"); + equals($("body").css("cursor"), "auto", "after drag: cursor restored"); + +}); + +test("{ distance: 10 }", function() { + + expect(2); + + var dragged = false; + $("#draggable2").draggable({ + distance: 10, + start: function(e, ui) { + dragged = true; + } + }); + + drag("#draggable2", -9, -9); + equals(dragged, false, "The draggable should not have moved when moving -9px"); + + drag("#draggable2", -10, -10); + equals(dragged, true, "The draggable should have moved when moving -10px"); + +}); + +test("{ opacity: 0.5 }", function() { + + expect(1); + + var opacity = null; + $("#draggable2").draggable({ + opacity: 0.5, + start: function(e, ui) { + opacity = $(this).css("opacity"); + } + }); + + drag("#draggable2", -1, -1); + + equals(opacity, "0.5", "start callback: opacity is 0.5"); + +}); + +test("{ zIndex: 10 }", function() { + + expect(1); + + var zIndex = null; + $("#draggable2").draggable({ + zIndex: 10, + start: function(e, ui) { + zIndex = $(this).css("zIndex"); + } + }); + + drag("#draggable2", -1, -1); + + equals(zIndex, "10", "start callback: zIndex is 10"); + +}); + +test("callbacks occurance count", function() { + + expect(3); + + var start = 0, stop = 0, dragc = 0; + $("#draggable2").draggable({ + start: function() { start++; }, + drag: function() { dragc++; }, + stop: function() { stop++; } + }); + + drag("#draggable2", 10, 10); + + equals(start, 1, "start callback should happen exactly once"); + equals(dragc, 11, "drag callback should happen exactly 1+10 times (first simultaneously with start)"); + equals(stop, 1, "stop callback should happen exactly once"); + +}); + + + diff --git a/ui/tests/slider.html b/ui/tests/slider.html index 518a9bd98..f77ec68e6 100644 --- a/ui/tests/slider.html +++ b/ui/tests/slider.html @@ -1,32 +1,32 @@ -<!DOCTYPE html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Language" content="en" />
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Slider Test Page</title>
-<link rel="stylesheet" href="../../qunit/testsuite.css" type="text/css" media="screen">
-
-<script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script>
-<script type="text/javascript" src="../source/ui.core.js"></script>
-<script type="text/javascript" src="../source/ui.slider.js"></script>
-
-<script type="text/javascript" src="../../qunit/testrunner.js"></script>
-<script type="text/javascript" src="slider.js"></script>
-</head>
-<body>
-
- <h1 id="header">jQuery Test Suite</h1>
- <h2 id="banner"></h2>
- <h2 id="userAgent"></h2>
-
- <div id="main" style="position:absolute;top:-20000px">
- <div id='slider1'></div>
- <div id='slider3' style="position: relative; margin: 40px; width: 217px; height: 28px; background: url(http://developer.yahoo.com/yui/examples/slider/assets/bg-fader.gif) no-repeat scroll 5px 0px;">
- <div class='ui-slider-handle' style='position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px; background-image: url(http://developer.yahoo.com/yui/examples/slider/assets/thumb-n.gif);'></div>
- </div>
- </div>
-
- <ol id="tests"></ol>
-
-</body>
-</html>
+<!DOCTYPE html> +<html lang="en"> +<head> +<meta http-equiv="Content-Language" content="en" /> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Slider Test Page</title> +<link rel="stylesheet" href="../../qunit/testsuite.css" type="text/css" media="screen"> + +<script type="text/javascript" src="../../jquery/jquery-1.2.6.js"></script> +<script type="text/javascript" src="../source/ui.core.js"></script> +<script type="text/javascript" src="../source/ui.slider.js"></script> + +<script type="text/javascript" src="../../qunit/testrunner.js"></script> +<script type="text/javascript" src="slider.js"></script> +</head> +<body> + + <h1 id="header">jQuery Test Suite</h1> + <h2 id="banner"></h2> + <h2 id="userAgent"></h2> + + <div id="main" style="position:absolute;top:-20000px"> + <div id='slider1'></div> + <div id='slider3' style="position: relative; margin: 40px; width: 217px; height: 28px; background: url(http://developer.yahoo.com/yui/examples/slider/assets/bg-fader.gif) no-repeat scroll 5px 0px;"> + <div class='ui-slider-handle' style='position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px; background-image: url(http://developer.yahoo.com/yui/examples/slider/assets/thumb-n.gif);'></div> + </div> + </div> + + <ol id="tests"></ol> + +</body> +</html> diff --git a/ui/tests/slider.js b/ui/tests/slider.js index 035fa496f..0dc020642 100644 --- a/ui/tests/slider.js +++ b/ui/tests/slider.js @@ -1,100 +1,100 @@ -$.fn.triggerKeydown = function(keyCode) {
- return this.trigger("keydown", [$.event.fix({event:"keydown", keyCode: keyCode, target: this[0]})]);
-}
-
-function assertChange(stepping, start, result, action) {
- return function() {
- expect(1);
- var slider = $("#slider3").slider({
- stepping: stepping,
- startValue: start,
- min: 0,
- max: 1000,
- change: function(e, ui) {
- equals(ui.value, result, "changed to " + ui.value);
- }
- });
- action.apply(slider);
- }
-}
-
-module("slider: single handle")
-
-test("change one step via keydown", assertChange(1, undefined, 1, function() {
- this.find("a").triggerKeydown("39");
-}))
-test("change - 10 steps via keydown", assertChange(10, 20, 10, function() {
- this.find("a").triggerKeydown("37");
-}))
-test("change +10 steps via keydown", assertChange(10, 20, 30, function() {
- this.find("a").triggerKeydown("39");
-}))
-
-test("moveTo, absolute value", assertChange(1, 1, 10, function() {
- this.slider("moveTo", 10);
-}))
-
-test("moveTo, absolute value as string", assertChange(1, 1, 10, function() {
- this.slider("moveTo", "10");
-}))
-
-test("moveTo, absolute value, below min", assertChange(1, 1, 0, function() {
- this.slider("moveTo", -10);
-}))
-
-test("moveTo, relative positive value", assertChange(1, 1, 11, function() {
- this.slider("moveTo", "+=10");
-}))
-
-test("moveTo, relative positive value, above max", assertChange(1, 10, 1000, function() {
- this.slider("moveTo", "+=2000");
-}))
-
-test("moveTo, relative negative value", assertChange(1, 20, 10, function() {
- this.slider("moveTo", "-=10");
-}))
-
-test("options update min/max", function() {
- expect(2);
- var slider = $("#slider3").slider({
- stepping: 1,
- startValue: 1
- });
- slider.slider("moveTo", "-=10");
- equals(slider.slider("value"), 0);
- slider.data("min.slider", -10);
- slider.slider("moveTo", "-=20");
- equals(slider.slider("value"), -10);
-})
-
-module("slider: setup and teardown");
-
-test("destroy and recreate", function() {
- expect(3)
- var slider = $("#slider3").slider();
- slider.slider("moveTo", "+=20");
- equals(slider.slider("value"), 20);
- slider.slider("destroy");
-
- slider.slider("moveTo", "+=30");
- ok(true, "nothing happens after slider is destroyed");
-
- slider.slider().slider("moveTo", "30");
-
- equals(Math.round(slider.slider("value")), 30);
-})
-
-test("handle creation", function() {
- var slider = $("#slider1");
- equals(slider.children().size(), 0);
- slider.slider({
- handles: [
- { start: 0 },
- { start: 10 }
- ]
- });
- equals(slider.children().size(), 2);
- var instance = $.data(slider[0], "slider")
- equals(instance.handle.length, 2);
- ok(instance.handle.jquery, "handle must be a jquery object")
+$.fn.triggerKeydown = function(keyCode) { + return this.trigger("keydown", [$.event.fix({event:"keydown", keyCode: keyCode, target: this[0]})]); +} + +function assertChange(stepping, start, result, action) { + return function() { + expect(1); + var slider = $("#slider3").slider({ + stepping: stepping, + startValue: start, + min: 0, + max: 1000, + change: function(e, ui) { + equals(ui.value, result, "changed to " + ui.value); + } + }); + action.apply(slider); + } +} + +module("slider: single handle") + +test("change one step via keydown", assertChange(1, undefined, 1, function() { + this.find("a").triggerKeydown("39"); +})) +test("change - 10 steps via keydown", assertChange(10, 20, 10, function() { + this.find("a").triggerKeydown("37"); +})) +test("change +10 steps via keydown", assertChange(10, 20, 30, function() { + this.find("a").triggerKeydown("39"); +})) + +test("moveTo, absolute value", assertChange(1, 1, 10, function() { + this.slider("moveTo", 10); +})) + +test("moveTo, absolute value as string", assertChange(1, 1, 10, function() { + this.slider("moveTo", "10"); +})) + +test("moveTo, absolute value, below min", assertChange(1, 1, 0, function() { + this.slider("moveTo", -10); +})) + +test("moveTo, relative positive value", assertChange(1, 1, 11, function() { + this.slider("moveTo", "+=10"); +})) + +test("moveTo, relative positive value, above max", assertChange(1, 10, 1000, function() { + this.slider("moveTo", "+=2000"); +})) + +test("moveTo, relative negative value", assertChange(1, 20, 10, function() { + this.slider("moveTo", "-=10"); +})) + +test("options update min/max", function() { + expect(2); + var slider = $("#slider3").slider({ + stepping: 1, + startValue: 1 + }); + slider.slider("moveTo", "-=10"); + equals(slider.slider("value"), 0); + slider.data("min.slider", -10); + slider.slider("moveTo", "-=20"); + equals(slider.slider("value"), -10); +}) + +module("slider: setup and teardown"); + +test("destroy and recreate", function() { + expect(3) + var slider = $("#slider3").slider(); + slider.slider("moveTo", "+=20"); + equals(slider.slider("value"), 20); + slider.slider("destroy"); + + slider.slider("moveTo", "+=30"); + ok(true, "nothing happens after slider is destroyed"); + + slider.slider().slider("moveTo", "30"); + + equals(Math.round(slider.slider("value")), 30); +}) + +test("handle creation", function() { + var slider = $("#slider1"); + equals(slider.children().size(), 0); + slider.slider({ + handles: [ + { start: 0 }, + { start: 10 } + ] + }); + equals(slider.children().size(), 2); + var instance = $.data(slider[0], "slider") + equals(instance.handle.length, 2); + ok(instance.handle.jquery, "handle must be a jquery object") })
\ No newline at end of file diff --git a/ui/tests/ui.testmouse.js b/ui/tests/ui.testmouse.js index 5b73ab013..b42a1036d 100644 --- a/ui/tests/ui.testmouse.js +++ b/ui/tests/ui.testmouse.js @@ -1,171 +1,171 @@ -/*
- * jQuery UI testMouse
- *
- * Copyright (c) 2008 Richard D. Worth (rdworth.org)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * Revision: $Id: $
- */
-;(function($) {
-
- var mouseX = 0;
- var mouseY = 0;
-
- $(function() {
- $(document).mousemove(function(e) {
- if (e.isTrusted !== false) {
- mouseX = e.pageX;
- mouseY = e.pageY;
- }
- });
- });
-
- $.widget("ui.testMouse", {
- trackMouse: function() {},
- init: function() {
- },
- destroy: function() {
- },
- center: function(offset) {
- var o = this.element.offset();
- return {
- x: (o.left + (offset || [0, 0])[0] || 0) + this.element.width() / 2,
- y: (o.top + (offset || [0, 0])[1] || 0) + this.element.height() / 2
- };
- },
- dispatch: function(type, x, y, button, relatedTarget) {
- var evt, e = {bubbles: true, cancelable: (type != "mousemove"), view: window, detail: 0,
- screenX: 0, screenY: 0, clientX: x, clientY: y,
- ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
- button: button || 0, relatedTarget: relatedTarget, isTrusted: false};
- if ($.isFunction(document.createEvent)) {
- evt = document.createEvent("MouseEvents");
- if ($.isFunction(evt.initMouseEvent)) {
- evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail,
- e.screenX, e.screenY, e.clientX, e.clientY,
- e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
- e.button, e.relatedTarget);
- } else {
- evt = document.createEvent("UIEvents");
- evt.initEvent(type, bubbles, cancelable);
- $.extend(evt, e);
- }
- this.element[0].dispatchEvent(evt);
- } else if (document.createEventObject) {
- evt = document.createEventObject();
- $.extend(evt, e);
- evt.button = 1;
- this.element[0].fireEvent('on' + type, evt)
- }
- },
- down: function(x, y) {
- this.dispatch("mousedown", x, y);
- },
- move: function(x, y) {
- this.dispatch("mousemove", x, y);
- },
- up: function(x, y) {
- this.dispatch("mouseup", x, y);
- },
- drag: function(dx, dy) {
- var self = this;
-
- var center = this.center();
- this.left = center.x;
- this.top = center.y;
-
- var OS = (/(win|mac|linux)/i.exec(navigator.platform) || ['other'])[0].toLowerCase();
-
- var defaultUrl = ['cursors', OS == 'other' ? 'win' : OS, 'default.png'].join('/');
- var cursorUrl = function() {
- return ['cursors', OS == 'other' ? 'win' : OS, self.element.css('cursor') + '.png'].join('/');
- }
- var noneUrl = ['cursors', OS == 'other' ? 'win' : OS, 'none' + ($.browser.safari ? '.png' : '.cur')].join('/');
-
- var fakemouse = $('<img src="' + defaultUrl + '" />');
- var realmouse = $('<img src="' + defaultUrl + '" />');
- if ($.browser.msie && $.browser.version == 6) {
- fakemouse = $('<div style="height:32;width:32;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\');" ></div>');
- realmouse = $('<div><div style="height:32;width:32;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\');" ></div></div>');
- }
- var mousescreen = $('<div/>');
-
- var updateCursor = function() {
- if ($.browser.msie && $.browser.version == 6) {
- fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + cursorUrl() + '\', sizingMethod=\'scale\'');
- } else {
- fakemouse.attr('src', cursorUrl());
- }
- }
- var resetCursor = function() {
- if ($.browser.msie && $.browser.version == 6) {
- fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\'');
- } else {
- fakemouse.attr('src', defaultUrl);
- }
- }
-
- var testStart = function() {
- self.element.bind("mouseover", updateCursor).bind("mouseout", resetCursor);
- fakemouse.appendTo('body').css({ position: 'absolute', left: mouseX, top: mouseY, zIndex: 5000 });
- realmouse.appendTo('body').css({ position: 'absolute', left: mouseX, top: mouseY, zIndex: 5000, opacity: 0.1 });
- mousescreen.appendTo('body').css({ width: '100%', height: '100%', position: 'absolute', top: 0, left: 0, zIndex: 5000 })
- .mousemove(function(e) { realmouse.css({ left: e.pageX, top: e.pageY }); return false; })
- .mousedown(function() { return false; })
- .mouseup(function() { return false; });
- mousescreen.css('cursor', 'url(' + noneUrl + '), crosshair');
- ($.browser.opera && mousescreen.css('cursor', 'crosshair'));
- }
- var testStop = function() {
- self.element.unbind("mouseover", updateCursor).unbind("mouseout", resetCursor);
- mousescreen.remove();
- mouseX = realmouse.css("left");
- mouseY = realmouse.css("top");
- realmouse.remove();
- fakemouse.remove();
- self.options.complete.apply();
- }
-
- testStart();
-
- this.lastX = null;
-
- fakemouse
- .animate({ left: this.left, top: this.top }, this.options.speed, function() {
- self.element.triggerHandler('mouseover');
- self.down(self.left, self.top);
- self.move(self.left, self.top);
- })
- .animate({ left: this.left + dx, top: this.top + dy }, {
- speed: self.options.speed,
- easing: "swing",
- step: function (xory) {
- if (!self.lastX) {
- self.lastX = xory;
- } else {
- var x = self.lastX, y = xory;
- self.move(x, y);
- self.lastX = null;
- }
- },
- complete: function() {
- self.element.triggerHandler('mouseout');
- self.up(0, 0);
- $(this).animate({ left: realmouse.css("left"), top: realmouse.css("top") }, {
- speed: self.options.speed,
- complete: function() {
- testStop();
- }
- })
- }
- });
-
- }
- });
-
- $.ui.testMouse.defaults = {
- speed: "slow"
- }
-
-})(jQuery);
+/* + * jQuery UI testMouse + * + * Copyright (c) 2008 Richard D. Worth (rdworth.org) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * Revision: $Id: $ + */ +;(function($) { + + var mouseX = 0; + var mouseY = 0; + + $(function() { + $(document).mousemove(function(e) { + if (e.isTrusted !== false) { + mouseX = e.pageX; + mouseY = e.pageY; + } + }); + }); + + $.widget("ui.testMouse", { + trackMouse: function() {}, + init: function() { + }, + destroy: function() { + }, + center: function(offset) { + var o = this.element.offset(); + return { + x: (o.left + (offset || [0, 0])[0] || 0) + this.element.width() / 2, + y: (o.top + (offset || [0, 0])[1] || 0) + this.element.height() / 2 + }; + }, + dispatch: function(type, x, y, button, relatedTarget) { + var evt, e = {bubbles: true, cancelable: (type != "mousemove"), view: window, detail: 0, + screenX: 0, screenY: 0, clientX: x, clientY: y, + ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, + button: button || 0, relatedTarget: relatedTarget, isTrusted: false}; + if ($.isFunction(document.createEvent)) { + evt = document.createEvent("MouseEvents"); + if ($.isFunction(evt.initMouseEvent)) { + evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail, + e.screenX, e.screenY, e.clientX, e.clientY, + e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, + e.button, e.relatedTarget); + } else { + evt = document.createEvent("UIEvents"); + evt.initEvent(type, bubbles, cancelable); + $.extend(evt, e); + } + this.element[0].dispatchEvent(evt); + } else if (document.createEventObject) { + evt = document.createEventObject(); + $.extend(evt, e); + evt.button = 1; + this.element[0].fireEvent('on' + type, evt) + } + }, + down: function(x, y) { + this.dispatch("mousedown", x, y); + }, + move: function(x, y) { + this.dispatch("mousemove", x, y); + }, + up: function(x, y) { + this.dispatch("mouseup", x, y); + }, + drag: function(dx, dy) { + var self = this; + + var center = this.center(); + this.left = center.x; + this.top = center.y; + + var OS = (/(win|mac|linux)/i.exec(navigator.platform) || ['other'])[0].toLowerCase(); + + var defaultUrl = ['cursors', OS == 'other' ? 'win' : OS, 'default.png'].join('/'); + var cursorUrl = function() { + return ['cursors', OS == 'other' ? 'win' : OS, self.element.css('cursor') + '.png'].join('/'); + } + var noneUrl = ['cursors', OS == 'other' ? 'win' : OS, 'none' + ($.browser.safari ? '.png' : '.cur')].join('/'); + + var fakemouse = $('<img src="' + defaultUrl + '" />'); + var realmouse = $('<img src="' + defaultUrl + '" />'); + if ($.browser.msie && $.browser.version == 6) { + fakemouse = $('<div style="height:32;width:32;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\');" ></div>'); + realmouse = $('<div><div style="height:32;width:32;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\');" ></div></div>'); + } + var mousescreen = $('<div/>'); + + var updateCursor = function() { + if ($.browser.msie && $.browser.version == 6) { + fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + cursorUrl() + '\', sizingMethod=\'scale\''); + } else { + fakemouse.attr('src', cursorUrl()); + } + } + var resetCursor = function() { + if ($.browser.msie && $.browser.version == 6) { + fakemouse.css('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + defaultUrl + '\', sizingMethod=\'scale\''); + } else { + fakemouse.attr('src', defaultUrl); + } + } + + var testStart = function() { + self.element.bind("mouseover", updateCursor).bind("mouseout", resetCursor); + fakemouse.appendTo('body').css({ position: 'absolute', left: mouseX, top: mouseY, zIndex: 5000 }); + realmouse.appendTo('body').css({ position: 'absolute', left: mouseX, top: mouseY, zIndex: 5000, opacity: 0.1 }); + mousescreen.appendTo('body').css({ width: '100%', height: '100%', position: 'absolute', top: 0, left: 0, zIndex: 5000 }) + .mousemove(function(e) { realmouse.css({ left: e.pageX, top: e.pageY }); return false; }) + .mousedown(function() { return false; }) + .mouseup(function() { return false; }); + mousescreen.css('cursor', 'url(' + noneUrl + '), crosshair'); + ($.browser.opera && mousescreen.css('cursor', 'crosshair')); + } + var testStop = function() { + self.element.unbind("mouseover", updateCursor).unbind("mouseout", resetCursor); + mousescreen.remove(); + mouseX = realmouse.css("left"); + mouseY = realmouse.css("top"); + realmouse.remove(); + fakemouse.remove(); + self.options.complete.apply(); + } + + testStart(); + + this.lastX = null; + + fakemouse + .animate({ left: this.left, top: this.top }, this.options.speed, function() { + self.element.triggerHandler('mouseover'); + self.down(self.left, self.top); + self.move(self.left, self.top); + }) + .animate({ left: this.left + dx, top: this.top + dy }, { + speed: self.options.speed, + easing: "swing", + step: function (xory) { + if (!self.lastX) { + self.lastX = xory; + } else { + var x = self.lastX, y = xory; + self.move(x, y); + self.lastX = null; + } + }, + complete: function() { + self.element.triggerHandler('mouseout'); + self.up(0, 0); + $(this).animate({ left: realmouse.css("left"), top: realmouse.css("top") }, { + speed: self.options.speed, + complete: function() { + testStop(); + } + }) + } + }); + + } + }); + + $.ui.testMouse.defaults = { + speed: "slow" + } + +})(jQuery); diff --git a/ui/themes/flora/flora.accordion.css b/ui/themes/flora/flora.accordion.css index 7037c05ea..3f23a806e 100644 --- a/ui/themes/flora/flora.accordion.css +++ b/ui/themes/flora/flora.accordion.css @@ -1,39 +1,39 @@ -.ui-accordion { margin: 0; padding: 0; list-style-type: none; }
-.ui-accordion li { margin: 0; margin-bottom: 2px; padding: 0; }
-.ui-accordion li .ui-accordion-header {
- display: block;
- padding-left: 5px;
- margin-right: 3px;
- height: 28px;
- background-image: url(i/accordion-middle.png);
- color: #000;
- text-decoration: none;
- line-height: 28px;
- position: relative;
- left: 3px;
-}
-.ui-accordion li .ui-accordion-right {
- display: block;
- background-image: url(i/accordion-right.png);
- position: absolute;
- top: 0px;
- right: -3px;
- height: 28px;
- width: 3px;
-}
-.ui-accordion li .ui-accordion-left {
- display: block;
- background-image: url(i/accordion-left.png);
- background-repeat: no-repeat;
- position: absolute;
- height: 28px;
- width: 3px;
-}
-
-.ui-accordion li:hover .ui-accordion-left { background-image: url(i/accordion-left-over.png); }
-.ui-accordion li:hover .ui-accordion-header { background-image: url(i/accordion-middle-over.png); }
-.ui-accordion li:hover .ui-accordion-right { background-image: url(i/accordion-right-over.png); }
-
-.ui-accordion li.selected .ui-accordion-left { background-image: url(i/accordion-left-act.png); }
-.ui-accordion li.selected .ui-accordion-header { background-image: url(i/accordion-middle-act.png); }
-.ui-accordion li.selected .ui-accordion-right { background-image: url(i/accordion-right-act.png); }
+.ui-accordion { margin: 0; padding: 0; list-style-type: none; } +.ui-accordion li { margin: 0; margin-bottom: 2px; padding: 0; } +.ui-accordion li .ui-accordion-header { + display: block; + padding-left: 5px; + margin-right: 3px; + height: 28px; + background-image: url(i/accordion-middle.png); + color: #000; + text-decoration: none; + line-height: 28px; + position: relative; + left: 3px; +} +.ui-accordion li .ui-accordion-right { + display: block; + background-image: url(i/accordion-right.png); + position: absolute; + top: 0px; + right: -3px; + height: 28px; + width: 3px; +} +.ui-accordion li .ui-accordion-left { + display: block; + background-image: url(i/accordion-left.png); + background-repeat: no-repeat; + position: absolute; + height: 28px; + width: 3px; +} + +.ui-accordion li:hover .ui-accordion-left { background-image: url(i/accordion-left-over.png); } +.ui-accordion li:hover .ui-accordion-header { background-image: url(i/accordion-middle-over.png); } +.ui-accordion li:hover .ui-accordion-right { background-image: url(i/accordion-right-over.png); } + +.ui-accordion li.selected .ui-accordion-left { background-image: url(i/accordion-left-act.png); } +.ui-accordion li.selected .ui-accordion-header { background-image: url(i/accordion-middle-act.png); } +.ui-accordion li.selected .ui-accordion-right { background-image: url(i/accordion-right-act.png); } diff --git a/ui/themes/flora/flora.all.css b/ui/themes/flora/flora.all.css index 2f8d7fbbc..5a63cf190 100644 --- a/ui/themes/flora/flora.all.css +++ b/ui/themes/flora/flora.all.css @@ -1,7 +1,7 @@ -@import "flora.css";
-@import "flora.accordion.css";
-@import "flora.datepicker.css";
-@import "flora.dialog.css";
-@import "flora.resizable.css";
-@import "flora.slider.css";
-@import "flora.tabs.css";
+@import "flora.css"; +@import "flora.accordion.css"; +@import "flora.datepicker.css"; +@import "flora.dialog.css"; +@import "flora.resizable.css"; +@import "flora.slider.css"; +@import "flora.tabs.css"; diff --git a/ui/themes/flora/flora.css b/ui/themes/flora/flora.css index 761217d93..f67bb3f8c 100644 --- a/ui/themes/flora/flora.css +++ b/ui/themes/flora/flora.css @@ -1,2 +1,2 @@ -.ui-wrapper { border: 1px solid #50A029; }
+.ui-wrapper { border: 1px solid #50A029; } .ui-wrapper input, .ui-wrapper textarea { border: 0; }
\ No newline at end of file diff --git a/ui/themes/flora/flora.dialog.css b/ui/themes/flora/flora.dialog.css index efef1c4ba..10d1b63b6 100644 --- a/ui/themes/flora/flora.dialog.css +++ b/ui/themes/flora/flora.dialog.css @@ -1,95 +1,95 @@ -/* This file skins dialog */
-
-.flora .ui-dialog,
-.flora.ui-dialog {
- background-color: #e6f7d4;
-}
-
-.flora .ui-dialog .ui-dialog-titlebar,
-.flora.ui-dialog .ui-dialog-titlebar {
- border-bottom: 1px solid #d8d2aa;
- background: #ff9900 url(i/dialog-title.gif) repeat-x;
- padding: 0px;
- height: 28px;
- _height: 29px;
-}
-
-.flora .ui-dialog.ui-draggable .ui-dialog-titlebar,
-.flora.ui-dialog.ui-draggable .ui-dialog-titlebar {
- cursor: move;
-}
-
-.flora .ui-dialog .ui-dialog-titlebar-close,
-.flora.ui-dialog .ui-dialog-titlebar-close {
- width: 16px;
- height: 16px;
- background: url(i/dialog-titlebar-close.png) no-repeat;
- position:absolute;
- top: 6px;
- right: 7px;
- cursor: default;
-}
-
-.flora .ui-dialog .ui-dialog-titlebar-close span,
-.flora.ui-dialog .ui-dialog-titlebar-close span {
- display: none;
-}
-
-.flora .ui-dialog .ui-dialog-titlebar-close-hover,
-.flora.ui-dialog .ui-dialog-titlebar-close-hover {
- background: url(i/dialog-titlebar-close-hover.png) no-repeat;
-}
-
-.flora .ui-dialog .ui-dialog-title,
-.flora.ui-dialog .ui-dialog-title {
- margin-left: 5px;
- color: white;
- font-weight: bold;
- position: relative;
- top: 7px;
- left: 4px;
-}
-
-.flora .ui-dialog .ui-dialog-content,
-.flora.ui-dialog .ui-dialog-content {
- margin: 1.2em;
-}
-
-.flora .ui-dialog .ui-dialog-buttonpane,
-.flora.ui-dialog .ui-dialog-buttonpane {
- position: absolute;
- bottom: 8px;
- right: 12px;
- width: 100%;
- text-align: right;
-}
-
-.flora .ui-dialog .ui-dialog-buttonpane button,
-.flora.ui-dialog .ui-dialog-buttonpane button {
- margin: 6px;
-}
-
-/* Dialog handle styles */
-.flora .ui-dialog .ui-resizable-n,
-.flora.ui-dialog .ui-resizable-n { cursor: n-resize; height: 6px; width: 100%; top: 0px; left: 0px; background: transparent url(i/dialog-n.gif) repeat scroll center top; }
-
-.flora .ui-dialog .ui-resizable-s,
-.flora.ui-dialog .ui-resizable-s { cursor: s-resize; height: 8px; width: 100%; bottom: 0px; left: 0px; background: transparent url(i/dialog-s.gif) repeat scroll center top; }
-
-.flora .ui-dialog .ui-resizable-e,
-.flora.ui-dialog .ui-resizable-e { cursor: e-resize; width: 7px; right: 0px; top: 0px; height: 100%; background: transparent url(i/dialog-e.gif) repeat scroll right center; }
-
-.flora .ui-dialog .ui-resizable-w,
-.flora.ui-dialog .ui-resizable-w { cursor: w-resize; width: 7px; left: 0px; top: 0px; height: 100%; background: transparent url(i/dialog-w.gif) repeat scroll right center; }
-
-.flora .ui-dialog .ui-resizable-se,
-.flora.ui-dialog .ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: transparent url(i/dialog-se.gif); }
-
-.flora .ui-dialog .ui-resizable-sw,
-.flora.ui-dialog .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: transparent url(i/dialog-sw.gif); }
-
-.flora .ui-dialog .ui-resizable-nw,
-.flora.ui-dialog .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 29px; left: 0px; top: 0px; background: transparent url(i/dialog-nw.gif); }
-
-.flora .ui-dialog .ui-resizable-ne,
-.flora.ui-dialog .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 29px; right: 0px; top: 0px; background: transparent url(i/dialog-ne.gif); }
+/* This file skins dialog */ + +.flora .ui-dialog, +.flora.ui-dialog { + background-color: #e6f7d4; +} + +.flora .ui-dialog .ui-dialog-titlebar, +.flora.ui-dialog .ui-dialog-titlebar { + border-bottom: 1px solid #d8d2aa; + background: #ff9900 url(i/dialog-title.gif) repeat-x; + padding: 0px; + height: 28px; + _height: 29px; +} + +.flora .ui-dialog.ui-draggable .ui-dialog-titlebar, +.flora.ui-dialog.ui-draggable .ui-dialog-titlebar { + cursor: move; +} + +.flora .ui-dialog .ui-dialog-titlebar-close, +.flora.ui-dialog .ui-dialog-titlebar-close { + width: 16px; + height: 16px; + background: url(i/dialog-titlebar-close.png) no-repeat; + position:absolute; + top: 6px; + right: 7px; + cursor: default; +} + +.flora .ui-dialog .ui-dialog-titlebar-close span, +.flora.ui-dialog .ui-dialog-titlebar-close span { + display: none; +} + +.flora .ui-dialog .ui-dialog-titlebar-close-hover, +.flora.ui-dialog .ui-dialog-titlebar-close-hover { + background: url(i/dialog-titlebar-close-hover.png) no-repeat; +} + +.flora .ui-dialog .ui-dialog-title, +.flora.ui-dialog .ui-dialog-title { + margin-left: 5px; + color: white; + font-weight: bold; + position: relative; + top: 7px; + left: 4px; +} + +.flora .ui-dialog .ui-dialog-content, +.flora.ui-dialog .ui-dialog-content { + margin: 1.2em; +} + +.flora .ui-dialog .ui-dialog-buttonpane, +.flora.ui-dialog .ui-dialog-buttonpane { + position: absolute; + bottom: 8px; + right: 12px; + width: 100%; + text-align: right; +} + +.flora .ui-dialog .ui-dialog-buttonpane button, +.flora.ui-dialog .ui-dialog-buttonpane button { + margin: 6px; +} + +/* Dialog handle styles */ +.flora .ui-dialog .ui-resizable-n, +.flora.ui-dialog .ui-resizable-n { cursor: n-resize; height: 6px; width: 100%; top: 0px; left: 0px; background: transparent url(i/dialog-n.gif) repeat scroll center top; } + +.flora .ui-dialog .ui-resizable-s, +.flora.ui-dialog .ui-resizable-s { cursor: s-resize; height: 8px; width: 100%; bottom: 0px; left: 0px; background: transparent url(i/dialog-s.gif) repeat scroll center top; } + +.flora .ui-dialog .ui-resizable-e, +.flora.ui-dialog .ui-resizable-e { cursor: e-resize; width: 7px; right: 0px; top: 0px; height: 100%; background: transparent url(i/dialog-e.gif) repeat scroll right center; } + +.flora .ui-dialog .ui-resizable-w, +.flora.ui-dialog .ui-resizable-w { cursor: w-resize; width: 7px; left: 0px; top: 0px; height: 100%; background: transparent url(i/dialog-w.gif) repeat scroll right center; } + +.flora .ui-dialog .ui-resizable-se, +.flora.ui-dialog .ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: transparent url(i/dialog-se.gif); } + +.flora .ui-dialog .ui-resizable-sw, +.flora.ui-dialog .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: transparent url(i/dialog-sw.gif); } + +.flora .ui-dialog .ui-resizable-nw, +.flora.ui-dialog .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 29px; left: 0px; top: 0px; background: transparent url(i/dialog-nw.gif); } + +.flora .ui-dialog .ui-resizable-ne, +.flora.ui-dialog .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 29px; right: 0px; top: 0px; background: transparent url(i/dialog-ne.gif); } diff --git a/ui/themes/flora/flora.resizable.css b/ui/themes/flora/flora.resizable.css index 5e30c0c2c..9c9a5433d 100644 --- a/ui/themes/flora/flora.resizable.css +++ b/ui/themes/flora/flora.resizable.css @@ -1,20 +1,20 @@ -/* This file skins resizables */
-
-.ui-resizable { position: relative; }
-
-/* Global handle styles */
-.ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; }
-.ui-resizable .ui-resizable-handle { display: block; }
-body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
-body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
-
-.ui-resizable-n { cursor: n-resize; height: 6px; width: 100%; top: 0px; left: 0px; background: transparent url(i/resizable-n.gif) repeat scroll center top; }
-.ui-resizable-s { cursor: s-resize; height: 6px; width: 100%; bottom: 0px; left: 0px; background: transparent url(i/resizable-s.gif) repeat scroll center top; }
-
-.ui-resizable-e { cursor: e-resize; width: 6px; right: 0px; top: 0px; height: 100%; background: transparent url(i/resizable-e.gif) repeat scroll right center; }
-.ui-resizable-w { cursor: w-resize; width: 6px; left: 0px; top: 0px; height: 100%; background: transparent url(i/resizable-w.gif) repeat scroll right center; }
-
-.ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: transparent url(i/resizable-se.gif); }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: transparent url(i/resizable-sw.gif); }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: 0px; top: 0px; background: transparent url(i/resizable-nw.gif); }
+/* This file skins resizables */ + +.ui-resizable { position: relative; } + +/* Global handle styles */ +.ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; } +.ui-resizable .ui-resizable-handle { display: block; } +body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ +body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ + +.ui-resizable-n { cursor: n-resize; height: 6px; width: 100%; top: 0px; left: 0px; background: transparent url(i/resizable-n.gif) repeat scroll center top; } +.ui-resizable-s { cursor: s-resize; height: 6px; width: 100%; bottom: 0px; left: 0px; background: transparent url(i/resizable-s.gif) repeat scroll center top; } + +.ui-resizable-e { cursor: e-resize; width: 6px; right: 0px; top: 0px; height: 100%; background: transparent url(i/resizable-e.gif) repeat scroll right center; } +.ui-resizable-w { cursor: w-resize; width: 6px; left: 0px; top: 0px; height: 100%; background: transparent url(i/resizable-w.gif) repeat scroll right center; } + +.ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: transparent url(i/resizable-se.gif); } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: transparent url(i/resizable-sw.gif); } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: 0px; top: 0px; background: transparent url(i/resizable-nw.gif); } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: 0px; top: 0px; background: transparent url(i/resizable-ne.gif); }
\ No newline at end of file diff --git a/ui/themes/flora/flora.slider.css b/ui/themes/flora/flora.slider.css index 94827b3c4..4e9ca8069 100644 --- a/ui/themes/flora/flora.slider.css +++ b/ui/themes/flora/flora.slider.css @@ -1,11 +1,11 @@ -/* This file skins sliders */
-
-.ui-slider { width: 200px; height: 23px; position: relative; background-repeat: no-repeat; background-position: center center; }
-.ui-slider-handle { position: absolute; z-index: 1; height: 23px; width: 12px; top: 0px; left: 0px; background-image: url(i/slider-handle.gif); }
-.ui-slider-handle-active { border: 1px dotted black; }
-.ui-slider-disabled .ui-slider-handle { opacity: 0.5; filter: alpha(opacity=50); }
-.ui-slider-range { position: absolute; background: #50A029; opacity: 0.3; filter: alpha(opacity=30); width: 100%; height: 100%; }
+/* This file skins sliders */ -/* Default slider backgrounds */
-.ui-slider, .ui-slider-1 { background-image: url(i/slider-bg-1.png); }
-.ui-slider-2 { background-image: url(i/slider-bg-2.png); }
\ No newline at end of file +.ui-slider { width: 200px; height: 23px; position: relative; background-repeat: no-repeat; background-position: center center; } +.ui-slider-handle { position: absolute; z-index: 1; height: 23px; width: 12px; top: 0px; left: 0px; background-image: url(i/slider-handle.gif); } +.ui-slider-handle-active { border: 1px dotted black; } +.ui-slider-disabled .ui-slider-handle { opacity: 0.5; filter: alpha(opacity=50); } +.ui-slider-range { position: absolute; background: #50A029; opacity: 0.3; filter: alpha(opacity=30); width: 100%; height: 100%; } + +/* Default slider backgrounds */ +.ui-slider, .ui-slider-1 { background-image: url(i/slider-bg-1.png); } +.ui-slider-2 { background-image: url(i/slider-bg-2.png); } diff --git a/ui/themes/ui.datepicker.css b/ui/themes/ui.datepicker.css index bbda236eb..c2b90abfa 100644 --- a/ui/themes/ui.datepicker.css +++ b/ui/themes/ui.datepicker.css @@ -1,207 +1,207 @@ -/* Main Style Sheet for jQuery UI date picker */
-#ui-datepicker-div, .ui-datepicker-inline {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- padding: 0;
- margin: 0;
- background: #ddd;
- width: 185px;
-}
-#ui-datepicker-div {
- display: none;
- border: 1px solid #777;
- z-index: 9999; /*must have*/
-}
-.ui-datepicker-inline {
- float: left;
- display: block;
- border: 0;
-}
-.ui-datepicker-rtl {
- direction: rtl;
-}
-.ui-datepicker-dialog {
- padding: 5px !important;
- border: 4px ridge #ddd !important;
-}
-button.ui-datepicker-trigger {
- width: 25px;
-}
-img.ui-datepicker-trigger {
- margin: 2px;
- vertical-align: middle;
-}
-.ui-datepicker-prompt {
- float: left;
- padding: 2px;
- background: #ddd;
- color: #000;
-}
-* html .ui-datepicker-prompt {
- width: 185px;
-}
-.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker {
- clear: both;
- float: left;
- width: 100%;
- color: #fff;
-}
-.ui-datepicker-control {
- background: #400;
- padding: 2px 0px;
-}
-.ui-datepicker-links {
- background: #000;
- padding: 2px 0px;
-}
-.ui-datepicker-control, .ui-datepicker-links {
- font-weight: bold;
- font-size: 80%;
-}
-.ui-datepicker-links label { /* disabled links */
- padding: 2px 5px;
- color: #888;
-}
-.ui-datepicker-clear, .ui-datepicker-prev {
- float: left;
- width: 34%;
-}
-.ui-datepicker-rtl .ui-datepicker-clear, .ui-datepicker-rtl .ui-datepicker-prev {
- float: right;
- text-align: right;
-}
-.ui-datepicker-current {
- float: left;
- width: 30%;
- text-align: center;
-}
-.ui-datepicker-close, .ui-datepicker-next {
- float: right;
- width: 34%;
- text-align: right;
-}
-.ui-datepicker-rtl .ui-datepicker-close, .ui-datepicker-rtl .ui-datepicker-next {
- float: left;
- text-align: left;
-}
-.ui-datepicker-header {
- padding: 1px 0 3px;
- background: #333;
- text-align: center;
- font-weight: bold;
- height: 1.3em;
-}
-.ui-datepicker-header select {
- background: #333;
- color: #fff;
- border: 0px;
- font-weight: bold;
-}
-.ui-datepicker {
- background: #ccc;
- text-align: center;
- font-size: 100%;
-}
-.ui-datepicker a {
- display: block;
- width: 100%;
-}
-.ui-datepicker-titleRow {
- background: #777;
-}
-.ui-datepicker-daysRow {
- background: #eee;
- color: #666;
-}
-.ui-datepicker-weekCol {
- background: #777;
- color: #fff;
-}
-.ui-datepicker-daysCell {
- color: #000;
- border: 1px solid #ddd;
-}
-.ui-datepicker-daysCell a{
- display: block;
-}
-.ui-datepicker-weekEndCell {
- background: #ddd;
-}
-.ui-datepicker-titleRow .ui-datepicker-weekEndCell {
- background: #777;
-}
-.ui-datepicker-daysCellOver {
- background: #fff;
- border: 1px solid #777;
-}
-.ui-datepicker-unselectable {
- color: #888;
-}
-.ui-datepicker-today {
- background: #fcc !important;
-}
-.ui-datepicker-currentDay {
- background: #999 !important;
-}
-.ui-datepicker-status {
- background: #ddd;
- width: 100%;
- font-size: 80%;
- text-align: center;
-}
-
-/* ________ Datepicker Links _______
-
-** Reset link properties and then override them with !important */
-#ui-datepicker-div a, .ui-datepicker-inline a {
- cursor: pointer;
- margin: 0;
- padding: 0;
- background: none;
- color: #000;
-}
-.ui-datepicker-inline .ui-datepicker-links a {
- padding: 0 5px !important;
-}
-.ui-datepicker-control a, .ui-datepicker-links a {
- padding: 2px 5px !important;
- color: #eee !important;
-}
-.ui-datepicker-titleRow a {
- color: #eee !important;
-}
-.ui-datepicker-control a:hover {
- background: #fdd !important;
- color: #333 !important;
-}
-.ui-datepicker-links a:hover, .ui-datepicker-titleRow a:hover {
- background: #ddd !important;
- color: #333 !important;
-}
-
-/* ___________ MULTIPLE MONTHS _________*/
-
-.ui-datepicker-multi .ui-datepicker {
- border: 1px solid #777;
-}
-.ui-datepicker-oneMonth {
- float: left;
- width: 185px;
-}
-.ui-datepicker-newRow {
- clear: left;
-}
-
-/* ___________ IE6 IFRAME FIX ________ */
-
-.ui-datepicker-cover {
- display: none; /*sorry for IE5*/
- display/**/: block; /*sorry for IE5*/
- position: absolute; /*must have*/
- z-index: -1; /*must have*/
- filter: mask(); /*must have*/
- top: -4px; /*must have*/
- left: -4px; /*must have*/
- width: 200px; /*must have*/
- height: 200px; /*must have*/
+/* Main Style Sheet for jQuery UI date picker */ +#ui-datepicker-div, .ui-datepicker-inline { + font-family: Arial, Helvetica, sans-serif; + font-size: 14px; + padding: 0; + margin: 0; + background: #ddd; + width: 185px; +} +#ui-datepicker-div { + display: none; + border: 1px solid #777; + z-index: 9999; /*must have*/ +} +.ui-datepicker-inline { + float: left; + display: block; + border: 0; +} +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-dialog { + padding: 5px !important; + border: 4px ridge #ddd !important; +} +button.ui-datepicker-trigger { + width: 25px; +} +img.ui-datepicker-trigger { + margin: 2px; + vertical-align: middle; +} +.ui-datepicker-prompt { + float: left; + padding: 2px; + background: #ddd; + color: #000; +} +* html .ui-datepicker-prompt { + width: 185px; +} +.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker { + clear: both; + float: left; + width: 100%; + color: #fff; +} +.ui-datepicker-control { + background: #400; + padding: 2px 0px; +} +.ui-datepicker-links { + background: #000; + padding: 2px 0px; +} +.ui-datepicker-control, .ui-datepicker-links { + font-weight: bold; + font-size: 80%; +} +.ui-datepicker-links label { /* disabled links */ + padding: 2px 5px; + color: #888; +} +.ui-datepicker-clear, .ui-datepicker-prev { + float: left; + width: 34%; +} +.ui-datepicker-rtl .ui-datepicker-clear, .ui-datepicker-rtl .ui-datepicker-prev { + float: right; + text-align: right; +} +.ui-datepicker-current { + float: left; + width: 30%; + text-align: center; +} +.ui-datepicker-close, .ui-datepicker-next { + float: right; + width: 34%; + text-align: right; +} +.ui-datepicker-rtl .ui-datepicker-close, .ui-datepicker-rtl .ui-datepicker-next { + float: left; + text-align: left; +} +.ui-datepicker-header { + padding: 1px 0 3px; + background: #333; + text-align: center; + font-weight: bold; + height: 1.3em; +} +.ui-datepicker-header select { + background: #333; + color: #fff; + border: 0px; + font-weight: bold; +} +.ui-datepicker { + background: #ccc; + text-align: center; + font-size: 100%; +} +.ui-datepicker a { + display: block; + width: 100%; +} +.ui-datepicker-titleRow { + background: #777; +} +.ui-datepicker-daysRow { + background: #eee; + color: #666; +} +.ui-datepicker-weekCol { + background: #777; + color: #fff; +} +.ui-datepicker-daysCell { + color: #000; + border: 1px solid #ddd; +} +.ui-datepicker-daysCell a{ + display: block; +} +.ui-datepicker-weekEndCell { + background: #ddd; +} +.ui-datepicker-titleRow .ui-datepicker-weekEndCell { + background: #777; +} +.ui-datepicker-daysCellOver { + background: #fff; + border: 1px solid #777; +} +.ui-datepicker-unselectable { + color: #888; +} +.ui-datepicker-today { + background: #fcc !important; +} +.ui-datepicker-currentDay { + background: #999 !important; +} +.ui-datepicker-status { + background: #ddd; + width: 100%; + font-size: 80%; + text-align: center; +} + +/* ________ Datepicker Links _______ + +** Reset link properties and then override them with !important */ +#ui-datepicker-div a, .ui-datepicker-inline a { + cursor: pointer; + margin: 0; + padding: 0; + background: none; + color: #000; +} +.ui-datepicker-inline .ui-datepicker-links a { + padding: 0 5px !important; +} +.ui-datepicker-control a, .ui-datepicker-links a { + padding: 2px 5px !important; + color: #eee !important; +} +.ui-datepicker-titleRow a { + color: #eee !important; +} +.ui-datepicker-control a:hover { + background: #fdd !important; + color: #333 !important; +} +.ui-datepicker-links a:hover, .ui-datepicker-titleRow a:hover { + background: #ddd !important; + color: #333 !important; +} + +/* ___________ MULTIPLE MONTHS _________*/ + +.ui-datepicker-multi .ui-datepicker { + border: 1px solid #777; +} +.ui-datepicker-oneMonth { + float: left; + width: 185px; +} +.ui-datepicker-newRow { + clear: left; +} + +/* ___________ IE6 IFRAME FIX ________ */ + +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ }
\ No newline at end of file |