diff options
| author | 2021-02-03 19:17:00 -0500 | |
|---|---|---|
| committer | 2021-02-03 19:17:00 -0500 | |
| commit | 3a0d66f07b112b6d2bdc2b57bbf717a89a351ce6 (patch) | |
| tree | a7cf56282e54f05785243bc1e903d6594f2c06ba /npm_assets/node_modules/html5shiv | |
| parent | 787b97a4cb24330b36f11297c6d3a7a473a907d0 (diff) | |
New upstream version 8.1.2.upstream/8.1.2
Diffstat (limited to 'npm_assets/node_modules/html5shiv')
51 files changed, 9473 insertions, 0 deletions
diff --git a/npm_assets/node_modules/html5shiv/.gitattributes b/npm_assets/node_modules/html5shiv/.gitattributes new file mode 100644 index 0000000..2125666 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/.gitattributes @@ -0,0 +1 @@ +* text=auto
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/.npmignore b/npm_assets/node_modules/html5shiv/.npmignore new file mode 100644 index 0000000..91dfed8 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/.npmignore @@ -0,0 +1,2 @@ +.DS_Store +node_modules
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/Gruntfile.js b/npm_assets/node_modules/html5shiv/Gruntfile.js new file mode 100644 index 0000000..1218a46 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/Gruntfile.js @@ -0,0 +1,61 @@ +/*global module:false*/ +module.exports = function(grunt){ + + + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + bower: grunt.file.readJSON('bower.json'), + copy: { + demo: { + files: [ + {expand: true, src: ['src/*'], dest: 'dist/', filter: 'isFile', flatten: true} + ] + } + }, + + uglify: { + options: { + beautify: { + ascii_only : true + }, + preserveComments: 'some' + }, + html5shiv: { + files: [{ + expand: true, // Enable dynamic expansion. + cwd: 'src/', // Src matches are relative to this path. + src: ['**/*.js'], // Actual pattern(s) to match. + dest: 'dist/', // Destination path prefix. + ext: '.min.js' + }] + } + }, + watch: { + js: { + files: ['src/**/*.js'], + tasks: ['copy', 'uglify', 'bytesize'] + } + }, + bytesize: { + all: { + src: [ + 'dist/**.min.js' + ] + } + } + }); + + + // Default task. + + + + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-bytesize'); + + grunt.registerTask('default', ['copy', 'uglify', 'bytesize', 'watch']); + +}; diff --git a/npm_assets/node_modules/html5shiv/MIT and GPL2 licenses.md b/npm_assets/node_modules/html5shiv/MIT and GPL2 licenses.md new file mode 100644 index 0000000..a9538ee --- /dev/null +++ b/npm_assets/node_modules/html5shiv/MIT and GPL2 licenses.md @@ -0,0 +1,372 @@ +Copyright (c) 2014 Alexander Farkas (aFarkas). + +This software is licensed under a dual license system (MIT or GPL version 2). +This means you are free to choose with which of both licenses (MIT or +GPL version 2) you want to use this library. + +The license texts of the MIT license and the GPL version 2 are as follows: + + +## MIT License + + 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. + + + +## GNU GENERAL PUBLIC LICENSE Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <Html5shiv, The HTML5 Shiv enables use of HTML5 sectioning elements in + legacy Internet Explorer and provides basic HTML5 styling for Internet Explorer 6-9, + Safari 4.x (and iPhone 3.x), and Firefox 3.x.> + Copyright (C) 2014 Alexander Farkas (aFarkas) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 2014 Alexander Farkas (aFarkas) + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/npm_assets/node_modules/html5shiv/bower.json b/npm_assets/node_modules/html5shiv/bower.json new file mode 100644 index 0000000..5814f00 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/bower.json @@ -0,0 +1,15 @@ +{ + "name": "html5shiv", + "version": "3.7.3", + "main": [ + "dist/html5shiv.js" + ], + "ignore": [ + "**/.*", + "composer.json", + "test", + "build", + "src", + "build.xml" + ] +} diff --git a/npm_assets/node_modules/html5shiv/composer.json b/npm_assets/node_modules/html5shiv/composer.json new file mode 100644 index 0000000..e56e2ac --- /dev/null +++ b/npm_assets/node_modules/html5shiv/composer.json @@ -0,0 +1,20 @@ +{ + "name": "afarkas/html5shiv", + "description": "Defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.", + "type": "component", + "homepage": "http://paulirish.com/2011/the-history-of-the-html5-shiv/", + "license": [ + "MIT", + "GPL-2.0" + ], + "require": { + "robloach/component-installer": "*" + }, + "extra": { + "component": { + "scripts": [ + "dist/html5shiv.js" + ] + } + } +} diff --git a/npm_assets/node_modules/html5shiv/dist/html5shiv-printshiv.js b/npm_assets/node_modules/html5shiv/dist/html5shiv-printshiv.js new file mode 100644 index 0000000..2fe2028 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/dist/html5shiv-printshiv.js @@ -0,0 +1,524 @@ +/** +* @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +;(function(window, document) { +/*jshint evil:true */ + /** version */ + var version = '3.7.3'; + + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = '<xyz></xyz>'; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + // assign a false positive if detection fails => unable to shiv + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x<style>' + cssText + '</style>'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Extends the built-in list of html5 elements + * @memberOf html5 + * @param {String|Array} newElements whitespace separated list or array of new element names to shiv + * @param {Document} ownerDocument The context document. + */ + function addElements(newElements, ownerDocument) { + var elements = html5.elements; + if(typeof elements != 'string'){ + elements = elements.join(' '); + } + if(typeof newElements != 'string'){ + newElements = newElements.join(' '); + } + html5.elements = elements +' '+ newElements; + shivDocument(ownerDocument); + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i<l;i++){ + clone.createElement(elems[i]); + } + return clone; + } + + /** + * Shivs the `createElement` and `createDocumentFragment` methods of the document. + * @private + * @param {Document|DocumentFragment} ownerDocument The document. + * @param {Object} data of the document. + */ + function shivMethods(ownerDocument, data) { + if (!data.cache) { + data.cache = {}; + data.createElem = ownerDocument.createElement; + data.createFrag = ownerDocument.createDocumentFragment; + data.frag = data.createFrag(); + } + + + ownerDocument.createElement = function(nodeName) { + //abort shiv + if (!html5.shivMethods) { + return data.createElem(nodeName); + } + return createElement(nodeName, ownerDocument, data); + }; + + ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + + 'var n=f.cloneNode(),c=n.createElement;' + + 'h.shivMethods&&(' + + // unroll the `createElement` calls + getElements().join().replace(/[\w\-:]+/g, function(nodeName) { + data.createElem(nodeName); + data.frag.createElement(nodeName); + return 'c("' + nodeName + '")'; + }) + + ');return n}' + )(html5, data.frag); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Shivs the given document. + * @memberOf html5 + * @param {Document} ownerDocument The document to shiv. + * @returns {Document} The shived document. + */ + function shivDocument(ownerDocument) { + if (!ownerDocument) { + ownerDocument = document; + } + var data = getExpandoData(ownerDocument); + + if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { + data.hasCSS = !!addStyleSheet(ownerDocument, + // corrects block display not defined in IE6/7/8/9 + 'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' + + // adds styling not present in IE6/7/8/9 + 'mark{background:#FF0;color:#000}' + + // hides non-rendered elements + 'template{display:none}' + ); + } + if (!supportsUnknownElements) { + shivMethods(ownerDocument, data); + } + return ownerDocument; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The `html5` object is exposed so that more elements can be shived and + * existing shiving can be detected on iframes. + * @type Object + * @example + * + * // options can be changed before the script is included + * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; + */ + var html5 = { + + /** + * An array or space separated string of node names of the elements to shiv. + * @memberOf html5 + * @type Array|String + */ + 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video', + + /** + * current version of html5shiv + */ + 'version': version, + + /** + * A flag to indicate that the HTML5 style sheet should be inserted. + * @memberOf html5 + * @type Boolean + */ + 'shivCSS': (options.shivCSS !== false), + + /** + * Is equal to true if a browser supports creating unknown/HTML5 elements + * @memberOf html5 + * @type boolean + */ + 'supportsUnknownElements': supportsUnknownElements, + + /** + * A flag to indicate that the document's `createElement` and `createDocumentFragment` + * methods should be overwritten. + * @memberOf html5 + * @type Boolean + */ + 'shivMethods': (options.shivMethods !== false), + + /** + * A string to describe the type of `html5` object ("default" or "default print"). + * @memberOf html5 + * @type String + */ + 'type': 'default', + + // shivs the document according to the specified `html5` object options + 'shivDocument': shivDocument, + + //creates a shived element + createElement: createElement, + + //creates a shived documentFragment + createDocumentFragment: createDocumentFragment, + + //extends list of elements + addElements: addElements + }; + + /*--------------------------------------------------------------------------*/ + + // expose html5 + window.html5 = html5; + + // shiv the document + shivDocument(document); + + /*------------------------------- Print Shiv -------------------------------*/ + + /** Used to filter media types */ + var reMedia = /^$|\b(?:all|print)\b/; + + /** Used to namespace printable elements */ + var shivNamespace = 'html5shiv'; + + /** Detect whether the browser supports shivable style sheets */ + var supportsShivableSheets = !supportsUnknownElements && (function() { + // assign a false negative if unable to shiv + var docEl = document.documentElement; + return !( + typeof document.namespaces == 'undefined' || + typeof document.parentWindow == 'undefined' || + typeof docEl.applyElement == 'undefined' || + typeof docEl.removeNode == 'undefined' || + typeof window.attachEvent == 'undefined' + ); + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Wraps all HTML5 elements in the given document with printable elements. + * (eg. the "header" element is wrapped with the "html5shiv:header" element) + * @private + * @param {Document} ownerDocument The document. + * @returns {Array} An array wrappers added. + */ + function addWrappers(ownerDocument) { + var node, + nodes = ownerDocument.getElementsByTagName('*'), + index = nodes.length, + reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'), + result = []; + + while (index--) { + node = nodes[index]; + if (reElements.test(node.nodeName)) { + result.push(node.applyElement(createWrapper(node))); + } + } + return result; + } + + /** + * Creates a printable wrapper for the given element. + * @private + * @param {Element} element The element. + * @returns {Element} The wrapper. + */ + function createWrapper(element) { + var node, + nodes = element.attributes, + index = nodes.length, + wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName); + + // copy element attributes to the wrapper + while (index--) { + node = nodes[index]; + node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue); + } + // copy element styles to the wrapper + wrapper.style.cssText = element.style.cssText; + return wrapper; + } + + /** + * Shivs the given CSS text. + * (eg. header{} becomes html5shiv\:header{}) + * @private + * @param {String} cssText The CSS text to shiv. + * @returns {String} The shived CSS text. + */ + function shivCssText(cssText) { + var pair, + parts = cssText.split('{'), + index = parts.length, + reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'), + replacement = '$1' + shivNamespace + '\\:$2'; + + while (index--) { + pair = parts[index] = parts[index].split('}'); + pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement); + parts[index] = pair.join('}'); + } + return parts.join('{'); + } + + /** + * Removes the given wrappers, leaving the original elements. + * @private + * @params {Array} wrappers An array of printable wrappers. + */ + function removeWrappers(wrappers) { + var index = wrappers.length; + while (index--) { + wrappers[index].removeNode(); + } + } + + /*--------------------------------------------------------------------------*/ + + /** + * Shivs the given document for print. + * @memberOf html5 + * @param {Document} ownerDocument The document to shiv. + * @returns {Document} The shived document. + */ + function shivPrint(ownerDocument) { + var shivedSheet, + wrappers, + data = getExpandoData(ownerDocument), + namespaces = ownerDocument.namespaces, + ownerWindow = ownerDocument.parentWindow; + + if (!supportsShivableSheets || ownerDocument.printShived) { + return ownerDocument; + } + if (typeof namespaces[shivNamespace] == 'undefined') { + namespaces.add(shivNamespace); + } + + function removeSheet() { + clearTimeout(data._removeSheetTimer); + if (shivedSheet) { + shivedSheet.removeNode(true); + } + shivedSheet= null; + } + + ownerWindow.attachEvent('onbeforeprint', function() { + + removeSheet(); + + var imports, + length, + sheet, + collection = ownerDocument.styleSheets, + cssText = [], + index = collection.length, + sheets = Array(index); + + // convert styleSheets collection to an array + while (index--) { + sheets[index] = collection[index]; + } + // concat all style sheet CSS text + while ((sheet = sheets.pop())) { + // IE does not enforce a same origin policy for external style sheets... + // but has trouble with some dynamically created stylesheets + if (!sheet.disabled && reMedia.test(sheet.media)) { + + try { + imports = sheet.imports; + length = imports.length; + } catch(er){ + length = 0; + } + + for (index = 0; index < length; index++) { + sheets.push(imports[index]); + } + + try { + cssText.push(sheet.cssText); + } catch(er){} + } + } + + // wrap all HTML5 elements with printable elements and add the shived style sheet + cssText = shivCssText(cssText.reverse().join('')); + wrappers = addWrappers(ownerDocument); + shivedSheet = addStyleSheet(ownerDocument, cssText); + + }); + + ownerWindow.attachEvent('onafterprint', function() { + // remove wrappers, leaving the original elements, and remove the shived style sheet + removeWrappers(wrappers); + clearTimeout(data._removeSheetTimer); + data._removeSheetTimer = setTimeout(removeSheet, 500); + }); + + ownerDocument.printShived = true; + return ownerDocument; + } + + /*--------------------------------------------------------------------------*/ + + // expose API + html5.type += ' print'; + html5.shivPrint = shivPrint; + + // shiv for print + shivPrint(document); + + if(typeof module == 'object' && module.exports){ + module.exports = html5; + } + +}(typeof window !== "undefined" ? window : this, document)); diff --git a/npm_assets/node_modules/html5shiv/dist/html5shiv-printshiv.min.js b/npm_assets/node_modules/html5shiv/dist/html5shiv-printshiv.min.js new file mode 100644 index 0000000..2b43bd0 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/dist/html5shiv-printshiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document);
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/dist/html5shiv.js b/npm_assets/node_modules/html5shiv/dist/html5shiv.js new file mode 100644 index 0000000..b6e46a4 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/dist/html5shiv.js @@ -0,0 +1,326 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +;(function(window, document) { +/*jshint evil:true */ + /** version */ + var version = '3.7.3-pre'; + + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = '<xyz></xyz>'; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + // assign a false positive if detection fails => unable to shiv + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x<style>' + cssText + '</style>'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Extends the built-in list of html5 elements + * @memberOf html5 + * @param {String|Array} newElements whitespace separated list or array of new element names to shiv + * @param {Document} ownerDocument The context document. + */ + function addElements(newElements, ownerDocument) { + var elements = html5.elements; + if(typeof elements != 'string'){ + elements = elements.join(' '); + } + if(typeof newElements != 'string'){ + newElements = newElements.join(' '); + } + html5.elements = elements +' '+ newElements; + shivDocument(ownerDocument); + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i<l;i++){ + clone.createElement(elems[i]); + } + return clone; + } + + /** + * Shivs the `createElement` and `createDocumentFragment` methods of the document. + * @private + * @param {Document|DocumentFragment} ownerDocument The document. + * @param {Object} data of the document. + */ + function shivMethods(ownerDocument, data) { + if (!data.cache) { + data.cache = {}; + data.createElem = ownerDocument.createElement; + data.createFrag = ownerDocument.createDocumentFragment; + data.frag = data.createFrag(); + } + + + ownerDocument.createElement = function(nodeName) { + //abort shiv + if (!html5.shivMethods) { + return data.createElem(nodeName); + } + return createElement(nodeName, ownerDocument, data); + }; + + ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + + 'var n=f.cloneNode(),c=n.createElement;' + + 'h.shivMethods&&(' + + // unroll the `createElement` calls + getElements().join().replace(/[\w\-:]+/g, function(nodeName) { + data.createElem(nodeName); + data.frag.createElement(nodeName); + return 'c("' + nodeName + '")'; + }) + + ');return n}' + )(html5, data.frag); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Shivs the given document. + * @memberOf html5 + * @param {Document} ownerDocument The document to shiv. + * @returns {Document} The shived document. + */ + function shivDocument(ownerDocument) { + if (!ownerDocument) { + ownerDocument = document; + } + var data = getExpandoData(ownerDocument); + + if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { + data.hasCSS = !!addStyleSheet(ownerDocument, + // corrects block display not defined in IE6/7/8/9 + 'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' + + // adds styling not present in IE6/7/8/9 + 'mark{background:#FF0;color:#000}' + + // hides non-rendered elements + 'template{display:none}' + ); + } + if (!supportsUnknownElements) { + shivMethods(ownerDocument, data); + } + return ownerDocument; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The `html5` object is exposed so that more elements can be shived and + * existing shiving can be detected on iframes. + * @type Object + * @example + * + * // options can be changed before the script is included + * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; + */ + var html5 = { + + /** + * An array or space separated string of node names of the elements to shiv. + * @memberOf html5 + * @type Array|String + */ + 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video', + + /** + * current version of html5shiv + */ + 'version': version, + + /** + * A flag to indicate that the HTML5 style sheet should be inserted. + * @memberOf html5 + * @type Boolean + */ + 'shivCSS': (options.shivCSS !== false), + + /** + * Is equal to true if a browser supports creating unknown/HTML5 elements + * @memberOf html5 + * @type boolean + */ + 'supportsUnknownElements': supportsUnknownElements, + + /** + * A flag to indicate that the document's `createElement` and `createDocumentFragment` + * methods should be overwritten. + * @memberOf html5 + * @type Boolean + */ + 'shivMethods': (options.shivMethods !== false), + + /** + * A string to describe the type of `html5` object ("default" or "default print"). + * @memberOf html5 + * @type String + */ + 'type': 'default', + + // shivs the document according to the specified `html5` object options + 'shivDocument': shivDocument, + + //creates a shived element + createElement: createElement, + + //creates a shived documentFragment + createDocumentFragment: createDocumentFragment, + + //extends list of elements + addElements: addElements + }; + + /*--------------------------------------------------------------------------*/ + + // expose html5 + window.html5 = html5; + + // shiv the document + shivDocument(document); + + if(typeof module == 'object' && module.exports){ + module.exports = html5; + } + +}(typeof window !== "undefined" ? window : this, document)); diff --git a/npm_assets/node_modules/html5shiv/dist/html5shiv.min.js b/npm_assets/node_modules/html5shiv/dist/html5shiv.min.js new file mode 100644 index 0000000..cd1c674 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/dist/html5shiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/package.json b/npm_assets/node_modules/html5shiv/package.json new file mode 100644 index 0000000..5bac677 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/package.json @@ -0,0 +1,46 @@ +{ + "_from": "html5shiv@^3.7.3", + "_id": "html5shiv@3.7.3", + "_inBundle": false, + "_integrity": "sha1-14qEo2e8uacQEA1XgCw4ewhGMdI=", + "_location": "/html5shiv", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "html5shiv@^3.7.3", + "name": "html5shiv", + "escapedName": "html5shiv", + "rawSpec": "^3.7.3", + "saveSpec": null, + "fetchSpec": "^3.7.3" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/html5shiv/-/html5shiv-3.7.3.tgz", + "_shasum": "d78a84a367bcb9a710100d57802c387b084631d2", + "_spec": "html5shiv@^3.7.3", + "_where": "/Users/kwpolska/git/nikola/npm_assets", + "bugs": { + "url": "https://github.com/aFarkas/html5shiv/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "The HTML5 Shiv enables use of HTML5 sectioning elements in legacy Internet Explorer and provides basic HTML5 styling for Internet Explorer 6-9, Safari 4.x (and iPhone 3.x), and Firefox 3.x.", + "devDependencies": { + "grunt": ">=0.4.1", + "grunt-bytesize": ">=0.1.0", + "grunt-contrib-copy": ">=0.4.0", + "grunt-contrib-uglify": ">=0.2.7", + "grunt-contrib-watch": ">=0.3.0" + }, + "homepage": "https://github.com/aFarkas/html5shiv#readme", + "main": "dist/html5shiv.js", + "name": "html5shiv", + "repository": { + "type": "git", + "url": "git+https://github.com/aFarkas/html5shiv.git" + }, + "version": "3.7.3" +} diff --git a/npm_assets/node_modules/html5shiv/readme.md b/npm_assets/node_modules/html5shiv/readme.md new file mode 100644 index 0000000..4ae8465 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/readme.md @@ -0,0 +1,152 @@ +# The HTML5 Shiv + +The HTML5 Shiv enables use of HTML5 sectioning elements in legacy Internet Explorer and provides basic HTML5 styling for Internet Explorer 6-9, Safari 4.x (and iPhone 3.x), and Firefox 3.x. + +### What do these files do? + +#### `html5shiv.js` +* This includes the basic `createElement()` shiv technique, along with monkeypatches for `document.createElement` and `document.createDocumentFragment` for IE6-8. It also applies [basic styling](https://github.com/aFarkas/html5shiv/blob/51da98dabd3c537891b7fe6114633fb10de52473/src/html5shiv.js#L216-220) for HTML5 elements for IE6-9, Safari 4.x and FF 3.x. + +####`html5shiv-printshiv.js` +* This includes all of the above, as well as a mechanism allowing HTML5 elements to be styled and contain children while being printed in IE 6-8. + +### Who can I get mad at now? + +HTML5 Shiv is maintained by [Alexander Farkas](https://github.com/aFarkas/), [Jonathan Neal](https://twitter.com/jon_neal) and [Paul Irish](https://twitter.com/paul_irish), with many contributions from [John-David Dalton](https://twitter.com/jdalton). It is also distributed with [Modernizr](http://modernizr.com/). + +If you have any issues in these implementations, you can report them here! :) + +For the full story of HTML5 Shiv and all of the people involved in making it, read [The Story of the HTML5 Shiv](http://paulirish.com/2011/the-history-of-the-html5-shiv/). + +## Installation + +###Using [Bower](http://bower.io/) + +`bower install html5shiv --save-dev` + +This will clone the latest version of the HTML5 shiv into the `bower_components` directory at the root of your project and also create or update the file `bower.json` which specifies your projects dependencies. + +Include the HTML5 shiv in the `<head>` of your page in a conditional comment and after any stylesheets. + +```html +<!--[if lt IE 9]> + <script src="bower_components/html5shiv/dist/html5shiv.js"></script> +<![endif]--> +``` + +###Manual installation + +Download and extract the [latest zip package](https://github.com/aFarkas/html5shiv/archive/master.zip) from this repositiory and copy the two files `dist/html5shiv.js` and `dist/html5shiv-printshiv.js` into your project. Then include one of them into your `<head>` as above. + +## HTML5 Shiv API + +HTML5 Shiv works as a simple drop-in solution. In most cases there is no need to configure HTML5 Shiv or use methods provided by HTML5 Shiv. + +### `html5.elements` option + +The `elements` option is a space separated string or array, which describes the **full** list of the elements to shiv. see also `addElements`. + +**Configuring `elements` before `html5shiv.js` is included.** + +```js +//create a global html5 options object +window.html5 = { + 'elements': 'mark section customelement' +}; +``` +**Configuring `elements` after `html5shiv.js` is included.** + +```js +//change the html5shiv options object +window.html5.elements = 'mark section customelement'; +//and re-invoke the `shivDocument` method +html5.shivDocument(document); +``` + +### `html5.shivCSS` + +If `shivCSS` is set to `true` HTML5 Shiv will add basic styles (mostly display: block) to sectioning elements (like section, article). In most cases a webpage author should include those basic styles in his normal stylesheet to ensure older browser support (i.e. Firefox 3.6) without JavaScript. + +The `shivCSS` is true by default and can be set false, only before html5shiv.js is included: + +```js +//create a global html5 options object +window.html5 = { + 'shivCSS': false +}; +``` + +### `html5.shivMethods` + +If the `shivMethods` option is set to `true` (by default) HTML5 Shiv will override `document.createElement`/`document.createDocumentFragment` in Internet Explorer 6-8 to allow dynamic DOM creation of HTML5 elements. + +Known issue: If an element is created using the overridden `createElement` method this element returns a document fragment as its `parentNode`, but should be normally `null`. If a script relies on this behavior, `shivMethods`should be set to `false`. +Note: jQuery 1.7+ has implemented his own HTML5 DOM creation fix for Internet Explorer 6-8. If all your scripts (including Third party scripts) are using jQuery's manipulation and DOM creation methods, you might want to set this option to `false`. + +**Configuring `shivMethods` before `html5shiv.js` is included.** + +```js +//create a global html5 options object +window.html5 = { + 'shivMethods': false +}; +``` +**Configuring `elements` after `html5shiv.js` is included.** + +```js +//change the html5shiv options object +window.html5.shivMethods = false; +``` + +### `html5.addElements( newElements [, document] )` + +The `html5.addElements` method extends the list of elements to shiv. The newElements argument can be a whitespace separated list or an array. + +```js +//extend list of elements to shiv +html5.addElements('element content'); +``` + +### `html5.createElement( nodeName [, document] )` + +The `html5.createElement` method creates a shived element, even if `shivMethods` is set to false. + +```js +var container = html5.createElement('div'); +//container is shived so we can add HTML5 elements using `innerHTML` +container.innerHTML = '<section>This is a section</section>'; +``` + +### `html5.createDocumentFragment( [document] )` + +The `html5.createDocumentFragment` method creates a shived document fragment, even if `shivMethods` is set to false. + +```js +var fragment = html5.createDocumentFragment(); +var container = document.createElement('div'); +fragment.appendChild(container); +//fragment is shived so we can add HTML5 elements using `innerHTML` +container.innerHTML = '<section>This is a section</section>'; +``` + +## HTML5 Shiv Known Issues and Limitations + +- The `shivMethods` option (overriding `document.createElement`) and the `html5.createElement` method create elements, which are not disconnected and have a parentNode (see also issue #64) +- The cloneNode problem is currently not addressed by HTML5 Shiv. HTML5 elements can be dynamically created, but can't be cloned in all cases. +- The printshiv version of HTML5 Shiv has to alter the print styles and the whole DOM for printing. In case of complex websites and or a lot of print styles this might cause performance and/or styling issues. A possible solution could be the [htc-branch](https://github.com/aFarkas/html5shiv/tree/iepp-htc) of HTML5 Shiv, which uses another technique to implement print styles for Internet Explorer 6-8. + +### What about the other HTML5 element projects? + +- The original conception and community collaboration story of the project is described at [The History of the HTML5 Shiv](http://paulirish.com/2011/the-history-of-the-html5-shiv/). +- [IEPP](https://code.google.com/p/ie-print-protector), by Jon Neal, addressed the printing fault of the original `html5shiv`. It was merged into `html5shiv`. +- **Shimprove**, in April 2010, patched `cloneNode` and `createElement` was later merged into `html5shiv` +- **innerShiv**, introduced in August 2010 by JD Barlett, addressed dynamically adding new HTML5 elements into the DOM. [jQuery added support](http://blog.jquery.com/2011/11/03/jquery-1-7-released/) that made innerShiv redundant and `html5shiv` addressed the same issues as well, so the project was completed. +- The **html5shim** and **html5shiv** sites on Google Code are maintained by Remy Sharp and are identical distribution points of this `html5shiv` project. +- **Modernizr** is developed by the same people as `html5shiv` and can include the latest version in any custom builds created at modernizr.com +- This `html5shiv` repo now contains tests for all the edge cases pursued by the above libraries and has been extensively tested, both in development and production. + +A [detailed changelog of html5shiv](https://github.com/aFarkas/html5shiv/wiki) is available. + +### Why is it called a *shiv*? + +The term **shiv** [originates](http://ejohn.org/blog/html5-shiv/) from [John Resig](https://github.com/jeresig), who was thought to have used the word for its slang meaning, *a sharp object used as a knife-like weapon*, intended for Internet Explorer. Truth be known, John probably intended to use the word [shim](http://en.wikipedia.org/wiki/Shim_(computing)), which in computing means *an application compatibility workaround*. Rather than correct his mispelling, most developers familiar with Internet Explorer appreciated the visual imagery. And that, [kids](http://html5homi.es/), is [etymology](https://en.wikipedia.org/wiki/Etymology). diff --git a/npm_assets/node_modules/html5shiv/src/html5shiv-printshiv.js b/npm_assets/node_modules/html5shiv/src/html5shiv-printshiv.js new file mode 100644 index 0000000..2fe2028 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/src/html5shiv-printshiv.js @@ -0,0 +1,524 @@ +/** +* @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +;(function(window, document) { +/*jshint evil:true */ + /** version */ + var version = '3.7.3'; + + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = '<xyz></xyz>'; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + // assign a false positive if detection fails => unable to shiv + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x<style>' + cssText + '</style>'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Extends the built-in list of html5 elements + * @memberOf html5 + * @param {String|Array} newElements whitespace separated list or array of new element names to shiv + * @param {Document} ownerDocument The context document. + */ + function addElements(newElements, ownerDocument) { + var elements = html5.elements; + if(typeof elements != 'string'){ + elements = elements.join(' '); + } + if(typeof newElements != 'string'){ + newElements = newElements.join(' '); + } + html5.elements = elements +' '+ newElements; + shivDocument(ownerDocument); + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i<l;i++){ + clone.createElement(elems[i]); + } + return clone; + } + + /** + * Shivs the `createElement` and `createDocumentFragment` methods of the document. + * @private + * @param {Document|DocumentFragment} ownerDocument The document. + * @param {Object} data of the document. + */ + function shivMethods(ownerDocument, data) { + if (!data.cache) { + data.cache = {}; + data.createElem = ownerDocument.createElement; + data.createFrag = ownerDocument.createDocumentFragment; + data.frag = data.createFrag(); + } + + + ownerDocument.createElement = function(nodeName) { + //abort shiv + if (!html5.shivMethods) { + return data.createElem(nodeName); + } + return createElement(nodeName, ownerDocument, data); + }; + + ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + + 'var n=f.cloneNode(),c=n.createElement;' + + 'h.shivMethods&&(' + + // unroll the `createElement` calls + getElements().join().replace(/[\w\-:]+/g, function(nodeName) { + data.createElem(nodeName); + data.frag.createElement(nodeName); + return 'c("' + nodeName + '")'; + }) + + ');return n}' + )(html5, data.frag); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Shivs the given document. + * @memberOf html5 + * @param {Document} ownerDocument The document to shiv. + * @returns {Document} The shived document. + */ + function shivDocument(ownerDocument) { + if (!ownerDocument) { + ownerDocument = document; + } + var data = getExpandoData(ownerDocument); + + if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { + data.hasCSS = !!addStyleSheet(ownerDocument, + // corrects block display not defined in IE6/7/8/9 + 'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' + + // adds styling not present in IE6/7/8/9 + 'mark{background:#FF0;color:#000}' + + // hides non-rendered elements + 'template{display:none}' + ); + } + if (!supportsUnknownElements) { + shivMethods(ownerDocument, data); + } + return ownerDocument; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The `html5` object is exposed so that more elements can be shived and + * existing shiving can be detected on iframes. + * @type Object + * @example + * + * // options can be changed before the script is included + * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; + */ + var html5 = { + + /** + * An array or space separated string of node names of the elements to shiv. + * @memberOf html5 + * @type Array|String + */ + 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video', + + /** + * current version of html5shiv + */ + 'version': version, + + /** + * A flag to indicate that the HTML5 style sheet should be inserted. + * @memberOf html5 + * @type Boolean + */ + 'shivCSS': (options.shivCSS !== false), + + /** + * Is equal to true if a browser supports creating unknown/HTML5 elements + * @memberOf html5 + * @type boolean + */ + 'supportsUnknownElements': supportsUnknownElements, + + /** + * A flag to indicate that the document's `createElement` and `createDocumentFragment` + * methods should be overwritten. + * @memberOf html5 + * @type Boolean + */ + 'shivMethods': (options.shivMethods !== false), + + /** + * A string to describe the type of `html5` object ("default" or "default print"). + * @memberOf html5 + * @type String + */ + 'type': 'default', + + // shivs the document according to the specified `html5` object options + 'shivDocument': shivDocument, + + //creates a shived element + createElement: createElement, + + //creates a shived documentFragment + createDocumentFragment: createDocumentFragment, + + //extends list of elements + addElements: addElements + }; + + /*--------------------------------------------------------------------------*/ + + // expose html5 + window.html5 = html5; + + // shiv the document + shivDocument(document); + + /*------------------------------- Print Shiv -------------------------------*/ + + /** Used to filter media types */ + var reMedia = /^$|\b(?:all|print)\b/; + + /** Used to namespace printable elements */ + var shivNamespace = 'html5shiv'; + + /** Detect whether the browser supports shivable style sheets */ + var supportsShivableSheets = !supportsUnknownElements && (function() { + // assign a false negative if unable to shiv + var docEl = document.documentElement; + return !( + typeof document.namespaces == 'undefined' || + typeof document.parentWindow == 'undefined' || + typeof docEl.applyElement == 'undefined' || + typeof docEl.removeNode == 'undefined' || + typeof window.attachEvent == 'undefined' + ); + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Wraps all HTML5 elements in the given document with printable elements. + * (eg. the "header" element is wrapped with the "html5shiv:header" element) + * @private + * @param {Document} ownerDocument The document. + * @returns {Array} An array wrappers added. + */ + function addWrappers(ownerDocument) { + var node, + nodes = ownerDocument.getElementsByTagName('*'), + index = nodes.length, + reElements = RegExp('^(?:' + getElements().join('|') + ')$', 'i'), + result = []; + + while (index--) { + node = nodes[index]; + if (reElements.test(node.nodeName)) { + result.push(node.applyElement(createWrapper(node))); + } + } + return result; + } + + /** + * Creates a printable wrapper for the given element. + * @private + * @param {Element} element The element. + * @returns {Element} The wrapper. + */ + function createWrapper(element) { + var node, + nodes = element.attributes, + index = nodes.length, + wrapper = element.ownerDocument.createElement(shivNamespace + ':' + element.nodeName); + + // copy element attributes to the wrapper + while (index--) { + node = nodes[index]; + node.specified && wrapper.setAttribute(node.nodeName, node.nodeValue); + } + // copy element styles to the wrapper + wrapper.style.cssText = element.style.cssText; + return wrapper; + } + + /** + * Shivs the given CSS text. + * (eg. header{} becomes html5shiv\:header{}) + * @private + * @param {String} cssText The CSS text to shiv. + * @returns {String} The shived CSS text. + */ + function shivCssText(cssText) { + var pair, + parts = cssText.split('{'), + index = parts.length, + reElements = RegExp('(^|[\\s,>+~])(' + getElements().join('|') + ')(?=[[\\s,>+~#.:]|$)', 'gi'), + replacement = '$1' + shivNamespace + '\\:$2'; + + while (index--) { + pair = parts[index] = parts[index].split('}'); + pair[pair.length - 1] = pair[pair.length - 1].replace(reElements, replacement); + parts[index] = pair.join('}'); + } + return parts.join('{'); + } + + /** + * Removes the given wrappers, leaving the original elements. + * @private + * @params {Array} wrappers An array of printable wrappers. + */ + function removeWrappers(wrappers) { + var index = wrappers.length; + while (index--) { + wrappers[index].removeNode(); + } + } + + /*--------------------------------------------------------------------------*/ + + /** + * Shivs the given document for print. + * @memberOf html5 + * @param {Document} ownerDocument The document to shiv. + * @returns {Document} The shived document. + */ + function shivPrint(ownerDocument) { + var shivedSheet, + wrappers, + data = getExpandoData(ownerDocument), + namespaces = ownerDocument.namespaces, + ownerWindow = ownerDocument.parentWindow; + + if (!supportsShivableSheets || ownerDocument.printShived) { + return ownerDocument; + } + if (typeof namespaces[shivNamespace] == 'undefined') { + namespaces.add(shivNamespace); + } + + function removeSheet() { + clearTimeout(data._removeSheetTimer); + if (shivedSheet) { + shivedSheet.removeNode(true); + } + shivedSheet= null; + } + + ownerWindow.attachEvent('onbeforeprint', function() { + + removeSheet(); + + var imports, + length, + sheet, + collection = ownerDocument.styleSheets, + cssText = [], + index = collection.length, + sheets = Array(index); + + // convert styleSheets collection to an array + while (index--) { + sheets[index] = collection[index]; + } + // concat all style sheet CSS text + while ((sheet = sheets.pop())) { + // IE does not enforce a same origin policy for external style sheets... + // but has trouble with some dynamically created stylesheets + if (!sheet.disabled && reMedia.test(sheet.media)) { + + try { + imports = sheet.imports; + length = imports.length; + } catch(er){ + length = 0; + } + + for (index = 0; index < length; index++) { + sheets.push(imports[index]); + } + + try { + cssText.push(sheet.cssText); + } catch(er){} + } + } + + // wrap all HTML5 elements with printable elements and add the shived style sheet + cssText = shivCssText(cssText.reverse().join('')); + wrappers = addWrappers(ownerDocument); + shivedSheet = addStyleSheet(ownerDocument, cssText); + + }); + + ownerWindow.attachEvent('onafterprint', function() { + // remove wrappers, leaving the original elements, and remove the shived style sheet + removeWrappers(wrappers); + clearTimeout(data._removeSheetTimer); + data._removeSheetTimer = setTimeout(removeSheet, 500); + }); + + ownerDocument.printShived = true; + return ownerDocument; + } + + /*--------------------------------------------------------------------------*/ + + // expose API + html5.type += ' print'; + html5.shivPrint = shivPrint; + + // shiv for print + shivPrint(document); + + if(typeof module == 'object' && module.exports){ + module.exports = html5; + } + +}(typeof window !== "undefined" ? window : this, document)); diff --git a/npm_assets/node_modules/html5shiv/src/html5shiv.js b/npm_assets/node_modules/html5shiv/src/html5shiv.js new file mode 100644 index 0000000..b6e46a4 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/src/html5shiv.js @@ -0,0 +1,326 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +;(function(window, document) { +/*jshint evil:true */ + /** version */ + var version = '3.7.3-pre'; + + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = '<xyz></xyz>'; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + // assign a false positive if detection fails => unable to shiv + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x<style>' + cssText + '</style>'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Extends the built-in list of html5 elements + * @memberOf html5 + * @param {String|Array} newElements whitespace separated list or array of new element names to shiv + * @param {Document} ownerDocument The context document. + */ + function addElements(newElements, ownerDocument) { + var elements = html5.elements; + if(typeof elements != 'string'){ + elements = elements.join(' '); + } + if(typeof newElements != 'string'){ + newElements = newElements.join(' '); + } + html5.elements = elements +' '+ newElements; + shivDocument(ownerDocument); + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i<l;i++){ + clone.createElement(elems[i]); + } + return clone; + } + + /** + * Shivs the `createElement` and `createDocumentFragment` methods of the document. + * @private + * @param {Document|DocumentFragment} ownerDocument The document. + * @param {Object} data of the document. + */ + function shivMethods(ownerDocument, data) { + if (!data.cache) { + data.cache = {}; + data.createElem = ownerDocument.createElement; + data.createFrag = ownerDocument.createDocumentFragment; + data.frag = data.createFrag(); + } + + + ownerDocument.createElement = function(nodeName) { + //abort shiv + if (!html5.shivMethods) { + return data.createElem(nodeName); + } + return createElement(nodeName, ownerDocument, data); + }; + + ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + + 'var n=f.cloneNode(),c=n.createElement;' + + 'h.shivMethods&&(' + + // unroll the `createElement` calls + getElements().join().replace(/[\w\-:]+/g, function(nodeName) { + data.createElem(nodeName); + data.frag.createElement(nodeName); + return 'c("' + nodeName + '")'; + }) + + ');return n}' + )(html5, data.frag); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Shivs the given document. + * @memberOf html5 + * @param {Document} ownerDocument The document to shiv. + * @returns {Document} The shived document. + */ + function shivDocument(ownerDocument) { + if (!ownerDocument) { + ownerDocument = document; + } + var data = getExpandoData(ownerDocument); + + if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { + data.hasCSS = !!addStyleSheet(ownerDocument, + // corrects block display not defined in IE6/7/8/9 + 'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' + + // adds styling not present in IE6/7/8/9 + 'mark{background:#FF0;color:#000}' + + // hides non-rendered elements + 'template{display:none}' + ); + } + if (!supportsUnknownElements) { + shivMethods(ownerDocument, data); + } + return ownerDocument; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The `html5` object is exposed so that more elements can be shived and + * existing shiving can be detected on iframes. + * @type Object + * @example + * + * // options can be changed before the script is included + * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; + */ + var html5 = { + + /** + * An array or space separated string of node names of the elements to shiv. + * @memberOf html5 + * @type Array|String + */ + 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video', + + /** + * current version of html5shiv + */ + 'version': version, + + /** + * A flag to indicate that the HTML5 style sheet should be inserted. + * @memberOf html5 + * @type Boolean + */ + 'shivCSS': (options.shivCSS !== false), + + /** + * Is equal to true if a browser supports creating unknown/HTML5 elements + * @memberOf html5 + * @type boolean + */ + 'supportsUnknownElements': supportsUnknownElements, + + /** + * A flag to indicate that the document's `createElement` and `createDocumentFragment` + * methods should be overwritten. + * @memberOf html5 + * @type Boolean + */ + 'shivMethods': (options.shivMethods !== false), + + /** + * A string to describe the type of `html5` object ("default" or "default print"). + * @memberOf html5 + * @type String + */ + 'type': 'default', + + // shivs the document according to the specified `html5` object options + 'shivDocument': shivDocument, + + //creates a shived element + createElement: createElement, + + //creates a shived documentFragment + createDocumentFragment: createDocumentFragment, + + //extends list of elements + addElements: addElements + }; + + /*--------------------------------------------------------------------------*/ + + // expose html5 + window.html5 = html5; + + // shiv the document + shivDocument(document); + + if(typeof module == 'object' && module.exports){ + module.exports = html5; + } + +}(typeof window !== "undefined" ? window : this, document)); diff --git a/npm_assets/node_modules/html5shiv/test/data/body-crash.jpg b/npm_assets/node_modules/html5shiv/test/data/body-crash.jpg Binary files differnew file mode 100644 index 0000000..8727016 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/body-crash.jpg diff --git a/npm_assets/node_modules/html5shiv/test/data/iframed-tests.html b/npm_assets/node_modules/html5shiv/test/data/iframed-tests.html new file mode 100644 index 0000000..f4e22fe --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/iframed-tests.html @@ -0,0 +1,103 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>iframe tests</title> + + + <style> + body { + background: url(body-crash.jpg) no-repeat -999px -999px; + } + article { + border: 2px solid #8C8; + } + </style> + <script> + (function(){ + window.querys = {}; + var name; + var search= location.search.replace('?', ''); + if(search){ + search = search.split('&'); + for(var i = 0; i < search.length; i++){ + name = search[i].split('='); + querys[name[0]] = true; + } + } + })(); + </script> + <script> + if(querys.disableMethodsBefore){ + if(!window.html5){ + window.html5 = {}; + } + window.html5.shivMethods = false; + } + if(querys.disableCSS){ + if(!window.html5){ + window.html5 = {}; + } + window.html5.shivCSS = false; + } + if(querys.addUnknownBefore){ + if(!window.html5){ + window.html5 = {}; + } + window.html5.elements = 'abcxyz abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output picture progress section summary time video'; + } + + + if(!querys.noEmbed){ + document.write('<script src="..\/..\/src\/html5shiv-printshiv.js"><\/script>'); + } + </script> + <script> + + if(querys.disableMethodsAfter){ + window.html5.shivMethods = false; + } + + if(querys.addUnknownAfter){ + window.html5.elements = 'abcxyz abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output picture progress section summary time video'; + html5.shivDocument(document); + } + </script> + + </head> + <body> + <div id="qunit-fixture"> + <abcxyz> + <div class="inside"></div> + </abcxyz> + <article> + <div class="inside"></div> + </article> + <aside> + <div class="inside"></div> + </aside> + <figcaption> + <div class="inside"></div> + </figcaption> + <figure> + <div class="inside"></div> + </figure> + <footer> + <div class="inside"></div> + </footer> + <header> + <div class="inside"></div> + </header> + <hgroup> + <div class="inside"></div> + </hgroup> + <nav> + <div class="inside"></div> + </nav> + <section> + <div class="inside"></div> + </section> + + </div> + </body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/data/inline-mixed-media.css b/npm_assets/node_modules/html5shiv/test/data/inline-mixed-media.css new file mode 100644 index 0000000..0a4de90 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/inline-mixed-media.css @@ -0,0 +1,11 @@ +@media screen, handheld { + article.inline-mixed-media { + border: 5px solid #000; + } +} + +@media print { + article.inline-mixed-media { + border: 5px dotted #000; + } +}
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/data/inline-print-media.css b/npm_assets/node_modules/html5shiv/test/data/inline-print-media.css new file mode 100644 index 0000000..87b10f1 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/inline-print-media.css @@ -0,0 +1,8 @@ +.inline-print-media form { + border: 5px solid #000; +} +@media print { + .inline-print-media form { + border: 5px dotted #000; + } +} diff --git a/npm_assets/node_modules/html5shiv/test/data/no-print.css b/npm_assets/node_modules/html5shiv/test/data/no-print.css new file mode 100644 index 0000000..2e3dc9e --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/no-print.css @@ -0,0 +1,8 @@ +article:before { + content: "isfnotorprint"; + isfnotorprint: true; +} +article { + content: "isfnotorprint"; + isfnotorprint: true; +}
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/data/paramtracer.swf b/npm_assets/node_modules/html5shiv/test/data/paramtracer.swf Binary files differnew file mode 100644 index 0000000..5d55d47 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/paramtracer.swf diff --git a/npm_assets/node_modules/html5shiv/test/data/print-styles.css b/npm_assets/node_modules/html5shiv/test/data/print-styles.css new file mode 100644 index 0000000..b8f2251 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/print-styles.css @@ -0,0 +1,8 @@ +.print-styles article { + border: 5px dotted #000; +} +@media print { + article.print-styles-print { + border: 5px dotted #000; + } +} diff --git a/npm_assets/node_modules/html5shiv/test/data/print.css b/npm_assets/node_modules/html5shiv/test/data/print.css new file mode 100644 index 0000000..28c988a --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/print.css @@ -0,0 +1,3 @@ +article.print { + border: 5px dotted #000; +}
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/data/screen.css b/npm_assets/node_modules/html5shiv/test/data/screen.css new file mode 100644 index 0000000..f69e58b --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/data/screen.css @@ -0,0 +1,9 @@ +article.print { + border: 5px solid #000; +} +.print-styles article { + border: 5px solid #000; +} +article.print-styles-print { + border: 5px solid #000; +}
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/highcharts/area-basic.html b/npm_assets/node_modules/html5shiv/test/highcharts/area-basic.html new file mode 100644 index 0000000..008e788 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/highcharts/area-basic.html @@ -0,0 +1,85 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>Highcharts Example</title> + <script src="../../src/html5shiv-printshiv.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> + <script src="highcharts.js"></script> + </head> + <body> + <div id="container" style="width:800px;height:400px;margin:0 auto"></div> + <script> + new Highcharts.Chart({ + 'chart': { + 'renderTo': 'container', + 'defaultSeriesType': 'area' + }, + 'title': { + 'text': 'US and USSR nuclear stockpiles' + }, + 'subtitle': { + 'text': 'Source: <a href="http://thebulletin.metapress.com/content/c4120650912x74k7/fulltext.pdf">'+ + 'thebulletin.metapress.com</a>' + }, + 'xAxis': { + 'labels': { + 'formatter': function() { + return this.value; + } + } + }, + 'yAxis': { + 'title': { + 'text': 'Nuclear weapon states' + }, + 'labels': { + 'formatter': function() { + return this.value / 1000 +'k'; + } + } + }, + 'tooltip': { + 'formatter': function() { + return this.series.name +' produced <b>'+ + Highcharts.numberFormat(this.y, 0) +'</b><br/>warheads in '+ this.x; + } + }, + 'plotOptions': { + 'area': { + 'pointStart': 1940, + 'marker': { + 'enabled': false, + 'symbol': 'circle', + 'radius': 2, + 'states': { + 'hover': { + 'enabled': true + } + } + } + } + }, + 'series': [{ + 'name': 'USA', + 'data': [null, null, null, null, null, 6 , 11, 32, 110, 235, 369, 640, + 1005, 1436, 2063, 3057, 4618, 6444, 9822, 15468, 20434, 24126, + 27387, 29459, 31056, 31982, 32040, 31233, 29224, 27342, 26662, + 26956, 27912, 28999, 28965, 27826, 25579, 25722, 24826, 24605, + 24304, 23464, 23708, 24099, 24357, 24237, 24401, 24344, 23586, + 22380, 21004, 17287, 14747, 13076, 12555, 12144, 11009, 10950, + 10871, 10824, 10577, 10527, 10475, 10421, 10358, 10295, 10104 ] + }, { + 'name': 'USSR/Russia', + 'data': [null, null, null, null, null, null, null , null, null, null, + 5, 25, 50, 120, 150, 200, 426, 660, 869, 1060, 1605, 2471, 3322, + 4238, 5221, 6129, 7089, 8339, 9399, 10538, 11643, 13092, 14478, + 15915, 17385, 19055, 21205, 23044, 25393, 27935, 30062, 32049, + 33952, 35804, 37431, 39197, 45000, 43000, 41000, 39000, 37000, + 35000, 33000, 31000, 29000, 27000, 25000, 24000, 23000, 22000, + 21000, 20000, 19000, 18000, 18000, 17000, 16000] + }] + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/highcharts/highcharts.js b/npm_assets/node_modules/html5shiv/test/highcharts/highcharts.js new file mode 100644 index 0000000..0900cd9 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/highcharts/highcharts.js @@ -0,0 +1,176 @@ +/* + Highcharts JS v2.1.9 (2011-11-11) + + (c) 2009-2011 Torstein H?nsi + + License: www.highcharts.com/license +*/ +(function(){function sa(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function ja(a,b){return parseInt(a,b||10)}function Sb(a){return typeof a==="string"}function Nb(a){return typeof a==="object"}function lc(a){return typeof a==="number"}function mc(a){return Fa.log(a)/Fa.LN10}function nc(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function K(a){return a!==Wa&&a!==null}function Ga(a,b,c){var d,e;if(Sb(b))if(K(c))a.setAttribute(b,c);else{if(a&&a.getAttribute)e=a.getAttribute(b)}else if(K(b)&& +Nb(b))for(d in b)a.setAttribute(d,b[d]);return e}function zc(a){return Object.prototype.toString.call(a)==="[object Array]"?a:[a]}function A(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++){c=a[b];if(typeof c!=="undefined"&&c!==null)return c}}function Ja(a,b){if(Pc)if(b&&b.opacity!==Wa)b.filter="alpha(opacity="+b.opacity*100+")";sa(a.style,b)}function hb(a,b,c,d,e){a=ua.createElement(a);b&&sa(a,b);e&&Ja(a,{padding:0,border:jb,margin:0});c&&Ja(a,c);d&&d.appendChild(a);return a}function yb(a,b){var c= +function(){};c.prototype=new a;sa(c.prototype,b);return c}function Ed(a,b,c,d){var e=Xa.lang;a=a;var f=isNaN(b=bb(b))?2:b;b=c===undefined?e.decimalPoint:c;d=d===undefined?e.thousandsSep:d;e=a<0?"-":"";c=String(ja(a=bb(+a||0).toFixed(f)));var g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+bb(a-c).toFixed(f).slice(2):"")}function Fd(a){var b={left:a.offsetLeft,top:a.offsetTop};for(a=a.offsetParent;a;){b.left+=a.offsetLeft;b.top+=a.offsetTop; +if(a!==ua.body&&a!==ua.documentElement){b.left-=a.scrollLeft;b.top-=a.scrollTop}a=a.offsetParent}return b}function Gd(){this.symbol=this.color=0}function fe(a,b,c,d,e,f,g){var h=g.x;g=g.y;var i=h-a+c-25,j=g-b+d+10,m;if(i<7)i=c+h+15;if(i+a>c+e){i-=i+a-(c+e);j-=b;m=true}if(j<5){j=5;if(m&&g>=j&&g<=j+b)j=g+b-5}else if(j+b>d+f)j=d+f-b-5;return{x:i,y:j}}function Hd(a,b){var c=a.length,d;for(d=0;d<c;d++)a[d].ss_i=d;a.sort(function(e,f){var g=b(e,f);return g===0?e.ss_i-f.ss_i:g});for(d=0;d<c;d++)delete a[d].ss_i} +function Ac(a){for(var b in a){a[b]&&a[b].destroy&&a[b].destroy();delete a[b]}}function oc(a,b){Bc=A(a,b.animation)}function Id(){var a=Xa.global.useUTC;Qc=a?Date.UTC:function(b,c,d,e,f,g){return(new Date(b,c,A(d,1),A(e,0),A(f,0),A(g,0))).getTime()};id=a?"getUTCMinutes":"getMinutes";jd=a?"getUTCHours":"getHours";kd=a?"getUTCDay":"getDay";Cc=a?"getUTCDate":"getDate";Rc=a?"getUTCMonth":"getMonth";Sc=a?"getUTCFullYear":"getFullYear";Jd=a?"setUTCMinutes":"setMinutes";Kd=a?"setUTCHours":"setHours";ld= +a?"setUTCDate":"setDate";Ld=a?"setUTCMonth":"setMonth";Md=a?"setUTCFullYear":"setFullYear"}function pc(a){Tc||(Tc=hb(Tb));a&&Tc.appendChild(a);Tc.innerHTML=""}function Uc(){}function Nd(a,b){function c(p){function q(k,n){this.pos=k;this.minor=n;this.isNew=true;n||this.addLabel()}function w(k){if(k){this.options=k;this.id=k.id}return this}function x(k,n,t,r){this.isNegative=n;this.options=k;this.x=t;this.stack=r;this.alignOptions={align:k.align||(va?n?"left":"right":"center"),verticalAlign:k.verticalAlign|| +(va?"middle":n?"bottom":"top"),y:A(k.y,va?4:n?14:-6),x:A(k.x,va?n?-6:6:0)};this.textAlign=k.textAlign||(va?n?"right":"left":"center")}function V(){var k=[],n=[],t;pa=wa=null;zb=[];u(Ha,function(r){t=false;u(["xAxis","yAxis"],function(F){if(r.isCartesian&&(F==="xAxis"&&xa||F==="yAxis"&&!xa)&&(r.options[F]===o.index||r.options[F]===Wa&&o.index===0)){r[F]=I;zb.push(r);t=true}});if(!r.visible&&z.ignoreHiddenSeries)t=false;if(t){var J,E,Q,fa,ka,$;if(!xa){J=r.options.stacking;Vc=J==="percent";if(J){ka= +r.options.stack;fa=r.type+A(ka,"");$="-"+fa;r.stackKey=fa;E=k[fa]||[];k[fa]=E;Q=n[$]||[];n[$]=Q}if(Vc){pa=0;wa=99}}if(r.isCartesian){u(r.data,function(F){var O=F.x,S=F.y,aa=S<0,Eb=aa?Q:E,kb=aa?$:fa;if(pa===null)pa=wa=F[qa];if(xa)if(O>wa)wa=O;else{if(O<pa)pa=O}else if(K(S)){if(J)Eb[O]=K(Eb[O])?Eb[O]+S:S;S=Eb?Eb[O]:S;F=A(F.low,S);if(!Vc)if(S>wa)wa=S;else if(F<pa)pa=F;if(J){s[kb]||(s[kb]={});s[kb][O]||(s[kb][O]=new x(o.stackLabels,aa,O,ka));s[kb][O].setTotal(S)}}});if(/(area|column|bar)/.test(r.type)&& +!xa)if(pa>=0){pa=0;Od=true}else if(wa<0){wa=0;Pd=true}}}})}function N(k,n){var t,r;Fb=n?1:Fa.pow(10,lb(Fa.log(k)/Fa.LN10));t=k/Fb;if(!n){n=[1,2,2.5,5,10];if(o.allowDecimals===false||ca)if(Fb===1)n=[1,2,5,10];else if(Fb<=0.1)n=[1/Fb]}for(r=0;r<n.length;r++){k=n[r];if(t<=(n[r]+(n[r+1]||n[r]))/2)break}k*=Fb;return k}function ta(k){var n;n=k;Fb=A(Fb,Fa.pow(10,lb(Fa.log(Ta)/Fa.LN10)));if(Fb<1){n=W(1/Fb)*10;n=W(k*n)/n}return n}function da(){var k,n,t,r,J=o.tickInterval,E=o.tickPixelInterval;k=o.maxZoom|| +(xa&&!K(o.min)&&!K(o.max)?tb(l.smallestInterval*5,wa-pa):null);ya=R?Da:Aa;if(Ub){t=l[xa?"xAxis":"yAxis"][o.linkedTo];r=t.getExtremes();ia=A(r.min,r.dataMin);ra=A(r.max,r.dataMax)}else{ia=A(Vb,o.min,pa);ra=A(Gb,o.max,wa)}if(ca){ia=mc(ia);ra=mc(ra)}if(ra-ia<k){r=(k-ra+ia)/2;ia=Ia(ia-r,A(o.min,ia-r),pa);ra=tb(ia+k,A(o.max,ia+k),wa)}if(!Ya&&!Vc&&!Ub&&K(ia)&&K(ra)){k=ra-ia||1;if(!K(o.min)&&!K(Vb)&&Qd&&(pa<0||!Od))ia-=k*Qd;if(!K(o.max)&&!K(Gb)&&Rd&&(wa>0||!Pd))ra+=k*Rd}Ta=ia===ra?1:Ub&&!J&&E===t.options.tickPixelInterval? +t.tickInterval:A(J,Ya?1:(ra-ia)*E/ya);if(!D&&!K(o.tickInterval))Ta=N(Ta);I.tickInterval=Ta;Wc=o.minorTickInterval==="auto"&&Ta?Ta/5:o.minorTickInterval;if(D){Ba=[];J=Xa.global.useUTC;var Q=1E3/ub,fa=6E4/ub,ka=36E5/ub;E=864E5/ub;k=6048E5/ub;r=2592E6/ub;var $=31556952E3/ub,F=[["second",Q,[1,2,5,10,15,30]],["minute",fa,[1,2,5,10,15,30]],["hour",ka,[1,2,3,4,6,8,12]],["day",E,[1,2]],["week",k,[1,2]],["month",r,[1,2,3,4,6]],["year",$,null]],O=F[6],S=O[1],aa=O[2];for(t=0;t<F.length;t++){O=F[t];S=O[1];aa= +O[2];if(F[t+1])if(Ta<=(S*aa[aa.length-1]+F[t+1][1])/2)break}if(S===$&&Ta<5*S)aa=[1,2,5];F=N(Ta/S,aa);aa=new Date(ia*ub);aa.setMilliseconds(0);if(S>=Q)aa.setSeconds(S>=fa?0:F*lb(aa.getSeconds()/F));if(S>=fa)aa[Jd](S>=ka?0:F*lb(aa[id]()/F));if(S>=ka)aa[Kd](S>=E?0:F*lb(aa[jd]()/F));if(S>=E)aa[ld](S>=r?1:F*lb(aa[Cc]()/F));if(S>=r){aa[Ld](S>=$?0:F*lb(aa[Rc]()/F));n=aa[Sc]()}if(S>=$){n-=n%F;aa[Md](n)}S===k&&aa[ld](aa[Cc]()-aa[kd]()+o.startOfWeek);t=1;n=aa[Sc]();Q=aa.getTime()/ub;fa=aa[Rc]();for(ka=aa[Cc]();Q< +ra&&t<Da;){Ba.push(Q);if(S===$)Q=Qc(n+t*F,0)/ub;else if(S===r)Q=Qc(n,fa+t*F)/ub;else if(!J&&(S===E||S===k))Q=Qc(n,fa,ka+t*F*(S===E?1:7));else Q+=S*F;t++}Ba.push(Q);Xc=o.dateTimeLabelFormats[O[0]]}else{t=ta(lb(ia/Ta)*Ta);n=ta(md(ra/Ta)*Ta);Ba=[];for(t=ta(t);t<=n;){Ba.push(t);t=ta(t+Ta)}}if(!Ub){if(Ya||xa&&l.hasColumn){n=(Ya?1:Ta)*0.5;if(Ya||!K(A(o.min,Vb)))ia-=n;if(Ya||!K(A(o.max,Gb)))ra+=n}n=Ba[0];t=Ba[Ba.length-1];if(o.startOnTick)ia=n;else ia>n&&Ba.shift();if(o.endOnTick)ra=t;else ra<t&&Ba.pop(); +Ob||(Ob={x:0,y:0});if(!D&&Ba.length>Ob[qa])Ob[qa]=Ba.length}}function Ma(){var k,n;Dc=ia;Sd=ra;V();da();Hb=fb;fb=ya/(ra-ia||1);if(!xa)for(k in s)for(n in s[k])s[k][n].cum=s[k][n].total;if(!I.isDirty)I.isDirty=ia!==Dc||ra!==Sd}function za(k){k=(new w(k)).render();Pb.push(k);return k}function eb(){var k=o.title,n=o.stackLabels,t=o.alternateGridColor,r=o.lineWidth,J,E,Q=(J=l.hasRendered)&&K(Dc)&&!isNaN(Dc);E=zb.length&&K(ia)&&K(ra);ya=R?Da:Aa;fb=ya/(ra-ia||1);cc=R?X:vb;if(E||Ub){if(Wc&&!Ya)for(E=ia+ +(Ba[0]-ia)%Wc;E<=ra;E+=Wc){Wb[E]||(Wb[E]=new q(E,true));Q&&Wb[E].isNew&&Wb[E].render(null,true);Wb[E].isActive=true;Wb[E].render()}u(Ba,function($,F){if(!Ub||$>=ia&&$<=ra){Q&&mb[$].isNew&&mb[$].render(F,true);mb[$].isActive=true;mb[$].render(F)}});t&&u(Ba,function($,F){if(F%2===0&&$<ra){dc[$]||(dc[$]=new w);dc[$].options={from:$,to:Ba[F+1]!==Wa?Ba[F+1]:ra,color:t};dc[$].render();dc[$].isActive=true}});J||u((o.plotLines||[]).concat(o.plotBands||[]),function($){Pb.push((new w($)).render())})}u([mb, +Wb,dc],function($){for(var F in $)if($[F].isActive)$[F].isActive=false;else{$[F].destroy();delete $[F]}});if(r){J=X+(Oa?Da:0)+la;E=cb-vb-(Oa?Aa:0)+la;J=ga.crispLine([Za,R?X:J,R?E:ea,Ka,R?$a-Ib:J,R?E:cb-vb],r);if(La)La.animate({d:J});else La=ga.path(J).attr({stroke:o.lineColor,"stroke-width":r,zIndex:7}).add()}if(ba){J=R?X:ea;r=ja(k.style.fontSize||12);J={low:J+(R?0:ya),middle:J+ya/2,high:J+(R?ya:0)}[k.align];r=(R?ea+Aa:X)+(R?1:-1)*(Oa?-1:1)*nd+(L===2?r:0);ba[ba.isNew?"attr":"animate"]({x:R?J:r+(Oa? +Da:0)+la+(k.x||0),y:R?r-(Oa?Aa:0)+la:J+(k.y||0)});ba.isNew=false}if(n&&n.enabled){var fa,ka;n=I.stackTotalGroup;if(!n)I.stackTotalGroup=n=ga.g("stack-labels").attr({visibility:Ab,zIndex:6}).translate(X,ea).add();for(fa in s){k=s[fa];for(ka in k)k[ka].render(n)}}I.isDirty=false}function ab(k){for(var n=Pb.length;n--;)Pb[n].id===k&&Pb[n].destroy()}var xa=p.isX,Oa=p.opposite,R=va?!xa:xa,L=R?Oa?0:2:Oa?1:3,s={},o=Ca(xa?Yc:od,[ge,he,Td,ie][L],p),I=this,ba,B=o.type,D=B==="datetime",ca=B==="logarithmic", +la=o.offset||0,qa=xa?"x":"y",ya,fb,Hb,cc=R?X:vb,G,ha,na,Ra,La,pa,wa,zb,Vb,Gb,ra=null,ia=null,Dc,Sd,Qd=o.minPadding,Rd=o.maxPadding,Ub=K(o.linkedTo),Od,Pd,Vc;B=o.events;var pd,Pb=[],Ta,Wc,Fb,Ba,mb={},Wb={},dc={},qc,rc,nd,Xc,Ya=o.categories,je=o.labels.formatter||function(){var k=this.value;return Xc?Zc(Xc,k):Ta%1E6===0?k/1E6+"M":Ta%1E3===0?k/1E3+"k":!Ya&&k>=1E3?Ed(k,0):k},$c=R&&o.labels.staggerLines,ec=o.reversed,fc=Ya&&o.tickmarkPlacement==="between"?0.5:0;q.prototype={addLabel:function(){var k=this.pos, +n=o.labels,t=!(k===ia&&!A(o.showFirstLabel,1)||k===ra&&!A(o.showLastLabel,0)),r=Ya&&R&&Ya.length&&!n.step&&!n.staggerLines&&!n.rotation&&Da/Ya.length||!R&&Da/2,J=Ya&&K(Ya[k])?Ya[k]:k,E=this.label;k=je.call({isFirst:k===Ba[0],isLast:k===Ba[Ba.length-1],dateTimeLabelFormat:Xc,value:ca?Fa.pow(10,J):J});r=r&&{width:Ia(1,W(r-2*(n.padding||10)))+Ua};r=sa(r,n.style);if(E===Wa)this.label=K(k)&&t&&n.enabled?ga.text(k,0,0,n.useHTML).attr({align:n.align,rotation:n.rotation}).css(r).add(na):null;else E&&E.attr({text:k}).css(r)}, +getLabelSize:function(){var k=this.label;return k?(this.labelBBox=k.getBBox())[R?"height":"width"]:0},render:function(k,n){var t=!this.minor,r=this.label,J=this.pos,E=o.labels,Q=this.gridLine,fa=t?o.gridLineWidth:o.minorGridLineWidth,ka=t?o.gridLineColor:o.minorGridLineColor,$=t?o.gridLineDashStyle:o.minorGridLineDashStyle,F=this.mark,O=t?o.tickLength:o.minorTickLength,S=t?o.tickWidth:o.minorTickWidth||0,aa=t?o.tickColor:o.minorTickColor,Eb=t?o.tickPosition:o.minorTickPosition,kb=E.step,nb=n&&ad|| +cb,Qb;Qb=R?G(J+fc,null,null,n)+cc:X+la+(Oa?(n&&qd||$a)-Ib-X:0);nb=R?nb-vb+la-(Oa?Aa:0):nb-G(J+fc,null,null,n)-cc;if(fa){J=ha(J+fc,fa,n);if(Q===Wa){Q={stroke:ka,"stroke-width":fa};if($)Q.dashstyle=$;if(t)Q.zIndex=1;this.gridLine=Q=fa?ga.path(J).attr(Q).add(Ra):null}!n&&Q&&J&&Q.animate({d:J})}if(S){if(Eb==="inside")O=-O;if(Oa)O=-O;t=ga.crispLine([Za,Qb,nb,Ka,Qb+(R?0:-O),nb+(R?O:0)],S);if(F)F.animate({d:t});else this.mark=ga.path(t).attr({stroke:aa,"stroke-width":S}).add(na)}if(r&&!isNaN(Qb)){Qb=Qb+ +E.x-(fc&&R?fc*fb*(ec?-1:1):0);nb=nb+E.y-(fc&&!R?fc*fb*(ec?1:-1):0);K(E.y)||(nb+=ja(r.styles.lineHeight)*0.9-r.getBBox().height/2);if($c)nb+=k/(kb||1)%$c*16;if(kb)r[k%kb?"hide":"show"]();r[this.isNew?"attr":"animate"]({x:Qb,y:nb})}this.isNew=false},destroy:function(){Ac(this)}};w.prototype={render:function(){var k=this,n=k.options,t=n.label,r=k.label,J=n.width,E=n.to,Q=n.from,fa=n.value,ka,$=n.dashStyle,F=k.svgElem,O=[],S,aa,Eb=n.color;aa=n.zIndex;var kb=n.events;if(ca){Q=mc(Q);E=mc(E);fa=mc(fa)}if(J){O= +ha(fa,J);n={stroke:Eb,"stroke-width":J};if($)n.dashstyle=$}else if(K(Q)&&K(E)){Q=Ia(Q,ia);E=tb(E,ra);ka=ha(E);if((O=ha(Q))&&ka)O.push(ka[4],ka[5],ka[1],ka[2]);else O=null;n={fill:Eb}}else return;if(K(aa))n.zIndex=aa;if(F)if(O)F.animate({d:O},null,F.onGetPath);else{F.hide();F.onGetPath=function(){F.show()}}else if(O&&O.length){k.svgElem=F=ga.path(O).attr(n).add();if(kb){$=function(nb){F.on(nb,function(Qb){kb[nb].apply(k,[Qb])})};for(S in kb)$(S)}}if(t&&K(t.text)&&O&&O.length&&Da>0&&Aa>0){t=Ca({align:R&& +ka&&"center",x:R?!ka&&4:10,verticalAlign:!R&&ka&&"middle",y:R?ka?16:10:ka?6:-4,rotation:R&&!ka&&90},t);if(!r)k.label=r=ga.text(t.text,0,0).attr({align:t.textAlign||t.align,rotation:t.rotation,zIndex:aa}).css(t.style).add();ka=[O[1],O[4],A(O[6],O[1])];O=[O[2],O[5],A(O[7],O[2])];S=tb.apply(Fa,ka);aa=tb.apply(Fa,O);r.align(t,false,{x:S,y:aa,width:Ia.apply(Fa,ka)-S,height:Ia.apply(Fa,O)-aa});r.show()}else r&&r.hide();return k},destroy:function(){Ac(this);nc(Pb,this)}};x.prototype={destroy:function(){Ac(this)}, +setTotal:function(k){this.cum=this.total=k},render:function(k){var n=this.options.formatter.call(this);if(this.label)this.label.attr({text:n,visibility:ob});else this.label=l.renderer.text(n,0,0).css(this.options.style).attr({align:this.textAlign,rotation:this.options.rotation,visibility:ob}).add(k)},setOffset:function(k,n){var t=this.isNegative,r=I.translate(this.total),J=I.translate(0);J=bb(r-J);var E=l.xAxis[0].translate(this.x)+k,Q=l.plotHeight;t={x:va?t?r:r-J:E,y:va?Q-E-n:t?Q-r-J:Q-r,width:va? +J:n,height:va?n:J};this.label&&this.label.align(this.alignOptions,null,t).attr({visibility:Ab})}};G=function(k,n,t,r,J){var E=1,Q=0,fa=r?Hb:fb;r=r?Dc:ia;fa||(fa=fb);if(t){E*=-1;Q=ya}if(ec){E*=-1;Q-=E*ya}if(n){if(ec)k=ya-k;k=k/fa+r;if(ca&&J)k=Fa.pow(10,k)}else{if(ca&&J)k=mc(k);k=E*(k-r)*fa+Q}return k};ha=function(k,n,t){var r,J,E;k=G(k,null,null,t);var Q=t&&ad||cb,fa=t&&qd||$a,ka;t=J=W(k+cc);r=E=W(Q-k-cc);if(isNaN(k))ka=true;else if(R){r=ea;E=Q-vb;if(t<X||t>X+Da)ka=true}else{t=X;J=fa-Ib;if(r<ea||r> +ea+Aa)ka=true}return ka?null:ga.crispLine([Za,t,r,Ka,J,E],n||0)};if(va&&xa&&ec===Wa)ec=true;sa(I,{addPlotBand:za,addPlotLine:za,adjustTickAmount:function(){if(Ob&&!D&&!Ya&&!Ub){var k=qc,n=Ba.length;qc=Ob[qa];if(n<qc){for(;Ba.length<qc;)Ba.push(ta(Ba[Ba.length-1]+Ta));fb*=(n-1)/(qc-1);ra=Ba[Ba.length-1]}if(K(k)&&qc!==k)I.isDirty=true}},categories:Ya,getExtremes:function(){return{min:ia,max:ra,dataMin:pa,dataMax:wa,userMin:Vb,userMax:Gb}},getPlotLinePath:ha,getThreshold:function(k){if(ia>k)k=ia;else if(ra< +k)k=ra;return G(k,0,1)},isXAxis:xa,options:o,plotLinesAndBands:Pb,getOffset:function(){var k=zb.length&&K(ia)&&K(ra),n=0,t=0,r=o.title,J=o.labels,E=[-1,1,1,-1][L],Q;if(!na){na=ga.g("axis").attr({zIndex:7}).add();Ra=ga.g("grid").attr({zIndex:1}).add()}rc=0;if(k||Ub){u(Ba,function(fa){if(mb[fa])mb[fa].addLabel();else mb[fa]=new q(fa);if(L===0||L===2||{1:"left",3:"right"}[L]===J.align)rc=Ia(mb[fa].getLabelSize(),rc)});if($c)rc+=($c-1)*16}else for(Q in mb){mb[Q].destroy();delete mb[Q]}if(r&&r.text){if(!ba){ba= +I.axisTitle=ga.text(r.text,0,0,r.useHTML).attr({zIndex:7,rotation:r.rotation||0,align:r.textAlign||{low:"left",middle:"center",high:"right"}[r.align]}).css(r.style).add();ba.isNew=true}n=ba.getBBox()[R?"height":"width"];t=A(r.margin,R?5:10)}la=E*(o.offset||Xb[L]);nd=rc+(L!==2&&rc&&E*o.labels[R?"y":"x"])+t;Xb[L]=Ia(Xb[L],nd+n+E*la)},render:eb,setCategories:function(k,n){I.categories=p.categories=Ya=k;u(zb,function(t){t.translate();t.setTooltipPoints(true)});I.isDirty=true;A(n,true)&&l.redraw()},setExtremes:function(k, +n,t,r){t=A(t,true);Pa(I,"setExtremes",{min:k,max:n},function(){Vb=k;Gb=n;t&&l.redraw(r)})},setScale:Ma,setTickPositions:da,translate:G,redraw:function(){Yb.resetTracker&&Yb.resetTracker();eb();u(Pb,function(k){k.render()});u(zb,function(k){k.isDirty=true})},removePlotBand:ab,removePlotLine:ab,reversed:ec,stacks:s,destroy:function(){var k;pb(I);for(k in s){Ac(s[k]);s[k]=null}if(I.stackTotalGroup)I.stackTotalGroup=I.stackTotalGroup.destroy();u([mb,Wb,dc,Pb],function(n){Ac(n)});u([La,na,Ra,ba],function(n){n&& +n.destroy()});La=na=Ra=ba=null}});for(pd in B)Qa(I,pd,B[pd]);Ma()}function d(){var p={};return{add:function(q,w,x,V){if(!p[q]){w=ga.text(w,0,0).css(a.toolbar.itemStyle).align({align:"right",x:-Ib-20,y:ea+30}).on("click",V).attr({align:"right",zIndex:20}).add();p[q]=w}},remove:function(q){pc(p[q].element);p[q]=null}}}function e(p){function q(){var B=this.points||zc(this),D=B[0].series.xAxis,ca=this.x;D=D&&D.options.type==="datetime";var la=Sb(ca)||D,qa;qa=la?['<span style="font-size: 10px">'+(D?Zc("%A, %b %e, %Y", +ca):ca)+"</span>"]:[];u(B,function(ya){qa.push(ya.point.tooltipFormatter(la))});return qa.join("<br/>")}function w(B,D){L=xa?B:(2*L+B)/3;s=xa?D:(s+D)/2;o.translate(L,s);rd=bb(B-L)>1||bb(D-s)>1?function(){w(B,D)}:null}function x(){if(!xa){var B=l.hoverPoints;o.hide();u(da,function(D){D&&D.hide()});B&&u(B,function(D){D.setState()});l.hoverPoints=null;xa=true}}var V,N=p.borderWidth,ta=p.crosshairs,da=[],Ma=p.style,za=p.shared,eb=ja(Ma.padding),ab=N+eb,xa=true,Oa,R,L=0,s=0;Ma.padding=0;var o=ga.g("tooltip").attr({zIndex:8}).add(), +I=ga.rect(ab,ab,0,0,p.borderRadius,N).attr({fill:p.backgroundColor,"stroke-width":N}).add(o).shadow(p.shadow),ba=ga.text("",eb+ab,ja(Ma.fontSize)+eb+ab,p.useHTML).attr({zIndex:1}).css(Ma).add(o);o.hide();return{shared:za,refresh:function(B){var D,ca,la,qa=0,ya={},fb=[];la=B.tooltipPos;D=p.formatter||q;ya=l.hoverPoints;if(za){ya&&u(ya,function(Hb){Hb.setState()});l.hoverPoints=B;u(B,function(Hb){Hb.setState(Bb);qa+=Hb.plotY;fb.push(Hb.getLabelConfig())});ca=B[0].plotX;qa=W(qa)/B.length;ya={x:B[0].category}; +ya.points=fb;B=B[0]}else ya=B.getLabelConfig();ya=D.call(ya);V=B.series;ca=za?ca:B.plotX;qa=za?qa:B.plotY;D=W(la?la[0]:va?Da-qa:ca);ca=W(la?la[1]:va?Aa-ca:qa);la=za||!B.series.isCartesian||gc(D,ca);if(ya===false||!la)x();else{if(xa){o.show();xa=false}ba.attr({text:ya});la=ba.getBBox();Oa=la.width+2*eb;R=la.height+2*eb;I.attr({width:Oa,height:R,stroke:p.borderColor||B.color||V.color||"#606060"});D=fe(Oa,R,X,ea,Da,Aa,{x:D,y:ca});w(W(D.x-ab),W(D.y-ab))}if(ta){ta=zc(ta);for(D=ta.length;D--;){ca=B.series[D? +"yAxis":"xAxis"];if(ta[D]&&ca){ca=ca.getPlotLinePath(B[D?"y":"x"],1);if(da[D])da[D].attr({d:ca,visibility:Ab});else{la={"stroke-width":ta[D].width||1,stroke:ta[D].color||"#C0C0C0",zIndex:2};if(ta[D].dashStyle)la.dashstyle=ta[D].dashStyle;da[D]=ga.path(ca).attr(la).add()}}}}},hide:x,destroy:function(){u(da,function(B){B&&B.destroy()});u([I,ba,o],function(B){B&&B.destroy()});I=ba=o=null}}}function f(p){function q(L){var s,o=Ud&&ua.width/ua.body.scrollWidth-1,I,ba,B;L=L||db.event;if(!L.target)L.target= +L.srcElement;s=L.touches?L.touches.item(0):L;if(L.type!=="mousemove"||db.opera||o){Jb=Fd(oa);I=Jb.left;ba=Jb.top}if(Pc){B=L.x;s=L.y}else if(s.layerX===Wa){B=s.pageX-I;s=s.pageY-ba}else{B=L.layerX;s=L.layerY}if(o){B+=W((o+1)*I-I);s+=W((o+1)*ba-ba)}return sa(L,{chartX:B,chartY:s})}function w(L){var s={xAxis:[],yAxis:[]};u(Va,function(o){var I=o.translate,ba=o.isXAxis;s[ba?"xAxis":"yAxis"].push({axis:o,value:I((va?!ba:ba)?L.chartX-X:Aa-L.chartY+ea,true)})});return s}function x(){var L=l.hoverSeries, +s=l.hoverPoint;s&&s.onMouseOut();L&&L.onMouseOut();hc&&hc.hide();sd=null}function V(){if(za){var L={xAxis:[],yAxis:[]},s=za.getBBox(),o=s.x-X,I=s.y-ea;if(Ma){u(Va,function(ba){var B=ba.translate,D=ba.isXAxis,ca=va?!D:D,la=B(ca?o:Aa-I-s.height,true,0,0,1);B=B(ca?o+s.width:Aa-I,true,0,0,1);L[D?"xAxis":"yAxis"].push({axis:ba,min:tb(la,B),max:Ia(la,B)})});Pa(l,"selection",L,td)}za=za.destroy()}l.mouseIsDown=ud=Ma=false;pb(ua,Kb?"touchend":"mouseup",V)}function N(L){var s=K(L.pageX)?L.pageX:L.page.x;L= +K(L.pageX)?L.pageY:L.page.y;Jb&&!gc(s-Jb.left-X,L-Jb.top-ea)&&x()}var ta,da,Ma,za,eb=z.zoomType,ab=/x/.test(eb),xa=/y/.test(eb),Oa=ab&&!va||xa&&va,R=xa&&!va||ab&&va;bd=function(){if(Ec){Ec.translate(X,ea);va&&Ec.attr({width:l.plotWidth,height:l.plotHeight}).invert()}else l.trackerGroup=Ec=ga.g("tracker").attr({zIndex:9}).add()};bd();if(p.enabled)l.tooltip=hc=e(p);(function(){oa.onmousedown=function(s){s=q(s);!Kb&&s.preventDefault&&s.preventDefault();l.mouseIsDown=ud=true;ta=s.chartX;da=s.chartY;Qa(ua, +Kb?"touchend":"mouseup",V)};var L=function(s){if(!(s&&s.touches&&s.touches.length>1)){s=q(s);if(!Kb)s.returnValue=false;var o=s.chartX,I=s.chartY,ba=!gc(o-X,I-ea);Jb||(Jb=Fd(oa));if(Kb&&s.type==="touchstart")if(Ga(s.target,"isTracker"))l.runTrackerClick||s.preventDefault();else!ke&&!ba&&s.preventDefault();if(ba){if(o<X)o=X;else if(o>X+Da)o=X+Da;if(I<ea)I=ea;else if(I>ea+Aa)I=ea+Aa}if(ud&&s.type!=="touchstart"){Ma=Math.sqrt(Math.pow(ta-o,2)+Math.pow(da-I,2));if(Ma>10){if(sc&&(ab||xa)&&gc(ta-X,da-ea))za|| +(za=ga.rect(X,ea,Oa?1:Da,R?1:Aa,0).attr({fill:z.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add());if(za&&Oa){o=o-ta;za.attr({width:bb(o),x:(o>0?0:o)+ta})}if(za&&R){I=I-da;za.attr({height:bb(I),y:(I>0?0:I)+da})}}}else if(!ba){var B;I=l.hoverPoint;o=l.hoverSeries;var D,ca,la=$a,qa=va?s.chartY:s.chartX-X;if(hc&&p.shared){B=[];D=Ha.length;for(ca=0;ca<D;ca++)if(Ha[ca].visible&&Ha[ca].tooltipPoints.length){s=Ha[ca].tooltipPoints[qa];s._dist=bb(qa-s.plotX);la=tb(la,s._dist);B.push(s)}for(D= +B.length;D--;)B[D]._dist>la&&B.splice(D,1);if(B.length&&B[0].plotX!==sd){hc.refresh(B);sd=B[0].plotX}}if(o&&o.tracker)(s=o.tooltipPoints[qa])&&s!==I&&s.onMouseOver()}return ba||!sc}};oa.onmousemove=L;Qa(oa,"mouseleave",x);Qa(ua,"mousemove",N);oa.ontouchstart=function(s){if(ab||xa)oa.onmousedown(s);L(s)};oa.ontouchmove=L;oa.ontouchend=function(){Ma&&x()};oa.onclick=function(s){var o=l.hoverPoint;s=q(s);s.cancelBubble=true;if(!Ma)if(o&&Ga(s.target,"isTracker")){var I=o.plotX,ba=o.plotY;sa(o,{pageX:Jb.left+ +X+(va?Da-ba:I),pageY:Jb.top+ea+(va?Aa-I:ba)});Pa(o.series,"click",sa(s,{point:o}));o.firePointEvent("click",s)}else{sa(s,w(s));gc(s.chartX-X,s.chartY-ea)&&Pa(l,"click",s)}Ma=false}})();Vd=setInterval(function(){rd&&rd()},32);sa(this,{zoomX:ab,zoomY:xa,resetTracker:x,destroy:function(){if(l.trackerGroup)l.trackerGroup=Ec=l.trackerGroup.destroy();pb(ua,"mousemove",N);oa.onclick=oa.onmousedown=oa.onmousemove=oa.ontouchstart=oa.ontouchend=oa.ontouchmove=null}})}function g(p){var q=p.type||z.type||z.defaultSeriesType, +w=wb[q],x=l.hasRendered;if(x)if(va&&q==="column")w=wb.bar;else if(!va&&q==="bar")w=wb.column;q=new w;q.init(l,p);if(!x&&q.inverted)va=true;if(q.isCartesian)sc=q.isCartesian;Ha.push(q);return q}function h(){z.alignTicks!==false&&u(Va,function(p){p.adjustTickAmount()});Ob=null}function i(p){var q=l.isDirtyLegend,w,x=l.isDirtyBox,V=Ha.length,N=V,ta=l.clipRect;for(oc(p,l);N--;){p=Ha[N];if(p.isDirty&&p.options.stacking){w=true;break}}if(w)for(N=V;N--;){p=Ha[N];if(p.options.stacking)p.isDirty=true}u(Ha, +function(da){if(da.isDirty){da.cleanData();da.getSegments();if(da.options.legendType==="point")q=true}});if(q&&Fc.renderLegend){Fc.renderLegend();l.isDirtyLegend=false}if(sc){if(!cd){Ob=null;u(Va,function(da){da.setScale()})}h();Gc();u(Va,function(da){if(da.isDirty||x){da.redraw();x=true}})}if(x){vd();bd();if(ta){Hc(ta);ta.animate({width:l.plotSizeX,height:l.plotSizeY})}}u(Ha,function(da){if(da.isDirty&&da.visible&&(!da.isCartesian||da.xAxis))da.redraw()});Yb&&Yb.resetTracker&&Yb.resetTracker();Pa(l, +"redraw")}function j(){var p=a.xAxis||{},q=a.yAxis||{},w;p=zc(p);u(p,function(x,V){x.index=V;x.isX=true});q=zc(q);u(q,function(x,V){x.index=V});Va=p.concat(q);l.xAxis=[];l.yAxis=[];Va=tc(Va,function(x){w=new c(x);l[w.isXAxis?"xAxis":"yAxis"].push(w);return w});h()}function m(p,q){uc=Ca(a.title,p);Ic=Ca(a.subtitle,q);u([["title",p,uc],["subtitle",q,Ic]],function(w){var x=w[0],V=l[x],N=w[1];w=w[2];if(V&&N)V=V.destroy();if(w&&w.text&&!V)l[x]=ga.text(w.text,0,0,w.useHTML).attr({align:w.align,"class":"highcharts-"+ +x,zIndex:1}).css(w.style).add().align(w,false,Rb)})}function v(){qb=z.renderTo;Wd=vc+wd++;if(Sb(qb))qb=ua.getElementById(qb);qb.innerHTML="";if(!qb.offsetWidth){Zb=qb.cloneNode(0);Ja(Zb,{position:ic,top:"-9999px",display:""});ua.body.appendChild(Zb)}dd=(Zb||qb).offsetWidth;Jc=(Zb||qb).offsetHeight;l.chartWidth=$a=z.width||dd||600;l.chartHeight=cb=z.height||(Jc>19?Jc:400);l.container=oa=hb(Tb,{className:"highcharts-container"+(z.className?" "+z.className:""),id:Wd},sa({position:Xd,overflow:ob,width:$a+ +Ua,height:cb+Ua,textAlign:"left"},z.style),Zb||qb);l.renderer=ga=z.forExport?new ed(oa,$a,cb,true):new fd(oa,$a,cb);var p,q;if(Yd&&oa.getBoundingClientRect){p=function(){Ja(oa,{left:0,top:0});q=oa.getBoundingClientRect();Ja(oa,{left:-(q.left-ja(q.left))+Ua,top:-(q.top-ja(q.top))+Ua})};p();Qa(db,"resize",p);Qa(l,"destroy",function(){pb(db,"resize",p)})}}function P(){function p(){var w=z.width||qb.offsetWidth,x=z.height||qb.offsetHeight;if(w&&x){if(w!==dd||x!==Jc){clearTimeout(q);q=setTimeout(function(){xd(w, +x,false)},100)}dd=w;Jc=x}}var q;Qa(db,"resize",p);Qa(l,"destroy",function(){pb(db,"resize",p)})}function T(){Pa(l,"endResize",null,function(){cd-=1})}function Y(){var p=a.labels,q=a.credits,w;m();Fc=l.legend=new le;Gc();u(Va,function(x){x.setTickPositions(true)});h();Gc();vd();sc&&u(Va,function(x){x.render()});if(!l.seriesGroup)l.seriesGroup=ga.g("series-group").attr({zIndex:3}).add();u(Ha,function(x){x.translate();x.setTooltipPoints();x.render()});p.items&&u(p.items,function(){var x=sa(p.style,this.style), +V=ja(x.left)+X,N=ja(x.top)+ea+12;delete x.left;delete x.top;ga.text(this.html,V,N).attr({zIndex:2}).css(x).add()});if(!l.toolbar)l.toolbar=d();if(q.enabled&&!l.credits){w=q.href;l.credits=ga.text(q.text,0,0).on("click",function(){if(w)location.href=w}).attr({align:q.position.align,zIndex:8}).css(q.style).add().align(q.position)}bd();l.hasRendered=true;if(Zb){qb.appendChild(oa);pc(Zb)}}function H(){var p,q=oa&&oa.parentNode;if(l!==null){Pa(l,"destroy");pb(db,"unload",H);pb(l);for(p=Va.length;p--;)Va[p]= +Va[p].destroy();for(p=Ha.length;p--;)Ha[p]=Ha[p].destroy();u(["title","subtitle","seriesGroup","clipRect","credits","tracker"],function(w){var x=l[w];if(x)l[w]=x.destroy()});u([wc,xc,Kc,Fc,hc,ga,Yb],function(w){w&&w.destroy&&w.destroy()});wc=xc=Kc=Fc=hc=ga=Yb=null;if(oa){oa.innerHTML="";pb(oa);q&&pc(oa);oa=null}clearInterval(Vd);for(p in l)delete l[p];l=null}}function U(){if(!Lc&&db==db.top&&ua.readyState!=="complete")ua.attachEvent("onreadystatechange",function(){ua.detachEvent("onreadystatechange", +U);ua.readyState==="complete"&&U()});else{v();yd();zd();u(a.series||[],function(p){g(p)});l.inverted=va=A(va,a.chart.inverted);j();l.render=Y;l.tracker=Yb=new f(a.tooltip);Y();Pa(l,"load");b&&b.apply(l,[l]);u(l.callbacks,function(p){p.apply(l,[l])})}}Yc=Ca(Yc,Xa.xAxis);od=Ca(od,Xa.yAxis);Xa.xAxis=Xa.yAxis=null;a=Ca(Xa,a);var z=a.chart,M=z.margin;M=Nb(M)?M:[M,M,M,M];var y=A(z.marginTop,M[0]),C=A(z.marginRight,M[1]),Z=A(z.marginBottom,M[2]),Sa=A(z.marginLeft,M[3]),Na=z.spacingTop,Ea=z.spacingRight, +gb=z.spacingBottom,Lb=z.spacingLeft,Rb,uc,Ic,ea,Ib,vb,X,Xb,qb,Zb,oa,Wd,dd,Jc,$a,cb,qd,ad,wc,Kc,Ad,xc,l=this,ke=(M=z.events)&&!!M.click,Bd,gc,hc,ud,jc,Zd,Cd,Aa,Da,Yb,Ec,bd,Fc,$b,ac,Jb,sc=z.showAxes,cd=0,Va=[],Ob,Ha=[],va,ga,rd,Vd,sd,vd,Gc,yd,zd,xd,td,$d,le=function(){function p(G,ha){var na=G.legendItem,Ra=G.legendLine,La=G.legendSymbol,pa=Oa.color,wa=ha?N.itemStyle.color:pa,zb=ha?G.color:pa;pa=ha?G.pointAttr[ib]:{stroke:pa,fill:pa};na&&na.css({fill:wa});Ra&&Ra.attr({stroke:zb});La&&La.attr(pa)}function q(G, +ha,na){var Ra=G.legendItem,La=G.legendLine,pa=G.legendSymbol;G=G.checkbox;Ra&&Ra.attr({x:ha,y:na});La&&La.translate(ha,na-4);pa&&pa.attr({x:ha+pa.xOff,y:na+pa.yOff});if(G){G.x=ha;G.y=na}}function w(){u(za,function(G){var ha=G.checkbox,na=qa.alignAttr;ha&&Ja(ha,{left:na.translateX+G.legendItemWidth+ha.x-40+Ua,top:na.translateY+ha.y-11+Ua})})}function x(G){var ha,na,Ra,La,pa=G.legendItem;La=G.series||G;var wa=La.options,zb=wa&&wa.borderWidth||0;if(!pa){La=/^(bar|pie|area|column)$/.test(La.type);G.legendItem= +pa=ga.text(N.labelFormatter.call(G),0,0).css(G.visible?ab:Oa).on("mouseover",function(){G.setState(Bb);pa.css(xa)}).on("mouseout",function(){pa.css(G.visible?ab:Oa);G.setState()}).on("click",function(){var Gb=function(){G.setVisible()};G.firePointEvent?G.firePointEvent("legendItemClick",null,Gb):Pa(G,"legendItemClick",null,Gb)}).attr({zIndex:2}).add(qa);if(!La&&wa&&wa.lineWidth){var Vb={"stroke-width":wa.lineWidth,zIndex:2};if(wa.dashStyle)Vb.dashstyle=wa.dashStyle;G.legendLine=ga.path([Za,-da-Ma, +0,Ka,-Ma,0]).attr(Vb).add(qa)}if(La)ha=ga.rect(na=-da-Ma,Ra=-11,da,12,2).attr({zIndex:3}).add(qa);else if(wa&&wa.marker&&wa.marker.enabled)ha=ga.symbol(G.symbol,na=-da/2-Ma,Ra=-4,wa.marker.radius).attr({zIndex:3}).add(qa);if(ha){ha.xOff=na+zb%2/2;ha.yOff=Ra+zb%2/2}G.legendSymbol=ha;p(G,G.visible);if(wa&&wa.showCheckbox){G.checkbox=hb("input",{type:"checkbox",checked:G.selected,defaultChecked:G.selected},N.itemCheckboxStyle,oa);Qa(G.checkbox,"click",function(Gb){Pa(G,"checkboxClick",{checked:Gb.target.checked}, +function(){G.select()})})}}ha=pa.getBBox();na=G.legendItemWidth=N.itemWidth||da+Ma+ha.width+R;B=ha.height;if(ta&&o-s+na>(fb||$a-2*R-s)){o=s;I+=B}ba=I;q(G,o,I);if(ta)o+=na;else I+=B;ya=fb||Ia(ta?o-s:na,ya)}function V(){o=s;I=L;ba=ya=0;qa||(qa=ga.g("legend").attr({zIndex:7}).add());za=[];u(Hb,function(Ra){var La=Ra.options;if(La.showInLegend)za=za.concat(La.legendType==="point"?Ra.data:Ra)});Hd(za,function(Ra,La){return(Ra.options.legendIndex||0)-(La.options.legendIndex||0)});cc&&za.reverse();u(za, +x);$b=fb||ya;ac=ba-L+B;if(ca||la){$b+=2*R;ac+=2*R;if(D){if($b>0&&ac>0){D[D.isNew?"attr":"animate"](D.crisp(null,null,null,$b,ac));D.isNew=false}}else{D=ga.rect(0,0,$b,ac,N.borderRadius,ca||0).attr({stroke:N.borderColor,"stroke-width":ca||0,fill:la||jb}).add(qa).shadow(N.shadow);D.isNew=true}D[za.length?"show":"hide"]()}for(var G=["left","right","top","bottom"],ha,na=4;na--;){ha=G[na];if(eb[ha]&&eb[ha]!=="auto"){N[na<2?"align":"verticalAlign"]=ha;N[na<2?"x":"y"]=ja(eb[ha])*(na%2?-1:1)}}za.length&& +qa.align(sa(N,{width:$b,height:ac}),true,Rb);cd||w()}var N=l.options.legend;if(N.enabled){var ta=N.layout==="horizontal",da=N.symbolWidth,Ma=N.symbolPadding,za,eb=N.style,ab=N.itemStyle,xa=N.itemHoverStyle,Oa=N.itemHiddenStyle,R=ja(eb.padding),L=18,s=4+R+da+Ma,o,I,ba,B=0,D,ca=N.borderWidth,la=N.backgroundColor,qa,ya,fb=N.width,Hb=l.series,cc=N.reversed;V();Qa(l,"endResize",w);return{colorizeItem:p,destroyItem:function(G){var ha=G.checkbox;u(["legendItem","legendLine","legendSymbol"],function(na){G[na]&& +G[na].destroy()});ha&&pc(G.checkbox)},renderLegend:V,destroy:function(){if(D)D=D.destroy();if(qa)qa=qa.destroy()}}}};gc=function(p,q){return p>=0&&p<=Da&&q>=0&&q<=Aa};$d=function(){Pa(l,"selection",{resetSelection:true},td);l.toolbar.remove("zoom")};td=function(p){var q=Xa.lang,w=l.pointCount<100;l.toolbar.add("zoom",q.resetZoom,q.resetZoomTitle,$d);!p||p.resetSelection?u(Va,function(x){x.setExtremes(null,null,false,w)}):u(p.xAxis.concat(p.yAxis),function(x){var V=x.axis;if(l.tracker[V.isXAxis?"zoomX": +"zoomY"])V.setExtremes(x.min,x.max,false,w)});i()};Gc=function(){var p=a.legend,q=A(p.margin,10),w=p.x,x=p.y,V=p.align,N=p.verticalAlign,ta;yd();if((l.title||l.subtitle)&&!K(y))if(ta=Ia(l.title&&!uc.floating&&!uc.verticalAlign&&uc.y||0,l.subtitle&&!Ic.floating&&!Ic.verticalAlign&&Ic.y||0))ea=Ia(ea,ta+A(uc.margin,15)+Na);if(p.enabled&&!p.floating)if(V==="right")K(C)||(Ib=Ia(Ib,$b-w+q+Ea));else if(V==="left")K(Sa)||(X=Ia(X,$b+w+q+Lb));else if(N==="top")K(y)||(ea=Ia(ea,ac+x+q+Na));else if(N==="bottom")K(Z)|| +(vb=Ia(vb,ac-x+q+gb));sc&&u(Va,function(da){da.getOffset()});K(Sa)||(X+=Xb[3]);K(y)||(ea+=Xb[0]);K(Z)||(vb+=Xb[2]);K(C)||(Ib+=Xb[1]);zd()};xd=function(p,q,w){var x=l.title,V=l.subtitle;cd+=1;oc(w,l);ad=cb;qd=$a;l.chartWidth=$a=W(p);l.chartHeight=cb=W(q);Ja(oa,{width:$a+Ua,height:cb+Ua});ga.setSize($a,cb,w);Da=$a-X-Ib;Aa=cb-ea-vb;Ob=null;u(Va,function(N){N.isDirty=true;N.setScale()});u(Ha,function(N){N.isDirty=true});l.isDirtyLegend=true;l.isDirtyBox=true;Gc();x&&x.align(null,null,Rb);V&&V.align(null, +null,Rb);i(w);ad=null;Pa(l,"resize");Bc===false?T():setTimeout(T,Bc&&Bc.duration||500)};zd=function(){l.plotLeft=X=W(X);l.plotTop=ea=W(ea);l.plotWidth=Da=W($a-X-Ib);l.plotHeight=Aa=W(cb-ea-vb);l.plotSizeX=va?Aa:Da;l.plotSizeY=va?Da:Aa;Rb={x:Lb,y:Na,width:$a-Lb-Ea,height:cb-Na-gb}};yd=function(){ea=A(y,Na);Ib=A(C,Ea);vb=A(Z,gb);X=A(Sa,Lb);Xb=[0,0,0,0]};vd=function(){var p=z.borderWidth||0,q=z.backgroundColor,w=z.plotBackgroundColor,x=z.plotBackgroundImage,V,N={x:X,y:ea,width:Da,height:Aa};V=p+(z.shadow? +8:0);if(p||q)if(wc)wc.animate(wc.crisp(null,null,null,$a-V,cb-V));else wc=ga.rect(V/2,V/2,$a-V,cb-V,z.borderRadius,p).attr({stroke:z.borderColor,"stroke-width":p,fill:q||jb}).add().shadow(z.shadow);if(w)if(Kc)Kc.animate(N);else Kc=ga.rect(X,ea,Da,Aa,0).attr({fill:w}).add().shadow(z.plotShadow);if(x)if(Ad)Ad.animate(N);else Ad=ga.image(x,X,ea,Da,Aa).add();if(z.plotBorderWidth)if(xc)xc.animate(xc.crisp(null,X,ea,Da,Aa));else xc=ga.rect(X,ea,Da,Aa,0,z.plotBorderWidth).attr({stroke:z.plotBorderColor, +"stroke-width":z.plotBorderWidth,zIndex:4}).add();l.isDirtyBox=false};Qa(db,"unload",H);z.reflow!==false&&Qa(l,"load",P);if(M)for(Bd in M)Qa(l,Bd,M[Bd]);l.options=a;l.series=Ha;l.addSeries=function(p,q,w){var x;if(p){oc(w,l);q=A(q,true);Pa(l,"addSeries",{options:p},function(){x=g(p);x.isDirty=true;l.isDirtyLegend=true;q&&l.redraw()})}return x};l.animation=A(z.animation,true);l.destroy=H;l.get=function(p){var q,w,x;for(q=0;q<Va.length;q++)if(Va[q].options.id===p)return Va[q];for(q=0;q<Ha.length;q++)if(Ha[q].options.id=== +p)return Ha[q];for(q=0;q<Ha.length;q++){x=Ha[q].data;for(w=0;w<x.length;w++)if(x[w].id===p)return x[w]}return null};l.getSelectedPoints=function(){var p=[];u(Ha,function(q){p=p.concat(Dd(q.data,function(w){return w.selected}))});return p};l.getSelectedSeries=function(){return Dd(Ha,function(p){return p.selected})};l.hideLoading=function(){gd(jc,{opacity:0},{duration:a.loading.hideDuration,complete:function(){Ja(jc,{display:jb})}});Cd=false};l.isInsidePlot=gc;l.redraw=i;l.setSize=xd;l.setTitle=m;l.showLoading= +function(p){var q=a.loading;if(!jc){jc=hb(Tb,{className:"highcharts-loading"},sa(q.style,{left:X+Ua,top:ea+Ua,width:Da+Ua,height:Aa+Ua,zIndex:10,display:jb}),oa);Zd=hb("span",null,q.labelStyle,jc)}Zd.innerHTML=p||a.lang.loading;if(!Cd){Ja(jc,{opacity:0,display:""});gd(jc,{opacity:q.style.opacity},{duration:q.showDuration});Cd=true}};l.pointCount=0;l.counters=new Gd;U()}var ua=document,db=window,Fa=Math,W=Fa.round,lb=Fa.floor,md=Fa.ceil,Ia=Fa.max,tb=Fa.min,bb=Fa.abs,rb=Fa.cos,Cb=Fa.sin,kc=Fa.PI,ae= +kc*2/360,yc=navigator.userAgent,Pc=/msie/i.test(yc)&&!db.opera,Mc=ua.documentMode===8,Ud=/AppleWebKit/.test(yc),Yd=/Firefox/.test(yc),Lc=!!ua.createElementNS&&!!ua.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,me=Yd&&parseInt(yc.split("Firefox/")[1],10)<4,fd,Kb=ua.documentElement.ontouchstart!==undefined,be={},wd=0,ub=1,Tc,Xa,Zc,Bc,Nc,Wa,Tb="div",ic="absolute",Xd="relative",ob="hidden",vc="highcharts-",Ab="visible",Ua="px",jb="none",Za="M",Ka="L",ce="rgba(192,192,192,"+(Lc?1.0E-6: +0.0020)+")",ib="",Bb="hover",Qc,id,jd,kd,Cc,Rc,Sc,Jd,Kd,ld,Ld,Md,ma=db.HighchartsAdapter,Db=ma||{},u=Db.each,Dd=Db.grep,tc=Db.map,Ca=Db.merge,Qa=Db.addEvent,pb=Db.removeEvent,Pa=Db.fireEvent,gd=Db.animate,Hc=Db.stop,wb={};Zc=function(a,b,c){function d(P){return P.toString().replace(/^([0-9])$/,"0$1")}if(!K(b)||isNaN(b))return"Invalid date";a=A(a,"%Y-%m-%d %H:%M:%S");b=new Date(b*ub);var e,f=b[jd](),g=b[kd](),h=b[Cc](),i=b[Rc](),j=b[Sc](),m=Xa.lang,v=m.weekdays;b={a:v[g].substr(0,3),A:v[g],d:d(h), +e:h,b:m.shortMonths[i],B:m.months[i],m:d(i+1),y:j.toString().substr(2,2),Y:j,H:d(f),I:d(f%12||12),l:f%12||12,M:d(b[id]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:d(b.getSeconds())};for(e in b)a=a.replace("%"+e,b[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};Gd.prototype={wrapColor:function(a){if(this.color>=a)this.color=0},wrapSymbol:function(a){if(this.symbol>=a)this.symbol=0}};Nc={init:function(a,b,c){b=b||"";var d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g;b=b.split(" ");c=[].concat(c);var h, +i,j=function(m){for(g=m.length;g--;)m[g]===Za&&m.splice(g+1,0,m[g+1],m[g+2],m[g+1],m[g+2])};if(e){j(b);j(c)}if(a.isArea){h=b.splice(b.length-6,6);i=c.splice(c.length-6,6)}if(d){c=[].concat(c).splice(0,f).concat(c);a.shift=false}if(b.length)for(a=c.length;b.length<a;){d=[].concat(b).splice(b.length-f,f);if(e){d[f-6]=d[f-2];d[f-5]=d[f-1]}b=b.concat(d)}if(h){b=b.concat(h);c=c.concat(i)}return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;){d=parseFloat(a[f]); +e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d}else e=b;return e}};ma&&ma.init&&ma.init(Nc);if(!ma&&db.jQuery){var Mb=jQuery;u=function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],a[c],c,a)===false)return c};Dd=Mb.grep;tc=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=b.call(a[d],a[d],d,a);return c};Ca=function(){var a=arguments;return Mb.extend(true,null,a[0],a[1],a[2],a[3])};Qa=function(a,b,c){Mb(a).bind(b,c)};pb=function(a,b,c){var d=ua.removeEventListener?"removeEventListener":"detachEvent"; +if(ua[d]&&!a[d])a[d]=function(){};Mb(a).unbind(b,c)};Pa=function(a,b,c,d){var e=Mb.Event(b),f="detached"+b;sa(e,c);if(a[b]){a[f]=a[b];a[b]=null}Mb(a).trigger(e);if(a[f]){a[b]=a[f];a[f]=null}d&&!e.isDefaultPrevented()&&d(e)};gd=function(a,b,c){var d=Mb(a);if(b.d){a.toD=b.d;b.d=1}d.stop();d.animate(b,c)};Hc=function(a){Mb(a).stop()};Mb.extend(Mb.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});var de=jQuery.fx,ee=de.step;u(["cur","_default","width","height"],function(a,b){var c=b? +ee:de.prototype,d=c[a],e;if(d)c[a]=function(f){f=b?f:this;e=f.elem;return e.attr?e.attr(f.prop,f.now):d.apply(this,arguments)}});ee.d=function(a){var b=a.elem;if(!a.started){var c=Nc.init(b,b.d,b.toD);a.start=c[0];a.end=c[1];a.started=true}b.attr("d",Nc.step(a.start,a.end,a.pos,b.toD))}}ma={enabled:true,align:"center",x:0,y:15,style:{color:"#666",fontSize:"11px",lineHeight:"14px"}};Xa={colors:["#4572A7","#AA4643","#89A54E","#80699B","#3D96AE","#DB843D","#92A8CD","#A47D7C","#B5CA92"],symbols:["circle", +"diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","June","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalPoint:".",resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:true},chart:{borderColor:"#4572A7", +borderRadius:5,defaultSeriesType:"line",ignoreHiddenSeries:true,spacingTop:10,spacingRight:10,spacingBottom:15,spacingLeft:10,style:{fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',fontSize:"12px"},backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0"},title:{text:"Chart title",align:"center",y:15,style:{color:"#3E576F",fontSize:"16px"}},subtitle:{text:"",align:"center",y:30,style:{color:"#6D869F"}},plotOptions:{line:{allowPointSelect:false,showCheckbox:false, +animation:{duration:1E3},events:{},lineWidth:2,shadow:true,marker:{enabled:true,lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:Ca(ma,{enabled:false,y:-6,formatter:function(){return this.y}}),showInLegend:true,states:{hover:{marker:{}},select:{marker:{}}},stickyTracking:true}},labels:{style:{position:ic,color:"#3E576F"}},legend:{enabled:true,align:"center",layout:"horizontal",labelFormatter:function(){return this.name}, +borderWidth:1,borderColor:"#909090",borderRadius:5,shadow:false,style:{padding:"5px"},itemStyle:{cursor:"pointer",color:"#3E576F"},itemHoverStyle:{cursor:"pointer",color:"#000000"},itemHiddenStyle:{color:"#C0C0C0"},itemCheckboxStyle:{position:ic,width:"13px",height:"13px"},symbolWidth:16,symbolPadding:5,verticalAlign:"bottom",x:0,y:0},loading:{hideDuration:100,labelStyle:{fontWeight:"bold",position:Xd,top:"1em"},showDuration:100,style:{position:ic,backgroundColor:"white",opacity:0.5,textAlign:"center"}}, +tooltip:{enabled:true,backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:2,borderRadius:5,shadow:true,snap:Kb?25:10,style:{color:"#333333",fontSize:"12px",padding:"5px",whiteSpace:"nowrap"}},toolbar:{itemStyle:{color:"#4572A7",cursor:"pointer"}},credits:{enabled:true,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"10px"}}};var Yc={dateTimeLabelFormats:{second:"%H:%M:%S",minute:"%H:%M", +hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:false,gridLineColor:"#C0C0C0",labels:ma,lineColor:"#C0D0E0",lineWidth:1,max:null,min:null,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:false,tickColor:"#C0D0E0",tickLength:5,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#6D869F", +fontWeight:"bold"}},type:"linear"},od=Ca(Yc,{endOnTick:true,gridLineWidth:1,tickPixelInterval:72,showLastLabel:true,labels:{align:"right",x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:true,tickWidth:0,title:{rotation:270,text:"Y-values"},stackLabels:{enabled:false,formatter:function(){return this.total},style:ma.style}}),ie={labels:{align:"right",x:-8,y:null},title:{rotation:270}},he={labels:{align:"left",x:8,y:null},title:{rotation:90}},Td={labels:{align:"center",x:0,y:14},title:{rotation:0}}, +ge=Ca(Td,{labels:{y:-5}}),xb=Xa.plotOptions;ma=xb.line;xb.spline=Ca(ma);xb.scatter=Ca(ma,{lineWidth:0,states:{hover:{lineWidth:0}}});xb.area=Ca(ma,{});xb.areaspline=Ca(xb.area);xb.column=Ca(ma,{borderColor:"#FFFFFF",borderWidth:1,borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,states:{hover:{brightness:0.1,shadow:false},select:{color:"#C0C0C0",borderColor:"#000000",shadow:false}},dataLabels:{y:null,verticalAlign:null}});xb.bar=Ca(xb.column,{dataLabels:{align:"left",x:5, +y:0}});xb.pie=Ca(ma,{borderColor:"#FFFFFF",borderWidth:1,center:["50%","50%"],colorByPoint:true,dataLabels:{distance:30,enabled:true,formatter:function(){return this.point.name},y:5},legendType:"point",marker:null,size:"75%",showInLegend:false,slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});Id();var bc=function(a){var b=[],c;(function(d){if(c=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/.exec(d))b=[ja(c[1]),ja(c[2]),ja(c[3]),parseFloat(c[4], +10)];else if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))b=[ja(c[1],16),ja(c[2],16),ja(c[3],16),1]})(a);return{get:function(d){return b&&!isNaN(b[0])?d==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":d==="a"?b[3]:"rgba("+b.join(",")+")":a},brighten:function(d){if(lc(d)&&d!==0){var e;for(e=0;e<3;e++){b[e]+=ja(d*255);if(b[e]<0)b[e]=0;if(b[e]>255)b[e]=255}}return this},setOpacity:function(d){b[3]=d;return this}}};Uc.prototype={init:function(a,b){this.element=ua.createElementNS("http://www.w3.org/2000/svg", +b);this.renderer=a},animate:function(a,b,c){if(b=A(b,Bc,true)){b=Ca(b);if(c)b.complete=c;gd(this,a,b)}else{this.attr(a);c&&c()}},attr:function(a,b){var c,d,e,f,g=this.element,h=g.nodeName,i=this.renderer,j,m=this.shadows,v=this.htmlNode,P,T=this;if(Sb(a)&&K(b)){c=a;a={};a[c]=b}if(Sb(a)){c=a;if(h==="circle")c={x:"cx",y:"cy"}[c]||c;else if(c==="strokeWidth")c="stroke-width";T=Ga(g,c)||this[c]||0;if(c!=="d"&&c!=="visibility")T=parseFloat(T)}else for(c in a){j=false;d=a[c];if(c==="d"){if(d&&d.join)d= +d.join(" ");if(/(NaN| {2}|^$)/.test(d))d="M 0 0";this.d=d}else if(c==="x"&&h==="text"){for(e=0;e<g.childNodes.length;e++){f=g.childNodes[e];Ga(f,"x")===Ga(g,"x")&&Ga(f,"x",d)}if(this.rotation)Ga(g,"transform","rotate("+this.rotation+" "+d+" "+ja(a.y||Ga(g,"y"))+")")}else if(c==="fill")d=i.color(d,g,c);else if(h==="circle"&&(c==="x"||c==="y"))c={x:"cx",y:"cy"}[c]||c;else if(c==="translateX"||c==="translateY"||c==="rotation"||c==="verticalAlign"){this[c]=d;this.updateTransform();j=true}else if(c=== +"stroke")d=i.color(d,g,c);else if(c==="dashstyle"){c="stroke-dasharray";d=d&&d.toLowerCase();if(d==="solid")d=jb;else if(d){d=d.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(e=d.length;e--;)d[e]=ja(d[e])*a["stroke-width"];d=d.join(",")}}else if(c==="isTracker")this[c]=d;else if(c==="width")d=ja(d);else if(c=== +"align"){c="text-anchor";d={left:"start",center:"middle",right:"end"}[d]}else if(c==="title"){e=ua.createElementNS("http://www.w3.org/2000/svg","title");e.appendChild(ua.createTextNode(d));g.appendChild(e)}if(c==="strokeWidth")c="stroke-width";if(Ud&&c==="stroke-width"&&d===0)d=1.0E-6;if(this.symbolName&&/^(x|y|r|start|end|innerR)/.test(c)){if(!P){this.symbolAttr(a);P=true}j=true}if(m&&/^(width|height|visibility|x|y|d)$/.test(c))for(e=m.length;e--;)Ga(m[e],c,d);if((c==="width"||c==="height")&&h=== +"rect"&&d<0)d=0;if(c==="text"){this.textStr=d;this.added&&i.buildText(this)}else j||Ga(g,c,d);if(v&&(c==="x"||c==="y"||c==="translateX"||c==="translateY"||c==="visibility")){e=v.length?v:[this];f=e.length;var Y;for(Y=0;Y<f;Y++){v=e[Y];j=v.getBBox();v=v.htmlNode;Ja(v,sa(this.styles,{left:j.x+(this.translateX||0)+Ua,top:j.y+(this.translateY||0)+Ua}));c==="visibility"&&Ja(v,{visibility:d})}}}return T},symbolAttr:function(a){var b=this;u(["x","y","r","start","end","width","height","innerR"],function(c){b[c]= +A(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](W(b.x*2)/2,W(b.y*2)/2,b.r,{start:b.start,end:b.end,width:b.width,height:b.height,innerR:b.innerR})})},clip:function(a){return this.attr("clip-path","url("+this.renderer.url+"#"+a.id+")")},crisp:function(a,b,c,d,e){var f,g={},h={},i;a=a||this.strokeWidth||0;i=a%2/2;h.x=lb(b||this.x||0)+i;h.y=lb(c||this.y||0)+i;h.width=lb((d||this.width||0)-2*i);h.height=lb((e||this.height||0)-2*i);h.strokeWidth=a;for(f in h)if(this[f]!==h[f])this[f]=g[f]=h[f]; +return g},css:function(a){var b=this.element;b=a&&a.width&&b.nodeName==="text";var c,d="",e=function(f,g){return"-"+g.toLowerCase()};if(a&&a.color)a.fill=a.color;this.styles=a=sa(this.styles,a);if(Pc&&!Lc){b&&delete a.width;Ja(this.element,a)}else{for(c in a)d+=c.replace(/([A-Z])/g,e)+":"+a[c]+";";this.attr({style:d})}b&&this.added&&this.renderer.buildText(this);return this},on:function(a,b){var c=b;if(Kb&&a==="click"){a="touchstart";c=function(d){d.preventDefault();b()}}this.element["on"+a]=c;return this}, +translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=true;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.inverted,d=this.rotation,e=[];if(c){a+=this.attr("width");b+=this.attr("height")}if(a||b)e.push("translate("+a+","+b+")");if(c)e.push("rotate(90) scale(-1,1)");else d&&e.push("rotate("+d+" "+this.x+" "+this.y+")");e.length&&Ga(this.element,"transform",e.join(" "))},toFront:function(){var a= +this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){if(a){this.alignOptions=a;this.alignByTranslate=b;c||this.renderer.alignedObjects.push(this)}else{a=this.alignOptions;b=this.alignByTranslate}c=A(c,this.renderer);var d=a.align,e=a.verticalAlign,f=(c.x||0)+(a.x||0),g=(c.y||0)+(a.y||0),h={};if(/^(right|center)$/.test(d))f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=W(f);if(/^(bottom|middle)$/.test(e))g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]|| +1);h[b?"translateY":"y"]=W(g);this[this.placed?"animate":"attr"](h);this.placed=true;this.alignAttr=h;return this},getBBox:function(){var a,b,c,d=this.rotation,e=d*ae;try{a=sa({},this.element.getBBox())}catch(f){a={width:0,height:0}}b=a.width;c=a.height;if(d){a.width=bb(c*Cb(e))+bb(b*rb(e));a.height=bb(c*rb(e))+bb(b*Cb(e))}return a},show:function(){return this.attr({visibility:Ab})},hide:function(){return this.attr({visibility:ob})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e= +d.childNodes,f=this.element,g=Ga(f,"zIndex");this.parentInverted=a&&a.inverted;this.textStr!==undefined&&b.buildText(this);if(a&&this.htmlNode){if(!a.htmlNode)a.htmlNode=[];a.htmlNode.push(this)}if(g){c.handleZ=true;g=ja(g)}if(c.handleZ)for(c=0;c<e.length;c++){a=e[c];b=Ga(a,"zIndex");if(a!==f&&(ja(b)>g||!K(g)&&K(b))){d.insertBefore(f,a);return this}}d.appendChild(f);this.added=true;return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element|| +{},c=a.shadows,d,e;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=null;Hc(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(e=0;e<a.stops.length;e++)a.stops[e]=a.stops[e].destroy();a.stops=null}a.safeRemoveChild(b);c&&u(c,function(f){a.safeRemoveChild(f)});nc(a.renderer.alignedObjects,a);for(d in a)delete a[d];return null},empty:function(){for(var a=this.element,b=a.childNodes,c=b.length;c--;)a.removeChild(b[c])},shadow:function(a,b){var c=[],d,e,f=this.element,g=this.parentInverted? +"(-1,-1)":"(1,1)";if(a){for(d=1;d<=3;d++){e=f.cloneNode(0);Ga(e,{isShadow:"true",stroke:"rgb(0, 0, 0)","stroke-opacity":0.05*d,"stroke-width":7-2*d,transform:"translate"+g,fill:jb});b?b.element.appendChild(e):f.parentNode.insertBefore(e,f);c.push(e)}this.shadows=c}return this}};var ed=function(){this.init.apply(this,arguments)};ed.prototype={Element:Uc,init:function(a,b,c,d){var e=location,f;f=this.createElement("svg").attr({xmlns:"http://www.w3.org/2000/svg",version:"1.1"});a.appendChild(f.element); +this.box=f.element;this.boxWrapper=f;this.alignedObjects=[];this.url=Pc?"":e.href.replace(/#.*?$/,"");this.defs=this.createElement("defs").add();this.forExport=d;this.gradients=[];this.setSize(b,c,false)},destroy:function(){var a,b=this.gradients,c=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();if(b){for(a=0;a<b.length;a++)this.gradients[a]=b[a].destroy();this.gradients=null}if(c)this.defs=c.destroy();return this.alignedObjects=null},createElement:function(a){var b=new this.Element; +b.init(this,a);return b},buildText:function(a){for(var b=a.element,c=A(a.textStr,"").toString().replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g),d=b.childNodes,e=/style="([^"]+)"/,f=/href="([^"]+)"/,g=Ga(b,"x"),h=a.styles,i=h&&a.useHTML&&!this.forExport,j=a.htmlNode,m=h&&ja(h.width),v=h&&h.lineHeight,P,T=d.length;T--;)b.removeChild(d[T]);m&&!a.added&& +this.box.appendChild(b);u(c,function(Y,H){var U,z=0,M;Y=Y.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");U=Y.split("|||");u(U,function(y){if(y!==""||U.length===1){var C={},Z=ua.createElementNS("http://www.w3.org/2000/svg","tspan");e.test(y)&&Ga(Z,"style",y.match(e)[1].replace(/(;| |^)color([ :])/,"$1fill$2"));if(f.test(y)){Ga(Z,"onclick",'location.href="'+y.match(f)[1]+'"');Ja(Z,{cursor:"pointer"})}y=(y.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">");Z.appendChild(ua.createTextNode(y)); +if(z)C.dx=3;else C.x=g;if(!z){if(H){!Lc&&a.renderer.forExport&&Ja(Z,{display:"block"});M=db.getComputedStyle&&ja(db.getComputedStyle(P,null).getPropertyValue("line-height"));if(!M||isNaN(M))M=v||P.offsetHeight||18;Ga(Z,"dy",M)}P=Z}Ga(Z,C);b.appendChild(Z);z++;if(m){y=y.replace(/-/g,"- ").split(" ");for(var Sa,Na=[];y.length||Na.length;){Sa=b.getBBox().width;C=Sa>m;if(!C||y.length===1){y=Na;Na=[];if(y.length){Z=ua.createElementNS("http://www.w3.org/2000/svg","tspan");Ga(Z,{dy:v||16,x:g});b.appendChild(Z); +if(Sa>m)m=Sa}}else{Z.removeChild(Z.firstChild);Na.unshift(y.pop())}y.length&&Z.appendChild(ua.createTextNode(y.join(" ").replace(/- /g,"-")))}}}})});if(i){if(!j)j=a.htmlNode=hb("span",null,sa(h,{position:ic,top:0,left:0}),this.box.parentNode);j.innerHTML=a.textStr;for(T=d.length;T--;)d[T].style.visibility=ob}},crispLine:function(a,b){if(a[1]===a[4])a[1]=a[4]=W(a[1])+b%2/2;if(a[2]===a[5])a[2]=a[5]=W(a[2])+b%2/2;return a},path:function(a){return this.createElement("path").attr({d:a,fill:jb})},circle:function(a, +b,c){a=Nb(a)?a:{x:a,y:b,r:c};return this.createElement("circle").attr(a)},arc:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.r;d=a.innerR;e=a.start;f=a.end;a=a.x}return this.symbol("arc",a||0,b||0,c||0,{innerR:d||0,start:e||0,end:f||0})},rect:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;a=a.x}e=this.createElement("rect").attr({rx:e,ry:e,fill:jb});return e.attr(e.crisp(f,a,b,Ia(c,0),Ia(d,0)))},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a; +this.height=b;for(this.boxWrapper[A(c,true)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return K(a)?b.attr({"class":vc+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:jb};arguments.length>1&&sa(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e){var f, +g=this.symbols[a];g=g&&g(W(b),W(c),d,e);var h=/^url\((.*?)\)$/,i;if(g){f=this.path(g);sa(f,{symbolName:a,x:b,y:c,r:d});e&&sa(f,e)}else if(h.test(a)){var j=function(m,v){m.attr({width:v[0],height:v[1]}).translate(-W(v[0]/2),-W(v[1]/2))};i=a.match(h)[1];a=be[i];f=this.image(i).attr({x:b,y:c});if(a)j(f,a);else{f.attr({width:0,height:0});hb("img",{onload:function(){j(f,be[i]=[this.width,this.height])},src:i})}}else f=this.circle(b,c,d);return f},symbols:{square:function(a,b,c){c=0.707*c;return[Za,a-c, +b-c,Ka,a+c,b-c,a+c,b+c,a-c,b+c,"Z"]},triangle:function(a,b,c){return[Za,a,b-1.33*c,Ka,a+c,b+0.67*c,a-c,b+0.67*c,"Z"]},"triangle-down":function(a,b,c){return[Za,a,b+1.33*c,Ka,a-c,b-0.67*c,a+c,b-0.67*c,"Z"]},diamond:function(a,b,c){return[Za,a,b-c,Ka,a+c,b,a,b+c,a-c,b,"Z"]},arc:function(a,b,c,d){var e=d.start,f=d.end-1.0E-6,g=d.innerR,h=rb(e),i=Cb(e),j=rb(f);f=Cb(f);d=d.end-e<kc?0:1;return[Za,a+c*h,b+c*i,"A",c,c,0,d,1,a+c*j,b+c*f,Ka,a+g*j,b+g*f,"A",g,g,0,d,0,a+g*h,b+g*i,"Z"]}},clipRect:function(a,b, +c,d){var e=vc+wd++,f=this.createElement("clipPath").attr({id:e}).add(this.defs);a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f=this;b=a.linearGradient;c=vc+wd++;var g,h,i;g=f.createElement("linearGradient").attr({id:c,gradientUnits:"userSpaceOnUse",x1:b[0],y1:b[1],x2:b[2],y2:b[3]}).add(f.defs);f.gradients.push(g);g.stops=[];u(a.stops,function(j){if(e.test(j[1])){d=bc(j[1]);h=d.get("rgb");i=d.get("a")}else{h=j[1];i=1}j= +f.createElement("stop").attr({offset:j[0],"stop-color":h,"stop-opacity":i}).add(g);g.stops.push(j)});return"url("+this.url+"#"+c+")"}else if(e.test(a)){d=bc(a);Ga(b,c+"-opacity",d.get("a"));return d.get("rgb")}else{b.removeAttribute(c+"-opacity");return a}},text:function(a,b,c,d){var e=Xa.chart.style;b=W(A(b,0));c=W(A(c,0));a=this.createElement("text").attr({x:b,y:c,text:a}).css({fontFamily:e.fontFamily,fontSize:e.fontSize});a.x=b;a.y=c;a.useHTML=d;return a}};fd=ed;if(!Lc){Db=yb(Uc,{init:function(a, +b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ",ic,";"];if(b==="shape"||b===Tb)d.push("left:0;top:0;width:10px;height:10px;");if(Mc)d.push("visibility: ",b===Tb?ob:Ab);c.push(' style="',d.join(""),'"/>');if(b){c=b===Tb||b==="span"||b==="img"?c.join(""):a.prepVML(c);this.element=hb(c)}this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box;d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);Mc&&d.gVis===ob&&Ja(c,{visibility:ob});d.appendChild(c);this.added=true;this.alignOnAdd&& +this.updateTransform();return this},attr:function(a,b){var c,d,e,f=this.element||{},g=f.style,h=f.nodeName,i=this.renderer,j=this.symbolName,m,v,P=this.shadows,T=this;if(Sb(a)&&K(b)){c=a;a={};a[c]=b}if(Sb(a)){c=a;T=c==="strokeWidth"||c==="stroke-width"?this.strokeweight:this[c]}else for(c in a){d=a[c];m=false;if(j&&/^(x|y|r|start|end|width|height|innerR)/.test(c)){if(!v){this.symbolAttr(a);v=true}m=true}else if(c==="d"){d=d||[];this.d=d.join(" ");e=d.length;for(m=[];e--;)m[e]=lc(d[e])?W(d[e]*10)- +5:d[e]==="Z"?"x":d[e];d=m.join(" ")||"x";f.path=d;if(P)for(e=P.length;e--;)P[e].path=d;m=true}else if(c==="zIndex"||c==="visibility"){if(Mc&&c==="visibility"&&h==="DIV"){f.gVis=d;m=f.childNodes;for(e=m.length;e--;)Ja(m[e],{visibility:d});if(d===Ab)d=null}if(d)g[c]=d;m=true}else if(/^(width|height)$/.test(c)){this[c]=d;if(this.updateClipping){this[c]=d;this.updateClipping()}else g[c]=d;m=true}else if(/^(x|y)$/.test(c)){this[c]=d;if(f.tagName==="SPAN")this.updateTransform();else g[{x:"left",y:"top"}[c]]= +d}else if(c==="class")f.className=d;else if(c==="stroke"){d=i.color(d,f,c);c="strokecolor"}else if(c==="stroke-width"||c==="strokeWidth"){f.stroked=d?true:false;c="strokeweight";this[c]=d;if(lc(d))d+=Ua}else if(c==="dashstyle"){(f.getElementsByTagName("stroke")[0]||hb(i.prepVML(["<stroke/>"]),null,null,f))[c]=d||"solid";this.dashstyle=d;m=true}else if(c==="fill")if(h==="SPAN")g.color=d;else{f.filled=d!==jb?true:false;d=i.color(d,f,c);c="fillcolor"}else if(c==="translateX"||c==="translateY"||c==="rotation"|| +c==="align"){if(c==="align")c="textAlign";this[c]=d;this.updateTransform();m=true}else if(c==="text"){this.bBox=null;f.innerHTML=d;m=true}if(P&&c==="visibility")for(e=P.length;e--;)P[e].style[c]=d;if(!m)if(Mc)f[c]=d;else Ga(f,c,d)}return T},clip:function(a){var b=this,c=a.members;c.push(b);b.destroyClip=function(){nc(c,b)};return b.css(a.getCSS(b.inverted))},css:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width){delete a.width;this.textWidth=b;this.updateTransform()}this.styles=sa(this.styles, +a);Ja(this.element,a);return this},safeRemoveChild:function(a){a.parentNode&&pc(a)},destroy:function(){this.destroyClip&&this.destroyClip();return Uc.prototype.destroy.apply(this)},empty:function(){for(var a=this.element.childNodes,b=a.length,c;b--;){c=a[b];c.parentNode.removeChild(c)}},getBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position=ic;b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},on:function(a,b){this.element["on"+ +a]=function(){var c=db.event;c.target=c.srcElement;b(c)};return this},updateTransform:function(){if(this.added){var a=this,b=a.element,c=a.translateX||0,d=a.translateY||0,e=a.x||0,f=a.y||0,g=a.textAlign||"left",h={left:0,center:0.5,right:1}[g],i=g&&g!=="left";if(c||d)a.css({marginLeft:c,marginTop:d});a.inverted&&u(b.childNodes,function(z){a.renderer.invertChild(z,b)});if(b.tagName==="SPAN"){var j,m;c=a.rotation;var v;j=0;d=1;var P=0,T;v=ja(a.textWidth);var Y=a.xCorr||0,H=a.yCorr||0,U=[c,g,b.innerHTML, +a.textWidth].join(",");if(U!==a.cTT){if(K(c)){j=c*ae;d=rb(j);P=Cb(j);Ja(b,{filter:c?["progid:DXImageTransform.Microsoft.Matrix(M11=",d,", M12=",-P,", M21=",P,", M22=",d,", sizingMethod='auto expand')"].join(""):jb})}j=b.offsetWidth;m=b.offsetHeight;if(j>v){Ja(b,{width:v+Ua,display:"block",whiteSpace:"normal"});j=v}v=W((ja(b.style.fontSize)||12)*1.2);Y=d<0&&-j;H=P<0&&-m;T=d*P<0;Y+=P*v*(T?1-h:h);H-=d*v*(c?T?h:1-h:1);if(i){Y-=j*h*(d<0?-1:1);if(c)H-=m*h*(P<0?-1:1);Ja(b,{textAlign:g})}a.xCorr=Y;a.yCorr= +H}Ja(b,{left:e+Y,top:f+H});a.cTT=U}}else this.alignOnAdd=true},shadow:function(a,b){var c=[],d,e=this.element,f=this.renderer,g,h=e.style,i,j=e.path;if(j&&typeof j.value!=="string")j="x";if(a){for(d=1;d<=3;d++){i=['<shape isShadow="true" strokeweight="',7-2*d,'" filled="false" path="',j,'" coordsize="100,100" style="',e.style.cssText,'" />'];g=hb(f.prepVML(i),null,{left:ja(h.left)+1,top:ja(h.top)+1});i=['<stroke color="black" opacity="',0.05*d,'"/>'];hb(f.prepVML(i),null,null,g);b?b.element.appendChild(g): +e.parentNode.insertBefore(g,e);c.push(g)}this.shadows=c}return this}});ma=function(){this.init.apply(this,arguments)};ma.prototype=Ca(ed.prototype,{Element:Db,isIE8:yc.indexOf("MSIE 8.0")>-1,init:function(a,b,c){var d;this.alignedObjects=[];d=this.createElement(Tb);a.appendChild(d.element);this.box=d.element;this.boxWrapper=d;this.setSize(b,c,false);if(!ua.namespaces.hcv){ua.namespaces.add("hcv","urn:schemas-microsoft-com:vml");ua.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}, +clipRect:function(a,b,c,d){var e=this.createElement();return sa(e,{members:[],left:a,top:b,width:c,height:d,getCSS:function(f){var g=this.top,h=this.left,i=h+this.width,j=g+this.height;g={clip:"rect("+W(f?h:g)+"px,"+W(f?j:i)+"px,"+W(f?i:j)+"px,"+W(f?g:h)+"px)"};!f&&Mc&&sa(g,{width:i+Ua,height:j+Ua});return g},updateClipping:function(){u(e.members,function(f){f.css(e.getCSS(f.inverted))})}})},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f,g,h=a.linearGradient,i,j,m,v;u(a.stops, +function(P,T){if(e.test(P[1])){d=bc(P[1]);f=d.get("rgb");g=d.get("a")}else{f=P[1];g=1}if(T){m=f;v=g}else{i=f;j=g}});a=90-Fa.atan((h[3]-h[1])/(h[2]-h[0]))*180/kc;a=["<",c,' colors="0% ',i,",100% ",m,'" angle="',a,'" opacity="',v,'" o:opacity2="',j,'" type="gradient" focus="100%" />'];hb(this.prepVML(a),null,null,b)}else if(e.test(a)&&b.tagName!=="IMG"){d=bc(a);a=["<",c,' opacity="',d.get("a"),'"/>'];hb(this.prepVML(a),null,null,b);return d.get("rgb")}else{b=b.getElementsByTagName(c);if(b.length)b[0].opacity= +1;return a}},prepVML:function(a){var b=this.isIE8;a=a.join("");if(b){a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />');a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')}else a=a.replace("<","<hcv:");return a},text:function(a,b,c){var d=Xa.chart.style;return this.createElement("span").attr({text:a,x:W(b),y:W(c)}).css({whiteSpace:"nowrap",fontFamily:d.fontFamily, +fontSize:d.fontSize})},path:function(a){return this.createElement("shape").attr({coordsize:"100 100",d:a})},circle:function(a,b,c){return this.symbol("circle").attr({x:a,y:b,r:c})},g:function(a){var b;if(a)b={className:vc+a,"class":vc+a};return this.createElement(Tb).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.css({left:b,top:c,width:d,height:e});return f},rect:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth; +a=a.x}var g=this.symbol("rect");g.r=e;return g.attr(g.crisp(f,a,b,Ia(c,0),Ia(d,0)))},invertChild:function(a,b){var c=b.style;Ja(a,{flip:"x",left:ja(c.width)-10,top:ja(c.height)-10,rotation:-90})},symbols:{arc:function(a,b,c,d){var e=d.start,f=d.end,g=rb(e),h=Cb(e),i=rb(f),j=Cb(f);d=d.innerR;var m=0.07/c,v=d&&0.1/d||0;if(f-e===0)return["x"];else if(2*kc-f+e<m)i=-m;else if(f-e<v)i=rb(e+v);return["wa",a-c,b-c,a+c,b+c,a+c*g,b+c*h,a+c*i,b+c*j,"at",a-d,b-d,a+d,b+d,a+d*i,b+d*j,a+d*g,b+d*h,"x","e"]},circle:function(a, +b,c){return["wa",a-c,b-c,a+c,b+c,a+c,b,a+c,b,"e"]},rect:function(a,b,c,d){if(!K(d))return[];var e=d.width;d=d.height;var f=a+e,g=b+d;c=tb(c,e,d);return[Za,a+c,b,Ka,f-c,b,"wa",f-2*c,b,f,b+2*c,f-c,b,f,b+c,Ka,f,g-c,"wa",f-2*c,g-2*c,f,g,f,g-c,f-c,g,Ka,a+c,g,"wa",a,g-2*c,a+2*c,g,a+c,g,a,g-c,Ka,a,b+c,"wa",a,b,a+2*c,b+2*c,a,b+c,a+c,b,"x","e"]}}});fd=ma}Nd.prototype.callbacks=[];var Oc=function(){};Oc.prototype={init:function(a,b){var c=a.chart.counters,d;this.series=a;this.applyOptions(b);this.pointAttr= +{};if(a.options.colorByPoint){d=a.chart.options.colors;if(!this.options)this.options={};this.color=this.options.color=this.color||d[c.color++];c.wrapColor(d.length)}a.chart.pointCount++;return this},applyOptions:function(a){var b=this.series;this.config=a;if(lc(a)||a===null)this.y=a;else if(Nb(a)&&!lc(a.length)){sa(this,a);this.options=a}else if(Sb(a[0])){this.name=a[0];this.y=a[1]}else if(lc(a[0])){this.x=a[0];this.y=a[1]}if(this.x===Wa)this.x=b.autoIncrement()},destroy:function(){var a=this,b=a.series, +c=b.chart.hoverPoints,d;b.chart.pointCount--;if(c){a.setState();nc(c,a)}a===b.chart.hoverPoint&&a.onMouseOut();pb(a);u(["graphic","tracker","group","dataLabel","connector","shadowGroup"],function(e){a[e]&&a[e].destroy()});a.legendItem&&a.series.chart.legend.destroyItem(a);for(d in a)a[d]=null},getLabelConfig:function(){return{x:this.category,y:this.y,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},select:function(a,b){var c=this,d=c.series.chart;a=A(a, +!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=a;c.setState(a&&"select");b||u(d.getSelectedPoints(),function(e){if(e.selected&&e!==c){e.selected=false;e.setState(ib);e.firePointEvent("unselect")}})})},onMouseOver:function(){var a=this.series.chart,b=a.tooltip,c=a.hoverPoint;c&&c!==this&&c.onMouseOut();this.firePointEvent("mouseOver");b&&!b.shared&&b.refresh(this);this.setState(Bb);a.hoverPoint=this},onMouseOut:function(){this.firePointEvent("mouseOut");this.setState(); +this.series.chart.hoverPoint=null},tooltipFormatter:function(a){var b=this.series;return['<span style="color:'+b.color+'">',this.name||b.name,"</span>: ",!a?"<b>x = "+(this.name||this.x)+",</b> ":"","<b>",!a?"y = ":"",this.y,"</b>"].join("")},update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g=e.chart;b=A(b,true);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(Nb(a)){e.getAttribs();f&&f.attr(d.pointAttr[e.state])}e.isDirty=true;b&&g.redraw(c)})},remove:function(a,b){var c= +this,d=c.series,e=d.chart,f=d.data;oc(b,e);a=A(a,true);c.firePointEvent("remove",null,function(){nc(f,c);c.destroy();d.isDirty=true;a&&e.redraw()})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;if(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])this.importEvents();if(a==="click"&&e.allowPointSelect)c=function(f){d.select(null,f.ctrlKey||f.metaKey||f.shiftKey)};Pa(this,a,b,c)},importEvents:function(){if(!this.hasImportedEvents){var a=Ca(this.series.options.point, +this.options).events,b;this.events=a;for(b in a)Qa(this,b,a[b]);this.hasImportedEvents=true}},setState:function(a){var b=this.series,c=b.options.states,d=xb[b.type].marker&&b.options.marker,e=d&&!d.enabled,f=(d=d&&d.states[a])&&d.enabled===false,g=b.stateMarkerGraphic,h=b.chart,i=this.pointAttr;a=a||ib;if(!(a===this.state||this.selected&&a!=="select"||c[a]&&c[a].enabled===false||a&&(f||e&&!d.enabled))){if(this.graphic)this.graphic.attr(i[a]);else{if(a){if(!g)b.stateMarkerGraphic=g=h.renderer.circle(0, +0,i[a].r).attr(i[a]).add(b.group);g.translate(this.plotX,this.plotY)}if(g)g[a?"show":"hide"]()}this.state=a}}};var sb=function(){};sb.prototype={isCartesian:true,type:"line",pointClass:Oc,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},init:function(a,b){var c,d;d=a.series.length;this.chart=a;b=this.setOptions(b);sa(this,{index:d,options:b,name:b.name||"Series "+(d+1),state:ib,pointAttr:{},visible:b.visible!==false,selected:b.selected===true});d=b.events; +for(c in d)Qa(this,c,d[c]);if(d&&d.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=true;this.getColor();this.getSymbol();this.setData(b.data,false)},autoIncrement:function(){var a=this.options,b=this.xIncrement;b=A(b,a.pointStart,0);this.pointInterval=A(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},cleanData:function(){var a=this.chart,b=this.data,c,d,e=a.smallestInterval,f,g;Hd(b,function(h,i){return h.x-i.x});if(this.options.connectNulls)for(g= +b.length-1;g>=0;g--)b[g].y===null&&b[g-1]&&b[g+1]&&b.splice(g,1);for(g=b.length-1;g>=0;g--)if(b[g-1]){f=b[g].x-b[g-1].x;if(f>0&&(d===Wa||f<d)){d=f;c=g}}if(e===Wa||d<e)a.smallestInterval=d;this.closestPoints=c},getSegments:function(){var a=-1,b=[],c=this.data;u(c,function(d,e){if(d.y===null){e>a+1&&b.push(c.slice(a+1,e));a=e}else e===c.length-1&&b.push(c.slice(a+1,e+1))});this.segments=b},setOptions:function(a){var b=this.chart.options.plotOptions;return Ca(b[this.type],b.series,a)},getColor:function(){var a= +this.chart.options.colors,b=this.chart.counters;this.color=this.options.color||a[b.color++]||"#0000ff";b.wrapColor(a.length)},getSymbol:function(){var a=this.chart.options.symbols,b=this.chart.counters;this.symbol=this.options.marker.symbol||a[b.symbol++];b.wrapSymbol(a.length)},addPoint:function(a,b,c,d){var e=this.data,f=this.graph,g=this.area,h=this.chart;a=(new this.pointClass).init(this,a);oc(d,h);if(f&&c)f.shift=c;if(g){g.shift=c;g.isArea=true}b=A(b,true);e.push(a);c&&e[0].remove(false);this.getAttribs(); +this.isDirty=true;b&&h.redraw()},setData:function(a,b){var c=this,d=c.data,e=c.initialColor,f=c.chart,g=d&&d.length||0;c.xIncrement=null;if(K(e))f.counters.color=e;for(a=tc(zc(a||[]),function(h){return(new c.pointClass).init(c,h)});g--;)d[g].destroy();c.data=a;c.cleanData();c.getSegments();c.getAttribs();c.isDirty=true;f.isDirtyBox=true;A(b,true)&&f.redraw(false)},remove:function(a,b){var c=this,d=c.chart;a=A(a,true);if(!c.isRemoving){c.isRemoving=true;Pa(c,"remove",null,function(){c.destroy();d.isDirtyLegend= +d.isDirtyBox=true;a&&d.redraw(b)})}c.isRemoving=false},translate:function(){for(var a=this.chart,b=this.options.stacking,c=this.xAxis.categories,d=this.yAxis,e=this.data,f=e.length;f--;){var g=e[f],h=g.x,i=g.y,j=g.low,m=d.stacks[(i<0?"-":"")+this.stackKey];g.plotX=this.xAxis.translate(h);if(b&&this.visible&&m&&m[h]){j=m[h];h=j.total;j.cum=j=j.cum-i;i=j+i;if(b==="percent"){j=h?j*100/h:0;i=h?i*100/h:0}g.percentage=h?g.y*100/h:0;g.stackTotal=h}if(K(j))g.yBottom=d.translate(j,0,1,0,1);if(i!==null)g.plotY= +d.translate(i,0,1,0,1);g.clientX=a.inverted?a.plotHeight-g.plotX:g.plotX;g.category=c&&c[g.x]!==Wa?c[g.x]:g.x}},setTooltipPoints:function(a){var b=this.chart,c=b.inverted,d=[],e=W((c?b.plotTop:b.plotLeft)+b.plotSizeX),f,g,h=[];if(a)this.tooltipPoints=null;u(this.segments,function(i){d=d.concat(i)});if(this.xAxis&&this.xAxis.reversed)d=d.reverse();u(d,function(i,j){f=d[j-1]?d[j-1]._high+1:0;for(g=i._high=d[j+1]?lb((i.plotX+(d[j+1]?d[j+1].plotX:e))/2):e;f<=g;)h[c?e-f++:f++]=i});this.tooltipPoints=h}, +onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(!(!Kb&&a.mouseIsDown)){b&&b!==this&&b.onMouseOut();this.options.events.mouseOver&&Pa(this,"mouseOver");this.tracker&&this.tracker.toFront();this.setState(Bb);a.hoverSeries=this}},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut();this&&a.events.mouseOut&&Pa(this,"mouseOut");c&&!a.stickyTracking&&c.hide();this.setState();b.hoverSeries=null},animate:function(a){var b=this.chart,c=this.clipRect, +d=this.options.animation;if(d&&!Nb(d))d={};if(a){if(!c.isAnimating){c.attr("width",0);c.isAnimating=true}}else{c.animate({width:b.plotSizeX},d);this.animate=null}},drawPoints:function(){var a,b=this.data,c=this.chart,d,e,f,g,h,i;if(this.options.marker.enabled)for(f=b.length;f--;){g=b[f];d=g.plotX;e=g.plotY;i=g.graphic;if(e!==Wa&&!isNaN(e)){a=g.pointAttr[g.selected?"select":ib];h=a.r;if(i)i.animate({x:d,y:e,r:h});else g.graphic=c.renderer.symbol(A(g.marker&&g.marker.symbol,this.symbol),d,e,h).attr(a).add(this.group)}}}, +convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={};a=a||{};b=b||{};c=c||{};d=d||{};for(f in e){g=e[f];h[f]=A(a[g],b[f],c[f],d[f])}return h},getAttribs:function(){var a=this,b=xb[a.type].marker?a.options.marker:a.options,c=b.states,d=c[Bb],e,f=a.color,g={stroke:f,fill:f},h=a.data,i=[],j,m=a.pointAttrToOptions,v;if(a.options.marker){d.radius=d.radius||b.radius+2;d.lineWidth=d.lineWidth||b.lineWidth+1}else d.color=d.color||bc(d.color||f).brighten(d.brightness).get();i[ib]=a.convertAttribs(b, +g);u([Bb,"select"],function(P){i[P]=a.convertAttribs(c[P],i[ib])});a.pointAttr=i;for(f=h.length;f--;){g=h[f];if((b=g.options&&g.options.marker||g.options)&&b.enabled===false)b.radius=0;e=false;if(g.options)for(v in m)if(K(b[m[v]]))e=true;if(e){j=[];c=b.states||{};e=c[Bb]=c[Bb]||{};if(!a.options.marker)e.color=bc(e.color||g.options.color).brighten(e.brightness||d.brightness).get();j[ib]=a.convertAttribs(b,i[ib]);j[Bb]=a.convertAttribs(c[Bb],i[Bb],j[ib]);j.select=a.convertAttribs(c.select,i.select, +j[ib])}else j=i;g.pointAttr=j}},destroy:function(){var a=this,b=a.chart,c=a.clipRect,d=/\/5[0-9\.]+ (Safari|Mobile)\//.test(yc),e,f;Pa(a,"destroy");pb(a);a.legendItem&&a.chart.legend.destroyItem(a);u(a.data,function(g){g.destroy()});if(c&&c!==b.clipRect)a.clipRect=c.destroy();u(["area","graph","dataLabelsGroup","group","tracker"],function(g){if(a[g]){e=d&&g==="group"?"hide":"destroy";a[g][e]()}});if(b.hoverSeries===a)b.hoverSeries=null;nc(b.series,a);for(f in a)delete a[f]},drawDataLabels:function(){if(this.options.dataLabels.enabled){var a, +b,c=this.data,d=this.options,e=d.dataLabels,f,g=this.dataLabelsGroup,h=this.chart,i=h.renderer,j=h.inverted,m=this.type,v;v=d.stacking;var P=m==="column"||m==="bar",T=e.verticalAlign===null,Y=e.y===null;if(P)if(v){if(T)e=Ca(e,{verticalAlign:"middle"});if(Y)e=Ca(e,{y:{top:14,middle:4,bottom:-6}[e.verticalAlign]})}else if(T)e=Ca(e,{verticalAlign:"top"});if(g)g.translate(h.plotLeft,h.plotTop);else g=this.dataLabelsGroup=i.g("data-labels").attr({visibility:this.visible?Ab:ob,zIndex:6}).translate(h.plotLeft, +h.plotTop).add();v=e.color;if(v==="auto")v=null;e.style.color=A(v,this.color,"black");u(c,function(H){var U=H.barX,z=U&&U+H.barW/2||H.plotX||-999,M=A(H.plotY,-999),y=H.dataLabel,C=e.align,Z=Y?H.y>=0?-6:12:e.y;f=e.formatter.call(H.getLabelConfig());a=(j?h.plotWidth-M:z)+e.x;b=(j?h.plotHeight-z:M)+Z;if(m==="column")a+={left:-1,right:1}[C]*H.barW/2||0;if(j&&H.y<0){C="right";a-=10}if(y){if(j&&!e.y)b=b+ja(y.styles.lineHeight)*0.9-y.getBBox().height/2;y.attr({text:f}).animate({x:a,y:b})}else if(K(f)){y= +H.dataLabel=i.text(f,a,b).attr({align:C,rotation:e.rotation,zIndex:1}).css(e.style).add(g);j&&!e.y&&y.attr({y:b+ja(y.styles.lineHeight)*0.9-y.getBBox().height/2})}if(P&&d.stacking&&y){z=H.barY;M=H.barW;H=H.barH;y.align(e,null,{x:j?h.plotWidth-z-H:U,y:j?h.plotHeight-U-M:z,width:j?H:M,height:j?M:H})}})}},drawGraph:function(){var a=this,b=a.options,c=a.graph,d=[],e,f=a.area,g=a.group,h=b.lineColor||a.color,i=b.lineWidth,j=b.dashStyle,m,v=a.chart.renderer,P=a.yAxis.getThreshold(b.threshold||0),T=/^area/.test(a.type), +Y=[],H=[];u(a.segments,function(U){m=[];u(U,function(C,Z){if(a.getPointSpline)m.push.apply(m,a.getPointSpline(U,C,Z));else{m.push(Z?Ka:Za);Z&&b.step&&m.push(C.plotX,U[Z-1].plotY);m.push(C.plotX,C.plotY)}});if(U.length>1)d=d.concat(m);else Y.push(U[0]);if(T){var z=[],M,y=m.length;for(M=0;M<y;M++)z.push(m[M]);y===3&&z.push(Ka,m[1],m[2]);if(b.stacking&&a.type!=="areaspline")for(M=U.length-1;M>=0;M--)z.push(U[M].plotX,U[M].yBottom);else z.push(Ka,U[U.length-1].plotX,P,Ka,U[0].plotX,P);H=H.concat(z)}}); +a.graphPath=d;a.singlePoints=Y;if(T){e=A(b.fillColor,bc(a.color).setOpacity(b.fillOpacity||0.75).get());if(f)f.animate({d:H});else a.area=a.chart.renderer.path(H).attr({fill:e}).add(g)}if(c){Hc(c);c.animate({d:d})}else if(i){c={stroke:h,"stroke-width":i};if(j)c.dashstyle=j;a.graph=v.path(d).attr(c).add(g).shadow(b.shadow)}},render:function(){var a=this,b=a.chart,c,d,e=a.options,f=e.animation,g=f&&a.animate;f=g?f&&f.duration||500:0;var h=a.clipRect,i=b.renderer;if(!h){h=a.clipRect=!b.hasRendered&& +b.clipRect?b.clipRect:i.clipRect(0,0,b.plotSizeX,b.plotSizeY);if(!b.clipRect)b.clipRect=h}if(!a.group){c=a.group=i.g("series");if(b.inverted){d=function(){c.attr({width:b.plotWidth,height:b.plotHeight}).invert()};d();Qa(b,"resize",d);Qa(a,"destroy",function(){pb(b,"resize",d)})}c.clip(a.clipRect).attr({visibility:a.visible?Ab:ob,zIndex:e.zIndex}).translate(b.plotLeft,b.plotTop).add(b.seriesGroup)}a.drawDataLabels();g&&a.animate(true);a.drawGraph&&a.drawGraph();a.drawPoints();a.options.enableMouseTracking!== +false&&a.drawTracker();g&&a.animate();setTimeout(function(){h.isAnimating=false;if((c=a.group)&&h!==b.clipRect&&h.renderer){c.clip(a.clipRect=b.clipRect);h.destroy()}},f);a.isDirty=false},redraw:function(){var a=this.chart,b=this.group;if(b){a.inverted&&b.attr({width:a.plotWidth,height:a.plotHeight});b.animate({translateX:a.plotLeft,translateY:a.plotTop})}this.translate();this.setTooltipPoints(true);this.render()},setState:function(a){var b=this.options,c=this.graph,d=b.states;b=b.lineWidth;a=a|| +ib;if(this.state!==a){this.state=a;if(!(d[a]&&d[a].enabled===false)){if(a)b=d[a].lineWidth||b+1;if(c&&!c.dashstyle)c.attr({"stroke-width":b},a?0:500)}}},setVisible:function(a,b){var c=this.chart,d=this.legendItem,e=this.group,f=this.tracker,g=this.dataLabelsGroup,h,i=this.data,j=c.options.chart.ignoreHiddenSeries;h=this.visible;h=(this.visible=a=a===Wa?!h:a)?"show":"hide";e&&e[h]();if(f)f[h]();else for(e=i.length;e--;){f=i[e];f.tracker&&f.tracker[h]()}g&&g[h]();d&&c.legend.colorizeItem(this,a);this.isDirty= +true;this.options.stacking&&u(c.series,function(m){if(m.options.stacking&&m.visible)m.isDirty=true});if(j)c.isDirtyBox=true;b!==false&&c.redraw();Pa(this,h)},show:function(){this.setVisible(true)},hide:function(){this.setVisible(false)},select:function(a){this.selected=a=a===Wa?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;Pa(this,a?"select":"unselect")},drawTracker:function(){var a=this,b=a.options,c=[].concat(a.graphPath),d=c.length,e=a.chart,f=e.options.tooltip.snap,g=a.tracker,h=b.cursor; +h=h&&{cursor:h};var i=a.singlePoints,j;if(d)for(j=d+1;j--;){c[j]===Za&&c.splice(j+1,0,c[j+1]-f,c[j+2],Ka);if(j&&c[j]===Za||j===d)c.splice(j,0,Ka,c[j-2]+f,c[j-1])}for(j=0;j<i.length;j++){d=i[j];c.push(Za,d.plotX-f,d.plotY,Ka,d.plotX+f,d.plotY)}if(g)g.attr({d:c});else a.tracker=e.renderer.path(c).attr({isTracker:true,stroke:ce,fill:jb,"stroke-width":b.lineWidth+2*f,visibility:a.visible?Ab:ob,zIndex:b.zIndex||1}).on(Kb?"touchstart":"mouseover",function(){e.hoverSeries!==a&&a.onMouseOver()}).on("mouseout", +function(){b.stickyTracking||a.onMouseOut()}).css(h).add(e.trackerGroup)}};ma=yb(sb);wb.line=ma;ma=yb(sb,{type:"area"});wb.area=ma;ma=yb(sb,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,i,j,m;if(c&&c<a.length-1){a=f.plotY;j=g.plotX;g=g.plotY;var v;h=(1.5*d+f.plotX)/2.5;i=(1.5*e+a)/2.5;j=(1.5*d+j)/2.5;m=(1.5*e+g)/2.5;v=(m-i)*(j-d)/(j-h)+e-m;i+=v;m+=v;if(i>a&&i>e){i=Ia(a,e);m=2*e-i}else if(i<a&&i<e){i=tb(a,e);m=2*e-i}if(m>g&&m>e){m=Ia(g,e);i=2*e-m}else if(m< +g&&m<e){m=tb(g,e);i=2*e-m}b.rightContX=j;b.rightContY=m}if(c){b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e];f.rightContX=f.rightContY=null}else b=[Za,d,e];return b}});wb.spline=ma;ma=yb(ma,{type:"areaspline"});wb.areaspline=ma;var hd=yb(sb,{type:"column",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",r:"borderRadius"},init:function(){sb.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasColumn=true;b.hasRendered&&u(b.series,function(c){if(c.type=== +a.type)c.isDirty=true})},translate:function(){var a=this,b=a.chart,c=a.options,d=c.stacking,e=c.borderWidth,f=0,g=a.xAxis.reversed,h=a.xAxis.categories,i={},j,m;sb.prototype.translate.apply(a);u(b.series,function(C){if(C.type===a.type&&C.visible){if(C.options.stacking){j=C.stackKey;if(i[j]===Wa)i[j]=f++;m=i[j]}else m=f++;C.columnIndex=m}});var v=a.data,P=a.closestPoints;h=bb(v[1]?v[P].plotX-v[P-1].plotX:b.plotSizeX/(h&&h.length||1));P=h*c.groupPadding;var T=(h-2*P)/f,Y=c.pointWidth,H=K(Y)?(T-Y)/2: +T*c.pointPadding,U=Ia(A(Y,T-2*H),1),z=H+(P+((g?f-a.columnIndex:a.columnIndex)||0)*T-h/2)*(g?-1:1),M=a.yAxis.getThreshold(c.threshold||0),y=A(c.minPointLength,5);u(v,function(C){var Z=C.plotY,Sa=C.yBottom||M,Na=C.plotX+z,Ea=md(tb(Z,Sa)),gb=md(Ia(Z,Sa)-Ea),Lb=a.yAxis.stacks[(C.y<0?"-":"")+a.stackKey],Rb;d&&a.visible&&Lb&&Lb[C.x]&&Lb[C.x].setOffset(z,U);if(bb(gb)<y){if(y){gb=y;Ea=bb(Ea-M)>y?Sa-y:M-(Z<=M?y:0)}Rb=Ea-3}sa(C,{barX:Na,barY:Ea,barW:U,barH:gb});C.shapeType="rect";Z=sa(b.renderer.Element.prototype.crisp.apply({}, +[e,Na,Ea,U,gb]),{r:c.borderRadius});if(e%2){Z.y-=1;Z.height+=1}C.shapeArgs=Z;C.trackerArgs=K(Rb)&&Ca(C.shapeArgs,{height:Ia(6,gb+3),y:Rb})})},getSymbol:function(){},drawGraph:function(){},drawPoints:function(){var a=this,b=a.options,c=a.chart.renderer,d,e;u(a.data,function(f){var g=f.plotY;if(g!==Wa&&!isNaN(g)&&f.y!==null){d=f.graphic;e=f.shapeArgs;if(d){Hc(d);d.animate(e)}else f.graphic=c[f.shapeType](e).attr(f.pointAttr[f.selected?"select":ib]).add(a.group).shadow(b.shadow)}})},drawTracker:function(){var a= +this,b=a.chart,c=b.renderer,d,e,f=+new Date,g=a.options,h=g.cursor,i=h&&{cursor:h},j;u(a.data,function(m){e=m.tracker;d=m.trackerArgs||m.shapeArgs;delete d.strokeWidth;if(m.y!==null)if(e)e.attr(d);else m.tracker=c[m.shapeType](d).attr({isTracker:f,fill:ce,visibility:a.visible?Ab:ob,zIndex:g.zIndex||1}).on(Kb?"touchstart":"mouseover",function(v){j=v.relatedTarget||v.fromElement;b.hoverSeries!==a&&Ga(j,"isTracker")!==f&&a.onMouseOver();m.onMouseOver()}).on("mouseout",function(v){if(!g.stickyTracking){j= +v.relatedTarget||v.toElement;Ga(j,"isTracker")!==f&&a.onMouseOut()}}).css(i).add(m.group||b.trackerGroup)})},animate:function(a){var b=this,c=b.data;if(!a){u(c,function(d){var e=d.graphic;d=d.shapeArgs;if(e){e.attr({height:0,y:b.yAxis.translate(0,0,1)});e.animate({height:d.height,y:d.y},b.options.animation)}});b.animate=null}},remove:function(){var a=this,b=a.chart;b.hasRendered&&u(b.series,function(c){if(c.type===a.type)c.isDirty=true});sb.prototype.remove.apply(a,arguments)}});wb.column=hd;ma=yb(hd, +{type:"bar",init:function(a){a.inverted=this.inverted=true;hd.prototype.init.apply(this,arguments)}});wb.bar=ma;ma=yb(sb,{type:"scatter",translate:function(){var a=this;sb.prototype.translate.apply(a);u(a.data,function(b){b.shapeType="circle";b.shapeArgs={x:b.plotX,y:b.plotY,r:a.chart.options.tooltip.snap}})},drawTracker:function(){var a=this,b=a.options.cursor,c=b&&{cursor:b},d;u(a.data,function(e){(d=e.graphic)&&d.attr({isTracker:true}).on("mouseover",function(){a.onMouseOver();e.onMouseOver()}).on("mouseout", +function(){a.options.stickyTracking||a.onMouseOut()}).css(c)})},cleanData:function(){}});wb.scatter=ma;ma=yb(Oc,{init:function(){Oc.prototype.init.apply(this,arguments);var a=this,b;sa(a,{visible:a.visible!==false,name:A(a.name,"Slice")});b=function(){a.slice()};Qa(a,"select",b);Qa(a,"unselect",b);return a},setVisible:function(a){var b=this.series.chart,c=this.tracker,d=this.dataLabel,e=this.connector,f=this.shadowGroup,g;g=(this.visible=a=a===Wa?!this.visible:a)?"show":"hide";this.group[g]();c&& +c[g]();d&&d[g]();e&&e[g]();f&&f[g]();this.legendItem&&b.legend.colorizeItem(this,a)},slice:function(a,b,c){var d=this.series.chart,e=this.slicedTranslation;oc(c,d);A(b,true);a=this.sliced=K(a)?a:!this.sliced;a={translateX:a?e[0]:d.plotLeft,translateY:a?e[1]:d.plotTop};this.group.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)}});ma=yb(sb,{type:"pie",isCartesian:false,pointClass:ma,pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},getColor:function(){this.initialColor= +this.chart.counters.color},animate:function(){var a=this;u(a.data,function(b){var c=b.graphic;b=b.shapeArgs;var d=-kc/2;if(c){c.attr({r:0,start:d,end:d});c.animate({r:b.r,start:b.start,end:b.end},a.options.animation)}});a.animate=null},translate:function(){var a=0,b=-0.25,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f=c.center.concat([c.size,c.innerSize||0]),g=this.chart,h=g.plotWidth,i=g.plotHeight,j,m,v,P=this.data,T=2*kc,Y,H=tb(h,i),U,z,M,y=c.dataLabels.distance;f=tc(f,function(C,Z){return(U= +/%$/.test(C))?[h,i,H,H][Z]*ja(C)/100:C});this.getX=function(C,Z){v=Fa.asin((C-f[1])/(f[2]/2+y));return f[0]+(Z?-1:1)*rb(v)*(f[2]/2+y)};this.center=f;u(P,function(C){a+=C.y});u(P,function(C){Y=a?C.y/a:0;j=W(b*T*1E3)/1E3;b+=Y;m=W(b*T*1E3)/1E3;C.shapeType="arc";C.shapeArgs={x:f[0],y:f[1],r:f[2]/2,innerR:f[3]/2,start:j,end:m};v=(m+j)/2;C.slicedTranslation=tc([rb(v)*d+g.plotLeft,Cb(v)*d+g.plotTop],W);z=rb(v)*f[2]/2;M=Cb(v)*f[2]/2;C.tooltipPos=[f[0]+z*0.7,f[1]+M*0.7];C.labelPos=[f[0]+z+rb(v)*y,f[1]+M+Cb(v)* +y,f[0]+z+rb(v)*e,f[1]+M+Cb(v)*e,f[0]+z,f[1]+M,y<0?"center":v<T/4?"left":"right",v];C.percentage=Y*100;C.total=a});this.setTooltipPoints()},render:function(){this.drawPoints();this.options.enableMouseTracking!==false&&this.drawTracker();this.drawDataLabels();this.options.animation&&this.animate&&this.animate();this.isDirty=false},drawPoints:function(){var a=this.chart,b=a.renderer,c,d,e,f=this.options.shadow,g,h;u(this.data,function(i){d=i.graphic;h=i.shapeArgs;e=i.group;g=i.shadowGroup;if(f&&!g)g= +i.shadowGroup=b.g("shadow").attr({zIndex:4}).add();if(!e)e=i.group=b.g("point").attr({zIndex:5}).add();c=i.sliced?i.slicedTranslation:[a.plotLeft,a.plotTop];e.translate(c[0],c[1]);g&&g.translate(c[0],c[1]);if(d)d.animate(h);else i.graphic=b.arc(h).attr(sa(i.pointAttr[ib],{"stroke-linejoin":"round"})).add(i.group).shadow(f,g);i.visible===false&&i.setVisible(false)})},drawDataLabels:function(){var a=this.data,b,c=this.chart,d=this.options.dataLabels,e=A(d.connectorPadding,10),f=A(d.connectorWidth,1), +g,h,i=A(d.softConnector,true),j=d.distance,m=this.center,v=m[2]/2;m=m[1];var P=j>0,T=[[],[]],Y,H,U,z,M=2,y;if(d.enabled){sb.prototype.drawDataLabels.apply(this);u(a,function(gb){if(gb.dataLabel)T[gb.labelPos[7]<kc/2?0:1].push(gb)});T[1].reverse();z=function(gb,Lb){return Lb.y-gb.y};for(a=T[0][0]&&T[0][0].dataLabel&&ja(T[0][0].dataLabel.styles.lineHeight);M--;){var C=[],Z=[],Sa=T[M],Na=Sa.length,Ea;for(y=m-v-j;y<=m+v+j;y+=a)C.push(y);U=C.length;if(Na>U){h=[].concat(Sa);h.sort(z);for(y=Na;y--;)h[y].rank= +y;for(y=Na;y--;)Sa[y].rank>=U&&Sa.splice(y,1);Na=Sa.length}for(y=0;y<Na;y++){b=Sa[y];h=b.labelPos;b=9999;for(H=0;H<U;H++){g=bb(C[H]-h[1]);if(g<b){b=g;Ea=H}}if(Ea<y&&C[y]!==null)Ea=y;else{if(U<Na-y+Ea&&C[y]!==null)Ea=U-Na+y;for(;C[Ea]===null;)Ea++}Z.push({i:Ea,y:C[Ea]});C[Ea]=null}Z.sort(z);for(y=0;y<Na;y++){b=Sa[y];h=b.labelPos;g=b.dataLabel;H=Z.pop();Y=h[1];U=b.visible===false?ob:Ab;Ea=H.i;H=H.y;if(Y>H&&C[Ea+1]!==null||Y<H&&C[Ea-1]!==null)H=Y;Y=this.getX(Ea===0||Ea===C.length-1?Y:H,M);g.attr({visibility:U, +align:h[6]})[g.moved?"animate":"attr"]({x:Y+d.x+({left:e,right:-e}[h[6]]||0),y:H+d.y});g.moved=true;if(P&&f){g=b.connector;h=i?[Za,Y+(h[6]==="left"?5:-5),H,"C",Y,H,2*h[2]-h[4],2*h[3]-h[5],h[2],h[3],Ka,h[4],h[5]]:[Za,Y+(h[6]==="left"?5:-5),H,Ka,h[2],h[3],Ka,h[4],h[5]];if(g){g.animate({d:h});g.attr("visibility",U)}else b.connector=g=this.chart.renderer.path(h).attr({"stroke-width":f,stroke:d.connectorColor||b.color||"#606060",visibility:U,zIndex:3}).translate(c.plotLeft,c.plotTop).add()}}}}},drawTracker:hd.prototype.drawTracker, +getSymbol:function(){}});wb.pie=ma;db.Highcharts={Chart:Nd,dateFormat:Zc,pathAnim:Nc,getOptions:function(){return Xa},hasRtlBug:me,numberFormat:Ed,Point:Oc,Color:bc,Renderer:fd,seriesTypes:wb,setOptions:function(a){Xa=Ca(Xa,a);Id();return Xa},Series:sb,addEvent:Qa,removeEvent:pb,createElement:hb,discardElement:pc,css:Ja,each:u,extend:sa,map:tc,merge:Ca,pick:A,extendClass:yb,product:"Highcharts",version:"2.1.9"}})(); diff --git a/npm_assets/node_modules/html5shiv/test/html5shiv.html b/npm_assets/node_modules/html5shiv/test/html5shiv.html new file mode 100644 index 0000000..28e20c0 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/html5shiv.html @@ -0,0 +1,71 @@ +<!doctype html> +<html lang="en" dir="ltr" id="html"> + <head> + <meta charset="utf-8"> + <title>html5shiv Test Suite</title> + <style> + body { + background: url(data/body-crash.jpg) no-repeat -999px -999px; + } + article { + border: 2px solid #8C8; + } + </style> + <link rel="stylesheet" media="screen" href="qunit/qunit.css"> + <script src="../src/html5shiv-printshiv.js"></script> + + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script> + + <script src="qunit/qunit.js"></script> + + <script src="unit/tests.js"></script> + </head> + <body id="body"> + <h1 id="qunit-header">html5shiv Test Suite</h1> + <h2 id="qunit-banner"></h2> + <div id="qunit-testrunner-toolbar"></div> + <h2 id="qunit-userAgent"></h2> + <ol id="qunit-tests"></ol> + + <iframe class="test-frame" src="data/iframed-tests.html?disableMethodsBefore"></iframe> + <iframe class="test-frame" src="data/iframed-tests.html?disableMethodsAfter"></iframe> + <iframe class="test-frame" src="data/iframed-tests.html?addUnknownBefore"></iframe> + <iframe class="test-frame" src="data/iframed-tests.html?addUnknownAfter"></iframe> + <iframe class="test-frame" src="data/iframed-tests.html?disableCSS"></iframe> + <iframe class="test-frame" src="data/iframed-tests.html?noEmbed"></iframe> + + + <div id="qunit-fixture"> + <abcxyz> + <div class="inside"></div> + </abcxyz> + <article> + <div class="inside"></div> + </article> + <aside> + <div class="inside"></div> + </aside> + <figcaption> + <div class="inside"></div> + </figcaption> + <figure> + <div class="inside"></div> + </figure> + <footer> + <div class="inside"></div> + </footer> + <header> + <div class="inside"></div> + </header> + <hgroup> + <div class="inside"></div> + </hgroup> + <nav> + <div class="inside"></div> + </nav> + <section> + <div class="inside"></div> + </section> + </div> + </body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/iframe.1-1.html b/npm_assets/node_modules/html5shiv/test/iframe.1-1.html new file mode 100644 index 0000000..b5affa6 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/iframe.1-1.html @@ -0,0 +1,14 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>Test 1</title> + <link rel="stylesheet" href="style.css"> + <script src="../src/html5shiv-printshiv.js"></script> + </head> + <body> + <section> + <p><a href="iframe.1-2.html">Change to Test Page 2</a></p> + </section> + </body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/iframe.1-2.html b/npm_assets/node_modules/html5shiv/test/iframe.1-2.html new file mode 100644 index 0000000..56ac8b3 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/iframe.1-2.html @@ -0,0 +1,13 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>Test 2</title> + <link rel="stylesheet" href="style.css"> + <script src="../src/html5shiv-printshiv.js"></script> + <body> + <section> + <p><a href="iframe.1-1.html">Change to Test Page 1</a> <span contenteditable>...</span></p> + </section> + </body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/iframe.1.html b/npm_assets/node_modules/html5shiv/test/iframe.1.html new file mode 100644 index 0000000..74c99e1 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/iframe.1.html @@ -0,0 +1,27 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>HTML5Shiv</title> + <link rel="stylesheet" href="style.css"> + <style> + body { + color: #fff; + background: url(data/body-crash.jpg); + } + </style> + <script src="../src/html5shiv-printshiv.js"></script> + <script src="//use.typekit.com/fbz1vwc.js"></script> + <script> + Typekit.load(); + </script> + </head> + <body> + <section>1</section> + <section>2</section> + <section style="border-color: red;">3</section> + <section> + <iframe src="iframe.1-1.html" style="width:100%;height:100%;" frameborder="0"></iframe> + </section> + </body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/index.html b/npm_assets/node_modules/html5shiv/test/index.html new file mode 100644 index 0000000..05f8fc7 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/index.html @@ -0,0 +1,45 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>IE<9 HTML5 Shiv Tests</title> + <link rel="stylesheet" href="style.css"> + <script src="../src/html5shiv-printshiv.js"></script> + </head> + <body> + <h1> + HTML5 Shiv Tests + </h1> + <h2>manual Print tests</h2> + <ul> + <li> + <a href="html5shiv.html">html5shiv testsuite</a>: <span class="pass">PASS</span> + </li> + + </ul> + <h2>manual Print tests</h2> + <ul> + <li> + <a href="iframe.1.html">iframe.1.html</a>: <span class="pass">PASS</span> + </li> + <li> + <a href="mixed-test.html">mixed-test.html</a>: <span class="pass">PASS</span> + </li> + + </ul> + <h2>additional tests</h2> + <ul> + + <li> + <a href="object-test.html">object-test.html</a>: <span class="pass">PASS</span> + </li> + + <li> + <a href="highcharts/area-basic.html">area-basic.html</a>: <span class="pass">PASS</span> + </li> + <li> + <a href="jquery-1.7.1/index.html">simplified jQuery test suite</a>: + </li> + </ul> + <body> +</html> diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/dashboard.xml b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/dashboard.xml new file mode 100644 index 0000000..5a6f561 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/dashboard.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<dashboard> + <locations class="foo"> + <location for="bar" checked="different"> + <infowindowtab> + <tab title="Location"><![CDATA[blabla]]></tab> + <tab title="Users"><![CDATA[blublu]]></tab> + </infowindowtab> + </location> + </locations> +</dashboard> diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/iframe.html b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/iframe.html new file mode 100644 index 0000000..3ff26e1 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/iframe.html @@ -0,0 +1,8 @@ +<html> + <head> + <title>iframe</title> + </head> + <body> + <div><span>span text</span></div> + </body> +</html> diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/test.js b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/test.js new file mode 100644 index 0000000..69f492d --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/test.js @@ -0,0 +1,3 @@ +var foobar = "bar"; +jQuery('#ap').html('bar'); +ok( true, "test.js executed"); diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testinit.js b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testinit.js new file mode 100644 index 0000000..aeda243 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testinit.js @@ -0,0 +1,121 @@ +var jQuery = this.jQuery || "jQuery", // For testing .noConflict() + $ = this.$ || "$", + originaljQuery = jQuery, + original$ = $, + amdDefined; + +/** + * Set up a mock AMD define function for testing AMD registration. + */ +function define(name, dependencies, callback) { + amdDefined = callback(); +} + +define.amd = { + jQuery: true +}; + +/** + * Returns an array of elements with the given IDs, eg. + * @example q("main", "foo", "bar") + * @result [<div id="main">, <span id="foo">, <input id="bar">] + */ +function q() { + var r = []; + + for ( var i = 0; i < arguments.length; i++ ) { + r.push( document.getElementById( arguments[i] ) ); + } + + return r; +} + +/** + * Asserts that a select matches the given IDs * @example t("Check for something", "//[a]", ["foo", "baar"]); + * @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar' + */ +function t(a,b,c) { + var f = jQuery(b).get(), s = ""; + + for ( var i = 0; i < f.length; i++ ) { + s += (s && ",") + '"' + f[i].id + '"'; + } + + deepEqual(f, q.apply(q,c), a + " (" + b + ")"); +} + +var fireNative; +if ( document.createEvent ) { + fireNative = function( node, type ) { + var event = document.createEvent('HTMLEvents'); + event.initEvent( type, true, true ); + node.dispatchEvent( event ); + }; +} else { + fireNative = function( node, type ) { + var event = document.createEventObject(); + node.fireEvent( 'on' + type, event ); + }; +} + +/** + * Add random number to url to stop IE from caching + * + * @example url("data/test.html") + * @result "data/test.html?10538358428943" + * + * @example url("data/test.php?foo=bar") + * @result "data/test.php?foo=bar&10538358345554" + */ +function url(value) { + return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000); +} + +(function () { + // Store the old counts so that we only assert on tests that have actually leaked, + // instead of asserting every time a test has leaked sometime in the past + var oldCacheLength = 0, + oldFragmentsLength = 0, + oldTimersLength = 0, + oldActive = 0; + + /** + * Ensures that tests have cleaned up properly after themselves. Should be passed as the + * teardown function on all modules' lifecycle object. + */ + this.moduleTeardown = function () { + var i, fragmentsLength = 0, cacheLength = 0; + + // Allow QUnit.reset to clean up any attached elements before checking for leaks + QUnit.reset(); + + for ( i in jQuery.cache ) { + ++cacheLength; + } + + jQuery.fragments = {}; + + for ( i in jQuery.fragments ) { + ++fragmentsLength; + } + + // Because QUnit doesn't have a mechanism for retrieving the number of expected assertions for a test, + // if we unconditionally assert any of these, the test will fail with too many assertions :| + if ( cacheLength !== oldCacheLength ) { + equal( cacheLength, oldCacheLength, "No unit tests leak memory in jQuery.cache" ); + oldCacheLength = cacheLength; + } + if ( fragmentsLength !== oldFragmentsLength ) { + equal( fragmentsLength, oldFragmentsLength, "No unit tests leak memory in jQuery.fragments" ); + oldFragmentsLength = fragmentsLength; + } + if ( jQuery.timers.length !== oldTimersLength ) { + equal( jQuery.timers.length, oldTimersLength, "No timers are still running" ); + oldTimersLength = jQuery.timers.length; + } + if ( jQuery.active !== oldActive ) { + equal( jQuery.active, 0, "No AJAX requests are still active" ); + oldActive = jQuery.active; + } + } +}());
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testrunner.js b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testrunner.js new file mode 100644 index 0000000..bdfbcac --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testrunner.js @@ -0,0 +1,27 @@ +jQuery.noConflict(); // Allow the test to run with other libs or jQuery's. + +// jQuery-specific QUnit.reset +(function() { + var reset = QUnit.reset, + ajaxSettings = jQuery.ajaxSettings; + + QUnit.reset = function() { + reset.apply(this, arguments); + jQuery.event.global = {}; + jQuery.ajaxSettings = jQuery.extend({}, ajaxSettings); + }; +})(); + +// load testswarm agent +(function() { + var url = window.location.search; + url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) ); + if ( !url || url.indexOf("http") !== 0 ) { + return; + } + + // (Temporarily) Disable Ajax tests to reduce network strain + // isLocal = QUnit.isLocal = true; + + document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>"); +})(); diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testsuite.css b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testsuite.css new file mode 100644 index 0000000..d3e4b4e --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/testsuite.css @@ -0,0 +1,128 @@ +/* for testing opacity set in styles in IE */ +ol#empty { opacity: 0; filter:Alpha(opacity=0) progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffff0000', EndColorStr='#ffffffff'); } + +div#fx-tests h4 { + background: red; +} + +div#fx-tests h4.pass { + background: green; +} + +div#fx-tests div.box { + background: red; + overflow: hidden; + border: 2px solid #000; +} + +div#fx-tests div.overflow { + overflow: visible; +} + +div.inline { + display: inline; +} + +div.autoheight { + height: auto; +} + +div.autowidth { + width: auto; +} + +div.autoopacity { + opacity: auto; +} + +div.largewidth { + width: 100px; +} + +div.largeheight { + height: 100px; +} + +div.largeopacity { + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); +} + +div.medwidth { + width: 50px; +} + +div.medheight { + height: 50px; +} + +div.medopacity { + opacity: 0.5; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50); +} + +div.nowidth { + width: 0px; +} + +div.noheight { + height: 0px; +} + +div.noopacity { + opacity: 0; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); +} + +div.hidden { + display: none; +} + +div#fx-tests div.widewidth { + background-repeat: repeat-x; +} + +div#fx-tests div.wideheight { + background-repeat: repeat-y; +} + +div#fx-tests div.widewidth.wideheight { + background-repeat: repeat; +} + +div#fx-tests div.noback { + background-image: none; +} + +div.chain, div.chain div { width: 100px; height: 20px; position: relative; float: left; } +div.chain div { position: absolute; top: 0px; left: 0px; } + +div.chain.test { background: red; } +div.chain.test div { background: green; } + +div.chain.out { background: green; } +div.chain.out div { background: red; display: none; } + +/* tests to ensure jQuery can determine the native display mode of elements + that have been set as display: none in stylesheets */ +div#show-tests * { display: none; } + +#nothiddendiv { font-size: 16px; } +#nothiddendivchild.em { font-size: 2em; } +#nothiddendivchild.prct { font-size: 150%; } + +/* For testing type on vml in IE #7071 */ +v\:oval { behavior:url(#default#VML); display:inline-block; } + +/* 8099 changes to default styles are read correctly */ +tt { display: none; } +sup { display: none; } +dfn { display: none; } + +/* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */ +body, div { background: url(http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; } + +/* #6652 REMOVE FILTER:ALPHA(OPACITY=100) AFTER ANIMATION */ +#t6652 div { filter: alpha(opacity=50); } + +/* #10501 */ +section { background:#f0f; display:block; }
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/versioncheck.js b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/versioncheck.js new file mode 100644 index 0000000..f4b7790 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/data/versioncheck.js @@ -0,0 +1,8 @@ +// Run minified source from dist (do make first) +// Should be loaded before QUnit but after src +(function() { + if ( /jquery\=min/.test( window.location.search ) ) { + jQuery.noConflict( true ); + document.write(unescape("%3Cscript%20src%3D%27../dist/jquery.min.js%27%3E%3C/script%3E")); + } +})();
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/index.html b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/index.html new file mode 100644 index 0000000..1810d3b --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/index.html @@ -0,0 +1,249 @@ +<!doctype html> +<html lang="en" dir="ltr" id="html"> + <head> + <meta charset="utf-8"> + <title>jQuery Test Suite</title> + <link rel="stylesheet" media="screen" href="../qunit/qunit.css"> + <link rel="stylesheet" media="screen" href="data/testsuite.css"> + <script src="data/testinit.js"></script> + <script src="../../src/html5shiv-printshiv.js"></script> + <script src="//code.jquery.com/jquery-1.7.1.min.js"></script> + <script src="data/versioncheck.js"></script> + <script src="../qunit/qunit.js"></script> + <script src="data/testrunner.js"></script> + <script src="unit/core.js"></script> + <script src="unit/traversing.js"></script> + <script src="unit/manipulation.js"></script> + </head> + <body id="body"> + <h1 id="qunit-header"><a href="/jquery/test/index.html">jQuery Test Suite</a> + <a href="?jquery=min">(minified)</a> + </h1> + <h2 id="qunit-banner"></h2> + <div id="qunit-testrunner-toolbar"></div> + <h2 id="qunit-userAgent"></h2> + <ol id="qunit-tests"></ol> + + <!-- Test HTML --> + <div id="nothiddendiv" style="height:1px;background:white;" class="nothiddendiv"> + <div id="nothiddendivchild"></div> + </div> + + <!-- this iframe is outside the #qunit-fixture so it won't reload constantly wasting time, but it means the tests must be "safe" and clean up after themselves --> + <iframe id="loadediframe" name="loadediframe" style="display:none;" src="data/iframe.html"></iframe> + <dl id="dl" style="position:absolute;top:-32767px;left:-32767px;width:1px"> + <div id="qunit-fixture"> + <p id="firstp">See <a id="simon1" href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p> + <p id="ap"> + Here are some links in a normal paragraph: <a id="google" href="http://www.google.com/" title="Google!">Google</a>, + <a id="groups" href="http://groups.google.com/" class="GROUPS">Google Groups (Link)</a>. + This link has <code><a href="http://smin" id="anchor1">class="blog"</a></code>: + <a href="http://diveintomark.org/" class="blog" hreflang="en" id="mark">diveintomark</a> + </p> + <div id="foo"> + <p id="sndp">Everything inside the red border is inside a div with <code>id="foo"</code>.</p> + <p lang="en" id="en">This is a normal link: <a id="yahoo" href="http://www.yahoo.com/" class="blogTest">Yahoo</a></p> + <p id="sap">This link has <code><a href="#2" id="anchor2">class="blog"</a></code>: <a href="http://simon.incutio.com/" class="blog link" id="simon">Simon Willison's Weblog</a></p> + </div> + <span id="name+value"></span> + <p id="first">Try them out:</p> + <ul id="firstUL"></ul> + <ol id="empty"></ol> + <form id="form" action="formaction"> + <label for="action" id="label-for">Action:</label> + <input type="text" name="action" value="Test" id="text1" maxlength="30"> + <input type="text" name="text2" value="Test" id="text2" disabled="disabled"> + <input type="radio" name="radio1" id="radio1" value="on"> + + <input type="radio" name="radio2" id="radio2" checked="checked"> + <input type="checkbox" name="check" id="check1" checked="checked"> + <input type="checkbox" id="check2" value="on"> + + <input type="hidden" name="hidden" id="hidden1"> + <input type="text" style="display:none;" name="foo[bar]" id="hidden2"> + + <input type="text" id="name" name="name" value="name"> + <input type="search" id="search" name="search" value="search"> + + <button id="button" name="button" type="button">Button</button> + <textarea id="area1" maxlength="30">foobar</textarea> + + <select name="select1" id="select1"> + <option id="option1a" class="emptyopt" value="">Nothing</option> + <option id="option1b" value="1">1</option> + <option id="option1c" value="2">2</option> + <option id="option1d" value="3">3</option> + </select> + <select name="select2" id="select2"> + <option id="option2a" class="emptyopt" value="">Nothing</option> + <option id="option2b" value="1">1</option> + <option id="option2c" value="2">2</option> + <option id="option2d" selected="selected" value="3">3</option> + </select> + <select name="select3" id="select3" multiple="multiple"> + <option id="option3a" class="emptyopt" value="">Nothing</option> + <option id="option3b" selected="selected" value="1">1</option> + <option id="option3c" selected="selected" value="2">2</option> + <option id="option3d" value="3">3</option> + <option id="option3e">no value</option> + </select> + <select name="select4" id="select4" multiple="multiple"> + <optgroup disabled="disabled"> + <option id="option4a" class="emptyopt" value="">Nothing</option> + <option id="option4b" disabled="disabled" selected="selected" value="1">1</option> + <option id="option4c" selected="selected" value="2">2</option> + </optgroup> + <option selected="selected" disabled="disabled" id="option4d" value="3">3</option> + <option id="option4e">no value</option> + </select> + <select name="select5" id="select5"> + <option id="option5a" value="3">1</option> + <option id="option5b" value="2">2</option> + <option id="option5c" value="1" data-attr="">3</option> + </select> + + <object id="object1" codebase="stupid"> + <param name="p1" value="x1"> + <param name="p2" value="x2"> + </object> + + <span id="台北Táiběi"></span> + <span id="台北" lang="中文"></span> + <span id="utf8class1" class="台北Táiběi 台北"></span> + <span id="utf8class2" class="台北"></span> + <span id="foo:bar" class="foo:bar"></span> + <span id="test.foo[5]bar" class="test.foo[5]bar"></span> + <foo_bar id="foobar">test element</foo_bar> + </form> + <b id="floatTest">Float test.</b> + <iframe id="iframe" name="iframe"></iframe> + <form id="lengthtest"> + <input type="text" id="length" name="test"> + <input type="text" id="idTest" name="id"> + </form> + <table id="table"></table> + + <form id="name-tests"> + <!-- Inputs with a grouped name attribute. --> + <input name="types[]" id="types_all" type="checkbox" value="all"> + <input name="types[]" id="types_anime" type="checkbox" value="anime"> + <input name="types[]" id="types_movie" type="checkbox" value="movie"> + </form> + + <form id="testForm" action="#" method="get"> + <textarea name="T3" rows="2" cols="15">? +Z</textarea> + <input type="hidden" name="H1" value="x"> + <input type="hidden" name="H2"> + <input name="PWD" type="password" value=""> + <input name="T1" type="text"> + <input name="T2" type="text" value="YES" readonly="readonly"> + <input type="checkbox" name="C1" value="1"> + <input type="checkbox" name="C2"> + <input type="radio" name="R1" value="1"> + <input type="radio" name="R1" value="2"> + <input type="text" name="My Name" value="me"> + <input type="reset" name="reset" value="NO"> + <select name="S1"> + <option value="abc">ABC</option> + <option value="abc">ABC</option> + <option value="abc">ABC</option> + </select> + <select name="S2" multiple="multiple" size="3"> + <option value="abc">ABC</option> + <option value="abc">ABC</option> + <option value="abc">ABC</option> + </select> + <select name="S3"> + <option selected="selected">YES</option> + </select> + <select name="S4"> + <option value="" selected="selected">NO</option> + </select> + <input type="submit" name="sub1" value="NO"> + <input type="submit" name="sub2" value="NO"> + <input type="image" name="sub3" value="NO"> + <button name="sub4" type="submit" value="NO">NO</button> + <input name="D1" type="text" value="NO" disabled="disabled"> + <input type="checkbox" checked="checked" disabled="disabled" name="D2" value="NO"> + <input type="radio" name="D3" value="NO" checked="checked" disabled="disabled"> + <select name="D4" disabled="disabled"> + <option selected="selected" value="NO">NO</option> + </select> + <input id="list-test" type="text"> + <datalist id="datalist"> + <option value="option"></option> + </datalist> + </form> + <div id="moretests"> + <form> + <div id="checkedtest" style="display:none;"> + <input type="radio" name="checkedtestradios" checked="checked"> + <input type="radio" name="checkedtestradios" value="on"> + <input type="checkbox" name="checkedtestcheckboxes" checked="checked"> + <input type="checkbox" name="checkedtestcheckboxes"> + </div> + </form> + <div id="nonnodes"><span>hi</span> there <!-- mon ami --></div> + <div id="t2037"> + <div><div class="hidden">hidden</div></div> + </div> + <div id="t6652"> + <div></div> + </div> + <div id="no-clone-exception"><object><embed></embed></object></div> + </div> + + <div id="tabindex-tests"> + <ol id="listWithTabIndex" tabindex="5"> + <li id="foodWithNegativeTabIndex" tabindex="-1">Rice</li> + <li id="foodNoTabIndex">Beans</li> + <li>Blinis</li> + <li>Tofu</li> + </ol> + <div id="divWithNoTabIndex">I'm hungry. I should...</div> + <span>...</span><a href="#" id="linkWithNoTabIndex">Eat lots of food</a><span>...</span> | + <span>...</span><a href="#" id="linkWithTabIndex" tabindex="2">Eat a little food</a><span>...</span> | + <span>...</span><a href="#" id="linkWithNegativeTabIndex" tabindex="-1">Eat no food</a><span>...</span> + <span>...</span><a id="linkWithNoHrefWithNoTabIndex">Eat a burger</a><span>...</span> + <span>...</span><a id="linkWithNoHrefWithTabIndex" tabindex="1">Eat some funyuns</a><span>...</span> + <span>...</span><a id="linkWithNoHrefWithNegativeTabIndex" tabindex="-1">Eat some funyuns</a><span>...</span> + </div> + + <div id="liveHandlerOrder"> + <span id="liveSpan1"><a href="#" id="liveLink1"></a></span> + <span id="liveSpan2"><a href="#" id="liveLink2"></a></span> + </div> + + <div id="siblingTest"> + <em id="siblingfirst">1</em> + <em id="siblingnext">2</em> + </div> + </div> + </dl> + <div id="fx-test-group" style="position:absolute;width:1px;height:1px;overflow:hidden;"> + <div id="fx-queue" name="test"> + <div id="fadein" class='chain test' name='div'>fadeIn<div>fadeIn</div></div> + <div id="fadeout" class='chain test out'>fadeOut<div>fadeOut</div></div> + + <div id="show" class='chain test'>show<div>show</div></div> + <div id="hide" class='chain test out'>hide<div>hide</div></div> + + <div id="togglein" class='chain test'>togglein<div>togglein</div></div> + <div id="toggleout" class='chain test out'>toggleout<div>toggleout</div></div> + + <div id="slideup" class='chain test'>slideUp<div>slideUp</div></div> + <div id="slidedown" class='chain test out'>slideDown<div>slideDown</div></div> + + <div id="slidetogglein" class='chain test'>slideToggleIn<div>slideToggleIn</div></div> + <div id="slidetoggleout" class='chain test out'>slideToggleOut<div>slideToggleOut</div></div> + + <div id="fadetogglein" class='chain test'>fadeToggleIn<div>fadeToggleIn</div></div> + <div id="fadetoggleout" class='chain test out'>fadeToggleOut<div>fadeToggleOut</div></div> + + <div id="fadeto" class='chain test'>fadeTo<div>fadeTo</div></div> + </div> + <div id="fx-tests"></div> + </div> + </body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/core.js b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/core.js new file mode 100644 index 0000000..6d8dfaa --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/core.js @@ -0,0 +1,1249 @@ +module("core", { teardown: moduleTeardown }); + +test("Basic requirements", function() { + expect(7); + ok( Array.prototype.push, "Array.push()" ); + ok( Function.prototype.apply, "Function.apply()" ); + ok( document.getElementById, "getElementById" ); + ok( document.getElementsByTagName, "getElementsByTagName" ); + ok( RegExp, "RegExp" ); + ok( jQuery, "jQuery" ); + ok( $, "$" ); +}); + +test("jQuery()", function() { + expect(29); + + // Basic constructor's behavior + + equal( jQuery().length, 0, "jQuery() === jQuery([])" ); + equal( jQuery(undefined).length, 0, "jQuery(undefined) === jQuery([])" ); + equal( jQuery(null).length, 0, "jQuery(null) === jQuery([])" ); + equal( jQuery("").length, 0, "jQuery('') === jQuery([])" ); + equal( jQuery("#").length, 0, "jQuery('#') === jQuery([])" ); + + var obj = jQuery("div"); + equal( jQuery(obj).selector, "div", "jQuery(jQueryObj) == jQueryObj" ); + + // can actually yield more than one, when iframes are included, the window is an array as well + equal( jQuery(window).length, 1, "Correct number of elements generated for jQuery(window)" ); + + + var main = jQuery("#qunit-fixture"); + deepEqual( jQuery("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" ); + +/* + // disabled since this test was doing nothing. i tried to fix it but i'm not sure + // what the expected behavior should even be. FF returns "\n" for the text node + // make sure this is handled + var crlfContainer = jQuery('<p>\r\n</p>'); + var x = crlfContainer.contents().get(0).nodeValue; + equal( x, what???, "Check for \\r and \\n in jQuery()" ); +*/ + + /* // Disabled until we add this functionality in + var pass = true; + try { + jQuery("<div>Testing</div>").appendTo(document.getElementById("iframe").contentDocument.body); + } catch(e){ + pass = false; + } + ok( pass, "jQuery('<tag>') needs optional document parameter to ease cross-frame DOM wrangling, see #968" );*/ + + var code = jQuery("<code/>"); + equal( code.length, 1, "Correct number of elements generated for code" ); + equal( code.parent().length, 0, "Make sure that the generated HTML has no parent." ); + var img = jQuery("<img/>"); + equal( img.length, 1, "Correct number of elements generated for img" ); + equal( img.parent().length, 0, "Make sure that the generated HTML has no parent." ); + var div = jQuery("<div/><hr/><code/><b/>"); + equal( div.length, 4, "Correct number of elements generated for div hr code b" ); + equal( div.parent().length, 0, "Make sure that the generated HTML has no parent." ); + + equal( jQuery([1,2,3]).get(1), 2, "Test passing an array to the factory" ); + + equal( jQuery(document.body).get(0), jQuery("body").get(0), "Test passing an html node to the factory" ); + + var exec = false; + + var elem = jQuery("<div/>", { + width: 10, + css: { paddingLeft:1, paddingRight:1 }, + click: function(){ ok(exec, "Click executed."); }, + text: "test", + "class": "test2", + id: "test3" + }); + + equal( elem[0].style.width, "10px", "jQuery() quick setter width"); + equal( elem[0].style.paddingLeft, "1px", "jQuery quick setter css"); + equal( elem[0].style.paddingRight, "1px", "jQuery quick setter css"); + equal( elem[0].childNodes.length, 1, "jQuery quick setter text"); + equal( elem[0].firstChild.nodeValue, "test", "jQuery quick setter text"); + equal( elem[0].className, "test2", "jQuery() quick setter class"); + equal( elem[0].id, "test3", "jQuery() quick setter id"); + + exec = true; + elem.click(); + + // manually clean up detached elements + elem.remove(); + + for ( var i = 0; i < 3; ++i ) { + elem = jQuery("<input type='text' value='TEST' />"); + } + equal( elem[0].defaultValue, "TEST", "Ensure cached nodes are cloned properly (Bug #6655)" ); + + // manually clean up detached elements + elem.remove(); + + equal( jQuery(" <div/> ").length, 1, "Make sure whitespace is trimmed." ); + equal( jQuery(" a<div/>b ").length, 1, "Make sure whitespace and other characters are trimmed." ); + + var long = ""; + for ( var i = 0; i < 128; i++ ) { + long += "12345678"; + } + + equal( jQuery(" <div>" + long + "</div> ").length, 1, "Make sure whitespace is trimmed on long strings." ); + equal( jQuery(" a<div>" + long + "</div>b ").length, 1, "Make sure whitespace and other characters are trimmed on long strings." ); +}); + +test("selector state", function() { + expect(31); + + var test; + + test = jQuery(undefined); + equal( test.selector, "", "Empty jQuery Selector" ); + equal( test.context, undefined, "Empty jQuery Context" ); + + test = jQuery(document); + equal( test.selector, "", "Document Selector" ); + equal( test.context, document, "Document Context" ); + + test = jQuery(document.body); + equal( test.selector, "", "Body Selector" ); + equal( test.context, document.body, "Body Context" ); + + test = jQuery("#qunit-fixture"); + equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" ); + equal( test.context, document, "#qunit-fixture Context" ); + + test = jQuery("#notfoundnono"); + equal( test.selector, "#notfoundnono", "#notfoundnono Selector" ); + equal( test.context, document, "#notfoundnono Context" ); + + test = jQuery("#qunit-fixture", document); + equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" ); + equal( test.context, document, "#qunit-fixture Context" ); + + test = jQuery("#qunit-fixture", document.body); + equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" ); + equal( test.context, document.body, "#qunit-fixture Context" ); + + // Test cloning + test = jQuery(test); + equal( test.selector, "#qunit-fixture", "#qunit-fixture Selector" ); + equal( test.context, document.body, "#qunit-fixture Context" ); + + test = jQuery(document.body).find("#qunit-fixture"); + equal( test.selector, "#qunit-fixture", "#qunit-fixture find Selector" ); + equal( test.context, document.body, "#qunit-fixture find Context" ); + + test = jQuery("#qunit-fixture").filter("div"); + equal( test.selector, "#qunit-fixture.filter(div)", "#qunit-fixture filter Selector" ); + equal( test.context, document, "#qunit-fixture filter Context" ); + + test = jQuery("#qunit-fixture").not("div"); + equal( test.selector, "#qunit-fixture.not(div)", "#qunit-fixture not Selector" ); + equal( test.context, document, "#qunit-fixture not Context" ); + + test = jQuery("#qunit-fixture").filter("div").not("div"); + equal( test.selector, "#qunit-fixture.filter(div).not(div)", "#qunit-fixture filter, not Selector" ); + equal( test.context, document, "#qunit-fixture filter, not Context" ); + + test = jQuery("#qunit-fixture").filter("div").not("div").end(); + equal( test.selector, "#qunit-fixture.filter(div)", "#qunit-fixture filter, not, end Selector" ); + equal( test.context, document, "#qunit-fixture filter, not, end Context" ); + + test = jQuery("#qunit-fixture").parent("body"); + equal( test.selector, "#qunit-fixture.parent(body)", "#qunit-fixture parent Selector" ); + equal( test.context, document, "#qunit-fixture parent Context" ); + + test = jQuery("#qunit-fixture").eq(0); + equal( test.selector, "#qunit-fixture.slice(0,1)", "#qunit-fixture eq Selector" ); + equal( test.context, document, "#qunit-fixture eq Context" ); + + var d = "<div />"; + equal( + jQuery(d).appendTo(jQuery(d)).selector, + jQuery(d).appendTo(d).selector, + "manipulation methods make same selector for jQuery objects" + ); +}); + +test( "globalEval", function() { + + expect( 3 ); + + jQuery.globalEval( "var globalEvalTest = true;" ); + ok( window.globalEvalTest, "Test variable declarations are global" ); + + window.globalEvalTest = false; + + jQuery.globalEval( "globalEvalTest = true;" ); + ok( window.globalEvalTest, "Test variable assignments are global" ); + + window.globalEvalTest = false; + + jQuery.globalEval( "this.globalEvalTest = true;" ); + ok( window.globalEvalTest, "Test context (this) is the window object" ); + + window.globalEvalTest = undefined; +}); + + + +test("noConflict", function() { + expect(7); + + var $$ = jQuery; + + equal( jQuery, jQuery.noConflict(), "noConflict returned the jQuery object" ); + equal( jQuery, $$, "Make sure jQuery wasn't touched." ); + equal( $, original$, "Make sure $ was reverted." ); + + jQuery = $ = $$; + + equal( jQuery.noConflict(true), $$, "noConflict returned the jQuery object" ); + equal( jQuery, originaljQuery, "Make sure jQuery was reverted." ); + equal( $, original$, "Make sure $ was reverted." ); + ok( $$("#qunit-fixture").html("test"), "Make sure that jQuery still works." ); + + jQuery = $$; +}); + +test("trim", function() { + expect(9); + + var nbsp = String.fromCharCode(160); + + equal( jQuery.trim("hello "), "hello", "trailing space" ); + equal( jQuery.trim(" hello"), "hello", "leading space" ); + equal( jQuery.trim(" hello "), "hello", "space on both sides" ); + equal( jQuery.trim(" " + nbsp + "hello " + nbsp + " "), "hello", " " ); + + equal( jQuery.trim(), "", "Nothing in." ); + equal( jQuery.trim( undefined ), "", "Undefined" ); + equal( jQuery.trim( null ), "", "Null" ); + equal( jQuery.trim( 5 ), "5", "Number" ); + equal( jQuery.trim( false ), "false", "Boolean" ); +}); + +test("type", function() { + expect(23); + + equal( jQuery.type(null), "null", "null" ); + equal( jQuery.type(undefined), "undefined", "undefined" ); + equal( jQuery.type(true), "boolean", "Boolean" ); + equal( jQuery.type(false), "boolean", "Boolean" ); + equal( jQuery.type(Boolean(true)), "boolean", "Boolean" ); + equal( jQuery.type(0), "number", "Number" ); + equal( jQuery.type(1), "number", "Number" ); + equal( jQuery.type(Number(1)), "number", "Number" ); + equal( jQuery.type(""), "string", "String" ); + equal( jQuery.type("a"), "string", "String" ); + equal( jQuery.type(String("a")), "string", "String" ); + equal( jQuery.type({}), "object", "Object" ); + equal( jQuery.type(/foo/), "regexp", "RegExp" ); + equal( jQuery.type(new RegExp("asdf")), "regexp", "RegExp" ); + equal( jQuery.type([1]), "array", "Array" ); + equal( jQuery.type(new Date()), "date", "Date" ); + equal( jQuery.type(new Function("return;")), "function", "Function" ); + equal( jQuery.type(function(){}), "function", "Function" ); + equal( jQuery.type(window), "object", "Window" ); + equal( jQuery.type(document), "object", "Document" ); + equal( jQuery.type(document.body), "object", "Element" ); + equal( jQuery.type(document.createTextNode("foo")), "object", "TextNode" ); + equal( jQuery.type(document.getElementsByTagName("*")), "object", "NodeList" ); +}); + +test("isPlainObject", function() { + expect(15); + + stop(); + + // The use case that we want to match + ok(jQuery.isPlainObject({}), "{}"); + + // Not objects shouldn't be matched + ok(!jQuery.isPlainObject(""), "string"); + ok(!jQuery.isPlainObject(0) && !jQuery.isPlainObject(1), "number"); + ok(!jQuery.isPlainObject(true) && !jQuery.isPlainObject(false), "boolean"); + ok(!jQuery.isPlainObject(null), "null"); + ok(!jQuery.isPlainObject(undefined), "undefined"); + + // Arrays shouldn't be matched + ok(!jQuery.isPlainObject([]), "array"); + + // Instantiated objects shouldn't be matched + ok(!jQuery.isPlainObject(new Date), "new Date"); + + var fn = function(){}; + + // Functions shouldn't be matched + ok(!jQuery.isPlainObject(fn), "fn"); + + // Again, instantiated objects shouldn't be matched + ok(!jQuery.isPlainObject(new fn), "new fn (no methods)"); + + // Makes the function a little more realistic + // (and harder to detect, incidentally) + fn.prototype = {someMethod: function(){}}; + + // Again, instantiated objects shouldn't be matched + ok(!jQuery.isPlainObject(new fn), "new fn"); + + // DOM Element + ok(!jQuery.isPlainObject(document.createElement("div")), "DOM Element"); + + // Window + ok(!jQuery.isPlainObject(window), "window"); + + try { + jQuery.isPlainObject( window.location ); + ok( true, "Does not throw exceptions on host objects"); + } catch ( e ) { + ok( false, "Does not throw exceptions on host objects -- FAIL"); + } + + try { + var iframe = document.createElement("iframe"); + document.body.appendChild(iframe); + + window.iframeDone = function(otherObject){ + // Objects from other windows should be matched + ok(jQuery.isPlainObject(new otherObject), "new otherObject"); + document.body.removeChild( iframe ); + start(); + }; + + var doc = iframe.contentDocument || iframe.contentWindow.document; + doc.open(); + doc.write("<body onload='window.parent.iframeDone(Object);'>"); + doc.close(); + } catch(e) { + document.body.removeChild( iframe ); + + ok(true, "new otherObject - iframes not supported"); + start(); + } +}); + +test("isFunction", function() { + expect(19); + + // Make sure that false values return false + ok( !jQuery.isFunction(), "No Value" ); + ok( !jQuery.isFunction( null ), "null Value" ); + ok( !jQuery.isFunction( undefined ), "undefined Value" ); + ok( !jQuery.isFunction( "" ), "Empty String Value" ); + ok( !jQuery.isFunction( 0 ), "0 Value" ); + + // Check built-ins + // Safari uses "(Internal Function)" + ok( jQuery.isFunction(String), "String Function("+String+")" ); + ok( jQuery.isFunction(Array), "Array Function("+Array+")" ); + ok( jQuery.isFunction(Object), "Object Function("+Object+")" ); + ok( jQuery.isFunction(Function), "Function Function("+Function+")" ); + + // When stringified, this could be misinterpreted + var mystr = "function"; + ok( !jQuery.isFunction(mystr), "Function String" ); + + // When stringified, this could be misinterpreted + var myarr = [ "function" ]; + ok( !jQuery.isFunction(myarr), "Function Array" ); + + // When stringified, this could be misinterpreted + var myfunction = { "function": "test" }; + ok( !jQuery.isFunction(myfunction), "Function Object" ); + + // Make sure normal functions still work + var fn = function(){}; + ok( jQuery.isFunction(fn), "Normal Function" ); + + var obj = document.createElement("object"); + + // Firefox says this is a function + ok( !jQuery.isFunction(obj), "Object Element" ); + + // IE says this is an object + // Since 1.3, this isn't supported (#2968) + //ok( jQuery.isFunction(obj.getAttribute), "getAttribute Function" ); + + var nodes = document.body.childNodes; + + // Safari says this is a function + ok( !jQuery.isFunction(nodes), "childNodes Property" ); + + var first = document.body.firstChild; + + // Normal elements are reported ok everywhere + ok( !jQuery.isFunction(first), "A normal DOM Element" ); + + var input = document.createElement("input"); + input.type = "text"; + document.body.appendChild( input ); + + // IE says this is an object + // Since 1.3, this isn't supported (#2968) + //ok( jQuery.isFunction(input.focus), "A default function property" ); + + document.body.removeChild( input ); + + var a = document.createElement("a"); + a.href = "some-function"; + document.body.appendChild( a ); + + // This serializes with the word 'function' in it + ok( !jQuery.isFunction(a), "Anchor Element" ); + + document.body.removeChild( a ); + + // Recursive function calls have lengths and array-like properties + function callme(callback){ + function fn(response){ + callback(response); + } + + ok( jQuery.isFunction(fn), "Recursive Function Call" ); + + fn({ some: "data" }); + }; + + callme(function(){ + callme(function(){}); + }); +}); + +test( "isNumeric", function() { + expect( 37 ); + + var t = jQuery.isNumeric, + Traditionalists = function(n) { + this.value = n; + this.toString = function(){ + return String(this.value); + }; + }, + answer = new Traditionalists( "42" ), + rong = new Traditionalists( "Devo" ); + + ok( t("-10"), "Negative integer string"); + ok( t("0"), "Zero string"); + ok( t("5"), "Positive integer string"); + ok( t(-16), "Negative integer number"); + ok( t(0), "Zero integer number"); + ok( t(32), "Positive integer number"); + ok( t("040"), "Octal integer literal string"); + ok( t(0144), "Octal integer literal"); + ok( t("0xFF"), "Hexadecimal integer literal string"); + ok( t(0xFFF), "Hexadecimal integer literal"); + ok( t("-1.6"), "Negative floating point string"); + ok( t("4.536"), "Positive floating point string"); + ok( t(-2.6), "Negative floating point number"); + ok( t(3.1415), "Positive floating point number"); + ok( t(8e5), "Exponential notation"); + ok( t("123e-2"), "Exponential notation string"); + ok( t(answer), "Custom .toString returning number"); + equal( t(""), false, "Empty string"); + equal( t(" "), false, "Whitespace characters string"); + equal( t("\t\t"), false, "Tab characters string"); + equal( t("abcdefghijklm1234567890"), false, "Alphanumeric character string"); + equal( t("xabcdefx"), false, "Non-numeric character string"); + equal( t(true), false, "Boolean true literal"); + equal( t(false), false, "Boolean false literal"); + equal( t("bcfed5.2"), false, "Number with preceding non-numeric characters"); + equal( t("7.2acdgs"), false, "Number with trailling non-numeric characters"); + equal( t(undefined), false, "Undefined value"); + equal( t(null), false, "Null value"); + equal( t(NaN), false, "NaN value"); + equal( t(Infinity), false, "Infinity primitive"); + equal( t(Number.POSITIVE_INFINITY), false, "Positive Infinity"); + equal( t(Number.NEGATIVE_INFINITY), false, "Negative Infinity"); + equal( t(rong), false, "Custom .toString returning non-number"); + equal( t({}), false, "Empty object"); + equal( t(function(){} ), false, "Instance of a function"); + equal( t( new Date ), false, "Instance of a Date"); + equal( t(function(){} ), false, "Instance of a function"); +}); + +test("isXMLDoc - HTML", function() { + expect(4); + + ok( !jQuery.isXMLDoc( document ), "HTML document" ); + ok( !jQuery.isXMLDoc( document.documentElement ), "HTML documentElement" ); + ok( !jQuery.isXMLDoc( document.body ), "HTML Body Element" ); + + var iframe = document.createElement("iframe"); + document.body.appendChild( iframe ); + + try { + var body = jQuery(iframe).contents()[0]; + + try { + ok( !jQuery.isXMLDoc( body ), "Iframe body element" ); + } catch(e) { + ok( false, "Iframe body element exception" ); + } + + } catch(e) { + ok( true, "Iframe body element - iframe not working correctly" ); + } + + document.body.removeChild( iframe ); +}); + +test("XSS via location.hash", function() { + expect(1); + + stop(); + jQuery._check9521 = function(x){ + ok( x, "script called from #id-like selector with inline handler" ); + jQuery("#check9521").remove(); + delete jQuery._check9521; + start(); + }; + try { + // This throws an error because it's processed like an id + jQuery( '#<img id="check9521" src="no-such-.gif" onerror="jQuery._check9521(false)">' ).appendTo("#qunit-fixture"); + } catch (err) { + jQuery._check9521(true); + }; +}); + +if ( !isLocal ) { +test("isXMLDoc - XML", function() { + expect(3); + stop(); + jQuery.get("data/dashboard.xml", function(xml) { + ok( jQuery.isXMLDoc( xml ), "XML document" ); + ok( jQuery.isXMLDoc( xml.documentElement ), "XML documentElement" ); + ok( jQuery.isXMLDoc( jQuery("tab", xml)[0] ), "XML Tab Element" ); + start(); + }); +}); +} + +test("isWindow", function() { + expect( 12 ); + + ok( jQuery.isWindow(window), "window" ); + ok( !jQuery.isWindow(), "empty" ); + ok( !jQuery.isWindow(null), "null" ); + ok( !jQuery.isWindow(undefined), "undefined" ); + ok( !jQuery.isWindow(document), "document" ); + ok( !jQuery.isWindow(document.documentElement), "documentElement" ); + ok( !jQuery.isWindow(""), "string" ); + ok( !jQuery.isWindow(1), "number" ); + ok( !jQuery.isWindow(true), "boolean" ); + ok( !jQuery.isWindow({}), "object" ); + // HMMM + // ok( !jQuery.isWindow({ setInterval: function(){} }), "fake window" ); + ok( !jQuery.isWindow(/window/), "regexp" ); + ok( !jQuery.isWindow(function(){}), "function" ); +}); + +test("jQuery('html')", function() { + expect(18); + + QUnit.reset(); + jQuery.foo = false; + var s = jQuery("<script>jQuery.foo='test';</script>")[0]; + ok( s, "Creating a script" ); + ok( !jQuery.foo, "Make sure the script wasn't executed prematurely" ); + jQuery("body").append("<script>jQuery.foo='test';</script>"); + ok( jQuery.foo, "Executing a scripts contents in the right context" ); + + // Test multi-line HTML + var div = jQuery("<div>\r\nsome text\n<p>some p</p>\nmore text\r\n</div>")[0]; + equal( div.nodeName.toUpperCase(), "DIV", "Make sure we're getting a div." ); + equal( div.firstChild.nodeType, 3, "Text node." ); + equal( div.lastChild.nodeType, 3, "Text node." ); + equal( div.childNodes[1].nodeType, 1, "Paragraph." ); + equal( div.childNodes[1].firstChild.nodeType, 3, "Paragraph text." ); + + QUnit.reset(); + ok( jQuery("<link rel='stylesheet'/>")[0], "Creating a link" ); + + ok( !jQuery("<script/>")[0].parentNode, "Create a script" ); + + ok( jQuery("<input/>").attr("type", "hidden"), "Create an input and set the type." ); + + var j = jQuery("<span>hi</span> there <!-- mon ami -->"); + ok( j.length >= 2, "Check node,textnode,comment creation (some browsers delete comments)" ); + + ok( !jQuery("<option>test</option>")[0].selected, "Make sure that options are auto-selected #2050" ); + + ok( jQuery("<div></div>")[0], "Create a div with closing tag." ); + ok( jQuery("<table></table>")[0], "Create a table with closing tag." ); + + // Test very large html string #7990 + var i; + var li = "<li>very large html string</li>"; + var html = ["<ul>"]; + for ( i = 0; i < 50000; i += 1 ) { + html.push(li); + } + html.push("</ul>"); + html = jQuery(html.join(""))[0]; + equal( html.nodeName.toUpperCase(), "UL"); + equal( html.firstChild.nodeName.toUpperCase(), "LI"); + equal( html.childNodes.length, 50000 ); +}); + +test("jQuery('html', context)", function() { + expect(1); + + var $div = jQuery("<div/>")[0]; + var $span = jQuery("<span/>", $div); + equal($span.length, 1, "Verify a span created with a div context works, #1763"); +}); + +if ( !isLocal ) { +test("jQuery(selector, xml).text(str) - Loaded via XML document", function() { + expect(2); + stop(); + jQuery.get("data/dashboard.xml", function(xml) { + // tests for #1419 where IE was a problem + var tab = jQuery("tab", xml).eq(0); + equal( tab.text(), "blabla", "Verify initial text correct" ); + tab.text("newtext"); + equal( tab.text(), "newtext", "Verify new text correct" ); + start(); + }); +}); +} + +test("end()", function() { + expect(3); + equal( "Yahoo", jQuery("#yahoo").parent().end().text(), "Check for end" ); + ok( jQuery("#yahoo").end(), "Check for end with nothing to end" ); + + var x = jQuery("#yahoo"); + x.parent(); + equal( "Yahoo", jQuery("#yahoo").text(), "Check for non-destructive behaviour" ); +}); + +test("length", function() { + expect(1); + equal( jQuery("#qunit-fixture p").length, 6, "Get Number of Elements Found" ); +}); + +test("size()", function() { + expect(1); + equal( jQuery("#qunit-fixture p").size(), 6, "Get Number of Elements Found" ); +}); + +test("get()", function() { + expect(1); + deepEqual( jQuery("#qunit-fixture p").get(), q("firstp","ap","sndp","en","sap","first"), "Get All Elements" ); +}); + +test("toArray()", function() { + expect(1); + deepEqual( jQuery("#qunit-fixture p").toArray(), + q("firstp","ap","sndp","en","sap","first"), + "Convert jQuery object to an Array" ) +}) + +test("inArray()", function() { + expect(19); + + var selections = { + p: q("firstp", "sap", "ap", "first"), + em: q("siblingnext", "siblingfirst"), + div: q("qunit-testrunner-toolbar", "nothiddendiv", "nothiddendivchild", "foo"), + a: q("mark", "groups", "google", "simon1"), + empty: [] + }, + tests = { + p: { elem: jQuery("#ap")[0], index: 2 }, + em: { elem: jQuery("#siblingfirst")[0], index: 1 }, + div: { elem: jQuery("#nothiddendiv")[0], index: 1 }, + a: { elem: jQuery("#simon1")[0], index: 3 } + }, + falseTests = { + p: jQuery("#liveSpan1")[0], + em: jQuery("#nothiddendiv")[0], + empty: "" + }; + + jQuery.each( tests, function( key, obj ) { + equal( jQuery.inArray( obj.elem, selections[ key ] ), obj.index, "elem is in the array of selections of its tag" ); + // Third argument (fromIndex) + equal( !!~jQuery.inArray( obj.elem, selections[ key ], 5 ), false, "elem is NOT in the array of selections given a starting index greater than its position" ); + equal( !!~jQuery.inArray( obj.elem, selections[ key ], 1 ), true, "elem is in the array of selections given a starting index less than or equal to its position" ); + equal( !!~jQuery.inArray( obj.elem, selections[ key ], -3 ), true, "elem is in the array of selections given a negative index" ); + }); + + jQuery.each( falseTests, function( key, elem ) { + equal( !!~jQuery.inArray( elem, selections[ key ] ), false, "elem is NOT in the array of selections" ); + }); + +}); + +test("get(Number)", function() { + expect(2); + equal( jQuery("#qunit-fixture p").get(0), document.getElementById("firstp"), "Get A Single Element" ); + strictEqual( jQuery("#firstp").get(1), undefined, "Try get with index larger elements count" ); +}); + +test("get(-Number)",function() { + expect(2); + equal( jQuery("p").get(-1), document.getElementById("first"), "Get a single element with negative index" ); + strictEqual( jQuery("#firstp").get(-2), undefined, "Try get with index negative index larger then elements count" ); +}) + +test("each(Function)", function() { + expect(1); + var div = jQuery("div"); + div.each(function(){this.foo = "zoo";}); + var pass = true; + for ( var i = 0; i < div.size(); i++ ) { + if ( div.get(i).foo != "zoo" ) pass = false; + } + ok( pass, "Execute a function, Relative" ); +}); + +test("slice()", function() { + expect(7); + + var $links = jQuery("#ap a"); + + deepEqual( $links.slice(1,2).get(), q("groups"), "slice(1,2)" ); + deepEqual( $links.slice(1).get(), q("groups", "anchor1", "mark"), "slice(1)" ); + deepEqual( $links.slice(0,3).get(), q("google", "groups", "anchor1"), "slice(0,3)" ); + deepEqual( $links.slice(-1).get(), q("mark"), "slice(-1)" ); + + deepEqual( $links.eq(1).get(), q("groups"), "eq(1)" ); + deepEqual( $links.eq("2").get(), q("anchor1"), "eq('2')" ); + deepEqual( $links.eq(-1).get(), q("mark"), "eq(-1)" ); +}); + +test("first()/last()", function() { + expect(4); + + var $links = jQuery("#ap a"), $none = jQuery("asdf"); + + deepEqual( $links.first().get(), q("google"), "first()" ); + deepEqual( $links.last().get(), q("mark"), "last()" ); + + deepEqual( $none.first().get(), [], "first() none" ); + deepEqual( $none.last().get(), [], "last() none" ); +}); + +test("map()", function() { + expect(8); + + deepEqual( + jQuery("#ap").map(function(){ + return jQuery(this).find("a").get(); + }).get(), + q("google", "groups", "anchor1", "mark"), + "Array Map" + ); + + deepEqual( + jQuery("#ap > a").map(function(){ + return this.parentNode; + }).get(), + q("ap","ap","ap"), + "Single Map" + ); + + //for #2616 + var keys = jQuery.map( {a:1,b:2}, function( v, k ){ + return k; + }); + equal( keys.join(""), "ab", "Map the keys from a hash to an array" ); + + var values = jQuery.map( {a:1,b:2}, function( v, k ){ + return v; + }); + equal( values.join(""), "12", "Map the values from a hash to an array" ); + + // object with length prop + var values = jQuery.map( {a:1,b:2, length:3}, function( v, k ){ + return v; + }); + equal( values.join(""), "123", "Map the values from a hash with a length property to an array" ); + + var scripts = document.getElementsByTagName("script"); + var mapped = jQuery.map( scripts, function( v, k ){ + return v; + }); + equal( mapped.length, scripts.length, "Map an array(-like) to a hash" ); + + var nonsense = document.getElementsByTagName("asdf"); + var mapped = jQuery.map( nonsense, function( v, k ){ + return v; + }); + equal( mapped.length, nonsense.length, "Map an empty array(-like) to a hash" ); + + var flat = jQuery.map( Array(4), function( v, k ){ + return k % 2 ? k : [k,k,k];//try mixing array and regular returns + }); + equal( flat.join(""), "00012223", "try the new flatten technique(#2616)" ); +}); + +test("jQuery.merge()", function() { + expect(8); + + var parse = jQuery.merge; + + deepEqual( parse([],[]), [], "Empty arrays" ); + + deepEqual( parse([1],[2]), [1,2], "Basic" ); + deepEqual( parse([1,2],[3,4]), [1,2,3,4], "Basic" ); + + deepEqual( parse([1,2],[]), [1,2], "Second empty" ); + deepEqual( parse([],[1,2]), [1,2], "First empty" ); + + // Fixed at [5998], #3641 + deepEqual( parse([-2,-1], [0,1,2]), [-2,-1,0,1,2], "Second array including a zero (falsy)"); + + // After fixing #5527 + deepEqual( parse([], [null, undefined]), [null, undefined], "Second array including null and undefined values"); + deepEqual( parse({length:0}, [1,2]), {length:2, 0:1, 1:2}, "First array like"); +}); + +test("jQuery.extend(Object, Object)", function() { + expect(28); + + var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, + options = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, + optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, + merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "x", xxx: "newstring" }, + deep1 = { foo: { bar: true } }, + deep1copy = { foo: { bar: true } }, + deep2 = { foo: { baz: true }, foo2: document }, + deep2copy = { foo: { baz: true }, foo2: document }, + deepmerged = { foo: { bar: true, baz: true }, foo2: document }, + arr = [1, 2, 3], + nestedarray = { arr: arr }; + + jQuery.extend(settings, options); + deepEqual( settings, merged, "Check if extended: settings must be extended" ); + deepEqual( options, optionsCopy, "Check if not modified: options must not be modified" ); + + jQuery.extend(settings, null, options); + deepEqual( settings, merged, "Check if extended: settings must be extended" ); + deepEqual( options, optionsCopy, "Check if not modified: options must not be modified" ); + + jQuery.extend(true, deep1, deep2); + deepEqual( deep1.foo, deepmerged.foo, "Check if foo: settings must be extended" ); + deepEqual( deep2.foo, deep2copy.foo, "Check if not deep2: options must not be modified" ); + equal( deep1.foo2, document, "Make sure that a deep clone was not attempted on the document" ); + + ok( jQuery.extend(true, {}, nestedarray).arr !== arr, "Deep extend of object must clone child array" ); + + // #5991 + ok( jQuery.isArray( jQuery.extend(true, { arr: {} }, nestedarray).arr ), "Cloned array heve to be an Array" ); + ok( jQuery.isPlainObject( jQuery.extend(true, { arr: arr }, { arr: {} }).arr ), "Cloned object heve to be an plain object" ); + + var empty = {}; + var optionsWithLength = { foo: { length: -1 } }; + jQuery.extend(true, empty, optionsWithLength); + deepEqual( empty.foo, optionsWithLength.foo, "The length property must copy correctly" ); + + empty = {}; + var optionsWithDate = { foo: { date: new Date } }; + jQuery.extend(true, empty, optionsWithDate); + deepEqual( empty.foo, optionsWithDate.foo, "Dates copy correctly" ); + + var myKlass = function() {}; + var customObject = new myKlass(); + var optionsWithCustomObject = { foo: { date: customObject } }; + empty = {}; + jQuery.extend(true, empty, optionsWithCustomObject); + ok( empty.foo && empty.foo.date === customObject, "Custom objects copy correctly (no methods)" ); + + // Makes the class a little more realistic + myKlass.prototype = { someMethod: function(){} }; + empty = {}; + jQuery.extend(true, empty, optionsWithCustomObject); + ok( empty.foo && empty.foo.date === customObject, "Custom objects copy correctly" ); + + var ret = jQuery.extend(true, { foo: 4 }, { foo: new Number(5) } ); + ok( ret.foo == 5, "Wrapped numbers copy correctly" ); + + var nullUndef; + nullUndef = jQuery.extend({}, options, { xnumber2: null }); + ok( nullUndef.xnumber2 === null, "Check to make sure null values are copied"); + + nullUndef = jQuery.extend({}, options, { xnumber2: undefined }); + ok( nullUndef.xnumber2 === options.xnumber2, "Check to make sure undefined values are not copied"); + + nullUndef = jQuery.extend({}, options, { xnumber0: null }); + ok( nullUndef.xnumber0 === null, "Check to make sure null values are inserted"); + + var target = {}; + var recursive = { foo:target, bar:5 }; + jQuery.extend(true, target, recursive); + deepEqual( target, { bar:5 }, "Check to make sure a recursive obj doesn't go never-ending loop by not copying it over" ); + + var ret = jQuery.extend(true, { foo: [] }, { foo: [0] } ); // 1907 + equal( ret.foo.length, 1, "Check to make sure a value with coersion 'false' copies over when necessary to fix #1907" ); + + var ret = jQuery.extend(true, { foo: "1,2,3" }, { foo: [1, 2, 3] } ); + ok( typeof ret.foo != "string", "Check to make sure values equal with coersion (but not actually equal) overwrite correctly" ); + + var ret = jQuery.extend(true, { foo:"bar" }, { foo:null } ); + ok( typeof ret.foo !== "undefined", "Make sure a null value doesn't crash with deep extend, for #1908" ); + + var obj = { foo:null }; + jQuery.extend(true, obj, { foo:"notnull" } ); + equal( obj.foo, "notnull", "Make sure a null value can be overwritten" ); + + function func() {} + jQuery.extend(func, { key: "value" } ); + equal( func.key, "value", "Verify a function can be extended" ); + + var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, + defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, + options1 = { xnumber2: 1, xstring2: "x" }, + options1Copy = { xnumber2: 1, xstring2: "x" }, + options2 = { xstring2: "xx", xxx: "newstringx" }, + options2Copy = { xstring2: "xx", xxx: "newstringx" }, + merged2 = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" }; + + var settings = jQuery.extend({}, defaults, options1, options2); + deepEqual( settings, merged2, "Check if extended: settings must be extended" ); + deepEqual( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" ); + deepEqual( options1, options1Copy, "Check if not modified: options1 must not be modified" ); + deepEqual( options2, options2Copy, "Check if not modified: options2 must not be modified" ); +}); + +test("jQuery.each(Object,Function)", function() { + expect(14); + jQuery.each( [0,1,2], function(i, n){ + equal( i, n, "Check array iteration" ); + }); + + jQuery.each( [5,6,7], function(i, n){ + equal( i, n - 5, "Check array iteration" ); + }); + + jQuery.each( { name: "name", lang: "lang" }, function(i, n){ + equal( i, n, "Check object iteration" ); + }); + + var total = 0; + jQuery.each([1,2,3], function(i,v){ total += v; }); + equal( total, 6, "Looping over an array" ); + total = 0; + jQuery.each([1,2,3], function(i,v){ total += v; if ( i == 1 ) return false; }); + equal( total, 3, "Looping over an array, with break" ); + total = 0; + jQuery.each({"a":1,"b":2,"c":3}, function(i,v){ total += v; }); + equal( total, 6, "Looping over an object" ); + total = 0; + jQuery.each({"a":3,"b":3,"c":3}, function(i,v){ total += v; return false; }); + equal( total, 3, "Looping over an object, with break" ); + + var f = function(){}; + f.foo = "bar"; + jQuery.each(f, function(i){ + f[i] = "baz"; + }); + equal( "baz", f.foo, "Loop over a function" ); + + var stylesheet_count = 0; + jQuery.each(document.styleSheets, function(i){ + stylesheet_count++; + }); + //html5shiv may add 1-2 stylesheets + ok(stylesheet_count > 1 && stylesheet_count < 5, "should not throw an error in IE while looping over document.styleSheets and return proper amount"); + +}); + +test("jQuery.makeArray", function(){ + expect(17); + + equal( jQuery.makeArray(jQuery("html>*"))[0].nodeName.toUpperCase(), "HEAD", "Pass makeArray a jQuery object" ); + + equal( jQuery.makeArray(document.getElementsByName("PWD")).slice(0,1)[0].name, "PWD", "Pass makeArray a nodelist" ); + + equal( (function(){ return jQuery.makeArray(arguments); })(1,2).join(""), "12", "Pass makeArray an arguments array" ); + + equal( jQuery.makeArray([1,2,3]).join(""), "123", "Pass makeArray a real array" ); + + equal( jQuery.makeArray().length, 0, "Pass nothing to makeArray and expect an empty array" ); + + equal( jQuery.makeArray( 0 )[0], 0 , "Pass makeArray a number" ); + + equal( jQuery.makeArray( "foo" )[0], "foo", "Pass makeArray a string" ); + + equal( jQuery.makeArray( true )[0].constructor, Boolean, "Pass makeArray a boolean" ); + + equal( jQuery.makeArray( document.createElement("div") )[0].nodeName.toUpperCase(), "DIV", "Pass makeArray a single node" ); + + equal( jQuery.makeArray( {length:2, 0:"a", 1:"b"} ).join(""), "ab", "Pass makeArray an array like map (with length)" ); + + ok( !!jQuery.makeArray( document.documentElement.childNodes ).slice(0,1)[0].nodeName, "Pass makeArray a childNodes array" ); + + // function, is tricky as it has length + equal( jQuery.makeArray( function(){ return 1;} )[0](), 1, "Pass makeArray a function" ); + + //window, also has length + equal( jQuery.makeArray(window)[0], window, "Pass makeArray the window" ); + + equal( jQuery.makeArray(/a/)[0].constructor, RegExp, "Pass makeArray a regex" ); + + ok( jQuery.makeArray(document.getElementById("form")).length >= 13, "Pass makeArray a form (treat as elements)" ); + + // For #5610 + deepEqual( jQuery.makeArray({length: "0"}), [], "Make sure object is coerced properly."); + deepEqual( jQuery.makeArray({length: "5"}), [], "Make sure object is coerced properly."); +}); + +test("jQuery.inArray", function(){ + expect(3); + + equal( jQuery.inArray( 0, false ), -1 , "Search in 'false' as array returns -1 and doesn't throw exception" ); + + equal( jQuery.inArray( 0, null ), -1 , "Search in 'null' as array returns -1 and doesn't throw exception" ); + + equal( jQuery.inArray( 0, undefined ), -1 , "Search in 'undefined' as array returns -1 and doesn't throw exception" ); +}); + +test("jQuery.isEmptyObject", function(){ + expect(2); + + equal(true, jQuery.isEmptyObject({}), "isEmptyObject on empty object literal" ); + equal(false, jQuery.isEmptyObject({a:1}), "isEmptyObject on non-empty object literal" ); + + // What about this ? + // equal(true, jQuery.isEmptyObject(null), "isEmptyObject on null" ); +}); + +test("jQuery.proxy", function(){ + expect(7); + + var test = function(){ equal( this, thisObject, "Make sure that scope is set properly." ); }; + var thisObject = { foo: "bar", method: test }; + + // Make sure normal works + test.call( thisObject ); + + // Basic scoping + jQuery.proxy( test, thisObject )(); + + // Another take on it + jQuery.proxy( thisObject, "method" )(); + + // Make sure it doesn't freak out + equal( jQuery.proxy( null, thisObject ), undefined, "Make sure no function was returned." ); + + // Partial application + var test2 = function( a ){ equal( a, "pre-applied", "Ensure arguments can be pre-applied." ); }; + jQuery.proxy( test2, null, "pre-applied" )(); + + // Partial application w/ normal arguments + var test3 = function( a, b ){ equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." ); }; + jQuery.proxy( test3, null, "pre-applied" )( "normal" ); + + // Test old syntax + var test4 = { meth: function( a ){ equal( a, "boom", "Ensure old syntax works." ); } }; + jQuery.proxy( test4, "meth" )( "boom" ); +}); + +test("jQuery.parseJSON", function(){ + expect(8); + + equal( jQuery.parseJSON(), null, "Nothing in, null out." ); + equal( jQuery.parseJSON( null ), null, "Nothing in, null out." ); + equal( jQuery.parseJSON( "" ), null, "Nothing in, null out." ); + + deepEqual( jQuery.parseJSON("{}"), {}, "Plain object parsing." ); + deepEqual( jQuery.parseJSON("{\"test\":1}"), {"test":1}, "Plain object parsing." ); + + deepEqual( jQuery.parseJSON("\n{\"test\":1}"), {"test":1}, "Make sure leading whitespaces are handled." ); + + try { + jQuery.parseJSON("{a:1}"); + ok( false, "Test malformed JSON string." ); + } catch( e ) { + ok( true, "Test malformed JSON string." ); + } + + try { + jQuery.parseJSON("{'a':1}"); + ok( false, "Test malformed JSON string." ); + } catch( e ) { + ok( true, "Test malformed JSON string." ); + } +}); + +test("jQuery.parseXML", 4, function(){ + var xml, tmp; + try { + xml = jQuery.parseXML( "<p>A <b>well-formed</b> xml string</p>" ); + tmp = xml.getElementsByTagName( "p" )[ 0 ]; + ok( !!tmp, "<p> present in document" ); + tmp = tmp.getElementsByTagName( "b" )[ 0 ]; + ok( !!tmp, "<b> present in document" ); + strictEqual( tmp.childNodes[ 0 ].nodeValue, "well-formed", "<b> text is as expected" ); + } catch (e) { + strictEqual( e, undefined, "unexpected error" ); + } + try { + xml = jQuery.parseXML( "<p>Not a <<b>well-formed</b> xml string</p>" ); + ok( false, "invalid xml not detected" ); + } catch( e ) { + strictEqual( e.message, "Invalid XML: <p>Not a <<b>well-formed</b> xml string</p>", "invalid xml detected" ); + } +}); + +test("jQuery.sub() - Static Methods", function(){ + expect(18); + var Subclass = jQuery.sub(); + Subclass.extend({ + topLevelMethod: function() {return this.debug;}, + debug: false, + config: { + locale: "en_US" + }, + setup: function(config) { + this.extend(true, this.config, config); + } + }); + Subclass.fn.extend({subClassMethod: function() { return this;}}); + + //Test Simple Subclass + ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true"); + ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!"); + deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly"); + equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods"); + + //Create a SubSubclass + var SubSubclass = Subclass.sub(); + + //Make Sure the SubSubclass inherited properly + ok(SubSubclass.topLevelMethod() === false, "SubSubclass.topLevelMethod thought debug was true"); + ok(SubSubclass.config.locale == "en_US", SubSubclass.config.locale + " is wrong!"); + deepEqual(SubSubclass.config.test, undefined, "SubSubclass.config.test is set incorrectly"); + equal(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods"); + + //Modify The Subclass and test the Modifications + SubSubclass.fn.extend({subSubClassMethod: function() { return this;}}); + SubSubclass.setup({locale: "es_MX", test: "worked"}); + SubSubclass.debug = true; + SubSubclass.ajax = function() {return false;}; + ok(SubSubclass.topLevelMethod(), "SubSubclass.topLevelMethod thought debug was false"); + deepEqual(SubSubclass(document).subClassMethod, Subclass.fn.subClassMethod, "Methods Differ!"); + ok(SubSubclass.config.locale == "es_MX", SubSubclass.config.locale + " is wrong!"); + ok(SubSubclass.config.test == "worked", "SubSubclass.config.test is set incorrectly"); + notEqual(jQuery.ajax, SubSubclass.ajax, "The subsubclass failed to get all top level methods"); + + //This shows that the modifications to the SubSubClass did not bubble back up to it's superclass + ok(Subclass.topLevelMethod() === false, "Subclass.topLevelMethod thought debug was true"); + ok(Subclass.config.locale == "en_US", Subclass.config.locale + " is wrong!"); + deepEqual(Subclass.config.test, undefined, "Subclass.config.test is set incorrectly"); + deepEqual(Subclass(document).subSubClassMethod, undefined, "subSubClassMethod set incorrectly"); + equal(jQuery.ajax, Subclass.ajax, "The subclass failed to get all top level methods"); +}); + +test("jQuery.sub() - .fn Methods", function(){ + expect(378); + + var Subclass = jQuery.sub(), + SubclassSubclass = Subclass.sub(), + jQueryDocument = jQuery(document), + selectors, contexts, methods, method, arg, description; + + jQueryDocument.toString = function(){ return "jQueryDocument"; }; + + Subclass.fn.subclassMethod = function(){}; + SubclassSubclass.fn.subclassSubclassMethod = function(){}; + + selectors = [ + "body", + "html, body", + "<div></div>" + ]; + + methods = [ // all methods that return a new jQuery instance + ["eq", 1], + ["add", document], + ["end"], + ["has"], + ["closest", "div"], + ["filter", document], + ["find", "div"] + ]; + + contexts = [undefined, document, jQueryDocument]; + + jQuery.each(selectors, function(i, selector){ + + jQuery.each(methods, function(){ + method = this[0]; + arg = this[1]; + + jQuery.each(contexts, function(i, context){ + + description = "(\""+selector+"\", "+context+")."+method+"("+(arg||"")+")"; + + deepEqual( + jQuery(selector, context)[method](arg).subclassMethod, undefined, + "jQuery"+description+" doesn't have Subclass methods" + ); + deepEqual( + jQuery(selector, context)[method](arg).subclassSubclassMethod, undefined, + "jQuery"+description+" doesn't have SubclassSubclass methods" + ); + deepEqual( + Subclass(selector, context)[method](arg).subclassMethod, Subclass.fn.subclassMethod, + "Subclass"+description+" has Subclass methods" + ); + deepEqual( + Subclass(selector, context)[method](arg).subclassSubclassMethod, undefined, + "Subclass"+description+" doesn't have SubclassSubclass methods" + ); + deepEqual( + SubclassSubclass(selector, context)[method](arg).subclassMethod, Subclass.fn.subclassMethod, + "SubclassSubclass"+description+" has Subclass methods" + ); + deepEqual( + SubclassSubclass(selector, context)[method](arg).subclassSubclassMethod, SubclassSubclass.fn.subclassSubclassMethod, + "SubclassSubclass"+description+" has SubclassSubclass methods" + ); + + }); + }); + }); + +}); + +test("jQuery.camelCase()", function() { + + var tests = { + "foo-bar": "fooBar", + "foo-bar-baz": "fooBarBaz", + "girl-u-want": "girlUWant", + "the-4th-dimension": "the4thDimension", + "-o-tannenbaum": "OTannenbaum", + "-moz-illa": "MozIlla", + "-ms-take": "msTake" + }; + + expect(7); + + jQuery.each( tests, function( key, val ) { + equal( jQuery.camelCase( key ), val, "Converts: " + key + " => " + val ); + }); +}); diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/manipulation.js b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/manipulation.js new file mode 100644 index 0000000..6b4a9e0 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/manipulation.js @@ -0,0 +1,1701 @@ +module("manipulation", { teardown: moduleTeardown }); + +// Ensure that an extended Array prototype doesn't break jQuery +Array.prototype.arrayProtoFn = function(arg) { throw("arrayProtoFn should not be called"); }; + +var bareObj = function(value) { return value; }; +var functionReturningObj = function(value) { return (function() { return value; }); }; + +test("text()", function() { + expect(3); + var expected = "This link has class=\"blog\": Simon Willison's Weblog"; + equal( jQuery("#sap").text(), expected, "Check for merged text of more then one element." ); + + // Check serialization of text values + equal( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." ); + notEqual( jQuery(document).text(), "", "Retrieving text for the document retrieves all text (#10724)."); +}); + +var testText = function(valueObj) { + expect(4); + var val = valueObj("<div><b>Hello</b> cruel world!</div>"); + equal( jQuery("#foo").text(val)[0].innerHTML.replace(/>/g, ">"), "<div><b>Hello</b> cruel world!</div>", "Check escaped text" ); + + // using contents will get comments regular, text, and comment nodes + var j = jQuery("#nonnodes").contents(); + j.text(valueObj("hi!")); + equal( jQuery(j[0]).text(), "hi!", "Check node,textnode,comment with text()" ); + equal( j[1].nodeValue, " there ", "Check node,textnode,comment with text()" ); + + // Blackberry 4.6 doesn't maintain comments in the DOM + equal( jQuery("#nonnodes")[0].childNodes.length < 3 ? 8 : j[2].nodeType, 8, "Check node,textnode,comment with text()" ); +}; + +test("text(String)", function() { + testText(bareObj); +}); + +test("text(Function)", function() { + testText(functionReturningObj); +}); + +test("text(Function) with incoming value", function() { + expect(2); + + var old = "This link has class=\"blog\": Simon Willison's Weblog"; + + jQuery("#sap").text(function(i, val) { + equal( val, old, "Make sure the incoming value is correct." ); + return "foobar"; + }); + + equal( jQuery("#sap").text(), "foobar", "Check for merged text of more then one element." ); + + QUnit.reset(); +}); + +var testWrap = function(val) { + expect(19); + var defaultText = "Try them out:"; + var result = jQuery("#first").wrap(val( "<div class='red'><span></span></div>" )).text(); + equal( defaultText, result, "Check for wrapping of on-the-fly html" ); + ok( jQuery("#first").parent().parent().is(".red"), "Check if wrapper has class 'red'" ); + + QUnit.reset(); + result = jQuery("#first").wrap(val( document.getElementById("empty") )).parent(); + ok( result.is("ol"), "Check for element wrapping" ); + equal( result.text(), defaultText, "Check for element wrapping" ); + + QUnit.reset(); + jQuery("#check1").click(function() { + var checkbox = this; + ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" ); + jQuery(checkbox).wrap(val( "<div id='c1' style='display:none;'></div>" )); + ok( checkbox.checked, "Checkbox's state is erased after wrap() action, see #769" ); + }).click(); + + // using contents will get comments regular, text, and comment nodes + var j = jQuery("#nonnodes").contents(); + j.wrap(val( "<i></i>" )); + + // Blackberry 4.6 doesn't maintain comments in the DOM + equal( jQuery("#nonnodes > i").length, jQuery("#nonnodes")[0].childNodes.length, "Check node,textnode,comment wraps ok" ); + equal( jQuery("#nonnodes > i").text(), j.text(), "Check node,textnode,comment wraps doesn't hurt text" ); + + // Try wrapping a disconnected node + var cacheLength = 0; + for (var i in jQuery.cache) { + cacheLength++; + } + + j = jQuery("<label/>").wrap(val( "<li/>" )); + equal( j[0].nodeName.toUpperCase(), "LABEL", "Element is a label" ); + equal( j[0].parentNode.nodeName.toUpperCase(), "LI", "Element has been wrapped" ); + + for (i in jQuery.cache) { + cacheLength--; + } + equal(cacheLength, 0, "No memory leak in jQuery.cache (bug #7165)"); + + // Wrap an element containing a text node + j = jQuery("<span/>").wrap("<div>test</div>"); + equal( j[0].previousSibling.nodeType, 3, "Make sure the previous node is a text element" ); + equal( j[0].parentNode.nodeName.toUpperCase(), "DIV", "And that we're in the div element." ); + + // Try to wrap an element with multiple elements (should fail) + j = jQuery("<div><span></span></div>").children().wrap("<p></p><div></div>"); + equal( j[0].parentNode.parentNode.childNodes.length, 1, "There should only be one element wrapping." ); + equal( j.length, 1, "There should only be one element (no cloning)." ); + equal( j[0].parentNode.nodeName.toUpperCase(), "P", "The span should be in the paragraph." ); + + // Wrap an element with a jQuery set + j = jQuery("<span/>").wrap(jQuery("<div></div>")); + equal( j[0].parentNode.nodeName.toLowerCase(), "div", "Wrapping works." ); + + // Wrap an element with a jQuery set and event + result = jQuery("<div></div>").click(function(){ + ok(true, "Event triggered."); + + // Remove handlers on detached elements + result.unbind(); + jQuery(this).unbind(); + }); + + j = jQuery("<span/>").wrap(result); + equal( j[0].parentNode.nodeName.toLowerCase(), "div", "Wrapping works." ); + + j.parent().trigger("click"); + + // clean up attached elements + QUnit.reset(); +} + +test("wrap(String|Element)", function() { + testWrap(bareObj); +}); + +test("wrap(Function)", function() { + testWrap(functionReturningObj); +}); + +test("wrap(Function) with index (#10177)", function() { + var expectedIndex = 0, + targets = jQuery("#qunit-fixture p"); + + expect(targets.length); + targets.wrap(function(i) { + equal( i, expectedIndex, "Check if the provided index (" + i + ") is as expected (" + expectedIndex + ")" ); + expectedIndex++; + + return "<div id='wrap_index_'" + i + "'></div>"; + }); +}); + +test("wrap(String) consecutive elements (#10177)", function() { + var targets = jQuery("#qunit-fixture p"); + + expect(targets.length * 2); + targets.wrap("<div class='wrapper'></div>"); + + targets.each(function() { + var $this = jQuery(this); + + ok( $this.parent().is('.wrapper'), "Check each elements parent is correct (.wrapper)" ); + equal( $this.siblings().length, 0, "Each element should be wrapped individually" ); + }); +}); + +var testWrapAll = function(val) { + expect(8); + var prev = jQuery("#firstp")[0].previousSibling; + var p = jQuery("#firstp,#first")[0].parentNode; + + var result = jQuery("#firstp,#first").wrapAll(val( "<div class='red'><div class='tmp'></div></div>" )); + equal( result.parent().length, 1, "Check for wrapping of on-the-fly html" ); + ok( jQuery("#first").parent().parent().is(".red"), "Check if wrapper has class 'red'" ); + ok( jQuery("#firstp").parent().parent().is(".red"), "Check if wrapper has class 'red'" ); + equal( jQuery("#first").parent().parent()[0].previousSibling, prev, "Correct Previous Sibling" ); + equal( jQuery("#first").parent().parent()[0].parentNode, p, "Correct Parent" ); + + QUnit.reset(); + var prev = jQuery("#firstp")[0].previousSibling; + var p = jQuery("#first")[0].parentNode; + var result = jQuery("#firstp,#first").wrapAll(val( document.getElementById("empty") )); + equal( jQuery("#first").parent()[0], jQuery("#firstp").parent()[0], "Same Parent" ); + equal( jQuery("#first").parent()[0].previousSibling, prev, "Correct Previous Sibling" ); + equal( jQuery("#first").parent()[0].parentNode, p, "Correct Parent" ); +} + +test("wrapAll(String|Element)", function() { + testWrapAll(bareObj); +}); + +var testWrapInner = function(val) { + expect(11); + var num = jQuery("#first").children().length; + var result = jQuery("#first").wrapInner(val("<div class='red'><div id='tmp'></div></div>")); + equal( jQuery("#first").children().length, 1, "Only one child" ); + ok( jQuery("#first").children().is(".red"), "Verify Right Element" ); + equal( jQuery("#first").children().children().children().length, num, "Verify Elements Intact" ); + + QUnit.reset(); + var num = jQuery("#first").html("foo<div>test</div><div>test2</div>").children().length; + var result = jQuery("#first").wrapInner(val("<div class='red'><div id='tmp'></div></div>")); + equal( jQuery("#first").children().length, 1, "Only one child" ); + ok( jQuery("#first").children().is(".red"), "Verify Right Element" ); + equal( jQuery("#first").children().children().children().length, num, "Verify Elements Intact" ); + + QUnit.reset(); + var num = jQuery("#first").children().length; + var result = jQuery("#first").wrapInner(val(document.getElementById("empty"))); + equal( jQuery("#first").children().length, 1, "Only one child" ); + ok( jQuery("#first").children().is("#empty"), "Verify Right Element" ); + equal( jQuery("#first").children().children().length, num, "Verify Elements Intact" ); + + var div = jQuery("<div/>"); + div.wrapInner(val("<span></span>")); + equal(div.children().length, 1, "The contents were wrapped."); + equal(div.children()[0].nodeName.toLowerCase(), "span", "A span was inserted."); +} + +test("wrapInner(String|Element)", function() { + testWrapInner(bareObj); +}); + +test("wrapInner(Function)", function() { + testWrapInner(functionReturningObj) +}); + +test("unwrap()", function() { + expect(9); + + jQuery("body").append(" <div id='unwrap' style='display: none;'> <div id='unwrap1'> <span class='unwrap'>a</span> <span class='unwrap'>b</span> </div> <div id='unwrap2'> <span class='unwrap'>c</span> <span class='unwrap'>d</span> </div> <div id='unwrap3'> <b><span class='unwrap unwrap3'>e</span></b> <b><span class='unwrap unwrap3'>f</span></b> </div> </div>"); + + var abcd = jQuery("#unwrap1 > span, #unwrap2 > span").get(), + abcdef = jQuery("#unwrap span").get(); + + equal( jQuery("#unwrap1 span").add("#unwrap2 span:first").unwrap().length, 3, "make #unwrap1 and #unwrap2 go away" ); + deepEqual( jQuery("#unwrap > span").get(), abcd, "all four spans should still exist" ); + + deepEqual( jQuery("#unwrap3 span").unwrap().get(), jQuery("#unwrap3 > span").get(), "make all b in #unwrap3 go away" ); + + deepEqual( jQuery("#unwrap3 span").unwrap().get(), jQuery("#unwrap > span.unwrap3").get(), "make #unwrap3 go away" ); + + deepEqual( jQuery("#unwrap").children().get(), abcdef, "#unwrap only contains 6 child spans" ); + + deepEqual( jQuery("#unwrap > span").unwrap().get(), jQuery("body > span.unwrap").get(), "make the 6 spans become children of body" ); + + deepEqual( jQuery("body > span.unwrap").unwrap().get(), jQuery("body > span.unwrap").get(), "can't unwrap children of body" ); + deepEqual( jQuery("body > span.unwrap").unwrap().get(), abcdef, "can't unwrap children of body" ); + + deepEqual( jQuery("body > span.unwrap").get(), abcdef, "body contains 6 .unwrap child spans" ); + + jQuery("body > span.unwrap").remove(); +}); + +var testAppend = function(valueObj) { + expect(41); + var defaultText = "Try them out:" + var result = jQuery("#first").append(valueObj("<b>buga</b>")); + equal( result.text(), defaultText + "buga", "Check if text appending works" ); + equal( jQuery("#select3").append(valueObj("<option value='appendTest'>Append Test</option>")).find("option:last-child").attr("value"), "appendTest", "Appending html options to select element"); + + QUnit.reset(); + var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:"; + jQuery("#sap").append(valueObj(document.getElementById("first"))); + equal( jQuery("#sap").text(), expected, "Check for appending of element" ); + + QUnit.reset(); + expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; + jQuery("#sap").append(valueObj([document.getElementById("first"), document.getElementById("yahoo")])); + equal( jQuery("#sap").text(), expected, "Check for appending of array of elements" ); + + QUnit.reset(); + expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:"; + jQuery("#sap").append(valueObj(jQuery("#yahoo, #first"))); + equal( jQuery("#sap").text(), expected, "Check for appending of jQuery object" ); + + QUnit.reset(); + jQuery("#sap").append(valueObj( 5 )); + ok( jQuery("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" ); + + QUnit.reset(); + jQuery("#sap").append(valueObj( " text with spaces " )); + ok( jQuery("#sap")[0].innerHTML.match(/ text with spaces $/), "Check for appending text with spaces" ); + + QUnit.reset(); + ok( jQuery("#sap").append(valueObj( [] )), "Check for appending an empty array." ); + ok( jQuery("#sap").append(valueObj( "" )), "Check for appending an empty string." ); + ok( jQuery("#sap").append(valueObj( document.getElementsByTagName("foo") )), "Check for appending an empty nodelist." ); + + QUnit.reset(); + jQuery("form").append(valueObj("<input name='radiotest' type='radio' checked='checked' />")); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(":checked"), "Append checked radio"); + }).remove(); + + QUnit.reset(); + jQuery("form").append(valueObj("<input name='radiotest' type='radio' checked = 'checked' />")); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(":checked"), "Append alternately formated checked radio"); + }).remove(); + + QUnit.reset(); + jQuery("form").append(valueObj("<input name='radiotest' type='radio' checked />")); + jQuery("form input[name=radiotest]").each(function(){ + ok( jQuery(this).is(":checked"), "Append HTML5-formated checked radio"); + }).remove(); + + QUnit.reset(); + jQuery("#sap").append(valueObj( document.getElementById("form") )); + equal( jQuery("#sap>form").size(), 1, "Check for appending a form" ); // Bug #910 + + QUnit.reset(); + var pass = true; + try { + var body = jQuery("#iframe")[0].contentWindow.document.body; + + pass = false; + jQuery( body ).append(valueObj( "<div>test</div>" )); + pass = true; + } catch(e) {} + + ok( pass, "Test for appending a DOM node to the contents of an IFrame" ); + + QUnit.reset(); + jQuery("<fieldset/>").appendTo("#form").append(valueObj( "<legend id='legend'>test</legend>" )); + t( "Append legend", "#legend", ["legend"] ); + + QUnit.reset(); + jQuery("#select1").append(valueObj( "<OPTION>Test</OPTION>" )); + equal( jQuery("#select1 option:last").text(), "Test", "Appending <OPTION> (all caps)" ); + + jQuery("#table").append(valueObj( "<colgroup></colgroup>" )); + ok( jQuery("#table colgroup").length, "Append colgroup" ); + + jQuery("#table colgroup").append(valueObj( "<col/>" )); + ok( jQuery("#table colgroup col").length, "Append col" ); + + QUnit.reset(); + jQuery("#table").append(valueObj( "<caption></caption>" )); + ok( jQuery("#table caption").length, "Append caption" ); + + QUnit.reset(); + jQuery("form:last") + .append(valueObj( "<select id='appendSelect1'></select>" )) + .append(valueObj( "<select id='appendSelect2'><option>Test</option></select>" )); + + t( "Append Select", "#appendSelect1, #appendSelect2", ["appendSelect1", "appendSelect2"] ); + + equal( "Two nodes", jQuery("<div />").append("Two", " nodes").text(), "Appending two text nodes (#4011)" ); + + // using contents will get comments regular, text, and comment nodes + var j = jQuery("#nonnodes").contents(); + var d = jQuery("<div/>").appendTo("#nonnodes").append(j); + equal( jQuery("#nonnodes").length, 1, "Check node,textnode,comment append moved leaving just the div" ); + ok( d.contents().length >= 2, "Check node,textnode,comment append works" ); + d.contents().appendTo("#nonnodes"); + d.remove(); + ok( jQuery("#nonnodes").contents().length >= 2, "Check node,textnode,comment append cleanup worked" ); + + QUnit.reset(); + var $input = jQuery("<input />").attr({ "type": "checkbox", "checked": true }).appendTo('#testForm'); + equal( $input[0].checked, true, "A checked checkbox that is appended stays checked" ); + + QUnit.reset(); + var $radios = jQuery("input:radio[name='R1']"), + $radioNot = jQuery("<input type='radio' name='R1' checked='checked'/>").insertAfter( $radios ), + $radio = $radios.eq(1).click(); + $radioNot[0].checked = false; + $radios.parent().wrap("<div></div>"); + equal( $radio[0].checked, true, "Reappending radios uphold which radio is checked" ); + equal( $radioNot[0].checked, false, "Reappending radios uphold not being checked" ); + QUnit.reset(); + + var prev = jQuery("#sap").children().length; + + jQuery("#sap").append( + "<span></span>", + "<span></span>", + "<span></span>" + ); + + equal( jQuery("#sap").children().length, prev + 3, "Make sure that multiple arguments works." ); + QUnit.reset(); +} + +test("append(String|Element|Array<Element>|jQuery)", function() { + testAppend(bareObj); +}); + +test("append(Function)", function() { + testAppend(functionReturningObj); +}); + +test("append(Function) with incoming value", function() { + expect(12); + + var defaultText = "Try them out:", old = jQuery("#first").html(); + + var result = jQuery("#first").append(function(i, val){ + equal( val, old, "Make sure the incoming value is correct." ); + return "<b>buga</b>"; + }); + equal( result.text(), defaultText + "buga", "Check if text appending works" ); + + var select = jQuery("#select3"); + old = select.html(); + + equal( select.append(function(i, val){ + equal( val, old, "Make sure the incoming value is correct." ); + return "<option value='appendTest'>Append Test</option>"; + }).find("option:last-child").attr("value"), "appendTest", "Appending html options to select element"); + + QUnit.reset(); + var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:"; + old = jQuery("#sap").html(); + + jQuery("#sap").append(function(i, val){ + equal( val, old, "Make sure the incoming value is correct." ); + return document.getElementById("first"); + }); + equal( jQuery("#sap").text(), expected, "Check for appending of element" ); + + QUnit.reset(); + expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; + old = jQuery("#sap").html(); + + jQuery("#sap").append(function(i, val){ + equal( val, old, "Make sure the incoming value is correct." ); + return [document.getElementById("first"), document.getElementById("yahoo")]; + }); + equal( jQuery("#sap").text(), expected, "Check for appending of array of elements" ); + + QUnit.reset(); + expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:"; + old = jQuery("#sap").html(); + + jQuery("#sap").append(function(i, val){ + equal( val, old, "Make sure the incoming value is correct." ); + return jQuery("#yahoo, #first"); + }); + equal( jQuery("#sap").text(), expected, "Check for appending of jQuery object" ); + + QUnit.reset(); + old = jQuery("#sap").html(); + + jQuery("#sap").append(function(i, val){ + equal( val, old, "Make sure the incoming value is correct." ); + return 5; + }); + ok( jQuery("#sap")[0].innerHTML.match( /5$/ ), "Check for appending a number" ); + + QUnit.reset(); +}); + +test("append the same fragment with events (Bug #6997, 5566)", function () { + var doExtra = !jQuery.support.noCloneEvent && document.fireEvent; + expect(2 + (doExtra ? 1 : 0)); + stop(); + + var element; + + // This patch modified the way that cloning occurs in IE; we need to make sure that + // native event handlers on the original object don't get disturbed when they are + // modified on the clone + if ( doExtra ) { + element = jQuery("div:first").click(function () { + ok(true, "Event exists on original after being unbound on clone"); + jQuery(this).unbind("click"); + }); + var clone = element.clone(true).unbind("click"); + clone[0].fireEvent("onclick"); + element[0].fireEvent("onclick"); + + // manually clean up detached elements + clone.remove(); + } + + element = jQuery("<a class='test6997'></a>").click(function () { + ok(true, "Append second element events work"); + }); + + jQuery("#listWithTabIndex li").append(element) + .find("a.test6997").eq(1).click(); + + element = jQuery("<li class='test6997'></li>").click(function () { + ok(true, "Before second element events work"); + start(); + }); + + jQuery("#listWithTabIndex li").before(element); + jQuery("#listWithTabIndex li.test6997").eq(1).click(); +}); + +test("append HTML5 sectioning elements (Bug #6485)", function () { + expect(2); + + jQuery("#qunit-fixture").append("<article style='font-size:10px'><section><aside>HTML5 elements</aside></section></article>"); + + var article = jQuery("article"), + aside = jQuery("aside"); + + equal( article.css("fontSize"), "10px", "HTML5 elements are styleable"); + equal( aside.length, 1, "HTML5 elements do not collapse their children") +}); + +test("HTML5 Elements inherit styles from style rules (Bug #10501)", function () { + expect(1); + + jQuery("#qunit-fixture").append("<article id='article'></article>"); + jQuery("#article").append("<section>This section should have a pink background.</section>"); + + // In IE, the missing background color will claim its value is "transparent" + notEqual( jQuery("section").css("background-color"), "transparent", "HTML5 elements inherit styles"); +}); + +test("html5 clone() cannot use the fragment cache in IE (#6485)", function () { + expect(1); + + jQuery("<article><section><aside>HTML5 elements</aside></section></article>").appendTo("#qunit-fixture"); + + var clone = jQuery("article").clone(); + + jQuery("#qunit-fixture").append( clone ); + + equal( jQuery("aside").length, 2, "clone()ing HTML5 elems does not collapse them" ); +}); + +test("html(String) with HTML5 (Bug #6485)", function() { + expect(2); + + jQuery("#qunit-fixture").html("<article><section><aside>HTML5 elements</aside></section></article>"); + equal( jQuery("#qunit-fixture").children().children().length, 1, "Make sure HTML5 article elements can hold children. innerHTML shortcut path" ); + equal( jQuery("#qunit-fixture").children().children().children().length, 1, "Make sure nested HTML5 elements can hold children." ); +}); + +test("append(xml)", function() { + expect( 1 ); + + function createXMLDoc() { + // Initialize DOM based upon latest installed MSXML or Netscape + var elem, + aActiveX = + [ "MSXML6.DomDocument", + "MSXML3.DomDocument", + "MSXML2.DomDocument", + "MSXML.DomDocument", + "Microsoft.XmlDom" ]; + + if ( document.implementation && "createDocument" in document.implementation ) { + return document.implementation.createDocument( "", "", null ); + } else { + // IE + for ( var n = 0, len = aActiveX.length; n < len; n++ ) { + try { + elem = new ActiveXObject( aActiveX[ n ] ); + return elem; + } catch(_){}; + } + } + } + + var xmlDoc = createXMLDoc(), + xml1 = xmlDoc.createElement("head"), + xml2 = xmlDoc.createElement("test"); + + ok( jQuery( xml1 ).append( xml2 ), "Append an xml element to another without raising an exception." ); + +}); + +test("appendTo(String|Element|Array<Element>|jQuery)", function() { + expect(17); + + var defaultText = "Try them out:" + jQuery("<b>buga</b>").appendTo("#first"); + equal( jQuery("#first").text(), defaultText + "buga", "Check if text appending works" ); + equal( jQuery("<option value='appendTest'>Append Test</option>").appendTo("#select3").parent().find("option:last-child").attr("value"), "appendTest", "Appending html options to select element"); + + QUnit.reset(); + var l = jQuery("#first").children().length + 2; + jQuery("<strong>test</strong>"); + jQuery("<strong>test</strong>"); + jQuery([ jQuery("<strong>test</strong>")[0], jQuery("<strong>test</strong>")[0] ]) + .appendTo("#first"); + equal( jQuery("#first").children().length, l, "Make sure the elements were inserted." ); + equal( jQuery("#first").children().last()[0].nodeName.toLowerCase(), "strong", "Verify the last element." ); + + QUnit.reset(); + var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:"; + jQuery(document.getElementById("first")).appendTo("#sap"); + equal( jQuery("#sap").text(), expected, "Check for appending of element" ); + + QUnit.reset(); + expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; + jQuery([document.getElementById("first"), document.getElementById("yahoo")]).appendTo("#sap"); + equal( jQuery("#sap").text(), expected, "Check for appending of array of elements" ); + + QUnit.reset(); + ok( jQuery(document.createElement("script")).appendTo("body").length, "Make sure a disconnected script can be appended." ); + + QUnit.reset(); + expected = "This link has class=\"blog\": Simon Willison's WeblogYahooTry them out:"; + jQuery("#yahoo, #first").appendTo("#sap"); + equal( jQuery("#sap").text(), expected, "Check for appending of jQuery object" ); + + QUnit.reset(); + jQuery("#select1").appendTo("#foo"); + t( "Append select", "#foo select", ["select1"] ); + + QUnit.reset(); + var div = jQuery("<div/>").click(function(){ + ok(true, "Running a cloned click."); + }); + div.appendTo("#qunit-fixture, #moretests"); + + jQuery("#qunit-fixture div:last").click(); + jQuery("#moretests div:last").click(); + + QUnit.reset(); + div = jQuery("<div/>").appendTo("#qunit-fixture, #moretests"); + + equal( div.length, 2, "appendTo returns the inserted elements" ); + + div.addClass("test"); + + ok( jQuery("#qunit-fixture div:last").hasClass("test"), "appendTo element was modified after the insertion" ); + ok( jQuery("#moretests div:last").hasClass("test"), "appendTo element was modified after the insertion" ); + + QUnit.reset(); + + div = jQuery("<div/>"); + jQuery("<span>a</span><b>b</b>").filter("span").appendTo( div ); + + equal( div.children().length, 1, "Make sure the right number of children were inserted." ); + + div = jQuery("#moretests div"); + + var num = jQuery("#qunit-fixture div").length; + div.remove().appendTo("#qunit-fixture"); + + equal( jQuery("#qunit-fixture div").length, num, "Make sure all the removed divs were inserted." ); + + QUnit.reset(); + + stop(); + jQuery.getScript('data/test.js', function() { + jQuery('script[src*="data\\/test\\.js"]').remove(); + start(); + }); +}); + +var testPrepend = function(val) { + expect(5); + var defaultText = "Try them out:" + var result = jQuery("#first").prepend(val( "<b>buga</b>" )); + equal( result.text(), "buga" + defaultText, "Check if text prepending works" ); + equal( jQuery("#select3").prepend(val( "<option value='prependTest'>Prepend Test</option>" )).find("option:first-child").attr("value"), "prependTest", "Prepending html options to select element"); + + QUnit.reset(); + var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog"; + jQuery("#sap").prepend(val( document.getElementById("first") )); + equal( jQuery("#sap").text(), expected, "Check for prepending of element" ); + + QUnit.reset(); + expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog"; + jQuery("#sap").prepend(val( [document.getElementById("first"), document.getElementById("yahoo")] )); + equal( jQuery("#sap").text(), expected, "Check for prepending of array of elements" ); + + QUnit.reset(); + expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog"; + jQuery("#sap").prepend(val( jQuery("#yahoo, #first") )); + equal( jQuery("#sap").text(), expected, "Check for prepending of jQuery object" ); +}; + +test("prepend(String|Element|Array<Element>|jQuery)", function() { + testPrepend(bareObj); +}); + +test("prepend(Function)", function() { + testPrepend(functionReturningObj); +}); + +test("prepend(Function) with incoming value", function() { + expect(10); + + var defaultText = "Try them out:", old = jQuery("#first").html(); + var result = jQuery("#first").prepend(function(i, val) { + equal( val, old, "Make sure the incoming value is correct." ); + return "<b>buga</b>"; + }); + equal( result.text(), "buga" + defaultText, "Check if text prepending works" ); + + old = jQuery("#select3").html(); + + equal( jQuery("#select3").prepend(function(i, val) { + equal( val, old, "Make sure the incoming value is correct." ); + return "<option value='prependTest'>Prepend Test</option>"; + }).find("option:first-child").attr("value"), "prependTest", "Prepending html options to select element"); + + QUnit.reset(); + var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog"; + old = jQuery("#sap").html(); + + jQuery("#sap").prepend(function(i, val) { + equal( val, old, "Make sure the incoming value is correct." ); + return document.getElementById("first"); + }); + + equal( jQuery("#sap").text(), expected, "Check for prepending of element" ); + + QUnit.reset(); + expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog"; + old = jQuery("#sap").html(); + + jQuery("#sap").prepend(function(i, val) { + equal( val, old, "Make sure the incoming value is correct." ); + return [document.getElementById("first"), document.getElementById("yahoo")]; + }); + + equal( jQuery("#sap").text(), expected, "Check for prepending of array of elements" ); + + QUnit.reset(); + expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog"; + old = jQuery("#sap").html(); + + jQuery("#sap").prepend(function(i, val) { + equal( val, old, "Make sure the incoming value is correct." ); + return jQuery("#yahoo, #first"); + }); + + equal( jQuery("#sap").text(), expected, "Check for prepending of jQuery object" ); +}); + +test("prependTo(String|Element|Array<Element>|jQuery)", function() { + expect(6); + var defaultText = "Try them out:" + jQuery("<b>buga</b>").prependTo("#first"); + equal( jQuery("#first").text(), "buga" + defaultText, "Check if text prepending works" ); + equal( jQuery("<option value='prependTest'>Prepend Test</option>").prependTo("#select3").parent().find("option:first-child").attr("value"), "prependTest", "Prepending html options to select element"); + + QUnit.reset(); + var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog"; + jQuery(document.getElementById("first")).prependTo("#sap"); + equal( jQuery("#sap").text(), expected, "Check for prepending of element" ); + + QUnit.reset(); + expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog"; + jQuery([document.getElementById("first"), document.getElementById("yahoo")]).prependTo("#sap"); + equal( jQuery("#sap").text(), expected, "Check for prepending of array of elements" ); + + QUnit.reset(); + expected = "YahooTry them out:This link has class=\"blog\": Simon Willison's Weblog"; + jQuery("#yahoo, #first").prependTo("#sap"); + equal( jQuery("#sap").text(), expected, "Check for prepending of jQuery object" ); + + QUnit.reset(); + jQuery("<select id='prependSelect1'></select>").prependTo("form:last"); + jQuery("<select id='prependSelect2'><option>Test</option></select>").prependTo("form:last"); + + t( "Prepend Select", "#prependSelect2, #prependSelect1", ["prependSelect2", "prependSelect1"] ); +}); + +var testBefore = function(val) { + expect(6); + var expected = "This is a normal link: bugaYahoo"; + jQuery("#yahoo").before(val( "<b>buga</b>" )); + equal( jQuery("#en").text(), expected, "Insert String before" ); + + QUnit.reset(); + expected = "This is a normal link: Try them out:Yahoo"; + jQuery("#yahoo").before(val( document.getElementById("first") )); + equal( jQuery("#en").text(), expected, "Insert element before" ); + + QUnit.reset(); + expected = "This is a normal link: Try them out:diveintomarkYahoo"; + jQuery("#yahoo").before(val( [document.getElementById("first"), document.getElementById("mark")] )); + equal( jQuery("#en").text(), expected, "Insert array of elements before" ); + + QUnit.reset(); + expected = "This is a normal link: diveintomarkTry them out:Yahoo"; + jQuery("#yahoo").before(val( jQuery("#mark, #first") )); + equal( jQuery("#en").text(), expected, "Insert jQuery before" ); + + var set = jQuery("<div/>").before("<span>test</span>"); + equal( set[0].nodeName.toLowerCase(), "span", "Insert the element before the disconnected node." ); + equal( set.length, 2, "Insert the element before the disconnected node." ); +}; + +test("before(String|Element|Array<Element>|jQuery)", function() { + testBefore(bareObj); +}); + +test("before(Function)", function() { + testBefore(functionReturningObj); +}); + +test("before and after w/ empty object (#10812)", function() { + expect(2); + + var res = jQuery( "#notInTheDocument" ).before( "(" ).after( ")" ); + equal( res.length, 2, "didn't choke on empty object" ); + equal( res.wrapAll("<div/>").parent().text(), "()", "correctly appended text" ); +}); + +test("insertBefore(String|Element|Array<Element>|jQuery)", function() { + expect(4); + var expected = "This is a normal link: bugaYahoo"; + jQuery("<b>buga</b>").insertBefore("#yahoo"); + equal( jQuery("#en").text(), expected, "Insert String before" ); + + QUnit.reset(); + expected = "This is a normal link: Try them out:Yahoo"; + jQuery(document.getElementById("first")).insertBefore("#yahoo"); + equal( jQuery("#en").text(), expected, "Insert element before" ); + + QUnit.reset(); + expected = "This is a normal link: Try them out:diveintomarkYahoo"; + jQuery([document.getElementById("first"), document.getElementById("mark")]).insertBefore("#yahoo"); + equal( jQuery("#en").text(), expected, "Insert array of elements before" ); + + QUnit.reset(); + expected = "This is a normal link: diveintomarkTry them out:Yahoo"; + jQuery("#mark, #first").insertBefore("#yahoo"); + equal( jQuery("#en").text(), expected, "Insert jQuery before" ); +}); + +var testAfter = function(val) { + expect(6); + var expected = "This is a normal link: Yahoobuga"; + jQuery("#yahoo").after(val( "<b>buga</b>" )); + equal( jQuery("#en").text(), expected, "Insert String after" ); + + QUnit.reset(); + expected = "This is a normal link: YahooTry them out:"; + jQuery("#yahoo").after(val( document.getElementById("first") )); + equal( jQuery("#en").text(), expected, "Insert element after" ); + + QUnit.reset(); + expected = "This is a normal link: YahooTry them out:diveintomark"; + jQuery("#yahoo").after(val( [document.getElementById("first"), document.getElementById("mark")] )); + equal( jQuery("#en").text(), expected, "Insert array of elements after" ); + + QUnit.reset(); + expected = "This is a normal link: YahoodiveintomarkTry them out:"; + jQuery("#yahoo").after(val( jQuery("#mark, #first") )); + equal( jQuery("#en").text(), expected, "Insert jQuery after" ); + + var set = jQuery("<div/>").after("<span>test</span>"); + equal( set[1].nodeName.toLowerCase(), "span", "Insert the element after the disconnected node." ); + equal( set.length, 2, "Insert the element after the disconnected node." ); +}; + +test("after(String|Element|Array<Element>|jQuery)", function() { + testAfter(bareObj); +}); + +test("after(Function)", function() { + testAfter(functionReturningObj); +}); + +test("insertAfter(String|Element|Array<Element>|jQuery)", function() { + expect(4); + var expected = "This is a normal link: Yahoobuga"; + jQuery("<b>buga</b>").insertAfter("#yahoo"); + equal( jQuery("#en").text(), expected, "Insert String after" ); + + QUnit.reset(); + expected = "This is a normal link: YahooTry them out:"; + jQuery(document.getElementById("first")).insertAfter("#yahoo"); + equal( jQuery("#en").text(), expected, "Insert element after" ); + + QUnit.reset(); + expected = "This is a normal link: YahooTry them out:diveintomark"; + jQuery([document.getElementById("first"), document.getElementById("mark")]).insertAfter("#yahoo"); + equal( jQuery("#en").text(), expected, "Insert array of elements after" ); + + QUnit.reset(); + expected = "This is a normal link: YahoodiveintomarkTry them out:"; + jQuery("#mark, #first").insertAfter("#yahoo"); + equal( jQuery("#en").text(), expected, "Insert jQuery after" ); +}); + +var testReplaceWith = function(val) { + expect(21); + jQuery("#yahoo").replaceWith(val( "<b id='replace'>buga</b>" )); + ok( jQuery("#replace")[0], "Replace element with string" ); + ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after string" ); + + QUnit.reset(); + jQuery("#yahoo").replaceWith(val( document.getElementById("first") )); + ok( jQuery("#first")[0], "Replace element with element" ); + ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after element" ); + + QUnit.reset(); + jQuery("#qunit-fixture").append("<div id='bar'><div id='baz'</div></div>"); + jQuery("#baz").replaceWith("Baz"); + equal( jQuery("#bar").text(),"Baz", "Replace element with text" ); + ok( !jQuery("#baz")[0], "Verify that original element is gone, after element" ); + + QUnit.reset(); + jQuery("#yahoo").replaceWith(val( [document.getElementById("first"), document.getElementById("mark")] )); + ok( jQuery("#first")[0], "Replace element with array of elements" ); + ok( jQuery("#mark")[0], "Replace element with array of elements" ); + ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after array of elements" ); + + QUnit.reset(); + jQuery("#yahoo").replaceWith(val( jQuery("#mark, #first") )); + ok( jQuery("#first")[0], "Replace element with set of elements" ); + ok( jQuery("#mark")[0], "Replace element with set of elements" ); + ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after set of elements" ); + + QUnit.reset(); + var tmp = jQuery("<div/>").appendTo("body").click(function(){ ok(true, "Newly bound click run." ); }); + var y = jQuery("<div/>").appendTo("body").click(function(){ ok(true, "Previously bound click run." ); }); + var child = y.append("<b>test</b>").find("b").click(function(){ ok(true, "Child bound click run." ); return false; }); + + y.replaceWith( tmp ); + + tmp.click(); + y.click(); // Shouldn't be run + child.click(); // Shouldn't be run + + tmp.remove(); + y.remove(); + child.remove(); + + QUnit.reset(); + + y = jQuery("<div/>").appendTo("body").click(function(){ ok(true, "Previously bound click run." ); }); + var child2 = y.append("<u>test</u>").find("u").click(function(){ ok(true, "Child 2 bound click run." ); return false; }); + + y.replaceWith( child2 ); + + child2.click(); + + y.remove(); + child2.remove(); + + QUnit.reset(); + + var set = jQuery("<div/>").replaceWith(val("<span>test</span>")); + equal( set[0].nodeName.toLowerCase(), "span", "Replace the disconnected node." ); + equal( set.length, 1, "Replace the disconnected node." ); + + var non_existant = jQuery("#does-not-exist").replaceWith( val("<b>should not throw an error</b>") ); + equal( non_existant.length, 0, "Length of non existant element." ); + + var $div = jQuery("<div class='replacewith'></div>").appendTo("body"); + // TODO: Work on jQuery(...) inline script execution + //$div.replaceWith("<div class='replacewith'></div><script>" + + //"equal(jQuery('.replacewith').length, 1, 'Check number of elements in page.');" + + //"</script>"); + equal(jQuery(".replacewith").length, 1, "Check number of elements in page."); + jQuery(".replacewith").remove(); + + QUnit.reset(); + + jQuery("#qunit-fixture").append("<div id='replaceWith'></div>"); + equal( jQuery("#qunit-fixture").find("div[id=replaceWith]").length, 1, "Make sure only one div exists." ); + + jQuery("#replaceWith").replaceWith( val("<div id='replaceWith'></div>") ); + equal( jQuery("#qunit-fixture").find("div[id=replaceWith]").length, 1, "Make sure only one div exists." ); + + jQuery("#replaceWith").replaceWith( val("<div id='replaceWith'></div>") ); + equal( jQuery("#qunit-fixture").find("div[id=replaceWith]").length, 1, "Make sure only one div exists." ); +} + +test("replaceWith(String|Element|Array<Element>|jQuery)", function() { + testReplaceWith(bareObj); +}); + +test("replaceWith(Function)", function() { + testReplaceWith(functionReturningObj); + + expect(22); + + var y = jQuery("#yahoo")[0]; + + jQuery(y).replaceWith(function(){ + equal( this, y, "Make sure the context is coming in correctly." ); + }); + + QUnit.reset(); +}); + +test("replaceWith(string) for more than one element", function(){ + expect(3); + + equal(jQuery("#foo p").length, 3, "ensuring that test data has not changed"); + + jQuery("#foo p").replaceWith("<span>bar</span>"); + equal(jQuery("#foo span").length, 3, "verify that all the three original element have been replaced"); + equal(jQuery("#foo p").length, 0, "verify that all the three original element have been replaced"); +}); + +test("replaceAll(String|Element|Array<Element>|jQuery)", function() { + expect(10); + jQuery("<b id='replace'>buga</b>").replaceAll("#yahoo"); + ok( jQuery("#replace")[0], "Replace element with string" ); + ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after string" ); + + QUnit.reset(); + jQuery(document.getElementById("first")).replaceAll("#yahoo"); + ok( jQuery("#first")[0], "Replace element with element" ); + ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after element" ); + + QUnit.reset(); + jQuery([document.getElementById("first"), document.getElementById("mark")]).replaceAll("#yahoo"); + ok( jQuery("#first")[0], "Replace element with array of elements" ); + ok( jQuery("#mark")[0], "Replace element with array of elements" ); + ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after array of elements" ); + + QUnit.reset(); + jQuery("#mark, #first").replaceAll("#yahoo"); + ok( jQuery("#first")[0], "Replace element with set of elements" ); + ok( jQuery("#mark")[0], "Replace element with set of elements" ); + ok( !jQuery("#yahoo")[0], "Verify that original element is gone, after set of elements" ); +}); + +test("jQuery.clone() (#8017)", function() { + + expect(2); + + ok( jQuery.clone && jQuery.isFunction( jQuery.clone ) , "jQuery.clone() utility exists and is a function."); + + var main = jQuery("#qunit-fixture")[0], + clone = jQuery.clone( main ); + + equal( main.childNodes.length, clone.childNodes.length, "Simple child length to ensure a large dom tree copies correctly" ); +}); + +test("clone() (#8070)", function () { + expect(2); + + jQuery("<select class='test8070'></select><select class='test8070'></select>").appendTo("#qunit-fixture"); + var selects = jQuery(".test8070"); + selects.append("<OPTION>1</OPTION><OPTION>2</OPTION>"); + + equal( selects[0].childNodes.length, 2, "First select got two nodes" ); + equal( selects[1].childNodes.length, 2, "Second select got two nodes" ); + + selects.remove(); +}); + +test("clone()", function() { + expect(39); + equal( "This is a normal link: Yahoo", jQuery("#en").text(), "Assert text for #en" ); + var clone = jQuery("#yahoo").clone(); + equal( "Try them out:Yahoo", jQuery("#first").append(clone).text(), "Check for clone" ); + equal( "This is a normal link: Yahoo", jQuery("#en").text(), "Reassert text for #en" ); + + var cloneTags = [ + "<table/>", "<tr/>", "<td/>", "<div/>", + "<button/>", "<ul/>", "<ol/>", "<li/>", + "<input type='checkbox' />", "<select/>", "<option/>", "<textarea/>", + "<tbody/>", "<thead/>", "<tfoot/>", "<iframe/>" + ]; + for (var i = 0; i < cloneTags.length; i++) { + var j = jQuery(cloneTags[i]); + equal( j[0].tagName, j.clone()[0].tagName, "Clone a " + cloneTags[i]); + } + + // using contents will get comments regular, text, and comment nodes + var cl = jQuery("#nonnodes").contents().clone(); + ok( cl.length >= 2, "Check node,textnode,comment clone works (some browsers delete comments on clone)" ); + + var div = jQuery("<div><ul><li>test</li></ul></div>").click(function(){ + ok( true, "Bound event still exists." ); + }); + + clone = div.clone(true); + + // manually clean up detached elements + div.remove(); + + div = clone.clone(true); + + // manually clean up detached elements + clone.remove(); + + equal( div.length, 1, "One element cloned" ); + equal( div[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" ); + div.trigger("click"); + + // manually clean up detached elements + div.remove(); + + div = jQuery("<div/>").append([ document.createElement("table"), document.createElement("table") ]); + div.find("table").click(function(){ + ok( true, "Bound event still exists." ); + }); + + clone = div.clone(true); + equal( clone.length, 1, "One element cloned" ); + equal( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" ); + clone.find("table:last").trigger("click"); + + // manually clean up detached elements + div.remove(); + clone.remove(); + + var divEvt = jQuery("<div><ul><li>test</li></ul></div>").click(function(){ + ok( false, "Bound event still exists after .clone()." ); + }), + cloneEvt = divEvt.clone(); + + // Make sure that doing .clone() doesn't clone events + cloneEvt.trigger("click"); + + cloneEvt.remove(); + divEvt.remove(); + + // Test both html() and clone() for <embed and <object types + div = jQuery("<div/>").html('<embed height="355" width="425" src="http://www.youtube.com/v/3KANI2dpXLw&hl=en"></embed>'); + + clone = div.clone(true); + equal( clone.length, 1, "One element cloned" ); + equal( clone.html(), div.html(), "Element contents cloned" ); + equal( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" ); + + // this is technically an invalid object, but because of the special + // classid instantiation it is the only kind that IE has trouble with, + // so let's test with it too. + div = jQuery("<div/>").html("<object height='355' width='425' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'> <param name='movie' value='http://www.youtube.com/v/3KANI2dpXLw&hl=en'> <param name='wmode' value='transparent'> </object>"); + + clone = div.clone(true); + equal( clone.length, 1, "One element cloned" ); + // equal( clone.html(), div.html(), "Element contents cloned" ); + equal( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" ); + + // and here's a valid one. + div = jQuery("<div/>").html("<object height='355' width='425' type='application/x-shockwave-flash' data='http://www.youtube.com/v/3KANI2dpXLw&hl=en'> <param name='movie' value='http://www.youtube.com/v/3KANI2dpXLw&hl=en'> <param name='wmode' value='transparent'> </object>"); + + clone = div.clone(true); + equal( clone.length, 1, "One element cloned" ); + equal( clone.html(), div.html(), "Element contents cloned" ); + equal( clone[0].nodeName.toUpperCase(), "DIV", "DIV element cloned" ); + + div = jQuery("<div/>").data({ a: true }); + clone = div.clone(true); + equal( clone.data("a"), true, "Data cloned." ); + clone.data("a", false); + equal( clone.data("a"), false, "Ensure cloned element data object was correctly modified" ); + equal( div.data("a"), true, "Ensure cloned element data object is copied, not referenced" ); + + // manually clean up detached elements + div.remove(); + clone.remove(); + + var form = document.createElement("form"); + form.action = "/test/"; + var div = document.createElement("div"); + div.appendChild( document.createTextNode("test") ); + form.appendChild( div ); + + equal( jQuery(form).clone().children().length, 1, "Make sure we just get the form back." ); + + equal( jQuery("body").clone().children()[0].id, "qunit-header", "Make sure cloning body works" ); +}); + +test("clone(form element) (Bug #3879, #6655)", function() { + expect(5); + var element = jQuery("<select><option>Foo</option><option selected>Bar</option></select>"); + + equal( element.clone().find("option:selected").val(), element.find("option:selected").val(), "Selected option cloned correctly" ); + + element = jQuery("<input type='checkbox' value='foo'>").attr("checked", "checked"); + clone = element.clone(); + + equal( clone.is(":checked"), element.is(":checked"), "Checked input cloned correctly" ); + equal( clone[0].defaultValue, "foo", "Checked input defaultValue cloned correctly" ); + + // defaultChecked also gets set now due to setAttribute in attr, is this check still valid? + // equal( clone[0].defaultChecked, !jQuery.support.noCloneChecked, "Checked input defaultChecked cloned correctly" ); + + element = jQuery("<input type='text' value='foo'>"); + clone = element.clone(); + equal( clone[0].defaultValue, "foo", "Text input defaultValue cloned correctly" ); + + element = jQuery("<textarea>foo</textarea>"); + clone = element.clone(); + equal( clone[0].defaultValue, "foo", "Textarea defaultValue cloned correctly" ); +}); + +test("clone(multiple selected options) (Bug #8129)", function() { + expect(1); + var element = jQuery("<select><option>Foo</option><option selected>Bar</option><option selected>Baz</option></select>"); + + equal( element.clone().find("option:selected").length, element.find("option:selected").length, "Multiple selected options cloned correctly" ); + +}); + +if (!isLocal) { +test("clone() on XML nodes", function() { + expect(2); + stop(); + jQuery.get("data/dashboard.xml", function (xml) { + var root = jQuery(xml.documentElement).clone(); + var origTab = jQuery("tab", xml).eq(0); + var cloneTab = jQuery("tab", root).eq(0); + origTab.text("origval"); + cloneTab.text("cloneval"); + equal(origTab.text(), "origval", "Check original XML node was correctly set"); + equal(cloneTab.text(), "cloneval", "Check cloned XML node was correctly set"); + start(); + }); +}); +} + +var testHtml = function(valueObj) { + expect(34); + + jQuery.scriptorder = 0; + + var div = jQuery("#qunit-fixture > div"); + div.html(valueObj("<b>test</b>")); + var pass = true; + for ( var i = 0; i < div.size(); i++ ) { + if ( div.get(i).childNodes.length != 1 ) pass = false; + } + ok( pass, "Set HTML" ); + + div = jQuery("<div/>").html( valueObj("<div id='parent_1'><div id='child_1'/></div><div id='parent_2'/>") ); + + equal( div.children().length, 2, "Make sure two child nodes exist." ); + equal( div.children().children().length, 1, "Make sure that a grandchild exists." ); + + var space = jQuery("<div/>").html(valueObj(" "))[0].innerHTML; + ok( /^\xA0$|^ $/.test( space ), "Make sure entities are passed through correctly." ); + equal( jQuery("<div/>").html(valueObj("&"))[0].innerHTML, "&", "Make sure entities are passed through correctly." ); + + jQuery("#qunit-fixture").html(valueObj("<style>.foobar{color:green;}</style>")); + + equal( jQuery("#qunit-fixture").children().length, 1, "Make sure there is a child element." ); + equal( jQuery("#qunit-fixture").children()[0].nodeName.toUpperCase(), "STYLE", "And that a style element was inserted." ); + + QUnit.reset(); + // using contents will get comments regular, text, and comment nodes + var j = jQuery("#nonnodes").contents(); + j.html(valueObj("<b>bold</b>")); + + // this is needed, or the expando added by jQuery unique will yield a different html + j.find("b").removeData(); + equal( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" ); + + jQuery("#qunit-fixture").html(valueObj("<select/>")); + jQuery("#qunit-fixture select").html(valueObj("<option>O1</option><option selected='selected'>O2</option><option>O3</option>")); + equal( jQuery("#qunit-fixture select").val(), "O2", "Selected option correct" ); + + var $div = jQuery("<div />"); + equal( $div.html(valueObj( 5 )).html(), "5", "Setting a number as html" ); + equal( $div.html(valueObj( 0 )).html(), "0", "Setting a zero as html" ); + + var $div2 = jQuery("<div/>"), insert = "<div>hello1</div>"; + equal( $div2.html(insert).html().replace(/>/g, ">"), insert, "Verify escaped insertion." ); + equal( $div2.html("x" + insert).html().replace(/>/g, ">"), "x" + insert, "Verify escaped insertion." ); + equal( $div2.html(" " + insert).html().replace(/>/g, ">"), " " + insert, "Verify escaped insertion." ); + + var map = jQuery("<map/>").html(valueObj("<area id='map01' shape='rect' coords='50,50,150,150' href='http://www.jquery.com/' alt='jQuery'>")); + + equal( map[0].childNodes.length, 1, "The area was inserted." ); + equal( map[0].firstChild.nodeName.toLowerCase(), "area", "The area was inserted." ); + + QUnit.reset(); + + jQuery("#qunit-fixture").html(valueObj("<script type='something/else'>ok( false, 'Non-script evaluated.' );</script><script type='text/javascript'>ok( true, 'text/javascript is evaluated.' );</script><script>ok( true, 'No type is evaluated.' );</script><div><script type='text/javascript'>ok( true, 'Inner text/javascript is evaluated.' );</script><script>ok( true, 'Inner No type is evaluated.' );</script><script type='something/else'>ok( false, 'Non-script evaluated.' );</script></div>")); + + var child = jQuery("#qunit-fixture").find("script"); + + equal( child.length, 2, "Make sure that two non-JavaScript script tags are left." ); + equal( child[0].type, "something/else", "Verify type of script tag." ); + equal( child[1].type, "something/else", "Verify type of script tag." ); + + jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>")); + jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>")); + jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>")); + + jQuery("#qunit-fixture").html(valueObj("<script type='text/javascript'>ok( true, 'jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975 (1)' );</script>")); + + jQuery("#qunit-fixture").html(valueObj("foo <form><script type='text/javascript'>ok( true, 'jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975 (2)' );</script></form>")); + + jQuery("#qunit-fixture").html(valueObj("<script>equal(jQuery.scriptorder++, 0, 'Script is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html (even though appears before)')<\/script><span id='scriptorder'><script>equal(jQuery.scriptorder++, 1, 'Script (nested) is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html')<\/script></span><script>equal(jQuery.scriptorder++, 2, 'Script (unnested) is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html')<\/script>")); +} + +test("html(String)", function() { + testHtml(bareObj); +}); + +test("html(Function)", function() { + testHtml(functionReturningObj); + + expect(36); + + QUnit.reset(); + + jQuery("#qunit-fixture").html(function(){ + return jQuery(this).text(); + }); + + ok( !/</.test( jQuery("#qunit-fixture").html() ), "Replace html with text." ); + ok( jQuery("#qunit-fixture").html().length > 0, "Make sure text exists." ); +}); + +test("html(Function) with incoming value", function() { + expect(20); + + var div = jQuery("#qunit-fixture > div"), old = div.map(function(){ return jQuery(this).html() }); + + div.html(function(i, val) { + equal( val, old[i], "Make sure the incoming value is correct." ); + return "<b>test</b>"; + }); + + var pass = true; + div.each(function(){ + if ( this.childNodes.length !== 1 ) { + pass = false; + } + }) + ok( pass, "Set HTML" ); + + QUnit.reset(); + // using contents will get comments regular, text, and comment nodes + var j = jQuery("#nonnodes").contents(); + old = j.map(function(){ return jQuery(this).html(); }); + + j.html(function(i, val) { + equal( val, old[i], "Make sure the incoming value is correct." ); + return "<b>bold</b>"; + }); + + // Handle the case where no comment is in the document + if ( j.length === 2 ) { + equal( null, null, "Make sure the incoming value is correct." ); + } + + j.find("b").removeData(); + equal( j.html().replace(/ xmlns="[^"]+"/g, "").toLowerCase(), "<b>bold</b>", "Check node,textnode,comment with html()" ); + + var $div = jQuery("<div />"); + + equal( $div.html(function(i, val) { + equal( val, "", "Make sure the incoming value is correct." ); + return 5; + }).html(), "5", "Setting a number as html" ); + + equal( $div.html(function(i, val) { + equal( val, "5", "Make sure the incoming value is correct." ); + return 0; + }).html(), "0", "Setting a zero as html" ); + + var $div2 = jQuery("<div/>"), insert = "<div>hello1</div>"; + equal( $div2.html(function(i, val) { + equal( val, "", "Make sure the incoming value is correct." ); + return insert; + }).html().replace(/>/g, ">"), insert, "Verify escaped insertion." ); + + equal( $div2.html(function(i, val) { + equal( val.replace(/>/g, ">"), insert, "Make sure the incoming value is correct." ); + return "x" + insert; + }).html().replace(/>/g, ">"), "x" + insert, "Verify escaped insertion." ); + + equal( $div2.html(function(i, val) { + equal( val.replace(/>/g, ">"), "x" + insert, "Make sure the incoming value is correct." ); + return " " + insert; + }).html().replace(/>/g, ">"), " " + insert, "Verify escaped insertion." ); +}); + +var testRemove = function(method) { + expect(9); + + var first = jQuery("#ap").children(":first"); + first.data("foo", "bar"); + + jQuery("#ap").children()[method](); + ok( jQuery("#ap").text().length > 10, "Check text is not removed" ); + equal( jQuery("#ap").children().length, 0, "Check remove" ); + + equal( first.data("foo"), method == "remove" ? null : "bar" ); + + QUnit.reset(); + jQuery("#ap").children()[method]("a"); + ok( jQuery("#ap").text().length > 10, "Check text is not removed" ); + equal( jQuery("#ap").children().length, 1, "Check filtered remove" ); + + jQuery("#ap").children()[method]("a, code"); + equal( jQuery("#ap").children().length, 0, "Check multi-filtered remove" ); + + // using contents will get comments regular, text, and comment nodes + // Handle the case where no comment is in the document + ok( jQuery("#nonnodes").contents().length >= 2, "Check node,textnode,comment remove works" ); + jQuery("#nonnodes").contents()[method](); + equal( jQuery("#nonnodes").contents().length, 0, "Check node,textnode,comment remove works" ); + + // manually clean up detached elements + if (method === "detach") { + first.remove(); + } + + QUnit.reset(); + + var count = 0; + var first = jQuery("#ap").children(":first"); + var cleanUp = first.click(function() { count++ })[method]().appendTo("#qunit-fixture").click(); + + equal( method == "remove" ? 0 : 1, count ); + + // manually clean up detached elements + cleanUp.remove(); +}; + +test("remove()", function() { + testRemove("remove"); +}); + +test("detach()", function() { + testRemove("detach"); +}); + +test("empty()", function() { + expect(3); + equal( jQuery("#ap").children().empty().text().length, 0, "Check text is removed" ); + equal( jQuery("#ap").children().length, 4, "Check elements are not removed" ); + + // using contents will get comments regular, text, and comment nodes + var j = jQuery("#nonnodes").contents(); + j.empty(); + equal( j.html(), "", "Check node,textnode,comment empty works" ); +}); + +test("jQuery.cleanData", function() { + expect(14); + + var type, pos, div, child; + + type = "remove"; + + // Should trigger 4 remove event + div = getDiv().remove(); + + // Should both do nothing + pos = "Outer"; + div.trigger("click"); + + pos = "Inner"; + div.children().trigger("click"); + + type = "empty"; + div = getDiv(); + child = div.children(); + + // Should trigger 2 remove event + div.empty(); + + // Should trigger 1 + pos = "Outer"; + div.trigger("click"); + + // Should do nothing + pos = "Inner"; + child.trigger("click"); + + // Should trigger 2 + div.remove(); + + type = "html"; + + div = getDiv(); + child = div.children(); + + // Should trigger 2 remove event + div.html("<div></div>"); + + // Should trigger 1 + pos = "Outer"; + div.trigger("click"); + + // Should do nothing + pos = "Inner"; + child.trigger("click"); + + // Should trigger 2 + div.remove(); + + function getDiv() { + var div = jQuery("<div class='outer'><div class='inner'></div></div>").click(function(){ + ok( true, type + " " + pos + " Click event fired." ); + }).focus(function(){ + ok( true, type + " " + pos + " Focus event fired." ); + }).find("div").click(function(){ + ok( false, type + " " + pos + " Click event fired." ); + }).focus(function(){ + ok( false, type + " " + pos + " Focus event fired." ); + }).end().appendTo("body"); + + div[0].detachEvent = div[0].removeEventListener = function(t){ + ok( true, type + " Outer " + t + " event unbound" ); + }; + + div[0].firstChild.detachEvent = div[0].firstChild.removeEventListener = function(t){ + ok( true, type + " Inner " + t + " event unbound" ); + }; + + return div; + } +}); + +test("jQuery.buildFragment - no plain-text caching (Bug #6779)", function() { + expect(1); + + // DOM manipulation fails if added text matches an Object method + var $f = jQuery( "<div />" ).appendTo( "#qunit-fixture" ), + bad = [ "start-", "toString", "hasOwnProperty", "append", "here&there!", "-end" ]; + + for ( var i=0; i < bad.length; i++ ) { + try { + $f.append( bad[i] ); + } + catch(e) {} + } + equal($f.text(), bad.join(""), "Cached strings that match Object properties"); + $f.remove(); +}); + +test( "jQuery.html - execute scripts escaped with html comment or CDATA (#9221)", function() { + expect( 3 ); + jQuery( [ + '<script type="text/javascript">', + '<!--', + 'ok( true, "<!-- handled" );', + '//-->', + '</script>' + ].join ( "\n" ) ).appendTo( "#qunit-fixture" ); + jQuery( [ + '<script type="text/javascript">', + '<![CDATA[', + 'ok( true, "<![CDATA[ handled" );', + '//]]>', + '</script>' + ].join ( "\n" ) ).appendTo( "#qunit-fixture" ); + jQuery( [ + '<script type="text/javascript">', + '<!--//--><![CDATA[//><!--', + 'ok( true, "<!--//--><![CDATA[//><!-- (Drupal case) handled" );', + '//--><!]]>', + '</script>' + ].join ( "\n" ) ).appendTo( "#qunit-fixture" ); +}); + +test("jQuery.buildFragment - plain objects are not a document #8950", function() { + expect(1); + + try { + jQuery('<input type="hidden">', {}); + ok( true, "Does not allow attribute object to be treated like a doc object"); + } catch (e) {} + +}); + +test("jQuery.clone - no exceptions for object elements #9587", function() { + expect(1); + + try { + jQuery("#no-clone-exception").clone(); + ok( true, "cloned with no exceptions" ); + } catch( e ) { + ok( false, e.message ); + } +}); + +test("jQuery(<tag>) & wrap[Inner/All]() handle unknown elems (#10667)", function() { + expect(2); + + var $wraptarget = jQuery( "<div id='wrap-target'>Target</div>" ).appendTo( "#qunit-fixture" ), + $section = jQuery( "<section>" ).appendTo( "#qunit-fixture" ); + + $wraptarget.wrapAll("<aside style='background-color:green'></aside>"); + + notEqual( $wraptarget.parent("aside").css("background-color"), "transparent", "HTML5 elements created with wrapAll inherit styles" ); + notEqual( $section.css("background-color"), "transparent", "HTML5 elements create with jQuery( string ) inherit styles" ); +}); + +test("Cloned, detached HTML5 elems (#10667,10670)", function() { + expect(7); + + var $section = jQuery( "<section>" ).appendTo( "#qunit-fixture" ), + $clone; + + // First clone + $clone = $section.clone(); + + // Infer that the test is being run in IE<=8 + if ( $clone[0].outerHTML && !jQuery.support.opacity ) { + // This branch tests cloning nodes by reading the outerHTML, used only in IE<=8 + equal( $clone[0].outerHTML, "<section></section>", "detached clone outerHTML matches '<section></section>'" ); + } else { + // This branch tests a known behaviour in modern browsers that should never fail. + // Included for expected test count symmetry (expecting 1) + equal( $clone[0].nodeName, "SECTION", "detached clone nodeName matches 'SECTION' in modern browsers" ); + } + + // Bind an event + $section.bind( "click", function( event ) { + ok( true, "clone fired event" ); + }); + + // Second clone (will have an event bound) + $clone = $section.clone( true ); + + // Trigger an event from the first clone + $clone.trigger( "click" ); + $clone.unbind( "click" ); + + // Add a child node with text to the original + $section.append( "<p>Hello</p>" ); + + // Third clone (will have child node and text) + $clone = $section.clone( true ); + + equal( $clone.find("p").text(), "Hello", "Assert text in child of clone" ); + + // Trigger an event from the third clone + $clone.trigger( "click" ); + $clone.unbind( "click" ); + + // Add attributes to copy + $section.attr({ + "class": "foo bar baz", + "title": "This is a title" + }); + + // Fourth clone (will have newly added attributes) + $clone = $section.clone( true ); + + equal( $clone.attr("class"), $section.attr("class"), "clone and element have same class attribute" ); + equal( $clone.attr("title"), $section.attr("title"), "clone and element have same title attribute" ); + + // Remove the original + $section.remove(); + + // Clone the clone + $section = $clone.clone( true ); + + // Remove the clone + $clone.remove(); + + // Trigger an event from the clone of the clone + $section.trigger( "click" ); + + // Unbind any remaining events + $section.unbind( "click" ); + $clone.unbind( "click" ); +}); + +test("jQuery.fragments cache expectations", function() { + + expect( 10 ); + + jQuery.fragments = {}; + + function fragmentCacheSize() { + var n = 0, c; + + for ( c in jQuery.fragments ) { + n++; + } + return n; + } + + jQuery("<li></li>"); + jQuery("<li>?</li>"); + jQuery("<li>whip</li>"); + jQuery("<li>it</li>"); + jQuery("<li>good</li>"); + jQuery("<div></div>"); + jQuery("<div><div><span></span></div></div>"); + jQuery("<tr><td></td></tr>"); + jQuery("<tr><td></tr>"); + jQuery("<li>aaa</li>"); + jQuery("<ul><li>?</li></ul>"); + jQuery("<div><p>arf</p>nnn</div>"); + jQuery("<div><p>dog</p>?</div>"); + jQuery("<span><span>"); + + equal( fragmentCacheSize(), 12, "12 entries exist in jQuery.fragments, 1" ); + + jQuery.each( [ + "<tr><td></td></tr>", + "<ul><li>?</li></ul>", + "<div><p>dog</p>?</div>", + "<span><span>" + ], function( i, frag ) { + + jQuery( frag ); + + equal( jQuery.fragments[ frag ].nodeType, 11, "Second call with " + frag + " creates a cached DocumentFragment, has nodeType 11" ); + ok( jQuery.fragments[ frag ].childNodes.length, "Second call with " + frag + " creates a cached DocumentFragment, has childNodes with length" ); + }); + + equal( fragmentCacheSize(), 12, "12 entries exist in jQuery.fragments, 2" ); +}); diff --git a/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/traversing.js b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/traversing.js new file mode 100644 index 0000000..bcd3a97 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/jquery-1.7.1/unit/traversing.js @@ -0,0 +1,642 @@ +module("traversing", { teardown: moduleTeardown }); + +test("find(String)", function() { + expect(5); + equal( "Yahoo", jQuery("#foo").find(".blogTest").text(), "Check for find" ); + + // using contents will get comments regular, text, and comment nodes + var j = jQuery("#nonnodes").contents(); + equal( j.find("div").length, 0, "Check node,textnode,comment to find zero divs" ); + + deepEqual( jQuery("#qunit-fixture").find("> div").get(), q("foo", "moretests", "tabindex-tests", "liveHandlerOrder", "siblingTest"), "find child elements" ); + deepEqual( jQuery("#qunit-fixture").find("> #foo, > #moretests").get(), q("foo", "moretests"), "find child elements" ); + deepEqual( jQuery("#qunit-fixture").find("> #foo > p").get(), q("sndp", "en", "sap"), "find child elements" ); +}); + +test("find(node|jQuery object)", function() { + expect( 11 ); + + var $foo = jQuery("#foo"), + $blog = jQuery(".blogTest"), + $first = jQuery("#first"), + $two = $blog.add( $first ), + $fooTwo = $foo.add( $blog ); + + equal( $foo.find( $blog ).text(), "Yahoo", "Find with blog jQuery object" ); + equal( $foo.find( $blog[0] ).text(), "Yahoo", "Find with blog node" ); + equal( $foo.find( $first ).length, 0, "#first is not in #foo" ); + equal( $foo.find( $first[0]).length, 0, "#first not in #foo (node)" ); + ok( $foo.find( $two ).is(".blogTest"), "Find returns only nodes within #foo" ); + ok( $fooTwo.find( $blog ).is(".blogTest"), "Blog is part of the collection, but also within foo" ); + ok( $fooTwo.find( $blog[0] ).is(".blogTest"), "Blog is part of the collection, but also within foo(node)" ); + + equal( $two.find( $foo ).length, 0, "Foo is not in two elements" ); + equal( $two.find( $foo[0] ).length, 0, "Foo is not in two elements(node)" ); + equal( $two.find( $first ).length, 0, "first is in the collection and not within two" ); + equal( $two.find( $first ).length, 0, "first is in the collection and not within two(node)" ); + +}); + +test("is(String|undefined)", function() { + expect(29); + ok( jQuery("#form").is("form"), "Check for element: A form must be a form" ); + ok( !jQuery("#form").is("div"), "Check for element: A form is not a div" ); + ok( jQuery("#mark").is(".blog"), "Check for class: Expected class 'blog'" ); + ok( !jQuery("#mark").is(".link"), "Check for class: Did not expect class 'link'" ); + ok( jQuery("#simon").is(".blog.link"), "Check for multiple classes: Expected classes 'blog' and 'link'" ); + ok( !jQuery("#simon").is(".blogTest"), "Check for multiple classes: Expected classes 'blog' and 'link', but not 'blogTest'" ); + ok( jQuery("#en").is("[lang=\"en\"]"), "Check for attribute: Expected attribute lang to be 'en'" ); + ok( !jQuery("#en").is("[lang=\"de\"]"), "Check for attribute: Expected attribute lang to be 'en', not 'de'" ); + ok( jQuery("#text1").is("[type=\"text\"]"), "Check for attribute: Expected attribute type to be 'text'" ); + ok( !jQuery("#text1").is("[type=\"radio\"]"), "Check for attribute: Expected attribute type to be 'text', not 'radio'" ); + ok( jQuery("#text2").is(":disabled"), "Check for pseudoclass: Expected to be disabled" ); + ok( !jQuery("#text1").is(":disabled"), "Check for pseudoclass: Expected not disabled" ); + ok( jQuery("#radio2").is(":checked"), "Check for pseudoclass: Expected to be checked" ); + ok( !jQuery("#radio1").is(":checked"), "Check for pseudoclass: Expected not checked" ); + ok( jQuery("#foo").is(":has(p)"), "Check for child: Expected a child 'p' element" ); + ok( !jQuery("#foo").is(":has(ul)"), "Check for child: Did not expect 'ul' element" ); + ok( jQuery("#foo").is(":has(p):has(a):has(code)"), "Check for childs: Expected 'p', 'a' and 'code' child elements" ); + ok( !jQuery("#foo").is(":has(p):has(a):has(code):has(ol)"), "Check for childs: Expected 'p', 'a' and 'code' child elements, but no 'ol'" ); + + ok( !jQuery("#foo").is(0), "Expected false for an invalid expression - 0" ); + ok( !jQuery("#foo").is(null), "Expected false for an invalid expression - null" ); + ok( !jQuery("#foo").is(""), "Expected false for an invalid expression - \"\"" ); + ok( !jQuery("#foo").is(undefined), "Expected false for an invalid expression - undefined" ); + ok( !jQuery("#foo").is({ plain: "object" }), "Check passing invalid object" ); + + // test is() with comma-seperated expressions + ok( jQuery("#en").is("[lang=\"en\"],[lang=\"de\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" ); + ok( jQuery("#en").is("[lang=\"de\"],[lang=\"en\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" ); + ok( jQuery("#en").is("[lang=\"en\"] , [lang=\"de\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" ); + ok( jQuery("#en").is("[lang=\"de\"] , [lang=\"en\"]"), "Comma-seperated; Check for lang attribute: Expect en or de" ); + + ok( !jQuery(window).is('a'), "Checking is on a window does not throw an exception(#10178)" ); + ok( !jQuery(document).is('a'), "Checking is on a document does not throw an exception(#10178)" ); +}); + +test("is(jQuery)", function() { + expect(21); + ok( jQuery("#form").is( jQuery("form") ), "Check for element: A form is a form" ); + ok( !jQuery("#form").is( jQuery("div") ), "Check for element: A form is not a div" ); + ok( jQuery("#mark").is( jQuery(".blog") ), "Check for class: Expected class 'blog'" ); + ok( !jQuery("#mark").is( jQuery(".link") ), "Check for class: Did not expect class 'link'" ); + ok( jQuery("#simon").is( jQuery(".blog.link") ), "Check for multiple classes: Expected classes 'blog' and 'link'" ); + ok( !jQuery("#simon").is( jQuery(".blogTest") ), "Check for multiple classes: Expected classes 'blog' and 'link', but not 'blogTest'" ); + ok( jQuery("#en").is( jQuery("[lang=\"en\"]") ), "Check for attribute: Expected attribute lang to be 'en'" ); + ok( !jQuery("#en").is( jQuery("[lang=\"de\"]") ), "Check for attribute: Expected attribute lang to be 'en', not 'de'" ); + ok( jQuery("#text1").is( jQuery("[type=\"text\"]") ), "Check for attribute: Expected attribute type to be 'text'" ); + ok( !jQuery("#text1").is( jQuery("[type=\"radio\"]") ), "Check for attribute: Expected attribute type to be 'text', not 'radio'" ); + ok( !jQuery("#text1").is( jQuery("input:disabled") ), "Check for pseudoclass: Expected not disabled" ); + ok( jQuery("#radio2").is( jQuery("input:checked") ), "Check for pseudoclass: Expected to be checked" ); + ok( !jQuery("#radio1").is( jQuery("input:checked") ), "Check for pseudoclass: Expected not checked" ); + ok( jQuery("#foo").is( jQuery("div:has(p)") ), "Check for child: Expected a child 'p' element" ); + ok( !jQuery("#foo").is( jQuery("div:has(ul)") ), "Check for child: Did not expect 'ul' element" ); + + // Some raw elements + ok( jQuery("#form").is( jQuery("form")[0] ), "Check for element: A form is a form" ); + ok( !jQuery("#form").is( jQuery("div")[0] ), "Check for element: A form is not a div" ); + ok( jQuery("#mark").is( jQuery(".blog")[0] ), "Check for class: Expected class 'blog'" ); + ok( !jQuery("#mark").is( jQuery(".link")[0] ), "Check for class: Did not expect class 'link'" ); + ok( jQuery("#simon").is( jQuery(".blog.link")[0] ), "Check for multiple classes: Expected classes 'blog' and 'link'" ); + ok( !jQuery("#simon").is( jQuery(".blogTest")[0] ), "Check for multiple classes: Expected classes 'blog' and 'link', but not 'blogTest'" ); +}); + +test("is() with positional selectors", function() { + expect(23); + + var html = jQuery( + '<p id="posp"><a class="firsta" href="#"><em>first</em></a><a class="seconda" href="#"><b>test</b></a><em></em></p>' + ).appendTo( "body" ), + isit = function(sel, match, expect) { + equal( jQuery( sel ).is( match ), expect, "jQuery( " + sel + " ).is( " + match + " )" ); + }; + + isit( "#posp", "#posp:first", true ); + isit( "#posp", "#posp:eq(2)", false ); + isit( "#posp", "#posp a:first", false ); + + isit( "#posp .firsta", "#posp a:first", true ); + isit( "#posp .firsta", "#posp a:last", false ); + isit( "#posp .firsta", "#posp a:even", true ); + isit( "#posp .firsta", "#posp a:odd", false ); + isit( "#posp .firsta", "#posp a:eq(0)", true ); + isit( "#posp .firsta", "#posp a:eq(9)", false ); + isit( "#posp .firsta", "#posp em:eq(0)", false ); + isit( "#posp .firsta", "#posp em:first", false ); + isit( "#posp .firsta", "#posp:first", false ); + + isit( "#posp .seconda", "#posp a:first", false ); + isit( "#posp .seconda", "#posp a:last", true ); + isit( "#posp .seconda", "#posp a:gt(0)", true ); + isit( "#posp .seconda", "#posp a:lt(5)", true ); + isit( "#posp .seconda", "#posp a:lt(1)", false ); + + isit( "#posp em", "#posp a:eq(0) em", true ); + isit( "#posp em", "#posp a:lt(1) em", true ); + isit( "#posp em", "#posp a:gt(1) em", false ); + isit( "#posp em", "#posp a:first em", true ); + isit( "#posp em", "#posp a em:last", true ); + isit( "#posp em", "#posp a em:eq(2)", false ); + + html.remove(); +}); + +test("index()", function() { + expect( 2 ); + + equal( jQuery("#text2").index(), 2, "Returns the index of a child amongst its siblings" ); + + equal( jQuery("<div/>").index(), -1, "Node without parent returns -1" ); +}); + +test("index(Object|String|undefined)", function() { + expect(16); + + var elements = jQuery([window, document]), + inputElements = jQuery("#radio1,#radio2,#check1,#check2"); + + // Passing a node + equal( elements.index(window), 0, "Check for index of elements" ); + equal( elements.index(document), 1, "Check for index of elements" ); + equal( inputElements.index(document.getElementById("radio1")), 0, "Check for index of elements" ); + equal( inputElements.index(document.getElementById("radio2")), 1, "Check for index of elements" ); + equal( inputElements.index(document.getElementById("check1")), 2, "Check for index of elements" ); + equal( inputElements.index(document.getElementById("check2")), 3, "Check for index of elements" ); + equal( inputElements.index(window), -1, "Check for not found index" ); + equal( inputElements.index(document), -1, "Check for not found index" ); + + // Passing a jQuery object + // enabled since [5500] + equal( elements.index( elements ), 0, "Pass in a jQuery object" ); + equal( elements.index( elements.eq(1) ), 1, "Pass in a jQuery object" ); + equal( jQuery("#form :radio").index( jQuery("#radio2") ), 1, "Pass in a jQuery object" ); + + // Passing a selector or nothing + // enabled since [6330] + equal( jQuery("#text2").index(), 2, "Check for index amongst siblings" ); + equal( jQuery("#form").children().eq(4).index(), 4, "Check for index amongst siblings" ); + equal( jQuery("#radio2").index("#form :radio") , 1, "Check for index within a selector" ); + equal( jQuery("#form :radio").index( jQuery("#radio2") ), 1, "Check for index within a selector" ); + equal( jQuery("#radio2").index("#form :text") , -1, "Check for index not found within a selector" ); +}); + +test("filter(Selector|undefined)", function() { + expect(9); + deepEqual( jQuery("#form input").filter(":checked").get(), q("radio2", "check1"), "filter(String)" ); + deepEqual( jQuery("p").filter("#ap, #sndp").get(), q("ap", "sndp"), "filter('String, String')" ); + deepEqual( jQuery("p").filter("#ap,#sndp").get(), q("ap", "sndp"), "filter('String,String')" ); + + deepEqual( jQuery("p").filter(null).get(), [], "filter(null) should return an empty jQuery object"); + deepEqual( jQuery("p").filter(undefined).get(), [], "filter(undefined) should return an empty jQuery object"); + deepEqual( jQuery("p").filter(0).get(), [], "filter(0) should return an empty jQuery object"); + deepEqual( jQuery("p").filter("").get(), [], "filter('') should return an empty jQuery object"); + + // using contents will get comments regular, text, and comment nodes + var j = jQuery("#nonnodes").contents(); + equal( j.filter("span").length, 1, "Check node,textnode,comment to filter the one span" ); + equal( j.filter("[name]").length, 0, "Check node,textnode,comment to filter the one span" ); +}); + +test("filter(Function)", function() { + expect(2); + + deepEqual( jQuery("#qunit-fixture p").filter(function() { return !jQuery("a", this).length }).get(), q("sndp", "first"), "filter(Function)" ); + + deepEqual( jQuery("#qunit-fixture p").filter(function(i, elem) { return !jQuery("a", elem).length }).get(), q("sndp", "first"), "filter(Function) using arg" ); +}); + +test("filter(Element)", function() { + expect(1); + + var element = document.getElementById("text1"); + deepEqual( jQuery("#form input").filter(element).get(), q("text1"), "filter(Element)" ); +}); + +test("filter(Array)", function() { + expect(1); + + var elements = [ document.getElementById("text1") ]; + deepEqual( jQuery("#form input").filter(elements).get(), q("text1"), "filter(Element)" ); +}); + +test("filter(jQuery)", function() { + expect(1); + + var elements = jQuery("#text1"); + deepEqual( jQuery("#form input").filter(elements).get(), q("text1"), "filter(Element)" ); +}); + + +test("filter() with positional selectors", function() { + expect(19); + + var html = jQuery('' + + '<p id="posp">' + + '<a class="firsta" href="#">' + + '<em>first</em>' + + '</a>' + + '<a class="seconda" href="#">' + + '<b>test</b>' + + '</a>' + + '<em></em>' + + '</p>').appendTo( "body" ), + filterit = function(sel, filter, length) { + equal( jQuery( sel ).filter( filter ).length, length, "jQuery( " + sel + " ).filter( " + filter + " )" ); + }; + + filterit( "#posp", "#posp:first", 1); + filterit( "#posp", "#posp:eq(2)", 0 ); + filterit( "#posp", "#posp a:first", 0 ); + + // Keep in mind this is within the selection and + // not in relation to other elements (.is() is a different story) + filterit( "#posp .firsta", "#posp a:first", 1 ); + filterit( "#posp .firsta", "#posp a:last", 1 ); + filterit( "#posp .firsta", "#posp a:last-child", 0 ); + filterit( "#posp .firsta", "#posp a:even", 1 ); + filterit( "#posp .firsta", "#posp a:odd", 0 ); + filterit( "#posp .firsta", "#posp a:eq(0)", 1 ); + filterit( "#posp .firsta", "#posp a:eq(9)", 0 ); + filterit( "#posp .firsta", "#posp em:eq(0)", 0 ); + filterit( "#posp .firsta", "#posp em:first", 0 ); + filterit( "#posp .firsta", "#posp:first", 0 ); + + filterit( "#posp .seconda", "#posp a:first", 1 ); + filterit( "#posp .seconda", "#posp em:first", 0 ); + filterit( "#posp .seconda", "#posp a:last", 1 ); + filterit( "#posp .seconda", "#posp a:gt(0)", 0 ); + filterit( "#posp .seconda", "#posp a:lt(5)", 1 ); + filterit( "#posp .seconda", "#posp a:lt(1)", 1 ); + html.remove(); +}); + +test("closest()", function() { + expect(13); + deepEqual( jQuery("body").closest("body").get(), q("body"), "closest(body)" ); + deepEqual( jQuery("body").closest("html").get(), q("html"), "closest(html)" ); + deepEqual( jQuery("body").closest("div").get(), [], "closest(div)" ); + deepEqual( jQuery("#qunit-fixture").closest("span,#html").get(), q("html"), "closest(span,#html)" ); + + deepEqual( jQuery("div:eq(1)").closest("div:first").get(), [], "closest(div:first)" ); + deepEqual( jQuery("div").closest("body:first div:last").get(), q("fx-tests"), "closest(body:first div:last)" ); + + // Test .closest() limited by the context + var jq = jQuery("#nothiddendivchild"); + deepEqual( jq.closest("html", document.body).get(), [], "Context limited." ); + deepEqual( jq.closest("body", document.body).get(), [], "Context limited." ); + deepEqual( jq.closest("#nothiddendiv", document.body).get(), q("nothiddendiv"), "Context not reached." ); + + //Test that .closest() returns unique'd set + equal( jQuery("#qunit-fixture p").closest("#qunit-fixture").length, 1, "Closest should return a unique set" ); + + // Test on disconnected node + equal( jQuery("<div><p></p></div>").find("p").closest("table").length, 0, "Make sure disconnected closest work." ); + + // Bug #7369 + equal( jQuery("<div foo='bar'></div>").closest("[foo]").length, 1, "Disconnected nodes with attribute selector" ); + equal( jQuery("<div>text</div>").closest("[lang]").length, 0, "Disconnected nodes with text and non-existent attribute selector" ); +}); + +test("closest(Array)", function() { + expect(7); + deepEqual( jQuery("body").closest(["body"]), [{selector:"body", elem:document.body, level:1}], "closest([body])" ); + deepEqual( jQuery("body").closest(["html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([html])" ); + deepEqual( jQuery("body").closest(["div"]), [], "closest([div])" ); + deepEqual( jQuery("#yahoo").closest(["div"]), [{"selector":"div", "elem": document.getElementById("foo"), "level": 3}, { "selector": "div", "elem": document.getElementById("qunit-fixture"), "level": 4 }], "closest([div])" ); + deepEqual( jQuery("#qunit-fixture").closest(["span,#html"]), [{selector:"span,#html", elem:document.documentElement, level:4}], "closest([span,#html])" ); + + deepEqual( jQuery("body").closest(["body","html"]), [{selector:"body", elem:document.body, level:1}, {selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" ); + deepEqual( jQuery("body").closest(["span","html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" ); +}); + +test("closest(jQuery)", function() { + expect(8); + var $child = jQuery("#nothiddendivchild"), + $parent = jQuery("#nothiddendiv"), + $main = jQuery("#qunit-fixture"), + $body = jQuery("body"); + ok( $child.closest( $parent ).is("#nothiddendiv"), "closest( jQuery('#nothiddendiv') )" ); + ok( $child.closest( $parent[0] ).is("#nothiddendiv"), "closest( jQuery('#nothiddendiv') ) :: node" ); + ok( $child.closest( $child ).is("#nothiddendivchild"), "child is included" ); + ok( $child.closest( $child[0] ).is("#nothiddendivchild"), "child is included :: node" ); + equal( $child.closest( document.createElement("div") ).length, 0, "created element is not related" ); + equal( $child.closest( $main ).length, 0, "Main not a parent of child" ); + equal( $child.closest( $main[0] ).length, 0, "Main not a parent of child :: node" ); + ok( $child.closest( $body.add($parent) ).is("#nothiddendiv"), "Closest ancestor retrieved." ); +}); + +test("not(Selector|undefined)", function() { + expect(11); + equal( jQuery("#qunit-fixture > p#ap > a").not("#google").length, 2, "not('selector')" ); + deepEqual( jQuery("p").not(".result").get(), q("firstp", "ap", "sndp", "en", "sap", "first"), "not('.class')" ); + deepEqual( jQuery("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" ); + deepEqual( jQuery("#form option").not("option.emptyopt:contains('Nothing'),[selected],[value='1']").get(), q("option1c", "option1d", "option2c", "option3d", "option3e", "option4e","option5b"), "not('complex selector')"); + + deepEqual( jQuery("#ap *").not("code").get(), q("google", "groups", "anchor1", "mark"), "not('tag selector')" ); + deepEqual( jQuery("#ap *").not("code, #mark").get(), q("google", "groups", "anchor1"), "not('tag, ID selector')" ); + deepEqual( jQuery("#ap *").not("#mark, code").get(), q("google", "groups", "anchor1"), "not('ID, tag selector')"); + + var all = jQuery("p").get(); + deepEqual( jQuery("p").not(null).get(), all, "not(null) should have no effect"); + deepEqual( jQuery("p").not(undefined).get(), all, "not(undefined) should have no effect"); + deepEqual( jQuery("p").not(0).get(), all, "not(0) should have no effect"); + deepEqual( jQuery("p").not("").get(), all, "not('') should have no effect"); +}); + +test("not(Element)", function() { + expect(1); + + var selects = jQuery("#form select"); + deepEqual( selects.not( selects[1] ).get(), q("select1", "select3", "select4", "select5"), "filter out DOM element"); +}); + +test("not(Function)", function() { + deepEqual( jQuery("#qunit-fixture p").not(function() { return jQuery("a", this).length }).get(), q("sndp", "first"), "not(Function)" ); +}); + +test("not(Array)", function() { + expect(2); + + equal( jQuery("#qunit-fixture > p#ap > a").not(document.getElementById("google")).length, 2, "not(DOMElement)" ); + equal( jQuery("p").not(document.getElementsByTagName("p")).length, 0, "not(Array-like DOM collection)" ); +}); + +test("not(jQuery)", function() { + expect(1); + + deepEqual( jQuery("p").not(jQuery("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" ); +}); + +test("has(Element)", function() { + expect(2); + + var obj = jQuery("#qunit-fixture").has(jQuery("#sndp")[0]); + deepEqual( obj.get(), q("qunit-fixture"), "Keeps elements that have the element as a descendant" ); + + var multipleParent = jQuery("#qunit-fixture, #header").has(jQuery("#sndp")[0]); + deepEqual( obj.get(), q("qunit-fixture"), "Does not include elements that do not have the element as a descendant" ); +}); + +test("has(Selector)", function() { + expect(3); + + var obj = jQuery("#qunit-fixture").has("#sndp"); + deepEqual( obj.get(), q("qunit-fixture"), "Keeps elements that have any element matching the selector as a descendant" ); + + var multipleParent = jQuery("#qunit-fixture, #header").has("#sndp"); + deepEqual( obj.get(), q("qunit-fixture"), "Does not include elements that do not have the element as a descendant" ); + + var multipleHas = jQuery("#qunit-fixture").has("#sndp, #first"); + deepEqual( multipleHas.get(), q("qunit-fixture"), "Only adds elements once" ); +}); + +test("has(Arrayish)", function() { + expect(3); + + var simple = jQuery("#qunit-fixture").has(jQuery("#sndp")); + deepEqual( simple.get(), q("qunit-fixture"), "Keeps elements that have any element in the jQuery list as a descendant" ); + + var multipleParent = jQuery("#qunit-fixture, #header").has(jQuery("#sndp")); + deepEqual( multipleParent.get(), q("qunit-fixture"), "Does not include elements that do not have an element in the jQuery list as a descendant" ); + + var multipleHas = jQuery("#qunit-fixture").has(jQuery("#sndp, #first")); + deepEqual( simple.get(), q("qunit-fixture"), "Only adds elements once" ); +}); + +test("andSelf()", function() { + expect(4); + deepEqual( jQuery("#en").siblings().andSelf().get(), q("sndp", "en", "sap"), "Check for siblings and self" ); + deepEqual( jQuery("#foo").children().andSelf().get(), q("foo", "sndp", "en", "sap"), "Check for children and self" ); + deepEqual( jQuery("#sndp, #en").parent().andSelf().get(), q("foo","sndp","en"), "Check for parent and self" ); + deepEqual( jQuery("#groups").parents("p, div").andSelf().get(), q("qunit-fixture", "ap", "groups"), "Check for parents and self" ); +}); + +test("siblings([String])", function() { + expect(6); + deepEqual( jQuery("#en").siblings().get(), q("sndp", "sap"), "Check for siblings" ); + deepEqual( jQuery("#sndp").siblings(":has(code)").get(), q("sap"), "Check for filtered siblings (has code child element)" ); + deepEqual( jQuery("#sndp").siblings(":has(a)").get(), q("en", "sap"), "Check for filtered siblings (has anchor child element)" ); + deepEqual( jQuery("#foo").siblings("form, b").get(), q("form", "floatTest", "lengthtest", "name-tests", "testForm"), "Check for multiple filters" ); + var set = q("sndp", "en", "sap"); + deepEqual( jQuery("#en, #sndp").siblings().get(), set, "Check for unique results from siblings" ); + deepEqual( jQuery("#option5a").siblings("option[data-attr]").get(), q("option5c"), "Has attribute selector in siblings (#9261)" ); +}); + +test("children([String])", function() { + expect(3); + deepEqual( jQuery("#foo").children().get(), q("sndp", "en", "sap"), "Check for children" ); + deepEqual( jQuery("#foo").children(":has(code)").get(), q("sndp", "sap"), "Check for filtered children" ); + deepEqual( jQuery("#foo").children("#en, #sap").get(), q("en", "sap"), "Check for multiple filters" ); +}); + +test("parent([String])", function() { + expect(5); + equal( jQuery("#groups").parent()[0].id, "ap", "Simple parent check" ); + equal( jQuery("#groups").parent("p")[0].id, "ap", "Filtered parent check" ); + equal( jQuery("#groups").parent("div").length, 0, "Filtered parent check, no match" ); + equal( jQuery("#groups").parent("div, p")[0].id, "ap", "Check for multiple filters" ); + deepEqual( jQuery("#en, #sndp").parent().get(), q("foo"), "Check for unique results from parent" ); +}); + +test("parents([String])", function() { + expect(5); + equal( jQuery("#groups").parents()[0].id, "ap", "Simple parents check" ); + equal( jQuery("#groups").parents("p")[0].id, "ap", "Filtered parents check" ); + equal( jQuery("#groups").parents("div")[0].id, "qunit-fixture", "Filtered parents check2" ); + deepEqual( jQuery("#groups").parents("p, div").get(), q("ap", "qunit-fixture"), "Check for multiple filters" ); + deepEqual( jQuery("#en, #sndp").parents().get(), q("foo", "qunit-fixture", "dl", "body", "html"), "Check for unique results from parents" ); +}); + +test("parentsUntil([String])", function() { + expect(9); + + var parents = jQuery("#groups").parents(); + + deepEqual( jQuery("#groups").parentsUntil().get(), parents.get(), "parentsUntil with no selector (nextAll)" ); + deepEqual( jQuery("#groups").parentsUntil(".foo").get(), parents.get(), "parentsUntil with invalid selector (nextAll)" ); + deepEqual( jQuery("#groups").parentsUntil("#html").get(), parents.not(":last").get(), "Simple parentsUntil check" ); + equal( jQuery("#groups").parentsUntil("#ap").length, 0, "Simple parentsUntil check" ); + deepEqual( jQuery("#groups").parentsUntil("#html, #body").get(), parents.slice( 0, 3 ).get(), "Less simple parentsUntil check" ); + deepEqual( jQuery("#groups").parentsUntil("#html", "div").get(), jQuery("#qunit-fixture").get(), "Filtered parentsUntil check" ); + deepEqual( jQuery("#groups").parentsUntil("#html", "p,div,dl").get(), parents.slice( 0, 3 ).get(), "Multiple-filtered parentsUntil check" ); + equal( jQuery("#groups").parentsUntil("#html", "span").length, 0, "Filtered parentsUntil check, no match" ); + deepEqual( jQuery("#groups, #ap").parentsUntil("#html", "p,div,dl").get(), parents.slice( 0, 3 ).get(), "Multi-source, multiple-filtered parentsUntil check" ); +}); + +test("next([String])", function() { + expect(4); + equal( jQuery("#ap").next()[0].id, "foo", "Simple next check" ); + equal( jQuery("#ap").next("div")[0].id, "foo", "Filtered next check" ); + equal( jQuery("#ap").next("p").length, 0, "Filtered next check, no match" ); + equal( jQuery("#ap").next("div, p")[0].id, "foo", "Multiple filters" ); +}); + +test("prev([String])", function() { + expect(4); + equal( jQuery("#foo").prev()[0].id, "ap", "Simple prev check" ); + equal( jQuery("#foo").prev("p")[0].id, "ap", "Filtered prev check" ); + equal( jQuery("#foo").prev("div").length, 0, "Filtered prev check, no match" ); + equal( jQuery("#foo").prev("p, div")[0].id, "ap", "Multiple filters" ); +}); + +test("nextAll([String])", function() { + expect(4); + + var elems = jQuery("#form").children(); + + deepEqual( jQuery("#label-for").nextAll().get(), elems.not(":first").get(), "Simple nextAll check" ); + deepEqual( jQuery("#label-for").nextAll("input").get(), elems.not(":first").filter("input").get(), "Filtered nextAll check" ); + deepEqual( jQuery("#label-for").nextAll("input,select").get(), elems.not(":first").filter("input,select").get(), "Multiple-filtered nextAll check" ); + deepEqual( jQuery("#label-for, #hidden1").nextAll("input,select").get(), elems.not(":first").filter("input,select").get(), "Multi-source, multiple-filtered nextAll check" ); +}); + +test("prevAll([String])", function() { + expect(4); + + var elems = jQuery( jQuery("#form").children().slice(0, 12).get().reverse() ); + + deepEqual( jQuery("#area1").prevAll().get(), elems.get(), "Simple prevAll check" ); + deepEqual( jQuery("#area1").prevAll("input").get(), elems.filter("input").get(), "Filtered prevAll check" ); + deepEqual( jQuery("#area1").prevAll("input,select").get(), elems.filter("input,select").get(), "Multiple-filtered prevAll check" ); + deepEqual( jQuery("#area1, #hidden1").prevAll("input,select").get(), elems.filter("input,select").get(), "Multi-source, multiple-filtered prevAll check" ); +}); + +test("nextUntil([String])", function() { + expect(11); + + var elems = jQuery("#form").children().slice( 2, 12 ); + + deepEqual( jQuery("#text1").nextUntil().get(), jQuery("#text1").nextAll().get(), "nextUntil with no selector (nextAll)" ); + deepEqual( jQuery("#text1").nextUntil(".foo").get(), jQuery("#text1").nextAll().get(), "nextUntil with invalid selector (nextAll)" ); + deepEqual( jQuery("#text1").nextUntil("#area1").get(), elems.get(), "Simple nextUntil check" ); + equal( jQuery("#text1").nextUntil("#text2").length, 0, "Simple nextUntil check" ); + deepEqual( jQuery("#text1").nextUntil("#area1, #radio1").get(), jQuery("#text1").next().get(), "Less simple nextUntil check" ); + deepEqual( jQuery("#text1").nextUntil("#area1", "input").get(), elems.not("button").get(), "Filtered nextUntil check" ); + deepEqual( jQuery("#text1").nextUntil("#area1", "button").get(), elems.not("input").get(), "Filtered nextUntil check" ); + deepEqual( jQuery("#text1").nextUntil("#area1", "button,input").get(), elems.get(), "Multiple-filtered nextUntil check" ); + equal( jQuery("#text1").nextUntil("#area1", "div").length, 0, "Filtered nextUntil check, no match" ); + deepEqual( jQuery("#text1, #hidden1").nextUntil("#area1", "button,input").get(), elems.get(), "Multi-source, multiple-filtered nextUntil check" ); + + deepEqual( jQuery("#text1").nextUntil("[class=foo]").get(), jQuery("#text1").nextAll().get(), "Non-element nodes must be skipped, since they have no attributes" ); +}); + +test("prevUntil([String])", function() { + expect(10); + + var elems = jQuery("#area1").prevAll(); + + deepEqual( jQuery("#area1").prevUntil().get(), elems.get(), "prevUntil with no selector (prevAll)" ); + deepEqual( jQuery("#area1").prevUntil(".foo").get(), elems.get(), "prevUntil with invalid selector (prevAll)" ); + deepEqual( jQuery("#area1").prevUntil("label").get(), elems.not(":last").get(), "Simple prevUntil check" ); + equal( jQuery("#area1").prevUntil("#button").length, 0, "Simple prevUntil check" ); + deepEqual( jQuery("#area1").prevUntil("label, #search").get(), jQuery("#area1").prev().get(), "Less simple prevUntil check" ); + deepEqual( jQuery("#area1").prevUntil("label", "input").get(), elems.not(":last").not("button").get(), "Filtered prevUntil check" ); + deepEqual( jQuery("#area1").prevUntil("label", "button").get(), elems.not(":last").not("input").get(), "Filtered prevUntil check" ); + deepEqual( jQuery("#area1").prevUntil("label", "button,input").get(), elems.not(":last").get(), "Multiple-filtered prevUntil check" ); + equal( jQuery("#area1").prevUntil("label", "div").length, 0, "Filtered prevUntil check, no match" ); + deepEqual( jQuery("#area1, #hidden1").prevUntil("label", "button,input").get(), elems.not(":last").get(), "Multi-source, multiple-filtered prevUntil check" ); +}); + +test("contents()", function() { + expect(12); + equal( jQuery("#ap").contents().length, 9, "Check element contents" ); + ok( jQuery("#iframe").contents()[0], "Check existance of IFrame document" ); + var ibody = jQuery("#loadediframe").contents()[0].body; + ok( ibody, "Check existance of IFrame body" ); + + equal( jQuery("span", ibody).text(), "span text", "Find span in IFrame and check its text" ); + + jQuery(ibody).append("<div>init text</div>"); + equal( jQuery("div", ibody).length, 2, "Check the original div and the new div are in IFrame" ); + + equal( jQuery("div:last", ibody).text(), "init text", "Add text to div in IFrame" ); + + jQuery("div:last", ibody).text("div text"); + equal( jQuery("div:last", ibody).text(), "div text", "Add text to div in IFrame" ); + + jQuery("div:last", ibody).remove(); + equal( jQuery("div", ibody).length, 1, "Delete the div and check only one div left in IFrame" ); + + equal( jQuery("div", ibody).text(), "span text", "Make sure the correct div is still left after deletion in IFrame" ); + + jQuery("<table/>", ibody).append("<tr><td>cell</td></tr>").appendTo(ibody); + jQuery("table", ibody).remove(); + equal( jQuery("div", ibody).length, 1, "Check for JS error on add and delete of a table in IFrame" ); + + // using contents will get comments regular, text, and comment nodes + var c = jQuery("#nonnodes").contents().contents(); + equal( c.length, 1, "Check node,textnode,comment contents is just one" ); + equal( c[0].nodeValue, "hi", "Check node,textnode,comment contents is just the one from span" ); +}); + +test("add(String|Element|Array|undefined)", function() { + expect(16); + deepEqual( jQuery("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" ); + deepEqual( jQuery("#sndp").add( jQuery("#en")[0] ).add( jQuery("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" ); + + // We no longer support .add(form.elements), unfortunately. + // There is no way, in browsers, to reliably determine the difference + // between form.elements and form - and doing .add(form) and having it + // add the form elements is way to unexpected, so this gets the boot. + // ok( jQuery([]).add(jQuery("#form")[0].elements).length >= 13, "Check elements from array" ); + + // For the time being, we're discontinuing support for jQuery(form.elements) since it's ambiguous in IE + // use jQuery([]).add(form.elements) instead. + //equal( jQuery([]).add(jQuery("#form")[0].elements).length, jQuery(jQuery("#form")[0].elements).length, "Array in constructor must equals array in add()" ); + + var divs = jQuery("<div/>").add("#sndp"); + ok( !divs[0].parentNode, "Make sure the first element is still the disconnected node." ); + + divs = jQuery("<div>test</div>").add("#sndp"); + equal( divs[0].parentNode.nodeType, 11, "Make sure the first element is still the disconnected node." ); + + divs = jQuery("#sndp").add("<div/>"); + ok( !divs[1].parentNode, "Make sure the first element is still the disconnected node." ); + + var tmp = jQuery("<div/>"); + + var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>").appendTo(tmp)).add(jQuery("<p id='x2'>xxx</p>").appendTo(tmp)); + equal( x[0].id, "x1", "Check on-the-fly element1" ); + equal( x[1].id, "x2", "Check on-the-fly element2" ); + + var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>").appendTo(tmp)[0]).add(jQuery("<p id='x2'>xxx</p>").appendTo(tmp)[0]); + equal( x[0].id, "x1", "Check on-the-fly element1" ); + equal( x[1].id, "x2", "Check on-the-fly element2" ); + + var x = jQuery([]).add(jQuery("<p id='x1'>xxx</p>")).add(jQuery("<p id='x2'>xxx</p>")); + equal( x[0].id, "x1", "Check on-the-fly element1" ); + equal( x[1].id, "x2", "Check on-the-fly element2" ); + + var x = jQuery([]).add("<p id='x1'>xxx</p>").add("<p id='x2'>xxx</p>"); + equal( x[0].id, "x1", "Check on-the-fly element1" ); + equal( x[1].id, "x2", "Check on-the-fly element2" ); + + var notDefined; + equal( jQuery([]).add(notDefined).length, 0, "Check that undefined adds nothing" ); + + equal( jQuery([]).add( document.getElementById("form") ).length, 1, "Add a form" ); + equal( jQuery([]).add( document.getElementById("select1") ).length, 1, "Add a select" ); +}); + +test("add(String, Context)", function() { + expect(6); + + deepEqual( jQuery( "#firstp" ).add( "#ap" ).get(), q( "firstp", "ap" ), "Add selector to selector " ); + deepEqual( jQuery( document.getElementById("firstp") ).add( "#ap" ).get(), q( "firstp", "ap" ), "Add gEBId to selector" ); + deepEqual( jQuery( document.getElementById("firstp") ).add( document.getElementById("ap") ).get(), q( "firstp", "ap" ), "Add gEBId to gEBId" ); + + var ctx = document.getElementById("firstp"); + deepEqual( jQuery( "#firstp" ).add( "#ap", ctx ).get(), q( "firstp" ), "Add selector to selector " ); + deepEqual( jQuery( document.getElementById("firstp") ).add( "#ap", ctx ).get(), q( "firstp" ), "Add gEBId to selector, not in context" ); + deepEqual( jQuery( document.getElementById("firstp") ).add( "#ap", document.getElementsByTagName("body")[0] ).get(), q( "firstp", "ap" ), "Add gEBId to selector, in context" ); +}); + +test("eq('-1') #10616", function() { + expect(3); + var $divs = jQuery( "div" ); + + equal( $divs.eq( -1 ).length, 1, "The number -1 returns a selection that has length 1" ); + equal( $divs.eq( "-1" ).length, 1, "The string '-1' returns a selection that has length 1" ); + deepEqual( $divs.eq( "-1" ), $divs.eq( -1 ), "String and number -1 match" ); +}); + diff --git a/npm_assets/node_modules/html5shiv/test/mixed-test.html b/npm_assets/node_modules/html5shiv/test/mixed-test.html new file mode 100644 index 0000000..8346ae1 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/mixed-test.html @@ -0,0 +1,99 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>IEPP Test Suite</title> + <link rel="stylesheet" href="data/inline-mixed-media.css"> + <link rel="stylesheet" href="data/inline-print-media.css"> + <link rel="stylesheet" href="data/print.css" media="print"> + <link rel="stylesheet" href="data/screen.css" media="screen, projection"> + <link rel="stylesheet" href="data/print-styles.css" media="print"> + <style> + body { + background: url(data/body-crash.jpg) no-repeat; + } + </style> + <style> + form { + margin: 0; + } + article#inline-print { + border: 5px solid #000; + } + section div article { + border: 5px solid #000; + } + section[data-article="article"] { + border: 5px solid #000; + } + </style> + <style media="print"> + article#inline-print { + border: 5px dotted #000; + } + section div article { + border: 5px dotted #000; + } + section[data-article="article"] { + border: 5px dotted #000; + } + p+article { + text-decoration: underline; + } + </style> + <script src="../src/html5shiv-printshiv.js"></script> + + <script src="//use.typekit.com/fbz1vwc.js"></script> + <script> + Typekit.load(); + </script> + </head> + <body id="print-body-id" class="print-body-class"> + <h1> + Print Me in IE! + </h1> + <p>You should see dotted broders in print.</p> + <article class="inline-mixed-media"> + <p> + 1. This text should be underlined in IE7+. + </p> + </article> + <article class="inline-print-media"> + <form action="/test/ test"> + <div class="inside-of-form">2. inside print</div> + </form> + </article> + <article class="print"> + <p> + 3. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam non + </p> + </article> + <div class="print-styles"> + <article> + <p> + 4. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam non + </p> + </article> + </div> + <article class="print-styles-print"> + <p> + 5. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam non + </p> + </article> + <section> + <div data-article="article"> + <article> + <p> + 6. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam non + </p> + + <section data-article="article"> + <p> + 7. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam non + </p> + </section> + </article> + </div> + </section> + </body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/object-test.html b/npm_assets/node_modules/html5shiv/test/object-test.html new file mode 100644 index 0000000..11c8970 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/object-test.html @@ -0,0 +1,78 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>HTML5 Shiv</title> + <link rel="stylesheet" href="style.css"> + <style> + .box { + position: relative; + zoom: 1; + } + .swf-overlay { + position: absolute; + top: 0; + left: 0; + width: 200px; + height: 100px; + border: 1px solid #000; + } + </style> + <script src="../src/html5shiv.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> + <script> + swfobject.registerObject('static-id', '6.0.0'); + swfobject.embedSWF('data/paramtracer.swf', 'dynamic-id', '480', '420', '6.0.0', null, { 'aFlashVar': 'aFlashVarValue' }, { 'wmode': 'transparent' }); + </script> + </head> + <body> + <section>This sentence has 3px solid border <mark>with these words highlighted</mark>.</section> + <h1>static swfobject</h1> + <div class="box"> + <object id="static-id" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="420"> + <param name="movie" value="data/paramtracer.swf"> + <!--[if !IE]>--> + <object type="application/x-shockwave-flash" data="data/paramtracer.swf" width="480" height="420"> + <!--<![endif]--> + <param name="flashvars" value="aFlashVar=aFlashVarValue"> + <param name="wmode" value="transparent"> + <!--[if !IE]>--> + </object> + <!--<![endif]--> + </object> + <div class="swf-overlay"></div> + </div> + + <h1>dynamic swfobject</h1> + <div class="box"> + <div id="dynamic-id"> + </div> + <div class="swf-overlay"></div> + </div> + + <h1>innerHTML object</h1> + <div class="box" id="checkinner"> + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="420"> + <param name="movie" value="data/paramtracer.swf"> + <!--[if !IE]>--> + <object type="application/x-shockwave-flash" data="data/paramtracer.swf" width="480" height="420"> + <!--<![endif]--> + <param name="flashvars" value="aFlashVar=aFlashVarValue"> + <param name="wmode" value="transparent"> + <!--[if !IE]>--> + </object> + <!--<![endif]--> + </object> + <div class="swf-overlay"></div> + </div> + <script> + (function(){ + var box = document.getElementById('checkinner'); + var box2 = document.createElement('div'); + box2.innerHTML = box.innerHTML; + box.innerHTML = ''; + box.appendChild(box2); + })(); + </script> + <body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/perf.1.html b/npm_assets/node_modules/html5shiv/test/perf.1.html new file mode 100644 index 0000000..62890ef --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/perf.1.html @@ -0,0 +1,41 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>HTML5 Shiv</title> + <link rel="stylesheet" href="style.css"> + <script src="../src/html5shiv-printshiv.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script> + </head> + <body> + <div id="time"></div> + <section>This sentence is in a green box <mark>with these words highlighted</mark>.</section> + <script> + function addDom(){ + var div, frag, fragDiv, divFrag, divFragDiv; + div = document.createElement('div'); + div.innerHTML = '<section>This native javascript sentence is in a green box <mark>with these words highlighted</mark>?</section>'; + + frag = document.createDocumentFragment(); + frag.appendChild(div); + div.innerHTML += '<section>This native javascript sentence is also in a green box <mark>with these words highlighted</mark>?</section>'; + document.body.appendChild(frag); + + frag = document.createDocumentFragment(); + fragDiv = frag.appendChild(document.createElement('div')); + fragDiv.innerHTML = '<section>This native javascript sentence is in a green box <mark>with these words highlighted</mark>?</section>'; + document.body.appendChild(fragDiv); + + jQuery(document.body).append('<section>This jQuery 1.6.4 sentence is in a green box <mark>with these words highlighted</mark>?</section><section>This jQuery 1.6.4 sentence is in a green box <mark>with these words highlighted</mark>?</section>'); + } + + var time = document.getElementById('time'); + var cur = new Date().getTime(); + + for(var i = 0; i < 1000; i++){ + addDom(); + } + time.innerHTML = new Date().getTime() - cur; + </script> + <body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/perf.2.html b/npm_assets/node_modules/html5shiv/test/perf.2.html new file mode 100644 index 0000000..2886320 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/perf.2.html @@ -0,0 +1,28 @@ +<!doctype html> +<html> + <head> + <meta charset="utf-8"> + <title>HTML5 Shiv</title> + <link rel="stylesheet" href="style.css"> + <script src="../src/html5shiv-printshiv.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script> + </head> + <body> + <div id="time"></div> + <section>This sentence is in a green box <mark>with these words highlighted</mark>.</section> + <script> + function addDom(){ + document.createElement('div'); + document.createDocumentFragment(); + } + + var time = document.getElementById('time'); + var cur = new Date().getTime(); + + for(var i = 0; i < 10000; i++){ + addDom(); + } + time.innerHTML = new Date().getTime() - cur; + </script> + <body> +</html>
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/qunit/qunit.css b/npm_assets/node_modules/html5shiv/test/qunit/qunit.css new file mode 100644 index 0000000..bcecc4c --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/qunit/qunit.css @@ -0,0 +1,226 @@ +/** + * QUnit v1.2.0 - A JavaScript Unit Testing Framework + * + * http://docs.jquery.com/QUnit + * + * Copyright (c) 2011 John Resig, Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * or GPL (GPL-LICENSE.txt) licenses. + */ + +/** 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-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { + 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: 15px 15px 0 0; + -moz-border-radius: 15px 15px 0 0; + -webkit-border-top-right-radius: 15px; + -webkit-border-top-left-radius: 15px; +} + +#qunit-header a { + text-decoration: none; + color: #c2ccd1; +} + +#qunit-header a:hover, +#qunit-header a:focus { + color: #fff; +} + +#qunit-banner { + height: 5px; +} + +#qunit-testrunner-toolbar { + padding: 0.5em 0 0.5em 2em; + color: #5E740B; + background-color: #eee; +} + +#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; +} + + +/** 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 ol { + margin-top: 0.5em; + padding: 0.5em; + + background-color: #fff; + + border-radius: 15px; + -moz-border-radius: 15px; + -webkit-border-radius: 15px; + + box-shadow: inset 0px 2px 13px #999; + -moz-box-shadow: inset 0px 2px 13px #999; + -webkit-box-shadow: inset 0px 2px 13px #999; +} + +#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 { + margin: 0.5em; + padding: 0.4em 0.5em 0.4em 0.5em; + background-color: #fff; + border-bottom: none; + list-style-position: inside; +} + +/*** Passing Styles */ + +#qunit-tests li li.pass { + color: #5E740B; + background-color: #fff; + border-left: 26px 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: 26px solid #EE5757; + white-space: pre; +} + +#qunit-tests > li:last-child { + border-radius: 0 0 15px 15px; + -moz-border-radius: 0 0 15px 15px; + -webkit-border-bottom-right-radius: 15px; + -webkit-border-bottom-left-radius: 15px; +} + +#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; +} + +/** Fixture */ + +#qunit-fixture { + position: absolute; + top: -10000px; + left: -10000px; +} diff --git a/npm_assets/node_modules/html5shiv/test/qunit/qunit.js b/npm_assets/node_modules/html5shiv/test/qunit/qunit.js new file mode 100644 index 0000000..6d2a8a7 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/qunit/qunit.js @@ -0,0 +1,1597 @@ +/** + * QUnit v1.2.0 - A JavaScript Unit Testing Framework + * + * http://docs.jquery.com/QUnit + * + * Copyright (c) 2011 John Resig, Jörn Zaefferer + * Dual licensed under the MIT (MIT-LICENSE.txt) + * or GPL (GPL-LICENSE.txt) licenses. + */ + +(function(window) { + +var defined = { + setTimeout: typeof window.setTimeout !== "undefined", + sessionStorage: (function() { + try { + return !!sessionStorage.getItem; + } catch(e) { + return false; + } + })() +}; + +var testId = 0, + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty; + +var Test = function(name, testName, expected, testEnvironmentArg, async, callback) { + this.name = name; + this.testName = testName; + this.expected = expected; + this.testEnvironmentArg = testEnvironmentArg; + this.async = async; + this.callback = callback; + this.assertions = []; +}; +Test.prototype = { + init: function() { + var tests = id("qunit-tests"); + if (tests) { + var b = document.createElement("strong"); + b.innerHTML = "Running " + this.name; + var li = document.createElement("li"); + li.appendChild( b ); + li.className = "running"; + li.id = this.id = "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 + } ); + } + + config.current = this; + this.testEnvironment = extend({ + setup: function() {}, + teardown: function() {} + }, this.moduleTestEnvironment); + if (this.testEnvironmentArg) { + extend(this.testEnvironment, this.testEnvironmentArg); + } + + 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; + + try { + if ( !config.pollution ) { + saveGlobal(); + } + + this.testEnvironment.setup.call(this.testEnvironment); + } catch(e) { + QUnit.ok( false, "Setup failed on " + this.testName + ": " + e.message ); + } + }, + run: function() { + config.current = this; + if ( this.async ) { + QUnit.stop(); + } + + if ( config.notrycatch ) { + this.callback.call(this.testEnvironment); + return; + } + try { + this.callback.call(this.testEnvironment); + } catch(e) { + fail("Test " + this.testName + " died, exception and test follows", e, this.callback); + QUnit.ok( false, "Died on test #" + (this.assertions.length + 1) + ": " + e.message + " - " + QUnit.jsDump.parse(e) ); + // 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; + try { + this.testEnvironment.teardown.call(this.testEnvironment); + checkPollution(); + } catch(e) { + QUnit.ok( false, "Teardown failed on " + this.testName + ": " + e.message ); + } + }, + finish: function() { + config.current = this; + if ( this.expected != null && this.expected != this.assertions.length ) { + QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" ); + } + + var good = 0, bad = 0, + tests = id("qunit-tests"); + + config.stats.all += this.assertions.length; + config.moduleStats.all += this.assertions.length; + + if ( tests ) { + var ol = document.createElement("ol"); + + for ( var i = 0; i < this.assertions.length; i++ ) { + var assertion = this.assertions[i]; + + var 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-" + this.module + "-" + this.testName, bad); + } else { + sessionStorage.removeItem("qunit-" + this.module + "-" + this.testName); + } + } + + if (bad == 0) { + ol.style.display = "none"; + } + + var b = document.createElement("strong"); + b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>"; + + var a = document.createElement("a"); + a.innerHTML = "Rerun"; + a.href = QUnit.url({ filter: getText([b]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") }); + + addEvent(b, "click", function() { + var next = b.nextSibling.nextSibling, + display = next.style.display; + next.style.display = display === "none" ? "block" : "none"; + }); + + 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({ filter: getText([target]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") }); + } + }); + + var li = id(this.id); + li.className = bad ? "fail" : "pass"; + li.removeChild( li.firstChild ); + li.appendChild( b ); + li.appendChild( a ); + li.appendChild( ol ); + + } else { + for ( var i = 0; i < this.assertions.length; i++ ) { + if ( !this.assertions[i].result ) { + bad++; + config.stats.bad++; + config.moduleStats.bad++; + } + } + } + + try { + QUnit.reset(); + } catch(e) { + fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset); + } + + runLoggingCallbacks( 'testDone', QUnit, { + name: this.testName, + module: this.module, + failed: bad, + passed: this.assertions.length - bad, + total: this.assertions.length + } ); + }, + + queue: function() { + var 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(); + }); + } + // defer when previous test run passed, if storage is available + var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-" + this.module + "-" + this.testName); + if (bad) { + run(); + } else { + synchronize(run, true); + }; + } + +}; + +var QUnit = { + + // call on start of module test to prepend name to all tests + module: function(name, testEnvironment) { + config.currentModule = name; + config.currentModuleTestEnviroment = testEnvironment; + }, + + 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 name = '<span class="test-name">' + testName + '</span>', testEnvironmentArg; + + if ( arguments.length === 2 ) { + callback = expected; + expected = null; + } + // is 2nd argument a testEnvironment? + if ( expected && typeof expected === 'object') { + testEnvironmentArg = expected; + expected = null; + } + + if ( config.currentModule ) { + name = '<span class="module-name">' + config.currentModule + "</span>: " + name; + } + + if ( !validTest(config.currentModule + ": " + testName) ) { + return; + } + + var test = new Test(name, testName, expected, testEnvironmentArg, async, callback); + test.module = config.currentModule; + test.moduleTestEnvironment = config.currentModuleTestEnviroment; + 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) { + config.current.expected = asserts; + }, + + /** + * Asserts true. + * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); + */ + ok: function(a, msg) { + a = !!a; + var details = { + result: a, + message: msg + }; + msg = escapeInnerText(msg); + runLoggingCallbacks( 'log', QUnit, details ); + config.current.assertions.push({ + result: a, + message: msg + }); + }, + + /** + * Checks that the first two arguments are equal, with an optional message. + * Prints out both actual and expected values. + * + * Prefered to ok( actual == expected, message ) + * + * @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." ); + * + * @param Object actual + * @param Object expected + * @param String message (optional) + */ + equal: function(actual, expected, message) { + QUnit.push(expected == actual, actual, expected, message); + }, + + notEqual: function(actual, expected, message) { + QUnit.push(expected != actual, actual, expected, message); + }, + + deepEqual: function(actual, expected, message) { + QUnit.push(QUnit.equiv(actual, expected), actual, expected, message); + }, + + notDeepEqual: function(actual, expected, message) { + QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message); + }, + + strictEqual: function(actual, expected, message) { + QUnit.push(expected === actual, actual, expected, message); + }, + + notStrictEqual: function(actual, expected, message) { + QUnit.push(expected !== actual, actual, expected, message); + }, + + raises: function(block, expected, message) { + var actual, ok = false; + + if (typeof expected === 'string') { + message = expected; + expected = null; + } + + try { + block(); + } catch (e) { + actual = e; + } + + if (actual) { + // we don't want to validate thrown error + if (!expected) { + ok = true; + // expected is a regexp + } else if (QUnit.objectType(expected) === "regexp") { + ok = expected.test(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) { + ok = true; + } + } + + QUnit.ok(ok, message); + }, + + start: function(count) { + config.semaphore -= count || 1; + if (config.semaphore > 0) { + // don't start until equal number of stop-calls + return; + } + if (config.semaphore < 0) { + // ignore if start is called more often then stop + config.semaphore = 0; + } + // 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); + } + } +}; + +//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; +})(); + +// Backwards compatibility, deprecated +QUnit.equals = QUnit.equal; +QUnit.same = QUnit.deepEqual; + +// Maintain internal state +var 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, + + urlConfig: ['noglobals', 'notrycatch'], + + //logging callback queues + begin: [], + done: [], + log: [], + testStart: [], + testDone: [], + moduleStart: [], + moduleDone: [] +}; + +// Load paramaters +(function() { + var location = window.location || { search: "", protocol: "file:" }, + params = location.search.slice( 1 ).split( "&" ), + length = params.length, + urlParams = {}, + current; + + if ( params[ 0 ] ) { + for ( var 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; + config.filter = urlParams.filter; + + // Figure out if we're running the tests from a server or not + QUnit.isLocal = !!(location.protocol === 'file:'); +})(); + +// Expose the API as global variables, unless an 'exports' +// object exists, in that case we assume we're in CommonJS +if ( typeof exports === "undefined" || typeof require === "undefined" ) { + extend(window, QUnit); + window.QUnit = QUnit; +} else { + extend(exports, QUnit); + exports.QUnit = QUnit; +} + +// define these after exposing globals to keep them in these QUnit namespace only +extend(QUnit, { + 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: 0 + }); + + var 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. + * + * If jQuery is available, uses jQuery's html(), otherwise just innerHTML. + */ + reset: function() { + if ( window.jQuery ) { + jQuery( "#qunit-fixture" ).html( config.fixture ); + } else { + var main = id( 'qunit-fixture' ); + if ( main ) { + main.innerHTML = config.fixture; + } + } + }, + + /** + * Trigger an event on an element. + * + * @example triggerEvent( document.body, "click" ); + * + * @param DOMElement elem + * @param String type + */ + 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 type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || ''; + + switch (type) { + case 'Number': + if (isNaN(obj)) { + return "nan"; + } else { + 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) { + var details = { + result: result, + message: message, + actual: actual, + expected: expected + }; + + message = escapeInnerText(message) || (result ? "okay" : "failed"); + message = '<span class="test-message">' + message + "</span>"; + expected = escapeInnerText(QUnit.jsDump.parse(expected)); + actual = escapeInnerText(QUnit.jsDump.parse(actual)); + var output = message + '<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>'; + } + if (!result) { + var source = sourceFromStacktrace(); + if (source) { + details.source = source; + output += '<tr class="test-source"><th>Source: </th><td><pre>' + escapeInnerText(source) + '</pre></td></tr>'; + } + } + output += "</table>"; + + runLoggingCallbacks( 'log', QUnit, details ); + + config.current.assertions.push({ + result: !!result, + message: output + }); + }, + + url: function( params ) { + params = extend( extend( {}, QUnit.urlParams ), params ); + var querystring = "?", + key; + for ( key in params ) { + if ( !hasOwn.call( params, key ) ) { + continue; + } + querystring += encodeURIComponent( key ) + "=" + + encodeURIComponent( params[ key ] ) + "&"; + } + return window.location.pathname + querystring.slice( 0, -1 ); + }, + + extend: extend, + id: id, + addEvent: addEvent +}); + +//QUnit.constructor is set to the empty F() above so that we can add to it's prototype later +//Doing this allows us to tell if the following methods have been overwritten on the actual +//QUnit object, which is a deprecated way of using the callbacks. +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 } + 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 oldconfig = extend({}, config); + QUnit.init(); + extend(config, oldconfig); + + config.blocking = false; + + var urlConfigHtml = '', len = config.urlConfig.length; + for ( var i = 0, val; i < len, val = config.urlConfig[i]; i++ ) { + config[val] = QUnit.urlParams[val]; + urlConfigHtml += '<label><input name="' + val + '" type="checkbox"' + ( config[val] ? ' checked="checked"' : '' ) + '>' + val + '</label>'; + } + + var userAgent = id("qunit-userAgent"); + if ( userAgent ) { + userAgent.innerHTML = navigator.userAgent; + } + var banner = id("qunit-header"); + if ( banner ) { + banner.innerHTML = '<a href="' + QUnit.url({ filter: undefined }) + '"> ' + banner.innerHTML + '</a> ' + urlConfigHtml; + addEvent( banner, "change", function( event ) { + var params = {}; + params[ event.target.name ] = event.target.checked ? true : undefined; + window.location = QUnit.url( params ); + }); + } + + var toolbar = id("qunit-testrunner-toolbar"); + if ( toolbar ) { + var filter = document.createElement("input"); + filter.type = "checkbox"; + filter.id = "qunit-filter-pass"; + addEvent( filter, "click", function() { + var ol = document.getElementById("qunit-tests"); + if ( filter.checked ) { + ol.className = ol.className + " hidepass"; + } else { + var 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; + var ol = document.getElementById("qunit-tests"); + ol.className = ol.className + " hidepass"; + } + toolbar.appendChild( filter ); + + var label = document.createElement("label"); + label.setAttribute("for", "qunit-filter-pass"); + label.innerHTML = "Hide passed tests"; + toolbar.appendChild( label ); + } + + var main = id('qunit-fixture'); + if ( main ) { + config.fixture = main.innerHTML; + } + + if (config.autostart) { + QUnit.start(); + } +}; + +addEvent(window, "load", QUnit.load); + +// addEvent(window, "error") gives us a useless event object +window.onerror = function( message, file, line ) { + if ( QUnit.config.current ) { + ok( false, message + ", " + file + ":" + line ); + } else { + test( "global failure", function() { + ok( false, message + ", " + file + ":" + line ); + }); + } +}; + +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 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> tests 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(" "); + } + + runLoggingCallbacks( 'done', QUnit, { + failed: config.stats.bad, + passed: passed, + total: config.stats.all, + runtime: runtime + } ); +} + +function validTest( name ) { + var filter = config.filter, + run = false; + + if ( !filter ) { + return true; + } + + var not = filter.charAt( 0 ) === "!"; + if ( not ) { + filter = filter.slice( 1 ); + } + + if ( name.indexOf( filter ) !== -1 ) { + return !not; + } + + if ( not ) { + run = true; + } + + return run; +} + +// so far supports only Firefox, Chrome and Opera (buggy) +// could be extended in the future to use something like https://github.com/csnover/TraceKit +function sourceFromStacktrace() { + try { + throw new Error(); + } catch ( e ) { + if (e.stacktrace) { + // Opera + return e.stacktrace.split("\n")[6]; + } else if (e.stack) { + // Firefox, Chrome + return e.stack.split("\n")[4]; + } else if (e.sourceURL) { + // Safari, PhantomJS + // TODO sourceURL points at the 'throw new Error' line above, useless + //return e.sourceURL + ":" + e.line; + } + } +} + +function escapeInnerText(s) { + if (!s) { + return ""; + } + s = s + ""; + return s.replace(/[\&<>]/g, function(s) { + switch(s) { + case "&": return "&"; + case "<": return "<"; + case ">": return ">"; + default: return s; + } + }); +} + +function synchronize( callback, last ) { + config.queue.push( callback ); + + if ( config.autorun && !config.blocking ) { + process(last); + } +} + +function 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( function(){ + process( last ); + }, 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 ) { + if ( !hasOwn.call( window, key ) ) { + continue; + } + config.pollution.push( key ); + } + } +} + +function checkPollution( name ) { + var old = config.pollution; + saveGlobal(); + + var newGlobals = diff( config.pollution, old ); + if ( newGlobals.length > 0 ) { + ok( false, "Introduced global variable(s): " + newGlobals.join(", ") ); + } + + var deletedGlobals = diff( old, config.pollution ); + if ( deletedGlobals.length > 0 ) { + ok( false, "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 result = a.slice(); + for ( var i = 0; i < result.length; i++ ) { + for ( var j = 0; j < b.length; j++ ) { + if ( result[i] === b[j] ) { + result.splice(i, 1); + i--; + break; + } + } + } + return result; +} + +function fail(message, exception, callback) { + if ( typeof console !== "undefined" && console.error && console.warn ) { + console.error(message); + console.error(exception); + console.warn(callback.toString()); + + } else if ( window.opera && opera.postError ) { + opera.postError(message, exception, callback.toString); + } +} + +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; +} + +function addEvent(elem, type, fn) { + if ( elem.addEventListener ) { + elem.addEventListener( type, fn, false ); + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, fn ); + } else { + fn(); + } +} + +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) { + //debugger; + var callbacks; + if ( QUnit.hasOwnProperty(key) ) { + QUnit[key].call(scope, args); + } else { + callbacks = config[key]; + for( var 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 () { + + var innerEquiv; // the real equiv function + var callers = []; // stack to decide between skip/abort functions + var parents = []; // stack to avoiding loops from circular referencing + + // 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 + } + } + } + + var getProto = Object.getPrototypeOf || function (obj) { + return obj.__proto__; + }; + + var callbacks = function () { + + // for string, boolean, number and null + function useStrictEquality(b, a) { + 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" + && a.source === b.source && // the regex itself + a.global === b.global && // and its modifers + // (gmi) ... + a.ignoreCase === b.ignoreCase + && a.multiline === b.multiline; + }, + + // - 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, loop; + var len; + + // 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; + var eq = true; // unless we can proove it + var aProperties = [], bProperties = []; // collection of + // strings + + // 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]) + loop = true; // don't go down the same path + // twice + } + 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 = Array.prototype.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 = Array(i); + this.up(); + while ( i-- ) + ret[i] = this.parse( arr[i] , undefined , stack); + this.down(); + return join( '[', ret, ']' ); + }; + + var reName = /^function (\w+)/; + + var jsDump = { + parse:function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance + stack = stack || [ ]; + var parser = this.parsers[ type || this.typeOf(obj) ]; + type = typeof parser; + var inStack = inArray(obj, stack); + if (inStack != -1) { + return 'recursion('+(inStack - stack.length)+')'; + } + //else + if (type == 'function') { + stack.push(obj); + var res = parser.call( this, obj, stack ); + stack.pop(); + return res; + } + // else + 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 { + type = typeof obj; + } + return type; + }, + separator:function() { + return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? ' ' : ' '; + }, + indent:function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing + if ( !this.multiline ) + return ''; + var chr = this.indentChar; + if ( this.HTML ) + chr = chr.replace(/\t/g,' ').replace(/ /g,' '); + return 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:'[ERROR]', //when no parser is found, shouldn't happen + unknown: '[Unknown]', + 'null':'null', + 'undefined':'undefined', + 'function':function( fn ) { + var ret = 'function', + name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE + 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 = [ ]; + QUnit.jsDump.up(); + for ( var key in map ) { + var 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 open = QUnit.jsDump.HTML ? '<' : '<', + close = QUnit.jsDump.HTML ? '>' : '>'; + + var tag = node.nodeName.toLowerCase(), + ret = open + tag; + + for ( var a in QUnit.jsDump.DOMAttrs ) { + var val = node[QUnit.jsDump.DOMAttrs[a]]; + if ( val ) + ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' ); + } + return ret + close + open + '/' + tag + close; + }, + functionArgs:function( fn ) {//function calls it internally, it's the arguments part of the function + var l = fn.length; + if ( !l ) return ''; + + var args = Array(l); + while ( l-- ) + args[l] = String.fromCharCode(97+l);//97 is 'a' + return ' ' + args.join(', ') + ' '; + }, + key:quote, //object calls it internally, the key part of an item in a map + functionCode:'[code]', //function calls it internally, it's the content of the function + attribute:quote, //node calls it internally, it's an html attribute value + string:quote, + date:quote, + regexp:literal, //regex + number:literal, + 'boolean':literal + }, + DOMAttrs:{//attributes to dump from nodes, name=>realName + id:'id', + name:'name', + 'class':'className' + }, + HTML:false,//if true, entities are escaped ( <, >, \t, space and \n ) + indentChar:' ',//indentation unit + multiline:true //if true, items in a collection, are separated by a \n, else just a space. + }; + + return jsDump; +})(); + +// from Sizzle.js +function getText( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += getText( elem.childNodes ); + } + } + + return ret; +}; + +//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() { + function diff(o, n) { + var ns = {}; + var os = {}; + + for (var i = 0; i < n.length; i++) { + if (ns[n[i]] == null) + ns[n[i]] = { + rows: [], + o: null + }; + ns[n[i]].rows.push(i); + } + + for (var i = 0; i < o.length; i++) { + if (os[o[i]] == null) + os[o[i]] = { + rows: [], + n: null + }; + os[o[i]].rows.push(i); + } + + for (var i in ns) { + if ( !hasOwn.call( ns, i ) ) { + continue; + } + if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && 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 (var 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 (var 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 out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/)); + + var str = ""; + + var oSpace = o.match(/\s+/g); + if (oSpace == null) { + oSpace = [" "]; + } + else { + oSpace.push(" "); + } + var nSpace = n.match(/\s+/g); + if (nSpace == null) { + nSpace = [" "]; + } + else { + nSpace.push(" "); + } + + if (out.n.length == 0) { + for (var 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 (var i = 0; i < out.n.length; i++) { + if (out.n[i].text == null) { + str += '<ins>' + out.n[i] + nSpace[i] + "</ins>"; + } + else { + var 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; + }; +})(); + +})(this); diff --git a/npm_assets/node_modules/html5shiv/test/style.all.css b/npm_assets/node_modules/html5shiv/test/style.all.css new file mode 100644 index 0000000..208c6ee --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/style.all.css @@ -0,0 +1,11 @@ +html { font: 75% sans-serif; overflow-y: scroll; } +body { margin: 0; } +pre { margin: 0; padding: 1em 0; } +section { border: 0.5em solid #8C8; margin: 1em; padding: 1em; } +h1 { margin: 1em 2em; } +ul { font: bold 1.5em sans-serif; margin: 1em; padding: 0 0 0 1.5em; } +li { margin: 1em; } +a { color: #66C; text-decoration: none; } + +.pass { color: #090; } +.fail { color: #F00; }
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/style.css b/npm_assets/node_modules/html5shiv/test/style.css new file mode 100644 index 0000000..e4f5049 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/style.css @@ -0,0 +1,2 @@ +@import url(style.all.css); +@import url(style.print.css);
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/style.print.css b/npm_assets/node_modules/html5shiv/test/style.print.css new file mode 100644 index 0000000..afd77b1 --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/style.print.css @@ -0,0 +1,5 @@ +@media print { + section { + border-style: dotted; + } +}
\ No newline at end of file diff --git a/npm_assets/node_modules/html5shiv/test/unit/tests.js b/npm_assets/node_modules/html5shiv/test/unit/tests.js new file mode 100644 index 0000000..52e8c9c --- /dev/null +++ b/npm_assets/node_modules/html5shiv/test/unit/tests.js @@ -0,0 +1,281 @@ +(function(){ + +module("html5shiv tests"); +var blockElements = "article,aside,figcaption,figure,footer,header,hgroup,nav,section".split(','); + +var testEnv = [ + { + doc: document, + initialShivMethods: html5.shivMethods, + html5: html5, + name: 'default' + } +]; + + +var shivTests = function(fn, env){ + if(!env){ + env = testEnv[0]; + } + env.html5.shivMethods = true; + fn(); + env.html5.shivMethods = env.initialShivMethods; +}; + +var envTest = function(name, fn, frames){ + if(!frames){ + frames = ['default']; + } + asyncTest(name, function(){ + $.each(testEnv, function(i, env){ + if($.inArray(env.name, frames) != -1){ + fn(env); + } + }); + if(testEnv.length > 1){ + start(); + } else { + initIframes(); + } + }); + +}; + +QUnit.reset = function() { + $.each(testEnv, function(i, env){ + $('#qunit-fixture', env.doc).html(env.fixture); + }); +}; + + +var initIframes = function(){ + if(testEnv.length > 1){return;} + testEnv[0].fixture = $('#qunit-fixture').html(); + + $('iframe.test-frame').each(function(){ + var win = this.contentWindow; + if($('#qunit-fixture', win.document).length){ + testEnv.push({ + doc: win.document, + html5: win.html5, + initialShivMethods: (win.html5 || {}).shivMethods, + fixture: $('#qunit-fixture', win.document).html(), + name: this.src.split('?')[1] + }); + } + }); + if(testEnv.length > 1){ + start(); + } else { + setTimeout(initIframes, 30); + } +}; + + +$(initIframes); + + +envTest("display block tests", function(env){ + $.each(blockElements, function(i, elem){ + equals($(elem, env.doc).css('display'), 'block', elem +" has display: block"); + }); + +}, ['default', 'disableMethodsBefore']); + +envTest("test html5.createElement/html5.createDocumentFragment", function(env){ + var doc5 = html5; + if(env.html5){ + doc5 = env.html5; + env.html5.shivMethods = false; + } + html5.shivMethods = false; + + var fragDiv = doc5.createElement('div', env.doc); + var frag = doc5.createDocumentFragment(env.doc); + var markText = "with these words highlighted"; + var div = $( doc5.createElement('div', env.doc) ).html('<section><article><mark>s</mark></article>?</section>').appendTo(env.doc.getElementById('qunit-fixture')); + + fragDiv.innerHTML = '<section>This native javascript sentence is in a green box <mark>'+markText+'</mark>?</section>'; + + frag.appendChild(fragDiv); + fragDiv.innerHTML += '<article>This native javascript sentence is also in a green box <mark>'+markText+'</mark>?</article>'; + + env.doc.getElementById('qunit-fixture').appendChild(frag); + + equals($('section article > mark', div).length, 1, "found mark in section > article"); + equals($('section > mark', fragDiv).html(), markText, "innerHTML getter equals innerHTML setter"); + equals($('article', fragDiv).css('borderTopWidth'), '2px', "article has a 2px border"); + + if(env.html5){ + env.html5.shivMethods = env.initialShivMethods; + } + html5.shivMethods = true; +}, ['disableMethodsBefore', 'disableMethodsAfter']); + + +if(!html5.supportsUnknownElements){ + + envTest("config shivMethods test", function(env){ + var div = $('<div/>', env.doc).html('<section><article><mark></mark></article>?</section>').appendTo(env.doc.getElementById('qunit-fixture')); + equals($('section article > mark', div).length, (env.html5.shivMethods) ? 1 : 0, "found/no found mark in section > article"); + }, ['default', 'disableMethodsBefore', 'disableMethodsAfter']); + + envTest("config shivCSS test", function(env){ + $.each(blockElements, function(i, elem){ + equals($(elem, env.doc).css('display'), 'inline', elem +" has display: inline if unshived"); + }); + env.html5.shivCSS = true; + env.html5.shivDocument(); + $.each(blockElements, function(i, elem){ + equals($(elem, env.doc).css('display'), 'block', elem +" has display: block. after reshiving"); + }); + }, ['disableCSS']); +} + +envTest("config add elements test", function(env){ + var value = $.trim($('abcxyz', env.doc).html()); + ok((html5.supportsUnknownElements || env.html5.elements.indexOf('abcxyz') !== -1) ? value : !value, "unknownelement has one/none div inside: "+ value); +}, ['default', 'disableMethodsBefore', 'addUnknownBefore', 'addUnknownAfter']); + +envTest("parsing tests", function(env){ + $.each(blockElements, function(i, elem){ + equals($(elem +' div.inside', env.doc).length, 1, elem +" has a div inside"); + }); +}, ['default', 'disableMethodsBefore']); + +envTest("style test", function(env){ + var article = $('article', env.doc); + equals(article.css('borderTopWidth'), '2px', "article has a 2px border"); +}, ['default', 'disableMethodsBefore']); + +if (!html5.supportsUnknownElements) { + envTest("shiv different document", function(env){ + var markText = "with these words highlighted3"; + var markup = '<section><article>This jQuery 1.6.4 sentence is in a green box <mark>' + markText + '</mark></article>?</section>'; + + var div = $('<div/>', env.doc).html(markup).appendTo(env.doc.getElementById('qunit-fixture')); + equals($('section article > mark', div).length, 0, "document is not shived"); + + html5.shivDocument(env.doc); + + div = $('<div/>', env.doc).html(markup).appendTo(env.doc.getElementById('qunit-fixture')); + equals($('section article > mark', div).length, 1, "document is shived"); + equals($('article', div).css('borderTopWidth'), '2px', "article has a 2px border"); + + }, ['noEmbed']); +} + +envTest("createElement/innerHTML test", function(env){ + shivTests( + function(){ + var div = env.doc.createElement('div'); + var text = "This native javascript sentence is in a green box <mark>with these words highlighted</mark>?"; + div.innerHTML = '<section id="section">'+ text +'</section>'; + env.doc.getElementById('qunit-fixture').appendChild(div); + equals($('#section', env.doc).html(), text, "innerHTML getter equals innerHTML setter"); + equals($('#section mark', env.doc).length, 1, "section has a mark element inside"); + }, + env + ); +}, ['default', 'disableMethodsBefore']); + +envTest("createElement/createDocumentFragment/innerHTML test", function(env){ + shivTests( + function(){ + var div = env.doc.createElement('div'); + var frag = env.doc.createDocumentFragment(); + var markText = "with these words highlighted"; + div.innerHTML = '<section>This native javascript sentence is in a green box <mark>'+markText+'</mark>?</section>'; + frag.appendChild(div); + div.innerHTML += '<article>This native javascript sentence is also in a green box <mark>'+markText+'</mark>?</article>'; + env.doc.getElementById('qunit-fixture').appendChild(frag); + equals($('section > mark', div).html(), markText, "innerHTML getter equals innerHTML setter"); + equals($('article', div).css('borderTopWidth'), '2px', "article has a 2px border"); + }, + env + ); +}, ['default', 'disableMethodsBefore']); + + +envTest("createDocumentFragment/cloneNode/innerHTML test", function(env){ + shivTests( + function(){ + var frag = env.doc.createDocumentFragment(); + var fragDiv = env.doc.createElement('div'); + + var markText = "with these words highlighted2"; + var fragDivClone; + frag.appendChild(fragDiv); + + fragDiv.innerHTML = '<div><article>This native javascript sentence is also in a green box <mark>'+markText+'</mark>?</article></div>'; + + fragDivClone = fragDiv.cloneNode(true); + + env.doc.getElementById('qunit-fixture').appendChild(fragDivClone); + equals($('mark', env.doc).html(), markText, "innerHTML getter equals innerHTML setter"); + }, + env + ); +}, ['default', 'addUnknownAfter']); + +test("form test", function() { + shivTests( + function(){ + var form = document.createElement('form'); + var select = document.createElement('select'); + var input = document.createElement('input'); + var button = document.createElement('button'); + var option = document.createElement('option'); + var markText = "with these words highlighted2"; + + form.setAttribute('action', 'some/path'); + form.setAttribute('name', 'formName'); + form.target = '_blank'; + select.name = 'selectName'; + option.value = '1.value'; + button.setAttribute('type', 'submit'); + input.type = 'submit'; + + form.innerHTML = '<article>This native javascript sentence is also in a green box <mark>'+markText+'</mark>?</article>'; + + + form.appendChild(select); + form.appendChild(button); + form.appendChild(input); + + + + if(select.add){ + try { + select.add(option); + } catch(er){ + select.appendChild(option); + } + } else { + select.appendChild(option); + } + document.getElementById('qunit-fixture').appendChild(form); + + equals($('select option', form).val(), '1.value', "select has one option with value"); + equals($('article > mark', form).html(), markText, "innerHTML getter equals innerHTML setter"); + equals($('article', form).css('borderTopWidth'), '2px', "article has a 2px border"); + } + ); +}); + +envTest("jQuery test", function(env){ + shivTests( + function(){ + var markText = "with these words highlighted3"; + var div = $('<div/>', env.doc).html('<section><article>This jQuery 1.6.4 sentence is in a green box <mark>'+markText+'</mark></article>?</section>').appendTo(env.doc.getElementById('qunit-fixture')); + equals($('article > mark', div).html(), markText, "innerHTML getter equals innerHTML setter"); + equals($('article', div).css('borderTopWidth'), '2px', "article has a 2px border"); + }, + env + ); +}); + + + + +})(); |
