diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/css/style.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/css/style.css index 44918a15f61fd95c527c8138811b674475970c06..ff2a4a0a367c67be9b95e547a13466f51252ac44 100644 --- a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/css/style.css +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/css/style.css @@ -151,6 +151,14 @@ body, h1, h2 { margin: 10px auto !important; } +/* + * Tree View + */ +.dynatree-container { + background-color: none !important; + border: none !important; +} + /* * General Layout */ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/Gruntfile.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/Gruntfile.js new file mode 100644 index 0000000000000000000000000000000000000000..3a2407244d0bdd89c7c04074bea438bda503bdde --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/Gruntfile.js @@ -0,0 +1,245 @@ +/*jshint node:true */ + +module.exports = function(grunt) { + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + // Project metadata, used by the <banner> directive. + meta: { + banner: "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " + + "<%= grunt.template.today('yyyy-mm-dd') %>\n" + + "<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" + + "* Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" + + " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */" + }, + clean: { + // archive: { + // noWrite: true, + // src: ["archive"] + // }, + build: { + noWrite: true, + src: ["build"] + }, + dist: { + noWrite: true, + src: ["dist"] + } + }, + compress: { + distToArchive: { + options: { + archive: "archive/<%= pkg.name %>-<%= pkg.version %>-dist.zip" + }, + files: [ + { + expand: true, + cwd: "dist/", + src: ["**/*"], + dest: "" + } + ] + }, + buildToArchive: { + options: { + archive: "archive/<%= pkg.name %>-<%= pkg.version %>-all.zip" + }, + files: [ + { + expand: true, + cwd: "build/", + src: ["**/*"], + dest: "" + } + ] + } + }, + concat: { + options: { + stripBanners: true + }, + srcToBuild: { + src: ["<banner:meta.banner>", + "src/<%= pkg.name %>.js" + ], + // dest: "build/<%= pkg.name %>-<%= pkg.version %>.js" + dest: "build/<%= pkg.name %>.js" + } + }, + connect: { + demo: { + options: { + port: 8080, + base: "./", + keepalive: true + } + } + }, + copy: { + // Copy the dist files (lib and css) from src/ to build/ + libToBuild: { + files: [{ + expand: true, + cwd: "src/", + src: ["skin**/*.{css,gif,png}", "*.txt"], + dest: "build/" + }, { + src: ["*.txt", "*.md"], + dest: "build/" + } + ] + }, + buildToDist: { + files: [{ + expand: true, + cwd: "build/", + src: "**", + dest: "dist/" + } ] + }, + // Copy everything (except for archive and build files) from src/ to build/ + srcToBuild: { + files: [{ + src: ["**/*", "!**/archive/**", "!**/build/**", "!**/node_modules/**"], + dest: "build/" + } + ] + } + }, + exec: { + tabfix: { + // Cleanup whitespace according to http://contribute.jquery.org/style-guide/js/ + // (requires https://github.com/mar10/tabfix) + // cmd: "tabfix -t --line=UNIX -r -m *.js,*.css,*.html,*json,*.yaml -i node_modules src doc -d" + cmd: "tabfix -t -r -m*.js,*.css,*.html,*.json -inode_modules src doc" + }, + upload: { + // FTP upload the demo files (requires https://github.com/mar10/pyftpsync) + cmd: "pyftpsync --progress upload . ftp://www.wwwendt.de/tech/dynatree --delete-unmatched --omit dist,node_modules,.*,_* -x" + } + }, + jshint: { + beforeConcat: ["Gruntfile.js", + "src/jquery.dynatree.js", + "tests/test-dynatree.js"], + afterConcat: ["<%= concat.srcToBuild.dest %>"], + options: { + // Enforcing Options: + bitwise: true, + curly: true, +// forin: true, + eqeqeq: true, + immed: true, + latedef: true, + newcap: true, + noarg: true, +// noempty: true, + nonew: true, +// plusplus: true, + regexp: true, +// strict: true, + sub: true, + undef: true, + // Relaxing Options: + eqnull: true, + laxbreak: true, +// laxcomma: true, + smarttabs: true, +// globalstrict: true, + // Environments: + browser: true, + globals: { + "define": false, + "jQuery": false + } + } + }, + qunit: { + // files: ["tests/unit/**/*.html"] + build: ["test/unit/test-core-build.html"], + develop: ["test/unit/test-core.html"] + }, + replace: { + build: { + src: ["build/*.js"], + overwrite: true, + replacements: [ + { + from: /version:\s*\"DEVELOPMENT\"/g, + // from: /version:\s*\"[0-9\.\-]+\"/g, + to: "version: \"<%= pkg.version %>\"" + }, { + from: /(@version:?\s*)(DEVELOPMENT)(\s*)/g, + to: "$1<%= pkg.version %>$3" + }, { + from: /(@date:?\s*)(DEVELOPMENT)(\s*)/g, + to: "$1<%= grunt.template.today('yyyy-mm-dd\"T\"HH:MM') %>$3" + }, { + from: /buildType:\s*\"[a-zA-Z]+\"/g, + to: "buildType: \"release\"" + }, { + from: /debugLevel:\s*[0-9]/g, + to: "debugLevel: 1" + } + ] + } + }, + uglify: { + build: { + options: { + banner: "<%= meta.banner %>" + }, + files: { + "build/<%= pkg.name %>.min.js": ["<%= concat.srcToBuild.dest %>"] + } + } + } + }); + grunt.loadNpmTasks("grunt-contrib-clean"); + grunt.loadNpmTasks("grunt-contrib-compress"); + grunt.loadNpmTasks("grunt-contrib-concat"); + grunt.loadNpmTasks("grunt-contrib-connect"); + grunt.loadNpmTasks("grunt-contrib-copy"); + grunt.loadNpmTasks("grunt-contrib-jshint"); + // grunt.loadNpmTasks("grunt-contrib-qunit"); + grunt.loadNpmTasks("grunt-contrib-uglify"); + grunt.loadNpmTasks("grunt-exec"); + grunt.loadNpmTasks("grunt-text-replace"); + + grunt.registerTask("server", ["connect:demo"]); + grunt.registerTask("test", [ + "jshint:beforeConcat" + // "qunit:develop" + ]); + // grunt.registerTask("travis", ["test"]); + grunt.registerTask("default", ["test"]); + grunt.registerTask("build", [ + // Cleanup source and run tests + "exec:tabfix", + "test", + // Copy compressed library to /dist/jquery.dynatree-1.2.3.zip + "clean:build", + "copy:libToBuild", + "concat:srcToBuild", + "replace:build", + "uglify:build", + "jshint:afterConcat", +// "qunit:build", + // The build folder now contains the tagged & minified (but uncompressed) + // library and css. Now copy that to /dist + "clean:dist", + "copy:buildToDist", + // Now copy everything (including dist/) to build/ + // and compress that to archive/ + "clean:build", + // "clean:temp", + "copy:srcToBuild", + "compress:buildToArchive", + "clean:build", + // The dist folder is compressed into a separate smaller zip + "compress:distToArchive" + ]); + // grunt.registerTask("release", ["checkrepo:beforeRelease", "build", "tagrelease", "bumpup:prerelease"]); + // grunt.registerTask("upload", ["build", "exec:upload"]); + grunt.registerTask("upload", ["test", "exec:upload"]); +}; diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/GPL-LICENSE.txt b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/GPL-LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..11dddd00ef0e91a0bce53b034d6b5b318a84e690 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/GPL-LICENSE.txt @@ -0,0 +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. diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/MIT-License.txt b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/MIT-License.txt new file mode 100644 index 0000000000000000000000000000000000000000..d70071be48003cc8a81c5936436b57359f14d141 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/MIT-License.txt @@ -0,0 +1,7 @@ +Copyright (c) 2006-2013 Martin Wendt (http://wwWendt.de) + +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. \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/jquery.dynatree.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/jquery.dynatree.js new file mode 100644 index 0000000000000000000000000000000000000000..08cf66d2aa79bbc22f7c6efa4c9c522d4cebe428 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/jquery.dynatree.js @@ -0,0 +1,3450 @@ +/*! **************************************************************************** + jquery.dynatree.js + Dynamic tree view control, with support for lazy loading of branches. + + Copyright (c) 2006-2013, Martin Wendt (http://wwWendt.de) + Dual licensed under the MIT or GPL Version 2 licenses. + http://code.google.com/p/dynatree/wiki/LicenseInfo + + A current version and some documentation is available at + http://dynatree.googlecode.com/ + + @version: 1.2.5-rc4 + @date: 2013-11-11T08:27 + + @depends: jquery.js + @depends: jquery.ui.core.js + @depends: jquery.cookie.js +*******************************************************************************/ + +/* jsHint options*/ +// Note: We currently allow eval() to parse the 'data' attribtes, when initializing from HTML. +// TODO: pass jsHint with the options given in grunt.js only. +// The following should not be required: +/*global alert */ +/*jshint nomen:false, smarttabs:true, eqeqeq:false, evil:true, regexp:false */ + +/************************************************************************* + * Debug functions + */ + +var _canLog = true; + +function _log(mode, msg) { + /** + * Usage: logMsg("%o was toggled", this); + */ + if( !_canLog ){ + return; + } + // Remove first argument + var args = Array.prototype.slice.apply(arguments, [1]); + // Prepend timestamp + var dt = new Date(); + var tag = dt.getHours() + ":" + dt.getMinutes() + ":" + + dt.getSeconds() + "." + dt.getMilliseconds(); + args[0] = tag + " - " + args[0]; + + try { + switch( mode ) { + case "info": + window.console.info.apply(window.console, args); + break; + case "warn": + window.console.warn.apply(window.console, args); + break; + default: + window.console.log.apply(window.console, args); + break; + } + } catch(e) { + if( !window.console ){ + _canLog = false; // Permanently disable, when logging is not supported by the browser + }else if(e.number === -2146827850){ + // fix for IE8, where window.console.log() exists, but does not support .apply() + window.console.log(args.join(", ")); + } + } +} + + +function logMsg(msg) { + Array.prototype.unshift.apply(arguments, ["debug"]); + _log.apply(this, arguments); +} + + +// Forward declaration +var getDynaTreePersistData = null; + + + +/************************************************************************* + * Constants + */ +var DTNodeStatus_Error = -1; +var DTNodeStatus_Loading = 1; +var DTNodeStatus_Ok = 0; + + +// Start of local namespace +(function($) { + +/************************************************************************* + * Common tool functions. + */ + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + }; + } +}; + +// Tool function to get dtnode from the event target: +function getDtNodeFromElement(el) { + alert("getDtNodeFromElement is deprecated"); + return $.ui.dynatree.getNode(el); +/* + var iMax = 5; + while( el && iMax-- ) { + if(el.dtnode) { return el.dtnode; } + el = el.parentNode; + } + return null; +*/ +} + +function noop() { +} + + +/* Convert number to string and prepend +/-; return empty string for 0.*/ +function offsetString(n){ + return n === 0 ? "" : (( n > 0 ) ? ("+" + n) : ("" + n)); +} + + +/* Check browser version, since $.browser was removed in jQuery 1.9 */ +function _checkBrowser(){ + var matched, browser; + function uaMatch( ua ) { + ua = ua.toLowerCase(); + var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || + /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || + []; + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + } + matched = uaMatch( navigator.userAgent ); + browser = {}; + if ( matched.browser ) { + browser[ matched.browser ] = true; + browser.version = matched.version; + } + if ( browser.chrome ) { + browser.webkit = true; + } else if ( browser.webkit ) { + browser.safari = true; + } + return browser; +} + + +/** Compare two dotted version strings (like '10.2.3'). + * @returns {Integer} 0: v1 == v2, -1: v1 < v2, 1: v1 > v2 + */ +function versionCompare(v1, v2) { + var v1parts = ("" + v1).split("."), + v2parts = ("" + v2).split("."), + minLength = Math.min(v1parts.length, v2parts.length), + p1, p2, i; + // Compare tuple pair-by-pair. + for(i = 0; i < minLength; i++) { + // Convert to integer if possible, because "8" > "10". + p1 = parseInt(v1parts[i], 10); + p2 = parseInt(v2parts[i], 10); + if (isNaN(p1)){ p1 = v1parts[i]; } + if (isNaN(p2)){ p2 = v2parts[i]; } + if (p1 == p2) { + continue; + }else if (p1 > p2) { + return 1; + }else if (p1 < p2) { + return -1; + } + // one operand is NaN + return NaN; + } + // The longer tuple is always considered 'greater' + if (v1parts.length === v2parts.length) { + return 0; + } + return (v1parts.length < v2parts.length) ? -1 : 1; +} + + +//var BROWSER = jQuery.browser || _checkBrowser(); +var BROWSER = _checkBrowser(); // issue 440 +var jquerySupports = { + // http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at + positionMyOfs: versionCompare($.ui.version, "1.9") >= 0 //isVersionAtLeast($.ui.version, 1, 9) + }; + + +/************************************************************************* + * Class DynaTreeNode + */ +var DynaTreeNode = Class.create(); + +DynaTreeNode.prototype = { + initialize: function(parent, tree, data) { + /** + * @constructor + */ + this.parent = parent; + this.tree = tree; + if ( typeof data === "string" ){ + data = { title: data }; + } +// if( !data.key ){ + if( data.key == null ){ // test for null OR undefined (issue 420) + data.key = "_" + tree._nodeCount++; + }else{ + data.key = "" + data.key; // issue 371 + } + this.data = $.extend({}, $.ui.dynatree.nodedatadefaults, data); + this.li = null; // not yet created + this.span = null; // not yet created + this.ul = null; // not yet created + this.childList = null; // no subnodes yet + this._isLoading = false; // Lazy content is being loaded + this.hasSubSel = false; + this.bExpanded = false; + this.bSelected = false; + + }, + + toString: function() { + return "DynaTreeNode<" + this.data.key + ">: '" + this.data.title + "'"; + }, + + toDict: function(recursive, callback) { + var node, + dict = $.extend({}, this.data); + dict.activate = ( this.tree.activeNode === this ); + dict.focus = ( this.tree.focusNode === this ); + dict.expand = this.bExpanded; + dict.select = this.bSelected; + if( callback ){ + callback(dict); + } + if( recursive && this.childList ) { + dict.children = []; + for(var i=0, l=this.childList.length; i<l; i++ ){ + node = this.childList[i]; + if( !node.isStatusNode() ){ + dict.children.push(node.toDict(true, callback)); + } + } + } else { + delete dict.children; + } + return dict; + }, + + fromDict: function(dict) { + /** + * Update node data. If dict contains 'children', then also replace + * the hole sub tree. + */ + var children = dict.children; + if(children === undefined){ + this.data = $.extend(this.data, dict); + this.render(); + return; + } + dict = $.extend({}, dict); + dict.children = undefined; + this.data = $.extend(this.data, dict); + this.removeChildren(); + this.addChild(children); + }, + + _getInnerHtml: function() { + var tree = this.tree, + opts = tree.options, + cache = tree.cache, + level = this.getLevel(), + data = this.data, + res = "", + imageSrc; + // connector (expanded, expandable or simple) + if( level < opts.minExpandLevel ) { + if(level > 1){ + res += cache.tagConnector; + } + // .. else (i.e. for root level) skip expander/connector altogether + } else if( this.hasChildren() !== false ) { + res += cache.tagExpander; + } else { + res += cache.tagConnector; + } + // Checkbox mode + if( opts.checkbox && data.hideCheckbox !== true && !data.isStatusNode ) { + res += cache.tagCheckbox; + } + // folder or doctype icon + if ( data.icon ) { + if (data.icon.charAt(0) === "/"){ + imageSrc = data.icon; + }else{ + imageSrc = opts.imagePath + data.icon; + } + res += "<img src='" + imageSrc + "' alt='' />"; + } else if ( data.icon === false ) { + // icon == false means 'no icon' +// noop(); // keep JSLint happy + } else if ( data.iconClass ) { + res += "<span class='" + " " + data.iconClass + "'></span>"; + } else { + // icon == null means 'default icon' + res += cache.tagNodeIcon; + } + // node title + var nodeTitle = ""; + if ( opts.onCustomRender ){ + nodeTitle = opts.onCustomRender.call(tree, this) || ""; + } + if(!nodeTitle){ + var tooltip = data.tooltip ? ' title="' + data.tooltip.replace(/\"/g, '"') + '"' : '', + href = data.href || "#"; + if( opts.noLink || data.noLink ) { + nodeTitle = '<span style="display:inline-block;" class="' + opts.classNames.title + '"' + tooltip + '>' + data.title + '</span>'; +// this.tree.logDebug("nodeTitle: " + nodeTitle); + } else { + nodeTitle = '<a href="' + href + '" class="' + opts.classNames.title + '"' + tooltip + '>' + data.title + '</a>'; + } + } + res += nodeTitle; + return res; + }, + + + _fixOrder: function() { + /** + * Make sure, that <li> order matches childList order. + */ + var cl = this.childList; + if( !cl || !this.ul ){ + return; + } + var childLI = this.ul.firstChild; + for(var i=0, l=cl.length-1; i<l; i++) { + var childNode1 = cl[i]; + var childNode2 = childLI.dtnode; + if( childNode1 !== childNode2 ) { + this.tree.logDebug("_fixOrder: mismatch at index " + i + ": " + childNode1 + " != " + childNode2); + this.ul.insertBefore(childNode1.li, childNode2.li); + } else { + childLI = childLI.nextSibling; + } + } + }, + + + render: function(useEffects, includeInvisible) { + /** + * Create <li><span>..</span> .. </li> tags for this node. + * + * <li id='KEY' dtnode=NODE> // This div contains the node's span and list of child div's. + * <span class='title'>S S S A</span> // Span contains graphic spans and title <a> tag + * <ul> // only present, when node has children + * <li id='KEY' dtnode=NODE>child1</li> + * <li id='KEY' dtnode=NODE>child2</li> + * </ul> + * </li> + */ +// this.tree.logDebug("%s.render(%s)", this, useEffects); + // --- + var tree = this.tree, + parent = this.parent, + data = this.data, + opts = tree.options, + cn = opts.classNames, + isLastSib = this.isLastSibling(), + firstTime = false; + + if( !parent && !this.ul ) { + // Root node has only a <ul> + this.li = this.span = null; + this.ul = document.createElement("ul"); + if( opts.minExpandLevel > 1 ){ + this.ul.className = cn.container + " " + cn.noConnector; + }else{ + this.ul.className = cn.container; + } + } else if( parent ) { + // Create <li><span /> </li> + if( ! this.li ) { + firstTime = true; + this.li = document.createElement("li"); + this.li.dtnode = this; + if( data.key && opts.generateIds ){ + this.li.id = opts.idPrefix + data.key; + } + this.span = document.createElement("span"); + this.span.className = cn.title; + this.li.appendChild(this.span); + + if( !parent.ul ) { + // This is the parent's first child: create UL tag + // (Hidden, because it will be + parent.ul = document.createElement("ul"); + parent.ul.style.display = "none"; + parent.li.appendChild(parent.ul); +// if( opts.minExpandLevel > this.getLevel() ){ +// parent.ul.className = cn.noConnector; +// } + } + // set node connector images, links and text +// this.span.innerHTML = this._getInnerHtml(); + + parent.ul.appendChild(this.li); + } + // set node connector images, links and text + this.span.innerHTML = this._getInnerHtml(); + // Set classes for current status + var cnList = []; + cnList.push(cn.node); + if( data.isFolder ){ + cnList.push(cn.folder); + } + if( this.bExpanded ){ + cnList.push(cn.expanded); + } + if( this.hasChildren() !== false ){ + cnList.push(cn.hasChildren); + } + if( data.isLazy && this.childList === null ){ + cnList.push(cn.lazy); + } + if( isLastSib ){ + cnList.push(cn.lastsib); + } + if( this.bSelected ){ + cnList.push(cn.selected); + } + if( this.hasSubSel ){ + cnList.push(cn.partsel); + } + if( tree.activeNode === this ){ + cnList.push(cn.active); + } + if( data.addClass ){ + cnList.push(data.addClass); + } + // IE6 doesn't correctly evaluate multiple class names, + // so we create combined class names that can be used in the CSS + cnList.push(cn.combinedExpanderPrefix + + (this.bExpanded ? "e" : "c") + + (data.isLazy && this.childList === null ? "d" : "") + + (isLastSib ? "l" : "") + ); + cnList.push(cn.combinedIconPrefix + + (this.bExpanded ? "e" : "c") + + (data.isFolder ? "f" : "") + ); + this.span.className = cnList.join(" "); + + // TODO: we should not set this in the <span> tag also, if we set it here: + this.li.className = isLastSib ? cn.lastsib : ""; + + // Allow tweaking, binding, after node was created for the first time + if(firstTime && opts.onCreate){ + opts.onCreate.call(tree, this, this.span); + } + // Hide children, if node is collapsed +// this.ul.style.display = ( this.bExpanded || !parent ) ? "" : "none"; + // Allow tweaking after node state was rendered + if(opts.onRender){ + opts.onRender.call(tree, this, this.span); + } + } + // Visit child nodes + if( (this.bExpanded || includeInvisible === true) && this.childList ) { + for(var i=0, l=this.childList.length; i<l; i++) { + this.childList[i].render(false, includeInvisible); + } + // Make sure the tag order matches the child array + this._fixOrder(); + } + // Hide children, if node is collapsed + if( this.ul ) { + var isHidden = (this.ul.style.display === "none"); + var isExpanded = !!this.bExpanded; +// logMsg("isHidden:%s", isHidden); + if( useEffects && opts.fx && (isHidden === isExpanded) ) { + var duration = opts.fx.duration || 200; + $(this.ul).animate(opts.fx, duration); + } else { + this.ul.style.display = ( this.bExpanded || !parent ) ? "" : "none"; + } + } + }, + /** Return '/id1/id2/id3'. */ + getKeyPath: function(excludeSelf) { + var path = []; + this.visitParents(function(node){ + if(node.parent){ + path.unshift(node.data.key); + } + }, !excludeSelf); + return "/" + path.join(this.tree.options.keyPathSeparator); + }, + + getParent: function() { + return this.parent; + }, + + getChildren: function() { + if(this.hasChildren() === undefined){ + return undefined; // Lazy node: unloaded, currently loading, or load error + } + return this.childList; + }, + + /** Check if node has children (returns undefined, if not sure). */ + hasChildren: function() { + if(this.data.isLazy){ + if(this.childList === null || this.childList === undefined){ + // Not yet loaded + return undefined; + }else if(this.childList.length === 0){ + // Loaded, but response was empty + return false; + }else if(this.childList.length === 1 && this.childList[0].isStatusNode()){ + // Currently loading or load error + return undefined; + } + return true; + } + return !!this.childList; + }, + + isFirstSibling: function() { + var p = this.parent; + return !p || p.childList[0] === this; + }, + + isLastSibling: function() { + var p = this.parent; + return !p || p.childList[p.childList.length-1] === this; + }, + + isLoading: function() { + return !!this._isLoading; + }, + + getPrevSibling: function() { + if( !this.parent ){ + return null; + } + var ac = this.parent.childList; + for(var i=1, l=ac.length; i<l; i++){ // start with 1, so prev(first) = null + if( ac[i] === this ){ + return ac[i-1]; + } + } + return null; + }, + + getNextSibling: function() { + if( !this.parent ){ + return null; + } + var ac = this.parent.childList; + for(var i=0, l=ac.length-1; i<l; i++){ // up to length-2, so next(last) = null + if( ac[i] === this ){ + return ac[i+1]; + } + } + return null; + }, + + isStatusNode: function() { + return (this.data.isStatusNode === true); + }, + + isChildOf: function(otherNode) { + return (this.parent && this.parent === otherNode); + }, + + isDescendantOf: function(otherNode) { + if(!otherNode){ + return false; + } + var p = this.parent; + while( p ) { + if( p === otherNode ){ + return true; + } + p = p.parent; + } + return false; + }, + + countChildren: function() { + var cl = this.childList; + if( !cl ){ + return 0; + } + var n = cl.length; + for(var i=0, l=n; i<l; i++){ + var child = cl[i]; + n += child.countChildren(); + } + return n; + }, + + /**Sort child list by title. + * cmd: optional compare function. + * deep: optional: pass true to sort all descendant nodes. + */ + sortChildren: function(cmp, deep) { + var cl = this.childList; + if( !cl ){ + return; + } + cmp = cmp || function(a, b) { +// return a.data.title === b.data.title ? 0 : a.data.title > b.data.title ? 1 : -1; + var x = a.data.title.toLowerCase(), + y = b.data.title.toLowerCase(); + return x === y ? 0 : x > y ? 1 : -1; + }; + cl.sort(cmp); + if( deep ){ + for(var i=0, l=cl.length; i<l; i++){ + if( cl[i].childList ){ + cl[i].sortChildren(cmp, "$norender$"); + } + } + } + if( deep !== "$norender$" ){ + this.render(); + } + }, + + _setStatusNode: function(data) { + // Create, modify or remove the status child node (pass 'null', to remove it). + var firstChild = ( this.childList ? this.childList[0] : null ); + if( !data ) { + if ( firstChild && firstChild.isStatusNode()) { + try{ + // I've seen exceptions here with loadKeyPath... + if(this.ul){ + this.ul.removeChild(firstChild.li); + firstChild.li = null; // avoid leaks (issue 215) + } + }catch(e){} + if( this.childList.length === 1 ){ + this.childList = []; + }else{ + this.childList.shift(); + } + } + } else if ( firstChild ) { + data.isStatusNode = true; + data.key = "_statusNode"; + firstChild.data = data; + firstChild.render(); + } else { + data.isStatusNode = true; + data.key = "_statusNode"; + firstChild = this.addChild(data); + } + }, + + setLazyNodeStatus: function(lts, opts) { + var tooltip = (opts && opts.tooltip) ? opts.tooltip : null, + info = (opts && opts.info) ? " (" + opts.info + ")" : ""; + switch( lts ) { + case DTNodeStatus_Ok: + this._setStatusNode(null); + $(this.span).removeClass(this.tree.options.classNames.nodeLoading); + this._isLoading = false; +// this.render(); + if( this.tree.options.autoFocus ) { + if( this === this.tree.tnRoot && this.childList && this.childList.length > 0) { + // special case: using ajaxInit + this.childList[0].focus(); + } else { + this.focus(); + } + } + break; + case DTNodeStatus_Loading: + this._isLoading = true; + $(this.span).addClass(this.tree.options.classNames.nodeLoading); + // The root is hidden, so we set a temporary status child + if(!this.parent){ + this._setStatusNode({ + title: this.tree.options.strings.loading + info, + tooltip: tooltip, + addClass: this.tree.options.classNames.nodeWait + }); + } + break; + case DTNodeStatus_Error: + this._isLoading = false; +// $(this.span).addClass(this.tree.options.classNames.nodeError); + this._setStatusNode({ + title: this.tree.options.strings.loadError + info, + tooltip: tooltip, + addClass: this.tree.options.classNames.nodeError + }); + break; + default: + throw "Bad LazyNodeStatus: '" + lts + "'."; + } + }, + + _parentList: function(includeRoot, includeSelf) { + var l = []; + var dtn = includeSelf ? this : this.parent; + while( dtn ) { + if( includeRoot || dtn.parent ){ + l.unshift(dtn); + } + dtn = dtn.parent; + } + return l; + }, + getLevel: function() { + /** + * Return node depth. 0: System root node, 1: visible top-level node. + */ + var level = 0; + var dtn = this.parent; + while( dtn ) { + level++; + dtn = dtn.parent; + } + return level; + }, + + _getTypeForOuterNodeEvent: function(event) { + /** Return the inner node span (title, checkbox or expander) if + * event.target points to the outer span. + * This function should fix issue #93: + * FF2 ignores empty spans, when generating events (returning the parent instead). + */ + var cns = this.tree.options.classNames; + var target = event.target; + // Only process clicks on an outer node span (probably due to a FF2 event handling bug) + if( target.className.indexOf(cns.node) < 0 ) { + return null; + } + // Event coordinates, relative to outer node span: + var eventX = event.pageX - target.offsetLeft; + var eventY = event.pageY - target.offsetTop; + + for(var i=0, l=target.childNodes.length; i<l; i++) { + var cn = target.childNodes[i]; + var x = cn.offsetLeft - target.offsetLeft; + var y = cn.offsetTop - target.offsetTop; + var nx = cn.clientWidth, ny = cn.clientHeight; +// alert (cn.className + ": " + x + ", " + y + ", s:" + nx + ", " + ny); + if( eventX >= x && eventX <= (x+nx) && eventY >= y && eventY <= (y+ny) ) { +// alert("HIT "+ cn.className); + if( cn.className==cns.title ){ + return "title"; + }else if( cn.className==cns.expander ){ + return "expander"; + }else if( cn.className==cns.checkbox ){ + return "checkbox"; + }else if( cn.className==cns.nodeIcon ){ + return "icon"; + } + } + } + return "prefix"; + }, + + getEventTargetType: function(event) { + // Return the part of a node, that a click event occured on. + // Note: there is no check, if the event was fired on THIS node. + var tcn = event && event.target ? event.target.className : "", + cns = this.tree.options.classNames; + + if( tcn.indexOf(cns.title) >= 0 ){ + return "title"; + }else if( tcn.indexOf(cns.expander) >= 0 ){ + return "expander"; + }else if( tcn.indexOf(cns.checkbox) >= 0 ){ + return "checkbox"; + }else if( tcn.indexOf(cns.nodeIcon) >= 0 ){ + return "icon"; + }else if( tcn.indexOf(cns.empty) >= 0 || tcn.indexOf(cns.vline) >= 0 || tcn.indexOf(cns.connector) >= 0 ){ + return "prefix"; + }else if( tcn.indexOf(cns.node) >= 0 ){ + // FIX issue #93 + return this._getTypeForOuterNodeEvent(event); + } + return null; + }, + + isVisible: function() { + // Return true, if all parents are expanded. + var parents = this._parentList(true, false); + for(var i=0, l=parents.length; i<l; i++){ + if( ! parents[i].bExpanded ){ return false; } + } + return true; + }, + + makeVisible: function() { + // Make sure, all parents are expanded + var parents = this._parentList(true, false); + for(var i=0, l=parents.length; i<l; i++){ + parents[i]._expand(true); + } + }, + + focus: function() { + // TODO: check, if we already have focus +// this.tree.logDebug("dtnode.focus(): %o", this); + this.makeVisible(); + try { + $(this.span).find(">a").focus(); + } catch(e) { } + }, + + isFocused: function() { + return (this.tree.tnFocused === this); + }, + + _activate: function(flag, fireEvents) { + // (De)Activate - but not focus - this node. + this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o", flag, fireEvents, this); + var opts = this.tree.options; + if( this.data.isStatusNode ){ + return; + } + if ( fireEvents && opts.onQueryActivate && opts.onQueryActivate.call(this.tree, flag, this) === false ){ + return; // Callback returned false + } + if( flag ) { + // Activate + if( this.tree.activeNode ) { + if( this.tree.activeNode === this ){ + return; + } + this.tree.activeNode.deactivate(); + } + if( opts.activeVisible ){ + this.makeVisible(); + } + this.tree.activeNode = this; + if( opts.persist ){ + $.cookie(opts.cookieId + "-active", this.data.key, opts.cookie); + } + this.tree.persistence.activeKey = this.data.key; + $(this.span).addClass(opts.classNames.active); + if ( fireEvents && opts.onActivate ){ + opts.onActivate.call(this.tree, this); + } + } else { + // Deactivate + if( this.tree.activeNode === this ) { + if ( opts.onQueryActivate && opts.onQueryActivate.call(this.tree, false, this) === false ){ + return; // Callback returned false + } + $(this.span).removeClass(opts.classNames.active); + if( opts.persist ) { + // Note: we don't pass null, but ''. So the cookie is not deleted. + // If we pass null, we also have to pass a COPY of opts, because $cookie will override opts.expires (issue 84) + $.cookie(opts.cookieId + "-active", "", opts.cookie); + } + this.tree.persistence.activeKey = null; + this.tree.activeNode = null; + if ( fireEvents && opts.onDeactivate ){ + opts.onDeactivate.call(this.tree, this); + } + } + } + }, + + activate: function() { + // Select - but not focus - this node. +// this.tree.logDebug("dtnode.activate(): %o", this); + this._activate(true, true); + }, + + activateSilently: function() { + this._activate(true, false); + }, + + deactivate: function() { +// this.tree.logDebug("dtnode.deactivate(): %o", this); + this._activate(false, true); + }, + + isActive: function() { + return (this.tree.activeNode === this); + }, + + _userActivate: function() { + // Handle user click / [space] / [enter], according to clickFolderMode. + var activate = true; + var expand = false; + if ( this.data.isFolder ) { + switch( this.tree.options.clickFolderMode ) { + case 2: + activate = false; + expand = true; + break; + case 3: + activate = expand = true; + break; + } + } + if( this.parent === null ) { + expand = false; + } + if( expand ) { + this.toggleExpand(); + this.focus(); + } + if( activate ) { + this.activate(); + } + }, + + _setSubSel: function(hasSubSel) { + if( hasSubSel ) { + this.hasSubSel = true; + $(this.span).addClass(this.tree.options.classNames.partsel); + } else { + this.hasSubSel = false; + $(this.span).removeClass(this.tree.options.classNames.partsel); + } + }, + /** + * Fix selection and partsel status, of parent nodes, according to current status of + * end nodes. + */ + _updatePartSelectionState: function() { +// alert("_updatePartSelectionState " + this); +// this.tree.logDebug("_updatePartSelectionState() - %o", this); + var sel; + // Return `true` or `false` for end nodes and remove part-sel flag + if( ! this.hasChildren() ){ + sel = (this.bSelected && !this.data.unselectable && !this.data.isStatusNode); + this._setSubSel(false); + return sel; + } + // Return `true`, `false`, or `undefined` for parent nodes + var i, l, + cl = this.childList, + allSelected = true, + allDeselected = true; + for(i=0, l=cl.length; i<l; i++) { + var n = cl[i], + s = n._updatePartSelectionState(); + if( s !== false){ + allDeselected = false; + } + if( s !== true){ + allSelected = false; + } + } + if( allSelected ){ + sel = true; + } else if ( allDeselected ){ + sel = false; + } else { + sel = undefined; + } + this._setSubSel(sel === undefined); + this.bSelected = (sel === true); + return sel; + }, + + /** + * Fix selection status, after this node was (de)selected in multi-hier mode. + * This includes (de)selecting all children. + */ + _fixSelectionState: function() { +// alert("_fixSelectionState " + this); +// this.tree.logDebug("_fixSelectionState(%s) - %o", this.bSelected, this); + var p, i, l; + if( this.bSelected ) { + // Select all children + this.visit(function(node){ + node.parent._setSubSel(true); + if(!node.data.unselectable){ + node._select(true, false, false); + } + }); + // Select parents, if all children are selected + p = this.parent; + while( p ) { + p._setSubSel(true); + var allChildsSelected = true; + for(i=0, l=p.childList.length; i<l; i++) { + var n = p.childList[i]; + if( !n.bSelected && !n.data.isStatusNode && !n.data.unselectable) { + // issue 305 proposes this: +// if( !n.bSelected && !n.data.isStatusNode ) { + allChildsSelected = false; + break; + } + } + if( allChildsSelected ){ + p._select(true, false, false); + } + p = p.parent; + } + } else { + // Deselect all children + this._setSubSel(false); + this.visit(function(node){ + node._setSubSel(false); + node._select(false, false, false); + }); + // Deselect parents, and recalc hasSubSel + p = this.parent; + while( p ) { + p._select(false, false, false); + var isPartSel = false; + for(i=0, l=p.childList.length; i<l; i++) { + if( p.childList[i].bSelected || p.childList[i].hasSubSel ) { + isPartSel = true; + break; + } + } + p._setSubSel(isPartSel); + p = p.parent; + } + } + }, + + _select: function(sel, fireEvents, deep) { + // Select - but not focus - this node. +// this.tree.logDebug("dtnode._select(%o) - %o", sel, this); + var opts = this.tree.options; + if( this.data.isStatusNode ){ + return; + } + // + if( this.bSelected === sel ) { +// this.tree.logDebug("dtnode._select(%o) IGNORED - %o", sel, this); + return; + } + // Allow event listener to abort selection + if ( fireEvents && opts.onQuerySelect && opts.onQuerySelect.call(this.tree, sel, this) === false ){ + return; // Callback returned false + } + // Force single-selection + if( opts.selectMode==1 && sel ) { + this.tree.visit(function(node){ + if( node.bSelected ) { + // Deselect; assuming that in selectMode:1 there's max. one other selected node + node._select(false, false, false); + return false; + } + }); + } + + this.bSelected = sel; +// this.tree._changeNodeList("select", this, sel); + + if( sel ) { + if( opts.persist ){ + this.tree.persistence.addSelect(this.data.key); + } + $(this.span).addClass(opts.classNames.selected); + + if( deep && opts.selectMode === 3 ){ + this._fixSelectionState(); + } + if ( fireEvents && opts.onSelect ){ + opts.onSelect.call(this.tree, true, this); + } + } else { + if( opts.persist ){ + this.tree.persistence.clearSelect(this.data.key); + } + $(this.span).removeClass(opts.classNames.selected); + + if( deep && opts.selectMode === 3 ){ + this._fixSelectionState(); + } + if ( fireEvents && opts.onSelect ){ + opts.onSelect.call(this.tree, false, this); + } + } + }, + + select: function(sel) { + // Select - but not focus - this node. +// this.tree.logDebug("dtnode.select(%o) - %o", sel, this); + if( this.data.unselectable ){ + return this.bSelected; + } + return this._select(sel!==false, true, true); + }, + + toggleSelect: function() { +// this.tree.logDebug("dtnode.toggleSelect() - %o", this); + return this.select(!this.bSelected); + }, + + isSelected: function() { + return this.bSelected; + }, + + isLazy: function() { + return !!this.data.isLazy; + }, + + _loadContent: function() { + try { + var opts = this.tree.options; + this.tree.logDebug("_loadContent: start - %o", this); + this.setLazyNodeStatus(DTNodeStatus_Loading); + if( true === opts.onLazyRead.call(this.tree, this) ) { + // If function returns 'true', we assume that the loading is done: + this.setLazyNodeStatus(DTNodeStatus_Ok); + // Otherwise (i.e. if the loading was started as an asynchronous process) + // the onLazyRead(dtnode) handler is expected to call dtnode.setLazyNodeStatus(DTNodeStatus_Ok/_Error) when done. + this.tree.logDebug("_loadContent: succeeded - %o", this); + } + } catch(e) { + this.tree.logWarning("_loadContent: failed - %o", e); + this.setLazyNodeStatus(DTNodeStatus_Error, {tooltip: ""+e}); + } + }, + + _expand: function(bExpand, forceSync) { + if( this.bExpanded === bExpand ) { + this.tree.logDebug("dtnode._expand(%o) IGNORED - %o", bExpand, this); + return; + } + this.tree.logDebug("dtnode._expand(%o) - %o", bExpand, this); + var opts = this.tree.options; + if( !bExpand && this.getLevel() < opts.minExpandLevel ) { + this.tree.logDebug("dtnode._expand(%o) prevented collapse - %o", bExpand, this); + return; + } + if ( opts.onQueryExpand && opts.onQueryExpand.call(this.tree, bExpand, this) === false ){ + return; // Callback returned false + } + this.bExpanded = bExpand; + + // Persist expand state + if( opts.persist ) { + if( bExpand ){ + this.tree.persistence.addExpand(this.data.key); + }else{ + this.tree.persistence.clearExpand(this.data.key); + } + } + // Do not apply animations in init phase, or before lazy-loading + var allowEffects = !(this.data.isLazy && this.childList === null) + && !this._isLoading + && !forceSync; + this.render(allowEffects); + + // Auto-collapse mode: collapse all siblings + if( this.bExpanded && this.parent && opts.autoCollapse ) { + var parents = this._parentList(false, true); + for(var i=0, l=parents.length; i<l; i++){ + parents[i].collapseSiblings(); + } + } + // If the currently active node is now hidden, deactivate it + if( opts.activeVisible && this.tree.activeNode && ! this.tree.activeNode.isVisible() ) { + this.tree.activeNode.deactivate(); + } + // Expanding a lazy node: set 'loading...' and call callback + if( bExpand && this.data.isLazy && this.childList === null && !this._isLoading ) { + this._loadContent(); + return; + } + if ( opts.onExpand ){ + opts.onExpand.call(this.tree, bExpand, this); + } + }, + + isExpanded: function() { + return this.bExpanded; + }, + + expand: function(flag) { + flag = (flag !== false); + if( !this.childList && !this.data.isLazy && flag ){ + return; // Prevent expanding empty nodes + } else if( this.parent === null && !flag ){ + return; // Prevent collapsing the root + } + this._expand(flag); + }, + + scheduleAction: function(mode, ms) { + /** Schedule activity for delayed execution (cancel any pending request). + * scheduleAction('cancel') will cancel the request. + */ + if( this.tree.timer ) { + clearTimeout(this.tree.timer); + this.tree.logDebug("clearTimeout(%o)", this.tree.timer); + } + var self = this; // required for closures + switch (mode) { + case "cancel": + // Simply made sure that timer was cleared + break; + case "expand": + this.tree.timer = setTimeout(function(){ + self.tree.logDebug("setTimeout: trigger expand"); + self.expand(true); + }, ms); + break; + case "activate": + this.tree.timer = setTimeout(function(){ + self.tree.logDebug("setTimeout: trigger activate"); + self.activate(); + }, ms); + break; + default: + throw "Invalid mode " + mode; + } + this.tree.logDebug("setTimeout(%s, %s): %s", mode, ms, this.tree.timer); + }, + + toggleExpand: function() { + this.expand(!this.bExpanded); + }, + + collapseSiblings: function() { + if( this.parent === null ){ + return; + } + var ac = this.parent.childList; + for (var i=0, l=ac.length; i<l; i++) { + if ( ac[i] !== this && ac[i].bExpanded ){ + ac[i]._expand(false); + } + } + }, + + _onClick: function(event) { +// this.tree.logDebug("dtnode.onClick(" + event.type + "): dtnode:" + this + ", button:" + event.button + ", which: " + event.which); + var targetType = this.getEventTargetType(event); + if( targetType === "expander" ) { + // Clicking the expander icon always expands/collapses + this.toggleExpand(); + this.focus(); // issue 95 + } else if( targetType === "checkbox" ) { + // Clicking the checkbox always (de)selects + this.toggleSelect(); + this.focus(); // issue 95 + } else { + this._userActivate(); + var aTag = this.span.getElementsByTagName("a"); + if(aTag[0]){ + // issue 154, 313 + if(!(BROWSER.msie && parseInt(BROWSER.version, 10) < 9)){ + aTag[0].focus(); + } + }else{ + // 'noLink' option was set + return true; + } + } + // Make sure that clicks stop, otherwise <a href='#'> jumps to the top + event.preventDefault(); + }, + + _onDblClick: function(event) { +// this.tree.logDebug("dtnode.onDblClick(" + event.type + "): dtnode:" + this + ", button:" + event.button + ", which: " + event.which); + }, + + _onKeydown: function(event) { +// this.tree.logDebug("dtnode.onKeydown(" + event.type + "): dtnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which); + var handled = true, + sib; +// alert("keyDown" + event.which); + + switch( event.which ) { + // charCodes: +// case 43: // '+' + case 107: // '+' + case 187: // '+' @ Chrome, Safari + if( !this.bExpanded ){ this.toggleExpand(); } + break; +// case 45: // '-' + case 109: // '-' + case 189: // '+' @ Chrome, Safari + if( this.bExpanded ){ this.toggleExpand(); } + break; + //~ case 42: // '*' + //~ break; + //~ case 47: // '/' + //~ break; + // case 13: // <enter> + // <enter> on a focused <a> tag seems to generate a click-event. + // this._userActivate(); + // break; + case 32: // <space> + this._userActivate(); + break; + case 8: // <backspace> + if( this.parent ){ + this.parent.focus(); + } + break; + case 37: // <left> + if( this.bExpanded ) { + this.toggleExpand(); + this.focus(); +// } else if( this.parent && (this.tree.options.rootVisible || this.parent.parent) ) { + } else if( this.parent && this.parent.parent ) { + this.parent.focus(); + } + break; + case 39: // <right> + if( !this.bExpanded && (this.childList || this.data.isLazy) ) { + this.toggleExpand(); + this.focus(); + } else if( this.childList ) { + this.childList[0].focus(); + } + break; + case 38: // <up> + sib = this.getPrevSibling(); + while( sib && sib.bExpanded && sib.childList ){ + sib = sib.childList[sib.childList.length-1]; + } +// if( !sib && this.parent && (this.tree.options.rootVisible || this.parent.parent) ) + if( !sib && this.parent && this.parent.parent ){ + sib = this.parent; + } + if( sib ){ + sib.focus(); + } + break; + case 40: // <down> + if( this.bExpanded && this.childList ) { + sib = this.childList[0]; + } else { + var parents = this._parentList(false, true); + for(var i=parents.length-1; i>=0; i--) { + sib = parents[i].getNextSibling(); + if( sib ){ break; } + } + } + if( sib ){ + sib.focus(); + } + break; + default: + handled = false; + } + // Return false, if handled, to prevent default processing +// return !handled; + if(handled){ + event.preventDefault(); + } + }, + + _onKeypress: function(event) { + // onKeypress is only hooked to allow user callbacks. + // We don't process it, because IE and Safari don't fire keypress for cursor keys. +// this.tree.logDebug("dtnode.onKeypress(" + event.type + "): dtnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which); + }, + + _onFocus: function(event) { + // Handles blur and focus events. +// this.tree.logDebug("dtnode._onFocus(%o): %o", event, this); + var opts = this.tree.options; + if ( event.type == "blur" || event.type == "focusout" ) { + if ( opts.onBlur ){ + opts.onBlur.call(this.tree, this); + } + if( this.tree.tnFocused ){ + $(this.tree.tnFocused.span).removeClass(opts.classNames.focused); + } + this.tree.tnFocused = null; + if( opts.persist ){ + $.cookie(opts.cookieId + "-focus", "", opts.cookie); + } + } else if ( event.type=="focus" || event.type=="focusin") { + // Fix: sometimes the blur event is not generated + if( this.tree.tnFocused && this.tree.tnFocused !== this ) { + this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o", this.tree.tnFocused); + $(this.tree.tnFocused.span).removeClass(opts.classNames.focused); + } + this.tree.tnFocused = this; + if ( opts.onFocus ){ + opts.onFocus.call(this.tree, this); + } + $(this.tree.tnFocused.span).addClass(opts.classNames.focused); + if( opts.persist ){ + $.cookie(opts.cookieId + "-focus", this.data.key, opts.cookie); + } + } + // TODO: return anything? +// return false; + }, + + visit: function(fn, includeSelf) { + // Call fn(node) for all child nodes. Stop iteration, if fn() returns false. + var res = true; + if( includeSelf === true ) { + res = fn(this); + if( res === false || res === "skip" ){ + return res; + } + } + if(this.childList){ + for(var i=0, l=this.childList.length; i<l; i++){ + res = this.childList[i].visit(fn, true); + if( res === false ){ + break; + } + } + } + return res; + }, + + visitParents: function(fn, includeSelf) { + // Visit parent nodes (bottom up) + if(includeSelf && fn(this) === false){ + return false; + } + var p = this.parent; + while( p ) { + if(fn(p) === false){ + return false; + } + p = p.parent; + } + return true; + }, + + remove: function() { + // Remove this node +// this.tree.logDebug ("%s.remove()", this); + if ( this === this.tree.root ){ + throw "Cannot remove system root"; + } + return this.parent.removeChild(this); + }, + + removeChild: function(tn) { + // Remove tn from list of direct children. + var ac = this.childList; + if( ac.length === 1 ) { + if( tn !== ac[0] ){ + throw "removeChild: invalid child"; + } + return this.removeChildren(); + } + if( tn === this.tree.activeNode ){ + tn.deactivate(); + } + if( this.tree.options.persist ) { + if( tn.bSelected ){ + this.tree.persistence.clearSelect(tn.data.key); + } + if ( tn.bExpanded ){ + this.tree.persistence.clearExpand(tn.data.key); + } + } + tn.removeChildren(true); + if(this.ul && tn.li ){ +// $("li", $(this.ul)).remove(); // issue 399 + this.ul.removeChild(tn.li); // issue 402 + } + for(var i=0, l=ac.length; i<l; i++) { + if( ac[i] === tn ) { + this.childList.splice(i, 1); +// delete tn; // JSLint complained + break; + } + } + }, + + removeChildren: function(isRecursiveCall, retainPersistence) { + // Remove all child nodes (more efficiently than recursive remove()) + this.tree.logDebug("%s.removeChildren(%o)", this, isRecursiveCall); + var tree = this.tree; + var ac = this.childList; + if( ac ) { + for(var i=0, l=ac.length; i<l; i++) { + var tn = ac[i]; + if ( tn === tree.activeNode && !retainPersistence ){ + tn.deactivate(); + } + if( this.tree.options.persist && !retainPersistence ) { + if( tn.bSelected ){ + this.tree.persistence.clearSelect(tn.data.key); + } + if ( tn.bExpanded ){ + this.tree.persistence.clearExpand(tn.data.key); + } + } + tn.removeChildren(true, retainPersistence); + if(this.ul && tn.li){ +// this.ul.removeChild(tn.li); + $("li", $(this.ul)).remove(); // issue 231 + } +// delete tn; JSLint complained + } + // Set to 'null' which is interpreted as 'not yet loaded' for lazy + // nodes + this.childList = null; + } + if( ! isRecursiveCall ) { +// this._expand(false); +// this.isRead = false; + this._isLoading = false; + this.render(); + } + }, + + setTitle: function(title) { + this.fromDict({title: title}); + }, + + reload: function(force) { + throw "Use reloadChildren() instead"; + }, + + reloadChildren: function(callback) { + // Reload lazy content (expansion state is maintained). + if( this.parent === null ){ + throw "Use tree.reload() instead"; + }else if( ! this.data.isLazy ){ + throw "node.reloadChildren() requires lazy nodes."; + } + // appendAjax triggers 'nodeLoaded' event. + // We listen to this, if a callback was passed to reloadChildren + if(callback){ + var self = this; + var eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id") + + "." + this.data.key; + this.tree.$tree.bind(eventType, function(e, node, isOk){ + self.tree.$tree.unbind(eventType); + self.tree.logDebug("loaded %o, %o, %o", e, node, isOk); + if(node !== self){ + throw "got invalid load event"; + } + callback.call(self.tree, node, isOk); + }); + } + // The expansion state is maintained + this.removeChildren(); + this._loadContent(); +// if( this.bExpanded ) { +// // Remove children first, to prevent effects being applied +// this.removeChildren(); +// // then force re-expand to trigger lazy loading +//// this.expand(false); +//// this.expand(true); +// this._loadContent(); +// } else { +// this.removeChildren(); +// this._loadContent(); +// } + }, + + /** + * Make sure the node with a given key path is available in the tree. + */ + _loadKeyPath: function(keyPath, callback) { + var tree = this.tree; + tree.logDebug("%s._loadKeyPath(%s)", this, keyPath); + if(keyPath === ""){ + throw "Key path must not be empty"; + } + var segList = keyPath.split(tree.options.keyPathSeparator); + if(segList[0] === ""){ + throw "Key path must be relative (don't start with '/')"; + } + var seg = segList.shift(); + if(this.childList){ + for(var i=0, l=this.childList.length; i < l; i++){ + var child = this.childList[i]; + if( child.data.key === seg ){ + if(segList.length === 0) { + // Found the end node + callback.call(tree, child, "ok"); + + }else if(child.data.isLazy && (child.childList === null || child.childList === undefined)){ + tree.logDebug("%s._loadKeyPath(%s) -> reloading %s...", this, keyPath, child); + var self = this; + // Note: this line gives a JSLint warning (Don't make functions within a loop) + /*jshint loopfunc:true */ + child.reloadChildren(function(node, isOk){ + // After loading, look for direct child with that key + if(isOk){ + tree.logDebug("%s._loadKeyPath(%s) -> reloaded %s.", node, keyPath, node); + callback.call(tree, child, "loaded"); + node._loadKeyPath(segList.join(tree.options.keyPathSeparator), callback); + }else{ + tree.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.", self, keyPath); + callback.call(tree, child, "error"); + } + }); + // we can ignore it, since it will only be exectuted once, the the loop is ended + // See also http://stackoverflow.com/questions/3037598/how-to-get-around-the-jslint-error-dont-make-functions-within-a-loop + } else { + callback.call(tree, child, "loaded"); + // Look for direct child with that key + child._loadKeyPath(segList.join(tree.options.keyPathSeparator), callback); + } + return; + } + } + } + // Could not find key + // Callback params: child: undefined, the segment, isEndNode (segList.length === 0) + callback.call(tree, undefined, "notfound", seg, segList.length === 0); + tree.logWarning("Node not found: " + seg); + return; + }, + + resetLazy: function() { + // Discard lazy content. + if( this.parent === null ){ + throw "Use tree.reload() instead"; + }else if( ! this.data.isLazy ){ + throw "node.resetLazy() requires lazy nodes."; + } + this.expand(false); + this.removeChildren(); + }, + + _addChildNode: function(dtnode, beforeNode) { + /** + * Internal function to add one single DynatreeNode as a child. + * + */ + var tree = this.tree, + opts = tree.options, + pers = tree.persistence; + +// tree.logDebug("%s._addChildNode(%o)", this, dtnode); + + // --- Update and fix dtnode attributes if necessary + dtnode.parent = this; +// if( beforeNode && (beforeNode.parent !== this || beforeNode === dtnode ) ) +// throw "<beforeNode> must be another child of <this>"; + + // --- Add dtnode as a child + if ( this.childList === null ) { + this.childList = []; + } else if( ! beforeNode ) { + // Fix 'lastsib' + if(this.childList.length > 0) { + $(this.childList[this.childList.length-1].span).removeClass(opts.classNames.lastsib); + } + } + if( beforeNode ) { + var iBefore = $.inArray(beforeNode, this.childList); + if( iBefore < 0 ){ + throw "<beforeNode> must be a child of <this>"; + } + this.childList.splice(iBefore, 0, dtnode); + } else { + // Append node + this.childList.push(dtnode); + } + + // --- Handle persistence + // Initial status is read from cookies, if persistence is active and + // cookies are already present. + // Otherwise the status is read from the data attributes and then persisted. + var isInitializing = tree.isInitializing(); + if( opts.persist && pers.cookiesFound && isInitializing ) { + // Init status from cookies +// tree.logDebug("init from cookie, pa=%o, dk=%o", pers.activeKey, dtnode.data.key); + if( pers.activeKey === dtnode.data.key ){ + tree.activeNode = dtnode; + } + if( pers.focusedKey === dtnode.data.key ){ + tree.focusNode = dtnode; + } + dtnode.bExpanded = ($.inArray(dtnode.data.key, pers.expandedKeyList) >= 0); + dtnode.bSelected = ($.inArray(dtnode.data.key, pers.selectedKeyList) >= 0); +// tree.logDebug(" key=%o, bSelected=%o", dtnode.data.key, dtnode.bSelected); + } else { + // Init status from data (Note: we write the cookies after the init phase) +// tree.logDebug("init from data"); + if( dtnode.data.activate ) { + tree.activeNode = dtnode; + if( opts.persist ){ + pers.activeKey = dtnode.data.key; + } + } + if( dtnode.data.focus ) { + tree.focusNode = dtnode; + if( opts.persist ){ + pers.focusedKey = dtnode.data.key; + } + } + dtnode.bExpanded = ( dtnode.data.expand === true ); // Collapsed by default + if( dtnode.bExpanded && opts.persist ){ + pers.addExpand(dtnode.data.key); + } + dtnode.bSelected = ( dtnode.data.select === true ); // Deselected by default +/* + Doesn't work, cause pers.selectedKeyList may be null + if( dtnode.bSelected && opts.selectMode==1 + && pers.selectedKeyList && pers.selectedKeyList.length>0 ) { + tree.logWarning("Ignored multi-selection in single-mode for %o", dtnode); + dtnode.bSelected = false; // Fixing bad input data (multi selection for mode:1) + } +*/ + if( dtnode.bSelected && opts.persist ){ + pers.addSelect(dtnode.data.key); + } + } + + // Always expand, if it's below minExpandLevel +// tree.logDebug ("%s._addChildNode(%o), l=%o", this, dtnode, dtnode.getLevel()); + if ( opts.minExpandLevel >= dtnode.getLevel() ) { +// tree.logDebug ("Force expand for %o", dtnode); + this.bExpanded = true; + } + + // In multi-hier mode, update the parents selection state + // issue #82: only if not initializing, because the children may not exist yet +// if( !dtnode.data.isStatusNode && opts.selectMode==3 && !isInitializing ) +// dtnode._fixSelectionState(); + + // In multi-hier mode, update the parents selection state + if( dtnode.bSelected && opts.selectMode==3 ) { + var p = this; + while( p ) { + if( !p.hasSubSel ){ + p._setSubSel(true); + } + p = p.parent; + } + } + // render this node and the new child + if ( tree.bEnableUpdate ){ + this.render(); + } + return dtnode; + }, + + addChild: function(obj, beforeNode) { + /** + * Add a node object as child. + * + * This should be the only place, where a DynaTreeNode is constructed! + * (Except for the root node creation in the tree constructor) + * + * @param obj A JS object (may be recursive) or an array of those. + * @param {DynaTreeNode} beforeNode (optional) sibling node. + * + * Data format: array of node objects, with optional 'children' attributes. + * [ + * { title: "t1", isFolder: true, ... } + * { title: "t2", isFolder: true, ..., + * children: [ + * {title: "t2.1", ..}, + * {..} + * ] + * } + * ] + * A simple object is also accepted instead of an array. + * + */ +// this.tree.logDebug("%s.addChild(%o, %o)", this, obj, beforeNode); + if(typeof(obj) == "string"){ + throw "Invalid data type for " + obj; + }else if( !obj || obj.length === 0 ){ // Passed null or undefined or empty array + return; + }else if( obj instanceof DynaTreeNode ){ + return this._addChildNode(obj, beforeNode); + } + + if( !obj.length ){ // Passed a single data object + obj = [ obj ]; + } + var prevFlag = this.tree.enableUpdate(false); + + var tnFirst = null; + for (var i=0, l=obj.length; i<l; i++) { + var data = obj[i]; + var dtnode = this._addChildNode(new DynaTreeNode(this, this.tree, data), beforeNode); + if( !tnFirst ){ + tnFirst = dtnode; + } + // Add child nodes recursively + if( data.children ){ + dtnode.addChild(data.children, null); + } + } + this.tree.enableUpdate(prevFlag); + return tnFirst; + }, + + append: function(obj) { + this.tree.logWarning("node.append() is deprecated (use node.addChild() instead)."); + return this.addChild(obj, null); + }, + + appendAjax: function(ajaxOptions) { + var self = this; + this.removeChildren(false, true); + this.setLazyNodeStatus(DTNodeStatus_Loading); + // Debug feature: force a delay, to simulate slow loading... + if(ajaxOptions.debugLazyDelay){ + var ms = ajaxOptions.debugLazyDelay; + ajaxOptions.debugLazyDelay = 0; + this.tree.logInfo("appendAjax: waiting for debugLazyDelay " + ms); + setTimeout(function(){self.appendAjax(ajaxOptions);}, ms); + return; + } + // Ajax option inheritance: $.ajaxSetup < $.ui.dynatree.prototype.options.ajaxDefaults < tree.options.ajaxDefaults < ajaxOptions + var orgSuccess = ajaxOptions.success, + orgError = ajaxOptions.error, + eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id") + "." + this.data.key; + var options = $.extend({}, this.tree.options.ajaxDefaults, ajaxOptions, { + success: function(data, textStatus, jqXHR){ + // <this> is the request options +// self.tree.logDebug("appendAjax().success"); + var prevPhase = self.tree.phase; + self.tree.phase = "init"; + // postProcess is similar to the standard dataFilter hook, + // but it is also called for JSONP + if( options.postProcess ){ + data = options.postProcess.call(this, data, this.dataType); + } + // Process ASPX WebMethod JSON object inside "d" property + // http://code.google.com/p/dynatree/issues/detail?id=202 + else if (data && data.hasOwnProperty("d")) { + data = (typeof data.d) == "string" ? $.parseJSON(data.d) : data.d; + } + if(!$.isArray(data) || data.length !== 0){ + self.addChild(data, null); + } + self.tree.phase = "postInit"; + if( orgSuccess ){ + orgSuccess.call(options, self, data, textStatus); + } + self.tree.logDebug("trigger " + eventType); + self.tree.$tree.trigger(eventType, [self, true]); + self.tree.phase = prevPhase; + // This should be the last command, so node._isLoading is true + // while the callbacks run + self.setLazyNodeStatus(DTNodeStatus_Ok); + if($.isArray(data) && data.length === 0){ + // Set to [] which is interpreted as 'no children' for lazy + // nodes + self.childList = []; + self.render(); + } + }, + error: function(jqXHR, textStatus, errorThrown){ + // <this> is the request options + self.tree.logWarning("appendAjax failed:", textStatus, ":\n", jqXHR, "\n", errorThrown); + if( orgError ){ + orgError.call(options, self, jqXHR, textStatus, errorThrown); + } + self.tree.$tree.trigger(eventType, [self, false]); + self.setLazyNodeStatus(DTNodeStatus_Error, {info: textStatus, tooltip: "" + errorThrown}); + } + }); + $.ajax(options); + }, + + move: function(targetNode, mode) { + /**Move this node to targetNode. + * mode 'child': append this node as last child of targetNode. + * This is the default. To be compatble with the D'n'd + * hitMode, we also accept 'over'. + * mode 'before': add this node as sibling before targetNode. + * mode 'after': add this node as sibling after targetNode. + */ + var pos; + if(this === targetNode){ + return; + } + if( !this.parent ){ + throw "Cannot move system root"; + } + if(mode === undefined || mode == "over"){ + mode = "child"; + } + var prevParent = this.parent; + var targetParent = (mode === "child") ? targetNode : targetNode.parent; + if( targetParent.isDescendantOf(this) ){ + throw "Cannot move a node to it's own descendant"; + } + // Unlink this node from current parent + if( this.parent.childList.length == 1 ) { + this.parent.childList = this.parent.data.isLazy ? [] : null; + this.parent.bExpanded = false; + } else { + pos = $.inArray(this, this.parent.childList); + if( pos < 0 ){ + throw "Internal error"; + } + this.parent.childList.splice(pos, 1); + } + // Remove from source DOM parent + if(this.parent.ul){ + this.parent.ul.removeChild(this.li); + } + + // Insert this node to target parent's child list + this.parent = targetParent; + if( targetParent.hasChildren() ) { + switch(mode) { + case "child": + // Append to existing target children + targetParent.childList.push(this); + break; + case "before": + // Insert this node before target node + pos = $.inArray(targetNode, targetParent.childList); + if( pos < 0 ){ + throw "Internal error"; + } + targetParent.childList.splice(pos, 0, this); + break; + case "after": + // Insert this node after target node + pos = $.inArray(targetNode, targetParent.childList); + if( pos < 0 ){ + throw "Internal error"; + } + targetParent.childList.splice(pos+1, 0, this); + break; + default: + throw "Invalid mode " + mode; + } + } else { + targetParent.childList = [ this ]; + } + // Parent has no <ul> tag yet: + if( !targetParent.ul ) { + // This is the parent's first child: create UL tag + // (Hidden, because it will be + targetParent.ul = document.createElement("ul"); + targetParent.ul.style.display = "none"; + targetParent.li.appendChild(targetParent.ul); + } + // Issue 319: Add to target DOM parent (only if node was already rendered(expanded)) + if(this.li){ + targetParent.ul.appendChild(this.li); + } + + if( this.tree !== targetNode.tree ) { + // Fix node.tree for all source nodes + this.visit(function(node){ + node.tree = targetNode.tree; + }, null, true); + throw "Not yet implemented."; + } + // TODO: fix selection state + // TODO: fix active state + if( !prevParent.isDescendantOf(targetParent)) { + prevParent.render(); + } + if( !targetParent.isDescendantOf(prevParent) ) { + targetParent.render(); + } +// this.tree.redraw(); +/* + var tree = this.tree; + var opts = tree.options; + var pers = tree.persistence; + + + // Always expand, if it's below minExpandLevel +// tree.logDebug ("%s._addChildNode(%o), l=%o", this, dtnode, dtnode.getLevel()); + if ( opts.minExpandLevel >= dtnode.getLevel() ) { +// tree.logDebug ("Force expand for %o", dtnode); + this.bExpanded = true; + } + + // In multi-hier mode, update the parents selection state + // issue #82: only if not initializing, because the children may not exist yet +// if( !dtnode.data.isStatusNode && opts.selectMode==3 && !isInitializing ) +// dtnode._fixSelectionState(); + + // In multi-hier mode, update the parents selection state + if( dtnode.bSelected && opts.selectMode==3 ) { + var p = this; + while( p ) { + if( !p.hasSubSel ) + p._setSubSel(true); + p = p.parent; + } + } + // render this node and the new child + if ( tree.bEnableUpdate ) + this.render(); + + return dtnode; + +*/ + }, + + // --- end of class + lastentry: undefined +}; + +/************************************************************************* + * class DynaTreeStatus + */ + +var DynaTreeStatus = Class.create(); + + +DynaTreeStatus._getTreePersistData = function(cookieId, cookieOpts) { + // Static member: Return persistence information from cookies + var ts = new DynaTreeStatus(cookieId, cookieOpts); + ts.read(); + return ts.toDict(); +}; +// Make available in global scope +getDynaTreePersistData = DynaTreeStatus._getTreePersistData; // TODO: deprecated + + +DynaTreeStatus.prototype = { + // Constructor + initialize: function(cookieId, cookieOpts) { +// this._log("DynaTreeStatus: initialize"); + if( cookieId === undefined ){ + cookieId = $.ui.dynatree.prototype.options.cookieId; + } + cookieOpts = $.extend({}, $.ui.dynatree.prototype.options.cookie, cookieOpts); + + this.cookieId = cookieId; + this.cookieOpts = cookieOpts; + this.cookiesFound = undefined; + this.activeKey = null; + this.focusedKey = null; + this.expandedKeyList = null; + this.selectedKeyList = null; + }, + // member functions + _log: function(msg) { + // this.logDebug("_changeNodeList(%o): nodeList:%o, idx:%o", mode, nodeList, idx); + Array.prototype.unshift.apply(arguments, ["debug"]); + _log.apply(this, arguments); + }, + read: function() { +// this._log("DynaTreeStatus: read"); + // Read or init cookies. + this.cookiesFound = false; + + var cookie = $.cookie(this.cookieId + "-active"); + this.activeKey = cookie || ""; + if( cookie ){ + this.cookiesFound = true; + } + cookie = $.cookie(this.cookieId + "-focus"); + this.focusedKey = cookie || ""; + if( cookie ){ + this.cookiesFound = true; + } + cookie = $.cookie(this.cookieId + "-expand"); + this.expandedKeyList = cookie ? cookie.split(",") : []; + if( cookie ){ + this.cookiesFound = true; + } + cookie = $.cookie(this.cookieId + "-select"); + this.selectedKeyList = cookie ? cookie.split(",") : []; + if( cookie ){ + this.cookiesFound = true; + } + }, + write: function() { +// this._log("DynaTreeStatus: write"); + $.cookie(this.cookieId + "-active", ( this.activeKey === null ) ? "" : this.activeKey, this.cookieOpts); + $.cookie(this.cookieId + "-focus", ( this.focusedKey === null ) ? "" : this.focusedKey, this.cookieOpts); + $.cookie(this.cookieId + "-expand", ( this.expandedKeyList === null ) ? "" : this.expandedKeyList.join(","), this.cookieOpts); + $.cookie(this.cookieId + "-select", ( this.selectedKeyList === null ) ? "" : this.selectedKeyList.join(","), this.cookieOpts); + }, + addExpand: function(key) { +// this._log("addExpand(%o)", key); + if( $.inArray(key, this.expandedKeyList) < 0 ) { + this.expandedKeyList.push(key); + $.cookie(this.cookieId + "-expand", this.expandedKeyList.join(","), this.cookieOpts); + } + }, + clearExpand: function(key) { +// this._log("clearExpand(%o)", key); + var idx = $.inArray(key, this.expandedKeyList); + if( idx >= 0 ) { + this.expandedKeyList.splice(idx, 1); + $.cookie(this.cookieId + "-expand", this.expandedKeyList.join(","), this.cookieOpts); + } + }, + addSelect: function(key) { +// this._log("addSelect(%o)", key); + if( $.inArray(key, this.selectedKeyList) < 0 ) { + this.selectedKeyList.push(key); + $.cookie(this.cookieId + "-select", this.selectedKeyList.join(","), this.cookieOpts); + } + }, + clearSelect: function(key) { +// this._log("clearSelect(%o)", key); + var idx = $.inArray(key, this.selectedKeyList); + if( idx >= 0 ) { + this.selectedKeyList.splice(idx, 1); + $.cookie(this.cookieId + "-select", this.selectedKeyList.join(","), this.cookieOpts); + } + }, + isReloading: function() { + return this.cookiesFound === true; + }, + toDict: function() { + return { + cookiesFound: this.cookiesFound, + activeKey: this.activeKey, + focusedKey: this.activeKey, + expandedKeyList: this.expandedKeyList, + selectedKeyList: this.selectedKeyList + }; + }, + // --- end of class + lastentry: undefined +}; + + +/************************************************************************* + * class DynaTree + */ + +var DynaTree = Class.create(); + +// --- Static members ---------------------------------------------------------- + +DynaTree.version = "@@Version"; + +//--- Class members ------------------------------------------------------------ + +DynaTree.prototype = { + // Constructor + initialize: function($widget) { + // instance members + this.phase = "init"; + this.$widget = $widget; + this.options = $widget.options; + this.$tree = $widget.element; + this.timer = null; + // find container element + this.divTree = this.$tree.get(0); + + _initDragAndDrop(this); + }, + + // member functions + + _load: function(callback) { + var $widget = this.$widget; + var opts = this.options, + self = this; + this.bEnableUpdate = true; + this._nodeCount = 1; + this.activeNode = null; + this.focusNode = null; + + // Some deprecation warnings to help with migration + if( opts.rootVisible !== undefined ){ + this.logWarning("Option 'rootVisible' is no longer supported."); + } + if( opts.minExpandLevel < 1 ) { + this.logWarning("Option 'minExpandLevel' must be >= 1."); + opts.minExpandLevel = 1; + } +// _log("warn", "jQuery.support.boxModel " + jQuery.support.boxModel); + + // If a 'options.classNames' dictionary was passed, still use defaults + // for undefined classes: + if( opts.classNames !== $.ui.dynatree.prototype.options.classNames ) { + opts.classNames = $.extend({}, $.ui.dynatree.prototype.options.classNames, opts.classNames); + } + if( opts.ajaxDefaults !== $.ui.dynatree.prototype.options.ajaxDefaults ) { + opts.ajaxDefaults = $.extend({}, $.ui.dynatree.prototype.options.ajaxDefaults, opts.ajaxDefaults); + } + if( opts.dnd !== $.ui.dynatree.prototype.options.dnd ) { + opts.dnd = $.extend({}, $.ui.dynatree.prototype.options.dnd, opts.dnd); + } + // Guess skin path, if not specified + if(!opts.imagePath) { + $("script").each( function () { + var _rexDtLibName = /.*dynatree[^\/]*\.js$/i; + if( this.src.search(_rexDtLibName) >= 0 ) { + if( this.src.indexOf("/")>=0 ){ // issue #47 + opts.imagePath = this.src.slice(0, this.src.lastIndexOf("/")) + "/skin/"; + }else{ + opts.imagePath = "skin/"; + } + self.logDebug("Guessing imagePath from '%s': '%s'", this.src, opts.imagePath); + return false; // first match + } + }); + } + + this.persistence = new DynaTreeStatus(opts.cookieId, opts.cookie); + if( opts.persist ) { + if( !$.cookie ){ + _log("warn", "Please include jquery.cookie.js to use persistence."); + } + this.persistence.read(); + } + this.logDebug("DynaTree.persistence: %o", this.persistence.toDict()); + + // Cached tag strings + this.cache = { + tagEmpty: "<span class='" + opts.classNames.empty + "'></span>", + tagVline: "<span class='" + opts.classNames.vline + "'></span>", + tagExpander: "<span class='" + opts.classNames.expander + "'></span>", + tagConnector: "<span class='" + opts.classNames.connector + "'></span>", + tagNodeIcon: "<span class='" + opts.classNames.nodeIcon + "'></span>", + tagCheckbox: "<span class='" + opts.classNames.checkbox + "'></span>", + lastentry: undefined + }; + + // Clear container, in case it contained some 'waiting' or 'error' text + // for clients that don't support JS. + // We don't do this however, if we try to load from an embedded UL element. + if( opts.children || (opts.initAjax && opts.initAjax.url) || opts.initId ){ + $(this.divTree).empty(); + } + var $ulInitialize = this.$tree.find(">ul:first").hide(); + + // Create the root element + this.tnRoot = new DynaTreeNode(null, this, {}); + this.tnRoot.bExpanded = true; + this.tnRoot.render(); + this.divTree.appendChild(this.tnRoot.ul); + + var root = this.tnRoot, + isReloading = ( opts.persist && this.persistence.isReloading() ), + isLazy = false, + prevFlag = this.enableUpdate(false); + + this.logDebug("Dynatree._load(): read tree structure..."); + + // Init tree structure + if( opts.children ) { + // Read structure from node array + root.addChild(opts.children); + + } else if( opts.initAjax && opts.initAjax.url ) { + // Init tree from AJAX request + isLazy = true; + root.data.isLazy = true; + this._reloadAjax(callback); + + } else if( opts.initId ) { + // Init tree from another UL element + this._createFromTag(root, $("#"+opts.initId)); + + } else { + // Init tree from the first UL element inside the container <div> +// var $ul = this.$tree.find(">ul:first").hide(); + this._createFromTag(root, $ulInitialize); + $ulInitialize.remove(); + } + + this._checkConsistency(); + // Fix part-sel flags + if(!isLazy && opts.selectMode == 3){ + root._updatePartSelectionState(); + } + // Render html markup + this.logDebug("Dynatree._load(): render nodes..."); + this.enableUpdate(prevFlag); + + // bind event handlers + this.logDebug("Dynatree._load(): bind events..."); + this.$widget.bind(); + + // --- Post-load processing + this.logDebug("Dynatree._load(): postInit..."); + this.phase = "postInit"; + + // In persist mode, make sure that cookies are written, even if they are empty + if( opts.persist ) { + this.persistence.write(); + } + // Set focus, if possible (this will also fire an event and write a cookie) + if( this.focusNode && this.focusNode.isVisible() ) { + this.logDebug("Focus on init: %o", this.focusNode); + this.focusNode.focus(); + } + if( !isLazy ) { + if( opts.onPostInit ) { + opts.onPostInit.call(this, isReloading, false); + } + if( callback ){ + callback.call(this, "ok"); + } + } + this.phase = "idle"; + }, + + _reloadAjax: function(callback) { + // Reload + var opts = this.options; + if( ! opts.initAjax || ! opts.initAjax.url ){ + throw "tree.reload() requires 'initAjax' mode."; + } + var pers = this.persistence; + var ajaxOpts = $.extend({}, opts.initAjax); + // Append cookie info to the request +// this.logDebug("reloadAjax: key=%o, an.key:%o", pers.activeKey, this.activeNode?this.activeNode.data.key:"?"); + if( ajaxOpts.addActiveKey ){ + ajaxOpts.data.activeKey = pers.activeKey; + } + if( ajaxOpts.addFocusedKey ){ + ajaxOpts.data.focusedKey = pers.focusedKey; + } + if( ajaxOpts.addExpandedKeyList ){ + ajaxOpts.data.expandedKeyList = pers.expandedKeyList.join(","); + } + if( ajaxOpts.addSelectedKeyList ){ + ajaxOpts.data.selectedKeyList = pers.selectedKeyList.join(","); + } + // Set up onPostInit callback to be called when Ajax returns + if( ajaxOpts.success ){ + this.logWarning("initAjax: success callback is ignored; use onPostInit instead."); + } + if( ajaxOpts.error ){ + this.logWarning("initAjax: error callback is ignored; use onPostInit instead."); + } + var isReloading = pers.isReloading(); + ajaxOpts.success = function(dtnode, data, textStatus) { + if(opts.selectMode == 3){ + dtnode.tree.tnRoot._updatePartSelectionState(); + } + if(opts.onPostInit){ + opts.onPostInit.call(dtnode.tree, isReloading, false); + } + if(callback){ + callback.call(dtnode.tree, "ok"); + } + }; + ajaxOpts.error = function(dtnode, XMLHttpRequest, textStatus, errorThrown) { + if(opts.onPostInit){ + opts.onPostInit.call(dtnode.tree, isReloading, true, XMLHttpRequest, textStatus, errorThrown); + } + if(callback){ + callback.call(dtnode.tree, "error", XMLHttpRequest, textStatus, errorThrown); + } + }; +// } + this.logDebug("Dynatree._init(): send Ajax request..."); + this.tnRoot.appendAjax(ajaxOpts); + }, + + toString: function() { + return "Dynatree '" + this.$tree.attr("id") + "'"; + }, + + toDict: function(includeRoot) { + var dict = this.tnRoot.toDict(true); + return includeRoot ? dict : dict.children; + }, + + serializeArray: function(stopOnParents) { + // Return a JavaScript array of objects, ready to be encoded as a JSON + // string for selected nodes + var nodeList = this.getSelectedNodes(stopOnParents), + name = this.$tree.attr("name") || this.$tree.attr("id"), + arr = []; + for(var i=0, l=nodeList.length; i<l; i++){ + arr.push({name: name, value: nodeList[i].data.key}); + } + return arr; + }, + + getPersistData: function() { + return this.persistence.toDict(); + }, + + logDebug: function(msg) { + if( this.options.debugLevel >= 2 ) { + Array.prototype.unshift.apply(arguments, ["debug"]); + _log.apply(this, arguments); + } + }, + + logInfo: function(msg) { + if( this.options.debugLevel >= 1 ) { + Array.prototype.unshift.apply(arguments, ["info"]); + _log.apply(this, arguments); + } + }, + + logWarning: function(msg) { + Array.prototype.unshift.apply(arguments, ["warn"]); + _log.apply(this, arguments); + }, + + isInitializing: function() { + return ( this.phase=="init" || this.phase=="postInit" ); + }, + isReloading: function() { + return ( this.phase=="init" || this.phase=="postInit" ) && this.options.persist && this.persistence.cookiesFound; + }, + isUserEvent: function() { + return ( this.phase=="userEvent" ); + }, + + redraw: function() { +// this.logDebug("dynatree.redraw()..."); + this.tnRoot.render(false, false); +// this.logDebug("dynatree.redraw() done."); + }, + renderInvisibleNodes: function() { + this.tnRoot.render(false, true); + }, + reload: function(callback) { + this._load(callback); + }, + + getRoot: function() { + return this.tnRoot; + }, + + enable: function() { + this.$widget.enable(); + }, + + disable: function() { + this.$widget.disable(); + }, + + getNodeByKey: function(key) { + // Search the DOM by element ID (assuming this is faster than traversing all nodes). + // $("#...") has problems, if the key contains '.', so we use getElementById() + var el = document.getElementById(this.options.idPrefix + key); + if( el ){ + return el.dtnode ? el.dtnode : null; + } + // Not found in the DOM, but still may be in an unrendered part of tree + var match = null; + this.visit(function(node){ +// window.console.log("%s", node); + if(node.data.key === key) { + match = node; + return false; + } + }, true); + return match; + }, + + getActiveNode: function() { + return this.activeNode; + }, + + reactivate: function(setFocus) { + // Re-fire onQueryActivate and onActivate events. + var node = this.activeNode; +// this.logDebug("reactivate %o", node); + if( node ) { + this.activeNode = null; // Force re-activating + node.activate(); + if( setFocus ){ + node.focus(); + } + } + }, + + getSelectedNodes: function(stopOnParents) { + var nodeList = []; + this.tnRoot.visit(function(node){ + if( node.bSelected ) { + nodeList.push(node); + if( stopOnParents === true ){ + return "skip"; // stop processing this branch + } + } + }); + return nodeList; + }, + + activateKey: function(key) { + var dtnode = (key === null) ? null : this.getNodeByKey(key); + if( !dtnode ) { + if( this.activeNode ){ + this.activeNode.deactivate(); + } + this.activeNode = null; + return null; + } + dtnode.focus(); + dtnode.activate(); + return dtnode; + }, + + loadKeyPath: function(keyPath, callback) { + var segList = keyPath.split(this.options.keyPathSeparator); + // Remove leading '/' + if(segList[0] === ""){ + segList.shift(); + } + // Remove leading system root key + if(segList[0] == this.tnRoot.data.key){ + this.logDebug("Removed leading root key."); + segList.shift(); + } + keyPath = segList.join(this.options.keyPathSeparator); + return this.tnRoot._loadKeyPath(keyPath, callback); + }, + + selectKey: function(key, select) { + var dtnode = this.getNodeByKey(key); + if( !dtnode ){ + return null; + } + dtnode.select(select); + return dtnode; + }, + + enableUpdate: function(bEnable) { + if ( this.bEnableUpdate==bEnable ){ + return bEnable; + } + this.bEnableUpdate = bEnable; + if ( bEnable ){ + this.redraw(); + } + return !bEnable; // return previous value + }, + + count: function() { + return this.tnRoot.countChildren(); + }, + + visit: function(fn, includeRoot) { + return this.tnRoot.visit(fn, includeRoot); + }, + + _createFromTag: function(parentTreeNode, $ulParent) { + // Convert a <UL>...</UL> list into children of the parent tree node. + var self = this; +/* +TODO: better? + this.$lis = $("li:has(a[href])", this.element); + this.$tabs = this.$lis.map(function() { return $("a", this)[0]; }); + */ + $ulParent.find(">li").each(function() { + var $li = $(this), + $liSpan = $li.find(">span:first"), + $liA = $li.find(">a:first"), + title, + href = null, + target = null, + tooltip; + if( $liSpan.length ) { + // If a <li><span> tag is specified, use it literally. + title = $liSpan.html(); + } else if( $liA.length ) { + title = $liA.html(); + href = $liA.attr("href"); + target = $liA.attr("target"); + tooltip = $liA.attr("title"); + } else { + // If only a <li> tag is specified, use the trimmed string up to + // the next child <ul> tag. + title = $li.html(); + var iPos = title.search(/<ul/i); + if( iPos >= 0 ){ + title = $.trim(title.substring(0, iPos)); + }else{ + title = $.trim(title); + } +// self.logDebug("%o", title); + } + // Parse node options from ID, title and class attributes + var data = { + title: title, + tooltip: tooltip, + isFolder: $li.hasClass("folder"), + isLazy: $li.hasClass("lazy"), + expand: $li.hasClass("expanded"), + select: $li.hasClass("selected"), + activate: $li.hasClass("active"), + focus: $li.hasClass("focused"), + noLink: $li.hasClass("noLink") + }; + if( href ){ + data.href = href; + data.target = target; + } + if( $li.attr("title") ){ + data.tooltip = $li.attr("title"); // overrides <a title='...'> + } + if( $li.attr("id") ){ + data.key = "" + $li.attr("id"); + } + // If a data attribute is present, evaluate as a JavaScript object + if( $li.attr("data") ) { + var dataAttr = $.trim($li.attr("data")); + if( dataAttr ) { + if( dataAttr.charAt(0) != "{" ){ + dataAttr = "{" + dataAttr + "}"; + } + try { + $.extend(data, eval("(" + dataAttr + ")")); + } catch(e) { + throw ("Error parsing node data: " + e + "\ndata:\n'" + dataAttr + "'"); + } + } + } + var childNode = parentTreeNode.addChild(data); + // Recursive reading of child nodes, if LI tag contains an UL tag + var $ul = $li.find(">ul:first"); + if( $ul.length ) { + self._createFromTag(childNode, $ul); // must use 'self', because 'this' is the each() context + } + }); + }, + + _checkConsistency: function() { +// this.logDebug("tree._checkConsistency() NOT IMPLEMENTED - %o", this); + }, + + _setDndStatus: function(sourceNode, targetNode, helper, hitMode, accept) { + // hitMode: 'after', 'before', 'over', 'out', 'start', 'stop' + var $source = sourceNode ? $(sourceNode.span) : null, + $target = $(targetNode.span), + posOpts, + markerOffsetX = 0, + markerAt = "center"; + + if( !this.$dndMarker ) { + this.$dndMarker = $("<div id='dynatree-drop-marker'></div>") + .hide() + .css({"z-index": 1000}) + .prependTo($(this.divTree).parent()); + +// logMsg("Creating marker: %o", this.$dndMarker); + } +/* + if(hitMode === "start"){ + } + if(hitMode === "stop"){ +// sourceNode.removeClass("dynatree-drop-target"); + } +*/ + if(hitMode === "after" || hitMode === "before" || hitMode === "over"){ +// $source && $source.addClass("dynatree-drag-source"); +// $target.addClass("dynatree-drop-target"); + + switch(hitMode){ + case "before": + this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over"); + this.$dndMarker.addClass("dynatree-drop-before"); + markerAt = "top"; + break; + case "after": + this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over"); + this.$dndMarker.addClass("dynatree-drop-after"); + markerAt = "bottom"; + break; + default: + this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before"); + this.$dndMarker.addClass("dynatree-drop-over"); + $target.addClass("dynatree-drop-target"); + markerOffsetX = 8; + } +// logMsg("Creating marker: %o", this.$dndMarker); +// logMsg(" $target.offset=%o", $target); +// logMsg(" pos/$target.offset=%o", pos); +// logMsg(" $target.position=%o", $target.position()); +// logMsg(" $target.offsetParent=%o, ot:%o", $target.offsetParent(), $target.offsetParent().offset()); +// logMsg(" $(this.divTree).offset=%o", $(this.divTree).offset()); +// logMsg(" $(this.divTree).parent=%o", $(this.divTree).parent()); +// var pos = $target.offset(); +// var parentPos = $target.offsetParent().offset(); +// var bodyPos = $target.offsetParent().offset(); + + if( jquerySupports.positionMyOfs ){ + posOpts = { + my: "left" + offsetString(markerOffsetX) + " center", + at: "left " + markerAt, + of: $target + }; + } else { + posOpts = { + my: "left center", + at: "left " + markerAt, + of: $target, + offset: "" + markerOffsetX + " 0" + }; + } + this.$dndMarker + .show() + .position(posOpts); + +// helper.addClass("dynatree-drop-hover"); + } else { +// $source && $source.removeClass("dynatree-drag-source"); + $target.removeClass("dynatree-drop-target"); + this.$dndMarker.hide(); +// helper.removeClass("dynatree-drop-hover"); + } + if(hitMode === "after"){ + $target.addClass("dynatree-drop-after"); + } else { + $target.removeClass("dynatree-drop-after"); + } + if(hitMode === "before"){ + $target.addClass("dynatree-drop-before"); + } else { + $target.removeClass("dynatree-drop-before"); + } + if(accept === true){ + if($source){ + $source.addClass("dynatree-drop-accept"); + } + $target.addClass("dynatree-drop-accept"); + helper.addClass("dynatree-drop-accept"); + }else{ + if($source){ + $source.removeClass("dynatree-drop-accept"); + } + $target.removeClass("dynatree-drop-accept"); + helper.removeClass("dynatree-drop-accept"); + } + if(accept === false){ + if($source){ + $source.addClass("dynatree-drop-reject"); + } + $target.addClass("dynatree-drop-reject"); + helper.addClass("dynatree-drop-reject"); + }else{ + if($source){ + $source.removeClass("dynatree-drop-reject"); + } + $target.removeClass("dynatree-drop-reject"); + helper.removeClass("dynatree-drop-reject"); + } + }, + + _onDragEvent: function(eventName, node, otherNode, event, ui, draggable) { + /** + * Handles drag'n'drop functionality. + * + * A standard jQuery drag-and-drop process may generate these calls: + * + * draggable helper(): + * _onDragEvent("helper", sourceNode, null, event, null, null); + * start: + * _onDragEvent("start", sourceNode, null, event, ui, draggable); + * drag: + * _onDragEvent("leave", prevTargetNode, sourceNode, event, ui, draggable); + * _onDragEvent("over", targetNode, sourceNode, event, ui, draggable); + * _onDragEvent("enter", targetNode, sourceNode, event, ui, draggable); + * stop: + * _onDragEvent("drop", targetNode, sourceNode, event, ui, draggable); + * _onDragEvent("leave", targetNode, sourceNode, event, ui, draggable); + * _onDragEvent("stop", sourceNode, null, event, ui, draggable); + */ + var hitMode, enterResponse, r, + dnd = this.options.dnd, + res = null, + nodeTag = $(node.span); + + switch (eventName) { + case "helper": + // Only event and node argument is available + var $helper = $("<div class='dynatree-drag-helper'><span class='dynatree-drag-helper-img' /></div>") + .append($(event.target).closest(".dynatree-title").clone()); +// .append($(event.target).closest('a').clone()); + // issue 244: helper should be child of scrollParent + $("ul.dynatree-container", node.tree.divTree).append($helper); +// $(node.tree.divTree).append($helper); + // Attach node reference to helper object + $helper.data("dtSourceNode", node); + res = $helper; + break; + case "start": + if(node.isStatusNode()) { + res = false; + } else if(dnd.onDragStart) { + res = dnd.onDragStart(node); + } + if(res === false) { + this.logDebug("tree.onDragStart() cancelled"); + //draggable._clear(); + // NOTE: the return value seems to be ignored (drag is not canceled, when false is returned) + ui.helper.trigger("mouseup"); + ui.helper.hide(); + } else { + nodeTag.addClass("dynatree-drag-source"); + } + break; + case "enter": + r = dnd.onDragEnter ? dnd.onDragEnter(node, otherNode, ui, draggable) : null; + if(!r){ + // convert null, undefined, false to false + res = false; + }else if ( $.isArray(r) ) { + res = { + over: ($.inArray("over", r) >= 0), + before: ($.inArray("before", r) >= 0), + after: ($.inArray("after", r) >= 0) + }; + }else{ + res = { + over: ((r === true) || (r === "over")), + before: ((r === true) || (r === "before")), + after: ((r === true) || (r === "after")) + }; + } + ui.helper.data("enterResponse", res); +// this.logDebug("helper.enterResponse: %o", res); + break; + case "over": + enterResponse = ui.helper.data("enterResponse"); + hitMode = null; + if(enterResponse === false){ + // Don't call onDragOver if onEnter returned false. + // issue 332 +// break; + } else if(typeof enterResponse === "string") { + // Use hitMode from onEnter if provided. + hitMode = enterResponse; + } else { + // Calculate hitMode from relative cursor position. + var nodeOfs = nodeTag.offset(); + var relPos = { x: event.pageX - nodeOfs.left, + y: event.pageY - nodeOfs.top }; + var relPos2 = { x: relPos.x / nodeTag.width(), + y: relPos.y / nodeTag.height() }; + + if( enterResponse.after && relPos2.y > 0.75 ){ + hitMode = "after"; + } else if(!enterResponse.over && enterResponse.after && relPos2.y > 0.5 ){ + hitMode = "after"; + } else if(enterResponse.before && relPos2.y <= 0.25) { + hitMode = "before"; + } else if(!enterResponse.over && enterResponse.before && relPos2.y <= 0.5) { + hitMode = "before"; + } else if(enterResponse.over) { + hitMode = "over"; + } + // Prevent no-ops like 'before source node' + // TODO: these are no-ops when moving nodes, but not in copy mode + if( dnd.preventVoidMoves ){ + if(node === otherNode){ + hitMode = null; + }else if(hitMode === "before" && otherNode && node === otherNode.getNextSibling()){ + hitMode = null; + }else if(hitMode === "after" && otherNode && node === otherNode.getPrevSibling()){ + hitMode = null; + }else if(hitMode === "over" && otherNode + && otherNode.parent === node && otherNode.isLastSibling() ){ + hitMode = null; + } + } +// this.logDebug("hitMode: %s - %s - %s", hitMode, (node.parent === otherNode), node.isLastSibling()); + ui.helper.data("hitMode", hitMode); + } + // Auto-expand node (only when 'over' the node, not 'before', or 'after') + if(hitMode === "over" + && dnd.autoExpandMS && node.hasChildren() !== false && !node.bExpanded) { + node.scheduleAction("expand", dnd.autoExpandMS); + } + if(hitMode && dnd.onDragOver){ + res = dnd.onDragOver(node, otherNode, hitMode, ui, draggable); + if(res === "over" || res === "before" || res === "after") { + hitMode = res; + } + } + // issue 332 +// this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false); + this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false && hitMode !== null); + break; + case "drop": + // issue 286: don't trigger onDrop, if DnD status is 'reject' + var isForbidden = ui.helper.hasClass("dynatree-drop-reject"); + hitMode = ui.helper.data("hitMode"); + if(hitMode && dnd.onDrop && !isForbidden){ + dnd.onDrop(node, otherNode, hitMode, ui, draggable); + } + break; + case "leave": + // Cancel pending expand request + node.scheduleAction("cancel"); + ui.helper.data("enterResponse", null); + ui.helper.data("hitMode", null); + this._setDndStatus(otherNode, node, ui.helper, "out", undefined); + if(dnd.onDragLeave){ + dnd.onDragLeave(node, otherNode, ui, draggable); + } + break; + case "stop": + nodeTag.removeClass("dynatree-drag-source"); + if(dnd.onDragStop){ + dnd.onDragStop(node); + } + break; + default: + throw "Unsupported drag event: " + eventName; + } + return res; + }, + + cancelDrag: function() { + var dd = $.ui.ddmanager.current; + if(dd){ + dd.cancel(); + } + }, + + // --- end of class + lastentry: undefined +}; + +/************************************************************************* + * Widget $(..).dynatree + */ + +$.widget("ui.dynatree", { +/* + init: function() { + // ui.core 1.6 renamed init() to _init(): this stub assures backward compatibility + _log("warn", "ui.dynatree.init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher."); + return this._init(); + }, + */ + _init: function() { +// if( parseFloat($.ui.version) < 1.8 ) { + if(versionCompare($.ui.version, "1.8") < 0){ + // jquery.ui.core 1.8 renamed _init() to _create(): this stub assures backward compatibility + if(this.options.debugLevel >= 0){ + _log("warn", "ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher."); + } + return this._create(); + } + // jquery.ui.core 1.8 still uses _init() to perform "default functionality" + if(this.options.debugLevel >= 2){ + _log("debug", "ui.dynatree._init() was called; no current default functionality."); + } + }, + + _create: function() { + var opts = this.options; + if(opts.debugLevel >= 1){ + logMsg("Dynatree._create(): version='%s', debugLevel=%o.", $.ui.dynatree.version, this.options.debugLevel); + } + // The widget framework supplies this.element and this.options. + this.options.event += ".dynatree"; // namespace event + + var divTree = this.element.get(0); +/* // Clear container, in case it contained some 'waiting' or 'error' text + // for clients that don't support JS + if( opts.children || (opts.initAjax && opts.initAjax.url) || opts.initId ) + $(divTree).empty(); +*/ + // Create the DynaTree object + this.tree = new DynaTree(this); + this.tree._load(); + this.tree.logDebug("Dynatree._init(): done."); + }, + + bind: function() { + // Prevent duplicate binding + this.unbind(); + + var eventNames = "click.dynatree dblclick.dynatree"; + if( this.options.keyboard ){ + // Note: leading ' '! + eventNames += " keypress.dynatree keydown.dynatree"; + } + this.element.bind(eventNames, function(event){ + var dtnode = $.ui.dynatree.getNode(event.target); + if( !dtnode ){ + return true; // Allow bubbling of other events + } + var tree = dtnode.tree; + var o = tree.options; + tree.logDebug("event(%s): dtnode: %s", event.type, dtnode); + var prevPhase = tree.phase; + tree.phase = "userEvent"; + try { + switch(event.type) { + case "click": + return ( o.onClick && o.onClick.call(tree, dtnode, event)===false ) ? false : dtnode._onClick(event); + case "dblclick": + return ( o.onDblClick && o.onDblClick.call(tree, dtnode, event)===false ) ? false : dtnode._onDblClick(event); + case "keydown": + return ( o.onKeydown && o.onKeydown.call(tree, dtnode, event)===false ) ? false : dtnode._onKeydown(event); + case "keypress": + return ( o.onKeypress && o.onKeypress.call(tree, dtnode, event)===false ) ? false : dtnode._onKeypress(event); + } + } catch(e) { + var _ = null; // issue 117 + tree.logWarning("bind(%o): dtnode: %o, error: %o", event, dtnode, e); + } finally { + tree.phase = prevPhase; + } + }); + + // focus/blur don't bubble, i.e. are not delegated to parent <div> tags, + // so we use the addEventListener capturing phase. + // See http://www.howtocreate.co.uk/tutorials/javascript/domevents + function __focusHandler(event) { + // Handles blur and focus. + // Fix event for IE: + // doesn't pass JSLint: +// event = arguments[0] = $.event.fix( event || window.event ); + // what jQuery does: +// var args = jQuery.makeArray( arguments ); +// event = args[0] = jQuery.event.fix( event || window.event ); + event = $.event.fix( event || window.event ); + var dtnode = $.ui.dynatree.getNode(event.target); + return dtnode ? dtnode._onFocus(event) : false; + } + var div = this.tree.divTree; + + if( div.addEventListener ) { + div.addEventListener("focus", __focusHandler, true); + div.addEventListener("blur", __focusHandler, true); + } else { + div.onfocusin = div.onfocusout = __focusHandler; + } + // EVENTS + // disable click if event is configured to something else +// if (!(/^click/).test(o.event)) +// this.$tabs.bind("click.tabs", function() { return false; }); + + }, + + unbind: function() { + this.element.unbind(".dynatree"); + }, + +/* TODO: we could handle option changes during runtime here (maybe to re-render, ...) + setData: function(key, value) { + this.tree.logDebug("dynatree.setData('" + key + "', '" + value + "')"); + }, +*/ + enable: function() { + this.bind(); + // Call default disable(): remove -disabled from css: + $.Widget.prototype.enable.apply(this, arguments); + }, + + disable: function() { + this.unbind(); + // Call default disable(): add -disabled to css: + $.Widget.prototype.disable.apply(this, arguments); + }, + + // --- getter methods (i.e. NOT returning a reference to $) + getTree: function() { + return this.tree; + }, + + getRoot: function() { + return this.tree.getRoot(); + }, + + getActiveNode: function() { + return this.tree.getActiveNode(); + }, + + getSelectedNodes: function() { + return this.tree.getSelectedNodes(); + }, + + // ------------------------------------------------------------------------ + lastentry: undefined +}); + + +// The following methods return a value (thus breaking the jQuery call chain): +if(versionCompare($.ui.version, "1.8") < 0){ + $.ui.dynatree.getter = "getTree getRoot getActiveNode getSelectedNodes"; +} + +/******************************************************************************* + * Tools in ui.dynatree namespace + */ +$.extend($.ui.dynatree, { + /** @type {String} */ + version: "1.2.5-rc4", + /** @type {String} */ + buildType: "release", + /** Expose class object as $.ui.dynatree._DynaTreeClass */ + _DynaTreeClass: DynaTree, + /** Expose class object as $.ui.dynatree._DynaTreeNodeClass */ + _DynaTreeNodeClass: DynaTreeNode, + /** + * Return a DynaTreeNode object for a given DOM element + */ + getNode: function(el) { + if(el instanceof DynaTreeNode){ + return el; // el already was a DynaTreeNode + } + if(el.selector !== undefined){ + el = el[0]; // el was a jQuery object: use the DOM element + } + // TODO: for some reason $el.parents("[dtnode]") does not work (jQuery 1.6.1) + // maybe, because dtnode is a property, not an attribute + while( el ) { + if(el.dtnode) { + return el.dtnode; + } + el = el.parentNode; + } + return null; + }, + /**Return persistence information from cookies.*/ + getPersistData: DynaTreeStatus._getTreePersistData +}); + + + +/******************************************************************************* + * Plugin default options: + */ +$.ui.dynatree.prototype.options = { + title: "Dynatree", // Tree's name (only used for debug output) + minExpandLevel: 1, // 1: root node is not collapsible + imagePath: null, // Path to a folder containing icons. Defaults to 'skin/' subdirectory. + children: null, // Init tree structure from this object array. + initId: null, // Init tree structure from a <ul> element with this ID. + initAjax: null, // Ajax options used to initialize the tree strucuture. + autoFocus: true, // Set focus to first child, when expanding or lazy-loading. + keyboard: true, // Support keyboard navigation. + persist: false, // Persist expand-status to a cookie + autoCollapse: false, // Automatically collapse all siblings, when a node is expanded. + clickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand + activeVisible: true, // Make sure, active nodes are visible (expanded). + checkbox: false, // Show checkboxes. + selectMode: 2, // 1:single, 2:multi, 3:multi-hier + fx: null, // Animations, e.g. null or { height: "toggle", duration: 200 } + noLink: false, // Use <span> instead of <a> tags for all nodes + // Low level event handlers: onEvent(dtnode, event): return false, to stop default processing + onClick: null, // null: generate focus, expand, activate, select events. + onDblClick: null, // (No default actions.) + onKeydown: null, // null: generate keyboard navigation (focus, expand, activate). + onKeypress: null, // (No default actions.) + onFocus: null, // null: set focus to node. + onBlur: null, // null: remove focus from node. + + // Pre-event handlers onQueryEvent(flag, dtnode): return false, to stop processing + onQueryActivate: null, // Callback(flag, dtnode) before a node is (de)activated. + onQuerySelect: null, // Callback(flag, dtnode) before a node is (de)selected. + onQueryExpand: null, // Callback(flag, dtnode) before a node is expanded/collpsed. + + // High level event handlers + onPostInit: null, // Callback(isReloading, isError) when tree was (re)loaded. + onActivate: null, // Callback(dtnode) when a node is activated. + onDeactivate: null, // Callback(dtnode) when a node is deactivated. + onSelect: null, // Callback(flag, dtnode) when a node is (de)selected. + onExpand: null, // Callback(flag, dtnode) when a node is expanded/collapsed. + onLazyRead: null, // Callback(dtnode) when a lazy node is expanded for the first time. + onCustomRender: null, // Callback(dtnode) before a node is rendered. Return a HTML string to override. + onCreate: null, // Callback(dtnode, nodeSpan) after a node was rendered for the first time. + onRender: null, // Callback(dtnode, nodeSpan) after a node was rendered. + // postProcess is similar to the standard dataFilter hook, + // but it is also called for JSONP + postProcess: null, // Callback(data, dataType) before an Ajax result is passed to dynatree + + // Drag'n'drop support + dnd: { + // Make tree nodes draggable: + onDragStart: null, // Callback(sourceNode), return true, to enable dnd + onDragStop: null, // Callback(sourceNode) +// helper: null, + revert: false, // true: slide helper back to source if drop is rejected + // Make tree nodes accept draggables + autoExpandMS: 1000, // Expand nodes after n milliseconds of hovering. + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: null, // Callback(targetNode, sourceNode, ui, draggable) + onDragOver: null, // Callback(targetNode, sourceNode, hitMode) + onDrop: null, // Callback(targetNode, sourceNode, hitMode, ui, draggable) + onDragLeave: null // Callback(targetNode, sourceNode) + }, + ajaxDefaults: { // Used by initAjax option + cache: false, // false: Append random '_' argument to the request url to prevent caching. + timeout: 0, // >0: Make sure we get an ajax error for invalid URLs + dataType: "json" // Expect json format and pass json object to callbacks. + }, + strings: { + loading: "Loading…", + loadError: "Load error!" + }, + generateIds: false, // Generate id attributes like <span id='dynatree-id-KEY'> + idPrefix: "dynatree-id-", // Used to generate node id's like <span id="dynatree-id-<key>">. + keyPathSeparator: "/", // Used by node.getKeyPath() and tree.loadKeyPath(). +// cookieId: "dynatree-cookie", // Choose a more unique name, to allow multiple trees. + cookieId: "dynatree", // Choose a more unique name, to allow multiple trees. + cookie: { + expires: null //7, // Days or Date; null: session cookie +// path: "/", // Defaults to current page +// domain: "jquery.com", +// secure: true + }, + // Class names used, when rendering the HTML markup. + // Note: + // These settings only apply on initialisation. + // If only single entries are passed for options.classNames, all other + // values are still set to default. + classNames: { + container: "dynatree-container", + node: "dynatree-node", + folder: "dynatree-folder", +// document: "dynatree-document", + + empty: "dynatree-empty", + vline: "dynatree-vline", + expander: "dynatree-expander", + connector: "dynatree-connector", + checkbox: "dynatree-checkbox", + nodeIcon: "dynatree-icon", + title: "dynatree-title", + noConnector: "dynatree-no-connector", + + nodeError: "dynatree-statusnode-error", + nodeWait: "dynatree-statusnode-wait", + hidden: "dynatree-hidden", + combinedExpanderPrefix: "dynatree-exp-", + combinedIconPrefix: "dynatree-ico-", + nodeLoading: "dynatree-loading", +// disabled: "dynatree-disabled", + hasChildren: "dynatree-has-children", + active: "dynatree-active", + selected: "dynatree-selected", + expanded: "dynatree-expanded", + lazy: "dynatree-lazy", + focused: "dynatree-focused", + partsel: "dynatree-partsel", + lastsib: "dynatree-lastsib" + }, + debugLevel: 1, // 0:quiet, 1:normal, 2:debug + + // ------------------------------------------------------------------------ + lastentry: undefined +}; +// +if(versionCompare($.ui.version, "1.8") < 0){ + $.ui.dynatree.defaults = $.ui.dynatree.prototype.options; +} + +/******************************************************************************* + * Reserved data attributes for a tree node. + */ +$.ui.dynatree.nodedatadefaults = { + title: null, // (required) Displayed name of the node (html is allowed here) + key: null, // May be used with activate(), select(), find(), ... + isFolder: false, // Use a folder icon. Also the node is expandable but not selectable. + isLazy: false, // Call onLazyRead(), when the node is expanded for the first time to allow for delayed creation of children. + tooltip: null, // Show this popup text. + href: null, // Added to the generated <a> tag. + icon: null, // Use a custom image (filename relative to tree.options.imagePath). 'null' for default icon, 'false' for no icon. + addClass: null, // Class name added to the node's span tag. + noLink: false, // Use <span> instead of <a> tag for this node + activate: false, // Initial active status. + focus: false, // Initial focused status. + expand: false, // Initial expanded status. + select: false, // Initial selected status. + hideCheckbox: false, // Suppress checkbox display for this node. + unselectable: false, // Prevent selection. +// disabled: false, + // The following attributes are only valid if passed to some functions: + children: null, // Array of child nodes. + // NOTE: we can also add custom attributes here. + // This may then also be used in the onActivate(), onSelect() or onLazyTree() callbacks. + // ------------------------------------------------------------------------ + lastentry: undefined +}; + +/******************************************************************************* + * Drag and drop support + */ +function _initDragAndDrop(tree) { + var dnd = tree.options.dnd || null; + // Register 'connectToDynatree' option with ui.draggable + if(dnd && (dnd.onDragStart || dnd.onDrop)) { + _registerDnd(); + } + // Attach ui.draggable to this Dynatree instance + if(dnd && dnd.onDragStart ) { + tree.$tree.draggable({ + addClasses: false, + appendTo: "body", + containment: false, + delay: 0, + distance: 4, +// revert: false, + // slide back, when dropping over non-target + revert: dnd.revert !== true ? false : function(dropped){ + // This is called by ui-draggable._mouseStop() when a drag stops. + // Return `true` to let the helper slide back. + logMsg("draggable.revert(), dropped=", dropped); + if(typeof dropped === "boolean"){ + // dropped == true, when dropped over a simple, valid droppable target. + // false, when dropped outside a drop target. + return !dropped; + } + // Drop comes from another tree. Default behavior is to assume + // a valid drop, since we are over a drop-target. + // Therefore we have to make an extra check, if the target node + // was rejected by a Dynatree callback. + var helper = $.ui.ddmanager && $.ui.ddmanager.current && $.ui.ddmanager.current.helper; + var isRejected = helper && helper.hasClass("dynatree-drop-reject"); + return isRejected; + }, + scroll: true, // issue 244: enable scrolling (if ul.dynatree-container) + scrollSpeed: 7, + scrollSensitivity: 10, + // Delegate draggable.start, drag, and stop events to our handler + connectToDynatree: true, + // Let source tree create the helper element + helper: function(event) { + var sourceNode = $.ui.dynatree.getNode(event.target); + if(!sourceNode){ // issue 211 + return "<div></div>"; + } + return sourceNode.tree._onDragEvent("helper", sourceNode, null, event, null, null); + }, + start: function(event, ui) { + // See issues 211, 268, 278 +// var sourceNode = $.ui.dynatree.getNode(event.target); + var sourceNode = ui.helper.data("dtSourceNode"); + return !!sourceNode; // Abort dragging if no Node could be found + } + }); + } + // Attach ui.droppable to this Dynatree instance + if(dnd && dnd.onDrop) { + tree.$tree.droppable({ + addClasses: false, + tolerance: "pointer", +// tolerance: "intersect", + greedy: false + }); + } +} + +//--- Extend ui.draggable event handling -------------------------------------- +var didRegisterDnd = false; +var _registerDnd = function() { + if(didRegisterDnd){ + return; + } + // Register proxy-functions for draggable.start/drag/stop + $.ui.plugin.add("draggable", "connectToDynatree", { + start: function(event, ui) { + // issue 386 + var draggable = $(this).data("ui-draggable") || $(this).data("draggable"), + sourceNode = ui.helper.data("dtSourceNode") || null; +// logMsg("draggable-connectToDynatree.start, %s", sourceNode); +// logMsg(" this: %o", this); +// logMsg(" event: %o", event); +// logMsg(" draggable: %o", draggable); +// logMsg(" ui: %o", ui); + + if(sourceNode) { + // Adjust helper offset, so cursor is slightly outside top/left corner +// draggable.offset.click.top -= event.target.offsetTop; +// draggable.offset.click.left -= event.target.offsetLeft; + draggable.offset.click.top = -2; + draggable.offset.click.left = + 16; +// logMsg(" draggable2: %o", draggable); +// logMsg(" draggable.offset.click FIXED: %s/%s", draggable.offset.click.left, draggable.offset.click.top); + // Trigger onDragStart event + // TODO: when called as connectTo..., the return value is ignored(?) + return sourceNode.tree._onDragEvent("start", sourceNode, null, event, ui, draggable); + } + }, + drag: function(event, ui) { + // issue 386 + var draggable = $(this).data("ui-draggable") || $(this).data("draggable"), + sourceNode = ui.helper.data("dtSourceNode") || null, + prevTargetNode = ui.helper.data("dtTargetNode") || null, + targetNode = $.ui.dynatree.getNode(event.target); +// logMsg("$.ui.dynatree.getNode(%o): %s", event.target, targetNode); +// logMsg("connectToDynatree.drag: helper: %o", ui.helper[0]); + if(event.target && !targetNode){ + // We got a drag event, but the targetNode could not be found + // at the event location. This may happen, + // 1. if the mouse jumped over the drag helper, + // 2. or if non-dynatree element is dragged + // We ignore it: + var isHelper = $(event.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length > 0; + if(isHelper){ +// logMsg("Drag event over helper: ignored."); + return; + } + } +// logMsg("draggable-connectToDynatree.drag: targetNode(from event): %s, dtTargetNode: %s", targetNode, ui.helper.data("dtTargetNode")); + ui.helper.data("dtTargetNode", targetNode); + // Leaving a tree node + if(prevTargetNode && prevTargetNode !== targetNode ) { + prevTargetNode.tree._onDragEvent("leave", prevTargetNode, sourceNode, event, ui, draggable); + } + if(targetNode){ + if(!targetNode.tree.options.dnd.onDrop) { + // not enabled as drop target + } else if(targetNode === prevTargetNode) { + // Moving over same node + targetNode.tree._onDragEvent("over", targetNode, sourceNode, event, ui, draggable); + }else{ + // Entering this node first time + targetNode.tree._onDragEvent("enter", targetNode, sourceNode, event, ui, draggable); + } + } + // else go ahead with standard event handling + }, + stop: function(event, ui) { + // issue 386 + var draggable = $(this).data("ui-draggable") || $(this).data("draggable"), + sourceNode = ui.helper.data("dtSourceNode") || null, + targetNode = ui.helper.data("dtTargetNode") || null, +// mouseDownEvent = draggable._mouseDownEvent, + eventType = event.type, + dropped = (eventType == "mouseup" && event.which == 1); + logMsg("draggable-connectToDynatree.stop: targetNode(from event): %s, dtTargetNode: %s", targetNode, ui.helper.data("dtTargetNode")); +// logMsg("draggable-connectToDynatree.stop, %s", sourceNode); +// logMsg(" type: %o, downEvent: %o, upEvent: %o", eventType, mouseDownEvent, event); +// logMsg(" targetNode: %o", targetNode); + if(!dropped){ + logMsg("Drag was cancelled"); + } + if(targetNode) { + if(dropped){ + targetNode.tree._onDragEvent("drop", targetNode, sourceNode, event, ui, draggable); + } + targetNode.tree._onDragEvent("leave", targetNode, sourceNode, event, ui, draggable); + } + if(sourceNode){ + sourceNode.tree._onDragEvent("stop", sourceNode, null, event, ui, draggable); + } + } + }); + didRegisterDnd = true; +}; + +// --------------------------------------------------------------------------- +}(jQuery)); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/jquery.dynatree.min.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/jquery.dynatree.min.js new file mode 100644 index 0000000000000000000000000000000000000000..e7e7db74b89c78e63e18f4c83d71d2f2fe3730b4 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/jquery.dynatree.min.js @@ -0,0 +1,4 @@ +/*! jQuery Dynatree Plugin - v1.2.5-rc4 - 2013-11-11 +* http://dynatree.googlecode.com/ +* Copyright (c) 2013 Martin Wendt; Licensed MIT, GPL */function _log(e){if(_canLog){var t=Array.prototype.slice.apply(arguments,[1]),i=new Date,s=i.getHours()+":"+i.getMinutes()+":"+i.getSeconds()+"."+i.getMilliseconds();t[0]=s+" - "+t[0];try{switch(e){case"info":window.console.info.apply(window.console,t);break;case"warn":window.console.warn.apply(window.console,t);break;default:window.console.log.apply(window.console,t)}}catch(n){window.console?-2146827850===n.number&&window.console.log(t.join(", ")):_canLog=!1}}}function logMsg(){Array.prototype.unshift.apply(arguments,["debug"]),_log.apply(this,arguments)}var _canLog=!0,getDynaTreePersistData=null,DTNodeStatus_Error=-1,DTNodeStatus_Loading=1,DTNodeStatus_Ok=0;(function($){function getDtNodeFromElement(e){return alert("getDtNodeFromElement is deprecated"),$.ui.dynatree.getNode(e)}function noop(){}function offsetString(e){return 0===e?"":e>0?"+"+e:""+e}function _checkBrowser(){function e(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}}var t,i;return t=e(navigator.userAgent),i={},t.browser&&(i[t.browser]=!0,i.version=t.version),i.chrome?i.webkit=!0:i.webkit&&(i.safari=!0),i}function versionCompare(e,t){var i,s,n,a=(""+e).split("."),r=(""+t).split("."),o=Math.min(a.length,r.length);for(n=0;o>n;n++)if(i=parseInt(a[n],10),s=parseInt(r[n],10),isNaN(i)&&(i=a[n]),isNaN(s)&&(s=r[n]),i!=s)return i>s?1:s>i?-1:0/0;return a.length===r.length?0:a.length<r.length?-1:1}function _initDragAndDrop(e){var t=e.options.dnd||null;t&&(t.onDragStart||t.onDrop)&&_registerDnd(),t&&t.onDragStart&&e.$tree.draggable({addClasses:!1,appendTo:"body",containment:!1,delay:0,distance:4,revert:t.revert!==!0?!1:function(e){if(logMsg("draggable.revert(), dropped=",e),"boolean"==typeof e)return!e;var t=$.ui.ddmanager&&$.ui.ddmanager.current&&$.ui.ddmanager.current.helper,i=t&&t.hasClass("dynatree-drop-reject");return i},scroll:!0,scrollSpeed:7,scrollSensitivity:10,connectToDynatree:!0,helper:function(e){var t=$.ui.dynatree.getNode(e.target);return t?t.tree._onDragEvent("helper",t,null,e,null,null):"<div></div>"},start:function(e,t){var i=t.helper.data("dtSourceNode");return!!i}}),t&&t.onDrop&&e.$tree.droppable({addClasses:!1,tolerance:"pointer",greedy:!1})}var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}},BROWSER=_checkBrowser(),jquerySupports={positionMyOfs:versionCompare($.ui.version,"1.9")>=0},DynaTreeNode=Class.create();DynaTreeNode.prototype={initialize:function(e,t,i){this.parent=e,this.tree=t,"string"==typeof i&&(i={title:i}),i.key=null==i.key?"_"+t._nodeCount++:""+i.key,this.data=$.extend({},$.ui.dynatree.nodedatadefaults,i),this.li=null,this.span=null,this.ul=null,this.childList=null,this._isLoading=!1,this.hasSubSel=!1,this.bExpanded=!1,this.bSelected=!1},toString:function(){return"DynaTreeNode<"+this.data.key+">: '"+this.data.title+"'"},toDict:function(e,t){var i,s=$.extend({},this.data);if(s.activate=this.tree.activeNode===this,s.focus=this.tree.focusNode===this,s.expand=this.bExpanded,s.select=this.bSelected,t&&t(s),e&&this.childList){s.children=[];for(var n=0,a=this.childList.length;a>n;n++)i=this.childList[n],i.isStatusNode()||s.children.push(i.toDict(!0,t))}else delete s.children;return s},fromDict:function(e){var t=e.children;return void 0===t?(this.data=$.extend(this.data,e),this.render(),void 0):(e=$.extend({},e),e.children=void 0,this.data=$.extend(this.data,e),this.removeChildren(),this.addChild(t),void 0)},_getInnerHtml:function(){var e,t=this.tree,i=t.options,s=t.cache,n=this.getLevel(),a=this.data,r="";i.minExpandLevel>n?n>1&&(r+=s.tagConnector):r+=this.hasChildren()!==!1?s.tagExpander:s.tagConnector,i.checkbox&&a.hideCheckbox!==!0&&!a.isStatusNode&&(r+=s.tagCheckbox),a.icon?(e="/"===a.icon.charAt(0)?a.icon:i.imagePath+a.icon,r+="<img src='"+e+"' alt='' />"):a.icon===!1||(r+=a.iconClass?"<span class=' "+a.iconClass+"'></span>":s.tagNodeIcon);var o="";if(i.onCustomRender&&(o=i.onCustomRender.call(t,this)||""),!o){var d=a.tooltip?' title="'+a.tooltip.replace(/\"/g,""")+'"':"",l=a.href||"#";o=i.noLink||a.noLink?'<span style="display:inline-block;" class="'+i.classNames.title+'"'+d+">"+a.title+"</span>":'<a href="'+l+'" class="'+i.classNames.title+'"'+d+">"+a.title+"</a>"}return r+=o},_fixOrder:function(){var e=this.childList;if(e&&this.ul)for(var t=this.ul.firstChild,i=0,s=e.length-1;s>i;i++){var n=e[i],a=t.dtnode;n!==a?(this.tree.logDebug("_fixOrder: mismatch at index "+i+": "+n+" != "+a),this.ul.insertBefore(n.li,a.li)):t=t.nextSibling}},render:function(e,t){var i=this.tree,s=this.parent,n=this.data,a=i.options,r=a.classNames,o=this.isLastSibling(),d=!1;if(s||this.ul){if(s){this.li||(d=!0,this.li=document.createElement("li"),this.li.dtnode=this,n.key&&a.generateIds&&(this.li.id=a.idPrefix+n.key),this.span=document.createElement("span"),this.span.className=r.title,this.li.appendChild(this.span),s.ul||(s.ul=document.createElement("ul"),s.ul.style.display="none",s.li.appendChild(s.ul)),s.ul.appendChild(this.li)),this.span.innerHTML=this._getInnerHtml();var l=[];l.push(r.node),n.isFolder&&l.push(r.folder),this.bExpanded&&l.push(r.expanded),this.hasChildren()!==!1&&l.push(r.hasChildren),n.isLazy&&null===this.childList&&l.push(r.lazy),o&&l.push(r.lastsib),this.bSelected&&l.push(r.selected),this.hasSubSel&&l.push(r.partsel),i.activeNode===this&&l.push(r.active),n.addClass&&l.push(n.addClass),l.push(r.combinedExpanderPrefix+(this.bExpanded?"e":"c")+(n.isLazy&&null===this.childList?"d":"")+(o?"l":"")),l.push(r.combinedIconPrefix+(this.bExpanded?"e":"c")+(n.isFolder?"f":"")),this.span.className=l.join(" "),this.li.className=o?r.lastsib:"",d&&a.onCreate&&a.onCreate.call(i,this,this.span),a.onRender&&a.onRender.call(i,this,this.span)}}else this.li=this.span=null,this.ul=document.createElement("ul"),this.ul.className=a.minExpandLevel>1?r.container+" "+r.noConnector:r.container;if((this.bExpanded||t===!0)&&this.childList){for(var h=0,c=this.childList.length;c>h;h++)this.childList[h].render(!1,t);this._fixOrder()}if(this.ul){var u="none"===this.ul.style.display,p=!!this.bExpanded;if(e&&a.fx&&u===p){var f=a.fx.duration||200;$(this.ul).animate(a.fx,f)}else this.ul.style.display=this.bExpanded||!s?"":"none"}},getKeyPath:function(e){var t=[];return this.visitParents(function(e){e.parent&&t.unshift(e.data.key)},!e),"/"+t.join(this.tree.options.keyPathSeparator)},getParent:function(){return this.parent},getChildren:function(){return void 0===this.hasChildren()?void 0:this.childList},hasChildren:function(){return this.data.isLazy?null===this.childList||void 0===this.childList?void 0:0===this.childList.length?!1:1===this.childList.length&&this.childList[0].isStatusNode()?void 0:!0:!!this.childList},isFirstSibling:function(){var e=this.parent;return!e||e.childList[0]===this},isLastSibling:function(){var e=this.parent;return!e||e.childList[e.childList.length-1]===this},isLoading:function(){return!!this._isLoading},getPrevSibling:function(){if(!this.parent)return null;for(var e=this.parent.childList,t=1,i=e.length;i>t;t++)if(e[t]===this)return e[t-1];return null},getNextSibling:function(){if(!this.parent)return null;for(var e=this.parent.childList,t=0,i=e.length-1;i>t;t++)if(e[t]===this)return e[t+1];return null},isStatusNode:function(){return this.data.isStatusNode===!0},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(e){if(!e)return!1;for(var t=this.parent;t;){if(t===e)return!0;t=t.parent}return!1},countChildren:function(){var e=this.childList;if(!e)return 0;for(var t=e.length,i=0,s=t;s>i;i++){var n=e[i];t+=n.countChildren()}return t},sortChildren:function(e,t){var i=this.childList;if(i){if(e=e||function(e,t){var i=e.data.title.toLowerCase(),s=t.data.title.toLowerCase();return i===s?0:i>s?1:-1},i.sort(e),t)for(var s=0,n=i.length;n>s;s++)i[s].childList&&i[s].sortChildren(e,"$norender$");"$norender$"!==t&&this.render()}},_setStatusNode:function(e){var t=this.childList?this.childList[0]:null;if(e)t?(e.isStatusNode=!0,e.key="_statusNode",t.data=e,t.render()):(e.isStatusNode=!0,e.key="_statusNode",t=this.addChild(e));else if(t&&t.isStatusNode()){try{this.ul&&(this.ul.removeChild(t.li),t.li=null)}catch(i){}1===this.childList.length?this.childList=[]:this.childList.shift()}},setLazyNodeStatus:function(e,t){var i=t&&t.tooltip?t.tooltip:null,s=t&&t.info?" ("+t.info+")":"";switch(e){case DTNodeStatus_Ok:this._setStatusNode(null),$(this.span).removeClass(this.tree.options.classNames.nodeLoading),this._isLoading=!1,this.tree.options.autoFocus&&(this===this.tree.tnRoot&&this.childList&&this.childList.length>0?this.childList[0].focus():this.focus());break;case DTNodeStatus_Loading:this._isLoading=!0,$(this.span).addClass(this.tree.options.classNames.nodeLoading),this.parent||this._setStatusNode({title:this.tree.options.strings.loading+s,tooltip:i,addClass:this.tree.options.classNames.nodeWait});break;case DTNodeStatus_Error:this._isLoading=!1,this._setStatusNode({title:this.tree.options.strings.loadError+s,tooltip:i,addClass:this.tree.options.classNames.nodeError});break;default:throw"Bad LazyNodeStatus: '"+e+"'."}},_parentList:function(e,t){for(var i=[],s=t?this:this.parent;s;)(e||s.parent)&&i.unshift(s),s=s.parent;return i},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},_getTypeForOuterNodeEvent:function(e){var t=this.tree.options.classNames,i=e.target;if(0>i.className.indexOf(t.node))return null;for(var s=e.pageX-i.offsetLeft,n=e.pageY-i.offsetTop,a=0,r=i.childNodes.length;r>a;a++){var o=i.childNodes[a],d=o.offsetLeft-i.offsetLeft,l=o.offsetTop-i.offsetTop,h=o.clientWidth,c=o.clientHeight;if(s>=d&&d+h>=s&&n>=l&&l+c>=n){if(o.className==t.title)return"title";if(o.className==t.expander)return"expander";if(o.className==t.checkbox)return"checkbox";if(o.className==t.nodeIcon)return"icon"}}return"prefix"},getEventTargetType:function(e){var t=e&&e.target?e.target.className:"",i=this.tree.options.classNames;return t.indexOf(i.title)>=0?"title":t.indexOf(i.expander)>=0?"expander":t.indexOf(i.checkbox)>=0?"checkbox":t.indexOf(i.nodeIcon)>=0?"icon":t.indexOf(i.empty)>=0||t.indexOf(i.vline)>=0||t.indexOf(i.connector)>=0?"prefix":t.indexOf(i.node)>=0?this._getTypeForOuterNodeEvent(e):null},isVisible:function(){for(var e=this._parentList(!0,!1),t=0,i=e.length;i>t;t++)if(!e[t].bExpanded)return!1;return!0},makeVisible:function(){for(var e=this._parentList(!0,!1),t=0,i=e.length;i>t;t++)e[t]._expand(!0)},focus:function(){this.makeVisible();try{$(this.span).find(">a").focus()}catch(e){}},isFocused:function(){return this.tree.tnFocused===this},_activate:function(e,t){this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o",e,t,this);var i=this.tree.options;if(!(this.data.isStatusNode||t&&i.onQueryActivate&&i.onQueryActivate.call(this.tree,e,this)===!1))if(e){if(this.tree.activeNode){if(this.tree.activeNode===this)return;this.tree.activeNode.deactivate()}i.activeVisible&&this.makeVisible(),this.tree.activeNode=this,i.persist&&$.cookie(i.cookieId+"-active",this.data.key,i.cookie),this.tree.persistence.activeKey=this.data.key,$(this.span).addClass(i.classNames.active),t&&i.onActivate&&i.onActivate.call(this.tree,this)}else if(this.tree.activeNode===this){if(i.onQueryActivate&&i.onQueryActivate.call(this.tree,!1,this)===!1)return;$(this.span).removeClass(i.classNames.active),i.persist&&$.cookie(i.cookieId+"-active","",i.cookie),this.tree.persistence.activeKey=null,this.tree.activeNode=null,t&&i.onDeactivate&&i.onDeactivate.call(this.tree,this)}},activate:function(){this._activate(!0,!0)},activateSilently:function(){this._activate(!0,!1)},deactivate:function(){this._activate(!1,!0)},isActive:function(){return this.tree.activeNode===this},_userActivate:function(){var e=!0,t=!1;if(this.data.isFolder)switch(this.tree.options.clickFolderMode){case 2:e=!1,t=!0;break;case 3:e=t=!0}null===this.parent&&(t=!1),t&&(this.toggleExpand(),this.focus()),e&&this.activate()},_setSubSel:function(e){e?(this.hasSubSel=!0,$(this.span).addClass(this.tree.options.classNames.partsel)):(this.hasSubSel=!1,$(this.span).removeClass(this.tree.options.classNames.partsel))},_updatePartSelectionState:function(){var e;if(!this.hasChildren())return e=this.bSelected&&!this.data.unselectable&&!this.data.isStatusNode,this._setSubSel(!1),e;var t,i,s=this.childList,n=!0,a=!0;for(t=0,i=s.length;i>t;t++){var r=s[t],o=r._updatePartSelectionState();o!==!1&&(a=!1),o!==!0&&(n=!1)}return e=n?!0:a?!1:void 0,this._setSubSel(void 0===e),this.bSelected=e===!0,e},_fixSelectionState:function(){var e,t,i;if(this.bSelected)for(this.visit(function(e){e.parent._setSubSel(!0),e.data.unselectable||e._select(!0,!1,!1)}),e=this.parent;e;){e._setSubSel(!0);var s=!0;for(t=0,i=e.childList.length;i>t;t++){var n=e.childList[t];if(!n.bSelected&&!n.data.isStatusNode&&!n.data.unselectable){s=!1;break}}s&&e._select(!0,!1,!1),e=e.parent}else for(this._setSubSel(!1),this.visit(function(e){e._setSubSel(!1),e._select(!1,!1,!1)}),e=this.parent;e;){e._select(!1,!1,!1);var a=!1;for(t=0,i=e.childList.length;i>t;t++)if(e.childList[t].bSelected||e.childList[t].hasSubSel){a=!0;break}e._setSubSel(a),e=e.parent}},_select:function(e,t,i){var s=this.tree.options;this.data.isStatusNode||this.bSelected!==e&&(t&&s.onQuerySelect&&s.onQuerySelect.call(this.tree,e,this)===!1||(1==s.selectMode&&e&&this.tree.visit(function(e){return e.bSelected?(e._select(!1,!1,!1),!1):void 0}),this.bSelected=e,e?(s.persist&&this.tree.persistence.addSelect(this.data.key),$(this.span).addClass(s.classNames.selected),i&&3===s.selectMode&&this._fixSelectionState(),t&&s.onSelect&&s.onSelect.call(this.tree,!0,this)):(s.persist&&this.tree.persistence.clearSelect(this.data.key),$(this.span).removeClass(s.classNames.selected),i&&3===s.selectMode&&this._fixSelectionState(),t&&s.onSelect&&s.onSelect.call(this.tree,!1,this))))},select:function(e){return this.data.unselectable?this.bSelected:this._select(e!==!1,!0,!0)},toggleSelect:function(){return this.select(!this.bSelected)},isSelected:function(){return this.bSelected},isLazy:function(){return!!this.data.isLazy},_loadContent:function(){try{var e=this.tree.options;this.tree.logDebug("_loadContent: start - %o",this),this.setLazyNodeStatus(DTNodeStatus_Loading),!0===e.onLazyRead.call(this.tree,this)&&(this.setLazyNodeStatus(DTNodeStatus_Ok),this.tree.logDebug("_loadContent: succeeded - %o",this))}catch(t){this.tree.logWarning("_loadContent: failed - %o",t),this.setLazyNodeStatus(DTNodeStatus_Error,{tooltip:""+t})}},_expand:function(e,t){if(this.bExpanded===e)return this.tree.logDebug("dtnode._expand(%o) IGNORED - %o",e,this),void 0;this.tree.logDebug("dtnode._expand(%o) - %o",e,this);var i=this.tree.options;if(!e&&this.getLevel()<i.minExpandLevel)return this.tree.logDebug("dtnode._expand(%o) prevented collapse - %o",e,this),void 0;if(!i.onQueryExpand||i.onQueryExpand.call(this.tree,e,this)!==!1){this.bExpanded=e,i.persist&&(e?this.tree.persistence.addExpand(this.data.key):this.tree.persistence.clearExpand(this.data.key));var s=!(this.data.isLazy&&null===this.childList||this._isLoading||t);if(this.render(s),this.bExpanded&&this.parent&&i.autoCollapse)for(var n=this._parentList(!1,!0),a=0,r=n.length;r>a;a++)n[a].collapseSiblings();return i.activeVisible&&this.tree.activeNode&&!this.tree.activeNode.isVisible()&&this.tree.activeNode.deactivate(),e&&this.data.isLazy&&null===this.childList&&!this._isLoading?(this._loadContent(),void 0):(i.onExpand&&i.onExpand.call(this.tree,e,this),void 0)}},isExpanded:function(){return this.bExpanded},expand:function(e){e=e!==!1,(this.childList||this.data.isLazy||!e)&&(null!==this.parent||e)&&this._expand(e)},scheduleAction:function(e,t){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.logDebug("clearTimeout(%o)",this.tree.timer));var i=this;switch(e){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){i.tree.logDebug("setTimeout: trigger expand"),i.expand(!0)},t);break;case"activate":this.tree.timer=setTimeout(function(){i.tree.logDebug("setTimeout: trigger activate"),i.activate()},t);break;default:throw"Invalid mode "+e}this.tree.logDebug("setTimeout(%s, %s): %s",e,t,this.tree.timer)},toggleExpand:function(){this.expand(!this.bExpanded)},collapseSiblings:function(){if(null!==this.parent)for(var e=this.parent.childList,t=0,i=e.length;i>t;t++)e[t]!==this&&e[t].bExpanded&&e[t]._expand(!1)},_onClick:function(e){var t=this.getEventTargetType(e);if("expander"===t)this.toggleExpand(),this.focus();else if("checkbox"===t)this.toggleSelect(),this.focus();else{this._userActivate();var i=this.span.getElementsByTagName("a");if(!i[0])return!0;BROWSER.msie&&9>parseInt(BROWSER.version,10)||i[0].focus()}e.preventDefault()},_onDblClick:function(){},_onKeydown:function(e){var t,i=!0;switch(e.which){case 107:case 187:this.bExpanded||this.toggleExpand();break;case 109:case 189:this.bExpanded&&this.toggleExpand();break;case 32:this._userActivate();break;case 8:this.parent&&this.parent.focus();break;case 37:this.bExpanded?(this.toggleExpand(),this.focus()):this.parent&&this.parent.parent&&this.parent.focus();break;case 39:this.bExpanded||!this.childList&&!this.data.isLazy?this.childList&&this.childList[0].focus():(this.toggleExpand(),this.focus());break;case 38:for(t=this.getPrevSibling();t&&t.bExpanded&&t.childList;)t=t.childList[t.childList.length-1];!t&&this.parent&&this.parent.parent&&(t=this.parent),t&&t.focus();break;case 40:if(this.bExpanded&&this.childList)t=this.childList[0];else for(var s=this._parentList(!1,!0),n=s.length-1;n>=0&&!(t=s[n].getNextSibling());n--);t&&t.focus();break;default:i=!1}i&&e.preventDefault()},_onKeypress:function(){},_onFocus:function(e){var t=this.tree.options;"blur"==e.type||"focusout"==e.type?(t.onBlur&&t.onBlur.call(this.tree,this),this.tree.tnFocused&&$(this.tree.tnFocused.span).removeClass(t.classNames.focused),this.tree.tnFocused=null,t.persist&&$.cookie(t.cookieId+"-focus","",t.cookie)):("focus"==e.type||"focusin"==e.type)&&(this.tree.tnFocused&&this.tree.tnFocused!==this&&(this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o",this.tree.tnFocused),$(this.tree.tnFocused.span).removeClass(t.classNames.focused)),this.tree.tnFocused=this,t.onFocus&&t.onFocus.call(this.tree,this),$(this.tree.tnFocused.span).addClass(t.classNames.focused),t.persist&&$.cookie(t.cookieId+"-focus",this.data.key,t.cookie))},visit:function(e,t){var i=!0;if(t===!0&&(i=e(this),i===!1||"skip"===i))return i;if(this.childList)for(var s=0,n=this.childList.length;n>s&&(i=this.childList[s].visit(e,!0),i!==!1);s++);return i},visitParents:function(e,t){if(t&&e(this)===!1)return!1;for(var i=this.parent;i;){if(e(i)===!1)return!1;i=i.parent}return!0},remove:function(){if(this===this.tree.root)throw"Cannot remove system root";return this.parent.removeChild(this)},removeChild:function(e){var t=this.childList;if(1===t.length){if(e!==t[0])throw"removeChild: invalid child";return this.removeChildren()}e===this.tree.activeNode&&e.deactivate(),this.tree.options.persist&&(e.bSelected&&this.tree.persistence.clearSelect(e.data.key),e.bExpanded&&this.tree.persistence.clearExpand(e.data.key)),e.removeChildren(!0),this.ul&&e.li&&this.ul.removeChild(e.li);for(var i=0,s=t.length;s>i;i++)if(t[i]===e){this.childList.splice(i,1);break}},removeChildren:function(e,t){this.tree.logDebug("%s.removeChildren(%o)",this,e);var i=this.tree,s=this.childList;if(s){for(var n=0,a=s.length;a>n;n++){var r=s[n];r!==i.activeNode||t||r.deactivate(),this.tree.options.persist&&!t&&(r.bSelected&&this.tree.persistence.clearSelect(r.data.key),r.bExpanded&&this.tree.persistence.clearExpand(r.data.key)),r.removeChildren(!0,t),this.ul&&r.li&&$("li",$(this.ul)).remove()}this.childList=null}e||(this._isLoading=!1,this.render())},setTitle:function(e){this.fromDict({title:e})},reload:function(){throw"Use reloadChildren() instead"},reloadChildren:function(e){if(null===this.parent)throw"Use tree.reload() instead";if(!this.data.isLazy)throw"node.reloadChildren() requires lazy nodes.";if(e){var t=this,i="nodeLoaded.dynatree."+this.tree.$tree.attr("id")+"."+this.data.key;this.tree.$tree.bind(i,function(s,n,a){if(t.tree.$tree.unbind(i),t.tree.logDebug("loaded %o, %o, %o",s,n,a),n!==t)throw"got invalid load event";e.call(t.tree,n,a)})}this.removeChildren(),this._loadContent()},_loadKeyPath:function(e,t){var i=this.tree;if(i.logDebug("%s._loadKeyPath(%s)",this,e),""===e)throw"Key path must not be empty";var s=e.split(i.options.keyPathSeparator);if(""===s[0])throw"Key path must be relative (don't start with '/')";var n=s.shift();if(this.childList)for(var a=0,r=this.childList.length;r>a;a++){var o=this.childList[a];if(o.data.key===n){if(0===s.length)t.call(i,o,"ok");else if(!o.data.isLazy||null!==o.childList&&void 0!==o.childList)t.call(i,o,"loaded"),o._loadKeyPath(s.join(i.options.keyPathSeparator),t);else{i.logDebug("%s._loadKeyPath(%s) -> reloading %s...",this,e,o);var d=this;o.reloadChildren(function(n,a){a?(i.logDebug("%s._loadKeyPath(%s) -> reloaded %s.",n,e,n),t.call(i,o,"loaded"),n._loadKeyPath(s.join(i.options.keyPathSeparator),t)):(i.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.",d,e),t.call(i,o,"error"))})}return}}t.call(i,void 0,"notfound",n,0===s.length),i.logWarning("Node not found: "+n)},resetLazy:function(){if(null===this.parent)throw"Use tree.reload() instead";if(!this.data.isLazy)throw"node.resetLazy() requires lazy nodes.";this.expand(!1),this.removeChildren()},_addChildNode:function(e,t){var i=this.tree,s=i.options,n=i.persistence;if(e.parent=this,null===this.childList?this.childList=[]:t||this.childList.length>0&&$(this.childList[this.childList.length-1].span).removeClass(s.classNames.lastsib),t){var a=$.inArray(t,this.childList);if(0>a)throw"<beforeNode> must be a child of <this>";this.childList.splice(a,0,e)}else this.childList.push(e);var r=i.isInitializing();if(s.persist&&n.cookiesFound&&r?(n.activeKey===e.data.key&&(i.activeNode=e),n.focusedKey===e.data.key&&(i.focusNode=e),e.bExpanded=$.inArray(e.data.key,n.expandedKeyList)>=0,e.bSelected=$.inArray(e.data.key,n.selectedKeyList)>=0):(e.data.activate&&(i.activeNode=e,s.persist&&(n.activeKey=e.data.key)),e.data.focus&&(i.focusNode=e,s.persist&&(n.focusedKey=e.data.key)),e.bExpanded=e.data.expand===!0,e.bExpanded&&s.persist&&n.addExpand(e.data.key),e.bSelected=e.data.select===!0,e.bSelected&&s.persist&&n.addSelect(e.data.key)),s.minExpandLevel>=e.getLevel()&&(this.bExpanded=!0),e.bSelected&&3==s.selectMode)for(var o=this;o;)o.hasSubSel||o._setSubSel(!0),o=o.parent;return i.bEnableUpdate&&this.render(),e},addChild:function(e,t){if("string"==typeof e)throw"Invalid data type for "+e;if(e&&0!==e.length){if(e instanceof DynaTreeNode)return this._addChildNode(e,t);e.length||(e=[e]);for(var i=this.tree.enableUpdate(!1),s=null,n=0,a=e.length;a>n;n++){var r=e[n],o=this._addChildNode(new DynaTreeNode(this,this.tree,r),t);s||(s=o),r.children&&o.addChild(r.children,null)}return this.tree.enableUpdate(i),s}},append:function(e){return this.tree.logWarning("node.append() is deprecated (use node.addChild() instead)."),this.addChild(e,null)},appendAjax:function(e){var t=this;if(this.removeChildren(!1,!0),this.setLazyNodeStatus(DTNodeStatus_Loading),e.debugLazyDelay){var i=e.debugLazyDelay;return e.debugLazyDelay=0,this.tree.logInfo("appendAjax: waiting for debugLazyDelay "+i),setTimeout(function(){t.appendAjax(e)},i),void 0}var s=e.success,n=e.error,a="nodeLoaded.dynatree."+this.tree.$tree.attr("id")+"."+this.data.key,r=$.extend({},this.tree.options.ajaxDefaults,e,{success:function(e,i){var n=t.tree.phase;t.tree.phase="init",r.postProcess?e=r.postProcess.call(this,e,this.dataType):e&&e.hasOwnProperty("d")&&(e="string"==typeof e.d?$.parseJSON(e.d):e.d),$.isArray(e)&&0===e.length||t.addChild(e,null),t.tree.phase="postInit",s&&s.call(r,t,e,i),t.tree.logDebug("trigger "+a),t.tree.$tree.trigger(a,[t,!0]),t.tree.phase=n,t.setLazyNodeStatus(DTNodeStatus_Ok),$.isArray(e)&&0===e.length&&(t.childList=[],t.render())},error:function(e,i,s){t.tree.logWarning("appendAjax failed:",i,":\n",e,"\n",s),n&&n.call(r,t,e,i,s),t.tree.$tree.trigger(a,[t,!1]),t.setLazyNodeStatus(DTNodeStatus_Error,{info:i,tooltip:""+s})}});$.ajax(r)},move:function(e,t){var i;if(this!==e){if(!this.parent)throw"Cannot move system root";(void 0===t||"over"==t)&&(t="child");var s=this.parent,n="child"===t?e:e.parent;if(n.isDescendantOf(this))throw"Cannot move a node to it's own descendant";if(1==this.parent.childList.length)this.parent.childList=this.parent.data.isLazy?[]:null,this.parent.bExpanded=!1;else{if(i=$.inArray(this,this.parent.childList),0>i)throw"Internal error";this.parent.childList.splice(i,1)}if(this.parent.ul&&this.parent.ul.removeChild(this.li),this.parent=n,n.hasChildren())switch(t){case"child":n.childList.push(this);break;case"before":if(i=$.inArray(e,n.childList),0>i)throw"Internal error";n.childList.splice(i,0,this);break;case"after":if(i=$.inArray(e,n.childList),0>i)throw"Internal error";n.childList.splice(i+1,0,this);break;default:throw"Invalid mode "+t}else n.childList=[this];if(n.ul||(n.ul=document.createElement("ul"),n.ul.style.display="none",n.li.appendChild(n.ul)),this.li&&n.ul.appendChild(this.li),this.tree!==e.tree)throw this.visit(function(t){t.tree=e.tree},null,!0),"Not yet implemented.";s.isDescendantOf(n)||s.render(),n.isDescendantOf(s)||n.render()}},lastentry:void 0};var DynaTreeStatus=Class.create();DynaTreeStatus._getTreePersistData=function(e,t){var i=new DynaTreeStatus(e,t);return i.read(),i.toDict()},getDynaTreePersistData=DynaTreeStatus._getTreePersistData,DynaTreeStatus.prototype={initialize:function(e,t){void 0===e&&(e=$.ui.dynatree.prototype.options.cookieId),t=$.extend({},$.ui.dynatree.prototype.options.cookie,t),this.cookieId=e,this.cookieOpts=t,this.cookiesFound=void 0,this.activeKey=null,this.focusedKey=null,this.expandedKeyList=null,this.selectedKeyList=null},_log:function(){Array.prototype.unshift.apply(arguments,["debug"]),_log.apply(this,arguments)},read:function(){this.cookiesFound=!1;var e=$.cookie(this.cookieId+"-active");this.activeKey=e||"",e&&(this.cookiesFound=!0),e=$.cookie(this.cookieId+"-focus"),this.focusedKey=e||"",e&&(this.cookiesFound=!0),e=$.cookie(this.cookieId+"-expand"),this.expandedKeyList=e?e.split(","):[],e&&(this.cookiesFound=!0),e=$.cookie(this.cookieId+"-select"),this.selectedKeyList=e?e.split(","):[],e&&(this.cookiesFound=!0)},write:function(){$.cookie(this.cookieId+"-active",null===this.activeKey?"":this.activeKey,this.cookieOpts),$.cookie(this.cookieId+"-focus",null===this.focusedKey?"":this.focusedKey,this.cookieOpts),$.cookie(this.cookieId+"-expand",null===this.expandedKeyList?"":this.expandedKeyList.join(","),this.cookieOpts),$.cookie(this.cookieId+"-select",null===this.selectedKeyList?"":this.selectedKeyList.join(","),this.cookieOpts)},addExpand:function(e){0>$.inArray(e,this.expandedKeyList)&&(this.expandedKeyList.push(e),$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},clearExpand:function(e){var t=$.inArray(e,this.expandedKeyList);t>=0&&(this.expandedKeyList.splice(t,1),$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts))},addSelect:function(e){0>$.inArray(e,this.selectedKeyList)&&(this.selectedKeyList.push(e),$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},clearSelect:function(e){var t=$.inArray(e,this.selectedKeyList);t>=0&&(this.selectedKeyList.splice(t,1),$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts))},isReloading:function(){return this.cookiesFound===!0},toDict:function(){return{cookiesFound:this.cookiesFound,activeKey:this.activeKey,focusedKey:this.activeKey,expandedKeyList:this.expandedKeyList,selectedKeyList:this.selectedKeyList}},lastentry:void 0};var DynaTree=Class.create();DynaTree.version="@@Version",DynaTree.prototype={initialize:function(e){this.phase="init",this.$widget=e,this.options=e.options,this.$tree=e.element,this.timer=null,this.divTree=this.$tree.get(0),_initDragAndDrop(this)},_load:function(e){this.$widget;var t=this.options,i=this;this.bEnableUpdate=!0,this._nodeCount=1,this.activeNode=null,this.focusNode=null,void 0!==t.rootVisible&&this.logWarning("Option 'rootVisible' is no longer supported."),1>t.minExpandLevel&&(this.logWarning("Option 'minExpandLevel' must be >= 1."),t.minExpandLevel=1),t.classNames!==$.ui.dynatree.prototype.options.classNames&&(t.classNames=$.extend({},$.ui.dynatree.prototype.options.classNames,t.classNames)),t.ajaxDefaults!==$.ui.dynatree.prototype.options.ajaxDefaults&&(t.ajaxDefaults=$.extend({},$.ui.dynatree.prototype.options.ajaxDefaults,t.ajaxDefaults)),t.dnd!==$.ui.dynatree.prototype.options.dnd&&(t.dnd=$.extend({},$.ui.dynatree.prototype.options.dnd,t.dnd)),t.imagePath||$("script").each(function(){var e=/.*dynatree[^\/]*\.js$/i;return this.src.search(e)>=0?(t.imagePath=this.src.indexOf("/")>=0?this.src.slice(0,this.src.lastIndexOf("/"))+"/skin/":"skin/",i.logDebug("Guessing imagePath from '%s': '%s'",this.src,t.imagePath),!1):void 0}),this.persistence=new DynaTreeStatus(t.cookieId,t.cookie),t.persist&&($.cookie||_log("warn","Please include jquery.cookie.js to use persistence."),this.persistence.read()),this.logDebug("DynaTree.persistence: %o",this.persistence.toDict()),this.cache={tagEmpty:"<span class='"+t.classNames.empty+"'></span>",tagVline:"<span class='"+t.classNames.vline+"'></span>",tagExpander:"<span class='"+t.classNames.expander+"'></span>",tagConnector:"<span class='"+t.classNames.connector+"'></span>",tagNodeIcon:"<span class='"+t.classNames.nodeIcon+"'></span>",tagCheckbox:"<span class='"+t.classNames.checkbox+"'></span>",lastentry:void 0},(t.children||t.initAjax&&t.initAjax.url||t.initId)&&$(this.divTree).empty();var s=this.$tree.find(">ul:first").hide();this.tnRoot=new DynaTreeNode(null,this,{}),this.tnRoot.bExpanded=!0,this.tnRoot.render(),this.divTree.appendChild(this.tnRoot.ul);var n=this.tnRoot,a=t.persist&&this.persistence.isReloading(),r=!1,o=this.enableUpdate(!1);this.logDebug("Dynatree._load(): read tree structure..."),t.children?n.addChild(t.children):t.initAjax&&t.initAjax.url?(r=!0,n.data.isLazy=!0,this._reloadAjax(e)):t.initId?this._createFromTag(n,$("#"+t.initId)):(this._createFromTag(n,s),s.remove()),this._checkConsistency(),r||3!=t.selectMode||n._updatePartSelectionState(),this.logDebug("Dynatree._load(): render nodes..."),this.enableUpdate(o),this.logDebug("Dynatree._load(): bind events..."),this.$widget.bind(),this.logDebug("Dynatree._load(): postInit..."),this.phase="postInit",t.persist&&this.persistence.write(),this.focusNode&&this.focusNode.isVisible()&&(this.logDebug("Focus on init: %o",this.focusNode),this.focusNode.focus()),r||(t.onPostInit&&t.onPostInit.call(this,a,!1),e&&e.call(this,"ok")),this.phase="idle"},_reloadAjax:function(e){var t=this.options;if(!t.initAjax||!t.initAjax.url)throw"tree.reload() requires 'initAjax' mode.";var i=this.persistence,s=$.extend({},t.initAjax);s.addActiveKey&&(s.data.activeKey=i.activeKey),s.addFocusedKey&&(s.data.focusedKey=i.focusedKey),s.addExpandedKeyList&&(s.data.expandedKeyList=i.expandedKeyList.join(",")),s.addSelectedKeyList&&(s.data.selectedKeyList=i.selectedKeyList.join(",")),s.success&&this.logWarning("initAjax: success callback is ignored; use onPostInit instead."),s.error&&this.logWarning("initAjax: error callback is ignored; use onPostInit instead.");var n=i.isReloading();s.success=function(i){3==t.selectMode&&i.tree.tnRoot._updatePartSelectionState(),t.onPostInit&&t.onPostInit.call(i.tree,n,!1),e&&e.call(i.tree,"ok")},s.error=function(i,s,a,r){t.onPostInit&&t.onPostInit.call(i.tree,n,!0,s,a,r),e&&e.call(i.tree,"error",s,a,r)},this.logDebug("Dynatree._init(): send Ajax request..."),this.tnRoot.appendAjax(s)},toString:function(){return"Dynatree '"+this.$tree.attr("id")+"'"},toDict:function(e){var t=this.tnRoot.toDict(!0);return e?t:t.children},serializeArray:function(e){for(var t=this.getSelectedNodes(e),i=this.$tree.attr("name")||this.$tree.attr("id"),s=[],n=0,a=t.length;a>n;n++)s.push({name:i,value:t[n].data.key}); +return s},getPersistData:function(){return this.persistence.toDict()},logDebug:function(){this.options.debugLevel>=2&&(Array.prototype.unshift.apply(arguments,["debug"]),_log.apply(this,arguments))},logInfo:function(){this.options.debugLevel>=1&&(Array.prototype.unshift.apply(arguments,["info"]),_log.apply(this,arguments))},logWarning:function(){Array.prototype.unshift.apply(arguments,["warn"]),_log.apply(this,arguments)},isInitializing:function(){return"init"==this.phase||"postInit"==this.phase},isReloading:function(){return("init"==this.phase||"postInit"==this.phase)&&this.options.persist&&this.persistence.cookiesFound},isUserEvent:function(){return"userEvent"==this.phase},redraw:function(){this.tnRoot.render(!1,!1)},renderInvisibleNodes:function(){this.tnRoot.render(!1,!0)},reload:function(e){this._load(e)},getRoot:function(){return this.tnRoot},enable:function(){this.$widget.enable()},disable:function(){this.$widget.disable()},getNodeByKey:function(e){var t=document.getElementById(this.options.idPrefix+e);if(t)return t.dtnode?t.dtnode:null;var i=null;return this.visit(function(t){return t.data.key===e?(i=t,!1):void 0},!0),i},getActiveNode:function(){return this.activeNode},reactivate:function(e){var t=this.activeNode;t&&(this.activeNode=null,t.activate(),e&&t.focus())},getSelectedNodes:function(e){var t=[];return this.tnRoot.visit(function(i){return i.bSelected&&(t.push(i),e===!0)?"skip":void 0}),t},activateKey:function(e){var t=null===e?null:this.getNodeByKey(e);return t?(t.focus(),t.activate(),t):(this.activeNode&&this.activeNode.deactivate(),this.activeNode=null,null)},loadKeyPath:function(e,t){var i=e.split(this.options.keyPathSeparator);return""===i[0]&&i.shift(),i[0]==this.tnRoot.data.key&&(this.logDebug("Removed leading root key."),i.shift()),e=i.join(this.options.keyPathSeparator),this.tnRoot._loadKeyPath(e,t)},selectKey:function(e,t){var i=this.getNodeByKey(e);return i?(i.select(t),i):null},enableUpdate:function(e){return this.bEnableUpdate==e?e:(this.bEnableUpdate=e,e&&this.redraw(),!e)},count:function(){return this.tnRoot.countChildren()},visit:function(e,t){return this.tnRoot.visit(e,t)},_createFromTag:function(parentTreeNode,$ulParent){var self=this;$ulParent.find(">li").each(function(){var $li=$(this),$liSpan=$li.find(">span:first"),$liA=$li.find(">a:first"),title,href=null,target=null,tooltip;if($liSpan.length)title=$liSpan.html();else if($liA.length)title=$liA.html(),href=$liA.attr("href"),target=$liA.attr("target"),tooltip=$liA.attr("title");else{title=$li.html();var iPos=title.search(/<ul/i);title=iPos>=0?$.trim(title.substring(0,iPos)):$.trim(title)}var data={title:title,tooltip:tooltip,isFolder:$li.hasClass("folder"),isLazy:$li.hasClass("lazy"),expand:$li.hasClass("expanded"),select:$li.hasClass("selected"),activate:$li.hasClass("active"),focus:$li.hasClass("focused"),noLink:$li.hasClass("noLink")};if(href&&(data.href=href,data.target=target),$li.attr("title")&&(data.tooltip=$li.attr("title")),$li.attr("id")&&(data.key=""+$li.attr("id")),$li.attr("data")){var dataAttr=$.trim($li.attr("data"));if(dataAttr){"{"!=dataAttr.charAt(0)&&(dataAttr="{"+dataAttr+"}");try{$.extend(data,eval("("+dataAttr+")"))}catch(e){throw"Error parsing node data: "+e+"\ndata:\n'"+dataAttr+"'"}}}var childNode=parentTreeNode.addChild(data),$ul=$li.find(">ul:first");$ul.length&&self._createFromTag(childNode,$ul)})},_checkConsistency:function(){},_setDndStatus:function(e,t,i,s,n){var a,r=e?$(e.span):null,o=$(t.span),d=0,l="center";if(this.$dndMarker||(this.$dndMarker=$("<div id='dynatree-drop-marker'></div>").hide().css({"z-index":1e3}).prependTo($(this.divTree).parent())),"after"===s||"before"===s||"over"===s){switch(s){case"before":this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over"),this.$dndMarker.addClass("dynatree-drop-before"),l="top";break;case"after":this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over"),this.$dndMarker.addClass("dynatree-drop-after"),l="bottom";break;default:this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before"),this.$dndMarker.addClass("dynatree-drop-over"),o.addClass("dynatree-drop-target"),d=8}a=jquerySupports.positionMyOfs?{my:"left"+offsetString(d)+" center",at:"left "+l,of:o}:{my:"left center",at:"left "+l,of:o,offset:""+d+" 0"},this.$dndMarker.show().position(a)}else o.removeClass("dynatree-drop-target"),this.$dndMarker.hide();"after"===s?o.addClass("dynatree-drop-after"):o.removeClass("dynatree-drop-after"),"before"===s?o.addClass("dynatree-drop-before"):o.removeClass("dynatree-drop-before"),n===!0?(r&&r.addClass("dynatree-drop-accept"),o.addClass("dynatree-drop-accept"),i.addClass("dynatree-drop-accept")):(r&&r.removeClass("dynatree-drop-accept"),o.removeClass("dynatree-drop-accept"),i.removeClass("dynatree-drop-accept")),n===!1?(r&&r.addClass("dynatree-drop-reject"),o.addClass("dynatree-drop-reject"),i.addClass("dynatree-drop-reject")):(r&&r.removeClass("dynatree-drop-reject"),o.removeClass("dynatree-drop-reject"),i.removeClass("dynatree-drop-reject"))},_onDragEvent:function(e,t,i,s,n,a){var r,o,d,l=this.options.dnd,h=null,c=$(t.span);switch(e){case"helper":var u=$("<div class='dynatree-drag-helper'><span class='dynatree-drag-helper-img' /></div>").append($(s.target).closest(".dynatree-title").clone());$("ul.dynatree-container",t.tree.divTree).append(u),u.data("dtSourceNode",t),h=u;break;case"start":t.isStatusNode()?h=!1:l.onDragStart&&(h=l.onDragStart(t)),h===!1?(this.logDebug("tree.onDragStart() cancelled"),n.helper.trigger("mouseup"),n.helper.hide()):c.addClass("dynatree-drag-source");break;case"enter":d=l.onDragEnter?l.onDragEnter(t,i,n,a):null,h=d?$.isArray(d)?{over:$.inArray("over",d)>=0,before:$.inArray("before",d)>=0,after:$.inArray("after",d)>=0}:{over:d===!0||"over"===d,before:d===!0||"before"===d,after:d===!0||"after"===d}:!1,n.helper.data("enterResponse",h);break;case"over":if(o=n.helper.data("enterResponse"),r=null,o===!1);else if("string"==typeof o)r=o;else{var p=c.offset(),f={x:s.pageX-p.left,y:s.pageY-p.top},g={x:f.x/c.width(),y:f.y/c.height()};o.after&&g.y>.75?r="after":!o.over&&o.after&&g.y>.5?r="after":o.before&&.25>=g.y?r="before":!o.over&&o.before&&.5>=g.y?r="before":o.over&&(r="over"),l.preventVoidMoves&&(t===i?r=null:"before"===r&&i&&t===i.getNextSibling()?r=null:"after"===r&&i&&t===i.getPrevSibling()?r=null:"over"===r&&i&&i.parent===t&&i.isLastSibling()&&(r=null)),n.helper.data("hitMode",r)}"over"===r&&l.autoExpandMS&&t.hasChildren()!==!1&&!t.bExpanded&&t.scheduleAction("expand",l.autoExpandMS),r&&l.onDragOver&&(h=l.onDragOver(t,i,r,n,a),("over"===h||"before"===h||"after"===h)&&(r=h)),this._setDndStatus(i,t,n.helper,r,h!==!1&&null!==r);break;case"drop":var y=n.helper.hasClass("dynatree-drop-reject");r=n.helper.data("hitMode"),r&&l.onDrop&&!y&&l.onDrop(t,i,r,n,a);break;case"leave":t.scheduleAction("cancel"),n.helper.data("enterResponse",null),n.helper.data("hitMode",null),this._setDndStatus(i,t,n.helper,"out",void 0),l.onDragLeave&&l.onDragLeave(t,i,n,a);break;case"stop":c.removeClass("dynatree-drag-source"),l.onDragStop&&l.onDragStop(t);break;default:throw"Unsupported drag event: "+e}return h},cancelDrag:function(){var e=$.ui.ddmanager.current;e&&e.cancel()},lastentry:void 0},$.widget("ui.dynatree",{_init:function(){return 0>versionCompare($.ui.version,"1.8")?(this.options.debugLevel>=0&&_log("warn","ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher."),this._create()):(this.options.debugLevel>=2&&_log("debug","ui.dynatree._init() was called; no current default functionality."),void 0)},_create:function(){var e=this.options;e.debugLevel>=1&&logMsg("Dynatree._create(): version='%s', debugLevel=%o.",$.ui.dynatree.version,this.options.debugLevel),this.options.event+=".dynatree",this.element.get(0),this.tree=new DynaTree(this),this.tree._load(),this.tree.logDebug("Dynatree._init(): done.")},bind:function(){function e(e){e=$.event.fix(e||window.event);var t=$.ui.dynatree.getNode(e.target);return t?t._onFocus(e):!1}this.unbind();var t="click.dynatree dblclick.dynatree";this.options.keyboard&&(t+=" keypress.dynatree keydown.dynatree"),this.element.bind(t,function(e){var t=$.ui.dynatree.getNode(e.target);if(!t)return!0;var i=t.tree,s=i.options;i.logDebug("event(%s): dtnode: %s",e.type,t);var n=i.phase;i.phase="userEvent";try{switch(e.type){case"click":return s.onClick&&s.onClick.call(i,t,e)===!1?!1:t._onClick(e);case"dblclick":return s.onDblClick&&s.onDblClick.call(i,t,e)===!1?!1:t._onDblClick(e);case"keydown":return s.onKeydown&&s.onKeydown.call(i,t,e)===!1?!1:t._onKeydown(e);case"keypress":return s.onKeypress&&s.onKeypress.call(i,t,e)===!1?!1:t._onKeypress(e)}}catch(a){i.logWarning("bind(%o): dtnode: %o, error: %o",e,t,a)}finally{i.phase=n}});var i=this.tree.divTree;i.addEventListener?(i.addEventListener("focus",e,!0),i.addEventListener("blur",e,!0)):i.onfocusin=i.onfocusout=e},unbind:function(){this.element.unbind(".dynatree")},enable:function(){this.bind(),$.Widget.prototype.enable.apply(this,arguments)},disable:function(){this.unbind(),$.Widget.prototype.disable.apply(this,arguments)},getTree:function(){return this.tree},getRoot:function(){return this.tree.getRoot()},getActiveNode:function(){return this.tree.getActiveNode()},getSelectedNodes:function(){return this.tree.getSelectedNodes()},lastentry:void 0}),0>versionCompare($.ui.version,"1.8")&&($.ui.dynatree.getter="getTree getRoot getActiveNode getSelectedNodes"),$.extend($.ui.dynatree,{version:"1.2.5-rc4",buildType:"release",_DynaTreeClass:DynaTree,_DynaTreeNodeClass:DynaTreeNode,getNode:function(e){if(e instanceof DynaTreeNode)return e;for(void 0!==e.selector&&(e=e[0]);e;){if(e.dtnode)return e.dtnode;e=e.parentNode}return null},getPersistData:DynaTreeStatus._getTreePersistData}),$.ui.dynatree.prototype.options={title:"Dynatree",minExpandLevel:1,imagePath:null,children:null,initId:null,initAjax:null,autoFocus:!0,keyboard:!0,persist:!1,autoCollapse:!1,clickFolderMode:3,activeVisible:!0,checkbox:!1,selectMode:2,fx:null,noLink:!1,onClick:null,onDblClick:null,onKeydown:null,onKeypress:null,onFocus:null,onBlur:null,onQueryActivate:null,onQuerySelect:null,onQueryExpand:null,onPostInit:null,onActivate:null,onDeactivate:null,onSelect:null,onExpand:null,onLazyRead:null,onCustomRender:null,onCreate:null,onRender:null,postProcess:null,dnd:{onDragStart:null,onDragStop:null,revert:!1,autoExpandMS:1e3,preventVoidMoves:!0,onDragEnter:null,onDragOver:null,onDrop:null,onDragLeave:null},ajaxDefaults:{cache:!1,timeout:0,dataType:"json"},strings:{loading:"Loading…",loadError:"Load error!"},generateIds:!1,idPrefix:"dynatree-id-",keyPathSeparator:"/",cookieId:"dynatree",cookie:{expires:null},classNames:{container:"dynatree-container",node:"dynatree-node",folder:"dynatree-folder",empty:"dynatree-empty",vline:"dynatree-vline",expander:"dynatree-expander",connector:"dynatree-connector",checkbox:"dynatree-checkbox",nodeIcon:"dynatree-icon",title:"dynatree-title",noConnector:"dynatree-no-connector",nodeError:"dynatree-statusnode-error",nodeWait:"dynatree-statusnode-wait",hidden:"dynatree-hidden",combinedExpanderPrefix:"dynatree-exp-",combinedIconPrefix:"dynatree-ico-",nodeLoading:"dynatree-loading",hasChildren:"dynatree-has-children",active:"dynatree-active",selected:"dynatree-selected",expanded:"dynatree-expanded",lazy:"dynatree-lazy",focused:"dynatree-focused",partsel:"dynatree-partsel",lastsib:"dynatree-lastsib"},debugLevel:1,lastentry:void 0},0>versionCompare($.ui.version,"1.8")&&($.ui.dynatree.defaults=$.ui.dynatree.prototype.options),$.ui.dynatree.nodedatadefaults={title:null,key:null,isFolder:!1,isLazy:!1,tooltip:null,href:null,icon:null,addClass:null,noLink:!1,activate:!1,focus:!1,expand:!1,select:!1,hideCheckbox:!1,unselectable:!1,children:null,lastentry:void 0};var didRegisterDnd=!1,_registerDnd=function(){didRegisterDnd||($.ui.plugin.add("draggable","connectToDynatree",{start:function(e,t){var i=$(this).data("ui-draggable")||$(this).data("draggable"),s=t.helper.data("dtSourceNode")||null;return s?(i.offset.click.top=-2,i.offset.click.left=16,s.tree._onDragEvent("start",s,null,e,t,i)):void 0},drag:function(e,t){var i=$(this).data("ui-draggable")||$(this).data("draggable"),s=t.helper.data("dtSourceNode")||null,n=t.helper.data("dtTargetNode")||null,a=$.ui.dynatree.getNode(e.target);if(e.target&&!a){var r=$(e.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length>0;if(r)return}t.helper.data("dtTargetNode",a),n&&n!==a&&n.tree._onDragEvent("leave",n,s,e,t,i),a&&a.tree.options.dnd.onDrop&&(a===n?a.tree._onDragEvent("over",a,s,e,t,i):a.tree._onDragEvent("enter",a,s,e,t,i))},stop:function(e,t){var i=$(this).data("ui-draggable")||$(this).data("draggable"),s=t.helper.data("dtSourceNode")||null,n=t.helper.data("dtTargetNode")||null,a=e.type,r="mouseup"==a&&1==e.which;logMsg("draggable-connectToDynatree.stop: targetNode(from event): %s, dtTargetNode: %s",n,t.helper.data("dtTargetNode")),r||logMsg("Drag was cancelled"),n&&(r&&n.tree._onDragEvent("drop",n,s,e,t,i),n.tree._onDragEvent("leave",n,s,e,t,i)),s&&s.tree._onDragEvent("stop",s,null,e,t,i)}}),didRegisterDnd=!0)}})(jQuery); \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/icons.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/icons.gif new file mode 100644 index 0000000000000000000000000000000000000000..6e237a0f44fbaae7fe406ddc9597918ecf5a997a Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/icons.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/loading.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..2a96840f48be2e10fda36b232b524244159cad8e Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/loading.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/ui.dynatree.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/ui.dynatree.css new file mode 100644 index 0000000000000000000000000000000000000000..1211ff281d660f8ae2b15ac4cce0d0a308054b8e --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin-vista/ui.dynatree.css @@ -0,0 +1,453 @@ +/******************************************************************************* + * Tree container + */ +ul.dynatree-container +{ + font-family: tahoma, arial, helvetica; + font-size: 10pt; /* font size should not be too big */ + white-space: nowrap; + padding: 3px; + margin: 0; /* issue 201 */ + background-color: white; + border: 1px dotted gray; + overflow: auto; + height: 100%; /* issue 263 */ +} + +ul.dynatree-container ul +{ + padding: 0 0 0 16px; + margin: 0; +} + +ul.dynatree-container li +{ + list-style-image: none; + list-style-position: outside; + list-style-type: none; + -moz-background-clip:border; + -moz-background-inline-policy: continuous; + -moz-background-origin: padding; + background-attachment: scroll; + background-color: transparent; + background-position: 0 0; + background-repeat: repeat-y; + background-image: none; /* no v-lines */ + + margin:0; + padding:1px 0 0 0; +} +/* Suppress lines for last child node */ +ul.dynatree-container li.dynatree-lastsib +{ + background-image: none; +} +/* Suppress lines if level is fixed expanded (option minExpandLevel) */ +ul.dynatree-no-connector > li +{ + background-image: none; +} + +/* Style, when control is disabled */ +.ui-dynatree-disabled ul.dynatree-container +{ + opacity: 0.5; +/* filter: alpha(opacity=50); /* Yields a css warning */ + background-color: silver; +} + + +/******************************************************************************* + * Common icon definitions + */ +span.dynatree-empty, +span.dynatree-vline, +span.dynatree-connector, +span.dynatree-expander, +span.dynatree-icon, +span.dynatree-checkbox, +span.dynatree-radio, +span.dynatree-drag-helper-img, +#dynatree-drop-marker +{ + width: 16px; + height: 16px; +/* display: -moz-inline-box; /* @ FF 1+2 removed for issue 221*/ +/* -moz-box-align: start; /* issue 221 */ + display: inline-block; /* Required to make a span sizeable */ + vertical-align: top; + background-repeat: no-repeat; + background-position: left; + background-image: url("icons.gif"); + background-position: 0 0; +} + +/** Used by 'icon' node option: */ +ul.dynatree-container img +{ + width: 16px; + height: 16px; + margin-left: 3px; + vertical-align: top; + border-style: none; +} + + +/******************************************************************************* + * Lines and connectors + */ + +/* +span.dynatree-empty +{ +} +span.dynatree-vline +{ +} +*/ +span.dynatree-connector +{ + background-image: none; +} +/* +.dynatree-lastsib span.dynatree-connector +{ +} +*/ +/******************************************************************************* + * Expander icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-exp- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'd': lazy (Delayed) + * 3rd character (optional): 'l': Last sibling + */ + +span.dynatree-expander +{ + background-position: 0px -80px; + cursor: pointer; +} +span.dynatree-expander:hover +{ + background-position: -16px -80px; +} +.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */ +{ +} +.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */ +{ +} +.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */ +{ +} +.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */ +.dynatree-exp-ed span.dynatree-expander, /* Expanded, delayed, not last sibling */ +.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */ +.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */ +{ + background-position: -32px -80px; +} +.dynatree-exp-e span.dynatree-expander:hover, /* Expanded, not delayed, not last sibling */ +.dynatree-exp-ed span.dynatree-expander:hover, /* Expanded, delayed, not last sibling */ +.dynatree-exp-el span.dynatree-expander:hover, /* Expanded, not delayed, last sibling */ +.dynatree-exp-edl span.dynatree-expander:hover /* Expanded, delayed, last sibling */ +{ + background-position: -48px -80px; +} +.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */ +{ + background-position: 0 0; + background-image: url("loading.gif"); +} + + +/******************************************************************************* + * Checkbox icon + */ +span.dynatree-checkbox +{ + margin-left: 3px; + background-position: 0px -32px; +} +span.dynatree-checkbox:hover +{ + background-position: -16px -32px; +} + +.dynatree-partsel span.dynatree-checkbox +{ + background-position: -64px -32px; +} +.dynatree-partsel span.dynatree-checkbox:hover +{ + background-position: -80px -32px; +} + +.dynatree-selected span.dynatree-checkbox +{ + background-position: -32px -32px; +} +.dynatree-selected span.dynatree-checkbox:hover +{ + background-position: -48px -32px; +} + +/******************************************************************************* + * Radiobutton icon + * This is a customization, that may be activated by overriding the 'checkbox' + * class name as 'dynatree-radio' in the tree options. + */ +span.dynatree-radio +{ + margin-left: 3px; + background-position: 0px -48px; +} +span.dynatree-radio:hover +{ + background-position: -16px -48px; +} + +.dynatree-partsel span.dynatree-radio +{ + background-position: -64px -48px; +} +.dynatree-partsel span.dynatree-radio:hover +{ + background-position: -80px -48px; +} + +.dynatree-selected span.dynatree-radio +{ + background-position: -32px -48px; +} +.dynatree-selected span.dynatree-radio:hover +{ + background-position: -48px -48px; +} + +/******************************************************************************* + * Node type icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-ico- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'f': folder + */ + +span.dynatree-icon /* Default icon */ +{ + margin-left: 3px; + background-position: 0px 0px; +} + +.dynatree-has-children span.dynatree-icon /* Default icon */ +{ +/* background-position: 0px -16px; */ +} + +.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */ +{ + background-position: 0px -16px; +} + +.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */ +{ + background-position: -64px -16px; +} + +/* Status node icons */ + +.dynatree-statusnode-wait span.dynatree-icon +{ + background-image: url("loading.gif"); +} + +.dynatree-statusnode-error span.dynatree-icon +{ + background-position: 0px -112px; +/* background-image: url("ltError.gif");*/ +} + +/******************************************************************************* + * Node titles + */ + +/* @Chrome: otherwise hit area of node titles is broken (issue 133) + Removed again for issue 165; (133 couldn't be reproduced) */ +span.dynatree-node +{ +/* display: -moz-inline-box; /* issue 133, 165, 172, 192. removed for issue 221 */ +/* -moz-box-align: start; /* issue 221 */ + display: inline-block; /* issue 373 Required to make a span sizeable */ + vertical-align: top; +} + + +/* Remove blue color and underline from title links */ +ul.dynatree-container a +/*, ul.dynatree-container a:visited*/ +{ + color: black; /* inherit doesn't work on IE */ + text-decoration: none; + vertical-align: top; + margin: 0px; + margin-left: 3px; +/* outline: 0; /* @ Firefox, prevent dotted border after click */ + /* Set transparent border to prevent jumping when active node gets a border + (we can do this, because this theme doesn't use vertical lines) + */ + border: 1px solid white; /* Note: 'transparent' would not work in IE6 */ + +} + +ul.dynatree-container a:hover +{ +/* text-decoration: underline; */ + background: #F2F7FD; /* light blue */ + border-color: #B8D6FB; /* darker light blue */ +} + +span.dynatree-node a +{ + display: inline-block; /* Better alignment, when title contains <br> */ +/* vertical-align: top;*/ + padding-left: 3px; + padding-right: 3px; /* Otherwise italic font will be outside bounds */ + /* line-height: 16px; /* should be the same as img height, in case 16 px */ +} +span.dynatree-folder a +{ +/* font-weight: bold; */ /* custom */ +} + +ul.dynatree-container a:focus, +span.dynatree-focused a:link /* @IE */ +{ + background-color: #EFEBDE; /* gray */ +} + +span.dynatree-has-children a +{ +/* font-style: oblique; /* custom: */ +} + +span.dynatree-expanded a +{ +} + +span.dynatree-selected a +{ +/* color: green; */ + font-style: italic; +} + +span.dynatree-active a +{ + border: 1px solid #99DEFD; + background-color: #D8F0FA; +} + +/******************************************************************************* + * Drag'n'drop support + */ + +/*** Helper object ************************************************************/ +div.dynatree-drag-helper +{ +} +div.dynatree-drag-helper a +{ + border: 1px solid gray; + background-color: white; + padding-left: 5px; + padding-right: 5px; + opacity: 0.8; +} +span.dynatree-drag-helper-img +{ + /* + position: relative; + left: -16px; + */ +} +div.dynatree-drag-helper /*.dynatree-drop-accept*/ +{ +/* border-color: green; + background-color: red;*/ +} +div.dynatree-drop-accept span.dynatree-drag-helper-img +{ + background-position: -32px -112px; +} +div.dynatree-drag-helper.dynatree-drop-reject +{ + border-color: red; +} +div.dynatree-drop-reject span.dynatree-drag-helper-img +{ + background-position: -16px -112px; +} + +/*** Drop marker icon *********************************************************/ + +#dynatree-drop-marker +{ + width: 24px; + position: absolute; + background-position: 0 -128px; + margin: 0; +} +#dynatree-drop-marker.dynatree-drop-after, +#dynatree-drop-marker.dynatree-drop-before +{ + width:64px; + background-position: 0 -144px; +} +#dynatree-drop-marker.dynatree-drop-copy +{ + background-position: -64px -128px; +} +#dynatree-drop-marker.dynatree-drop-move +{ + background-position: -64px -128px; +} + +/*** Source node while dragging ***********************************************/ + +span.dynatree-drag-source +{ + /* border: 1px dotted gray; */ + background-color: #e0e0e0; +} +span.dynatree-drag-source a +{ + color: gray; +} + +/*** Target node while dragging cursor is over it *****************************/ + +span.dynatree-drop-target +{ + /*border: 1px solid gray;*/ +} +span.dynatree-drop-target a +{ +} +span.dynatree-drop-target.dynatree-drop-accept a +{ + /*border: 1px solid green;*/ + background-color: #3169C6 !important; + color: white !important; /* @ IE6 */ + text-decoration: none; +} +span.dynatree-drop-target.dynatree-drop-reject +{ + /*border: 1px solid red;*/ +} +span.dynatree-drop-target.dynatree-drop-after a +{ +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/icons-rtl.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/icons-rtl.gif new file mode 100644 index 0000000000000000000000000000000000000000..a29b5fbc967378b8665df3513f4d8cf648f73809 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/icons-rtl.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/icons.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/icons.gif new file mode 100644 index 0000000000000000000000000000000000000000..a58eb93f12a2c63382d6b47f070fa03ffec7fd5f Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/icons.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/loading.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..251df0544cd63db56160b5a53c9e203999a561e6 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/loading.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/ui.dynatree.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/ui.dynatree.css new file mode 100644 index 0000000000000000000000000000000000000000..1a57a04a963f1b6e31560048471caa83f173ca80 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/ui.dynatree.css @@ -0,0 +1,441 @@ +/******************************************************************************* + * Tree container + */ +ul.dynatree-container +{ + font-family: tahoma, arial, helvetica; + font-size: 10pt; /* font size should not be too big */ + white-space: nowrap; + padding: 3px; + margin: 0; /* issue 201 */ + background-color: white; + border: 1px dotted gray; + overflow: auto; + height: 100%; /* issue 263 */ +} + +ul.dynatree-container ul +{ + padding: 0 0 0 16px; + margin: 0; +} + +ul.dynatree-container li +{ + list-style-image: none; + list-style-position: outside; + list-style-type: none; + -moz-background-clip:border; + -moz-background-inline-policy: continuous; + -moz-background-origin: padding; + background-attachment: scroll; + background-color: transparent; + background-repeat: repeat-y; + background-image: url("vline.gif"); + background-position: 0 0; + /* + background-image: url("icons_96x256.gif"); + background-position: -80px -64px; + */ + margin: 0; + padding: 1px 0 0 0; +} +/* Suppress lines for last child node */ +ul.dynatree-container li.dynatree-lastsib +{ + background-image: none; +} +/* Suppress lines if level is fixed expanded (option minExpandLevel) */ +ul.dynatree-no-connector > li +{ + background-image: none; +} + +/* Style, when control is disabled */ +.ui-dynatree-disabled ul.dynatree-container +{ + opacity: 0.5; +/* filter: alpha(opacity=50); /* Yields a css warning */ + background-color: silver; +} + +/******************************************************************************* + * Common icon definitions + */ +span.dynatree-empty, +span.dynatree-vline, +span.dynatree-connector, +span.dynatree-expander, +span.dynatree-icon, +span.dynatree-checkbox, +span.dynatree-radio, +span.dynatree-drag-helper-img, +#dynatree-drop-marker +{ + width: 16px; + height: 16px; +/* display: -moz-inline-box; /* @ FF 1+2 removed for issue 221 */ +/* -moz-box-align: start; /* issue 221 */ + display: inline-block; /* Required to make a span sizeable */ + vertical-align: top; + background-repeat: no-repeat; + background-position: left; + background-image: url("icons.gif"); + background-position: 0 0; +} + +/** Used by 'icon' node option: */ +ul.dynatree-container img +{ + width: 16px; + height: 16px; + margin-left: 3px; + vertical-align: top; + border-style: none; +} + + +/******************************************************************************* + * Lines and connectors + */ + +span.dynatree-connector +{ + background-position: -16px -64px; +} + +/******************************************************************************* + * Expander icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-exp- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'd': lazy (Delayed) + * 3rd character (optional): 'l': Last sibling + */ + +span.dynatree-expander +{ + background-position: 0px -80px; + cursor: pointer; +} +.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */ +{ + background-position: 0px -96px; +} +.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */ +{ + background-position: -64px -80px; +} +.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */ +{ + background-position: -64px -96px; +} +.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */ +.dynatree-exp-ed span.dynatree-expander /* Expanded, delayed, not last sibling */ +{ + background-position: -32px -80px; +} +.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */ +.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */ +{ + background-position: -32px -96px; +} +.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */ +{ + background-position: 0 0; + background-image: url("loading.gif"); +} + + +/******************************************************************************* + * Checkbox icon + */ +span.dynatree-checkbox +{ + margin-left: 3px; + background-position: 0px -32px; +} +span.dynatree-checkbox:hover +{ + background-position: -16px -32px; +} + +.dynatree-partsel span.dynatree-checkbox +{ + background-position: -64px -32px; +} +.dynatree-partsel span.dynatree-checkbox:hover +{ + background-position: -80px -32px; +} + +.dynatree-selected span.dynatree-checkbox +{ + background-position: -32px -32px; +} +.dynatree-selected span.dynatree-checkbox:hover +{ + background-position: -48px -32px; +} + +/******************************************************************************* + * Radiobutton icon + * This is a customization, that may be activated by overriding the 'checkbox' + * class name as 'dynatree-radio' in the tree options. + */ +span.dynatree-radio +{ + margin-left: 3px; + background-position: 0px -48px; +} +span.dynatree-radio:hover +{ + background-position: -16px -48px; +} + +.dynatree-partsel span.dynatree-radio +{ + background-position: -64px -48px; +} +.dynatree-partsel span.dynatree-radio:hover +{ + background-position: -80px -48px; +} + +.dynatree-selected span.dynatree-radio +{ + background-position: -32px -48px; +} +.dynatree-selected span.dynatree-radio:hover +{ + background-position: -48px -48px; +} + +/******************************************************************************* + * Node type icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-ico- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'f': folder + */ + +span.dynatree-icon /* Default icon */ +{ + margin-left: 3px; + background-position: 0px 0px; +} + +.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */ +{ + background-position: 0px -16px; +} + +.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */ +{ + background-position: -64px -16px; +} + +/* Status node icons */ + +.dynatree-statusnode-wait span.dynatree-icon +{ + background-image: url("loading.gif"); +} + +.dynatree-statusnode-error span.dynatree-icon +{ + background-position: 0px -112px; +/* background-image: url("ltError.gif");*/ +} + +/******************************************************************************* + * Node titles + */ + +/* @Chrome: otherwise hit area of node titles is broken (issue 133) + Removed again for issue 165; (133 couldn't be reproduced) */ +span.dynatree-node +{ +/* display: -moz-inline-box; /* issue 133, 165, 172, 192. removed for issue 221*/ +/* -moz-box-align: start; /* issue 221 */ + display: inline-block; /* issue 373 Required to make a span sizeable */ + vertical-align: top; +} + + +/* Remove blue color and underline from title links */ +ul.dynatree-container a +/*, ul.dynatree-container a:visited*/ +{ + color: black; /* inherit doesn't work on IE */ + text-decoration: none; + vertical-align: top; + margin: 0px; + margin-left: 3px; +/* outline: 0; /* @ Firefox, prevent dotted border after click */ +} + +ul.dynatree-container a:hover +{ +/* text-decoration: underline; */ + background-color: #F2F7FD; /* light blue */ + border-color: #B8D6FB; /* darker light blue */ +} + +span.dynatree-node a +{ + font-size: 10pt; /* required for IE, quirks mode */ + display: inline-block; /* Better alignment, when title contains <br> */ +/* vertical-align: top;*/ + padding-left: 3px; + padding-right: 3px; /* Otherwise italic font will be outside bounds */ + /* line-height: 16px; /* should be the same as img height, in case 16 px */ +} +span.dynatree-folder a +{ + font-weight: bold; +} + +ul.dynatree-container a:focus, +span.dynatree-focused a:link /* @IE */ +{ + background-color: #EFEBDE; /* gray */ +} + +span.dynatree-has-children a +{ +} + +span.dynatree-expanded a +{ +} + +span.dynatree-selected a +{ + color: green; + font-style: italic; +} + +span.dynatree-active a +{ + background-color: #3169C6 !important; + color: white !important; /* @ IE6 */ +} + +/******************************************************************************* + * Drag'n'drop support + */ + +/*** Helper object ************************************************************/ +div.dynatree-drag-helper +{ +} +div.dynatree-drag-helper a +{ + border: 1px solid gray; + background-color: white; + padding-left: 5px; + padding-right: 5px; + opacity: 0.8; +} +span.dynatree-drag-helper-img +{ + /* + position: relative; + left: -16px; + */ +} +div.dynatree-drag-helper /*.dynatree-drop-accept*/ +{ + +/* border-color: green; + background-color: red;*/ +} +div.dynatree-drop-accept span.dynatree-drag-helper-img +{ + background-position: -32px -112px; +} +div.dynatree-drag-helper.dynatree-drop-reject +{ + border-color: red; +} +div.dynatree-drop-reject span.dynatree-drag-helper-img +{ + background-position: -16px -112px; +} + +/*** Drop marker icon *********************************************************/ + +#dynatree-drop-marker +{ + width: 24px; + position: absolute; + background-position: 0 -128px; + margin: 0; +/* border: 1px solid red; */ +} +#dynatree-drop-marker.dynatree-drop-after, +#dynatree-drop-marker.dynatree-drop-before +{ + width:64px; + background-position: 0 -144px; +} +#dynatree-drop-marker.dynatree-drop-copy +{ + background-position: -64px -128px; +} +#dynatree-drop-marker.dynatree-drop-move +{ + background-position: -64px -128px; +} + +/*** Source node while dragging ***********************************************/ + +span.dynatree-drag-source +{ + /* border: 1px dotted gray; */ + background-color: #e0e0e0; +} +span.dynatree-drag-source a +{ + color: gray; +} + +/*** Target node while dragging cursor is over it *****************************/ + +span.dynatree-drop-target +{ + /*border: 1px solid gray;*/ +} +span.dynatree-drop-target a +{ +} +span.dynatree-drop-target.dynatree-drop-accept a +{ + /*border: 1px solid green;*/ + background-color: #3169C6 !important; + color: white !important; /* @ IE6 */ + text-decoration: none; +} +span.dynatree-drop-target.dynatree-drop-reject +{ + /*border: 1px solid red;*/ +} +span.dynatree-drop-target.dynatree-drop-after a +{ +} + + +/******************************************************************************* + * Custom node classes (sample) + */ + +span.custom1 a +{ + background-color: maroon; + color: yellow; +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/vline-rtl.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/vline-rtl.gif new file mode 100644 index 0000000000000000000000000000000000000000..0400cb3eeace6abda62ae41957f3e41907a3aa6b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/vline-rtl.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/vline.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/vline.gif new file mode 100644 index 0000000000000000000000000000000000000000..1b00ae50e0f1538d985811207b0af2a85d1d128b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/dist/skin/vline.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-226.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-226.html new file mode 100644 index 0000000000000000000000000000000000000000..435b2dab1eb5fb998b3c73f756c78b1a6b954d17 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-226.html @@ -0,0 +1,48 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Test ISSUE</title> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + </style> + + <script type="text/javascript"> +$(function () { + $("#tree").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onActivate: function(node) { + $("#echoActive").text("" + node + " (" + node.getKeyPath()+ ")"); + }, + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + } + }); + $("#btn1").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + node.setTitle("abc'hurz"); + }); + $("#btn2").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("2"); + }); +}); + </script> +</head> +<body> + <div id="tree"> + </div> + <div>Active node: <span id="echoActive">-</span></div> + + <button id="btn1">Action 1</button> + <button id="btn2">Action 2</button> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-232.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-232.html new file mode 100644 index 0000000000000000000000000000000000000000..cdf6de40250e832cf6682a2381b9aca1ad8ac5c3 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-232.html @@ -0,0 +1,306 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - issue 232</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + var treeData = [ + {title: "item1 with key and tooltip", tooltip: "Look, a tool tip!" }, + {title: "item2: selected on init", select: true }, + {title: "Folder", isFolder: true, key: "id3", + children: [ + {title: "Sub-item 3.1", + children: [ + {title: "Sub-item 3.1.1", key: "id3.1.1" }, + {title: "Sub-item 3.1.2", key: "id3.1.2" } + ] + }, + {title: "Sub-item 3.2", + children: [ + {title: "Sub-item 3.2.1", key: "id3.2.1" }, + {title: "Sub-item 3.2.2", key: "id3.2.2" } + ] + } + ] + }, + {title: "Document with some children (expanded on init)", key: "id4", expand: true, + children: [ + {title: "Sub-item 4.1 (active on init)", activate: true, + children: [ + {title: "Sub-item 4.1.1", key: "id4.1.1" }, + {title: "Sub-item 4.1.2", key: "id4.1.2" } + ] + }, + {title: "Sub-item 4.2 (selected on init)", select: true, + children: [ + {title: "Sub-item 4.2.1", key: "id4.2.1" }, + {title: "Sub-item 4.2.2", key: "id4.2.2" } + ] + }, + {title: "Sub-item 4.3 (hideCheckbox)", hideCheckbox: true }, + {title: "Sub-item 4.4 (unselectable)", unselectable: true } + ] + } + ]; + $(function(){ + + // --- Initialize sample trees + $("#tree1").dynatree({ + checkbox: true, + // Override class name for checkbox icon: +// classNames: {checkbox: "dynatree-radio"}, + selectMode: 1, + children: treeData, + onActivate: function(node) { + $("#echoActive1").text(node.data.title); + }, + onSelect: function(select, node) { + // Display list of selected nodes + var s = node.tree.getSelectedNodes().join(", "); + $("#echoSelection1").text(s); + }, + onDblClick: function(node, event) { + node.toggleSelect(); + }, + onKeydown: function(node, event) { + if( event.which == 32 ) { + node.toggleSelect(); + return false; + } + }, + // The following options are only required, if we have more than one tree on one page: +// initId: "treeData", + cookieId: "dynatree-Cb1", + idPrefix: "dynatree-Cb1-" + }); + + $("#tree2").dynatree({ + checkbox: true, + selectMode: 2, + children: treeData, + onSelect: function(select, node) { + // Display list of selected nodes + var selNodes = node.tree.getSelectedNodes(); + // convert to title/key array + var selKeys = $.map(selNodes, function(node){ + return "[" + node.data.key + "]: '" + node.data.title + "'"; + }); + $("#echoSelection2").text(selKeys.join(", ")); + }, + onClick: function(node, event) { + // We should not toggle, if target was "checkbox", because this + // would result in double-toggle (i.e. no toggle) + if( node.getEventTargetType(event) == "title" ) + node.toggleSelect(); + }, + onKeydown: function(node, event) { + if( event.which == 32 ) { + node.toggleSelect(); + return false; + } + }, + // The following options are only required, if we have more than one tree on one page: + cookieId: "dynatree-Cb2", + idPrefix: "dynatree-Cb2-" + }); + + $("#tree3").dynatree({ + checkbox: true, + selectMode: 3, + children: treeData, + onSelect: function(select, node) { + // Get a list of all selected nodes, and convert to a key array: + var selKeys = $.map(node.tree.getSelectedNodes(), function(node){ + return node.data.key; + }); + $("#echoSelection3").text(selKeys.join(", ")); + + // Get a list of all selected TOP nodes + var selRootNodes = node.tree.getSelectedNodes(true); + // ... and convert to a key array: + var selRootKeys = $.map(selRootNodes, function(node){ + return node.data.key; + }); + $("#echoSelectionRootKeys3").text(selRootKeys.join(", ")); + $("#echoSelectionRoots3").text(selRootNodes.join(", ")); + }, + onDblClick: function(node, event) { + node.toggleSelect(); + }, + onKeydown: function(node, event) { + if( event.which == 32 ) { + node.toggleSelect(); + return false; + } + }, + // The following options are only required, if we have more than one tree on one page: +// initId: "treeData", + cookieId: "dynatree-Cb3", + idPrefix: "dynatree-Cb3-" + }); + + $("#tree4").dynatree({ + checkbox: false, + selectMode: 2, + children: treeData, + onQuerySelect: function(select, node) { + if( node.data.isFolder ) + return false; + }, + onSelect: function(select, node) { + // Display list of selected nodes + var selNodes = node.tree.getSelectedNodes(); + // convert to title/key array + var selKeys = $.map(selNodes, function(node){ + return "[" + node.data.key + "]: '" + node.data.title + "'"; + }); + $("#echoSelection4").text(selKeys.join(", ")); + }, + onClick: function(node, event) { + if( ! node.data.isFolder ) + node.toggleSelect(); + }, + onDblClick: function(node, event) { + node.toggleExpand(); + }, + onKeydown: function(node, event) { + if( event.which == 32 ) { + node.toggleSelect(); + return false; + } + }, + // The following options are only required, if we have more than one tree on one page: +// initId: "treeData", + cookieId: "dynatree-Cb4", + idPrefix: "dynatree-Cb4-" + }); + + $("#btnToggleSelect").click(function(){ + $("#tree2").dynatree("getRoot").visit(function(node){ + node.toggleSelect(); + }); + return false; + }); + $("#btnDeselectAll").click(function(){ + $("#tree2").dynatree("getRoot").visit(function(node){ + node.select(false); + }); + return false; + }); + $("#btnSelectAll").click(function(){ + $("#tree2").dynatree("getRoot").visit(function(node){ + node.select(true); + }); + return false; + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> + }); +</script> +</head> + +<body class="example"> + <h1>Example: Selection and checkbox</h1> + + <!-- Tree #1 --> + + <p class="description"> + This tree has <b>checkoxes and selectMode 1 (single-selection)</b> enabled.<br> + A double-click handler selects a <i>document</i> node (not folders).<br> + A keydown handler selects on [space].<br> + The <code>checkbox</code> class name was customized, to display radio + buttons.<br> + Note: the initialization data contains multiple selected nodes. This is + considered bad input data and <b>not</b> fixed automatically (only on + the first click). + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + <div id="tree1"></div> + <div>Active node: <span id="echoActive1">-</span></div> + <div>Selection: <span id="echoSelection1">-</span></div> + + + <!-- Tree #2 --> + + <p class="description"> + This tree has <b>selectMode 2 (multi-selection)</b> enabled.<br> + A single-click handler selects the node.<br> + A keydown handler selects on [space]. + </p> + <p> + <a href="#" id="btnSelectAll">Select all</a> - + <a href="#" id="btnDeselectAll">Deselect all</a> - + <a href="#" id="btnToggleSelect">Toggle select</a> + </p> + <div id="tree2"></div> + <div>Selected keys: <span id="echoSelection2">-</span></div> + + + <!-- Tree #3 --> + + <p class="description"> + This tree has <b>checkoxes and selectMode 3 (hierarchical multi-selection)</b> enabled.<br> + A double-click handler selects the node.<br> + A keydown handler selects on [space]. + </p> + <div id="tree3"></div> + <div>Selected keys: <span id="echoSelection3">-</span></div> + <div>Selected root keys: <span id="echoSelectionRootKeys3">-</span></div> + <div>Selected root nodes: <span id="echoSelectionRoots3">-</span></div> + + + <!-- Tree #4 --> + + <p class="description"> + This tree has selectMode 2 (multi-selection) enabled, but <b>no checkboxes</b>.<br> + A single-click handler selects the node.<br> + A keydown handler selects on [space].<br> + A double-click handler expands documents.<br> + A onQuerySelect handler prevents selection of folders. + </p> + <div id="tree4"></div> + <div>Selected keys: <span id="echoSelection4">-</span></div> + + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-241.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-241.html new file mode 100644 index 0000000000000000000000000000000000000000..06d03339e3be3cd8147ad0a3926faf28cdfa4ae0 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-241.html @@ -0,0 +1,48 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Test ISSUE</title> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + </style> + + <script type="text/javascript"> +$(function () { + $("#tree").dynatree({ + initAjax: { + url: "_test-241.json" + }, + onActivate: function(node) { + $("#echoActive").text("" + node + " (" + node.getKeyPath()+ ")"); + }, + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + } + }); + $("#btn1").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("1"); + }); + $("#btn2").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("2"); + }); +}); + </script> +</head> +<body> + <div id="tree"> + </div> + <div>Active node: <span id="echoActive">-</span></div> + + <button id="btn1">Action 1</button> + <button id="btn2">Action 2</button> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-241.json b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-241.json new file mode 100644 index 0000000000000000000000000000000000000000..9c22b738366fc294699bd2af108c5492e70f5494 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-241.json @@ -0,0 +1,41 @@ +[ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", "expand": true, + "children": [ + {"title": "Sub-item 2.1", + "children": [ + {"title": "Sub-item 2.1.1", + "children": [ + {"title": "Sub-item 2.1.1.1", "href": "abc"}, + {"title": "Sub-item 2.1.2.2"}, + {"title": "Sub-item 2.1.1.3"}, + {"title": "Sub-item 2.1.2.4"} + ] + }, + {"title": "Sub-item 2.1.2"}, + {"title": "Sub-item 2.1.3"}, + {"title": "Sub-item 2.1.4"} + ] + }, + {"title": "Sub-item 2.2"}, + {"title": "Sub-item 2.3 (lazy)", "isLazy": true } + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1", + "children": [ + {"title": "Sub-item 3.1.1"}, + {"title": "Sub-item 3.1.2"}, + {"title": "Sub-item 3.1.3"}, + {"title": "Sub-item 3.1.4"} + ] + }, + {"title": "Sub-item 3.2"}, + {"title": "Sub-item 3.3"}, + {"title": "Sub-item 3.4"} + ] + }, + {"title": "Lazy Folder 4", "isFolder": true, "isLazy": true, "key": "folder4"}, + {"title": "Item 5"} +] diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-247.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-247.html new file mode 100644 index 0000000000000000000000000000000000000000..de5602529f423d38317835071138385bb3354cb0 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-247.html @@ -0,0 +1,244 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- jquery.contextmenu, A Beautiful Site (http://abeautifulsite.net/) --> + <script src="contextmenu/jquery.contextMenu-custom.js" type="text/javascript"></script> + <link href="contextmenu/jquery.contextMenu.css" rel="stylesheet" type="text/css" > + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + + <script type="text/javascript"> + + // --- Implement Cut/Copy/Paste -------------------------------------------- + var clipboardNode = null; + var pasteMode = null; + + function copyPaste(action, node) { + switch( action ) { + case "cut": + case "copy": + clipboardNode = node; + pasteMode = action; + break; + case "paste": + if( !clipboardNode ) { + alert("Clipoard is empty."); + break; + } + if( pasteMode == "cut" ) { + // Cut mode: check for recursion and remove source + var isRecursive = false; + var cb = clipboardNode.toDict(true, function(dict){ + // If one of the source nodes is the target, we must not move + if( dict.key == node.data.key ) + isRecursive = true; + }); + if( isRecursive ) { + alert("Cannot move a node to a sub node."); + return; + } + node.addChild(cb); + clipboardNode.remove(); + } else { + // Copy mode: prevent duplicate keys: + var cb = clipboardNode.toDict(true, function(dict){ + dict.title = "Copy of " + dict.title; + delete dict.key; // Remove key, so a new one will be created + }); + node.addChild(cb); + } + clipboardNode = pasteMode = null; + break; + default: + alert("Unhandled clipboard action '" + action + "'"); + } + }; + + // --- Contextmenu helper -------------------------------------------------- + function bindContextMenu(span) { + // Add context menu to this node: + $(span).contextMenu({menu: "myMenu"}, function(action, el, pos) { + // The event was bound to the <span> tag, but the node object + // is stored in the parent <li> tag + var node = $.ui.dynatree.getNode(el); + switch( action ) { + case "cut": + case "copy": + case "paste": + copyPaste(action, node); + break; + default: + alert("Todo: appply action '" + action + "' to node " + node); + } + }); + }; + + // --- Init dynatree during startup ---------------------------------------- + + $(function(){ + + $("#tree").dynatree({ + persist: true, + onActivate: function(node) { + $("#echoActivated").text(node.data.title + ", key=" + node.data.key); + }, + onClick: function(node, event) { + // Close menu on click + if( $(".contextMenu:visible").length > 0 ){ + $(".contextMenu").hide(); +// return false; + } + }, + onKeydown: function(node, event) { + // Eat keyboard events, when a menu is open + if( $(".contextMenu:visible").length > 0 ) + return false; + + switch( event.which ) { + + // Open context menu on [Space] key (simulate right click) + case 32: // [Space] + $(node.span).trigger("mousedown", { + preventDefault: true, + button: 2 + }) + .trigger("mouseup", { + preventDefault: true, + pageX: node.span.offsetLeft, + pageY: node.span.offsetTop, + button: 2 + }); + return false; + + // Handle Ctrl-C, -X and -V + case 67: + if( event.ctrlKey ) { // Ctrl-C + copyPaste("copy", node); + return false; + } + break; + case 86: + if( event.ctrlKey ) { // Ctrl-V + copyPaste("paste", node); + return false; + } + break; + case 88: + if( event.ctrlKey ) { // Ctrl-X + copyPaste("cut", node); + return false; + } + break; + } + }, + /*Bind context menu for every node when it's DOM element is created. + We do it here, so we can also bind to lazy nodes, which do not + exist at load-time. (abeautifulsite.net menu control does not + support event delegation)*/ + onCreate: function(node, span){ + bindContextMenu(span); + }, + /*Load lazy content (to show that context menu will work for new items too)*/ + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + }, + /* D'n'd, just to show it's compatible with a context menu. + See http://code.google.com/p/dynatree/issues/detail?id=174 */ + dnd: { + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragStart: function(node) { + return true; + }, + onDragEnter: function(node, sourceNode) { + if(node.parent !== sourceNode.parent) + return false; + return ["before", "after"]; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + sourceNode.move(node, hitMode); + } + } + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: Context Menu</h1> + <p class="description"> + Implementation of a context menu. Right-click a node and see what happens.<br> + Also [space] key is supported to open the menu.<br> + <br> + This example also demonstrates, how to copy or move branches and how + to implement clipboard functionality. + <br> + A keyboard handler implements Cut, Copy, and Paste with <code>Ctrl-X</code>, + <code>Ctrl-C</code>, <code>Ctrl-V</code>. + </p> + <p class="description"> + This sample uses the jQuery Context Menu Plugin by Cory S.N. LaViska.<br> + Visit <a href="http://abeautifulsite.net/">A Beautiful Site</a> for usage and more information. + </p> + + <!-- Definition of context menu --> + <ul id="myMenu" class="contextMenu"> + <li class="edit"><a href="#edit">Edit</a></li> + <li class="cut separator"><a href="#cut">Cut</a></li> + <li class="copy"><a href="#copy">Copy</a></li> + <li class="paste"><a href="#paste">Paste</a></li> + <li class="delete"><a href="#delete">Delete</a></li> + <li class="quit separator"><a href="#quit">Quit</a></li> + </ul> + + <!-- Definition tree structure --> + <div id="tree"> + <ul> + <li id="id1" title="Look, a tool tip!">item1 with key and tooltip + <li id="id2" class="activate">item2: activated on init + <li id="id3" class="folder">Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <li id="id3.2">Sub-item 3.2 + </ul> + + <li id="id4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="id4.1">Sub-item 4.1 + <li id="id4.2">Sub-item 4.2 + </ul> + + <li id="id5" class="lazy folder">Lazy folder + </ul> + </div> + + <div>Selected node: <span id="echoActivated">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-251.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-251.html new file mode 100644 index 0000000000000000000000000000000000000000..84a90e5717be44e64f98d88d6081bef3eaee4776 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-251.html @@ -0,0 +1,80 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Test ISSUE</title> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + </style> + + <script type="text/javascript"> +$(function () { + $("#tree").dynatree({ + // initAjax: { + // url: "sample-data3.json" + // }, + onActivate: function(node) { + $("#echoActive").text("" + node + " (" + node.getKeyPath()+ ")"); + }, + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + } + }); + $("#btn1").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("1"); + }); + $("#btn2").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("2"); + }); +}); + </script> +</head> +<body> + <div id="tree"> +<ul xmlns:msxsl="urn:schemas-microsoft-com:xslt"> + <li data="icon: 'FirstLevelA.ico'">First Level 1.1</li> + <li data="icon: 'FirstLevelB.ico'"> + <span style="DISPLAY: inline-block;"> + <span style="DISPLAY: inline-block;" menu="1,KPHL,KPHL - KBWI" showMenuAtCursor="true" title="">KPHL</span> + <span style="DISPLAY: inline-block;">-</span> + <span style="DISPLAY: inline-block;" menu="1,KBWI,KPHL - KBWI" showMenuAtCursor="true" title="">KBWI</span> + <span style="DISPLAY: inline-block;">(</span> + <span style="DISPLAY: inline-block;" menu="0,KPHL - KBWI" showMenuAtCursor="true" title="">PHILADELPHIA INT / BALTIMORE WASHINGTON</span> + <span style="DISPLAY: inline-block;">)</span> + </span> + <ul> + <li data="icon: 'SecondLevelA.ico'"> + <span style="DISPLAY: inline-block;" menu="2,SOMEDATA1" showMenuAtCursor="true" title="">Route 1</span> + <ul> + <li data="icon: 'ThirdLevelA.ico'"> + <span style="DISPLAY: inline-block;" menu="3,SOMEDATA2" showMenuAtCursor="true" title="">ABC - Description of ABC</span> + </li> + <li data="icon: 'ThirdLevelA.ico'"> + <span style="DISPLAY: inline-block;" menu="3,SOMEDATA3" showMenuAtCursor="true" title="">123 - Description of 123</span> + </li> + <li data="icon: 'ThirdLevelA.ico'"> + <span style="DISPLAY: inline-block;" menu="3,SOMEDATA4" showMenuAtCursor="true" title="">XYZ - Description of XYZ</span> + </li> + <li data="icon: 'ThirdLevelA.ico'"> + <span style="DISPLAY: inline-block;" menu="3,SOMEDATA5" showMenuAtCursor="true" title="">456 - Description of 456</span> + </li> + </ul> + </li> + </ul> + </li> +</ul> + </div> + <div>Active node: <span id="echoActive">-</span></div> + + <button id="btn1">Action 1</button> + <button id="btn2">Action 2</button> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-260.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-260.html new file mode 100644 index 0000000000000000000000000000000000000000..8b4d46c5a0bec8fdebedb8fc92cd1aba246e0dec --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-260.html @@ -0,0 +1,53 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Test ISSUE</title> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + </style> + + <script type="text/javascript"> +$(function () { + $("#tree").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 5000 // don't do this in production code + }); + }, + onActivate: function(node) { + $("#echoActive").text("" + node + " (" + node.getKeyPath()+ ")"); + }, + onClick: function(node) { + alert(node.isLoading()); + } + }); + $("#btn1").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("1"); + }); + $("#btn2").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("2"); + }); +}); + </script> +</head> +<body> + <div id="tree"> + </div> + <div>Active node: <span id="echoActive">-</span></div> + + <button id="btn1">Action 1</button> + <button id="btn2">Action 2</button> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-305.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-305.html new file mode 100644 index 0000000000000000000000000000000000000000..2d176e6d63e1030175dc07f22e40c9d73637de47 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-305.html @@ -0,0 +1,37 @@ +<html lang="en"> +<head> <title>Dynatree - Bug Demo</title> + <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.js"></script> + <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js"></script> + <link rel="stylesheet" type="text/css" href="http://wwwendt.de/tech/dynatree/src/skin-vista/ui.dynatree.css"> + <!-- + <script type="text/javascript" src="http://dynatree.googlecode.com/svn/trunk/src/jquery.dynatree.js"></script> +--> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + <!-- fixed file below --> + <!-- <script type="text/javascript" src="file:/tmp/jquery.dynatree.js"> --> + + </script> + <script type="text/javascript">//<![CDATA[ + var treeData = [ { title: + "Parent", children: [{title: "Child1", select:true},{ + title: "Child2", unselectable: true }] } ]; + + $(function(){ + $("#tree2").dynatree({ + checkbox: true, + selectMode: 3, + children: treeData, + }); + }); + //]]> + + </script> + </head> + <body> + <h1> + deselect and select child1, watch parent partsel style + </h1> + <div id="tree2"> + </div> + </body> + </html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-319.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-319.html new file mode 100644 index 0000000000000000000000000000000000000000..7fdf34536fe9dfa0308bdf52d793920fdc99d5d4 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-319.html @@ -0,0 +1,84 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" > +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> +</head> +<script type="text/javascript"> + var gv_newRosterOptionID = -1; + $(function () { + $("#tree").dynatree({ + debugLevel:2, + onActivate: function (node) { + $("#active").text(node.data.title); + }, + onFocus: function (node) { + $("#focus").text(node.data.title); + } + }); + }); + + function copyfail_onclick() { + var dtActive = $("#tree").dynatree("getActiveNode"); + var newTopNodeKey = gv_newRosterOptionID; + var clipboard = dtActive.toDict(true, function (dict) { + dict.title = "Copy of " + dict.title + " - " + gv_newRosterOptionID; + dict.key = gv_newRosterOptionID; // prevent duplicate keys + gv_newRosterOptionID--; + }); + + var dtNewNode = dtActive.addChild(clipboard); + dtNewNode.move(dtActive,'after'); + } + + function copywork_onclick() { + var dtActive = $("#tree").dynatree("getActiveNode"); + var newTopNodeKey = gv_newRosterOptionID; + var clipboard = dtActive.toDict(true, function (dict) { + dict.title = "Copy of " + dict.title + " - " + gv_newRosterOptionID; + dict.key = gv_newRosterOptionID; // prevent duplicate keys + gv_newRosterOptionID--; + }); + + var dtNewNode = dtActive.addChild(clipboard); + dtActive.expand(true); + dtNewNode.move(dtActive,'after'); + } + +</script> +<body> + <!-- Add a <div> element where the tree should appear: --> + <div id="tree"> + <ul> + <li id="key1" title="Look, a tool tip!">item1 with key and tooltip + <li id="key2" class="selected">item2: selected on init + <li id="key3" class="folder">Folder with some children + <ul> + <li id="key3.1">Sub-item 3.1 + <li id="key3.2">Sub-item 3.2 + </ul> + + <li id="key4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="key4.1">Sub-item 4.1 + <li id="key4.2">Sub-item 4.2 + </ul> + + <li id="key5" class="lazy folder">Lazy folder + </ul> + </div> + + <input id="copyFail" type="button" value="copy current node after (Fails)" onclick="return copyfail_onclick()" /> + <input id="copyWork" type="button" value="copy current node after (Works)" onclick="return copywork_onclick()" /> + <div>Active: <span id="active"></span></div> + <div>Focused: <span id="focus"></span></div> + +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-321.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-321.html new file mode 100644 index 0000000000000000000000000000000000000000..e02a6fdad654e68d9a717d310af177cb5f3ee76a --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-321.html @@ -0,0 +1,101 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" > +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> + <title>Dynatree - Example</title> +<!-- + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui-1.8.20.custom.min.js" type="text/javascript"></script> + <link href="../jquery/cupertino/jquery-ui-1.8.20.custom.css" rel="stylesheet" type="text/css"> +--> + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> + <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script> + <link type="text/css" rel="stylesheet" href="http://jqueryui.com/themes/cupertino/jquery.ui.all.css" /> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + #firstDiv {width:250px; float: left;} + #outer {width:550px; float: left;} + #tree {width:350px; float: left;} + </style> +</head> +<script type="text/javascript"> + var gv_newRosterOptionID = -1; + $(document).ready(function() { + $("#tabs").tabs(); + + $(function () { + $("#tree").dynatree({ + debugLevel:2, + onActivate: function (node) { + $("#active").text(node.data.title); + }, + onFocus: function (node) { + $("#focus").text(node.data.title); + }, + dnd: { + preventVoidMoves: true, + onDragStart: function (node) { + //logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDrop: function (node, sourceNode, hitMode, ui, draggable) { + //logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragEnter: function (node, sourceNode) { + return true; //["before", "after"]; + } + } + }); + }); + }); +</script> +<body> + <!-- Add a <div> element where the tree should appear: --> + <div id="firstDiv"> + The First Div - push it left + </div> + <div id="outer"> + <P> This is some other text - Push it down + <div id="tabs"> + <ul> + <li><a href="#fragment-1"><span>One</span></a></li> + <li><a href="#fragment-2"><span>Two</span></a></li> + <li><a href="#fragment-3"><span>Three</span></a></li> + </ul> + <div id="fragment-1"> + <div id="tree"> + <ul> + <li id="key1" title="Look, a tool tip!">item1 with key and tooltip + <li id="key2" class="selected">item2: selected on init + <li id="key3" class="folder">Folder with some children + <ul> + <li id="key3.1">Sub-item 3.1 + <li id="key3.2">Sub-item 3.2 + </ul> + + <li id="key4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="key4.1">Sub-item 4.1 + <li id="key4.2">Sub-item 4.2 + </ul> + </ul> + </div> + </div> + <div id="fragment-2"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + </div> + <div id="fragment-3"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + </div> + </div> + </div> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-329.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-329.html new file mode 100644 index 0000000000000000000000000000000000000000..593b0dad5bf9fa88e12496fd2ad982eed7c5bfe6 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-329.html @@ -0,0 +1,104 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" > +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> + <title>Dynatree - Example</title> +<!-- + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui-1.8.20.custom.min.js" type="text/javascript"></script> + <link href="../jquery/cupertino/jquery-ui-1.8.20.custom.css" rel="stylesheet" type="text/css"> +--> + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> + <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script> + <link type="text/css" rel="stylesheet" href="http://jqueryui.com/themes/cupertino/jquery.ui.all.css" /> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css"> + + + <style type="text/css"> + #firstDiv {width:250px; float: left;} + #outer {width:550px; float: left;} + #tree {width:350px; float: left;} + </style> +</head> +<script type="text/javascript"> + var gv_newRosterOptionID = -1; + $(document).ready(function() { + $("#tabs").tabs(); + + $(function () { + $("#tree").dynatree({ + debugLevel:2, + onActivate: function (node) { + $("#active").text(node.data.title); + }, + onFocus: function (node) { + $("#focus").text(node.data.title); + }, + dnd: { + preventVoidMoves: true, + onDragStart: function (node) { + //logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDrop: function (node, sourceNode, hitMode, ui, draggable) { + //logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragEnter: function (node, sourceNode) { + return true; //["before", "after"]; + } + } + }); + }); + }); +</script> +<body> + <!-- Add a <div> element where the tree should appear: --> + <div id="firstDiv"> + The First Div - push it left + </div> + <div id="outer"> + <P> This is some other text - Push it down + <div id="tabs"> + <ul> + <li><a href="#fragment-1"><span>One</span></a></li> + <li><a href="#fragment-2"><span>Two</span></a></li> + <li><a href="#fragment-3"><span>Three</span></a></li> + </ul> + <div id="fragment-1"> + <div id="tree"> + <ul> + <li id="key1" data="iconClass:'icon-music'" title="Look, a tool tip!">item1 with key and tooltip + <li id="key2" class="selected">item2: selected on init + <li id="key3" class="folder">Folder with some children + <ul> + <li id="key3.1">Sub-item 3.1 + <li id="key3.2">Sub-item 3.2 + </ul> + + <li id="key4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="key4.1">Sub-item 4.1 + <li id="key4.2">Sub-item 4.2 + </ul> + </ul> + </div> + </div> + <div id="fragment-2"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + </div> + <div id="fragment-3"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. + </div> + </div> + </div> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-447.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-447.html new file mode 100644 index 0000000000000000000000000000000000000000..f86d23ee05e00fa91fefa4929813945ea5ca595a --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-447.html @@ -0,0 +1,321 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> +<!-- + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript"></script> +--> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + #draggableSample, #droppableSample { + height:100px; + padding:0.5em; + width:150px; + border:1px solid #AAAAAA; + } + #draggableSample { + background-color: silver; + color:#222222; + } + #droppableSample { + background-color: maroon; + color: white; + } + #droppableSample.drophover { + border: 1px solid green; + } + </style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 750 // don't do thi in production code + }); + }, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + revert: false, // true: slide helper back to source if drop is rejected + onDragStart: function(node) { + /** This function MUST be defined to enable dragging for the tree. + * Return false to cancel dragging of node. + */ + logMsg("tree.onDragStart(%o)", node); +// if(node.data.isFolder){ +// return false; +// } + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + onDragEnter: function(node, sourceNode) { + /** sourceNode may be null for non-dynatree droppables. + * Return false to disallow dropping on node. In this case + * onDragOver and onDragLeave are not called. + * Return 'over', 'before, or 'after' to force a hitMode. + * Return ['before', 'after'] to restrict available hitModes. + * Any other return value will calc the hitMode from the cursor position. + */ + // Prevent dropping a parent below another parent (only sort + // nodes under the same parent) + if(node.parent !== sourceNode.parent){ + return false; + } + // Don't allow dropping *over* a node (would create a child) + return ["before", "after"]; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + /** This function MUST be defined to enable dropping of items on + * the tree. + */ + sourceNode.move(node, hitMode); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 750 // don't do thi in production code + }); + }, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + }, + dnd: { + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + /* sourceNode may be null for non-dynatree droppables. + * Return false to disallow dropping on node. In this case + * onDragOver and onDragLeave are not called. + * Return 'over', 'before, or 'after' to force a hitMode. + * Any other return value will calc the hitMode from the cursor position. + */ + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + // For the sake of this example deny dropping over folders + if(node.data.isFolder){ + return false; + } + return true; +// return "over"; + }, + onDragOver: function(node, sourceNode, hitMode) { + /* Return false to disallow dropping this node.*/ +// if(node.data.isFolder){ +// var dd = $.ui.ddmanager.current; +// dd.cancel(); +// alert("folder"); +// } + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + /* This function MUST be defined to enable dropping of items on the tree. + * sourceNode may be null, if it is a non-Dynatree droppable. + */ + logMsg("tree.onDrop(%o, %o)", node, sourceNode); + var copynode; + if(sourceNode) { + copynode = sourceNode.toDict(true, function(dict){ + dict.title = "Copy of " + dict.title; + delete dict.key; // Remove key, so a new one will be created + }); + }else{ + copynode = {title: "This node was dropped here (" + ui.helper + ")."}; + } + if(hitMode == "over"){ + // Append as child node + node.addChild(copynode); + // expand the drop target + node.expand(true); + }else if(hitMode == "before"){ + // Add before this, i.e. as child of current parent + node.parent.addChild(copynode, node); + }else if(hitMode == "after"){ + // Add after this, i.e. as child of current parent + node.parent.addChild(copynode, node.getNextSibling()); + } + }, + onDragLeave: function(node, sourceNode) { + /** Always called if onDragEnter was called. + */ + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize simple draggable sample ---------------------------------- + $("#draggableSample").draggable({ +// revert: "invalid", // slide back, when dropping over non-target + revert: function(dropped){ + // Return `true` to let the helper slide back. + if(typeof dropped === "boolean"){ + // dropped == true, when dropped over a simple, valid droppable target. + // false, when dropped outside a drop target. + return !dropped; + } + // Drop comes from another tree. Default behavior is to assume + // a valid drop, since we are over a drop-target. + // Therefore we have to make an extra check, if the target node + // was rejected by a Dynatree callback. + var helper = $.ui.ddmanager && $.ui.ddmanager.current && $.ui.ddmanager.current.helper; + var isRejected = helper && helper.hasClass("dynatree-drop-reject"); + return isRejected; + }, + connectToDynatree: true, + cursorAt: { top: -5, left:-5 }, + helper: "clone" + }); + // --- Initialize simple droppable sample ---------------------------------- + $("#droppableSample").droppable({ + hoverClass: "drophover", + addClasses: true, +// tolerance: "pointer", + over: function(event, ui) { + logMsg("droppable.over, %o, %o", event, ui); + }, + drop: function(event, ui) { + var source = ui.helper.data("dtSourceNode") || ui.draggable; + $(this).addClass("ui-state-highlight").find("p").html("Dropped " + source); +// alert("dropped"); + } + }); + + $("#btn1").click(function(e){ + var tree = $("#tree").dynatree("getTree"); + tree.reload(); + }); + $("#btn2").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("2"); + }); + + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>Example: Standard jQuery drag-and-drop</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <table> + <thead> + <tr> + <th> + <p>This tree allows dragging.</p> + </th> + <th> + <p>This tree allows dropping.</p> + </th> + </tr> + </thead> + <tbody> + <tr valign="top"> + <td> + <div id="tree"> </div> + </td> + <td> + <div id="tree2"></div> + </td> + </tr> + <tr> + <td> + <div>Active node: <span id="echoActive">-</span></div> + </td> + <td> + <div>Active node: <span id="echoActive2">-</span></div> + </td> + </tr> + <tr> + <td> + <div id="draggableSample" class="ui-widget-content"> + <p>Drag me around</p> + </div> + </td> + <td> + <div id="droppableSample" class="ui-widget-content"> + <p>Drop something here</p> + </div> + </td> + </tr> + </tbody> + </table> + + <button id="btn1">Reload 1</button> + <button id="btn2">Action 2</button> + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-issue-NNN.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-issue-NNN.html new file mode 100644 index 0000000000000000000000000000000000000000..cb6a099948facb552b9111f64d50e477664bea8a --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/_test-issue-NNN.html @@ -0,0 +1,87 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>Dynatree issue ISSUE_NUMBER</title> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + #tree{ + height: 250px; + } + </style> + + <script type="text/javascript"> + + var treeData = [ + {title: "Node 1" }, + {title: "Node 2", select: true }, + {title: "Folder 3", key: "id3", expand: true, + children: [ + {title: "Sub-item 3.1 (active on init)", activate: true, + children: [ + {title: "Sub-item 3.1.1", key: "id3.1.1" }, + {title: "Sub-item 3.1.2", key: "id3.1.2" } + ] + }, + {title: "Sub-item 3.2 (selected on init)", selected: true, folder: true, + children: [ + {title: "Sub-item 3.2.1", key: "id3.2.1" }, + {title: "Sub-item 3.2.2", key: "id3.2.2" } + ] + } + ] + } + ]; + +$(function () { + $("#tree").dynatree({ + // checkbox: true, + // selectMode: 3, + children: treeData, + // initAjax: { + // url: "sample-data3.json" + // }, + // onLazyRead: function(node){ + // // Mockup a slow reqeuest ... + // node.appendAjax({ + // url: "sample-data2.json", + // debugLazyDelay: 750 // don't do this in production code + // }); + // }, + onActivate: function(node) { + $("#echoActive").text("" + node + " (" + node.getKeyPath()+ ")"); + } + }); + $("#btn1").click(function(e){ + var tree = $("#tree").dynatree("getTree"), + node = $("#tree").dynatree("getActiveNode"); + var n1 = tree.getNodeByKey("id3.1.1"); + alert("1"); + }); + $("#btn2").click(function(e){ + var node = $("#tree").dynatree("getActiveNode"); + alert("2"); + }); +}); + </script> +</head> +<body> + <h3>Dynatree issue ISSUE_NUMBER</h3> + <p><a href="https://code.google.com/p/dynatree/issues/detail?id=123">LINK</a></p> + <p>Steps to reproduce:</p> + <ol> + <li>foo + <li>bar + </ol> + <div id="tree"> + </div> + <div>Active node: <span id="echoActive">-</span></div> + + <button id="btn1">Action 1</button> + <button id="btn2">Action 2</button> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/cut.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/cut.png new file mode 100644 index 0000000000000000000000000000000000000000..f215d6f6b7c81ab344a3e53e0e5e756c58c82d90 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/cut.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/door.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/door.png new file mode 100644 index 0000000000000000000000000000000000000000..369fc46ed259191014664e8a16bea76e7513f8b6 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/door.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_copy.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_copy.png new file mode 100644 index 0000000000000000000000000000000000000000..a9f31a278e17993d8d4e13beac2f9d5f7b42d08f Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_copy.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_delete.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..af1ecaf2981fa37628c8b8b15ee389f9575e5f6b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_delete.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_edit.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..b93e77600def75c9a144d3d0a5088a62c02cbb0b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_edit.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_paste.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_paste.png new file mode 100644 index 0000000000000000000000000000000000000000..5b2cbb3fd02a5e708d9f9de4ea118965972a02b0 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/images/page_white_paste.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/jquery.contextMenu-custom.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/jquery.contextMenu-custom.js new file mode 100644 index 0000000000000000000000000000000000000000..a4f5ddcd518866f1055617b9b3d9ec39d4629455 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/jquery.contextMenu-custom.js @@ -0,0 +1,256 @@ +// jQuery Context Menu Plugin +// +// Version 1.01 customized version (see comment below) +// +// Cory S.N. LaViska +// A Beautiful Site (http://abeautifulsite.net/) +// +// More info: http://abeautifulsite.net/2008/09/jquery-context-menu-plugin/ +// +// Terms of Use +// +// This plugin is dual-licensed under the GNU General Public License +// and the MIT License and is copyright A Beautiful Site, LLC. +// +// 2011-02-17 Martin Wendt: +// Changed stopPropagation() to preventDefault() in order to make it +// work with Dynatree drag'n'drop. +// See http://code.google.com/p/dynatree/issues/detail?id=174 +// 2012-09-27 Martin Wendt: +// fixed position in a fancy layout +// 2013-05-09 Martin Wendt: +// Added polyfil for $.browser (fixes compatibility with jQuery 1.9) +// +if(jQuery)( function() { + + /* Check browser version, since $.browser was removed in jQuery 1.9 */ + function _checkBrowser(){ + var matched, browser; + function uaMatch( ua ) { + ua = ua.toLowerCase(); + var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || + /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || + []; + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + } + matched = uaMatch( navigator.userAgent ); + browser = {}; + if ( matched.browser ) { + browser[ matched.browser ] = true; + browser.version = matched.version; + } + if ( browser.chrome ) { + browser.webkit = true; + } else if ( browser.webkit ) { + browser.safari = true; + } + return browser; + } + var BROWSER = jQuery.browser || _checkBrowser(); + + $.extend($.fn, { + + contextMenu: function(o, callback) { + // Defaults + if( o.menu == undefined ) return false; + if( o.inSpeed == undefined ) o.inSpeed = 150; + if( o.outSpeed == undefined ) o.outSpeed = 75; + // 0 needs to be -1 for expected results (no fade) + if( o.inSpeed == 0 ) o.inSpeed = -1; + if( o.outSpeed == 0 ) o.outSpeed = -1; + // Loop each context menu + $(this).each( function() { + var el = $(this); + var offset = $(el).offset(); + // Add contextMenu class + $('#' + o.menu).addClass('contextMenu'); + // Simulate a true right click + $(this).mousedown( function(e) { + var evt = e; +// evt.stopPropagation(); + evt.preventDefault(); + $(this).mouseup( function(e) { +// e.stopPropagation(); + e.preventDefault(); + var srcElement = $(this); + $(this).unbind('mouseup'); + if( evt.button == 2 ) { + // Hide context menus that may be showing + $(".contextMenu").hide(); + // Get this context menu + var menu = $('#' + o.menu); + + if( $(el).hasClass('disabled') ) return false; + + // Detect mouse position + var d = {}, x, y; + if( self.innerHeight ) { + d.pageYOffset = self.pageYOffset; + d.pageXOffset = self.pageXOffset; + d.innerHeight = self.innerHeight; + d.innerWidth = self.innerWidth; + } else if( document.documentElement && + document.documentElement.clientHeight ) { + d.pageYOffset = document.documentElement.scrollTop; + d.pageXOffset = document.documentElement.scrollLeft; + d.innerHeight = document.documentElement.clientHeight; + d.innerWidth = document.documentElement.clientWidth; + } else if( document.body ) { + d.pageYOffset = document.body.scrollTop; + d.pageXOffset = document.body.scrollLeft; + d.innerHeight = document.body.clientHeight; + d.innerWidth = document.body.clientWidth; + } + (e.pageX) ? x = e.pageX : x = e.clientX + d.scrollLeft; + (e.pageY) ? y = e.pageY : y = e.clientY + d.scrollTop; + + // Show the menu + $(document).unbind('click'); + // MW: fixed position in a fancy layout +// $(menu).css({ top: y, left: x }).fadeIn(o.inSpeed); + $(menu).fadeIn(o.inSpeed).offset({ top: y, left: x }); // must be visible, before calling offset() + // Hover events + $(menu).find('A').mouseover( function() { + $(menu).find('LI.hover').removeClass('hover'); + $(this).parent().addClass('hover'); + }).mouseout( function() { + $(menu).find('LI.hover').removeClass('hover'); + }); + + // Keyboard + $(document).keypress( function(e) { + switch( e.keyCode ) { + case 38: // up + if( $(menu).find('LI.hover').size() == 0 ) { + $(menu).find('LI:last').addClass('hover'); + } else { + $(menu).find('LI.hover').removeClass('hover').prevAll('LI:not(.disabled)').eq(0).addClass('hover'); + if( $(menu).find('LI.hover').size() == 0 ) $(menu).find('LI:last').addClass('hover'); + } + break; + case 40: // down + if( $(menu).find('LI.hover').size() == 0 ) { + $(menu).find('LI:first').addClass('hover'); + } else { + $(menu).find('LI.hover').removeClass('hover').nextAll('LI:not(.disabled)').eq(0).addClass('hover'); + if( $(menu).find('LI.hover').size() == 0 ) $(menu).find('LI:first').addClass('hover'); + } + break; + case 13: // enter + $(menu).find('LI.hover A').trigger('click'); + break; + case 27: // esc + $(document).trigger('click'); + break + } + }); + + // When items are selected + $('#' + o.menu).find('A').unbind('click'); + $('#' + o.menu).find('LI:not(.disabled) A').click( function() { + $(document).unbind('click').unbind('keypress'); + $(".contextMenu").hide(); + // Callback + if( callback ) callback( $(this).attr('href').substr(1), $(srcElement), {x: x - offset.left, y: y - offset.top, docX: x, docY: y} ); + return false; + }); + + // Hide bindings + setTimeout( function() { // Delay for Mozilla + $(document).click( function() { + $(document).unbind('click').unbind('keypress'); + $(menu).fadeOut(o.outSpeed); + return false; + }); + }, 0); + } + }); + }); + + // Disable text selection + if( BROWSER.mozilla ) { + $('#' + o.menu).each( function() { $(this).css({ 'MozUserSelect' : 'none' }); }); + } else if( BROWSER.msie ) { + $('#' + o.menu).each( function() { $(this).bind('selectstart.disableTextSelect', function() { return false; }); }); + } else { + $('#' + o.menu).each(function() { $(this).bind('mousedown.disableTextSelect', function() { return false; }); }); + } + // Disable browser context menu (requires both selectors to work in IE/Safari + FF/Chrome) + $(el).add($('UL.contextMenu')).bind('contextmenu', function() { return false; }); + + }); + return $(this); + }, + + // Disable context menu items on the fly + disableContextMenuItems: function(o) { + if( o == undefined ) { + // Disable all + $(this).find('LI').addClass('disabled'); + return( $(this) ); + } + $(this).each( function() { + if( o != undefined ) { + var d = o.split(','); + for( var i = 0; i < d.length; i++ ) { + $(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled'); + + } + } + }); + return( $(this) ); + }, + + // Enable context menu items on the fly + enableContextMenuItems: function(o) { + if( o == undefined ) { + // Enable all + $(this).find('LI.disabled').removeClass('disabled'); + return( $(this) ); + } + $(this).each( function() { + if( o != undefined ) { + var d = o.split(','); + for( var i = 0; i < d.length; i++ ) { + $(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled'); + + } + } + }); + return( $(this) ); + }, + + // Disable context menu(s) + disableContextMenu: function() { + $(this).each( function() { + $(this).addClass('disabled'); + }); + return( $(this) ); + }, + + // Enable context menu(s) + enableContextMenu: function() { + $(this).each( function() { + $(this).removeClass('disabled'); + }); + return( $(this) ); + }, + + // Destroy context menu(s) + destroyContextMenu: function() { + // Destroy specified context menus + $(this).each( function() { + // Disable action + $(this).unbind('mousedown').unbind('mouseup'); + }); + return( $(this) ); + } + + }); +})(jQuery); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/jquery.contextMenu.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/jquery.contextMenu.css new file mode 100644 index 0000000000000000000000000000000000000000..df72c84ba85c26b5dd0c122733c9805f7bb05c04 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/contextmenu/jquery.contextMenu.css @@ -0,0 +1,62 @@ +/* Generic context menu styles */ +.contextMenu { + position: absolute; + width: 120px; + z-index: 99999; + border: solid 1px #CCC; + background: #EEE; + padding: 0px; + margin: 0px; + display: none; +} + +.contextMenu LI { + list-style: none; + padding: 0px; + margin: 0px; +} + +.contextMenu A { + color: #333; + text-decoration: none; + display: block; + line-height: 20px; + height: 20px; + background-position: 6px center; + background-repeat: no-repeat; + outline: none; + padding: 1px 5px; + padding-left: 28px; +} + +.contextMenu LI.hover A { + color: #FFF; + background-color: #3399FF; +} + +.contextMenu LI.disabled A { + color: #AAA; + cursor: default; +} + +.contextMenu LI.hover.disabled A { + background-color: transparent; +} + +.contextMenu LI.separator { + border-top: solid 1px #CCC; +} + +/* + Adding Icons + + You can add icons to the context menu by adding + classes to the respective LI element(s) +*/ + +.contextMenu LI.edit A { background-image: url(images/page_white_edit.png); } +.contextMenu LI.cut A { background-image: url(images/cut.png); } +.contextMenu LI.copy A { background-image: url(images/page_white_copy.png); } +.contextMenu LI.paste A { background-image: url(images/page_white_paste.png); } +.contextMenu LI.delete A { background-image: url(images/page_white_delete.png); } +.contextMenu LI.quit A { background-image: url(images/door.png); } diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/dynatree-doc.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/dynatree-doc.html new file mode 100644 index 0000000000000000000000000000000000000000..71aaa24a97cec2549d3b2a4cc5313dfbe492d9b4 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/dynatree-doc.html @@ -0,0 +1,2155 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>jquery.dynatree.js documentation</title> + + <meta name="keywords" content="dynatree JavaScript JS dynamic html tree view treeview checkbox widget plugin for jQuery data structure library ajax open source free"> + <meta name="description" content="dynatree is a JavaScript treeview plugin for jQuery with support for checkboxes and lazy loading of branches."> + + <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Convert tabs to spaces and doc CSS --> + <link rel="stylesheet" type="text/css" href="howto.css"> + <script src="howto.js" type="text/javascript"></script> + + <!-- Automatic TOC generator --> + <script src="./jquery.planize.js" type="text/javascript"></script> + + <!-- PrettyPrint (triggered in onload event) --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + + <script type="text/javascript"> + $(function(){ + // Log to Google Analytics, when not running locally + if ( document.URL.toLowerCase().indexOf('wwwendt.de/')>=0 ) { + var pageTracker = _gat._getTracker("UA-316028-1"); + pageTracker._trackPageview(); + } + + // Create TOC + $("html *").planize({ + title: "Table of contents", + min_level: 2, + generate_toc: true, + toc_elem: $("#toc") + }); + // Format code samples + prettyPrint(); + }); + </script> +</head> + +<body> + + +<h1>Dynatree documentation</h1> + +<div class="hint"> + This document describes dynatree version: <strong>$Version:$</strong>.<br> + Document revision: $Revision:$.<br> + A current version may be found at the project site + <a href="http://wwwendt.de/tech/dynatree/index.html">http://wwwendt.de/tech/dynatree/index.html</a>. +</div> +<p> + Dynatree is a dynamic JavaScript tree view control with support for checkboxes, + drag'n'drop, and lazy loading. +</p> +<p> + Main features: +</p> +<ul> + <li>Open source (<a href="http://code.google.com/p/dynatree/wiki/LicenseInfo">MIT and GPL License</a>) + <li>Optimized for large dynamic trees (DOM elements are only created when really needed). + <li>Programmable through a rich object oriented interface. + <li>Support for lazy loading and Ajax. + <li>Checkboxes and hierarchical selection. + <li>Supports drag and drop. + <li>Support for persistence. + <li>Keyboard aware. + <li>Initializes from HTML code, JSON, or JavaScript objects. + <li>Implemented as a <a href="http://jquery.com">jQuery</a> plugin.<br> + (Note: this doesn't mean that you have to use jQuery for your whole site.) +</ul> + +<p class="info"> + Dynatree runs best, when the HTML document is rendered in a strict mode like<br> + <code><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"></code>. + <br> + Avoid the <a href="http://en.wikipedia.org/wiki/Quirks_mode">quirks mode</a>. +</p> + +<!-- jquery.planize will generate a TOC here: --> +<div id="toc"> +</div> + + +<h2>Download</h2> + +<p> + You can download the current dynatree package at + <a href="http://code.google.com/p/dynatree/downloads">http://code.google.com/p/dynatree/downloads</a>. + It contains everything needed including the source, some documentation and examples.<br> + jQuery is already included, but you can check the <a href="http://www.jquery.com">jQuery site</a> + for the latest versions of jquery.js and ui.core.js. +</p> + + +<h2>Examples</h2> + +<p> + This documentation contains script examples and links.<br> + See also the <a href="samples.html">Example Browser</a> for some more advanced live demos. +</p> +<p class="info"> + Using the <code>[View source code]</code> link in the + Example Browser is probably the best way to learn about Dynatree. +</p> + +<h2 id="quickExample">Quick start</h2> + +<p> + Let's start with a simple example: +</p> + +<div class="codesample"> +<a href="sample-quick.html">Try this example...</a> +<pre class="prettyprint"> +<html> +<head> + <!-- Include the required JavaScript libraries: --> + <script src='jquery/jquery.js' type="text/javascript"></script> + <script src='jquery/jquery-ui.custom.js' type="text/javascript"></script> + <script src='jquery/jquery.cookie.js' type="text/javascript"></script> + + <link rel='stylesheet' type='text/css' href='skin/ui.dynatree.css'> + <script src='jquery.dynatree.js' type="text/javascript"></script> + + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + $(function(){ + // Attach the dynatree widget to an existing <div id="tree"> element + // and pass the tree options as an argument to the dynatree() function: + $("#tree").dynatree({ + onActivate: function(node) { + // A DynaTreeNode object is passed to the activation handler + // Note: we also get this event, if persistence is on, and the page is reloaded. + alert("You activated " + node.data.title); + }, + persist: true, + children: [ // Pass an array of nodes. + {title: "Item 1"}, + {title: "Folder 2", isFolder: true, + children: [ + {title: "Sub-item 2.1"}, + {title: "Sub-item 2.2"} + ] + }, + {title: "Item 3"} + ] + }); + }); + </script> +</head> +<body> + <!-- Add a <div> element where the tree should appear: --> + <div id="tree"> </div> +</body> +</html> +</pre> +</div> +<p> + As an alternative, it is possible to leave away the <code>children</code> option and + add a <ul> inside the <div id="tree"> tag instead.<br> + See <a href="#initFromUl">Initializing the tree structure from a <ul> element</a> for an example. +</p> + +<p> + I am going into more details in the following sections. +</p> + + +<h2>Initializing the tree</h2> + +<p> + Dynatree is based on and made for jQuery. If you are not familiar with this, you might also want to check the <a href="http://docs.jquery.com">jQuery documentation</a>. +</p> +<p> + The tree is initialized in the onload event of the html document. In jQuery this is usually done by passing a function to $(..) : +</p> +<pre class="prettyprint"> +<head> + <script type="text/javascript"> + $(function(){ + […] + }); + </script> +</head> +</pre> + +<p> + The dynatree widget is then attached to an empty <div > element with a given ID of 'tree'. + This id can have any value, it only has to match the jQuery selector, in our case '#tree'.<br> + Options are passed to the dynatree() function as a dictionary in curly braces: +</p> +<pre class="prettyprint"> + $("#tree").dynatree({ + […] + }); +</pre> + + +<h3>Tree options</h3> + +<p> + Tree options are passed as plain JavaScript objects in curly braces, e.g.<br> + <code>{ … }</code>.<br> +</p> +<p> + The following script shows the available options.<br> + All options have a reasonable default, so we may only have to pass the <code>onActivate</code> handler. +</p> + +<pre class="prettyprint"> +$("#tree").dynatree({ + title: "Dynatree", // Tree's name (only used for debug outpu) + minExpandLevel: 1, // 1: root node is not collapsible + imagePath: null, // Path to a folder containing icons. Defaults to 'skin/' subdirectory. + children: null, // Init tree structure from this object array. + initId: null, // Init tree structure from a <ul> element with this ID. + initAjax: null, // Ajax options used to initialize the tree strucuture. + autoFocus: true, // Set focus to first child, when expanding or lazy-loading. + keyboard: true, // Support keyboard navigation. + persist: false, // Persist expand-status to a cookie + autoCollapse: false, // Automatically collapse all siblings, when a node is expanded. + clickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand + activeVisible: true, // Make sure, active nodes are visible (expanded). + checkbox: false, // Show checkboxes. + selectMode: 2, // 1:single, 2:multi, 3:multi-hier + fx: null, // Animations, e.g. null or { height: "toggle", duration: 200 } + noLink: false, // Use <span> instead of <a> tags for all nodes + // Low level event handlers: onEvent(dtnode, event): return false, to stop default processing + onClick: null, // null: generate focus, expand, activate, select events. + onDblClick: null, // (No default actions.) + onKeydown: null, // null: generate keyboard navigation (focus, expand, activate). + onKeypress: null, // (No default actions.) + onFocus: null, // null: set focus to node. + onBlur: null, // null: remove focus from node. + + // Pre-event handlers onQueryEvent(flag, dtnode): return false, to stop processing + onQueryActivate: null, // Callback(flag, dtnode) before a node is (de)activated. + onQuerySelect: null, // Callback(flag, dtnode) before a node is (de)selected. + onQueryExpand: null, // Callback(flag, dtnode) before a node is expanded/collpsed. + + // High level event handlers + onPostInit: null, // Callback(isReloading, isError) when tree was (re)loaded. + onActivate: null, // Callback(dtnode) when a node is activated. + onDeactivate: null, // Callback(dtnode) when a node is deactivated. + onSelect: null, // Callback(flag, dtnode) when a node is (de)selected. + onExpand: null, // Callback(flag, dtnode) when a node is expanded/collapsed. + onLazyRead: null, // Callback(dtnode) when a lazy node is expanded for the first time. + onCustomRender: null, // Callback(dtnode) before a node is rendered. Return a HTML string to override. + onCreate: null, // Callback(dtnode, nodeSpan) after a node was rendered for the first time. + onRender: null, // Callback(dtnode, nodeSpan) after a node was rendered. + postProcess: null, // Callback(data, dataType) before an Ajax result is passed to dynatree. + + // Drag'n'drop support + dnd: { + // Make tree nodes draggable: + onDragStart: null, // Callback(sourceNode), return true, to enable dnd + onDragStop: null, // Callback(sourceNode) + // Make tree nodes accept draggables + autoExpandMS: 1000, // Expand nodes after n milliseconds of hovering. + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + revert: false, // true: slide helper back to source if drop is rejected + onDragEnter: null, // Callback(targetNode, sourceNode, ui, draggable) + onDragOver: null, // Callback(targetNode, sourceNode, hitMode) + onDrop: null, // Callback(targetNode, sourceNode, hitMode, ui, draggable) + onDragLeave: null // Callback(targetNode, sourceNode) + }, + ajaxDefaults: { // Used by initAjax option + cache: false, // false: Append random '_' argument to the request url to prevent caching. + timeout: 0, // >0: Make sure we get an ajax error for invalid URLs + dataType: "json" // Expect json format and pass json object to callbacks. + }, + strings: { + loading: "Loading…", + loadError: "Load error!" + }, + generateIds: false, // Generate id attributes like <span id='dynatree-id-KEY'> + idPrefix: "dynatree-id-", // Used to generate node id's like <span id="dynatree-id-<key>">. + keyPathSeparator: "/", // Used by node.getKeyPath() and tree.loadKeyPath(). + cookieId: "dynatree", // Choose a more unique name, to allow multiple trees. + cookie: { + expires: null // Days or Date; null: session cookie + }, + // Class names used, when rendering the HTML markup. + // Note: + // These settings only apply on initialisation. + // If only single entries are passed for options.classNames, all other + // values are still set to default. + classNames: { + container: "dynatree-container", + node: "dynatree-node", + folder: "dynatree-folder", + + empty: "dynatree-empty", + vline: "dynatree-vline", + expander: "dynatree-expander", + connector: "dynatree-connector", + checkbox: "dynatree-checkbox", + nodeIcon: "dynatree-icon", + title: "dynatree-title", + noConnector: "dynatree-no-connector", + + nodeError: "dynatree-statusnode-error", + nodeWait: "dynatree-statusnode-wait", + hidden: "dynatree-hidden", + combinedExpanderPrefix: "dynatree-exp-", + combinedIconPrefix: "dynatree-ico-", + hasChildren: "dynatree-has-children", + active: "dynatree-active", + selected: "dynatree-selected", + expanded: "dynatree-expanded", + lazy: "dynatree-lazy", + focused: "dynatree-focused", + partsel: "dynatree-partsel", + lastsib: "dynatree-lastsib" + }, + debugLevel: 1 // 0:quiet, 1:normal, 2:debug +}); +</pre> + +<p> + <strong>Details:</strong> +</p> +<dl class="optionList"> + <dt>opts.classNames + <dd> + Type: <code>dictionary</code>, default: <code>$.ui.dynatree.defaults.classNames</code>.<br> + Override class names, that are used, when rendering the HTML markup.<br> + Typically this will require some customization of the CSS file too. + <br> + <b>Note:</b> class names are applied on initialisation only. + <br> + Example: +<pre class="prettyprint"> +$("#tree1").dynatree({ + checkbox: true, + // Override class name for checkbox icon: + classNames: {checkbox: "dynatree-radio"}, + [...] +</pre> + </dd> + <dt>opts.clickFolderMode + <dd> + Type: <code>integer</code>, default: <code>3</code>.<br> + Define, how a mouse click will change a folder status. + <ol> + <li>Single-clicking a folder title (or pressing the [enter] or [space] + key) will activate it.<br> + In this mode documents and folders behave the same. + <li>Single-clicking a folder title expands the node. The folder cannot + be activated. + <li>Single-clicking a folder title will activate and expand it. + </ol> + </dd> + <dt>opts.persist + <dd> + Type: <code>boolean</code>, default: <code>false</code>.<br> + True: the tree's expansion, activation, focus and selection state is saved + to a session cookie, so reloading the page will restore the status.<br> + Notes: this may not work with lazy nodes.<br> + See <code>cookie</code> option. + </dd> +</dl> + + +<h3>Initializing the tree structure</h3> + +<p> + A tree structure is made of <i>nodes</i>. Every node may in turn contain + a list child nodes.<br> + A dynatree always has exactly one <i>root node</i>, and all top level nodes + of our tree are created as direct descendants.<br> + The root node is usually hidden, so we only see the nodes that we have added. +</p> +<p> + Dynatree can read it's structure from different sources: +</p> +<ol> + <li>If the <code>children</code> option is passed, it will be used. + <li>Otherwise, if the <code>initAjax</code> option is passed, it will be used. + <li>Otherwise, if the <code>initId</code> option is passed, it will be used. + <li>Otherwise, if the the container <div> element contains a <ul> element, + it will be used. + <li>Otherwise, the tree is left empty.<br> + But we may choose to do so, if we want to modify the tree programmatically. +</ol> +<p> + Methods 1-3 expect a list of node options, as described in the following + sections. +</p> + + +<h4 id="nodeOptions">Node options</h4> + +<p> + Node options are defined as plain JavaScript objects in curly braces, e.g.<br> + <code>{ … }</code>.<br> + Most of the time we pass a list of node options like this<br> + <code>children: [ { … }, { … }, … ]</code>. +</p> +<p> + The follwing snippet shows the attributes that can be used to define a tree node.<br> + There are reasonable default values for all options, so we may only have to pass a <code>title</code>. +</p> + +<pre class="prettyprint"> +children: [ + { + title: null, // (required) Displayed name of the node (html is allowed here) + key: null, // May be used with activate(), select(), find(), ... + isFolder: false, // Use a folder icon. Also the node is expandable but not selectable. + isLazy: false, // Call onLazyRead(), when the node is expanded for the first time to allow for delayed creation of children. + tooltip: null, // Show this popup text. + href: null, // Added to the generated <a> tag. + icon: null, // Use a custom image (filename relative to tree.options.imagePath). 'null' for default icon, 'false' for no icon. + addClass: null, // Class name added to the node's span tag. + noLink: false, // Use <span> instead of <a> tag for this node + activate: false, // Initial active status. + focus: false, // Initial focused status. + expand: false, // Initial expanded status. + select: false, // Initial selected status. + hideCheckbox: false, // Suppress checkbox display for this node. + unselectable: false, // Prevent selection. + // The following attributes are only valid if passed to some functions: + children: null // Array of child nodes. + // NOTE: we can also add custom attributes here. + // This may then also be used in the onActivate(), onSelect() or onLazyTree() callbacks. + }, + […] +] + +</pre> + +<p> + The node options are also passed to the event handlers and can be accessed like this: +</p> +<pre class="prettyprint"> +onActivate: function(node) { + alert("You activated " + node.data.title); +}, +</pre> + +<p> + <strong>Details:</strong> +</p> +<dl class="optionList"> + <dt>data.activate + <dd> + If set to true, the node will be initially activated. + </dd> + <dt>data.addClass + <dd> + Class name that is added to the node's <span> element.<br> + Example: + <pre class="prettyprint">{ title: "Pretty node", addClass: "customClass1" }</pre> + or + <pre class="prettyprint"><li data="addClass: 'customClass1'">Pretty node</pre> + can be styled using css as + <pre class="prettyprint">span.customClass1 a { background-color: maroon; color: yellow; }</pre> + </dd> + <dt>data.children + <dd> + Array of node options, that are used to generate child nodes.<br> + This option is only valid when passed to certain functions, like <code>DynTreeNode.addChild()</code>. + </dd> + <dt>data.expand + <dd> + If set to true, the node will be initially expanded. + </dd> + <dt>data.focus + <dd> + If set to true, the node will be initially focused. + </dd> + <dt>data.hideCheckbox + <dd> + Suppress display of checkbox icon.<br> + It is still possible to (de)select the node using the API, keyboard or + initialization data. (The selection state may be visualized by a CSS + style.)<br> + See also <code>unselectable</code>. + </dd> + <dt>data.href + <dd> + Contains the link URL, if the tree was initialized from a <ul> tag: +<pre class="prettyprint"><div id="tree"><ul> + <li class="expanded folder">Search engines + <ul> + <li><a href="http://www.google.com" target="_self">Google</a> + <li><a href="http://www.bing.com">Bing</a> +</pre> + </dd> + <dt>data.icon + <dd> + Optional name of an image file relative to the image directory. <br> + If <i>null</i> specified, a default image is used depending on the node type (folder + or document). This is the default.<br> + If <i>false</i> specified, no image is displayed. + </dd> + <dt>data.isFolder + <dd> + Marks node as folder (treated as a document otherwise).<br> + See <a href="#foldersAndDocs">Folders and Documents</a> + </dd> + <dt>data.isLazy + <dd> + Enables delayed loading of the node contents. When a lazy node is expanded + for the first time, the onLazyRead() callback is called. + </dd> + <dt>data.key + <dd> + Uniquely identifies this node. It is optional, but we need it for some + functions like <code>tree.activateKey()</code>.<br> + If specified, the node's element id is generated by prepending a prefix + like this: <code>dynatree-id-<i>1234</i></code>.<br> + If <i>not</i> specified, a random key id is generated. + </dd> + <dt>data.select + <dd> + If set to true, the node will be initially selected. + </dd> + <dt>data.target + <dd> + See data.href. + </dd> + <dt>data.title + <dd> + Type: string, default: "".<br> + Displayed name of the node (html markup is allowed here). + </dd> + <dt>data.tooltip + <dd> + Optional string to display in a popup window when the cursor hovers over + the node. + </dd> + <dt>data.unselectable + <dd> + Prevent (de)selection of this node using API, mouse, and keyboard.<br> + It is still possible, to (de)select this node in the initialization data + or indirectly (in multi-hier mode).<br> + See also <code>hideCheckbox</code>. + </dd> +</dl> + +<p> + To override the node attribute <i>defaults</i>, modify the structure before initializing + dynatree: +</p> +<pre class="prettyprint"> +<script type="text/javascript"> + $.ui.dynatree.nodedatadefaults["icon"] = false; // Turn off icons by default + + $(function(){ + $("#tree").dynatree({ + rootVisible: false, + [...] +</pre> + + +<h4 id="foldersAndDocs">Folders and documents</h4> + +<p> + When a node is of type <i>folder</i>, it get's a special folder icon and class name.<br> + We usually use them to hold child nodes.<br> + Also, folders can be expanded by clicking the title text (this behavior + can be controlled using the <code>clickFolderMode</code> option). +</p><p> + Non-folders ('documents') may also contain child nodes.<br> + Clicking on a child node activates it, so we have to click the small [+] icon in front to expand such a document node. +</p> + + +<h4>Initializing the tree structure from an object array</h4> + +<p> + In the <a href="#quickExample">quick example above</a> we have already seen how a tree is initialized by passing a + node array with the <code>children</code> option. +</p> +<pre class="prettyprint"> +$("#tree").dynatree({ + children: [ … ], + […] +}); +</pre> +<p> + See also <a href="#nodeOptions">Node options</a>. +</p> + + +<h4 id="ajaxResponse">Initializing the tree structure from an Ajax response</h4> + +<p> + Instead of passing an array of data objects, we can pass a url in the <code>initAjax</code> + option that will be used to contact an Ajax web service. +</p> + +<pre class="prettyprint"> +$("#tree").dynatree({ + initAjax: {url: "/ajaxTree", + data: {key: "root", // Optional arguments to append to the url + mode: "all" + } + }, + […] +}); +</pre> + +<p> + The web service is expected to return a <a href="http://json.org/">valid JSON</a> + node list, formatted like this:<br> + <code>[ { ... }, { ... }, ... ]</code>. +</p> +<p> + Because the data request is performed asynchronously, the document will load faster. + Dynatree will display a spinning wheel, while waiting for the request to complete. +</p> +<p> + See <a href="#lazyLoading">Loading child nodes on demand</a> for details.<br> + See <a href="#lazyPersist">Persistence for lazy trees</a> for a sample on + how to combine this with persistence. +</p> + + +<h4 id="initFromUl">Initializing the tree structure from a <ul> element</h4> + +<p> + If the container <code><div></code> contains a <code><ul></code> element, + the node titles are read from the <code><li></code> tags.<br> + If the title contains html markup, it may be better to wrap it inside a span element. +</p> +<p> + All other node options are specified in the <code>data</code> attribute of a <li> element. + For example +</p> +<pre class="prettyprint"> +<li data="url: 'http://jquery.com'">jQuery home +<li data="url: 'http://example.com', addClass: 'customClass1'">Example page +</pre> +<p class="info"> + Note that the <code>data</code> attribute is not valid in <code><li></code> elements in + some doctypes (HTML 4.01 transitional and Strict and XHTML 1.0 Strict). + Validators will complain about this.<br> + Also, if the <code>id</code> attribute is used to pass a key, it should be + alphanumeric and start with a letter to be compliant.<br> + (This doesn't seem to affect the functionality however.) +</p> +<p> + Nested <ul> elements are used to build a hierarchical tree structure.<br> + After the <ul> element was parsed, it is removed from the DOM tree. +</p> +<p> + Note that <a> elements are recognized:<br> + <code><li><a href='URL' target='TARGET'>TITLE</a></code> will result in<br> + node.data.title = TITLE<br> + node.data.href = URL<br> + node.data.target = TARGET +</p> + +<div class="codesample"> + <a href="sample-ul.html">Try this example...</a> +<pre class="prettyprint"> +<head> + <!-- Include the required JavaScript libraries: --> + <script src='jquery/jquery.js' type="text/javascript"></script> + <script src='jquery/jquery-ui.custom.js' type="text/javascript"></script> + + <link rel='stylesheet' type='text/css' href='skin/ui.dynatree.css' > + <script src='jquery.dynatree.js' type="text/javascript"></script> + + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + onActivate: function(node) { + alert("You activated " + node); + } + }); + }); + </script> +</head> +<body> + <!-- Add a <div> element where the tree should appear: --> + <div id="tree"> + <ul> + <li id="key1" title="Look, a tool tip!">item1 with key and tooltip + <li id="key2" class="selected">item2: selected on init + <li id="key3" class="folder">Folder with some children + <ul> + <li id="key3.1">Sub-item 3.1 + <li id="key3.2">Sub-item 3.2 + </ul> + + <li id="key4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="key4.1">Sub-item 4.1 + <li id="key4.2">Sub-item 4.2 + </ul> + + <li id="key5" class="lazy folder">Lazy folder + </ul> + </div> +</body> +</pre> + </div> + + +<h4>Initializing the tree structure programmatically</h4> +<p> + Finally, it is always possible to program the DynaTree and DynaTreeNode objects directly. +</p> +<p> + See also <a href="#programming">Programming dynatree</a>. +</p> + +<div class="codesample"> + <a href="sample-api.html">Try this example...</a> +<pre class="prettyprint"> +$(function(){ + // Initialize the tree in the onload event + $("#tree").dynatree({ + onActivate: function(node) { + alert("You activated " + node); + } + }); + // Now get the root node object + var rootNode = $("#tree").dynatree("getRoot"); + // Call the DynaTreeNode.addChild() member function and pass options for the new node + var childNode = rootNode.addChild({ + title: "Child node 1", + tooltip: "This child node was added programmatically.", + isFolder: true + }); + // + childNode.addChild({ + title: "Document using a custom icon", + icon: "customdoc1.gif" + }); +}); +</pre> +</div> + + +<h2>Handling events</h2> + +<p> + When a user clicks a node, we want to react in some way. + So at least we want to implement an <code>onActivate</code> + handler. +</p> +<p> + All event handlers are passed an instance of DynaTreeNode as argument.<br> + <code>this</code> refers to the Dynatree object.<br> + The node options can be accessed like this: +</p> +<pre class="prettyprint"> +onActivate: function(node) { + alert("You activated " + node.data.title); +}, +</pre> + +<p> + See also <a href="#programming">Programming dynatree</a>. +</p> + +<h3><code>DynaTree</code> callbacks</h3> + +The <code>this</code> context is set to the tree object.<br> +Use <code>tree.isUserEvent()</code>, <code>tree.isInitializing()</code>, +and <code>tree.isReloading()</code> to determine who generated this event. + +<dl class="optionList"> + <dt>opts.onActivate(node) + <dd> + Called when a node was activated. + <pre class="prettyprint">onActivate: function(node) { + if(node.tree.isUserEvent()){ + [...] // Do something after user activated the node (using mouse or keyboard) + } +}</pre> + </dd> + + <dt>opts.onBlur(node) + <dd> + Called when a node lost the focus. + </dd> + + <dt>opts.onClick(node, event) + <dd> + Called when a node was clicked.<br> + Use <code>node.getEventTargetType(event)</code> to check which area was clicked.<br> + Return <code>false</code> to prevent default processing + (setting focus, activate the node, expand folders, etc.). + <pre class="prettyprint">onClick: function(node, event) { + if(node.getEventTargetType(event) == "title"){ + [...] // Handle the click event + return false;// Prevent default processing + } +}</pre> + </dd> + + <dt>opts.onCreate(node, nodeSpan) + <dd> + Called after a node's HTML tag was created, i.e. when a node becomes + visible for the first time.<br> + This callback may be used to bind events or widgets for nodes that are + created lazily or programatically.<br> + <pre class="prettyprint">onCreate: function(node, nodeSpan) { + $(span).click(function(e){ + alert('clicked ' + node); + }); +}</pre> + (Note that the use of jQuery live events may often be a more efficient solution.)<br> + See also <code>opts.onRender</code>. + </dd> + + <dt>opts.onCustomRender(node) + <dd> + Called before a node's title HTML tag will be created. + This happens when a node becomes visible for the first time.<br> + This callback may return a string that will be used instead of the + default HTML markup. + <pre class="prettyprint">onCustomRender: function(node) { + return "<span class='dynatree-title'>SPAM</span>" +}</pre> + </dd> + + <dt>opts.onDblClick(node, event) + <dd> + Called when a node was double clicked.<br> + Use <code>node.getEventTargetType(event)</code> to check which area was clicked.<br> + Return <code>false</code> to prevent default processing (currently none). + </dd> + + <dt>opts.onDeactivate(node) + <dd> + Called when a node was deactivated. + </dd> + + <dt>opts.onExpand(flag, node) + <dd> + Called when a node was expanded/collapsed. + </dd> + + <dt>opts.onFocus(node) + <dd> + Called when a node receives the focus. + </dd> + + <dt>opts.onKeydown(node, event) + <dd> + Called on keydown events.<br> + Return <code>false</code> to prevent default processing + (generate keyboard navigation, focus, expand, activate, etc.). + </dd> + + <dt>opts.onKeypress(node, event) + <dd> + Called on keypress events.<br> + Return <code>false</code> to prevent default processing (currently none). + </dd> + + <dt>opts.onLazyRead(node) + <dd> + Called when a lazy node is expanded for the first time. + </dd> + + <dt>opts.onPostInit(isReloading, isError [, XMLHttpRequest, textStatus, errorThrown]) + <dd> + Called when the tree was (re)loaded.<br> + In case of an error, <code>isError</code> will be <code>true</code> and + addition info is passed: XMLHttpRequest, textStatus, errorThrown. + </dd> + + <dt>opts.onQueryActivate(flag, node) + <dd> + Called before a node is (de)activated. Return <code>false</code> to prevent + this. + </dd> + + <dt>opts.onQueryExpand(flag, node) + <dd> + Called before a node is expanded/collapsed. Return <code>false</code> to prevent + this. + </dd> + + <dt>opts.onQuerySelect(flag, node) + <dd> + Called before a node is (de)selected. Return <code>false</code> to prevent + this. + </dd> + + <dt>opts.onRender(node, nodeSpan) + <dd> + Called after every time a node's HTML tag was created or changed.<br> + This callback may be used to modify the HTML markup. + <pre class="prettyprint">onRender: function(node, nodeSpan) { + $(nodeSpan).find("a.dynatree-title").css("color", "red"); +}</pre> + See also <code>opts.onCreate</code>. + </dd> + + <dt>opts.onSelect(flag, node) + <dd> + Called when a node was (de)selected. + </dd> + + <dt>opts.dnd.onDragStart(sourceNode) + <dd> + This function <i>must</i> be defined to enable dragging for the tree. + Return <code>false</code> to cancel dragging of node. + </dd> + + <dt>opts.dnd.onDragEnter(targetNode, sourceNode, ui, draggable) + <dd> + Return <code>true</code> to make tree nodes accept dropping of draggables. + </dd> + + <dt>opts.dnd.onDragOver(targetNode, sourceNode, hitMode, ui, draggable) + <dd> + </dd> + + <dt>opts.dnd.onDragLeave(targetNode, sourceNode, ui, draggable) + <dd> + </dd> + + <dt>opts.dnd.onDrop(targetNode, sourceNode, hitMode, ui, draggable) + <dd> + This function <i>must</i> be defined to enable dropping of items on the tree. + </dd> + + <dt>opts.dnd.onDragStop(sourceNode) + <dd> + </dd> + + <dt>ajaxOptions.success(node) + <dd> + (Passed as argument to <code>node.appendAjax(...)</code>.)<br> + Called after nodes have been created and the waiting icon was removed. + 'this' is the options for this Ajax request + </dd> + + <dt>ajaxOptions.error(node, XMLHttpRequest, textStatus, errorThrown) + <dd> + (Passed as argument to <code>node.appendAjax(...)</code>.)<br> + </dd> + +</dl> + + +<h3>Handling activate/click</h3> + +<p> + The following example handles an activation event by opening a url in a new window.<br> + This assumes, that we have defined an additional custom attribute named + 'url' in the node options, like so: +</p> + +<pre class="prettyprint"> +<ul> + <li data="url: 'http://jquery.com'">jQuery home + <li data="url: 'http://docs.jquery.com'">jQuery docs +</pre> + +<p> + or +</p> + +<pre class="prettyprint"> +children: [ + { title: "jQuery home", url: "http://jquery.com" }, + { title: "jQuery docs", url: "http://docs.jquery.com" }, +</pre> + +<p> + Also, the title of the currently active node is displayed in the <span id='echoActive'> tag. +</p> + +<div class="codesample"> +<a href="sample-events.html">Try this example...</a> +<pre class="prettyprint"> +$("#tree").dynatree({ + […] + onActivate: function(node) { + if( node.data.url ) + window.open(node.data.url); + $("#echoActive").text(node.data.title); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + […] +}); +</pre> +</div> + + +<h3>Handling selection events</h3> + +<p> + The following example writes the title of the currently focused node to the <span id='echoFocused'> element: +</p> + +<div class="codesample"> + <a href="sample-select.html">Try this example...</a> + <pre class="prettyprint"> + $("#tree").dynatree({ + […] + onSelect: function(flag, node) { + if( ! flag ) + alert("You deselected node with title " + node.data.title); + var selectedNodes = node.tree.getSelectedNodes(); + var selectedKeys = $.map(selectedNodes, function(node){ + return node.data.key; + }); + alert("Selected keys: " + selectedKeys.join(", ")); + }, + […] + }); + </pre> +</div> + + +<h3>Handling focus changes</h3> + +<p> + If we use the cursor keys to walk the tree nodes, the focus changes to the next node, but the active node remains the same unless we use [Space] or [Enter].<br> + Also, when we click on a folder node it is only focused, but not activated. +</p> +<p> + The following example writes the title of the currently focused node to the <span id='echoFocused'> element: +</p> + +<div class="codesample"> +<a href="sample-events.html">Try this example...</a> +<pre class="prettyprint"> +$("#tree").dynatree({ + […] + onFocus: function(node) { + $("#echoFocused").text(node.data.title); + }, + onBlur: function(node) { + $("#echoFocused").text("-"); + }, + […] +}); +</pre> +</div> + + +<h3 id="lazyLoading">Loading child nodes on demand ('lazy loading')</h3> + +<p> + Dynatree supports delayed loading of tree nodes, which means we read the + child nodes only when their parent is expanded. +</p> +<p> + Because the data request is performed asynchronously, the browser will not + block and is still responsive. Dynatree will display a spinning wheel, while + waiting for the request to complete. +</p> +<p> + To make this happen, we have to +</p> +<ul> + <li>Mark some or all nodes as lazy, by setting the <code>isLazy</code> option to true. + <li>Implement a backend web service that delivers a <a href="http://json.org/">JSON</a> + formatted node list. + <li>Implement the <code>onLazyRead</code> callback to send an Ajax request, + create the child nodes, and set the 'ok' status. +</ul> + +<div class="codesample"> +<a href="sample-lazy.html">Try this example...</a> +<pre class="prettyprint"> +$("#tree").dynatree({ + […] + onLazyRead: function(node){ + node.appendAjax({url: "/sendData", + data: {"key": node.data.key, // Optional url arguments + "mode": "all" + } + }); + }, + […] +}); +</pre> +</div> + +<p> + Typically we would implement <code>onLazyRead</code> by calling the + <code>node.appendAjax()</code> function.<br> + It expects one option object argument, as described in the documentation for + the <a href="http://docs.jquery.com/Ajax/jQuery.ajax">jQuery.ajax()</a> command.<br> +</p><p> + These options are set by default:<br> + <code>cache: false</code> and <code>dataType: "json"</code>. +</p><p> + Note that the <code>success</code> and <code>error</code> options + are implemented differently from the jQuery standard:<br> + They pass different arguments and are called <strong>after</strong> the + Dynatree default processing took place.<br> + This makes it easy to use the <code>success</code> callback to apply any + custom postprocessing, for example activating a node or binding events. +</p> +<pre class="prettyprint"> +$("#tree").dynatree({ + […] + onLazyRead: function(node){ + node.appendAjax({url: "/sendData", + data: {"key": node.data.key, // Optional url arguments + "mode": "all" + }, + // (Optional) use JSONP to allow cross-site-requests + // (must be supported by the server): +// dataType: "jsonp", + success: function(node) { + // Called after nodes have been created and the waiting icon was removed. + // 'this' is the options for this Ajax request + }, + error: function(node, XMLHttpRequest, textStatus, errorThrown) { + // Called on error, after error icon was created. + }, + cache: false // Append random '_' argument to url to prevent caching. + }); + }, + […] +}); +</pre> +<p> + The web service is expected to return a <a href="http://json.org/">valid JSON</a> + node list, formatted like this:<br> + <code>[ { "title": "Node1", "isLazy": true, "key": "BC13B21636CD6D5C", … }, { … }, … ]</code><br> + See <a href="#nodeOptions">Node options</a> for a list of supported attributes. +</p><p> + When the response was received, <code>appendAjax()</code> appends the child + nodes and calls <code>node.setLazyNodeStatus(DTNodeStatus_Ok)</code> to + remove the wait icon. +</p><p> + Note that <code>initAjax</code> is simply a special case, where the tree's + root node is loaded on startup.<br> + See <a href="#ajaxResponse">Initializing the structure from an Ajax response</a> + for a sample to initialize the whole tree with an Ajax request. +</p><p> + This sample code (written in Python) shows how a server could create a + response: +</p> +<pre class="prettyprint"> +# Build node list as JSON formatted string: +res = '[' +res += '{ "title": "Node 1", "key": "k1", "isLazy": true },' +res += '{ "title": "Node 2", "key": "k2", "isLazy": true },' +res += '{ "title": "Node 3", "key": "k3", "isLazy": true }' # no trailing "," at the last line +res += ']' + +# Add support for the JSONP protocol: +# This means, if the request URL contains an argument '?callback=xxx', +# wrap the result as 'xxx(result)' +if "callback" in argDict: + res = argDict["callback"] + "(" + res + ")" + +# Make sure, content type is JSON: +start_response("200 OK", [("Content-Type", "application/json")]) + +# Return result (the square brackets are Python / WSGI specific): +return [ res ] +</pre> +<p> + See <a href="dynatree_server.py">dynatree_server.py</a> for a sample + implementation of a web server that handles this (~150 lines of Python code).<br> + When this server is running, you can try this <a href="sample-pyserver.html">live example</a> + of a lazy tree. +</p> + + +<h4 id="lazyCustom">Loading custom formats</h4> +<p> +If we need more control, or if the server cannot provide JSON in Dynatree's +native format, we could also use <a href="http://docs.jquery.com/Ajax/jQuery.ajax">jQuery.ajax()</a> +to fetch the data, then transform it and call <code>node.addChild()</code>: +</p> +<pre class="prettyprint"> +$("#tree").dynatree({ + […] + onLazyRead: function(node){ + $.ajax({ + url: […], + success: function(data, textStatus){ + // In this sample we assume that the server returns JSON like + // { "status": "...", "result": [ {...}, {...}, ...]} + if(data.status == "ok"){ + // Convert the response to a native Dynatree JavaScipt object. + var list = data.result; + res = []; + for(var i=0, l=list.length; i<l; i++){ + var e = list[i]; + res.push({title: "" + i + ": " + e.fcurr + "-" + e.tcurr + ":" + e.ukurs, + icon: false}); + } + // PWS status OK + node.setLazyNodeStatus(DTNodeStatus_Ok); + node.addChild(res); + }else{ + // Server returned an error condition: set node status accordingly + node.setLazyNodeStatus(DTNodeStatus_Error, { + tooltip: data.faultDetails, + info: data.faultString + }); + } + } + }); + […] +}); +</pre> + + +<h2 id="dnd">Drag'n'drop</h2> + +<p> +Drag and drop functionality is enabled by defining the appropriate callbacks: +</p> +<pre class="prettyprint"> + $("#tree").dynatree({ + [...] + dnd: { + onDragStart: function(node) { + /** This function MUST be defined to enable dragging for the tree. + * Return false to cancel dragging of node. + */ + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + /** This function MUST be defined to enable dropping of items on + * the tree. + */ + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + } + } + }); +</pre> +<p> +There are a lot more callbacks that can be used to fine tune the behaviour. +Check the source code in the samples in the <a href="samples.html">Example Browser</a> +to learn more. +</p> + + +<h2 id="persistence">Persistence</h2> + +<p> +When initializing a tree in persist mode, we first check, if persistence +cookies already exist.<br> +If not, we assume first-time initializing, read the status from the tree source, +and store it into new cookies. +</p><p> +Otherwise we assume re-loading, ignore the source node attributes and override +them using the cookie info. +</p><p> +In either case, the 'active', 'expand' and 'select' status of a node is read from +the data or restored from the cookies.<br> +However, no onQueryActivate, onActivate, onExpand, onSelect, etc. events are fired. +(The only event that may be fired is onFocus.)<br> +In order to generate these events on reload, we may use the callback function onPostInit() +and tree.reactivate(). +</p> + +<pre class="prettyprint"> +$("#tree").dynatree({ + […] + onPostInit: function(isReloading, isError) { + // 'this' is the current tree + // isReloading is true, if status was read from existing cookies + // isError is only used in Ajax mode + // Fire an onActivate() event for the currently active node + this.reactivate(); + }, + onActivate: function(node) { + // Use status functions to find out about the calling context + var isInitializing = node.tree.isInitializing(); // Tree loading phase + var isReloading = node.tree.isReloading(); // Loading phase, and reading status from cookies + var isUserEvent = node.tree.isUserEvent(); // Event was triggered by mouse or keyboard + + $("#echoActive").text(node.data.title); + }, +</pre> + + +<h3 id="lazyPersist">Persistence for lazy trees</h3> +<p> +The problem with restoring the status of a <b>lazy</b> tree is, that the currently active +or selected nodes may not be part of the tree, when it is freshly re-loaded. +</p><p> +The basic idea is to leave it up to the backend web service to deliver not only +the top-level nodes, but also all nodes that are required to display the current status. +</p><p> +For example, it may be neccessary to render 3 parent nodes, if the active node is at level # 4.<br> +The backend may also deliver all child nodes of expanded parents.<br> +Or in selectMode 3 (hierarchical) we may want to send all nodes, that are partly selected. +</p><p> +initAjax (and appendAjax) have 3 options, that make it easy to pass persistence +information to the web service. +</p><p> + See <a href="dynatree_server.py">dynatree_server.py</a> for a sample + implementation of a web server that handles this (~150 lines of Python code).<br> + When this server is running, you can try this <a href="sample-pyserver.html">live example</a> + of a lazy tree. +</p> + +<pre class="prettyprint"> +$("#tree").dynatree({ + […] + initAjax: {url: "/ajaxTree", + data: {key: key, + mode: mode, + filter: filter + }, + addActiveKey: true, // add &activeKey= parameter to URL + addFocusedKey: true, // add &focusedKey= parameter to URL + addExpandedKeyList: true // add &expandedKeyList= parameter to URL + }, + onPostInit: function(isReloading, isError) { + // In lazy mode, this will be called *after* the initAjax request returned. + // 'this' is the current tree + // isReloading is set, if status was read from existing cookies + // isError is set, if Ajax failed + // Fire an onActivate() event for the currently active node + this.reactivate(); + }, + onActivate: function(node) { + // Use status functions to find out about the calling context + var isUserEvent = node.tree.isUserEvent(); // Event was triggered by mouse or keyboard + + $("#echoActive").text(node.data.title); + }, +</pre> + + +<h2 id="programming">Programming dynatree</h2> + +<p> + The dynatree widget provides a set of plugin methods, that can be called + directly.<br> + For example +</p> +<pre class="prettyprint"> +$("#tree").dynatree("disable"); +</pre> +<p> + However this plugin implementation is based on a class called <code>DynaTree</code> + that holds a set of <code>DynaTreeNode</code> objects.<br> + These classes expose methods that can be accessed for enhanced functionality.<br> + For example: +</p> +<pre class="prettyprint"> +// Get the DynaTree object instance: +var tree = $("#tree").dynatree("getTree"); +// Use it's class methods: +tree.activateKey("key1234"); +// Get a DynaTreeNode object instance: +var node = tree.getNodeByKey("key7654"); +var rootNode = $("#tree").dynatree("getRoot"); +// and use it +node.toggleExpand(); +</pre> + + +<h3>Dynatree Plugin methods</h3> + +<p> + Besides the constructor, that is called like this: +</p> +<pre class="prettyprint"> +$("#tree").dynatree({ + […] +}); +</pre> + +<p> + The following methods are globally available from the ui.dynatree namespace: +</p> +<dl class="optionList"> + <dt>$.ui.dynatree.getNode(el) + <dd> + Return a DynaTreeNode object for a given DOM element.<br> + `el` may be a DOM element or a jQuery object. + Example: <pre class="prettyprint">$("#tree a").hover(function(){ + var node = $.ui.dynatree.getNode(this); + logMsg("Hover in %s", node); + }, function(){ + [...] + });</pre> + </dd> + <dt>$.ui.dynatree.getPersistData(cookieId, cookieOpts) + <dd> + Return cookie persistence info as dictionary. + </dd> + <dt>$.ui.dynatree.version + <dd> + Release version number. + </dd> +</dl> + + +<p> + The following methods are directly available from the plugin: +</p> +<dl class="optionList"> + <dt>$("#tree").dynatree("disable") + <dd> + Disable event handling and add a class 'dynatree-disabled' to + the container element. + </dd> + <dt>$("#tree").dynatree("enable") + <dd> + Enable event handling and remove the 'dynatree-disabled' class from the + container element. + </dd> + <dt>$("#tree").dynatree("option", ) + <dd> + Set a dynatree option at runtime. + Example: <pre class="prettyprint">$("#tree").dynatree("option", "autoCollapse", true); +$("#tree").dynatree("option", "fx", { height: "toggle", duration: 200 }); </pre> + </dd> + <dt>$("#tree").dynatree("getTree") + <dd> + Return the associated <code>DynaTree</code> object. + </dd> + <dt>$("#tree").dynatree("getRoot") + <dd> + Return the root <code>DynaTreeNode</code> object of the tree. + </dd> + <dt>$("#tree").dynatree("getActiveNode") + <dd> + Return the <code>DynaTreeNode</code> object that is currently active.<br> + (May be <code>null</code>.) + </dd> + <dt>$("#tree").dynatree("getSelectedNodes") + <dd> + Return an array of <code>DynaTreeNode</code> objects that are currently + selected.<br> + (May be empty: <code>[ ]</code>.) + </dd> +</dl> + + +<h3><code>DynaTree</code> class members</h3> + +<dl class="optionList"> + <dt>tree.activateKey(key) + <dd> + Activate and focus node with a given key and fire focus and activate events.<br> + If <code>activeVisible</code> option is set, all parents will be expanded as necessary.<br> + If key is null, the current activation is removed.<br> + Return the active DynaTreeNode. + </dd> + <dt>tree.count() + <dd> + Return the number of nodes. + </dd> + <dt>tree.disable() + <dd> + Disable input for the tree and display gray. This is a shortcut for + <code>$("#tree").dynatreee("disable")</code>. + </dd> + <dt>tree.enable() + <dd> + Complement to <code>tree.disable()</code>. + </dd> + <dt>tree.enableUpdate(enable) + <dd> + Turn rendering on or off and return the previous mode. + Disabling update may speedup processing, when adding lots of nodes.<br> + Don't forget to turn rendering back on, after applying the changes: + <pre class="prettyprint">var prevMode = tree.enableUpdate(false); +[...] +tree.enableUpdate(prevMode);</pre> + </dd> + <dt>tree.getActiveNode() + <dd> + Return the currently active DynaTreeNode or null. + </dd> + <dt>tree.getNodeByKey(key) + <dd> + Return DynaTreeNode with a given key or 'null' if not found. + </dd> + <dt>tree.getPersistData() + <dd> + Return cookie persistence info as dictionary.<br> + There is also a global function available: + <code>$.ui.dynatree.getPersistData(cookieId, cookieOpts)</code>. + </dd> + <dt>tree.getRoot() + <dd> + Return the <i>invisible</i> root DynaTreeNode object. + All visible toplevel nodes are children of this system node. + </dd> + <dt>tree.getSelectedNodes(stopOnParents) + <dd> + Return a list of currently selected DynaTreeNodes (may be an empty array).<br> + If stopOnParents is set to <code>true</code>, children of selected nodes + are skipped. This may be convenient in selectMode:3 (multi-hier). + </dd> + <dt>tree.initialize() + <dd> + Constructor (internal use). + </dd> + <dt>tree.isInitializing() + <dd> + Return <code>true</code>, if the tree is in the init phase.<br> + Use this function in an event handler, to check if the event was fired + during a page reload, when the cookie persistence is applied. + </dd> + <dt>tree.isReloading() + <dd> + Return <code>true</code>, if the tree is in the init phase and persistence is on, + and the current status was read from existing cookies.<br> + Use this function in an event handler, to check if the event was fired + during a page reload, when the cookie persistence is applied. + </dd> + <dt>tree.isUserEvent() + <dd> + Return <code>true</code>, if the tree is processing a user event.<br> + Use this function in an event handler, to check if the event was fired + in response to a mouse click or key stroke.<br> + Otherwise, the the event was generated by an API call or during + initialization. + </dd> + <dt>tree.loadKeyPath(keyPath, callback) + <dd> + Make sure that a node with a given ID is loaded, by traversing - and + loading - its parents. This method is ment for lazy hierarchies.<br> + A callback is executed for every node as we go. + <pre class="prettyprint">tree.loadKeyPath("/_3/_23/_26/_27", function(node, status){ + if(status == "loaded") { + // 'node' is a parent that was just traversed. + // If we call expand() here, then all nodes will be expanded + // as we go + node.expand(); + }else if(status == "ok") { + // 'node' is the end node of our path. + // If we call activate() or makeVisible() here, then the + // whole branch will be exoanded now + node.activate(); + }else if(status == "notfound") { + var seg = arguments[2], + isEndNode = arguments[3]; + } +});</pre> + </dd> + <dt>tree.logDebug(msg), logInfo(msg), logWarning(msg) + <dd> + (Internal use). + </dd> + <dt>tree.reactivate(setFocus) + <dd> + Fire onQueryActivate and onActivate events for the currently active node + (if there is one).<br> + This may be useful when processing an onPostInit callback. + </dd> + <dt>tree.redraw() + <dd> + Render all visible nodes. + See <code>node.render()</code> for details. + </dd> + <dt>tree.reload() + <dd> + Reload the the tree.<br> + For lazy trees this is done, by re-submitting the Ajax request that was + defined in the <code>initAjax</code> option.<br> + This will <strong>not</strong> work, if the tree was loaded from an embedded + <UL> element, because these elements are removed after they have been + rendered. + </dd> + <dt>tree.renderInvisibleNodes() + <dd> + Force immediate HTML creation for all nodes, even if inside collapsed + branches. + This may be useful, if we want to bind events or otherwise must access + these HTML elements.<br> + It will however degrade performance, especially on large trees!<br> + See <code>node.render()</code> for details. + </dd> + <dt>tree.selectKey(key, flag) + <dd> + Select or deselect node with a given key and fire focus and select events.<br> + Return the selected DynaTreeNode. + </dd> + <dt>tree.serializeArray(stopOnParents) + <dd> + Return selected nodes as array of <code>{name: 'TreeName', value: 'NodeKey'}</code> + objects, where name is the 'name' attribute of the tree's <div> element.<br> + This format is compatible with jQuery's serializeArray() + function and may be used in $.post() calls.<br> + See also the 'form' sample in the Example Browser. + </dd> + <dt>tree.toDict(includeRoot) + <dd> + Convert the tree into a JavaScript object.<br> + If 'includeRoot' is false or omitted, the result is an array of node dcts.<br> + See <code>node.toDict()</code> for details. + </dd> + <dt>tree.visit(fn, includeRoot) + <dd> + Call <code>fn(node)</code> for all nodes.<br> + Stop iteration, if fn() returns false. + Stop iteration <i>of the current branch</i>, if fn() returns 'skip'. + </dd> +</dl> + + +<h3><code>DynaTreeNode</code> class members</h3> + +<dl class="optionList"> + <dt>Attribute 'data'</dt> + <dd> + Use this attribute to access all node options that were passed to create + this node.<br> + For example <code>node.data.title</code> or <code>node.data.tooltip</code>. + See also <a href="#nodeOptions">Node options</a>. + </dd> + <dt>node.activate()</dt> + <dd> + Activate this node - according to flag - and fire a onActivate event.<br> + If <code>activeVisible</code> option is set, all parents will be expanded as necessary.<br> + Focus is <em>not</em> set. + </dd> + <dt>node.activateSilently()</dt> + <dd> + Same as <code>activate()</code>, but does not fire events. + </dd> + <dt>node.addChild(nodeData[, beforeNode])</dt> + <dd> + Append a new child node.<br> + <i>nodeData</i> may be a node data object as defined in + <a href="#nodeOptions">Node options</a>, or an array thereof. + Also objects and arrays of type <code>DynaTreeNode</code> are allowed.<br> + Example: +<pre class="prettyprint"> +var node = $("#tree").dynatree("getTree").getNodeByKey("1234"); +node.addChild({title: "New Node", key: "3333"}); +</pre> + Since the <i>nodeData</i> may be a nested data structure, it is possible + to create a deep hierarchy with one call.<br> + The optional argument <i>beforeNode</i> specifies a child <code>DynaTreeNode</code> + that the new node will be inserted before. (If this parameter is <i>null</i> + or omitted, the new node will be appended.) + </dd> + + <dt>node.appendAjax(ajaxOptions)</dt> + <dd> + Accepts a standard jQuery Ajax option object.<br> + An asynchronous request is started, so this function returns immediately. + While loading, a spinning wheel is displayed. On error, a red icon is shown.<br> + The request handler must return a JSON object, formatted like the data's + <code>children</code> object.<br> + Use the <code>setLazyNodeStatus()</code> function to display the result.<br> + See <a href="#lazyLoading">Loading child nodes on demand ('lazy loading')</a> for details. + </dd> + <dt>node.countChildren()</dt> + <dd> + Return the number of descendant nodes, i.e. direct and indirect children. + </dd> + <dt>node.deactivate()</dt> + <dd> + Deactivate this node and fire an onDeactivate event. + </dd> + <dt>node.expand(flag)</dt> + <dd> + Expand or collapse this node - according to flag. + </dd> + <dt>node.focus()</dt> + <dd> + Set focus to this node. Parent nodes are expanded, if this is necessary + to make it visible. + </dd> + <dt>node.getChildren() + <dd> + Return list of child nodes or <code>null</code>.<br> + For lazy nodes that have not yet been loaded, <code>undefined</code> is + is returned. + </dd> + <dt>node.getEventTargetType(event)</dt> + <dd> + Return the part of a node, that a click event occurred on.<br> + Possible values: 'prefix' 'expander', 'checkbox', 'icon', 'title'.<br> + <code>null</code> is returned else.<br> + Note: there is no check, if the event was fired on <strong>this</strong> node. + </dd> + <dt>node.getLevel() + <dd> + Return the depth (i.e. number of parent nodes).<br> + 0 is returned for the root node. + </dd> + <dt>node.getNextSibling() + <dd> + Return the successor node or <code>null</code>. + </dd> + <dt>node.getParent() + <dd> + Return the parent node or <code>null</code>. + </dd> + <dt>node.getPrevSibling() + <dd> + Return the predecessor node or <code>null</code>. + </dd> + <dt>node.hasChildren() + <dd> + Return <code>true</code> if node has child nodes.<br> + Return <code>false</code> if node is a leaf, i.e. has no child nodes.<br> + Return <code>undefined</code> if this is a lazy node, that was not yet + successfully loaded.<br> + A test for 'node is surely empty' would be coded like + <pre class="prettyprint">if(node.hasChildren() === false) ...</pre> + </dd> + <dt>node.isActive() + <dd> + Return true, if this node is activated. Only one tree node may be active + at any time. + </dd> + <dt>node.isChildOf(otherNode) + <dd> + Return true, if this node is a <i>direct</i> child of + <code>otherNode</code>. + </dd> + <dt>node.isDescendantOf(otherNode) + <dd> + Return true, if this node is a descendent (direct or indirect child) of + <code>otherNode</code>. + </dd> + <dt>node.isExpanded() + <dd> + Return true, if the node is expanded. + </dd> + <dt>node.isFirstSibling() + <dd> + Return true, if this node is the first of all children of the current parent. + </dd> + <dt>node.isFocused() + <dd> + Return true, if this node is has the focus. + </dd> + <dt>node.isLastSibling() + <dd> + Return true, if this node is the last of all children of the current parent. + </dd> + <dt>node.isLazy() + <dd> + Return true, if the node is lazy (loaded or not). + </dd> + <dt>node.isLoading() + <dd> + Return true, if the node is lazy and currently loading (i.e. an Ajax request is active). + </dd> + <dt>node.isSelected() + <dd> + Return true, if the node is selected. + </dd> + <dt>node.isStatusNode() + <dd> + Return true, if this is an temporary status node. Status nodes are + created while loading lazy data, to display a throbber or error + condition. + </dd> + <dt>node.isVisible() + <dd> + Return true, if the node is visible, i.e. all parents are expanded. + </dd> + <dt>node.makeVisible() + <dd> + Expand all parents as neccessary, to make this node visible. + </dd> + <dt>node.move(targetNode, mode) + <dd> + Move this node to <code>targetNode</code>. + Possible <code>mode</code>: + <ul> + <li><code>child</code>: append this node as last child of targetNode. + This is the default. + To be compatble with the D'n'd hitMode, we also accept 'over'. + <li><code>before</code>: add this node as sibling before targetNode. + <li><code>after</code>: add this node as sibling after targetNode. + </ul> + </dd> + <dt>node.reload(force)</dt> + <dd> + Deprecated. Use <code>reloadChildren()</code> instead. + </dd> + <dt>node.reloadChildren(callback)</dt> + <dd> + Discard and reload all children of a lazy node by triggering + the <code>onLazyRead</code> event. + if <code>callback</code> is passed, it is called after the Ajax request + was executed. + Example <pre class="prettyprint">node.reloadChildren(function(node, isOk){ + if(!isOk) alert("Node " + node + " could not be reloaded."); +});</pre> + </dd> + <dt>node.remove() + <dd> + Remove this node and descendents from tree. + </dd> + <dt>node.removeChildren() + <dd> + Remove all child nodes and descendents. + </dd> + <dt>node.render(useEffects, includeInvisible) + <dd> + Redraw this node with current attributes. All HTML markup is updated + and class names are added according to current status.<br> + If this node is expanded, markup for children is recursively generated + as well. + <ul> + <li><code>useEffects</code>:<br> + (default: false) Set to false to prevent animated expand effects, + which would be applied asynchronously. + <li><code>includeInvisible</code>:<br> + (default: false) Force HTML creation for all descendants, even if + inside a collapsed branch.<br> + This may be useful, if we want to bind events or otherwise access + these HTML elements. It will however degrade performance, especially + on large trees. + </ul> + <br> + Most of the time, there is no need to call this explicitly, since it is + internally called on state changes. + </dd> + <dt>node.resetLazy() + <dd> + Remove all children from a lazy node and make sure it is collapsed. + The node will be re-loaded when expanded the next time. + </dd> + <dt>node.scheduleAction(mode, ms) + <dd> + Schedule a delayed action. + Possible <code>mode</code>: + <ul> + <li><code>expand</code>: Expand this node after <i>ms</i> microseconds. + <li><code>activate</code>: Activate this node after <i>ms</i> microseconds. + <li><code>cancel</code>: cancel pending action, if any was scheduled. + </ul> + </dd> + <dt>node.select(flag) + <dd> + Select or deselect this node - according to flag - and fire an onSelect event. + </dd> + <dt>node.setLazyNodeStatus(status) + <dd> + Display a dummy child node, to provide feedback, when loading a lazy node's content. <br> + Possible status: + <ul> + <li><code>DTNodeStatus_Loading</code>: show a spinning wheel, with 'loading...' message. + <li><code>DTNodeStatus_Error</code>: show an error icon and message. + <li><code>DTNodeStatus_Ok</code>: Remove the status node. + </ul> + Messages may be customized using the <code>strings.loading</code> and <code>strings.loadError</code> options. + </dd> + <dt>node.setTitle(title) + <dd> + Change current node title and redraw. + </dd> + <dt>node.sortChildren(cmp, deep) + <dd> + Sort child list by title.<br> + <code>cmd</code>: optional compare function. If ommitted sorting is done by node titles.<br> + <code>deep</code>: optional: pass true to sort all descendant nodes.<br> + Example<pre class="prettyprint">// Custom compare function (optional) that sorts case insensitive +var cmp = function(a, b) { + a = a.data.title.toLowerCase(); + b = b.data.title.toLowerCase(); + return a > b ? 1 : a < b ? -1 : 0; +}; +node.sortChildren(cmp, false);</pre> + </dd> + <dt>node.toDict(recursive, callback) + <dd> + Convert the node into a JavaScript object.<br> + <code>recursive</code>: set to true, to include child nodes.<br> + <code>callback</code>: (optional) function to allow modifications.<br> + Example <pre class="prettyprint">var cb = node.toDict(true, function(dict){ + dict.title = "Copy of " + dict.title; + delete dict.key; // prevent duplicate keys +});</pre> + </dd> + <dt>node.toggleExpand() + <dd> + Toggle expansion state.<br> + Expanding a lazy node, fires a onLazyRead event. + </dd> + <dt>node.toggleSelect() + <dd> + Toggle selection state. + </dd> + <dt>node.visit(fn, includeSelf) + <dd> + Call <code>fn(node)</code> for all child nodes.<br> + Stop iteration, if fn() returns false. + Stop iteration <i>of the current branch</i>, if fn() returns the string + 'skip'. + </dd> + <dt>node.visitParents(fn, includeSelf) + <dd> + Call <code>fn(node)</code> for all parent nodes.<br> + Stop iteration, if fn(node) returns false. + </dd> +</dl> + +<h3>Programming examples</h3> + +<p> + The follwing code snippets should give an idea on how to use the API. +</p> + +<h4>Example: Select a node with key '1234'</h4> + +<pre class="prettyprint"> +$("#tree").dynatree("getTree").selectKey("1234"); +// or another way: +$("#tree").dynatree("getTree").getNodeByKey("1234").select(); +// .. or yet another way (if 'generateIds' option was enabled): +$("#dynatree-id-1234").prop("dtnode").select(); + +</pre> + + +<h4>Example: Access the currently active node</h4> + +<pre class="prettyprint"> +var node = $("#tree").dynatree("getActiveNode"); +if( node ){ + alert("Currently active: " + node.data.title); +} +</pre> + + +<h4>Example: Retrieve a node using for a DOM element or jQuery object</h4> + +<pre class="prettyprint"> +$(".dynatree-partsel").each(function(){ + var node = $.ui.dynatree.getNode(this); + [...] +}); +</pre> + + +<h4>Example: Rename the active node</h4> + +<pre class="prettyprint"> +var node = $("#tree").dynatree("getActiveNode"); +node.data.title = "My new title"; +node.render(); +</pre> + + +<h4>Example: Add a child to the active node</h4> + +<pre class="prettyprint"> +var node = $("#tree").dynatree("getActiveNode"); +var childNode = node.addChild({ + title: "My new node", + tooltip: "This folder and all child nodes were added programmatically." +}); +</pre> +<p> + Note: instead of passing a single child object, we could also pass an array + of such objects.<br> + Also, the children may again contain <code>children</code> attributes, thus + defining a sub tree. +</p> + + +<h4>Example: Add a hover handler and find the hovered node from any sub element</h4> + +<pre class="prettyprint"> +// Bind hover events to the tree's <a> tags: +$("#tree a").hover(function(){ + var node = $.ui.dynatree.getNode(this); + logMsg("Hover in %s", node); + }, function(){ + var node = $.ui.dynatree.getNode(this); + logMsg("Hover out %s", node); + }); +</pre> + + +<h4>Example: Expand all nodes</h4> + +<pre class="prettyprint"> +$("#tree").dynatree("getRoot").visit(function(node){ + node.expand(true); +}); +</pre> + + +<h4>Example: Save current tree status to the backend</h4> + +<pre class="prettyprint"> +// Get a JavaScript object copy of the tree +var dict = $("#tree").dynatree("getTree").toDict(); +// ... then use Ajax to send this to your server... +</pre> + + +<h4>Example: activate a node depending on URL</h4> + +This sample shows how to parse the page URL and activate a node accordingly: +<code>http://server/_test-194.html?activate=_11</code> + +<pre class="prettyprint"> +// Add a helper function to parse the URL +function getURLParameter(name) { + return unescape( + (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] + ); +} +// Evaluate the URL after the tree was loaded +$(function(){ + $("#tree").dynatree({ + [...] + onPostInit: function(isReloading, isError) { + var key = getURLParameter("activate"); + if( key ) { + this.activateKey(key); + } + }, +</pre> + + +<h2 id="theming">Theming and translation</h2> + +<p> + The tree's fonts, colors, and icons are defined using CSS, so changing the + appearance is simply a matter of including a custom stylesheet or by + replacing <a href="../src/skin/icons.gif">icons.gif</a> with another + version. +</p> +<div class="codesample"> +<a href="sample-theming.html">Try this example...</a> +<pre class="prettyprint"> +<script src="../jquery/jquery.js" type="text/javascript"></script> +<script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> +<script src="../src/jquery.dynatree.js" type="text/javascript"></script> +<!-- Include the basic stylesheet: --> +<link href="../src/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css"> +<!-- Override CSS with a custom stylesheet : --> +<link href="skin-custom/custom.css" rel="stylesheet" type="text/css" > + +<script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + […] + }); + }); +</script> +</pre> +</div> + +<p> + Custom.css would include lines like this: +</p> +<pre class="prettyprint"> +.dynatree-has-children span.dynatree-icon +{ + background-position: 0 0; + background-image: url("doc_with_children.gif"); +} +</pre> + +<p> + Changing the appearance and icons of <b>single nodes</b> is done by assigning a + custom class: +</p> +<pre class="prettyprint"> +<ul> + <li data="addClass: 'custom1'">Document with custom class +</pre> + +<p> + or +</p> + +<pre class="prettyprint"> +children: [ + { title: "Document with custom class", addClass: "custom1" }, +</pre> + +<p> + we would then add CSS definitions for the new node to our stylesheet: +</p> +<pre class="prettyprint"> +span.custom1 a +{ + background-color: #ffffbb; + color: maroon; +} +span.custom1 span.dynatree-icon +{ + background-position: 0 0; + background-image: url("customDoc2.gif"); +} +</pre> + + +<h3>Translation</h3> +<p> + Strings can be translated in the tree options: +</p> + +<pre class="prettyprint"> +$("#tree").dynatree({ + […] + strings: { + loading: "Daten werden geladen…", + loadError: "Fehler beim Laden!" + }, +}); +</pre> + + + +<h2><a id="issues"></a>Feedback, version history, credits and known issues</h2> + +<h3>Credits</h3> +<p> + I am using the <a href="http://prendreuncafe.com/work/jqplanize/">planize plugin</a> + by Nicolas Perriault for the table of contents.<br> + I am using <a href="http://code.google.com/p/google-code-prettify/">prettify.js</a> + by Mike Samuel for syntax highlighting in the of source code samples. +</p> + +<h3>Feedback and support</h3> +<p> + First of all: this is work in progress.<br> + Any kind of feedback is very welcome :-) +</p> +<ul> + <li>A <a href="http://groups.google.com/group/dynatree">discussion forum</a> is in place to ask questions or discuss features. + <li>Check <a href="http://stackoverflow.com/tags/dynatree">Stack Overflow</a> for existing questions. + <li>Use the <a href="http://code.google.com/p/dynatree/issues/list">Issue Tracker</a> to get a list of known bugs, or vote for a feature.<br> + Please make sure you searched the group and issue tracker, before adding a new request. + <li>If you like: + <a href="http://wwwendt.de/freeware/donate.html">Make a donation</a>. +</ul> + +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/dynatree_server.py b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/dynatree_server.py new file mode 100644 index 0000000000000000000000000000000000000000..eb337c707eae58f5acfc712ef2ee967ab4b277cc --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/dynatree_server.py @@ -0,0 +1,270 @@ +""" + This sample web server demonstrates how to implement a web service for + Dynatree requests. + + As data source, we choose a folder in the local file system, simply + because it is hierarchical and has a concept of documents (files) and + folders (directories) and because it was easy to implement. + A typical web service would of course read the data from a 'real' source + like an SQL database or XML file, but I hope you get the idea ;-) + + See: http://dynatree.googlecode.com + + Martin Wendt, 2009-2011 + + Usage: + 1. Python 2.5 or later is required to run this server. + For Python 2.5 the simplejson module must also be installed; + Python 2.6 has built in json support. + 2. Configure the rootPath variable in the main() function at the bottom + of this module. + 3. Run this module: + > python dynatree_server.py + + Optionally pass a root folder: + > python dynatree_server.py c:\temp + + This module + - Is a standalone web server that answers URLs beginning with + http://127.0.0.1:8001/?... + with JSON responses that conform to the Dynatree spec. + However, we don't do error checking or anything else that would be + required for production environments. + + - Answers requests to initialize a tree using the 'initAjax: {}' option: + http://127.0.0.1:8001/?mode=baseFolders + with a list of files/directories in the configured root directory. + + - Answers requests to lazy-load node children using 'appendAjax({...})': + http://127.0.0.1:8001/?key=_25c2b6d6 + with a list of files/directories in the directory that matches this key. + + - Supports Dynatree's 'lazy persistence': + http://127.0.0.1:8001/?mode=baseFolder&expandedKeyList=_41771df2%2C_4230fb68%2C... + will return not only the base entries, but also all children inside + parents that are listed as expanded. + + - Supports &sleep=SECONDS argument for simulating slow responses. + + - Supports the JSONP protocol: + http://127.0.0.1:8001/?mode=baseFolder&callback=jsonp1241293219729 + will wrap the result like this "jsonp1241293219729(<res>)". + This is only required, if this web service is not on the same host as + the web page that contains the Dynatree widget. + JSONP can be enabled for jQuery.ajax() by passing dataType: 'jsonp' + instead of 'json'. + + - Dumps the POST body, if the request URL is '/submit_data' + + +Sample Dynatree options to use this service: + $("#tree").dynatree({ + ... + persist: true, + initAjax: {url: "http://127.0.0.1:8001", + dataType: "jsonp", // Enable JSONP, so this sample can be run from the local file system against a localhost server + data: {key: "", +// sleep: 3, +// depth: 2, + mode: "baseFolders" + }, + addExpandedKeyList: true // Send list of expanded keys, so the webservice can deliver these children also + }, + onLazyRead: function(dtnode){ + dtnode.appendAjax( + {url: "http://127.0.0.1:8001", + dataType: "jsonp", + data: {key: dtnode.data.key, + mode: "branch" + } + }); + } + }); +""" + +import cgi +import os +import sys +import time +from wsgiref.simple_server import WSGIServer, WSGIRequestHandler +from tempfile import gettempdir + +try: + import json # Available since Python 2.6 +except ImportError: + import simplejson as json + +#=============================================================================== +# Helper functions +#=============================================================================== + +def _keyFromString(s): + """Calculate a unique key for an arbitrary string. + + Example: _keyFromString("c:\temp\wsgidav1\src\DAV") = "_25c2b6d6" + """ + return "_" + hex(hash(s)) [3:] + + +def _findFolderByKey(rootPath, key): + """Search rootPath and all sub folders for a directory that matches the key.""" + for root, dirs, files in os.walk(rootPath): + for name in dirs: + fullPath = os.path.join(root, name) + fileKey = _keyFromString(fullPath) + if key == fileKey: + return fullPath + return None + + +#=============================================================================== +# DynaTreeWsgiApp +#=============================================================================== + +class DynaTreeWsgiApp(object): + """This WSGI application serves a file system hierarchy for dynatree.""" + def __init__(self, optionDict): + self.optionDict = optionDict + + def __call__(self, environ, start_response): + """Handle one HTTP request.""" + + # Parse URL query into a list of 2-tuples (name, value) + argList = cgi.parse_qsl(environ.get("QUERY_STRING", "")) + # Convert to dictionary {"name": "value", ... } + argDict = dict(argList) + print "Query args: %s" % argDict + + # Support &sleep=SECONDS argument to simulate slow connections for debugging + if argDict.get("sleep"): + print "Sleeping %s seconds..." % argDict.get("sleep") + time.sleep(int(argDict.get("sleep"))) + + # Dump POST request data, if http://HOST:PORT/submit_data was requested +# print "PI", environ["PATH_INFO"] + if environ["PATH_INFO"] == "/submit_data": + print "Got /submit_data request, CONTENT_LENGTH=%r" % environ.get("CONTENT_LENGTH") + try: + length = int(environ["CONTENT_LENGTH"]) + data = environ["wsgi.input"].read(length) + except: + print >>sys.stderr, "Couldn't read from wsgi.input! This can happen when using Firefox locally" + try: + data = environ["wsgi.input"].read() + except: + print + print "Data: ", data + start_response("200 OK", [("Content-Type", "text/html")]) + return [ "Thanks for sending<br><pre><code>%s</code></pre>" % data ] + + # Support &depth=LEVEL argument to read more than one level (1: direct children) + depth = int(argDict.get("depth", 0)) + if depth > 1: + print "'depth' mode: loading %s levels" % depth + + # Return empty list when '&returnEmpty' is passed + returnEmpty = "returnEmpty" in argDict + + # Eval 'mode' and 'key' arguments + rootPath = self.optionDict["rootPath"] + if argDict.get("mode") == "baseFolders": + folderPath = rootPath + elif argDict.get("key"): + key = argDict.get("key") + folderPath = _findFolderByKey(rootPath, key) + if not folderPath: + raise RuntimeError("Could not find folder for key '%s'." % key) + else: + raise RuntimeError("Missing required argument '&mode=baseFolder' or '&key=...'") + + # Get list of child nodes (may be recursive) + childList = [ ] + if not returnEmpty: + self.makeChildList(argDict, folderPath, childList, depth) + + # Convert result list to a JSON string + res = json.dumps(childList, encoding="Latin-1") + + # Support for the JSONP protocol. + if "callback" in argDict: + res = argDict["callback"] + "(" + res + ")" + + # Return HTTP response + start_response("200 OK", [("Content-Type", "application/json")]) + return [ res ] + + + def makeChildList(self, argDict, folderPath, childList, depth): + print "makeChildList(%s, depth=%s) " % (folderPath, depth) + expandedKeyList = argDict.get("expandedKeyList", "").split(",") + filenameList = os.listdir(folderPath) + for fn in filenameList: + fullPath = os.path.join(folderPath, fn) + isFolder = os.path.isdir(fullPath) + key = _keyFromString(fullPath) + try: + size = os.path.getsize(fullPath) + date = time.ctime(os.path.getmtime(fullPath)) + except: + # May fail when path contains funny chars (don't care in this sample) + size = 0 + date = time.ctime() + # Create a node dictionary and append it to the child list + node = {"title": fn, + "key": key, + "isFolder": isFolder, + "isLazy": isFolder, + "tooltip": "%s, %s bytes, modified: %s" % (fullPath, size, date), + } + childList.append(node) + # Support lazy persistence: + # If the current node was requested as 'expanded', load the children too + if isFolder and (key in expandedKeyList or depth > 1): + subNodes = [] + self.makeChildList(argDict, fullPath, subNodes, depth-1) + node["children"] = subNodes +# node["isLazy"] = False +# node["expand"] = True + + +#=============================================================================== +# Server +#=============================================================================== + +# Requires Python >= 2.5 + +def make_server(host, port, app, server_class=WSGIServer, handler_class=WSGIRequestHandler): + """Create a new WSGI server listening on 'host' and 'port' for 'app'.""" + server = server_class((host, port), handler_class) + server.set_app(app) + return server + + +def main(): + # Configure root directory that will be exported: + rootPath = gettempdir() + if len(sys.argv) > 1: + rootPath =sys.argv[1] + +# rootPath = "/temp" + + # Configure hostname and port on which the server will listen +# hostname = "127.0.0.1" # Use empty string for localhost (local access only) + hostname = "" # Use empty string for 0.0.0.0 (allows remote access) + port = 8001 + + wsgi_app = DynaTreeWsgiApp({"rootPath": rootPath}) + + httpd = make_server(hostname, port, wsgi_app) + + sa = httpd.socket.getsockname() + + print "Exporting file system at ", rootPath, " for Dynatree." + print "Serving HTTP on", sa[0], "port", sa[1], "..." + assert os.path.isdir(rootPath), "Invalid root path: '%s'" % rootPath + + httpd.serve_forever() + + +if __name__ == "__main__": + main() diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/howto.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/howto.css new file mode 100644 index 0000000000000000000000000000000000000000..935ab47300c124c2ece4b7163df5a79251955bd6 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/howto.css @@ -0,0 +1,122 @@ +body { + font-family: sans-serif; + +} + +ul { + list-style-type: square; +} + +div.hint { + font-size: smaller; +} + +p.info, +div.info { + background-color: #ffffa0; + background-image: url(iconInfo_32x32.png); + background-repeat: no-repeat; + padding: 5px; + padding-left: 40px; +} + +div.codesample { + border: thin solid gray; +} + +div.codesample a { + text-align: right; +} + +code +{ + font-family: monospace; + font-size: 1.2em; +} + +div.codesample pre, +pre.codesample +{ + font-family: monospace; /* courier doesn't contain '...'*/ + background-color: #f0f0f0; + padding: 5px; +} + +pre.codesample { + border: thin solid gray; +} + +dl.optionList { + margin-left: 20px; +} +dl.optionList dt { + font-family: monospace; + background-color: #f0f0f0; +} +dl.optionList dd { +/* font-style: italic; */ + margin-bottom: 10px; +} + +/***************************************************************************** + * jquery.planize + */ + +#toc { + border: thin solid gray; +/* background-color: f0f0f0; */ + padding: 5px; +} +#toc >h4 { +/* background-color: f0f0f0; */ + margin-top: 5px; + margin-bottom: 5px; +} +#toc ul { + list-style-type: none; +} + +#toc a, +#toc a:visited +{ + color: blue; + text-decoration: none; +} +#toc a:hover +{ + text-decoration: underline; +} + +/***************************************************************************** + * Examples + */ + +body.example +{ + margin: 15px; +} + +body.example h1 +{ + font-size: 1.2em; +} + +body.example p.description, +body.example p.sample-links +{ +/* border: thin solid gray; */ + background-color: #d0d0f0; + padding: 5px; + font-size: small; +} + +p.sample-links a, +p.sample-links a:visited +{ + color: navy; + text-decoration: none; +} +p.sample-links a:hover +{ + text-decoration: underline; +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/howto.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/howto.js new file mode 100644 index 0000000000000000000000000000000000000000..4c2da61f885df6b002d8371e1361b65e4854cc2b --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/howto.js @@ -0,0 +1,87 @@ +/************************************************************************* + (c) 2008-2009 Martin Wendt + *************************************************************************/ + +$(function(){ + // Replace tabs inside <pre> with 4 spaces, because some browsers display 8 + // characters + $("pre.codesample, div.codesample pre, pre.prettyprint").each(function(){ + var text = $(this).text(); + text2 = text.replace(/\t/g, " "); + $(this).text(text2) + }); + + // Show some elements only, if (not) inside the Example Browser + if (top.location == self.location) + $(".hideOutsideFS").hide(); + else + $(".hideInsideFS").hide(); +}); + + +(function($) { + +$.widget("ui.toc", { + init: function() { + // The widget framework supplies this.element and this.options. + this.options.event += '.toc'; // namespace event + + // create TOC + var $this = this.element; + var opts = this.options; + + // Attach the tree object to parent element + var id = $this.attr("id"); + + $this.addClass(opts.classnames.container); + $this.append("<div class='" + opts.classnames.title + "'>" + opts.title + "</div>"); + +// var $ul = $this.append("<ul />"); + var $ul = $("<ul />").appendTo($this); +// this._addSubItems($ul, 1); + var idx = 1; + $("h2").each(function() { + var $h = $(this); + $ul.append("<li><a href='#" + idx + "'>" + $h.text() + "</a></li>"); + $h.attr("id", idx); + idx++; + }); + }, + + // ------------------------------------------------------------------------ + lastentry: undefined +}); + + +// The following methods return a value (thus breaking the jQuery call chain): + +//$.ui.toc.getter = "getTree getRoot"; + + +// Plugin default options: + +$.ui.toc.defaults = { + title: "Table of contents", // Text used for the toc header. + startDepth: 1, // Start with <Hx> and higher (H1, H2, ...) + maxDepth: 3, // Max depth to scan (..., ´H2, H3) + addUpLink: false, // Add an clickable link to jump back upwards to the toc. + numberItems: false, // Use an ordered list instead of <ul>. Also the index is prepended to the <h..> tags. + orderedListStyleType: "decimal", + strings: { + loading: "Loading…", + loadError: "Load error!" + }, + classnames: { + container: "ui-toc-container", + title: "ui-toc-title" + }, + debugLevel: 0, + // templates + //~ tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>', // var $li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label)); + // ------------------------------------------------------------------------ + lastentry: undefined +}; + + +// --------------------------------------------------------------------------- +})(jQuery); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/iconInfo_32x32.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/iconInfo_32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..d8197d61a38f508651d3ce759bcd60d620226bbb Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/iconInfo_32x32.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/iconWarning_32x32.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/iconWarning_32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f6551d940eb76b48597f3f9bf09e2a3395b090 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/iconWarning_32x32.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons-vista.psp b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons-vista.psp new file mode 100644 index 0000000000000000000000000000000000000000..261420c52e69dc7085a4db36bf2cb182f3f27cd4 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons-vista.psp differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons-xp.psp b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons-xp.psp new file mode 100644 index 0000000000000000000000000000000000000000..251f46d3434f9868b4e3cd787509f48f83427d1a Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons-xp.psp differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons_layout.ods b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons_layout.ods new file mode 100644 index 0000000000000000000000000000000000000000..64d4486f485c8307f90a81e6104cd76d77041a5d Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/icons_layout.ods differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/cut.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/cut.png new file mode 100644 index 0000000000000000000000000000000000000000..f215d6f6b7c81ab344a3e53e0e5e756c58c82d90 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/cut.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/door.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/door.png new file mode 100644 index 0000000000000000000000000000000000000000..369fc46ed259191014664e8a16bea76e7513f8b6 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/door.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_copy.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_copy.png new file mode 100644 index 0000000000000000000000000000000000000000..a9f31a278e17993d8d4e13beac2f9d5f7b42d08f Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_copy.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_delete.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_delete.png new file mode 100644 index 0000000000000000000000000000000000000000..af1ecaf2981fa37628c8b8b15ee389f9575e5f6b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_delete.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_edit.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..b93e77600def75c9a144d3d0a5088a62c02cbb0b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_edit.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_paste.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_paste.png new file mode 100644 index 0000000000000000000000000000000000000000..5b2cbb3fd02a5e708d9f9de4ea118965972a02b0 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/images/page_white_paste.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.contextMenu.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.contextMenu.css new file mode 100644 index 0000000000000000000000000000000000000000..e115cd4c75105c09d0dff1e04c47660ce5aa5ab9 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.contextMenu.css @@ -0,0 +1,134 @@ +/* + * jQuery contextMenu - Plugin for simple contextMenu handling + * + * Version: 1.5.2 + * + * Authors: Rodney Rehm, Addy Osmani (patches for FF) + * Web: http://medialize.github.com/jQuery-contextMenu/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * GPL v3 http://opensource.org/licenses/GPL-3.0 + * + */ + +.context-menu-list { + margin:0; + padding:0; + + min-width: 120px; + max-width: 250px; + display: inline-block; + position: absolute; + list-style-type: none; + + border: 1px solid #DDD; + background: #EEE; + + -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); + -moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); + -ms-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); + -o-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); + + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; +} + +.context-menu-item { + padding: 2px 2px 2px 24px; + background-color: #EEE; + position: relative; + -moz-user-select: -moz-none; +} + +.context-menu-separator { + padding-bottom:0; + border-bottom: 1px solid #DDD; +} + +.context-menu-item > label { + -moz-user-select: text; +} + +.context-menu-item.hover { + cursor: pointer; + background-color: #39F; +} + +.context-menu-item.disabled { + color: #666; +} + +.context-menu-input.hover, +.context-menu-item.disabled.hover { + cursor: default; + background-color: #EEE; +} + +.context-menu-submenu:after { + content: ">"; + color: #666; + position: absolute; + top: 0; + right: 3px; + z-index: 1; +} + +/* icons + #protip: + In case you want to use sprites for icons (which I would suggest you do) have a look at + http://css-tricks.com/13224-pseudo-spriting/ to get an idea of how to implement + .context-menu-item.icon:before {} + */ +.context-menu-item.icon { min-height: 18px; background-repeat: no-repeat; background-position: 4px 2px; } +.context-menu-item.icon-edit { background-image: url(images/page_white_edit.png); } +.context-menu-item.icon-cut { background-image: url(images/cut.png); } +.context-menu-item.icon-copy { background-image: url(images/page_white_copy.png); } +.context-menu-item.icon-paste { background-image: url(images/page_white_paste.png); } +.context-menu-item.icon-delete { background-image: url(images/page_white_delete.png); } +.context-menu-item.icon-quit { background-image: url(images/door.png); } + +/* vertically align inside labels */ +.context-menu-input > label > * { vertical-align: top; } + +/* position checkboxes and radios as icons */ +.context-menu-input > label > input[type="checkbox"], +.context-menu-input > label > input[type="radio"] { + margin-left: -17px; +} +.context-menu-input > label > span { + margin-left: 5px; +} + +.context-menu-input > label, +.context-menu-input > label > input[type="text"], +.context-menu-input > label > textarea, +.context-menu-input > label > select { + display: block; + width: 100%; + + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -o-box-sizing: border-box; + box-sizing: border-box; +} + +.context-menu-input > label > textarea { + height: 100px; +} +.context-menu-item > .context-menu-list { + display: none; + /* re-positioned by js */ + right: -5px; + top: 5px; +} + +.context-menu-item.hover > .context-menu-list { + display: block; +} + +.context-menu-accesskey { + text-decoration: underline; +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.contextMenu.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.contextMenu.js new file mode 100644 index 0000000000000000000000000000000000000000..646820edde07f4ce112f8fd9ddcf338310689666 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.contextMenu.js @@ -0,0 +1,1434 @@ +/* + * jQuery contextMenu - Plugin for simple contextMenu handling + * + * Version: 1.5.6 + * + * Authors: Rodney Rehm, Addy Osmani (patches for FF) + * Web: http://medialize.github.com/jQuery-contextMenu/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * GPL v3 http://opensource.org/licenses/GPL-3.0 + * + */ + +(function($, undefined){ + + // TODO: - + // ARIA stuff: menuitem, menuitemcheckbox und menuitemradio + // create <menu> structure if $.support[htmlCommand || htmlMenuitem] and !opt.disableNative + +// determine html5 compatibility +$.support.htmlMenuitem = ('HTMLMenuItemElement' in window); +$.support.htmlCommand = ('HTMLCommandElement' in window); + +var // currently active contextMenu trigger + $currentTrigger = null, + // is contextMenu initialized with at least one menu? + initialized = false, + // flag stating to ignore the contextmenu event + ignoreThisClick = false, + // window handle + $win = $(window), + // number of registered menus + counter = 0, + // mapping selector to namespace + namespaces = {}, + // mapping namespace to options + menus = {}, + // custom command type handlers + types = {}, + // default values + defaults = { + // selector of contextMenu trigger + selector: null, + // where to append the menu to + appendTo: null, + // method to trigger context menu ["right", "left", "hover"] + trigger: "right", + // hide menu when mouse leaves trigger / menu elements + autoHide: false, + // ignore right click triggers for left, hover or custom activation + ignoreRightClick: false, + // ms to wait before showing a hover-triggered context menu + delay: 200, + // determine position to show menu at + determinePosition: function($menu) { + // position to the lower middle of the trigger element + if ($.ui && $.ui.position) { + // .position() is provided as a jQuery UI utility + // (...and it won't work on hidden elements) + $menu.css('display', 'block').position({ + my: "center top", + at: "center bottom", + of: this, + offset: "0 5", + collision: "fit" + }).css('display', 'none'); + } else { + // determine contextMenu position + var offset = this.offset(); + offset.top += this.outerHeight(); + offset.left += this.outerWidth() / 2 - $menu.outerWidth() / 2; + $menu.css(offset); + } + }, + // position menu + position: function(opt, x, y) { + var $this = this, + offset; + // determine contextMenu position + if (!x && !y) { + opt.determinePosition.call(this, opt.$menu); + return; + } else if (x === "maintain" && y === "maintain") { + // x and y must not be changed (after re-show on command click) + offset = opt.$menu.position(); + } else { + // x and y are given (by mouse event) + var triggerIsFixed = opt.$trigger.parents().andSelf() + .filter(function() { + return $(this).css('position') == "fixed"; + }).length; + + if (triggerIsFixed) { + y -= $win.scrollTop(); + x -= $win.scrollLeft(); + } + offset = {top: y, left: x}; + } + + // correct offset if viewport demands it + var bottom = $win.scrollTop() + $win.height(), + right = $win.scrollLeft() + $win.width(), + height = opt.$menu.height(), + width = opt.$menu.width(); + + if (offset.top + height > bottom) { + offset.top -= height; + } + + if (offset.left + width > right) { + offset.left -= width; + } + + opt.$menu.css(offset); + }, + // position the sub-menu + positionSubmenu: function($menu) { + if ($.ui && $.ui.position) { + // .position() is provided as a jQuery UI utility + // (...and it won't work on hidden elements) + $menu.css('display', 'block').position({ + my: "left top", + at: "right top", + of: this, + collision: "fit" + }).css('display', ''); + } else { + // determine contextMenu position + var offset = this.offset(); + offset.top += 0; + offset.left += this.outerWidth(); + $menu.css(offset); + } + }, + // offset to add to zIndex + zIndex: 1, + // show hide animation settings + animation: { + duration: 50, + show: 'slideDown', + hide: 'slideUp' + }, + // events + events: { + show: $.noop, + hide: $.noop + }, + // default callback + callback: null, + // list of contextMenu items + items: {} + }, + // mouse position for hover activation + hoveract = { + timer: null, + pageX: null, + pageY: null + }, + // determine zIndex + zindex = function($t) { + var zin = 0, + $tt = $t; + + while (true) { + zin = Math.max(zin, parseInt($tt.css('z-index'), 10) || 0); + $tt = $tt.parent(); + if (!$tt || !$tt.length || $tt.prop('nodeName').toLowerCase() == 'body') { + break; + } + } + + return zin; + }, + // event handlers + handle = { + // abort anything + abortevent: function(e){ + e.preventDefault(); + e.stopImmediatePropagation(); + }, + + // contextmenu show dispatcher + contextmenu: function(e) { + var $this = $(this); + // disable actual context-menu + e.preventDefault(); + e.stopImmediatePropagation(); + + // ignore right click trigger + if (ignoreThisClick) { + ignoreThisClick = false; + return; + } + + if (!$this.hasClass('context-menu-disabled')) { + // theoretically need to fire a show event at <menu> + // http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus + // var evt = jQuery.Event("show", { data: data, pageX: e.pageX, pageY: e.pageY, relatedTarget: this }); + // e.data.$menu.trigger(evt); + + $currentTrigger = $this; + if (e.data.build) { + // dynamically build menu on invocation + $.extend(true, e.data, defaults, e.data.build($currentTrigger, e) || {}); + op.create(e.data); + } + // show menu + op.show.call($this, e.data, e.pageX, e.pageY); + } + }, + // contextMenu left-click trigger + click: function(e) { + e.preventDefault(); + e.stopImmediatePropagation(); + $(this).trigger(jQuery.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY })); + }, + // contextMenu right-click trigger + mousedown: function(e) { + // register mouse down + var $this = $(this); + + // hide any previous menus + if ($currentTrigger && $currentTrigger.length && !$currentTrigger.is($this)) { + $currentTrigger.data('contextMenu').$menu.trigger('contextmenu:hide'); + } + + // activate on right click + if (e.button == 2) { + $currentTrigger = $this.data('contextMenuActive', true); + } + }, + // contextMenu right-click trigger + mouseup: function(e) { + // show menu + var $this = $(this); + if ($this.data('contextMenuActive') && $currentTrigger && $currentTrigger.length && $currentTrigger.is($this) && !$this.hasClass('context-menu-disabled')) { + e.preventDefault(); + e.stopImmediatePropagation(); + $currentTrigger = $this; + $this.trigger(jQuery.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY })); + } + + $this.removeData('contextMenuActive'); + }, + // contextMenu hover trigger + mouseenter: function(e) { + var $this = $(this), + $related = $(e.relatedTarget), + $document = $(document); + + // abort if we're coming from a menu + if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) { + return; + } + + // abort if a menu is shown + if ($currentTrigger && $currentTrigger.length) { + return; + } + + hoveract.pageX = e.pageX; + hoveract.pageY = e.pageY; + hoveract.data = e.data; + $document.on('mousemove.contextMenuShow', handle.mousemove); + hoveract.timer = setTimeout(function() { + hoveract.timer = null; + $document.off('mousemove.contextMenuShow'); + $currentTrigger = $this; + $this.trigger(jQuery.Event("contextmenu", { data: hoveract.data, pageX: hoveract.pageX, pageY: hoveract.pageY })); + }, e.data.delay ); + }, + // contextMenu hover trigger + mousemove: function(e) { + hoveract.pageX = e.pageX; + hoveract.pageY = e.pageY; + }, + // contextMenu hover trigger + mouseleave: function(e) { + // abort if we're leaving for a menu + var $related = $(e.relatedTarget); + if ($related.is('.context-menu-list') || $related.closest('.context-menu-list').length) { + return; + } + + try { + clearTimeout(hoveract.timer); + } catch(e) {} + + hoveract.timer = null; + }, + + // ignore right click trigger + ignoreRightClick: function(e) { + if (e.button == 2) { + ignoreThisClick = true; + } + }, + + // click on layer to hide contextMenu + layerClick: function(e) { + var $this = $(this), + root = $this.data('contextMenuRoot'); + + e.preventDefault(); + e.stopImmediatePropagation(); + $this.remove(); + root.$menu.trigger('contextmenu:hide'); + }, + // key handled :hover + keyStop: function(e, opt) { + if (!opt.isInput) { + e.preventDefault(); + } + + e.stopPropagation(); + }, + key: function(e) { + var opt = $currentTrigger.data('contextMenu') || {}, + $children = opt.$menu.children(), + $round; + + switch (e.keyCode) { + case 9: + case 38: // up + handle.keyStop(e, opt); + // if keyCode is [38 (up)] or [9 (tab) with shift] + if (opt.isInput) { + if (e.keyCode == 9 && e.shiftKey) { + e.preventDefault(); + opt.$selected && opt.$selected.find('input, textarea, select').blur(); + opt.$menu.trigger('prevcommand'); + return; + } else if (e.keyCode == 38 && opt.$selected.find('input, textarea, select').prop('type') == 'checkbox') { + // checkboxes don't capture this key + e.preventDefault(); + return; + } + } else if (e.keyCode != 9 || e.shiftKey) { + opt.$menu.trigger('prevcommand'); + return; + } + + case 9: // tab + case 40: // down + handle.keyStop(e, opt); + if (opt.isInput) { + if (e.keyCode == 9) { + e.preventDefault(); + opt.$selected && opt.$selected.find('input, textarea, select').blur(); + opt.$menu.trigger('nextcommand'); + return; + } else if (e.keyCode == 40 && opt.$selected.find('input, textarea, select').prop('type') == 'checkbox') { + // checkboxes don't capture this key + e.preventDefault(); + return; + } + } else { + opt.$menu.trigger('nextcommand'); + return; + } + break; + + case 37: // left + handle.keyStop(e, opt); + if (opt.isInput || !opt.$selected || !opt.$selected.length) { + break; + } + + if (!opt.$selected.parent().hasClass('context-menu-root')) { + var $parent = opt.$selected.parent().parent(); + opt.$selected.trigger('contextmenu:blur'); + opt.$selected = $parent; + return; + } + break; + + case 39: // right + handle.keyStop(e, opt); + if (opt.isInput || !opt.$selected || !opt.$selected.length) { + break; + } + + var itemdata = opt.$selected.data('contextMenu') || {}; + if (itemdata.$menu && opt.$selected.hasClass('context-menu-submenu')) { + opt.$selected = null; + itemdata.$selected = null; + itemdata.$menu.trigger('nextcommand'); + return; + } + break; + + case 13: // enter + handle.keyStop(e, opt); + if (opt.isInput) { + if (opt.$selected && !opt.$selected.is(':textarea, :select')) { + e.preventDefault(); + return; + } + break; + } + opt.$selected && opt.$selected.trigger('mouseup'); + return; + + case 32: // space + // prevent browser from scrolling down while menu is visible + handle.keyStop(e, opt); + return; + + case 27: // esc + handle.keyStop(e, opt); + opt.$menu.trigger('contextmenu:hide'); + return; + + default: // 0-9, a-z + var k = (String.fromCharCode(e.keyCode)).toUpperCase(); + if (opt.accesskeys[k]) { + // according to the specs accesskeys must be invoked immediately + opt.accesskeys[k].$node.trigger(opt.accesskeys[k].$menu + ? 'contextmenu:focus' + : 'mouseup' + ); + return; + } + break; + } + // pass event to selected item, + // stop propagation to avoid endless recursion + e.stopPropagation(); + opt.$selected && opt.$selected.trigger(e); + }, + + // select previous possible command in menu + prevItem: function(e) { + e.stopPropagation(); + var opt = $(this).data('contextMenu') || {}; + + // obtain currently selected menu + if (opt.$selected) { + var $s = opt.$selected; + opt = opt.$selected.parent().data('contextMenu') || {}; + opt.$selected = $s; + } + + var $children = opt.$menu.children(), + $prev = !opt.$selected || !opt.$selected.prev().length ? $children.last() : opt.$selected.prev(), + $round = $prev; + + // skip disabled + while ($prev.hasClass('disabled') || $prev.hasClass('not-selectable')) { + if ($prev.prev().length) { + $prev = $prev.prev(); + } else { + $prev = $children.last(); + } + if ($prev.is($round)) { + // break endless loop + return; + } + } + + // leave current + if (opt.$selected) { + handle.itemMouseleave.call(opt.$selected.get(0), e); + } + + // activate next + handle.itemMouseenter.call($prev.get(0), e); + + // focus input + var $input = $prev.find('input, textarea, select'); + if ($input.length) { + $input.focus(); + } + }, + // select next possible command in menu + nextItem: function(e) { + e.stopPropagation(); + var opt = $(this).data('contextMenu') || {}; + + // obtain currently selected menu + if (opt.$selected) { + var $s = opt.$selected; + opt = opt.$selected.parent().data('contextMenu') || {}; + opt.$selected = $s; + } + + var $children = opt.$menu.children(), + $next = !opt.$selected || !opt.$selected.next().length ? $children.first() : opt.$selected.next(), + $round = $next; + + // skip disabled + while ($next.hasClass('disabled') || $next.hasClass('not-selectable')) { + if ($next.next().length) { + $next = $next.next(); + } else { + $next = $children.first(); + } + if ($next.is($round)) { + // break endless loop + return; + } + } + + // leave current + if (opt.$selected) { + handle.itemMouseleave.call(opt.$selected.get(0), e); + } + + // activate next + handle.itemMouseenter.call($next.get(0), e); + + // focus input + var $input = $next.find('input, textarea, select'); + if ($input.length) { + $input.focus(); + } + }, + + // flag that we're inside an input so the key handler can act accordingly + focusInput: function(e) { + var $this = $(this).closest('.context-menu-item'), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + root.$selected = opt.$selected = $this; + root.isInput = opt.isInput = true; + }, + // flag that we're inside an input so the key handler can act accordingly + blurInput: function(e) { + var $this = $(this).closest('.context-menu-item'), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + root.isInput = opt.isInput = false; + }, + + // :hover on menu + menuMouseenter: function(e) { + var root = $(this).data().contextMenuRoot; + root.hovering = true; + }, + // :hover on menu + menuMouseleave: function(e) { + var root = $(this).data().contextMenuRoot; + if (root.$layer && root.$layer.is(e.relatedTarget)) { + root.hovering = false; + } + }, + + + // :hover done manually so key handling is possible + itemMouseenter: function(e) { + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + root.hovering = true; + + // abort if we're re-entering + if (e && root.$layer && root.$layer.is(e.relatedTarget)) { + e.preventDefault(); + e.stopImmediatePropagation(); + } + + // make sure only one item is selected + (opt.$menu ? opt : root).$menu + .children('.hover').trigger('contextmenu:blur'); + + if ($this.hasClass('disabled') || $this.hasClass('not-selectable')) { + opt.$selected = null; + return; + } + + $this.trigger('contextmenu:focus'); + }, + // :hover done manually so key handling is possible + itemMouseleave: function(e) { + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + if (root !== opt && root.$layer && root.$layer.is(e.relatedTarget)) { + root.$selected && root.$selected.trigger('contextmenu:blur'); + e.preventDefault(); + e.stopImmediatePropagation(); + root.$selected = opt.$selected = opt.$node; + return; + } + + $this.trigger('contextmenu:blur'); + }, + // contextMenu item click + itemClick: function(e) { + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot, + key = data.contextMenuKey, + callback; + + // abort if the key is unknown or disabled + if (!opt.items[key] || $this.hasClass('disabled')) { + return; + } + + e.preventDefault(); + e.stopImmediatePropagation(); + + if ($.isFunction(root.callbacks[key])) { + // item-specific callback + callback = root.callbacks[key]; + } else if ($.isFunction(root.callback)) { + // default callback + callback = root.callback; + } else { + // no callback, no action + return; + } + + // hide menu if callback doesn't stop that + if (callback.call(root.$trigger, key, root) !== false) { + root.$menu.trigger('contextmenu:hide'); + } else { + op.update.call(root.$trigger, root); + } + }, + // ignore click events on input elements + inputClick: function(e) { + e.stopImmediatePropagation(); + }, + + // hide <menu> + hideMenu: function(e) { + var root = $(this).data('contextMenuRoot'); + op.hide.call(root.$trigger, root); + }, + // focus <command> + focusItem: function(e) { + e.stopPropagation(); + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + $this.addClass('hover') + .siblings('.hover').trigger('contextmenu:blur'); + + // remember selected + opt.$selected = root.$selected = $this; + + // position sub-menu - do after show so dumb $.ui.position can keep up + if (opt.$node) { + root.positionSubmenu.call(opt.$node, opt.$menu); + } + }, + // blur <command> + blurItem: function(e) { + e.stopPropagation(); + var $this = $(this), + data = $this.data(), + opt = data.contextMenu, + root = data.contextMenuRoot; + + $this.removeClass('hover'); + opt.$selected = null; + } + }, + // operations + op = { + show: function(opt, x, y) { + var $this = $(this), + offset, + css = {}; + + // hide any open menus + $('#context-menu-layer').trigger('mousedown'); + + // show event + if (opt.events.show.call($this, opt) === false) { + $currentTrigger = null; + return; + } + + // backreference for callbacks + opt.$trigger = $this; + + // create or update context menu + op.update.call($this, opt); + + // position menu + opt.position.call($this, opt, x, y); + + // make sure we're in front + if (opt.zIndex) { + css.zIndex = zindex($this) + opt.zIndex; + } + + // add layer + op.layer.call(opt.$menu, opt, css.zIndex); + + // adjust sub-menu zIndexes + opt.$menu.find('ul').css('zIndex', css.zIndex + 1); + + // position and show context menu + opt.$menu.css( css )[opt.animation.show](opt.animation.duration); + // make options available + $this.data('contextMenu', opt); + // register key handler + $(document).off('keydown.contextMenu').on('keydown.contextMenu', handle.key); + // register autoHide handler + if (opt.autoHide) { + // trigger element coordinates + var pos = $this.position(); + pos.right = pos.left + $this.outerWidth(); + pos.bottom = pos.top + this.outerHeight(); + // mouse position handler + $(document).on('mousemove.contextMenuAutoHide', function(e) { + if (opt.$layer && !opt.hovering && (!(e.pageX >= pos.left && e.pageX <= pos.right) || !(e.pageY >= pos.top && e.pageY <= pos.bottom))) { + // if mouse in menu...¦ + opt.$layer.trigger('mousedown'); + } + }); + } + }, + hide: function(opt) { + var $this = $(this); + if (!opt) { + opt = $this.data('contextMenu') || {}; + } + + // hide event + if (opt.events && opt.events.hide.call($this, opt) === false) { + return; + } + + if (opt.$layer) { + try { + opt.$layer.remove(); + delete opt.$layer; + } catch(e) { + opt.$layer = null; + } + } + + // remove handle + $currentTrigger = null; + // remove selected + opt.$menu.find('.hover').trigger('contextmenu:blur'); + opt.$selected = null; + // unregister key and mouse handlers + //$(document).off('.contextMenuAutoHide keydown.contextMenu'); // http://bugs.jquery.com/ticket/10705 + $(document).off('.contextMenuAutoHide').off('keydown.contextMenu'); + // hide menu + opt.$menu && opt.$menu[opt.animation.hide](opt.animation.duration); + + // tear down dynamically built menu + if (opt.build) { + opt.$menu.remove(); + $.each(opt, function(key, value) { + switch (key) { + case 'ns': + case 'selector': + case 'build': + case 'trigger': + case 'ignoreRightClick': + return true; + + default: + opt[key] = undefined; + try { + delete opt[key]; + } catch (e) {} + return true; + } + }); + } + }, + create: function(opt, root) { + if (root === undefined) { + root = opt; + } + // create contextMenu + opt.$menu = $('<ul class="context-menu-list ' + (opt.className || "") + '"></ul>').data({ + 'contextMenu': opt, + 'contextMenuRoot': root + }); + + $.each(['callbacks', 'commands', 'inputs'], function(i,k){ + opt[k] = {}; + if (!root[k]) { + root[k] = {}; + } + }); + + root.accesskeys || (root.accesskeys = {}); + + // create contextMenu items + $.each(opt.items, function(key, item){ + var $t = $('<li class="context-menu-item ' + (item.className || "") +'"></li>'), + $label = null, + $input = null; + + item.$node = $t.data({ + 'contextMenu': opt, + 'contextMenuRoot': root, + 'contextMenuKey': key + }); + + // register accesskey + // NOTE: the accesskey attribute should be applicable to any element, but Safari5 and Chrome13 still can't do that + if (item.accesskey) { + var aks = splitAccesskey(item.accesskey); + for (var i=0, ak; ak = aks[i]; i++) { + if (!root.accesskeys[ak]) { + root.accesskeys[ak] = item; + item._name = item.name.replace(new RegExp('(' + ak + ')', 'i'), '<span class="context-menu-accesskey">$1</span>'); + break; + } + } + } + + if (typeof item == "string") { + $t.addClass('context-menu-separator not-selectable'); + } else if (item.type && types[item.type]) { + // run custom type handler + types[item.type].call($t, item, opt, root); + // register commands + $.each([opt, root], function(i,k){ + k.commands[key] = item; + if ($.isFunction(item.callback)) { + k.callbacks[key] = item.callback; + } + }); + } else { + // add label for input + if (item.type == 'html') { + $t.addClass('context-menu-html not-selectable'); + } else if (item.type) { + $label = $('<label></label>').appendTo($t); + $('<span></span>').html(item._name || item.name).appendTo($label); + $t.addClass('context-menu-input'); + opt.hasTypes = true; + $.each([opt, root], function(i,k){ + k.commands[key] = item; + k.inputs[key] = item; + }); + } else if (item.items) { + item.type = 'sub'; + } + + switch (item.type) { + case 'text': + $input = $('<input type="text" value="1" name="context-menu-input-'+ key +'" value="">') + .val(item.value || "").appendTo($label); + break; + + case 'textarea': + $input = $('<textarea name="context-menu-input-'+ key +'"></textarea>') + .val(item.value || "").appendTo($label); + + if (item.height) { + $input.height(item.height); + } + break; + + case 'checkbox': + $input = $('<input type="checkbox" value="1" name="context-menu-input-'+ key +'" value="">') + .val(item.value || "").prop("checked", !!item.selected).prependTo($label); + break; + + case 'radio': + $input = $('<input type="radio" value="1" name="context-menu-input-'+ item.radio +'" value="">') + .val(item.value || "").prop("checked", !!item.selected).prependTo($label); + break; + + case 'select': + $input = $('<select name="context-menu-input-'+ key +'">').appendTo($label); + if (item.options) { + $.each(item.options, function(value, text) { + $('<option></option>').val(value).text(text).appendTo($input); + }); + $input.val(item.selected); + } + break; + + case 'sub': + $('<span></span>').html(item._name || item.name).appendTo($t); + item.appendTo = item.$node; + op.create(item, root); + $t.data('contextMenu', item).addClass('context-menu-submenu'); + item.callback = null; + break; + + case 'html': + $(item.html).appendTo($t); + break; + + default: + $.each([opt, root], function(i,k){ + k.commands[key] = item; + if ($.isFunction(item.callback)) { + k.callbacks[key] = item.callback; + } + }); + + $('<span></span>').html(item._name || item.name || "").appendTo($t); + break; + } + + // disable key listener in <input> + if (item.type && item.type != 'sub' && item.type != 'html') { + $input + .on('focus', handle.focusInput) + .on('blur', handle.blurInput); + + if (item.events) { + $input.on(item.events); + } + } + + // add icons + if (item.icon) { + $t.addClass("icon icon-" + item.icon); + } + } + + // cache contained elements + item.$input = $input; + item.$label = $label; + + // attach item to menu + $t.appendTo(opt.$menu); + + // Disable text selection + if (!opt.hasTypes) { + if($.browser.msie) { + $t.on('selectstart.disableTextSelect', handle.abortevent); + } else if(!$.browser.mozilla) { + $t.on('mousedown.disableTextSelect', handle.abortevent); + } + } + }); + // attach contextMenu to <body> (to bypass any possible overflow:hidden issues on parents of the trigger element) + if (!opt.$node) { + opt.$menu.css('display', 'none').addClass('context-menu-root'); + } + opt.$menu.appendTo(opt.appendTo || document.body); + }, + update: function(opt, root) { + var $this = this; + if (root === undefined) { + root = opt; + // determine widths of submenus, as CSS won't grow them automatically + // position:absolute > position:absolute; min-width:100; max-width:200; results in width: 100; + // kinda sucks hard... + opt.$menu.find('ul').andSelf().css({position: 'static', display: 'block'}).each(function(){ + var $this = $(this); + $this.width($this.css('position', 'absolute').width()) + .css('position', 'static'); + }).css({position: '', display: ''}); + } + // re-check disabled for each item + opt.$menu.children().each(function(){ + var $item = $(this), + key = $item.data('contextMenuKey'), + item = opt.items[key], + disabled = ($.isFunction(item.disabled) && item.disabled.call($this, key, root)) || item.disabled === true; + + // dis- / enable item + $item[disabled ? 'addClass' : 'removeClass']('disabled'); + + if (item.type) { + // dis- / enable input elements + $item.find('input, select, textarea').prop('disabled', disabled); + + // update input states + switch (item.type) { + case 'text': + case 'textarea': + item.$input.val(item.value || ""); + break; + + case 'checkbox': + case 'radio': + item.$input.val(item.value || "").prop('checked', !!item.selected); + break; + + case 'select': + item.$input.val(item.selected || ""); + break; + } + } + + if (item.$menu) { + // update sub-menu + op.update.call($this, item, root); + } + }); + }, + layer: function(opt, zIndex) { + // add transparent layer for click area + // filter and background for Internet Explorer, Issue #23 + return opt.$layer = $('<div id="context-menu-layer" style="position:fixed; z-index:' + zIndex + '; top:0; left:0; opacity: 0; filter: alpha(opacity=0); background-color: #000;"></div>') + .css({height: $win.height(), width: $win.width(), display: 'block'}) + .data('contextMenuRoot', opt) + .insertBefore(this) + .on('mousedown', handle.layerClick); + } + }; + +// split accesskey according to http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#assigned-access-key +function splitAccesskey(val) { + var t = val.split(/\s+/), + keys = []; + + for (var i=0, k; k = t[i]; i++) { + k = k[0].toUpperCase(); // first character only + // theoretically non-accessible characters should be ignored, but different systems, different keyboard layouts, ... screw it. + // a map to look up already used access keys would be nice + keys.push(k); + } + + return keys; +} + +// handle contextMenu triggers +$.fn.contextMenu = function(operation) { + if (operation === undefined) { + this.first().trigger('contextmenu'); + } else if (operation.x && operation.y) { + this.first().trigger(jQuery.Event("contextmenu", {pageX: operation.x, pageY: operation.y})); + } else if (operation === "hide") { + var $menu = this.data('contextMenu').$menu; + $menu && $menu.trigger('contextmenu:hide'); + } else if (operation) { + this.removeClass('context-menu-disabled'); + } else if (!operation) { + this.addClass('context-menu-disabled'); + } + + return this; +}; + +// manage contextMenu instances +$.contextMenu = function(operation, options) { + if (typeof operation != 'string') { + options = operation; + operation = 'create'; + } + + if (typeof options == 'string') { + options = {selector: options}; + } else if (options === undefined) { + options = {}; + } + + // merge with default options + var o = $.extend(true, {}, defaults, options || {}), + $body = $body = $(document); + + switch (operation) { + case 'create': + // no selector no joy + if (!o.selector) { + throw new Error('No selector specified'); + } + // make sure internal classes are not bound to + if (o.selector.match(/.context-menu-(list|item|input)($|\s)/)) { + throw new Error('Cannot bind to selector "' + o.selector + '" as it contains a reserved className'); + } + if (!o.build && (!o.items || $.isEmptyObject(o.items))) { + throw new Error('No Items sepcified'); + } + counter ++; + o.ns = '.contextMenu' + counter; + namespaces[o.selector] = o.ns; + menus[o.ns] = o; + + if (!initialized) { + // make sure item click is registered first + $body + .on({ + 'contextmenu:hide.contextMenu': handle.hideMenu, + 'prevcommand.contextMenu': handle.prevItem, + 'nextcommand.contextMenu': handle.nextItem, + 'contextmenu.contextMenu': handle.abortevent, + 'mouseenter.contextMenu': handle.menuMouseenter, + 'mouseleave.contextMenu': handle.menuMouseleave + }, '.context-menu-list') + .on('mouseup.contextMenu', '.context-menu-input', handle.inputClick) + .on({ + 'mouseup.contextMenu': handle.itemClick, + 'contextmenu:focus.contextMenu': handle.focusItem, + 'contextmenu:blur.contextMenu': handle.blurItem, + 'contextmenu.contextMenu': handle.abortevent, + 'mouseenter.contextMenu': handle.itemMouseenter, + 'mouseleave.contextMenu': handle.itemMouseleave + }, '.context-menu-item'); + + initialized = true; + } + + // engage native contextmenu event + $body + .on('contextmenu' + o.ns, o.selector, o, handle.contextmenu); + + switch (o.trigger) { + case 'hover': + $body + .on('mouseenter' + o.ns, o.selector, o, handle.mouseenter) + .on('mouseleave' + o.ns, o.selector, o, handle.mouseleave); + break; + + case 'left': + $body.on('click' + o.ns, o.selector, o, handle.click); + break; + /* + default: + // http://www.quirksmode.org/dom/events/contextmenu.html + $body + .on('mousedown' + o.ns, o.selector, o, handle.mousedown) + .on('mouseup' + o.ns, o.selector, o, handle.mouseup); + break; + */ + } + + if (o.trigger != 'hover' && o.ignoreRightClick) { + $body.on('mousedown' + o.ns, o.selector, handle.ignoreRightClick); + } + + // create menu + if (!o.build) { + op.create(o); + } + break; + + case 'destroy': + if (!o.selector) { + $body.off('.contextMenu .contextMenuAutoHide'); + $.each(namespaces, function(key, value) { + $body.off(value); + }); + + namespaces = {}; + menus = {}; + counter = 0; + initialized = false; + + $('.context-menu-list').remove(); + } else if (namespaces[o.selector]) { + try { + if (menus[namespaces[o.selector]].$menu) { + menus[namespaces[o.selector]].$menu.remove(); + } + + delete menus[namespaces[o.selector]]; + } catch(e) { + menus[namespaces[o.selector]] = null; + } + + $body.off(namespaces[o.selector]); + } + break; + + case 'html5': + // if <command> or <menuitem> are not handled by the browser, + // or options was a bool true, + // initialize $.contextMenu for them + if ((!$.support.htmlCommand && !$.support.htmlMenuitem) || (typeof options == "boolean" && options)) { + $('menu[type="context"]').each(function() { + if (this.id) { + $.contextMenu({ + selector: '[contextmenu=' + this.id +']', + items: $.contextMenu.fromMenu(this) + }); + } + }).css('display', 'none'); + } + break; + + default: + throw new Error('Unknown operation "' + operation + '"'); + } + + return this; +}; + +// import values into <input> commands +$.contextMenu.setInputValues = function(opt, data) { + if (data === undefined) { + data = {}; + } + + $.each(opt.inputs, function(key, item) { + switch (item.type) { + case 'text': + case 'textarea': + item.value = data[key] || ""; + break; + + case 'checkbox': + item.selected = data[key] ? true : false; + break; + + case 'radio': + item.selected = (data[item.radio] || "") == item.value ? true : false; + break; + + case 'select': + item.selected = data[key] || ""; + break; + } + }); +}; + +// export values from <input> commands +$.contextMenu.getInputValues = function(opt, data) { + if (data === undefined) { + data = {}; + } + + $.each(opt.inputs, function(key, item) { + switch (item.type) { + case 'text': + case 'textarea': + case 'select': + data[key] = item.$input.val(); + break; + + case 'checkbox': + data[key] = item.$input.prop('checked'); + break; + + case 'radio': + if (item.$input.prop('checked')) { + data[item.radio] = item.value; + } + break; + } + }); + + return data; +}; + +// find <label for="xyz"> +function inputLabel(node) { + return (node.id && $('label[for="'+ node.id +'"]').val()) || node.name; +} + +// convert <menu> to items object +function menuChildren(items, $children, counter) { + if (!counter) { + counter = 0; + } + + $children.each(function() { + var $node = $(this), + node = this, + nodeName = this.nodeName.toLowerCase(), + label, + item; + + // extract <label><input> + if (nodeName == 'label' && $node.find('input, textarea, select').length) { + label = $node.text(); + $node = $node.children().first(); + node = $node.get(0); + nodeName = node.nodeName.toLowerCase(); + } + + /* + * <menu> accepts flow-content as children. that means <embed>, <canvas> and such are valid menu items. + * Not being the sadistic kind, $.contextMenu only accepts: + * <command>, <menuitem>, <hr>, <span>, <p> <input [text, radio, checkbox]>, <textarea>, <select> and of course <menu>. + * Everything else will be imported as an html node, which is not interfaced with contextMenu. + */ + + // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#concept-command + switch (nodeName) { + // http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#the-menu-element + case 'menu': + item = {name: $node.attr('label'), items: {}}; + menuChildren(item.items, $node.children(), counter); + break; + + // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-a-element-to-define-a-command + case 'a': + // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-button-element-to-define-a-command + case 'button': + item = { + name: $node.text(), + disabled: !!$node.attr('disabled'), + callback: (function(){ return function(){ $node.click(); }; })() + }; + break; + + // http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#using-the-command-element-to-define-a-command + + case 'menuitem': + case 'command': + switch ($node.attr('type')) { + case undefined: + case 'command': + case 'menuitem': + item = { + name: $node.attr('label'), + disabled: !!$node.attr('disabled'), + callback: (function(){ return function(){ $node.click(); }; })() + }; + break; + + case 'checkbox': + item = { + type: 'checkbox', + disabled: !!$node.attr('disabled'), + name: $node.attr('label'), + selected: !!$node.attr('checked') + }; + break; + + case 'radio': + item = { + type: 'radio', + disabled: !!$node.attr('disabled'), + name: $node.attr('label'), + radio: $node.attr('radiogroup'), + value: $node.attr('id'), + selected: !!$node.attr('checked') + }; + break; + + default: + item = undefined; + } + break; + + case 'hr': + item = '-------'; + break; + + case 'input': + switch ($node.attr('type')) { + case 'text': + item = { + type: 'text', + name: label || inputLabel(node), + disabled: !!$node.attr('disabled'), + value: $node.val() + }; + break; + + case 'checkbox': + item = { + type: 'checkbox', + name: label || inputLabel(node), + disabled: !!$node.attr('disabled'), + selected: !!$node.attr('checked') + }; + break; + + case 'radio': + item = { + type: 'radio', + name: label || inputLabel(node), + disabled: !!$node.attr('disabled'), + radio: !!$node.attr('name'), + value: $node.val(), + selected: !!$node.attr('checked') + }; + break; + + default: + item = undefined; + break; + } + break; + + case 'select': + item = { + type: 'select', + name: label || inputLabel(node), + disabled: !!$node.attr('disabled'), + selected: $node.val(), + options: {} + }; + $node.children().each(function(){ + item.options[this.value] = $(this).text(); + }); + break; + + case 'textarea': + item = { + type: 'textarea', + name: label || inputLabel(node), + disabled: !!$node.attr('disabled'), + value: $node.val() + }; + break; + + case 'label': + break; + + default: + item = {type: 'html', html: $node.clone(true)}; + break; + } + + if (item) { + counter++; + items['key' + counter] = item; + } + }); +} + +// convert html5 menu +$.contextMenu.fromMenu = function(element) { + var $this = $(element), + items = {}; + + menuChildren(items, $this.children()); + + return items; +}; + +// make defaults accessible +$.contextMenu.defaults = defaults; +$.contextMenu.types = types; + +})(jQuery); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.ui.position.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.ui.position.js new file mode 100644 index 0000000000000000000000000000000000000000..d7295b1fb42f0ef4c539a6b74bfdf8e32084b768 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jq.context/jquery.ui.position.js @@ -0,0 +1,252 @@ +/* + * jQuery UI Position 1.8.13 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var horizontalPositions = /left|center|right/, + verticalPositions = /top|center|bottom/, + center = "center", + _position = $.fn.position, + _offset = $.fn.offset; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var target = $( options.of ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ], + targetWidth, + targetHeight, + basePosition; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: 0, left: 0 }; + // TODO: use $.isWindow() in 1.9 + } else if ( targetElem.setTimeout ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + basePosition = { top: options.of.pageY, left: options.of.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + basePosition = target.offset(); + } + + // force my and at to have valid horizontal and veritcal positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[this] || "" ).split( " " ); + if ( pos.length === 1) { + pos = horizontalPositions.test( pos[0] ) ? + pos.concat( [center] ) : + verticalPositions.test( pos[0] ) ? + [ center ].concat( pos ) : + [ center, center ]; + } + pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center; + pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center; + options[ this ] = pos; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + // normalize offset option + offset[ 0 ] = parseInt( offset[0], 10 ) || 0; + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + offset[ 1 ] = parseInt( offset[1], 10 ) || 0; + + if ( options.at[0] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[0] === center ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[1] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[1] === center ) { + basePosition.top += targetHeight / 2; + } + + basePosition.left += offset[ 0 ]; + basePosition.top += offset[ 1 ]; + + return this.each(function() { + var elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, + marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, + collisionWidth = elemWidth + marginLeft + + ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ), + collisionHeight = elemHeight + marginTop + + ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ), + position = $.extend( {}, basePosition ), + collisionPosition; + + if ( options.my[0] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[0] === center ) { + position.left -= elemWidth / 2; + } + + if ( options.my[1] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[1] === center ) { + position.top -= elemHeight / 2; + } + + // prevent fractions (see #5280) + position.left = Math.round( position.left ); + position.top = Math.round( position.top ); + + collisionPosition = { + left: position.left - marginLeft, + top: position.top - marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[i] ] ) { + $.ui.position[ collision[i] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: offset, + my: options.my, + at: options.at + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + elem.offset( $.extend( position, { using: options.using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(); + position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left ); + }, + top: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(); + position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top ); + } + }, + + flip: { + left: function( position, data ) { + if ( data.at[0] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(), + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + -data.targetWidth, + offset = -2 * data.offset[ 0 ]; + position.left += data.collisionPosition.left < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + }, + top: function( position, data ) { + if ( data.at[1] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(), + myOffset = data.my[ 1 ] === "top" ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + -data.targetHeight, + offset = -2 * data.offset[ 1 ]; + position.top += data.collisionPosition.top < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + } + } +}; + +// offset setter from jQuery 1.4 +if ( !$.offset.setOffset ) { + $.offset.setOffset = function( elem, options ) { + // set position first, in-case top/left are set even on static elem + if ( /static/.test( $.curCSS( elem, "position" ) ) ) { + elem.style.position = "relative"; + } + var curElem = $( elem ), + curOffset = curElem.offset(), + curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0, + curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0, + props = { + top: (options.top - curOffset.top) + curTop, + left: (options.left - curOffset.left) + curLeft + }; + + if ( 'using' in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + }; + + $.fn.offset = function( options ) { + var elem = this[ 0 ]; + if ( !elem || !elem.ownerDocument ) { return null; } + if ( options ) { + return this.each(function() { + $.offset.setOffset( this, options ); + }); + } + return _offset.call( this ); + }; +} + +}( jQuery )); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jquery.planize.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jquery.planize.js new file mode 100644 index 0000000000000000000000000000000000000000..4cda67e3260a31788058c4eb6317e72c4ec3ce14 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/jquery.planize.js @@ -0,0 +1,148 @@ +/** + * The planize jQuery plugin adds some features for dealing with hierarchical headings in a given DOM element. + * + * - adds enumerations and anchors in all headings, + * - can generates an HTML table of content and append it to an existing DOM element, + * - in an unobstrusive way. + * + * Example of use: + * + * $('html *').planize(); + * + * Configuration object parameters documentation: + * - add_anchors : generates anchors for each header (automatically set to true if `generate_toc` is set to true) + * - callback : a function called when processing is finished + * - debug : prints pretty debug messages into the firebug or opera console, if available + * - generate_toc : generates an html unordered list containing the table of content of the document + * - min_level : min heading level needed to be included in toc and be renumbered (0 = all headings) + * - max_level : max heading level needed to be included in toc and be renumbered (0 = all headings) + * - number_suffix : heading identifier suffix, eg. ')' in "1.2.3)" + * - number_separator : separator for numbers, eg. '.' in "1.2.3)" + * - toc_elem : the dom element where the toc will be append + * - toc_none : the message to display if no headings have been found in the current document + * - toc_title : the title of the table of content + * + * @requires jQuery v1.2 or higher + * @author Nicolas Perriault <nperriault _at_ gmail _dot_ com> + * @license MIT (http://www.opensource.org/licenses/mit-license.php) + * @param Object config Plugin configuration + * @return jQuery(this) + * + */ +(function(jQuery){ + + jQuery.fn.planize = function(config) { + + var self = jQuery(this); + var processed = false; + var toc = ''; + var defaultConfig = { + add_anchors : false, + callback : null, + debug : false, + generate_toc : false, + min_level : 1, + max_level : 6, + number_suffix : '', + number_separator : '.', + toc_elem : null, + toc_none : 'No heading found for this document', + toc_title : 'Table of contents' + }; + config = jQuery.extend(defaultConfig, config); + + /** + * Prepends all headers text with the current tree number reference + + * @return void + */ + var process = function() { + var level = 0; + var levels = [0,0,0,0,0,0,0]; + var hLevelText = ''; + var prependText = ''; + var prevLevel = 0; + var n = 0; + self.children('*:header:visible').each(function(index, heading) { + log('Processing heading %o', heading); + level = parseInt(heading.tagName.substring(1)); + if (config.min_level <= level && level <= config.max_level) { + n++; + levels[level]++; + for (var l = 1; l <= level; l++) { + hLevelText += levels[l] > 0 ? levels[l] + config.number_separator : ''; + } + levels[level + 1] = 0; + hLevelText = hLevelText.substring(0, hLevelText.length - 1); + prependText = hLevelText; + if (config.generate_toc || config.add_anchors) { + if (config.generate_toc) { + var link = '<a href="#h' + hLevelText + '">' +jQuery('<span/>').text(jQuery(this).text()).html() + '</a>'; + var elem = "\n"+'<li>' + hLevelText + (config.number_suffix ? config.number_suffix : '') + ' ' + link; + if (level < prevLevel) { + log(hLevelText + ', unnesting because:' + level + '<' + prevLevel); + var unnest = ''; + while (level < prevLevel) { + unnest += '</ul>'; + prevLevel--; + } + toc += unnest + elem + '</li>'; + } else if (level > prevLevel) { + log(hLevelText + ', nesting because:' + level + '>' + prevLevel); + toc += '<ul>' + elem; + } else { + log(hLevelText + ', same level (' + level + ')'); + toc += elem; + } + } + prependText = '<span id="h' + hLevelText + '"></span>' + hLevelText; + } + if (config.number_suffix) { + prependText += config.number_suffix; + } + jQuery(this).prepend(prependText + ' '); + prependText = hLevelText = ''; + prevLevel = level; + } + }); + + if (config.generate_toc) { + if (config.toc_title) { + toc = '<h4>' + config.toc_title + '</h4>' + toc; + } + if (n == 0) { + toc += config.toc_none ? '<p>' + config.toc_none + '</p>' : ''; + } + jQuery(config.toc_elem ? config.toc_elem : 'body').append(toc); + } + + processed = true; + }; + + /** + * Logs a message into the firebug or opera console if available + * + */ + var log = function() { + if (!config.debug) { + return; + } + try { + console.log.apply(console, arguments); + } catch(e) { + try { + opera.postError.apply(opera, arguments); + } catch(e){} + } + } + + process(); + + if (config.callback) { + config.callback(config.toc_elem); + } + + return jQuery(this); + }; + +})(jQuery); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/nav_bg.png b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/nav_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..fe526a7500ddf9f5f31c4c5c015a74c12983f8f7 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/nav_bg.png differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/prettify.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/prettify.css new file mode 100644 index 0000000000000000000000000000000000000000..51746db1504164dfda45531bf6c2f0a7391a5d7b --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/prettify.css @@ -0,0 +1,52 @@ +/* Pretty printing styles. Used with prettify.js. */ + +.str { color: #080; } +.kwd { color: #008; } +.com { color: #800; } +.typ { color: #606; } +.lit { color: #066; } +.pun { color: #660; } +.pln { color: #000; } +.tag { color: #008; } +.atn { color: #606; } +.atv { color: #080; } +.dec { color: #606; } +/*pre.prettyprint { padding: 2px; border: 1px solid #888 }*/ +pre.prettyprint { + padding: 2px; + border: 1px dashed #888; +/* margin-left: 30px; + margin-right: 10px; + background-color: #f0f0f0;*/ + overflow: auto; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L5, +li.L6, +li.L7, +li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { background: #eee } + +@media print { + .str { color: #060; } + .kwd { color: #006; font-weight: bold; } + .com { color: #600; font-style: italic; } + .typ { color: #404; font-weight: bold; } + .lit { color: #044; } + .pun { color: #440; } + .pln { color: #000; } + .tag { color: #006; font-weight: bold; } + .atn { color: #404; } + .atv { color: #060; } +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/prettify.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/prettify.js new file mode 100644 index 0000000000000000000000000000000000000000..c9161da9b8ad1eb4a8c90773755c3677697f6551 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/prettify.js @@ -0,0 +1,33 @@ +window.PR_SHOULD_USE_CONTINUATION=true;window.PR_TAB_WIDTH=8;window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void 0;window._pr_isIE6=function(){var y=navigator&&navigator.userAgent&&navigator.userAgent.match(/\bMSIE ([678])\./);y=y?+y[1]:false;window._pr_isIE6=function(){return y};return y}; +(function(){function y(b){return b.replace(L,"&").replace(M,"<").replace(N,">")}function H(b,f,i){switch(b.nodeType){case 1:var o=b.tagName.toLowerCase();f.push("<",o);var l=b.attributes,n=l.length;if(n){if(i){for(var r=[],j=n;--j>=0;)r[j]=l[j];r.sort(function(q,m){return q.name<m.name?-1:q.name===m.name?0:1});l=r}for(j=0;j<n;++j){r=l[j];r.specified&&f.push(" ",r.name.toLowerCase(),'="',r.value.replace(L,"&").replace(M,"<").replace(N,">").replace(X,"""),'"')}}f.push(">"); +for(l=b.firstChild;l;l=l.nextSibling)H(l,f,i);if(b.firstChild||!/^(?:br|link|img)$/.test(o))f.push("</",o,">");break;case 3:case 4:f.push(y(b.nodeValue));break}}function O(b){function f(c){if(c.charAt(0)!=="\\")return c.charCodeAt(0);switch(c.charAt(1)){case "b":return 8;case "t":return 9;case "n":return 10;case "v":return 11;case "f":return 12;case "r":return 13;case "u":case "x":return parseInt(c.substring(2),16)||c.charCodeAt(1);case "0":case "1":case "2":case "3":case "4":case "5":case "6":case "7":return parseInt(c.substring(1), +8);default:return c.charCodeAt(1)}}function i(c){if(c<32)return(c<16?"\\x0":"\\x")+c.toString(16);c=String.fromCharCode(c);if(c==="\\"||c==="-"||c==="["||c==="]")c="\\"+c;return c}function o(c){var d=c.substring(1,c.length-1).match(RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));c=[];for(var a=[],k=d[0]==="^",e=k?1:0,h=d.length;e<h;++e){var g=d[e];switch(g){case "\\B":case "\\b":case "\\D":case "\\d":case "\\S":case "\\s":case "\\W":case "\\w":c.push(g); +continue}g=f(g);var s;if(e+2<h&&"-"===d[e+1]){s=f(d[e+2]);e+=2}else s=g;a.push([g,s]);if(!(s<65||g>122)){s<65||g>90||a.push([Math.max(65,g)|32,Math.min(s,90)|32]);s<97||g>122||a.push([Math.max(97,g)&-33,Math.min(s,122)&-33])}}a.sort(function(v,w){return v[0]-w[0]||w[1]-v[1]});d=[];g=[NaN,NaN];for(e=0;e<a.length;++e){h=a[e];if(h[0]<=g[1]+1)g[1]=Math.max(g[1],h[1]);else d.push(g=h)}a=["["];k&&a.push("^");a.push.apply(a,c);for(e=0;e<d.length;++e){h=d[e];a.push(i(h[0]));if(h[1]>h[0]){h[1]+1>h[0]&&a.push("-"); +a.push(i(h[1]))}}a.push("]");return a.join("")}function l(c){for(var d=c.source.match(RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),a=d.length,k=[],e=0,h=0;e<a;++e){var g=d[e];if(g==="(")++h;else if("\\"===g.charAt(0))if((g=+g.substring(1))&&g<=h)k[g]=-1}for(e=1;e<k.length;++e)if(-1===k[e])k[e]=++n;for(h=e=0;e<a;++e){g=d[e];if(g==="("){++h;if(k[h]===undefined)d[e]="(?:"}else if("\\"=== +g.charAt(0))if((g=+g.substring(1))&&g<=h)d[e]="\\"+k[h]}for(h=e=0;e<a;++e)if("^"===d[e]&&"^"!==d[e+1])d[e]="";if(c.ignoreCase&&r)for(e=0;e<a;++e){g=d[e];c=g.charAt(0);if(g.length>=2&&c==="[")d[e]=o(g);else if(c!=="\\")d[e]=g.replace(/[a-zA-Z]/g,function(s){s=s.charCodeAt(0);return"["+String.fromCharCode(s&-33,s|32)+"]"})}return d.join("")}for(var n=0,r=false,j=false,q=0,m=b.length;q<m;++q){var t=b[q];if(t.ignoreCase)j=true;else if(/[a-z]/i.test(t.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, +""))){r=true;j=false;break}}var p=[];q=0;for(m=b.length;q<m;++q){t=b[q];if(t.global||t.multiline)throw Error(""+t);p.push("(?:"+l(t)+")")}return RegExp(p.join("|"),j?"gi":"g")}function Y(b){var f=0;return function(i){for(var o=null,l=0,n=0,r=i.length;n<r;++n)switch(i.charAt(n)){case "\t":o||(o=[]);o.push(i.substring(l,n));l=b-f%b;for(f+=l;l>=0;l-=16)o.push(" ".substring(0,l));l=n+1;break;case "\n":f=0;break;default:++f}if(!o)return i;o.push(i.substring(l));return o.join("")}}function I(b, +f,i,o){if(f){b={source:f,c:b};i(b);o.push.apply(o,b.d)}}function B(b,f){var i={},o;(function(){for(var r=b.concat(f),j=[],q={},m=0,t=r.length;m<t;++m){var p=r[m],c=p[3];if(c)for(var d=c.length;--d>=0;)i[c.charAt(d)]=p;p=p[1];c=""+p;if(!q.hasOwnProperty(c)){j.push(p);q[c]=null}}j.push(/[\0-\uffff]/);o=O(j)})();var l=f.length;function n(r){for(var j=r.c,q=[j,z],m=0,t=r.source.match(o)||[],p={},c=0,d=t.length;c<d;++c){var a=t[c],k=p[a],e=void 0,h;if(typeof k==="string")h=false;else{var g=i[a.charAt(0)]; +if(g){e=a.match(g[1]);k=g[0]}else{for(h=0;h<l;++h){g=f[h];if(e=a.match(g[1])){k=g[0];break}}e||(k=z)}if((h=k.length>=5&&"lang-"===k.substring(0,5))&&!(e&&typeof e[1]==="string")){h=false;k=P}h||(p[a]=k)}g=m;m+=a.length;if(h){h=e[1];var s=a.indexOf(h),v=s+h.length;if(e[2]){v=a.length-e[2].length;s=v-h.length}k=k.substring(5);I(j+g,a.substring(0,s),n,q);I(j+g+s,h,Q(k,h),q);I(j+g+v,a.substring(v),n,q)}else q.push(j+g,k)}r.d=q}return n}function x(b){var f=[],i=[];if(b.tripleQuotedStrings)f.push([A,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, +null,"'\""]);else b.multiLineStrings?f.push([A,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):f.push([A,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]);b.verbatimStrings&&i.push([A,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);if(b.hashComments)if(b.cStyleComments){f.push([C,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]);i.push([A,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, +null])}else f.push([C,/^#[^\r\n]*/,null,"#"]);if(b.cStyleComments){i.push([C,/^\/\/[^\r\n]*/,null]);i.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}b.regexLiterals&&i.push(["lang-regex",RegExp("^"+Z+"(/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/)")]);b=b.keywords.replace(/^\s+|\s+$/g,"");b.length&&i.push([R,RegExp("^(?:"+b.replace(/\s+/g,"|")+")\\b"),null]);f.push([z,/^\s+/,null," \r\n\t\u00a0"]);i.push([J,/^@[a-z_$][a-z_$@0-9]*/i,null],[S,/^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, +null],[z,/^[a-z_$][a-z_$@0-9]*/i,null],[J,/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],[E,/^.[^\s\w\.$@\'\"\`\/\#]*/,null]);return B(f,i)}function $(b){function f(D){if(D>r){if(j&&j!==q){n.push("</span>");j=null}if(!j&&q){j=q;n.push('<span class="',j,'">')}var T=y(p(i.substring(r,D))).replace(e?d:c,"$1 ");e=k.test(T);n.push(T.replace(a,s));r=D}}var i=b.source,o=b.g,l=b.d,n=[],r=0,j=null,q=null,m=0,t=0,p=Y(window.PR_TAB_WIDTH),c=/([\r\n ]) /g, +d=/(^| ) /gm,a=/\r\n?|\n/g,k=/[ \r\n]$/,e=true,h=window._pr_isIE6();h=h?b.b.tagName==="PRE"?h===6?" \r\n":h===7?" <br>\r":" \r":" <br />":"<br />";var g=b.b.className.match(/\blinenums\b(?::(\d+))?/),s;if(g){for(var v=[],w=0;w<10;++w)v[w]=h+'</li><li class="L'+w+'">';var F=g[1]&&g[1].length?g[1]-1:0;n.push('<ol class="linenums"><li class="L',F%10,'"');F&&n.push(' value="',F+1,'"');n.push(">");s=function(){var D=v[++F%10];return j?"</span>"+D+'<span class="'+j+'">':D}}else s=h; +for(;;)if(m<o.length?t<l.length?o[m]<=l[t]:true:false){f(o[m]);if(j){n.push("</span>");j=null}n.push(o[m+1]);m+=2}else if(t<l.length){f(l[t]);q=l[t+1];t+=2}else break;f(i.length);j&&n.push("</span>");g&&n.push("</li></ol>");b.a=n.join("")}function u(b,f){for(var i=f.length;--i>=0;){var o=f[i];if(G.hasOwnProperty(o))"console"in window&&console.warn("cannot override language handler %s",o);else G[o]=b}}function Q(b,f){b&&G.hasOwnProperty(b)||(b=/^\s*</.test(f)?"default-markup":"default-code");return G[b]} +function U(b){var f=b.f,i=b.e;b.a=f;try{var o,l=f.match(aa);f=[];var n=0,r=[];if(l)for(var j=0,q=l.length;j<q;++j){var m=l[j];if(m.length>1&&m.charAt(0)==="<"){if(!ba.test(m))if(ca.test(m)){f.push(m.substring(9,m.length-3));n+=m.length-12}else if(da.test(m)){f.push("\n");++n}else if(m.indexOf(V)>=0&&m.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,' $1="$2$3$4"').match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)){var t=m.match(W)[2],p=1,c;c=j+1;a:for(;c<q;++c){var d=l[c].match(W);if(d&& +d[2]===t)if(d[1]==="/"){if(--p===0)break a}else++p}if(c<q){r.push(n,l.slice(j,c+1).join(""));j=c}else r.push(n,m)}else r.push(n,m)}else{var a;p=m;var k=p.indexOf("&");if(k<0)a=p;else{for(--k;(k=p.indexOf("&#",k+1))>=0;){var e=p.indexOf(";",k);if(e>=0){var h=p.substring(k+3,e),g=10;if(h&&h.charAt(0)==="x"){h=h.substring(1);g=16}var s=parseInt(h,g);isNaN(s)||(p=p.substring(0,k)+String.fromCharCode(s)+p.substring(e+1))}}a=p.replace(ea,"<").replace(fa,">").replace(ga,"'").replace(ha,'"').replace(ia," ").replace(ja, +"&")}f.push(a);n+=a.length}}o={source:f.join(""),h:r};var v=o.source;b.source=v;b.c=0;b.g=o.h;Q(i,v)(b);$(b)}catch(w){if("console"in window)console.log(w&&w.stack?w.stack:w)}}var A="str",R="kwd",C="com",S="typ",J="lit",E="pun",z="pln",P="src",V="nocode",Z=function(){for(var b=["!","!=","!==","#","%","%=","&","&&","&&=","&=","(","*","*=","+=",",","-=","->","/","/=",":","::",";","<","<<","<<=","<=","=","==","===",">",">=",">>",">>=",">>>",">>>=","?","@","[","^","^=","^^","^^=","{","|","|=","||","||=", +"~","break","case","continue","delete","do","else","finally","instanceof","return","throw","try","typeof"],f="(?:^^|[+-]",i=0;i<b.length;++i)f+="|"+b[i].replace(/([^=<>:&a-z])/g,"\\$1");f+=")\\s*";return f}(),L=/&/g,M=/</g,N=/>/g,X=/\"/g,ea=/</g,fa=/>/g,ga=/'/g,ha=/"/g,ja=/&/g,ia=/ /g,ka=/[\r\n]/g,K=null,aa=RegExp("[^<]+|<!--[\\s\\S]*?--\>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|</?[a-zA-Z](?:[^>\"']|'[^']*'|\"[^\"]*\")*>|<","g"),ba=/^<\!--/,ca=/^<!\[CDATA\[/,da=/^<br\b/i,W=/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/, +la=x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename using virtual wchar_t where break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof debugger eval export function get null set undefined var with Infinity NaN caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END break continue do else for if return while case done elif esac eval fi function in local set then until ", +hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true}),G={};u(la,["default-code"]);u(B([],[[z,/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup", +"htm","html","mxml","xhtml","xml","xsl"]);u(B([[z,/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i], +["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);u(B([],[["atv",/^[\s\S]+/]]),["uq.val"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename using virtual wchar_t where ", +hashComments:true,cStyleComments:true}),["c","cc","cpp","cxx","cyc","m"]);u(x({keywords:"null true false"}),["json"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ", +hashComments:true,cStyleComments:true,verbatimStrings:true}),["cs"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof abstract boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ", +cStyleComments:true}),["java"]);u(x({keywords:"break continue do else for if return while case done elif esac eval fi function in local set then until ",hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);u(x({keywords:"break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]); +u(x({keywords:"caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);u(x({keywords:"break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",hashComments:true, +multiLineStrings:true,regexLiterals:true}),["rb"]);u(x({keywords:"break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof debugger eval export function get null set undefined var with Infinity NaN ",cStyleComments:true,regexLiterals:true}),["js"]);u(B([],[[A,/^[\s\S]+/]]), +["regex"]);window.PR_normalizedHtml=H;window.prettyPrintOne=function(b,f){var i={f:b,e:f};U(i);return i.a};window.prettyPrint=function(b){function f(){for(var t=window.PR_SHOULD_USE_CONTINUATION?j.now()+250:Infinity;q<o.length&&j.now()<t;q++){var p=o[q];if(p.className&&p.className.indexOf("prettyprint")>=0){var c=p.className.match(/\blang-(\w+)\b/);if(c)c=c[1];for(var d=false,a=p.parentNode;a;a=a.parentNode)if((a.tagName==="pre"||a.tagName==="code"||a.tagName==="xmp")&&a.className&&a.className.indexOf("prettyprint")>= +0){d=true;break}if(!d){a=p;if(null===K){d=document.createElement("PRE");d.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));K=!/</.test(d.innerHTML)}if(K){d=a.innerHTML;if("XMP"===a.tagName)d=y(d);else{a=a;if("PRE"===a.tagName)a=true;else if(ka.test(d)){var k="";if(a.currentStyle)k=a.currentStyle.whiteSpace;else if(window.getComputedStyle)k=window.getComputedStyle(a,null).whiteSpace;a=!k||k==="pre"}else a=true;a||(d=d.replace(/(<br\s*\/?>)[\r\n]+/g,"$1").replace(/(?:[\r\n]+[ \t]*)+/g, +" "))}d=d}else{d=[];for(a=a.firstChild;a;a=a.nextSibling)H(a,d);d=d.join("")}d=d.replace(/(?:\r\n?|\n)$/,"");m={f:d,e:c,b:p};U(m);if(p=m.a){c=m.b;if("XMP"===c.tagName){d=document.createElement("PRE");for(a=0;a<c.attributes.length;++a){k=c.attributes[a];if(k.specified)if(k.name.toLowerCase()==="class")d.className=k.value;else d.setAttribute(k.name,k.value)}d.innerHTML=p;c.parentNode.replaceChild(d,c)}else c.innerHTML=p}}}}if(q<o.length)setTimeout(f,250);else b&&b()}for(var i=[document.getElementsByTagName("pre"), +document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],o=[],l=0;l<i.length;++l)for(var n=0,r=i[l].length;n<r;++n)o.push(i[l][n]);i=null;var j=Date;j.now||(j={now:function(){return(new Date).getTime()}});var q=0,m;f()};window.PR={combinePrefixPatterns:O,createSimpleLexer:B,registerLangHandler:u,sourceDecorator:x,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:C,PR_DECLARATION:"dec",PR_KEYWORD:R,PR_LITERAL:J,PR_NOCODE:V,PR_PLAIN:z,PR_PUNCTUATION:E,PR_SOURCE:P,PR_STRING:A, +PR_TAG:"tag",PR_TYPE:S}})() \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-api.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-api.html new file mode 100644 index 0000000000000000000000000000000000000000..affc7ba17ae6be92e94bbf52521dd6c9920ec94a --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-api.html @@ -0,0 +1,250 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + // Initialize the tree inside the <div>element. + // The tree structure is read from the contained <ul> tag. + $("#tree").dynatree({ + title: "Programming Sample", + onActivate: function(node) { + $("#echoActive").text(node.data.title); +// alert(node.getKeyPath()); + if( node.data.url ) + window.open(node.data.url, node.data.target); + }, + onDeactivate: function(node) { + $("#echoSelected").text("-"); + }, + onFocus: function(node) { + $("#echoFocused").text(node.data.title); + }, + onBlur: function(node) { + $("#echoFocused").text("-"); + }, + onLazyRead: function(node){ + var fakeJsonResult = [ + { title: 'Lazy node 1', isLazy: true }, + { title: 'Simple node 2', select: true } + ]; +// alert ("Let's pretend we're using this AJAX response to load the branch:\n " + jsonResult); + function fakeAjaxResponse() { + return function() { + node.addChild(fakeJsonResult); + // Remove the 'loading...' status: + node.setLazyNodeStatus(DTNodeStatus_Ok); + }; + } + window.setTimeout(fakeAjaxResponse(), 1500); + } + }); + + $("#btnAddCode").click(function(){ + // Sample: add an hierarchic branch using code. + // This is how we would add tree nodes programatically + var rootNode = $("#tree").dynatree("getRoot"); + var childNode = rootNode.addChild({ + title: "Programatically addded nodes", + tooltip: "This folder and all child nodes were added programmatically.", + isFolder: true + }); + childNode.addChild({ + title: "Document using a custom icon", + icon: "customdoc1.gif" + }); + }); + + $("#btnAddObject").click(function(){ + // Sample: add an hierarchic branch using an array + var obj = [ + { title: 'Lazy node 1', isLazy: true }, + { title: 'Lazy node 2', isLazy: true }, + { title: 'Folder node 3', isFolder: true, + children: [ + { title: 'node 3.1' }, + { title: 'node 3.2', + children: [ + { title: 'node 3.2.1' }, + { title: 'node 3.2.2', + children: [ + { title: 'node 3.2.2.1' } + ] + } + ] + } + ] + } + ]; + $("#tree").dynatree("getRoot").addChild(obj); + }); + + $("#btnActiveNode").click(function(){ + $("#tree").dynatree("getTree").activateKey("id4.3.2"); +// $("#tree").dynatree("getTree").getNodeByKey("id4.3.2").activate(); + }); + $("#btnSetTitle").click(function(){ + var node = $("#tree").dynatree("getActiveNode"); + if( !node ) return; + node.setTitle(node.data.title + ", " + new Date()); + // this is a shortcut for + // node.fromDict({title: node.data.title + new Date()}); + }); + $("#btnFromDict").click(function(){ + var node = $("#tree").dynatree("getActiveNode"); + if( !node ) return; +// alert(JSON.stringify(node.toDict(true))); + // Set node data and - optionally - replace children + node.fromDict({ + title: node.data.title + new Date(), + children: [{title: "t1"}, {title: "t2"}] + }); + }); + + $("#btnShowActive").click(function(){ + var node = $("#tree").dynatree("getActiveNode"); + if( node ){ + alert("Currently active: " + node.data.title); + }else{ + alert("No active node."); + } + }); + + $("#btnDisable").toggle(function(){ + $("#tree").dynatree("disable"); + $(this).text("Enable"); + return false; + }, function(){ + $("#tree").dynatree("enable"); + $(this).text("Disable"); + return false; + }); + $("#btnToggleExpand").click(function(){ + $("#tree").dynatree("getRoot").visit(function(node){ + node.toggleExpand(); + }); + return false; + }); + $("#btnCollapseAll").click(function(){ + $("#tree").dynatree("getRoot").visit(function(node){ + node.expand(false); + }); + return false; + }); + $("#btnExpandAll").click(function(){ + $("#tree").dynatree("getRoot").visit(function(node){ + node.expand(true); + }); + return false; + }); + $("#btnSortActive").click(function(){ + var node = $("#tree").dynatree("getActiveNode"); + // Custom compare function (optional) that sorts case insensitive + var cmp = function(a, b) { + a = a.data.title.toLowerCase(); + b = b.data.title.toLowerCase(); + return a > b ? 1 : a < b ? -1 : 0; + }; + node.sortChildren(cmp, false); + }); + $("#btnSortAll").click(function(){ + var node = $("#tree").dynatree("getRoot"); + node.sortChildren(null, true); + }); + }); +</script> +</head> + +<body class="example"> + <h1>Dynatree API</h1> + <p class="description"> + This example demonstrates the usage of some DynaTree and DynaTreeNode + API functions. + </p> + + <p> + <a href="#" id="btnExpandAll">Expand all</a> - + <a href="#" id="btnCollapseAll">Collapse all</a> - + <a href="#" id="btnToggleExpand">Toggle expand</a> + <br> + <a href="#" id="btnSortAll">Sort tree</a> + <a href="#" id="btnSortActive">Sort current node</a> + <br> + <a href="#" id="btnDisable">Disable</a> + </p> + <div id="tree"> + <ul> + <li>This simple node (and the following) have been created from html. + <li id="id1" title="This is item #1">item1 with key and tooltip + <li id="id2">item2 with key 'id2' + + <li id="id3" class="folder">Standard Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <li id="id3.2">Sub-item 3.2 + </ul> + + <li id="id4">item 4. Note that also non-folders (i.e. 'documents') may have child nodes + <ul> + <li id="id4.1">Sub-item 4.1 + <li id="id4.2">Sub-item 4.2 + <li id="id4.3">Sub-item 4.3 + <ul> + <li id="id4.3.1">Sub-item 4.3.1 + <li id="id4.3.2">Sub-item 4.3.2 + <ul> + <li id="id4.3.2.1">Sub-item 4.3.2.1 + <li id="id4.3.2.2">Sub-item 4.3.2.2 + </ul> + </ul> + <li id="id4.4">Sub-item 4.4 + </ul> + + <li id="id5" class="expanded folder">Advanced examples + <ul> + <li data="key: 'node5.1'">item5.1: Using data attribute as an alternative way to specify a key. + <li data="key: 'node5.3', isFolder: true">item5.1: Using data attribute as an alternative way to specify a folder. + <li id="id5.2">Sub-item 5.2 + <li>Item without a key. Keys are optional (generated automatically), but may be used in the callbacks + </ul> + </ul> + </div> + + <div>Active node: <span id="echoActive">-</span></div> + <div>Focused node: <span id="echoFocused">-</span></div> + <p> + <button id="btnAddCode">Add nodes programmatically</button> + <button id="btnAddObject">Add nodes using arrays</button> + <button id="btnActiveNode">Activate item id4.3.2</button> + <button id="btnShowActive">Show active node...</button> + <button id="btnSetTitle">Set active node title</button> + <button id="btnFromDict">Modify active node fom dict</button> + </p> + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu.html new file mode 100644 index 0000000000000000000000000000000000000000..cb3f56b7c205a183adefa6112f5b736ba2ff59ae --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu.html @@ -0,0 +1,253 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> +<!-- + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + --> + <link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" /> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js" type="text/javascript"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js" type="text/javascript"></script> + + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- jquery.contextmenu, A Beautiful Site (http://abeautifulsite.net/) --> + <script src="contextmenu/jquery.contextMenu-custom.js" type="text/javascript"></script> + <link href="contextmenu/jquery.contextMenu.css" rel="stylesheet" type="text/css" > + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + + <script type="text/javascript"> + + // --- Implement Cut/Copy/Paste -------------------------------------------- + var clipboardNode = null; + var pasteMode = null; + + function copyPaste(action, node) { + switch( action ) { + case "cut": + case "copy": + clipboardNode = node; + pasteMode = action; + break; + case "paste": + if( !clipboardNode ) { + alert("Clipoard is empty."); + break; + } + if( pasteMode == "cut" ) { + // Cut mode: check for recursion and remove source + var isRecursive = false; + var cb = clipboardNode.toDict(true, function(dict){ + // If one of the source nodes is the target, we must not move + if( dict.key == node.data.key ) + isRecursive = true; + }); + if( isRecursive ) { + alert("Cannot move a node to a sub node."); + return; + } + node.addChild(cb); + clipboardNode.remove(); + } else { + // Copy mode: prevent duplicate keys: + var cb = clipboardNode.toDict(true, function(dict){ + dict.title = "Copy of " + dict.title; + delete dict.key; // Remove key, so a new one will be created + }); + node.addChild(cb); + } + clipboardNode = pasteMode = null; + break; + default: + alert("Unhandled clipboard action '" + action + "'"); + } + }; + + // --- Contextmenu helper -------------------------------------------------- + function bindContextMenu(span) { + // Add context menu to this node: + $(span).contextMenu({menu: "myMenu"}, function(action, el, pos) { + // The event was bound to the <span> tag, but the node object + // is stored in the parent <li> tag + var node = $.ui.dynatree.getNode(el); + switch( action ) { + case "cut": + case "copy": + case "paste": + copyPaste(action, node); + break; + default: + alert("Todo: appply action '" + action + "' to node " + node); + } + }); + }; + + // --- Init dynatree during startup ---------------------------------------- + + $(function(){ + + $("#tree").dynatree({ + persist: true, + onActivate: function(node) { + $("#echoActivated").text(node.data.title + ", key=" + node.data.key); + }, + onClick: function(node, event) { + // Close menu on click + if( $(".contextMenu:visible").length > 0 ){ + $(".contextMenu").hide(); +// return false; + } + }, + onKeydown: function(node, event) { + // Eat keyboard events, when a menu is open + if( $(".contextMenu:visible").length > 0 ) + return false; + + switch( event.which ) { + + // Open context menu on [Space] key (simulate right click) + case 32: // [Space] + $(node.span).trigger("mousedown", { + preventDefault: true, + button: 2 + }) + .trigger("mouseup", { + preventDefault: true, + pageX: node.span.offsetLeft, + pageY: node.span.offsetTop, + button: 2 + }); + return false; + + // Handle Ctrl-C, -X and -V + case 67: + if( event.ctrlKey ) { // Ctrl-C + copyPaste("copy", node); + return false; + } + break; + case 86: + if( event.ctrlKey ) { // Ctrl-V + copyPaste("paste", node); + return false; + } + break; + case 88: + if( event.ctrlKey ) { // Ctrl-X + copyPaste("cut", node); + return false; + } + break; + } + }, + /*Bind context menu for every node when it's DOM element is created. + We do it here, so we can also bind to lazy nodes, which do not + exist at load-time. (abeautifulsite.net menu control does not + support event delegation)*/ + onCreate: function(node, span){ + bindContextMenu(span); + }, + /*Load lazy content (to show that context menu will work for new items too)*/ + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + }, + /* D'n'd, just to show it's compatible with a context menu. + See http://code.google.com/p/dynatree/issues/detail?id=174 */ + dnd: { + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragStart: function(node) { + return true; + }, + onDragEnter: function(node, sourceNode) { + if(node.parent !== sourceNode.parent) + return false; + return ["before", "after"]; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + sourceNode.move(node, hitMode); + } + } + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: Context Menu</h1> + <p class="description"> + Implementation of a context menu. Right-click a node and see what happens.<br> + Also [space] key is supported to open the menu.<br> + <br> + This example also demonstrates, how to copy or move branches and how + to implement clipboard functionality. + <br> + A keyboard handler implements Cut, Copy, and Paste with <code>Ctrl-X</code>, + <code>Ctrl-C</code>, <code>Ctrl-V</code>. + </p> + <p class="description"> + This sample uses the jQuery Context Menu Plugin by Cory S.N. LaViska. + Visit <a href="http://abeautifulsite.net/">A Beautiful Site</a> for usage and more information. + <br> + <b>NOTE:</b></br> + I had to <a href="http://code.google.com/p/dynatree/issues/detail?id=174">patch Cory's code</a> in order to make it work. Please understand, that I am not able to support this plugin. There are many other context menus + out there :-) + </p> + + <!-- Definition of context menu --> + <ul id="myMenu" class="contextMenu"> + <li class="edit"><a href="#edit">Edit</a></li> + <li class="cut separator"><a href="#cut">Cut</a></li> + <li class="copy"><a href="#copy">Copy</a></li> + <li class="paste"><a href="#paste">Paste</a></li> + <li class="delete"><a href="#delete">Delete</a></li> + <li class="quit separator"><a href="#quit">Quit</a></li> + </ul> + + <!-- Definition tree structure --> + <div id="tree"> + <ul> + <li id="id1" title="Look, a tool tip!">item1 with key and tooltip + <li id="id2" class="activate">item2: activated on init + <li id="id3" class="folder">Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <li id="id3.2">Sub-item 3.2 + </ul> + + <li id="id4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="id4.1">Sub-item 4.1 + <li id="id4.2">Sub-item 4.2 + </ul> + + <li id="id5" class="lazy folder">Lazy folder + </ul> + </div> + + <div>Selected node: <span id="echoActivated">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu2.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu2.html new file mode 100644 index 0000000000000000000000000000000000000000..a849f8bc8da357a587c37724ccd06ed9738c0e4f --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu2.html @@ -0,0 +1,249 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- jquery.contextmenu, A Beautiful Site (http://abeautifulsite.net/) --> + <!-- + <script src="contextmenu/jquery.contextMenu-custom.js" type="text/javascript"></script> + <link href="contextmenu/jquery.contextMenu.css" rel="stylesheet" type="text/css" > + --> + <!-- medialize jQuery contextMenu (http://github.com/medialize/jQuery-contextMenu) --> + <!-- + --> + <script src="jq.context/jquery.ui.position.js" type="text/javascript"></script> + <script src="jq.context/jquery.contextMenu.js" type="text/javascript"></script> + <link href="jq.context/jquery.contextMenu.css" rel="stylesheet" type="text/css" /> + + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + +// --- Implement Cut/Copy/Paste -------------------------------------------- +var clipboardNode = null; +var pasteMode = null; + +function copyPaste(action, node) { + switch( action ) { + case "cut": + case "copy": + clipboardNode = node; + pasteMode = action; + break; + case "paste": + if( !clipboardNode ) { + alert("Clipoard is empty."); + break; + } + if( pasteMode == "cut" ) { + // Cut mode: check for recursion and remove source + var isRecursive = false; + var cb = clipboardNode.toDict(true, function(dict){ + // If one of the source nodes is the target, we must not move + if( dict.key == node.data.key ) + isRecursive = true; + }); + if( isRecursive ) { + alert("Cannot move a node to a sub node."); + return; + } + node.addChild(cb); + clipboardNode.remove(); + } else { + // Copy mode: prevent duplicate keys: + var cb = clipboardNode.toDict(true, function(dict){ + dict.title = "Copy of " + dict.title; + delete dict.key; // Remove key, so a new one will be created + }); + node.addChild(cb); + } + clipboardNode = pasteMode = null; + break; + default: + alert("Unhandled clipboard action '" + action + "'"); + } +}; + +// --- Init dynatree during startup ---------------------------------------- + +$(function(){ + +$("#tree").dynatree({ + persist: true, + onActivate: function(node) { + $("#echoActivated").text(node.data.title + ", key=" + node.data.key); + }, + /* + onClick: function(node, event) { + // Close menu on click + if( $(".contextMenu:visible").length > 0 ){ + $(".contextMenu").hide(); +// return false; + } + }, + */ + onKeydown: function(node, event) { + // Eat keyboard events, when a menu is open + if( $(".contextMenu:visible").length > 0 ){ + return false; + } + switch( event.which ) { + + // Open context menu on [Space] key (simulate right click) + case 32: // [Space] + $("a", node.span).contextMenu(); + return false; + + // Handle Ctrl-C, -X and -V + case 67: + if( event.ctrlKey ) { // Ctrl-C + copyPaste("copy", node); + return false; + } + break; + case 86: + if( event.ctrlKey ) { // Ctrl-V + copyPaste("paste", node); + return false; + } + break; + case 88: + if( event.ctrlKey ) { // Ctrl-X + copyPaste("cut", node); + return false; + } + break; + } + }, + /*Load lazy content (to show that context menu will work for new items too)*/ + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + }, + /* D'n'd, just to show it's compatible with a context menu. + See http://code.google.com/p/dynatree/issues/detail?id=174 */ + dnd: { + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragStart: function(node) { + return true; + }, + onDragEnter: function(node, sourceNode) { + if(node.parent !== sourceNode.parent) + return false; + return ["before", "after"]; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + sourceNode.move(node, hitMode); + } + } +}); // $.dynatree +/* +$(document).on('contextmenu.contextMenu', function(e){ + alert("on contextmenu"); +}); +*/ + +// jQuery contextMenu blocks mouse events, so we have to catch them in order to +// activate the node on click +$(document).on('mousedown.contextMenu', function(e){ + var node = $.ui.dynatree.getNode(e.target); + window.console && console.log("e: %o, node: %o", e, node); + node && node.activate(); +}); + +$.contextMenu({ + // bind menu to every dynatree node + selector: 'a.dynatree-title', + // called for every menu command + callback: function(cmd, options) { + var node = $.ui.dynatree.getNode(this); + window.console && console.log(cmd + " - " + node); + node.activate(); + copyPaste(cmd, node); + }, + items: { + "edit": {name: "Edit", icon: "edit"}, + "cut": {name: "Cut", icon: "cut"}, + "copy": {name: "Copy", icon: "copy"}, + "paste": {name: "Paste", icon: "paste"}, + "delete": {name: "Delete", icon: "delete"}, + "sep1": "---------", + "quit": {name: "Quit", icon: "quit"} + } +}); // $.contextMenu() + +}); // $(function){...} +</script> +</head> + +<body class="example"> + <h1>Example: Context Menu</h1> + <p class="description"> + Implementation of a context menu. Right-click a node and see what happens.<br> + Also [space] key is supported to open the menu.<br> + <br> + This example also demonstrates, how to copy or move branches and how + to implement clipboard functionality. + <br> + A keyboard handler implements Cut, Copy, and Paste with <code>Ctrl-X</code>, + <code>Ctrl-C</code>, <code>Ctrl-V</code>. + </p> + <p class="description"> + This sample uses the jQuery Context Menu Plugin by Rodney Rehm. + Visit <a href="http://medialize.github.com/jQuery-contextMenu/index.html">the project page at github</a> for usage and more information. + <br> + <b>NOTE:</b></br> + Please understand, that I am not able to support this plugin. There are many other context menus + out there :-) + </p> + + <!-- Definition tree structure --> + <div id="tree"> + <ul> + <li id="id1" title="Look, a tool tip!">item1 with key and tooltip + <li id="id2" class="activate">item2: activated on init + <li id="id3" class="folder">Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <li id="id3.2">Sub-item 3.2 + </ul> + + <li id="id4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="id4.1">Sub-item 4.1 + <li id="id4.2">Sub-item 4.2 + </ul> + + <li id="id5" class="lazy folder">Lazy folder + </ul> + </div> + + <div>Selected node: <span id="echoActivated">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu3.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu3.html new file mode 100644 index 0000000000000000000000000000000000000000..1147a07310c66654f4ae0058bc4b2b47748da67b --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-contextmenu3.html @@ -0,0 +1,245 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" /> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js" type="text/javascript"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js" type="text/javascript"></script> + + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- jquery-contextmenu (https://github.com/mar10/jquery-contextmenu/) --> + <script src="http://wwwendt.de/tech/demo/jquery-contextmenu/jquery.contextmenu.js" type="text/javascript"></script> + + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<style type="text/css"> +.ui-menu{ + min-width: 100px; +} +</style> + +<script type="text/javascript"> + +// --- Implement Cut/Copy/Paste -------------------------------------------- +var clipboardNode = null; +var pasteMode = null; + +function copyPaste(action, node) { + // Strip leading '#' + action = action.replace(/^#/, ""); + switch( action ) { + case "cut": + case "copy": + clipboardNode = node; + pasteMode = action; + break; + case "paste": + if( !clipboardNode ) { + alert("Clipoard is empty."); + break; + } + if( pasteMode == "cut" ) { + // Cut mode: check for recursion and remove source + var isRecursive = false; + var cb = clipboardNode.toDict(true, function(dict){ + // If one of the source nodes is the target, we must not move + if( dict.key == node.data.key ) + isRecursive = true; + }); + if( isRecursive ) { + alert("Cannot move a node to a sub node."); + return; + } + node.addChild(cb); + clipboardNode.remove(); + } else { + // Copy mode: prevent duplicate keys: + var cb = clipboardNode.toDict(true, function(dict){ + dict.title = "Copy of " + dict.title; + delete dict.key; // Remove key, so a new one will be created + }); + node.addChild(cb); + } + clipboardNode = pasteMode = null; + break; + default: + alert("Unhandled clipboard action '" + action + "'"); + } +}; + +// --- Init dynatree during startup ---------------------------------------- + +$(function(){ + +$("#tree").dynatree({ + persist: true, + onActivate: function(node) { + $("#echoActivated").text(node.data.title + ", key=" + node.data.key); + }, + onKeydown: function(node, event) { + // Eat keyboard events, when a menu is open + if( $(".contextMenu:visible").length > 0 ){ + return false; + } + switch( event.which ) { + + // Open context menu on [Space] key (simulate right click) + case 32: // [Space] + $("#tree").contextmenu("open", $(".dynatree-title", node.span)); + return false; + + // Handle Ctrl-C, -X and -V + case 67: + if( event.ctrlKey ) { // Ctrl-C + copyPaste("copy", node); + return false; + } + break; + case 86: + if( event.ctrlKey ) { // Ctrl-V + copyPaste("paste", node); + return false; + } + break; + case 88: + if( event.ctrlKey ) { // Ctrl-X + copyPaste("cut", node); + return false; + } + break; + } + }, + /*Load lazy content (to show that context menu will work for new items too)*/ + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + }, + /* D'n'd, just to show it's compatible with a context menu. + See http://code.google.com/p/dynatree/issues/detail?id=174 */ + dnd: { + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragStart: function(node) { + return true; + }, + onDragEnter: function(node, sourceNode) { + if(node.parent !== sourceNode.parent) + return false; + return ["before", "after"]; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + sourceNode.move(node, hitMode); + } + } +}); // $.dynatree + +/* Enable the context menu for all node titles */ +$("#tree").contextmenu({ + delegate: ".dynatree-title", +// menu: "#menu", + menu: [ + {title: "Cut", cmd: "cut", uiIcon: "ui-icon-scissors"}, + {title: "Copy", cmd: "copy", uiIcon: "ui-icon-copy"}, + {title: "Paste", cmd: "paste", uiIcon: "ui-icon-clipboard", disabled: false }, + {title: "----"}, + {title: "Edit", cmd: "edit", uiIcon: "ui-icon-pencil", disabled: true }, + {title: "Delete", cmd: "delete", uiIcon: "ui-icon-trash", disabled: true }, + {title: "More", children: [ + {title: "Sub 1", cmd: "sub1"}, + {title: "Sub 2", cmd: "sub1"} + ]} + ], + select: function(event, ui) { + var cmd = ui.item.find(">a").attr("href"), + target = event.relatedTarget, + node = $.ui.dynatree.getNode(target); + window.console && console.log(cmd + " - " + node); + node.activate(); + copyPaste(cmd, node); + } +}); + +}); // $(function){...} +</script> +</head> + +<body class="example"> + <h1>Example: Context Menu</h1> + <p class="description"> + Implementation of a context menu. Right-click a node and see what happens.<br> + Also [space] key is supported to open the menu.<br> + <br> + This example also demonstrates, how to copy or move branches and how + to implement clipboard functionality. + <br> + A keyboard handler implements Cut, Copy, and Paste with <code>Ctrl-X</code>, + <code>Ctrl-C</code>, <code>Ctrl-V</code>. + </p> + <p class="description"> + <b>NOTE:</b><br> + This sample uses the jquery-contextmenu plugin (which in turn depends + on jQuery UI 1.9+). + Visit <a href="https://github.com/mar10/jquery-contextmenu/" target="_blank">the project page at github</a> for usage and more information. + <br> + Please understand, that this separate plugin is not part of dynatree. + Questions and bug reports should be directed there. + </p> + + <!-- Definition tree structure --> + <div id="tree"> + <ul> + <li id="id1" title="Look, a tool tip!">item1 with key and tooltip + <li id="id2" class="activate">item2: activated on init + <li id="id3" class="folder">Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <li id="id3.2">Sub-item 3.2 + </ul> + + <li id="id4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="id4.1">Sub-item 4.1 + <li id="id4.2">Sub-item 4.2 + </ul> + + <li id="id5" class="lazy folder">Lazy folder + </ul> + </div> + + <div>Selected node: <span id="echoActivated">-</span></div> + + <!-- Definition of the menu --> +<!-- + <ul id="menu" class="ui-helper-hidden"> + <li><a href="#cut"><span class="ui-icon ui-icon-scissors"></span>Cut</a></li> + <li><a href="#copy"><span class="ui-icon ui-icon-copy"></span>Copy</a></li> + <li><a href="#paste"><span class="ui-icon ui-icon-clipboard"></span>Paste</a></li> + <li>----</li> + <li><a href="#edit" class="ui-state-disabled"><span class="ui-icon ui-icon-pencil"></span>Edit</a></li> + <li><a href="#delete" class="ui-state-disabled"><span class="ui-icon ui-icon-trash"></span>Delete</a></li> + </ul> +--> + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data1.json b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data1.json new file mode 100644 index 0000000000000000000000000000000000000000..45dfb5e25213985b2b0378a9a8395515b191523b --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data1.json @@ -0,0 +1,16 @@ +[ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", + "children": [ + {"title": "Sub-item 2.1"}, + {"title": "Sub-item 2.2"} + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1"}, + {"title": "Sub-item 3.2"} + ] + }, + {"title": "Item 5"} +] diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data2.json b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data2.json new file mode 100644 index 0000000000000000000000000000000000000000..3d8ed34b4f6a03e802645258fea3366751b1fd9f --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data2.json @@ -0,0 +1 @@ +[ {"title": "SubItem 1", "isLazy": true }, {"title": "SubFolder 2", "isFolder": true, "isLazy": true } ] diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data3.json b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data3.json new file mode 100644 index 0000000000000000000000000000000000000000..ade994ca3e9a1b20fe1db3871d6d27bf6bf41b66 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-data3.json @@ -0,0 +1,41 @@ +[ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", "expand": true, + "children": [ + {"title": "Sub-item 2.1", + "children": [ + {"title": "Sub-item 2.1.1", + "children": [ + {"title": "Sub-item 2.1.1.1"}, + {"title": "Sub-item 2.1.2.2"}, + {"title": "Sub-item 2.1.1.3"}, + {"title": "Sub-item 2.1.2.4"} + ] + }, + {"title": "Sub-item 2.1.2"}, + {"title": "Sub-item 2.1.3"}, + {"title": "Sub-item 2.1.4"} + ] + }, + {"title": "Sub-item 2.2"}, + {"title": "Sub-item 2.3 (lazy)", "isLazy": true } + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1", + "children": [ + {"title": "Sub-item 3.1.1"}, + {"title": "Sub-item 3.1.2"}, + {"title": "Sub-item 3.1.3"}, + {"title": "Sub-item 3.1.4"} + ] + }, + {"title": "Sub-item 3.2"}, + {"title": "Sub-item 3.3"}, + {"title": "Sub-item 3.4"} + ] + }, + {"title": "Lazy Folder 4", "isFolder": true, "isLazy": true, "key": "folder4"}, + {"title": "Item 5"} +] diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-default.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-default.html new file mode 100644 index 0000000000000000000000000000000000000000..9b88b4ed2b4bf1b01710871d62a11de41f3e9d61 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-default.html @@ -0,0 +1,99 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + + <script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + // using default options + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> + }); + </script> +</head> + +<body class="example"> + <h1>Example: Default</h1> + <p class="description"> + This tree uses default options.<br> + It is initalized from a hidden <ul> element on this page. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <div id="tree"> + <ul id="treeData" style="display: none;"> + <li id="id1" title="Look, a tool tip!">item1 with key and tooltip + <li id="id2">item2 + <li id="id3" class="folder">Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <ul> + <li id="id3.1.1">Sub-item 3.1.1 + <li id="id3.1.2">Sub-item 3.1.2 + </ul> + <li id="id3.2">Sub-item 3.2 + <ul> + <li id="id3.2.1">Sub-item 3.2.1 + <li id="id3.2.2">Sub-item 3.2.2 + </ul> + </ul> + <li id="id4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="id4.1" class="active focused">Sub-item 4.1 (active and focus on init) + <ul> + <li id="id4.1.1">Sub-item 4.1.1 + <li id="id4.1.2">Sub-item 4.1.2 + </ul> + <li id="id4.2">Sub-item 4.2 + <ul> + <li id="id4.2.1">Sub-item 4.2.1 + <li id="id4.2.2">Sub-item 4.2.2 + </ul> + </ul> + </ul> + </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd.html new file mode 100644 index 0000000000000000000000000000000000000000..ac6a0e0874d17c116f40e51d32d519f5fd2ac81a --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd.html @@ -0,0 +1,92 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 750 // don't do thi in production code + }); + }, + dnd: { + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragStart: function(node) { + /** This function MUST be defined to enable dragging for the tree. + * Return false to cancel dragging of node. + */ + return true; + }, + onDragEnter: function(node, sourceNode) { + /** sourceNode may be null for non-dynatree droppables. + * Return false to disallow dropping on node. In this case + * onDragOver and onDragLeave are not called. + * Return 'over', 'before, or 'after' to force a hitMode. + * Return ['before', 'after'] to restrict available hitModes. + * Any other return value will calc the hitMode from the cursor position. + */ + // Prevent dropping a parent below another parent (only sort + // nodes under the same parent) + if(node.parent !== sourceNode.parent){ + return false; + } + // Don't allow dropping *over* a node (would create a child) + return ["before", "after"]; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + /** This function MUST be defined to enable dropping of items on + * the tree. + */ + sourceNode.move(node, hitMode); + } + } + }); +}); +--></script> +</head> + +<body class="example"> + <h1>Example: Sort nodes using drag-and-drop</h1> + <p class="description"> + This sample uses Dynatree's built-in drag-and-drop feature to move nodes.<br> + - A node may only be dragged under it's original parent.<br> + - When dropped, the node is moved to the target. + </p> + + <div id="tree"> </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd2.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd2.html new file mode 100644 index 0000000000000000000000000000000000000000..34db4d8f7ef7077bd3facef6c34b4e7934f24b10 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd2.html @@ -0,0 +1,125 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<style type="text/css"> + ul.dynatree-container { + overflow: scroll; + position: relative; + width: 200px; + height: 250px; + }; +</style> + +<script type="text/javascript"><!-- +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 750 // don't do this in production code + }); + }, + dnd: { + onDragStart: function(node) { + /** This function MUST be defined to enable dragging for the tree. + * Return false to cancel dragging of node. + */ + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + // This function is optional. + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + /** sourceNode may be null for non-dynatree droppables. + * Return false to disallow dropping on node. In this case + * onDragOver and onDragLeave are not called. + * Return 'over', 'before, or 'after' to force a hitMode. + * Return ['before', 'after'] to restrict available hitModes. + * Any other return value will calc the hitMode from the cursor position. + */ + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + /** Return false to disallow dropping this node. + * + */ + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + // Prevent dropping a parent below it's own child + if(node.isDescendantOf(sourceNode)){ + return false; + } + // Prohibit creating childs in non-folders (only sorting allowed) + if( !node.data.isFolder && hitMode === "over" ){ + return "after"; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + /** This function MUST be defined to enable dropping of items on + * the tree. + */ + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + // expand the drop target +// sourceNode.expand(true); + }, + onDragLeave: function(node, sourceNode) { + /** Always called if onDragEnter was called. + */ + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); +}); +--></script> +</head> + +<body class="example"> + <h1>Example: Move nodes using drag-and-drop</h1> + <p class="description"> + This sample uses Dynatree's built-in drag-and-drop feature to move nodes.<br> + - autoExpandMS option is used to expand nodes on mouse hover.<br> + - The container style uses `overflow: scroll` to demonstrate auto-scrolling.<br> + - When dropped, the node is moved to the target. + </p> + + <div id="tree"> </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd3.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd3.html new file mode 100644 index 0000000000000000000000000000000000000000..cc1975780df0633c69cc936cc20f27a8fc645758 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-dnd3.html @@ -0,0 +1,287 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> +<!-- + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript"></script> +--> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + #draggableSample, #droppableSample { + height:100px; + padding:0.5em; + width:150px; + border:1px solid #AAAAAA; + } + #draggableSample { + background-color: silver; + color:#222222; + } + #droppableSample { + background-color: maroon; + color: white; + } + #droppableSample.drophover { + border: 1px solid green; + } + </style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 750 // don't do thi in production code + }); + }, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + revert: false, // true: slide helper back to source if drop is rejected + onDragStart: function(node) { + /** This function MUST be defined to enable dragging for the tree. + * Return false to cancel dragging of node. + */ + logMsg("tree.onDragStart(%o)", node); + if(node.data.isFolder){ + return false; + } + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 750 // don't do thi in production code + }); + }, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + }, + dnd: { + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + /* sourceNode may be null for non-dynatree droppables. + * Return false to disallow dropping on node. In this case + * onDragOver and onDragLeave are not called. + * Return 'over', 'before, or 'after' to force a hitMode. + * Any other return value will calc the hitMode from the cursor position. + */ + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + // For the sake of this example deny dropping over folders + if(node.data.isFolder){ + return false; + } + return true; +// return "over"; + }, + onDragOver: function(node, sourceNode, hitMode) { + /* Return false to disallow dropping this node.*/ +// if(node.data.isFolder){ +// var dd = $.ui.ddmanager.current; +// dd.cancel(); +// alert("folder"); +// } + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + /* This function MUST be defined to enable dropping of items on the tree. + * sourceNode may be null, if it is a non-Dynatree droppable. + */ + logMsg("tree.onDrop(%o, %o)", node, sourceNode); + var copynode; + if(sourceNode) { + copynode = sourceNode.toDict(true, function(dict){ + dict.title = "Copy of " + dict.title; + delete dict.key; // Remove key, so a new one will be created + }); + }else{ + copynode = {title: "This node was dropped here (" + ui.helper + ")."}; + } + if(hitMode == "over"){ + // Append as child node + node.addChild(copynode); + // expand the drop target + node.expand(true); + }else if(hitMode == "before"){ + // Add before this, i.e. as child of current parent + node.parent.addChild(copynode, node); + }else if(hitMode == "after"){ + // Add after this, i.e. as child of current parent + node.parent.addChild(copynode, node.getNextSibling()); + } + }, + onDragLeave: function(node, sourceNode) { + /** Always called if onDragEnter was called. + */ + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize simple draggable sample ---------------------------------- + $("#draggableSample").draggable({ +// revert: "invalid", // slide back, when dropping over non-target + revert: function(dropped){ + // Return `true` to let the helper slide back. + if(typeof dropped === "boolean"){ + // dropped == true, when dropped over a simple, valid droppable target. + // false, when dropped outside a drop target. + return !dropped; + } + // Drop comes from another tree. Default behavior is to assume + // a valid drop, since we are over a drop-target. + // Therefore we have to make an extra check, if the target node + // was rejected by a Dynatree callback. + var helper = $.ui.ddmanager && $.ui.ddmanager.current && $.ui.ddmanager.current.helper; + var isRejected = helper && helper.hasClass("dynatree-drop-reject"); + return isRejected; + }, + connectToDynatree: true, + cursorAt: { top: -5, left:-5 }, + helper: "clone" + }); + // --- Initialize simple droppable sample ---------------------------------- + $("#droppableSample").droppable({ + hoverClass: "drophover", + addClasses: true, +// tolerance: "pointer", + over: function(event, ui) { + logMsg("droppable.over, %o, %o", event, ui); + }, + drop: function(event, ui) { + var source = ui.helper.data("dtSourceNode") || ui.draggable; + $(this).addClass("ui-state-highlight").find("p").html("Dropped " + source); +// alert("dropped"); + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>Example: Standard jQuery drag-and-drop</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <table> + <thead> + <tr> + <th> + <p>This tree allows dragging.</p> + </th> + <th> + <p>This tree allows dropping.</p> + </th> + </tr> + </thead> + <tbody> + <tr valign="top"> + <td> + <div id="tree"> </div> + </td> + <td> + <div id="tree2"></div> + </td> + </tr> + <tr> + <td> + <div>Active node: <span id="echoActive">-</span></div> + </td> + <td> + <div>Active node: <span id="echoActive2">-</span></div> + </td> + </tr> + <tr> + <td> + <div id="draggableSample" class="ui-widget-content"> + <p>Drag me around</p> + </div> + </td> + <td> + <div id="droppableSample" class="ui-widget-content"> + <p>Drop something here</p> + </div> + </td> + </tr> + </tbody> + </table> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-effects.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-effects.html new file mode 100644 index 0000000000000000000000000000000000000000..3416236533631fbaac133bd4bea5bb3ea6d2ef80 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-effects.html @@ -0,0 +1,124 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + fx: { height: "toggle", duration: 200 }, + autoCollapse: true, + onActivate: function(node) { + $("#echoActive").text(node.data.title); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + } + }); + $("#cbAutoCollapse") + .attr("checked", true) // set state, to prevent caching + .click(function(){ + var f = $(this).attr("checked"); + $("#tree").dynatree("option", "autoCollapse", f); + }); + $("#cbEffects") + .attr("checked", true) // set state, to prevent caching + .click(function(){ + var f = $(this).attr("checked"); + if(f){ + $("#tree").dynatree("option", "fx", { height: "toggle", duration: 200 }); + }else{ + $("#tree").dynatree("option", "fx", null); + } + }); + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: effects</h1> + <p class="description"> + This sample enables effects to expand/Collapse and sets the + <code>autoCollapse</code> option. + </p> + <div> + <input type="checkbox" id="cbAutoCollapse"><label for="cbAutoCollapse">Auto collapse</label> + - + <input type="checkbox" id="cbEffects"><label for="cbEffects">Use effects</label> + - + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + <div id="tree"> + <ul style="display: none;"> + <li id="id1" title="Look, a tool tip!">item1 with key and tooltip + <li id="id2">item2 + <li id="id3" class="folder">Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <ul> + <li id="id3.1.1">Sub-item 3.1.1 + <li id="id3.1.2">Sub-item 3.1.2 + </ul> + <li id="id3.2">Sub-item 3.2 + <ul> + <li id="id3.2.1">Sub-item 3.2.1 + <li id="id3.2.2">Sub-item 3.2.2 + </ul> + </ul> + <li id="id4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="id4.1" class="active focused">Sub-item 4.1 (active and focus on init) + <ul> + <li id="id4.1.1">Sub-item 4.1.1 + <li id="id4.1.2">Sub-item 4.1.2 + </ul> + <li id="id4.2">Sub-item 4.2 + <ul> + <li id="id4.2.1">Sub-item 4.2.1 + <li id="id4.2.2">Sub-item 4.2.2 + </ul> + </ul> + </ul> + </div> + <div>Active node: <span id="echoActive">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-empty.json b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-empty.json new file mode 100644 index 0000000000000000000000000000000000000000..719bd4d2732bf2288d7303c703119a54c24974da --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-empty.json @@ -0,0 +1 @@ +[ ] diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-events.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-events.html new file mode 100644 index 0000000000000000000000000000000000000000..81b64375f184b24d98bd0cd5f121b4dbe4783827 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-events.html @@ -0,0 +1,151 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + title: "Event samples", +// checkbox: true, +// persist: true, + onQueryActivate: function(activate, node) { + logMsg("onQueryActivate(%o, %o)", activate, node); +// return false; + }, + onActivate: function(node) { + logMsg("onActivate(%o)", node); + $("#echoActive").text(node.data.title); + if( node.data.url ) + window.open(node.data.url); + }, + onDeactivate: function(node) { + logMsg("onDeactivate(%o)", node); + $("#echoActive").text("-"); + }, + + onQuerySelect: function(select, node) { + logMsg("onQuerySelect(%o, %o)", select, node); + if( node.data.isFolder ) + return false; + }, + onSelect: function(select, node) { + logMsg("onSelect(%o, %o)", node); + var s = node.tree.getSelectedNodes().join(", "); + $("#echoSelected").text(s); + }, + + onQueryExpand: function(expand, node) { + logMsg("onQueryExpand(%o, %o)", expand, node); +// return false; + }, + onExpand: function(expand, node) { + logMsg("onExpand(%o, %o)", expand, node); + }, + + onLazyRead: function(node) { + logMsg("onLazyRead(%o)", node); + }, + + onFocus: function(node) { + logMsg("onFocus(%o)", node); + $("#echoFocused").text(node.data.title); + // Auto-activate focused node after 2 seconds + node.scheduleAction("activate", 2000); + }, + onBlur: function(node) { + logMsg("onBlur(%o)", node); + $("#echoFocused").text("-"); + }, + + onClick: function(node, event) { + logMsg("onClick(%o, %o)", node, event); + if( event.shiftKey && node.isLazy ) + alert("ctrl"); + //return false; + }, + onDblClick: function(node, event) { + logMsg("onDblClick(%o, %o)", node, event); + node.toggleSelect(); + }, + onKeydown: function(node, event) { + logMsg("onKeydown(%o, %o)", node, event); + switch( event.which ) { + case 32: // [space] + node.toggleSelect(); + return false; + } + }, + onKeypress: function(node, event) { + logMsg("onKeypress(%o, %o)", node, event); + } + }); + + }); +</script> +</head> + +<body class="example"> + <h1>Example: Events</h1> + <p class="description"> + Implements all callbacks.<br> + Use the Firebug plugin in Firefox to see the event log.<br> + The 'links' folders contain nodes with an custom data.url option. + This is used to open the URL in the onActivate event. <br> + Note: the lazy reading is not implemented in this example.<br> + A focused node will automatically be activated after 2 seconds (use the + keyboard to try this out). + </p> + + <div id="tree"> + <ul> + <li class="folder">jQuery links + <ul> + <li data="url: 'http://jquery.com'">jQuery home + <li data="url: 'http://docs.jquery.com'">jQuery docs + </ul> + + <li class="folder">Other links + <ul> + <li data="url: 'http://code.google.com'">Google Code + </ul> + + <li class="folder">Lazy loading + <ul> + <li id="k123" class="lazy">This is a lazy loading document with key k123. + <li id="k234" class="lazy folder">This is a lazy loading folder with key k234. + </ul> + </ul> + </div> + + <div>Active node: <span id="echoActive">-</span></div> + <div>Selected node list: <span id="echoSelected">-</span></div> + <div>Focused node: <span id="echoFocused">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-form.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-form.html new file mode 100644 index 0000000000000000000000000000000000000000..8140d535771d845ecf2fbe8a65fc05d3101afdce --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-form.html @@ -0,0 +1,113 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + + <!-- Add code to initialize the tree when the document is loaded: --> +<script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + checkbox: true, + // Override class name for checkbox icon, so rasio buttons are displayed: + //classNames: {checkbox: "dynatree-radio"}, + // Select mode 3: multi-hier + selectMode: 3, + children: [ + {title: "Item 1", key: "node1"}, + {title: "Folder 2", isFolder: true, key: "node2", + children: [ + {title: "Sub-item 2.1", key: "node2.1"}, + {title: "Sub-item 2.2", key: "node2.2"} + ] + }, + {title: "Item 3", key: "node3"} + ] + }); + $("form").submit(function() { + // Serialize standard form fields: + var formData = $(this).serializeArray(); + + // then append Dynatree selected 'checkboxes': + var tree = $("#tree").dynatree("getTree"); + formData = formData.concat(tree.serializeArray()); + + // and/or add the active node as 'radio button': + if(tree.getActiveNode()){ + formData.push({name: "activeNode", value: tree.getActiveNode().data.key}); + } + + alert("POSTing this:\n" + jQuery.param(formData)); + + $.post("http://127.0.0.1:8001/submit_data", + formData, + function(response, textStatus, xhr){ + alert("POST returned " + response + ", " + textStatus); + } + ); + return false; + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: Form</h1> + <p class="description"> + This checkbox tree is embedded in a form. + The [Submit] handler serializes the selected tree nodes as if they were + standard checkboxes.<br> + The values are then POSTed to the server (together with the other form + elements). + </p> + <!-- + <form action="http://127.0.0.1:8001/submit_data" method="POST"> + --> + <form> + Username: <input type="text" name="userName" /> + <br> + <textarea name="comment"></textarea> + <br> + <input type="radio" name="rb1" value="foo" checked> Foo + <input type="radio" name="rb1" value="bar"> Bar + <input type="radio" name="rb1" value="baz"> Baz + <br> + <input type="checkbox" name="cb1" value="John" checked>John + <input type="checkbox" name="cb1" value="Paul">Paul + <input type="checkbox" name="cb1" value="George">George + <input type="checkbox" name="cb1" value="Ringo">Ringo + <br> + + <!-- The name attribute is used by tree.serializeArray() --> + <div id="tree" name="selNodes"> + </div> + + <input type="submit" value="Send data"> + </form> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-iframe-1.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-iframe-1.html new file mode 100644 index 0000000000000000000000000000000000000000..c1ab81895b25b459f6c5716c6d8a142ad01929dc --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-iframe-1.html @@ -0,0 +1,43 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <meta name="robots" content="noindex,follow"> + + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + $(function(){ + $("#btnExpand").click(function(){ + var $tree = parent.$("#tree"); + var rootNode = parent.$("#tree").dynatree("getRoot"); + parent.logMsg("%o", rootNode); + parent.$("#tree").dynatree("getRoot").visit(function(node){ + node.toggleExpand(); + }); + }); + }); + </script> +</head> + +<body class="example"> + <p class="description"> + This page lives inside an iframe<br> + Click a link in the tree to load some content here. + <br> + This button demonstrates, ho to access a tree in another frame: + <button id="btnExpand">Toggle tree</button> + <br> + View the source of <a href="sample-iframe-1.html" target="_blank">this iframe content</a>, + to see how it can be done. + </p> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-iframe.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-iframe.html new file mode 100644 index 0000000000000000000000000000000000000000..e4b97831b05c39e3e5e90ce4f9f2a37f017fb0f6 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-iframe.html @@ -0,0 +1,124 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + + <style type="text/css"> + #tree { + vertical-align: top; + width: 250px; + } + iframe { + border: 1px dotted gray; + } + </style> + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + $(function(){ + // Attach the dynatree widget to an existing <div id="tree"> element + // and pass the tree options as an argument to the dynatree() function: + $("#tree").dynatree({ +// autoCollapse: true, + minExpandLevel: 1, +// persist: true, + onPostInit: function(isReloading, isError) { + this.reactivate(); + }, + onActivate: function(node) { + // Use <a> href and target attributes to load the content: + if( node.data.href ){ + // Open target + window.open(node.data.href, node.data.target); + // or open target in iframe +// $("[name=contentFrame]").attr("src", node.data.href); + } + } + }); + }); + </script> +</head> +<body class="example"> + <h1>Example: URL navigation and iframes</h1> + <p class="description"> + This sample shows, how to use dynatree as a navigation menu.<br> + The tree initialisation uses <code><a href='URL', target='TARGET'>title</a></code> + tags.<br> + The <code>onActivate</code> handler then uses <code>node.data.href</code> + to open the the pages in the embedded iframe.<br> + Note that the navigation will fallback to standard HTML links, + when JavaScript is disabled.<br> + <br> + The [Toggle tree] button in the embedded welcome page also gives an example on + how to access a tree that exists outside the own frame. + </p> + + <table> + <colgroup> + <col width="300px" valign="top"> + <col width="90%"> + </colgroup> + <tr> + <td valign="top"> + <!-- Add a <div> element where the tree should appear: --> + <div id="tree"> + <ul> + <li class="expanded folder">Search engines + <ul> + <li><a href="http://www.google.com" target="contentFrame">Google (target='contentFrame')</a> + <li><a href="http://www.google.com" target="_self">Google (target='_self')</a> + <li><a href="http://www.google.com" target="_top" title="This link replaces the current page">Google (target='_top')</a> + <li><a href="http://www.bing.com" target="contentFrame">Bing</a> + <li><a href="http://www.wolframalpha.com/" target="contentFrame">WolframAlpha</a> + </ul> + <li class="expanded folder">jQuery + <ul> + <li><a href="http://www.jquery.com/" target="contentFrame">jQuery</a> + <li><a href="http://ui.jquery.com/" target="contentFrame">jQuery UI</a> + <li><a href="http://api.jquery.com/" target="contentFrame">API browser</a> + <li><a href="http://code.google.com/p/dynatree/" target="contentFrame">Dynatree</a> + </ul> + <li class="expanded folder">Misc + <ul> + <li><a href="sample-iframe-1.html" target="contentFrame">Welcome</a> + </ul> + </ul> + </div> + </td> + + <td> + <iframe src="sample-iframe-1.html" name="contentFrame" width="100%" height="500" + scrolling="yes" marginheight="0" marginwidth="0" frameborder="0"> + <p>Your browser does not support iframes</p> + </iframe> + </td> + </tr> + </table> + + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-init-lazy.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-init-lazy.html new file mode 100644 index 0000000000000000000000000000000000000000..7381da1c3719558bafb473c3738455e877eed3db --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-init-lazy.html @@ -0,0 +1,66 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + // In real life we would call a URL on the server like this: +// initAjax: { +// url: "/getTopLevelNodesAsJson", +// data: { mode: "funnyMode" } +// }, + // .. but here we use a local file instead: + initAjax: { + url: "sample-data1.json" + }, + onActivate: function(node) { + $("#echoActive").text(node.data.title); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + } + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: Init from Ajax request</h1> + <p class="description"> + This sample initializes the tree from a JSON request. + </p> + + <!-- Add a <div> element where the tree should appear: --> + <div id="tree"> </div> + + <div>Active node: <span id="echoActive">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-inline-edit.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-inline-edit.html new file mode 100644 index 0000000000000000000000000000000000000000..a53d0cf964a3cc8ff0f8fda057a2b94760ab54bf --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-inline-edit.html @@ -0,0 +1,129 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Editable nodes</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> +/** + * Implement inline editing for a dynatree node + */ +function editNode(node){ + var prevTitle = node.data.title, + tree = node.tree; + // Disable dynatree mouse- and key handling + tree.$widget.unbind(); + // Replace node with <input> + $(".dynatree-title", node.span).html("<input id='editNode' value='" + prevTitle + "'>"); + // Focus <input> and bind keyboard handler + $("input#editNode") + .focus() + .keydown(function(event){ + switch( event.which ) { + case 27: // [esc] + // discard changes on [esc] + $("input#editNode").val(prevTitle); + $(this).blur(); + break; + case 13: // [enter] + // simulate blur to accept new value + $(this).blur(); + break; + } + }).blur(function(event){ + // Accept new value, when user leaves <input> + var title = $("input#editNode").val(); + node.setTitle(title); + // Re-enable mouse and keyboard handlling + tree.$widget.bind(); + node.focus(); + }); +} + +// ---------- + +$(function(){ + var isMac = /Mac/.test(navigator.platform); + $("#tree").dynatree({ + title: "Event samples", + onClick: function(node, event) { + if( event.shiftKey ){ + editNode(node); + return false; + } + }, + onDblClick: function(node, event) { + editNode(node); + return false; + }, + onKeydown: function(node, event) { + switch( event.which ) { + case 113: // [F2] + editNode(node); + return false; + case 13: // [enter] + if( isMac ){ + editNode(node); + return false; + } + } + } + }); +}); +</script> +</head> + +<body class="example"> + <h1>Example: edit nodes</h1> + <p class="description"> + Demos how to edit node titles with<br> + - dblclick<br> + - Shift + click<br> + - [F2]<br> + - [Enter] (on Mac)<br> + </p> + + <div id="tree"> + <ul> + <li class="folder">Folder 1 + <ul> + <li>Node 1 + <li>Node 2 + <li>Node 3 + </ul> + + <li class="folder">Folder 2 + <ul> + <li>Node 1 + <li>Node 2 + <li>Node 3 + </ul> + </ul> + </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-lazy.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-lazy.html new file mode 100644 index 0000000000000000000000000000000000000000..6729581674cb7c67e92e24156d406cb1225026f9 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-lazy.html @@ -0,0 +1,136 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + + // --- Initialize sample trees + $("#tree").dynatree({ + title: "Lazy loading sample", + fx: { height: "toggle", duration: 200 }, + autoFocus: false, // Set focus to first child, when expanding or lazy-loading. + // In real life we would call a URL on the server like this: +// initAjax: { +// url: "/getTopLevelNodesAsJson", +// data: { mode: "funnyMode" } +// }, + // .. but here we use a local file instead: + initAjax: { + url: "sample-data3.json" + }, + + onActivate: function(node) { + $("#echoActive").text("" + node + " (" + node.getKeyPath()+ ")"); + }, + + onLazyRead: function(node){ + // In real life we would call something like this: +// node.appendAjax({ +// url: "/getChildrenAsJson", +// data: {key: node.data.key, +// mode: "funnyMode" +// } +// }); + // .. but here we use a local file instead: + node.appendAjax({ + url: "sample-data2.json", + // We don't want the next line in production code: + debugLazyDelay: 750 + }); + } + }); + $("#btnReloadActive").click(function(){ + var node = $("#tree").dynatree("getActiveNode"); + if( node && node.isLazy() ){ + node.reloadChildren(function(node, isOk){ + }); + }else{ + alert("Please activate a lazy node first."); + } + }); + $("#btnLoadKeyPath").click(function(){ + var tree = $("#tree").dynatree("getTree"); + // Make sure that node #_27 is loaded, by traversing the parents. + // The callback is executed for every node as we go: + tree.loadKeyPath("/folder4/_23/_26/_27", function(node, status){ + if(status == "loaded") { + // 'node' is a parent that was just traversed. + // If we call expand() here, then all nodes will be expanded + // as we go + node.expand(); + }else if(status == "ok") { + // 'node' is the end node of our path. + // If we call activate() or makeVisible() here, then the + // whole branch will be exoanded now + node.activate(); + } + }); + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> + }); +</script> +</head> + +<body class="example"> +<h1>Example: Lazy loading</h1> +<p class="description">Using 'lazy' option to load the tree and to load the +branches.<br> +<br> +You may want to try this <a href="sample-lazy-persist.html">live example</a> of +a lazy tree that uses a simple test server. +</p> +<div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> +</div> +<div id="tree"><!-- When using initAjax, it may be nice to put a throbber here, that spins until the initial content is loaded: --> +</div> + +<div>Active node: <span id="echoActive">-</span></div> +<p> + <button id="btnReloadActive">Reload active node...</button> + <button id="btnLoadKeyPath">Load node by path '/folder4/_23/_26/_27'...</button> +</p> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-minexpand.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-minexpand.html new file mode 100644 index 0000000000000000000000000000000000000000..3394a35e747c4181c5db36222046f82d82506c07 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-minexpand.html @@ -0,0 +1,83 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + $(function(){ + $("#tree1").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onActivate: function(node) { + logMsg("Activated %o", node); + }, + minExpandLevel: 1 + }); + $("#tree2").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onActivate: function(node) { + logMsg("Activated %o", node); + }, + minExpandLevel: 2 + }); + $("#tree3").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onActivate: function(node) { + logMsg("Activated %o", node); + }, + minExpandLevel: 3 + }); + }); + </script> +</head> + +<body class="example"> + <h1>Example: Expand level</h1> + + <!-- Add a <div> element where the tree should appear: --> + <p class="description">minExpandLevel=1<br> + This is the default option.</p> + <div id="tree1"> </div> + + <hr> + <p class="description">minExpandLevel=2<br> + Top-level nodes are always expanded, so the expander icon is hidden.</p> + <div id="tree2"> </div> + + <hr> + <p class="description">minExpandLevel=3.</p> + <div id="tree3"> </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-multiline.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-multiline.html new file mode 100644 index 0000000000000000000000000000000000000000..545ebf5b99779f04ab1d4fb2bfc5fb4a425ffd14 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-multiline.html @@ -0,0 +1,259 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<style> + span.ws-wrap span.dynatree-title { white-space: normal; } + span.ws-nowrap span.dynatree-title { white-space: nowrap; } + span.ws-pre span.dynatree-title { white-space: pre; } +</style> +<script type="text/javascript"> + function drawCanvas() { + var canvas = document.getElementById("canvas1"); + if(canvas && canvas.getContext) { + canvas = canvas.getContext("2d"); + var lingrad = canvas.createLinearGradient( 0, 0, 0, 150 ); + lingrad.addColorStop( 0, "#0099cc" ); + lingrad.addColorStop( 0.5, "#fff" ); + lingrad.addColorStop( 0.5, "#99cc00"); + lingrad.addColorStop( 1, "#0099ff"); + canvas.fillStyle = lingrad; + canvas.fillRect(0, 0, 400 ,100 ); + canvas.fillStyle = "rgb(200,0,0)"; + canvas.fillRect( 10, 10, 55, 55 ); + } + } + + $(function(){ + // Initialize the tree inside the <div>element. + // The tree structure is read from the contained <ul> tag. + $("#tree").dynatree({ + onActivate: function(node) { + $("#echoActive").text(node.data.title); + if(node.data.key == "canvasNode1") + drawCanvas(); + }, + onDeactivate: function(node) { + $("#echoSelected").text("-"); + } + }); + // Dynatree renders nodes 'lazily', i.e. when they are first expanded. + // So we to use live event binding for embedded elements. + $("#btn1").live("click", function(){ + alert("Thank you for clicking."); + return false; + }); + }); +</script> +</head> +<body class="example"> + <h1>Example: formatted and multi-line titles</h1> + <p class="description"> + This example shows how multi-line and non-text contents is displayed. + <br> + The 'noLink' node-option is used for single nodes to make the form and + HTML5 elements clickable. + </p> + + <div id="tree"> + <ul> + <li>Using some <b>bold</b> markup in the text (<li> tag only). + <li><span>Using some <b>bold</b> markup in the text (<li><span> tag).</span> + + <li class="folder">Long paragraph, with H3, P, and BR + <ul> + <li><span><h3>Title</h3> + <p> + Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed + diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + <br> + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit + amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam + nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + <br> + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod + tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + <br> + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + </p> + </span> + <li>Node 2 + </ul> + + <li class="folder">Long line (nowrap) + <ul> + <li class="noLink"><span> + Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed + diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit + amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam + nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod + tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + </span> + <li>Node 2 + </ul> + + <li class="folder">Long line (wrapping) + <ul> + <li class="noLink" data="addClass: 'ws-wrap'"><span> + Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed + diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit + amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam + nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod + tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + </span> + <li>Node 2 + </ul> + + <li class="folder">Long line (pre formatted) + <ul> + <li class="noLink" data="addClass: 'ws-pre'"><span> + Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed + diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit + amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam + nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod + tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. + At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + </span> + <li>Node 2 + </ul> + + <li class="folder">Long text using BR and P + <ul> + <li class="noLink"><span> + <p> + Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed <br> + diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, <br> + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br> + </p> + <p> + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit <br> + amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam <br> + nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, <br> + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br> + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. <br> + </p> + <p> + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod <br> + tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. <br> + At vero eos et accusam et justo duo dolores et ea rebum. <br> + </p> + <p> + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. <br> + </p> + </span> + <li>Node 2 + </ul> + + <li class="folder">Form elements + <ul> + <li class="noLink"><span> + Name: <input type="text" name="name2" /> + </span> + <li class="noLink"><span> + Comment:<br><textarea name="comment2"></textarea> + </span> + <li class="noLink" data="icon: false"><span> + <input type="radio" id="rb1_1" name="rb1" value="v1" checked> + <label for="rb1_1">Foo</label> + <input type="radio" id="rb1_2" name="rb1" value="v2"> + <label for="rb1_2">Bar</label> + <input type="radio" id="rb1_3" name="rb1" value="v3"> + <label for="rb1_3">Baz</label> + </span> + <li class="noLink"><span> + <button id="btn1" value="123">Click me</button> + </span> + </ul> + + <li class="folder">Canvas + <ul> + <li class="noLink" id="canvasNode1" data="icon: false"><span> + Click below to draw:<br> + <canvas id="canvas1" width="400" height="100"> + Your browser does not support the <code>canvas</code> element. + </canvas> + </span> + </ul> + + <li class="folder">Video + <ul> + <li class="noLink"><span> + <video src="http://www.w3schools.com/html5/movie.ogg" + controls="controls" + NO_autoplay + > + Your browser does not support the <code>video</code> element. + </video> + </span> + </ul> + + <li class="folder">Audio + <ul> + <li class="noLink"><span> + <audio src="http://developer.mozilla.org/@api/deki/files/2926/=AudioTest_(1).ogg" + controls="controls" + NO_autoplay> + Your browser does not support the <code>audio</code> element. + </audio> + </span> + </ul> + + <li>item3 + </ul> + </div> + + <div>Active node: <span id="echoActive">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-persist.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-persist.html new file mode 100644 index 0000000000000000000000000000000000000000..602bc9e244532b0cd6c89d78d1ca11300e52bb4c --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-persist.html @@ -0,0 +1,107 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + persist: true, + checkbox: true, + selectMode: 3, + onPostInit: function(isReloading, isError) { + logMsg("onPostInit(%o, %o)", isReloading, isError); + // Re-fire onActivate, so the text is update + this.reactivate(); + }, + onActivate: function(node) { + $("#echoActive").text(node.data.title); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + onDblClick: function(node, event) { + logMsg("onDblClick(%o, %o)", node, event); + node.toggleExpand(); + } + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: Persist</h1> + <p class="description"> + Cookie persistence is enabled here.<br> + Also, double-click handler expands document nodes.<br> + Select a node and hit [F5] to refresh, to see how the active node and + expansion and selection states are restored.<br> + <br> + NOTE: if this doesn't seem to work, it's probably because the frame + content is cached by the browser.<br> + Try this example as an + <a href="#" target="_blank">unframed page</a>. + </p> + + <!-- Tree container --> + <div id="tree"> + <ul> + <li id="id1" title="Look, a tool tip!">item1 with key and tooltip + <li id="id2">item2 + <li id="id3" class="folder">Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <ul> + <li id="id3.1.1">Sub-item 3.1.1 + <li id="id3.1.2">Sub-item 3.1.2 + </ul> + <li id="id3.2">Sub-item 3.2 + <ul> + <li id="id3.2.1">Sub-item 3.2.1 + <li id="id3.2.2">Sub-item 3.2.2 + </ul> + </ul> + <li id="id4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="id4.1" class="active focused">Sub-item 4.1 (active and focus on init) + <ul> + <li id="id4.1.1">Sub-item 4.1.1 + <li id="id4.1.2">Sub-item 4.1.2 + </ul> + <li id="id4.2">Sub-item 4.2 + <ul> + <li id="id4.2.1">Sub-item 4.2.1 + <li id="id4.2.2">Sub-item 4.2.2 + </ul> + </ul> + </ul> + </div> + <div>Active node: <span id="echoActive">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-pyserver.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-pyserver.html new file mode 100644 index 0000000000000000000000000000000000000000..27aa95c3f5f07f9960d79146bd04944f8afcfd06 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-pyserver.html @@ -0,0 +1,184 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Local Server</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + var _activeKey = null, + debugDelay = 5; // seconds + $(function(){ + + $("#tree").ajaxComplete(function(event, XMLHttpRequest, ajaxOptions) { + _log("debug", "ajaxComplete: %o", this); // dom element listening + }); + + // --- Initialize sample trees + $("#tree").dynatree({ + persist: true, + checkbox: true, + selectMode: 3, + onPostInit: function(isReloading, isError) { +// alert("reloading: "+isReloading+", error:"+isError); + logMsg("onPostInit(%o, %o) - %o", isReloading, isError, this); + // Re-fire onActivate, so the text is updated + this.reactivate(); + }, + fx: { height: "toggle", duration: 200 }, + // initAjax is hard to fake, so we pass the children as object array: + initAjax: {url: "http://127.0.0.1:8001", + dataType: "jsonp", // Enable JSONP, so this sample can be run from the local file system against a localhost server + timeout: 10000, // timeout, otherwise 'connection refused' is not recognized if server is not running + data: {key: "", + sleep: debugDelay, +// returnEmpty: true, +// depth: 3, + mode: "baseFolders" + }, + addExpandedKeyList: true // Send list of expanded keys, so the webservice can deliver these children also + }, + onLazyRead: function(node){ + node.appendAjax( + {url: "http://127.0.0.1:8001", + dataType: "jsonp", // Enable JSONP, so this sample can be run from the local file system against a localhost server + data: {key: node.data.key, + sleep: debugDelay, +// returnEmpty: true, + mode: "branch" + } + }); + }, + onActivate: function(node) { + $("#echoActive").text(node.data.tooltip + ", key=" + node.data.key); + _activeKey = node.data.key; + }, + dnd: { + onDragStart: function(node) { + /** This function MUST be defined to enable dragging for the tree. + * Return false to cancel dragging of node. + */ + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + // This function is optional. + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + /** sourceNode may be null for non-dynatree droppables. + * Return false to disallow dropping on node. In this case + * onDragOver and onDragLeave are not called. + * Return 'over', 'before, or 'after' to force a hitMode. + * Return ['before', 'after'] to restrict available hitModes. + * Any other return value will calc the hitMode from the cursor position. + */ + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + /** Return false to disallow dropping this node. + * + */ + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + // Prevent dropping a parent below it's own child + if(node.isDescendantOf(sourceNode)){ + return false; + } + // Prohibit creating childs in non-folders (only sorting allowed) + // if( !node.isFolder && hitMode == "over" ) + // return "after"; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + /** This function MUST be defined to enable dropping of items on + * the tree. + */ + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + // expand the drop target + // sourceNode.expand(true); + }, + onDragLeave: function(node, sourceNode) { + /** Always called if onDragEnter was called. + */ + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + + $("#btnReload").click(function(){ + $("#tree").dynatree("getTree").reload(); + return false; + }); + $("#btnReloadNode").click(function(){ + $("#tree").dynatree("getTree").getNodeByKey(_activeKey).reloadChildren(); + return false; + }); + + + }); +</script> +</head> + +<body class="example"> + <h1>Example: Lazy loading with a (local) HTTP test server</h1> + <p class="description"> + Using <code>initAjax</code> option to initialize the tree using Ajax.<br> + The folders have the <code>isLazy</code> option set, so that they are also + loaded 'on demand', when expanded.<br> + <br> + Using <code>persist: true</code> and <code>initAjax: { addExpandedKeyList: true }</code> + we also support 'lazy persistence' (which has to be supported by the + web service, of course).<br> + <br> + Note:<br> + This sample assumes that a Dynatree Web Service is running at http://127.0.0.1:8001.<br> + See <a href="dynatree_server.py">dynatree_server.py</a> for a sample + server implementation.<br> + <br> + Note also:<br> + We have to enable JSONP using the option <code>initAjax: { dataType: 'jsonp' }</code>, + because Ajax calls will fail, if the originating HTML page and the web + service do not reside on the same host.<br> + In our case may have this sample page on the local file system and the + web service runs on 127.0.0.1. + </p> + + <div id="tree"> + <!-- When using initAjax, it may be nice to put a throbber here, that spins until the initial content is loaded: --> + Loading... + </div> + + <div>Active node: <span id="echoActive">-</span></div> + + <p> + <button id="btnReload">Reload tree</button> + <button id="btnReloadNode">Reload active node</button> + </p> + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-quick.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-quick.html new file mode 100644 index 0000000000000000000000000000000000000000..f8862df34f342d97c218adf7b5b3c97d2b30f90e --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-quick.html @@ -0,0 +1,67 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + $(function(){ + // Attach the dynatree widget to an existing <div id="tree"> element + // and pass the tree options as an argument to the dynatree() function: + $("#tree").dynatree({ + onActivate: function(node) { + // A DynaTreeNode object is passed to the activation handler + // Note: we also get this event, if persistence is on, and the page is reloaded. + alert("You activated " + node.data.title); + }, + children: [ + {title: "Item 1"}, + {title: "Folder 2", isFolder: true, key: "folder2", + children: [ + {title: "Sub-item 2.1"}, + {title: "Sub-item 2.2"} + ] + }, + {title: "Item 3"} + ] + }); + }); + </script> +</head> +<body class="example"> + <h1>Example: Quick start</h1> + <p class="description"> + This sample initializes the tree from a JavaScript object.<br> + An <i>onActivate</i> handler brings up an alert box when a node is selected. + </p> + + <!-- Add a <div> element where the tree should appear: --> + <div id="tree"> </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-rtl.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-rtl.html new file mode 100644 index 0000000000000000000000000000000000000000..b2bcd21fce4355f8de746547370ec5674688e7fd --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-rtl.html @@ -0,0 +1,130 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + <style type="text/css"> + .dynatree-container.dynatree-rtl .dynatree-title { + unicode-bidi: bidi-override; /* optional: reverse title letters */ + } + ul.dynatree-container.dynatree-rtl ul { + padding: 0 16px 0 0; + } + ul.dynatree-container.dynatree-rtl li { + background-position: right 0; + background-image: url("../src/skin/vline-rtl.gif"); + } + .dynatree-container.dynatree-rtl span.dynatree-connector, + .dynatree-container.dynatree-rtl span.dynatree-expander, + .dynatree-container.dynatree-rtl span.dynatree-icon, + .dynatree-container.dynatree-rtl span.dynatree-drag-helper-img, + .dynatree-container.dynatree-rtl #dynatree-drop-marker { + background-image: url("../src/skin/icons-rtl.gif"); + } + </style> + <script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + dnd: { + onDragStart: function(node) { + return true; + }, + onDragEnter: function(node, sourceNode) { + return true; + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + sourceNode.move(node, hitMode); + } + }, + onPostInit: function(){ + // Set RTL attribute on init + this.$tree.find("ul.dynatree-container").attr("DIR", "RTL").addClass("dynatree-rtl"); + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> + }); + </script> +</head> + +<body class="example"> + <h1>Example: RTL</h1> + <p class="description"> + This tree uses some extra styles to provide RTL support (experimental). + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <div id="tree"> + <ul id="treeData" style="display: none;"> + <li id="id1" title="Look, a tool tip!">item1 with key and tooltip + <li id="id2">item2 + <li id="id3" class="folder">Folder with some children + <ul> + <li id="id3.1">Sub-item 3.1 + <ul> + <li id="id3.1.1">Sub-item 3.1.1 + <li id="id3.1.2">Sub-item 3.1.2 + </ul> + <li id="id3.2">Sub-item 3.2 + <ul> + <li id="id3.2.1">Sub-item 3.2.1 + <li id="id3.2.2">Sub-item 3.2.2 + </ul> + </ul> + <li id="id4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="id4.1" class="active focused">Sub-item 4.1 (active and focus on init) + <ul> + <li id="id4.1.1">Sub-item 4.1.1 + <li id="id4.1.2">Sub-item 4.1.2 + </ul> + <li id="id4.2">Sub-item 4.2 + <ul> + <li id="id4.2.1">Sub-item 4.2.1 + <li id="id4.2.2">Sub-item 4.2.2 + </ul> + </ul> + </ul> + </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-select.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-select.html new file mode 100644 index 0000000000000000000000000000000000000000..d186c18ccd471099ee9565acbdcc49dc089352f2 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-select.html @@ -0,0 +1,306 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + var treeData = [ + {title: "item1 with key and tooltip", tooltip: "Look, a tool tip!" }, + {title: "item2: selected on init", select: true }, + {title: "Folder", isFolder: true, key: "id3", + children: [ + {title: "Sub-item 3.1", + children: [ + {title: "Sub-item 3.1.1", key: "id3.1.1" }, + {title: "Sub-item 3.1.2", key: "id3.1.2" } + ] + }, + {title: "Sub-item 3.2", + children: [ + {title: "Sub-item 3.2.1", key: "id3.2.1" }, + {title: "Sub-item 3.2.2", key: "id3.2.2" } + ] + } + ] + }, + {title: "Document with some children (expanded on init)", key: "id4", expand: true, + children: [ + {title: "Sub-item 4.1 (active on init)", activate: true, + children: [ + {title: "Sub-item 4.1.1", key: "id4.1.1" }, + {title: "Sub-item 4.1.2", key: "id4.1.2" } + ] + }, + {title: "Sub-item 4.2 (selected on init)", select: true, + children: [ + {title: "Sub-item 4.2.1", key: "id4.2.1" }, + {title: "Sub-item 4.2.2", key: "id4.2.2" } + ] + }, + {title: "Sub-item 4.3 (hideCheckbox)", hideCheckbox: true }, + {title: "Sub-item 4.4 (unselectable)", unselectable: true } + ] + } + ]; + $(function(){ + + // --- Initialize sample trees + $("#tree1").dynatree({ + checkbox: true, + // Override class name for checkbox icon: + classNames: {checkbox: "dynatree-radio"}, + selectMode: 1, + children: treeData, + onActivate: function(node) { + $("#echoActive1").text(node.data.title); + }, + onSelect: function(select, node) { + // Display list of selected nodes + var s = node.tree.getSelectedNodes().join(", "); + $("#echoSelection1").text(s); + }, + onDblClick: function(node, event) { + node.toggleSelect(); + }, + onKeydown: function(node, event) { + if( event.which == 32 ) { + node.toggleSelect(); + return false; + } + }, + // The following options are only required, if we have more than one tree on one page: +// initId: "treeData", + cookieId: "dynatree-Cb1", + idPrefix: "dynatree-Cb1-" + }); + + $("#tree2").dynatree({ + checkbox: true, + selectMode: 2, + children: treeData, + onSelect: function(select, node) { + // Display list of selected nodes + var selNodes = node.tree.getSelectedNodes(); + // convert to title/key array + var selKeys = $.map(selNodes, function(node){ + return "[" + node.data.key + "]: '" + node.data.title + "'"; + }); + $("#echoSelection2").text(selKeys.join(", ")); + }, + onClick: function(node, event) { + // We should not toggle, if target was "checkbox", because this + // would result in double-toggle (i.e. no toggle) + if( node.getEventTargetType(event) == "title" ) + node.toggleSelect(); + }, + onKeydown: function(node, event) { + if( event.which == 32 ) { + node.toggleSelect(); + return false; + } + }, + // The following options are only required, if we have more than one tree on one page: + cookieId: "dynatree-Cb2", + idPrefix: "dynatree-Cb2-" + }); + + $("#tree3").dynatree({ + checkbox: true, + selectMode: 3, + children: treeData, + onSelect: function(select, node) { + // Get a list of all selected nodes, and convert to a key array: + var selKeys = $.map(node.tree.getSelectedNodes(), function(node){ + return node.data.key; + }); + $("#echoSelection3").text(selKeys.join(", ")); + + // Get a list of all selected TOP nodes + var selRootNodes = node.tree.getSelectedNodes(true); + // ... and convert to a key array: + var selRootKeys = $.map(selRootNodes, function(node){ + return node.data.key; + }); + $("#echoSelectionRootKeys3").text(selRootKeys.join(", ")); + $("#echoSelectionRoots3").text(selRootNodes.join(", ")); + }, + onDblClick: function(node, event) { + node.toggleSelect(); + }, + onKeydown: function(node, event) { + if( event.which == 32 ) { + node.toggleSelect(); + return false; + } + }, + // The following options are only required, if we have more than one tree on one page: +// initId: "treeData", + cookieId: "dynatree-Cb3", + idPrefix: "dynatree-Cb3-" + }); + + $("#tree4").dynatree({ + checkbox: false, + selectMode: 2, + children: treeData, + onQuerySelect: function(select, node) { + if( node.data.isFolder ) + return false; + }, + onSelect: function(select, node) { + // Display list of selected nodes + var selNodes = node.tree.getSelectedNodes(); + // convert to title/key array + var selKeys = $.map(selNodes, function(node){ + return "[" + node.data.key + "]: '" + node.data.title + "'"; + }); + $("#echoSelection4").text(selKeys.join(", ")); + }, + onClick: function(node, event) { + if( ! node.data.isFolder ) + node.toggleSelect(); + }, + onDblClick: function(node, event) { + node.toggleExpand(); + }, + onKeydown: function(node, event) { + if( event.which == 32 ) { + node.toggleSelect(); + return false; + } + }, + // The following options are only required, if we have more than one tree on one page: +// initId: "treeData", + cookieId: "dynatree-Cb4", + idPrefix: "dynatree-Cb4-" + }); + + $("#btnToggleSelect").click(function(){ + $("#tree2").dynatree("getRoot").visit(function(node){ + node.toggleSelect(); + }); + return false; + }); + $("#btnDeselectAll").click(function(){ + $("#tree2").dynatree("getRoot").visit(function(node){ + node.select(false); + }); + return false; + }); + $("#btnSelectAll").click(function(){ + $("#tree2").dynatree("getRoot").visit(function(node){ + node.select(true); + }); + return false; + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> + }); +</script> +</head> + +<body class="example"> + <h1>Example: Selection and checkbox</h1> + + <!-- Tree #1 --> + + <p class="description"> + This tree has <b>checkoxes and selectMode 1 (single-selection)</b> enabled.<br> + A double-click handler selects a <i>document</i> node (not folders).<br> + A keydown handler selects on [space].<br> + The <code>checkbox</code> class name was customized, to display radio + buttons.<br> + Note: the initialization data contains multiple selected nodes. This is + considered bad input data and <b>not</b> fixed automatically (only on + the first click). + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + <div id="tree1"></div> + <div>Active node: <span id="echoActive1">-</span></div> + <div>Selection: <span id="echoSelection1">-</span></div> + + + <!-- Tree #2 --> + + <p class="description"> + This tree has <b>selectMode 2 (multi-selection)</b> enabled.<br> + A single-click handler selects the node.<br> + A keydown handler selects on [space]. + </p> + <p> + <a href="#" id="btnSelectAll">Select all</a> - + <a href="#" id="btnDeselectAll">Deselect all</a> - + <a href="#" id="btnToggleSelect">Toggle select</a> + </p> + <div id="tree2"></div> + <div>Selected keys: <span id="echoSelection2">-</span></div> + + + <!-- Tree #3 --> + + <p class="description"> + This tree has <b>checkoxes and selectMode 3 (hierarchical multi-selection)</b> enabled.<br> + A double-click handler selects the node.<br> + A keydown handler selects on [space]. + </p> + <div id="tree3"></div> + <div>Selected keys: <span id="echoSelection3">-</span></div> + <div>Selected root keys: <span id="echoSelectionRootKeys3">-</span></div> + <div>Selected root nodes: <span id="echoSelectionRoots3">-</span></div> + + + <!-- Tree #4 --> + + <p class="description"> + This tree has selectMode 2 (multi-selection) enabled, but <b>no checkboxes</b>.<br> + A single-click handler selects the node.<br> + A keydown handler selects on [space].<br> + A double-click handler expands documents.<br> + A onQuerySelect handler prevents selection of folders. + </p> + <div id="tree4"></div> + <div>Selected keys: <span id="echoSelection4">-</span></div> + + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-theming.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-theming.html new file mode 100644 index 0000000000000000000000000000000000000000..590357403160663ea62088e25f973ab35a0348c1 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-theming.html @@ -0,0 +1,93 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <!-- Include the basic stylesheet: --> + <link href="../src/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css"> + <!-- Override CSS with a custom stylesheet : --> + <link href="skin-custom/custom.css" rel="stylesheet" type="text/css" > + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + title: "Sample Theming", + // Image folder used for data.icon attribute. + imagePath: "skin-custom/", + onSelect: function(node) { + alert ("You selected " + node); + } + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: Theming</h1> + <p class="description"> + Includes a custom CSS <i>after</i> the standard CSS to overrride theming.<br> + Some nodes have their <code>data.addClass</code> attribute set.<br> + Finally, the last two nodes use the <code>data.icon</code> attribute. + </p> + + <div id="tree"> + <ul> + <li>Document with some children + <ul> + <li>Sub-item 4.1 + <ul> + <li>Sub-item 4.1.1 + <li>Sub-item 4.1.2 + </ul> + <li>Sub-item 4.2 + </ul> + + <li class="folder">A folder (different icon when expanded) + <ul> + <li>Node 2.1 + <li>Node 2.2 + </ul> + + <li data="addClass:'custom1'">Node with custom class 1 + + <li data="isFolder: true, addClass:'custom2'">Folder with custom class 2 + <ul> + <li data="addClass:'custom1'">Node 4.1 (using custom class 1) + <li>Node 4.2 + </ul> + + <li data="icon: 'customDoc1.gif'">Node with standard CSS, but custom icon + <li data="isFolder: true, icon: 'folder_docs.gif'">Folder with standard CSS but custom icon + <ul> + <li>Node 4.1 + <li>Node 4.2 + </ul> + + + </ul> + </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-ul.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-ul.html new file mode 100644 index 0000000000000000000000000000000000000000..0408ca90525a16cf564b1382ed4a3bfed62d9a71 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample-ul.html @@ -0,0 +1,71 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + onActivate: function(node) { + $("#echoActive").text(node.data.title); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + } + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: Init from <ul> element</h1> + <p class="description"> + This sample initializes the tree from a <ul> element. + </p> + + <div id="tree"> + <ul style="display:none"> + <li id="key1" title="Look, a tool tip!">item1 with key and tooltip + <li id="key2" class="selected">item2: selected on init + <li id="key3" class="folder">Folder with some children + <ul> + <li id="key3.1">Sub-item 3.1 + <li id="key3.2">Sub-item 3.2 + </ul> + + <li id="key4" class="expanded">Document with some children (expanded on init) + <ul> + <li id="key4.1">Sub-item 4.1 + <li id="key4.2">Sub-item 4.2 + </ul> + </ul> + </div> + <div>Active node: <span id="echoActive">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample.css new file mode 100644 index 0000000000000000000000000000000000000000..ed7bc6e50931dd30395cc22f312e68f2891ae707 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample.css @@ -0,0 +1,63 @@ +body.example +{ + margin: 15px; + font-family: sans-serif; +} + +body.example h1 +{ + font-size: 1.2em; +} +body.example h2 +{ + font-size: 1em; +} + +a, +a:visited +{ + color: navy; + text-decoration: none; + font-size: small; +} +a:hover +{ + text-decoration: underline; +} + +body.example p.description, +body.example p.sample-links +{ +/* border: thin solid gray; */ + background-color: #d0d0f0; + padding: 5px; + font-size: small; +} + +p.version-info +{ + color: gray; + font-size: 0.6em; +} +p.sample-links a, +p.sample-links a:visited +{ + color: navy; + text-decoration: none; + margin-left: 15px; + padding: 1px 3px; +/* border: 1pt solid white;*/ +} + +p.sample-links a:hover +{ + text-decoration: underline; +} + +pre{ + background:#eee; + border:1px solid #999; + padding:.5em; + margin:.5em; + font-size:.9em; +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample.js new file mode 100644 index 0000000000000000000000000000000000000000..7cda44bec13041d1a7e4d74c79207cd7cab0637c --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/sample.js @@ -0,0 +1,100 @@ +/************************************************************************* + (c) 2008-2012 Martin Wendt + *************************************************************************/ + +/** + * Replacement for $().toggle(func1, func2), which was deprecated with jQuery 1.8 + * and removed in 1.9.; + * Taken from http://stackoverflow.com/a/4911660/19166 + * By Felix Kling + */ +(function($) { + $.fn.clickToggle = function(func1, func2) { + var funcs = [func1, func2]; + this.data('toggleclicked', 0); + this.click(function() { + var data = $(this).data(); + var tc = data.toggleclicked; + $.proxy(funcs[tc], this)(); + data.toggleclicked = (tc + 1) % 2; + }); + return this; + }; +}(jQuery)); + + +function viewSourceCode() +{ + window.location = "view-source:" + window.location.href; +} + + +function initCodeSamples() +{ + var $source = $("#sourceCode"); + $("#codeExample").clickToggle( + function(){ + $source.show("fast"); + if( !this.old ){ + this.old = $(this).html(); + $.get(this.href, function(code){ + // Remove <!-- Start_Exclude [...] End_Exclude --> blocks: + code = code.replace(/<!-- Start_Exclude(.|\n|\r)*?End_Exclude -->/gi, "<!-- (Irrelevant source removed.) -->"); + // Reduce tabs from 8 to 2 characters + code = code.replace(/\t/g, " "); + $source.text(code); + // Format code samples + try { + prettyPrint(); + } catch (e) { + alert(e); + } + }, "html"); + } + $(this).html("Hide source code"); + }, + function(){ + $(this).html(this.old); + $source.hide("fast"); + } + ); + if(jQuery.ui){ + var info = "Dynatree " + jQuery.ui.dynatree.version + + ", jQuery UI " + jQuery.ui.version + + ", jQuery " + jQuery.fn.jquery; +/* + info += "\n<br>"; + info += "document.compatMode: " + document.compatMode + "\n"; + for(e in jQuery.support){ + info += "<br>\n" + e + ": " + jQuery.support[e]; + } +*/ + $("p.sample-links").after("<p class='version-info'>" + info + "</p>"); + } +} + + +var _gaq = _gaq || []; + +$(function(){ + // Log to Google Analytics, when not running locally + if ( document.URL.toLowerCase().indexOf("wwwendt.de/") >= 0 ) { + _gaq.push(["_setAccount", "UA-316028-1"]); + _gaq.push(["_trackPageview"]); + + (function() { + var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true; + ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js"; + var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s); + })(); + } + + // Show some elements only, if (not) inside the Example Browser +// if (top.location == self.location){ + if (window.top == window.self){ + $(".hideOutsideFS").hide(); + }else{ + $(".hideInsideFS").hide(); + } + initCodeSamples(); +}); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-nav.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-nav.html new file mode 100644 index 0000000000000000000000000000000000000000..3ec4f053ecc8abfb0fa9a24d0d03c1938f283416 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-nav.html @@ -0,0 +1,137 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <meta name="robots" content="noindex,follow"> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + <script src="sample.js" type="text/javascript"></script> + <title>Dynatree - Example Browser</title> + +<style type="text/css"> +body { + background-color: #39414A; + color: white; + font-family: Helvetica, Arial, sans-serif; + font-size: smaller; + background-image: url("nav_bg.png"); + background-repeat: repeat-x; +} +a { + color: white; + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +div#tree { + position: absolute; + height: 95%; + width: 95%; + padding: 5px; + margin-right: 16px; +} +ul.dynatree-container { + height: 100%; + width: 100%; + background-color: transparent; +} +ul.dynatree-container a { + color: white; + border: 1px solid transparent; + background-color: transparent; +} +ul.dynatree-container a:hover { + background-color: transparent; +} +ul.dynatree-container a:focus, span.dynatree-focused a:link { + background-color: gray; +} +</style> + +<script type="text/javascript"> + $(function(){ + // --- Initialize sample trees + $("#tree").dynatree({ + autoFocus: true, +// persist: true, + minExpandLevel: 2, + onFocus: function(node) { + // Auto-activate focused node after 1 second + if(node.data.href){ + node.scheduleAction("activate", 1000); + } + }, + onBlur: function(node) { + node.scheduleAction("cancel"); + }, + onActivate: function(node){ + if(node.data.href){ + window.open(node.data.href, node.data.target); + } + } + }); + }); +</script> + +</head> + +<body> + <div id="tree"> + <ul> + <li><a target="_blank" href="dynatree-doc.html">Documentation</a> + <li><a target="_blank" href="http://dynatree.googlecode.com">jquery.dynatree.js</a> + <li class="folder expnded"> Examples + <ul> + <li><a target="content" href="sample-default.html">Default options</a> + <li><a target="content" href="sample-quick.html">Init from JS object</a> + <li><a target="content" href="sample-init-lazy.html">Init from external data</a> + <li><a target="content" href="sample-iframe.html">URL navigation and <iframe></a> + <li><a target="content" href="sample-api.html">Programming API</a> + <li><a target="content" href="sample-select.html">Checkbox & select</a> + <li><a target="content" href="sample-theming.html">Theming</a> + <li><a target="content" href="sample-persist.html">Persistence</a> + <li><a target="content" href="sample-events.html">Event handling</a> + <li><a target="content" href="sample-effects.html">Effects</a> + <li class="folder">Drag'n'drop + <ul> + <li><a target="content" href="sample-dnd.html">Drag'n'drop</a> + <li><a target="content" href="sample-dnd2.html">Drag'n'drop 2</a> + <li><a target="content" href="sample-dnd3.html">Drag'n'drop 3</a> + </ul> + <li><a target="content" href="sample-contextmenu.html">Context menu, Copy/paste</a> + <li><a target="content" href="sample-contextmenu3.html">Context menu, Copy/paste (2)</a> + <li><a target="content" href="sample-minexpand.html">Fixed expand level</a> + <li><a target="content" href="sample-lazy.html">Lazy loading</a> + <li><a target="content" href="sample-form.html">Embed in forms</a> + <li><a target="content" href="sample-multiline.html">Large nodes</a> + <li class="folder">Tweaks + <ul> + <li><a target="content" href="test-table.html">Column layout</a> + <li><a target="content" href="sample-inline-edit.html">Edit nodes</a> + <li><a target="content" href="sample-rtl.html">RTL</a> + </ul> + <li class="folder">Test + <ul> + <li><a target="content" href="test-bench.html">Benchmark large trees</a> + <li><a target="content" href="test-latest.html">Latest jQuery</a> + <li><a target="content" href="sample-pyserver.html">Local server</a> + <li class="folder">DTD + <ul> + <li><a target="content" href="test-dtd-none.html">No DTD</a> + <li><a target="content" href="test-dtd-html4-transitional.html">HTML4 transitional</a> + <li><a target="content" href="test-dtd-html4-strict.html">HTML4 strict</a> + <li><a target="content" href="test-dtd-html5.html">HTML5</a> + <li><a target="content" href="test-dtd-xml-transitional.html">XHTML transitional</a> + <li><a target="content" href="test-dtd-xml-strict.html">XHTML strict</a> + </ul> + </ul> + </ul> + </ul> + </div> +</body> +</html><html><body></body></html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-top.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-top.html new file mode 100644 index 0000000000000000000000000000000000000000..5282abe7cb7d46e969e1190805ce220c38a66eb4 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-top.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <meta name="robots" content="noindex,follow"> + <title>Dynatree - Example Browser</title> + +<style type="text/css"> +body { + background-color: #0F1923; + color: white; + padding: 3px 10px; + font-family: sans-serif; +} +h1 { + margin-top: 8px; + font-size: 1.4em; +} +a { + text-decoration: none; + color: white; +} +</style> +</head> + +<body> + <h1><a href="samples.html" target="_top">Dynatree - Example Browser</a></h1> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-welcome.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-welcome.html new file mode 100644 index 0000000000000000000000000000000000000000..23f3e7065675529f8ccca0ae915e5c0576404795 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples-welcome.html @@ -0,0 +1,27 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> +</head> + +<body class="example"> + <h1>dynatree - Examples</h1> + <p class="description"> + This site presents some live examples for Dynatree.<br> + <br> + Select a topic on the navigator to the left and click 'View source code' + at the bottom of the samples for details.<br> + <br> + More documentation and infos can be found at the + <a target="_blank" href="http://dynatree.googlecode.com">project home</a>.<br> + <br> + Have fun :-) + </p> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples.html new file mode 100644 index 0000000000000000000000000000000000000000..5e3f456b8942df79498c2b8d954a1a5080a83b37 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/samples.html @@ -0,0 +1,25 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <meta name="robots" content="noindex,follow"> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="sample.js" type="text/javascript"></script> + <title>Dynatree - Example Browser</title> +</head> +<frameset rows="50,1*" frameborder="no" framespacing="0"> + <frame src="samples-top.html" name="top" scrolling="NO" noresize + marginwidth="0" marginheight="0"> + <frameset cols="200,1*" > + <frame src="samples-nav.html" name="nav" scrolling="NO" + marginwidth="0" marginheight="0"> + <frame src="samples-welcome.html" name="content"> + </frameset> +</frameset> + +<noframes> + <body> + <p>This page requires frames.</p> + </body> +</noframes> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/custom.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/custom.css new file mode 100644 index 0000000000000000000000000000000000000000..56f1b32fa8867aecafb92b88950f1c0fdc3f8035 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/custom.css @@ -0,0 +1,71 @@ +/******************************************************************************* + * Sample for a Dynatree custom stylesheet. + * This is expected to be included after the standard ui.dynatree.css, thus + * overridung the defaults. + */ +.dynatree-has-children span.dynatree-icon +{ + background-position: 0 0; + background-image: url("doc_with_children.gif"); +} + +.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */ +{ + background-image: url("folder_docs.gif"); +} + +.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */ +{ + background-image: url("folder_images.gif"); +} + + +/******************************************************************************* + * Node titles + */ + +span.dynatree-has-children a +{ + font-style: oblique; +} + +span.dynatree-selected a +{ + color: green; + font-style: italic; +} + +span.dynatree-active a, +span.dynatree-active a:hover +{ + border: 1px solid maroon; + background-color: #FAD8F0 !important; /* reddish */ +} + + +/******************************************************************************* + * Custom node classes (sample) + */ + +span.custom1 a +{ + background-color: #ffffbb; + color: maroon; +} +span.custom1 span.dynatree-icon +{ + background-position: 0 0; + background-image: url("customDoc2.gif"); +} + +span.custom2 a +{ + font-weight: bold; + background-color: silver; + color: navy; +} +span.custom2 span.dynatree-icon +{ + background-position: 0 0; + background-image: url("folder_page.gif"); +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customDoc1.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customDoc1.gif new file mode 100644 index 0000000000000000000000000000000000000000..59681a80dea123300644eaeee106e7d7c7fb2cf1 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customDoc1.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customDoc2.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customDoc2.gif new file mode 100644 index 0000000000000000000000000000000000000000..8bda8a47e3c0e9c4cb5f757d91c2a97453944f13 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customDoc2.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customFolder1.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customFolder1.gif new file mode 100644 index 0000000000000000000000000000000000000000..27e989add4930937b7f633c45ecf4b61591b8e62 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/customFolder1.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/doc_with_children.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/doc_with_children.gif new file mode 100644 index 0000000000000000000000000000000000000000..0888abf85ed10d3bdadb25b30b49e8c35b8233d9 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/doc_with_children.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_docs.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_docs.gif new file mode 100644 index 0000000000000000000000000000000000000000..f33f23d2c963015d9fac201b508fa76b69078d1e Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_docs.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_images.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_images.gif new file mode 100644 index 0000000000000000000000000000000000000000..2b79960ee9f905d9d3e072a1b5a3ec40a0281951 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_images.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_page.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..a8c53e2f7bb62d0e7a693fc9bed282952b75f39b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/skin-custom/folder_page.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-bench.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-bench.html new file mode 100644 index 0000000000000000000000000000000000000000..d1f3c4bea4a8f69688620548abd900fd86ac3410 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-bench.html @@ -0,0 +1,136 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.min.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.min.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + $(function(){ + $("#tree").dynatree({ + children: [ + {title: "Add 100 nodes (flat, force update)...", isFolder: true, isLazy: true, mode: "add100_flat_u" }, + {title: "Add 100 nodes (flat)...", isFolder: true, isLazy: true, mode: "add100_flat" }, + {title: "Add 1.000 nodes (flat)...", isFolder: true, isLazy: true, mode: "add1000_flat" }, + {title: "Add 1.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add1000_deep" }, + {title: "Add 10.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add10000_deep" } + ], + onSelect: function(node) { + alert("You selected " + node.data.title); + }, + onLazyRead: function(node) { + var tree = node.tree; + logMsg("Benchmarking mode='" + node.data.mode + "'..."); + switch( node.data.mode ) { + case "add100_flat_u": + addNodes(node, 100, 0, 0, true) + break; + case "add100_flat": + addNodes(node, 100, 0, 0) + break; + case "add1000_flat": + addNodes(node, 1000, 0, 0) + break; + case "add1000_deep": + addNodes(node, 10, 10, 10) + break; + case "add10000_deep": + addNodes(node, 10, 100, 10) + break; + } +// node.setLazyNodeStatus(DTNodeStatus_Ok); + logMsg("Benchmarking mode='" + node.data.mode + "' done."); + // Return true, to show we're finished + return true; + } + }); + + $("#btnClear").click(function(){ + var root = $("#tree").dynatree("getRoot"); + for(var i = 0; i<root.childList.length; i++) + root.childList[i].removeChildren(); + }); + $("#btnRenderAll").click(function(){ + var tree = $("#tree").dynatree("getTree"); + var count = tree.count(); + logMsg("Benchmarking node creation for " + count + " nodes..."); + tree.renderInvisibleNodes(); + logMsg("Benchmarking node creation for " + count + " nodes done."); + }); + }); + + function addNodes(node, level1, level2, level3, forceUpdate) { + if( forceUpdate != true ) + node.tree.enableUpdate(false); + + var key; + for (var i=0; i<level1; i++) { + key = "" + (i+1); + var f = node.addChild({title: "Folder_" + key, + key: key, + isFolder: true + }); + for (var j=0; j<level2; j++) { + key = "" + (i+1) + "." + (j+1); + var d = f.addChild({title: "Node_" + key, + key: key + }); + for (var k=0; k<level3; k++) { + key = "" + (i+1) + "." + (j+1) + "." + (k+1); + d.addChild({title: "Node_" + key, + key: key + }); + } + } + } + node.tree.enableUpdate(true); + } + + </script> +</head> + +<body class="example"> + <h1>Example: Benchmark</h1> + <p class="description"> + Expand a node to start a benchmark, then check the firebug console. + </p> + <p class="description"> + Some users reported slow loading with Firefox. If you experience + response times longer than 3-4 for seconds for <code>Add 1.000 nodes (flat)</code> + please <a href="http://code.google.com/p/dynatree/issues/detail?id=182">let us know</a>. + </p> + + <div id='tree'> </div> + <p> + enableUpdate(false) is used for speedup. + </p> + <p> + <button id="btnClear">remove children</button> + <button id="btnRenderAll">Create HTML markup for all nodes</button> + </p> + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-css.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-css.html new file mode 100644 index 0000000000000000000000000000000000000000..348e288686fd85cecb47dcad2bb0eae62c2a1748 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-css.html @@ -0,0 +1,44 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + + <title>dynatree - temporary tests</title> + <!-- Include the required JavaScript libraries: --> + +<style type="text/css"> +.container { + color: red; +} +.container a:link { + text-decoration: none; + color: inherit; +} +.container span.active a { + color: magenta; +} + +/* +a:link { font-weight:bold; color:blue; text-decoration:none; } +a:visited { font-weight:bold; color:silver; text-decoration:none; } +a:focus { font-weight:bold; color:red; text-decoration:underline; } +a:hover { font-weight:bold; color:green; text-decoration:none; } +a:active { font-weight:bold; color:lime; text-decoration:underline; } +*/ +</style> + +</head> +<body> + <P>This file is only temporarily used to reproduce issues.</P> + <p style="color: red;">Using doctype HTML 4.01 Strict.</p> + <div id='tree'> </div> + + <div class="container"> + <div><span>text</span></div> + <div><span class="active"><a href="#">tag</a></span></div> + <div><span><a href="#">tag</a></span></div> + </div> + + <p><a href="http://dynatree.googlecode.com">jquery.dynatree.js</a></p> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html4-strict.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html4-strict.html new file mode 100644 index 0000000000000000000000000000000000000000..e0ace900c5ce11c43fd96bd647fbe019c19f8079 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html4-strict.html @@ -0,0 +1,198 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - HTML4 strict</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + +<style type="text/css"> +#tree ul.dynatree-container { + overflow: scroll; + position: relative; + width: 200px; + height: 250px; +} +#tree2 { + position: absolute; + top: 150px; + left: 350px; +} +</style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +var data = [ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", "expand": true, + "children": [ + {"title": "Sub-item 2.1", + "children": [ + {"title": "Sub-item 2.1.1", + "children": [ + {"title": "Sub-item 2.1.1.1"}, + {"title": "Sub-item 2.1.2.2"}, + {"title": "Sub-item 2.1.1.3"}, + {"title": "Sub-item 2.1.2.4"} + ] + }, + {"title": "Sub-item 2.1.2"}, + {"title": "Sub-item 2.1.3"}, + {"title": "Sub-item 2.1.4"} + ] + }, + {"title": "Sub-item 2.2"}, + {"title": "Sub-item 2.3 (lazy)"} + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1", + "children": [ + {"title": "Sub-item 3.1.1"}, + {"title": "Sub-item 3.1.2"}, + {"title": "Sub-item 3.1.3"}, + {"title": "Sub-item 3.1.4"} + ] + }, + {"title": "Sub-item 3.2"}, + {"title": "Sub-item 3.3"}, + {"title": "Sub-item 3.4"} + ] + }, + {"title": "Item 5"} +]; +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>DTD test: HTML4 strict</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <div id="tree"> 1 </div> + <div>Active node 1: <span id="echoActive">-</span></div> + <hr> + <div id="tree2"> 2 </div> + <div>Active node 2: <span id="echoActive2">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html4-transitional.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html4-transitional.html new file mode 100644 index 0000000000000000000000000000000000000000..41f07cba63dcf4f5b841c3e7854502786224dfed --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html4-transitional.html @@ -0,0 +1,198 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - HTML4 transitional</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + +<style type="text/css"> +#tree ul.dynatree-container { + overflow: scroll; + position: relative; + width: 200px; + height: 250px; +} +#tree2 { + position: absolute; + top: 150px; + left: 350px; +} +</style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +var data = [ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", "expand": true, + "children": [ + {"title": "Sub-item 2.1", + "children": [ + {"title": "Sub-item 2.1.1", + "children": [ + {"title": "Sub-item 2.1.1.1"}, + {"title": "Sub-item 2.1.2.2"}, + {"title": "Sub-item 2.1.1.3"}, + {"title": "Sub-item 2.1.2.4"} + ] + }, + {"title": "Sub-item 2.1.2"}, + {"title": "Sub-item 2.1.3"}, + {"title": "Sub-item 2.1.4"} + ] + }, + {"title": "Sub-item 2.2"}, + {"title": "Sub-item 2.3 (lazy)"} + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1", + "children": [ + {"title": "Sub-item 3.1.1"}, + {"title": "Sub-item 3.1.2"}, + {"title": "Sub-item 3.1.3"}, + {"title": "Sub-item 3.1.4"} + ] + }, + {"title": "Sub-item 3.2"}, + {"title": "Sub-item 3.3"}, + {"title": "Sub-item 3.4"} + ] + }, + {"title": "Item 5"} +]; +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>DTD test: HTML4 transitional</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <div id="tree"> 1 </div> + <div>Active node 1: <span id="echoActive">-</span></div> + <hr> + <div id="tree2"> 2 </div> + <div>Active node 2: <span id="echoActive2">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html5.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html5.html new file mode 100644 index 0000000000000000000000000000000000000000..478dd3f3adf6ee0dc3d01e5bcf312f5d420eb70a --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-html5.html @@ -0,0 +1,198 @@ +<!DOCTYPE html> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - HTML5</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + +<style type="text/css"> +#tree ul.dynatree-container { + overflow: scroll; + position: relative; + width: 200px; + height: 250px; +} +#tree2 { + position: absolute; + top: 150px; + left: 350px; +} +</style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +var data = [ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", "expand": true, + "children": [ + {"title": "Sub-item 2.1", + "children": [ + {"title": "Sub-item 2.1.1", + "children": [ + {"title": "Sub-item 2.1.1.1"}, + {"title": "Sub-item 2.1.2.2"}, + {"title": "Sub-item 2.1.1.3"}, + {"title": "Sub-item 2.1.2.4"} + ] + }, + {"title": "Sub-item 2.1.2"}, + {"title": "Sub-item 2.1.3"}, + {"title": "Sub-item 2.1.4"} + ] + }, + {"title": "Sub-item 2.2"}, + {"title": "Sub-item 2.3 (lazy)"} + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1", + "children": [ + {"title": "Sub-item 3.1.1"}, + {"title": "Sub-item 3.1.2"}, + {"title": "Sub-item 3.1.3"}, + {"title": "Sub-item 3.1.4"} + ] + }, + {"title": "Sub-item 3.2"}, + {"title": "Sub-item 3.3"}, + {"title": "Sub-item 3.4"} + ] + }, + {"title": "Item 5"} +]; +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>DTD test: HTML5</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <div id="tree"> 1 </div> + <div>Active node 1: <span id="echoActive">-</span></div> + <hr> + <div id="tree2"> 2 </div> + <div>Active node 2: <span id="echoActive2">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-none.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-none.html new file mode 100644 index 0000000000000000000000000000000000000000..7c882058a0e1ceb802e50d6674309e7217e144fa --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-none.html @@ -0,0 +1,197 @@ +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - no DTD (i.e. 'Quirks')</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + +<style type="text/css"> +#tree ul.dynatree-container { + overflow: scroll; + position: relative; + width: 200px; + height: 250px; +} +#tree2 { + position: absolute; + top: 150px; + left: 350px; +} +</style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +var data = [ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", "expand": true, + "children": [ + {"title": "Sub-item 2.1", + "children": [ + {"title": "Sub-item 2.1.1", + "children": [ + {"title": "Sub-item 2.1.1.1"}, + {"title": "Sub-item 2.1.2.2"}, + {"title": "Sub-item 2.1.1.3"}, + {"title": "Sub-item 2.1.2.4"} + ] + }, + {"title": "Sub-item 2.1.2"}, + {"title": "Sub-item 2.1.3"}, + {"title": "Sub-item 2.1.4"} + ] + }, + {"title": "Sub-item 2.2"}, + {"title": "Sub-item 2.3 (lazy)"} + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1", + "children": [ + {"title": "Sub-item 3.1.1"}, + {"title": "Sub-item 3.1.2"}, + {"title": "Sub-item 3.1.3"}, + {"title": "Sub-item 3.1.4"} + ] + }, + {"title": "Sub-item 3.2"}, + {"title": "Sub-item 3.3"}, + {"title": "Sub-item 3.4"} + ] + }, + {"title": "Item 5"} +]; +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>DTD test: no DTD ('quirks')</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <div id="tree"> 1 </div> + <div>Active node 1: <span id="echoActive">-</span></div> + <hr> + <div id="tree2"> 2 </div> + <div>Active node 2: <span id="echoActive2">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-xml-strict.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-xml-strict.html new file mode 100644 index 0000000000000000000000000000000000000000..57fb94ef263cf1086d7c070ec00a2beed5e69ef3 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-xml-strict.html @@ -0,0 +1,199 @@ +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - DTD XML strict</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + +<style type="text/css"> +#tree ul.dynatree-container { + overflow: scroll; + position: relative; + width: 200px; + height: 250px; +} +#tree2 { + position: absolute; + top: 150px; + left: 350px; +} +</style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +var data = [ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", "expand": true, + "children": [ + {"title": "Sub-item 2.1", + "children": [ + {"title": "Sub-item 2.1.1", + "children": [ + {"title": "Sub-item 2.1.1.1"}, + {"title": "Sub-item 2.1.2.2"}, + {"title": "Sub-item 2.1.1.3"}, + {"title": "Sub-item 2.1.2.4"} + ] + }, + {"title": "Sub-item 2.1.2"}, + {"title": "Sub-item 2.1.3"}, + {"title": "Sub-item 2.1.4"} + ] + }, + {"title": "Sub-item 2.2"}, + {"title": "Sub-item 2.3 (lazy)"} + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1", + "children": [ + {"title": "Sub-item 3.1.1"}, + {"title": "Sub-item 3.1.2"}, + {"title": "Sub-item 3.1.3"}, + {"title": "Sub-item 3.1.4"} + ] + }, + {"title": "Sub-item 3.2"}, + {"title": "Sub-item 3.3"}, + {"title": "Sub-item 3.4"} + ] + }, + {"title": "Item 5"} +]; +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>DTD test: XML strict</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <div id="tree"> 1 </div> + <div>Active node 1: <span id="echoActive">-</span></div> + <hr> + <div id="tree2"> 2 </div> + <div>Active node 2: <span id="echoActive2">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-xml-transitional.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-xml-transitional.html new file mode 100644 index 0000000000000000000000000000000000000000..09ebb521fc9aca757aaf4bda33219e0ade3681f8 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-dtd-xml-transitional.html @@ -0,0 +1,200 @@ +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - XML transitionale</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + +<style type="text/css"> +#tree ul.dynatree-container { + overflow: scroll; + position: relative; + width: 200px; + height: 250px; +} +#tree2 { + position: absolute; + top: 150px; + left: 350px; +} +</style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +var data = [ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", "expand": true, + "children": [ + {"title": "Sub-item 2.1", + "children": [ + {"title": "Sub-item 2.1.1", + "children": [ + {"title": "Sub-item 2.1.1.1"}, + {"title": "Sub-item 2.1.2.2"}, + {"title": "Sub-item 2.1.1.3"}, + {"title": "Sub-item 2.1.2.4"} + ] + }, + {"title": "Sub-item 2.1.2"}, + {"title": "Sub-item 2.1.3"}, + {"title": "Sub-item 2.1.4"} + ] + }, + {"title": "Sub-item 2.2"}, + {"title": "Sub-item 2.3 (lazy)"} + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1", + "children": [ + {"title": "Sub-item 3.1.1"}, + {"title": "Sub-item 3.1.2"}, + {"title": "Sub-item 3.1.3"}, + {"title": "Sub-item 3.1.4"} + ] + }, + {"title": "Sub-item 3.2"}, + {"title": "Sub-item 3.3"}, + {"title": "Sub-item 3.4"} + ] + }, + {"title": "Item 5"} +]; +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + children: data, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + dnd: { + onDragStart: function(node) { + logMsg("tree.onDragStart(%o)", node); + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + }, + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); + return true; + }, + onDragOver: function(node, sourceNode, hitMode) { + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + if(node.isDescendantOf(sourceNode)){ + return false; + } + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + logMsg("tree.onDrop(%o, %o, %s)", node, sourceNode, hitMode); + sourceNode.move(node, hitMode); + }, + onDragLeave: function(node, sourceNode) { + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>DTD test: XML transitional</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <div id="tree"> 1 </div> + <div>Active node 1: <span id="echoActive">-</span></div> + <hr> + <div id="tree2"> 2 </div> + <div>Active node 2: <span id="echoActive2">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-latest.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-latest.html new file mode 100644 index 0000000000000000000000000000000000000000..8d1fda5cbf37f18114ccffec6d0b37efc0fa88e6 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-latest.html @@ -0,0 +1,262 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Test wit latest jQuery</title> + + <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> + <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <style type="text/css"> + #draggableSample, #droppableSample { + height:100px; + padding:0.5em; + width:150px; + border:1px solid #AAAAAA; + } + #draggableSample { + background-color: silver; + color:#222222; + } + #droppableSample { + background-color: maroon; + color: white; + } + #droppableSample.drophover { + border: 1px solid green; + } + </style> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"><!-- +$(function(){ + // --- Initialize first Dynatree ------------------------------------------- + $("#tree").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 750 // don't do thi in production code + }); + }, + onActivate: function(node) { + $("#echoActive").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + dnd: { + onDragStart: function(node) { + /** This function MUST be defined to enable dragging for the tree. + * Return false to cancel dragging of node. + */ + logMsg("tree.onDragStart(%o)", node); + if(node.data.isFolder) + return false; + return true; + }, + onDragStop: function(node) { + logMsg("tree.onDragStop(%o)", node); + } + } + }); + // --- Initialize second Dynatree ------------------------------------------ + $("#tree2").dynatree({ + initAjax: { + url: "sample-data3.json" + }, + onLazyRead: function(node){ + // Mockup a slow reqeuest ... + node.appendAjax({ + url: "sample-data2.json", + debugLazyDelay: 750 // don't do thi in production code + }); + }, + onActivate: function(node) { + $("#echoActive2").text(node.data.title + "(" + node.data.key + ")"); + }, + onDeactivate: function(node) { + $("#echoActive2").text("-"); + }, + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data2.json" + }); + }, + dnd: { + autoExpandMS: 1000, + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: function(node, sourceNode) { + /** sourceNode may be null for non-dynatree droppables. + * Return false to disallow dropping on node. In this case + * onDragOver and onDragLeave are not called. + * Return 'over', 'before, or 'after' to force a hitMode. + * Any other return value will calc the hitMode from the cursor position. + */ + logMsg("tree.onDragEnter(%o, %o)", node, sourceNode); +// if(node.data.isFolder) +// return false; + return true; +// return "over"; + }, + onDragOver: function(node, sourceNode, hitMode) { + /** Return false to disallow dropping this node. + * + */ +// if(node.data.isFolder){ +// var dd = $.ui.ddmanager.current; +// dd.cancel(); +// alert("folder"); +// } + logMsg("tree.onDragOver(%o, %o, %o)", node, sourceNode, hitMode); + }, + onDrop: function(node, sourceNode, hitMode, ui, draggable) { + /**This function MUST be defined to enable dropping of items on the tree. + * sourceNode may be null, if it is a non-Dynatree droppable. + */ + logMsg("tree.onDrop(%o, %o)", node, sourceNode); + var copynode; + if(sourceNode) { + copynode = sourceNode.toDict(true, function(dict){ + dict.title = "Copy of " + dict.title; + delete dict.key; // Remove key, so a new one will be created + }); + }else{ + copynode = {title: "This node was dropped here (" + ui.helper + ")."}; + } + if(hitMode == "over"){ + // Append as child node + node.addChild(copynode); + // expand the drop target + node.expand(true); + }else if(hitMode == "before"){ + // Add before this, i.e. as child of current parent + node.parent.addChild(copynode, node); + }else if(hitMode == "after"){ + // Add after this, i.e. as child of current parent + node.parent.addChild(copynode, node.getNextSibling()); + } + }, + onDragLeave: function(node, sourceNode) { + /** Always called if onDragEnter was called. + */ + logMsg("tree.onDragLeave(%o, %o)", node, sourceNode); + } + } + }); + // --- Initialize simple draggable sample ---------------------------------- + $("#draggableSample").draggable({ + revert: true, + connectToDynatree: true, + cursorAt: { top: -5, left:-5 }, + helper: "clone" + }); + // --- Initialize simple droppable sample ---------------------------------- + $("#droppableSample").droppable({ + hoverClass: "drophover", + addClasses: true, + over: function(event, ui) { + logMsg("droppable.over, %o, %o", event, ui); + }, + drop: function(event, ui) { + var source = ui.helper.data("dtSourceNode") || ui.draggable; + $(this).addClass("ui-state-highlight").find("p").html("Dropped " + source); +// alert("dropped"); + } + }); + <!-- Start_Exclude: This block is not part of the sample code --> + $("#skinCombo") + .val(0) // set state to prevent caching + .change(function(){ + var href = "../src/" + + $(this).val() + + "/ui.dynatree.css" + + "?reload=" + new Date().getTime(); + $("#skinSheet").attr("href", href); + }); + <!-- End_Exclude --> +}); +--></script> +</head> + +<body class="example"> + <h1>Example: Standard jQuery drag-and-drop</h1> + <p class="description"> + This sample uses the standard jQuery draggable and droppable. + </p> + <div> + Skin: + <select id="skinCombo" size="1"> + <option value="skin">Standard ('/skin/')</option> + <option value="skin-vista">Vista ('/skin-vista/')</option> + </select> + </div> + + <table> + <thead> + <tr> + <th> + <p>This tree allows dragging.</p> + </th> + <th> + <p>This tree allows dropping.</p> + </th> + </tr> + </thead> + <tbody> + <tr valign="top"> + <td> + <div id="tree"> </div> + </td> + <td> + <div id="tree2"></div> + </td> + </tr> + <tr> + <td> + <div>Active node: <span id="echoActive">-</span></div> + </td> + <td> + <div>Active node: <span id="echoActive2">-</span></div> + </td> + </tr> + <tr> + <td> + <div id="draggableSample" class="ui-widget-content"> + <p>Drag me around</p> + </div> + </td> + <td> + <div id="droppableSample" class="ui-widget-content"> + <p>Drop something here</p> + </div> + </td> + </tr> + </tbody> + </table> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-persist.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-persist.html new file mode 100644 index 0000000000000000000000000000000000000000..01e7652971f686ac256437ff1713b2e2f2ff3fd1 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-persist.html @@ -0,0 +1,121 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + + var treeData = [ + {title: "item1 with key and tooltip", tooltip: "Look, a tool tip!" }, + {title: "item2: selected on init", select: true }, + {title: "Folder with some children", isFolder: true, key: "id3", + children: [ + {title: "Sub-item 3.1", + children: [ + {title: "Sub-item 3.1.1", key: "id3.1.1" }, + {title: "Sub-item 3.1.2", key: "id3.1.2" } + ] + }, + {title: "Sub-item 3.2", + children: [ + {title: "Sub-item 3.2.1", key: "id3.2.1" }, + {title: "Sub-item 3.2.2", key: "id3.2.2" } + ] + } + ] + }, + {title: "Documnent with some children (expanded on init)", key: "id4", expand: true, + children: [ + {title: "Sub-item 4.1 (active on init)", activate: true, + children: [ + {title: "Sub-item 4.1.1", key: "id4.1.1" }, + {title: "Sub-item 4.1.2", key: "id4.1.2" } + ] + }, + {title: "Sub-item 4.2 (selected on init)", select: true, + children: [ + {title: "Sub-item 4.2.1", key: "id4.2.1" }, + {title: "Sub-item 4.2.2", key: "id4.2.2" } + ] + } + ] + } + ]; + + + $(function(){ + $("#tree").dynatree({ + persist: true, + checkbox: true, + children: treeData, +// clickFolderMode: 1, + selectMode: 2, + onPostInit: function(isReloading, isError) { + logMsg("onPostInit(): tree:%o, isReloading:%o, isError:%o", this, isReloading, isError); + logMsg("onPostInit(): tree.isReloading:%o, tree.isInitializing:%o", this.isReloading(), this.isInitializing()); + var persistData = this.getPersistData(); + logMsg("persistData: %o", persistData); + this.reactivate(); + }, + onActivate: function(node) { + logMsg("onActivate: %o, userEvent:%o", node, node.tree.isUserEvent()); + $("#echoActive").text(node.data.title); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + }, + onDblClick: function(node, event) { + logMsg("onDblClick(%o, %o)", node, event); + node.toggleExpand(); + } + }); + logMsg("after widget init: %o", this); + }); +</script> +</head> + +<body class="example"> + <h1>TEST: Persist</h1> + <p class="description"> + Cookie persistence and is enabled here.<br> + (Also, double-click handler expands document nodes.)<br> + Select a node and hit [F5] to refresh, to see how the active node and + expansion and selection states are restored.<br> + <br> + NOTE: if this doesn't seem to work, it's probably because the frame + content is cached by the browser.<br> + Try this example as an + <a href="#" target="_blank">unframed page</a>. + </p> + + <!-- Tree container --> + <div id="tree"></div> + <div>Active node: <span id="echoActive">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-preload.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-preload.html new file mode 100644 index 0000000000000000000000000000000000000000..5f2c5c9cb509e2c9fb2aeaa310383ea96fcabdc3 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-preload.html @@ -0,0 +1,115 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <!-- + jQuery.Preload Plugin by Ariel Flesler + http://flesler.blogspot.com/2008/01/jquerypreload.html + --> + <script src="../jquery/jquery.preload-min.js" type="text/javascript"></script> + + <link href="../src/skin-vista/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<script type="text/javascript"> + $(function(){ + // Preload images (roughly sorted by importance) + // Uses jQuery.Preload Plugin by Ariel Flesler (http://flesler.blogspot.com/2008/01/jquerypreload.html) + $.preload([ + "ltWait", + "vline", + "ltFld", "ltFld_o", + "ltL_", "ltL_ne", "ltL_nes", "ltL_ns", "ltM_ne", "ltM_nes", "ltP_ne", "ltP_nes", + "ltD_ne", "ltD_nes", "ltDoc", + "ltError", + "cbUnchecked", "cbUnchecked_hover", + "cbChecked", "cbChecked_hover", + "cbIntermediate", "cbIntermediate_hover", + "rbUnchecked", "rbUnchecked_hover", + "rbChecked", "rbChecked_hover", + "rbIntermediate", "rbIntermediate_hover", + "move_here", "copy_here", + "drop_accept", "drop_here", "drop_reject", "drop_sibling_here" + ], { + base: "skin/", + ext: ".jpg", + onComplete: function(data){ + // Loaded one image + logMsg("Loaded " + data.image); + }, + onFinish: function(data){ + // All images loaded: + logMsg("Loaded " + data.loaded + ", failed: " + data.failed); + } + }); + $("#tree").dynatree({ + // In real life we would call a URL on the server like this: +// initAjax: { +// url: "/getTopLevelNodesAsJson", +// data: { mode: "funnyMode" } +// }, + // .. but here we use a local file instead: + initAjax: { + url: "sample-data3.json", + cache: true, + dataType: "json", + type: "GET", + timeout: 5000, + async: false + }, + onLazyRead: function(node){ + node.appendAjax({ + url: "sample-data3.json", + cache: true, + dataType: "json", + type: "GET", + timeout: 5000, + async: false + }); + }, + onActivate: function(node) { + $("#echoActive").text(node.data.title); + }, + onDeactivate: function(node) { + $("#echoActive").text("-"); + } + }); + }); +</script> +</head> + +<body class="example"> + <h1>Example: Init from Ajax request</h1> + <p class="description"> + This sample initializes the tree from a JSON request. + </p> + + <!-- Add a <div> element where the tree should appear: --> + <div id="tree"> </div> + + <div>Active node: <span id="echoActive">-</span></div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-release.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-release.html new file mode 100644 index 0000000000000000000000000000000000000000..bcfd8a0867d4dec5d145201a3a41bc3faa3bfd56 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-release.html @@ -0,0 +1,82 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + + <title>dynatree - Q'n'd test for release</title> + +<!-- +OLD jQuery 1.3 UI 1.7 + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.js" type="text/javascript"></script> + <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/jquery-ui.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> +LATEST CDN + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.js" type="text/javascript"></script> + <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> +DIST + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> +MINIFIED DIST + <script src="../jquery/jquery.min.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.min.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.min.js" type="text/javascript"></script> +--> + <!-- Include the required JavaScript libraries: --> + <script src="../jquery/jquery.min.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.min.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.min.js" type="text/javascript"></script> + + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + + alert("$.ui.version: " + $.ui.version + "\n" + + "$.jquery.version: " + jQuery.fn.jquery); + + $(function(){ + // Attach the dynatree widget to an existing <div id="tree"> element + // and pass the tree options as an argument to the dynatree() function: + $("#tree").dynatree({ + onActivate: function(node) { + // A DynaTreeNode object is passed to the activation handler + // Note: we also get this event, if persistence is on, and the page is reloaded. + alert("You activated " + node.data.title); + }, + onSelect: function(select, node) { + logMsg("onSelect(%o, %o)", node); + var s = node.tree.getSelectedNodes().join(", "); + $("#echoSelected").text(s); + }, +// persist: true, + children: [ + {title: "Item 1"}, + {title: "Folder 2", isFolder: true, key: "folder2", + children: [ + {title: "Sub-item 2.1"}, + {title: "Sub-item 2.2"} + ] + }, + {title: "Item 3"} + ] + }); + }); + </script> +</head> +<body> + <!-- Add a <div> element where the tree should appear: --> + <p>This tree uses the minified JS library. (Check this with IE!)</p> + <div id="tree"> ERROR: Tree could not be loaded!</div> + +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-table.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-table.html new file mode 100644 index 0000000000000000000000000000000000000000..7c3f87b25fe3fbd37325b8f96876f7329e7f1e4a --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-table.html @@ -0,0 +1,104 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + <style type="text/css"> + ul.dynatree-container span.td { + position: absolute; + display: inline; + border-size: 1px; + overflow: hidden; + background-color: white; + } + ul.dynatree-container span.td:nth-child(1) { + position: static; + } + ul.dynatree-container span.td:nth-child(2) { + color: red; + left: 150px; + width: 50px; + } + ul.dynatree-container span.td:nth-child(3) { + color: green; + left: 200px; + width: 150px; + } + </style> + <!-- Add code to initialize the tree when the document is loaded: --> + <script type="text/javascript"> + $(function(){ + // Attach the dynatree widget to an existing <div id="tree"> element + // and pass the tree options as an argument to the dynatree() function: + $("#tree").dynatree({ + onActivate: function(node) { + }, + onCustomRender: function(node) { + // Render title as columns + if(node.data.title.indexOf("~") === -1){ + // Default rendering + return false; + } + var cols = node.data.title.split("~"), + html = "<a class='dynatree-title' href='#'>"; + for(var i=0; i<cols.length; i++){ + html += "<span class='td'>" + cols[i] + "</span>"; + } + return html + "</a>"; + }, + children: [ + {title: "Item 1~ico1~sdflkh sdfkjuhds fkjd kjhdf"}, + {title: "Item 2~ico1~fkjd kjhdf"}, + {title: "Folder 2", isFolder: true, key: "folder2", + children: [ + {title: "Sub Item 1~ico1~sdflkh sdfkjuhds fkjd kjhdf"}, + {title: "Sub Item 2 xxx~ico1~fkjd kjhdf"} + ] + }, + {title: "Folder 3", isFolder: true, key: "folder3", + children: [ + {title: "Sub Item 1~ico1~sdflkh sdfkjuhds fkjd kjhdf"}, + {title: "Sub Item 2 xxx~ico1~fkjd kjhdf"} + ] + }, + {title: "Item 3"} + ] + }); + }); + </script> +</head> +<body class="example"> + <h1>Example: column simulation</h1> + <p class="description"> + This sample shows, how titles could displayed as aligned columns. + </p> + + <!-- Add a <div> element where the tree should appear: --> + <div id="tree"> </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-xhtml.xhtml b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-xhtml.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..49de333a8386404140d6ea7869a667dfdf2575a8 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test-xhtml.xhtml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>dynatree - temporary tests</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Add code to initialize the tree when the document is loaded: --> + <script type='text/javascript'> + /* <![CDATA[ */ + + $(function(){ + $("#tree").dynatree({ + rootVisible: true, + rootCollapsible: false, + keyboard: true, + persist: true, + children: [ + {title: "Node 1", expand: true, key: "_1", + children: [ + {title: "Node 1.1" }, + {title: "Node 1.2", isFolder: true, expand: true, key: "_12", + children: [ + {title: "Node 1.2.1" }, + {title: "Node 1.2.2", key: "_122", + children: [ + {title: "Node 1.2.2.1" }, + {title: "Node 1.2.2.2" }, + {title: "Node 1.2.2.3" } + ] + }, + {title: "Node 1.2.3", + children: [] + } + ] + }, + {title: "Node 1.3" } + ] + }, + {title: "Node 2" } + ], + onSelect: function(dtnode) { + $("#echoSelected").text(dtnode.data.title); + //alert("You selected " + dtnode.data.title); + }, + onLazyRead: function(dtnode) { + logMsg("Benchmarking mode='" + dtnode.data.mode + "' done."); + } + }); + $("#tree2").dynatree({ + onSelect: function(dtnode) { + $("#echoSelected").text(dtnode.data.title); + //alert("You selected " + dtnode.data.title); + } + }); + $("#btnRemoveDiv").click(function(){ + logMsg("removing %o", $("#tree")); + $("#tree").remove(); + }); + $("#btn50").click(function(){ + $("#tree").dynatree("getRoot").append({title: 'i50', expand: true}); + }); + + }); + + /* ]]> */ + </script> +</head> +<body> + <p>This file is only temporarily used to reproduce issues.</p> + <p style="color: red;">Using doctype XHTML 1.0 Strict.</p> + <div id='tree'> </div> + + <div>Selected node: <span id="echoSelected">-</span></div> + <div>Focused node: <span id="echoFocused">-</span></div> + <p> + <button id="btnRemoveDiv">Remove main div</button> + <button id="btn50">issue #50</button> + <button id="btnDiv">dynamic div issue</button> + </p> + <div id='tree2'> + <ul> + <li data="{title: 'node1'}">node1</li> + <li data="{title: 'node2'}">node2</li> + </ul> + </div> + + + <p><a href="http://dynatree.googlecode.com">jquery.dynatree.js</a></p> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test_??? b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test_??? new file mode 100644 index 0000000000000000000000000000000000000000..30d74d258442c7c65512eafab474568dd706c430 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/doc/test_??? @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/index.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/index.html new file mode 100644 index 0000000000000000000000000000000000000000..cdf6abe4d484b559aefcd9079fffc4bfa5bd0f01 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/index.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree</title> +</head> + +<body class="example"> + <h1>dynatree.js</h1> + <ul> + <li><a href="doc/samples.html">Example Browser</a> + <li><a href="doc/dynatree-doc.html">Documentation</a> + <li><a href="http://dynatree.googlecode.com">Project home</a> + </ul> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/README.txt b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..4094d90d611710200754ca05f8759a0fd5769937 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/README.txt @@ -0,0 +1,27 @@ +This folder contains copies of the required jQuery libraries for use with +Dynatree 1.0 + +Currently using + +- jquery.js: + jQuery 1.7.1 + +- jquery-ui.custom.js: + jQuery UI 1.8.17 with all modules selected. + +- jquery.min.js and jquery-ui.custom.min.js: + Minified versions of the above + +Current versions are always available at + http://jqueryui.com/download + +Include the required libs like this: + <script src='../jquery/jquery.js' type='text/javascript'></script> + <script src='../jquery/jquery-ui.custom.js' type='text/javascript'></script> + <script src='../jquery/jquery.cookie.js' type='text/javascript'></script> + + +Alternatively the current libs may be we included from CDNs, for example + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.js" type="text/javascript"></script> + <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js" type="text/javascript"></script> + <script src='../jquery/jquery.cookie.js' type='text/javascript'></script> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery-ui.custom.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery-ui.custom.js new file mode 100644 index 0000000000000000000000000000000000000000..8dafccf7d0ff6c160aa6fad5935d1577be557142 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery-ui.custom.js @@ -0,0 +1,11727 @@ +/*! + * jQuery UI 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function( $, undefined ) { + +// prevent duplicate loading +// this is only a problem because we proxy existing functions +// and we don't want to double proxy them +$.ui = $.ui || {}; +if ( $.ui.version ) { + return; +} + +$.extend( $.ui, { + version: "1.8.24", + + keyCode: { + ALT: 18, + BACKSPACE: 8, + CAPS_LOCK: 20, + COMMA: 188, + COMMAND: 91, + COMMAND_LEFT: 91, // COMMAND + COMMAND_RIGHT: 93, + CONTROL: 17, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + INSERT: 45, + LEFT: 37, + MENU: 93, // COMMAND_RIGHT + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SHIFT: 16, + SPACE: 32, + TAB: 9, + UP: 38, + WINDOWS: 91 // COMMAND + } +}); + +// plugins +$.fn.extend({ + propAttr: $.fn.prop || $.fn.attr, + + _focus: $.fn.focus, + focus: function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + this._focus.apply( this, arguments ); + }, + + scrollParent: function() { + var scrollParent; + if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1)); + }).eq(0); + } + + return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> + value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +// support: jQuery <1.8 +if ( !$( "<a>" ).outerWidth( 1 ).jquery ) { + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; + if ( border ) { + size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); +} + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + var map = element.parentNode, + mapName = map.name, + img; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) + ? !element.disabled + : "a" == nodeName + ? element.href || isTabIndexNotNaN + : isTabIndexNotNaN) + // the element and all of its ancestors must be visible + && visible( element ); +} + +function visible( element ) { + return !$( element ).parents().andSelf().filter(function() { + return $.curCSS( this, "visibility" ) === "hidden" || + $.expr.filters.hidden( this ); + }).length; +} + +$.extend( $.expr[ ":" ], { + data: $.expr.createPseudo ? + $.expr.createPseudo(function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + }) : + // support: jQuery <1.8 + function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support +$(function() { + var body = document.body, + div = body.appendChild( div = document.createElement( "div" ) ); + + // access offsetHeight before setting the style to prevent a layout bug + // in IE 9 which causes the elemnt to continue to take up space even + // after it is removed from the DOM (#8026) + div.offsetHeight; + + $.extend( div.style, { + minHeight: "100px", + height: "auto", + padding: 0, + borderWidth: 0 + }); + + $.support.minHeight = div.offsetHeight === 100; + $.support.selectstart = "onselectstart" in div; + + // set display to none to avoid a layout bug in IE + // http://dev.jquery.com/ticket/4014 + body.removeChild( div ).style.display = "none"; +}); + +// jQuery <1.4.3 uses curCSS, in 1.4.3 - 1.7.2 curCSS = css, 1.8+ only has css +if ( !$.curCSS ) { + $.curCSS = $.css; +} + + + + + +// deprecated +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use the proxy pattern instead. + plugin: { + add: function( module, option, set ) { + var proto = $.ui[ module ].prototype; + for ( var i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode ) { + return; + } + + for ( var i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains() + contains: function( a, b ) { + return document.compareDocumentPosition ? + a.compareDocumentPosition( b ) & 16 : + a !== b && a.contains( b ); + }, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + }, + + // these are odd functions, fix the API or move into individual plugins + isOverAxis: function( x, reference, size ) { + //Determines when x coordinate is over "b" element axis + return ( x > reference ) && ( x < ( reference + size ) ); + }, + isOver: function( y, x, top, left, height, width ) { + //Determines when x, y coordinates is over "b" element + return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width ); + } +}); + +})( jQuery ); +/*! + * jQuery UI Widget 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Widget + */ +(function( $, undefined ) { + +// jQuery 1.4+ +if ( $.cleanData ) { + var _cleanData = $.cleanData; + $.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); + }; +} else { + var _remove = $.fn.remove; + $.fn.remove = function( selector, keepData ) { + return this.each(function() { + if ( !keepData ) { + if ( !selector || $.filter( selector, [ this ] ).length ) { + $( "*", this ).add( [ this ] ).each(function() { + try { + $( this ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + }); + } + } + return _remove.call( $(this), selector, keepData ); + }); + }; +} + +$.widget = function( name, base, prototype ) { + var namespace = name.split( "." )[ 0 ], + fullName; + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName ] = function( elem ) { + return !!$.data( elem, name ); + }; + + $[ namespace ] = $[ namespace ] || {}; + $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + + var basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from +// $.each( basePrototype, function( key, val ) { +// if ( $.isPlainObject(val) ) { +// basePrototype[ key ] = $.extend( {}, val ); +// } +// }); + basePrototype.options = $.extend( true, {}, basePrototype.options ); + $[ namespace ][ name ].prototype = $.extend( true, basePrototype, { + namespace: namespace, + widgetName: name, + widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name, + widgetBaseClass: fullName + }, prototype ); + + $.widget.bridge( name, $[ namespace ][ name ] ); +}; + +$.widget.bridge = function( name, object ) { + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = Array.prototype.slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.extend.apply( null, [ true, options ].concat(args) ) : + options; + + // prevent calls to internal methods + if ( isMethodCall && options.charAt( 0 ) === "_" ) { + return returnValue; + } + + if ( isMethodCall ) { + this.each(function() { + var instance = $.data( this, name ), + methodValue = instance && $.isFunction( instance[options] ) ? + instance[ options ].apply( instance, args ) : + instance; + // TODO: add this back in 1.9 and use $.error() (see #5972) +// if ( !instance ) { +// throw "cannot call methods on " + name + " prior to initialization; " + +// "attempted to call method '" + options + "'"; +// } +// if ( !$.isFunction( instance[options] ) ) { +// throw "no such method '" + options + "' for " + name + " widget instance"; +// } +// var methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, name ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, name, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( options, element ) { + // allow instantiation without initializing for simple inheritance + if ( arguments.length ) { + this._createWidget( options, element ); + } +}; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + options: { + disabled: false + }, + _createWidget: function( options, element ) { + // $.widget.bridge stores the plugin instance, but we do it anyway + // so that it's stored even before the _create function runs + $.data( element, this.widgetName, this ); + this.element = $( element ); + this.options = $.extend( true, {}, + this.options, + this._getCreateOptions(), + options ); + + var self = this; + this.element.bind( "remove." + this.widgetName, function() { + self.destroy(); + }); + + this._create(); + this._trigger( "create" ); + this._init(); + }, + _getCreateOptions: function() { + return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ]; + }, + _create: function() {}, + _init: function() {}, + + destroy: function() { + this.element + .unbind( "." + this.widgetName ) + .removeData( this.widgetName ); + this.widget() + .unbind( "." + this.widgetName ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetBaseClass + "-disabled " + + "ui-state-disabled" ); + }, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.extend( {}, this.options ); + } + + if (typeof key === "string" ) { + if ( value === undefined ) { + return this.options[ key ]; + } + options = {}; + options[ key ] = value; + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var self = this; + $.each( options, function( key, value ) { + self._setOption( key, value ); + }); + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) + .attr( "aria-disabled", value ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + + return !( $.isFunction(callback) && + callback.call( this.element[0], event, data ) === false || + event.isDefaultPrevented() ); + } +}; + +})( jQuery ); +/*! + * jQuery UI Mouse 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Mouse + * + * Depends: + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var mouseHandled = false; +$( document ).mouseup( function( e ) { + mouseHandled = false; +}); + +$.widget("ui.mouse", { + options: { + cancel: ':input,option', + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var self = this; + + this.element + .bind('mousedown.'+this.widgetName, function(event) { + return self._mouseDown(event); + }) + .bind('click.'+this.widgetName, function(event) { + if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) { + $.removeData(event.target, self.widgetName + '.preventClickEvent'); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind('.'+this.widgetName); + if ( this._mouseMoveDelegate ) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + } + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if( mouseHandled ) { return }; + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var self = this, + btnIsLeft = (event.which == 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + self.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) { + $.removeData(event.target, this.widgetName + '.preventClickEvent'); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return self._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return self._mouseUp(event); + }; + $(document) + .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate) + .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target == this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + '.preventClickEvent', true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(event) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(event) {}, + _mouseDrag: function(event) {}, + _mouseStop: function(event) {}, + _mouseCapture: function(event) { return true; } +}); + +})(jQuery); +/*! + * jQuery UI Position 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var horizontalPositions = /left|center|right/, + verticalPositions = /top|center|bottom/, + center = "center", + support = {}, + _position = $.fn.position, + _offset = $.fn.offset; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var target = $( options.of ), + targetElem = target[0], + collision = ( options.collision || "flip" ).split( " " ), + offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ], + targetWidth, + targetHeight, + basePosition; + + if ( targetElem.nodeType === 9 ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: 0, left: 0 }; + // TODO: use $.isWindow() in 1.9 + } else if ( targetElem.setTimeout ) { + targetWidth = target.width(); + targetHeight = target.height(); + basePosition = { top: target.scrollTop(), left: target.scrollLeft() }; + } else if ( targetElem.preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + targetWidth = targetHeight = 0; + basePosition = { top: options.of.pageY, left: options.of.pageX }; + } else { + targetWidth = target.outerWidth(); + targetHeight = target.outerHeight(); + basePosition = target.offset(); + } + + // force my and at to have valid horizontal and veritcal positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[this] || "" ).split( " " ); + if ( pos.length === 1) { + pos = horizontalPositions.test( pos[0] ) ? + pos.concat( [center] ) : + verticalPositions.test( pos[0] ) ? + [ center ].concat( pos ) : + [ center, center ]; + } + pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center; + pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center; + options[ this ] = pos; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + // normalize offset option + offset[ 0 ] = parseInt( offset[0], 10 ) || 0; + if ( offset.length === 1 ) { + offset[ 1 ] = offset[ 0 ]; + } + offset[ 1 ] = parseInt( offset[1], 10 ) || 0; + + if ( options.at[0] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[0] === center ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[1] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[1] === center ) { + basePosition.top += targetHeight / 2; + } + + basePosition.left += offset[ 0 ]; + basePosition.top += offset[ 1 ]; + + return this.each(function() { + var elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, + marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, + collisionWidth = elemWidth + marginLeft + + ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ), + collisionHeight = elemHeight + marginTop + + ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ), + position = $.extend( {}, basePosition ), + collisionPosition; + + if ( options.my[0] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[0] === center ) { + position.left -= elemWidth / 2; + } + + if ( options.my[1] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[1] === center ) { + position.top -= elemHeight / 2; + } + + // prevent fractions if jQuery version doesn't support them (see #5280) + if ( !support.fractions ) { + position.left = Math.round( position.left ); + position.top = Math.round( position.top ); + } + + collisionPosition = { + left: position.left - marginLeft, + top: position.top - marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[i] ] ) { + $.ui.position[ collision[i] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: offset, + my: options.my, + at: options.at + }); + } + }); + + if ( $.fn.bgiframe ) { + elem.bgiframe(); + } + elem.offset( $.extend( position, { using: options.using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(); + position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left ); + }, + top: function( position, data ) { + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(); + position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top ); + } + }, + + flip: { + left: function( position, data ) { + if ( data.at[0] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(), + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + -data.targetWidth, + offset = -2 * data.offset[ 0 ]; + position.left += data.collisionPosition.left < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + }, + top: function( position, data ) { + if ( data.at[1] === center ) { + return; + } + var win = $( window ), + over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(), + myOffset = data.my[ 1 ] === "top" ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + -data.targetHeight, + offset = -2 * data.offset[ 1 ]; + position.top += data.collisionPosition.top < 0 ? + myOffset + atOffset + offset : + over > 0 ? + myOffset + atOffset + offset : + 0; + } + } +}; + +// offset setter from jQuery 1.4 +if ( !$.offset.setOffset ) { + $.offset.setOffset = function( elem, options ) { + // set position first, in-case top/left are set even on static elem + if ( /static/.test( $.curCSS( elem, "position" ) ) ) { + elem.style.position = "relative"; + } + var curElem = $( elem ), + curOffset = curElem.offset(), + curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0, + curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0, + props = { + top: (options.top - curOffset.top) + curTop, + left: (options.left - curOffset.left) + curLeft + }; + + if ( 'using' in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + }; + + $.fn.offset = function( options ) { + var elem = this[ 0 ]; + if ( !elem || !elem.ownerDocument ) { return null; } + if ( options ) { + if ( $.isFunction( options ) ) { + return this.each(function( i ) { + $( this ).offset( options.call( this, i, $( this ).offset() ) ); + }); + } + return this.each(function() { + $.offset.setOffset( this, options ); + }); + } + return _offset.call( this ); + }; +} + +// jQuery <1.4.3 uses curCSS, in 1.4.3 - 1.7.2 curCSS = css, 1.8+ only has css +if ( !$.curCSS ) { + $.curCSS = $.css; +} + +// fraction support test (older versions of jQuery don't support fractions) +(function () { + var body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ), + testElement, testElementParent, testElementStyle, offset, offsetTotal; + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( var i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;"; + + offset = $( div ).offset( function( _, offset ) { + return offset; + }).offset(); + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); + + offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 ); + support.fractions = offsetTotal > 21 && offsetTotal < 22; +})(); + +}( jQuery )); +/*! + * jQuery UI Draggable 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false + }, + _create: function() { + + if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) + this.element[0].style.position = 'relative'; + + (this.options.addClasses && this.element.addClass("ui-draggable")); + (this.options.disabled && this.element.addClass("ui-draggable-disabled")); + + this._mouseInit(); + + }, + + destroy: function() { + if(!this.element.data('draggable')) return; + this.element + .removeData("draggable") + .unbind(".draggable") + .removeClass("ui-draggable" + + " ui-draggable-dragging" + + " ui-draggable-disabled"); + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle')) + return false; + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) + return false; + + if ( o.iframeFix ) { + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + } + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + this.helper.addClass("ui-draggable-dragging"); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css("position"); + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) + if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event); + + return true; + }, + + _mouseDrag: function(event, noPropagation) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger('drag', event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.position; + } + + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) + dropped = $.ui.ddmanager.drop(this, event); + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is no longer in the DOM don't bother to continue (see #8269) + var element = this.element[0], elementInDom = false; + while ( element && (element = element.parentNode) ) { + if (element == document ) { + elementInDom = true; + } + } + if ( !elementInDom && this.options.helper === "original" ) + return false; + + if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + var self = this; + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(self._trigger("stop", event) !== false) { + self._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + _mouseUp: function(event) { + //Remove frame helpers + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); + + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) + if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + + var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; + $(this.options.handle, this.element) + .find("*") + .andSelf() + .each(function() { + if(this == event.target) handle = true; + }); + + return handle; + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element); + + if(!helper.parents('body').length) + helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo)); + + if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) + helper.css("position", "absolute"); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0), + right: (parseInt(this.element.css("marginRight"),10) || 0), + bottom: (parseInt(this.element.css("marginBottom"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, + (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { + var c = $(o.containment); + var ce = c[0]; if(!ce) return; + var co = c.offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0), + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0), + (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, + (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; + + } else if(o.containment.constructor == Array) { + this.containment = o.containment; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + var containment; + if(this.containment) { + if (this.relative_container){ + var co = this.relative_container.offset(); + containment = [ this.containment[0] + co.left, + this.containment[1] + co.top, + this.containment[2] + co.left, + this.containment[3] + co.top ]; + } + else { + containment = this.containment; + } + + if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top; + } + + if(o.grid) { + //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) + var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; + pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; + pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove(); + //if($.ui.ddmanager) $.ui.ddmanager.current = null; + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function(event) { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.extend($.ui.draggable, { + version: "1.8.24" +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid' + if(this.shouldRevert) this.instance.options.revert = true; + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper == 'original') + this.instance.currentItem.css({ top: 'auto', left: 'auto' }); + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), self = this; + + var checkPos = function(o) { + var dyClick = this.offset.click.top, dxClick = this.offset.click.left; + var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left; + var itemHeight = o.height, itemWidth = o.width; + var itemTop = o.top, itemLeft = o.left; + + return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth); + }; + + $.each(inst.sortables, function(i) { + + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) this.instance._mouseDrag(event); + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger('out', event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) this.instance.placeholder.remove(); + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + }; + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function(event, ui) { + var t = $('body'), o = $(this).data('draggable').options; + if (t.css("cursor")) o._cursor = t.css("cursor"); + t.css("cursor", o.cursor); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if (o._cursor) $('body').css("cursor", o._cursor); + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data('draggable').options; + if(t.css("opacity")) o._opacity = t.css("opacity"); + t.css('opacity', o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data('draggable').options; + if(o._opacity) $(ui.helper).css('opacity', o._opacity); + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function(event, ui) { + var i = $(this).data("draggable"); + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset(); + }, + drag: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') { + + if(!o.axis || o.axis != 'x') { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if(!o.axis || o.axis != 'y') { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(!o.axis || o.axis != 'x') { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(!o.axis || o.axis != 'y') { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(i, event); + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function(event, ui) { + + var i = $(this).data("draggable"), o = i.options; + i.snapElements = []; + + $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() { + var $t = $(this); var $o = $t.offset(); + if(this != i.element[0]) i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("draggable"), o = inst.options; + var d = o.snapTolerance; + + var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (var i = inst.snapElements.length - 1; i >= 0; i--){ + + var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width, + t = inst.snapElements[i].top, b = t + inst.snapElements[i].height; + + //Yes, I know, this is insane ;) + if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) { + if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode != 'inner') { + var ts = Math.abs(t - y2) <= d; + var bs = Math.abs(b - y1) <= d; + var ls = Math.abs(l - x2) <= d; + var rs = Math.abs(r - x1) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + + var first = (ts || bs || ls || rs); + + if(o.snapMode != 'outer') { + var ts = Math.abs(t - y1) <= d; + var bs = Math.abs(b - y2) <= d; + var ls = Math.abs(l - x1) <= d; + var rs = Math.abs(r - x2) <= d; + if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + }; + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function(event, ui) { + + var o = $(this).data("draggable").options; + + var group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + if (!group.length) { return; } + + var min = parseInt(group[0].style.zIndex) || 0; + $(group).each(function(i) { + this.style.zIndex = min + i; + }); + + this[0].style.zIndex = min + group.length; + + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("draggable").options; + if(t.css("zIndex")) o._zIndex = t.css("zIndex"); + t.css('zIndex', o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("draggable").options; + if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex); + } +}); + +})(jQuery); +/*! + * jQuery UI Droppable 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Droppables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.mouse.js + * jquery.ui.draggable.js + */ +(function( $, undefined ) { + +$.widget("ui.droppable", { + widgetEventPrefix: "drop", + options: { + accept: '*', + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: 'default', + tolerance: 'intersect' + }, + _create: function() { + + var o = this.options, accept = o.accept; + this.isover = 0; this.isout = 1; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + //Store the droppable's proportions + this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + destroy: function() { + var drop = $.ui.ddmanager.droppables[this.options.scope]; + 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"); + + return this; + }, + + _setOption: function(key, value) { + + if(key == 'accept') { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.addClass(this.options.activeClass); + (draggable && this._trigger('activate', event, this.ui(draggable))); + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + (draggable && this._trigger('deactivate', event, this.ui(draggable))); + }, + + _over: function(event) { + + 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.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.addClass(this.options.hoverClass); + this._trigger('over', event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + 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.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('out', event, this.ui(draggable)); + } + + }, + + _drop: function(event,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(":data(droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, 'droppable'); + if( + inst.options.greedy + && !inst.options.disabled + && inst.options.scope == draggable.options.scope + && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) + && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) return false; + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) this.element.removeClass(this.options.activeClass); + if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass); + this._trigger('drop', event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.extend($.ui.droppable, { + version: "1.8.24" +}); + +$.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': + var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left), + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top), + isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width); + return isOver; + 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: { 'default': [] }, + prepareOffsets: function(t, event) { + + var m = $.ui.ddmanager.droppables[t.options.scope] || []; + var type = event ? event.type : null; // workaround for #2317 + var list = (t.currentItem || t.element).find(":data(droppable)").andSelf(); + + droppablesLoop: for (var i = 0; i < m.length; i++) { + + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted + for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item + m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue + + if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables + + m[i].offset = m[i].element.offset(); + m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight }; + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(!this.options) return; + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) + dropped = this._drop.call(this, event) || dropped; + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = 1; this.isover = 0; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parents( ":not(body,html)" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + }); + }, + drag: function(draggable, event) { + + //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, event); + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.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) { + // find droppable parents with same scope + var scope = this.options.scope; + var parent = this.element.parents(':data(droppable)').filter(function () { + return $.data(this, 'droppable').options.scope === scope; + }); + + 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, event); + } + + this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0; + this[c == "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c == 'isout') { + parentInstance['isout'] = 0; + parentInstance['isover'] = 1; + parentInstance._over.call(parentInstance, event); + } + }); + + }, + dragStop: function( draggable, event ) { + draggable.element.parents( ":not(body,html)" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); + } +}; + +})(jQuery); +/*! + * jQuery UI Resizable 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.resizable", $.ui.mouse, { + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + zIndex: 1000 + }, + _create: function() { + + var self = this, o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({ + position: this.element.css('position'), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css('top'), + left: this.element.css('left') + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "resizable", this.element.data('resizable') + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css('resize'); + this.originalElement.css('resize', 'none'); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css('margin') }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' }); + if(this.handles.constructor == String) { + + if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw'; + var n = this.handles.split(","); this.handles = {}; + + for(var i = 0; i < n.length; i++) { + + var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle; + var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>'); + + // Apply zIndex to all handles - see #7960 + axis.css({ zIndex: o.zIndex }); + + //TODO : What's going on here? + if ('se' == handle) { + axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se'); + }; + + //Insert into internal handles object and append to element + this.handles[handle] = '.ui-resizable-'+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + target = target || this.element; + + for(var i in this.handles) { + + if(this.handles[i].constructor == String) + this.handles[i] = $(this.handles[i], this.element).show(); + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + var axis = $(this.handles[i], this.element), padWrapper = 0; + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + var padPos = [ 'padding', + /ne|nw|n/.test(i) ? 'Top' : + /se|sw|s/.test(i) ? 'Bottom' : + /^e$/.test(i) ? 'Right' : 'Left' ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) + continue; + + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $('.ui-resizable-handle', this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!self.resizing) { + if (this.className) + var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + //Axis, default = se + self.axis = axis && axis[1] ? axis[1] : 'se'; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .hover(function() { + if (o.disabled) return; + $(this).removeClass("ui-resizable-autohide"); + self._handles.show(); + }, + function(){ + if (o.disabled) return; + if (!self.resizing) { + $(this).addClass("ui-resizable-autohide"); + self._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + destroy: function() { + + this._mouseDestroy(); + + var _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + var wrapper = this.element; + wrapper.after( + this.originalElement.css({ + position: wrapper.css('position'), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css('top'), + left: wrapper.css('left') + }) + ).remove(); + } + + this.originalElement.css('resize', this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var handle = false; + for (var i in this.handles) { + if ($(this.handles[i])[0] == event.target) { + handle = true; + } + } + + return !this.options.disabled && handle; + }, + + _mouseStart: function(event) { + + var o = this.options, iniPos = this.element.position(), el = this.element; + + this.resizing = true; + this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() }; + + // bugfix for http://dev.jquery.com/ticket/1749 + if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) { + el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left }); + } + + this._renderProxy(); + + var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top')); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + var cursor = $('.ui-resizable-' + this.axis).css('cursor'); + $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var el = this.helper, o = this.options, props = {}, + self = this, smp = this.originalMousePosition, a = this.axis; + + var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0; + var trigger = this._change[a]; + if (!trigger) return false; + + // Calculate the attrs that will be change + var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; + + // Put this in the mouseDrag handler since the user can start pressing shift while resizing + this._updateVirtualBoundaries(event.shiftKey); + if (this._aspectRatio || event.shiftKey) + data = this._updateRatio(data, event); + + data = this._respectSize(data, event); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + el.css({ + top: this.position.top + "px", left: this.position.left + "px", + width: this.size.width + "px", height: this.size.height + "px" + }); + + if (!this._helper && this._proportionallyResizeElements.length) + this._proportionallyResize(); + + this._updateCache(data); + + // calling the user callback at the end + this._trigger('resize', event, this.ui()); + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var o = this.options, self = this; + + if(this._helper) { + var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + if (!o.animate) + this.element.css($.extend(s, { top: top, left: left })); + + self.helper.height(self.size.height); + self.helper.width(self.size.width); + + if (this._helper && !o.animate) this._proportionallyResize(); + } + + $('body').css('cursor', 'auto'); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) this.helper.remove(); + return false; + + }, + + _updateVirtualBoundaries: function(forceAspectRatio) { + var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b; + + b = { + minWidth: isNumber(o.minWidth) ? o.minWidth : 0, + maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, + minHeight: isNumber(o.minHeight) ? o.minHeight : 0, + maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity + }; + + if(this._aspectRatio || forceAspectRatio) { + // We want to create an enclosing box whose aspect ration is the requested one + // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension + pMinWidth = b.minHeight * this.aspectRatio; + pMinHeight = b.minWidth / this.aspectRatio; + pMaxWidth = b.maxHeight * this.aspectRatio; + pMaxHeight = b.maxWidth / this.aspectRatio; + + if(pMinWidth > b.minWidth) b.minWidth = pMinWidth; + if(pMinHeight > b.minHeight) b.minHeight = pMinHeight; + if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth; + if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight; + } + this._vBoundaries = b; + }, + + _updateCache: function(data) { + var o = this.options; + this.offset = this.helper.offset(); + if (isNumber(data.left)) this.position.left = data.left; + if (isNumber(data.top)) this.position.top = data.top; + if (isNumber(data.height)) this.size.height = data.height; + if (isNumber(data.width)) this.size.width = data.width; + }, + + _updateRatio: function(data, event) { + + var o = this.options, cpos = this.position, csize = this.size, a = this.axis; + + if (isNumber(data.height)) data.width = (data.height * this.aspectRatio); + else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio); + + if (a == 'sw') { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a == 'nw') { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function(data, event) { + + var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); + + if (isminw) data.width = o.minWidth; + if (isminh) data.height = o.minHeight; + if (ismaxw) data.width = o.maxWidth; + if (ismaxh) data.height = o.maxHeight; + + var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height; + var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + + if (isminw && cw) data.left = dw - o.minWidth; + if (ismaxw && cw) data.left = dw - o.maxWidth; + if (isminh && ch) data.top = dh - o.minHeight; + if (ismaxh && ch) data.top = dh - o.maxHeight; + + // fixing jump error on top/left - bug #2330 + var isNotwh = !data.width && !data.height; + if (isNotwh && !data.left && data.top) data.top = null; + else if (isNotwh && !data.top && data.left) data.left = null; + + return data; + }, + + _proportionallyResize: function() { + + var o = this.options; + if (!this._proportionallyResizeElements.length) return; + var element = this.helper || this.element; + + for (var i=0; i < this._proportionallyResizeElements.length; i++) { + + var prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')], + p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')]; + + this.borderDif = $.map(b, function(v, i) { + var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0; + return border + padding; + }); + } + + if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length))) + continue; + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + }; + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $('<div style="overflow:hidden;"></div>'); + + // fix ie6 offset TODO: This seems broken + var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), + pxyoffset = ( ie6 ? 2 : -1 ); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() + pxyoffset, + height: this.element.outerHeight() + pxyoffset, + position: 'absolute', + left: this.elementOffset.left - ie6offset +'px', + top: this.elementOffset.top - ie6offset +'px', + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx, dy) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var o = this.options, cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n != "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +$.extend($.ui.resizable, { + version: "1.8.24" +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function (event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10) + }); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition; + + var delta = { + height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0, + top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left']; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) + style[prop] = sum || null; + }); + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function (event, ui) { + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "animate", { + + stop: function(event, ui) { + var self = $(this).data("resizable"), o = self.options; + + var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; + + var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, + top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; + + self.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(self.element.css('width'), 10), + height: parseInt(self.element.css('height'), 10), + top: parseInt(self.element.css('top'), 10), + left: parseInt(self.element.css('left'), 10) + }; + + if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height }); + + // propagating resize, and updating values for each animation step + self._updateCache(data); + self._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, el = self.element; + var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + if (!ce) return; + + self.containerElement = $(ce); + + if (/document/.test(oc) || oc == document) { + self.containerOffset = { left: 0, top: 0 }; + self.containerPosition = { left: 0, top: 0 }; + + self.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + var element = $(ce), p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + self.containerOffset = element.offset(); + self.containerPosition = element.position(); + self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + self.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, + ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position, + pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement; + + if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co; + + if (cp.left < (self._helper ? co.left : 0)) { + self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left)); + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + self.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (self._helper ? co.top : 0)) { + self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top); + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + self.position.top = self._helper ? co.top : 0; + } + + self.offset.left = self.parentData.left+self.position.left; + self.offset.top = self.parentData.top+self.position.top; + + var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ), + hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height ); + + var isParent = self.containerElement.get(0) == self.element.parent().get(0), + isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position')); + + if(isParent && isOffsetRelative) woset -= self.parentData.left; + + if (woset + self.size.width >= self.parentData.width) { + self.size.width = self.parentData.width - woset; + if (pRatio) self.size.height = self.size.width / self.aspectRatio; + } + + if (hoset + self.size.height >= self.parentData.height) { + self.size.height = self.parentData.height - hoset; + if (pRatio) self.size.width = self.size.height * self.aspectRatio; + } + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options, cp = self.position, + co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement; + + var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height; + + if (self._helper && !o.animate && (/relative/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + if (self._helper && !o.animate && (/static/).test(ce.css('position'))) + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function(event, ui) { + + var self = $(this).data("resizable"), o = self.options, cs = self.size; + + self.ghost = self.originalElement.clone(); + self.ghost + .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass('ui-resizable-ghost') + .addClass(typeof o.ghost == 'string' ? o.ghost : ''); + + self.ghost.appendTo(self.helper); + + }, + + resize: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width }); + }, + + stop: function(event, ui){ + var self = $(this).data("resizable"), o = self.options; + if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0)); + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function(event, ui) { + var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey; + o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid; + var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1); + + if (/^(se|s|e)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + } + else if (/^(ne)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + } + else if (/^(sw)$/.test(a)) { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.left = op.left - ox; + } + else { + self.size.width = os.width + ox; + self.size.height = os.height + oy; + self.position.top = op.top - oy; + self.position.left = op.left - ox; + } + } + +}); + +var num = function(v) { + return parseInt(v, 10) || 0; +}; + +var isNumber = function(value) { + return !isNaN(parseInt(value, 10)); +}; + +})(jQuery); +/*! + * jQuery UI Selectable 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + options: { + appendTo: 'body', + autoRefresh: true, + distance: 0, + filter: '*', + tolerance: 'touch' + }, + _create: 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.addClass("ui-selectee"); + 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.outerWidth(), + bottom: pos.top + $this.outerHeight(), + 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 = $("<div class='ui-selectable-helper'></div>"); + }, + + destroy: function() { + this.selectees + .removeClass("ui-selectee") + .removeData("selectable-item"); + this.element + .removeClass("ui-selectable ui-selectable-disabled") + .removeData("selectable") + .unbind(".selectable"); + this._mouseDestroy(); + + return this; + }, + + _mouseStart: function(event) { + var self = this; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) + return; + + var options = this.options; + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.clientX, + "top": event.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 (!event.metaKey && !event.ctrlKey) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().andSelf().each(function() { + var selectee = $.data(this, "selectable-item"); + if (selectee) { + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + self._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + 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 = event.pageX, y2 = event.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._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if ((event.metaKey || event.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._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass('ui-selected'); + selectee.selected = false; + + selectee.$element.addClass('ui-unselecting'); + selectee.unselecting = true; + // selectable UNSELECTING callback + self._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + 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._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $('.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._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +$.extend($.ui.selectable, { + version: "1.8.24" +}); + +})(jQuery); +/*! + * jQuery UI Sortable 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Sortables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget("ui.sortable", $.ui.mouse, { + widgetEventPrefix: "sort", + ready: false, + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: 'auto', + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: '> *', + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000 + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are being displayed horizontally + this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + //We're ready to go + this.ready = true + + }, + + destroy: function() { + $.Widget.prototype.destroy.call( this ); + this.element + .removeClass("ui-sortable ui-sortable-disabled"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) + this.items[i].item.removeData(this.widgetName + "-item"); + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget() + [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + var that = this; + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type == 'static') return false; + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + var currentItem = null, self = this, nodes = $(event.target).parents().each(function() { + if($.data(this, that.widgetName + '-item') == self) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target); + + if(!currentItem) return false; + if(this.options.handle && !overrideHandle) { + var validHandle = false; + + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; }); + if(!validHandle) return false; + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var o = this.options, self = this; + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] != this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) + this._setContainment(); + + if(o.cursor) { // cursor option + if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor"); + $('body').css("cursor", o.cursor); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity"); + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex"); + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') + this.overflowOffset = this.scrollParent.offset(); + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) + this._cacheHelperProportions(); + + + //Post 'activate' events to possible containers + if(!noActivation) { + for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); } + } + + //Prepare possible droppables + if($.ui.ddmanager) + $.ui.ddmanager.current = this; + + if ($.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + var o = this.options, scrolled = false; + if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper position + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + // Only put the placeholder inside the current Container, skip all + // items form other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this moving items in "sub-sortables" can cause the placeholder to jitter + // beetween the outer and inner container. + if (item.instance !== this.currentContainer) continue; + + if (itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) return; + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) + $.ui.ddmanager.drop(this, event); + + if(this.options.revert) { + var self = this; + var cur = self.placeholder.offset(); + + self.reverting = true; + + $(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._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + var self = this; + + if(this.dragging) { + + this._mouseUp({ target: null }); + + if(this.options.helper == "original") + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + else + this.currentItem.show(); + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, self._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, self._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var str = []; o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); + }); + + if(!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected); + var ret = []; o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); }); + return ret; + + }, + + /* 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; + + var dyClick = this.offset.click.top, + dxClick = this.offset.click.left; + + var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r; + + if( this.options.tolerance == "pointer" + || this.options.forcePointerForContainers + || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height']) + ) { + return isOverElement; + } 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 + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) + return false; + + return this.floating ? + ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta != 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta != 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor == String + ? [options.connectWith] + : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var self = this; + var items = []; + var queries = []; + var connectWith = this._connectWith(); + + if(connectWith && connected) { + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]); + } + }; + }; + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]); + + for (var i = queries.length - 1; i >= 0; i--){ + queries[i][0].each(function() { + items.push(this); + }); + }; + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); + + for (var i=0; i < this.items.length; i++) { + + for (var j=0; j < list.length; j++) { + if(list[j] == this.items[i].item[0]) + this.items.splice(i,1); + }; + + }; + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + var items = this.items; + var self = this; + var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]]; + var connectWith = this._connectWith(); + + if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down + for (var i = connectWith.length - 1; i >= 0; i--){ + var cur = $(connectWith[i]); + for (var j = cur.length - 1; j >= 0; j--){ + var inst = $.data(cur[j], this.widgetName); + if(inst && inst != this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + }; + }; + } + + for (var i = queries.length - 1; i >= 0; i--) { + var targetData = queries[i][1]; + var _queries = queries[i][0]; + + for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) { + var item = $(_queries[j]); + + item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + }; + }; + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + for (var i = this.items.length - 1; i >= 0; i--){ + var item = this.items[i]; + + //We ignore calculating positions of all connected containers when we're not over them + if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0]) + continue; + + var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + var p = t.offset(); + item.left = p.left; + item.top = p.top; + }; + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + 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(); + }; + } + + return this; + }, + + _createPlaceholder: function(that) { + + var self = that || this, o = self.options; + + if(!o.placeholder || o.placeholder.constructor == String) { + var className = o.placeholder; + o.placeholder = { + element: function() { + + var el = $(document.createElement(self.currentItem[0].nodeName)) + .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper")[0]; + + if(!className) + el.style.visibility = "hidden"; + + return el; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) return; + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); }; + if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); }; + } + }; + } + + //Create the placeholder + self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem)); + + //Append it after the actual current item + self.currentItem.after(self.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(self, self.placeholder); + + }, + + _contactContainers: function(event) { + + // get innermost container that intersects with item + var innermostContainer = null, innermostIndex = null; + + + for (var i = this.containers.length - 1; i >= 0; i--){ + + // never consider a container that's located within the item itself + if($.ui.contains(this.currentItem[0], this.containers[i].element[0])) + continue; + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0])) + continue; + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) return; + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } else if(this.currentContainer != this.containers[innermostIndex]) { + + //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[innermostIndex].floating ? 'left' : 'top']; + for (var j = this.items.length - 1; j >= 0; j--) { + if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; + var cur = this.containers[innermostIndex].floating ? this.items[j].item.offset().left : this.items[j].item.offset().top; + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + this.direction = (cur - base > 0) ? 'down' : 'up'; + } + } + + if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled + return; + + this.currentContainer = this.containers[innermostIndex]; + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options; + var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem); + + if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already + $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + + if(helper[0] == this.currentItem[0]) + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + + if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width()); + if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height()); + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj == 'string') { + obj = obj.split(' '); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ('left' in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ('right' in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ('top' in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ('bottom' in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + po = { top: 0, left: 0 }; + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition == "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var o = this.options; + if(o.containment == 'parent') o.containment = this.helper[0].parentNode; + if(o.containment == 'document' || o.containment == 'window') this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + + if(!(/^(document|window|parent)$/).test(o.containment)) { + var ce = $(o.containment)[0]; + var co = $(o.containment).offset(); + var over = ($(ce).css("overflow") != 'hidden'); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) pos = this.position; + var mod = d == "absolute" ? 1 : -1; + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top // The absolute mouse position + + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left // The absolute mouse position + + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) + - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + var pageX = event.pageX; + var pageY = event.pageY; + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left; + if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top; + if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left; + if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top; + } + + if(o.grid) { + var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY // The absolute mouse position + - this.offset.click.top // Click offset (relative to the element) + - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.top // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX // The absolute mouse position + - this.offset.click.left // Click offset (relative to the element) + - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent + - this.offset.parent.left // The offsetParent's offset without borders (offset + border) + + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var self = this, counter = this.counter; + + window.setTimeout(function() { + if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + },0); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var delayedTriggers = [], self = this; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem); + this._noFinalSort = null; + + if(this.helper[0] == this.currentItem[0]) { + for(var i in this._storedCSS) { + if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = ''; + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + + // Check if the items Container has Changed and trigger appropriate + // events. + if (this !== this.currentContainer) { + if(!noPropagation) { + delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + } + } + + //Post events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + if(this.containers[i].containerCache.over) { + delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor + if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity + if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return false; + } + + if(!noPropagation) this._trigger("beforeStop", event, this._uiHash()); + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null; + + if(!noPropagation) { + for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(inst) { + var self = inst || this; + return { + helper: self.helper, + placeholder: self.placeholder || $([]), + position: self.position, + originalPosition: self.originalPosition, + offset: self.positionAbs, + item: self.currentItem, + sender: inst ? inst.element : null + }; + } + +}); + +$.extend($.ui.sortable, { + version: "1.8.24" +}); + +})(jQuery); +/*! + * jQuery UI Accordion 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget( "ui.accordion", { + options: { + active: 0, + animated: "slide", + autoHeight: true, + clearStyle: false, + collapsible: false, + event: "click", + fillSpace: false, + header: "> li > :first-child,> :not(li):even", + icons: { + header: "ui-icon-triangle-1-e", + headerSelected: "ui-icon-triangle-1-s" + }, + navigation: false, + navigationFilter: function() { + return this.href.toLowerCase() === location.href.toLowerCase(); + } + }, + + _create: function() { + var self = this, + options = self.options; + + self.running = 0; + + self.element + .addClass( "ui-accordion ui-widget ui-helper-reset" ) + // in lack of child-selectors in CSS + // we need to mark top-LIs in a UL-accordion for some IE-fix + .children( "li" ) + .addClass( "ui-accordion-li-fix" ); + + self.headers = self.element.find( options.header ) + .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ) + .bind( "mouseenter.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + }) + .bind( "mouseleave.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( "ui-state-hover" ); + }) + .bind( "focus.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-focus" ); + }) + .bind( "blur.accordion", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( "ui-state-focus" ); + }); + + self.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ); + + if ( options.navigation ) { + var current = self.element.find( "a" ).filter( options.navigationFilter ).eq( 0 ); + if ( current.length ) { + var header = current.closest( ".ui-accordion-header" ); + if ( header.length ) { + // anchor within header + self.active = header; + } else { + // anchor within content + self.active = current.closest( ".ui-accordion-content" ).prev(); + } + } + } + + self.active = self._findActive( self.active || options.active ) + .addClass( "ui-state-default ui-state-active" ) + .toggleClass( "ui-corner-all" ) + .toggleClass( "ui-corner-top" ); + self.active.next().addClass( "ui-accordion-content-active" ); + + self._createIcons(); + self.resize(); + + // ARIA + self.element.attr( "role", "tablist" ); + + self.headers + .attr( "role", "tab" ) + .bind( "keydown.accordion", function( event ) { + return self._keydown( event ); + }) + .next() + .attr( "role", "tabpanel" ); + + self.headers + .not( self.active || "" ) + .attr({ + "aria-expanded": "false", + "aria-selected": "false", + tabIndex: -1 + }) + .next() + .hide(); + + // make sure at least one header is in the tab order + if ( !self.active.length ) { + self.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + self.active + .attr({ + "aria-expanded": "true", + "aria-selected": "true", + tabIndex: 0 + }); + } + + // only need links in tab order for Safari + if ( !$.browser.safari ) { + self.headers.find( "a" ).attr( "tabIndex", -1 ); + } + + if ( options.event ) { + self.headers.bind( options.event.split(" ").join(".accordion ") + ".accordion", function(event) { + self._clickHandler.call( self, event, this ); + event.preventDefault(); + }); + } + }, + + _createIcons: function() { + var options = this.options; + if ( options.icons ) { + $( "<span></span>" ) + .addClass( "ui-icon " + options.icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-icon" ) + .toggleClass(options.icons.header) + .toggleClass(options.icons.headerSelected); + this.element.addClass( "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this.headers.children( ".ui-icon" ).remove(); + this.element.removeClass( "ui-accordion-icons" ); + }, + + destroy: function() { + var options = this.options; + + this.element + .removeClass( "ui-accordion ui-widget ui-helper-reset" ) + .removeAttr( "role" ); + + this.headers + .unbind( ".accordion" ) + .removeClass( "ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) + .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-selected" ) + .removeAttr( "tabIndex" ); + + this.headers.find( "a" ).removeAttr( "tabIndex" ); + this._destroyIcons(); + var contents = this.headers.next() + .css( "display", "" ) + .removeAttr( "role" ) + .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" ); + if ( options.autoHeight || options.fillHeight ) { + contents.css( "height", "" ); + } + + return $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + + if ( key == "active" ) { + this.activate( value ); + } + if ( key == "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key == "disabled" ) { + this.headers.add(this.headers.next()) + [ value ? "addClass" : "removeClass" ]( + "ui-accordion-disabled ui-state-disabled" ); + } + }, + + _keydown: function( event ) { + if ( this.options.disabled || event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._clickHandler( { target: event.target }, event.target ); + event.preventDefault(); + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + return false; + } + + return true; + }, + + resize: function() { + var options = this.options, + maxHeight; + + if ( options.fillSpace ) { + if ( $.browser.msie ) { + var defOverflow = this.element.parent().css( "overflow" ); + this.element.parent().css( "overflow", "hidden"); + } + maxHeight = this.element.parent().height(); + if ($.browser.msie) { + this.element.parent().css( "overflow", defOverflow ); + } + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( options.autoHeight ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); + }) + .height( maxHeight ); + } + + return this; + }, + + activate: function( index ) { + // TODO this gets called on init, changing the option without an explicit call for that + this.options.active = index; + // call clickHandler with custom event + var active = this._findActive( index )[ 0 ]; + this._clickHandler( { target: active }, active ); + + return this; + }, + + _findActive: function( selector ) { + return selector + ? typeof selector === "number" + ? this.headers.filter( ":eq(" + selector + ")" ) + : this.headers.not( this.headers.not( selector ) ) + : selector === false + ? $( [] ) + : this.headers.filter( ":eq(0)" ); + }, + + // TODO isn't event.target enough? why the separate target argument? + _clickHandler: function( event, target ) { + var options = this.options; + if ( options.disabled ) { + return; + } + + // called only when using activate(false) to close all parts programmatically + if ( !event.target ) { + if ( !options.collapsible ) { + return; + } + this.active + .removeClass( "ui-state-active ui-corner-top" ) + .addClass( "ui-state-default ui-corner-all" ) + .children( ".ui-icon" ) + .removeClass( options.icons.headerSelected ) + .addClass( options.icons.header ); + this.active.next().addClass( "ui-accordion-content-active" ); + var toHide = this.active.next(), + data = { + options: options, + newHeader: $( [] ), + oldHeader: options.active, + newContent: $( [] ), + oldContent: toHide + }, + toShow = ( this.active = $( [] ) ); + this._toggle( toShow, toHide, data ); + return; + } + + // get the click target + var clicked = $( event.currentTarget || target ), + clickedIsActive = clicked[0] === this.active[0]; + + // TODO the option is changed, is that correct? + // TODO if it is correct, shouldn't that happen after determining that the click is valid? + options.active = options.collapsible && clickedIsActive ? + false : + this.headers.index( clicked ); + + // if animations are still active, or the active header is the target, ignore click + if ( this.running || ( !options.collapsible && clickedIsActive ) ) { + return; + } + + // find elements to show and hide + var active = this.active, + toShow = clicked.next(), + toHide = this.active.next(), + data = { + options: options, + newHeader: clickedIsActive && options.collapsible ? $([]) : clicked, + oldHeader: this.active, + newContent: clickedIsActive && options.collapsible ? $([]) : toShow, + oldContent: toHide + }, + down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $([]) : clicked; + this._toggle( toShow, toHide, data, clickedIsActive, down ); + + // switch classes + active + .removeClass( "ui-state-active ui-corner-top" ) + .addClass( "ui-state-default ui-corner-all" ) + .children( ".ui-icon" ) + .removeClass( options.icons.headerSelected ) + .addClass( options.icons.header ); + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-state-default ui-corner-all" ) + .addClass( "ui-state-active ui-corner-top" ) + .children( ".ui-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.headerSelected ); + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + + return; + }, + + _toggle: function( toShow, toHide, data, clickedIsActive, down ) { + var self = this, + options = self.options; + + self.toShow = toShow; + self.toHide = toHide; + self.data = data; + + var complete = function() { + if ( !self ) { + return; + } + return self._completed.apply( self, arguments ); + }; + + // trigger changestart event + self._trigger( "changestart", null, self.data ); + + // count elements to animate + self.running = toHide.size() === 0 ? toShow.size() : toHide.size(); + + if ( options.animated ) { + var animOptions = {}; + + if ( options.collapsible && clickedIsActive ) { + animOptions = { + toShow: $( [] ), + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight || options.fillSpace + }; + } else { + animOptions = { + toShow: toShow, + toHide: toHide, + complete: complete, + down: down, + autoHeight: options.autoHeight || options.fillSpace + }; + } + + if ( !options.proxied ) { + options.proxied = options.animated; + } + + if ( !options.proxiedDuration ) { + options.proxiedDuration = options.duration; + } + + options.animated = $.isFunction( options.proxied ) ? + options.proxied( animOptions ) : + options.proxied; + + options.duration = $.isFunction( options.proxiedDuration ) ? + options.proxiedDuration( animOptions ) : + options.proxiedDuration; + + var animations = $.ui.accordion.animations, + duration = options.duration, + easing = options.animated; + + if ( easing && !animations[ easing ] && !$.easing[ easing ] ) { + easing = "slide"; + } + if ( !animations[ easing ] ) { + animations[ easing ] = function( options ) { + this.slide( options, { + easing: easing, + duration: duration || 700 + }); + }; + } + + animations[ easing ]( animOptions ); + } else { + if ( options.collapsible && clickedIsActive ) { + toShow.toggle(); + } else { + toHide.hide(); + toShow.show(); + } + + complete( true ); + } + + // TODO assert that the blur and focus triggers are really necessary, remove otherwise + toHide.prev() + .attr({ + "aria-expanded": "false", + "aria-selected": "false", + tabIndex: -1 + }) + .blur(); + toShow.prev() + .attr({ + "aria-expanded": "true", + "aria-selected": "true", + tabIndex: 0 + }) + .focus(); + }, + + _completed: function( cancel ) { + this.running = cancel ? 0 : --this.running; + if ( this.running ) { + return; + } + + if ( this.options.clearStyle ) { + this.toShow.add( this.toHide ).css({ + height: "", + overflow: "" + }); + } + + // other classes are removed before the animation; this one needs to stay until completed + this.toHide.removeClass( "ui-accordion-content-active" ); + // Work around for rendering bug in IE (#5421) + if ( this.toHide.length ) { + this.toHide.parent()[0].className = this.toHide.parent()[0].className; + } + + this._trigger( "change", null, this.data ); + } +}); + +$.extend( $.ui.accordion, { + version: "1.8.24", + animations: { + slide: function( options, additions ) { + options = $.extend({ + easing: "swing", + duration: 300 + }, options, additions ); + if ( !options.toHide.size() ) { + options.toShow.animate({ + height: "show", + paddingTop: "show", + paddingBottom: "show" + }, options ); + return; + } + if ( !options.toShow.size() ) { + options.toHide.animate({ + height: "hide", + paddingTop: "hide", + paddingBottom: "hide" + }, options ); + return; + } + var overflow = options.toShow.css( "overflow" ), + percentDone = 0, + showProps = {}, + hideProps = {}, + fxAttrs = [ "height", "paddingTop", "paddingBottom" ], + originalWidth; + // fix width before calculating height of hidden element + var s = options.toShow; + originalWidth = s[0].style.width; + s.width( s.parent().width() + - parseFloat( s.css( "paddingLeft" ) ) + - parseFloat( s.css( "paddingRight" ) ) + - ( parseFloat( s.css( "borderLeftWidth" ) ) || 0 ) + - ( parseFloat( s.css( "borderRightWidth" ) ) || 0 ) ); + + $.each( fxAttrs, function( i, prop ) { + hideProps[ prop ] = "hide"; + + var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ ); + showProps[ prop ] = { + value: parts[ 1 ], + unit: parts[ 2 ] || "px" + }; + }); + options.toShow.css({ height: 0, overflow: "hidden" }).show(); + options.toHide + .filter( ":hidden" ) + .each( options.complete ) + .end() + .filter( ":visible" ) + .animate( hideProps, { + step: function( now, settings ) { + // only calculate the percent when animating height + // IE gets very inconsistent results when animating elements + // with small values, which is common for padding + if ( settings.prop == "height" ) { + percentDone = ( settings.end - settings.start === 0 ) ? 0 : + ( settings.now - settings.start ) / ( settings.end - settings.start ); + } + + options.toShow[ 0 ].style[ settings.prop ] = + ( percentDone * showProps[ settings.prop ].value ) + + showProps[ settings.prop ].unit; + }, + duration: options.duration, + easing: options.easing, + complete: function() { + if ( !options.autoHeight ) { + options.toShow.css( "height", "" ); + } + options.toShow.css({ + width: originalWidth, + overflow: overflow + }); + options.complete(); + } + }); + }, + bounceslide: function( options ) { + this.slide( options, { + easing: options.down ? "easeOutBounce" : "swing", + duration: options.down ? 1000 : 200 + }); + } + } +}); + +})( jQuery ); +/*! + * jQuery UI Autocomplete 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function( $, undefined ) { + +// used to prevent race conditions with remote data sources +var requestIndex = 0; + +$.widget( "ui.autocomplete", { + options: { + appendTo: "body", + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null + }, + + pending: 0, + + _create: function() { + var self = this, + doc = this.element[ 0 ].ownerDocument, + suppressKeyPress; + this.isMultiLine = this.element.is( "textarea" ); + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ) + // TODO verify these actually work as intended + .attr({ + role: "textbox", + "aria-autocomplete": "list", + "aria-haspopup": "true" + }) + .bind( "keydown.autocomplete", function( event ) { + if ( self.options.disabled || self.element.propAttr( "readOnly" ) ) { + return; + } + + suppressKeyPress = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + self._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + self._move( "nextPage", event ); + break; + case keyCode.UP: + self._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + self._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( self.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + } + //passthrough - ENTER and TAB both select the current element + case keyCode.TAB: + if ( !self.menu.active ) { + return; + } + self.menu.select( event ); + break; + case keyCode.ESCAPE: + self.element.val( self.term ); + self.close( event ); + break; + default: + // keypress is triggered before the input value is changed + clearTimeout( self.searching ); + self.searching = setTimeout(function() { + // only search if the value has changed + if ( self.term != self.element.val() ) { + self.selectedItem = null; + self.search( null, event ); + } + }, self.options.delay ); + break; + } + }) + .bind( "keypress.autocomplete", function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + event.preventDefault(); + } + }) + .bind( "focus.autocomplete", function() { + if ( self.options.disabled ) { + return; + } + + self.selectedItem = null; + self.previous = self.element.val(); + }) + .bind( "blur.autocomplete", function( event ) { + if ( self.options.disabled ) { + return; + } + + clearTimeout( self.searching ); + // clicks on the menu (or a button to trigger a search) will cause a blur event + self.closing = setTimeout(function() { + self.close( event ); + self._change( event ); + }, 150 ); + }); + this._initSource(); + this.menu = $( "<ul></ul>" ) + .addClass( "ui-autocomplete" ) + .appendTo( $( this.options.appendTo || "body", doc )[0] ) + // prevent the close-on-blur in case of a "slow" click on the menu (long mousedown) + .mousedown(function( event ) { + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = self.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + setTimeout(function() { + $( document ).one( 'mousedown', function( event ) { + if ( event.target !== self.element[ 0 ] && + event.target !== menuElement && + !$.ui.contains( menuElement, event.target ) ) { + self.close(); + } + }); + }, 1 ); + } + + // use another timeout to make sure the blur-event-handler on the input was already triggered + setTimeout(function() { + clearTimeout( self.closing ); + }, 13); + }) + .menu({ + focus: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ); + if ( false !== self._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( /^key/.test(event.originalEvent.type) ) { + self.element.val( item.value ); + } + } + }, + selected: function( event, ui ) { + var item = ui.item.data( "item.autocomplete" ), + previous = self.previous; + + // only trigger when focus was lost (click on menu) + if ( self.element[0] !== doc.activeElement ) { + self.element.focus(); + self.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + setTimeout(function() { + self.previous = previous; + self.selectedItem = item; + }, 1); + } + + if ( false !== self._trigger( "select", event, { item: item } ) ) { + self.element.val( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + self.term = self.element.val(); + + self.close( event ); + self.selectedItem = item; + }, + blur: function( event, ui ) { + // don't set the value of the text field if it's already correct + // this prevents moving the cursor unnecessarily + if ( self.menu.element.is(":visible") && + ( self.element.val() !== self.term ) ) { + self.element.val( self.term ); + } + } + }) + .zIndex( this.element.zIndex() + 1 ) + // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 + .css({ top: 0, left: 0 }) + .hide() + .data( "menu" ); + if ( $.fn.bgiframe ) { + this.menu.element.bgiframe(); + } + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + self.beforeunloadHandler = function() { + self.element.removeAttr( "autocomplete" ); + }; + $( window ).bind( "beforeunload", self.beforeunloadHandler ); + }, + + destroy: function() { + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ) + .removeAttr( "role" ) + .removeAttr( "aria-autocomplete" ) + .removeAttr( "aria-haspopup" ); + this.menu.element.remove(); + $( window ).unbind( "beforeunload", this.beforeunloadHandler ); + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] ) + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _initSource: function() { + var self = this, + array, + url; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter(array, request.term) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( self.xhr ) { + self.xhr.abort(); + } + self.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data, status ) { + response( data ); + }, + error: function() { + response( [] ); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + search: function( value, event ) { + value = value != null ? value : this.element.val(); + + // always save the actual value, not the one passed as an argument + this.term = this.element.val(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + clearTimeout( this.closing ); + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var that = this, + index = ++requestIndex; + + return function( content ) { + if ( index === requestIndex ) { + that.__response( content ); + } + + that.pending--; + if ( !that.pending ) { + that.element.removeClass( "ui-autocomplete-loading" ); + } + }; + }, + + __response: function( content ) { + if ( !this.options.disabled && content && content.length ) { + content = this._normalize( content ); + this._suggest( content ); + this._trigger( "open" ); + } else { + this.close(); + } + }, + + close: function( event ) { + clearTimeout( this.closing ); + if ( this.menu.element.is(":visible") ) { + this.menu.element.hide(); + this.menu.deactivate(); + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this.element.val() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function(item) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element + .empty() + .zIndex( this.element.zIndex() + 1 ); + this._renderMenu( ul, items ); + // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate + this.menu.deactivate(); + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + + if ( this.options.autoFocus ) { + this.menu.next( new $.Event("mouseover") ); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var self = this; + $.each( items, function( index, item ) { + self._renderItem( ul, item ); + }); + }, + + _renderItem: function( ul, item) { + return $( "<li></li>" ) + .data( "item.autocomplete", item ) + .append( $( "<a></a>" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is(":visible") ) { + this.search( null, event ); + return; + } + if ( this.menu.first() && /^previous/.test(direction) || + this.menu.last() && /^next/.test(direction) ) { + this.element.val( this.term ); + this.menu.deactivate(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + +}( jQuery )); + +/* + * jQuery UI Menu (not officially released) + * + * This widget isn't yet finished and the API is subject to change. We plan to finish + * it for the next release. You're welcome to give it a try anyway and give us feedback, + * as long as you're okay with migrating your code later on. We can help with that, too. + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function($) { + +$.widget("ui.menu", { + _create: function() { + var self = this; + this.element + .addClass("ui-menu ui-widget ui-widget-content ui-corner-all") + .attr({ + role: "listbox", + "aria-activedescendant": "ui-active-menuitem" + }) + .click(function( event ) { + if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) { + return; + } + // temporary + event.preventDefault(); + self.select( event ); + }); + this.refresh(); + }, + + refresh: function() { + var self = this; + + // don't refresh list items that are already adapted + var items = this.element.children("li:not(.ui-menu-item):has(a)") + .addClass("ui-menu-item") + .attr("role", "menuitem"); + + items.children("a") + .addClass("ui-corner-all") + .attr("tabindex", -1) + // mouseenter doesn't work with event delegation + .mouseenter(function( event ) { + self.activate( event, $(this).parent() ); + }) + .mouseleave(function() { + self.deactivate(); + }); + }, + + activate: function( event, item ) { + this.deactivate(); + if (this.hasScroll()) { + var offset = item.offset().top - this.element.offset().top, + scroll = this.element.scrollTop(), + elementHeight = this.element.height(); + if (offset < 0) { + this.element.scrollTop( scroll + offset); + } else if (offset >= elementHeight) { + this.element.scrollTop( scroll + offset - elementHeight + item.height()); + } + } + this.active = item.eq(0) + .children("a") + .addClass("ui-state-hover") + .attr("id", "ui-active-menuitem") + .end(); + this._trigger("focus", event, { item: item }); + }, + + deactivate: function() { + if (!this.active) { return; } + + this.active.children("a") + .removeClass("ui-state-hover") + .removeAttr("id"); + this._trigger("blur"); + this.active = null; + }, + + next: function(event) { + this.move("next", ".ui-menu-item:first", event); + }, + + previous: function(event) { + this.move("prev", ".ui-menu-item:last", event); + }, + + first: function() { + return this.active && !this.active.prevAll(".ui-menu-item").length; + }, + + last: function() { + return this.active && !this.active.nextAll(".ui-menu-item").length; + }, + + move: function(direction, edge, event) { + if (!this.active) { + this.activate(event, this.element.children(edge)); + return; + } + var next = this.active[direction + "All"](".ui-menu-item").eq(0); + if (next.length) { + this.activate(event, next); + } else { + this.activate(event, this.element.children(edge)); + } + }, + + // TODO merge with previousPage + nextPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.last()) { + this.activate(event, this.element.children(".ui-menu-item:first")); + return; + } + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base - height + $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:last"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.last() ? ":first" : ":last")); + } + }, + + // TODO merge with nextPage + previousPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.first()) { + this.activate(event, this.element.children(".ui-menu-item:last")); + return; + } + + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base + height - $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:first"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.first() ? ":last" : ":first")); + } + }, + + hasScroll: function() { + return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight"); + }, + + select: function( event ) { + this._trigger("selected", event, { item: this.active }); + } +}); + +}(jQuery)); +/*! + * jQuery UI Button 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var lastActive, startXPos, startYPos, clickDragged, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + stateClasses = "ui-state-hover ui-state-active ", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function() { + var buttons = $( this ).find( ":ui-button" ); + setTimeout(function() { + buttons.button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + options: { + disabled: null, + text: true, + label: null, + icons: { + primary: null, + secondary: null + } + }, + _create: function() { + this.element.closest( "form" ) + .unbind( "reset.button" ) + .bind( "reset.button", formResetHandler ); + + if ( typeof this.options.disabled !== "boolean" ) { + this.options.disabled = !!this.element.propAttr( "disabled" ); + } else { + this.element.propAttr( "disabled", this.options.disabled ); + } + + this._determineButtonType(); + this.hasTitle = !!this.buttonElement.attr( "title" ); + + var self = this, + options = this.options, + toggleButton = this.type === "checkbox" || this.type === "radio", + hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ), + focusClass = "ui-state-focus"; + + if ( options.label === null ) { + options.label = this.buttonElement.html(); + } + + this.buttonElement + .addClass( baseClasses ) + .attr( "role", "button" ) + .bind( "mouseenter.button", function() { + if ( options.disabled ) { + return; + } + $( this ).addClass( "ui-state-hover" ); + if ( this === lastActive ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "mouseleave.button", function() { + if ( options.disabled ) { + return; + } + $( this ).removeClass( hoverClass ); + }) + .bind( "click.button", function( event ) { + if ( options.disabled ) { + event.preventDefault(); + event.stopImmediatePropagation(); + } + }); + + this.element + .bind( "focus.button", function() { + // no need to check disabled, focus won't be triggered anyway + self.buttonElement.addClass( focusClass ); + }) + .bind( "blur.button", function() { + self.buttonElement.removeClass( focusClass ); + }); + + if ( toggleButton ) { + this.element.bind( "change.button", function() { + if ( clickDragged ) { + return; + } + self.refresh(); + }); + // if mouse moves between mousedown and mouseup (drag) set clickDragged flag + // prevents issue where button state changes but checkbox/radio checked state + // does not in Firefox (see ticket #6970) + this.buttonElement + .bind( "mousedown.button", function( event ) { + if ( options.disabled ) { + return; + } + clickDragged = false; + startXPos = event.pageX; + startYPos = event.pageY; + }) + .bind( "mouseup.button", function( event ) { + if ( options.disabled ) { + return; + } + if ( startXPos !== event.pageX || startYPos !== event.pageY ) { + clickDragged = true; + } + }); + } + + if ( this.type === "checkbox" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).toggleClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", self.element[0].checked ); + }); + } else if ( this.type === "radio" ) { + this.buttonElement.bind( "click.button", function() { + if ( options.disabled || clickDragged ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + self.buttonElement.attr( "aria-pressed", "true" ); + + var radio = self.element[ 0 ]; + radioGroup( radio ) + .not( radio ) + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + }); + } else { + this.buttonElement + .bind( "mousedown.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).addClass( "ui-state-active" ); + lastActive = this; + $( document ).one( "mouseup", function() { + lastActive = null; + }); + }) + .bind( "mouseup.button", function() { + if ( options.disabled ) { + return false; + } + $( this ).removeClass( "ui-state-active" ); + }) + .bind( "keydown.button", function(event) { + if ( options.disabled ) { + return false; + } + if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) { + $( this ).addClass( "ui-state-active" ); + } + }) + .bind( "keyup.button", function() { + $( this ).removeClass( "ui-state-active" ); + }); + + if ( this.buttonElement.is("a") ) { + this.buttonElement.keyup(function(event) { + if ( event.keyCode === $.ui.keyCode.SPACE ) { + // TODO pass through original event correctly (just as 2nd argument doesn't work) + $( this ).click(); + } + }); + } + } + + // TODO: pull out $.Widget's handling for the disabled option into + // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can + // be overridden by individual plugins + this._setOption( "disabled", options.disabled ); + this._resetButton(); + }, + + _determineButtonType: function() { + + if ( this.element.is(":checkbox") ) { + this.type = "checkbox"; + } else if ( this.element.is(":radio") ) { + this.type = "radio"; + } else if ( this.element.is("input") ) { + this.type = "input"; + } else { + this.type = "button"; + } + + if ( this.type === "checkbox" || this.type === "radio" ) { + // we don't search against the document in case the element + // is disconnected from the DOM + var ancestor = this.element.parents().filter(":last"), + labelSelector = "label[for='" + this.element.attr("id") + "']"; + this.buttonElement = ancestor.find( labelSelector ); + if ( !this.buttonElement.length ) { + ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings(); + this.buttonElement = ancestor.filter( labelSelector ); + if ( !this.buttonElement.length ) { + this.buttonElement = ancestor.find( labelSelector ); + } + } + this.element.addClass( "ui-helper-hidden-accessible" ); + + var checked = this.element.is( ":checked" ); + if ( checked ) { + this.buttonElement.addClass( "ui-state-active" ); + } + this.buttonElement.attr( "aria-pressed", checked ); + } else { + this.buttonElement = this.element; + } + }, + + widget: function() { + return this.buttonElement; + }, + + destroy: function() { + this.element + .removeClass( "ui-helper-hidden-accessible" ); + this.buttonElement + .removeClass( baseClasses + " " + stateClasses + " " + typeClasses ) + .removeAttr( "role" ) + .removeAttr( "aria-pressed" ) + .html( this.buttonElement.find(".ui-button-text").html() ); + + if ( !this.hasTitle ) { + this.buttonElement.removeAttr( "title" ); + } + + $.Widget.prototype.destroy.call( this ); + }, + + _setOption: function( key, value ) { + $.Widget.prototype._setOption.apply( this, arguments ); + if ( key === "disabled" ) { + if ( value ) { + this.element.propAttr( "disabled", true ); + } else { + this.element.propAttr( "disabled", false ); + } + return; + } + this._resetButton(); + }, + + refresh: function() { + var isDisabled = this.element.is( ":disabled" ); + if ( isDisabled !== this.options.disabled ) { + this._setOption( "disabled", isDisabled ); + } + if ( this.type === "radio" ) { + radioGroup( this.element[0] ).each(function() { + if ( $( this ).is( ":checked" ) ) { + $( this ).button( "widget" ) + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + $( this ).button( "widget" ) + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + }); + } else if ( this.type === "checkbox" ) { + if ( this.element.is( ":checked" ) ) { + this.buttonElement + .addClass( "ui-state-active" ) + .attr( "aria-pressed", "true" ); + } else { + this.buttonElement + .removeClass( "ui-state-active" ) + .attr( "aria-pressed", "false" ); + } + } + }, + + _resetButton: function() { + if ( this.type === "input" ) { + if ( this.options.label ) { + this.element.val( this.options.label ); + } + return; + } + var buttonElement = this.buttonElement.removeClass( typeClasses ), + buttonText = $( "<span></span>", this.element[0].ownerDocument ) + .addClass( "ui-button-text" ) + .html( this.options.label ) + .appendTo( buttonElement.empty() ) + .text(), + icons = this.options.icons, + multipleIcons = icons.primary && icons.secondary, + buttonClasses = []; + + if ( icons.primary || icons.secondary ) { + if ( this.options.text ) { + buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + } + + if ( icons.primary ) { + buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" ); + } + + if ( icons.secondary ) { + buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" ); + } + + if ( !this.options.text ) { + buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); + + if ( !this.hasTitle ) { + buttonElement.attr( "title", buttonText ); + } + } + } else { + buttonClasses.push( "ui-button-text-only" ); + } + buttonElement.addClass( buttonClasses.join( " " ) ); + } +}); + +$.widget( "ui.buttonset", { + options: { + items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)" + }, + + _create: function() { + this.element.addClass( "ui-buttonset" ); + }, + + _init: function() { + this.refresh(); + }, + + _setOption: function( key, value ) { + if ( key === "disabled" ) { + this.buttons.button( "option", key, value ); + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + refresh: function() { + var rtl = this.element.css( "direction" ) === "rtl"; + + this.buttons = this.element.find( this.options.items ) + .filter( ":ui-button" ) + .button( "refresh" ) + .end() + .not( ":ui-button" ) + .button() + .end() + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-all ui-corner-left ui-corner-right" ) + .filter( ":first" ) + .addClass( rtl ? "ui-corner-right" : "ui-corner-left" ) + .end() + .filter( ":last" ) + .addClass( rtl ? "ui-corner-left" : "ui-corner-right" ) + .end() + .end(); + }, + + destroy: function() { + this.element.removeClass( "ui-buttonset" ); + this.buttons + .map(function() { + return $( this ).button( "widget" )[ 0 ]; + }) + .removeClass( "ui-corner-left ui-corner-right" ) + .end() + .button( "destroy" ); + + $.Widget.prototype.destroy.call( this ); + } +}); + +}( jQuery ) ); +/*! + * jQuery UI Dialog 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function( $, undefined ) { + +var uiDialogClasses = + 'ui-dialog ' + + 'ui-widget ' + + 'ui-widget-content ' + + 'ui-corner-all ', + sizeRelatedOptions = { + buttons: true, + height: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + width: true + }, + resizableRelatedOptions = { + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true + }; + +$.widget("ui.dialog", { + options: { + autoOpen: true, + buttons: {}, + closeOnEscape: true, + closeText: 'close', + dialogClass: '', + draggable: true, + hide: null, + height: 'auto', + maxHeight: false, + maxWidth: false, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: 'center', + at: 'center', + collision: 'fit', + // ensure that the titlebar is never outside the document + using: function(pos) { + var topOffset = $(this).css(pos).offset().top; + if (topOffset < 0) { + $(this).css('top', pos.top - topOffset); + } + } + }, + resizable: true, + show: null, + stack: true, + title: '', + width: 300, + zIndex: 1000 + }, + + _create: function() { + this.originalTitle = this.element.attr('title'); + // #5742 - .attr() might return a DOMElement + if ( typeof this.originalTitle !== "string" ) { + this.originalTitle = ""; + } + + this.options.title = this.options.title || this.originalTitle; + var self = this, + options = self.options, + + title = options.title || ' ', + titleId = $.ui.dialog.getTitleId(self.element), + + uiDialog = (self.uiDialog = $('<div></div>')) + .appendTo(document.body) + .hide() + .addClass(uiDialogClasses + options.dialogClass) + .css({ + 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(event) { + if (options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE) { + + self.close(event); + event.preventDefault(); + } + }) + .attr({ + role: 'dialog', + 'aria-labelledby': titleId + }) + .mousedown(function(event) { + self.moveToTop(false, event); + }), + + uiDialogContent = self.element + .show() + .removeAttr('title') + .addClass( + 'ui-dialog-content ' + + 'ui-widget-content') + .appendTo(uiDialog), + + uiDialogTitlebar = (self.uiDialogTitlebar = $('<div></div>')) + .addClass( + 'ui-dialog-titlebar ' + + 'ui-widget-header ' + + 'ui-corner-all ' + + 'ui-helper-clearfix' + ) + .prependTo(uiDialog), + + uiDialogTitlebarClose = $('<a href="#"></a>') + .addClass( + 'ui-dialog-titlebar-close ' + + 'ui-corner-all' + ) + .attr('role', 'button') + .hover( + function() { + uiDialogTitlebarClose.addClass('ui-state-hover'); + }, + function() { + uiDialogTitlebarClose.removeClass('ui-state-hover'); + } + ) + .focus(function() { + uiDialogTitlebarClose.addClass('ui-state-focus'); + }) + .blur(function() { + uiDialogTitlebarClose.removeClass('ui-state-focus'); + }) + .click(function(event) { + self.close(event); + return false; + }) + .appendTo(uiDialogTitlebar), + + uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('<span></span>')) + .addClass( + 'ui-icon ' + + 'ui-icon-closethick' + ) + .text(options.closeText) + .appendTo(uiDialogTitlebarClose), + + uiDialogTitle = $('<span></span>') + .addClass('ui-dialog-title') + .attr('id', titleId) + .html(title) + .prependTo(uiDialogTitlebar); + + //handling of deprecated beforeclose (vs beforeClose) option + //Ticket #4669 http://dev.jqueryui.com/ticket/4669 + //TODO: remove in 1.9pre + if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) { + options.beforeClose = options.beforeclose; + } + + uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); + + if (options.draggable && $.fn.draggable) { + self._makeDraggable(); + } + if (options.resizable && $.fn.resizable) { + self._makeResizable(); + } + + self._createButtons(options.buttons); + self._isOpen = false; + + if ($.fn.bgiframe) { + uiDialog.bgiframe(); + } + }, + + _init: function() { + if ( this.options.autoOpen ) { + this.open(); + } + }, + + destroy: function() { + var self = this; + + if (self.overlay) { + self.overlay.destroy(); + } + self.uiDialog.hide(); + self.element + .unbind('.dialog') + .removeData('dialog') + .removeClass('ui-dialog-content ui-widget-content') + .hide().appendTo('body'); + self.uiDialog.remove(); + + if (self.originalTitle) { + self.element.attr('title', self.originalTitle); + } + + return self; + }, + + widget: function() { + return this.uiDialog; + }, + + close: function(event) { + var self = this, + maxZ, thisZ; + + if (false === self._trigger('beforeClose', event)) { + return; + } + + if (self.overlay) { + self.overlay.destroy(); + } + self.uiDialog.unbind('keypress.ui-dialog'); + + self._isOpen = false; + + if (self.options.hide) { + self.uiDialog.hide(self.options.hide, function() { + self._trigger('close', event); + }); + } else { + self.uiDialog.hide(); + self._trigger('close', event); + } + + $.ui.dialog.overlay.resize(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + if (self.options.modal) { + maxZ = 0; + $('.ui-dialog').each(function() { + if (this !== self.uiDialog[0]) { + thisZ = $(this).css('z-index'); + if(!isNaN(thisZ)) { + maxZ = Math.max(maxZ, thisZ); + } + } + }); + $.ui.dialog.maxZ = maxZ; + } + + return self; + }, + + isOpen: function() { + return this._isOpen; + }, + + // the force parameter allows us to move modal dialogs to their correct + // position on open + moveToTop: function(force, event) { + var self = this, + options = self.options, + saveScroll; + + if ((options.modal && !force) || + (!options.stack && !options.modal)) { + return self._trigger('focus', event); + } + + if (options.zIndex > $.ui.dialog.maxZ) { + $.ui.dialog.maxZ = options.zIndex; + } + if (self.overlay) { + $.ui.dialog.maxZ += 1; + self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ); + } + + //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed. + // http://ui.jquery.com/bugs/ticket/3193 + saveScroll = { scrollTop: self.element.scrollTop(), scrollLeft: self.element.scrollLeft() }; + $.ui.dialog.maxZ += 1; + self.uiDialog.css('z-index', $.ui.dialog.maxZ); + self.element.attr(saveScroll); + self._trigger('focus', event); + + return self; + }, + + open: function() { + if (this._isOpen) { return; } + + var self = this, + options = self.options, + uiDialog = self.uiDialog; + + self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null; + self._size(); + self._position(options.position); + uiDialog.show(options.show); + self.moveToTop(true); + + // prevent tabbing out of modal dialogs + if ( options.modal ) { + uiDialog.bind( "keydown.ui-dialog", function( event ) { + if ( event.keyCode !== $.ui.keyCode.TAB ) { + return; + } + + var tabbables = $(':tabbable', this), + first = tabbables.filter(':first'), + last = tabbables.filter(':last'); + + if (event.target === last[0] && !event.shiftKey) { + first.focus(1); + return false; + } else if (event.target === first[0] && event.shiftKey) { + last.focus(1); + return false; + } + }); + } + + // set focus to the first tabbable element in the content area or the first button + // if there are no tabbable elements, set focus on the dialog itself + $(self.element.find(':tabbable').get().concat( + uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat( + uiDialog.get()))).eq(0).focus(); + + self._isOpen = true; + self._trigger('open'); + + return self; + }, + + _createButtons: function(buttons) { + var self = this, + hasButtons = false, + uiDialogButtonPane = $('<div></div>') + .addClass( + 'ui-dialog-buttonpane ' + + 'ui-widget-content ' + + 'ui-helper-clearfix' + ), + uiButtonSet = $( "<div></div>" ) + .addClass( "ui-dialog-buttonset" ) + .appendTo( uiDialogButtonPane ); + + // if we already have a button pane, remove it + self.uiDialog.find('.ui-dialog-buttonpane').remove(); + + if (typeof buttons === 'object' && buttons !== null) { + $.each(buttons, function() { + return !(hasButtons = true); + }); + } + if (hasButtons) { + $.each(buttons, function(name, props) { + props = $.isFunction( props ) ? + { click: props, text: name } : + props; + var button = $('<button type="button"></button>') + .click(function() { + props.click.apply(self.element[0], arguments); + }) + .appendTo(uiButtonSet); + // can't use .attr( props, true ) with jQuery 1.3.2. + $.each( props, function( key, value ) { + if ( key === "click" ) { + return; + } + if ( key in button ) { + button[ key ]( value ); + } else { + button.attr( key, value ); + } + }); + if ($.fn.button) { + button.button(); + } + }); + uiDialogButtonPane.appendTo(self.uiDialog); + } + }, + + _makeDraggable: function() { + var self = this, + options = self.options, + doc = $(document), + heightBeforeDrag; + + function filteredUi(ui) { + return { + position: ui.position, + offset: ui.offset + }; + } + + self.uiDialog.draggable({ + cancel: '.ui-dialog-content, .ui-dialog-titlebar-close', + handle: '.ui-dialog-titlebar', + containment: 'document', + start: function(event, ui) { + heightBeforeDrag = options.height === "auto" ? "auto" : $(this).height(); + $(this).height($(this).height()).addClass("ui-dialog-dragging"); + self._trigger('dragStart', event, filteredUi(ui)); + }, + drag: function(event, ui) { + self._trigger('drag', event, filteredUi(ui)); + }, + stop: function(event, ui) { + options.position = [ui.position.left - doc.scrollLeft(), + ui.position.top - doc.scrollTop()]; + $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag); + self._trigger('dragStop', event, filteredUi(ui)); + $.ui.dialog.overlay.resize(); + } + }); + }, + + _makeResizable: function(handles) { + handles = (handles === undefined ? this.options.resizable : handles); + var self = this, + options = self.options, + // .ui-resizable has position: relative defined in the stylesheet + // but dialogs have to use absolute or fixed positioning + position = self.uiDialog.css('position'), + resizeHandles = (typeof handles === 'string' ? + handles : + 'n,e,s,w,se,sw,ne,nw' + ); + + function filteredUi(ui) { + return { + originalPosition: ui.originalPosition, + originalSize: ui.originalSize, + position: ui.position, + size: ui.size + }; + } + + self.uiDialog.resizable({ + cancel: '.ui-dialog-content', + containment: 'document', + alsoResize: self.element, + maxWidth: options.maxWidth, + maxHeight: options.maxHeight, + minWidth: options.minWidth, + minHeight: self._minHeight(), + handles: resizeHandles, + start: function(event, ui) { + $(this).addClass("ui-dialog-resizing"); + self._trigger('resizeStart', event, filteredUi(ui)); + }, + resize: function(event, ui) { + self._trigger('resize', event, filteredUi(ui)); + }, + stop: function(event, ui) { + $(this).removeClass("ui-dialog-resizing"); + options.height = $(this).height(); + options.width = $(this).width(); + self._trigger('resizeStop', event, filteredUi(ui)); + $.ui.dialog.overlay.resize(); + } + }) + .css('position', position) + .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); + }, + + _minHeight: function() { + var options = this.options; + + if (options.height === 'auto') { + return options.minHeight; + } else { + return Math.min(options.minHeight, options.height); + } + }, + + _position: function(position) { + var myAt = [], + offset = [0, 0], + isVisible; + + if (position) { + // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( + // if (typeof position == 'string' || $.isArray(position)) { + // myAt = $.isArray(position) ? position : position.split(' '); + + if (typeof position === 'string' || (typeof position === 'object' && '0' in position)) { + myAt = position.split ? position.split(' ') : [position[0], position[1]]; + if (myAt.length === 1) { + myAt[1] = myAt[0]; + } + + $.each(['left', 'top'], function(i, offsetPosition) { + if (+myAt[i] === myAt[i]) { + offset[i] = myAt[i]; + myAt[i] = offsetPosition; + } + }); + + position = { + my: myAt.join(" "), + at: myAt.join(" "), + offset: offset.join(" ") + }; + } + + position = $.extend({}, $.ui.dialog.prototype.options.position, position); + } else { + position = $.ui.dialog.prototype.options.position; + } + + // need to show the dialog to get the actual offset in the position plugin + isVisible = this.uiDialog.is(':visible'); + if (!isVisible) { + this.uiDialog.show(); + } + this.uiDialog + // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 + .css({ top: 0, left: 0 }) + .position($.extend({ of: window }, position)); + if (!isVisible) { + this.uiDialog.hide(); + } + }, + + _setOptions: function( options ) { + var self = this, + resizableOptions = {}, + resize = false; + + $.each( options, function( key, value ) { + self._setOption( key, value ); + + if ( key in sizeRelatedOptions ) { + resize = true; + } + if ( key in resizableRelatedOptions ) { + resizableOptions[ key ] = value; + } + }); + + if ( resize ) { + this._size(); + } + if ( this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", resizableOptions ); + } + }, + + _setOption: function(key, value){ + var self = this, + uiDialog = self.uiDialog; + + switch (key) { + //handling of deprecated beforeclose (vs beforeClose) option + //Ticket #4669 http://dev.jqueryui.com/ticket/4669 + //TODO: remove in 1.9pre + case "beforeclose": + key = "beforeClose"; + break; + case "buttons": + self._createButtons(value); + break; + case "closeText": + // ensure that we always pass a string + self.uiDialogTitlebarCloseText.text("" + value); + break; + case "dialogClass": + uiDialog + .removeClass(self.options.dialogClass) + .addClass(uiDialogClasses + value); + break; + case "disabled": + if (value) { + uiDialog.addClass('ui-dialog-disabled'); + } else { + uiDialog.removeClass('ui-dialog-disabled'); + } + break; + case "draggable": + var isDraggable = uiDialog.is( ":data(draggable)" ); + if ( isDraggable && !value ) { + uiDialog.draggable( "destroy" ); + } + + if ( !isDraggable && value ) { + self._makeDraggable(); + } + break; + case "position": + self._position(value); + break; + case "resizable": + // currently resizable, becoming non-resizable + var isResizable = uiDialog.is( ":data(resizable)" ); + if (isResizable && !value) { + uiDialog.resizable('destroy'); + } + + // currently resizable, changing handles + if (isResizable && typeof value === 'string') { + uiDialog.resizable('option', 'handles', value); + } + + // currently non-resizable, becoming resizable + if (!isResizable && value !== false) { + self._makeResizable(value); + } + break; + case "title": + // convert whatever was passed in o a string, for html() to not throw up + $(".ui-dialog-title", self.uiDialogTitlebar).html("" + (value || ' ')); + break; + } + + $.Widget.prototype._setOption.apply(self, arguments); + }, + + _size: function() { + /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content + * divs will both have width and height set, so we need to reset them + */ + var options = this.options, + nonContentHeight, + minContentHeight, + isVisible = this.uiDialog.is( ":visible" ); + + // reset content sizing + this.element.show().css({ + width: 'auto', + minHeight: 0, + height: 0 + }); + + if (options.minWidth > options.width) { + options.width = options.minWidth; + } + + // reset wrapper sizing + // determine the height of all the non-content elements + nonContentHeight = this.uiDialog.css({ + height: 'auto', + width: options.width + }) + .height(); + minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); + + if ( options.height === "auto" ) { + // only needed for IE6 support + if ( $.support.minHeight ) { + this.element.css({ + minHeight: minContentHeight, + height: "auto" + }); + } else { + this.uiDialog.show(); + var autoHeight = this.element.css( "height", "auto" ).height(); + if ( !isVisible ) { + this.uiDialog.hide(); + } + this.element.height( Math.max( autoHeight, minContentHeight ) ); + } + } else { + this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); + } + + if (this.uiDialog.is(':data(resizable)')) { + this.uiDialog.resizable('option', 'minHeight', this._minHeight()); + } + } +}); + +$.extend($.ui.dialog, { + version: "1.8.24", + + uuid: 0, + maxZ: 0, + + getTitleId: function($el) { + var id = $el.attr('id'); + if (!id) { + this.uuid += 1; + id = this.uuid; + } + return 'ui-dialog-title-' + id; + }, + + overlay: function(dialog) { + this.$el = $.ui.dialog.overlay.create(dialog); + } +}); + +$.extend($.ui.dialog.overlay, { + instances: [], + // reuse old instances due to IE memory leak with alpha transparency (see #5185) + oldInstances: [], + maxZ: 0, + events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','), + function(event) { return event + '.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() { + // handle $(el).dialog().dialog('close') (see #4065) + if ($.ui.dialog.overlay.instances.length) { + $(document).bind($.ui.dialog.overlay.events, function(event) { + // stop events if the z-index of the target is < the z-index of the overlay + // we cannot return true when we don't want to cancel the event (#3523) + if ($(event.target).zIndex() < $.ui.dialog.overlay.maxZ) { + return false; + } + }); + } + }, 1); + + // allow closing by pressing the escape key + $(document).bind('keydown.dialog-overlay', function(event) { + if (dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE) { + + dialog.close(event); + event.preventDefault(); + } + }); + + // handle window resize + $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize); + } + + var $el = (this.oldInstances.pop() || $('<div></div>').addClass('ui-widget-overlay')) + .appendTo(document.body) + .css({ + width: this.width(), + height: this.height() + }); + + if ($.fn.bgiframe) { + $el.bgiframe(); + } + + this.instances.push($el); + return $el; + }, + + destroy: function($el) { + var indexOf = $.inArray($el, this.instances); + if (indexOf != -1){ + this.oldInstances.push(this.instances.splice(indexOf, 1)[0]); + } + + if (this.instances.length === 0) { + $([document, window]).unbind('.dialog-overlay'); + } + + $el.remove(); + + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) + var maxZ = 0; + $.each(this.instances, function() { + maxZ = Math.max(maxZ, this.css('z-index')); + }); + this.maxZ = maxZ; + }, + + height: function() { + var scrollHeight, + offsetHeight; + // handle IE 6 + if ($.browser.msie && $.browser.version < 7) { + scrollHeight = Math.max( + document.documentElement.scrollHeight, + document.body.scrollHeight + ); + offsetHeight = Math.max( + document.documentElement.offsetHeight, + document.body.offsetHeight + ); + + if (scrollHeight < offsetHeight) { + return $(window).height() + 'px'; + } else { + return scrollHeight + 'px'; + } + // handle "good" browsers + } else { + return $(document).height() + 'px'; + } + }, + + width: function() { + var scrollWidth, + offsetWidth; + // handle IE + if ( $.browser.msie ) { + scrollWidth = Math.max( + document.documentElement.scrollWidth, + document.body.scrollWidth + ); + offsetWidth = Math.max( + document.documentElement.offsetWidth, + document.body.offsetWidth + ); + + if (scrollWidth < offsetWidth) { + return $(window).width() + 'px'; + } else { + return scrollWidth + 'px'; + } + // handle "good" browsers + } 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 Slider 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +// number of pages in a slider +// (how many times can you page up/down to go through the whole range) +var numPages = 5; + +$.widget( "ui.slider", $.ui.mouse, { + + widgetEventPrefix: "slide", + + options: { + animate: false, + distance: 0, + max: 100, + min: 0, + orientation: "horizontal", + range: false, + step: 1, + value: 0, + values: null + }, + + _create: function() { + var self = this, + o = this.options, + existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ), + handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>", + handleCount = ( o.values && o.values.length ) || 1, + handles = []; + + this._keySliding = false; + this._mouseSliding = false; + this._animateOff = true; + this._handleIndex = null; + this._detectOrientation(); + this._mouseInit(); + + this.element + .addClass( "ui-slider" + + " ui-slider-" + this.orientation + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" + + ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) ); + + this.range = $([]); + + if ( o.range ) { + if ( o.range === true ) { + if ( !o.values ) { + o.values = [ this._valueMin(), this._valueMin() ]; + } + if ( o.values.length && o.values.length !== 2 ) { + o.values = [ o.values[0], o.values[0] ]; + } + } + + this.range = $( "<div></div>" ) + .appendTo( this.element ) + .addClass( "ui-slider-range" + + // note: this isn't the most fittingly semantic framework class for this element, + // but worked best visually with a variety of themes + " ui-widget-header" + + ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) ); + } + + for ( var i = existingHandles.length; i < handleCount; i += 1 ) { + handles.push( handle ); + } + + this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) ); + + this.handle = this.handles.eq( 0 ); + + this.handles.add( this.range ).filter( "a" ) + .click(function( event ) { + event.preventDefault(); + }) + .hover(function() { + if ( !o.disabled ) { + $( this ).addClass( "ui-state-hover" ); + } + }, function() { + $( this ).removeClass( "ui-state-hover" ); + }) + .focus(function() { + if ( !o.disabled ) { + $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" ); + $( this ).addClass( "ui-state-focus" ); + } else { + $( this ).blur(); + } + }) + .blur(function() { + $( this ).removeClass( "ui-state-focus" ); + }); + + this.handles.each(function( i ) { + $( this ).data( "index.ui-slider-handle", i ); + }); + + this.handles + .keydown(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ), + allowed, + curVal, + newVal, + step; + + if ( self.options.disabled ) { + return; + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + case $.ui.keyCode.END: + case $.ui.keyCode.PAGE_UP: + case $.ui.keyCode.PAGE_DOWN: + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + event.preventDefault(); + if ( !self._keySliding ) { + self._keySliding = true; + $( this ).addClass( "ui-state-active" ); + allowed = self._start( event, index ); + if ( allowed === false ) { + return; + } + } + break; + } + + step = self.options.step; + if ( self.options.values && self.options.values.length ) { + curVal = newVal = self.values( index ); + } else { + curVal = newVal = self.value(); + } + + switch ( event.keyCode ) { + case $.ui.keyCode.HOME: + newVal = self._valueMin(); + break; + case $.ui.keyCode.END: + newVal = self._valueMax(); + break; + case $.ui.keyCode.PAGE_UP: + newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.PAGE_DOWN: + newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) ); + break; + case $.ui.keyCode.UP: + case $.ui.keyCode.RIGHT: + if ( curVal === self._valueMax() ) { + return; + } + newVal = self._trimAlignValue( curVal + step ); + break; + case $.ui.keyCode.DOWN: + case $.ui.keyCode.LEFT: + if ( curVal === self._valueMin() ) { + return; + } + newVal = self._trimAlignValue( curVal - step ); + break; + } + + self._slide( event, index, newVal ); + }) + .keyup(function( event ) { + var index = $( this ).data( "index.ui-slider-handle" ); + + if ( self._keySliding ) { + self._keySliding = false; + self._stop( event, index ); + self._change( event, index ); + $( this ).removeClass( "ui-state-active" ); + } + + }); + + this._refreshValue(); + + this._animateOff = false; + }, + + destroy: function() { + this.handles.remove(); + this.range.remove(); + + this.element + .removeClass( "ui-slider" + + " ui-slider-horizontal" + + " ui-slider-vertical" + + " ui-slider-disabled" + + " ui-widget" + + " ui-widget-content" + + " ui-corner-all" ) + .removeData( "slider" ) + .unbind( ".slider" ); + + this._mouseDestroy(); + + return this; + }, + + _mouseCapture: function( event ) { + var o = this.options, + position, + normValue, + distance, + closestHandle, + self, + index, + allowed, + offset, + mouseOverHandle; + + if ( o.disabled ) { + return false; + } + + this.elementSize = { + width: this.element.outerWidth(), + height: this.element.outerHeight() + }; + this.elementOffset = this.element.offset(); + + position = { x: event.pageX, y: event.pageY }; + normValue = this._normValueFromMouse( position ); + distance = this._valueMax() - this._valueMin() + 1; + self = this; + this.handles.each(function( i ) { + var thisDistance = Math.abs( normValue - self.values(i) ); + if ( distance > thisDistance ) { + distance = thisDistance; + closestHandle = $( this ); + index = i; + } + }); + + // workaround for bug #3736 (if both handles of a range are at 0, + // the first is always used as the one with least distance, + // and moving it is obviously prevented by preventing negative ranges) + if( o.range === true && this.values(1) === o.min ) { + index += 1; + closestHandle = $( this.handles[index] ); + } + + allowed = this._start( event, index ); + if ( allowed === false ) { + return false; + } + this._mouseSliding = true; + + self._handleIndex = index; + + closestHandle + .addClass( "ui-state-active" ) + .focus(); + + offset = closestHandle.offset(); + mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" ); + this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { + left: event.pageX - offset.left - ( closestHandle.width() / 2 ), + top: event.pageY - offset.top - + ( closestHandle.height() / 2 ) - + ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) - + ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) + + ( parseInt( closestHandle.css("marginTop"), 10 ) || 0) + }; + + if ( !this.handles.hasClass( "ui-state-hover" ) ) { + this._slide( event, index, normValue ); + } + this._animateOff = true; + return true; + }, + + _mouseStart: function( event ) { + return true; + }, + + _mouseDrag: function( event ) { + var position = { x: event.pageX, y: event.pageY }, + normValue = this._normValueFromMouse( position ); + + this._slide( event, this._handleIndex, normValue ); + + return false; + }, + + _mouseStop: function( event ) { + this.handles.removeClass( "ui-state-active" ); + this._mouseSliding = false; + + this._stop( event, this._handleIndex ); + this._change( event, this._handleIndex ); + + this._handleIndex = null; + this._clickOffset = null; + this._animateOff = false; + + return false; + }, + + _detectOrientation: function() { + this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; + }, + + _normValueFromMouse: function( position ) { + var pixelTotal, + pixelMouse, + percentMouse, + valueTotal, + valueMouse; + + if ( this.orientation === "horizontal" ) { + pixelTotal = this.elementSize.width; + pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); + } else { + pixelTotal = this.elementSize.height; + pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); + } + + percentMouse = ( pixelMouse / pixelTotal ); + if ( percentMouse > 1 ) { + percentMouse = 1; + } + if ( percentMouse < 0 ) { + percentMouse = 0; + } + if ( this.orientation === "vertical" ) { + percentMouse = 1 - percentMouse; + } + + valueTotal = this._valueMax() - this._valueMin(); + valueMouse = this._valueMin() + percentMouse * valueTotal; + + return this._trimAlignValue( valueMouse ); + }, + + _start: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + return this._trigger( "start", event, uiHash ); + }, + + _slide: function( event, index, newVal ) { + var otherVal, + newValues, + allowed; + + if ( this.options.values && this.options.values.length ) { + otherVal = this.values( index ? 0 : 1 ); + + if ( ( this.options.values.length === 2 && this.options.range === true ) && + ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) ) + ) { + newVal = otherVal; + } + + if ( newVal !== this.values( index ) ) { + newValues = this.values(); + newValues[ index ] = newVal; + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal, + values: newValues + } ); + otherVal = this.values( index ? 0 : 1 ); + if ( allowed !== false ) { + this.values( index, newVal, true ); + } + } + } else { + if ( newVal !== this.value() ) { + // A slide can be canceled by returning false from the slide callback + allowed = this._trigger( "slide", event, { + handle: this.handles[ index ], + value: newVal + } ); + if ( allowed !== false ) { + this.value( newVal ); + } + } + } + }, + + _stop: function( event, index ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "stop", event, uiHash ); + }, + + _change: function( event, index ) { + if ( !this._keySliding && !this._mouseSliding ) { + var uiHash = { + handle: this.handles[ index ], + value: this.value() + }; + if ( this.options.values && this.options.values.length ) { + uiHash.value = this.values( index ); + uiHash.values = this.values(); + } + + this._trigger( "change", event, uiHash ); + } + }, + + value: function( newValue ) { + if ( arguments.length ) { + this.options.value = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, 0 ); + return; + } + + return this._value(); + }, + + values: function( index, newValue ) { + var vals, + newValues, + i; + + if ( arguments.length > 1 ) { + this.options.values[ index ] = this._trimAlignValue( newValue ); + this._refreshValue(); + this._change( null, index ); + return; + } + + if ( arguments.length ) { + if ( $.isArray( arguments[ 0 ] ) ) { + vals = this.options.values; + newValues = arguments[ 0 ]; + for ( i = 0; i < vals.length; i += 1 ) { + vals[ i ] = this._trimAlignValue( newValues[ i ] ); + this._change( null, i ); + } + this._refreshValue(); + } else { + if ( this.options.values && this.options.values.length ) { + return this._values( index ); + } else { + return this.value(); + } + } + } else { + return this._values(); + } + }, + + _setOption: function( key, value ) { + var i, + valsLength = 0; + + if ( $.isArray( this.options.values ) ) { + valsLength = this.options.values.length; + } + + $.Widget.prototype._setOption.apply( this, arguments ); + + switch ( key ) { + case "disabled": + if ( value ) { + this.handles.filter( ".ui-state-focus" ).blur(); + this.handles.removeClass( "ui-state-hover" ); + this.handles.propAttr( "disabled", true ); + this.element.addClass( "ui-disabled" ); + } else { + this.handles.propAttr( "disabled", false ); + this.element.removeClass( "ui-disabled" ); + } + break; + case "orientation": + this._detectOrientation(); + this.element + .removeClass( "ui-slider-horizontal ui-slider-vertical" ) + .addClass( "ui-slider-" + this.orientation ); + this._refreshValue(); + break; + case "value": + this._animateOff = true; + this._refreshValue(); + this._change( null, 0 ); + this._animateOff = false; + break; + case "values": + this._animateOff = true; + this._refreshValue(); + for ( i = 0; i < valsLength; i += 1 ) { + this._change( null, i ); + } + this._animateOff = false; + break; + } + }, + + //internal value getter + // _value() returns value trimmed by min and max, aligned by step + _value: function() { + var val = this.options.value; + val = this._trimAlignValue( val ); + + return val; + }, + + //internal values getter + // _values() returns array of values trimmed by min and max, aligned by step + // _values( index ) returns single value trimmed by min and max, aligned by step + _values: function( index ) { + var val, + vals, + i; + + if ( arguments.length ) { + val = this.options.values[ index ]; + val = this._trimAlignValue( val ); + + return val; + } else { + // .slice() creates a copy of the array + // this copy gets trimmed by min and max and then returned + vals = this.options.values.slice(); + for ( i = 0; i < vals.length; i+= 1) { + vals[ i ] = this._trimAlignValue( vals[ i ] ); + } + + return vals; + } + }, + + // returns the step-aligned value that val is closest to, between (inclusive) min and max + _trimAlignValue: function( val ) { + if ( val <= this._valueMin() ) { + return this._valueMin(); + } + if ( val >= this._valueMax() ) { + return this._valueMax(); + } + var step = ( this.options.step > 0 ) ? this.options.step : 1, + valModStep = (val - this._valueMin()) % step, + alignValue = val - valModStep; + + if ( Math.abs(valModStep) * 2 >= step ) { + alignValue += ( valModStep > 0 ) ? step : ( -step ); + } + + // Since JavaScript has problems with large floats, round + // the final value to 5 digits after the decimal point (see #4124) + return parseFloat( alignValue.toFixed(5) ); + }, + + _valueMin: function() { + return this.options.min; + }, + + _valueMax: function() { + return this.options.max; + }, + + _refreshValue: function() { + var oRange = this.options.range, + o = this.options, + self = this, + animate = ( !this._animateOff ) ? o.animate : false, + valPercent, + _set = {}, + lastValPercent, + value, + valueMin, + valueMax; + + if ( this.options.values && this.options.values.length ) { + this.handles.each(function( i, j ) { + valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + if ( self.options.range === true ) { + if ( self.orientation === "horizontal" ) { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } else { + if ( i === 0 ) { + self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); + } + if ( i === 1 ) { + self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + lastValPercent = valPercent; + }); + } else { + value = this.value(); + valueMin = this._valueMin(); + valueMax = this._valueMax(); + valPercent = ( valueMax !== valueMin ) ? + ( value - valueMin ) / ( valueMax - valueMin ) * 100 : + 0; + _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; + this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); + + if ( oRange === "min" && this.orientation === "horizontal" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "horizontal" ) { + this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + if ( oRange === "min" && this.orientation === "vertical" ) { + this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); + } + if ( oRange === "max" && this.orientation === "vertical" ) { + this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } ); + } + } + } + +}); + +$.extend( $.ui.slider, { + version: "1.8.24" +}); + +}(jQuery)); +/*! + * jQuery UI Tabs 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +var tabId = 0, + listId = 0; + +function getNextTabId() { + return ++tabId; +} + +function getNextListId() { + return ++listId; +} + +$.widget( "ui.tabs", { + options: { + add: null, + ajaxOptions: null, + cache: false, + cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } + collapsible: false, + disable: null, + disabled: [], + enable: null, + event: "click", + fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 } + idPrefix: "ui-tabs-", + load: null, + panelTemplate: "<div></div>", + remove: null, + select: null, + show: null, + spinner: "<em>Loading…</em>", + tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>" + }, + + _create: function() { + this._tabify( true ); + }, + + _setOption: function( key, value ) { + if ( key == "selected" ) { + if (this.options.collapsible && value == this.options.selected ) { + return; + } + this.select( value ); + } else { + this.options[ key ] = value; + this._tabify(); + } + }, + + _tabId: function( a ) { + return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) || + this.options.idPrefix + getNextTabId(); + }, + + _sanitizeSelector: function( hash ) { + // we need this because an id may contain a ":" + return hash.replace( /:/g, "\\:" ); + }, + + _cookie: function() { + var cookie = this.cookie || + ( this.cookie = this.options.cookie.name || "ui-tabs-" + getNextListId() ); + return $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) ); + }, + + _ui: function( tab, panel ) { + return { + tab: tab, + panel: panel, + index: this.anchors.index( tab ) + }; + }, + + _cleanup: function() { + // restore all former loading tabs labels + this.lis.filter( ".ui-state-processing" ) + .removeClass( "ui-state-processing" ) + .find( "span:data(label.tabs)" ) + .each(function() { + var el = $( this ); + el.html( el.data( "label.tabs" ) ).removeData( "label.tabs" ); + }); + }, + + _tabify: function( init ) { + var self = this, + o = this.options, + fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash + + this.list = this.element.find( "ol,ul" ).eq( 0 ); + this.lis = $( " > li:has(a[href])", this.list ); + this.anchors = this.lis.map(function() { + return $( "a", this )[ 0 ]; + }); + this.panels = $( [] ); + + this.anchors.each(function( i, a ) { + var href = $( a ).attr( "href" ); + // For dynamically created HTML that contains a hash as href IE < 8 expands + // such href to the full page url with hash and then misinterprets tab as ajax. + // Same consideration applies for an added tab with a fragment identifier + // since a[href=#fragment-identifier] does unexpectedly not match. + // Thus normalize href attribute... + var hrefBase = href.split( "#" )[ 0 ], + baseEl; + if ( hrefBase && ( hrefBase === location.toString().split( "#" )[ 0 ] || + ( baseEl = $( "base" )[ 0 ]) && hrefBase === baseEl.href ) ) { + href = a.hash; + a.href = href; + } + + // inline tab + if ( fragmentId.test( href ) ) { + self.panels = self.panels.add( self.element.find( self._sanitizeSelector( href ) ) ); + // remote tab + // prevent loading the page itself if href is just "#" + } else if ( href && href !== "#" ) { + // required for restore on destroy + $.data( a, "href.tabs", href ); + + // TODO until #3808 is fixed strip fragment identifier from url + // (IE fails to load from such url) + $.data( a, "load.tabs", href.replace( /#.*$/, "" ) ); + + var id = self._tabId( a ); + a.href = "#" + id; + var $panel = self.element.find( "#" + id ); + if ( !$panel.length ) { + $panel = $( o.panelTemplate ) + .attr( "id", id ) + .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ) + .insertAfter( self.panels[ i - 1 ] || self.list ); + $panel.data( "destroy.tabs", true ); + } + self.panels = self.panels.add( $panel ); + // invalid tab href + } else { + o.disabled.push( i ); + } + }); + + // initialization from scratch + if ( init ) { + // attach necessary classes for styling + this.element.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" ); + this.list.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ); + this.lis.addClass( "ui-state-default ui-corner-top" ); + this.panels.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ); + + // 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.anchors.each(function( i, a ) { + if ( a.hash == location.hash ) { + o.selected = i; + return false; + } + }); + } + if ( typeof o.selected !== "number" && o.cookie ) { + o.selected = parseInt( self._cookie(), 10 ); + } + if ( typeof o.selected !== "number" && this.lis.filter( ".ui-tabs-selected" ).length ) { + o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) ); + } + o.selected = o.selected || ( this.lis.length ? 0 : -1 ); + } else if ( o.selected === null ) { // usage of null is deprecated, TODO remove in next release + o.selected = -1; + } + + // sanity check - default to first tab... + o.selected = ( ( o.selected >= 0 && this.anchors[ o.selected ] ) || o.selected < 0 ) + ? o.selected + : 0; + + // 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( ".ui-state-disabled" ), 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( "ui-tabs-hide" ); + this.lis.removeClass( "ui-tabs-selected ui-state-active" ); + // check for length avoids error when initializing empty list + if ( o.selected >= 0 && this.anchors.length ) { + self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ).removeClass( "ui-tabs-hide" ); + this.lis.eq( o.selected ).addClass( "ui-tabs-selected ui-state-active" ); + + // seems to be expected behavior that the show callback is fired + self.element.queue( "tabs", function() { + self._trigger( "show", null, + self._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) )[ 0 ] ) ); + }); + + this.load( o.selected ); + } + + // clean up to avoid memory leaks in certain versions of IE 6 + // TODO: namespace this event + $( window ).bind( "unload", function() { + self.lis.add( self.anchors ).unbind( ".tabs" ); + self.lis = self.anchors = self.panels = null; + }); + // update selected after add/remove + } else { + o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) ); + } + + // update collapsible + // TODO: use .toggleClass() + this.element[ o.collapsible ? "addClass" : "removeClass" ]( "ui-tabs-collapsible" ); + + // set or update cookie after init and add/remove respectively + if ( o.cookie ) { + this._cookie( o.selected, o.cookie ); + } + + // disable tabs + for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) { + $( li )[ $.inArray( i, o.disabled ) != -1 && + // TODO: use .toggleClass() + !$( li ).hasClass( "ui-tabs-selected" ) ? "addClass" : "removeClass" ]( "ui-state-disabled" ); + } + + // reset cache if switching from cached to not cached + if ( o.cache === false ) { + this.anchors.removeData( "cache.tabs" ); + } + + // remove all handlers before, tabify may run on existing tabs after add or option change + this.lis.add( this.anchors ).unbind( ".tabs" ); + + if ( o.event !== "mouseover" ) { + var addState = function( state, el ) { + if ( el.is( ":not(.ui-state-disabled)" ) ) { + el.addClass( "ui-state-" + state ); + } + }; + var removeState = function( state, el ) { + el.removeClass( "ui-state-" + state ); + }; + this.lis.bind( "mouseover.tabs" , function() { + addState( "hover", $( this ) ); + }); + this.lis.bind( "mouseout.tabs", function() { + removeState( "hover", $( this ) ); + }); + this.anchors.bind( "focus.tabs", function() { + addState( "focus", $( this ).closest( "li" ) ); + }); + this.anchors.bind( "blur.tabs", function() { + removeState( "focus", $( this ).closest( "li" ) ); + }); + } + + // set up animations + var hideFx, showFx; + if ( o.fx ) { + if ( $.isArray( o.fx ) ) { + hideFx = o.fx[ 0 ]; + showFx = o.fx[ 1 ]; + } else { + hideFx = showFx = o.fx; + } + } + + // Reset certain styles left over from animation + // and prevent IE's ClearType bug... + function resetStyle( $el, fx ) { + $el.css( "display", "" ); + if ( !$.support.opacity && fx.opacity ) { + $el[ 0 ].style.removeAttribute( "filter" ); + } + } + + // Show a tab... + var showTab = showFx + ? function( clicked, $show ) { + $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" ); + $show.hide().removeClass( "ui-tabs-hide" ) // avoid flicker that way + .animate( showFx, showFx.duration || "normal", function() { + resetStyle( $show, showFx ); + self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) ); + }); + } + : function( clicked, $show ) { + $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" ); + $show.removeClass( "ui-tabs-hide" ); + self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) ); + }; + + // Hide a tab, $show is optional... + var hideTab = hideFx + ? function( clicked, $hide ) { + $hide.animate( hideFx, hideFx.duration || "normal", function() { + self.lis.removeClass( "ui-tabs-selected ui-state-active" ); + $hide.addClass( "ui-tabs-hide" ); + resetStyle( $hide, hideFx ); + self.element.dequeue( "tabs" ); + }); + } + : function( clicked, $hide, $show ) { + self.lis.removeClass( "ui-tabs-selected ui-state-active" ); + $hide.addClass( "ui-tabs-hide" ); + self.element.dequeue( "tabs" ); + }; + + // attach tab event handler, unbind to avoid duplicates from former tabifying... + this.anchors.bind( o.event + ".tabs", function() { + var el = this, + $li = $(el).closest( "li" ), + $hide = self.panels.filter( ":not(.ui-tabs-hide)" ), + $show = self.element.find( self._sanitizeSelector( el.hash ) ); + + // If tab is already selected and not collapsible 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( "ui-tabs-selected" ) && !o.collapsible) || + $li.hasClass( "ui-state-disabled" ) || + $li.hasClass( "ui-state-processing" ) || + self.panels.filter( ":animated" ).length || + self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) { + this.blur(); + return false; + } + + o.selected = self.anchors.index( this ); + + self.abort(); + + // if tab may be closed + if ( o.collapsible ) { + if ( $li.hasClass( "ui-tabs-selected" ) ) { + o.selected = -1; + + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + self.element.queue( "tabs", function() { + hideTab( el, $hide ); + }).dequeue( "tabs" ); + + this.blur(); + return false; + } else if ( !$hide.length ) { + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + self.element.queue( "tabs", function() { + showTab( el, $show ); + }); + + // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171 + self.load( self.anchors.index( this ) ); + + this.blur(); + return false; + } + } + + if ( o.cookie ) { + self._cookie( o.selected, o.cookie ); + } + + // show new tab + if ( $show.length ) { + if ( $hide.length ) { + self.element.queue( "tabs", function() { + hideTab( el, $hide ); + }); + } + self.element.queue( "tabs", function() { + showTab( el, $show ); + }); + + self.load( self.anchors.index( this ) ); + } 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 via CSS + // in modern browsers; blur() removes focus from address bar in Firefox + // which can become a usability and annoying problem with tabs('rotate'). + if ( $.browser.msie ) { + this.blur(); + } + }); + + // disable click in any case + this.anchors.bind( "click.tabs", function(){ + return false; + }); + }, + + _getIndex: function( index ) { + // meta-function to give users option to provide a href string instead of a numerical index. + // also sanitizes numerical indexes to valid values. + if ( typeof index == "string" ) { + index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) ); + } + + return index; + }, + + destroy: function() { + var o = this.options; + + this.abort(); + + this.element + .unbind( ".tabs" ) + .removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ) + .removeData( "tabs" ); + + this.list.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ); + + this.anchors.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.unbind( ".tabs" ).add( this.panels ).each(function() { + if ( $.data( this, "destroy.tabs" ) ) { + $( this ).remove(); + } else { + $( this ).removeClass([ + "ui-state-default", + "ui-corner-top", + "ui-tabs-selected", + "ui-state-active", + "ui-state-hover", + "ui-state-focus", + "ui-state-disabled", + "ui-tabs-panel", + "ui-widget-content", + "ui-corner-bottom", + "ui-tabs-hide" + ].join( " " ) ); + } + }); + + if ( o.cookie ) { + this._cookie( null, o.cookie ); + } + + return this; + }, + + add: function( url, label, index ) { + if ( index === undefined ) { + index = this.anchors.length; + } + + var self = this, + o = this.options, + $li = $( o.tabTemplate.replace( /#\{href\}/g, url ).replace( /#\{label\}/g, label ) ), + id = !url.indexOf( "#" ) ? url.replace( "#", "" ) : this._tabId( $( "a", $li )[ 0 ] ); + + $li.addClass( "ui-state-default ui-corner-top" ).data( "destroy.tabs", true ); + + // try to find an existing element before creating a new one + var $panel = self.element.find( "#" + id ); + if ( !$panel.length ) { + $panel = $( o.panelTemplate ) + .attr( "id", id ) + .data( "destroy.tabs", true ); + } + $panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" ); + + if ( index >= this.lis.length ) { + $li.appendTo( this.list ); + $panel.appendTo( this.list[ 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.anchors.length == 1 ) { + o.selected = 0; + $li.addClass( "ui-tabs-selected ui-state-active" ); + $panel.removeClass( "ui-tabs-hide" ); + this.element.queue( "tabs", function() { + self._trigger( "show", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) ); + }); + + this.load( 0 ); + } + + this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + return this; + }, + + remove: function( index ) { + index = this._getIndex( 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( "ui-tabs-selected" ) && this.anchors.length > 1) { + this.select( index + ( index + 1 < this.anchors.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(); + + this._trigger( "remove", null, this._ui( $li.find( "a" )[ 0 ], $panel[ 0 ] ) ); + return this; + }, + + enable: function( index ) { + index = this._getIndex( index ); + var o = this.options; + if ( $.inArray( index, o.disabled ) == -1 ) { + return; + } + + this.lis.eq( index ).removeClass( "ui-state-disabled" ); + o.disabled = $.grep( o.disabled, function( n, i ) { + return n != index; + }); + + this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + return this; + }, + + disable: function( index ) { + index = this._getIndex( index ); + var self = this, o = this.options; + // cannot disable already selected tab + if ( index != o.selected ) { + this.lis.eq( index ).addClass( "ui-state-disabled" ); + + o.disabled.push( index ); + o.disabled.sort(); + + this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) ); + } + + return this; + }, + + select: function( index ) { + index = this._getIndex( index ); + if ( index == -1 ) { + if ( this.options.collapsible && this.options.selected != -1 ) { + index = this.options.selected; + } else { + return this; + } + } + this.anchors.eq( index ).trigger( this.options.event + ".tabs" ); + return this; + }, + + load: function( index ) { + index = this._getIndex( index ); + var self = this, + o = this.options, + a = this.anchors.eq( index )[ 0 ], + url = $.data( a, "load.tabs" ); + + this.abort(); + + // not remote or from cache + if ( !url || this.element.queue( "tabs" ).length !== 0 && $.data( a, "cache.tabs" ) ) { + this.element.dequeue( "tabs" ); + return; + } + + // load remote from here on + this.lis.eq( index ).addClass( "ui-state-processing" ); + + if ( o.spinner ) { + var span = $( "span", a ); + span.data( "label.tabs", span.html() ).html( o.spinner ); + } + + this.xhr = $.ajax( $.extend( {}, o.ajaxOptions, { + url: url, + success: function( r, s ) { + self.element.find( self._sanitizeSelector( a.hash ) ).html( r ); + + // take care of tab labels + self._cleanup(); + + if ( o.cache ) { + $.data( a, "cache.tabs", true ); + } + + self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) ); + try { + o.ajaxOptions.success( r, s ); + } + catch ( e ) {} + }, + error: function( xhr, s, e ) { + // take care of tab labels + self._cleanup(); + + self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) ); + try { + // Passing index avoid a race condition when this method is + // called after the user has selected another tab. + // Pass the anchor that initiated this request allows + // loadError to manipulate the tab content panel via $(a.hash) + o.ajaxOptions.error( xhr, s, index, a ); + } + catch ( e ) {} + } + } ) ); + + // last, so that load event is fired before show... + self.element.dequeue( "tabs" ); + + return this; + }, + + abort: function() { + // stop possibly running animations + this.element.queue( [] ); + this.panels.stop( false, true ); + + // "tabs" queue must not contain more than two elements, + // which are the callbacks for the latest clicked tab... + this.element.queue( "tabs", this.element.queue( "tabs" ).splice( -2, 2 ) ); + + // terminate pending requests from other tabs + if ( this.xhr ) { + this.xhr.abort(); + delete this.xhr; + } + + // take care of tab labels + this._cleanup(); + return this; + }, + + url: function( index, url ) { + this.anchors.eq( index ).removeData( "cache.tabs" ).data( "load.tabs", url ); + return this; + }, + + length: function() { + return this.anchors.length; + } +}); + +$.extend( $.ui.tabs, { + version: "1.8.24" +}); + +/* + * Tabs Extensions + */ + +/* + * Rotate + */ +$.extend( $.ui.tabs.prototype, { + rotation: null, + rotate: function( ms, continuing ) { + var self = this, + o = this.options; + + var rotate = self._rotate || ( self._rotate = function( e ) { + clearTimeout( self.rotation ); + self.rotation = setTimeout(function() { + var t = o.selected; + self.select( ++t < self.anchors.length ? t : 0 ); + }, ms ); + + if ( e ) { + e.stopPropagation(); + } + }); + + var stop = self._unrotate || ( self._unrotate = !continuing + ? function(e) { + if (e.clientX) { // in case of a true click + self.rotate(null); + } + } + : function( e ) { + rotate(); + }); + + // start rotation + if ( ms ) { + this.element.bind( "tabsshow", rotate ); + this.anchors.bind( o.event + ".tabs", stop ); + rotate(); + // stop rotation + } else { + clearTimeout( self.rotation ); + this.element.unbind( "tabsshow", rotate ); + this.anchors.unbind( o.event + ".tabs", stop ); + delete this._rotate; + delete this._unrotate; + } + + return this; + } +}); + +})( jQuery ); +/*! + * jQuery UI Datepicker 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker + * + * Depends: + * jquery.ui.core.js + */ +(function( $, undefined ) { + +$.extend($.ui, { datepicker: { version: "1.8.24" } }); + +var PROP_NAME = 'datepicker'; +var dpuuid = new Date().getTime(); +var instActive; + +/* 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, + allowing multiple different settings on the same page. */ + +function Datepicker() { + this.debug = false; // Change this to true to start debugging + this._curInst = null; // The current instance in use + this._keyEvent = false; // If the last event was a key event + 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._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division + this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class + this._appendClass = 'ui-datepicker-append'; // The name of the append marker class + this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class + this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class + this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class + this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class + this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class + this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + closeText: 'Done', // Display text for close link + prevText: 'Prev', // Display text for previous month link + nextText: 'Next', // Display text for next month link + currentText: 'Today', // Display 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 + 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 + weekHeader: 'Wk', // Column header for week of the year + dateFormat: 'mm/dd/yy', // See format options on parseDate + firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... + isRTL: false, // True if right-to-left language, false if left-to-right + showMonthAfterYear: false, // True if the year select precedes month, false for month then year + yearSuffix: '' // Additional text to append to the year in the month headers + }; + 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: 'fadeIn', // Name of jQuery animation for popup + showOptions: {}, // Options for enhanced animations + 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 + hideIfNoPrevNext: false, // True to hide next/previous month links + // if not applicable, false to just disable them + navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links + gotoCurrent: false, // True if today link goes back to current selection instead + changeMonth: false, // True if month can be selected directly, false if only prev/next + changeYear: false, // True if year can be selected directly, false if only prev/next + yearRange: 'c-10:c+10', // Range of years to display in drop-down, + // either relative to today's year (-nn:+nn), relative to currently displayed year + // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) + showOtherMonths: false, // True to show dates in other months, false to leave blank + selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable + showWeek: false, // True to show week of the year, false to not show it + 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 + minDate: null, // The earliest selectable date, or null for no limit + maxDate: null, // The latest selectable date, or null for no limit + duration: 'fast', // Duration 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 '', + // [2] = cell title (optional), 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 + onChangeMonthYear: null, // Define a callback function when the month or year is changed + onClose: null, // Define a callback function when the datepicker is closed + numberOfMonths: 1, // Number of months to show at a time + showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) + stepMonths: 1, // Number of months to step back/forward + stepBigMonths: 12, // Number of months to step back/forward for the big links + altField: '', // Selector for an alternate field to store selected dates into + altFormat: '', // The date format to use for the alternate field + constrainInput: true, // The input is constrained by the current date format + showButtonPanel: false, // True to show button panel, false to not show it + autoSize: false, // True to size the input for the date format, false to leave as is + disabled: false // The initial disabled state + }; + $.extend(this._defaults, this.regional['']); + this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')); +} + +$.extend(Datepicker.prototype, { + /* Class name added to elements to indicate already configured with a date picker. */ + markerClassName: 'hasDatepicker', + + //Keep track of the maximum number of rows displayed (see #7043) + maxRows: 4, + + /* Debug logging (if enabled). */ + log: function () { + if (this.debug) + console.log.apply('', arguments); + }, + + // TODO rename to "widget" when switching to widget factory + _widgetDatepicker: function() { + return this.dpDiv; + }, + + /* 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 (var 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 inline = (nodeName == 'div' || nodeName == 'span'); + if (!target.id) { + this.uuid += 1; + target.id = 'dp' + this.uuid; + } + var inst = this._newInst($(target), inline); + inst.settings = $.extend({}, settings || {}, inlineSettings || {}); + if (nodeName == 'input') { + this._connectDatepicker(target, inst); + } else if (inline) { + this._inlineDatepicker(target, inst); + } + }, + + /* Create a new instance object. */ + _newInst: function(target, inline) { + var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars + return {id: id, input: target, // associated target + selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection + drawMonth: 0, drawYear: 0, // month being drawn + inline: inline, // is datepicker inline or not + dpDiv: (!inline ? this.dpDiv : // presentation div + bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))}; + }, + + /* Attach the date picker to an input field. */ + _connectDatepicker: function(target, inst) { + var input = $(target); + inst.append = $([]); + inst.trigger = $([]); + if (input.hasClass(this.markerClassName)) + return; + this._attachments(input, inst); + input.addClass(this.markerClassName).keydown(this._doKeyDown). + keypress(this._doKeyPress).keyup(this._doKeyUp). + bind("setData.datepicker", function(event, key, value) { + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key) { + return this._get(inst, key); + }); + this._autoSize(inst); + $.data(target, PROP_NAME, inst); + //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + }, + + /* Make attachments based on settings. */ + _attachments: function(input, inst) { + var appendText = this._get(inst, 'appendText'); + var isRTL = this._get(inst, 'isRTL'); + if (inst.append) + inst.append.remove(); + if (appendText) { + inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>'); + input[isRTL ? 'before' : 'after'](inst.append); + } + input.unbind('focus', this._showDatepicker); + if (inst.trigger) + inst.trigger.remove(); + var showOn = this._get(inst, '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 + var buttonText = this._get(inst, 'buttonText'); + var buttonImage = this._get(inst, 'buttonImage'); + inst.trigger = $(this._get(inst, 'buttonImageOnly') ? + $('<img/>').addClass(this._triggerClass). + attr({ src: buttonImage, alt: buttonText, title: buttonText }) : + $('<button type="button"></button>').addClass(this._triggerClass). + html(buttonImage == '' ? buttonText : $('<img/>').attr( + { src:buttonImage, alt:buttonText, title:buttonText }))); + input[isRTL ? 'before' : 'after'](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) + $.datepicker._hideDatepicker(); + else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) { + $.datepicker._hideDatepicker(); + $.datepicker._showDatepicker(input[0]); + } else + $.datepicker._showDatepicker(input[0]); + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, 'autoSize') && !inst.inline) { + var date = new Date(2009, 12 - 1, 20); // Ensure double digits + var dateFormat = this._get(inst, 'dateFormat'); + if (dateFormat.match(/[DM]/)) { + var findMax = function(names) { + var max = 0; + var maxI = 0; + for (var i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + 'monthNames' : 'monthNamesShort')))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay()); + } + inst.input.attr('size', this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) + return; + divSpan.addClass(this.markerClassName).append(inst.dpDiv). + bind("setData.datepicker", function(event, key, value){ + inst.settings[key] = value; + }).bind("getData.datepicker", function(event, key){ + return this._get(inst, key); + }); + $.data(target, PROP_NAME, inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + //If disabled option is true, disable the datepicker before showing it (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements + // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height + inst.dpDiv.css( "display", "block" ); + }, + + /* Pop-up the date picker in a "dialog" box. + @param input element - ignored + @param date string or Date - the initial date to display + @param onSelect function - the function 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, date, onSelect, settings, pos) { + var inst = this._dialogInst; // internal instance + if (!inst) { + this.uuid += 1; + var id = 'dp' + this.uuid; + this._dialogInput = $('<input type="text" id="' + id + + '" style="position: absolute; top: -100px; width: 0px;"/>'); + this._dialogInput.keydown(this._doKeyDown); + $('body').append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], PROP_NAME, inst); + } + extendRemove(inst.settings, settings || {}); + date = (date && date.constructor == Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + var browserWidth = document.documentElement.clientWidth; + var browserHeight = document.documentElement.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] + 20) + 'px').css('top', this._pos[1] + 'px'); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) + $.blockUI(this.dpDiv); + $.data(this._dialogInput[0], PROP_NAME, inst); + return this; + }, + + /* Detach a datepicker from its control. + @param target element - the target input field or division or span */ + _destroyDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + $.removeData(target, PROP_NAME); + if (nodeName == 'input') { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind('focus', this._showDatepicker). + unbind('keydown', this._doKeyDown). + unbind('keypress', this._doKeyPress). + unbind('keyup', this._doKeyUp); + } else if (nodeName == 'div' || nodeName == 'span') + $target.removeClass(this.markerClassName).empty(); + }, + + /* Enable the date picker to a jQuery selection. + @param target element - the target input field or division or span */ + _enableDatepicker: function(target) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = false; + inst.trigger.filter('button'). + each(function() { this.disabled = false; }).end(). + filter('img').css({opacity: '1.0', cursor: ''}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().removeClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + removeAttr("disabled"); + } + 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) { + var $target = $(target); + var inst = $.data(target, PROP_NAME); + if (!$target.hasClass(this.markerClassName)) { + return; + } + var nodeName = target.nodeName.toLowerCase(); + if (nodeName == 'input') { + target.disabled = true; + inst.trigger.filter('button'). + each(function() { this.disabled = true; }).end(). + filter('img').css({opacity: '0.5', cursor: 'default'}); + } + else if (nodeName == 'div' || nodeName == 'span') { + var inline = $target.children('.' + this._inlineClass); + inline.children().addClass('ui-state-disabled'); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + attr("disabled", "disabled"); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value == target ? null : value); }); // delete entry + this._disabledInputs[this._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; + }, + + /* Retrieve the instance data for the target control. + @param target element - the target input field or division or span + @return object - the associated instance data + @throws error if a jQuery problem getting data */ + _getInst: function(target) { + try { + return $.data(target, PROP_NAME); + } + catch (err) { + throw 'Missing instance data for this datepicker'; + } + }, + + /* Update or retrieve 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 object - the new settings to update or + string - the name of the setting to change or retrieve, + when retrieving also 'all' for all instance settings or + 'defaults' for all global defaults + @param value any - the new value for the setting + (omit if above is an object or to retrieve a value) */ + _optionDatepicker: function(target, name, value) { + var inst = this._getInst(target); + if (arguments.length == 2 && typeof name == 'string') { + return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) : + (inst ? (name == 'all' ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + var settings = name || {}; + if (typeof name == 'string') { + settings = {}; + settings[name] = value; + } + if (inst) { + if (this._curInst == inst) { + this._hideDatepicker(); + } + var date = this._getDateDatepicker(target, true); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + extendRemove(inst.settings, settings); + // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided + if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined) + inst.settings.minDate = this._formatDate(inst, minDate); + if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined) + inst.settings.maxDate = this._formatDate(inst, maxDate); + this._attachments($(target), inst); + this._autoSize(inst); + this._setDate(inst, date); + this._updateAlternate(inst); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. + @param target element - the target input field or division or span */ + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + 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 */ + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + @param target element - the target input field or division or span + @param noDefault boolean - true if no default date is to be used + @return Date - the current date */ + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) + this._setDateFromField(inst, noDefault); + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var inst = $.datepicker._getInst(event.target); + var handled = true; + var isRTL = inst.dpDiv.is('.ui-datepicker-rtl'); + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) + switch (event.keyCode) { + case 9: $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' + + $.datepicker._currentClass + ')', inst.dpDiv); + if (sel[0]) + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + var onSelect = $.datepicker._get(inst, 'onSelect'); + if (onSelect) { + var dateStr = $.datepicker._formatDate(inst); + + // trigger custom callback + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); + } + else + $.datepicker._hideDatepicker(); + return false; // don't submit the form + break; // select the value on enter + case 27: $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + break; // next month/year on page down/+ ctrl + case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target); + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target); + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D'); + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, 'stepBigMonths') : + -$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +left on Mac + break; + case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D'); + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, 'stepBigMonths') : + +$.datepicker._get(inst, 'stepMonths')), 'M'); + // next month/year on alt +right + break; + case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D'); + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: handled = false; + } + else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + else { + handled = false; + } + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var inst = $.datepicker._getInst(event.target); + if ($.datepicker._get(inst, 'constrainInput')) { + var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')); + var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode); + return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var inst = $.datepicker._getInst(event.target); + if (inst.input.val() != inst.lastVal) { + try { + var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (err) { + $.datepicker.log(err); + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. + If false returned from beforeShow event handler do not show. + @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); + if ($.datepicker._curInst && $.datepicker._curInst != inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + if ( inst && $.datepicker._datepickerShowing ) { + $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); + } + } + var beforeShow = $.datepicker._get(inst, 'beforeShow'); + var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; + if(beforeShowSettings === false){ + //false + return; + } + extendRemove(inst.settings, beforeShowSettings); + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + 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'; + return !isFixed; + }); + if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled + $.datepicker._pos[0] -= document.documentElement.scrollLeft; + $.datepicker._pos[1] -= document.documentElement.scrollTop; + } + var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; + $.datepicker._pos = null; + //to avoid flashes on Firefox + inst.dpDiv.empty(); + // determine sizing offscreen + inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'}); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? + 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', + left: offset.left + 'px', top: offset.top + 'px'}); + if (!inst.inline) { + var showAnim = $.datepicker._get(inst, 'showAnim'); + var duration = $.datepicker._get(inst, 'duration'); + var postProcess = function() { + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !! cover.length ){ + var borders = $.datepicker._getBorders(inst.dpDiv); + cover.css({left: -borders[0], top: -borders[1], + width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}); + } + }; + inst.dpDiv.zIndex($(input).zIndex()+1); + $.datepicker._datepickerShowing = true; + if ($.effects && $.effects[showAnim]) + inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); + if (!showAnim || !duration) + postProcess(); + if (inst.input.is(':visible') && !inst.input.is(':disabled')) + inst.input.focus(); + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + var self = this; + self.maxRows = 4; //Reset the max number of rows being displayed (see #7043) + var borders = $.datepicker._getBorders(inst.dpDiv); + instActive = inst; // for delegate hover events + inst.dpDiv.empty().append(this._generateHTML(inst)); + this._attachHandlers(inst); + var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only + if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6 + cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()}) + } + inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover(); + var numMonths = this._getNumberOfMonths(inst); + var cols = numMonths[1]; + var width = 17; + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); + if (cols > 1) + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); + inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + + 'Class']('ui-datepicker-multi'); + inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + + 'Class']('ui-datepicker-rtl'); + if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) + inst.input.focus(); + // deffered render of the years select (to avoid flashes on Firefox) + if( inst.yearshtml ){ + var origyearshtml = inst.yearshtml; + setTimeout(function(){ + //assure that inst.yearshtml didn't change. + if( origyearshtml === inst.yearshtml && inst.yearshtml ){ + inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml); + } + origyearshtml = inst.yearshtml = null; + }, 0); + } + }, + + /* Retrieve the size of left and top borders for an element. + @param elem (jQuery object) the element of interest + @return (number[2]) the left and top borders */ + _getBorders: function(elem) { + var convert = function(value) { + return {thin: 1, medium: 2, thick: 3}[value] || value; + }; + return [parseFloat(convert(elem.css('border-left-width'))), + parseFloat(convert(elem.css('border-top-width')))]; + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(); + var dpHeight = inst.dpDiv.outerHeight(); + var inputWidth = inst.input ? inst.input.outerWidth() : 0; + var inputHeight = inst.input ? inst.input.outerHeight() : 0; + var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()); + var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); + + offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var inst = this._getInst(obj); + var isRTL = this._get(inst, 'isRTL'); + while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { + obj = obj[isRTL ? 'previousSibling' : '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 */ + _hideDatepicker: function(input) { + var inst = this._curInst; + if (!inst || (input && inst != $.data(input, PROP_NAME))) + return; + if (this._datepickerShowing) { + var showAnim = this._get(inst, 'showAnim'); + var duration = this._get(inst, 'duration'); + var postProcess = function() { + $.datepicker._tidyDialog(inst); + }; + if ($.effects && $.effects[showAnim]) + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); + else + inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess); + if (!showAnim) + postProcess(); + this._datepickerShowing = false; + var onClose = this._get(inst, 'onClose'); + if (onClose) + onClose.apply((inst.input ? inst.input[0] : null), + [(inst.input ? inst.input.val() : ''), inst]); + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' }); + if ($.blockUI) { + $.unblockUI(); + $('body').append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar'); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) + return; + + var $target = $(event.target), + inst = $.datepicker._getInst($target[0]); + + if ( ( ( $target[0].id != $.datepicker._mainDivId && + $target.parents('#' + $.datepicker._mainDivId).length == 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.closest("." + $.datepicker._triggerClass).length && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || + ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) ) + $.datepicker._hideDatepicker(); + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + if (this._get(inst, 'gotoCurrent') && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } + else { + var date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id); + var inst = this._getInst(target[0]); + inst['selected' + (period == 'M' ? 'Month' : 'Year')] = + inst['draw' + (period == 'M' ? 'Month' : 'Year')] = + parseInt(select.options[select.selectedIndex].value,10); + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var target = $(id); + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + var inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $('a', td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + var inst = this._getInst(target[0]); + this._selectDate(target, ''); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var target = $(id); + var inst = this._getInst(target[0]); + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) + inst.input.val(dateStr); + this._updateAlternate(inst); + var onSelect = this._get(inst, '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 { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) != 'object') + inst.input.focus(); // restore focus + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altField = this._get(inst, 'altField'); + if (altField) { // update alternate field too + var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat'); + var date = this._getDate(inst); + var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { $(this).val(dateStr); }); + } + }, + + /* 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.getTime()); + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + var time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. + See formatDate below for the possible formats. + + @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; + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + 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 doy = -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) { + var isDoubled = lookAhead(match); + var size = (match == '@' ? 14 : (match == '!' ? 20 : + (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2)))); + var digits = new RegExp('^\\d{1,' + size + '}'); + var num = value.substring(iValue).match(digits); + if (!num) + throw 'Missing number at position ' + iValue; + iValue += num[0].length; + return parseInt(num[0], 10); + }; + // Extract a name from the string value and convert to an index + var getName = function(match, shortNames, longNames) { + var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { + return [ [k, v] ]; + }).sort(function (a, b) { + return -(a[1].length - b[1].length); + }); + var index = -1; + $.each(names, function (i, pair) { + var name = pair[1]; + if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) { + index = pair[0]; + iValue += name.length; + return false; + } + }); + if (index != -1) + return index + 1; + else + throw 'Unknown name at position ' + iValue; + }; + // 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 'o': + doy = getNumber('o'); + break; + case 'm': + month = getNumber('m'); + break; + case 'M': + month = getName('M', monthNamesShort, monthNames); + break; + case 'y': + year = getNumber('y'); + break; + case '@': + var date = new Date(getNumber('@')); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case '!': + var date = new Date((getNumber('!') - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")) + checkLiteral(); + else + literal = true; + break; + default: + checkLiteral(); + } + } + if (iValue < value.length){ + throw "Extra/unparsed characters found in date: " + value.substring(iValue); + } + if (year == -1) + year = new Date().getFullYear(); + else if (year < 100) + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + if (doy > -1) { + month = 1; + day = doy; + do { + var dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) + break; + month++; + day -= dim; + } while (true); + } + var date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day) + throw 'Invalid date'; // E.g. 31/02/00 + return date; + }, + + /* Standard date formats. */ + ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601) + COOKIE: 'D, dd M yy', + ISO_8601: 'yy-mm-dd', + RFC_822: 'D, d M y', + RFC_850: 'DD, dd-M-y', + RFC_1036: 'D, d M y', + RFC_1123: 'D, d M yy', + RFC_2822: 'D, d M yy', + RSS: 'D, d M y', // RFC 822 + TICKS: '!', + TIMESTAMP: '@', + W3C: 'yy-mm-dd', // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* 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) + o - day of year (no leading zeros) + oo - day of year (three 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) + @ - Unix timestamp (ms since 01/01/1970) + ! - Windows ticks (100ns since 01/01/0001) + '...' - 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, len) { + var num = '' + value; + if (lookAhead(match)) + while (num.length < len) + num = '0' + num; + return num; + }; + // 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(), 2); + break; + case 'D': + output += formatName('D', date.getDay(), dayNamesShort, dayNames); + break; + case 'o': + output += formatNumber('o', + Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); + break; + case 'm': + output += formatNumber('m', date.getMonth() + 1, 2); + 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 '@': + output += date.getTime(); + break; + case '!': + output += date.getTime() * 10000 + this._ticksTo1970; + 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; + // 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; + }; + 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': case 'm': case 'y': case '@': + chars += '0123456789'; + break; + case 'D': case 'M': + return null; // Accept anything + case "'": + if (lookAhead("'")) + chars += "'"; + else + literal = true; + break; + default: + chars += format.charAt(iFormat); + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() == inst.lastVal) { + return; + } + var dateFormat = this._get(inst, 'dateFormat'); + var dates = inst.lastVal = inst.input ? inst.input.val() : null; + var date, defaultDate; + date = defaultDate = this._getDefaultDate(inst); + var settings = this._getFormatConfig(inst); + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + this.log(event); + dates = (noDefault ? '' : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, 'defaultDate'), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }; + var offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(); + var year = date.getFullYear(); + var month = date.getMonth(); + var day = date.getDate(); + var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g; + var matches = pattern.exec(offset); + while (matches) { + switch (matches[2] || 'd') { + case 'd' : case 'D' : + day += parseInt(matches[1],10); break; + case 'w' : case 'W' : + day += parseInt(matches[1],10) * 7; break; + case 'm' : case 'M' : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case 'y': case 'Y' : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }; + var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) : + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); + newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate); + if (newDate) { + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + } + return this._daylightSavingAdjust(newDate); + }, + + /* Handle switch to/from daylight saving. + Hours may be non-zero on daylight saving cut-over: + > 12 when midnight changeover, but then cannot generate + midnight datetime, so jump to 1AM, otherwise reset. + @param date (Date) the date to check + @return (Date) the corrected date */ + _daylightSavingAdjust: function(date) { + if (!date) return null; + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !date; + var origMonth = inst.selectedMonth; + var origYear = inst.selectedYear; + var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + inst.selectedDay = inst.currentDay = newDate.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); + if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange) + this._notifyChange(inst); + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? '' : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Attach the onxxx handlers. These are declared statically so + * they work with static code transformers like Caja. + */ + _attachHandlers: function(inst) { + var stepMonths = this._get(inst, 'stepMonths'); + var id = '#' + inst.id.replace( /\\\\/g, "\\" ); + inst.dpDiv.find('[data-handler]').map(function () { + var handler = { + prev: function () { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, -stepMonths, 'M'); + }, + next: function () { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, +stepMonths, 'M'); + }, + hide: function () { + window['DP_jQuery_' + dpuuid].datepicker._hideDatepicker(); + }, + today: function () { + window['DP_jQuery_' + dpuuid].datepicker._gotoToday(id); + }, + selectDay: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectDay(id, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this); + return false; + }, + selectMonth: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'M'); + return false; + }, + selectYear: function () { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'Y'); + return false; + } + }; + $(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]); + }); + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var today = new Date(); + today = this._daylightSavingAdjust( + new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time + var isRTL = this._get(inst, 'isRTL'); + var showButtonPanel = this._get(inst, 'showButtonPanel'); + var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext'); + var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat'); + var numMonths = this._getNumberOfMonths(inst); + var showCurrentAtPos = this._get(inst, 'showCurrentAtPos'); + var stepMonths = this._get(inst, 'stepMonths'); + var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1); + var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var drawMonth = inst.drawMonth - showCurrentAtPos; + var drawYear = inst.drawYear; + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + var prevText = this._get(inst, 'prevText'); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + '<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click"' + + ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' : + (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>')); + var nextText = this._get(inst, 'nextText'); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + '<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click"' + + ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' : + (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>')); + var currentText = this._get(inst, 'currentText'); + var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">' + + this._get(inst, 'closeText') + '</button>' : ''); + var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') + + (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click"' + + '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : ''; + var firstDay = parseInt(this._get(inst, 'firstDay'),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + var showWeek = this._get(inst, 'showWeek'); + var dayNames = this._get(inst, 'dayNames'); + var dayNamesShort = this._get(inst, 'dayNamesShort'); + var dayNamesMin = this._get(inst, 'dayNamesMin'); + var monthNames = this._get(inst, 'monthNames'); + var monthNamesShort = this._get(inst, 'monthNamesShort'); + var beforeShowDay = this._get(inst, 'beforeShowDay'); + var showOtherMonths = this._get(inst, 'showOtherMonths'); + var selectOtherMonths = this._get(inst, 'selectOtherMonths'); + var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week; + var defaultDate = this._getDefaultDate(inst); + var html = ''; + for (var row = 0; row < numMonths[0]; row++) { + var group = ''; + this.maxRows = 4; + for (var col = 0; col < numMonths[1]; col++) { + var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + var cornerClass = ' ui-corner-all'; + var calender = ''; + if (isMultiMonth) { + calender += '<div class="ui-datepicker-group'; + if (numMonths[1] > 1) + switch (col) { + case 0: calender += ' ui-datepicker-group-first'; + cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break; + case numMonths[1]-1: calender += ' ui-datepicker-group-last'; + cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break; + default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break; + } + calender += '">'; + } + calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' + + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + '</div><table class="ui-datepicker-calendar"><thead>' + + '<tr>'; + var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : ''); + for (var dow = 0; dow < 7; dow++) { // days of the week + var day = (dow + firstDay) % 7; + thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' + + '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>'; + } + calender += thead + '</tr></thead><tbody>'; + var daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth) + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate + var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) + this.maxRows = numRows; + var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += '<tr>'; + var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' + + this._get(inst, 'calculateWeek')(printDate) + '</td>'); + for (var dow = 0; dow < 7; dow++) { // create date picker days + var daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']); + var otherMonth = (printDate.getMonth() != drawMonth); + var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += '<td class="' + + ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends + (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months + ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key + (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ? + // or defaultDate is current printedDate and defaultDate is selectedDate + ' ' + this._dayOverClass : '') + // highlight selected day + (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days + (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates + (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day + (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different) + ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title + (unselectable ? '' : ' data-handler="selectDay" data-event="click" data-month="' + printDate.getMonth() + '" data-year="' + printDate.getFullYear() + '"') + '>' + // actions + (otherMonth && !showOtherMonths ? ' ' : // display for other months + (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' + + (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') + + (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day + (otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months + '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + '</tr>'; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += '</tbody></table>' + (isMultiMonth ? '</div>' + + ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : ''); + group += calender; + } + html += group; + } + html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? + '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : ''); + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + var changeMonth = this._get(inst, 'changeMonth'); + var changeYear = this._get(inst, 'changeYear'); + var showMonthAfterYear = this._get(inst, 'showMonthAfterYear'); + var html = '<div class="ui-datepicker-title">'; + var monthHtml = ''; + // month selection + if (secondary || !changeMonth) + monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>'; + else { + var inMinYear = (minDate && minDate.getFullYear() == drawYear); + var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear); + monthHtml += '<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">'; + for (var month = 0; month < 12; month++) { + if ((!inMinYear || month >= minDate.getMonth()) && + (!inMaxYear || month <= maxDate.getMonth())) + monthHtml += '<option value="' + month + '"' + + (month == drawMonth ? ' selected="selected"' : '') + + '>' + monthNamesShort[month] + '</option>'; + } + monthHtml += '</select>'; + } + if (!showMonthAfterYear) + html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : ''); + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ''; + if (secondary || !changeYear) + html += '<span class="ui-datepicker-year">' + drawYear + '</span>'; + else { + // determine range of years to display + var years = this._get(inst, 'yearRange').split(':'); + var thisYear = new Date().getFullYear(); + var determineYear = function(value) { + var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + var year = determineYear(years[0]); + var endYear = Math.max(year, determineYear(years[1] || '')); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += '<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">'; + for (; year <= endYear; year++) { + inst.yearshtml += '<option value="' + year + '"' + + (year == drawYear ? ' selected="selected"' : '') + + '>' + year + '</option>'; + } + inst.yearshtml += '</select>'; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + html += this._get(inst, 'yearSuffix'); + if (showMonthAfterYear) + html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml; + html += '</div>'; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period == 'Y' ? offset : 0); + var month = inst.drawMonth + (period == 'M' ? offset : 0); + var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + + (period == 'D' ? offset : 0); + var date = this._restrictMinMax(inst, + this._daylightSavingAdjust(new Date(year, month, day))); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period == 'M' || period == 'Y') + this._notifyChange(inst); + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + var newDate = (minDate && date < minDate ? minDate : date); + newDate = (maxDate && newDate > maxDate ? maxDate : newDate); + return newDate; + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, 'onChangeMonthYear'); + if (onChange) + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, 'numberOfMonths'); + return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + 'Date'), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(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(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst); + var date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + if (offset < 0) + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var minDate = this._getMinMaxDate(inst, 'min'); + var maxDate = this._getMinMaxDate(inst, 'max'); + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime())); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, 'shortYearCutoff'); + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'), + monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day == 'object' ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function bindHover(dpDiv) { + var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; + return dpDiv.bind('mouseout', function(event) { + var elem = $( event.target ).closest( selector ); + if ( !elem.length ) { + return; + } + elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" ); + }) + .bind('mouseover', function(event) { + var elem = $( event.target ).closest( selector ); + if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) || + !elem.length ) { + return; + } + elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + elem.addClass('ui-state-hover'); + if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover'); + if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover'); + }); +} + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) + if (props[name] == null || props[name] == undefined) + target[name] = props[name]; + return target; +}; + +/* Determine whether an object is an array. */ +function isArray(a) { + return (a && (($.browser.safari && typeof a == 'object' && a.length) || + (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); +}; + +/* 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){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick). + find('body').append($.datepicker.dpDiv); + $.datepicker.initialized = true; + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget')) + return $.datepicker['_' + options + 'Datepicker']. + apply($.datepicker, [this[0]].concat(otherArgs)); + if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string') + 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 +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.8.24"; + +// Workaround for #4055 +// Add another global to avoid noConflict issues with inline event handlers +window['DP_jQuery_' + dpuuid] = $; + +})(jQuery); +/*! + * jQuery UI Progressbar 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function( $, undefined ) { + +$.widget( "ui.progressbar", { + options: { + value: 0, + max: 100 + }, + + min: 0, + + _create: function() { + this.element + .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .attr({ + role: "progressbar", + "aria-valuemin": this.min, + "aria-valuemax": this.options.max, + "aria-valuenow": this._value() + }); + + this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" ) + .appendTo( this.element ); + + this.oldValue = this._value(); + this._refreshValue(); + }, + + destroy: function() { + this.element + .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) + .removeAttr( "role" ) + .removeAttr( "aria-valuemin" ) + .removeAttr( "aria-valuemax" ) + .removeAttr( "aria-valuenow" ); + + this.valueDiv.remove(); + + $.Widget.prototype.destroy.apply( this, arguments ); + }, + + value: function( newValue ) { + if ( newValue === undefined ) { + return this._value(); + } + + this._setOption( "value", newValue ); + return this; + }, + + _setOption: function( key, value ) { + if ( key === "value" ) { + this.options.value = value; + this._refreshValue(); + if ( this._value() === this.options.max ) { + this._trigger( "complete" ); + } + } + + $.Widget.prototype._setOption.apply( this, arguments ); + }, + + _value: function() { + var val = this.options.value; + // normalize invalid value + if ( typeof val !== "number" ) { + val = 0; + } + return Math.min( this.options.max, Math.max( this.min, val ) ); + }, + + _percentage: function() { + return 100 * this._value() / this.options.max; + }, + + _refreshValue: function() { + var value = this.value(); + var percentage = this._percentage(); + + if ( this.oldValue !== value ) { + this.oldValue = value; + this._trigger( "change" ); + } + + this.valueDiv + .toggle( value > this.min ) + .toggleClass( "ui-corner-right", value === this.options.max ) + .width( percentage.toFixed(0) + "%" ); + this.element.attr( "aria-valuenow", value ); + } +}); + +$.extend( $.ui.progressbar, { + version: "1.8.24" +}); + +})( jQuery ); +/*! + * jQuery UI Effects 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */ +;jQuery.effects || (function($, undefined) { + +$.effects = {}; + + + +/******************************************************************************/ +/****************************** COLOR ANIMATIONS ******************************/ +/******************************************************************************/ + +// override the animation for color styles +$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', + 'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'], +function(i, attr) { + $.fx.step[attr] = function(fx) { + if (!fx.colorInit) { + fx.start = getColor(fx.elem, attr); + fx.end = getRGB(fx.end); + fx.colorInit = true; + } + + fx.elem.style[attr] = 'rgb(' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' + + Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')'; + }; +}); + +// Color Conversion functions from highlightFade +// By Blair Mitchelmore +// http://jquery.offput.ca/highlightFade/ + +// Parse strings looking for color tuples [255,255,255] +function getRGB(color) { + var result; + + // Check if we're already dealing with an array of colors + if ( color && color.constructor == Array && color.length == 3 ) + return color; + + // Look for rgb(num,num,num) + if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) + return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; + + // Look for rgb(num%,num%,num%) + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) + return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; + + // Look for #a0b1c2 + if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) + return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; + + // Look for #fff + if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) + return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; + + // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 + if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) + return colors['transparent']; + + // Otherwise, we're most likely dealing with a named color + return colors[$.trim(color).toLowerCase()]; +} + +function getColor(elem, attr) { + var color; + + do { + // jQuery <1.4.3 uses curCSS, in 1.4.3 - 1.7.2 curCSS = css, 1.8+ only has css + color = ($.curCSS || $.css)(elem, attr); + + // Keep going until we find an element that has color, or we hit the body + if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") ) + break; + + attr = "backgroundColor"; + } while ( elem = elem.parentNode ); + + return getRGB(color); +}; + +// Some named colors to work with +// From Interface by Stefan Petre +// http://interface.eyecon.ro/ + +var colors = { + aqua:[0,255,255], + azure:[240,255,255], + beige:[245,245,220], + black:[0,0,0], + blue:[0,0,255], + brown:[165,42,42], + cyan:[0,255,255], + darkblue:[0,0,139], + darkcyan:[0,139,139], + darkgrey:[169,169,169], + darkgreen:[0,100,0], + darkkhaki:[189,183,107], + darkmagenta:[139,0,139], + darkolivegreen:[85,107,47], + darkorange:[255,140,0], + darkorchid:[153,50,204], + darkred:[139,0,0], + darksalmon:[233,150,122], + darkviolet:[148,0,211], + fuchsia:[255,0,255], + gold:[255,215,0], + green:[0,128,0], + indigo:[75,0,130], + khaki:[240,230,140], + lightblue:[173,216,230], + lightcyan:[224,255,255], + lightgreen:[144,238,144], + lightgrey:[211,211,211], + lightpink:[255,182,193], + lightyellow:[255,255,224], + lime:[0,255,0], + magenta:[255,0,255], + maroon:[128,0,0], + navy:[0,0,128], + olive:[128,128,0], + orange:[255,165,0], + pink:[255,192,203], + purple:[128,0,128], + violet:[128,0,128], + red:[255,0,0], + silver:[192,192,192], + white:[255,255,255], + yellow:[255,255,0], + transparent: [255,255,255] +}; + + + +/******************************************************************************/ +/****************************** CLASS ANIMATIONS ******************************/ +/******************************************************************************/ + +var classAnimationActions = ['add', 'remove', 'toggle'], + shorthandStyles = { + border: 1, + borderBottom: 1, + borderColor: 1, + borderLeft: 1, + borderRight: 1, + borderTop: 1, + borderWidth: 1, + margin: 1, + padding: 1 + }; + +function getElementStyles() { + var style = document.defaultView + ? document.defaultView.getComputedStyle(this, null) + : this.currentStyle, + newStyle = {}, + key, + camelCase; + + // webkit enumerates style porperties + if (style && style.length && style[0] && style[style[0]]) { + var len = style.length; + while (len--) { + key = style[len]; + if (typeof style[key] == 'string') { + camelCase = key.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + newStyle[camelCase] = style[key]; + } + } + } else { + for (key in style) { + if (typeof style[key] === 'string') { + newStyle[key] = style[key]; + } + } + } + + return newStyle; +} + +function filterStyles(styles) { + var name, value; + for (name in styles) { + value = styles[name]; + if ( + // ignore null and undefined values + value == null || + // ignore functions (when does this occur?) + $.isFunction(value) || + // shorthand styles that need to be expanded + name in shorthandStyles || + // ignore scrollbars (break in IE) + (/scrollbar/).test(name) || + + // only colors or values that can be converted to numbers + (!(/color/i).test(name) && isNaN(parseFloat(value))) + ) { + delete styles[name]; + } + } + + return styles; +} + +function styleDifference(oldStyle, newStyle) { + var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459 + name; + + for (name in newStyle) { + if (oldStyle[name] != newStyle[name]) { + diff[name] = newStyle[name]; + } + } + + return diff; +} + +$.effects.animateClass = function(value, duration, easing, callback) { + if ($.isFunction(easing)) { + callback = easing; + easing = null; + } + + return this.queue(function() { + var that = $(this), + originalStyleAttr = that.attr('style') || ' ', + originalStyle = filterStyles(getElementStyles.call(this)), + newStyle, + className = that.attr('class') || ""; + + $.each(classAnimationActions, function(i, action) { + if (value[action]) { + that[action + 'Class'](value[action]); + } + }); + newStyle = filterStyles(getElementStyles.call(this)); + that.attr('class', className); + + that.animate(styleDifference(originalStyle, newStyle), { + queue: false, + duration: duration, + easing: easing, + complete: function() { + $.each(classAnimationActions, function(i, action) { + if (value[action]) { that[action + 'Class'](value[action]); } + }); + // work around bug in IE by clearing the cssText before setting it + if (typeof that.attr('style') == 'object') { + that.attr('style').cssText = ''; + that.attr('style').cssText = originalStyleAttr; + } else { + that.attr('style', originalStyleAttr); + } + if (callback) { callback.apply(this, arguments); } + $.dequeue( this ); + } + }); + }); +}; + +$.fn.extend({ + _addClass: $.fn.addClass, + addClass: function(classNames, speed, easing, callback) { + return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames); + }, + + _removeClass: $.fn.removeClass, + removeClass: function(classNames,speed,easing,callback) { + return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames); + }, + + _toggleClass: $.fn.toggleClass, + toggleClass: function(classNames, force, speed, easing, callback) { + if ( typeof force == "boolean" || force === undefined ) { + if ( !speed ) { + // without speed parameter; + return this._toggleClass(classNames, force); + } else { + return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]); + } + } else { + // without switch parameter; + return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]); + } + }, + + switchClass: function(remove,add,speed,easing,callback) { + return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]); + } +}); + + + +/******************************************************************************/ +/*********************************** EFFECTS **********************************/ +/******************************************************************************/ + +$.extend($.effects, { + version: "1.8.24", + + // Saves a set of properties in a data storage + save: function(element, set) { + for(var i=0; i < set.length; i++) { + if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]); + } + }, + + // Restores a set of previously saved properties from a data storage + restore: function(element, set) { + for(var i=0; i < set.length; i++) { + if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i])); + } + }, + + setMode: function(el, mode) { + if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle + return mode; + }, + + getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value + // this should be a little more flexible in the future to handle a string & hash + var y, x; + switch (origin[0]) { + case 'top': y = 0; break; + case 'middle': y = 0.5; break; + case 'bottom': y = 1; break; + default: y = origin[0] / original.height; + }; + switch (origin[1]) { + case 'left': x = 0; break; + case 'center': x = 0.5; break; + case 'right': x = 1; break; + default: x = origin[1] / original.width; + }; + return {x: x, y: y}; + }, + + // Wraps the element around a wrapper that copies position properties + createWrapper: function(element) { + + // if the element is already wrapped, return it + if (element.parent().is('.ui-effects-wrapper')) { + return element.parent(); + } + + // wrap the element + var props = { + width: element.outerWidth(true), + height: element.outerHeight(true), + 'float': element.css('float') + }, + wrapper = $('<div></div>') + .addClass('ui-effects-wrapper') + .css({ + fontSize: '100%', + background: 'transparent', + border: 'none', + margin: 0, + padding: 0 + }), + active = document.activeElement; + + // support: Firefox + // Firefox incorrectly exposes anonymous content + // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 + try { + active.id; + } catch( e ) { + active = document.body; + } + + element.wrap( wrapper ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + + wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element + + // transfer positioning properties to the wrapper + if (element.css('position') == 'static') { + wrapper.css({ position: 'relative' }); + element.css({ position: 'relative' }); + } else { + $.extend(props, { + position: element.css('position'), + zIndex: element.css('z-index') + }); + $.each(['top', 'left', 'bottom', 'right'], function(i, pos) { + props[pos] = element.css(pos); + if (isNaN(parseInt(props[pos], 10))) { + props[pos] = 'auto'; + } + }); + element.css({position: 'relative', top: 0, left: 0, right: 'auto', bottom: 'auto' }); + } + + return wrapper.css(props).show(); + }, + + removeWrapper: function(element) { + var parent, + active = document.activeElement; + + if (element.parent().is('.ui-effects-wrapper')) { + parent = element.parent().replaceWith(element); + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + return parent; + } + + return element; + }, + + setTransition: function(element, list, factor, value) { + value = value || {}; + $.each(list, function(i, x){ + var unit = element.cssUnit(x); + if (unit[0] > 0) value[x] = unit[0] * factor + unit[1]; + }); + return value; + } +}); + + +function _normalizeArguments(effect, options, speed, callback) { + // shift params for method overloading + if (typeof effect == 'object') { + callback = options; + speed = null; + options = effect; + effect = options.effect; + } + if ($.isFunction(options)) { + callback = options; + speed = null; + options = {}; + } + if (typeof options == 'number' || $.fx.speeds[options]) { + callback = speed; + speed = options; + options = {}; + } + if ($.isFunction(speed)) { + callback = speed; + speed = null; + } + + options = options || {}; + + speed = speed || options.duration; + speed = $.fx.off ? 0 : typeof speed == 'number' + ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default; + + callback = callback || options.complete; + + return [effect, options, speed, callback]; +} + +function standardSpeed( speed ) { + // valid standard speeds + if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { + return true; + } + + // invalid strings - treat as "normal" speed + if ( typeof speed === "string" && !$.effects[ speed ] ) { + return true; + } + + return false; +} + +$.fn.extend({ + effect: function(effect, options, speed, callback) { + var args = _normalizeArguments.apply(this, arguments), + // TODO: make effects take actual parameters instead of a hash + args2 = { + options: args[1], + duration: args[2], + callback: args[3] + }, + mode = args2.options.mode, + effectMethod = $.effects[effect]; + + if ( $.fx.off || !effectMethod ) { + // delegate to the original method (e.g., .show()) if possible + if ( mode ) { + return this[ mode ]( args2.duration, args2.callback ); + } else { + return this.each(function() { + if ( args2.callback ) { + args2.callback.call( this ); + } + }); + } + } + + return effectMethod.call(this, args2); + }, + + _show: $.fn.show, + show: function(speed) { + if ( standardSpeed( speed ) ) { + return this._show.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'show'; + return this.effect.apply(this, args); + } + }, + + _hide: $.fn.hide, + hide: function(speed) { + if ( standardSpeed( speed ) ) { + return this._hide.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'hide'; + return this.effect.apply(this, args); + } + }, + + // jQuery core overloads toggle and creates _toggle + __toggle: $.fn.toggle, + toggle: function(speed) { + if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { + return this.__toggle.apply(this, arguments); + } else { + var args = _normalizeArguments.apply(this, arguments); + args[1].mode = 'toggle'; + return this.effect.apply(this, args); + } + }, + + // helper functions + cssUnit: function(key) { + var style = this.css(key), val = []; + $.each( ['em','px','%','pt'], function(i, unit){ + if(style.indexOf(unit) > 0) + val = [parseFloat(style), unit]; + }); + return val; + } +}); + + + +/******************************************************************************/ +/*********************************** EASING ***********************************/ +/******************************************************************************/ + +// based on easing equations from Robert Penner (http://www.robertpenner.com/easing) + +var baseEasings = {}; + +$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { + baseEasings[ name ] = function( p ) { + return Math.pow( p, i + 2 ); + }; +}); + +$.extend( baseEasings, { + Sine: function ( p ) { + return 1 - Math.cos( p * Math.PI / 2 ); + }, + Circ: function ( p ) { + return 1 - Math.sqrt( 1 - p * p ); + }, + Elastic: function( p ) { + return p === 0 || p === 1 ? p : + -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 ); + }, + Back: function( p ) { + return p * p * ( 3 * p - 2 ); + }, + Bounce: function ( p ) { + var pow2, + bounce = 4; + + while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} + return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); + } +}); + +$.each( baseEasings, function( name, easeIn ) { + $.easing[ "easeIn" + name ] = easeIn; + $.easing[ "easeOut" + name ] = function( p ) { + return 1 - easeIn( 1 - p ); + }; + $.easing[ "easeInOut" + name ] = function( p ) { + return p < .5 ? + easeIn( p * 2 ) / 2 : + easeIn( p * -2 + 2 ) / -2 + 1; + }; +}); + +})(jQuery); +/*! + * jQuery UI Effects Blind 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Blind + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.blind = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // 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 + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var ref = (direction == 'vertical') ? 'height' : 'width'; + var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width(); + if(mode == 'show') wrapper.css(ref, 0); // Shift + + // Animation + var animation = {}; + animation[ref] = mode == 'show' ? distance : 0; + + // Animate + wrapper.animate(animation, o.duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Bounce 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Bounce + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.bounce = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var direction = o.options.direction || 'up'; // Default direction + var distance = o.options.distance || 20; // Default distance + var times = o.options.times || 5; // Default # of times + var speed = o.duration || 250; // Default speed per bounce + if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE + + // 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(true) / 3 : el.outerWidth(true) / 3); + if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift + if (mode == 'hide') distance = distance / (times * 2); + if (mode != 'hide') times--; + + // Animate + if (mode == 'show') { // Show Bounce + var animation = {opacity: 1}; + animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation, speed / 2, o.options.easing); + distance = distance / 2; + times--; + }; + for (var i = 0; i < times; i++) { // Bounces + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing); + distance = (mode == 'hide') ? distance * 2 : distance / 2; + }; + if (mode == 'hide') { // Last Bounce + var animation = {opacity: 0}; + animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + el.animate(animation, speed / 2, o.options.easing, function(){ + el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + }); + } else { + var animation1 = {}, animation2 = {}; + animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance; + animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance; + el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){ + $.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); +/*! + * jQuery UI Effects Clip 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Clip + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.clip = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','height','width']; + + // 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 + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var animate = el[0].tagName == 'IMG' ? wrapper : el; + var ref = { + size: (direction == 'vertical') ? 'height' : 'width', + position: (direction == 'vertical') ? 'top' : 'left' + }; + var distance = (direction == 'vertical') ? animate.height() : animate.width(); + if(mode == 'show') { animate.css(ref.size, 0); animate.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 + animate.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(el[0], arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Drop 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Drop + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.drop = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','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( true ) / 2 : el.outerWidth( 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); +/*! + * jQuery UI Effects Explode 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Explode + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.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"),10) || 0; + offset.left -= parseInt(el.css("marginLeft"),10) || 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('ui-effects-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(); + + $('div.ui-effects-explode').remove(); + + }, o.duration || 500); + + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Fade 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.fade = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'hide'); + + elem.animate({ opacity: mode }, { + queue: false, + duration: o.duration, + easing: o.options.easing, + complete: function() { + (o.callback && o.callback.apply(this, arguments)); + elem.dequeue(); + } + }); + }); +}; + +})(jQuery); +/*! + * jQuery UI Effects Fold 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.fold = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode + var size = o.options.size || 15; // Default fold size + var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value + var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2; + + // Adjust + $.effects.save(el, props); el.show(); // Save & Show + var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper + var widthFirst = ((mode == 'show') != horizFirst); + var ref = widthFirst ? ['width', 'height'] : ['height', 'width']; + var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()]; + var percent = /([0-9]+)%/.exec(size); + if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1]; + if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift + + // Animation + var animation1 = {}, animation2 = {}; + animation1[ref[0]] = mode == 'show' ? distance[0] : size; + animation2[ref[1]] = mode == 'show' ? distance[1] : 0; + + // Animate + wrapper.animate(animation1, duration, o.options.easing) + .animate(animation2, duration, o.options.easing, function() { + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(el[0], arguments); // Callback + el.dequeue(); + }); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Highlight 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.highlight = function(o) { + return this.queue(function() { + var elem = $(this), + props = ['backgroundImage', 'backgroundColor', 'opacity'], + mode = $.effects.setMode(elem, o.options.mode || 'show'), + animation = { + backgroundColor: elem.css('backgroundColor') + }; + + if (mode == 'hide') { + animation.opacity = 0; + } + + $.effects.save(elem, props); + elem + .show() + .css({ + backgroundImage: 'none', + backgroundColor: o.options.color || '#ffff99' + }) + .animate(animation, { + queue: false, + duration: o.duration, + easing: o.options.easing, + complete: function() { + (mode == 'hide' && elem.hide()); + $.effects.restore(elem, props); + (mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter')); + (o.callback && o.callback.apply(this, arguments)); + elem.dequeue(); + } + }); + }); +}; + +})(jQuery); +/*! + * jQuery UI Effects Pulsate 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.pulsate = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'show'), + times = ((o.options.times || 5) * 2) - 1, + duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2, + isVisible = elem.is(':visible'), + animateTo = 0; + + if (!isVisible) { + elem.css('opacity', 0).show(); + animateTo = 1; + } + + if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) { + times--; + } + + for (var i = 0; i < times; i++) { + elem.animate({ opacity: animateTo }, duration, o.options.easing); + animateTo = (animateTo + 1) % 2; + } + + elem.animate({ opacity: animateTo }, duration, o.options.easing, function() { + if (animateTo == 0) { + elem.hide(); + } + (o.callback && o.callback.apply(this, arguments)); + }); + + elem + .queue('fx', function() { elem.dequeue(); }) + .dequeue(); + }); +}; + +})(jQuery); +/*! + * jQuery UI Effects Scale 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Scale + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.puff = function(o) { + return this.queue(function() { + var elem = $(this), + mode = $.effects.setMode(elem, o.options.mode || 'hide'), + percent = parseInt(o.options.percent, 10) || 150, + factor = percent / 100, + original = { height: elem.height(), width: elem.width() }; + + $.extend(o.options, { + fade: true, + mode: mode, + percent: mode == 'hide' ? percent : 100, + from: mode == 'hide' + ? original + : { + height: original.height * factor, + width: original.width * factor + } + }); + + elem.effect('scale', o.options, o.duration, o.callback); + elem.dequeue(); + }); +}; + +$.effects.scale = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this); + + // Set options + var options = $.extend(true, {}, o.options); + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent + var direction = o.options.direction || 'both'; // Set default axis + var origin = o.options.origin; // The origin of the scaling + if (mode != 'effect') { // Set default origin and restore for show/hide + options.origin = origin || ['middle','center']; + options.restore = true; + } + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state + + // Adjust + var factor = { // Set scaling factor + y: direction != 'horizontal' ? (percent / 100) : 1, + x: direction != 'vertical' ? (percent / 100) : 1 + }; + el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state + + if (o.options.fade) { // Fade option to support puff + if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;}; + if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;}; + }; + + // Animation + options.from = el.from; options.to = el.to; options.mode = mode; + + // Animate + el.effect('size', options, o.duration, o.callback); + el.dequeue(); + }); + +}; + +$.effects.size = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right','width','height','overflow','opacity']; + var props1 = ['position','top','bottom','left','right','overflow','opacity']; // Always restore + var props2 = ['width','height','overflow']; // Copy for children + var cProps = ['fontSize']; + var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom']; + var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight']; + + // Set options + var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode + var restore = o.options.restore || false; // Default restore + var scale = o.options.scale || 'both'; // Default scale mode + var origin = o.options.origin; // The origin of the sizing + var original = {height: el.height(), width: el.width()}; // Save original + el.from = o.options.from || original; // Default from state + el.to = o.options.to || original; // Default to state + // Adjust + if (origin) { // Calculate baseline shifts + var baseline = $.effects.getBaseline(origin, original); + el.from.top = (original.height - el.from.height) * baseline.y; + el.from.left = (original.width - el.from.width) * baseline.x; + el.to.top = (original.height - el.to.height) * baseline.y; + el.to.left = (original.width - el.to.width) * baseline.x; + }; + var factor = { // Set scaling factor + from: {y: el.from.height / original.height, x: el.from.width / original.width}, + to: {y: el.to.height / original.height, x: el.to.width / original.width} + }; + if (scale == 'box' || scale == 'both') { // Scale the css box + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(vProps); + el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + props = props.concat(hProps); + el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from); + el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to); + }; + }; + if (scale == 'content' || scale == 'both') { // Scale the content + if (factor.from.y != factor.to.y) { // Vertical props scaling + props = props.concat(cProps); + el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from); + el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to); + }; + }; + $.effects.save(el, restore ? props : props1); el.show(); // Save & Show + $.effects.createWrapper(el); // Create Wrapper + el.css('overflow','hidden').css(el.from); // Shift + + // Animate + if (scale == 'content' || scale == 'both') { // Scale the children + vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size + hProps = hProps.concat(['marginLeft','marginRight']); // Add margins + props2 = props.concat(vProps).concat(hProps); // Concat + el.find("*[width]").each(function(){ + var child = $(this); + if (restore) $.effects.save(child, props2); + var c_original = {height: child.height(), width: child.width()}; // Save original + child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x}; + child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x}; + if (factor.from.y != factor.to.y) { // Vertical props scaling + child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from); + child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to); + }; + if (factor.from.x != factor.to.x) { // Horizontal props scaling + child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from); + child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to); + }; + child.css(child.from); // Shift children + child.animate(child.to, o.duration, o.options.easing, function(){ + if (restore) $.effects.restore(child, props2); // Restore children + }); // Animate children + }); + }; + + // Animate + el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() { + if (el.to.opacity === 0) { + el.css('opacity', el.from.opacity); + } + if(mode == 'hide') el.hide(); // Hide + $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore + if(o.callback) o.callback.apply(this, arguments); // Callback + el.dequeue(); + }}); + + }); + +}; + +})(jQuery); +/*! + * jQuery UI Effects Shake 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Shake + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.shake = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // 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); +/*! + * jQuery UI Effects Slide 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Slide + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.slide = function(o) { + + return this.queue(function() { + + // Create element + var el = $(this), props = ['position','top','bottom','left','right']; + + // 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( true ) : el.outerWidth( true )); + if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -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); +/*! + * jQuery UI Effects Transfer 1.8.24 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Transfer + * + * Depends: + * jquery.effects.core.js + */ +(function( $, undefined ) { + +$.effects.transfer = function(o) { + return this.queue(function() { + var elem = $(this), + target = $(o.options.to), + endPosition = target.offset(), + animation = { + top: endPosition.top, + left: endPosition.left, + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = elem.offset(), + transfer = $('<div class="ui-effects-transfer"></div>') + .appendTo(document.body) + .addClass(o.options.className) + .css({ + top: startPosition.top, + left: startPosition.left, + height: elem.innerHeight(), + width: elem.innerWidth(), + position: 'absolute' + }) + .animate(animation, o.duration, o.options.easing, function() { + transfer.remove(); + (o.callback && o.callback.apply(elem[0], arguments)); + elem.dequeue(); + }); + }); +}; + +})(jQuery); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery-ui.custom.min.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery-ui.custom.min.js new file mode 100644 index 0000000000000000000000000000000000000000..793184eeda6093c5d98dc677dfab692d87b389e6 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery-ui.custom.min.js @@ -0,0 +1,125 @@ +/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.core.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.24",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.curCSS||(a.curCSS=a.css),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.widget.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.mouse.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.position.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.draggable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.24"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!e.length)return;var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.droppable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"),this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance))return e=!0,!1}),e?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.24"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h<d.length;h++){if(d[h].options.disabled||b&&!d[h].accept.call(d[h].element[0],b.currentItem||b.element))continue;for(var i=0;i<f.length;i++)if(f[i]==d[h].element[0]){d[h].proportions.height=0;continue g}d[h].visible=d[h].element.css("display")!="none";if(!d[h].visible)continue;e=="mousedown"&&d[h]._activate.call(d[h],c),d[h].offset=d[h].element.offset(),d[h].proportions={width:d[h].element[0].offsetWidth,height:d[h].element[0].offsetHeight}}},drop:function(b,c){var d=!1;return a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c))}),d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.options.scope,h=this.element.parents(":data(droppable)").filter(function(){return a.data(this,"droppable").options.scope===g});h.length&&(f=a.data(h[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.resizable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{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"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');h.css({zIndex:c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide"),b._handles.show()},function(){if(c.disabled)return;b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");return a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);return l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;return d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width)),a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;return p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),a},_proportionallyResize:function(){var b=this.options;if(!this._proportionallyResizeElements.length)return;var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(!a.browser.msie||!a(c).is(":hidden")&&!a(c).parents(":hidden").length)e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0});else continue}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.24"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/d.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*d.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.selectable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");return d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element}),!1}})},_mouseDrag:function(b){var c=this;this.dragged=!0;if(this.options.disabled)return;var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}return this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}),!1},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;return a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove(),!1}}),a.extend(a.ui.selectable,{version:"1.8.24"})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.sortable.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(f.instance!==this.currentContainer)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=this.options.axis==="x"||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=this.options.axis==="y"||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!1},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i],this.direction=j-h>0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())}),this!==this.currentContainer&&(c||(d.push(function(a){this._trigger("remove",a,this._uiHash())}),d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.currentContainer)),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.currentContainer))));for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.24"})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.accordion.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");return(b.autoHeight||b.fillHeight)&&c.css("height",""),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(this.options.disabled||b.altKey||b.ctrlKey)return;var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}return f?(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),!1):!0},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];return this._clickHandler({target:b},b),this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(d.disabled)return;if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!g)return;return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(this.running)return;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data)}}),a.extend(a.ui.accordion,{version:"1.8.24",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size()){b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);return}if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.autocomplete.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d),a.pending--,a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.button.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);return c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form})),e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){if(h.disabled)return;a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active")}).bind("mouseleave.button",function(){if(h.disabled)return;a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){if(f)return;b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){if(h.disabled)return;f=!1,d=a.pageX,e=a.pageY}).bind("mouseup.button",function(a){if(h.disabled)return;if(d!==a.pageX||e!==a.pageY)f=!0})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled"){c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1);return}this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var b=this.buttonElement.removeClass(i),c=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.dialog.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){return b.close(a),!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;return a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle),a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1===c._trigger("beforeClose",b))return;return c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d),c},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;return e.modal&&!b||!e.stack&&!e.modal?d._trigger("focus",c):(e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c),d)},open:function(){if(this._isOpen)return;var b=this,c=b.options,d=b.uiDialog;return b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode!==a.ui.keyCode.TAB)return;var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey)return d.focus(1),!1;if(b.target===d[0]&&b.shiftKey)return e.focus(1),!1}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open"),b},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),f=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(f);a.each(d,function(a,b){if(a==="click")return;a in e?e[a](b):e.attr(a,b)}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.24",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");return b||(this.uuid+=1,b=this.uuid),"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return a.fn.bgiframe&&c.bgiframe(),this.instances.push(c),c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;return a.browser.msie&&a.browser.version<7?(b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),b<c?a(window).height()+"px":b+"px"):a(document).height()+"px"},width:function(){var b,c;return a.browser.msie?(b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),b<c?a(window).width()+"px":b+"px"):a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.slider.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=a(this).data("index.ui-slider-handle"),f,g,h,i;if(b.options.disabled)return;switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:d.preventDefault();if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),f=b._start(d,e);if(f===!1)return}}i=b.options.step,b.options.values&&b.options.values.length?g=h=b.values(e):g=h=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===b._valueMax())return;h=b._trimAlignValue(g+i);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-i)}b._slide(d,e,h)}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);return}if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a),a},_values:function(a){var b,c,d;if(arguments.length)return b=this.options.values[a],b=this._trimAlignValue(b),b;c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return Math.abs(c)*2>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.24"})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.tabs.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){function e(){return++c}function f(){return++d}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},destroy:function(){var b=this.options;return this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;return this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))),this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;return this.anchors.eq(a).trigger(this.options.event+".tabs"),this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}return this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.24"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){e()}:function(a){a.clientX&&c.rotate(null)});return a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate),this}})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.datepicker.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length)return;c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length)return;d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.24"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var 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(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);return c&&!c.inline&&this._setDateFromField(c,b),c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(d){$.datepicker.log(d)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a)),this._attachHandlers(a);var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+(c?0:$(document).scrollLeft()),i=document.documentElement.clientHeight+(c?0:$(document).scrollTop());return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b)};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1;var f=this._get(b,"onClose");f&&f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0]))return;this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0]))return;var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;return c&&s++,c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;return r+=f[0].length,parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase())return f=c[0],r+=d.length,!1});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;return c&&m++,c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;return c&&e++,c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()==a.lastVal)return;var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;return b.setDate(b.getDate()+a),b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());return f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0)),this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_attachHandlers:function(a){var b=this._get(a,"stepMonths"),c="#"+a.id.replace(/\\\\/g,"\\");a.dpDiv.find("[data-handler]").map(function(){var a={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(c,-b,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(c,+b,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(c)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(c,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(c,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(c,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),a[this.getAttribute("data-handler")])})},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' data-handler="selectDay" data-event="click" data-month="'+Y.getMonth()+'" data-year="'+Y.getFullYear()+'"')+">"+(bb&&!G?" ":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="</div>",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;return e=d&&e>d?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.24",window["DP_jQuery_"+dpuuid]=$})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.progressbar.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){return a===b?this._value():(this._setOption("value",a),this)},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.24"})})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.core.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array&&b.length==3?b:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]:(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:(c=/rgba\(0, 0, 0, 0\)/.exec(b))?e.transparent:e[a.trim(b).toLowerCase()]}function d(b,d){var e;do{e=(a.curCSS||a.css)(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};return a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete,[b,c,d,e]}function l(b){return!b||typeof b=="number"||a.fx.speeds[b]?!0:typeof b=="string"&&!a.effects[b]?!0:!1}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){return a.isFunction(d)&&(e=d,d=null),this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class")||"";a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.24",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){return b=="toggle"&&(b=a.is(":hidden")?"show":"hide"),b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;try{e.id}catch(f){e=document.body}return b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;return b.parent().is(".ui-effects-wrapper")?(c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus(),c):b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];return a.fx.off||!i?h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="show",this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="hide",this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);return c[1].mode="toggle",this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}});var m={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,b){m[b]=function(b){return Math.pow(b,a+2)}}),a.extend(m,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return a===0||a===1?a:-Math.pow(2,8*(a-1))*Math.sin(((a-1)*80-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){var b,c=4;while(a<((b=Math.pow(2,--c))-1)/11);return 1/Math.pow(4,3-c)-7.5625*Math.pow((b*3-2)/22-a,2)}}),a.each(m,function(b,c){a.easing["easeIn"+b]=c,a.easing["easeOut"+b]=function(a){return 1-c(1-a)},a.easing["easeInOut"+b]=function(a){return a<.5?c(a*2)/2:c(a*-2+2)/-2+1}})}(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.blind.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.bounce.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight(!0)/3:c.outerWidth(!0)/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.clip.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.drop.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight(!0)/2:c.outerWidth(!0)/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.explode.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.fade.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.fold.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.highlight.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.pulsate.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show"),e=(b.options.times||5)*2-1,f=b.duration?b.duration/2:a.fx.speeds._default/2,g=c.is(":visible"),h=0;g||(c.css("opacity",0).show(),h=1),(d=="hide"&&g||d=="show"&&!g)&&e--;for(var i=0;i<e;i++)c.animate({opacity:h},f,b.options.easing),h=(h+1)%2;c.animate({opacity:h},f,b.options.easing,function(){h==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.scale.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){var c=a(this);k&&a.effects.save(c,f);var d={height:c.height(),width:c.width()};c.from={height:d.height*q.from.y,width:d.width*q.from.x},c.to={height:d.height*q.to.y,width:d.width*q.to.x},q.from.y!=q.to.y&&(c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to)),c.css(c.from),c.animate(c.to,b.duration,b.options.easing,function(){k&&a.effects.restore(c,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.shake.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.slide.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight(!0):c.outerWidth(!0));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.24 - 2012-09-28 +* https://github.com/jquery/jquery-ui +* Includes: jquery.effects.transfer.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.cookie.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.cookie.js new file mode 100644 index 0000000000000000000000000000000000000000..a03edb8c32fca6568431937dd50ceb1294dd94c2 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.cookie.js @@ -0,0 +1,94 @@ +/*! + * jQuery Cookie Plugin v1.3.1 + * https://github.com/carhartl/jquery-cookie + * + * Copyright 2013 Klaus Hartl + * Released under the MIT license + */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as anonymous module. + define(['jquery'], factory); + } else { + // Browser globals. + factory(jQuery); + } +}(function ($) { + + var pluses = /\+/g; + + function raw(s) { + return s; + } + + function decoded(s) { + return decodeURIComponent(s.replace(pluses, ' ')); + } + + function converted(s) { + if (s.indexOf('"') === 0) { + // This is a quoted cookie as according to RFC2068, unescape + s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } + try { + return config.json ? JSON.parse(s) : s; + } catch(er) {} + } + + var config = $.cookie = function (key, value, options) { + + // write + if (value !== undefined) { + options = $.extend({}, config.defaults, options); + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setDate(t.getDate() + days); + } + + value = config.json ? JSON.stringify(value) : String(value); + + return (document.cookie = [ + config.raw ? key : encodeURIComponent(key), + '=', + config.raw ? value : encodeURIComponent(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // read + var decode = config.raw ? raw : decoded; + var cookies = document.cookie.split('; '); + var result = key ? undefined : {}; + for (var i = 0, l = cookies.length; i < l; i++) { + var parts = cookies[i].split('='); + var name = decode(parts.shift()); + var cookie = decode(parts.join('=')); + + if (key && key === name) { + result = converted(cookie); + break; + } + + if (!key) { + result[name] = converted(cookie); + } + } + + return result; + }; + + config.defaults = {}; + + $.removeCookie = function (key, options) { + if ($.cookie(key) !== undefined) { + $.cookie(key, '', $.extend(options, { expires: -1 })); + return true; + } + return false; + }; + +})); \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.js new file mode 100644 index 0000000000000000000000000000000000000000..d4f3bb38cdab24303efed50e482aecc949fcdb53 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.js @@ -0,0 +1,9440 @@ +/*! + * jQuery JavaScript Library v1.8.2 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time) + */ +(function( window, undefined ) { +var + // A central reference to the root jQuery(document) + rootjQuery, + + // The deferred used on DOM ready + readyList, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + location = window.location, + navigator = window.navigator, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // Save a reference to some core methods + core_push = Array.prototype.push, + core_slice = Array.prototype.slice, + core_indexOf = Array.prototype.indexOf, + core_toString = Object.prototype.toString, + core_hasOwn = Object.prototype.hasOwnProperty, + core_trim = String.prototype.trim, + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Used for matching numbers + core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, + + // Used for detecting and trimming whitespace + core_rnotwhite = /\S/, + core_rspace = /\s+/, + + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // A simple way to check for HTML strings + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) + rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, + rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return ( letter + "" ).toUpperCase(); + }, + + // The ready event handler and self cleanup method + DOMContentLoaded = function() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + } else if ( document.readyState === "complete" ) { + // we're here because readyState === "complete" in oldIE + // which is good enough for us to call the dom ready! + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = ( context && context.nodeType ? context.ownerDocument || context : document ); + + // scripts is true for back-compat + selector = jQuery.parseHTML( match[1], doc, true ); + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + this.attr.call( selector, context, true ); + } + + return jQuery.merge( this, selector ); + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.8.2", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return core_slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; + }, + + eq: function( i ) { + i = +i; + return i === -1 ? + this.slice( i ) : + this.slice( i, i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( core_slice.apply( this, arguments ), + "slice", core_slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: core_push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ core_toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !core_hasOwn.call(obj, "constructor") && + !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || core_hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + // data: string of html + // context (optional): If specified, the fragment will be created in this context, defaults to document + // scripts (optional): If true, will include scripts passed in the html string + parseHTML: function( data, context, scripts ) { + var parsed; + if ( !data || typeof data !== "string" ) { + return null; + } + if ( typeof context === "boolean" ) { + scripts = context; + context = 0; + } + context = context || document; + + // Single tag + if ( (parsed = rsingleTag.exec( data )) ) { + return [ context.createElement( parsed[1] ) ]; + } + + parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] ); + return jQuery.merge( [], + (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes ); + }, + + parseJSON: function( data ) { + if ( !data || typeof data !== "string") { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { + return null; + } + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && core_rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var name, + i = 0, + length = obj.length, + isObj = length === undefined || jQuery.isFunction( obj ); + + if ( args ) { + if ( isObj ) { + for ( name in obj ) { + if ( callback.apply( obj[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( obj[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in obj ) { + if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) { + break; + } + } + } + } + + return obj; + }, + + // Use native String.trim function wherever possible + trim: core_trim && !core_trim.call("\uFEFF\xA0") ? + function( text ) { + return text == null ? + "" : + core_trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var type, + ret = results || []; + + if ( arr != null ) { + // The window, strings (and functions) also have 'length' + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + type = jQuery.type( arr ); + + if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) { + core_push.call( ret, arr ); + } else { + jQuery.merge( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( core_indexOf ) { + return core_indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var l = second.length, + i = first.length, + j = 0; + + if ( typeof l === "number" ) { + for ( ; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var retVal, + ret = [], + i = 0, + length = elems.length; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, + ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = core_slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context, args.concat( core_slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + // Multifunctional method to get and set values of a collection + // The value/s can optionally be executed if it's a function + access: function( elems, fn, key, value, chainable, emptyGet, pass ) { + var exec, + bulk = key == null, + i = 0, + length = elems.length; + + // Sets many values + if ( key && typeof key === "object" ) { + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); + } + chainable = 1; + + // Sets one value + } else if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = pass === undefined && jQuery.isFunction( value ); + + if ( bulk ) { + // Bulk operations only iterate when executing function values + if ( exec ) { + exec = fn; + fn = function( elem, key, value ) { + return exec.call( jQuery( elem ), value ); + }; + + // Otherwise they run against the entire set + } else { + fn.call( elems, value ); + fn = null; + } + } + + if ( fn ) { + for (; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + } + + chainable = 1; + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; + }, + + now: function() { + return ( new Date() ).getTime(); + } +}); + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready, 1 ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // and execute any waiting functions + jQuery.ready(); + } + })(); + } + } + } + return readyList.promise( obj ); +}; + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.split( core_rspace ), function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); + + var // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) { + list.push( arg ); + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + jQuery.each( arguments, function( _, arg ) { + var index; + while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Control if a given callback is in the list + has: function( fn ) { + return jQuery.inArray( fn, list ) > -1; + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( list && ( !fired || stack ) ) { + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; +jQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var action = tuple[ 0 ], + fn = fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ]( jQuery.isFunction( fn ) ? + function() { + var returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); + } + } : + newDefer[ action ] + ); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] = list.fire + deferred[ tuple[0] ] = list.fire; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = core_slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; + if( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); +jQuery.support = (function() { + + var support, + all, + a, + select, + opt, + input, + fragment, + eventName, + i, + isSupported, + clickFn, + div = document.createElement("div"); + + // Preliminary tests + div.setAttribute( "className", "t" ); + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; + + all = div.getElementsByTagName("*"); + a = div.getElementsByTagName("a")[ 0 ]; + a.style.cssText = "top:1px;float:left;opacity:.5"; + + // Can't get basic test support + if ( !all || !all.length ) { + return {}; + } + + // First batch of supports tests + select = document.createElement("select"); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName("input")[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute("href") === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.5/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Tests for enctype support on a form(#6743) + enctype: !!document.createElement("form").enctype, + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", + + // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode + boxModel: ( document.compatMode === "CSS1Compat" ), + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true, + boxSizingReliable: true, + pixelPosition: false + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", clickFn = function() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + }); + div.cloneNode( true ).fireEvent("onclick"); + div.detachEvent( "onclick", clickFn ); + } + + // Check if a radio maintains its value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute( "type", "radio" ); + support.radioValue = input.value === "t"; + + input.setAttribute( "checked", "checked" ); + + // #11217 - WebKit loses check when the name is after the checked attribute + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.lastChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + fragment.removeChild( input ); + fragment.appendChild( div ); + + // Technique from Juriy Zaytsev + // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for ( i in { + submit: true, + change: true, + focusin: true + }) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + // Run tests that need a body at doc ready + jQuery(function() { + var container, div, tds, marginDiv, + divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;", + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + container = document.createElement("div"); + container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px"; + body.insertBefore( container, body.firstChild ); + + // Construct the test element + div = document.createElement("div"); + container.appendChild( div ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; + tds = div.getElementsByTagName("td"); + tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE <= 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Check box-sizing and margin behavior + div.innerHTML = ""; + div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; + support.boxSizing = ( div.offsetWidth === 4 ); + support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 ); + + // NOTE: To any future maintainer, we've window.getComputedStyle + // because jsdom on node.js will break without it. + if ( window.getComputedStyle ) { + support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; + support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + marginDiv = document.createElement("div"); + marginDiv.style.cssText = div.style.cssText = divReset; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); + } + + if ( typeof div.style.zoom !== "undefined" ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.innerHTML = ""; + div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = "block"; + div.style.overflow = "visible"; + div.innerHTML = "<div></div>"; + div.firstChild.style.width = "5px"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); + + container.style.zoom = 1; + } + + // Null elements to avoid leaks in IE + body.removeChild( container ); + container = div = tds = marginDiv = null; + }); + + // Null elements to avoid leaks in IE + fragment.removeChild( div ); + all = a = select = opt = input = fragment = div = null; + + return support; +})(); +var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, + rmultiDash = /([A-Z])/g; + +jQuery.extend({ + cache: {}, + + deletedIds: [], + + // Remove at next major release (1.9/2.0) + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // Avoids exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, l, + + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split(" "); + } + } + } + + for ( i = 0, l = name.length; i < l; i++ ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + } else if ( jQuery.support.deleteExpando || cache != cache.window ) { + delete cache[ id ]; + + // When all else fails, null + } else { + cache[ id ] = null; + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; + + // nodes accept data unless otherwise specified; rejection can be conditional + return !noData || noData !== true && elem.getAttribute("classid") === noData; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var parts, part, attr, name, l, + elem = this[0], + i = 0, + data = null; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + attr = elem.attributes; + for ( l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( !name.indexOf( "data-" ) ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( elem, name, data[ name ] ); + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + parts = key.split( ".", 2 ); + parts[1] = parts[1] ? "." + parts[1] : ""; + part = parts[1] + "!"; + + return jQuery.access( this, function( value ) { + + if ( value === undefined ) { + data = this.triggerHandler( "getData" + part, [ parts[0] ] ); + + // Try to fetch any internally stored data first + if ( data === undefined && elem ) { + data = jQuery.data( elem, key ); + data = dataAttr( elem, key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } + + parts[1] = value; + this.each(function() { + var self = jQuery( this ); + + self.triggerHandler( "setData" + part, parts ); + jQuery.data( this, key, value ); + self.triggerHandler( "changeData" + part, parts ); + }); + }, null, value, arguments.length > 1, null, false ); + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} +jQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray(data) ) { + queue = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + jQuery.removeData( elem, type + "queue", true ); + jQuery.removeData( elem, key, true ); + }) + }); + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var nodeHook, boolHook, fixSpecified, + rclass = /[\t\r\n]/g, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea|)$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classNames, i, l, elem, + setClass, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call(this, j, this.className) ); + }); + } + + if ( value && typeof value === "string" ) { + classNames = value.split( core_rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className && classNames.length === 1 ) { + elem.className = value; + + } else { + setClass = " " + elem.className + " "; + + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) { + setClass += classNames[ c ] + " "; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var removes, className, elem, c, cl, i, l; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call(this, j, this.className) ); + }); + } + if ( (value && typeof value === "string") || value === undefined ) { + removes = ( value || "" ).split( core_rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + if ( elem.nodeType === 1 && elem.className ) { + + className = (" " + elem.className + " ").replace( rclass, " " ); + + // loop over each item in the removal list + for ( c = 0, cl = removes.length; c < cl; c++ ) { + // Remove until there is nothing to remove, + while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) { + className = className.replace( " " + removes[ c ] + " " , " " ); + } + } + elem.className = value ? jQuery.trim( className ) : ""; + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( core_rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space separated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var val, + self = jQuery(this); + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, i, max, option, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + i = one ? index : 0; + max = one ? index + 1 : options.length; + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9 + attrFn: {}, + + attr: function( elem, name, value, pass ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( notxml ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, value + "" ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var propName, attrNames, name, isBool, + i = 0; + + if ( value && elem.nodeType === 1 ) { + + attrNames = value.split( core_rspace ); + + for ( ; i < attrNames.length; i++ ) { + name = attrNames[ i ]; + + if ( name ) { + propName = jQuery.propFix[ name ] || name; + isBool = rboolean.test( name ); + + // See #9699 for explanation of this approach (setting first, then removal) + // Do not do this for boolean attributes (see #10870) + if ( !isBool ) { + jQuery.attr( elem, name, "" ); + } + elem.removeAttribute( getSetAttribute ? name : propName ); + + // Set corresponding property to false for boolean attributes + if ( isBool && propName in elem ) { + elem[ propName ] = false; + } + } + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + // Use the value property for back compat + // Use the nodeHook for button elements in IE6/7 (#1954) + value: { + get: function( elem, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.get( elem, name ); + } + return name in elem ? + elem.value : + null; + }, + set: function( elem, value, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return ( elem[ name ] = value ); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + // Fall back to attribute presence where some booleans are not supported + var attrNode, + property = jQuery.prop( elem, name ); + return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = true; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + fixSpecified = { + name: true, + id: true, + coords: true + }; + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ? + ret.value : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + ret = document.createAttribute( name ); + elem.setAttributeNode( ret ); + } + return ( ret.value = value + "" ); + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + get: nodeHook.get, + set: function( elem, value, name ) { + if ( value === "" ) { + value = "false"; + } + nodeHook.set( elem, value, name ); + } + }; +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = value + "" ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }); +}); +var rformElems = /^(?:textarea|input|select)$/i, + rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/, + rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + hoverHack = function( events ) { + return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); + }; + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + add: function( elem, types, handler, data, selector ) { + + var elemData, eventHandle, events, + t, tns, type, namespaces, handleObj, + handleObjIn, handlers, special; + + // Don't attach events to noData or text/comment nodes (allow plain objects tho) + if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + events = elemData.events; + if ( !events ) { + elemData.events = events = {}; + } + eventHandle = elemData.handle; + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = jQuery.trim( hoverHack(types) ).split( " " ); + for ( t = 0; t < types.length; t++ ) { + + tns = rtypenamespace.exec( types[t] ) || []; + type = tns[1]; + namespaces = ( tns[2] || "" ).split( "." ).sort(); + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: tns[1], + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + handlers = events[ type ]; + if ( !handlers ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var t, tns, type, origType, namespaces, origCount, + j, events, special, eventType, handleObj, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = jQuery.trim( hoverHack( types || "" ) ).split(" "); + for ( t = 0; t < types.length; t++ ) { + tns = rtypenamespace.exec( types[t] ) || []; + type = origType = tns[1]; + namespaces = tns[2]; + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector? special.delegateType : special.bindType ) || type; + eventType = events[ type ] || []; + origCount = eventType.length; + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null; + + // Remove matching events + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !namespaces || namespaces.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + eventType.splice( j--, 1 ); + + if ( handleObj.selector ) { + eventType.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( eventType.length === 0 && origCount !== eventType.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery.removeData( elem, "events", true ); + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Don't do events on text and comment nodes + if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { + return; + } + + // Event object or event type + var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType, + type = event.type || event, + namespaces = []; + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "!" ) >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf( "." ) >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.isTrigger = true; + event.exclusive = exclusive; + event.namespace = namespaces.join( "." ); + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; + ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; + + // Handle a global trigger + if ( !elem ) { + + // TODO: Stop taunting the data cache; remove global events and always attach to document + cache = jQuery.cache; + for ( i in cache ) { + if ( cache[ i ].events && cache[ i ].events[ type ] ) { + jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); + } + } + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data != null ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + eventPath = [[ elem, special.bindType || type ]]; + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; + for ( old = elem; cur; cur = cur.parentNode ) { + eventPath.push([ cur, bubbleType ]); + old = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( old === (elem.ownerDocument || document) ) { + eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); + } + } + + // Fire handlers on the event path + for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { + + cur = eventPath[i][0]; + event.type = eventPath[i][1]; + + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + // Note that this is a bare JS function and not a jQuery handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + // IE<9 dies on focus/blur to hidden element (#1486) + if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( old ) { + elem[ ontype ] = old; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event || window.event ); + + var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related, + handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), + delegateCount = handlers.delegateCount, + args = core_slice.call( arguments ), + run_all = !event.exclusive && !event.namespace, + special = jQuery.event.special[ event.type ] || {}, + handlerQueue = []; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers that should run if there are delegated events + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && !(event.button && event.type === "click") ) { + + for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { + + // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.disabled !== true || event.type !== "click" ) { + selMatch = {}; + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + sel = handleObj.selector; + + if ( selMatch[ sel ] === undefined ) { + selMatch[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( selMatch[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, matches: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( handlers.length > delegateCount ) { + handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); + } + + // Run delegates first; they may want to stop propagation beneath us + for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { + matched = handlerQueue[ i ]; + event.currentTarget = matched.elem; + + for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { + handleObj = matched.matches[ j ]; + + // Triggered event must either 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { + + event.data = handleObj.data; + event.handleObj = handleObj; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** + props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, + originalEvent = event, + fixHook = jQuery.event.fixHooks[ event.type ] || {}, + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = jQuery.Event( originalEvent ); + + for ( i = copy.length; i; ) { + prop = copy[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Target should not be a text node (#504, Safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8) + event.metaKey = !!event.metaKey; + + return fixHook.filter? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + + focus: { + delegateType: "focusin" + }, + blur: { + delegateType: "focusout" + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +// Some plugins are using, but it's undocumented/deprecated and will be removed. +// The 1.7 special event interface should provide all the hooks needed now. +jQuery.event.handle = jQuery.event.dispatch; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 – + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === "undefined" ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj, + selector = handleObj.selector; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !jQuery._data( form, "_submit_attached" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + jQuery._data( form, "_submit_attached", true ); + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + } + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event, true ); + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + jQuery._data( elem, "_change_attached", true ); + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { // && selector != null + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + live: function( types, data, fn ) { + jQuery( this.context ).on( types, this.selector, data, fn ); + return this; + }, + die: function( types, fn ) { + jQuery( this.context ).off( types, this.selector || "**", fn ); + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; + + if ( rkeyEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; + } + + if ( rmouseEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; + } +}); +/*! + * Sizzle CSS Selector Engine + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://sizzlejs.com/ + */ +(function( window, undefined ) { + +var cachedruns, + assertGetIdNotName, + Expr, + getText, + isXML, + contains, + compile, + sortOrder, + hasDuplicate, + outermostContext, + + baseHasDuplicate = true, + strundefined = "undefined", + + expando = ( "sizcache" + Math.random() ).replace( ".", "" ), + + Token = String, + document = window.document, + docElem = document.documentElement, + dirruns = 0, + done = 0, + pop = [].pop, + push = [].push, + slice = [].slice, + // Use a stripped-down indexOf if a native one is unavailable + indexOf = [].indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + // Augment a function for special use by Sizzle + markFunction = function( fn, value ) { + fn[ expando ] = value == null || value; + return fn; + }, + + createCache = function() { + var cache = {}, + keys = []; + + return markFunction(function( key, value ) { + // Only keep the most recent entries + if ( keys.push( key ) > Expr.cacheLength ) { + delete cache[ keys.shift() ]; + } + + return (cache[ key ] = value); + }, cache ); + }, + + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + + // Regex + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors) + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + operators = "([*^$|!~]?=)", + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + + // Prefer arguments not in parens/brackets, + // then attribute selectors and non-pseudos (denoted by :), + // then anything else + // These preferences are here to reduce the number of selectors + // needing tokenize in the PSEUDO preFilter + pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)", + + // For matchExpr.POS and matchExpr.needsContext + pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), + rpseudo = new RegExp( pseudos ), + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, + + rnot = /^:not/, + rsibling = /[\x20\t\r\n\f]*[+~]/, + rendsWithNot = /:not\($/, + + rheader = /h\d/i, + rinputs = /input|select|textarea|button/i, + + rbackslash = /\\(?!\\)/g, + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "POS": new RegExp( pos, "i" ), + "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + // For use in libraries implementing .is() + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" ) + }, + + // Support + + // Used for testing something on an element + assert = function( fn ) { + var div = document.createElement("div"); + + try { + return fn( div ); + } catch (e) { + return false; + } finally { + // release memory in IE + div = null; + } + }, + + // Check if getElementsByTagName("*") returns only elements + assertTagNameNoComments = assert(function( div ) { + div.appendChild( document.createComment("") ); + return !div.getElementsByTagName("*").length; + }), + + // Check if getAttribute returns normalized href attributes + assertHrefNotNormalized = assert(function( div ) { + div.innerHTML = "<a href='#'></a>"; + return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && + div.firstChild.getAttribute("href") === "#"; + }), + + // Check if attributes should be retrieved by attribute nodes + assertAttributes = assert(function( div ) { + div.innerHTML = "<select></select>"; + var type = typeof div.lastChild.getAttribute("multiple"); + // IE8 returns a string for some attributes even when not present + return type !== "boolean" && type !== "string"; + }), + + // Check if getElementsByClassName can be trusted + assertUsableClassName = assert(function( div ) { + // Opera can't find a second classname (in 9.6) + div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>"; + if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { + return false; + } + + // Safari 3.2 caches class attributes and doesn't catch changes + div.lastChild.className = "e"; + return div.getElementsByClassName("e").length === 2; + }), + + // Check if getElementById returns elements by name + // Check if getElementsByName privileges form controls or returns elements by ID + assertUsableName = assert(function( div ) { + // Inject content + div.id = expando + 0; + div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>"; + docElem.insertBefore( div, docElem.firstChild ); + + // Test + var pass = document.getElementsByName && + // buggy browsers will return fewer than the correct 2 + document.getElementsByName( expando ).length === 2 + + // buggy browsers will return more than the correct 0 + document.getElementsByName( expando + 0 ).length; + assertGetIdNotName = !document.getElementById( expando ); + + // Cleanup + docElem.removeChild( div ); + + return pass; + }); + +// If slice is not available, provide a backup +try { + slice.call( docElem.childNodes, 0 )[0].nodeType; +} catch ( e ) { + slice = function( i ) { + var elem, + results = []; + for ( ; (elem = this[i]); i++ ) { + results.push( elem ); + } + return results; + }; +} + +function Sizzle( selector, context, results, seed ) { + results = results || []; + context = context || document; + var match, elem, xml, m, + nodeType = context.nodeType; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( nodeType !== 1 && nodeType !== 9 ) { + return []; + } + + xml = isXML( context ); + + if ( !xml && !seed ) { + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) { + push.apply( results, slice.call(context.getElementsByClassName( m ), 0) ); + return results; + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed, xml ); +} + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + return Sizzle( expr, null, null, [ elem ] ).length > 0; +}; + +// Returns a function to use in pseudos for input types +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +// Returns a function to use in pseudos for buttons +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +// Returns a function to use in pseudos for positionals +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( nodeType ) { + if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (see #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + } else { + + // If no nodeType, this is expected to be an array + for ( ; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } + return ret; +}; + +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +// Element contains another +contains = Sizzle.contains = docElem.contains ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) ); + } : + docElem.compareDocumentPosition ? + function( a, b ) { + return b && !!( a.compareDocumentPosition( b ) & 16 ); + } : + function( a, b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + return false; + }; + +Sizzle.attr = function( elem, name ) { + var val, + xml = isXML( elem ); + + if ( !xml ) { + name = name.toLowerCase(); + } + if ( (val = Expr.attrHandle[ name ]) ) { + return val( elem ); + } + if ( xml || assertAttributes ) { + return elem.getAttribute( name ); + } + val = elem.getAttributeNode( name ); + return val ? + typeof elem[ name ] === "boolean" ? + elem[ name ] ? name : null : + val.specified ? val.value : null : + null; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + // IE6/7 return a modified href + attrHandle: assertHrefNotNormalized ? + {} : + { + "href": function( elem ) { + return elem.getAttribute( "href", 2 ); + }, + "type": function( elem ) { + return elem.getAttribute("type"); + } + }, + + find: { + "ID": assertGetIdNotName ? + function( id, context, xml ) { + if ( typeof context.getElementById !== strundefined && !xml ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + } : + function( id, context, xml ) { + if ( typeof context.getElementById !== strundefined && !xml ) { + var m = context.getElementById( id ); + + return m ? + m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? + [m] : + undefined : + []; + } + }, + + "TAG": assertTagNameNoComments ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + var elem, + tmp = [], + i = 0; + + for ( ; (elem = results[i]); i++ ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }, + + "NAME": assertUsableName && function( tag, context ) { + if ( typeof context.getElementsByName !== strundefined ) { + return context.getElementsByName( name ); + } + }, + + "CLASS": assertUsableClassName && function( className, context, xml ) { + if ( typeof context.getElementsByClassName !== strundefined && !xml ) { + return context.getElementsByClassName( className ); + } + } + }, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( rbackslash, "" ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 3 xn-component of xn+y argument ([+-]?\d*n|) + 4 sign of xn-component + 5 x of xn-component + 6 sign of y-component + 7 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1] === "nth" ) { + // nth-child requires argument + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) ); + match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" ); + + // other types prohibit arguments + } else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var unquoted, excess; + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + if ( match[3] ) { + match[2] = match[3]; + } else if ( (unquoted = match[4]) ) { + // Only check arguments that contain a pseudo + if ( rpseudo.test(unquoted) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + unquoted = unquoted.slice( 0, excess ); + match[0] = match[0].slice( 0, excess ); + } + match[2] = unquoted; + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + "ID": assertGetIdNotName ? + function( id ) { + id = id.replace( rbackslash, "" ); + return function( elem ) { + return elem.getAttribute("id") === id; + }; + } : + function( id ) { + id = id.replace( rbackslash, "" ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === id; + }; + }, + + "TAG": function( nodeName ) { + if ( nodeName === "*" ) { + return function() { return true; }; + } + nodeName = nodeName.replace( rbackslash, "" ).toLowerCase(); + + return function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ expando ][ className ]; + if ( !pattern ) { + pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") ); + } + return function( elem ) { + return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); + }; + }, + + "ATTR": function( name, operator, check ) { + return function( elem, context ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.substr( result.length - check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, argument, first, last ) { + + if ( type === "nth" ) { + return function( elem ) { + var node, diff, + parent = elem.parentNode; + + if ( first === 1 && last === 0 ) { + return true; + } + + if ( parent ) { + diff = 0; + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + diff++; + if ( elem === node ) { + break; + } + } + } + } + + // Incorporate the offset (or cast to NaN), then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + }; + } + + return function( elem ) { + var node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + /* falls through */ + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), + // not comment, processing instructions, or others + // Thanks to Diego Perini for the nodeName shortcut + // Greater than "@" means alpha characters (specifically not starting with "#" or "?") + var nodeType; + elem = elem.firstChild; + while ( elem ) { + if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) { + return false; + } + elem = elem.nextSibling; + } + return true; + }, + + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "text": function( elem ) { + var type, attr; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && + (type = elem.type) === "text" && + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type ); + }, + + // Input types + "radio": createInputPseudo("radio"), + "checkbox": createInputPseudo("checkbox"), + "file": createInputPseudo("file"), + "password": createInputPseudo("password"), + "image": createInputPseudo("image"), + + "submit": createButtonPseudo("submit"), + "reset": createButtonPseudo("reset"), + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "focus": function( elem ) { + var doc = elem.ownerDocument; + return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href); + }, + + "active": function( elem ) { + return elem === elem.ownerDocument.activeElement; + }, + + // Positional types + "first": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = 0; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = 1; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +function siblingCheck( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; +} + +sortOrder = docElem.compareDocumentPosition ? + function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + return ( !a.compareDocumentPosition || !b.compareDocumentPosition ? + a.compareDocumentPosition : + a.compareDocumentPosition(b) & 4 + ) ? -1 : 1; + } : + function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + +// Always assume the presence of duplicates if sort doesn't +// pass them to our comparison function (as in Google Chrome). +[0, 0].sort( sortOrder ); +baseHasDuplicate = !hasDuplicate; + +// Document sorting and removing duplicates +Sizzle.uniqueSort = function( results ) { + var elem, + i = 1; + + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( ; (elem = results[i]); i++ ) { + if ( elem === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + + return results; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, soFar, groups, preFilters, + cached = tokenCache[ expando ][ selector ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + soFar = soFar.slice( match[0].length ); + } + groups.push( tokens = [] ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + tokens.push( matched = new Token( match.shift() ) ); + soFar = soFar.slice( matched.length ); + + // Cast descendant combinators to space + matched.type = match[0].replace( rtrim, " " ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + // The last two arguments here are (context, xml) for backCompat + (match = preFilters[ type ]( match, document, true ))) ) { + + tokens.push( matched = new Token( match.shift() ) ); + soFar = soFar.slice( matched.length ); + matched.type = type; + matched.matches = match; + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && combinator.dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( !xml ) { + var cache, + dirkey = dirruns + " " + doneName + " ", + cachedkey = dirkey + cachedruns; + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + if ( (cache = elem[ expando ]) === cachedkey ) { + return elem.sizset; + } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) { + if ( elem.sizset ) { + return elem; + } + } else { + elem[ expando ] = cachedkey; + if ( matcher( elem, context, xml ) ) { + elem.sizset = true; + return elem; + } + elem.sizset = false; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( checkNonElements || elem.nodeType === 1 ) { + if ( matcher( elem, context, xml ) ) { + return elem; + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones + if ( seed && postFinder ) { + return; + } + + var i, elem, postFilterIn, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + postFilterIn = condense( matcherOut, postMap ); + postFilter( postFilterIn, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = postFilterIn.length; + while ( i-- ) { + if ( (elem = postFilterIn[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + // Keep seed and results synchronized + if ( seed ) { + // Ignore postFinder because it can't coexist with seed + i = preFilter && matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + seed[ preMap[i] ] = !(results[ preMap[i] ] = elem); + } + } + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + // The concatenated values are (context, xml) for backCompat + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && tokens.join("") + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, expandContext ) { + var elem, j, matcher, + setMatched = [], + matchedCount = 0, + i = "0", + unmatched = seed && [], + outermost = expandContext != null, + contextBackup = outermostContext, + // We must always have either seed elements or context + elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), + // Nested matchers should use non-integer dirruns + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E); + + if ( outermost ) { + outermostContext = context !== document && context; + cachedruns = superMatcher.el; + } + + // Add elements passing elementMatchers directly to results + for ( ; (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + for ( j = 0; (matcher = elementMatchers[j]); j++ ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + cachedruns = ++superMatcher.el; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + for ( j = 0; (matcher = setMatchers[j]); j++ ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + superMatcher.el = 0; + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ expando ][ selector ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results, seed ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results, seed ); + } + return results; +} + +function select( selector, context, results, seed, xml ) { + var i, tokens, token, type, find, + match = tokenize( selector ), + j = match.length; + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && !xml && + Expr.relative[ tokens[1].type ] ) { + + context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0]; + if ( !context ) { + return results; + } + + selector = selector.slice( tokens.shift().length ); + } + + // Fetch a seed set for right-to-left matching + for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( rbackslash, "" ), + rsibling.test( tokens[0].type ) && context.parentNode || context, + xml + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && tokens.join(""); + if ( !selector ) { + push.apply( results, slice.call( seed, 0 ) ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + xml, + results, + rsibling.test( selector ) + ); + return results; +} + +if ( document.querySelectorAll ) { + (function() { + var disconnectedMatch, + oldSelect = select, + rescape = /'|\\/g, + rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, + + // qSa(:focus) reports false when true (Chrome 21), + // A support test would require too much code (would include document ready) + rbuggyQSA = [":focus"], + + // matchesSelector(:focus) reports false when true (Chrome 21), + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + // A support test would require too much code (would include document ready) + // just skip matchesSelector for :active + rbuggyMatches = [ ":active", ":focus" ], + matches = docElem.matchesSelector || + docElem.mozMatchesSelector || + docElem.webkitMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector; + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explictly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = "<select><option selected=''></option></select>"; + + // IE8 - Some boolean attributes are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here (do not put tests after this one) + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + + // Opera 10-12/IE9 - ^= $= *= and empty values + // Should not select anything + div.innerHTML = "<p test=''></p>"; + if ( div.querySelectorAll("[test^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here (do not put tests after this one) + div.innerHTML = "<input type='hidden'/>"; + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push(":enabled", ":disabled"); + } + }); + + // rbuggyQSA always contains :focus, so no need for a length check + rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") ); + + select = function( selector, context, results, seed, xml ) { + // Only use querySelectorAll when not filtering, + // when this is not xml, + // and when no QSA bugs apply + if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + var groups, i, + old = true, + nid = expando, + newContext = context, + newSelector = context.nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + groups[i].join(""); + } + newContext = rsibling.test( selector ) && context.parentNode || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, slice.call( newContext.querySelectorAll( + newSelector + ), 0 ) ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + + return oldSelect( selector, context, results, seed, xml ); + }; + + if ( matches ) { + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + try { + matches.call( div, "[test!='']:sizzle" ); + rbuggyMatches.push( "!=", pseudos ); + } catch ( e ) {} + }); + + // rbuggyMatches always contains :active and :focus, so no need for a length check + rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") ); + + Sizzle.matchesSelector = function( elem, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + // rbuggyMatches always contains :active, so no need for an existence check + if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) { + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, null, null, [ elem ] ).length > 0; + }; + } + })(); +} + +// Deprecated +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Back-compat +function setFilters() {} +Expr.filters = setFilters.prototype = Expr.pseudos; +Expr.setFilters = new setFilters(); + +// Override sizzle attribute retrieval +Sizzle.attr = jQuery.attr; +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.pseudos; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})( window ); +var runtil = /Until$/, + rparentsprev = /^(?:parents|prev(?:Until|All))/, + isSimple = /^.[^:#\[\.,]*$/, + rneedsContext = jQuery.expr.match.needsContext, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var i, l, length, n, r, ret, + self = this; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + ret = this.pushStack( "", "find", selector ); + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( + typeof selector === "string" ? + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + rneedsContext.test( selector ) ? + jQuery( selector, this.context ).index( this[0] ) >= 0 : + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + ret = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + cur = this[i]; + + while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + } + cur = cur.parentNode; + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +jQuery.fn.andSelf = jQuery.fn.addBack; + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( this.length > 1 && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, core_slice.call( arguments ).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return ( elem === qualifier ) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; + }); +} +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rtbody = /<tbody/i, + rhtml = /<|&#?\w+;/, + rnoInnerhtml = /<(?:script|style|link)/i, + rnocache = /<(?:script|object|embed|option|style)/i, + rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), + rcheckableType = /^(?:checkbox|radio)$/, + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptType = /\/(java|ecma)script/i, + rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g, + wrapMap = { + option: [ 1, "<select multiple='multiple'>", "</select>" ], + legend: [ 1, "<fieldset>", "</fieldset>" ], + thead: [ 1, "<table>", "</table>" ], + tr: [ 2, "<table><tbody>", "</tbody></table>" ], + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], + col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], + area: [ 1, "<map>", "</map>" ], + _default: [ 0, "", "" ] + }, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, +// unless wrapped in a div with non-breaking characters in front of it. +if ( !jQuery.support.htmlSerialize ) { + wrapMap._default = [ 1, "X<div>", "</div>" ]; +} + +jQuery.fn.extend({ + text: function( value ) { + return jQuery.access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); + }, null, value, arguments.length ); + }, + + wrapAll: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapAll( html.call(this, i) ); + }); + } + + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); + + if ( this[0].parentNode ) { + wrap.insertBefore( this[0] ); + } + + wrap.map(function() { + var elem = this; + + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { + elem = elem.firstChild; + } + + return elem; + }).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapInner( html.call(this, i) ); + }); + } + + return this.each(function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + }); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each(function(i) { + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); + }); + }, + + unwrap: function() { + return this.parent().each(function() { + if ( !jQuery.nodeName( this, "body" ) ) { + jQuery( this ).replaceWith( this.childNodes ); + } + }).end(); + }, + + append: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 ) { + this.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip(arguments, true, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 ) { + this.insertBefore( elem, this.firstChild ); + } + }); + }, + + before: function() { + if ( !isDisconnected( this[0] ) ) { + return this.domManip(arguments, false, function( elem ) { + this.parentNode.insertBefore( elem, this ); + }); + } + + if ( arguments.length ) { + var set = jQuery.clean( arguments ); + return this.pushStack( jQuery.merge( set, this ), "before", this.selector ); + } + }, + + after: function() { + if ( !isDisconnected( this[0] ) ) { + return this.domManip(arguments, false, function( elem ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + } + + if ( arguments.length ) { + var set = jQuery.clean( arguments ); + return this.pushStack( jQuery.merge( this, set ), "after", this.selector ); + } + }, + + // keepData is for internal use only--do not document + remove: function( selector, keepData ) { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( elem.getElementsByTagName("*") ); + jQuery.cleanData( [ elem ] ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( elem.getElementsByTagName("*") ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function () { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return jQuery.access( this, function( value ) { + var elem = this[0] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1></$2>" ); + + try { + for (; i < l; i++ ) { + // Remove element nodes and prevent memory leaks + elem = this[i] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( elem.getElementsByTagName( "*" ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch(e) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function( value ) { + if ( !isDisconnected( this[0] ) ) { + // Make sure that the elements are removed from the DOM before they are inserted + // this can help fix replacing a parent with child elements + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this), old = self.html(); + self.replaceWith( value.call( this, i, old ) ); + }); + } + + if ( typeof value !== "string" ) { + value = jQuery( value ).detach(); + } + + return this.each(function() { + var next = this.nextSibling, + parent = this.parentNode; + + jQuery( this ).remove(); + + if ( next ) { + jQuery(next).before( value ); + } else { + jQuery(parent).append( value ); + } + }); + } + + return this.length ? + this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) : + this; + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, table, callback ) { + + // Flatten any nested arrays + args = [].concat.apply( [], args ); + + var results, first, fragment, iNoClone, + i = 0, + value = args[0], + scripts = [], + l = this.length; + + // We can't cloneNode fragments that contain checked, in WebKit + if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) { + return this.each(function() { + jQuery(this).domManip( args, table, callback ); + }); + } + + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + args[0] = value.call( this, i, table ? self.html() : undefined ); + self.domManip( args, table, callback ); + }); + } + + if ( this[0] ) { + results = jQuery.buildFragment( args, this, scripts ); + fragment = results.fragment; + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + table = table && jQuery.nodeName( first, "tr" ); + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + // Fragments from the fragment cache must always be cloned and never used in place. + for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) { + callback.call( + table && jQuery.nodeName( this[i], "table" ) ? + findOrAppend( this[i], "tbody" ) : + this[i], + i === iNoClone ? + fragment : + jQuery.clone( fragment, true, true ) + ); + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + + if ( scripts.length ) { + jQuery.each( scripts, function( i, elem ) { + if ( elem.src ) { + if ( jQuery.ajax ) { + jQuery.ajax({ + url: elem.src, + type: "GET", + dataType: "script", + async: false, + global: false, + "throws": true + }); + } else { + jQuery.error("no ajax"); + } + } else { + jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } + }); + } + } + + return this; + } +}); + +function findOrAppend( elem, tag ) { + return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); +} + +function cloneCopyEvent( src, dest ) { + + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function cloneFixAttributes( src, dest ) { + var nodeName; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + // clearAttributes removes the attributes, which we don't want, + // but also removes the attachEvent events, which we *do* want + if ( dest.clearAttributes ) { + dest.clearAttributes(); + } + + // mergeAttributes, in contrast, only merges back on the + // original attributes, not the events + if ( dest.mergeAttributes ) { + dest.mergeAttributes( src ); + } + + nodeName = dest.nodeName.toLowerCase(); + + if ( nodeName === "object" ) { + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + + // IE blanks contents when cloning scripts + } else if ( nodeName === "script" && dest.text !== src.text ) { + dest.text = src.text; + } + + // Event data gets referenced instead of copied if the expando + // gets copied too + dest.removeAttribute( jQuery.expando ); +} + +jQuery.buildFragment = function( args, context, scripts ) { + var fragment, cacheable, cachehit, + first = args[ 0 ]; + + // Set context from what may come in as undefined or a jQuery collection or a node + // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 & + // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception + context = context || document; + context = !context.nodeType && context[0] || context; + context = context.ownerDocument || context; + + // Only cache "small" (1/2 KB) HTML strings that are associated with the main document + // Cloning options loses the selected state, so don't cache them + // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment + // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache + // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501 + if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document && + first.charAt(0) === "<" && !rnocache.test( first ) && + (jQuery.support.checkClone || !rchecked.test( first )) && + (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) { + + // Mark cacheable and look for a hit + cacheable = true; + fragment = jQuery.fragments[ first ]; + cachehit = fragment !== undefined; + } + + if ( !fragment ) { + fragment = context.createDocumentFragment(); + jQuery.clean( args, context, fragment, scripts ); + + // Update the cache, but only store false + // unless this is a second parsing of the same content + if ( cacheable ) { + jQuery.fragments[ first ] = cachehit && fragment; + } + } + + return { fragment: fragment, cacheable: cacheable }; +}; + +jQuery.fragments = {}; + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + l = insert.length, + parent = this.length === 1 && this[0].parentNode; + + if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) { + insert[ original ]( this[0] ); + return this; + } else { + for ( ; i < l; i++ ) { + elems = ( i > 0 ? this.clone(true) : this ).get(); + jQuery( insert[i] )[ original ]( elems ); + ret = ret.concat( elems ); + } + + return this.pushStack( ret, name, insert.selector ); + } + }; +}); + +function getAll( elem ) { + if ( typeof elem.getElementsByTagName !== "undefined" ) { + return elem.getElementsByTagName( "*" ); + + } else if ( typeof elem.querySelectorAll !== "undefined" ) { + return elem.querySelectorAll( "*" ); + + } else { + return []; + } +} + +// Used in clean, fixes the defaultChecked property +function fixDefaultChecked( elem ) { + if ( rcheckableType.test( elem.type ) ) { + elem.defaultChecked = elem.checked; + } +} + +jQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var srcElements, + destElements, + i, + clone; + + if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && + (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { + // IE copies events bound via attachEvent when using cloneNode. + // Calling detachEvent on the clone will also remove the events + // from the original. In order to get around this, we use some + // proprietary methods to clear the events. Thanks to MooTools + // guys for this hotness. + + cloneFixAttributes( elem, clone ); + + // Using Sizzle here is crazy slow, so we use getElementsByTagName instead + srcElements = getAll( elem ); + destElements = getAll( clone ); + + // Weird iteration because IE will replace the length property + // with an element if you are cloning the body and one of the + // elements on the page has a name or id of "length" + for ( i = 0; srcElements[i]; ++i ) { + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[i] ) { + cloneFixAttributes( srcElements[i], destElements[i] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + cloneCopyEvent( elem, clone ); + + if ( deepDataAndEvents ) { + srcElements = getAll( elem ); + destElements = getAll( clone ); + + for ( i = 0; srcElements[i]; ++i ) { + cloneCopyEvent( srcElements[i], destElements[i] ); + } + } + } + + srcElements = destElements = null; + + // Return the cloned set + return clone; + }, + + clean: function( elems, context, fragment, scripts ) { + var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags, + safe = context === document && safeFragment, + ret = []; + + // Ensure that context is a document + if ( !context || typeof context.createDocumentFragment === "undefined" ) { + context = document; + } + + // Use the already-created safe fragment if context permits + for ( i = 0; (elem = elems[i]) != null; i++ ) { + if ( typeof elem === "number" ) { + elem += ""; + } + + if ( !elem ) { + continue; + } + + // Convert html string into DOM nodes + if ( typeof elem === "string" ) { + if ( !rhtml.test( elem ) ) { + elem = context.createTextNode( elem ); + } else { + // Ensure a safe container in which to render the html + safe = safe || createSafeFragment( context ); + div = context.createElement("div"); + safe.appendChild( div ); + + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(rxhtmlTag, "<$1></$2>"); + + // Go to html and back, then peel off extra wrappers + tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + depth = wrap[0]; + div.innerHTML = wrap[1] + elem + wrap[2]; + + // Move to the right depth + while ( depth-- ) { + div = div.lastChild; + } + + // Remove IE's autoinserted <tbody> from table fragments + if ( !jQuery.support.tbody ) { + + // String was a <table>, *may* have spurious <tbody> + hasBody = rtbody.test(elem); + tbody = tag === "table" && !hasBody ? + div.firstChild && div.firstChild.childNodes : + + // String was a bare <thead> or <tfoot> + wrap[1] === "<table>" && !hasBody ? + div.childNodes : + []; + + for ( j = tbody.length - 1; j >= 0 ; --j ) { + if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { + tbody[ j ].parentNode.removeChild( tbody[ j ] ); + } + } + } + + // IE completely kills leading whitespace when innerHTML is used + if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { + div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); + } + + elem = div.childNodes; + + // Take out of fragment container (we need a fresh div each time) + div.parentNode.removeChild( div ); + } + } + + if ( elem.nodeType ) { + ret.push( elem ); + } else { + jQuery.merge( ret, elem ); + } + } + + // Fix #11356: Clear elements from safeFragment + if ( div ) { + elem = div = safe = null; + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !jQuery.support.appendChecked ) { + for ( i = 0; (elem = ret[i]) != null; i++ ) { + if ( jQuery.nodeName( elem, "input" ) ) { + fixDefaultChecked( elem ); + } else if ( typeof elem.getElementsByTagName !== "undefined" ) { + jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); + } + } + } + + // Append elements to a provided document fragment + if ( fragment ) { + // Special handling of each script element + handleScript = function( elem ) { + // Check if we consider it executable + if ( !elem.type || rscriptType.test( elem.type ) ) { + // Detach the script and store it in the scripts array (if provided) or the fragment + // Return truthy to indicate that it has been handled + return scripts ? + scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) : + fragment.appendChild( elem ); + } + }; + + for ( i = 0; (elem = ret[i]) != null; i++ ) { + // Check if we're done after handling an executable script + if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) { + // Append to fragment and handle embedded scripts + fragment.appendChild( elem ); + if ( typeof elem.getElementsByTagName !== "undefined" ) { + // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration + jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript ); + + // Splice the scripts into ret after their former ancestor and advance our index beyond them + ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); + i += jsTags.length; + } + } + } + } + + return ret; + }, + + cleanData: function( elems, /* internal */ acceptData ) { + var data, id, elem, type, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + deleteExpando = jQuery.support.deleteExpando, + special = jQuery.event.special; + + for ( ; (elem = elems[i]) != null; i++ ) { + + if ( acceptData || jQuery.acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( deleteExpando ) { + delete elem[ internalKey ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( internalKey ); + + } else { + elem[ internalKey ] = null; + } + + jQuery.deletedIds.push( id ); + } + } + } + } + } +}); +// Limit scope pollution from any deprecated API +(function() { + +var matched, browser; + +// Use of jQuery.browser is frowned upon. +// More details: http://api.jquery.com/jQuery.browser +// jQuery.uaMatch maintained for back-compat +jQuery.uaMatch = function( ua ) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || + /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; +}; + +matched = jQuery.uaMatch( navigator.userAgent ); +browser = {}; + +if ( matched.browser ) { + browser[ matched.browser ] = true; + browser.version = matched.version; +} + +// Chrome is Webkit, but Webkit is also Safari. +if ( browser.chrome ) { + browser.webkit = true; +} else if ( browser.webkit ) { + browser.safari = true; +} + +jQuery.browser = browser; + +jQuery.sub = function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; +}; + +})(); +var curCSS, iframe, iframeDoc, + ralpha = /alpha\([^)]*\)/i, + ropacity = /opacity=([^)]*)/, + rposition = /^(top|right|bottom|left)$/, + // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" + // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rmargin = /^margin/, + rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), + rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), + rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ), + elemdisplay = {}, + + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: 0, + fontWeight: 400 + }, + + cssExpand = [ "Top", "Right", "Bottom", "Left" ], + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], + + eventsToggle = jQuery.fn.toggle; + +// return a css property mapped to a potentially vendor prefixed property +function vendorPropName( style, name ) { + + // shortcut for names that are not vendor prefixed + if ( name in style ) { + return name; + } + + // check for vendor prefixed names + var capName = name.charAt(0).toUpperCase() + name.slice(1), + origName = name, + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in style ) { + return name; + } + } + + return origName; +} + +function isHidden( elem, el ) { + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); +} + +function showHide( elements, show ) { + var elem, display, + values = [], + index = 0, + length = elements.length; + + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + values[ index ] = jQuery._data( elem, "olddisplay" ); + if ( show ) { + // Reset the inline display of this element to learn if it is + // being hidden by cascaded rules or not + if ( !values[ index ] && elem.style.display === "none" ) { + elem.style.display = ""; + } + + // Set elements which have been overridden with display: none + // in a stylesheet to whatever the default browser style is + // for such an element + if ( elem.style.display === "" && isHidden( elem ) ) { + values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); + } + } else { + display = curCSS( elem, "display" ); + + if ( !values[ index ] && display !== "none" ) { + jQuery._data( elem, "olddisplay", display ); + } + } + } + + // Set the display of most of the elements in a second loop + // to avoid the constant reflow + for ( index = 0; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + if ( !show || elem.style.display === "none" || elem.style.display === "" ) { + elem.style.display = show ? values[ index ] || "" : "none"; + } + } + + return elements; +} + +jQuery.fn.extend({ + css: function( name, value ) { + return jQuery.access( this, function( elem, name, value ) { + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + }, + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state, fn2 ) { + var bool = typeof state === "boolean"; + + if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) { + return eventsToggle.apply( this, arguments ); + } + + return this.each(function() { + if ( bool ? state : isHidden( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + }); + } +}); + +jQuery.extend({ + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + + } + } + } + }, + + // Exclude the following css properties to add px + cssNumber: { + "fillOpacity": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + // normalize float css property + "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + style = elem.style; + + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // convert relative number strings (+= or -=) to relative numbers. #7345 + if ( type === "string" && (ret = rrelNum.exec( value )) ) { + value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); + // Fixes bug #9237 + type = "number"; + } + + // Make sure that NaN and null values aren't set. See: #7116 + if ( value == null || type === "number" && isNaN( value ) ) { + return; + } + + // If a number was passed in, add 'px' to the (except for certain CSS properties) + if ( type === "number" && !jQuery.cssNumber[ origName ] ) { + value += "px"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { + // Wrapped to prevent IE from throwing errors when 'invalid' values are provided + // Fixes bug #5509 + try { + style[ name ] = value; + } catch(e) {} + } + + } else { + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, numeric, extra ) { + var val, num, hooks, + origName = jQuery.camelCase( name ); + + // Make sure that we're working with the right name + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name ); + } + + //convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Return, converting to number if forced or a qualifier was provided and val looks numeric + if ( numeric || extra !== undefined ) { + num = parseFloat( val ); + return numeric || jQuery.isNumeric( num ) ? num || 0 : val; + } + return val; + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; + } +}); + +// NOTE: To any future maintainer, we've window.getComputedStyle +// because jsdom on node.js will break without it. +if ( window.getComputedStyle ) { + curCSS = function( elem, name ) { + var ret, width, minWidth, maxWidth, + computed = window.getComputedStyle( elem, null ), + style = elem.style; + + if ( computed ) { + + ret = computed[ name ]; + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right + // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels + // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret; + }; +} else if ( document.documentElement.currentStyle ) { + curCSS = function( elem, name ) { + var left, rsLeft, + ret = elem.currentStyle && elem.currentStyle[ name ], + style = elem.style; + + // Avoid setting ret to empty string here + // so we don't default to auto + if ( ret == null && style && style[ name ] ) { + ret = style[ name ]; + } + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + // but not position css attributes, as those are proportional to the parent element instead + // and we can't measure the parent instead because it might trigger a "stacking dolls" problem + if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { + + // Remember the original values + left = style.left; + rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + if ( rsLeft ) { + elem.runtimeStyle.left = elem.currentStyle.left; + } + style.left = name === "fontSize" ? "1em" : ret; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + if ( rsLeft ) { + elem.runtimeStyle.left = rsLeft; + } + } + + return ret === "" ? "auto" : ret; + }; +} + +function setPositiveNumber( elem, value, subtract ) { + var matches = rnumsplit.exec( value ); + return matches ? + Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox ) { + var i = extra === ( isBorderBox ? "border" : "content" ) ? + // If we already have the right measurement, avoid augmentation + 4 : + // Otherwise initialize for horizontal or vertical properties + name === "width" ? 1 : 0, + + val = 0; + + for ( ; i < 4; i += 2 ) { + // both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + // we use jQuery.css instead of curCSS here + // because of the reliableMarginRight CSS hook! + val += jQuery.css( elem, extra + cssExpand[ i ], true ); + } + + // From this point on we use curCSS for maximum performance (relevant in animations) + if ( isBorderBox ) { + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0; + } + + // at this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; + } + } else { + // at this point, extra isn't content, so add padding + val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0; + + // at this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with offset property, which is equivalent to the border-box value + var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, + valueIsBorderBox = true, + isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"; + + // some non-html elements return undefined for offsetWidth, so check for null/undefined + // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 + // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 + if ( val <= 0 || val == null ) { + // Fall back to computed then uncomputed css if necessary + val = curCSS( elem, name ); + if ( val < 0 || val == null ) { + val = elem.style[ name ]; + } + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test(val) ) { + return val; + } + + // we need the check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + } + + // use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox + ) + ) + "px"; +} + + +// Try to determine the default display value of an element +function css_defaultDisplay( nodeName ) { + if ( elemdisplay[ nodeName ] ) { + return elemdisplay[ nodeName ]; + } + + var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ), + display = elem.css("display"); + elem.remove(); + + // If the simple way fails, + // get element's real default display by attaching it to a temp iframe + if ( display === "none" || display === "" ) { + // Use the already-created iframe if possible + iframe = document.body.appendChild( + iframe || jQuery.extend( document.createElement("iframe"), { + frameBorder: 0, + width: 0, + height: 0 + }) + ); + + // Create a cacheable copy of the iframe document on first call. + // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML + // document to it; WebKit & Firefox won't allow reusing the iframe document. + if ( !iframeDoc || !iframe.createElement ) { + iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; + iframeDoc.write("<!doctype html><html><body>"); + iframeDoc.close(); + } + + elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) ); + + display = curCSS( elem, "display" ); + document.body.removeChild( iframe ); + } + + // Store the correct default display + elemdisplay[ nodeName ] = display; + + return display; +} + +jQuery.each([ "height", "width" ], function( i, name ) { + jQuery.cssHooks[ name ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + // certain elements can have dimension info if we invisibly show them + // however, it must have a current display style that would benefit from this + if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) { + return jQuery.swap( elem, cssShow, function() { + return getWidthOrHeight( elem, name, extra ); + }); + } else { + return getWidthOrHeight( elem, name, extra ); + } + } + }, + + set: function( elem, value, extra ) { + return setPositiveNumber( elem, value, extra ? + augmentWidthOrHeight( + elem, + name, + extra, + jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box" + ) : 0 + ); + } + }; +}); + +if ( !jQuery.support.opacity ) { + jQuery.cssHooks.opacity = { + get: function( elem, computed ) { + // IE uses filters for opacity + return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? + ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : + computed ? "1" : ""; + }, + + set: function( elem, value ) { + var style = elem.style, + currentStyle = elem.currentStyle, + opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", + filter = currentStyle && currentStyle.filter || style.filter || ""; + + // IE has trouble with opacity if it does not have layout + // Force it by setting the zoom level + style.zoom = 1; + + // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 + if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && + style.removeAttribute ) { + + // Setting style.filter to null, "" & " " still leave "filter:" in the cssText + // if "filter:" is present at all, clearType is disabled, we want to avoid this + // style.removeAttribute is IE Only, but so apparently is this code path... + style.removeAttribute( "filter" ); + + // if there there is no filter style applied in a css rule, we are done + if ( currentStyle && !currentStyle.filter ) { + return; + } + } + + // otherwise, set new filter values + style.filter = ralpha.test( filter ) ? + filter.replace( ralpha, opacity ) : + filter + " " + opacity; + } + }; +} + +// These hooks cannot be added until DOM ready because the support test +// for it is not run until after DOM ready +jQuery(function() { + if ( !jQuery.support.reliableMarginRight ) { + jQuery.cssHooks.marginRight = { + get: function( elem, computed ) { + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + // Work around by temporarily setting element display to inline-block + return jQuery.swap( elem, { "display": "inline-block" }, function() { + if ( computed ) { + return curCSS( elem, "marginRight" ); + } + }); + } + }; + } + + // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 + // getComputedStyle returns percent when specified for top/left/bottom/right + // rather than make the css module depend on the offset module, we just check for it here + if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { + jQuery.each( [ "top", "left" ], function( i, prop ) { + jQuery.cssHooks[ prop ] = { + get: function( elem, computed ) { + if ( computed ) { + var ret = curCSS( elem, prop ); + // if curCSS returns percentage, fallback to offset + return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret; + } + } + }; + }); + } + +}); + +if ( jQuery.expr && jQuery.expr.filters ) { + jQuery.expr.filters.hidden = function( elem ) { + return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none"); + }; + + jQuery.expr.filters.visible = function( elem ) { + return !jQuery.expr.filters.hidden( elem ); + }; +} + +// These hooks are used by animate to expand properties +jQuery.each({ + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i, + + // assumes a single number if not a string + parts = typeof value === "string" ? value.split(" ") : [ value ], + expanded = {}; + + for ( i = 0; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( !rmargin.test( prefix ) ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +}); +var r20 = /%20/g, + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, + rselectTextarea = /^(?:select|textarea)/i; + +jQuery.fn.extend({ + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map(function(){ + return this.elements ? jQuery.makeArray( this.elements ) : this; + }) + .filter(function(){ + return this.name && !this.disabled && + ( this.checked || rselectTextarea.test( this.nodeName ) || + rinput.test( this.type ) ); + }) + .map(function( i, elem ){ + var val = jQuery( this ).val(); + + return val == null ? + null : + jQuery.isArray( val ) ? + jQuery.map( val, function( val, i ){ + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }) : + { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }).get(); + } +}); + +//Serialize an array of form elements or a set of +//key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, value ) { + // If value is a function, invoke it and return its value + value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); + s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); + }; + + // Set traditional to true for jQuery <= 1.3.2 behavior. + if ( traditional === undefined ) { + traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + }); + + } else { + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ).replace( r20, "+" ); +}; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( jQuery.isArray( obj ) ) { + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + // If array item is non-scalar (array or object), encode its + // numeric index to resolve deserialization ambiguity issues. + // Note that rack (as of 1.0.0) can't currently deserialize + // nested arrays properly, and attempting to do so may cause + // a server error. Possible fixes are to modify rack's + // deserialization algorithm or to provide an option or flag + // to force array serialization to be shallow. + buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); + } + }); + + } else if ( !traditional && jQuery.type( obj ) === "object" ) { + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + // Serialize scalar item. + add( prefix, obj ); + } +} +var + // Document location + ajaxLocParts, + ajaxLocation, + + rhash = /#.*$/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + rquery = /\?/, + rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, + rts = /([?&])_=[^&]*/, + rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, + + // Keep a copy of the old load method + _load = jQuery.fn.load, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = ["*/"] + ["*"]; + +// #8138, IE may throw an exception when accessing +// a field from window.location if document.domain has been set +try { + ajaxLocation = location.href; +} catch( e ) { + // Use the href attribute of an A element + // since IE will modify it given document.location + ajaxLocation = document.createElement( "a" ); + ajaxLocation.href = ""; + ajaxLocation = ajaxLocation.href; +} + +// Segment location into parts +ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, list, placeBefore, + dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ), + i = 0, + length = dataTypes.length; + + if ( jQuery.isFunction( func ) ) { + // For each dataType in the dataTypeExpression + for ( ; i < length; i++ ) { + dataType = dataTypes[ i ]; + // We control if we're asked to add before + // any existing element + placeBefore = /^\+/.test( dataType ); + if ( placeBefore ) { + dataType = dataType.substr( 1 ) || "*"; + } + list = structure[ dataType ] = structure[ dataType ] || []; + // then we add to the structure accordingly + list[ placeBefore ? "unshift" : "push" ]( func ); + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, + dataType /* internal */, inspected /* internal */ ) { + + dataType = dataType || options.dataTypes[ 0 ]; + inspected = inspected || {}; + + inspected[ dataType ] = true; + + var selection, + list = structure[ dataType ], + i = 0, + length = list ? list.length : 0, + executeOnly = ( structure === prefilters ); + + for ( ; i < length && ( executeOnly || !selection ); i++ ) { + selection = list[ i ]( options, originalOptions, jqXHR ); + // If we got redirected to another dataType + // we try there if executing only and not done already + if ( typeof selection === "string" ) { + if ( !executeOnly || inspected[ selection ] ) { + selection = undefined; + } else { + options.dataTypes.unshift( selection ); + selection = inspectPrefiltersOrTransports( + structure, options, originalOptions, jqXHR, selection, inspected ); + } + } + } + // If we're only executing or nothing was selected + // we try the catchall dataType if not done already + if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { + selection = inspectPrefiltersOrTransports( + structure, options, originalOptions, jqXHR, "*", inspected ); + } + // unnecessary when only executing (prefilters) + // but it'll be ignored by the caller in that case + return selection; +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } +} + +jQuery.fn.load = function( url, params, callback ) { + if ( typeof url !== "string" && _load ) { + return _load.apply( this, arguments ); + } + + // Don't do a request if no elements are being requested + if ( !this.length ) { + return this; + } + + var selector, type, response, + self = this, + off = url.indexOf(" "); + + if ( off >= 0 ) { + selector = url.slice( off, url.length ); + url = url.slice( 0, off ); + } + + // If it's a function + if ( jQuery.isFunction( params ) ) { + + // We assume that it's the callback + callback = params; + params = undefined; + + // Otherwise, build a param string + } else if ( params && typeof params === "object" ) { + type = "POST"; + } + + // Request the remote document + jQuery.ajax({ + url: url, + + // if "type" variable is undefined, then "GET" method will be used + type: type, + dataType: "html", + data: params, + complete: function( jqXHR, status ) { + if ( callback ) { + self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); + } + } + }).done(function( responseText ) { + + // Save response for use in complete callback + response = arguments; + + // See if a selector was specified + self.html( selector ? + + // Create a dummy div to hold the results + jQuery("<div>") + + // inject the contents of the document in, removing the scripts + // to avoid any 'Permission Denied' errors in IE + .append( responseText.replace( rscript, "" ) ) + + // Locate the specified elements + .find( selector ) : + + // If not, just inject the full result + responseText ); + + }); + + return this; +}; + +// Attach a bunch of functions for handling common AJAX events +jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){ + jQuery.fn[ o ] = function( f ){ + return this.on( o, f ); + }; +}); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + // shift arguments if data argument was omitted + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + return jQuery.ajax({ + type: method, + url: url, + data: data, + success: callback, + dataType: type + }); + }; +}); + +jQuery.extend({ + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + if ( settings ) { + // Building a settings object + ajaxExtend( target, jQuery.ajaxSettings ); + } else { + // Extending ajaxSettings + settings = target; + target = jQuery.ajaxSettings; + } + ajaxExtend( target, settings ); + return target; + }, + + ajaxSettings: { + url: ajaxLocation, + isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), + global: true, + type: "GET", + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + processData: true, + async: true, + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + xml: "application/xml, text/xml", + html: "text/html", + text: "text/plain", + json: "application/json, text/javascript", + "*": allTypes + }, + + contents: { + xml: /xml/, + html: /html/, + json: /json/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText" + }, + + // List of data converters + // 1) key format is "source_type destination_type" (a single space in-between) + // 2) the catchall symbol "*" can be used for source_type + converters: { + + // Convert anything to text + "* text": window.String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": jQuery.parseJSON, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + context: true, + url: true + } + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var // ifModified key + ifModifiedKey, + // Response headers + responseHeadersString, + responseHeaders, + // transport + transport, + // timeout handle + timeoutTimer, + // Cross-domain detection vars + parts, + // To know if global events are to be dispatched + fireGlobals, + // Loop variable + i, + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + // Callbacks context + callbackContext = s.context || s, + // Context for global events + // It's the callbackContext if one was provided in the options + // and if it's a DOM node or a jQuery collection + globalEventContext = callbackContext !== s && + ( callbackContext.nodeType || callbackContext instanceof jQuery ) ? + jQuery( callbackContext ) : jQuery.event, + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + // Status-dependent callbacks + statusCode = s.statusCode || {}, + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + // The jqXHR state + state = 0, + // Default abort message + strAbort = "canceled", + // Fake xhr + jqXHR = { + + readyState: 0, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( !state ) { + var lname = name.toLowerCase(); + name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Raw string + getAllResponseHeaders: function() { + return state === 2 ? responseHeadersString : null; + }, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( state === 2 ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match === undefined ? null : match; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( !state ) { + s.mimeType = type; + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + statusText = statusText || strAbort; + if ( transport ) { + transport.abort( statusText ); + } + done( 0, statusText ); + return this; + } + }; + + // Callback for when everything is done + // It is defined here because jslint complains if it is declared + // at the end of the function (which would be more logical and readable) + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Called once + if ( state === 2 ) { + return; + } + + // State is "done" now + state = 2; + + // Clear timeout if it exists + if ( timeoutTimer ) { + clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // If successful, handle type chaining + if ( status >= 200 && status < 300 || status === 304 ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + + modified = jqXHR.getResponseHeader("Last-Modified"); + if ( modified ) { + jQuery.lastModified[ ifModifiedKey ] = modified; + } + modified = jqXHR.getResponseHeader("Etag"); + if ( modified ) { + jQuery.etag[ ifModifiedKey ] = modified; + } + } + + // If not modified + if ( status === 304 ) { + + statusText = "notmodified"; + isSuccess = true; + + // If we have data + } else { + + isSuccess = ajaxConvert( s, response ); + statusText = isSuccess.state; + success = isSuccess.data; + error = isSuccess.error; + isSuccess = !error; + } + } else { + // We extract error from statusText + // then normalize statusText and status for non-aborts + error = statusText; + if ( !statusText || status ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ), + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + // Attach deferreds + deferred.promise( jqXHR ); + jqXHR.success = jqXHR.done; + jqXHR.error = jqXHR.fail; + jqXHR.complete = completeDeferred.add; + + // Status-dependent callbacks + jqXHR.statusCode = function( map ) { + if ( map ) { + var tmp; + if ( state < 2 ) { + for ( tmp in map ) { + statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ]; + } + } else { + tmp = map[ jqXHR.status ]; + jqXHR.always( tmp ); + } + } + return this; + }; + + // Remove hash character (#7531: and string promotion) + // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) + // We also use the url parameter if available + s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); + + // Extract dataTypes list + s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace ); + + // A cross-domain request is in order when we have a protocol:host:port mismatch + if ( s.crossDomain == null ) { + parts = rurl.exec( s.url.toLowerCase() ) || false; + s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !== + ( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ); + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( state === 2 ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + fireGlobals = s.global; + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // If data is available, append data to url + if ( s.data ) { + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Get ifModifiedKey before adding the anti-cache parameter + ifModifiedKey = s.url; + + // Add anti-cache in url if needed + if ( s.cache === false ) { + + var ts = jQuery.now(), + // try replacing _= if it is there + ret = s.url.replace( rts, "$1_=" + ts ); + + // if nothing was replaced, add timestamp to the end + s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + ifModifiedKey = ifModifiedKey || s.url; + if ( jQuery.lastModified[ ifModifiedKey ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] ); + } + if ( jQuery.etag[ ifModifiedKey ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] ); + } + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? + s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { + // Abort if not done already and return + return jqXHR.abort(); + + } + + // aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + for ( i in { success: 1, error: 1, complete: 1 } ) { + jqXHR[ i ]( s[ i ] ); + } + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = setTimeout( function(){ + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + state = 1; + transport.send( requestHeaders, done ); + } catch (e) { + // Propagate exception as error if not done + if ( state < 2 ) { + done( -1, e ); + // Simply rethrow otherwise + } else { + throw e; + } + } + } + + return jqXHR; + }, + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {} + +}); + +/* Handles responses to an ajax request: + * - sets all responseXXX fields accordingly + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes, + responseFields = s.responseFields; + + // Fill responseXXX fields + for ( type in responseFields ) { + if ( type in responses ) { + jqXHR[ responseFields[type] ] = responses[ type ]; + } + } + + // Remove auto dataType and get content-type in the process + while( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "content-type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +// Chain conversions given the request and the original response +function ajaxConvert( s, response ) { + + var conv, conv2, current, tmp, + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(), + prev = dataTypes[ 0 ], + converters = {}, + i = 0; + + // Apply the dataFilter if provided + if ( s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + // Convert to each sequential dataType, tolerating list modification + for ( ; (current = dataTypes[++i]); ) { + + // There's only work to do if current dataType is non-auto + if ( current !== "*" ) { + + // Convert response if prev dataType is non-auto and differs from current + if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split(" "); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.splice( i--, 0, current ); + } + + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s["throws"] ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; + } + } + } + } + + // Update prev for next iteration + prev = current; + } + } + + return { state: "success", data: response }; +} +var oldCallbacks = [], + rquestion = /\?/, + rjsonp = /(=)\?(?=&|$)|\?\?/, + nonce = jQuery.now(); + +// Default jsonp settings +jQuery.ajaxSetup({ + jsonp: "callback", + jsonpCallback: function() { + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); + this[ callback ] = true; + return callback; + } +}); + +// Detect, normalize options and install callbacks for jsonp requests +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { + + var callbackName, overwritten, responseContainer, + data = s.data, + url = s.url, + hasCallback = s.jsonp !== false, + replaceInUrl = hasCallback && rjsonp.test( url ), + replaceInData = hasCallback && !replaceInUrl && typeof data === "string" && + !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && + rjsonp.test( data ); + + // Handle iff the expected data type is "jsonp" or we have a parameter to set + if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) { + + // Get callback name, remembering preexisting value associated with it + callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? + s.jsonpCallback() : + s.jsonpCallback; + overwritten = window[ callbackName ]; + + // Insert callback into url or form data + if ( replaceInUrl ) { + s.url = url.replace( rjsonp, "$1" + callbackName ); + } else if ( replaceInData ) { + s.data = data.replace( rjsonp, "$1" + callbackName ); + } else if ( hasCallback ) { + s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; + } + + // Use data converter to retrieve json after script execution + s.converters["script json"] = function() { + if ( !responseContainer ) { + jQuery.error( callbackName + " was not called" ); + } + return responseContainer[ 0 ]; + }; + + // force json dataType + s.dataTypes[ 0 ] = "json"; + + // Install callback + window[ callbackName ] = function() { + responseContainer = arguments; + }; + + // Clean-up function (fires after converters) + jqXHR.always(function() { + // Restore preexisting value + window[ callbackName ] = overwritten; + + // Save back as free + if ( s[ callbackName ] ) { + // make sure that re-using the options doesn't screw things around + s.jsonpCallback = originalSettings.jsonpCallback; + + // save the callback name for future use + oldCallbacks.push( callbackName ); + } + + // Call if it was a function and we have a response + if ( responseContainer && jQuery.isFunction( overwritten ) ) { + overwritten( responseContainer[ 0 ] ); + } + + responseContainer = overwritten = undefined; + }); + + // Delegate to script + return "script"; + } +}); +// Install script dataType +jQuery.ajaxSetup({ + accepts: { + script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /javascript|ecmascript/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +}); + +// Handle cache's special case and global +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + s.global = false; + } +}); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function(s) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + + var script, + head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement; + + return { + + send: function( _, callback ) { + + script = document.createElement( "script" ); + + script.async = "async"; + + if ( s.scriptCharset ) { + script.charset = s.scriptCharset; + } + + script.src = s.url; + + // Attach handlers for all browsers + script.onload = script.onreadystatechange = function( _, isAbort ) { + + if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { + + // Handle memory leak in IE + script.onload = script.onreadystatechange = null; + + // Remove the script + if ( head && script.parentNode ) { + head.removeChild( script ); + } + + // Dereference the script + script = undefined; + + // Callback if not abort + if ( !isAbort ) { + callback( 200, "success" ); + } + } + }; + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709 and #4378). + head.insertBefore( script, head.firstChild ); + }, + + abort: function() { + if ( script ) { + script.onload( 0, 1 ); + } + } + }; + } +}); +var xhrCallbacks, + // #5280: Internet Explorer will keep connections alive if we don't abort on unload + xhrOnUnloadAbort = window.ActiveXObject ? function() { + // Abort all pending requests + for ( var key in xhrCallbacks ) { + xhrCallbacks[ key ]( 0, 1 ); + } + } : false, + xhrId = 0; + +// Functions to create xhrs +function createStandardXHR() { + try { + return new window.XMLHttpRequest(); + } catch( e ) {} +} + +function createActiveXHR() { + try { + return new window.ActiveXObject( "Microsoft.XMLHTTP" ); + } catch( e ) {} +} + +// Create the request object +// (This is still attached to ajaxSettings for backward compatibility) +jQuery.ajaxSettings.xhr = window.ActiveXObject ? + /* Microsoft failed to properly + * implement the XMLHttpRequest in IE7 (can't request local files), + * so we use the ActiveXObject when it is available + * Additionally XMLHttpRequest can be disabled in IE7/IE8 so + * we need a fallback. + */ + function() { + return !this.isLocal && createStandardXHR() || createActiveXHR(); + } : + // For all other browsers, use the standard XMLHttpRequest object + createStandardXHR; + +// Determine support properties +(function( xhr ) { + jQuery.extend( jQuery.support, { + ajax: !!xhr, + cors: !!xhr && ( "withCredentials" in xhr ) + }); +})( jQuery.ajaxSettings.xhr() ); + +// Create transport if the browser can provide an xhr +if ( jQuery.support.ajax ) { + + jQuery.ajaxTransport(function( s ) { + // Cross domain only allowed if supported through XMLHttpRequest + if ( !s.crossDomain || jQuery.support.cors ) { + + var callback; + + return { + send: function( headers, complete ) { + + // Get a new xhr + var handle, i, + xhr = s.xhr(); + + // Open the socket + // Passing null username, generates a login popup on Opera (#2865) + if ( s.username ) { + xhr.open( s.type, s.url, s.async, s.username, s.password ); + } else { + xhr.open( s.type, s.url, s.async ); + } + + // Apply custom fields if provided + if ( s.xhrFields ) { + for ( i in s.xhrFields ) { + xhr[ i ] = s.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( s.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( s.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !s.crossDomain && !headers["X-Requested-With"] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Need an extra try/catch for cross domain requests in Firefox 3 + try { + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + } catch( _ ) {} + + // Do send the request + // This may raise an exception which is actually + // handled in jQuery.ajax (so no try/catch here) + xhr.send( ( s.hasContent && s.data ) || null ); + + // Listener + callback = function( _, isAbort ) { + + var status, + statusText, + responseHeaders, + responses, + xml; + + // Firefox throws exceptions when accessing properties + // of an xhr when a network error occurred + // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) + try { + + // Was never called and is aborted or complete + if ( callback && ( isAbort || xhr.readyState === 4 ) ) { + + // Only called once + callback = undefined; + + // Do not keep as active anymore + if ( handle ) { + xhr.onreadystatechange = jQuery.noop; + if ( xhrOnUnloadAbort ) { + delete xhrCallbacks[ handle ]; + } + } + + // If it's an abort + if ( isAbort ) { + // Abort it manually if needed + if ( xhr.readyState !== 4 ) { + xhr.abort(); + } + } else { + status = xhr.status; + responseHeaders = xhr.getAllResponseHeaders(); + responses = {}; + xml = xhr.responseXML; + + // Construct response list + if ( xml && xml.documentElement /* #4958 */ ) { + responses.xml = xml; + } + + // When requesting binary data, IE6-9 will throw an exception + // on any attempt to access responseText (#11426) + try { + responses.text = xhr.responseText; + } catch( _ ) { + } + + // Firefox throws an exception when accessing + // statusText for faulty cross-domain requests + try { + statusText = xhr.statusText; + } catch( e ) { + // We normalize with Webkit giving an empty statusText + statusText = ""; + } + + // Filter status for non standard behaviors + + // If the request is local and we have data: assume a success + // (success with no data won't get notified, that's the best we + // can do given current implementations) + if ( !status && s.isLocal && !s.crossDomain ) { + status = responses.text ? 200 : 404; + // IE - #1450: sometimes returns 1223 when it should be 204 + } else if ( status === 1223 ) { + status = 204; + } + } + } + } catch( firefoxAccessException ) { + if ( !isAbort ) { + complete( -1, firefoxAccessException ); + } + } + + // Call complete if needed + if ( responses ) { + complete( status, statusText, responses, responseHeaders ); + } + }; + + if ( !s.async ) { + // if we're in sync mode we fire the callback + callback(); + } else if ( xhr.readyState === 4 ) { + // (IE6 & IE7) if it's in cache and has been + // retrieved directly we need to fire the callback + setTimeout( callback, 0 ); + } else { + handle = ++xhrId; + if ( xhrOnUnloadAbort ) { + // Create the active xhrs callbacks list if needed + // and attach the unload handler + if ( !xhrCallbacks ) { + xhrCallbacks = {}; + jQuery( window ).unload( xhrOnUnloadAbort ); + } + // Add to list of active xhrs callbacks + xhrCallbacks[ handle ] = callback; + } + xhr.onreadystatechange = callback; + } + }, + + abort: function() { + if ( callback ) { + callback(0,1); + } + } + }; + } + }); +} +var fxNow, timerId, + rfxtypes = /^(?:toggle|show|hide)$/, + rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), + rrun = /queueHooks$/, + animationPrefilters = [ defaultPrefilter ], + tweeners = { + "*": [function( prop, value ) { + var end, unit, + tween = this.createTween( prop, value ), + parts = rfxnum.exec( value ), + target = tween.cur(), + start = +target || 0, + scale = 1, + maxIterations = 20; + + if ( parts ) { + end = +parts[2]; + unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + + // We need to compute starting value + if ( unit !== "px" && start ) { + // Iteratively approximate from a nonzero starting point + // Prefer the current property, because this process will be trivial if it uses the same units + // Fallback to end or a simple constant + start = jQuery.css( tween.elem, prop, true ) || end || 1; + + do { + // If previous iteration zeroed out, double until we get *something* + // Use a string for doubling factor so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + start = start / scale; + jQuery.style( tween.elem, prop, start + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // And breaking the loop if scale is unchanged or perfect, or if we've just had enough + } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); + } + + tween.unit = unit; + tween.start = start; + // If a +=/-= token was provided, we're doing a relative animation + tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end; + } + return tween; + }] + }; + +// Animations created synchronously will run synchronously +function createFxNow() { + setTimeout(function() { + fxNow = undefined; + }, 0 ); + return ( fxNow = jQuery.now() ); +} + +function createTweens( animation, props ) { + jQuery.each( props, function( prop, value ) { + var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( collection[ index ].call( animation, prop, value ) ) { + + // we're done with this property + return; + } + } + }); +} + +function Animation( elem, properties, options ) { + var result, + index = 0, + tweenerIndex = 0, + length = animationPrefilters.length, + deferred = jQuery.Deferred().always( function() { + // don't match elem in the :animated selector + delete tick.elem; + }), + tick = function() { + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + percent = 1 - ( remaining / animation.duration || 0 ), + index = 0, + length = animation.tweens.length; + + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ]); + + if ( percent < 1 && length ) { + return remaining; + } else { + deferred.resolveWith( elem, [ animation ] ); + return false; + } + }, + animation = deferred.promise({ + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { specialEasing: {} }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end, easing ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + // if we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // resolve when we played the last frame + // otherwise, reject + if ( gotoEnd ) { + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + }), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length ; index++ ) { + result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + return result; + } + } + + createTweens( animation, props ); + + if ( jQuery.isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + jQuery.fx.timer( + jQuery.extend( tick, { + anim: animation, + queue: animation.opts.queue, + elem: elem + }) + ); + + // attach callbacks from options + return animation.progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = jQuery.camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( jQuery.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // not quite $.extend, this wont overwrite keys already present. + // also - reusing 'index' from above because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweener: function( props, callback ) { + if ( jQuery.isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.split(" "); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length ; index++ ) { + prop = props[ index ]; + tweeners[ prop ] = tweeners[ prop ] || []; + tweeners[ prop ].unshift( callback ); + } + }, + + prefilter: function( callback, prepend ) { + if ( prepend ) { + animationPrefilters.unshift( callback ); + } else { + animationPrefilters.push( callback ); + } + } +}); + +function defaultPrefilter( elem, props, opts ) { + var index, prop, value, length, dataShow, tween, hooks, oldfire, + anim = this, + style = elem.style, + orig = {}, + handled = [], + hidden = elem.nodeType && isHidden( elem ); + + // handle queue: false promises + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always(function() { + // doing this makes sure that the complete handler will be called + // before this completes + anim.always(function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + }); + }); + } + + // height/width overflow pass + if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { + // Make sure that nothing sneaks out + // Record all 3 overflow attributes because IE does not + // change the overflow attribute when overflowX and + // overflowY are set to the same value + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Set display property to inline-block for height/width + // animations on inline elements that are having width/height animated + if ( jQuery.css( elem, "display" ) === "inline" && + jQuery.css( elem, "float" ) === "none" ) { + + // inline-level elements accept inline-block; + // block-level elements need to be inline with layout + if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { + style.display = "inline-block"; + + } else { + style.zoom = 1; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + if ( !jQuery.support.shrinkWrapBlocks ) { + anim.done(function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + }); + } + } + + + // show/hide pass + for ( index in props ) { + value = props[ index ]; + if ( rfxtypes.exec( value ) ) { + delete props[ index ]; + if ( value === ( hidden ? "hide" : "show" ) ) { + continue; + } + handled.push( index ); + } + } + + length = handled.length; + if ( length ) { + dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} ); + if ( hidden ) { + jQuery( elem ).show(); + } else { + anim.done(function() { + jQuery( elem ).hide(); + }); + } + anim.done(function() { + var prop; + jQuery.removeData( elem, "fxshow", true ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + }); + for ( index = 0 ; index < length ; index++ ) { + prop = handled[ index ]; + tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 ); + orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop ); + + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = tween.start; + if ( hidden ) { + tween.end = tween.start; + tween.start = prop === "width" || prop === "height" ? 1 : 0; + } + } + } + } +} + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || "swing"; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + if ( tween.elem[ tween.prop ] != null && + (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { + return tween.elem[ tween.prop ]; + } + + // passing any value as a 4th parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails + // so, simple values such as "10px" are parsed to Float. + // complex values such as "rotate(1rad)" are returned as is. + result = jQuery.css( tween.elem, tween.prop, false, "" ); + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + // use step hook for back compat - use cssHook if its there - use .style if its + // available and use plain properties where available + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Remove in 2.0 - this supports IE8's panic based approach +// to setting things on disconnected nodes + +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" || + // special check for .toggle( handler, handler, ... ) + ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +}); + +jQuery.fn.extend({ + fadeTo: function( speed, to, easing, callback ) { + + // show any hidden elements after setting opacity to 0 + return this.filter( isHidden ).css( "opacity", 0 ).show() + + // animate to the value specified + .end().animate({ opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations resolve immediately + if ( empty ) { + anim.stop( true ); + } + }; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each(function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = jQuery._data( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // start the next in the queue if the last step wasn't forced + // timers currently will call their complete callbacks, which will dequeue + // but only if they were gotoEnd + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + }); + } +}); + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + attrs = { height: type }, + i = 0; + + // if we include width, step value is 1 to do all cssExpand values, + // if we don't include width, step value is 2 to skip over Left and Right + includeWidth = includeWidth? 1 : 0; + for( ; i < 4 ; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +// Generate shortcuts for custom animations +jQuery.each({ + slideDown: genFx("show"), + slideUp: genFx("hide"), + slideToggle: genFx("toggle"), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +}); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing + }; + + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : + opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; + + // normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p*Math.PI ) / 2; + } +}; + +jQuery.timers = []; +jQuery.fx = Tween.prototype.init; +jQuery.fx.tick = function() { + var timer, + timers = jQuery.timers, + i = 0; + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + // Checks the timer has not already been removed + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } +}; + +jQuery.fx.timer = function( timer ) { + if ( timer() && jQuery.timers.push( timer ) && !timerId ) { + timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); + } +}; + +jQuery.fx.interval = 13; + +jQuery.fx.stop = function() { + clearInterval( timerId ); + timerId = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + // Default speed + _default: 400 +}; + +// Back Compat <1.8 extension point +jQuery.fx.step = {}; + +if ( jQuery.expr && jQuery.expr.filters ) { + jQuery.expr.filters.animated = function( elem ) { + return jQuery.grep(jQuery.timers, function( fn ) { + return elem === fn.elem; + }).length; + }; +} +var rroot = /^(?:body|html)$/i; + +jQuery.fn.offset = function( options ) { + if ( arguments.length ) { + return options === undefined ? + this : + this.each(function( i ) { + jQuery.offset.setOffset( this, options, i ); + }); + } + + var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft, + box = { top: 0, left: 0 }, + elem = this[ 0 ], + doc = elem && elem.ownerDocument; + + if ( !doc ) { + return; + } + + if ( (body = doc.body) === elem ) { + return jQuery.offset.bodyOffset( elem ); + } + + docElem = doc.documentElement; + + // Make sure it's not a disconnected DOM node + if ( !jQuery.contains( docElem, elem ) ) { + return box; + } + + // If we don't have gBCR, just use 0,0 rather than error + // BlackBerry 5, iOS 3 (original iPhone) + if ( typeof elem.getBoundingClientRect !== "undefined" ) { + box = elem.getBoundingClientRect(); + } + win = getWindow( doc ); + clientTop = docElem.clientTop || body.clientTop || 0; + clientLeft = docElem.clientLeft || body.clientLeft || 0; + scrollTop = win.pageYOffset || docElem.scrollTop; + scrollLeft = win.pageXOffset || docElem.scrollLeft; + return { + top: box.top + scrollTop - clientTop, + left: box.left + scrollLeft - clientLeft + }; +}; + +jQuery.offset = { + + bodyOffset: function( body ) { + var top = body.offsetTop, + left = body.offsetLeft; + + if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) { + top += parseFloat( jQuery.css(body, "marginTop") ) || 0; + left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; + } + + return { top: top, left: left }; + }, + + setOffset: function( elem, options, i ) { + var position = jQuery.css( elem, "position" ); + + // set position first, in-case top/left are set even on static elem + if ( position === "static" ) { + elem.style.position = "relative"; + } + + var curElem = jQuery( elem ), + curOffset = curElem.offset(), + curCSSTop = jQuery.css( elem, "top" ), + curCSSLeft = jQuery.css( elem, "left" ), + calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, + props = {}, curPosition = {}, curTop, curLeft; + + // need to be able to calculate position if either top or left is auto and position is either absolute or fixed + if ( calculatePosition ) { + curPosition = curElem.position(); + curTop = curPosition.top; + curLeft = curPosition.left; + } else { + curTop = parseFloat( curCSSTop ) || 0; + curLeft = parseFloat( curCSSLeft ) || 0; + } + + if ( jQuery.isFunction( options ) ) { + options = options.call( elem, i, curOffset ); + } + + if ( options.top != null ) { + props.top = ( options.top - curOffset.top ) + curTop; + } + if ( options.left != null ) { + props.left = ( options.left - curOffset.left ) + curLeft; + } + + if ( "using" in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + } +}; + + +jQuery.fn.extend({ + + position: function() { + if ( !this[0] ) { + return; + } + + var elem = this[0], + + // Get *real* offsetParent + offsetParent = this.offsetParent(), + + // Get correct offsets + offset = this.offset(), + parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); + + // Subtract element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; + offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; + + // Add offsetParent borders + parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; + parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; + + // Subtract the two offsets + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + }; + }, + + offsetParent: function() { + return this.map(function() { + var offsetParent = this.offsetParent || document.body; + while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { + offsetParent = offsetParent.offsetParent; + } + return offsetParent || document.body; + }); + } +}); + + +// Create scrollLeft and scrollTop methods +jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { + var top = /Y/.test( prop ); + + jQuery.fn[ method ] = function( val ) { + return jQuery.access( this, function( elem, method, val ) { + var win = getWindow( elem ); + + if ( val === undefined ) { + return win ? (prop in win) ? win[ prop ] : + win.document.documentElement[ method ] : + elem[ method ]; + } + + if ( win ) { + win.scrollTo( + !top ? val : jQuery( win ).scrollLeft(), + top ? val : jQuery( win ).scrollTop() + ); + + } else { + elem[ method ] = val; + } + }, method, val, arguments.length, null ); + }; +}); + +function getWindow( elem ) { + return jQuery.isWindow( elem ) ? + elem : + elem.nodeType === 9 ? + elem.defaultView || elem.parentWindow : + false; +} +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { + // margin is only for outerHeight, outerWidth + jQuery.fn[ funcName ] = function( margin, value ) { + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); + + return jQuery.access( this, function( elem, type, value ) { + var doc; + + if ( jQuery.isWindow( elem ) ) { + // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there + // isn't a whole lot we can do. See pull request at this URL for discussion: + // https://github.com/jquery/jquery/pull/764 + return elem.document.documentElement[ "client" + name ]; + } + + // Get document width or height + if ( elem.nodeType === 9 ) { + doc = elem.documentElement; + + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest + // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. + return Math.max( + elem.body[ "scroll" + name ], doc[ "scroll" + name ], + elem.body[ "offset" + name ], doc[ "offset" + name ], + doc[ "client" + name ] + ); + } + + return value === undefined ? + // Get width or height on the element, requesting but not forcing parseFloat + jQuery.css( elem, type, value, extra ) : + + // Set width or height on the element + jQuery.style( elem, type, value, extra ); + }, type, chainable ? margin : undefined, chainable, null ); + }; + }); +}); +// Expose jQuery to the global object +window.jQuery = window.$ = jQuery; + +// Expose jQuery as an AMD module, but only for AMD loaders that +// understand the issues with loading multiple versions of jQuery +// in a page that all might call define(). The loader will indicate +// they have special allowances for multiple jQuery versions by +// specifying define.amd.jQuery = true. Register as a named module, +// since jQuery can be concatenated with other files that may use define, +// but not use a proper concatenation script that understands anonymous +// AMD modules. A named AMD is safest and most robust way to register. +// Lowercase jquery is used because AMD module names are derived from +// file names, and jQuery is normally delivered in a lowercase file name. +// Do this after creating the global so that if an AMD module wants to call +// noConflict to hide this version of jQuery, it will work. +if ( typeof define === "function" && define.amd && define.amd.jQuery ) { + define( "jquery", [], function () { return jQuery; } ); +} + +})( window ); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.min.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.min.js new file mode 100644 index 0000000000000000000000000000000000000000..f65cf1dc4573c51e54d7cf3772d06caf96726616 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/jquery/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v1.8.2 jquery.com | jquery.org/license */ +(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call(" ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/package.json b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/package.json new file mode 100644 index 0000000000000000000000000000000000000000..da965a1ff6bcf1998344dbe3fe62c56a18788426 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/package.json @@ -0,0 +1,42 @@ +{ + "name": "jquery.dynatree", + "title": "jQuery Dynatree Plugin", + "description": "Dynatree is a JavaScript dynamic tree view plugin for jQuery with support for persistence, keyboard, checkboxes, drag'n'drop, and lazy loading.", + "version": "1.2.5-rc4", + "homepage": "http://dynatree.googlecode.com/", + "author": { + "name": "Martin Wendt", + "url": "http://wwwendt.de/" + }, + "repository": { + "type": "svn", + "url": "http://dynatree.googlecode.com/svn/trunk/" + }, + "bugs": { + "url": "https://code.google.com/p/dynatree/issues/list" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://code.google.com/p/dynatree/wiki/LicenseInfo" + }, + { + "type": "GPL", + "url": "https://code.google.com/p/dynatree/wiki/LicenseInfo" + } + ], + "keywords": [], + "dependencies": {}, + "devDependencies": { + "grunt": "~0.4.1", + "grunt-contrib-jshint": "~0.4.0", + "grunt-contrib-concat": "~0.1.3", + "grunt-contrib-uglify": "~0.2.0", + "grunt-exec": "~0.4.0", + "grunt-contrib-connect": "~0.3.0", + "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-copy": "~0.4.1", + "grunt-text-replace": "~0.3.8", + "grunt-contrib-compress": "~0.5.2" + } +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/GPL-LICENSE.txt b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/GPL-LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..11dddd00ef0e91a0bce53b034d6b5b318a84e690 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/GPL-LICENSE.txt @@ -0,0 +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. diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/MIT-License.txt b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/MIT-License.txt new file mode 100644 index 0000000000000000000000000000000000000000..d70071be48003cc8a81c5936436b57359f14d141 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/MIT-License.txt @@ -0,0 +1,7 @@ +Copyright (c) 2006-2013 Martin Wendt (http://wwWendt.de) + +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. \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/jquery.dynatree.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/jquery.dynatree.js new file mode 100644 index 0000000000000000000000000000000000000000..521916d2247139504f7569c5752d031c45398ddc --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/jquery.dynatree.js @@ -0,0 +1,3450 @@ +/*! **************************************************************************** + jquery.dynatree.js + Dynamic tree view control, with support for lazy loading of branches. + + Copyright (c) 2006-2013, Martin Wendt (http://wwWendt.de) + Dual licensed under the MIT or GPL Version 2 licenses. + http://code.google.com/p/dynatree/wiki/LicenseInfo + + A current version and some documentation is available at + http://dynatree.googlecode.com/ + + @version: DEVELOPMENT + @date: DEVELOPMENT + + @depends: jquery.js + @depends: jquery.ui.core.js + @depends: jquery.cookie.js +*******************************************************************************/ + +/* jsHint options*/ +// Note: We currently allow eval() to parse the 'data' attribtes, when initializing from HTML. +// TODO: pass jsHint with the options given in grunt.js only. +// The following should not be required: +/*global alert */ +/*jshint nomen:false, smarttabs:true, eqeqeq:false, evil:true, regexp:false */ + +/************************************************************************* + * Debug functions + */ + +var _canLog = true; + +function _log(mode, msg) { + /** + * Usage: logMsg("%o was toggled", this); + */ + if( !_canLog ){ + return; + } + // Remove first argument + var args = Array.prototype.slice.apply(arguments, [1]); + // Prepend timestamp + var dt = new Date(); + var tag = dt.getHours() + ":" + dt.getMinutes() + ":" + + dt.getSeconds() + "." + dt.getMilliseconds(); + args[0] = tag + " - " + args[0]; + + try { + switch( mode ) { + case "info": + window.console.info.apply(window.console, args); + break; + case "warn": + window.console.warn.apply(window.console, args); + break; + default: + window.console.log.apply(window.console, args); + break; + } + } catch(e) { + if( !window.console ){ + _canLog = false; // Permanently disable, when logging is not supported by the browser + }else if(e.number === -2146827850){ + // fix for IE8, where window.console.log() exists, but does not support .apply() + window.console.log(args.join(", ")); + } + } +} + + +function logMsg(msg) { + Array.prototype.unshift.apply(arguments, ["debug"]); + _log.apply(this, arguments); +} + + +// Forward declaration +var getDynaTreePersistData = null; + + + +/************************************************************************* + * Constants + */ +var DTNodeStatus_Error = -1; +var DTNodeStatus_Loading = 1; +var DTNodeStatus_Ok = 0; + + +// Start of local namespace +(function($) { + +/************************************************************************* + * Common tool functions. + */ + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + }; + } +}; + +// Tool function to get dtnode from the event target: +function getDtNodeFromElement(el) { + alert("getDtNodeFromElement is deprecated"); + return $.ui.dynatree.getNode(el); +/* + var iMax = 5; + while( el && iMax-- ) { + if(el.dtnode) { return el.dtnode; } + el = el.parentNode; + } + return null; +*/ +} + +function noop() { +} + + +/* Convert number to string and prepend +/-; return empty string for 0.*/ +function offsetString(n){ + return n === 0 ? "" : (( n > 0 ) ? ("+" + n) : ("" + n)); +} + + +/* Check browser version, since $.browser was removed in jQuery 1.9 */ +function _checkBrowser(){ + var matched, browser; + function uaMatch( ua ) { + ua = ua.toLowerCase(); + var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || + /(webkit)[ \/]([\w.]+)/.exec( ua ) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || + /(msie) ([\w.]+)/.exec( ua ) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || + []; + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + } + matched = uaMatch( navigator.userAgent ); + browser = {}; + if ( matched.browser ) { + browser[ matched.browser ] = true; + browser.version = matched.version; + } + if ( browser.chrome ) { + browser.webkit = true; + } else if ( browser.webkit ) { + browser.safari = true; + } + return browser; +} + + +/** Compare two dotted version strings (like '10.2.3'). + * @returns {Integer} 0: v1 == v2, -1: v1 < v2, 1: v1 > v2 + */ +function versionCompare(v1, v2) { + var v1parts = ("" + v1).split("."), + v2parts = ("" + v2).split("."), + minLength = Math.min(v1parts.length, v2parts.length), + p1, p2, i; + // Compare tuple pair-by-pair. + for(i = 0; i < minLength; i++) { + // Convert to integer if possible, because "8" > "10". + p1 = parseInt(v1parts[i], 10); + p2 = parseInt(v2parts[i], 10); + if (isNaN(p1)){ p1 = v1parts[i]; } + if (isNaN(p2)){ p2 = v2parts[i]; } + if (p1 == p2) { + continue; + }else if (p1 > p2) { + return 1; + }else if (p1 < p2) { + return -1; + } + // one operand is NaN + return NaN; + } + // The longer tuple is always considered 'greater' + if (v1parts.length === v2parts.length) { + return 0; + } + return (v1parts.length < v2parts.length) ? -1 : 1; +} + + +//var BROWSER = jQuery.browser || _checkBrowser(); +var BROWSER = _checkBrowser(); // issue 440 +var jquerySupports = { + // http://jqueryui.com/upgrade-guide/1.9/#deprecated-offset-option-merged-into-my-and-at + positionMyOfs: versionCompare($.ui.version, "1.9") >= 0 //isVersionAtLeast($.ui.version, 1, 9) + }; + + +/************************************************************************* + * Class DynaTreeNode + */ +var DynaTreeNode = Class.create(); + +DynaTreeNode.prototype = { + initialize: function(parent, tree, data) { + /** + * @constructor + */ + this.parent = parent; + this.tree = tree; + if ( typeof data === "string" ){ + data = { title: data }; + } +// if( !data.key ){ + if( data.key == null ){ // test for null OR undefined (issue 420) + data.key = "_" + tree._nodeCount++; + }else{ + data.key = "" + data.key; // issue 371 + } + this.data = $.extend({}, $.ui.dynatree.nodedatadefaults, data); + this.li = null; // not yet created + this.span = null; // not yet created + this.ul = null; // not yet created + this.childList = null; // no subnodes yet + this._isLoading = false; // Lazy content is being loaded + this.hasSubSel = false; + this.bExpanded = false; + this.bSelected = false; + + }, + + toString: function() { + return "DynaTreeNode<" + this.data.key + ">: '" + this.data.title + "'"; + }, + + toDict: function(recursive, callback) { + var node, + dict = $.extend({}, this.data); + dict.activate = ( this.tree.activeNode === this ); + dict.focus = ( this.tree.focusNode === this ); + dict.expand = this.bExpanded; + dict.select = this.bSelected; + if( callback ){ + callback(dict); + } + if( recursive && this.childList ) { + dict.children = []; + for(var i=0, l=this.childList.length; i<l; i++ ){ + node = this.childList[i]; + if( !node.isStatusNode() ){ + dict.children.push(node.toDict(true, callback)); + } + } + } else { + delete dict.children; + } + return dict; + }, + + fromDict: function(dict) { + /** + * Update node data. If dict contains 'children', then also replace + * the hole sub tree. + */ + var children = dict.children; + if(children === undefined){ + this.data = $.extend(this.data, dict); + this.render(); + return; + } + dict = $.extend({}, dict); + dict.children = undefined; + this.data = $.extend(this.data, dict); + this.removeChildren(); + this.addChild(children); + }, + + _getInnerHtml: function() { + var tree = this.tree, + opts = tree.options, + cache = tree.cache, + level = this.getLevel(), + data = this.data, + res = "", + imageSrc; + // connector (expanded, expandable or simple) + if( level < opts.minExpandLevel ) { + if(level > 1){ + res += cache.tagConnector; + } + // .. else (i.e. for root level) skip expander/connector altogether + } else if( this.hasChildren() !== false ) { + res += cache.tagExpander; + } else { + res += cache.tagConnector; + } + // Checkbox mode + if( opts.checkbox && data.hideCheckbox !== true && !data.isStatusNode ) { + res += cache.tagCheckbox; + } + // folder or doctype icon + if ( data.icon ) { + if (data.icon.charAt(0) === "/"){ + imageSrc = data.icon; + }else{ + imageSrc = opts.imagePath + data.icon; + } + res += "<img src='" + imageSrc + "' alt='' />"; + } else if ( data.icon === false ) { + // icon == false means 'no icon' +// noop(); // keep JSLint happy + } else if ( data.iconClass ) { + res += "<span class='" + " " + data.iconClass + "'></span>"; + } else { + // icon == null means 'default icon' + res += cache.tagNodeIcon; + } + // node title + var nodeTitle = ""; + if ( opts.onCustomRender ){ + nodeTitle = opts.onCustomRender.call(tree, this) || ""; + } + if(!nodeTitle){ + var tooltip = data.tooltip ? ' title="' + data.tooltip.replace(/\"/g, '"') + '"' : '', + href = data.href || "#"; + if( opts.noLink || data.noLink ) { + nodeTitle = '<span style="display:inline-block;" class="' + opts.classNames.title + '"' + tooltip + '>' + data.title + '</span>'; +// this.tree.logDebug("nodeTitle: " + nodeTitle); + } else { + nodeTitle = '<a href="' + href + '" class="' + opts.classNames.title + '"' + tooltip + '>' + data.title + '</a>'; + } + } + res += nodeTitle; + return res; + }, + + + _fixOrder: function() { + /** + * Make sure, that <li> order matches childList order. + */ + var cl = this.childList; + if( !cl || !this.ul ){ + return; + } + var childLI = this.ul.firstChild; + for(var i=0, l=cl.length-1; i<l; i++) { + var childNode1 = cl[i]; + var childNode2 = childLI.dtnode; + if( childNode1 !== childNode2 ) { + this.tree.logDebug("_fixOrder: mismatch at index " + i + ": " + childNode1 + " != " + childNode2); + this.ul.insertBefore(childNode1.li, childNode2.li); + } else { + childLI = childLI.nextSibling; + } + } + }, + + + render: function(useEffects, includeInvisible) { + /** + * Create <li><span>..</span> .. </li> tags for this node. + * + * <li id='KEY' dtnode=NODE> // This div contains the node's span and list of child div's. + * <span class='title'>S S S A</span> // Span contains graphic spans and title <a> tag + * <ul> // only present, when node has children + * <li id='KEY' dtnode=NODE>child1</li> + * <li id='KEY' dtnode=NODE>child2</li> + * </ul> + * </li> + */ +// this.tree.logDebug("%s.render(%s)", this, useEffects); + // --- + var tree = this.tree, + parent = this.parent, + data = this.data, + opts = tree.options, + cn = opts.classNames, + isLastSib = this.isLastSibling(), + firstTime = false; + + if( !parent && !this.ul ) { + // Root node has only a <ul> + this.li = this.span = null; + this.ul = document.createElement("ul"); + if( opts.minExpandLevel > 1 ){ + this.ul.className = cn.container + " " + cn.noConnector; + }else{ + this.ul.className = cn.container; + } + } else if( parent ) { + // Create <li><span /> </li> + if( ! this.li ) { + firstTime = true; + this.li = document.createElement("li"); + this.li.dtnode = this; + if( data.key && opts.generateIds ){ + this.li.id = opts.idPrefix + data.key; + } + this.span = document.createElement("span"); + this.span.className = cn.title; + this.li.appendChild(this.span); + + if( !parent.ul ) { + // This is the parent's first child: create UL tag + // (Hidden, because it will be + parent.ul = document.createElement("ul"); + parent.ul.style.display = "none"; + parent.li.appendChild(parent.ul); +// if( opts.minExpandLevel > this.getLevel() ){ +// parent.ul.className = cn.noConnector; +// } + } + // set node connector images, links and text +// this.span.innerHTML = this._getInnerHtml(); + + parent.ul.appendChild(this.li); + } + // set node connector images, links and text + this.span.innerHTML = this._getInnerHtml(); + // Set classes for current status + var cnList = []; + cnList.push(cn.node); + if( data.isFolder ){ + cnList.push(cn.folder); + } + if( this.bExpanded ){ + cnList.push(cn.expanded); + } + if( this.hasChildren() !== false ){ + cnList.push(cn.hasChildren); + } + if( data.isLazy && this.childList === null ){ + cnList.push(cn.lazy); + } + if( isLastSib ){ + cnList.push(cn.lastsib); + } + if( this.bSelected ){ + cnList.push(cn.selected); + } + if( this.hasSubSel ){ + cnList.push(cn.partsel); + } + if( tree.activeNode === this ){ + cnList.push(cn.active); + } + if( data.addClass ){ + cnList.push(data.addClass); + } + // IE6 doesn't correctly evaluate multiple class names, + // so we create combined class names that can be used in the CSS + cnList.push(cn.combinedExpanderPrefix + + (this.bExpanded ? "e" : "c") + + (data.isLazy && this.childList === null ? "d" : "") + + (isLastSib ? "l" : "") + ); + cnList.push(cn.combinedIconPrefix + + (this.bExpanded ? "e" : "c") + + (data.isFolder ? "f" : "") + ); + this.span.className = cnList.join(" "); + + // TODO: we should not set this in the <span> tag also, if we set it here: + this.li.className = isLastSib ? cn.lastsib : ""; + + // Allow tweaking, binding, after node was created for the first time + if(firstTime && opts.onCreate){ + opts.onCreate.call(tree, this, this.span); + } + // Hide children, if node is collapsed +// this.ul.style.display = ( this.bExpanded || !parent ) ? "" : "none"; + // Allow tweaking after node state was rendered + if(opts.onRender){ + opts.onRender.call(tree, this, this.span); + } + } + // Visit child nodes + if( (this.bExpanded || includeInvisible === true) && this.childList ) { + for(var i=0, l=this.childList.length; i<l; i++) { + this.childList[i].render(false, includeInvisible); + } + // Make sure the tag order matches the child array + this._fixOrder(); + } + // Hide children, if node is collapsed + if( this.ul ) { + var isHidden = (this.ul.style.display === "none"); + var isExpanded = !!this.bExpanded; +// logMsg("isHidden:%s", isHidden); + if( useEffects && opts.fx && (isHidden === isExpanded) ) { + var duration = opts.fx.duration || 200; + $(this.ul).animate(opts.fx, duration); + } else { + this.ul.style.display = ( this.bExpanded || !parent ) ? "" : "none"; + } + } + }, + /** Return '/id1/id2/id3'. */ + getKeyPath: function(excludeSelf) { + var path = []; + this.visitParents(function(node){ + if(node.parent){ + path.unshift(node.data.key); + } + }, !excludeSelf); + return "/" + path.join(this.tree.options.keyPathSeparator); + }, + + getParent: function() { + return this.parent; + }, + + getChildren: function() { + if(this.hasChildren() === undefined){ + return undefined; // Lazy node: unloaded, currently loading, or load error + } + return this.childList; + }, + + /** Check if node has children (returns undefined, if not sure). */ + hasChildren: function() { + if(this.data.isLazy){ + if(this.childList === null || this.childList === undefined){ + // Not yet loaded + return undefined; + }else if(this.childList.length === 0){ + // Loaded, but response was empty + return false; + }else if(this.childList.length === 1 && this.childList[0].isStatusNode()){ + // Currently loading or load error + return undefined; + } + return true; + } + return !!this.childList; + }, + + isFirstSibling: function() { + var p = this.parent; + return !p || p.childList[0] === this; + }, + + isLastSibling: function() { + var p = this.parent; + return !p || p.childList[p.childList.length-1] === this; + }, + + isLoading: function() { + return !!this._isLoading; + }, + + getPrevSibling: function() { + if( !this.parent ){ + return null; + } + var ac = this.parent.childList; + for(var i=1, l=ac.length; i<l; i++){ // start with 1, so prev(first) = null + if( ac[i] === this ){ + return ac[i-1]; + } + } + return null; + }, + + getNextSibling: function() { + if( !this.parent ){ + return null; + } + var ac = this.parent.childList; + for(var i=0, l=ac.length-1; i<l; i++){ // up to length-2, so next(last) = null + if( ac[i] === this ){ + return ac[i+1]; + } + } + return null; + }, + + isStatusNode: function() { + return (this.data.isStatusNode === true); + }, + + isChildOf: function(otherNode) { + return (this.parent && this.parent === otherNode); + }, + + isDescendantOf: function(otherNode) { + if(!otherNode){ + return false; + } + var p = this.parent; + while( p ) { + if( p === otherNode ){ + return true; + } + p = p.parent; + } + return false; + }, + + countChildren: function() { + var cl = this.childList; + if( !cl ){ + return 0; + } + var n = cl.length; + for(var i=0, l=n; i<l; i++){ + var child = cl[i]; + n += child.countChildren(); + } + return n; + }, + + /**Sort child list by title. + * cmd: optional compare function. + * deep: optional: pass true to sort all descendant nodes. + */ + sortChildren: function(cmp, deep) { + var cl = this.childList; + if( !cl ){ + return; + } + cmp = cmp || function(a, b) { +// return a.data.title === b.data.title ? 0 : a.data.title > b.data.title ? 1 : -1; + var x = a.data.title.toLowerCase(), + y = b.data.title.toLowerCase(); + return x === y ? 0 : x > y ? 1 : -1; + }; + cl.sort(cmp); + if( deep ){ + for(var i=0, l=cl.length; i<l; i++){ + if( cl[i].childList ){ + cl[i].sortChildren(cmp, "$norender$"); + } + } + } + if( deep !== "$norender$" ){ + this.render(); + } + }, + + _setStatusNode: function(data) { + // Create, modify or remove the status child node (pass 'null', to remove it). + var firstChild = ( this.childList ? this.childList[0] : null ); + if( !data ) { + if ( firstChild && firstChild.isStatusNode()) { + try{ + // I've seen exceptions here with loadKeyPath... + if(this.ul){ + this.ul.removeChild(firstChild.li); + firstChild.li = null; // avoid leaks (issue 215) + } + }catch(e){} + if( this.childList.length === 1 ){ + this.childList = []; + }else{ + this.childList.shift(); + } + } + } else if ( firstChild ) { + data.isStatusNode = true; + data.key = "_statusNode"; + firstChild.data = data; + firstChild.render(); + } else { + data.isStatusNode = true; + data.key = "_statusNode"; + firstChild = this.addChild(data); + } + }, + + setLazyNodeStatus: function(lts, opts) { + var tooltip = (opts && opts.tooltip) ? opts.tooltip : null, + info = (opts && opts.info) ? " (" + opts.info + ")" : ""; + switch( lts ) { + case DTNodeStatus_Ok: + this._setStatusNode(null); + $(this.span).removeClass(this.tree.options.classNames.nodeLoading); + this._isLoading = false; +// this.render(); + if( this.tree.options.autoFocus ) { + if( this === this.tree.tnRoot && this.childList && this.childList.length > 0) { + // special case: using ajaxInit + this.childList[0].focus(); + } else { + this.focus(); + } + } + break; + case DTNodeStatus_Loading: + this._isLoading = true; + $(this.span).addClass(this.tree.options.classNames.nodeLoading); + // The root is hidden, so we set a temporary status child + if(!this.parent){ + this._setStatusNode({ + title: this.tree.options.strings.loading + info, + tooltip: tooltip, + addClass: this.tree.options.classNames.nodeWait + }); + } + break; + case DTNodeStatus_Error: + this._isLoading = false; +// $(this.span).addClass(this.tree.options.classNames.nodeError); + this._setStatusNode({ + title: this.tree.options.strings.loadError + info, + tooltip: tooltip, + addClass: this.tree.options.classNames.nodeError + }); + break; + default: + throw "Bad LazyNodeStatus: '" + lts + "'."; + } + }, + + _parentList: function(includeRoot, includeSelf) { + var l = []; + var dtn = includeSelf ? this : this.parent; + while( dtn ) { + if( includeRoot || dtn.parent ){ + l.unshift(dtn); + } + dtn = dtn.parent; + } + return l; + }, + getLevel: function() { + /** + * Return node depth. 0: System root node, 1: visible top-level node. + */ + var level = 0; + var dtn = this.parent; + while( dtn ) { + level++; + dtn = dtn.parent; + } + return level; + }, + + _getTypeForOuterNodeEvent: function(event) { + /** Return the inner node span (title, checkbox or expander) if + * event.target points to the outer span. + * This function should fix issue #93: + * FF2 ignores empty spans, when generating events (returning the parent instead). + */ + var cns = this.tree.options.classNames; + var target = event.target; + // Only process clicks on an outer node span (probably due to a FF2 event handling bug) + if( target.className.indexOf(cns.node) < 0 ) { + return null; + } + // Event coordinates, relative to outer node span: + var eventX = event.pageX - target.offsetLeft; + var eventY = event.pageY - target.offsetTop; + + for(var i=0, l=target.childNodes.length; i<l; i++) { + var cn = target.childNodes[i]; + var x = cn.offsetLeft - target.offsetLeft; + var y = cn.offsetTop - target.offsetTop; + var nx = cn.clientWidth, ny = cn.clientHeight; +// alert (cn.className + ": " + x + ", " + y + ", s:" + nx + ", " + ny); + if( eventX >= x && eventX <= (x+nx) && eventY >= y && eventY <= (y+ny) ) { +// alert("HIT "+ cn.className); + if( cn.className==cns.title ){ + return "title"; + }else if( cn.className==cns.expander ){ + return "expander"; + }else if( cn.className==cns.checkbox ){ + return "checkbox"; + }else if( cn.className==cns.nodeIcon ){ + return "icon"; + } + } + } + return "prefix"; + }, + + getEventTargetType: function(event) { + // Return the part of a node, that a click event occured on. + // Note: there is no check, if the event was fired on THIS node. + var tcn = event && event.target ? event.target.className : "", + cns = this.tree.options.classNames; + + if( tcn.indexOf(cns.title) >= 0 ){ + return "title"; + }else if( tcn.indexOf(cns.expander) >= 0 ){ + return "expander"; + }else if( tcn.indexOf(cns.checkbox) >= 0 ){ + return "checkbox"; + }else if( tcn.indexOf(cns.nodeIcon) >= 0 ){ + return "icon"; + }else if( tcn.indexOf(cns.empty) >= 0 || tcn.indexOf(cns.vline) >= 0 || tcn.indexOf(cns.connector) >= 0 ){ + return "prefix"; + }else if( tcn.indexOf(cns.node) >= 0 ){ + // FIX issue #93 + return this._getTypeForOuterNodeEvent(event); + } + return null; + }, + + isVisible: function() { + // Return true, if all parents are expanded. + var parents = this._parentList(true, false); + for(var i=0, l=parents.length; i<l; i++){ + if( ! parents[i].bExpanded ){ return false; } + } + return true; + }, + + makeVisible: function() { + // Make sure, all parents are expanded + var parents = this._parentList(true, false); + for(var i=0, l=parents.length; i<l; i++){ + parents[i]._expand(true); + } + }, + + focus: function() { + // TODO: check, if we already have focus +// this.tree.logDebug("dtnode.focus(): %o", this); + this.makeVisible(); + try { + $(this.span).find(">a").focus(); + } catch(e) { } + }, + + isFocused: function() { + return (this.tree.tnFocused === this); + }, + + _activate: function(flag, fireEvents) { + // (De)Activate - but not focus - this node. + this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o", flag, fireEvents, this); + var opts = this.tree.options; + if( this.data.isStatusNode ){ + return; + } + if ( fireEvents && opts.onQueryActivate && opts.onQueryActivate.call(this.tree, flag, this) === false ){ + return; // Callback returned false + } + if( flag ) { + // Activate + if( this.tree.activeNode ) { + if( this.tree.activeNode === this ){ + return; + } + this.tree.activeNode.deactivate(); + } + if( opts.activeVisible ){ + this.makeVisible(); + } + this.tree.activeNode = this; + if( opts.persist ){ + $.cookie(opts.cookieId + "-active", this.data.key, opts.cookie); + } + this.tree.persistence.activeKey = this.data.key; + $(this.span).addClass(opts.classNames.active); + if ( fireEvents && opts.onActivate ){ + opts.onActivate.call(this.tree, this); + } + } else { + // Deactivate + if( this.tree.activeNode === this ) { + if ( opts.onQueryActivate && opts.onQueryActivate.call(this.tree, false, this) === false ){ + return; // Callback returned false + } + $(this.span).removeClass(opts.classNames.active); + if( opts.persist ) { + // Note: we don't pass null, but ''. So the cookie is not deleted. + // If we pass null, we also have to pass a COPY of opts, because $cookie will override opts.expires (issue 84) + $.cookie(opts.cookieId + "-active", "", opts.cookie); + } + this.tree.persistence.activeKey = null; + this.tree.activeNode = null; + if ( fireEvents && opts.onDeactivate ){ + opts.onDeactivate.call(this.tree, this); + } + } + } + }, + + activate: function() { + // Select - but not focus - this node. +// this.tree.logDebug("dtnode.activate(): %o", this); + this._activate(true, true); + }, + + activateSilently: function() { + this._activate(true, false); + }, + + deactivate: function() { +// this.tree.logDebug("dtnode.deactivate(): %o", this); + this._activate(false, true); + }, + + isActive: function() { + return (this.tree.activeNode === this); + }, + + _userActivate: function() { + // Handle user click / [space] / [enter], according to clickFolderMode. + var activate = true; + var expand = false; + if ( this.data.isFolder ) { + switch( this.tree.options.clickFolderMode ) { + case 2: + activate = false; + expand = true; + break; + case 3: + activate = expand = true; + break; + } + } + if( this.parent === null ) { + expand = false; + } + if( expand ) { + this.toggleExpand(); + this.focus(); + } + if( activate ) { + this.activate(); + } + }, + + _setSubSel: function(hasSubSel) { + if( hasSubSel ) { + this.hasSubSel = true; + $(this.span).addClass(this.tree.options.classNames.partsel); + } else { + this.hasSubSel = false; + $(this.span).removeClass(this.tree.options.classNames.partsel); + } + }, + /** + * Fix selection and partsel status, of parent nodes, according to current status of + * end nodes. + */ + _updatePartSelectionState: function() { +// alert("_updatePartSelectionState " + this); +// this.tree.logDebug("_updatePartSelectionState() - %o", this); + var sel; + // Return `true` or `false` for end nodes and remove part-sel flag + if( ! this.hasChildren() ){ + sel = (this.bSelected && !this.data.unselectable && !this.data.isStatusNode); + this._setSubSel(false); + return sel; + } + // Return `true`, `false`, or `undefined` for parent nodes + var i, l, + cl = this.childList, + allSelected = true, + allDeselected = true; + for(i=0, l=cl.length; i<l; i++) { + var n = cl[i], + s = n._updatePartSelectionState(); + if( s !== false){ + allDeselected = false; + } + if( s !== true){ + allSelected = false; + } + } + if( allSelected ){ + sel = true; + } else if ( allDeselected ){ + sel = false; + } else { + sel = undefined; + } + this._setSubSel(sel === undefined); + this.bSelected = (sel === true); + return sel; + }, + + /** + * Fix selection status, after this node was (de)selected in multi-hier mode. + * This includes (de)selecting all children. + */ + _fixSelectionState: function() { +// alert("_fixSelectionState " + this); +// this.tree.logDebug("_fixSelectionState(%s) - %o", this.bSelected, this); + var p, i, l; + if( this.bSelected ) { + // Select all children + this.visit(function(node){ + node.parent._setSubSel(true); + if(!node.data.unselectable){ + node._select(true, false, false); + } + }); + // Select parents, if all children are selected + p = this.parent; + while( p ) { + p._setSubSel(true); + var allChildsSelected = true; + for(i=0, l=p.childList.length; i<l; i++) { + var n = p.childList[i]; + if( !n.bSelected && !n.data.isStatusNode && !n.data.unselectable) { + // issue 305 proposes this: +// if( !n.bSelected && !n.data.isStatusNode ) { + allChildsSelected = false; + break; + } + } + if( allChildsSelected ){ + p._select(true, false, false); + } + p = p.parent; + } + } else { + // Deselect all children + this._setSubSel(false); + this.visit(function(node){ + node._setSubSel(false); + node._select(false, false, false); + }); + // Deselect parents, and recalc hasSubSel + p = this.parent; + while( p ) { + p._select(false, false, false); + var isPartSel = false; + for(i=0, l=p.childList.length; i<l; i++) { + if( p.childList[i].bSelected || p.childList[i].hasSubSel ) { + isPartSel = true; + break; + } + } + p._setSubSel(isPartSel); + p = p.parent; + } + } + }, + + _select: function(sel, fireEvents, deep) { + // Select - but not focus - this node. +// this.tree.logDebug("dtnode._select(%o) - %o", sel, this); + var opts = this.tree.options; + if( this.data.isStatusNode ){ + return; + } + // + if( this.bSelected === sel ) { +// this.tree.logDebug("dtnode._select(%o) IGNORED - %o", sel, this); + return; + } + // Allow event listener to abort selection + if ( fireEvents && opts.onQuerySelect && opts.onQuerySelect.call(this.tree, sel, this) === false ){ + return; // Callback returned false + } + // Force single-selection + if( opts.selectMode==1 && sel ) { + this.tree.visit(function(node){ + if( node.bSelected ) { + // Deselect; assuming that in selectMode:1 there's max. one other selected node + node._select(false, false, false); + return false; + } + }); + } + + this.bSelected = sel; +// this.tree._changeNodeList("select", this, sel); + + if( sel ) { + if( opts.persist ){ + this.tree.persistence.addSelect(this.data.key); + } + $(this.span).addClass(opts.classNames.selected); + + if( deep && opts.selectMode === 3 ){ + this._fixSelectionState(); + } + if ( fireEvents && opts.onSelect ){ + opts.onSelect.call(this.tree, true, this); + } + } else { + if( opts.persist ){ + this.tree.persistence.clearSelect(this.data.key); + } + $(this.span).removeClass(opts.classNames.selected); + + if( deep && opts.selectMode === 3 ){ + this._fixSelectionState(); + } + if ( fireEvents && opts.onSelect ){ + opts.onSelect.call(this.tree, false, this); + } + } + }, + + select: function(sel) { + // Select - but not focus - this node. +// this.tree.logDebug("dtnode.select(%o) - %o", sel, this); + if( this.data.unselectable ){ + return this.bSelected; + } + return this._select(sel!==false, true, true); + }, + + toggleSelect: function() { +// this.tree.logDebug("dtnode.toggleSelect() - %o", this); + return this.select(!this.bSelected); + }, + + isSelected: function() { + return this.bSelected; + }, + + isLazy: function() { + return !!this.data.isLazy; + }, + + _loadContent: function() { + try { + var opts = this.tree.options; + this.tree.logDebug("_loadContent: start - %o", this); + this.setLazyNodeStatus(DTNodeStatus_Loading); + if( true === opts.onLazyRead.call(this.tree, this) ) { + // If function returns 'true', we assume that the loading is done: + this.setLazyNodeStatus(DTNodeStatus_Ok); + // Otherwise (i.e. if the loading was started as an asynchronous process) + // the onLazyRead(dtnode) handler is expected to call dtnode.setLazyNodeStatus(DTNodeStatus_Ok/_Error) when done. + this.tree.logDebug("_loadContent: succeeded - %o", this); + } + } catch(e) { + this.tree.logWarning("_loadContent: failed - %o", e); + this.setLazyNodeStatus(DTNodeStatus_Error, {tooltip: ""+e}); + } + }, + + _expand: function(bExpand, forceSync) { + if( this.bExpanded === bExpand ) { + this.tree.logDebug("dtnode._expand(%o) IGNORED - %o", bExpand, this); + return; + } + this.tree.logDebug("dtnode._expand(%o) - %o", bExpand, this); + var opts = this.tree.options; + if( !bExpand && this.getLevel() < opts.minExpandLevel ) { + this.tree.logDebug("dtnode._expand(%o) prevented collapse - %o", bExpand, this); + return; + } + if ( opts.onQueryExpand && opts.onQueryExpand.call(this.tree, bExpand, this) === false ){ + return; // Callback returned false + } + this.bExpanded = bExpand; + + // Persist expand state + if( opts.persist ) { + if( bExpand ){ + this.tree.persistence.addExpand(this.data.key); + }else{ + this.tree.persistence.clearExpand(this.data.key); + } + } + // Do not apply animations in init phase, or before lazy-loading + var allowEffects = !(this.data.isLazy && this.childList === null) + && !this._isLoading + && !forceSync; + this.render(allowEffects); + + // Auto-collapse mode: collapse all siblings + if( this.bExpanded && this.parent && opts.autoCollapse ) { + var parents = this._parentList(false, true); + for(var i=0, l=parents.length; i<l; i++){ + parents[i].collapseSiblings(); + } + } + // If the currently active node is now hidden, deactivate it + if( opts.activeVisible && this.tree.activeNode && ! this.tree.activeNode.isVisible() ) { + this.tree.activeNode.deactivate(); + } + // Expanding a lazy node: set 'loading...' and call callback + if( bExpand && this.data.isLazy && this.childList === null && !this._isLoading ) { + this._loadContent(); + return; + } + if ( opts.onExpand ){ + opts.onExpand.call(this.tree, bExpand, this); + } + }, + + isExpanded: function() { + return this.bExpanded; + }, + + expand: function(flag) { + flag = (flag !== false); + if( !this.childList && !this.data.isLazy && flag ){ + return; // Prevent expanding empty nodes + } else if( this.parent === null && !flag ){ + return; // Prevent collapsing the root + } + this._expand(flag); + }, + + scheduleAction: function(mode, ms) { + /** Schedule activity for delayed execution (cancel any pending request). + * scheduleAction('cancel') will cancel the request. + */ + if( this.tree.timer ) { + clearTimeout(this.tree.timer); + this.tree.logDebug("clearTimeout(%o)", this.tree.timer); + } + var self = this; // required for closures + switch (mode) { + case "cancel": + // Simply made sure that timer was cleared + break; + case "expand": + this.tree.timer = setTimeout(function(){ + self.tree.logDebug("setTimeout: trigger expand"); + self.expand(true); + }, ms); + break; + case "activate": + this.tree.timer = setTimeout(function(){ + self.tree.logDebug("setTimeout: trigger activate"); + self.activate(); + }, ms); + break; + default: + throw "Invalid mode " + mode; + } + this.tree.logDebug("setTimeout(%s, %s): %s", mode, ms, this.tree.timer); + }, + + toggleExpand: function() { + this.expand(!this.bExpanded); + }, + + collapseSiblings: function() { + if( this.parent === null ){ + return; + } + var ac = this.parent.childList; + for (var i=0, l=ac.length; i<l; i++) { + if ( ac[i] !== this && ac[i].bExpanded ){ + ac[i]._expand(false); + } + } + }, + + _onClick: function(event) { +// this.tree.logDebug("dtnode.onClick(" + event.type + "): dtnode:" + this + ", button:" + event.button + ", which: " + event.which); + var targetType = this.getEventTargetType(event); + if( targetType === "expander" ) { + // Clicking the expander icon always expands/collapses + this.toggleExpand(); + this.focus(); // issue 95 + } else if( targetType === "checkbox" ) { + // Clicking the checkbox always (de)selects + this.toggleSelect(); + this.focus(); // issue 95 + } else { + this._userActivate(); + var aTag = this.span.getElementsByTagName("a"); + if(aTag[0]){ + // issue 154, 313 + if(!(BROWSER.msie && parseInt(BROWSER.version, 10) < 9)){ + aTag[0].focus(); + } + }else{ + // 'noLink' option was set + return true; + } + } + // Make sure that clicks stop, otherwise <a href='#'> jumps to the top + event.preventDefault(); + }, + + _onDblClick: function(event) { +// this.tree.logDebug("dtnode.onDblClick(" + event.type + "): dtnode:" + this + ", button:" + event.button + ", which: " + event.which); + }, + + _onKeydown: function(event) { +// this.tree.logDebug("dtnode.onKeydown(" + event.type + "): dtnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which); + var handled = true, + sib; +// alert("keyDown" + event.which); + + switch( event.which ) { + // charCodes: +// case 43: // '+' + case 107: // '+' + case 187: // '+' @ Chrome, Safari + if( !this.bExpanded ){ this.toggleExpand(); } + break; +// case 45: // '-' + case 109: // '-' + case 189: // '+' @ Chrome, Safari + if( this.bExpanded ){ this.toggleExpand(); } + break; + //~ case 42: // '*' + //~ break; + //~ case 47: // '/' + //~ break; + // case 13: // <enter> + // <enter> on a focused <a> tag seems to generate a click-event. + // this._userActivate(); + // break; + case 32: // <space> + this._userActivate(); + break; + case 8: // <backspace> + if( this.parent ){ + this.parent.focus(); + } + break; + case 37: // <left> + if( this.bExpanded ) { + this.toggleExpand(); + this.focus(); +// } else if( this.parent && (this.tree.options.rootVisible || this.parent.parent) ) { + } else if( this.parent && this.parent.parent ) { + this.parent.focus(); + } + break; + case 39: // <right> + if( !this.bExpanded && (this.childList || this.data.isLazy) ) { + this.toggleExpand(); + this.focus(); + } else if( this.childList ) { + this.childList[0].focus(); + } + break; + case 38: // <up> + sib = this.getPrevSibling(); + while( sib && sib.bExpanded && sib.childList ){ + sib = sib.childList[sib.childList.length-1]; + } +// if( !sib && this.parent && (this.tree.options.rootVisible || this.parent.parent) ) + if( !sib && this.parent && this.parent.parent ){ + sib = this.parent; + } + if( sib ){ + sib.focus(); + } + break; + case 40: // <down> + if( this.bExpanded && this.childList ) { + sib = this.childList[0]; + } else { + var parents = this._parentList(false, true); + for(var i=parents.length-1; i>=0; i--) { + sib = parents[i].getNextSibling(); + if( sib ){ break; } + } + } + if( sib ){ + sib.focus(); + } + break; + default: + handled = false; + } + // Return false, if handled, to prevent default processing +// return !handled; + if(handled){ + event.preventDefault(); + } + }, + + _onKeypress: function(event) { + // onKeypress is only hooked to allow user callbacks. + // We don't process it, because IE and Safari don't fire keypress for cursor keys. +// this.tree.logDebug("dtnode.onKeypress(" + event.type + "): dtnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which); + }, + + _onFocus: function(event) { + // Handles blur and focus events. +// this.tree.logDebug("dtnode._onFocus(%o): %o", event, this); + var opts = this.tree.options; + if ( event.type == "blur" || event.type == "focusout" ) { + if ( opts.onBlur ){ + opts.onBlur.call(this.tree, this); + } + if( this.tree.tnFocused ){ + $(this.tree.tnFocused.span).removeClass(opts.classNames.focused); + } + this.tree.tnFocused = null; + if( opts.persist ){ + $.cookie(opts.cookieId + "-focus", "", opts.cookie); + } + } else if ( event.type=="focus" || event.type=="focusin") { + // Fix: sometimes the blur event is not generated + if( this.tree.tnFocused && this.tree.tnFocused !== this ) { + this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o", this.tree.tnFocused); + $(this.tree.tnFocused.span).removeClass(opts.classNames.focused); + } + this.tree.tnFocused = this; + if ( opts.onFocus ){ + opts.onFocus.call(this.tree, this); + } + $(this.tree.tnFocused.span).addClass(opts.classNames.focused); + if( opts.persist ){ + $.cookie(opts.cookieId + "-focus", this.data.key, opts.cookie); + } + } + // TODO: return anything? +// return false; + }, + + visit: function(fn, includeSelf) { + // Call fn(node) for all child nodes. Stop iteration, if fn() returns false. + var res = true; + if( includeSelf === true ) { + res = fn(this); + if( res === false || res === "skip" ){ + return res; + } + } + if(this.childList){ + for(var i=0, l=this.childList.length; i<l; i++){ + res = this.childList[i].visit(fn, true); + if( res === false ){ + break; + } + } + } + return res; + }, + + visitParents: function(fn, includeSelf) { + // Visit parent nodes (bottom up) + if(includeSelf && fn(this) === false){ + return false; + } + var p = this.parent; + while( p ) { + if(fn(p) === false){ + return false; + } + p = p.parent; + } + return true; + }, + + remove: function() { + // Remove this node +// this.tree.logDebug ("%s.remove()", this); + if ( this === this.tree.root ){ + throw "Cannot remove system root"; + } + return this.parent.removeChild(this); + }, + + removeChild: function(tn) { + // Remove tn from list of direct children. + var ac = this.childList; + if( ac.length === 1 ) { + if( tn !== ac[0] ){ + throw "removeChild: invalid child"; + } + return this.removeChildren(); + } + if( tn === this.tree.activeNode ){ + tn.deactivate(); + } + if( this.tree.options.persist ) { + if( tn.bSelected ){ + this.tree.persistence.clearSelect(tn.data.key); + } + if ( tn.bExpanded ){ + this.tree.persistence.clearExpand(tn.data.key); + } + } + tn.removeChildren(true); + if(this.ul && tn.li ){ +// $("li", $(this.ul)).remove(); // issue 399 + this.ul.removeChild(tn.li); // issue 402 + } + for(var i=0, l=ac.length; i<l; i++) { + if( ac[i] === tn ) { + this.childList.splice(i, 1); +// delete tn; // JSLint complained + break; + } + } + }, + + removeChildren: function(isRecursiveCall, retainPersistence) { + // Remove all child nodes (more efficiently than recursive remove()) + this.tree.logDebug("%s.removeChildren(%o)", this, isRecursiveCall); + var tree = this.tree; + var ac = this.childList; + if( ac ) { + for(var i=0, l=ac.length; i<l; i++) { + var tn = ac[i]; + if ( tn === tree.activeNode && !retainPersistence ){ + tn.deactivate(); + } + if( this.tree.options.persist && !retainPersistence ) { + if( tn.bSelected ){ + this.tree.persistence.clearSelect(tn.data.key); + } + if ( tn.bExpanded ){ + this.tree.persistence.clearExpand(tn.data.key); + } + } + tn.removeChildren(true, retainPersistence); + if(this.ul && tn.li){ +// this.ul.removeChild(tn.li); + $("li", $(this.ul)).remove(); // issue 231 + } +// delete tn; JSLint complained + } + // Set to 'null' which is interpreted as 'not yet loaded' for lazy + // nodes + this.childList = null; + } + if( ! isRecursiveCall ) { +// this._expand(false); +// this.isRead = false; + this._isLoading = false; + this.render(); + } + }, + + setTitle: function(title) { + this.fromDict({title: title}); + }, + + reload: function(force) { + throw "Use reloadChildren() instead"; + }, + + reloadChildren: function(callback) { + // Reload lazy content (expansion state is maintained). + if( this.parent === null ){ + throw "Use tree.reload() instead"; + }else if( ! this.data.isLazy ){ + throw "node.reloadChildren() requires lazy nodes."; + } + // appendAjax triggers 'nodeLoaded' event. + // We listen to this, if a callback was passed to reloadChildren + if(callback){ + var self = this; + var eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id") + + "." + this.data.key; + this.tree.$tree.bind(eventType, function(e, node, isOk){ + self.tree.$tree.unbind(eventType); + self.tree.logDebug("loaded %o, %o, %o", e, node, isOk); + if(node !== self){ + throw "got invalid load event"; + } + callback.call(self.tree, node, isOk); + }); + } + // The expansion state is maintained + this.removeChildren(); + this._loadContent(); +// if( this.bExpanded ) { +// // Remove children first, to prevent effects being applied +// this.removeChildren(); +// // then force re-expand to trigger lazy loading +//// this.expand(false); +//// this.expand(true); +// this._loadContent(); +// } else { +// this.removeChildren(); +// this._loadContent(); +// } + }, + + /** + * Make sure the node with a given key path is available in the tree. + */ + _loadKeyPath: function(keyPath, callback) { + var tree = this.tree; + tree.logDebug("%s._loadKeyPath(%s)", this, keyPath); + if(keyPath === ""){ + throw "Key path must not be empty"; + } + var segList = keyPath.split(tree.options.keyPathSeparator); + if(segList[0] === ""){ + throw "Key path must be relative (don't start with '/')"; + } + var seg = segList.shift(); + if(this.childList){ + for(var i=0, l=this.childList.length; i < l; i++){ + var child = this.childList[i]; + if( child.data.key === seg ){ + if(segList.length === 0) { + // Found the end node + callback.call(tree, child, "ok"); + + }else if(child.data.isLazy && (child.childList === null || child.childList === undefined)){ + tree.logDebug("%s._loadKeyPath(%s) -> reloading %s...", this, keyPath, child); + var self = this; + // Note: this line gives a JSLint warning (Don't make functions within a loop) + /*jshint loopfunc:true */ + child.reloadChildren(function(node, isOk){ + // After loading, look for direct child with that key + if(isOk){ + tree.logDebug("%s._loadKeyPath(%s) -> reloaded %s.", node, keyPath, node); + callback.call(tree, child, "loaded"); + node._loadKeyPath(segList.join(tree.options.keyPathSeparator), callback); + }else{ + tree.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.", self, keyPath); + callback.call(tree, child, "error"); + } + }); + // we can ignore it, since it will only be exectuted once, the the loop is ended + // See also http://stackoverflow.com/questions/3037598/how-to-get-around-the-jslint-error-dont-make-functions-within-a-loop + } else { + callback.call(tree, child, "loaded"); + // Look for direct child with that key + child._loadKeyPath(segList.join(tree.options.keyPathSeparator), callback); + } + return; + } + } + } + // Could not find key + // Callback params: child: undefined, the segment, isEndNode (segList.length === 0) + callback.call(tree, undefined, "notfound", seg, segList.length === 0); + tree.logWarning("Node not found: " + seg); + return; + }, + + resetLazy: function() { + // Discard lazy content. + if( this.parent === null ){ + throw "Use tree.reload() instead"; + }else if( ! this.data.isLazy ){ + throw "node.resetLazy() requires lazy nodes."; + } + this.expand(false); + this.removeChildren(); + }, + + _addChildNode: function(dtnode, beforeNode) { + /** + * Internal function to add one single DynatreeNode as a child. + * + */ + var tree = this.tree, + opts = tree.options, + pers = tree.persistence; + +// tree.logDebug("%s._addChildNode(%o)", this, dtnode); + + // --- Update and fix dtnode attributes if necessary + dtnode.parent = this; +// if( beforeNode && (beforeNode.parent !== this || beforeNode === dtnode ) ) +// throw "<beforeNode> must be another child of <this>"; + + // --- Add dtnode as a child + if ( this.childList === null ) { + this.childList = []; + } else if( ! beforeNode ) { + // Fix 'lastsib' + if(this.childList.length > 0) { + $(this.childList[this.childList.length-1].span).removeClass(opts.classNames.lastsib); + } + } + if( beforeNode ) { + var iBefore = $.inArray(beforeNode, this.childList); + if( iBefore < 0 ){ + throw "<beforeNode> must be a child of <this>"; + } + this.childList.splice(iBefore, 0, dtnode); + } else { + // Append node + this.childList.push(dtnode); + } + + // --- Handle persistence + // Initial status is read from cookies, if persistence is active and + // cookies are already present. + // Otherwise the status is read from the data attributes and then persisted. + var isInitializing = tree.isInitializing(); + if( opts.persist && pers.cookiesFound && isInitializing ) { + // Init status from cookies +// tree.logDebug("init from cookie, pa=%o, dk=%o", pers.activeKey, dtnode.data.key); + if( pers.activeKey === dtnode.data.key ){ + tree.activeNode = dtnode; + } + if( pers.focusedKey === dtnode.data.key ){ + tree.focusNode = dtnode; + } + dtnode.bExpanded = ($.inArray(dtnode.data.key, pers.expandedKeyList) >= 0); + dtnode.bSelected = ($.inArray(dtnode.data.key, pers.selectedKeyList) >= 0); +// tree.logDebug(" key=%o, bSelected=%o", dtnode.data.key, dtnode.bSelected); + } else { + // Init status from data (Note: we write the cookies after the init phase) +// tree.logDebug("init from data"); + if( dtnode.data.activate ) { + tree.activeNode = dtnode; + if( opts.persist ){ + pers.activeKey = dtnode.data.key; + } + } + if( dtnode.data.focus ) { + tree.focusNode = dtnode; + if( opts.persist ){ + pers.focusedKey = dtnode.data.key; + } + } + dtnode.bExpanded = ( dtnode.data.expand === true ); // Collapsed by default + if( dtnode.bExpanded && opts.persist ){ + pers.addExpand(dtnode.data.key); + } + dtnode.bSelected = ( dtnode.data.select === true ); // Deselected by default +/* + Doesn't work, cause pers.selectedKeyList may be null + if( dtnode.bSelected && opts.selectMode==1 + && pers.selectedKeyList && pers.selectedKeyList.length>0 ) { + tree.logWarning("Ignored multi-selection in single-mode for %o", dtnode); + dtnode.bSelected = false; // Fixing bad input data (multi selection for mode:1) + } +*/ + if( dtnode.bSelected && opts.persist ){ + pers.addSelect(dtnode.data.key); + } + } + + // Always expand, if it's below minExpandLevel +// tree.logDebug ("%s._addChildNode(%o), l=%o", this, dtnode, dtnode.getLevel()); + if ( opts.minExpandLevel >= dtnode.getLevel() ) { +// tree.logDebug ("Force expand for %o", dtnode); + this.bExpanded = true; + } + + // In multi-hier mode, update the parents selection state + // issue #82: only if not initializing, because the children may not exist yet +// if( !dtnode.data.isStatusNode && opts.selectMode==3 && !isInitializing ) +// dtnode._fixSelectionState(); + + // In multi-hier mode, update the parents selection state + if( dtnode.bSelected && opts.selectMode==3 ) { + var p = this; + while( p ) { + if( !p.hasSubSel ){ + p._setSubSel(true); + } + p = p.parent; + } + } + // render this node and the new child + if ( tree.bEnableUpdate ){ + this.render(); + } + return dtnode; + }, + + addChild: function(obj, beforeNode) { + /** + * Add a node object as child. + * + * This should be the only place, where a DynaTreeNode is constructed! + * (Except for the root node creation in the tree constructor) + * + * @param obj A JS object (may be recursive) or an array of those. + * @param {DynaTreeNode} beforeNode (optional) sibling node. + * + * Data format: array of node objects, with optional 'children' attributes. + * [ + * { title: "t1", isFolder: true, ... } + * { title: "t2", isFolder: true, ..., + * children: [ + * {title: "t2.1", ..}, + * {..} + * ] + * } + * ] + * A simple object is also accepted instead of an array. + * + */ +// this.tree.logDebug("%s.addChild(%o, %o)", this, obj, beforeNode); + if(typeof(obj) == "string"){ + throw "Invalid data type for " + obj; + }else if( !obj || obj.length === 0 ){ // Passed null or undefined or empty array + return; + }else if( obj instanceof DynaTreeNode ){ + return this._addChildNode(obj, beforeNode); + } + + if( !obj.length ){ // Passed a single data object + obj = [ obj ]; + } + var prevFlag = this.tree.enableUpdate(false); + + var tnFirst = null; + for (var i=0, l=obj.length; i<l; i++) { + var data = obj[i]; + var dtnode = this._addChildNode(new DynaTreeNode(this, this.tree, data), beforeNode); + if( !tnFirst ){ + tnFirst = dtnode; + } + // Add child nodes recursively + if( data.children ){ + dtnode.addChild(data.children, null); + } + } + this.tree.enableUpdate(prevFlag); + return tnFirst; + }, + + append: function(obj) { + this.tree.logWarning("node.append() is deprecated (use node.addChild() instead)."); + return this.addChild(obj, null); + }, + + appendAjax: function(ajaxOptions) { + var self = this; + this.removeChildren(false, true); + this.setLazyNodeStatus(DTNodeStatus_Loading); + // Debug feature: force a delay, to simulate slow loading... + if(ajaxOptions.debugLazyDelay){ + var ms = ajaxOptions.debugLazyDelay; + ajaxOptions.debugLazyDelay = 0; + this.tree.logInfo("appendAjax: waiting for debugLazyDelay " + ms); + setTimeout(function(){self.appendAjax(ajaxOptions);}, ms); + return; + } + // Ajax option inheritance: $.ajaxSetup < $.ui.dynatree.prototype.options.ajaxDefaults < tree.options.ajaxDefaults < ajaxOptions + var orgSuccess = ajaxOptions.success, + orgError = ajaxOptions.error, + eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id") + "." + this.data.key; + var options = $.extend({}, this.tree.options.ajaxDefaults, ajaxOptions, { + success: function(data, textStatus, jqXHR){ + // <this> is the request options +// self.tree.logDebug("appendAjax().success"); + var prevPhase = self.tree.phase; + self.tree.phase = "init"; + // postProcess is similar to the standard dataFilter hook, + // but it is also called for JSONP + if( options.postProcess ){ + data = options.postProcess.call(this, data, this.dataType); + } + // Process ASPX WebMethod JSON object inside "d" property + // http://code.google.com/p/dynatree/issues/detail?id=202 + else if (data && data.hasOwnProperty("d")) { + data = (typeof data.d) == "string" ? $.parseJSON(data.d) : data.d; + } + if(!$.isArray(data) || data.length !== 0){ + self.addChild(data, null); + } + self.tree.phase = "postInit"; + if( orgSuccess ){ + orgSuccess.call(options, self, data, textStatus); + } + self.tree.logDebug("trigger " + eventType); + self.tree.$tree.trigger(eventType, [self, true]); + self.tree.phase = prevPhase; + // This should be the last command, so node._isLoading is true + // while the callbacks run + self.setLazyNodeStatus(DTNodeStatus_Ok); + if($.isArray(data) && data.length === 0){ + // Set to [] which is interpreted as 'no children' for lazy + // nodes + self.childList = []; + self.render(); + } + }, + error: function(jqXHR, textStatus, errorThrown){ + // <this> is the request options + self.tree.logWarning("appendAjax failed:", textStatus, ":\n", jqXHR, "\n", errorThrown); + if( orgError ){ + orgError.call(options, self, jqXHR, textStatus, errorThrown); + } + self.tree.$tree.trigger(eventType, [self, false]); + self.setLazyNodeStatus(DTNodeStatus_Error, {info: textStatus, tooltip: "" + errorThrown}); + } + }); + $.ajax(options); + }, + + move: function(targetNode, mode) { + /**Move this node to targetNode. + * mode 'child': append this node as last child of targetNode. + * This is the default. To be compatble with the D'n'd + * hitMode, we also accept 'over'. + * mode 'before': add this node as sibling before targetNode. + * mode 'after': add this node as sibling after targetNode. + */ + var pos; + if(this === targetNode){ + return; + } + if( !this.parent ){ + throw "Cannot move system root"; + } + if(mode === undefined || mode == "over"){ + mode = "child"; + } + var prevParent = this.parent; + var targetParent = (mode === "child") ? targetNode : targetNode.parent; + if( targetParent.isDescendantOf(this) ){ + throw "Cannot move a node to it's own descendant"; + } + // Unlink this node from current parent + if( this.parent.childList.length == 1 ) { + this.parent.childList = this.parent.data.isLazy ? [] : null; + this.parent.bExpanded = false; + } else { + pos = $.inArray(this, this.parent.childList); + if( pos < 0 ){ + throw "Internal error"; + } + this.parent.childList.splice(pos, 1); + } + // Remove from source DOM parent + if(this.parent.ul){ + this.parent.ul.removeChild(this.li); + } + + // Insert this node to target parent's child list + this.parent = targetParent; + if( targetParent.hasChildren() ) { + switch(mode) { + case "child": + // Append to existing target children + targetParent.childList.push(this); + break; + case "before": + // Insert this node before target node + pos = $.inArray(targetNode, targetParent.childList); + if( pos < 0 ){ + throw "Internal error"; + } + targetParent.childList.splice(pos, 0, this); + break; + case "after": + // Insert this node after target node + pos = $.inArray(targetNode, targetParent.childList); + if( pos < 0 ){ + throw "Internal error"; + } + targetParent.childList.splice(pos+1, 0, this); + break; + default: + throw "Invalid mode " + mode; + } + } else { + targetParent.childList = [ this ]; + } + // Parent has no <ul> tag yet: + if( !targetParent.ul ) { + // This is the parent's first child: create UL tag + // (Hidden, because it will be + targetParent.ul = document.createElement("ul"); + targetParent.ul.style.display = "none"; + targetParent.li.appendChild(targetParent.ul); + } + // Issue 319: Add to target DOM parent (only if node was already rendered(expanded)) + if(this.li){ + targetParent.ul.appendChild(this.li); + } + + if( this.tree !== targetNode.tree ) { + // Fix node.tree for all source nodes + this.visit(function(node){ + node.tree = targetNode.tree; + }, null, true); + throw "Not yet implemented."; + } + // TODO: fix selection state + // TODO: fix active state + if( !prevParent.isDescendantOf(targetParent)) { + prevParent.render(); + } + if( !targetParent.isDescendantOf(prevParent) ) { + targetParent.render(); + } +// this.tree.redraw(); +/* + var tree = this.tree; + var opts = tree.options; + var pers = tree.persistence; + + + // Always expand, if it's below minExpandLevel +// tree.logDebug ("%s._addChildNode(%o), l=%o", this, dtnode, dtnode.getLevel()); + if ( opts.minExpandLevel >= dtnode.getLevel() ) { +// tree.logDebug ("Force expand for %o", dtnode); + this.bExpanded = true; + } + + // In multi-hier mode, update the parents selection state + // issue #82: only if not initializing, because the children may not exist yet +// if( !dtnode.data.isStatusNode && opts.selectMode==3 && !isInitializing ) +// dtnode._fixSelectionState(); + + // In multi-hier mode, update the parents selection state + if( dtnode.bSelected && opts.selectMode==3 ) { + var p = this; + while( p ) { + if( !p.hasSubSel ) + p._setSubSel(true); + p = p.parent; + } + } + // render this node and the new child + if ( tree.bEnableUpdate ) + this.render(); + + return dtnode; + +*/ + }, + + // --- end of class + lastentry: undefined +}; + +/************************************************************************* + * class DynaTreeStatus + */ + +var DynaTreeStatus = Class.create(); + + +DynaTreeStatus._getTreePersistData = function(cookieId, cookieOpts) { + // Static member: Return persistence information from cookies + var ts = new DynaTreeStatus(cookieId, cookieOpts); + ts.read(); + return ts.toDict(); +}; +// Make available in global scope +getDynaTreePersistData = DynaTreeStatus._getTreePersistData; // TODO: deprecated + + +DynaTreeStatus.prototype = { + // Constructor + initialize: function(cookieId, cookieOpts) { +// this._log("DynaTreeStatus: initialize"); + if( cookieId === undefined ){ + cookieId = $.ui.dynatree.prototype.options.cookieId; + } + cookieOpts = $.extend({}, $.ui.dynatree.prototype.options.cookie, cookieOpts); + + this.cookieId = cookieId; + this.cookieOpts = cookieOpts; + this.cookiesFound = undefined; + this.activeKey = null; + this.focusedKey = null; + this.expandedKeyList = null; + this.selectedKeyList = null; + }, + // member functions + _log: function(msg) { + // this.logDebug("_changeNodeList(%o): nodeList:%o, idx:%o", mode, nodeList, idx); + Array.prototype.unshift.apply(arguments, ["debug"]); + _log.apply(this, arguments); + }, + read: function() { +// this._log("DynaTreeStatus: read"); + // Read or init cookies. + this.cookiesFound = false; + + var cookie = $.cookie(this.cookieId + "-active"); + this.activeKey = cookie || ""; + if( cookie ){ + this.cookiesFound = true; + } + cookie = $.cookie(this.cookieId + "-focus"); + this.focusedKey = cookie || ""; + if( cookie ){ + this.cookiesFound = true; + } + cookie = $.cookie(this.cookieId + "-expand"); + this.expandedKeyList = cookie ? cookie.split(",") : []; + if( cookie ){ + this.cookiesFound = true; + } + cookie = $.cookie(this.cookieId + "-select"); + this.selectedKeyList = cookie ? cookie.split(",") : []; + if( cookie ){ + this.cookiesFound = true; + } + }, + write: function() { +// this._log("DynaTreeStatus: write"); + $.cookie(this.cookieId + "-active", ( this.activeKey === null ) ? "" : this.activeKey, this.cookieOpts); + $.cookie(this.cookieId + "-focus", ( this.focusedKey === null ) ? "" : this.focusedKey, this.cookieOpts); + $.cookie(this.cookieId + "-expand", ( this.expandedKeyList === null ) ? "" : this.expandedKeyList.join(","), this.cookieOpts); + $.cookie(this.cookieId + "-select", ( this.selectedKeyList === null ) ? "" : this.selectedKeyList.join(","), this.cookieOpts); + }, + addExpand: function(key) { +// this._log("addExpand(%o)", key); + if( $.inArray(key, this.expandedKeyList) < 0 ) { + this.expandedKeyList.push(key); + $.cookie(this.cookieId + "-expand", this.expandedKeyList.join(","), this.cookieOpts); + } + }, + clearExpand: function(key) { +// this._log("clearExpand(%o)", key); + var idx = $.inArray(key, this.expandedKeyList); + if( idx >= 0 ) { + this.expandedKeyList.splice(idx, 1); + $.cookie(this.cookieId + "-expand", this.expandedKeyList.join(","), this.cookieOpts); + } + }, + addSelect: function(key) { +// this._log("addSelect(%o)", key); + if( $.inArray(key, this.selectedKeyList) < 0 ) { + this.selectedKeyList.push(key); + $.cookie(this.cookieId + "-select", this.selectedKeyList.join(","), this.cookieOpts); + } + }, + clearSelect: function(key) { +// this._log("clearSelect(%o)", key); + var idx = $.inArray(key, this.selectedKeyList); + if( idx >= 0 ) { + this.selectedKeyList.splice(idx, 1); + $.cookie(this.cookieId + "-select", this.selectedKeyList.join(","), this.cookieOpts); + } + }, + isReloading: function() { + return this.cookiesFound === true; + }, + toDict: function() { + return { + cookiesFound: this.cookiesFound, + activeKey: this.activeKey, + focusedKey: this.activeKey, + expandedKeyList: this.expandedKeyList, + selectedKeyList: this.selectedKeyList + }; + }, + // --- end of class + lastentry: undefined +}; + + +/************************************************************************* + * class DynaTree + */ + +var DynaTree = Class.create(); + +// --- Static members ---------------------------------------------------------- + +DynaTree.version = "@@Version"; + +//--- Class members ------------------------------------------------------------ + +DynaTree.prototype = { + // Constructor + initialize: function($widget) { + // instance members + this.phase = "init"; + this.$widget = $widget; + this.options = $widget.options; + this.$tree = $widget.element; + this.timer = null; + // find container element + this.divTree = this.$tree.get(0); + + _initDragAndDrop(this); + }, + + // member functions + + _load: function(callback) { + var $widget = this.$widget; + var opts = this.options, + self = this; + this.bEnableUpdate = true; + this._nodeCount = 1; + this.activeNode = null; + this.focusNode = null; + + // Some deprecation warnings to help with migration + if( opts.rootVisible !== undefined ){ + this.logWarning("Option 'rootVisible' is no longer supported."); + } + if( opts.minExpandLevel < 1 ) { + this.logWarning("Option 'minExpandLevel' must be >= 1."); + opts.minExpandLevel = 1; + } +// _log("warn", "jQuery.support.boxModel " + jQuery.support.boxModel); + + // If a 'options.classNames' dictionary was passed, still use defaults + // for undefined classes: + if( opts.classNames !== $.ui.dynatree.prototype.options.classNames ) { + opts.classNames = $.extend({}, $.ui.dynatree.prototype.options.classNames, opts.classNames); + } + if( opts.ajaxDefaults !== $.ui.dynatree.prototype.options.ajaxDefaults ) { + opts.ajaxDefaults = $.extend({}, $.ui.dynatree.prototype.options.ajaxDefaults, opts.ajaxDefaults); + } + if( opts.dnd !== $.ui.dynatree.prototype.options.dnd ) { + opts.dnd = $.extend({}, $.ui.dynatree.prototype.options.dnd, opts.dnd); + } + // Guess skin path, if not specified + if(!opts.imagePath) { + $("script").each( function () { + var _rexDtLibName = /.*dynatree[^\/]*\.js$/i; + if( this.src.search(_rexDtLibName) >= 0 ) { + if( this.src.indexOf("/")>=0 ){ // issue #47 + opts.imagePath = this.src.slice(0, this.src.lastIndexOf("/")) + "/skin/"; + }else{ + opts.imagePath = "skin/"; + } + self.logDebug("Guessing imagePath from '%s': '%s'", this.src, opts.imagePath); + return false; // first match + } + }); + } + + this.persistence = new DynaTreeStatus(opts.cookieId, opts.cookie); + if( opts.persist ) { + if( !$.cookie ){ + _log("warn", "Please include jquery.cookie.js to use persistence."); + } + this.persistence.read(); + } + this.logDebug("DynaTree.persistence: %o", this.persistence.toDict()); + + // Cached tag strings + this.cache = { + tagEmpty: "<span class='" + opts.classNames.empty + "'></span>", + tagVline: "<span class='" + opts.classNames.vline + "'></span>", + tagExpander: "<span class='" + opts.classNames.expander + "'></span>", + tagConnector: "<span class='" + opts.classNames.connector + "'></span>", + tagNodeIcon: "<span class='" + opts.classNames.nodeIcon + "'></span>", + tagCheckbox: "<span class='" + opts.classNames.checkbox + "'></span>", + lastentry: undefined + }; + + // Clear container, in case it contained some 'waiting' or 'error' text + // for clients that don't support JS. + // We don't do this however, if we try to load from an embedded UL element. + if( opts.children || (opts.initAjax && opts.initAjax.url) || opts.initId ){ + $(this.divTree).empty(); + } + var $ulInitialize = this.$tree.find(">ul:first").hide(); + + // Create the root element + this.tnRoot = new DynaTreeNode(null, this, {}); + this.tnRoot.bExpanded = true; + this.tnRoot.render(); + this.divTree.appendChild(this.tnRoot.ul); + + var root = this.tnRoot, + isReloading = ( opts.persist && this.persistence.isReloading() ), + isLazy = false, + prevFlag = this.enableUpdate(false); + + this.logDebug("Dynatree._load(): read tree structure..."); + + // Init tree structure + if( opts.children ) { + // Read structure from node array + root.addChild(opts.children); + + } else if( opts.initAjax && opts.initAjax.url ) { + // Init tree from AJAX request + isLazy = true; + root.data.isLazy = true; + this._reloadAjax(callback); + + } else if( opts.initId ) { + // Init tree from another UL element + this._createFromTag(root, $("#"+opts.initId)); + + } else { + // Init tree from the first UL element inside the container <div> +// var $ul = this.$tree.find(">ul:first").hide(); + this._createFromTag(root, $ulInitialize); + $ulInitialize.remove(); + } + + this._checkConsistency(); + // Fix part-sel flags + if(!isLazy && opts.selectMode == 3){ + root._updatePartSelectionState(); + } + // Render html markup + this.logDebug("Dynatree._load(): render nodes..."); + this.enableUpdate(prevFlag); + + // bind event handlers + this.logDebug("Dynatree._load(): bind events..."); + this.$widget.bind(); + + // --- Post-load processing + this.logDebug("Dynatree._load(): postInit..."); + this.phase = "postInit"; + + // In persist mode, make sure that cookies are written, even if they are empty + if( opts.persist ) { + this.persistence.write(); + } + // Set focus, if possible (this will also fire an event and write a cookie) + if( this.focusNode && this.focusNode.isVisible() ) { + this.logDebug("Focus on init: %o", this.focusNode); + this.focusNode.focus(); + } + if( !isLazy ) { + if( opts.onPostInit ) { + opts.onPostInit.call(this, isReloading, false); + } + if( callback ){ + callback.call(this, "ok"); + } + } + this.phase = "idle"; + }, + + _reloadAjax: function(callback) { + // Reload + var opts = this.options; + if( ! opts.initAjax || ! opts.initAjax.url ){ + throw "tree.reload() requires 'initAjax' mode."; + } + var pers = this.persistence; + var ajaxOpts = $.extend({}, opts.initAjax); + // Append cookie info to the request +// this.logDebug("reloadAjax: key=%o, an.key:%o", pers.activeKey, this.activeNode?this.activeNode.data.key:"?"); + if( ajaxOpts.addActiveKey ){ + ajaxOpts.data.activeKey = pers.activeKey; + } + if( ajaxOpts.addFocusedKey ){ + ajaxOpts.data.focusedKey = pers.focusedKey; + } + if( ajaxOpts.addExpandedKeyList ){ + ajaxOpts.data.expandedKeyList = pers.expandedKeyList.join(","); + } + if( ajaxOpts.addSelectedKeyList ){ + ajaxOpts.data.selectedKeyList = pers.selectedKeyList.join(","); + } + // Set up onPostInit callback to be called when Ajax returns + if( ajaxOpts.success ){ + this.logWarning("initAjax: success callback is ignored; use onPostInit instead."); + } + if( ajaxOpts.error ){ + this.logWarning("initAjax: error callback is ignored; use onPostInit instead."); + } + var isReloading = pers.isReloading(); + ajaxOpts.success = function(dtnode, data, textStatus) { + if(opts.selectMode == 3){ + dtnode.tree.tnRoot._updatePartSelectionState(); + } + if(opts.onPostInit){ + opts.onPostInit.call(dtnode.tree, isReloading, false); + } + if(callback){ + callback.call(dtnode.tree, "ok"); + } + }; + ajaxOpts.error = function(dtnode, XMLHttpRequest, textStatus, errorThrown) { + if(opts.onPostInit){ + opts.onPostInit.call(dtnode.tree, isReloading, true, XMLHttpRequest, textStatus, errorThrown); + } + if(callback){ + callback.call(dtnode.tree, "error", XMLHttpRequest, textStatus, errorThrown); + } + }; +// } + this.logDebug("Dynatree._init(): send Ajax request..."); + this.tnRoot.appendAjax(ajaxOpts); + }, + + toString: function() { + return "Dynatree '" + this.$tree.attr("id") + "'"; + }, + + toDict: function(includeRoot) { + var dict = this.tnRoot.toDict(true); + return includeRoot ? dict : dict.children; + }, + + serializeArray: function(stopOnParents) { + // Return a JavaScript array of objects, ready to be encoded as a JSON + // string for selected nodes + var nodeList = this.getSelectedNodes(stopOnParents), + name = this.$tree.attr("name") || this.$tree.attr("id"), + arr = []; + for(var i=0, l=nodeList.length; i<l; i++){ + arr.push({name: name, value: nodeList[i].data.key}); + } + return arr; + }, + + getPersistData: function() { + return this.persistence.toDict(); + }, + + logDebug: function(msg) { + if( this.options.debugLevel >= 2 ) { + Array.prototype.unshift.apply(arguments, ["debug"]); + _log.apply(this, arguments); + } + }, + + logInfo: function(msg) { + if( this.options.debugLevel >= 1 ) { + Array.prototype.unshift.apply(arguments, ["info"]); + _log.apply(this, arguments); + } + }, + + logWarning: function(msg) { + Array.prototype.unshift.apply(arguments, ["warn"]); + _log.apply(this, arguments); + }, + + isInitializing: function() { + return ( this.phase=="init" || this.phase=="postInit" ); + }, + isReloading: function() { + return ( this.phase=="init" || this.phase=="postInit" ) && this.options.persist && this.persistence.cookiesFound; + }, + isUserEvent: function() { + return ( this.phase=="userEvent" ); + }, + + redraw: function() { +// this.logDebug("dynatree.redraw()..."); + this.tnRoot.render(false, false); +// this.logDebug("dynatree.redraw() done."); + }, + renderInvisibleNodes: function() { + this.tnRoot.render(false, true); + }, + reload: function(callback) { + this._load(callback); + }, + + getRoot: function() { + return this.tnRoot; + }, + + enable: function() { + this.$widget.enable(); + }, + + disable: function() { + this.$widget.disable(); + }, + + getNodeByKey: function(key) { + // Search the DOM by element ID (assuming this is faster than traversing all nodes). + // $("#...") has problems, if the key contains '.', so we use getElementById() + var el = document.getElementById(this.options.idPrefix + key); + if( el ){ + return el.dtnode ? el.dtnode : null; + } + // Not found in the DOM, but still may be in an unrendered part of tree + var match = null; + this.visit(function(node){ +// window.console.log("%s", node); + if(node.data.key === key) { + match = node; + return false; + } + }, true); + return match; + }, + + getActiveNode: function() { + return this.activeNode; + }, + + reactivate: function(setFocus) { + // Re-fire onQueryActivate and onActivate events. + var node = this.activeNode; +// this.logDebug("reactivate %o", node); + if( node ) { + this.activeNode = null; // Force re-activating + node.activate(); + if( setFocus ){ + node.focus(); + } + } + }, + + getSelectedNodes: function(stopOnParents) { + var nodeList = []; + this.tnRoot.visit(function(node){ + if( node.bSelected ) { + nodeList.push(node); + if( stopOnParents === true ){ + return "skip"; // stop processing this branch + } + } + }); + return nodeList; + }, + + activateKey: function(key) { + var dtnode = (key === null) ? null : this.getNodeByKey(key); + if( !dtnode ) { + if( this.activeNode ){ + this.activeNode.deactivate(); + } + this.activeNode = null; + return null; + } + dtnode.focus(); + dtnode.activate(); + return dtnode; + }, + + loadKeyPath: function(keyPath, callback) { + var segList = keyPath.split(this.options.keyPathSeparator); + // Remove leading '/' + if(segList[0] === ""){ + segList.shift(); + } + // Remove leading system root key + if(segList[0] == this.tnRoot.data.key){ + this.logDebug("Removed leading root key."); + segList.shift(); + } + keyPath = segList.join(this.options.keyPathSeparator); + return this.tnRoot._loadKeyPath(keyPath, callback); + }, + + selectKey: function(key, select) { + var dtnode = this.getNodeByKey(key); + if( !dtnode ){ + return null; + } + dtnode.select(select); + return dtnode; + }, + + enableUpdate: function(bEnable) { + if ( this.bEnableUpdate==bEnable ){ + return bEnable; + } + this.bEnableUpdate = bEnable; + if ( bEnable ){ + this.redraw(); + } + return !bEnable; // return previous value + }, + + count: function() { + return this.tnRoot.countChildren(); + }, + + visit: function(fn, includeRoot) { + return this.tnRoot.visit(fn, includeRoot); + }, + + _createFromTag: function(parentTreeNode, $ulParent) { + // Convert a <UL>...</UL> list into children of the parent tree node. + var self = this; +/* +TODO: better? + this.$lis = $("li:has(a[href])", this.element); + this.$tabs = this.$lis.map(function() { return $("a", this)[0]; }); + */ + $ulParent.find(">li").each(function() { + var $li = $(this), + $liSpan = $li.find(">span:first"), + $liA = $li.find(">a:first"), + title, + href = null, + target = null, + tooltip; + if( $liSpan.length ) { + // If a <li><span> tag is specified, use it literally. + title = $liSpan.html(); + } else if( $liA.length ) { + title = $liA.html(); + href = $liA.attr("href"); + target = $liA.attr("target"); + tooltip = $liA.attr("title"); + } else { + // If only a <li> tag is specified, use the trimmed string up to + // the next child <ul> tag. + title = $li.html(); + var iPos = title.search(/<ul/i); + if( iPos >= 0 ){ + title = $.trim(title.substring(0, iPos)); + }else{ + title = $.trim(title); + } +// self.logDebug("%o", title); + } + // Parse node options from ID, title and class attributes + var data = { + title: title, + tooltip: tooltip, + isFolder: $li.hasClass("folder"), + isLazy: $li.hasClass("lazy"), + expand: $li.hasClass("expanded"), + select: $li.hasClass("selected"), + activate: $li.hasClass("active"), + focus: $li.hasClass("focused"), + noLink: $li.hasClass("noLink") + }; + if( href ){ + data.href = href; + data.target = target; + } + if( $li.attr("title") ){ + data.tooltip = $li.attr("title"); // overrides <a title='...'> + } + if( $li.attr("id") ){ + data.key = "" + $li.attr("id"); + } + // If a data attribute is present, evaluate as a JavaScript object + if( $li.attr("data") ) { + var dataAttr = $.trim($li.attr("data")); + if( dataAttr ) { + if( dataAttr.charAt(0) != "{" ){ + dataAttr = "{" + dataAttr + "}"; + } + try { + $.extend(data, eval("(" + dataAttr + ")")); + } catch(e) { + throw ("Error parsing node data: " + e + "\ndata:\n'" + dataAttr + "'"); + } + } + } + var childNode = parentTreeNode.addChild(data); + // Recursive reading of child nodes, if LI tag contains an UL tag + var $ul = $li.find(">ul:first"); + if( $ul.length ) { + self._createFromTag(childNode, $ul); // must use 'self', because 'this' is the each() context + } + }); + }, + + _checkConsistency: function() { +// this.logDebug("tree._checkConsistency() NOT IMPLEMENTED - %o", this); + }, + + _setDndStatus: function(sourceNode, targetNode, helper, hitMode, accept) { + // hitMode: 'after', 'before', 'over', 'out', 'start', 'stop' + var $source = sourceNode ? $(sourceNode.span) : null, + $target = $(targetNode.span), + posOpts, + markerOffsetX = 0, + markerAt = "center"; + + if( !this.$dndMarker ) { + this.$dndMarker = $("<div id='dynatree-drop-marker'></div>") + .hide() + .css({"z-index": 1000}) + .prependTo($(this.divTree).parent()); + +// logMsg("Creating marker: %o", this.$dndMarker); + } +/* + if(hitMode === "start"){ + } + if(hitMode === "stop"){ +// sourceNode.removeClass("dynatree-drop-target"); + } +*/ + if(hitMode === "after" || hitMode === "before" || hitMode === "over"){ +// $source && $source.addClass("dynatree-drag-source"); +// $target.addClass("dynatree-drop-target"); + + switch(hitMode){ + case "before": + this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over"); + this.$dndMarker.addClass("dynatree-drop-before"); + markerAt = "top"; + break; + case "after": + this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over"); + this.$dndMarker.addClass("dynatree-drop-after"); + markerAt = "bottom"; + break; + default: + this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before"); + this.$dndMarker.addClass("dynatree-drop-over"); + $target.addClass("dynatree-drop-target"); + markerOffsetX = 8; + } +// logMsg("Creating marker: %o", this.$dndMarker); +// logMsg(" $target.offset=%o", $target); +// logMsg(" pos/$target.offset=%o", pos); +// logMsg(" $target.position=%o", $target.position()); +// logMsg(" $target.offsetParent=%o, ot:%o", $target.offsetParent(), $target.offsetParent().offset()); +// logMsg(" $(this.divTree).offset=%o", $(this.divTree).offset()); +// logMsg(" $(this.divTree).parent=%o", $(this.divTree).parent()); +// var pos = $target.offset(); +// var parentPos = $target.offsetParent().offset(); +// var bodyPos = $target.offsetParent().offset(); + + if( jquerySupports.positionMyOfs ){ + posOpts = { + my: "left" + offsetString(markerOffsetX) + " center", + at: "left " + markerAt, + of: $target + }; + } else { + posOpts = { + my: "left center", + at: "left " + markerAt, + of: $target, + offset: "" + markerOffsetX + " 0" + }; + } + this.$dndMarker + .show() + .position(posOpts); + +// helper.addClass("dynatree-drop-hover"); + } else { +// $source && $source.removeClass("dynatree-drag-source"); + $target.removeClass("dynatree-drop-target"); + this.$dndMarker.hide(); +// helper.removeClass("dynatree-drop-hover"); + } + if(hitMode === "after"){ + $target.addClass("dynatree-drop-after"); + } else { + $target.removeClass("dynatree-drop-after"); + } + if(hitMode === "before"){ + $target.addClass("dynatree-drop-before"); + } else { + $target.removeClass("dynatree-drop-before"); + } + if(accept === true){ + if($source){ + $source.addClass("dynatree-drop-accept"); + } + $target.addClass("dynatree-drop-accept"); + helper.addClass("dynatree-drop-accept"); + }else{ + if($source){ + $source.removeClass("dynatree-drop-accept"); + } + $target.removeClass("dynatree-drop-accept"); + helper.removeClass("dynatree-drop-accept"); + } + if(accept === false){ + if($source){ + $source.addClass("dynatree-drop-reject"); + } + $target.addClass("dynatree-drop-reject"); + helper.addClass("dynatree-drop-reject"); + }else{ + if($source){ + $source.removeClass("dynatree-drop-reject"); + } + $target.removeClass("dynatree-drop-reject"); + helper.removeClass("dynatree-drop-reject"); + } + }, + + _onDragEvent: function(eventName, node, otherNode, event, ui, draggable) { + /** + * Handles drag'n'drop functionality. + * + * A standard jQuery drag-and-drop process may generate these calls: + * + * draggable helper(): + * _onDragEvent("helper", sourceNode, null, event, null, null); + * start: + * _onDragEvent("start", sourceNode, null, event, ui, draggable); + * drag: + * _onDragEvent("leave", prevTargetNode, sourceNode, event, ui, draggable); + * _onDragEvent("over", targetNode, sourceNode, event, ui, draggable); + * _onDragEvent("enter", targetNode, sourceNode, event, ui, draggable); + * stop: + * _onDragEvent("drop", targetNode, sourceNode, event, ui, draggable); + * _onDragEvent("leave", targetNode, sourceNode, event, ui, draggable); + * _onDragEvent("stop", sourceNode, null, event, ui, draggable); + */ + var hitMode, enterResponse, r, + dnd = this.options.dnd, + res = null, + nodeTag = $(node.span); + + switch (eventName) { + case "helper": + // Only event and node argument is available + var $helper = $("<div class='dynatree-drag-helper'><span class='dynatree-drag-helper-img' /></div>") + .append($(event.target).closest(".dynatree-title").clone()); +// .append($(event.target).closest('a').clone()); + // issue 244: helper should be child of scrollParent + $("ul.dynatree-container", node.tree.divTree).append($helper); +// $(node.tree.divTree).append($helper); + // Attach node reference to helper object + $helper.data("dtSourceNode", node); + res = $helper; + break; + case "start": + if(node.isStatusNode()) { + res = false; + } else if(dnd.onDragStart) { + res = dnd.onDragStart(node); + } + if(res === false) { + this.logDebug("tree.onDragStart() cancelled"); + //draggable._clear(); + // NOTE: the return value seems to be ignored (drag is not canceled, when false is returned) + ui.helper.trigger("mouseup"); + ui.helper.hide(); + } else { + nodeTag.addClass("dynatree-drag-source"); + } + break; + case "enter": + r = dnd.onDragEnter ? dnd.onDragEnter(node, otherNode, ui, draggable) : null; + if(!r){ + // convert null, undefined, false to false + res = false; + }else if ( $.isArray(r) ) { + res = { + over: ($.inArray("over", r) >= 0), + before: ($.inArray("before", r) >= 0), + after: ($.inArray("after", r) >= 0) + }; + }else{ + res = { + over: ((r === true) || (r === "over")), + before: ((r === true) || (r === "before")), + after: ((r === true) || (r === "after")) + }; + } + ui.helper.data("enterResponse", res); +// this.logDebug("helper.enterResponse: %o", res); + break; + case "over": + enterResponse = ui.helper.data("enterResponse"); + hitMode = null; + if(enterResponse === false){ + // Don't call onDragOver if onEnter returned false. + // issue 332 +// break; + } else if(typeof enterResponse === "string") { + // Use hitMode from onEnter if provided. + hitMode = enterResponse; + } else { + // Calculate hitMode from relative cursor position. + var nodeOfs = nodeTag.offset(); + var relPos = { x: event.pageX - nodeOfs.left, + y: event.pageY - nodeOfs.top }; + var relPos2 = { x: relPos.x / nodeTag.width(), + y: relPos.y / nodeTag.height() }; + + if( enterResponse.after && relPos2.y > 0.75 ){ + hitMode = "after"; + } else if(!enterResponse.over && enterResponse.after && relPos2.y > 0.5 ){ + hitMode = "after"; + } else if(enterResponse.before && relPos2.y <= 0.25) { + hitMode = "before"; + } else if(!enterResponse.over && enterResponse.before && relPos2.y <= 0.5) { + hitMode = "before"; + } else if(enterResponse.over) { + hitMode = "over"; + } + // Prevent no-ops like 'before source node' + // TODO: these are no-ops when moving nodes, but not in copy mode + if( dnd.preventVoidMoves ){ + if(node === otherNode){ + hitMode = null; + }else if(hitMode === "before" && otherNode && node === otherNode.getNextSibling()){ + hitMode = null; + }else if(hitMode === "after" && otherNode && node === otherNode.getPrevSibling()){ + hitMode = null; + }else if(hitMode === "over" && otherNode + && otherNode.parent === node && otherNode.isLastSibling() ){ + hitMode = null; + } + } +// this.logDebug("hitMode: %s - %s - %s", hitMode, (node.parent === otherNode), node.isLastSibling()); + ui.helper.data("hitMode", hitMode); + } + // Auto-expand node (only when 'over' the node, not 'before', or 'after') + if(hitMode === "over" + && dnd.autoExpandMS && node.hasChildren() !== false && !node.bExpanded) { + node.scheduleAction("expand", dnd.autoExpandMS); + } + if(hitMode && dnd.onDragOver){ + res = dnd.onDragOver(node, otherNode, hitMode, ui, draggable); + if(res === "over" || res === "before" || res === "after") { + hitMode = res; + } + } + // issue 332 +// this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false); + this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false && hitMode !== null); + break; + case "drop": + // issue 286: don't trigger onDrop, if DnD status is 'reject' + var isForbidden = ui.helper.hasClass("dynatree-drop-reject"); + hitMode = ui.helper.data("hitMode"); + if(hitMode && dnd.onDrop && !isForbidden){ + dnd.onDrop(node, otherNode, hitMode, ui, draggable); + } + break; + case "leave": + // Cancel pending expand request + node.scheduleAction("cancel"); + ui.helper.data("enterResponse", null); + ui.helper.data("hitMode", null); + this._setDndStatus(otherNode, node, ui.helper, "out", undefined); + if(dnd.onDragLeave){ + dnd.onDragLeave(node, otherNode, ui, draggable); + } + break; + case "stop": + nodeTag.removeClass("dynatree-drag-source"); + if(dnd.onDragStop){ + dnd.onDragStop(node); + } + break; + default: + throw "Unsupported drag event: " + eventName; + } + return res; + }, + + cancelDrag: function() { + var dd = $.ui.ddmanager.current; + if(dd){ + dd.cancel(); + } + }, + + // --- end of class + lastentry: undefined +}; + +/************************************************************************* + * Widget $(..).dynatree + */ + +$.widget("ui.dynatree", { +/* + init: function() { + // ui.core 1.6 renamed init() to _init(): this stub assures backward compatibility + _log("warn", "ui.dynatree.init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher."); + return this._init(); + }, + */ + _init: function() { +// if( parseFloat($.ui.version) < 1.8 ) { + if(versionCompare($.ui.version, "1.8") < 0){ + // jquery.ui.core 1.8 renamed _init() to _create(): this stub assures backward compatibility + if(this.options.debugLevel >= 0){ + _log("warn", "ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher."); + } + return this._create(); + } + // jquery.ui.core 1.8 still uses _init() to perform "default functionality" + if(this.options.debugLevel >= 2){ + _log("debug", "ui.dynatree._init() was called; no current default functionality."); + } + }, + + _create: function() { + var opts = this.options; + if(opts.debugLevel >= 1){ + logMsg("Dynatree._create(): version='%s', debugLevel=%o.", $.ui.dynatree.version, this.options.debugLevel); + } + // The widget framework supplies this.element and this.options. + this.options.event += ".dynatree"; // namespace event + + var divTree = this.element.get(0); +/* // Clear container, in case it contained some 'waiting' or 'error' text + // for clients that don't support JS + if( opts.children || (opts.initAjax && opts.initAjax.url) || opts.initId ) + $(divTree).empty(); +*/ + // Create the DynaTree object + this.tree = new DynaTree(this); + this.tree._load(); + this.tree.logDebug("Dynatree._init(): done."); + }, + + bind: function() { + // Prevent duplicate binding + this.unbind(); + + var eventNames = "click.dynatree dblclick.dynatree"; + if( this.options.keyboard ){ + // Note: leading ' '! + eventNames += " keypress.dynatree keydown.dynatree"; + } + this.element.bind(eventNames, function(event){ + var dtnode = $.ui.dynatree.getNode(event.target); + if( !dtnode ){ + return true; // Allow bubbling of other events + } + var tree = dtnode.tree; + var o = tree.options; + tree.logDebug("event(%s): dtnode: %s", event.type, dtnode); + var prevPhase = tree.phase; + tree.phase = "userEvent"; + try { + switch(event.type) { + case "click": + return ( o.onClick && o.onClick.call(tree, dtnode, event)===false ) ? false : dtnode._onClick(event); + case "dblclick": + return ( o.onDblClick && o.onDblClick.call(tree, dtnode, event)===false ) ? false : dtnode._onDblClick(event); + case "keydown": + return ( o.onKeydown && o.onKeydown.call(tree, dtnode, event)===false ) ? false : dtnode._onKeydown(event); + case "keypress": + return ( o.onKeypress && o.onKeypress.call(tree, dtnode, event)===false ) ? false : dtnode._onKeypress(event); + } + } catch(e) { + var _ = null; // issue 117 + tree.logWarning("bind(%o): dtnode: %o, error: %o", event, dtnode, e); + } finally { + tree.phase = prevPhase; + } + }); + + // focus/blur don't bubble, i.e. are not delegated to parent <div> tags, + // so we use the addEventListener capturing phase. + // See http://www.howtocreate.co.uk/tutorials/javascript/domevents + function __focusHandler(event) { + // Handles blur and focus. + // Fix event for IE: + // doesn't pass JSLint: +// event = arguments[0] = $.event.fix( event || window.event ); + // what jQuery does: +// var args = jQuery.makeArray( arguments ); +// event = args[0] = jQuery.event.fix( event || window.event ); + event = $.event.fix( event || window.event ); + var dtnode = $.ui.dynatree.getNode(event.target); + return dtnode ? dtnode._onFocus(event) : false; + } + var div = this.tree.divTree; + + if( div.addEventListener ) { + div.addEventListener("focus", __focusHandler, true); + div.addEventListener("blur", __focusHandler, true); + } else { + div.onfocusin = div.onfocusout = __focusHandler; + } + // EVENTS + // disable click if event is configured to something else +// if (!(/^click/).test(o.event)) +// this.$tabs.bind("click.tabs", function() { return false; }); + + }, + + unbind: function() { + this.element.unbind(".dynatree"); + }, + +/* TODO: we could handle option changes during runtime here (maybe to re-render, ...) + setData: function(key, value) { + this.tree.logDebug("dynatree.setData('" + key + "', '" + value + "')"); + }, +*/ + enable: function() { + this.bind(); + // Call default disable(): remove -disabled from css: + $.Widget.prototype.enable.apply(this, arguments); + }, + + disable: function() { + this.unbind(); + // Call default disable(): add -disabled to css: + $.Widget.prototype.disable.apply(this, arguments); + }, + + // --- getter methods (i.e. NOT returning a reference to $) + getTree: function() { + return this.tree; + }, + + getRoot: function() { + return this.tree.getRoot(); + }, + + getActiveNode: function() { + return this.tree.getActiveNode(); + }, + + getSelectedNodes: function() { + return this.tree.getSelectedNodes(); + }, + + // ------------------------------------------------------------------------ + lastentry: undefined +}); + + +// The following methods return a value (thus breaking the jQuery call chain): +if(versionCompare($.ui.version, "1.8") < 0){ + $.ui.dynatree.getter = "getTree getRoot getActiveNode getSelectedNodes"; +} + +/******************************************************************************* + * Tools in ui.dynatree namespace + */ +$.extend($.ui.dynatree, { + /** @type {String} */ + version: "DEVELOPMENT", + /** @type {String} */ + buildType: "DEVELOP", + /** Expose class object as $.ui.dynatree._DynaTreeClass */ + _DynaTreeClass: DynaTree, + /** Expose class object as $.ui.dynatree._DynaTreeNodeClass */ + _DynaTreeNodeClass: DynaTreeNode, + /** + * Return a DynaTreeNode object for a given DOM element + */ + getNode: function(el) { + if(el instanceof DynaTreeNode){ + return el; // el already was a DynaTreeNode + } + if(el.selector !== undefined){ + el = el[0]; // el was a jQuery object: use the DOM element + } + // TODO: for some reason $el.parents("[dtnode]") does not work (jQuery 1.6.1) + // maybe, because dtnode is a property, not an attribute + while( el ) { + if(el.dtnode) { + return el.dtnode; + } + el = el.parentNode; + } + return null; + }, + /**Return persistence information from cookies.*/ + getPersistData: DynaTreeStatus._getTreePersistData +}); + + + +/******************************************************************************* + * Plugin default options: + */ +$.ui.dynatree.prototype.options = { + title: "Dynatree", // Tree's name (only used for debug output) + minExpandLevel: 1, // 1: root node is not collapsible + imagePath: null, // Path to a folder containing icons. Defaults to 'skin/' subdirectory. + children: null, // Init tree structure from this object array. + initId: null, // Init tree structure from a <ul> element with this ID. + initAjax: null, // Ajax options used to initialize the tree strucuture. + autoFocus: true, // Set focus to first child, when expanding or lazy-loading. + keyboard: true, // Support keyboard navigation. + persist: false, // Persist expand-status to a cookie + autoCollapse: false, // Automatically collapse all siblings, when a node is expanded. + clickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand + activeVisible: true, // Make sure, active nodes are visible (expanded). + checkbox: false, // Show checkboxes. + selectMode: 2, // 1:single, 2:multi, 3:multi-hier + fx: null, // Animations, e.g. null or { height: "toggle", duration: 200 } + noLink: false, // Use <span> instead of <a> tags for all nodes + // Low level event handlers: onEvent(dtnode, event): return false, to stop default processing + onClick: null, // null: generate focus, expand, activate, select events. + onDblClick: null, // (No default actions.) + onKeydown: null, // null: generate keyboard navigation (focus, expand, activate). + onKeypress: null, // (No default actions.) + onFocus: null, // null: set focus to node. + onBlur: null, // null: remove focus from node. + + // Pre-event handlers onQueryEvent(flag, dtnode): return false, to stop processing + onQueryActivate: null, // Callback(flag, dtnode) before a node is (de)activated. + onQuerySelect: null, // Callback(flag, dtnode) before a node is (de)selected. + onQueryExpand: null, // Callback(flag, dtnode) before a node is expanded/collpsed. + + // High level event handlers + onPostInit: null, // Callback(isReloading, isError) when tree was (re)loaded. + onActivate: null, // Callback(dtnode) when a node is activated. + onDeactivate: null, // Callback(dtnode) when a node is deactivated. + onSelect: null, // Callback(flag, dtnode) when a node is (de)selected. + onExpand: null, // Callback(flag, dtnode) when a node is expanded/collapsed. + onLazyRead: null, // Callback(dtnode) when a lazy node is expanded for the first time. + onCustomRender: null, // Callback(dtnode) before a node is rendered. Return a HTML string to override. + onCreate: null, // Callback(dtnode, nodeSpan) after a node was rendered for the first time. + onRender: null, // Callback(dtnode, nodeSpan) after a node was rendered. + // postProcess is similar to the standard dataFilter hook, + // but it is also called for JSONP + postProcess: null, // Callback(data, dataType) before an Ajax result is passed to dynatree + + // Drag'n'drop support + dnd: { + // Make tree nodes draggable: + onDragStart: null, // Callback(sourceNode), return true, to enable dnd + onDragStop: null, // Callback(sourceNode) +// helper: null, + revert: false, // true: slide helper back to source if drop is rejected + // Make tree nodes accept draggables + autoExpandMS: 1000, // Expand nodes after n milliseconds of hovering. + preventVoidMoves: true, // Prevent dropping nodes 'before self', etc. + onDragEnter: null, // Callback(targetNode, sourceNode, ui, draggable) + onDragOver: null, // Callback(targetNode, sourceNode, hitMode) + onDrop: null, // Callback(targetNode, sourceNode, hitMode, ui, draggable) + onDragLeave: null // Callback(targetNode, sourceNode) + }, + ajaxDefaults: { // Used by initAjax option + cache: false, // false: Append random '_' argument to the request url to prevent caching. + timeout: 0, // >0: Make sure we get an ajax error for invalid URLs + dataType: "json" // Expect json format and pass json object to callbacks. + }, + strings: { + loading: "Loading…", + loadError: "Load error!" + }, + generateIds: false, // Generate id attributes like <span id='dynatree-id-KEY'> + idPrefix: "dynatree-id-", // Used to generate node id's like <span id="dynatree-id-<key>">. + keyPathSeparator: "/", // Used by node.getKeyPath() and tree.loadKeyPath(). +// cookieId: "dynatree-cookie", // Choose a more unique name, to allow multiple trees. + cookieId: "dynatree", // Choose a more unique name, to allow multiple trees. + cookie: { + expires: null //7, // Days or Date; null: session cookie +// path: "/", // Defaults to current page +// domain: "jquery.com", +// secure: true + }, + // Class names used, when rendering the HTML markup. + // Note: + // These settings only apply on initialisation. + // If only single entries are passed for options.classNames, all other + // values are still set to default. + classNames: { + container: "dynatree-container", + node: "dynatree-node", + folder: "dynatree-folder", +// document: "dynatree-document", + + empty: "dynatree-empty", + vline: "dynatree-vline", + expander: "dynatree-expander", + connector: "dynatree-connector", + checkbox: "dynatree-checkbox", + nodeIcon: "dynatree-icon", + title: "dynatree-title", + noConnector: "dynatree-no-connector", + + nodeError: "dynatree-statusnode-error", + nodeWait: "dynatree-statusnode-wait", + hidden: "dynatree-hidden", + combinedExpanderPrefix: "dynatree-exp-", + combinedIconPrefix: "dynatree-ico-", + nodeLoading: "dynatree-loading", +// disabled: "dynatree-disabled", + hasChildren: "dynatree-has-children", + active: "dynatree-active", + selected: "dynatree-selected", + expanded: "dynatree-expanded", + lazy: "dynatree-lazy", + focused: "dynatree-focused", + partsel: "dynatree-partsel", + lastsib: "dynatree-lastsib" + }, + debugLevel: 2, // 0:quiet, 1:normal, 2:debug + + // ------------------------------------------------------------------------ + lastentry: undefined +}; +// +if(versionCompare($.ui.version, "1.8") < 0){ + $.ui.dynatree.defaults = $.ui.dynatree.prototype.options; +} + +/******************************************************************************* + * Reserved data attributes for a tree node. + */ +$.ui.dynatree.nodedatadefaults = { + title: null, // (required) Displayed name of the node (html is allowed here) + key: null, // May be used with activate(), select(), find(), ... + isFolder: false, // Use a folder icon. Also the node is expandable but not selectable. + isLazy: false, // Call onLazyRead(), when the node is expanded for the first time to allow for delayed creation of children. + tooltip: null, // Show this popup text. + href: null, // Added to the generated <a> tag. + icon: null, // Use a custom image (filename relative to tree.options.imagePath). 'null' for default icon, 'false' for no icon. + addClass: null, // Class name added to the node's span tag. + noLink: false, // Use <span> instead of <a> tag for this node + activate: false, // Initial active status. + focus: false, // Initial focused status. + expand: false, // Initial expanded status. + select: false, // Initial selected status. + hideCheckbox: false, // Suppress checkbox display for this node. + unselectable: false, // Prevent selection. +// disabled: false, + // The following attributes are only valid if passed to some functions: + children: null, // Array of child nodes. + // NOTE: we can also add custom attributes here. + // This may then also be used in the onActivate(), onSelect() or onLazyTree() callbacks. + // ------------------------------------------------------------------------ + lastentry: undefined +}; + +/******************************************************************************* + * Drag and drop support + */ +function _initDragAndDrop(tree) { + var dnd = tree.options.dnd || null; + // Register 'connectToDynatree' option with ui.draggable + if(dnd && (dnd.onDragStart || dnd.onDrop)) { + _registerDnd(); + } + // Attach ui.draggable to this Dynatree instance + if(dnd && dnd.onDragStart ) { + tree.$tree.draggable({ + addClasses: false, + appendTo: "body", + containment: false, + delay: 0, + distance: 4, +// revert: false, + // slide back, when dropping over non-target + revert: dnd.revert !== true ? false : function(dropped){ + // This is called by ui-draggable._mouseStop() when a drag stops. + // Return `true` to let the helper slide back. + logMsg("draggable.revert(), dropped=", dropped); + if(typeof dropped === "boolean"){ + // dropped == true, when dropped over a simple, valid droppable target. + // false, when dropped outside a drop target. + return !dropped; + } + // Drop comes from another tree. Default behavior is to assume + // a valid drop, since we are over a drop-target. + // Therefore we have to make an extra check, if the target node + // was rejected by a Dynatree callback. + var helper = $.ui.ddmanager && $.ui.ddmanager.current && $.ui.ddmanager.current.helper; + var isRejected = helper && helper.hasClass("dynatree-drop-reject"); + return isRejected; + }, + scroll: true, // issue 244: enable scrolling (if ul.dynatree-container) + scrollSpeed: 7, + scrollSensitivity: 10, + // Delegate draggable.start, drag, and stop events to our handler + connectToDynatree: true, + // Let source tree create the helper element + helper: function(event) { + var sourceNode = $.ui.dynatree.getNode(event.target); + if(!sourceNode){ // issue 211 + return "<div></div>"; + } + return sourceNode.tree._onDragEvent("helper", sourceNode, null, event, null, null); + }, + start: function(event, ui) { + // See issues 211, 268, 278 +// var sourceNode = $.ui.dynatree.getNode(event.target); + var sourceNode = ui.helper.data("dtSourceNode"); + return !!sourceNode; // Abort dragging if no Node could be found + } + }); + } + // Attach ui.droppable to this Dynatree instance + if(dnd && dnd.onDrop) { + tree.$tree.droppable({ + addClasses: false, + tolerance: "pointer", +// tolerance: "intersect", + greedy: false + }); + } +} + +//--- Extend ui.draggable event handling -------------------------------------- +var didRegisterDnd = false; +var _registerDnd = function() { + if(didRegisterDnd){ + return; + } + // Register proxy-functions for draggable.start/drag/stop + $.ui.plugin.add("draggable", "connectToDynatree", { + start: function(event, ui) { + // issue 386 + var draggable = $(this).data("ui-draggable") || $(this).data("draggable"), + sourceNode = ui.helper.data("dtSourceNode") || null; +// logMsg("draggable-connectToDynatree.start, %s", sourceNode); +// logMsg(" this: %o", this); +// logMsg(" event: %o", event); +// logMsg(" draggable: %o", draggable); +// logMsg(" ui: %o", ui); + + if(sourceNode) { + // Adjust helper offset, so cursor is slightly outside top/left corner +// draggable.offset.click.top -= event.target.offsetTop; +// draggable.offset.click.left -= event.target.offsetLeft; + draggable.offset.click.top = -2; + draggable.offset.click.left = + 16; +// logMsg(" draggable2: %o", draggable); +// logMsg(" draggable.offset.click FIXED: %s/%s", draggable.offset.click.left, draggable.offset.click.top); + // Trigger onDragStart event + // TODO: when called as connectTo..., the return value is ignored(?) + return sourceNode.tree._onDragEvent("start", sourceNode, null, event, ui, draggable); + } + }, + drag: function(event, ui) { + // issue 386 + var draggable = $(this).data("ui-draggable") || $(this).data("draggable"), + sourceNode = ui.helper.data("dtSourceNode") || null, + prevTargetNode = ui.helper.data("dtTargetNode") || null, + targetNode = $.ui.dynatree.getNode(event.target); +// logMsg("$.ui.dynatree.getNode(%o): %s", event.target, targetNode); +// logMsg("connectToDynatree.drag: helper: %o", ui.helper[0]); + if(event.target && !targetNode){ + // We got a drag event, but the targetNode could not be found + // at the event location. This may happen, + // 1. if the mouse jumped over the drag helper, + // 2. or if non-dynatree element is dragged + // We ignore it: + var isHelper = $(event.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length > 0; + if(isHelper){ +// logMsg("Drag event over helper: ignored."); + return; + } + } +// logMsg("draggable-connectToDynatree.drag: targetNode(from event): %s, dtTargetNode: %s", targetNode, ui.helper.data("dtTargetNode")); + ui.helper.data("dtTargetNode", targetNode); + // Leaving a tree node + if(prevTargetNode && prevTargetNode !== targetNode ) { + prevTargetNode.tree._onDragEvent("leave", prevTargetNode, sourceNode, event, ui, draggable); + } + if(targetNode){ + if(!targetNode.tree.options.dnd.onDrop) { + // not enabled as drop target + } else if(targetNode === prevTargetNode) { + // Moving over same node + targetNode.tree._onDragEvent("over", targetNode, sourceNode, event, ui, draggable); + }else{ + // Entering this node first time + targetNode.tree._onDragEvent("enter", targetNode, sourceNode, event, ui, draggable); + } + } + // else go ahead with standard event handling + }, + stop: function(event, ui) { + // issue 386 + var draggable = $(this).data("ui-draggable") || $(this).data("draggable"), + sourceNode = ui.helper.data("dtSourceNode") || null, + targetNode = ui.helper.data("dtTargetNode") || null, +// mouseDownEvent = draggable._mouseDownEvent, + eventType = event.type, + dropped = (eventType == "mouseup" && event.which == 1); + logMsg("draggable-connectToDynatree.stop: targetNode(from event): %s, dtTargetNode: %s", targetNode, ui.helper.data("dtTargetNode")); +// logMsg("draggable-connectToDynatree.stop, %s", sourceNode); +// logMsg(" type: %o, downEvent: %o, upEvent: %o", eventType, mouseDownEvent, event); +// logMsg(" targetNode: %o", targetNode); + if(!dropped){ + logMsg("Drag was cancelled"); + } + if(targetNode) { + if(dropped){ + targetNode.tree._onDragEvent("drop", targetNode, sourceNode, event, ui, draggable); + } + targetNode.tree._onDragEvent("leave", targetNode, sourceNode, event, ui, draggable); + } + if(sourceNode){ + sourceNode.tree._onDragEvent("stop", sourceNode, null, event, ui, draggable); + } + } + }); + didRegisterDnd = true; +}; + +// --------------------------------------------------------------------------- +}(jQuery)); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/icons.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/icons.gif new file mode 100644 index 0000000000000000000000000000000000000000..6e237a0f44fbaae7fe406ddc9597918ecf5a997a Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/icons.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/loading.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..2a96840f48be2e10fda36b232b524244159cad8e Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/loading.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/ui.dynatree.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/ui.dynatree.css new file mode 100644 index 0000000000000000000000000000000000000000..1211ff281d660f8ae2b15ac4cce0d0a308054b8e --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin-vista/ui.dynatree.css @@ -0,0 +1,453 @@ +/******************************************************************************* + * Tree container + */ +ul.dynatree-container +{ + font-family: tahoma, arial, helvetica; + font-size: 10pt; /* font size should not be too big */ + white-space: nowrap; + padding: 3px; + margin: 0; /* issue 201 */ + background-color: white; + border: 1px dotted gray; + overflow: auto; + height: 100%; /* issue 263 */ +} + +ul.dynatree-container ul +{ + padding: 0 0 0 16px; + margin: 0; +} + +ul.dynatree-container li +{ + list-style-image: none; + list-style-position: outside; + list-style-type: none; + -moz-background-clip:border; + -moz-background-inline-policy: continuous; + -moz-background-origin: padding; + background-attachment: scroll; + background-color: transparent; + background-position: 0 0; + background-repeat: repeat-y; + background-image: none; /* no v-lines */ + + margin:0; + padding:1px 0 0 0; +} +/* Suppress lines for last child node */ +ul.dynatree-container li.dynatree-lastsib +{ + background-image: none; +} +/* Suppress lines if level is fixed expanded (option minExpandLevel) */ +ul.dynatree-no-connector > li +{ + background-image: none; +} + +/* Style, when control is disabled */ +.ui-dynatree-disabled ul.dynatree-container +{ + opacity: 0.5; +/* filter: alpha(opacity=50); /* Yields a css warning */ + background-color: silver; +} + + +/******************************************************************************* + * Common icon definitions + */ +span.dynatree-empty, +span.dynatree-vline, +span.dynatree-connector, +span.dynatree-expander, +span.dynatree-icon, +span.dynatree-checkbox, +span.dynatree-radio, +span.dynatree-drag-helper-img, +#dynatree-drop-marker +{ + width: 16px; + height: 16px; +/* display: -moz-inline-box; /* @ FF 1+2 removed for issue 221*/ +/* -moz-box-align: start; /* issue 221 */ + display: inline-block; /* Required to make a span sizeable */ + vertical-align: top; + background-repeat: no-repeat; + background-position: left; + background-image: url("icons.gif"); + background-position: 0 0; +} + +/** Used by 'icon' node option: */ +ul.dynatree-container img +{ + width: 16px; + height: 16px; + margin-left: 3px; + vertical-align: top; + border-style: none; +} + + +/******************************************************************************* + * Lines and connectors + */ + +/* +span.dynatree-empty +{ +} +span.dynatree-vline +{ +} +*/ +span.dynatree-connector +{ + background-image: none; +} +/* +.dynatree-lastsib span.dynatree-connector +{ +} +*/ +/******************************************************************************* + * Expander icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-exp- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'd': lazy (Delayed) + * 3rd character (optional): 'l': Last sibling + */ + +span.dynatree-expander +{ + background-position: 0px -80px; + cursor: pointer; +} +span.dynatree-expander:hover +{ + background-position: -16px -80px; +} +.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */ +{ +} +.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */ +{ +} +.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */ +{ +} +.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */ +.dynatree-exp-ed span.dynatree-expander, /* Expanded, delayed, not last sibling */ +.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */ +.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */ +{ + background-position: -32px -80px; +} +.dynatree-exp-e span.dynatree-expander:hover, /* Expanded, not delayed, not last sibling */ +.dynatree-exp-ed span.dynatree-expander:hover, /* Expanded, delayed, not last sibling */ +.dynatree-exp-el span.dynatree-expander:hover, /* Expanded, not delayed, last sibling */ +.dynatree-exp-edl span.dynatree-expander:hover /* Expanded, delayed, last sibling */ +{ + background-position: -48px -80px; +} +.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */ +{ + background-position: 0 0; + background-image: url("loading.gif"); +} + + +/******************************************************************************* + * Checkbox icon + */ +span.dynatree-checkbox +{ + margin-left: 3px; + background-position: 0px -32px; +} +span.dynatree-checkbox:hover +{ + background-position: -16px -32px; +} + +.dynatree-partsel span.dynatree-checkbox +{ + background-position: -64px -32px; +} +.dynatree-partsel span.dynatree-checkbox:hover +{ + background-position: -80px -32px; +} + +.dynatree-selected span.dynatree-checkbox +{ + background-position: -32px -32px; +} +.dynatree-selected span.dynatree-checkbox:hover +{ + background-position: -48px -32px; +} + +/******************************************************************************* + * Radiobutton icon + * This is a customization, that may be activated by overriding the 'checkbox' + * class name as 'dynatree-radio' in the tree options. + */ +span.dynatree-radio +{ + margin-left: 3px; + background-position: 0px -48px; +} +span.dynatree-radio:hover +{ + background-position: -16px -48px; +} + +.dynatree-partsel span.dynatree-radio +{ + background-position: -64px -48px; +} +.dynatree-partsel span.dynatree-radio:hover +{ + background-position: -80px -48px; +} + +.dynatree-selected span.dynatree-radio +{ + background-position: -32px -48px; +} +.dynatree-selected span.dynatree-radio:hover +{ + background-position: -48px -48px; +} + +/******************************************************************************* + * Node type icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-ico- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'f': folder + */ + +span.dynatree-icon /* Default icon */ +{ + margin-left: 3px; + background-position: 0px 0px; +} + +.dynatree-has-children span.dynatree-icon /* Default icon */ +{ +/* background-position: 0px -16px; */ +} + +.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */ +{ + background-position: 0px -16px; +} + +.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */ +{ + background-position: -64px -16px; +} + +/* Status node icons */ + +.dynatree-statusnode-wait span.dynatree-icon +{ + background-image: url("loading.gif"); +} + +.dynatree-statusnode-error span.dynatree-icon +{ + background-position: 0px -112px; +/* background-image: url("ltError.gif");*/ +} + +/******************************************************************************* + * Node titles + */ + +/* @Chrome: otherwise hit area of node titles is broken (issue 133) + Removed again for issue 165; (133 couldn't be reproduced) */ +span.dynatree-node +{ +/* display: -moz-inline-box; /* issue 133, 165, 172, 192. removed for issue 221 */ +/* -moz-box-align: start; /* issue 221 */ + display: inline-block; /* issue 373 Required to make a span sizeable */ + vertical-align: top; +} + + +/* Remove blue color and underline from title links */ +ul.dynatree-container a +/*, ul.dynatree-container a:visited*/ +{ + color: black; /* inherit doesn't work on IE */ + text-decoration: none; + vertical-align: top; + margin: 0px; + margin-left: 3px; +/* outline: 0; /* @ Firefox, prevent dotted border after click */ + /* Set transparent border to prevent jumping when active node gets a border + (we can do this, because this theme doesn't use vertical lines) + */ + border: 1px solid white; /* Note: 'transparent' would not work in IE6 */ + +} + +ul.dynatree-container a:hover +{ +/* text-decoration: underline; */ + background: #F2F7FD; /* light blue */ + border-color: #B8D6FB; /* darker light blue */ +} + +span.dynatree-node a +{ + display: inline-block; /* Better alignment, when title contains <br> */ +/* vertical-align: top;*/ + padding-left: 3px; + padding-right: 3px; /* Otherwise italic font will be outside bounds */ + /* line-height: 16px; /* should be the same as img height, in case 16 px */ +} +span.dynatree-folder a +{ +/* font-weight: bold; */ /* custom */ +} + +ul.dynatree-container a:focus, +span.dynatree-focused a:link /* @IE */ +{ + background-color: #EFEBDE; /* gray */ +} + +span.dynatree-has-children a +{ +/* font-style: oblique; /* custom: */ +} + +span.dynatree-expanded a +{ +} + +span.dynatree-selected a +{ +/* color: green; */ + font-style: italic; +} + +span.dynatree-active a +{ + border: 1px solid #99DEFD; + background-color: #D8F0FA; +} + +/******************************************************************************* + * Drag'n'drop support + */ + +/*** Helper object ************************************************************/ +div.dynatree-drag-helper +{ +} +div.dynatree-drag-helper a +{ + border: 1px solid gray; + background-color: white; + padding-left: 5px; + padding-right: 5px; + opacity: 0.8; +} +span.dynatree-drag-helper-img +{ + /* + position: relative; + left: -16px; + */ +} +div.dynatree-drag-helper /*.dynatree-drop-accept*/ +{ +/* border-color: green; + background-color: red;*/ +} +div.dynatree-drop-accept span.dynatree-drag-helper-img +{ + background-position: -32px -112px; +} +div.dynatree-drag-helper.dynatree-drop-reject +{ + border-color: red; +} +div.dynatree-drop-reject span.dynatree-drag-helper-img +{ + background-position: -16px -112px; +} + +/*** Drop marker icon *********************************************************/ + +#dynatree-drop-marker +{ + width: 24px; + position: absolute; + background-position: 0 -128px; + margin: 0; +} +#dynatree-drop-marker.dynatree-drop-after, +#dynatree-drop-marker.dynatree-drop-before +{ + width:64px; + background-position: 0 -144px; +} +#dynatree-drop-marker.dynatree-drop-copy +{ + background-position: -64px -128px; +} +#dynatree-drop-marker.dynatree-drop-move +{ + background-position: -64px -128px; +} + +/*** Source node while dragging ***********************************************/ + +span.dynatree-drag-source +{ + /* border: 1px dotted gray; */ + background-color: #e0e0e0; +} +span.dynatree-drag-source a +{ + color: gray; +} + +/*** Target node while dragging cursor is over it *****************************/ + +span.dynatree-drop-target +{ + /*border: 1px solid gray;*/ +} +span.dynatree-drop-target a +{ +} +span.dynatree-drop-target.dynatree-drop-accept a +{ + /*border: 1px solid green;*/ + background-color: #3169C6 !important; + color: white !important; /* @ IE6 */ + text-decoration: none; +} +span.dynatree-drop-target.dynatree-drop-reject +{ + /*border: 1px solid red;*/ +} +span.dynatree-drop-target.dynatree-drop-after a +{ +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/icons-rtl.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/icons-rtl.gif new file mode 100644 index 0000000000000000000000000000000000000000..a29b5fbc967378b8665df3513f4d8cf648f73809 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/icons-rtl.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/icons.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/icons.gif new file mode 100644 index 0000000000000000000000000000000000000000..a58eb93f12a2c63382d6b47f070fa03ffec7fd5f Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/icons.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/loading.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..251df0544cd63db56160b5a53c9e203999a561e6 Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/loading.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/ui.dynatree.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/ui.dynatree.css new file mode 100644 index 0000000000000000000000000000000000000000..1a57a04a963f1b6e31560048471caa83f173ca80 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/ui.dynatree.css @@ -0,0 +1,441 @@ +/******************************************************************************* + * Tree container + */ +ul.dynatree-container +{ + font-family: tahoma, arial, helvetica; + font-size: 10pt; /* font size should not be too big */ + white-space: nowrap; + padding: 3px; + margin: 0; /* issue 201 */ + background-color: white; + border: 1px dotted gray; + overflow: auto; + height: 100%; /* issue 263 */ +} + +ul.dynatree-container ul +{ + padding: 0 0 0 16px; + margin: 0; +} + +ul.dynatree-container li +{ + list-style-image: none; + list-style-position: outside; + list-style-type: none; + -moz-background-clip:border; + -moz-background-inline-policy: continuous; + -moz-background-origin: padding; + background-attachment: scroll; + background-color: transparent; + background-repeat: repeat-y; + background-image: url("vline.gif"); + background-position: 0 0; + /* + background-image: url("icons_96x256.gif"); + background-position: -80px -64px; + */ + margin: 0; + padding: 1px 0 0 0; +} +/* Suppress lines for last child node */ +ul.dynatree-container li.dynatree-lastsib +{ + background-image: none; +} +/* Suppress lines if level is fixed expanded (option minExpandLevel) */ +ul.dynatree-no-connector > li +{ + background-image: none; +} + +/* Style, when control is disabled */ +.ui-dynatree-disabled ul.dynatree-container +{ + opacity: 0.5; +/* filter: alpha(opacity=50); /* Yields a css warning */ + background-color: silver; +} + +/******************************************************************************* + * Common icon definitions + */ +span.dynatree-empty, +span.dynatree-vline, +span.dynatree-connector, +span.dynatree-expander, +span.dynatree-icon, +span.dynatree-checkbox, +span.dynatree-radio, +span.dynatree-drag-helper-img, +#dynatree-drop-marker +{ + width: 16px; + height: 16px; +/* display: -moz-inline-box; /* @ FF 1+2 removed for issue 221 */ +/* -moz-box-align: start; /* issue 221 */ + display: inline-block; /* Required to make a span sizeable */ + vertical-align: top; + background-repeat: no-repeat; + background-position: left; + background-image: url("icons.gif"); + background-position: 0 0; +} + +/** Used by 'icon' node option: */ +ul.dynatree-container img +{ + width: 16px; + height: 16px; + margin-left: 3px; + vertical-align: top; + border-style: none; +} + + +/******************************************************************************* + * Lines and connectors + */ + +span.dynatree-connector +{ + background-position: -16px -64px; +} + +/******************************************************************************* + * Expander icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-exp- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'd': lazy (Delayed) + * 3rd character (optional): 'l': Last sibling + */ + +span.dynatree-expander +{ + background-position: 0px -80px; + cursor: pointer; +} +.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */ +{ + background-position: 0px -96px; +} +.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */ +{ + background-position: -64px -80px; +} +.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */ +{ + background-position: -64px -96px; +} +.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */ +.dynatree-exp-ed span.dynatree-expander /* Expanded, delayed, not last sibling */ +{ + background-position: -32px -80px; +} +.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */ +.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */ +{ + background-position: -32px -96px; +} +.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */ +{ + background-position: 0 0; + background-image: url("loading.gif"); +} + + +/******************************************************************************* + * Checkbox icon + */ +span.dynatree-checkbox +{ + margin-left: 3px; + background-position: 0px -32px; +} +span.dynatree-checkbox:hover +{ + background-position: -16px -32px; +} + +.dynatree-partsel span.dynatree-checkbox +{ + background-position: -64px -32px; +} +.dynatree-partsel span.dynatree-checkbox:hover +{ + background-position: -80px -32px; +} + +.dynatree-selected span.dynatree-checkbox +{ + background-position: -32px -32px; +} +.dynatree-selected span.dynatree-checkbox:hover +{ + background-position: -48px -32px; +} + +/******************************************************************************* + * Radiobutton icon + * This is a customization, that may be activated by overriding the 'checkbox' + * class name as 'dynatree-radio' in the tree options. + */ +span.dynatree-radio +{ + margin-left: 3px; + background-position: 0px -48px; +} +span.dynatree-radio:hover +{ + background-position: -16px -48px; +} + +.dynatree-partsel span.dynatree-radio +{ + background-position: -64px -48px; +} +.dynatree-partsel span.dynatree-radio:hover +{ + background-position: -80px -48px; +} + +.dynatree-selected span.dynatree-radio +{ + background-position: -32px -48px; +} +.dynatree-selected span.dynatree-radio:hover +{ + background-position: -48px -48px; +} + +/******************************************************************************* + * Node type icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-ico- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'f': folder + */ + +span.dynatree-icon /* Default icon */ +{ + margin-left: 3px; + background-position: 0px 0px; +} + +.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */ +{ + background-position: 0px -16px; +} + +.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */ +{ + background-position: -64px -16px; +} + +/* Status node icons */ + +.dynatree-statusnode-wait span.dynatree-icon +{ + background-image: url("loading.gif"); +} + +.dynatree-statusnode-error span.dynatree-icon +{ + background-position: 0px -112px; +/* background-image: url("ltError.gif");*/ +} + +/******************************************************************************* + * Node titles + */ + +/* @Chrome: otherwise hit area of node titles is broken (issue 133) + Removed again for issue 165; (133 couldn't be reproduced) */ +span.dynatree-node +{ +/* display: -moz-inline-box; /* issue 133, 165, 172, 192. removed for issue 221*/ +/* -moz-box-align: start; /* issue 221 */ + display: inline-block; /* issue 373 Required to make a span sizeable */ + vertical-align: top; +} + + +/* Remove blue color and underline from title links */ +ul.dynatree-container a +/*, ul.dynatree-container a:visited*/ +{ + color: black; /* inherit doesn't work on IE */ + text-decoration: none; + vertical-align: top; + margin: 0px; + margin-left: 3px; +/* outline: 0; /* @ Firefox, prevent dotted border after click */ +} + +ul.dynatree-container a:hover +{ +/* text-decoration: underline; */ + background-color: #F2F7FD; /* light blue */ + border-color: #B8D6FB; /* darker light blue */ +} + +span.dynatree-node a +{ + font-size: 10pt; /* required for IE, quirks mode */ + display: inline-block; /* Better alignment, when title contains <br> */ +/* vertical-align: top;*/ + padding-left: 3px; + padding-right: 3px; /* Otherwise italic font will be outside bounds */ + /* line-height: 16px; /* should be the same as img height, in case 16 px */ +} +span.dynatree-folder a +{ + font-weight: bold; +} + +ul.dynatree-container a:focus, +span.dynatree-focused a:link /* @IE */ +{ + background-color: #EFEBDE; /* gray */ +} + +span.dynatree-has-children a +{ +} + +span.dynatree-expanded a +{ +} + +span.dynatree-selected a +{ + color: green; + font-style: italic; +} + +span.dynatree-active a +{ + background-color: #3169C6 !important; + color: white !important; /* @ IE6 */ +} + +/******************************************************************************* + * Drag'n'drop support + */ + +/*** Helper object ************************************************************/ +div.dynatree-drag-helper +{ +} +div.dynatree-drag-helper a +{ + border: 1px solid gray; + background-color: white; + padding-left: 5px; + padding-right: 5px; + opacity: 0.8; +} +span.dynatree-drag-helper-img +{ + /* + position: relative; + left: -16px; + */ +} +div.dynatree-drag-helper /*.dynatree-drop-accept*/ +{ + +/* border-color: green; + background-color: red;*/ +} +div.dynatree-drop-accept span.dynatree-drag-helper-img +{ + background-position: -32px -112px; +} +div.dynatree-drag-helper.dynatree-drop-reject +{ + border-color: red; +} +div.dynatree-drop-reject span.dynatree-drag-helper-img +{ + background-position: -16px -112px; +} + +/*** Drop marker icon *********************************************************/ + +#dynatree-drop-marker +{ + width: 24px; + position: absolute; + background-position: 0 -128px; + margin: 0; +/* border: 1px solid red; */ +} +#dynatree-drop-marker.dynatree-drop-after, +#dynatree-drop-marker.dynatree-drop-before +{ + width:64px; + background-position: 0 -144px; +} +#dynatree-drop-marker.dynatree-drop-copy +{ + background-position: -64px -128px; +} +#dynatree-drop-marker.dynatree-drop-move +{ + background-position: -64px -128px; +} + +/*** Source node while dragging ***********************************************/ + +span.dynatree-drag-source +{ + /* border: 1px dotted gray; */ + background-color: #e0e0e0; +} +span.dynatree-drag-source a +{ + color: gray; +} + +/*** Target node while dragging cursor is over it *****************************/ + +span.dynatree-drop-target +{ + /*border: 1px solid gray;*/ +} +span.dynatree-drop-target a +{ +} +span.dynatree-drop-target.dynatree-drop-accept a +{ + /*border: 1px solid green;*/ + background-color: #3169C6 !important; + color: white !important; /* @ IE6 */ + text-decoration: none; +} +span.dynatree-drop-target.dynatree-drop-reject +{ + /*border: 1px solid red;*/ +} +span.dynatree-drop-target.dynatree-drop-after a +{ +} + + +/******************************************************************************* + * Custom node classes (sample) + */ + +span.custom1 a +{ + background-color: maroon; + color: yellow; +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/vline-rtl.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/vline-rtl.gif new file mode 100644 index 0000000000000000000000000000000000000000..0400cb3eeace6abda62ae41957f3e41907a3aa6b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/vline-rtl.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/vline.gif b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/vline.gif new file mode 100644 index 0000000000000000000000000000000000000000..1b00ae50e0f1538d985811207b0af2a85d1d128b Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/src/skin/vline.gif differ diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/qunit.css b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/qunit.css new file mode 100644 index 0000000000000000000000000000000000000000..d7fc0c8eccbfbf2a35d803948f853eb541cf47b2 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/qunit.css @@ -0,0 +1,244 @@ +/** + * QUnit v1.11.0 - A JavaScript Unit Testing Framework + * + * http://qunitjs.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ + +/** Font Family and Sizes */ + +#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { + font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; +} + +#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } +#qunit-tests { font-size: smaller; } + + +/** Resets */ + +#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { + margin: 0; + padding: 0; +} + + +/** Header */ + +#qunit-header { + padding: 0.5em 0 0.5em 1em; + + color: #8699a4; + background-color: #0d3349; + + font-size: 1.5em; + line-height: 1em; + font-weight: normal; + + border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + -webkit-border-top-right-radius: 5px; + -webkit-border-top-left-radius: 5px; +} + +#qunit-header a { + text-decoration: none; + color: #c2ccd1; +} + +#qunit-header a:hover, +#qunit-header a:focus { + color: #fff; +} + +#qunit-testrunner-toolbar label { + display: inline-block; + padding: 0 .5em 0 .1em; +} + +#qunit-banner { + height: 5px; +} + +#qunit-testrunner-toolbar { + padding: 0.5em 0 0.5em 2em; + color: #5E740B; + background-color: #eee; + overflow: hidden; +} + +#qunit-userAgent { + padding: 0.5em 0 0.5em 2.5em; + background-color: #2b81af; + color: #fff; + text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; +} + +#qunit-modulefilter-container { + float: right; +} + +/** Tests: Pass/Fail */ + +#qunit-tests { + list-style-position: inside; +} + +#qunit-tests li { + padding: 0.4em 0.5em 0.4em 2.5em; + border-bottom: 1px solid #fff; + list-style-position: inside; +} + +#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { + display: none; +} + +#qunit-tests li strong { + cursor: pointer; +} + +#qunit-tests li a { + padding: 0.5em; + color: #c2ccd1; + text-decoration: none; +} +#qunit-tests li a:hover, +#qunit-tests li a:focus { + color: #000; +} + +#qunit-tests li .runtime { + float: right; + font-size: smaller; +} + +.qunit-assert-list { + margin-top: 0.5em; + padding: 0.5em; + + background-color: #fff; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +.qunit-collapsed { + display: none; +} + +#qunit-tests table { + border-collapse: collapse; + margin-top: .2em; +} + +#qunit-tests th { + text-align: right; + vertical-align: top; + padding: 0 .5em 0 0; +} + +#qunit-tests td { + vertical-align: top; +} + +#qunit-tests pre { + margin: 0; + white-space: pre-wrap; + word-wrap: break-word; +} + +#qunit-tests del { + background-color: #e0f2be; + color: #374e0c; + text-decoration: none; +} + +#qunit-tests ins { + background-color: #ffcaca; + color: #500; + text-decoration: none; +} + +/*** Test Counts */ + +#qunit-tests b.counts { color: black; } +#qunit-tests b.passed { color: #5E740B; } +#qunit-tests b.failed { color: #710909; } + +#qunit-tests li li { + padding: 5px; + background-color: #fff; + border-bottom: none; + list-style-position: inside; +} + +/*** Passing Styles */ + +#qunit-tests li li.pass { + color: #3c510c; + background-color: #fff; + border-left: 10px solid #C6E746; +} + +#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } +#qunit-tests .pass .test-name { color: #366097; } + +#qunit-tests .pass .test-actual, +#qunit-tests .pass .test-expected { color: #999999; } + +#qunit-banner.qunit-pass { background-color: #C6E746; } + +/*** Failing Styles */ + +#qunit-tests li li.fail { + color: #710909; + background-color: #fff; + border-left: 10px solid #EE5757; + white-space: pre; +} + +#qunit-tests > li:last-child { + border-radius: 0 0 5px 5px; + -moz-border-radius: 0 0 5px 5px; + -webkit-border-bottom-right-radius: 5px; + -webkit-border-bottom-left-radius: 5px; +} + +#qunit-tests .fail { color: #000000; background-color: #EE5757; } +#qunit-tests .fail .test-name, +#qunit-tests .fail .module-name { color: #000000; } + +#qunit-tests .fail .test-actual { color: #EE5757; } +#qunit-tests .fail .test-expected { color: green; } + +#qunit-banner.qunit-fail { background-color: #EE5757; } + + +/** Result */ + +#qunit-testresult { + padding: 0.5em 0.5em 0.5em 2.5em; + + color: #2b81af; + background-color: #D2E0E6; + + border-bottom: 1px solid white; +} +#qunit-testresult .module-name { + font-weight: bold; +} + +/** Fixture */ + +#qunit-fixture { + position: absolute; + top: -10000px; + left: -10000px; + width: 1000px; + height: 1000px; +} diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/qunit.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/qunit.js new file mode 100644 index 0000000000000000000000000000000000000000..302545f4038e59c89a3647d2d176f92f436953ec --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/qunit.js @@ -0,0 +1,2152 @@ +/** + * QUnit v1.11.0 - A JavaScript Unit Testing Framework + * + * http://qunitjs.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ + +(function( window ) { + +var QUnit, + assert, + config, + onErrorFnPrev, + testId = 0, + fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + // Keep a local reference to Date (GH-283) + Date = window.Date, + defined = { + setTimeout: typeof window.setTimeout !== "undefined", + sessionStorage: (function() { + var x = "qunit-test-string"; + try { + sessionStorage.setItem( x, x ); + sessionStorage.removeItem( x ); + return true; + } catch( e ) { + return false; + } + }()) + }, + /** + * Provides a normalized error string, correcting an issue + * with IE 7 (and prior) where Error.prototype.toString is + * not properly implemented + * + * Based on http://es5.github.com/#x15.11.4.4 + * + * @param {String|Error} error + * @return {String} error message + */ + errorString = function( error ) { + var name, message, + errorString = error.toString(); + if ( errorString.substring( 0, 7 ) === "[object" ) { + name = error.name ? error.name.toString() : "Error"; + message = error.message ? error.message.toString() : ""; + if ( name && message ) { + return name + ": " + message; + } else if ( name ) { + return name; + } else if ( message ) { + return message; + } else { + return "Error"; + } + } else { + return errorString; + } + }, + /** + * Makes a clone of an object using only Array or Object as base, + * and copies over the own enumerable properties. + * + * @param {Object} obj + * @return {Object} New object with only the own properties (recursively). + */ + objectValues = function( obj ) { + // Grunt 0.3.x uses an older version of jshint that still has jshint/jshint#392. + /*jshint newcap: false */ + var key, val, + vals = QUnit.is( "array", obj ) ? [] : {}; + for ( key in obj ) { + if ( hasOwn.call( obj, key ) ) { + val = obj[key]; + vals[key] = val === Object(val) ? objectValues(val) : val; + } + } + return vals; + }; + +function Test( settings ) { + extend( this, settings ); + this.assertions = []; + this.testNumber = ++Test.count; +} + +Test.count = 0; + +Test.prototype = { + init: function() { + var a, b, li, + tests = id( "qunit-tests" ); + + if ( tests ) { + b = document.createElement( "strong" ); + b.innerHTML = this.nameHtml; + + // `a` initialized at top of scope + a = document.createElement( "a" ); + a.innerHTML = "Rerun"; + a.href = QUnit.url({ testNumber: this.testNumber }); + + li = document.createElement( "li" ); + li.appendChild( b ); + li.appendChild( a ); + li.className = "running"; + li.id = this.id = "qunit-test-output" + testId++; + + tests.appendChild( li ); + } + }, + setup: function() { + if ( this.module !== config.previousModule ) { + if ( config.previousModule ) { + runLoggingCallbacks( "moduleDone", QUnit, { + name: config.previousModule, + failed: config.moduleStats.bad, + passed: config.moduleStats.all - config.moduleStats.bad, + total: config.moduleStats.all + }); + } + config.previousModule = this.module; + config.moduleStats = { all: 0, bad: 0 }; + runLoggingCallbacks( "moduleStart", QUnit, { + name: this.module + }); + } else if ( config.autorun ) { + runLoggingCallbacks( "moduleStart", QUnit, { + name: this.module + }); + } + + config.current = this; + + this.testEnvironment = extend({ + setup: function() {}, + teardown: function() {} + }, this.moduleTestEnvironment ); + + this.started = +new Date(); + runLoggingCallbacks( "testStart", QUnit, { + name: this.testName, + module: this.module + }); + + // allow utility functions to access the current test environment + // TODO why?? + QUnit.current_testEnvironment = this.testEnvironment; + + if ( !config.pollution ) { + saveGlobal(); + } + if ( config.notrycatch ) { + this.testEnvironment.setup.call( this.testEnvironment ); + return; + } + try { + this.testEnvironment.setup.call( this.testEnvironment ); + } catch( e ) { + QUnit.pushFailure( "Setup failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); + } + }, + run: function() { + config.current = this; + + var running = id( "qunit-testresult" ); + + if ( running ) { + running.innerHTML = "Running: <br/>" + this.nameHtml; + } + + if ( this.async ) { + QUnit.stop(); + } + + this.callbackStarted = +new Date(); + + if ( config.notrycatch ) { + this.callback.call( this.testEnvironment, QUnit.assert ); + this.callbackRuntime = +new Date() - this.callbackStarted; + return; + } + + try { + this.callback.call( this.testEnvironment, QUnit.assert ); + this.callbackRuntime = +new Date() - this.callbackStarted; + } catch( e ) { + this.callbackRuntime = +new Date() - this.callbackStarted; + + QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + ( e.message || e ), extractStacktrace( e, 0 ) ); + // else next test will carry the responsibility + saveGlobal(); + + // Restart the tests if they're blocking + if ( config.blocking ) { + QUnit.start(); + } + } + }, + teardown: function() { + config.current = this; + if ( config.notrycatch ) { + if ( typeof this.callbackRuntime === "undefined" ) { + this.callbackRuntime = +new Date() - this.callbackStarted; + } + this.testEnvironment.teardown.call( this.testEnvironment ); + return; + } else { + try { + this.testEnvironment.teardown.call( this.testEnvironment ); + } catch( e ) { + QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + ( e.message || e ), extractStacktrace( e, 1 ) ); + } + } + checkPollution(); + }, + finish: function() { + config.current = this; + if ( config.requireExpects && this.expected === null ) { + QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); + } else if ( this.expected !== null && this.expected !== this.assertions.length ) { + QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); + } else if ( this.expected === null && !this.assertions.length ) { + QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); + } + + var i, assertion, a, b, time, li, ol, + test = this, + good = 0, + bad = 0, + tests = id( "qunit-tests" ); + + this.runtime = +new Date() - this.started; + config.stats.all += this.assertions.length; + config.moduleStats.all += this.assertions.length; + + if ( tests ) { + ol = document.createElement( "ol" ); + ol.className = "qunit-assert-list"; + + for ( i = 0; i < this.assertions.length; i++ ) { + assertion = this.assertions[i]; + + li = document.createElement( "li" ); + li.className = assertion.result ? "pass" : "fail"; + li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); + ol.appendChild( li ); + + if ( assertion.result ) { + good++; + } else { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + + // store result when possible + if ( QUnit.config.reorder && defined.sessionStorage ) { + if ( bad ) { + sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); + } else { + sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); + } + } + + if ( bad === 0 ) { + addClass( ol, "qunit-collapsed" ); + } + + // `b` initialized at top of scope + b = document.createElement( "strong" ); + b.innerHTML = this.nameHtml + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>"; + + addEvent(b, "click", function() { + var next = b.parentNode.lastChild, + collapsed = hasClass( next, "qunit-collapsed" ); + ( collapsed ? removeClass : addClass )( next, "qunit-collapsed" ); + }); + + addEvent(b, "dblclick", function( e ) { + var target = e && e.target ? e.target : window.event.srcElement; + if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) { + target = target.parentNode; + } + if ( window.location && target.nodeName.toLowerCase() === "strong" ) { + window.location = QUnit.url({ testNumber: test.testNumber }); + } + }); + + // `time` initialized at top of scope + time = document.createElement( "span" ); + time.className = "runtime"; + time.innerHTML = this.runtime + " ms"; + + // `li` initialized at top of scope + li = id( this.id ); + li.className = bad ? "fail" : "pass"; + li.removeChild( li.firstChild ); + a = li.firstChild; + li.appendChild( b ); + li.appendChild( a ); + li.appendChild( time ); + li.appendChild( ol ); + + } else { + for ( i = 0; i < this.assertions.length; i++ ) { + if ( !this.assertions[i].result ) { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + } + + runLoggingCallbacks( "testDone", QUnit, { + name: this.testName, + module: this.module, + failed: bad, + passed: this.assertions.length - bad, + total: this.assertions.length, + duration: this.runtime + }); + + QUnit.reset(); + + config.current = undefined; + }, + + queue: function() { + var bad, + test = this; + + synchronize(function() { + test.init(); + }); + function run() { + // each of these can by async + synchronize(function() { + test.setup(); + }); + synchronize(function() { + test.run(); + }); + synchronize(function() { + test.teardown(); + }); + synchronize(function() { + test.finish(); + }); + } + + // `bad` initialized at top of scope + // defer when previous test run passed, if storage is available + bad = QUnit.config.reorder && defined.sessionStorage && + +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); + + if ( bad ) { + run(); + } else { + synchronize( run, true ); + } + } +}; + +// Root QUnit object. +// `QUnit` initialized at top of scope +QUnit = { + + // call on start of module test to prepend name to all tests + module: function( name, testEnvironment ) { + config.currentModule = name; + config.currentModuleTestEnvironment = testEnvironment; + config.modules[name] = true; + }, + + asyncTest: function( testName, expected, callback ) { + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + + QUnit.test( testName, expected, callback, true ); + }, + + test: function( testName, expected, callback, async ) { + var test, + nameHtml = "<span class='test-name'>" + escapeText( testName ) + "</span>"; + + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + + if ( config.currentModule ) { + nameHtml = "<span class='module-name'>" + escapeText( config.currentModule ) + "</span>: " + nameHtml; + } + + test = new Test({ + nameHtml: nameHtml, + testName: testName, + expected: expected, + async: async, + callback: callback, + module: config.currentModule, + moduleTestEnvironment: config.currentModuleTestEnvironment, + stack: sourceFromStacktrace( 2 ) + }); + + if ( !validTest( test ) ) { + return; + } + + test.queue(); + }, + + // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. + expect: function( asserts ) { + if (arguments.length === 1) { + config.current.expected = asserts; + } else { + return config.current.expected; + } + }, + + start: function( count ) { + // QUnit hasn't been initialized yet. + // Note: RequireJS (et al) may delay onLoad + if ( config.semaphore === undefined ) { + QUnit.begin(function() { + // This is triggered at the top of QUnit.load, push start() to the event loop, to allow QUnit.load to finish first + setTimeout(function() { + QUnit.start( count ); + }); + }); + return; + } + + config.semaphore -= count || 1; + // don't start until equal number of stop-calls + if ( config.semaphore > 0 ) { + return; + } + // ignore if start is called more often then stop + if ( config.semaphore < 0 ) { + config.semaphore = 0; + QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)", null, sourceFromStacktrace(2) ); + return; + } + // A slight delay, to avoid any current callbacks + if ( defined.setTimeout ) { + window.setTimeout(function() { + if ( config.semaphore > 0 ) { + return; + } + if ( config.timeout ) { + clearTimeout( config.timeout ); + } + + config.blocking = false; + process( true ); + }, 13); + } else { + config.blocking = false; + process( true ); + } + }, + + stop: function( count ) { + config.semaphore += count || 1; + config.blocking = true; + + if ( config.testTimeout && defined.setTimeout ) { + clearTimeout( config.timeout ); + config.timeout = window.setTimeout(function() { + QUnit.ok( false, "Test timed out" ); + config.semaphore = 1; + QUnit.start(); + }, config.testTimeout ); + } + } +}; + +// `assert` initialized at top of scope +// Asssert helpers +// All of these must either call QUnit.push() or manually do: +// - runLoggingCallbacks( "log", .. ); +// - config.current.assertions.push({ .. }); +// We attach it to the QUnit object *after* we expose the public API, +// otherwise `assert` will become a global variable in browsers (#341). +assert = { + /** + * Asserts rough true-ish result. + * @name ok + * @function + * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); + */ + ok: function( result, msg ) { + if ( !config.current ) { + throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); + } + result = !!result; + + var source, + details = { + module: config.current.module, + name: config.current.testName, + result: result, + message: msg + }; + + msg = escapeText( msg || (result ? "okay" : "failed" ) ); + msg = "<span class='test-message'>" + msg + "</span>"; + + if ( !result ) { + source = sourceFromStacktrace( 2 ); + if ( source ) { + details.source = source; + msg += "<table><tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr></table>"; + } + } + runLoggingCallbacks( "log", QUnit, details ); + config.current.assertions.push({ + result: result, + message: msg + }); + }, + + /** + * Assert that the first two arguments are equal, with an optional message. + * Prints out both actual and expected values. + * @name equal + * @function + * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); + */ + equal: function( actual, expected, message ) { + /*jshint eqeqeq:false */ + QUnit.push( expected == actual, actual, expected, message ); + }, + + /** + * @name notEqual + * @function + */ + notEqual: function( actual, expected, message ) { + /*jshint eqeqeq:false */ + QUnit.push( expected != actual, actual, expected, message ); + }, + + /** + * @name propEqual + * @function + */ + propEqual: function( actual, expected, message ) { + actual = objectValues(actual); + expected = objectValues(expected); + QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name notPropEqual + * @function + */ + notPropEqual: function( actual, expected, message ) { + actual = objectValues(actual); + expected = objectValues(expected); + QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name deepEqual + * @function + */ + deepEqual: function( actual, expected, message ) { + QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name notDeepEqual + * @function + */ + notDeepEqual: function( actual, expected, message ) { + QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); + }, + + /** + * @name strictEqual + * @function + */ + strictEqual: function( actual, expected, message ) { + QUnit.push( expected === actual, actual, expected, message ); + }, + + /** + * @name notStrictEqual + * @function + */ + notStrictEqual: function( actual, expected, message ) { + QUnit.push( expected !== actual, actual, expected, message ); + }, + + "throws": function( block, expected, message ) { + var actual, + expectedOutput = expected, + ok = false; + + // 'expected' is optional + if ( typeof expected === "string" ) { + message = expected; + expected = null; + } + + config.current.ignoreGlobalErrors = true; + try { + block.call( config.current.testEnvironment ); + } catch (e) { + actual = e; + } + config.current.ignoreGlobalErrors = false; + + if ( actual ) { + // we don't want to validate thrown error + if ( !expected ) { + ok = true; + expectedOutput = null; + // expected is a regexp + } else if ( QUnit.objectType( expected ) === "regexp" ) { + ok = expected.test( errorString( actual ) ); + // expected is a constructor + } else if ( actual instanceof expected ) { + ok = true; + // expected is a validation function which returns true is validation passed + } else if ( expected.call( {}, actual ) === true ) { + expectedOutput = null; + ok = true; + } + + QUnit.push( ok, actual, expectedOutput, message ); + } else { + QUnit.pushFailure( message, null, 'No exception was thrown.' ); + } + } +}; + +/** + * @deprecate since 1.8.0 + * Kept assertion helpers in root for backwards compatibility. + */ +extend( QUnit, assert ); + +/** + * @deprecated since 1.9.0 + * Kept root "raises()" for backwards compatibility. + * (Note that we don't introduce assert.raises). + */ +QUnit.raises = assert[ "throws" ]; + +/** + * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 + * Kept to avoid TypeErrors for undefined methods. + */ +QUnit.equals = function() { + QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); +}; +QUnit.same = function() { + QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); +}; + +// We want access to the constructor's prototype +(function() { + function F() {} + F.prototype = QUnit; + QUnit = new F(); + // Make F QUnit's constructor so that we can add to the prototype later + QUnit.constructor = F; +}()); + +/** + * Config object: Maintain internal state + * Later exposed as QUnit.config + * `config` initialized at top of scope + */ +config = { + // The queue of tests to run + queue: [], + + // block until document ready + blocking: true, + + // when enabled, show only failing tests + // gets persisted through sessionStorage and can be changed in UI via checkbox + hidepassed: false, + + // by default, run previously failed tests first + // very useful in combination with "Hide passed tests" checked + reorder: true, + + // by default, modify document.title when suite is done + altertitle: true, + + // when enabled, all tests must call expect() + requireExpects: false, + + // add checkboxes that are persisted in the query-string + // when enabled, the id is set to `true` as a `QUnit.config` property + urlConfig: [ + { + id: "noglobals", + label: "Check for Globals", + tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." + }, + { + id: "notrycatch", + label: "No try-catch", + tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." + } + ], + + // Set of all modules. + modules: {}, + + // logging callback queues + begin: [], + done: [], + log: [], + testStart: [], + testDone: [], + moduleStart: [], + moduleDone: [] +}; + +// Export global variables, unless an 'exports' object exists, +// in that case we assume we're in CommonJS (dealt with on the bottom of the script) +if ( typeof exports === "undefined" ) { + extend( window, QUnit ); + + // Expose QUnit object + window.QUnit = QUnit; +} + +// Initialize more QUnit.config and QUnit.urlParams +(function() { + var i, + location = window.location || { search: "", protocol: "file:" }, + params = location.search.slice( 1 ).split( "&" ), + length = params.length, + urlParams = {}, + current; + + if ( params[ 0 ] ) { + for ( i = 0; i < length; i++ ) { + current = params[ i ].split( "=" ); + current[ 0 ] = decodeURIComponent( current[ 0 ] ); + // allow just a key to turn on a flag, e.g., test.html?noglobals + current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; + urlParams[ current[ 0 ] ] = current[ 1 ]; + } + } + + QUnit.urlParams = urlParams; + + // String search anywhere in moduleName+testName + config.filter = urlParams.filter; + + // Exact match of the module name + config.module = urlParams.module; + + config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; + + // Figure out if we're running the tests from a server or not + QUnit.isLocal = location.protocol === "file:"; +}()); + +// Extend QUnit object, +// these after set here because they should not be exposed as global functions +extend( QUnit, { + assert: assert, + + config: config, + + // Initialize the configuration options + init: function() { + extend( config, { + stats: { all: 0, bad: 0 }, + moduleStats: { all: 0, bad: 0 }, + started: +new Date(), + updateRate: 1000, + blocking: false, + autostart: true, + autorun: false, + filter: "", + queue: [], + semaphore: 1 + }); + + var tests, banner, result, + qunit = id( "qunit" ); + + if ( qunit ) { + qunit.innerHTML = + "<h1 id='qunit-header'>" + escapeText( document.title ) + "</h1>" + + "<h2 id='qunit-banner'></h2>" + + "<div id='qunit-testrunner-toolbar'></div>" + + "<h2 id='qunit-userAgent'></h2>" + + "<ol id='qunit-tests'></ol>"; + } + + tests = id( "qunit-tests" ); + banner = id( "qunit-banner" ); + result = id( "qunit-testresult" ); + + if ( tests ) { + tests.innerHTML = ""; + } + + if ( banner ) { + banner.className = ""; + } + + if ( result ) { + result.parentNode.removeChild( result ); + } + + if ( tests ) { + result = document.createElement( "p" ); + result.id = "qunit-testresult"; + result.className = "result"; + tests.parentNode.insertBefore( result, tests ); + result.innerHTML = "Running...<br/> "; + } + }, + + // Resets the test setup. Useful for tests that modify the DOM. + reset: function() { + var fixture = id( "qunit-fixture" ); + if ( fixture ) { + fixture.innerHTML = config.fixture; + } + }, + + // Trigger an event on an element. + // @example triggerEvent( document.body, "click" ); + triggerEvent: function( elem, type, event ) { + if ( document.createEvent ) { + event = document.createEvent( "MouseEvents" ); + event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, + 0, 0, 0, 0, 0, false, false, false, false, 0, null); + + elem.dispatchEvent( event ); + } else if ( elem.fireEvent ) { + elem.fireEvent( "on" + type ); + } + }, + + // Safe object type checking + is: function( type, obj ) { + return QUnit.objectType( obj ) === type; + }, + + objectType: function( obj ) { + if ( typeof obj === "undefined" ) { + return "undefined"; + // consider: typeof null === object + } + if ( obj === null ) { + return "null"; + } + + var match = toString.call( obj ).match(/^\[object\s(.*)\]$/), + type = match && match[1] || ""; + + switch ( type ) { + case "Number": + if ( isNaN(obj) ) { + return "nan"; + } + return "number"; + case "String": + case "Boolean": + case "Array": + case "Date": + case "RegExp": + case "Function": + return type.toLowerCase(); + } + if ( typeof obj === "object" ) { + return "object"; + } + return undefined; + }, + + push: function( result, actual, expected, message ) { + if ( !config.current ) { + throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); + } + + var output, source, + details = { + module: config.current.module, + name: config.current.testName, + result: result, + message: message, + actual: actual, + expected: expected + }; + + message = escapeText( message ) || ( result ? "okay" : "failed" ); + message = "<span class='test-message'>" + message + "</span>"; + output = message; + + if ( !result ) { + expected = escapeText( QUnit.jsDump.parse(expected) ); + actual = escapeText( QUnit.jsDump.parse(actual) ); + output += "<table><tr class='test-expected'><th>Expected: </th><td><pre>" + expected + "</pre></td></tr>"; + + if ( actual !== expected ) { + output += "<tr class='test-actual'><th>Result: </th><td><pre>" + actual + "</pre></td></tr>"; + output += "<tr class='test-diff'><th>Diff: </th><td><pre>" + QUnit.diff( expected, actual ) + "</pre></td></tr>"; + } + + source = sourceFromStacktrace(); + + if ( source ) { + details.source = source; + output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr>"; + } + + output += "</table>"; + } + + runLoggingCallbacks( "log", QUnit, details ); + + config.current.assertions.push({ + result: !!result, + message: output + }); + }, + + pushFailure: function( message, source, actual ) { + if ( !config.current ) { + throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); + } + + var output, + details = { + module: config.current.module, + name: config.current.testName, + result: false, + message: message + }; + + message = escapeText( message ) || "error"; + message = "<span class='test-message'>" + message + "</span>"; + output = message; + + output += "<table>"; + + if ( actual ) { + output += "<tr class='test-actual'><th>Result: </th><td><pre>" + escapeText( actual ) + "</pre></td></tr>"; + } + + if ( source ) { + details.source = source; + output += "<tr class='test-source'><th>Source: </th><td><pre>" + escapeText( source ) + "</pre></td></tr>"; + } + + output += "</table>"; + + runLoggingCallbacks( "log", QUnit, details ); + + config.current.assertions.push({ + result: false, + message: output + }); + }, + + url: function( params ) { + params = extend( extend( {}, QUnit.urlParams ), params ); + var key, + querystring = "?"; + + for ( key in params ) { + if ( !hasOwn.call( params, key ) ) { + continue; + } + querystring += encodeURIComponent( key ) + "=" + + encodeURIComponent( params[ key ] ) + "&"; + } + return window.location.protocol + "//" + window.location.host + + window.location.pathname + querystring.slice( 0, -1 ); + }, + + extend: extend, + id: id, + addEvent: addEvent + // load, equiv, jsDump, diff: Attached later +}); + +/** + * @deprecated: Created for backwards compatibility with test runner that set the hook function + * into QUnit.{hook}, instead of invoking it and passing the hook function. + * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. + * Doing this allows us to tell if the following methods have been overwritten on the actual + * QUnit object. + */ +extend( QUnit.constructor.prototype, { + + // Logging callbacks; all receive a single argument with the listed properties + // run test/logs.html for any related changes + begin: registerLoggingCallback( "begin" ), + + // done: { failed, passed, total, runtime } + done: registerLoggingCallback( "done" ), + + // log: { result, actual, expected, message } + log: registerLoggingCallback( "log" ), + + // testStart: { name } + testStart: registerLoggingCallback( "testStart" ), + + // testDone: { name, failed, passed, total, duration } + testDone: registerLoggingCallback( "testDone" ), + + // moduleStart: { name } + moduleStart: registerLoggingCallback( "moduleStart" ), + + // moduleDone: { name, failed, passed, total } + moduleDone: registerLoggingCallback( "moduleDone" ) +}); + +if ( typeof document === "undefined" || document.readyState === "complete" ) { + config.autorun = true; +} + +QUnit.load = function() { + runLoggingCallbacks( "begin", QUnit, {} ); + + // Initialize the config, saving the execution queue + var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, + urlConfigCheckboxesContainer, urlConfigCheckboxes, moduleFilter, + numModules = 0, + moduleFilterHtml = "", + urlConfigHtml = "", + oldconfig = extend( {}, config ); + + QUnit.init(); + extend(config, oldconfig); + + config.blocking = false; + + len = config.urlConfig.length; + + for ( i = 0; i < len; i++ ) { + val = config.urlConfig[i]; + if ( typeof val === "string" ) { + val = { + id: val, + label: val, + tooltip: "[no tooltip available]" + }; + } + config[ val.id ] = QUnit.urlParams[ val.id ]; + urlConfigHtml += "<input id='qunit-urlconfig-" + escapeText( val.id ) + + "' name='" + escapeText( val.id ) + + "' type='checkbox'" + ( config[ val.id ] ? " checked='checked'" : "" ) + + " title='" + escapeText( val.tooltip ) + + "'><label for='qunit-urlconfig-" + escapeText( val.id ) + + "' title='" + escapeText( val.tooltip ) + "'>" + val.label + "</label>"; + } + + moduleFilterHtml += "<label for='qunit-modulefilter'>Module: </label><select id='qunit-modulefilter' name='modulefilter'><option value='' " + + ( config.module === undefined ? "selected='selected'" : "" ) + + ">< All Modules ></option>"; + + for ( i in config.modules ) { + if ( config.modules.hasOwnProperty( i ) ) { + numModules += 1; + moduleFilterHtml += "<option value='" + escapeText( encodeURIComponent(i) ) + "' " + + ( config.module === i ? "selected='selected'" : "" ) + + ">" + escapeText(i) + "</option>"; + } + } + moduleFilterHtml += "</select>"; + + // `userAgent` initialized at top of scope + userAgent = id( "qunit-userAgent" ); + if ( userAgent ) { + userAgent.innerHTML = navigator.userAgent; + } + + // `banner` initialized at top of scope + banner = id( "qunit-header" ); + if ( banner ) { + banner.innerHTML = "<a href='" + QUnit.url({ filter: undefined, module: undefined, testNumber: undefined }) + "'>" + banner.innerHTML + "</a> "; + } + + // `toolbar` initialized at top of scope + toolbar = id( "qunit-testrunner-toolbar" ); + if ( toolbar ) { + // `filter` initialized at top of scope + filter = document.createElement( "input" ); + filter.type = "checkbox"; + filter.id = "qunit-filter-pass"; + + addEvent( filter, "click", function() { + var tmp, + ol = document.getElementById( "qunit-tests" ); + + if ( filter.checked ) { + ol.className = ol.className + " hidepass"; + } else { + tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; + ol.className = tmp.replace( / hidepass /, " " ); + } + if ( defined.sessionStorage ) { + if (filter.checked) { + sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); + } else { + sessionStorage.removeItem( "qunit-filter-passed-tests" ); + } + } + }); + + if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { + filter.checked = true; + // `ol` initialized at top of scope + ol = document.getElementById( "qunit-tests" ); + ol.className = ol.className + " hidepass"; + } + toolbar.appendChild( filter ); + + // `label` initialized at top of scope + label = document.createElement( "label" ); + label.setAttribute( "for", "qunit-filter-pass" ); + label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." ); + label.innerHTML = "Hide passed tests"; + toolbar.appendChild( label ); + + urlConfigCheckboxesContainer = document.createElement("span"); + urlConfigCheckboxesContainer.innerHTML = urlConfigHtml; + urlConfigCheckboxes = urlConfigCheckboxesContainer.getElementsByTagName("input"); + // For oldIE support: + // * Add handlers to the individual elements instead of the container + // * Use "click" instead of "change" + // * Fallback from event.target to event.srcElement + addEvents( urlConfigCheckboxes, "click", function( event ) { + var params = {}, + target = event.target || event.srcElement; + params[ target.name ] = target.checked ? true : undefined; + window.location = QUnit.url( params ); + }); + toolbar.appendChild( urlConfigCheckboxesContainer ); + + if (numModules > 1) { + moduleFilter = document.createElement( 'span' ); + moduleFilter.setAttribute( 'id', 'qunit-modulefilter-container' ); + moduleFilter.innerHTML = moduleFilterHtml; + addEvent( moduleFilter.lastChild, "change", function() { + var selectBox = moduleFilter.getElementsByTagName("select")[0], + selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value); + + window.location = QUnit.url( { module: ( selectedModule === "" ) ? undefined : selectedModule } ); + }); + toolbar.appendChild(moduleFilter); + } + } + + // `main` initialized at top of scope + main = id( "qunit-fixture" ); + if ( main ) { + config.fixture = main.innerHTML; + } + + if ( config.autostart ) { + QUnit.start(); + } +}; + +addEvent( window, "load", QUnit.load ); + +// `onErrorFnPrev` initialized at top of scope +// Preserve other handlers +onErrorFnPrev = window.onerror; + +// Cover uncaught exceptions +// Returning true will surpress the default browser handler, +// returning false will let it run. +window.onerror = function ( error, filePath, linerNr ) { + var ret = false; + if ( onErrorFnPrev ) { + ret = onErrorFnPrev( error, filePath, linerNr ); + } + + // Treat return value as window.onerror itself does, + // Only do our handling if not surpressed. + if ( ret !== true ) { + if ( QUnit.config.current ) { + if ( QUnit.config.current.ignoreGlobalErrors ) { + return true; + } + QUnit.pushFailure( error, filePath + ":" + linerNr ); + } else { + QUnit.test( "global failure", extend( function() { + QUnit.pushFailure( error, filePath + ":" + linerNr ); + }, { validTest: validTest } ) ); + } + return false; + } + + return ret; +}; + +function done() { + config.autorun = true; + + // Log the last module results + if ( config.currentModule ) { + runLoggingCallbacks( "moduleDone", QUnit, { + name: config.currentModule, + failed: config.moduleStats.bad, + passed: config.moduleStats.all - config.moduleStats.bad, + total: config.moduleStats.all + }); + } + + var i, key, + banner = id( "qunit-banner" ), + tests = id( "qunit-tests" ), + runtime = +new Date() - config.started, + passed = config.stats.all - config.stats.bad, + html = [ + "Tests completed in ", + runtime, + " milliseconds.<br/>", + "<span class='passed'>", + passed, + "</span> assertions of <span class='total'>", + config.stats.all, + "</span> passed, <span class='failed'>", + config.stats.bad, + "</span> failed." + ].join( "" ); + + if ( banner ) { + banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); + } + + if ( tests ) { + id( "qunit-testresult" ).innerHTML = html; + } + + if ( config.altertitle && typeof document !== "undefined" && document.title ) { + // show ✖ for good, ✔ for bad suite result in title + // use escape sequences in case file gets loaded with non-utf-8-charset + document.title = [ + ( config.stats.bad ? "\u2716" : "\u2714" ), + document.title.replace( /^[\u2714\u2716] /i, "" ) + ].join( " " ); + } + + // clear own sessionStorage items if all tests passed + if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { + // `key` & `i` initialized at top of scope + for ( i = 0; i < sessionStorage.length; i++ ) { + key = sessionStorage.key( i++ ); + if ( key.indexOf( "qunit-test-" ) === 0 ) { + sessionStorage.removeItem( key ); + } + } + } + + // scroll back to top to show results + if ( window.scrollTo ) { + window.scrollTo(0, 0); + } + + runLoggingCallbacks( "done", QUnit, { + failed: config.stats.bad, + passed: passed, + total: config.stats.all, + runtime: runtime + }); +} + +/** @return Boolean: true if this test should be ran */ +function validTest( test ) { + var include, + filter = config.filter && config.filter.toLowerCase(), + module = config.module && config.module.toLowerCase(), + fullName = (test.module + ": " + test.testName).toLowerCase(); + + // Internally-generated tests are always valid + if ( test.callback && test.callback.validTest === validTest ) { + delete test.callback.validTest; + return true; + } + + if ( config.testNumber ) { + return test.testNumber === config.testNumber; + } + + if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { + return false; + } + + if ( !filter ) { + return true; + } + + include = filter.charAt( 0 ) !== "!"; + if ( !include ) { + filter = filter.slice( 1 ); + } + + // If the filter matches, we need to honour include + if ( fullName.indexOf( filter ) !== -1 ) { + return include; + } + + // Otherwise, do the opposite + return !include; +} + +// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) +// Later Safari and IE10 are supposed to support error.stack as well +// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack +function extractStacktrace( e, offset ) { + offset = offset === undefined ? 3 : offset; + + var stack, include, i; + + if ( e.stacktrace ) { + // Opera + return e.stacktrace.split( "\n" )[ offset + 3 ]; + } else if ( e.stack ) { + // Firefox, Chrome + stack = e.stack.split( "\n" ); + if (/^error$/i.test( stack[0] ) ) { + stack.shift(); + } + if ( fileName ) { + include = []; + for ( i = offset; i < stack.length; i++ ) { + if ( stack[ i ].indexOf( fileName ) !== -1 ) { + break; + } + include.push( stack[ i ] ); + } + if ( include.length ) { + return include.join( "\n" ); + } + } + return stack[ offset ]; + } else if ( e.sourceURL ) { + // Safari, PhantomJS + // hopefully one day Safari provides actual stacktraces + // exclude useless self-reference for generated Error objects + if ( /qunit.js$/.test( e.sourceURL ) ) { + return; + } + // for actual exceptions, this is useful + return e.sourceURL + ":" + e.line; + } +} +function sourceFromStacktrace( offset ) { + try { + throw new Error(); + } catch ( e ) { + return extractStacktrace( e, offset ); + } +} + +/** + * Escape text for attribute or text content. + */ +function escapeText( s ) { + if ( !s ) { + return ""; + } + s = s + ""; + // Both single quotes and double quotes (for attributes) + return s.replace( /['"<>&]/g, function( s ) { + switch( s ) { + case '\'': + return '''; + case '"': + return '"'; + case '<': + return '<'; + case '>': + return '>'; + case '&': + return '&'; + } + }); +} + +function synchronize( callback, last ) { + config.queue.push( callback ); + + if ( config.autorun && !config.blocking ) { + process( last ); + } +} + +function process( last ) { + function next() { + process( last ); + } + var start = new Date().getTime(); + config.depth = config.depth ? config.depth + 1 : 1; + + while ( config.queue.length && !config.blocking ) { + if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { + config.queue.shift()(); + } else { + window.setTimeout( next, 13 ); + break; + } + } + config.depth--; + if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { + done(); + } +} + +function saveGlobal() { + config.pollution = []; + + if ( config.noglobals ) { + for ( var key in window ) { + // in Opera sometimes DOM element ids show up here, ignore them + if ( !hasOwn.call( window, key ) || /^qunit-test-output/.test( key ) ) { + continue; + } + config.pollution.push( key ); + } + } +} + +function checkPollution() { + var newGlobals, + deletedGlobals, + old = config.pollution; + + saveGlobal(); + + newGlobals = diff( config.pollution, old ); + if ( newGlobals.length > 0 ) { + QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); + } + + deletedGlobals = diff( old, config.pollution ); + if ( deletedGlobals.length > 0 ) { + QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); + } +} + +// returns a new Array with the elements that are in a but not in b +function diff( a, b ) { + var i, j, + result = a.slice(); + + for ( i = 0; i < result.length; i++ ) { + for ( j = 0; j < b.length; j++ ) { + if ( result[i] === b[j] ) { + result.splice( i, 1 ); + i--; + break; + } + } + } + return result; +} + +function extend( a, b ) { + for ( var prop in b ) { + if ( b[ prop ] === undefined ) { + delete a[ prop ]; + + // Avoid "Member not found" error in IE8 caused by setting window.constructor + } else if ( prop !== "constructor" || a !== window ) { + a[ prop ] = b[ prop ]; + } + } + + return a; +} + +/** + * @param {HTMLElement} elem + * @param {string} type + * @param {Function} fn + */ +function addEvent( elem, type, fn ) { + // Standards-based browsers + if ( elem.addEventListener ) { + elem.addEventListener( type, fn, false ); + // IE + } else { + elem.attachEvent( "on" + type, fn ); + } +} + +/** + * @param {Array|NodeList} elems + * @param {string} type + * @param {Function} fn + */ +function addEvents( elems, type, fn ) { + var i = elems.length; + while ( i-- ) { + addEvent( elems[i], type, fn ); + } +} + +function hasClass( elem, name ) { + return (" " + elem.className + " ").indexOf(" " + name + " ") > -1; +} + +function addClass( elem, name ) { + if ( !hasClass( elem, name ) ) { + elem.className += (elem.className ? " " : "") + name; + } +} + +function removeClass( elem, name ) { + var set = " " + elem.className + " "; + // Class name may appear multiple times + while ( set.indexOf(" " + name + " ") > -1 ) { + set = set.replace(" " + name + " " , " "); + } + // If possible, trim it for prettiness, but not neccecarily + elem.className = window.jQuery ? jQuery.trim( set ) : ( set.trim ? set.trim() : set ); +} + +function id( name ) { + return !!( typeof document !== "undefined" && document && document.getElementById ) && + document.getElementById( name ); +} + +function registerLoggingCallback( key ) { + return function( callback ) { + config[key].push( callback ); + }; +} + +// Supports deprecated method of completely overwriting logging callbacks +function runLoggingCallbacks( key, scope, args ) { + var i, callbacks; + if ( QUnit.hasOwnProperty( key ) ) { + QUnit[ key ].call(scope, args ); + } else { + callbacks = config[ key ]; + for ( i = 0; i < callbacks.length; i++ ) { + callbacks[ i ].call( scope, args ); + } + } +} + +// Test for equality any JavaScript type. +// Author: Philippe Rathé <prathe@gmail.com> +QUnit.equiv = (function() { + + // Call the o related callback with the given arguments. + function bindCallbacks( o, callbacks, args ) { + var prop = QUnit.objectType( o ); + if ( prop ) { + if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { + return callbacks[ prop ].apply( callbacks, args ); + } else { + return callbacks[ prop ]; // or undefined + } + } + } + + // the real equiv function + var innerEquiv, + // stack to decide between skip/abort functions + callers = [], + // stack to avoiding loops from circular referencing + parents = [], + + getProto = Object.getPrototypeOf || function ( obj ) { + return obj.__proto__; + }, + callbacks = (function () { + + // for string, boolean, number and null + function useStrictEquality( b, a ) { + /*jshint eqeqeq:false */ + if ( b instanceof a.constructor || a instanceof b.constructor ) { + // to catch short annotaion VS 'new' annotation of a + // declaration + // e.g. var i = 1; + // var j = new Number(1); + return a == b; + } else { + return a === b; + } + } + + return { + "string": useStrictEquality, + "boolean": useStrictEquality, + "number": useStrictEquality, + "null": useStrictEquality, + "undefined": useStrictEquality, + + "nan": function( b ) { + return isNaN( b ); + }, + + "date": function( b, a ) { + return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); + }, + + "regexp": function( b, a ) { + return QUnit.objectType( b ) === "regexp" && + // the regex itself + a.source === b.source && + // and its modifers + a.global === b.global && + // (gmi) ... + a.ignoreCase === b.ignoreCase && + a.multiline === b.multiline && + a.sticky === b.sticky; + }, + + // - skip when the property is a method of an instance (OOP) + // - abort otherwise, + // initial === would have catch identical references anyway + "function": function() { + var caller = callers[callers.length - 1]; + return caller !== Object && typeof caller !== "undefined"; + }, + + "array": function( b, a ) { + var i, j, len, loop; + + // b could be an object literal here + if ( QUnit.objectType( b ) !== "array" ) { + return false; + } + + len = a.length; + if ( len !== b.length ) { + // safe and faster + return false; + } + + // track reference to avoid circular references + parents.push( a ); + for ( i = 0; i < len; i++ ) { + loop = false; + for ( j = 0; j < parents.length; j++ ) { + if ( parents[j] === a[i] ) { + loop = true;// dont rewalk array + } + } + if ( !loop && !innerEquiv(a[i], b[i]) ) { + parents.pop(); + return false; + } + } + parents.pop(); + return true; + }, + + "object": function( b, a ) { + var i, j, loop, + // Default to true + eq = true, + aProperties = [], + bProperties = []; + + // comparing constructors is more strict than using + // instanceof + if ( a.constructor !== b.constructor ) { + // Allow objects with no prototype to be equivalent to + // objects with Object as their constructor. + if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || + ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { + return false; + } + } + + // stack constructor before traversing properties + callers.push( a.constructor ); + // track reference to avoid circular references + parents.push( a ); + + for ( i in a ) { // be strict: don't ensures hasOwnProperty + // and go deep + loop = false; + for ( j = 0; j < parents.length; j++ ) { + if ( parents[j] === a[i] ) { + // don't go down the same path twice + loop = true; + } + } + aProperties.push(i); // collect a's properties + + if (!loop && !innerEquiv( a[i], b[i] ) ) { + eq = false; + break; + } + } + + callers.pop(); // unstack, we are done + parents.pop(); + + for ( i in b ) { + bProperties.push( i ); // collect b's properties + } + + // Ensures identical properties name + return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); + } + }; + }()); + + innerEquiv = function() { // can take multiple arguments + var args = [].slice.apply( arguments ); + if ( args.length < 2 ) { + return true; // end transition + } + + return (function( a, b ) { + if ( a === b ) { + return true; // catch the most you can + } else if ( a === null || b === null || typeof a === "undefined" || + typeof b === "undefined" || + QUnit.objectType(a) !== QUnit.objectType(b) ) { + return false; // don't lose time with error prone cases + } else { + return bindCallbacks(a, callbacks, [ b, a ]); + } + + // apply transition with (1..n) arguments + }( args[0], args[1] ) && arguments.callee.apply( this, args.splice(1, args.length - 1 )) ); + }; + + return innerEquiv; +}()); + +/** + * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | + * http://flesler.blogspot.com Licensed under BSD + * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 + * + * @projectDescription Advanced and extensible data dumping for Javascript. + * @version 1.0.0 + * @author Ariel Flesler + * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} + */ +QUnit.jsDump = (function() { + function quote( str ) { + return '"' + str.toString().replace( /"/g, '\\"' ) + '"'; + } + function literal( o ) { + return o + ""; + } + function join( pre, arr, post ) { + var s = jsDump.separator(), + base = jsDump.indent(), + inner = jsDump.indent(1); + if ( arr.join ) { + arr = arr.join( "," + s + inner ); + } + if ( !arr ) { + return pre + post; + } + return [ pre, inner + arr, base + post ].join(s); + } + function array( arr, stack ) { + var i = arr.length, ret = new Array(i); + this.up(); + while ( i-- ) { + ret[i] = this.parse( arr[i] , undefined , stack); + } + this.down(); + return join( "[", ret, "]" ); + } + + var reName = /^function (\w+)/, + jsDump = { + // type is used mostly internally, you can fix a (custom)type in advance + parse: function( obj, type, stack ) { + stack = stack || [ ]; + var inStack, res, + parser = this.parsers[ type || this.typeOf(obj) ]; + + type = typeof parser; + inStack = inArray( obj, stack ); + + if ( inStack !== -1 ) { + return "recursion(" + (inStack - stack.length) + ")"; + } + if ( type === "function" ) { + stack.push( obj ); + res = parser.call( this, obj, stack ); + stack.pop(); + return res; + } + return ( type === "string" ) ? parser : this.parsers.error; + }, + typeOf: function( obj ) { + var type; + if ( obj === null ) { + type = "null"; + } else if ( typeof obj === "undefined" ) { + type = "undefined"; + } else if ( QUnit.is( "regexp", obj) ) { + type = "regexp"; + } else if ( QUnit.is( "date", obj) ) { + type = "date"; + } else if ( QUnit.is( "function", obj) ) { + type = "function"; + } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { + type = "window"; + } else if ( obj.nodeType === 9 ) { + type = "document"; + } else if ( obj.nodeType ) { + type = "node"; + } else if ( + // native arrays + toString.call( obj ) === "[object Array]" || + // NodeList objects + ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) + ) { + type = "array"; + } else if ( obj.constructor === Error.prototype.constructor ) { + type = "error"; + } else { + type = typeof obj; + } + return type; + }, + separator: function() { + return this.multiline ? this.HTML ? "<br />" : "\n" : this.HTML ? " " : " "; + }, + // extra can be a number, shortcut for increasing-calling-decreasing + indent: function( extra ) { + if ( !this.multiline ) { + return ""; + } + var chr = this.indentChar; + if ( this.HTML ) { + chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); + } + return new Array( this._depth_ + (extra||0) ).join(chr); + }, + up: function( a ) { + this._depth_ += a || 1; + }, + down: function( a ) { + this._depth_ -= a || 1; + }, + setParser: function( name, parser ) { + this.parsers[name] = parser; + }, + // The next 3 are exposed so you can use them + quote: quote, + literal: literal, + join: join, + // + _depth_: 1, + // This is the list of parsers, to modify them, use jsDump.setParser + parsers: { + window: "[Window]", + document: "[Document]", + error: function(error) { + return "Error(\"" + error.message + "\")"; + }, + unknown: "[Unknown]", + "null": "null", + "undefined": "undefined", + "function": function( fn ) { + var ret = "function", + // functions never have name in IE + name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1]; + + if ( name ) { + ret += " " + name; + } + ret += "( "; + + ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); + return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); + }, + array: array, + nodelist: array, + "arguments": array, + object: function( map, stack ) { + var ret = [ ], keys, key, val, i; + QUnit.jsDump.up(); + keys = []; + for ( key in map ) { + keys.push( key ); + } + keys.sort(); + for ( i = 0; i < keys.length; i++ ) { + key = keys[ i ]; + val = map[ key ]; + ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); + } + QUnit.jsDump.down(); + return join( "{", ret, "}" ); + }, + node: function( node ) { + var len, i, val, + open = QUnit.jsDump.HTML ? "<" : "<", + close = QUnit.jsDump.HTML ? ">" : ">", + tag = node.nodeName.toLowerCase(), + ret = open + tag, + attrs = node.attributes; + + if ( attrs ) { + for ( i = 0, len = attrs.length; i < len; i++ ) { + val = attrs[i].nodeValue; + // IE6 includes all attributes in .attributes, even ones not explicitly set. + // Those have values like undefined, null, 0, false, "" or "inherit". + if ( val && val !== "inherit" ) { + ret += " " + attrs[i].nodeName + "=" + QUnit.jsDump.parse( val, "attribute" ); + } + } + } + ret += close; + + // Show content of TextNode or CDATASection + if ( node.nodeType === 3 || node.nodeType === 4 ) { + ret += node.nodeValue; + } + + return ret + open + "/" + tag + close; + }, + // function calls it internally, it's the arguments part of the function + functionArgs: function( fn ) { + var args, + l = fn.length; + + if ( !l ) { + return ""; + } + + args = new Array(l); + while ( l-- ) { + // 97 is 'a' + args[l] = String.fromCharCode(97+l); + } + return " " + args.join( ", " ) + " "; + }, + // object calls it internally, the key part of an item in a map + key: quote, + // function calls it internally, it's the content of the function + functionCode: "[code]", + // node calls it internally, it's an html attribute value + attribute: quote, + string: quote, + date: quote, + regexp: literal, + number: literal, + "boolean": literal + }, + // if true, entities are escaped ( <, >, \t, space and \n ) + HTML: false, + // indentation unit + indentChar: " ", + // if true, items in a collection, are separated by a \n, else just a space. + multiline: true + }; + + return jsDump; +}()); + +// from jquery.js +function inArray( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; +} + +/* + * Javascript Diff Algorithm + * By John Resig (http://ejohn.org/) + * Modified by Chu Alan "sprite" + * + * Released under the MIT license. + * + * More Info: + * http://ejohn.org/projects/javascript-diff-algorithm/ + * + * Usage: QUnit.diff(expected, actual) + * + * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over" + */ +QUnit.diff = (function() { + /*jshint eqeqeq:false, eqnull:true */ + function diff( o, n ) { + var i, + ns = {}, + os = {}; + + for ( i = 0; i < n.length; i++ ) { + if ( !hasOwn.call( ns, n[i] ) ) { + ns[ n[i] ] = { + rows: [], + o: null + }; + } + ns[ n[i] ].rows.push( i ); + } + + for ( i = 0; i < o.length; i++ ) { + if ( !hasOwn.call( os, o[i] ) ) { + os[ o[i] ] = { + rows: [], + n: null + }; + } + os[ o[i] ].rows.push( i ); + } + + for ( i in ns ) { + if ( !hasOwn.call( ns, i ) ) { + continue; + } + if ( ns[i].rows.length === 1 && hasOwn.call( os, i ) && os[i].rows.length === 1 ) { + n[ ns[i].rows[0] ] = { + text: n[ ns[i].rows[0] ], + row: os[i].rows[0] + }; + o[ os[i].rows[0] ] = { + text: o[ os[i].rows[0] ], + row: ns[i].rows[0] + }; + } + } + + for ( i = 0; i < n.length - 1; i++ ) { + if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && + n[ i + 1 ] == o[ n[i].row + 1 ] ) { + + n[ i + 1 ] = { + text: n[ i + 1 ], + row: n[i].row + 1 + }; + o[ n[i].row + 1 ] = { + text: o[ n[i].row + 1 ], + row: i + 1 + }; + } + } + + for ( i = n.length - 1; i > 0; i-- ) { + if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && + n[ i - 1 ] == o[ n[i].row - 1 ]) { + + n[ i - 1 ] = { + text: n[ i - 1 ], + row: n[i].row - 1 + }; + o[ n[i].row - 1 ] = { + text: o[ n[i].row - 1 ], + row: i - 1 + }; + } + } + + return { + o: o, + n: n + }; + } + + return function( o, n ) { + o = o.replace( /\s+$/, "" ); + n = n.replace( /\s+$/, "" ); + + var i, pre, + str = "", + out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), + oSpace = o.match(/\s+/g), + nSpace = n.match(/\s+/g); + + if ( oSpace == null ) { + oSpace = [ " " ]; + } + else { + oSpace.push( " " ); + } + + if ( nSpace == null ) { + nSpace = [ " " ]; + } + else { + nSpace.push( " " ); + } + + if ( out.n.length === 0 ) { + for ( i = 0; i < out.o.length; i++ ) { + str += "<del>" + out.o[i] + oSpace[i] + "</del>"; + } + } + else { + if ( out.n[0].text == null ) { + for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { + str += "<del>" + out.o[n] + oSpace[n] + "</del>"; + } + } + + for ( i = 0; i < out.n.length; i++ ) { + if (out.n[i].text == null) { + str += "<ins>" + out.n[i] + nSpace[i] + "</ins>"; + } + else { + // `pre` initialized at top of scope + pre = ""; + + for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { + pre += "<del>" + out.o[n] + oSpace[n] + "</del>"; + } + str += " " + out.n[i].text + nSpace[i] + pre; + } + } + } + + return str; + }; +}()); + +// for CommonJS enviroments, export everything +if ( typeof exports !== "undefined" ) { + extend( exports, QUnit ); +} + +// get at whatever the global object is, like window in browsers +}( (function() {return this;}.call()) )); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/sample-data1.json b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/sample-data1.json new file mode 100644 index 0000000000000000000000000000000000000000..7287a7e4fa343b912b7ff16ba0c74de10785d1a3 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/sample-data1.json @@ -0,0 +1,17 @@ +[ + {"title": "Item 1"}, + {"title": "Folder 2", "isFolder": true, "key": "folder2", + "children": [ + {"title": "Sub-item 2.1"}, + {"title": "Sub-item 2.2"} + ] + }, + {"title": "Folder 3", "isFolder": true, "key": "folder3", + "children": [ + {"title": "Sub-item 3.1"}, + {"title": "Sub-item 3.2"} + ] + }, + {"title": "Lazy Folder 4", "isFolder": true, "isLazy": true, "key": "folder4"}, + {"title": "Item 5"} +] \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/sample-data2.json b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/sample-data2.json new file mode 100644 index 0000000000000000000000000000000000000000..9602459c18e935874748d83e7545f7147d32fb9e --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/sample-data2.json @@ -0,0 +1 @@ +[ {"title": "SubItem 1", "isLazy": true }, {"title": "SubFolder 2", "isFolder": true, "isLazy": true } ] \ No newline at end of file diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-adhoc.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-adhoc.html new file mode 100644 index 0000000000000000000000000000000000000000..2ad44ba67ecca0bbe2803d04949ee7cde5cb1edc --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-adhoc.html @@ -0,0 +1,51 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - AdHoc tests</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + +<script type="text/javascript"> + $(function(){ + // Initialize the tree inside the <div>element. + // The tree structure is read from the contained <ul> tag. + $("#tree").dynatree({ + initAjax: { + url: "sample-data1.json" + }, + }); + $("#btn01").click(function(){ + var a = []; + alert("" + !!a.length); + }); + $("#btn11").click(function(){ + alert("11"); + }); + }); +</script> +</head> + +<body class="example"> + <h1>Dynatree Test</h1> + <p class="description"> + Testbed. + </p> + + <p> + <a href="#" id="btn01">Test 01</a> - + </p> + <div id="tree"></div> + + <div>Active node: <span id="echoActive">-</span></div> + <div>Focused node: <span id="echoFocused">-</span></div> + <p> + <button id="btn11">Test 11</button> + </p> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-bench.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-bench.html new file mode 100644 index 0000000000000000000000000000000000000000..c5641ea67d4f8cab98f047b52d62ec8deb1af6ca --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-bench.html @@ -0,0 +1,242 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <title>Dynatree - Example</title> + + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link rel="stylesheet" href="qunit.css" type="text/css" media="screen" /> + <script type="text/javascript" src="qunit.js"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <!-- Start_Exclude: This block is not part of the sample code --> + <link href="prettify.css" rel="stylesheet"> + <script src="prettify.js" type="text/javascript"></script> + <link href="sample.css" rel="stylesheet" type="text/css"> + <script src="sample.js" type="text/javascript"></script> + <!-- End_Exclude --> + +<!-- Add code to initialize the tree when the document is loaded: --> +<script type="text/javascript"> + +$(function(){ + +/******************************************************************************* + * QUnit setup + */ +QUnit.log = function(result, message) { + if (window.console && window.console.log) { + window.console.log(result +' :: '+ message); + } +} + +/******************************************************************************* + * Tool functions + */ +function makeBenchWrapper(testName, callback) { + return function() { + var start = +new Date; +// callback.apply(this, arguments); + callback.call(); + var elap = +new Date - start; + ok(true, testName + " took " + elap + " milliseconds"); + } +} + + +function benchmark(testName, callback) { + // Execute callback immediately and log timing as test result. + // This function should be called inside a test() function. + makeBenchWrapper(testName, callback).call(); +} + + +function timedTest(testName, callback) { + // Same as test(testName, callback), but adds a timing assertion. + test(testName, makeBenchWrapper(testName, callback)); +} + + +function simulateClick(selector) { + var e = document.createEvent("MouseEvents"); + e.initEvent("click", true, true); + $(selector).each(function(){ + this.dispatchEvent(e); + }); +}; + + +function addNodes(node, level1, level2, level3, forceUpdate) { + if( forceUpdate != true ) + node.tree.enableUpdate(false); + + var key; + for (var i=0; i<level1; i++) { + key = "" + (i+1); + var f = node.addChild({title: "Folder_" + key, + key: key, + isFolder: true + }); + for (var j=0; j<level2; j++) { + key = "" + (i+1) + "." + (j+1); + var d = f.addChild({title: "Node_" + key, + key: key + }); + for (var k=0; k<level3; k++) { + key = "" + (i+1) + "." + (j+1) + "." + (k+1); + d.addChild({title: "Node_" + key, + key: key + }); + } + } + } + node.tree.enableUpdate(true); +} + +/******************************************************************************* + * Module Init + */ +module("Init"); + +test("Create dynatree", function() { + $("#tree").dynatree({ + children: [ + {key: "_1", title: "Add 100 nodes (flat, force update)...", isFolder: true, isLazy: true, mode: "add100_flat_u" }, + {key: "_2", title: "Add 100 nodes (flat)...", isFolder: true, isLazy: true, mode: "add100_flat" }, + {key: "_3", title: "Add 1.000 nodes (flat)...", isFolder: true, isLazy: true, mode: "add1000_flat" }, + {key: "_4", title: "Add 1.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add1000_deep" }, + {key: "_5", title: "Add 10.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add10000_deep" }, + {key: "_6", title: "Add 10.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "addJsonFile" } + ], + onSelect: function(node) { + alert("You selected " + node.data.title); + }, + onLazyRead: function(node) { + var tree = node.tree; + var start = +new Date; + logMsg("Benchmarking mode='" + node.data.mode + "'..."); + switch( node.data.mode ) { + case "add100_flat_u": + addNodes(node, 100, 0, 0, true) + break; + case "add100_flat": + addNodes(node, 100, 0, 0) + break; + case "add1000_flat": + addNodes(node, 1000, 0, 0) + break; + case "add1000_deep": + addNodes(node, 10, 10, 10) + break; + case "add10000_deep": + addNodes(node, 10, 100, 10) + break; + case "addJsonFile": + node.appendAjax({ + url: "sample-data2.json" + }); + break; + default: + throw "Invalid Mode "+ node.data.mode; + } + logMsg("Benchmarking mode='" + node.data.mode + "' done: " + (+new Date - start) + " milliseconds"); + // Return true, to show we're finished + return true; + } + }); +}); + +/******************************************************************************* + * Module Load + */ +module("Load"); +/* +asyncTest("Expand lazy nodes (simulated async click())", function() { + var tree = $("#tree").dynatree("getTree"); + simulateClick("#dynatree-id-_2"); + start(); +// equals(tree.getNodeByKey("1").data.title, "Folder_1"); +// simulateClick("#dynatree-id-_2"); +}); + +test(".expand() lazy nodes", function() { + var tree = $("#tree").dynatree("getTree"); + tree.getNodeByKey("_3").expand(); +}); +*/ +test(".click() top level nodes", function() { + expect(6); + benchmark("add100_flat_u", function() { + $("#dynatree-id-_1").click(); + }); + benchmark("add100_flat", function() { + $("#dynatree-id-_2").click(); + }); + benchmark("add1000_flat", function() { + $("#dynatree-id-_3").click(); + }); + benchmark("add1000_deep", function() { + $("#dynatree-id-_4").click(); + }); + benchmark("add10000_deep", function() { + $("#dynatree-id-_5").click(); + }); + benchmark("addJsonFile", function() { + $("#dynatree-id-_6").click(); + }); +}); + +timedTest(".click() add10000_deep", function() { + $("#dynatree-id-_5").click(); +}); +/* +test("Load 100 nodes (flat)", function() { + var parent = $("#tree").dynatree("getTree").getNodeByKey("_1"); +// addNodes(parent, 100, 0, 0) + ok( true, "all pass" ); +}); +*/ +/******************************************************************************* + * Module Cleanup + */ +module("Cleanup"); +/* +test("Remove children", function() { + var root = $("#tree").dynatree("getRoot"); + for(var i = 0; i<root.childList.length; i++) + root.childList[i].removeChildren(); +// ok( true, "all pass" ); +}); +*/ +// --- +}); +</script> +</head> + +<body class="example"> + <h1 id="qunit-header">Dynatree unit tests: benchmarks</h1> + <h2 id="qunit-banner"></h2> + <h2 id="qunit-userAgent"></h2> + <ol id="qunit-tests"></ol> + + <hr /> + + <div id='tree'> </div> + + <!-- Start_Exclude: This block is not part of the sample code --> + <hr> + <p class="sample-links no_code"> + <a class="hideInsideFS" href="http://dynatree.googlecode.com">jquery.dynatree.js project home</a> + <a class="hideOutsideFS" href="#">Link to this page</a> + <a class="hideInsideFS" href="samples.html">Example Browser</a> + <a href="#" id="codeExample">View source code</a> + </p> + <pre id="sourceCode" class="prettyprint" style="display:none"></pre> + <!-- End_Exclude --> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-dynatree.js b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-dynatree.js new file mode 100644 index 0000000000000000000000000000000000000000..c6dd46196847af3352dd9775356e645a0b7c50ea --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test-dynatree.js @@ -0,0 +1,211 @@ +/*globals $:false, expect:false, module:false, ok:false, test:false, QUnit:false */ +/*globals logMsg, alert */ + +$(function(){ +/******************************************************************************* + * QUnit setup + */ +QUnit.log = function(result, message) { + if (window.console && window.console.log) { + window.console.log(result +' :: '+ message); + } +}; + +/******************************************************************************* + * Tool functions + */ +function makeBenchWrapper(testName, callback) { + return function() { + var start = +new Date(); +// callback.apply(this, arguments); + callback.call(); + var elap = +new Date() - start; + ok(true, testName + " took " + elap + " milliseconds"); + }; +} + + +function benchmark(testName, callback) { + // Execute callback immediately and log timing as test result. + // This function should be called inside a test() function. + makeBenchWrapper(testName, callback).call(); +} + + +function timedTest(testName, callback) { + // Same as test(testName, callback), but adds a timing assertion. + test(testName, makeBenchWrapper(testName, callback)); +} + + +function simulateClick(selector) { + var e = document.createEvent("MouseEvents"); + e.initEvent("click", true, true); + $(selector).each(function(){ + this.dispatchEvent(e); + }); +} + + +function addNodes(dtnode, level1, level2, level3, forceUpdate) { + if( forceUpdate !== true ){ + dtnode.tree.enableUpdate(false); + } + var key; + for (var i=0; i<level1; i++) { + key = "" + (i+1); + var f = dtnode.addChild({title: "Folder_" + key, + key: key, + isFolder: true + }); + for (var j=0; j<level2; j++) { + key = "" + (i+1) + "." + (j+1); + var d = f.addChild({title: "Node_" + key, + key: key + }); + for (var k=0; k<level3; k++) { + key = "" + (i+1) + "." + (j+1) + "." + (k+1); + d.addChild({title: "Node_" + key, + key: key + }); + } + } + } + dtnode.tree.enableUpdate(true); +} + +/******************************************************************************* + * Module Init + */ +module("Init"); + +test("Initialization", function() { + expect(6); + ok(!!$.ui.dynatree, "defined $.ui.dynatree"); + ok(!!$.ui.dynatree.version, "defined $.ui.dynatree.version"); + ok($.isFunction($.ui.dynatree.getNode), "defined $.ui.dynatree.getNode()"); + ok($.isFunction($.ui.dynatree.getPersistData), "defined $.ui.dynatree.getPersistData()"); + ok(!!$.ui.dynatree._DynaTreeClass.prototype, "defined $.ui.dynatree._DynaTreeClass"); + ok(!!$.ui.dynatree._DynaTreeNodeClass.prototype, "defined $.ui.dynatree._DynaTreeNodeClass"); +}); +/* +test("Create dynatree", function() { + $("#tree").dynatree({ + children: [ + {key: "_1", title: "Lazy Add 100 nodes (flat, force update)...", isFolder: true, isLazy: true, mode: "add100_flat_u" }, + {key: "_2", title: "Lazy Add 100 nodes (flat)...", isFolder: true, isLazy: true, mode: "add100_flat" }, + {key: "_3", title: "Lazy Add 1.000 nodes (flat)...", isFolder: true, isLazy: true, mode: "add1000_flat" }, + {key: "_4", title: "Lazy Add 1.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add1000_deep" }, + {key: "_5", title: "Lazy Add 10.000 nodes (deep)...", isFolder: true, isLazy: true, mode: "add10000_deep" }, + {key: "_6", title: "Lazy Add JSON file...", isFolder: true, isLazy: true, mode: "addJsonFile" }, + {key: "_7", title: "Add 1.000 nodes (flat)", isFolder: true }, + {key: "_8", title: "Add 1.000 nodes (deep)", isFolder: true } + ], + onSelect: function(dtnode) { + alert("You selected " + dtnode.data.title); + }, + onLazyRead: function(dtnode) { + var tree = dtnode.tree; + var start = +new Date(); + logMsg("Benchmarking mode='" + dtnode.data.mode + "'..."); + switch( dtnode.data.mode ) { + case "add100_flat_u": + addNodes(dtnode, 100, 0, 0, true); + break; + case "add100_flat": + addNodes(dtnode, 100, 0, 0); + break; + case "add1000_flat": + addNodes(dtnode, 1000, 0, 0); + break; + case "add1000_deep": + addNodes(dtnode, 10, 10, 10); + break; + case "add10000_deep": + addNodes(dtnode, 10, 100, 10); + break; + case "addJsonFile": + dtnode.appendAjax({ + url: "sample-data2.json" + }); + break; + default: + throw "Invalid Mode "+ dtnode.data.mode; + } + logMsg("Benchmarking mode='" + dtnode.data.mode + "' done: " + (+new Date() - start) + " milliseconds"); + // Return true, to show we're finished + return true; + } + }); +}); +*/ +/******************************************************************************* + * Module Load + */ +module("Load"); + +test("Add nodes to folder using API witout expanding", function() { + expect(2); + + benchmark("1000 nodes flat", function() { + var node = $("#tree").dynatree("getTree").getNodeByKey("_7"); + addNodes(node, 1000, 0, 0); + }); + + benchmark("1000 nodes deep", function() { + var node = $("#tree").dynatree("getTree").getNodeByKey("_8"); + addNodes(node, 10, 10, 10); + }); +}); + +test(".click() top level nodes (triggers lazy loading)", function() { + expect(3); +/* + benchmark("Click add100_flat_u", function() { + $("#dynatree-id-_1").click(); + }); + benchmark("Click add100_flat", function() { + $("#dynatree-id-_2").click(); + }); +*/ + benchmark("Click add1000_flat", function() { + $("#dynatree-id-_3").click(); + }); + + benchmark("Click add1000_deep", function() { + $("#dynatree-id-_4").click(); + }); +/* + benchmark("Click add10000_deep", function() { + $("#dynatree-id-_5").click(); + }); + */ + benchmark("Click addJsonFile", function() { + $("#dynatree-id-_6").click(); + }); +}); +/* +timedTest(".click() add10000_deep", function() { + $("#dynatree-id-_5").click(); +}); + +test("Load 100 nodes (flat)", function() { + var parent = $("#tree").dynatree("getTree").getNodeByKey("_1"); +// addNodes(parent, 100, 0, 0) + ok( true, "all pass" ); +}); +*/ +/******************************************************************************* + * Module Cleanup + */ +module("Cleanup"); +/* +test("Remove children", function() { + var root = $("#tree").dynatree("getRoot"); + for(var i = 0; i<root.childList.length; i++) + root.childList[i].removeChildren(); +// ok( true, "all pass" ); +}); +*/ +// --- +}); diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test.html new file mode 100644 index 0000000000000000000000000000000000000000..dc7edd6cf856c3dee2b33bb8059933e5ed73fc3f --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/dynatree/tests/test.html @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> + <script src="../jquery/jquery.js" type="text/javascript"></script> + <script src="../jquery/jquery-ui.custom.js" type="text/javascript"></script> + <script src="../jquery/jquery.cookie.js" type="text/javascript"></script> + + <link rel="stylesheet" href="qunit.css" type="text/css" media="screen" /> + <script type="text/javascript" src="qunit.js"></script> + + <link href="../src/skin/ui.dynatree.css" rel="stylesheet" type="text/css"> + <script src="../src/jquery.dynatree.js" type="text/javascript"></script> + + <script src="test-dynatree.js" type="text/javascript"></script> +</head> +<body> + <h1 id="qunit-header">Dynatree unit tests</h1> + <h2 id="qunit-banner"></h2> + <h2 id="qunit-userAgent"></h2> + <ol id="qunit-tests"></ol> + <hr /> + <div id="tree"></div> +</body> +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html index 47072d7e49cb4a7d9426318d49dbdb93eeecdb32..89cf62d978e7885e55d50450df565bd7af57d548 100644 --- a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html @@ -14,8 +14,15 @@ <link type="text/css" rel="stylesheet" href="./bootstrap/css/bootstrap.css" /> <link type="text/css" rel="stylesheet" href="./bootstrap/css/bootstrap-responsive.css" /> <link type="text/css" rel="stylesheet" href="./flowplayer/skin/minimalist.css" /> + <link type="text/css" rel="stylesheet" href="./dynatree/src/skin-vista/ui.dynatree.css" id="skinSheet"> <script type="text/javascript" src="./js/jquery.blockUI.js"></script> <script type="text/javascript" src="./flowplayer/flowplayer.min.js"></script> + <script type="text/javascript" src="./dynatree/jquery/jquery-ui.custom.js"></script> + <script type="text/javascript" src="./dynatree/jquery/jquery.cookie.js"></script> + <script type="text/javascript" src="./dynatree/src/jquery.dynatree.js"></script> + + + <!-- App files --> <link type="text/css" rel="stylesheet" href="./css/style.css" /> @@ -32,7 +39,8 @@ var allDataStores = null; var mainCluster = null; - var clusters = {}; + var clusters = []; + var allDataSets = null; // @@ -42,7 +50,7 @@ //Attach function to form login var submitFunction = function(event) { event.preventDefault(); - $.blockUI({ message: '<h1><img src="./css/busy.gif" /> Please wait...</h1>' }); + blockUIWithMessage(); openbis.login($.trim($('#username').val()), $.trim($('#password').val()), function(data) { @@ -83,7 +91,7 @@ searchSamplesWithType(sampleType, function(data) { buildLogout(); - buildMenu(data); + buildData(data); } ); } @@ -99,20 +107,63 @@ } function logout() { openbis.logout(function(data) { + /* $("#menu").empty(); $("#main").empty(); - clusters = {}; + clusters = []; $("#login-form-div").show(); + */ + location.reload(); }); } // // Menu Setup // - function buildMenu(data) { + + function getClusterWithCode(code) { + for(var clusterIndex = 0; clusterIndex < clusters.length; clusterIndex++) { + var auxCluster = clusters[clusterIndex]; + if(auxCluster.code === code) { + return auxCluster; + } + } + return null; + } + + function buildData(dataToBuild) { + var initalizeGenes = []; + + for (var i = 0; i < dataToBuild.length; i++) { + clusters.push(dataToBuild[i]); //Build a general data structure + + var geneLevelCreatorJSRocks = function(dataCode) { + var geneLevelCreator = function() { + var callbackFunction = function(data) { + getClusterWithCode(dataCode).genes = data; + + if(initalizeGenes.length == 0) { + buildMenu(); + } else { + var nextCall = initalizeGenes.pop(); + nextCall(); + } + } + searchSamplesWithTypeAndCode("GENE", dataCode + ":*", callbackFunction); + } + return geneLevelCreator; + } + initalizeGenes.push(geneLevelCreatorJSRocks(dataToBuild[i].code)); + } + + var firstFunction = initalizeGenes.pop(); + firstFunction(); + } + + function buildMenu() { var $menu = $("<ul>"); - //$("#menu").append("<lu></lu>"); // this is equivalent to the above. It's only good for static things. The above is better for dynamic things, as in this case. - var $experimentLevel = $("<li>") + //$("#menu").append("<ul></ul>"); // this is equivalent to the above. It's only good for static things. The above is better for dynamic things, as in this case. + var $experimentLevel = $("<li>", {'class' : 'folder expanded'}) .append("<a href='javascript:showExperiment()'>" + experimentCode + "</a>"); $menu .append($experimentLevel); @@ -121,46 +172,44 @@ $experimentLevel .append($samplesMenu); - for (var i = 0; i < data.length; i++) { - clusters[data[i].code] = data[i]; //Build a general data structure + for (var i = 0; i < clusters.length; i++) { - var $sampleLevel = $("<li>") - .append("<a href='javascript:showSamples(\""+data[i].identifier+"\")'>" + data[i].code + "</a>"); + var $sampleLevel = $("<li>", {'class' : 'folder'}) + .append("<a href='javascript:showSamples(\""+clusters[i].identifier+"\")'>" + clusters[i].code + "</a>"); $samplesMenu .append($sampleLevel); - var geneLevelCreator = function() { - var $containedSamplesMenu = $("<ul>"); + var $containedSamplesMenu = $("<ul>"); $sampleLevel .append($containedSamplesMenu); - var callbackFunction = function(data) { - clusters[data[0].code.substring(0, data[0].code.indexOf(":"))].genes = data; - - for (var j = 0; j < data.length; j++) { - var cleanGeneCode = data[j].code.substring(data[j].code.indexOf(":")+1); + for (var j = 0; j < clusters[i].genes.length; j++) { + var cleanIdentifier = clusters[i].genes[j].identifier; + var cleanGeneCode = clusters[i].genes[j].code.substring(clusters[i].genes[j].code.indexOf(":")+1); $containedSamplesMenu.append( $("<li>") - .append("<a href='javascript:showContainedSamples(\""+data[j].identifier+"\")'>" + cleanGeneCode + "</a>")); + .append($("<a>", {'href' : "javascript:showContainedSamples('" + cleanIdentifier + "')"}).text(cleanGeneCode)) + ); - } - } - - searchSamplesWithTypeAndCode("GENE", data[i].code + ":*", callbackFunction); } - - geneLevelCreator(); } $("#menu").append($menu); - + + $("#menu").dynatree({ + onClick: function(node, e) { + if(e.target.className === "dynatree-title" && node.data.href) { + eval(node.data.href); + } + } + }); } - // // Navigation // function showExperiment() { + blockUIWithMessage(); $("#main").empty(); //Obtain PDF URL @@ -169,11 +218,13 @@ var pdfFileUrl = files[0]; $("#main").append("<h1>Gene Clusters</h1>"); $("#main").append("<iframe src='" + pdfFileUrl + "' style='width:100%; height:" + $(window).height() + "px; ' frameborder='0'></iframe>"); + $.unblockUI(); } ); } function showSamples(sampleIdentifier) { + blockUIWithMessage(); var displayName = sampleIdentifier.substring(10); $("#main").empty(); @@ -190,8 +241,9 @@ getDataSetFilesFor(sampleIdentifier, "PNG_IMAGES", allDataStores[0].downloadUrl, function(pngFiles) { for(var i = 0; i < pngFiles.length; i++) { - $("#main").append("<a target='_blank' href='" + pngFiles[i] + "'><img src='" + pngFiles[i] + "' style='width: 20%;' /></a>"); + $("#main").append("<a target='_blank' href='" + pngFiles[i] + "'><img src='" + pngFiles[i] + "' style='width: 20%; min-width:220px;' /></a>"); } + $.unblockUI(); } ); } @@ -199,7 +251,7 @@ } function showContainedSamples(sampleIdentifier) { - $.blockUI({ message: '<h1><img src="./css/busy.gif" /> Please wait...</h1>' }); + blockUIWithMessage(); var displayName = sampleIdentifier.substring(10); $("#main").empty(); @@ -264,7 +316,7 @@ openbis.listDataSetsForExperiments([mainCluster], null, function(datasets) { allDataSets = datasets.result; - $.unblockUI(); + showExperiment(); } ); }; @@ -314,12 +366,10 @@ var $paddingRight = $("<div>", { 'class' : 'span2'}); var $videoList = $("<div>", { 'class' : 'span2 videoList'}); - var $playerWrapper = $("<div>", { 'class' : 'span6' }); - var $player = $("<div>", { 'id': id, 'class' : 'flowplayer', 'data-swf' : './flowplayer/flowplayer.swf' }); - $playerWrapper.append($player); - + var $player = $("<div>", { 'id': id, 'class' : 'span6 flowplayer', 'data-swf' : './flowplayer/flowplayer.swf' }); + $playerWidget.append($videoList); - $playerWidget.append($playerWrapper); + $playerWidget.append($player); for(var i = 0; i < videoListURL.length; i++) { var greatJSObjectOrientation = function() { @@ -352,8 +402,25 @@ return $playerWidgetContainer; } - - + // + // BlockUI + // + blockUIWithMessage = function(message) { + + var css = { + 'border': 'none', + 'padding': '10px', + '-webkit-border-radius': '10px', + '-moz-border-radius': '10px', + 'border-radius' : '10px', + 'box-shadow' : '0px 0px 10px rgba(50, 50, 50, 0.8)', + '-webkit-box-shadow' : '0px 0px 10px rgba(50, 50, 50, 0.8)', + '-moz-box-shadow' : '0px 0px 10px rgba(50, 50, 50, 0.8)', + 'cursor' : 'default' + }; + + $.blockUI({ message: '<h1><img src="./css/busy.gif" /> Please wait...</h1>' , css: css }); + } diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html-ce75a519-fb00-49fb-beaf-c3ff2c523002 b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html-ce75a519-fb00-49fb-beaf-c3ff2c523002 new file mode 100644 index 0000000000000000000000000000000000000000..bb0ff079674fd00f81e1775e7182161327557a8c --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index.html-ce75a519-fb00-49fb-beaf-c3ff2c523002 @@ -0,0 +1,274 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> + <title>Sinergia</title> + + <!-- openBIS --> + <script type="text/javascript" src="/openbis/resources/js/jquery.js"></script> + <script type="text/javascript" src="/openbis/resources/js/openbis.js"></script> + + + <!-- Third party libraries --> + <link type="text/css" rel="stylesheet" href="./bootstrap/css/bootstrap.css" /> + <link type="text/css" rel="stylesheet" href="./bootstrap/css/bootstrap-responsive.css" /> + <script type="text/javascript" src="./js/jquery.blockUI.js"></script> + <script type="text/javascript" src="./js/pdfobject.js"></script> + + <!-- App files --> + <link type="text/css" rel="stylesheet" href="./css/style.css" /> + <script type="text/javascript" src="./js/search.js"></script> + + <script type="text/javascript"> + // + // Global variables + // + var openbis = new openbis(); + var experimentCode = 'CLUSTERS'; + var experimentIdentifier = '/SINERGIA/CLUSTERS/CLUSTERS'; + var sampleType ='CLUSTER'; + + var allDataStores = null; + var mainCluster = null; + var clusters = {}; + var allDataSets = null; + + // + // Login + // + $(document).ready(function() { + //Attach function to form login + var submitFunction = function(event) { + event.preventDefault(); + $.blockUI({ message: '<h1><img src="./css/busy.gif" /> Please wait...</h1>' }); + + openbis.login($.trim($('#username').val()), $.trim($('#password').val()), + function(data) { + $.unblockUI(); + enterApp(data) + }); + } + $("#loginForm").submit(submitFunction); + + //Avoid login if we got already a cookie + openbis.ifRestoredSessionActive(function(data) { enterApp(data) }); + }); + + function enterApp(data){ + if(data.result === null) { + //Login not correct + window.alert("Login information incorrect."); + return; + } + else { + $("#login-form-div").hide(); + //Loading main experiment + openbis.listExperimentsForIdentifiers([experimentIdentifier], + function (data) { + mainCluster = data.result[0]; + //Get datastores + openbis.listDataStores( + function(data) { + allDataStores = data.result; + loadAllDataSets(); //Get all datasets using the experiment + } + ); + + + } + ); + + //Build menu and load samples data structure + searchSamplesWithType(sampleType, + function(data) { + buildLogout(); + buildMenu(data); + } + ); + } + + + } + + // + // Logout + // + function buildLogout() { + $("#menu").append("<a class='logout-btn' href='javascript:logout()'>Logout <img src='./images/System-Logout-icon.png'></a>"); + } + function logout() { + openbis.logout(function(data) { + $("#menu").empty(); + $("#main").empty(); + clusters = {}; + $("#login-form-div").show(); + }); + } + + // + // Menu Setup + // + function buildMenu(data) { + var $menu = $("<ul>"); + //$("#menu").append("<lu></lu>"); // this is equivalent to the above. It's only good for static things. The above is better for dynamic things, as in this case. + var $experimentLevel = $("<li>") + .append("<a href='javascript:showExperiment(\""+experimentCode+"\")'>" + experimentCode + "</a>"); + $menu + .append($experimentLevel); + + var $samplesMenu = $("<ul>"); + $experimentLevel + .append($samplesMenu); + + for (var i = 0; i < data.length; i++) { + clusters[data[i].code] = data[i]; //Build a general data structure + + var $sampleLevel = $("<li>") + .append("<a href='javascript:showSamples(\""+data[i].code+"\")'>" + data[i].code + "</a>"); + $samplesMenu + .append($sampleLevel); + + var geneLevelCreator = function() { + var $containedSamplesMenu = $("<ul>"); + $sampleLevel + .append($containedSamplesMenu); + + var callbackFunction = function(data) { + clusters[data[0].code.substring(0, data[0].code.indexOf(":"))].genes = data; + + for (var j = 0; j < data.length; j++) { + var cleanGeneCode = data[j].code.substring(data[j].code.indexOf(":")+1); + $containedSamplesMenu.append( + $("<li>") + .append("<a href='javascript:showContainedSamples(\""+cleanGeneCode+"\")'>" + cleanGeneCode + "</a>")); + + } + } + + searchSamplesWithTypeAndCode("GENE", data[i].code + ":*", callbackFunction); + } + + geneLevelCreator(); + } + + $("#menu").append($menu); + + } + + + // + // Navigation + // + function showExperiment(code) { + $("#main").empty(); + + //Obtain PDF URL + getDataSetFilesFor(null, "PDF", allDataStores[0].downloadUrl, + function(files) { + $("#main").append("<h1>Gene Clusters<h1>"); + var pdfFile = files[0]; + var failureMessage = 'It appears you do not have a PDF plugin for this browser. ' + //$("#main").append("<object data='" + pdfFile + "#toolbar=1&navpanes=0&scrollbar=1&page=1&view=FitH" + "' type='application/pdf' width='100%' height='100%'>" + failureMessage + "</object>"); + $("#main").append("<iframe src='" + pdfFile + " height = '100%' width ='100%'></iframe>" ; + } + ); + } + + function showSamples(code) { + $("#main").append(code); + } + + function showContainedSamples(code) { + $("#main").append(code); + } + + // + // Data Loader + // + function loadAllDataSets() { + openbis.listDataSetsForExperiments([mainCluster], null, + function(datasets) { + allDataSets = datasets.result; + } + ); + }; + + function getDataSetFilesFor(sampleIdentifier, dataSetTypeCode, datastoreDownloadURL, callback) { + //Obtain datasets + var datasets = []; + for(var i = 0; i < allDataSets.length; i++) { + if( allDataSets[i].sampleIdentifierOrNull === sampleIdentifier && + allDataSets[i].dataSetTypeCode === dataSetTypeCode ) { + datasets.push(allDataSets[i]); + } + } + //List dataset files + var allDatasetFiles = []; + + var callBackForFiles = function(datasetFiles) { + if(datasetFiles) { + var dataset = datasets.pop(); + + for(var i = 0; i < datasetFiles.result.length; i++) { + if(!datasetFiles.result[i].isDirectory) { + var dowloadUrl = datastoreDownloadURL + '/' + dataset.code + "/" + datasetFiles.result[i].pathInDataSet + "?sessionID=" + openbis.getSession(); + allDatasetFiles.push(dowloadUrl); + } + } + } + + if(datasets.length === 0) { + callback(allDatasetFiles); + } else { + openbis.listFilesForDataSet(datasets[datasets.length-1].code, "/", true, callBackForFiles); + } + }; + + callBackForFiles(null); + } + + + + </script> +</head> + + + + + + +<body class="bodyLogin"> + <div id="login-form-div" class="loginForm"> + <img class="loginLogo" src="./images/openBIS_Logo.png" alt="openBIS" /> + <h1>Sinergia Project</h1> + + <form id="loginForm" action="javascript:"> + <fieldset> + <div class='loginInputBox'> + <input placeholder="User Name" id="username" type="text" required="required"> + </div> + + <div class='loginInputBox'> + <input placeholder="Password" id="password" type="password" required="required"> + </div> + + <button class="btn" id="login-button" type="submit"><i class="icon-arrow-right"></i></button> + </fieldset> + </form> + + <center> + <div style="margin-bottom: 5px; margin-top: 100px;">Compatible With:</div> + <img src="./images/browser-icon-chrome.png" style="width: 43px; height:43px;" /><img src="./images/browser-icon-safari.png" style="width: 43px; height:43px;" /><img src="./images/browser-icon-firefox.png" style="width: 43px; height:43px;" /> + </center> + </div> + + <div class="container-fluid"> + <div class="row-fluid"> + <div id ="menu" class="span3"></div> + <div id ="main" class="span8"></div> + </div> + </div> +</body> + +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index_new.html b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index_new.html new file mode 100644 index 0000000000000000000000000000000000000000..847cdcf51a14f92a04f794429c035e755fcb8ba3 --- /dev/null +++ b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/index_new.html @@ -0,0 +1,334 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> + <title>Sinergia</title> + + <!-- openBIS --> + <script type="text/javascript" src="/openbis/resources/js/jquery.js"></script> + <script type="text/javascript" src="/openbis/resources/js/openbis.js"></script> + + + <!-- Third party libraries --> + <link type="text/css" rel="stylesheet" href="./bootstrap/css/bootstrap.css" /> + <link type="text/css" rel="stylesheet" href="./bootstrap/css/bootstrap-responsive.css" /> + <script type="text/javascript" src="./js/jquery.blockUI.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> + <script src="./js/flowplayer.min.js"></script> + <link rel="stylesheet" href="./css/minimalist.css"> + + <!-- App files --> + <link type="text/css" rel="stylesheet" href="./css/style.css" /> + <script type="text/javascript" src="./js/search.js"></script> + + <script type="text/javascript"> + // + // Global variables + // + var openbis = new openbis(); + var experimentCode = 'CLUSTERS'; + var experimentIdentifier = '/SINERGIA/CLUSTERS/CLUSTERS'; + var sampleType ='CLUSTER'; + + var allDataStores = null; + var mainCluster = null; + var clusters = {}; + var allDataSets = null; + + // + // Login + // + $(document).ready(function() { + //Attach function to form login + var submitFunction = function(event) { + event.preventDefault(); + $.blockUI({ message: '<h1><img src="./css/busy.gif" /> Please wait...</h1>' }); + + openbis.login($.trim($('#username').val()), $.trim($('#password').val()), + function(data) { + enterApp(data) + }); + } + $("#loginForm").submit(submitFunction); + + //Avoid login if we got already a cookie + openbis.ifRestoredSessionActive(function(data) { enterApp(data) }); + }); + + function enterApp(data){ + if(data.result === null) { + //Login not correct + window.alert("Login information incorrect."); + return; + } + else { + $("#login-form-div").hide(); + //Loading main experiment + openbis.listExperimentsForIdentifiers([experimentIdentifier], + function (data) { + mainCluster = data.result[0]; + //Get datastores + openbis.listDataStores( + function(data) { + allDataStores = data.result; + loadAllDataSets(); //Get all datasets using the experiment + } + ); + + + } + ); + + //Build menu and load samples data structure + searchSamplesWithType(sampleType, + function(data) { + buildLogout(); + buildMenu(data); + } + ); + } + + + } + + // + // Logout + // + function buildLogout() { + $("#menu").append("<a class='logout-btn' href='javascript:logout()'>Logout <img src='./images/System-Logout-icon.png'></a>"); + } + function logout() { + openbis.logout(function(data) { + $("#menu").empty(); + $("#main").empty(); + clusters = {}; + $("#login-form-div").show(); + }); + } + + // + // Menu Setup + // + function buildMenu(data) { + var $menu = $("<ul>"); + //$("#menu").append("<lu></lu>"); // this is equivalent to the above. It's only good for static things. The above is better for dynamic things, as in this case. + var $experimentLevel = $("<li>") + .append("<a href='javascript:showExperiment()'>" + experimentCode + "</a>"); + $menu + .append($experimentLevel); + + var $samplesMenu = $("<ul>"); + $experimentLevel + .append($samplesMenu); + + for (var i = 0; i < data.length; i++) { + clusters[data[i].code] = data[i]; //Build a general data structure + + var $sampleLevel = $("<li>") + .append("<a href='javascript:showSamples(\""+data[i].identifier+"\")'>" + data[i].code + "</a>"); + $samplesMenu + .append($sampleLevel); + + var geneLevelCreator = function() { + var $containedSamplesMenu = $("<ul>"); + $sampleLevel + .append($containedSamplesMenu); + + var callbackFunction = function(data) { + clusters[data[0].code.substring(0, data[0].code.indexOf(":"))].genes = data; + + for (var j = 0; j < data.length; j++) { + var cleanGeneCode = data[j].code.substring(data[j].code.indexOf(":")+1); + $containedSamplesMenu.append( + $("<li>") + .append("<a href='javascript:showContainedSamples(\""+data[j].identifier+"\")'>" + cleanGeneCode + "</a>")); + + } + } + + searchSamplesWithTypeAndCode("GENE", data[i].code + ":*", callbackFunction); + } + + geneLevelCreator(); + } + + $("#menu").append($menu); + + } + + + // + // Navigation + // + function showExperiment() { + $("#main").empty(); + + //Obtain PDF URL + getDataSetFilesFor(null, "PDF", allDataStores[0].downloadUrl, + function(files) { + var pdfFileUrl = files[0]; + $("#main").append("<h1>Gene Clusters</h1>"); + $("#main").append("<iframe src='" + pdfFileUrl + "' style='width:100%; height:" + $(window).height() + "px; ' frameborder='0'></iframe>"); + } + ); + } + + function showSamples(sampleIdentifier) { + var displayName = sampleIdentifier.substring(10); + $("#main").empty(); + + //Obtain PDF URL + getDataSetFilesFor(sampleIdentifier, "PDF", allDataStores[0].downloadUrl, + function(pdfFiles) { + var pdfFileUrl = pdfFiles[0]; + $("#main").append("<h1>" + displayName + "</h1>"); + $("#main").append("<h2>Genes: </h2>"); + $("#main").append("<iframe src='" + pdfFileUrl + "' style='width:100%; height:" + $(window).height()/2 + "px; ' frameborder='0'></iframe>"); + $("#main").append("<h2>Representative Images: </h2>"); + + //Obtain Image URL + getDataSetFilesFor(sampleIdentifier, "PNG_IMAGES", allDataStores[0].downloadUrl, + function(pngFiles) { + for(var i = 0; i < pngFiles.length; i++) { + $("#main").append("<a target='_blank' href='" + pngFiles[i] + "'><img src='" + pngFiles[i] + "' style='width: 20%;' /></a>"); + + } + + } + ); + } + ); + } + + function showContainedSamples(sampleIdentifier) { + var displayName = sampleIdentifier.substring(10); + $("#main").empty(); + + //Obtain PDF URL + getDataSetFilesFor(sampleIdentifier, "PDF", allDataStores[0].downloadUrl, + function(pdfFiles) { + $("#main").append("<h1>" + displayName + "</h1>"); + + for(var i = 0; i < pdfFiles.length; i++) { + var pdfFileUrl = pdfFiles[i]; + var component = ""; + + component += "<div style='float: left; margin-right:20px;'>"; + if(pdfFileUrl.indexOf("rnaProfile.pdf") !== -1) { + component += "<h2>RNA Profile:</h2>"; + } else if(pdfFileUrl.indexOf("geneProfile.pdf") !== -1) { + component += "<h2>Gene Profile:</h2>"; + } + component += "<iframe src='" + pdfFileUrl + "' style='width:" + ($("#main").width()/7) * 3 + "px; height:" + $(window).height()/2 + "px; ' frameborder='0'></iframe>"; + component += "</div>"; + + $("#main").append(component); + } + + //Obtain movies URL + $("#main").append("<h2>Control Videos:</h2>"); + //getDataSetFilesFor(sampleIdentifier, "VIDEOS", allDataStores[0].downloadUrl, + // function(videoFiles) { + // for(var i = 0; i < videoFiles.length; i++) { + // $("#main").append("<div class='flowplayer'> <video> <source type='video/mp4' src=' " + videoFiles[i]+ "'></video></div> "); + // } + // } + + // ); + + $("#main").append("<h2>Gene Videos:</h2>"); + } + ); + } + + // + // Data Loader + // + function loadAllDataSets() { + openbis.listDataSetsForExperiments([mainCluster], null, + function(datasets) { + allDataSets = datasets.result; + $.unblockUI(); + } + ); + }; + + function getDataSetFilesFor(sampleIdentifier, dataSetTypeCode, datastoreDownloadURL, callback) { + //Obtain datasets + var datasets = []; + for(var i = 0; i < allDataSets.length; i++) { + if( allDataSets[i].sampleIdentifierOrNull === sampleIdentifier && + allDataSets[i].dataSetTypeCode === dataSetTypeCode ) { + datasets.push(allDataSets[i]); + } + } + //List dataset files + var allDatasetFiles = []; + + var callBackForFiles = function(datasetFiles) { + if(datasetFiles) { + var dataset = datasets.pop(); + + for(var i = 0; i < datasetFiles.result.length; i++) { + if(!datasetFiles.result[i].isDirectory) { + var dowloadUrl = datastoreDownloadURL + '/' + dataset.code + "/" + datasetFiles.result[i].pathInDataSet + "?sessionID=" + openbis.getSession(); + allDatasetFiles.push(dowloadUrl); + } + } + } + + if(datasets.length === 0) { + callback(allDatasetFiles); + } else { + openbis.listFilesForDataSet(datasets[datasets.length-1].code, "/", true, callBackForFiles); + } + }; + + callBackForFiles(null); + } + + + + </script> +</head> + + + + + + +<body class="bodyLogin"> + <div id="login-form-div" class="loginForm"> + <img class="loginLogo" src="./images/openBIS_Logo.png" alt="openBIS" /> + <h1>Sinergia Project</h1> + + <form id="loginForm" action="javascript:"> + <fieldset> + <div class='loginInputBox'> + <input placeholder="User Name" id="username" type="text" required="required"> + </div> + + <div class='loginInputBox'> + <input placeholder="Password" id="password" type="password" required="required"> + </div> + + <button class="btn" id="login-button" type="submit"><i class="icon-arrow-right"></i></button> + </fieldset> + </form> + + <center> + <div style="margin-bottom: 5px; margin-top: 100px;">Compatible With:</div> + <img src="./images/browser-icon-chrome.png" style="width: 43px; height:43px;" /><img src="./images/browser-icon-safari.png" style="width: 43px; height:43px;" /><img src="./images/browser-icon-firefox.png" style="width: 43px; height:43px;" /> + </center> + </div> + + <div class="container-fluid"> + <div class="row-fluid"> + <div id ="menu" class="span3"></div> + <div id ="main" class="span9"></div> + </div> + </div> +</body> + +</html> diff --git a/screening/sinergia/sinergia/1/as/webapps/sinergia/html/test.mp4 b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/test.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..3e368c5b5774e23096c65f032063122558ab58cf Binary files /dev/null and b/screening/sinergia/sinergia/1/as/webapps/sinergia/html/test.mp4 differ