├── .gitignore ├── js ├── profiling │ ├── charts.swf │ ├── config.js │ └── yahoo-profiling.css ├── script.js ├── plugins.js ├── modernizr-1.5.min.js ├── dd_belatedpng.js └── jquery-1.4.2.min.js ├── robots.txt ├── css ├── handheld.css └── style.css ├── crossdomain.xml ├── 404.html ├── README.markdown ├── test ├── qunit │ ├── testsuite.css │ └── testrunner.js ├── index.html └── tests.js ├── index.html ├── .htaccess └── demo └── elements-demo.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | .sass-cache 4 | -------------------------------------------------------------------------------- /js/profiling/charts.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subtleGradient/html5-boilerplate/master/js/profiling/charts.swf -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | 6 | -------------------------------------------------------------------------------- /js/script.js: -------------------------------------------------------------------------------- 1 | /* Author: 2 | 3 | */ 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /css/handheld.css: -------------------------------------------------------------------------------- 1 | 2 | * { 3 | float: none; /* Screens are not big enough to account for floats */ 4 | font-size: 80%; /* Slightly reducing font size to reduce need to scroll */ 5 | background: #fff; /* As much contrast as possible */ 6 | color: #000; 7 | } -------------------------------------------------------------------------------- /crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | 2 | not found 3 | 4 | 12 | 13 | 14 | 15 | 16 |
17 |

Not found

18 |

:(

19 |
-------------------------------------------------------------------------------- /js/plugins.js: -------------------------------------------------------------------------------- 1 | 2 | // remap jQuery to $ 3 | (function($){ 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | })(window.jQuery); 16 | 17 | 18 | 19 | // usage: log('inside coolFunc',this,arguments); 20 | // paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ 21 | window.log = function(){ 22 | log.history = log.history || []; // store logs to an array for reference 23 | log.history.push(arguments); 24 | if(this.console){ 25 | console.log( Array.prototype.slice.call(arguments) ); 26 | } 27 | }; 28 | 29 | 30 | 31 | // catch all document.write() calls 32 | (function(){ 33 | var docwrite = document.write; 34 | document.write = function(q){ 35 | log('document.write(): ',q); 36 | if (/docwriteregexwhitelist/.test(q)) docwrite(q); 37 | } 38 | })(); 39 | 40 | 41 | // background image cache bug for ie6. www.mister-pixel.com/#Content__state= 42 | /*@cc_on @if (@_win32) { document.execCommand("BackgroundImageCache",false,true) } @end @*/ 43 | 44 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | ### HTML5 Boilerplate 2 | 3 | ## CHANGELOG: 4 | 5 | v0.9 -August 10th, 2010 - Initial release 6 | 7 | ## LICENSE: 8 | 9 | Copyright Paul Irish 10 | 11 | Dual licensed under MIT and GPL 12 | 13 | ## INSTALLATION: 14 | 15 | This is a set of files that a front-end developer can use to get started on a website, with following included: 16 | 17 | 1. Cross-browser compatible (IE6, yeah we got that.) 18 | 2. HTML5 ready. Use the new tags with certainty. 19 | 3. Optimal caching and compression rules for grade-A performance 20 | 4. Best practice site configuration defaults 21 | 5. Think there's too much? The HTML5 Boilerplate is delete-key friendly. :) 22 | 6. Mobile browser optimizations 23 | 7. Progressive enhancement graceful degredation ........ yeah yeah we got that 24 | 8. IE specific classes for maximum cross-browser control 25 | 9. Want to write unit tests but lazy? A full, hooked up test suite is waiting for you. 26 | 10. Javascript profiling.. in IE6 and IE7? Sure, no problem. 27 | 11. Console.log nerfing so you won't break anyone by mistake. 28 | 12. Never go wrong with your doctype or markup! 29 | 13. An optimal print stylesheet, performance optimized 30 | 14. iOS, Android, Opera Mobile-adaptable markup and CSS skeleton. 31 | 15. IE6 pngfix baked in. 32 | 16. jQuery, waiting for you 33 | 34 | 35 | There will be two releases: a documented release, which is exactly what you see here, and a production release, with most of the descriptive comments stripped out. 36 | 37 | -------------------------------------------------------------------------------- /js/profiling/config.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | // call PROFILE.show() to show the profileViewer 4 | 5 | var PROFILE = { 6 | 7 | init : function(bool) { 8 | 9 | // define what objects, constructors and functions you want to profile 10 | // documentation here: http://developer.yahoo.com/yui/profiler/ 11 | 12 | YAHOO.tool.Profiler.registerObject("jQuery", jQuery, true); 13 | 14 | // the following would profile all methods within constructor's prototype 15 | // YAHOO.tool.Profiler.registerConstructor("Person"); 16 | 17 | // the following would profile the global function sayHi 18 | // YAHOO.tool.Profiler.registerFunction("sayHi", window); 19 | 20 | // if true is passed into init(), F9 will bring up the profiler 21 | if (bool){ 22 | $(document).keyup(function(e){ 23 | if (e.keyCode === 120){ 24 | PROFILE.show(); 25 | $(document).unbind('keyup',arguments.callee); 26 | } 27 | }) 28 | } 29 | }, 30 | 31 | //When the showProfile button is clicked, use YUI Loader to get all required 32 | //dependencies and then show the profile: 33 | show : function() { 34 | 35 | 36 | 37 | var s = document.createElement('link'); 38 | s.setAttribute('rel','stylesheet'); 39 | s.setAttribute('type','text/css'); 40 | s.setAttribute('href','js/profiling/yahoo-profiling.css'); 41 | document.body.appendChild(s); 42 | 43 | YAHOO.util.Dom.addClass(document.body, 'yui-skin-sam'); 44 | 45 | //instantiate ProfilerViewer with desired options: 46 | var pv = new YAHOO.widget.ProfilerViewer("", { 47 | visible: true, //expand the viewer mmediately after instantiation 48 | showChart: true, 49 | // base:"../../build/", 50 | swfUrl: "js/profiling/charts.swf" 51 | }); 52 | 53 | } 54 | 55 | }; 56 | 57 | // check some global debug variable to see if we should be profiling.. 58 | if (true) { PROFILE.init(true) } 59 | 60 | -------------------------------------------------------------------------------- /test/qunit/testsuite.css: -------------------------------------------------------------------------------- 1 | body, div, h1 { font-family: 'trebuchet ms', verdana, arial; margin: 0; padding: 0 } 2 | body {font-size: 10pt; } 3 | h1 { padding: 15px; font-size: large; background-color: #06b; color: white; } 4 | h1 a { color: white; } 5 | h2 { padding: 10px; background-color: #eee; color: black; margin: 0; font-size: small; font-weight: normal } 6 | 7 | .pass { color: green; } 8 | .fail { color: red; } 9 | p.result { margin-left: 1em; } 10 | 11 | #banner { height: 2em; border-bottom: 1px solid white; } 12 | h2.pass { background-color: green; } 13 | h2.fail { background-color: red; } 14 | 15 | div.testrunner-toolbar { background: #eee; border-top: 1px solid black; padding: 10px; } 16 | 17 | ol#tests > li > strong { cursor:pointer; } 18 | 19 | div#fx-tests h4 { 20 | background: red; 21 | } 22 | 23 | div#fx-tests h4.pass { 24 | background: green; 25 | } 26 | 27 | div#fx-tests div.box { 28 | background: red url(data/cow.jpg) no-repeat; 29 | overflow: hidden; 30 | border: 2px solid #000; 31 | } 32 | 33 | div#fx-tests div.overflow { 34 | overflow: visible; 35 | } 36 | 37 | div.inline { 38 | display: inline; 39 | } 40 | 41 | div.autoheight { 42 | height: auto; 43 | } 44 | 45 | div.autowidth { 46 | width: auto; 47 | } 48 | 49 | div.autoopacity { 50 | opacity: auto; 51 | } 52 | 53 | div.largewidth { 54 | width: 100px; 55 | } 56 | 57 | div.largeheight { 58 | height: 100px; 59 | } 60 | 61 | div.largeopacity { 62 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); 63 | } 64 | 65 | div.medwidth { 66 | width: 50px; 67 | } 68 | 69 | div.medheight { 70 | height: 50px; 71 | } 72 | 73 | div.medopacity { 74 | opacity: 0.5; 75 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50); 76 | } 77 | 78 | div.nowidth { 79 | width: 0px; 80 | } 81 | 82 | div.noheight { 83 | height: 0px; 84 | } 85 | 86 | div.noopacity { 87 | opacity: 0; 88 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); 89 | } 90 | 91 | div.hidden { 92 | display: none; 93 | } 94 | 95 | div#fx-tests div.widewidth { 96 | background-repeat: repeat-x; 97 | } 98 | 99 | div#fx-tests div.wideheight { 100 | background-repeat: repeat-y; 101 | } 102 | 103 | div#fx-tests div.widewidth.wideheight { 104 | background-repeat: repeat; 105 | } 106 | 107 | div#fx-tests div.noback { 108 | background-image: none; 109 | } 110 | 111 | div.chain, div.chain div { width: 100px; height: 20px; position: relative; float: left; } 112 | div.chain div { position: absolute; top: 0px; left: 0px; } 113 | 114 | div.chain.test { background: red; } 115 | div.chain.test div { background: green; } 116 | 117 | div.chain.out { background: green; } 118 | div.chain.out div { background: red; display: none; } 119 | 120 | div#show-tests * { display: none; } 121 | -------------------------------------------------------------------------------- /js/profiling/yahoo-profiling.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://developer.yahoo.net/yui/license.txt 5 | version: 2.7.0 6 | */ 7 | .yui-skin-sam .yui-pv{background-color:#4a4a4a;font:arial;position:relative;width:99%;z-index:1000;margin-bottom:1em;overflow:hidden;}.yui-skin-sam .yui-pv .hd{background:url(http://yui.yahooapis.com/2.7.0/build/profilerviewer/assets/skins/sam/header_background.png) repeat-x;min-height:30px;overflow:hidden;zoom:1;padding:2px 0;}.yui-skin-sam .yui-pv .hd h4{padding:8px 10px;margin:0;font:bold 14px arial;color:#fff;}.yui-skin-sam .yui-pv .hd a{background:#3f6bc3;font:bold 11px arial;color:#fff;padding:4px;margin:3px 10px 0 0;border:1px solid #3f567d;cursor:pointer;display:block;float:right;}.yui-skin-sam .yui-pv .hd span{display:none;}.yui-skin-sam .yui-pv .hd span.yui-pv-busy{height:18px;width:18px;background:url(http://yui.yahooapis.com/2.7.0/build/profilerviewer/assets/skins/sam/wait.gif) no-repeat;overflow:hidden;display:block;float:right;margin:4px 10px 0 0;}.yui-skin-sam .yui-pv .hd:after,.yui-pv .bd:after,.yui-skin-sam .yui-pv-chartlegend dl:after{content:'.';visibility:hidden;clear:left;height:0;display:block;}.yui-skin-sam .yui-pv .bd{position:relative;zoom:1;overflow-x:auto;overflow-y:hidden;}.yui-skin-sam .yui-pv .yui-pv-table{padding:0 10px;margin:5px 0 10px 0;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-bd td{color:#eeee5c;font:12px arial;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd{background:#929292;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even{background:#58637a;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-desc{background:#384970;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-desc{background:#6F6E6E;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th{background-image:none;background:#2E2D2D;}.yui-skin-sam .yui-pv th.yui-dt-asc .yui-dt-liner{background:transparent url(http://yui.yahooapis.com/2.7.0/build/profilerviewer/assets/skins/sam/asc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv th.yui-dt-desc .yui-dt-liner{background:transparent url(http://yui.yahooapis.com/2.7.0/build/profilerviewer/assets/skins/sam/desc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th a{color:#fff;font:bold 12px arial;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-desc{background:#333;}.yui-skin-sam .yui-pv-chartcontainer{padding:0 10px;}.yui-skin-sam .yui-pv-chart{height:250px;clear:right;margin:5px 0 0 0;color:#fff;}.yui-skin-sam .yui-pv-chartlegend div{float:right;margin:0 0 0 10px;_width:250px;}.yui-skin-sam .yui-pv-chartlegend dl{border:1px solid #999;padding:.2em 0 .2em .5em;zoom:1;margin:5px 0;}.yui-skin-sam .yui-pv-chartlegend dt{float:left;display:block;height:.7em;width:.7em;padding:0;}.yui-skin-sam .yui-pv-chartlegend dd{float:left;display:block;color:#fff;margin:0 1em 0 .5em;padding:0;font:11px arial;}.yui-skin-sam .yui-pv-minimized{height:35px;}.yui-skin-sam .yui-pv-minimized .bd{top:-3000px;}.yui-skin-sam .yui-pv-minimized .hd a.yui-pv-refresh{display:none;} -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
55 |
56 | 57 |
58 | 59 |
60 | 61 |
62 | 63 | 66 |
67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 92 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | # Apache configuration file 2 | # httpd.apache.org/docs/2.2/mod/quickreference.html 3 | 4 | # Techniques in here adapted from all over, 5 | # including Kroc Camen: camendesign.com/.htaccess 6 | 7 | 8 | # Force the latest IE version, in various cases when it may fall back to IE7 mode 9 | # github.com/rails/rails/commit/123eb25#commitcomment-118920 10 | # Use ChromeFrame if it's installed for a better experience for the poor IE folk 11 | 12 | 13 | BrowserMatch MSIE ie 14 | Header set X-UA-Compatible "IE=Edge" env=ie 15 | BrowserMatch chromeframe gcf 16 | Header append X-UA-Compatible "chrome=1" env=gcf 17 | 18 | 19 | 20 | 21 | # hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ 22 | # Disabled. Uncomment to serve cross-domain ajax requests 23 | # 24 | # Header set Access-Control-Allow-Origin "*" 25 | # 26 | 27 | 28 | 29 | 30 | # allow access from all domains for webfonts 31 | # alternatively you could only whitelist 32 | # your subdomains like "sub.domain.com" 33 | 34 | 35 | 36 | Header set Access-Control-Allow-Origin "*" 37 | 38 | 39 | 40 | 41 | # video 42 | AddType video/ogg ogg ogv 43 | AddType video/mp4 mp4 44 | 45 | # Proper svg serving. Required for svg webfonts on iPad 46 | # twitter.com/FontSquirrel/status/14855840545 47 | AddType image/svg+xml svg svgz 48 | 49 | # webfonts 50 | AddType application/vnd.ms-fontobject eot 51 | AddType font/ttf ttf 52 | AddType font/otf otf 53 | AddType font/x-woff woff 54 | 55 | 56 | # allow concatenation from within specific js and css files 57 | 58 | # e.g. Inside of script.combined.js you could have 59 | # 60 | # 61 | # and they would be included into this single file 62 | 63 | 64 | Options +Includes 65 | SetOutputFilter INCLUDES 66 | 67 | 68 | Options +Includes 69 | SetOutputFilter INCLUDES 70 | 71 | 72 | 73 | 74 | 75 | # gzip compression. 76 | 77 | 78 | # html, xml, css, and js: 79 | AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json 80 | 81 | # webfonts and svg: 82 | 83 | SetOutputFilter DEFLATE 84 | 85 | 86 | 87 | 88 | 89 | 90 | # these are pretty far-future expires headers 91 | # they assume you control versioning with cachebusting query params like 92 | # 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |

Unit Tests (executed by QUnit)

23 | 24 |

25 | 26 | 27 | 31 | 249 | 250 |
    251 | 252 | -------------------------------------------------------------------------------- /js/dd_belatedpng.js: -------------------------------------------------------------------------------- 1 | /** 2 | * DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML . 3 | * Author: Drew Diller 4 | * Email: drew.diller@gmail.com 5 | * URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/ 6 | * Version: 0.0.7a 7 | * Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license 8 | * 9 | * Example usage: 10 | * DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector 11 | * DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement 12 | **/ 13 | 14 | /* 15 | PLEASE READ: 16 | Absolutely everything in this script is SILLY. I know this. IE's rendering of certain pixels doesn't make sense, so neither does this code! 17 | */ 18 | 19 | var DD_belatedPNG = { 20 | 21 | ns: 'DD_belatedPNG', 22 | imgSize: {}, 23 | 24 | createVmlNameSpace: function() { /* enable VML */ 25 | if (document.namespaces && !document.namespaces[this.ns]) { 26 | document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml'); 27 | } 28 | if (window.attachEvent) { 29 | window.attachEvent('onbeforeunload', function() { 30 | DD_belatedPNG = null; 31 | }); 32 | } 33 | }, 34 | 35 | createVmlStyleSheet: function() { /* style VML, enable behaviors */ 36 | /* 37 | Just in case lots of other developers have added 38 | lots of other stylesheets using document.createStyleSheet 39 | and hit the 31-limit mark, let's not use that method! 40 | further reading: http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx 41 | */ 42 | var style = document.createElement('style'); 43 | document.documentElement.firstChild.insertBefore(style, document.documentElement.firstChild.firstChild); 44 | var styleSheet = style.styleSheet; 45 | styleSheet.addRule(this.ns + '\\:*', '{behavior:url(#default#VML)}'); 46 | styleSheet.addRule(this.ns + '\\:shape', 'position:absolute;'); 47 | styleSheet.addRule('img.' + this.ns + '_sizeFinder', 'behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;'); /* large negative top value for avoiding vertical scrollbars for large images, suggested by James O'Brien, http://www.thanatopsic.org/hendrik/ */ 48 | this.styleSheet = styleSheet; 49 | }, 50 | 51 | readPropertyChange: function() { 52 | var el = event.srcElement; 53 | if (event.propertyName.search('background') != -1 || event.propertyName.search('border') != -1) { 54 | DD_belatedPNG.applyVML(el); 55 | } 56 | if (event.propertyName == 'style.display') { 57 | var display = (el.currentStyle.display == 'none') ? 'none' : 'block'; 58 | for (var v in el.vml) { 59 | el.vml[v].shape.style.display = display; 60 | } 61 | } 62 | if (event.propertyName.search('filter') != -1) { 63 | DD_belatedPNG.vmlOpacity(el); 64 | } 65 | }, 66 | 67 | vmlOpacity: function(el) { 68 | if (el.currentStyle.filter.search('lpha') != -1) { 69 | var trans = el.currentStyle.filter; 70 | trans = parseInt(trans.substring(trans.lastIndexOf('=')+1, trans.lastIndexOf(')')), 10)/100; 71 | el.vml.color.shape.style.filter = el.currentStyle.filter; /* complete guesswork */ 72 | el.vml.image.fill.opacity = trans; /* complete guesswork */ 73 | } 74 | }, 75 | 76 | handlePseudoHover: function(el) { 77 | setTimeout(function() { /* wouldn't work as intended without setTimeout */ 78 | DD_belatedPNG.applyVML(el); 79 | }, 1); 80 | }, 81 | 82 | /** 83 | * This is the method to use in a document. 84 | * @param {String} selector - REQUIRED - a CSS selector, such as '#doc .container' 85 | **/ 86 | fix: function(selector) { 87 | if (!$.browser.ie6) return; // just a doublecheck catch. 88 | var selectors = selector.split(','); /* multiple selectors supported, no need for multiple calls to this anymore */ 89 | for (var i=0; i size.H) { 247 | c.B = size.H; 248 | } 249 | el.vml.image.shape.style.clip = 'rect('+c.T+'px '+(c.R+fudge)+'px '+c.B+'px '+(c.L+fudge)+'px)'; 250 | } 251 | else { 252 | el.vml.image.shape.style.clip = 'rect('+dC.T+'px '+dC.R+'px '+dC.B+'px '+dC.L+'px)'; 253 | } 254 | }, 255 | 256 | fixPng: function(el) { 257 | if (!$.browser.ie6) return; // just a doublecheck catch. 258 | 259 | el.style.behavior = 'none'; 260 | if (el.nodeName == 'BODY' || el.nodeName == 'TD' || el.nodeName == 'TR') { /* elements not supported yet */ 261 | return; 262 | } 263 | el.isImg = false; 264 | if (el.nodeName == 'IMG') { 265 | if(el.src.toLowerCase().search(/\.png/) != -1) { 266 | el.isImg = true; 267 | el.style.visibility = 'hidden'; 268 | } 269 | else { 270 | return; 271 | } 272 | } 273 | else if (el.currentStyle.backgroundImage.toLowerCase().search('.png') == -1) { 274 | return; 275 | } 276 | var lib = DD_belatedPNG; 277 | el.vml = {color: {}, image: {}}; 278 | var els = {shape: {}, fill: {}}; 279 | for (var r in el.vml) { 280 | for (var e in els) { 281 | var nodeStr = lib.ns + ':' + e; 282 | el.vml[r][e] = document.createElement(nodeStr); 283 | } 284 | el.vml[r].shape.stroked = false; 285 | el.vml[r].shape.appendChild(el.vml[r].fill); 286 | el.parentNode.insertBefore(el.vml[r].shape, el); 287 | } 288 | el.vml.image.shape.fillcolor = 'none'; /* Don't show blank white shapeangle when waiting for image to load. */ 289 | el.vml.image.fill.type = 'tile'; /* Ze magic!! Makes image show up. */ 290 | el.vml.color.fill.on = false; /* Actually going to apply vml element's style.backgroundColor, so hide the whiteness. */ 291 | 292 | lib.attachHandlers(el); 293 | 294 | lib.giveLayout(el); 295 | lib.giveLayout(el.offsetParent); 296 | 297 | /* set up element */ 298 | lib.applyVML(el); 299 | } 300 | 301 | }; 302 | try { 303 | document.execCommand("BackgroundImageCache", false, true); /* TredoSoft Multiple IE doesn't like this, so try{} it */ 304 | } catch(r) {} 305 | DD_belatedPNG.createVmlNameSpace(); 306 | DD_belatedPNG.createVmlStyleSheet(); -------------------------------------------------------------------------------- /demo/elements-demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
    58 | 61 |
    62 | 63 | 69 | 70 | 71 | 72 |

    Title 01 Heading

    73 |
    74 |

    Level 03 Heading

    75 |

    Lorem ipsum emphasised text dolor sit amet, strong text 76 | consectetur adipisicing elit, abbreviated text sed do eiusmod tempor 77 | incididunt ut labore et dolore magna aliqua. Ut 78 | quoted text enim ad minim veniam, quis nostrud exercitation link text 79 | ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute 80 | inserted text irure dolor in reprehenderit in voluptate velit esse cillum 81 | dolore eu fugiat nulla pariatur. Excepteur sint occaecat code text cupidatat 82 | non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    83 | 84 |

    85 | Suspendisse rhoncus, est ac sollicitudin viverra, leo orci sagittis massa, sed condimentum acronym text est tortor a lectus. Curabitur porta feugiat ullamcorper. Integer lacinia mi id odio faucibus eget tincidunt nisl iaculis. Nam adipiscing hendrerit turpis, et porttitor felis sollicitudin et. Donec dictum massa ac neque accumsan tempor. Cras aliquam, ipsum sit amet laoreet hendrerit, purus deleted text sapien convallis dui, et porta leo ipsum ac nunc. Nullam ornare porta dui ac semper. Cras aliquam laoreet hendrerit. Quisque vulputate dolor eget mi porta vel porta nisl pretium. Vivamus non leo magna, quis imperdiet risus. Morbi tempor risus placerat tellus imperdiet fringilla. 86 |

    87 | 88 |
    89 |

    I am not one who was born in the possession of knowledge; I am one who is fond of antiquity, and earnest in seeking it there.

    90 |
    91 | 92 |

    Confucius, The Confucian Analects, (551 BC - 479 BC)

    93 | 94 |

    Level 03 Heading

    95 | 96 |

    Extended paragraph. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod 97 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud 98 | exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in 99 | reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint 100 | occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    101 | 102 |
      103 |
    1. Unus
    2. 104 |
    3. Duo
    4. 105 |
    5. Tres
    6. 106 |
    7. Quattuor
    8. 107 |
    108 | 109 |

    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 110 | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit 111 | anim id est laborum.

    112 | 113 |

    Header 3

    114 | 115 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt 116 | ut labore et dolore magna aliqua.

    117 | 118 |

    Unordered lists

    119 |
      120 |
    • Lorem ipsum dolor sit amet
    • 121 |
    • Consectetur adipisicing elit
    • 122 |
    • Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
    • 123 |
    • Ut enim ad minim veniam
    • 124 |
    125 |

    Lorem ipsum dolor sit amet,consectetur adipisicing elit, sed do eiusmod tempor incididunt 126 | ut labore et dolore magna aliqua.

    127 | 128 |
    body { font:0.8125em/1.618 Arial, sans-serif; 
    129 |       background-color:#fff;  
    130 |       color:#111;
    131 |       }
    132 | 133 |

    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 134 | pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit 135 | anim id est laborum.

    136 | 137 |

    Header 4

    138 | 139 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt 140 | ut labore et dolore magna aliqua.

    141 | 142 |
    143 |
    Definition list
    144 |
    Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 145 | aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea 146 | commodo consequat.
    147 |
    Lorem ipsum dolor sit amet
    148 |
    Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna 149 | aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea 150 | commodo consequat.
    151 | 152 |
    153 | 154 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt 155 | ut labore et dolore magna aliqua.

    156 |

    Ordered list

    157 |
      158 |
    1. List item
    2. 159 |
    3. List item
    4. 160 |
    5. List item 161 |
        162 |
      1. List item level 2
      2. 163 |
      3. List item level 2 164 |
          165 |
        1. List item level 3
        2. 166 |
        3. List item level 3
        4. 167 |
        168 |
      4. 169 |
      170 |
    6. 171 |
    172 |

    Unordered list

    173 |
      174 |
    • List item 01
    • 175 |
    • List item 02
    • 176 |
    • List item 03 177 |
        178 |
      • List item level 2
      • 179 |
      • List item level 2 180 |
          181 |
        • List item level 3
        • 182 |
        • List item level 3
        • 183 |
        184 |
      • 185 | 186 |
      187 |
    • 188 |
    189 | 190 |

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt 191 | ut labore et dolore magna aliqua.

    192 | 193 | 194 |

    Tables

    195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 |
    Jimi Hendrix - albums
    AlbumYearPrice
    AlbumYearPrice
    Are You Experienced 1967$10.00
    Axis: Bold as Love1967$12.00
    Electric Ladyland1968$10.00
    Band of Gypsys1970$12.00
    234 |

    235 | I am the a tag example
    236 | 237 | I am the abbr tag example
    238 | 239 | I am the acronym tag example
    240 | I am the b tag example
    241 | I am the big tag example
    242 | 243 | I am the cite tag example
    244 | 245 | I am the code tag example
    246 | I am the del tag example
    247 | I am the dfn tag example
    248 | 249 | I am the em tag example
    250 | 251 | I am the font tag example
    252 | I am the i tag example
    253 | I am the ins tag example
    254 | 255 | I am the kbd tag example
    256 | 257 | I am the q tag inside a q tag example
    258 | I am the s tag example
    259 | I am the samp tag example
    260 | 261 | I am the small tag example
    262 | I am the span tag example
    263 | I am the strike tag example
    264 | I am the strong tag example
    265 | 266 | I am the sub tag example
    267 | I am the sup tag example
    268 | I am the tt tag example
    269 | I am the var tag example
    270 | 271 | I am the u tag example 272 |

    273 |

    What is Lorem Ipsum?

    274 |

    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

    275 | 276 |

    This Lorem Ipsum HTML example is created from the parts of Placeholder Markup with Lorem Ipsum - Jon Tan, 277 | Emastic CSS Framework, 278 | Tripoli CSS Framework and 279 | Baseline CSS Framework .

    280 | 281 |
    Address: somewhere, World
    282 | 283 | 284 | 285 |

    286 | Link
    287 | <strong>
    288 | <del> deleted
    289 | <dfn> dfn
    290 | <em> emphasis 291 |

    292 |
    293 | <html>
    294 | 	<head>
    295 | 	</head>
    296 | 	<body>
    297 | 	<div class = "main"> <div>
    298 | 	</body>
    299 | </html> 
    300 | 
    301 | 302 | <tt> 303 | Pellentesque tempor, dui ut ultrices viverra, neque urna blandit nisi, id accumsan dolor est vitae risus. 304 | 305 | 306 |
    307 | 308 | 309 | 310 | 311 |
    312 |
    Description list title 01
    313 | 314 |
    Description list description 01
    315 |
    Description list title 02
    316 |
    Description list description 02
    317 |
    Description list description 03
    318 | 319 |
    320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 |
    Table Caption
    Table head thTable head td
    Table foot thTable foot td
    Table body thTable body td
    Table body tdTable body td
    352 | 353 |
    354 | 355 |
    356 |
    357 | Form legend 358 | 359 |
    360 |
    361 |
    362 | 363 |
    364 |
    365 | 366 |
    367 |
    368 | 369 |
    370 | 371 |
    372 | 373 | 374 | 375 |
    376 | 379 |
    380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | -------------------------------------------------------------------------------- /test/qunit/testrunner.js: -------------------------------------------------------------------------------- 1 | /* 2 | * QUnit - jQuery unit testrunner 3 | * 4 | * http://docs.jquery.com/QUnit 5 | * 6 | * Copyright (c) 2008 John Resig, Jörn Zaefferer 7 | * Dual licensed under the MIT (MIT-LICENSE.txt) 8 | * and GPL (GPL-LICENSE.txt) licenses. 9 | * 10 | * $Id: testrunner.js 6173 2009-02-02 20:09:32Z jeresig $ 11 | */ 12 | 13 | (function($) { 14 | 15 | // Tests for equality any JavaScript type and structure without unexpected results. 16 | // Discussions and reference: http://philrathe.com/articles/equiv 17 | // Test suites: http://philrathe.com/tests/equiv 18 | // Author: Philippe Rathé 19 | var equiv = function () { 20 | 21 | var innerEquiv; // the real equiv function 22 | var callers = []; // stack to decide between skip/abort functions 23 | 24 | // Determine what is o. 25 | function hoozit(o) { 26 | if (typeof o === "string") { 27 | return "string"; 28 | 29 | } else if (typeof o === "boolean") { 30 | return "boolean"; 31 | 32 | } else if (typeof o === "number") { 33 | 34 | if (isNaN(o)) { 35 | return "nan"; 36 | } else { 37 | return "number"; 38 | } 39 | 40 | } else if (typeof o === "undefined") { 41 | return "undefined"; 42 | 43 | // consider: typeof null === object 44 | } else if (o === null) { 45 | return "null"; 46 | 47 | // consider: typeof [] === object 48 | } else if (o instanceof Array) { 49 | return "array"; 50 | 51 | // consider: typeof new Date() === object 52 | } else if (o instanceof Date) { 53 | return "date"; 54 | 55 | // consider: /./ instanceof Object; 56 | // /./ instanceof RegExp; 57 | // typeof /./ === "function"; // => false in IE and Opera, 58 | // true in FF and Safari 59 | } else if (o instanceof RegExp) { 60 | return "regexp"; 61 | 62 | } else if (typeof o === "object") { 63 | return "object"; 64 | 65 | } else if (o instanceof Function) { 66 | return "function"; 67 | } 68 | } 69 | 70 | // Call the o related callback with the given arguments. 71 | function bindCallbacks(o, callbacks, args) { 72 | var prop = hoozit(o); 73 | if (prop) { 74 | if (hoozit(callbacks[prop]) === "function") { 75 | return callbacks[prop].apply(callbacks, args); 76 | } else { 77 | return callbacks[prop]; // or undefined 78 | } 79 | } 80 | } 81 | 82 | var callbacks = function () { 83 | 84 | // for string, boolean, number and null 85 | function useStrictEquality(b, a) { 86 | return a === b; 87 | } 88 | 89 | return { 90 | "string": useStrictEquality, 91 | "boolean": useStrictEquality, 92 | "number": useStrictEquality, 93 | "null": useStrictEquality, 94 | "undefined": useStrictEquality, 95 | 96 | "nan": function (b) { 97 | return isNaN(b); 98 | }, 99 | 100 | "date": function (b, a) { 101 | return hoozit(b) === "date" && a.valueOf() === b.valueOf(); 102 | }, 103 | 104 | "regexp": function (b, a) { 105 | return hoozit(b) === "regexp" && 106 | a.source === b.source && // the regex itself 107 | a.global === b.global && // and its modifers (gmi) ... 108 | a.ignoreCase === b.ignoreCase && 109 | a.multiline === b.multiline; 110 | }, 111 | 112 | // - skip when the property is a method of an instance (OOP) 113 | // - abort otherwise, 114 | // initial === would have catch identical references anyway 115 | "function": function () { 116 | var caller = callers[callers.length - 1]; 117 | return caller !== Object && 118 | typeof caller !== "undefined"; 119 | }, 120 | 121 | "array": function (b, a) { 122 | var i; 123 | var len; 124 | 125 | // b could be an object literal here 126 | if ( ! (hoozit(b) === "array")) { 127 | return false; 128 | } 129 | 130 | len = a.length; 131 | if (len !== b.length) { // safe and faster 132 | return false; 133 | } 134 | for (i = 0; i < len; i++) { 135 | if( ! innerEquiv(a[i], b[i])) { 136 | return false; 137 | } 138 | } 139 | return true; 140 | }, 141 | 142 | "object": function (b, a) { 143 | var i; 144 | var eq = true; // unless we can proove it 145 | var aProperties = [], bProperties = []; // collection of strings 146 | 147 | // comparing constructors is more strict than using instanceof 148 | if ( a.constructor !== b.constructor) { 149 | return false; 150 | } 151 | 152 | // stack constructor before traversing properties 153 | callers.push(a.constructor); 154 | 155 | for (i in a) { // be strict: don't ensures hasOwnProperty and go deep 156 | 157 | aProperties.push(i); // collect a's properties 158 | 159 | if ( ! innerEquiv(a[i], b[i])) { 160 | eq = false; 161 | } 162 | } 163 | 164 | callers.pop(); // unstack, we are done 165 | 166 | for (i in b) { 167 | bProperties.push(i); // collect b's properties 168 | } 169 | 170 | // Ensures identical properties name 171 | return eq && innerEquiv(aProperties.sort(), bProperties.sort()); 172 | } 173 | }; 174 | }(); 175 | 176 | innerEquiv = function () { // can take multiple arguments 177 | var args = Array.prototype.slice.apply(arguments); 178 | if (args.length < 2) { 179 | return true; // end transition 180 | } 181 | 182 | return (function (a, b) { 183 | if (a === b) { 184 | return true; // catch the most you can 185 | 186 | } else if (typeof a !== typeof b || a === null || b === null || typeof a === "undefined" || typeof b === "undefined") { 187 | return false; // don't lose time with error prone cases 188 | 189 | } else { 190 | return bindCallbacks(a, callbacks, [b, a]); 191 | } 192 | 193 | // apply transition with (1..n) arguments 194 | })(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1)); 195 | }; 196 | 197 | return innerEquiv; 198 | }(); // equiv 199 | 200 | var GETParams = $.map( location.search.slice(1).split('&'), decodeURIComponent ), 201 | ngindex = $.inArray("noglobals", GETParams), 202 | noglobals = ngindex !== -1; 203 | 204 | if( noglobals ) 205 | GETParams.splice( ngindex, 1 ); 206 | 207 | var config = { 208 | stats: { 209 | all: 0, 210 | bad: 0 211 | }, 212 | queue: [], 213 | // block until document ready 214 | blocking: true, 215 | //restrict modules/tests by get parameters 216 | filters: GETParams, 217 | isLocal: !!(window.location.protocol == 'file:') 218 | }; 219 | 220 | // public API as global methods 221 | $.extend(window, { 222 | test: test, 223 | module: module, 224 | expect: expect, 225 | ok: ok, 226 | equals: equals, 227 | start: start, 228 | stop: stop, 229 | reset: reset, 230 | isLocal: config.isLocal, 231 | same: function(a, b, message) { 232 | push(equiv(a, b), a, b, message); 233 | }, 234 | QUnit: { 235 | equiv: equiv, 236 | ok: ok, 237 | done: function(failures, total){}, 238 | log: function(result, message){} 239 | }, 240 | // legacy methods below 241 | isSet: isSet, 242 | isObj: isObj, 243 | compare: function() { 244 | throw "compare is deprecated - use same() instead"; 245 | }, 246 | compare2: function() { 247 | throw "compare2 is deprecated - use same() instead"; 248 | }, 249 | serialArray: function() { 250 | throw "serialArray is deprecated - use jsDump.parse() instead"; 251 | }, 252 | q: q, 253 | t: t, 254 | url: url, 255 | triggerEvent: triggerEvent 256 | }); 257 | 258 | $(window).load(function() { 259 | $('#userAgent').html(navigator.userAgent); 260 | var head = $('
    ').insertAfter("#userAgent"); 261 | $('').attr("disabled", true).prependTo(head).click(function() { 262 | $('li.pass')[this.checked ? 'hide' : 'show'](); 263 | }); 264 | $('').attr("disabled", true).appendTo(head).click(function() { 265 | $("li.fail:contains('missing test - untested code is broken code')").parent('ol').parent('li.fail')[this.checked ? 'hide' : 'show'](); 266 | }); 267 | $("#filter-missing").after(''); 268 | runTest(); 269 | }); 270 | 271 | function synchronize(callback) { 272 | config.queue.push(callback); 273 | if(!config.blocking) { 274 | process(); 275 | } 276 | } 277 | 278 | function process() { 279 | while(config.queue.length && !config.blocking) { 280 | config.queue.shift()(); 281 | } 282 | } 283 | 284 | function stop(timeout) { 285 | config.blocking = true; 286 | if (timeout) 287 | config.timeout = setTimeout(function() { 288 | QUnit.ok( false, "Test timed out" ); 289 | start(); 290 | }, timeout); 291 | } 292 | function start() { 293 | // A slight delay, to avoid any current callbacks 294 | setTimeout(function() { 295 | if(config.timeout) 296 | clearTimeout(config.timeout); 297 | config.blocking = false; 298 | process(); 299 | }, 13); 300 | } 301 | 302 | function validTest( name ) { 303 | var i = config.filters.length, 304 | run = false; 305 | 306 | if( !i ) 307 | return true; 308 | 309 | while( i-- ){ 310 | var filter = config.filters[i], 311 | not = filter.charAt(0) == '!'; 312 | if( not ) 313 | filter = filter.slice(1); 314 | if( name.indexOf(filter) != -1 ) 315 | return !not; 316 | if( not ) 317 | run = true; 318 | } 319 | return run; 320 | } 321 | 322 | function runTest() { 323 | config.blocking = false; 324 | var started = +new Date; 325 | config.fixture = document.getElementById('main').innerHTML; 326 | config.ajaxSettings = $.ajaxSettings; 327 | synchronize(function() { 328 | $('

    ').html(['Tests completed in ', 329 | +new Date - started, ' milliseconds.
    ', 330 | '', config.stats.bad, ' tests of ', config.stats.all, ' failed.'] 331 | .join('')) 332 | .appendTo("body"); 333 | $("#banner").addClass(config.stats.bad ? "fail" : "pass"); 334 | QUnit.done( config.stats.bad, config.stats.all ); 335 | }); 336 | } 337 | 338 | var pollution; 339 | 340 | function saveGlobal(){ 341 | pollution = [ ]; 342 | 343 | if( noglobals ) 344 | for( var key in window ) 345 | pollution.push(key); 346 | } 347 | function checkPollution( name ){ 348 | var old = pollution; 349 | saveGlobal(); 350 | 351 | if( pollution.length > old.length ){ 352 | ok( false, "Introduced global variable(s): " + diff(old, pollution).join(", ") ); 353 | config.expected++; 354 | } 355 | } 356 | 357 | function diff( clean, dirty ){ 358 | return $.grep( dirty, function(name){ 359 | return $.inArray( name, clean ) == -1; 360 | }); 361 | } 362 | 363 | function test(name, callback) { 364 | if(config.currentModule) 365 | name = config.currentModule + " module: " + name; 366 | var lifecycle = $.extend({ 367 | setup: function() {}, 368 | teardown: function() {} 369 | }, config.moduleLifecycle); 370 | 371 | if ( !validTest(name) ) 372 | return; 373 | 374 | synchronize(function() { 375 | config.assertions = []; 376 | config.expected = null; 377 | try { 378 | if( !pollution ) 379 | saveGlobal(); 380 | lifecycle.setup(); 381 | } catch(e) { 382 | QUnit.ok( false, "Setup failed on " + name + ": " + e.message ); 383 | } 384 | }) 385 | synchronize(function() { 386 | try { 387 | callback(); 388 | } catch(e) { 389 | if( typeof console != "undefined" && console.error && console.warn ) { 390 | console.error("Test " + name + " died, exception and test follows"); 391 | console.error(e); 392 | console.warn(callback.toString()); 393 | } 394 | QUnit.ok( false, "Died on test #" + (config.assertions.length + 1) + ": " + e.message ); 395 | // else next test will carry the responsibility 396 | saveGlobal(); 397 | } 398 | }); 399 | synchronize(function() { 400 | try { 401 | checkPollution(); 402 | lifecycle.teardown(); 403 | } catch(e) { 404 | QUnit.ok( false, "Teardown failed on " + name + ": " + e.message ); 405 | } 406 | }) 407 | synchronize(function() { 408 | try { 409 | reset(); 410 | } catch(e) { 411 | if( typeof console != "undefined" && console.error && console.warn ) { 412 | console.error("reset() failed, following Test " + name + ", exception and reset fn follows"); 413 | console.error(e); 414 | console.warn(reset.toString()); 415 | } 416 | } 417 | 418 | if(config.expected && config.expected != config.assertions.length) { 419 | QUnit.ok( false, "Expected " + config.expected + " assertions, but " + config.assertions.length + " were run" ); 420 | } 421 | 422 | var good = 0, bad = 0; 423 | var ol = $("

      ").hide(); 424 | config.stats.all += config.assertions.length; 425 | for ( var i = 0; i < config.assertions.length; i++ ) { 426 | var assertion = config.assertions[i]; 427 | $("
    1. ").addClass(assertion.result ? "pass" : "fail").text(assertion.message || "(no message)").appendTo(ol); 428 | assertion.result ? good++ : bad++; 429 | } 430 | config.stats.bad += bad; 431 | 432 | var b = $("").html(name + " (" + bad + ", " + good + ", " + config.assertions.length + ")") 433 | .click(function(){ 434 | $(this).next().toggle(); 435 | }) 436 | .dblclick(function(event) { 437 | var target = $(event.target).filter("strong").clone(); 438 | if ( target.length ) { 439 | target.children().remove(); 440 | location.href = location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent($.trim(target.text())); 441 | } 442 | }); 443 | 444 | $("
    2. ").addClass(bad ? "fail" : "pass").append(b).append(ol).appendTo("#tests"); 445 | 446 | if(bad) { 447 | $("#filter-pass").attr("disabled", null); 448 | $("#filter-missing").attr("disabled", null); 449 | } 450 | }); 451 | } 452 | 453 | // call on start of module test to prepend name to all tests 454 | function module(name, lifecycle) { 455 | config.currentModule = name; 456 | config.moduleLifecycle = lifecycle; 457 | } 458 | 459 | /** 460 | * Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. 461 | */ 462 | function expect(asserts) { 463 | config.expected = asserts; 464 | } 465 | 466 | /** 467 | * Resets the test setup. Useful for tests that modify the DOM. 468 | */ 469 | function reset() { 470 | $("#main").html( config.fixture ); 471 | $.event.global = {}; 472 | $.ajaxSettings = $.extend({}, config.ajaxSettings); 473 | } 474 | 475 | /** 476 | * Asserts true. 477 | * @example ok( $("a").size() > 5, "There must be at least 5 anchors" ); 478 | */ 479 | function ok(a, msg) { 480 | QUnit.log(a, msg); 481 | 482 | config.assertions.push({ 483 | result: !!a, 484 | message: msg 485 | }); 486 | } 487 | 488 | /** 489 | * Asserts that two arrays are the same 490 | */ 491 | function isSet(a, b, msg) { 492 | function serialArray( a ) { 493 | var r = []; 494 | 495 | if ( a && a.length ) 496 | for ( var i = 0; i < a.length; i++ ) { 497 | var str = a[i].nodeName; 498 | if ( str ) { 499 | str = str.toLowerCase(); 500 | if ( a[i].id ) 501 | str += "#" + a[i].id; 502 | } else 503 | str = a[i]; 504 | r.push( str ); 505 | } 506 | 507 | return "[ " + r.join(", ") + " ]"; 508 | } 509 | var ret = true; 510 | if ( a && b && a.length != undefined && a.length == b.length ) { 511 | for ( var i = 0; i < a.length; i++ ) 512 | if ( a[i] != b[i] ) 513 | ret = false; 514 | } else 515 | ret = false; 516 | QUnit.ok( ret, !ret ? (msg + " expected: " + serialArray(b) + " result: " + serialArray(a)) : msg ); 517 | } 518 | 519 | /** 520 | * Asserts that two objects are equivalent 521 | */ 522 | function isObj(a, b, msg) { 523 | var ret = true; 524 | 525 | if ( a && b ) { 526 | for ( var i in a ) 527 | if ( a[i] != b[i] ) 528 | ret = false; 529 | 530 | for ( i in b ) 531 | if ( a[i] != b[i] ) 532 | ret = false; 533 | } else 534 | ret = false; 535 | 536 | QUnit.ok( ret, msg ); 537 | } 538 | 539 | /** 540 | * Returns an array of elements with the given IDs, eg. 541 | * @example q("main", "foo", "bar") 542 | * @result [
      , , ] 543 | */ 544 | function q() { 545 | var r = []; 546 | for ( var i = 0; i < arguments.length; i++ ) 547 | r.push( document.getElementById( arguments[i] ) ); 548 | return r; 549 | } 550 | 551 | /** 552 | * Asserts that a select matches the given IDs 553 | * @example t("Check for something", "//[a]", ["foo", "baar"]); 554 | * @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar' 555 | */ 556 | function t(a,b,c) { 557 | var f = $(b); 558 | var s = ""; 559 | for ( var i = 0; i < f.length; i++ ) 560 | s += (s && ",") + '"' + f[i].id + '"'; 561 | isSet(f, q.apply(q,c), a + " (" + b + ")"); 562 | } 563 | 564 | /** 565 | * Add random number to url to stop IE from caching 566 | * 567 | * @example url("data/test.html") 568 | * @result "data/test.html?10538358428943" 569 | * 570 | * @example url("data/test.php?foo=bar") 571 | * @result "data/test.php?foo=bar&10538358345554" 572 | */ 573 | function url(value) { 574 | return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000); 575 | } 576 | 577 | /** 578 | * Checks that the first two arguments are equal, with an optional message. 579 | * Prints out both actual and expected values. 580 | * 581 | * Prefered to ok( actual == expected, message ) 582 | * 583 | * @example equals( $.format("Received {0} bytes.", 2), "Received 2 bytes." ); 584 | * 585 | * @param Object actual 586 | * @param Object expected 587 | * @param String message (optional) 588 | */ 589 | function equals(actual, expected, message) { 590 | push(expected == actual, actual, expected, message); 591 | } 592 | 593 | function push(result, actual, expected, message) { 594 | message = message || (result ? "okay" : "failed"); 595 | QUnit.ok( result, result ? message + ": " + expected : message + ", expected: " + jsDump.parse(expected) + " result: " + jsDump.parse(actual) ); 596 | } 597 | 598 | /** 599 | * Trigger an event on an element. 600 | * 601 | * @example triggerEvent( document.body, "click" ); 602 | * 603 | * @param DOMElement elem 604 | * @param String type 605 | */ 606 | function triggerEvent( elem, type, event ) { 607 | if ( $.browser.mozilla || $.browser.opera ) { 608 | event = document.createEvent("MouseEvents"); 609 | event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, 610 | 0, 0, 0, 0, 0, false, false, false, false, 0, null); 611 | elem.dispatchEvent( event ); 612 | } else if ( $.browser.msie ) { 613 | elem.fireEvent("on"+type); 614 | } 615 | } 616 | 617 | })(jQuery); 618 | 619 | /** 620 | * jsDump 621 | * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com 622 | * Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php) 623 | * Date: 5/15/2008 624 | * @projectDescription Advanced and extensible data dumping for Javascript. 625 | * @version 1.0.0 626 | * @author Ariel Flesler 627 | * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} 628 | */ 629 | (function(){ 630 | function quote( str ){ 631 | return '"' + str.toString().replace(/"/g, '\\"') + '"'; 632 | }; 633 | function literal( o ){ 634 | return o + ''; 635 | }; 636 | function join( pre, arr, post ){ 637 | var s = jsDump.separator(), 638 | base = jsDump.indent(); 639 | inner = jsDump.indent(1); 640 | if( arr.join ) 641 | arr = arr.join( ',' + s + inner ); 642 | if( !arr ) 643 | return pre + post; 644 | return [ pre, inner + arr, base + post ].join(s); 645 | }; 646 | function array( arr ){ 647 | var i = arr.length, ret = Array(i); 648 | this.up(); 649 | while( i-- ) 650 | ret[i] = this.parse( arr[i] ); 651 | this.down(); 652 | return join( '[', ret, ']' ); 653 | }; 654 | 655 | var reName = /^function (\w+)/; 656 | 657 | var jsDump = window.jsDump = { 658 | parse:function( obj, type ){//type is used mostly internally, you can fix a (custom)type in advance 659 | var parser = this.parsers[ type || this.typeOf(obj) ]; 660 | type = typeof parser; 661 | 662 | return type == 'function' ? parser.call( this, obj ) : 663 | type == 'string' ? parser : 664 | this.parsers.error; 665 | }, 666 | typeOf:function( obj ){ 667 | var type = typeof obj, 668 | f = 'function';//we'll use it 3 times, save it 669 | return type != 'object' && type != f ? type : 670 | !obj ? 'null' : 671 | obj.exec ? 'regexp' :// some browsers (FF) consider regexps functions 672 | obj.getHours ? 'date' : 673 | obj.scrollBy ? 'window' : 674 | obj.nodeName == '#document' ? 'document' : 675 | obj.nodeName ? 'node' : 676 | obj.item ? 'nodelist' : // Safari reports nodelists as functions 677 | obj.callee ? 'arguments' : 678 | obj.call || obj.constructor != Array && //an array would also fall on this hack 679 | (obj+'').indexOf(f) != -1 ? f : //IE reports functions like alert, as objects 680 | 'length' in obj ? 'array' : 681 | type; 682 | }, 683 | separator:function(){ 684 | return this.multiline ? this.HTML ? '
      ' : '\n' : this.HTML ? ' ' : ' '; 685 | }, 686 | indent:function( extra ){// extra can be a number, shortcut for increasing-calling-decreasing 687 | if( !this.multiline ) 688 | return ''; 689 | var chr = this.indentChar; 690 | if( this.HTML ) 691 | chr = chr.replace(/\t/g,' ').replace(/ /g,' '); 692 | return Array( this._depth_ + (extra||0) ).join(chr); 693 | }, 694 | up:function( a ){ 695 | this._depth_ += a || 1; 696 | }, 697 | down:function( a ){ 698 | this._depth_ -= a || 1; 699 | }, 700 | setParser:function( name, parser ){ 701 | this.parsers[name] = parser; 702 | }, 703 | // The next 3 are exposed so you can use them 704 | quote:quote, 705 | literal:literal, 706 | join:join, 707 | // 708 | _depth_: 1, 709 | // This is the list of parsers, to modify them, use jsDump.setParser 710 | parsers:{ 711 | window: '[Window]', 712 | document: '[Document]', 713 | error:'[ERROR]', //when no parser is found, shouldn't happen 714 | unknown: '[Unknown]', 715 | 'null':'null', 716 | undefined:'undefined', 717 | 'function':function( fn ){ 718 | var ret = 'function', 719 | name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE 720 | if( name ) 721 | ret += ' ' + name; 722 | ret += '('; 723 | 724 | ret = [ ret, this.parse( fn, 'functionArgs' ), '){'].join(''); 725 | return join( ret, this.parse(fn,'functionCode'), '}' ); 726 | }, 727 | array: array, 728 | nodelist: array, 729 | arguments: array, 730 | object:function( map ){ 731 | var ret = [ ]; 732 | this.up(); 733 | for( var key in map ) 734 | ret.push( this.parse(key,'key') + ': ' + this.parse(map[key]) ); 735 | this.down(); 736 | return join( '{', ret, '}' ); 737 | }, 738 | node:function( node ){ 739 | var open = this.HTML ? '<' : '<', 740 | close = this.HTML ? '>' : '>'; 741 | 742 | var tag = node.nodeName.toLowerCase(), 743 | ret = open + tag; 744 | 745 | for( var a in this.DOMAttrs ){ 746 | var val = node[this.DOMAttrs[a]]; 747 | if( val ) 748 | ret += ' ' + a + '=' + this.parse( val, 'attribute' ); 749 | } 750 | return ret + close + open + '/' + tag + close; 751 | }, 752 | functionArgs:function( fn ){//function calls it internally, it's the arguments part of the function 753 | var l = fn.length; 754 | if( !l ) return ''; 755 | 756 | var args = Array(l); 757 | while( l-- ) 758 | args[l] = String.fromCharCode(97+l);//97 is 'a' 759 | return ' ' + args.join(', ') + ' '; 760 | }, 761 | key:quote, //object calls it internally, the key part of an item in a map 762 | functionCode:'[code]', //function calls it internally, it's the content of the function 763 | attribute:quote, //node calls it internally, it's an html attribute value 764 | string:quote, 765 | date:quote, 766 | regexp:literal, //regex 767 | number:literal, 768 | 'boolean':literal 769 | }, 770 | DOMAttrs:{//attributes to dump from nodes, name=>realName 771 | id:'id', 772 | name:'name', 773 | 'class':'className' 774 | }, 775 | HTML:false,//if true, entities are escaped ( <, >, \t, space and \n ) 776 | indentChar:' ',//indentation unit 777 | multiline:true //if true, items in a collection, are separated by a \n, else just a space. 778 | }; 779 | 780 | })(); 781 | 782 | 783 | 784 | //fireunit compat 785 | // http://ejohn.org/blog/fireunit/ 786 | if ( typeof fireunit === "object" ) { 787 | QUnit.log = fireunit.ok; 788 | QUnit.done = fireunit.testDone; 789 | } 790 | 791 | -------------------------------------------------------------------------------- /test/tests.js: -------------------------------------------------------------------------------- 1 | 2 | // documentation on writing tests here: http://docs.jquery.com/QUnit 3 | 4 | 5 | module("example tests"); 6 | test('Molecular is sweet',function(){ 7 | expect(1); 8 | equals('molecular'.replace('molecular','sweet'),'sweet','Yes. Molecular is, in fact, sweet'); 9 | 10 | }) 11 | 12 | // these test things from script.js 13 | test('Environment is good',function(){ 14 | expect(3); 15 | equals( $.browser.ie6, ($.browser.msie && jQuery.browser.version < 7),'$.browser.ie6 is set and correct' ); 16 | ok( (typeof document._write === 'function'),'document write is remapped to _write' ) 17 | ok( (document._write != document.write),'document write is different than _write' ) 18 | }) 19 | 20 | 21 | 22 | 23 | // below are example tests from qunit itself 24 | module("equiv"); 25 | test("Primitive types and constants", function () { 26 | expect(60); 27 | equals(QUnit.equiv(null, null), true, "null"); 28 | equals(QUnit.equiv(null, {}), false, "null"); 29 | equals(QUnit.equiv(null, undefined), false, "null"); 30 | equals(QUnit.equiv(null, 0), false, "null"); 31 | equals(QUnit.equiv(null, false), false, "null"); 32 | equals(QUnit.equiv(null, ''), false, "null"); 33 | equals(QUnit.equiv(null, []), false, "null"); 34 | 35 | equals(QUnit.equiv(undefined, undefined), true, "undefined"); 36 | equals(QUnit.equiv(undefined, null), false, "undefined"); 37 | equals(QUnit.equiv(undefined, 0), false, "undefined"); 38 | equals(QUnit.equiv(undefined, false), false, "undefined"); 39 | equals(QUnit.equiv(undefined, {}), false, "undefined"); 40 | equals(QUnit.equiv(undefined, []), false, "undefined"); 41 | equals(QUnit.equiv(undefined, ""), false, "undefined"); 42 | 43 | // Nan usually doest not equal to Nan using the '==' operator. 44 | // Only isNaN() is able to do it. 45 | equals(QUnit.equiv(0/0, 0/0), true, "NaN"); // NaN VS NaN 46 | equals(QUnit.equiv(1/0, 2/0), true, "Infinity"); // Infinity VS Infinity 47 | equals(QUnit.equiv(-1/0, 2/0), false, "-Infinity, Infinity"); // -Infinity VS Infinity 48 | equals(QUnit.equiv(-1/0, -2/0), true, "-Infinity, -Infinity"); // -Infinity VS -Infinity 49 | equals(QUnit.equiv(0/0, 1/0), false, "NaN, Infinity"); // Nan VS Infinity 50 | equals(QUnit.equiv(1/0, 0/0), false, "NaN, Infinity"); // Nan VS Infinity 51 | equals(QUnit.equiv(0/0, null), false, "NaN"); 52 | equals(QUnit.equiv(0/0, undefined), false, "NaN"); 53 | equals(QUnit.equiv(0/0, 0), false, "NaN"); 54 | equals(QUnit.equiv(0/0, false), false, "NaN"); 55 | equals(QUnit.equiv(0/0, function () {}), false, "NaN"); 56 | equals(QUnit.equiv(1/0, null), false, "NaN, Infinity"); 57 | equals(QUnit.equiv(1/0, undefined), false, "NaN, Infinity"); 58 | equals(QUnit.equiv(1/0, 0), false, "NaN, Infinity"); 59 | equals(QUnit.equiv(1/0, 1), false, "NaN, Infinity"); 60 | equals(QUnit.equiv(1/0, false), false, "NaN, Infinity"); 61 | equals(QUnit.equiv(1/0, true), false, "NaN, Infinity"); 62 | equals(QUnit.equiv(1/0, function () {}), false, "NaN, Infinity"); 63 | 64 | equals(QUnit.equiv(0, 0), true, "number"); 65 | equals(QUnit.equiv(0, 1), false, "number"); 66 | equals(QUnit.equiv(1, 0), false, "number"); 67 | equals(QUnit.equiv(1, 1), true, "number"); 68 | equals(QUnit.equiv(1.1, 1.1), true, "number"); 69 | equals(QUnit.equiv(0.0000005, 0.0000005), true, "number"); 70 | equals(QUnit.equiv(0, ''), false, "number"); 71 | equals(QUnit.equiv(0, '0'), false, "number"); 72 | equals(QUnit.equiv(1, '1'), false, "number"); 73 | equals(QUnit.equiv(0, false), false, "number"); 74 | equals(QUnit.equiv(1, true), false, "number"); 75 | 76 | equals(QUnit.equiv(true, true), true, "boolean"); 77 | equals(QUnit.equiv(true, false), false, "boolean"); 78 | equals(QUnit.equiv(false, true), false, "boolean"); 79 | equals(QUnit.equiv(false, 0), false, "boolean"); 80 | equals(QUnit.equiv(false, null), false, "boolean"); 81 | equals(QUnit.equiv(false, undefined), false, "boolean"); 82 | equals(QUnit.equiv(true, 1), false, "boolean"); 83 | equals(QUnit.equiv(true, null), false, "boolean"); 84 | equals(QUnit.equiv(true, undefined), false, "boolean"); 85 | 86 | equals(QUnit.equiv('', ''), true, "string"); 87 | equals(QUnit.equiv('a', 'a'), true, "string"); 88 | equals(QUnit.equiv("foobar", "foobar"), true, "string"); 89 | equals(QUnit.equiv("foobar", "foo"), false, "string"); 90 | equals(QUnit.equiv('', 0), false, "string"); 91 | equals(QUnit.equiv('', false), false, "string"); 92 | equals(QUnit.equiv('', null), false, "string"); 93 | equals(QUnit.equiv('', undefined), false, "string"); 94 | }); 95 | 96 | test("Objects Basics.", function() { 97 | expect(15); 98 | equals(QUnit.equiv({}, {}), true); 99 | equals(QUnit.equiv({}, null), false); 100 | equals(QUnit.equiv({}, undefined), false); 101 | equals(QUnit.equiv({}, 0), false); 102 | equals(QUnit.equiv({}, false), false); 103 | 104 | // This test is a hard one, it is very important 105 | // REASONS: 106 | // 1) They are of the same type "object" 107 | // 2) [] instanceof Object is true 108 | // 3) Their properties are the same (doesn't exists) 109 | equals(QUnit.equiv({}, []), false); 110 | 111 | equals(QUnit.equiv({a:1}, {a:1}), true); 112 | equals(QUnit.equiv({a:1}, {a:"1"}), false); 113 | equals(QUnit.equiv({a:[]}, {a:[]}), true); 114 | equals(QUnit.equiv({a:{}}, {a:null}), false); 115 | equals(QUnit.equiv({a:1}, {}), false); 116 | equals(QUnit.equiv({}, {a:1}), false); 117 | 118 | // Hard ones 119 | equals(QUnit.equiv({a:undefined}, {}), false); 120 | equals(QUnit.equiv({}, {a:undefined}), false); 121 | equals(QUnit.equiv( 122 | { 123 | a: [{ bar: undefined }] 124 | }, 125 | { 126 | a: [{ bat: undefined }] 127 | } 128 | ), false); 129 | }); 130 | 131 | 132 | test("Arrays Basics.", function() { 133 | expect(20); 134 | equals(QUnit.equiv([], []), true); 135 | 136 | // May be a hard one, can invoke a crash at execution. 137 | // because their types are both "object" but null isn't 138 | // like a true object, it doesn't have any property at all. 139 | equals(QUnit.equiv([], null), false); 140 | 141 | equals(QUnit.equiv([], undefined), false); 142 | equals(QUnit.equiv([], false), false); 143 | equals(QUnit.equiv([], 0), false); 144 | equals(QUnit.equiv([], ""), false); 145 | 146 | // May be a hard one, but less hard 147 | // than {} with [] (note the order) 148 | equals(QUnit.equiv([], {}), false); 149 | 150 | equals(QUnit.equiv([null],[]), false); 151 | equals(QUnit.equiv([undefined],[]), false); 152 | equals(QUnit.equiv([],[null]), false); 153 | equals(QUnit.equiv([],[undefined]), false); 154 | equals(QUnit.equiv([null],[undefined]), false); 155 | equals(QUnit.equiv([[]],[[]]), true); 156 | equals(QUnit.equiv([[],[],[]],[[],[],[]]), true); 157 | equals(QUnit.equiv( 158 | [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]], 159 | [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]), 160 | true); 161 | equals(QUnit.equiv( 162 | [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]], 163 | [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]), // shorter 164 | false); 165 | equals(QUnit.equiv( 166 | [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[{}]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]], 167 | [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]), // deepest element not an array 168 | false); 169 | 170 | // same multidimensional 171 | equals(QUnit.equiv( 172 | [1,2,3,4,5,6,7,8,9, [ 173 | 1,2,3,4,5,6,7,8,9, [ 174 | 1,2,3,4,5,[ 175 | [6,7,8,9, [ 176 | [ 177 | 1,2,3,4,[ 178 | 2,3,4,[ 179 | 1,2,[ 180 | 1,2,3,4,[ 181 | 1,2,3,4,5,6,7,8,9,[ 182 | 0 183 | ],1,2,3,4,5,6,7,8,9 184 | ],5,6,7,8,9 185 | ],4,5,6,7,8,9 186 | ],5,6,7,8,9 187 | ],5,6,7 188 | ] 189 | ] 190 | ] 191 | ] 192 | ]]], 193 | [1,2,3,4,5,6,7,8,9, [ 194 | 1,2,3,4,5,6,7,8,9, [ 195 | 1,2,3,4,5,[ 196 | [6,7,8,9, [ 197 | [ 198 | 1,2,3,4,[ 199 | 2,3,4,[ 200 | 1,2,[ 201 | 1,2,3,4,[ 202 | 1,2,3,4,5,6,7,8,9,[ 203 | 0 204 | ],1,2,3,4,5,6,7,8,9 205 | ],5,6,7,8,9 206 | ],4,5,6,7,8,9 207 | ],5,6,7,8,9 208 | ],5,6,7 209 | ] 210 | ] 211 | ] 212 | ] 213 | ]]]), 214 | true, "Multidimensional"); 215 | 216 | // different multidimensional 217 | equals(QUnit.equiv( 218 | [1,2,3,4,5,6,7,8,9, [ 219 | 1,2,3,4,5,6,7,8,9, [ 220 | 1,2,3,4,5,[ 221 | [6,7,8,9, [ 222 | [ 223 | 1,2,3,4,[ 224 | 2,3,4,[ 225 | 1,2,[ 226 | 1,2,3,4,[ 227 | 1,2,3,4,5,6,7,8,9,[ 228 | 0 229 | ],1,2,3,4,5,6,7,8,9 230 | ],5,6,7,8,9 231 | ],4,5,6,7,8,9 232 | ],5,6,7,8,9 233 | ],5,6,7 234 | ] 235 | ] 236 | ] 237 | ] 238 | ]]], 239 | [1,2,3,4,5,6,7,8,9, [ 240 | 1,2,3,4,5,6,7,8,9, [ 241 | 1,2,3,4,5,[ 242 | [6,7,8,9, [ 243 | [ 244 | 1,2,3,4,[ 245 | 2,3,4,[ 246 | 1,2,[ 247 | '1',2,3,4,[ // string instead of number 248 | 1,2,3,4,5,6,7,8,9,[ 249 | 0 250 | ],1,2,3,4,5,6,7,8,9 251 | ],5,6,7,8,9 252 | ],4,5,6,7,8,9 253 | ],5,6,7,8,9 254 | ],5,6,7 255 | ] 256 | ] 257 | ] 258 | ] 259 | ]]]), 260 | false, "Multidimensional"); 261 | 262 | // different multidimensional 263 | equals(QUnit.equiv( 264 | [1,2,3,4,5,6,7,8,9, [ 265 | 1,2,3,4,5,6,7,8,9, [ 266 | 1,2,3,4,5,[ 267 | [6,7,8,9, [ 268 | [ 269 | 1,2,3,4,[ 270 | 2,3,4,[ 271 | 1,2,[ 272 | 1,2,3,4,[ 273 | 1,2,3,4,5,6,7,8,9,[ 274 | 0 275 | ],1,2,3,4,5,6,7,8,9 276 | ],5,6,7,8,9 277 | ],4,5,6,7,8,9 278 | ],5,6,7,8,9 279 | ],5,6,7 280 | ] 281 | ] 282 | ] 283 | ] 284 | ]]], 285 | [1,2,3,4,5,6,7,8,9, [ 286 | 1,2,3,4,5,6,7,8,9, [ 287 | 1,2,3,4,5,[ 288 | [6,7,8,9, [ 289 | [ 290 | 1,2,3,4,[ 291 | 2,3,[ // missing an element (4) 292 | 1,2,[ 293 | 1,2,3,4,[ 294 | 1,2,3,4,5,6,7,8,9,[ 295 | 0 296 | ],1,2,3,4,5,6,7,8,9 297 | ],5,6,7,8,9 298 | ],4,5,6,7,8,9 299 | ],5,6,7,8,9 300 | ],5,6,7 301 | ] 302 | ] 303 | ] 304 | ] 305 | ]]]), 306 | false, "Multidimensional"); 307 | }); 308 | 309 | test("Functions.", function() { 310 | expect(10); 311 | var f0 = function () {}; 312 | var f1 = function () {}; 313 | 314 | // f2 and f3 have the same code, formatted differently 315 | var f2 = function () {var i = 0;}; 316 | var f3 = function () { 317 | var i = 0 // this comment and no semicoma as difference 318 | }; 319 | 320 | equals(QUnit.equiv(function() {}, function() {}), false, "Anonymous functions"); // exact source code 321 | equals(QUnit.equiv(function() {}, function() {return true;}), false, "Anonymous functions"); 322 | 323 | equals(QUnit.equiv(f0, f0), true, "Function references"); // same references 324 | equals(QUnit.equiv(f0, f1), false, "Function references"); // exact source code, different references 325 | equals(QUnit.equiv(f2, f3), false, "Function references"); // equivalent source code, different references 326 | equals(QUnit.equiv(f1, f2), false, "Function references"); // different source code, different references 327 | equals(QUnit.equiv(function() {}, true), false); 328 | equals(QUnit.equiv(function() {}, undefined), false); 329 | equals(QUnit.equiv(function() {}, null), false); 330 | equals(QUnit.equiv(function() {}, {}), false); 331 | }); 332 | 333 | 334 | test("Date instances.", function() { 335 | expect(3); 336 | // Date, we don't need to test Date.parse() because it returns a number. 337 | // Only test the Date instances by setting them a fix date. 338 | // The date use is midnight January 1, 1970 339 | 340 | var d1 = new Date(); 341 | d1.setTime(0); // fix the date 342 | 343 | var d2 = new Date(); 344 | d2.setTime(0); // fix the date 345 | 346 | var d3 = new Date(); // The very now 347 | 348 | // Anyway their types differs, just in case the code fails in the order in which it deals with date 349 | equals(QUnit.equiv(d1, 0), false); // d1.valueOf() returns 0, but d1 and 0 are different 350 | // test same values date and different instances equality 351 | equals(QUnit.equiv(d1, d2), true); 352 | // test different date and different instances difference 353 | equals(QUnit.equiv(d1, d3), false); 354 | }); 355 | 356 | 357 | test("RegExp.", function() { 358 | expect(26); 359 | // Must test cases that imply those traps: 360 | // var a = /./; 361 | // a instanceof Object; // Oops 362 | // a instanceof RegExp; // Oops 363 | // typeof a === "function"; // Oops, false in IE and Opera, true in FF and Safari ("object") 364 | 365 | // Tests same regex with same modifiers in different order 366 | var r = /foo/; 367 | var r5 = /foo/gim; 368 | var r6 = /foo/gmi; 369 | var r7 = /foo/igm; 370 | var r8 = /foo/img; 371 | var r9 = /foo/mig; 372 | var r10 = /foo/mgi; 373 | var ri1 = /foo/i; 374 | var ri2 = /foo/i; 375 | var rm1 = /foo/m; 376 | var rm2 = /foo/m; 377 | var rg1 = /foo/g; 378 | var rg2 = /foo/g; 379 | 380 | equals(QUnit.equiv(r5, r6), true, "Modifier order"); 381 | equals(QUnit.equiv(r5, r7), true, "Modifier order"); 382 | equals(QUnit.equiv(r5, r8), true, "Modifier order"); 383 | equals(QUnit.equiv(r5, r9), true, "Modifier order"); 384 | equals(QUnit.equiv(r5, r10), true, "Modifier order"); 385 | equals(QUnit.equiv(r, r5), false, "Modifier"); 386 | 387 | equals(QUnit.equiv(ri1, ri2), true, "Modifier"); 388 | equals(QUnit.equiv(r, ri1), false, "Modifier"); 389 | equals(QUnit.equiv(ri1, rm1), false, "Modifier"); 390 | equals(QUnit.equiv(r, rm1), false, "Modifier"); 391 | equals(QUnit.equiv(rm1, ri1), false, "Modifier"); 392 | equals(QUnit.equiv(rm1, rm2), true, "Modifier"); 393 | equals(QUnit.equiv(rg1, rm1), false, "Modifier"); 394 | equals(QUnit.equiv(rm1, rg1), false, "Modifier"); 395 | equals(QUnit.equiv(rg1, rg2), true, "Modifier"); 396 | 397 | // Different regex, same modifiers 398 | var r11 = /[a-z]/gi; 399 | var r13 = /[0-9]/gi; // oops! different 400 | equals(QUnit.equiv(r11, r13), false, "Regex pattern"); 401 | 402 | var r14 = /0/ig; 403 | var r15 = /"0"/ig; // oops! different 404 | equals(QUnit.equiv(r14, r15), false, "Regex pattern"); 405 | 406 | var r1 = /[\n\r\u2028\u2029]/g; 407 | var r2 = /[\n\r\u2028\u2029]/g; 408 | var r3 = /[\n\r\u2028\u2028]/g; // differs from r1 409 | var r4 = /[\n\r\u2028\u2029]/; // differs from r1 410 | 411 | equals(QUnit.equiv(r1, r2), true, "Regex pattern"); 412 | equals(QUnit.equiv(r1, r3), false, "Regex pattern"); 413 | equals(QUnit.equiv(r1, r4), false, "Regex pattern"); 414 | 415 | // More complex regex 416 | var regex1 = "^[-_.a-z0-9]+@([-_a-z0-9]+\\.)+([A-Za-z][A-Za-z]|[A-Za-z][A-Za-z][A-Za-z])|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$"; 417 | var regex2 = "^[-_.a-z0-9]+@([-_a-z0-9]+\\.)+([A-Za-z][A-Za-z]|[A-Za-z][A-Za-z][A-Za-z])|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$"; 418 | // regex 3 is different: '.' not escaped 419 | var regex3 = "^[-_.a-z0-9]+@([-_a-z0-9]+.)+([A-Za-z][A-Za-z]|[A-Za-z][A-Za-z][A-Za-z])|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$"; 420 | 421 | var r21 = new RegExp(regex1); 422 | var r22 = new RegExp(regex2); 423 | var r23 = new RegExp(regex3); // diff from r21, not same pattern 424 | var r23a = new RegExp(regex3, "gi"); // diff from r23, not same modifier 425 | var r24a = new RegExp(regex3, "ig"); // same as r23a 426 | 427 | equals(QUnit.equiv(r21, r22), true, "Complex Regex"); 428 | equals(QUnit.equiv(r21, r23), false, "Complex Regex"); 429 | equals(QUnit.equiv(r23, r23a), false, "Complex Regex"); 430 | equals(QUnit.equiv(r23a, r24a), true, "Complex Regex"); 431 | 432 | // typeof r1 is "function" in some browsers and "object" in others so we must cover this test 433 | var re = / /; 434 | equals(QUnit.equiv(re, function () {}), false, "Regex internal"); 435 | equals(QUnit.equiv(re, {}), false, "Regex internal"); 436 | }); 437 | 438 | 439 | test("Complex Objects.", function() { 440 | 441 | expect(15); 442 | 443 | function fn1() { 444 | return "fn1"; 445 | } 446 | function fn2() { 447 | return "fn2"; 448 | } 449 | 450 | // Try to invert the order of some properties to make sure it is covered. 451 | // It can failed when properties are compared between unsorted arrays. 452 | equals(QUnit.equiv( 453 | { 454 | a: 1, 455 | b: null, 456 | c: [{}], 457 | d: { 458 | a: 3.14159, 459 | b: false, 460 | c: { 461 | e: fn1, 462 | f: [[[]]], 463 | g: { 464 | j: { 465 | k: { 466 | n: { 467 | r: "r", 468 | s: [1,2,3], 469 | t: undefined, 470 | u: 0, 471 | v: { 472 | w: { 473 | x: { 474 | y: "Yahoo!", 475 | z: null 476 | } 477 | } 478 | } 479 | }, 480 | q: [], 481 | p: 1/0, 482 | o: 99 483 | }, 484 | l: undefined, 485 | m: null 486 | } 487 | }, 488 | d: 0, 489 | i: true, 490 | h: "false" 491 | } 492 | }, 493 | e: undefined, 494 | g: "", 495 | h: "h", 496 | f: {}, 497 | i: [] 498 | }, 499 | { 500 | a: 1, 501 | b: null, 502 | c: [{}], 503 | d: { 504 | b: false, 505 | a: 3.14159, 506 | c: { 507 | d: 0, 508 | e: fn1, 509 | f: [[[]]], 510 | g: { 511 | j: { 512 | k: { 513 | n: { 514 | r: "r", 515 | t: undefined, 516 | u: 0, 517 | s: [1,2,3], 518 | v: { 519 | w: { 520 | x: { 521 | z: null, 522 | y: "Yahoo!" 523 | } 524 | } 525 | } 526 | }, 527 | o: 99, 528 | p: 1/0, 529 | q: [] 530 | }, 531 | l: undefined, 532 | m: null 533 | } 534 | }, 535 | i: true, 536 | h: "false" 537 | } 538 | }, 539 | e: undefined, 540 | g: "", 541 | f: {}, 542 | h: "h", 543 | i: [] 544 | } 545 | ), true); 546 | 547 | equals(QUnit.equiv( 548 | { 549 | a: 1, 550 | b: null, 551 | c: [{}], 552 | d: { 553 | a: 3.14159, 554 | b: false, 555 | c: { 556 | d: 0, 557 | e: fn1, 558 | f: [[[]]], 559 | g: { 560 | j: { 561 | k: { 562 | n: { 563 | //r: "r", // different: missing a property 564 | s: [1,2,3], 565 | t: undefined, 566 | u: 0, 567 | v: { 568 | w: { 569 | x: { 570 | y: "Yahoo!", 571 | z: null 572 | } 573 | } 574 | } 575 | }, 576 | o: 99, 577 | p: 1/0, 578 | q: [] 579 | }, 580 | l: undefined, 581 | m: null 582 | } 583 | }, 584 | h: "false", 585 | i: true 586 | } 587 | }, 588 | e: undefined, 589 | f: {}, 590 | g: "", 591 | h: "h", 592 | i: [] 593 | }, 594 | { 595 | a: 1, 596 | b: null, 597 | c: [{}], 598 | d: { 599 | a: 3.14159, 600 | b: false, 601 | c: { 602 | d: 0, 603 | e: fn1, 604 | f: [[[]]], 605 | g: { 606 | j: { 607 | k: { 608 | n: { 609 | r: "r", 610 | s: [1,2,3], 611 | t: undefined, 612 | u: 0, 613 | v: { 614 | w: { 615 | x: { 616 | y: "Yahoo!", 617 | z: null 618 | } 619 | } 620 | } 621 | }, 622 | o: 99, 623 | p: 1/0, 624 | q: [] 625 | }, 626 | l: undefined, 627 | m: null 628 | } 629 | }, 630 | h: "false", 631 | i: true 632 | } 633 | }, 634 | e: undefined, 635 | f: {}, 636 | g: "", 637 | h: "h", 638 | i: [] 639 | } 640 | ), false); 641 | 642 | equals(QUnit.equiv( 643 | { 644 | a: 1, 645 | b: null, 646 | c: [{}], 647 | d: { 648 | a: 3.14159, 649 | b: false, 650 | c: { 651 | d: 0, 652 | e: fn1, 653 | f: [[[]]], 654 | g: { 655 | j: { 656 | k: { 657 | n: { 658 | r: "r", 659 | s: [1,2,3], 660 | t: undefined, 661 | u: 0, 662 | v: { 663 | w: { 664 | x: { 665 | y: "Yahoo!", 666 | z: null 667 | } 668 | } 669 | } 670 | }, 671 | o: 99, 672 | p: 1/0, 673 | q: [] 674 | }, 675 | l: undefined, 676 | m: null 677 | } 678 | }, 679 | h: "false", 680 | i: true 681 | } 682 | }, 683 | e: undefined, 684 | f: {}, 685 | g: "", 686 | h: "h", 687 | i: [] 688 | }, 689 | { 690 | a: 1, 691 | b: null, 692 | c: [{}], 693 | d: { 694 | a: 3.14159, 695 | b: false, 696 | c: { 697 | d: 0, 698 | e: fn1, 699 | f: [[[]]], 700 | g: { 701 | j: { 702 | k: { 703 | n: { 704 | r: "r", 705 | s: [1,2,3], 706 | //t: undefined, // different: missing a property with an undefined value 707 | u: 0, 708 | v: { 709 | w: { 710 | x: { 711 | y: "Yahoo!", 712 | z: null 713 | } 714 | } 715 | } 716 | }, 717 | o: 99, 718 | p: 1/0, 719 | q: [] 720 | }, 721 | l: undefined, 722 | m: null 723 | } 724 | }, 725 | h: "false", 726 | i: true 727 | } 728 | }, 729 | e: undefined, 730 | f: {}, 731 | g: "", 732 | h: "h", 733 | i: [] 734 | } 735 | ), false); 736 | 737 | equals(QUnit.equiv( 738 | { 739 | a: 1, 740 | b: null, 741 | c: [{}], 742 | d: { 743 | a: 3.14159, 744 | b: false, 745 | c: { 746 | d: 0, 747 | e: fn1, 748 | f: [[[]]], 749 | g: { 750 | j: { 751 | k: { 752 | n: { 753 | r: "r", 754 | s: [1,2,3], 755 | t: undefined, 756 | u: 0, 757 | v: { 758 | w: { 759 | x: { 760 | y: "Yahoo!", 761 | z: null 762 | } 763 | } 764 | } 765 | }, 766 | o: 99, 767 | p: 1/0, 768 | q: [] 769 | }, 770 | l: undefined, 771 | m: null 772 | } 773 | }, 774 | h: "false", 775 | i: true 776 | } 777 | }, 778 | e: undefined, 779 | f: {}, 780 | g: "", 781 | h: "h", 782 | i: [] 783 | }, 784 | { 785 | a: 1, 786 | b: null, 787 | c: [{}], 788 | d: { 789 | a: 3.14159, 790 | b: false, 791 | c: { 792 | d: 0, 793 | e: fn1, 794 | f: [[[]]], 795 | g: { 796 | j: { 797 | k: { 798 | n: { 799 | r: "r", 800 | s: [1,2,3], 801 | t: undefined, 802 | u: 0, 803 | v: { 804 | w: { 805 | x: { 806 | y: "Yahoo!", 807 | z: null 808 | } 809 | } 810 | } 811 | }, 812 | o: 99, 813 | p: 1/0, 814 | q: {} // different was [] 815 | }, 816 | l: undefined, 817 | m: null 818 | } 819 | }, 820 | h: "false", 821 | i: true 822 | } 823 | }, 824 | e: undefined, 825 | f: {}, 826 | g: "", 827 | h: "h", 828 | i: [] 829 | } 830 | ), false); 831 | 832 | var same1 = { 833 | a: [ 834 | "string", null, 0, "1", 1, { 835 | prop: null, 836 | foo: [1,2,null,{}, [], [1,2,3]], 837 | bar: undefined 838 | }, 3, "Hey!", "Κάνε πάντα γνωρίζουμε ας των, μηχανής επιδιόρθωσης επιδιορθώσεις ώς μια. Κλπ ας" 839 | ], 840 | unicode: "老 汉语中存在 港澳和海外的华人圈中 贵州 我去了书店 现在尚有争", 841 | b: "b", 842 | c: fn1 843 | }; 844 | 845 | var same2 = { 846 | a: [ 847 | "string", null, 0, "1", 1, { 848 | prop: null, 849 | foo: [1,2,null,{}, [], [1,2,3]], 850 | bar: undefined 851 | }, 3, "Hey!", "Κάνε πάντα γνωρίζουμε ας των, μηχανής επιδιόρθωσης επιδιορθώσεις ώς μια. Κλπ ας" 852 | ], 853 | unicode: "老 汉语中存在 港澳和海外的华人圈中 贵州 我去了书店 现在尚有争", 854 | b: "b", 855 | c: fn1 856 | }; 857 | 858 | var diff1 = { 859 | a: [ 860 | "string", null, 0, "1", 1, { 861 | prop: null, 862 | foo: [1,2,null,{}, [], [1,2,3,4]], // different: 4 was add to the array 863 | bar: undefined 864 | }, 3, "Hey!", "Κάνε πάντα γνωρίζουμε ας των, μηχανής επιδιόρθωσης επιδιορθώσεις ώς μια. Κλπ ας" 865 | ], 866 | unicode: "老 汉语中存在 港澳和海外的华人圈中 贵州 我去了书店 现在尚有争", 867 | b: "b", 868 | c: fn1 869 | }; 870 | 871 | var diff2 = { 872 | a: [ 873 | "string", null, 0, "1", 1, { 874 | prop: null, 875 | foo: [1,2,null,{}, [], [1,2,3]], 876 | newprop: undefined, // different: newprop was added 877 | bar: undefined 878 | }, 3, "Hey!", "Κάνε πάντα γνωρίζουμε ας των, μηχανής επιδιόρθωσης επιδιορθώσεις ώς μια. Κλπ ας" 879 | ], 880 | unicode: "老 汉语中存在 港澳和海外的华人圈中 贵州 我去了书店 现在尚有争", 881 | b: "b", 882 | c: fn1 883 | }; 884 | 885 | var diff3 = { 886 | a: [ 887 | "string", null, 0, "1", 1, { 888 | prop: null, 889 | foo: [1,2,null,{}, [], [1,2,3]], 890 | bar: undefined 891 | }, 3, "Hey!", "Κάνε πάντα γνωρίζουμε ας των, μηχανής επιδιόρθωσης επιδιορθώσεις ώς μια. Κλπ α" // different: missing last char 892 | ], 893 | unicode: "老 汉语中存在 港澳和海外的华人圈中 贵州 我去了书店 现在尚有争", 894 | b: "b", 895 | c: fn1 896 | }; 897 | 898 | var diff4 = { 899 | a: [ 900 | "string", null, 0, "1", 1, { 901 | prop: null, 902 | foo: [1,2,undefined,{}, [], [1,2,3]], // different: undefined instead of null 903 | bar: undefined 904 | }, 3, "Hey!", "Κάνε πάντα γνωρίζουμε ας των, μηχανής επιδιόρθωσης επιδιορθώσεις ώς μια. Κλπ ας" 905 | ], 906 | unicode: "老 汉语中存在 港澳和海外的华人圈中 贵州 我去了书店 现在尚有争", 907 | b: "b", 908 | c: fn1 909 | }; 910 | 911 | var diff5 = { 912 | a: [ 913 | "string", null, 0, "1", 1, { 914 | prop: null, 915 | foo: [1,2,null,{}, [], [1,2,3]], 916 | bat: undefined // different: property name not "bar" 917 | }, 3, "Hey!", "Κάνε πάντα γνωρίζουμε ας των, μηχανής επιδιόρθωσης επιδιορθώσεις ώς μια. Κλπ ας" 918 | ], 919 | unicode: "老 汉语中存在 港澳和海外的华人圈中 贵州 我去了书店 现在尚有争", 920 | b: "b", 921 | c: fn1 922 | }; 923 | 924 | equals(QUnit.equiv(same1, same2), true); 925 | equals(QUnit.equiv(same2, same1), true); 926 | equals(QUnit.equiv(same2, diff1), false); 927 | equals(QUnit.equiv(diff1, same2), false); 928 | 929 | equals(QUnit.equiv(same1, diff1), false); 930 | equals(QUnit.equiv(same1, diff2), false); 931 | equals(QUnit.equiv(same1, diff3), false); 932 | equals(QUnit.equiv(same1, diff3), false); 933 | equals(QUnit.equiv(same1, diff4), false); 934 | equals(QUnit.equiv(same1, diff5), false); 935 | equals(QUnit.equiv(diff5, diff1), false); 936 | }); 937 | 938 | 939 | test("Complex Arrays.", function() { 940 | expect(7); 941 | function fn() { 942 | } 943 | 944 | equals(QUnit.equiv( 945 | [1, 2, 3, true, {}, null, [ 946 | { 947 | a: ["", '1', 0] 948 | }, 949 | 5, 6, 7 950 | ], "foo"], 951 | [1, 2, 3, true, {}, null, [ 952 | { 953 | a: ["", '1', 0] 954 | }, 955 | 5, 6, 7 956 | ], "foo"]), 957 | true); 958 | 959 | equals(QUnit.equiv( 960 | [1, 2, 3, true, {}, null, [ 961 | { 962 | a: ["", '1', 0] 963 | }, 964 | 5, 6, 7 965 | ], "foo"], 966 | [1, 2, 3, true, {}, null, [ 967 | { 968 | b: ["", '1', 0] // not same property name 969 | }, 970 | 5, 6, 7 971 | ], "foo"]), 972 | false); 973 | 974 | var a = [{ 975 | b: fn, 976 | c: false, 977 | "do": "reserved word", 978 | "for": { 979 | ar: [3,5,9,"hey!", [], { 980 | ar: [1,[ 981 | 3,4,6,9, null, [], [] 982 | ]], 983 | e: fn, 984 | f: undefined 985 | }] 986 | }, 987 | e: 0.43445 988 | }, 5, "string", 0, fn, false, null, undefined, 0, [ 989 | 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 990 | ], [], [[[], "foo", null, { 991 | n: 1/0, 992 | z: { 993 | a: [3,4,5,6,"yep!", undefined, undefined], 994 | b: {} 995 | } 996 | }, {}]]]; 997 | 998 | equals(QUnit.equiv(a, 999 | [{ 1000 | b: fn, 1001 | c: false, 1002 | "do": "reserved word", 1003 | "for": { 1004 | ar: [3,5,9,"hey!", [], { 1005 | ar: [1,[ 1006 | 3,4,6,9, null, [], [] 1007 | ]], 1008 | e: fn, 1009 | f: undefined 1010 | }] 1011 | }, 1012 | e: 0.43445 1013 | }, 5, "string", 0, fn, false, null, undefined, 0, [ 1014 | 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 1015 | ], [], [[[], "foo", null, { 1016 | n: 1/0, 1017 | z: { 1018 | a: [3,4,5,6,"yep!", undefined, undefined], 1019 | b: {} 1020 | } 1021 | }, {}]]]), true); 1022 | 1023 | equals(QUnit.equiv(a, 1024 | [{ 1025 | b: fn, 1026 | c: false, 1027 | "do": "reserved word", 1028 | "for": { 1029 | ar: [3,5,9,"hey!", [], { 1030 | ar: [1,[ 1031 | 3,4,6,9, null, [], [] 1032 | ]], 1033 | e: fn, 1034 | f: undefined 1035 | }] 1036 | }, 1037 | e: 0.43445 1038 | }, 5, "string", 0, fn, false, null, undefined, 0, [ 1039 | 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[2]]]], "3"], {}, 1/0 // different: [[[[[2]]]]] instead of [[[[[3]]]]] 1040 | ], [], [[[], "foo", null, { 1041 | n: 1/0, 1042 | z: { 1043 | a: [3,4,5,6,"yep!", undefined, undefined], 1044 | b: {} 1045 | } 1046 | }, {}]]]), false); 1047 | 1048 | equals(QUnit.equiv(a, 1049 | [{ 1050 | b: fn, 1051 | c: false, 1052 | "do": "reserved word", 1053 | "for": { 1054 | ar: [3,5,9,"hey!", [], { 1055 | ar: [1,[ 1056 | 3,4,6,9, null, [], [] 1057 | ]], 1058 | e: fn, 1059 | f: undefined 1060 | }] 1061 | }, 1062 | e: 0.43445 1063 | }, 5, "string", 0, fn, false, null, undefined, 0, [ 1064 | 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 1065 | ], [], [[[], "foo", null, { 1066 | n: -1/0, // different, -Infinity instead of Infinity 1067 | z: { 1068 | a: [3,4,5,6,"yep!", undefined, undefined], 1069 | b: {} 1070 | } 1071 | }, {}]]]), false); 1072 | 1073 | equals(QUnit.equiv(a, 1074 | [{ 1075 | b: fn, 1076 | c: false, 1077 | "do": "reserved word", 1078 | "for": { 1079 | ar: [3,5,9,"hey!", [], { 1080 | ar: [1,[ 1081 | 3,4,6,9, null, [], [] 1082 | ]], 1083 | e: fn, 1084 | f: undefined 1085 | }] 1086 | }, 1087 | e: 0.43445 1088 | }, 5, "string", 0, fn, false, null, undefined, 0, [ 1089 | 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 1090 | ], [], [[[], "foo", { // different: null is missing 1091 | n: 1/0, 1092 | z: { 1093 | a: [3,4,5,6,"yep!", undefined, undefined], 1094 | b: {} 1095 | } 1096 | }, {}]]]), false); 1097 | 1098 | equals(QUnit.equiv(a, 1099 | [{ 1100 | b: fn, 1101 | c: false, 1102 | "do": "reserved word", 1103 | "for": { 1104 | ar: [3,5,9,"hey!", [], { 1105 | ar: [1,[ 1106 | 3,4,6,9, null, [], [] 1107 | ]], 1108 | e: fn 1109 | // different: missing property f: undefined 1110 | }] 1111 | }, 1112 | e: 0.43445 1113 | }, 5, "string", 0, fn, false, null, undefined, 0, [ 1114 | 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 1115 | ], [], [[[], "foo", null, { 1116 | n: 1/0, 1117 | z: { 1118 | a: [3,4,5,6,"yep!", undefined, undefined], 1119 | b: {} 1120 | } 1121 | }, {}]]]), false); 1122 | }); 1123 | 1124 | 1125 | test("Prototypal inheritance", function() { 1126 | expect(7); 1127 | function Gizmo(id) { 1128 | this.id = id; 1129 | } 1130 | 1131 | function Hoozit(id) { 1132 | this.id = id; 1133 | } 1134 | Hoozit.prototype = new Gizmo(); 1135 | 1136 | var gizmo = new Gizmo("ok"); 1137 | var hoozit = new Hoozit("ok"); 1138 | 1139 | // Try this test many times after test on instances that hold function 1140 | // to make sure that our code does not mess with last object constructor memoization. 1141 | equals(QUnit.equiv(function () {}, function () {}), false); 1142 | 1143 | // Hoozit inherit from Gizmo 1144 | // hoozit instanceof Hoozit; // true 1145 | // hoozit instanceof Gizmo; // true 1146 | equals(QUnit.equiv(hoozit, gizmo), true); 1147 | 1148 | Gizmo.prototype.bar = true; // not a function just in case we skip them 1149 | 1150 | // Hoozit inherit from Gizmo 1151 | // They are equivalent 1152 | equals(QUnit.equiv(hoozit, gizmo), true); 1153 | 1154 | // Make sure this is still true !important 1155 | // The reason for this is that I forgot to reset the last 1156 | // caller to where it were called from. 1157 | equals(QUnit.equiv(function () {}, function () {}), false); 1158 | 1159 | // Make sure this is still true !important 1160 | equals(QUnit.equiv(hoozit, gizmo), true); 1161 | 1162 | Hoozit.prototype.foo = true; // not a function just in case we skip them 1163 | 1164 | // Gizmo does not inherit from Hoozit 1165 | // gizmo instanceof Gizmo; // true 1166 | // gizmo instanceof Hoozit; // false 1167 | // They are not equivalent 1168 | equals(QUnit.equiv(hoozit, gizmo), false); 1169 | 1170 | // Make sure this is still true !important 1171 | equals(QUnit.equiv(function () {}, function () {}), false); 1172 | }); 1173 | 1174 | 1175 | test("Instances", function() { 1176 | expect(7); 1177 | function A() {} 1178 | var a1 = new A(); 1179 | var a2 = new A(); 1180 | 1181 | function B() { 1182 | this.fn = function () {}; 1183 | } 1184 | var b1 = new B(); 1185 | var b2 = new B(); 1186 | 1187 | equals(QUnit.equiv(a1, a2), true, "Same property, same constructor"); 1188 | 1189 | // b1.fn and b2.fn are functions but they are different references 1190 | // But we decided to skip function for instances. 1191 | equals(QUnit.equiv(b1, b2), true, "Same property, same constructor"); 1192 | equals(QUnit.equiv(a1, b1), false, "Same properties but different constructor"); // failed 1193 | 1194 | function Car(year) { 1195 | var privateVar = 0; 1196 | this.year = year; 1197 | this.isOld = function() { 1198 | return year > 10; 1199 | }; 1200 | } 1201 | 1202 | function Human(year) { 1203 | var privateVar = 1; 1204 | this.year = year; 1205 | this.isOld = function() { 1206 | return year > 80; 1207 | }; 1208 | } 1209 | 1210 | var car = new Car(30); 1211 | var carSame = new Car(30); 1212 | var carDiff = new Car(10); 1213 | var human = new Human(30); 1214 | 1215 | var diff = { 1216 | year: 30 1217 | }; 1218 | 1219 | var same = { 1220 | year: 30, 1221 | isOld: function () {} 1222 | }; 1223 | 1224 | equals(QUnit.equiv(car, car), true); 1225 | equals(QUnit.equiv(car, carDiff), false); 1226 | equals(QUnit.equiv(car, carSame), true); 1227 | equals(QUnit.equiv(car, human), false); 1228 | }); 1229 | 1230 | 1231 | test("Complex Instances Nesting (with function value in literals and/or in nested instances)", function() { 1232 | expect(6); 1233 | function A(fn) { 1234 | this.a = {}; 1235 | this.fn = fn; 1236 | this.b = {a: []}; 1237 | this.o = {}; 1238 | this.fn1 = fn; 1239 | } 1240 | function B(fn) { 1241 | this.fn = fn; 1242 | this.fn1 = function () {}; 1243 | this.a = new A(function () {}); 1244 | } 1245 | 1246 | function fnOutside() { 1247 | } 1248 | 1249 | function C(fn) { 1250 | function fnInside() { 1251 | } 1252 | this.x = 10; 1253 | this.fn = fn; 1254 | this.fn1 = function () {}; 1255 | this.fn2 = fnInside; 1256 | this.fn3 = { 1257 | a: true, 1258 | b: fnOutside // ok make reference to a function in all instances scope 1259 | }; 1260 | this.o1 = {}; 1261 | 1262 | // This function will be ignored. 1263 | // Even if it is not visible for all instances (e.g. locked in a closures), 1264 | // it is from a property that makes part of an instance (e.g. from the C constructor) 1265 | this.b1 = new B(function () {}); 1266 | this.b2 = new B({ 1267 | x: { 1268 | b2: new B(function() {}) 1269 | } 1270 | }); 1271 | } 1272 | 1273 | function D(fn) { 1274 | function fnInside() { 1275 | } 1276 | this.x = 10; 1277 | this.fn = fn; 1278 | this.fn1 = function () {}; 1279 | this.fn2 = fnInside; 1280 | this.fn3 = { 1281 | a: true, 1282 | b: fnOutside, // ok make reference to a function in all instances scope 1283 | 1284 | // This function won't be ingored. 1285 | // It isn't visible for all C insances 1286 | // and it is not in a property of an instance. (in an Object instances e.g. the object literal) 1287 | c: fnInside 1288 | }; 1289 | this.o1 = {}; 1290 | 1291 | // This function will be ignored. 1292 | // Even if it is not visible for all instances (e.g. locked in a closures), 1293 | // it is from a property that makes part of an instance (e.g. from the C constructor) 1294 | this.b1 = new B(function () {}); 1295 | this.b2 = new B({ 1296 | x: { 1297 | b2: new B(function() {}) 1298 | } 1299 | }); 1300 | } 1301 | 1302 | function E(fn) { 1303 | function fnInside() { 1304 | } 1305 | this.x = 10; 1306 | this.fn = fn; 1307 | this.fn1 = function () {}; 1308 | this.fn2 = fnInside; 1309 | this.fn3 = { 1310 | a: true, 1311 | b: fnOutside // ok make reference to a function in all instances scope 1312 | }; 1313 | this.o1 = {}; 1314 | 1315 | // This function will be ignored. 1316 | // Even if it is not visible for all instances (e.g. locked in a closures), 1317 | // it is from a property that makes part of an instance (e.g. from the C constructor) 1318 | this.b1 = new B(function () {}); 1319 | this.b2 = new B({ 1320 | x: { 1321 | b1: new B({a: function() {}}), 1322 | b2: new B(function() {}) 1323 | } 1324 | }); 1325 | } 1326 | 1327 | 1328 | var a1 = new A(function () {}); 1329 | var a2 = new A(function () {}); 1330 | equals(QUnit.equiv(a1, a2), true); 1331 | 1332 | equals(QUnit.equiv(a1, a2), true); // different instances 1333 | 1334 | var b1 = new B(function () {}); 1335 | var b2 = new B(function () {}); 1336 | equals(QUnit.equiv(a1, a2), true); 1337 | 1338 | var c1 = new C(function () {}); 1339 | var c2 = new C(function () {}); 1340 | equals(QUnit.equiv(c1, c2), true); 1341 | 1342 | var d1 = new D(function () {}); 1343 | var d2 = new D(function () {}); 1344 | equals(QUnit.equiv(d1, d2), false); 1345 | 1346 | var e1 = new E(function () {}); 1347 | var e2 = new E(function () {}); 1348 | equals(QUnit.equiv(e1, e2), false); 1349 | 1350 | }); 1351 | 1352 | 1353 | test("Test that must be done at the end because they extend some primitive's prototype", function() { 1354 | expect(2); 1355 | // Try that a function looks like our regular expression. 1356 | // This tests if we check that a and b are really both instance of RegExp 1357 | Function.prototype.global = true; 1358 | Function.prototype.multiline = true; 1359 | Function.prototype.ignoreCase = false; 1360 | Function.prototype.source = "my regex"; 1361 | var re = /my regex/gm; 1362 | equals(QUnit.equiv(re, function () {}), false, "A function that looks that a regex isn't a regex"); 1363 | // This test will ensures it works in both ways, and ALSO especially that we can make differences 1364 | // between RegExp and Function constructor because typeof on a RegExpt instance is "function" 1365 | equals(QUnit.equiv(function () {}, re), false, "Same conversely, but ensures that function and regexp are distinct because their constructor are different"); 1366 | }); 1367 | 1368 | -------------------------------------------------------------------------------- /js/jquery-1.4.2.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery JavaScript Library v1.4.2 3 | * http://jquery.com/ 4 | * 5 | * Copyright 2010, John Resig 6 | * Dual licensed under the MIT or GPL Version 2 licenses. 7 | * http://jquery.org/license 8 | * 9 | * Includes Sizzle.js 10 | * http://sizzlejs.com/ 11 | * Copyright 2010, The Dojo Foundation 12 | * Released under the MIT, BSD, and GPL Licenses. 13 | * 14 | * Date: Sat Feb 13 22:33:48 2010 -0500 15 | */ 16 | (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, 21 | Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& 22 | (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, 23 | a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== 24 | "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, 25 | function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
      a"; 34 | var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, 35 | parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= 36 | false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= 37 | s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, 38 | applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; 39 | else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, 40 | a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== 41 | w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, 42 | cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= 47 | c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); 48 | a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, 49 | function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); 50 | k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), 51 | C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= 53 | e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& 54 | f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; 55 | if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", 63 | e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, 64 | "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, 65 | d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, 71 | e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); 72 | t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| 73 | g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, 80 | CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, 81 | g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, 82 | text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, 83 | setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= 84 | h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== 86 | "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, 87 | h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& 90 | q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; 91 | if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

      ";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); 92 | (function(){var g=s.createElement("div");g.innerHTML="
      ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: 93 | function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= 96 | {},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== 97 | "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", 98 | d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? 99 | a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== 100 | 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
      ","
      "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= 102 | c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, 103 | wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, 104 | prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, 105 | this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); 106 | return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, 107 | ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); 111 | return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", 112 | ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= 113 | c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? 114 | c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= 115 | function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= 116 | Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, 117 | "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= 118 | a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= 119 | a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== 120 | "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
      ").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, 121 | serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), 122 | function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, 123 | global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& 124 | e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? 125 | "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== 126 | false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= 127 | false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", 128 | c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| 129 | d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); 130 | g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 131 | 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== 132 | "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; 133 | if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== 139 | "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| 140 | c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; 141 | this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= 142 | this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, 143 | e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
      "; 149 | a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); 150 | c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, 151 | d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- 152 | f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": 153 | "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in 154 | e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); 155 | --------------------------------------------------------------------------------