Merge lp:~ubuntu-community-webthemes/ubuntu-community-webthemes/light-django-theme-linaro-refresh into lp:~linaro-connect-theme-devs/ubuntu-community-webthemes/light-django-linaro-theme
- light-django-theme-linaro-refresh
- Merge into light-django-linaro-theme
Proposed by
Chris Johnston
Status: | Merged |
---|---|
Merged at revision: | 43 |
Proposed branch: | lp:~ubuntu-community-webthemes/ubuntu-community-webthemes/light-django-theme-linaro-refresh |
Merge into: | lp:~linaro-connect-theme-devs/ubuntu-community-webthemes/light-django-linaro-theme |
Diff against target: |
3704 lines (+3364/-143) 15 files modified
media/css/extra_styles.css (+45/-42) media/js/ga.js (+5/-0) media/js/jquery-1.7.2.min.js (+4/-0) media/js/loader.js (+19/-0) media/js/main.js (+0/-43) media/js/modernizr.min.js (+4/-0) media/js/pngFix.js (+0/-13) media/js/polyfills/IE9/IE9.js (+118/-0) media/js/polyfills/IE9/LICENSE (+21/-0) media/js/polyfills/IE9/squish.js (+1/-0) media/js/polyfills/IE9/src/IE9.src.js (+2901/-0) media/js/polyfills/IE9/src/squish.src.js (+35/-0) media/js/polyfills/pie.js (+140/-0) media/js/site.js (+26/-0) templates/website_base.html (+45/-45) |
To merge this branch: | bzr merge lp:~ubuntu-community-webthemes/ubuntu-community-webthemes/light-django-theme-linaro-refresh |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Linaro Infrastructure | Pending | ||
Review via email: mp+99413@code.launchpad.net |
Commit message
Description of the change
Cleans up the layout of the theme.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'media/css/extra_styles.css' | |||
2 | --- media/css/extra_styles.css 2012-03-25 00:36:30 +0000 | |||
3 | +++ media/css/extra_styles.css 2012-03-26 20:23:22 +0000 | |||
4 | @@ -9,50 +9,50 @@ | |||
5 | 9 | */ | 9 | */ |
6 | 10 | 10 | ||
7 | 11 | 11 | ||
12 | 12 | #top-nav { | 12 | #top-nav { |
13 | 13 | font-size:11px; | 13 | font-size:11px; |
14 | 14 | margin:0 auto; | 14 | margin:0 auto; |
15 | 15 | line-height: 2em; | 15 | line-height: 2em; |
16 | 16 | height: 22px; | 16 | height: 22px; |
17 | 17 | } | 17 | } |
18 | 18 | 18 | ||
19 | 19 | 19 | ||
24 | 20 | .top-nav-item { | 20 | .top-nav-item { |
25 | 21 | display:inline-block; | 21 | display:inline-block; |
26 | 22 | margin-right: 14px; | 22 | margin-right: 14px; |
27 | 23 | line-height:2em; | 23 | line-height:2em; |
28 | 24 | } | 24 | } |
29 | 25 | 25 | ||
33 | 26 | #top-login { | 26 | #top-login { |
34 | 27 | display:inline-block; | 27 | display:inline-block; |
35 | 28 | margin-right:15px; | 28 | margin-right:15px; |
36 | 29 | float:right; | 29 | float:right; |
37 | 30 | } | 30 | } |
38 | 31 | 31 | ||
63 | 32 | .top-login-item { | 32 | .top-login-item { |
64 | 33 | display:inline-block; | 33 | display:inline-block; |
65 | 34 | padding:0 8px; | 34 | padding:0 8px; |
66 | 35 | line-height:2em; | 35 | line-height:2em; |
67 | 36 | } | 36 | } |
68 | 37 | 37 | ||
69 | 38 | #top-nav { | 38 | #top-nav { |
70 | 39 | background-color:#ffffff; | 39 | background-color:#ffffff; |
71 | 40 | } | 40 | } |
72 | 41 | 41 | ||
73 | 42 | .top-nav-item, .top-nav-item:visited { | 42 | .top-nav-item, .top-nav-item:visited { |
74 | 43 | color:#333333; | 43 | color:#333333; |
75 | 44 | } | 44 | } |
76 | 45 | 45 | ||
77 | 46 | .top-nav-item:hover { | 46 | .top-nav-item:hover { |
78 | 47 | text-decoration: underline; | 47 | text-decoration: underline; |
79 | 48 | } | 48 | } |
80 | 49 | 49 | ||
81 | 50 | .top-login-item { | 50 | .top-login-item { |
82 | 51 | color:#dd4814; | 51 | color:#dd4814; |
83 | 52 | } | 52 | } |
84 | 53 | 53 | ||
85 | 54 | .top-login-item:hover { | 54 | .top-login-item:hover { |
86 | 55 | text-decoration: underline; | 55 | text-decoration: underline; |
87 | 56 | } | 56 | } |
88 | 57 | 57 | ||
89 | 58 | header .logo-ubuntu { | 58 | header .logo-ubuntu { |
90 | @@ -66,10 +66,10 @@ | |||
91 | 66 | } | 66 | } |
92 | 67 | 67 | ||
93 | 68 | .alone, .leading, .aggregator /* progressive */ { | 68 | .alone, .leading, .aggregator /* progressive */ { |
96 | 69 | -webkit-border-radius: 8px; | 69 | -webkit-border-radius: 4px; |
97 | 70 | -moz-border-radius: 8px; | 70 | -moz-border-radius: 4px; |
98 | 71 | } | 71 | } |
100 | 72 | 72 | ||
101 | 73 | table.basic thead th, table.basic thead a { | 73 | table.basic thead th, table.basic thead a { |
102 | 74 | font-weight:bold; | 74 | font-weight:bold; |
103 | 75 | } | 75 | } |
104 | @@ -93,7 +93,7 @@ | |||
105 | 93 | padding:4px 8px; | 93 | padding:4px 8px; |
106 | 94 | } | 94 | } |
107 | 95 | 95 | ||
109 | 96 | table.basic thead { | 96 | table.basic thead { |
110 | 97 | background-color:#aea79f; | 97 | background-color:#aea79f; |
111 | 98 | } | 98 | } |
112 | 99 | 99 | ||
113 | @@ -172,7 +172,7 @@ | |||
114 | 172 | 172 | ||
115 | 173 | /* Form Layout */ | 173 | /* Form Layout */ |
116 | 174 | 174 | ||
118 | 175 | form ul.errorlist { | 175 | form ul.errorlist { |
119 | 176 | display: inline-block; | 176 | display: inline-block; |
120 | 177 | line-height: 1em; | 177 | line-height: 1em; |
121 | 178 | vertical-align: top; | 178 | vertical-align: top; |
122 | @@ -294,7 +294,7 @@ | |||
123 | 294 | background-color: #962d0c; | 294 | background-color: #962d0c; |
124 | 295 | } | 295 | } |
125 | 296 | 296 | ||
127 | 297 | input[type="submit"][disabled="disabled"], input[type="submit"][disabled="disabled"]:hover { | 297 | input[type="submit"][disabled="disabled"], input[type="submit"][disabled="disabled"]:hover { |
128 | 298 | background-color:#AEA79F; | 298 | background-color:#AEA79F; |
129 | 299 | text-shadow: none; | 299 | text-shadow: none; |
130 | 300 | } | 300 | } |
131 | @@ -312,7 +312,7 @@ | |||
132 | 312 | 312 | ||
133 | 313 | /* | 313 | /* |
134 | 314 | * | 314 | * |
136 | 315 | * For Linaro | 315 | * For Linaro |
137 | 316 | * | 316 | * |
138 | 317 | */ | 317 | */ |
139 | 318 | a:link { | 318 | a:link { |
140 | @@ -352,3 +352,6 @@ | |||
141 | 352 | .nav-secondary li.active a, .nav-secondary a:hover { | 352 | .nav-secondary li.active a, .nav-secondary a:hover { |
142 | 353 | color: #79A519; | 353 | color: #79A519; |
143 | 354 | } | 354 | } |
144 | 355 | |||
145 | 356 | span.skype_pnh_container {display:none !important;} | ||
146 | 357 | span.skype_pnh_print_container {display:inline !important;} | ||
147 | 355 | 358 | ||
148 | === added directory 'media/css/old' | |||
149 | === renamed file 'media/css/960.css' => 'media/css/old/960.css' | |||
150 | === renamed file 'media/css/default.css' => 'media/css/old/default.css' | |||
151 | === renamed file 'media/css/django_extras.css' => 'media/css/old/django_extras.css' | |||
152 | === renamed file 'media/css/ie.css' => 'media/css/old/ie.css' | |||
153 | === renamed file 'media/css/ie6.css' => 'media/css/old/ie6.css' | |||
154 | === added file 'media/js/ga.js' | |||
155 | --- media/js/ga.js 1970-01-01 00:00:00 +0000 | |||
156 | +++ media/js/ga.js 2012-03-26 20:23:22 +0000 | |||
157 | @@ -0,0 +1,5 @@ | |||
158 | 1 | $(document).ready(function() { | ||
159 | 2 | var _gaq = _gaq || []; | ||
160 | 3 | _gaq.push(['_setAccount', 'UA-30315860-1']); | ||
161 | 4 | _gaq.push(['_trackPageview']); | ||
162 | 5 | }); | ||
163 | 0 | 6 | ||
164 | === added file 'media/js/jquery-1.7.2.min.js' | |||
165 | --- media/js/jquery-1.7.2.min.js 1970-01-01 00:00:00 +0000 | |||
166 | +++ media/js/jquery-1.7.2.min.js 2012-03-26 20:23:22 +0000 | |||
167 | @@ -0,0 +1,4 @@ | |||
168 | 1 | /*! jQuery v1.7.2 jquery.com | jquery.org/license */ | ||
169 | 2 | (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+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(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( | ||
170 | 3 | a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f | ||
171 | 4 | .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); | ||
172 | 0 | 5 | ||
173 | === added file 'media/js/loader.js' | |||
174 | --- media/js/loader.js 1970-01-01 00:00:00 +0000 | |||
175 | +++ media/js/loader.js 2012-03-26 20:23:22 +0000 | |||
176 | @@ -0,0 +1,19 @@ | |||
177 | 1 | Modernizr.load([ | ||
178 | 2 | { | ||
179 | 3 | load: website_assets + '/js/twidenash/jquery-twidenash.js' | ||
180 | 4 | }, | ||
181 | 5 | { | ||
182 | 6 | load: website_assets + '/js/site.js' | ||
183 | 7 | }, | ||
184 | 8 | { | ||
185 | 9 | test: Modernizr.borderradius && Modernizr.boxshadow, | ||
186 | 10 | nope: website_assets + "/js/polyfills/pie.js", | ||
187 | 11 | complete: function() { | ||
188 | 12 | window.PIE && $("*").each(function() { | ||
189 | 13 | ($(this).css("box-shadow") || $(this).css("border-radius")) && PIE.attach(this) | ||
190 | 14 | }) | ||
191 | 15 | } | ||
192 | 16 | }, | ||
193 | 17 | website_assets + '/js/ga.js' | ||
194 | 18 | ]); | ||
195 | 19 | |||
196 | 0 | 20 | ||
197 | === removed file 'media/js/main.js' | |||
198 | --- media/js/main.js 2010-06-14 14:48:41 +0000 | |||
199 | +++ media/js/main.js 1970-01-01 00:00:00 +0000 | |||
200 | @@ -1,43 +0,0 @@ | |||
201 | 1 | $(function(){ | ||
202 | 2 | |||
203 | 3 | var $header = $('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>HEADER</h3></div>'), | ||
204 | 4 | $aside = $('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>ASIDE</h3></div>'), | ||
205 | 5 | $content = $('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>CONTENT</h3></div>'), | ||
206 | 6 | $footer = $('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>FOOTER</h3></div>'); | ||
207 | 7 | |||
208 | 8 | |||
209 | 9 | $('#wireframe .container').mouseenter(function(){ | ||
210 | 10 | var $el = $(this); | ||
211 | 11 | |||
212 | 12 | $el.css( { border : "1px dashed #555", padding : "0px 9px" }) | ||
213 | 13 | |||
214 | 14 | if($el.parent().is('header')) { | ||
215 | 15 | $el.append($header); | ||
216 | 16 | } | ||
217 | 17 | |||
218 | 18 | if($el.parent().is('aside')) { | ||
219 | 19 | $el.append($aside); | ||
220 | 20 | } | ||
221 | 21 | |||
222 | 22 | if($el.parent().is('section')) { | ||
223 | 23 | $el.append($content); | ||
224 | 24 | } | ||
225 | 25 | |||
226 | 26 | if($el.parent().is('footer')) { | ||
227 | 27 | $el.append($footer); | ||
228 | 28 | } | ||
229 | 29 | |||
230 | 30 | |||
231 | 31 | }); | ||
232 | 32 | |||
233 | 33 | |||
234 | 34 | $('#wireframe .container').mouseleave(function(){ | ||
235 | 35 | $('.label').remove(); | ||
236 | 36 | $(this).css( { border : "0px dashed #555", padding : "0px 10px" }) | ||
237 | 37 | |||
238 | 38 | }); | ||
239 | 39 | |||
240 | 40 | |||
241 | 41 | |||
242 | 42 | |||
243 | 43 | }); | ||
244 | 44 | 0 | ||
245 | === added file 'media/js/modernizr.min.js' | |||
246 | --- media/js/modernizr.min.js 1970-01-01 00:00:00 +0000 | |||
247 | +++ media/js/modernizr.min.js 2012-03-26 20:23:22 +0000 | |||
248 | @@ -0,0 +1,4 @@ | |||
249 | 1 | /* Modernizr 2.5.3 (Custom Build) | MIT & BSD | ||
250 | 2 | * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-rgba-textshadow-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-canvas-hashchange-audio-video-inputtypes-shiv-cssclasses-addtest-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-json-url_data_uri-window_framed-load | ||
251 | 3 | */ | ||
252 | 4 | ;window.Modernizr=function(a,b,c){function B(a){j.cssText=a}function C(a,b){return B(n.join(a+";")+(b||""))}function D(a,b){return typeof a===b}function E(a,b){return!!~(""+a).indexOf(b)}function F(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function G(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:D(f,"function")?f.bind(d||b):f}return!1}function H(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+p.join(d+" ")+d).split(" ");return D(b,"string")||D(b,"undefined")?F(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),G(e,b,c))}function J(){e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(k),g.offsetWidth,e=k.value!=l,g.removeChild(k)):e=k.value!=l)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.5.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={},s={},t={},u=[],v=u.slice,w,x=function(a,c,d,e){var f,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),k.appendChild(j);return f=["­","<style>",a,"</style>"].join(""),k.id=h,m.innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},y=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=D(e[d],"function"),D(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),z={}.hasOwnProperty,A;!D(z,"undefined")&&!D(z.call,"undefined")?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e});var I=function(a,c){var d=a.join(""),f=c.length;x(d,function(a,c){var d=b.styleSheets[b.styleSheets.length-1],g=d?d.cssRules&&d.cssRules[0]?d.cssRules[0].cssText:d.cssText||"":"",h=a.childNodes,i={};while(f--)i[h[f].id]=h[f];e.csstransforms3d=(i.csstransforms3d&&i.csstransforms3d.offsetLeft)===9&&i.csstransforms3d.offsetHeight===3,e.fontface=/src/i.test(g)&&g.indexOf(c.split(" ")[0])===0},f,c)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",n.join("transform-3d),("),h,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join("")],["fontface","csstransforms3d"]);r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.hashchange=function(){return y("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.rgba=function(){return B("background-color:rgba(150,255,150,.5)"),E(j.backgroundColor,"rgba")},r.backgroundsize=function(){return H("backgroundSize")},r.borderimage=function(){return H("borderImage")},r.borderradius=function(){return H("borderRadius")},r.boxshadow=function(){return H("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return B((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),E(j.backgroundImage,"gradient")},r.cssreflections=function(){return H("boxReflect")},r.csstransforms=function(){return!!H("transform")},r.csstransforms3d=function(){var a=!!H("perspective");return a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d),a},r.csstransitions=function(){return H("transition")},r.fontface=function(){return e.fontface},r.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},r.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c};for(var K in r)A(r,K)&&(w=K.toLowerCase(),e[w]=r[K](),u.push((e[w]?"":"no-")+w));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)A(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,g.className+=" "+(b?"":"no-")+a,e[a]=b}return e},B(""),i=k=null,function(a,b){function g(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML="<xyz></xyz>",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.hasEvent=y,e.testProp=function(a){return F([a])},e.testAllProps=H,e.testStyles=x,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+u.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},Modernizr.addTest("json",!!window.JSON&&!!JSON.parse),function(){var a=new Image;a.onerror=function(){Modernizr.addTest("datauri",function(){return!1})},a.onload=function(){Modernizr.addTest("datauri",function(){return a.width==1&&a.height==1})},a.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="}(),Modernizr.addTest("framed",function(){return window.location!=top.location}); | ||
253 | 0 | 5 | ||
254 | === removed file 'media/js/pngFix.js' | |||
255 | --- media/js/pngFix.js 2010-06-14 14:48:41 +0000 | |||
256 | +++ media/js/pngFix.js 1970-01-01 00:00:00 +0000 | |||
257 | @@ -1,13 +0,0 @@ | |||
258 | 1 | /** | ||
259 | 2 | * DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>. | ||
260 | 3 | * Author: Drew Diller | ||
261 | 4 | * Email: drew.diller@gmail.com | ||
262 | 5 | * URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/ | ||
263 | 6 | * Version: 0.0.8a | ||
264 | 7 | * Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license | ||
265 | 8 | * | ||
266 | 9 | * Example usage: | ||
267 | 10 | * DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector | ||
268 | 11 | * DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement | ||
269 | 12 | **/ | ||
270 | 13 | var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;b<c.length;b++){this.screenStyleSheet.addRule(c[b],"behavior:expression(DD_belatedPNG.fixPng(this))")}}},applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);if(a.isImg){this.copyImageBorders(a)}},attachHandlers:function(i){var d,c,g,e,b,f;d=this;c={resize:"vmlOffsets",move:"vmlOffsets"};if(i.nodeName=="A"){e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"};for(b in e){if(e.hasOwnProperty(b)){c[b]=e[b]}}}for(f in c){if(c.hasOwnProperty(f)){g=function(){d[c[f]](i)};i.attachEvent("on"+f,g)}}i.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=1;if(a.currentStyle.position=="static"){a.style.position="relative"}},copyImageBorders:function(b){var c,a;c={borderStyle:true,borderWidth:true,borderColor:true};for(a in c){if(c.hasOwnProperty(a)){b.vml.color.shape.style[a]=b.currentStyle[a]}}},vmlFill:function(e){if(!e.currentStyle){return}else{var d,f,g,b,a,c;d=e.currentStyle}for(b in e.vml){if(e.vml.hasOwnProperty(b)){e.vml[b].shape.style.zIndex=d.zIndex}}e.runtimeStyle.backgroundColor="";e.runtimeStyle.backgroundImage="";f=true;if(d.backgroundImage!="none"||e.isImg){if(!e.isImg){e.vmlBg=d.backgroundImage;e.vmlBg=e.vmlBg.substr(5,e.vmlBg.lastIndexOf('")')-5)}else{e.vmlBg=e.src}g=this;if(!g.imgSize[e.vmlBg]){a=document.createElement("img");g.imgSize[e.vmlBg]=a;a.className=g.ns+"_sizeFinder";a.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none; margin:0; padding:0;";c=function(){this.width=this.offsetWidth;this.height=this.offsetHeight;g.vmlOffsets(e)};a.attachEvent("onload",c);a.src=e.vmlBg;a.removeAttribute("width");a.removeAttribute("height");document.body.insertBefore(a,document.body.firstChild)}e.vml.image.fill.src=e.vmlBg;f=false}e.vml.image.fill.on=!f;e.vml.image.fill.color="none";e.vml.color.shape.style.backgroundColor=d.backgroundColor;e.runtimeStyle.backgroundImage="none";e.runtimeStyle.backgroundColor="transparent"},vmlOffsets:function(d){var h,n,a,e,g,m,f,l,j,i,k;h=d.currentStyle;n={W:d.clientWidth+1,H:d.clientHeight+1,w:this.imgSize[d.vmlBg].width,h:this.imgSize[d.vmlBg].height,L:d.offsetLeft,T:d.offsetTop,bLW:d.clientLeft,bTW:d.clientTop};a=(n.L+n.bLW==1)?1:0;e=function(b,p,q,c,s,u){b.coordsize=c+","+s;b.coordorigin=u+","+u;b.path="m0,0l"+c+",0l"+c+","+s+"l0,"+s+" xe";b.style.width=c+"px";b.style.height=s+"px";b.style.left=p+"px";b.style.top=q+"px"};e(d.vml.color.shape,(n.L+(d.isImg?0:n.bLW)),(n.T+(d.isImg?0:n.bTW)),(n.W-1),(n.H-1),0);e(d.vml.image.shape,(n.L+n.bLW),(n.T+n.bTW),(n.W),(n.H),1);g={X:0,Y:0};if(d.isImg){g.X=parseInt(h.paddingLeft,10)+1;g.Y=parseInt(h.paddingTop,10)+1}else{for(j in g){if(g.hasOwnProperty(j)){this.figurePercentage(g,n,j,h["backgroundPosition"+j])}}}d.vml.image.fill.position=(g.X/n.W)+","+(g.Y/n.H);m=h.backgroundRepeat;f={T:1,R:n.W+a,B:n.H,L:1+a};l={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};if(m!="repeat"||d.isImg){i={T:(g.Y),R:(g.X+n.w),B:(g.Y+n.h),L:(g.X)};if(m.search("repeat-")!=-1){k=m.split("repeat-")[1].toUpperCase();i[l[k].b1]=1;i[l[k].b2]=n[l[k].d]}if(i.B>n.H){i.B=n.H}d.vml.image.shape.style.clip="rect("+i.T+"px "+(i.R+a)+"px "+i.B+"px "+(i.L+a)+"px)"}else{d.vml.image.shape.style.clip="rect("+f.T+"px "+f.R+"px "+f.B+"px "+f.L+"px)"}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f=="X");switch(a){case"left":case"top":d[f]=0;break;case"center":d[f]=0.5;break;case"right":case"bottom":d[f]=1;break;default:if(a.search("%")!=-1){d[f]=parseInt(a,10)/100}else{e=false}}d[f]=Math.ceil(e?((c[b?"W":"H"]*d[f])-(c[b?"w":"h"]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/\.png$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet(); | ||
271 | 14 | 0 | ||
272 | === added directory 'media/js/polyfills' | |||
273 | === added directory 'media/js/polyfills/IE9' | |||
274 | === added file 'media/js/polyfills/IE9/IE9.js' | |||
275 | --- media/js/polyfills/IE9/IE9.js 1970-01-01 00:00:00 +0000 | |||
276 | +++ media/js/polyfills/IE9/IE9.js 2012-03-26 20:23:22 +0000 | |||
277 | @@ -0,0 +1,118 @@ | |||
278 | 1 | (function(window,document){var IE7=window.IE7={version:"2.1(beta4)",toString:K("[IE7]")};IE7.compat=9;var appVersion=IE7.appVersion=navigator.appVersion.match(/MSIE (\d\.\d)/)[1]-0;if(/ie7_off/.test(top.location.search)||appVersion<5.5||appVersion>=IE7.compat)return;var MSIE5=appVersion<6;var Undefined=K();var documentElement=document.documentElement,body,viewport;var ANON="!";var HEADER=":link{ie7-link:link}:visited{ie7-link:visited}";var RELATIVE=/^[\w\.]+[^:]*$/;function makePath(href,path){if(RELATIVE.test(href))href= | ||
279 | 2 | (path||"")+href;return href}function getPath(href,path){href=makePath(href,path);return href.slice(0,href.lastIndexOf("/")+1)}var script=document.scripts[document.scripts.length-1];var path=getPath(script.src);try{var httpRequest=new ActiveXObject("Microsoft.XMLHTTP")}catch(ex){}var fileCache={};function loadFile(href,path){try{href=makePath(href,path);if(!fileCache[href]){httpRequest.open("GET",href,false);httpRequest.send();if(httpRequest.status==0||httpRequest.status==200)fileCache[href]=httpRequest.responseText}}catch(ex){}return fileCache[href]|| | ||
280 | 3 | ""}var _slice=Array.prototype.slice;var _FORMAT=/%([1-9])/g;var _LTRIM=/^\s\s*/;var _RTRIM=/\s\s*$/;var _RESCAPE=/([\/()[\]{}|*+-.,^$?\\])/g;var _BASE=/\bbase\b/;var _HIDDEN=["constructor","toString"];var prototyping;function Base(){}Base.extend=function(_instance,_static){prototyping=true;var _prototype=new this;extend(_prototype,_instance);prototyping=false;var _constructor=_prototype.constructor;function klass(){if(!prototyping)_constructor.apply(this,arguments)}_prototype.constructor=klass;klass.extend= | ||
281 | 4 | arguments.callee;extend(klass,_static);klass.prototype=_prototype;return klass};Base.prototype.extend=function(source){return extend(this,source)};var HASH="#";var ITEMS="#";var KEYS=".";var COMPILED="/";var REGGRP_BACK_REF=/\\(\d+)/g,REGGRP_ESCAPE_COUNT=/\[(\\.|[^\]\\])+\]|\\.|\(\?/g,REGGRP_PAREN=/\(/g,REGGRP_LOOKUP=/\$(\d+)/,REGGRP_LOOKUP_SIMPLE=/^\$\d+$/,REGGRP_LOOKUPS=/(\[(\\.|[^\]\\])+\]|\\.|\(\?)|\(/g,REGGRP_DICT_ENTRY=/^<#\w+>$/,REGGRP_DICT_ENTRIES=/<#(\w+)>/g;var RegGrp=Base.extend({constructor:function(values){this[KEYS]= | ||
282 | 5 | [];this[ITEMS]={};this.merge(values)},add:function(expression,replacement){delete this[COMPILED];if(expression instanceof RegExp)expression=expression.source;if(!this[HASH+expression])this[KEYS].push(String(expression));return this[ITEMS][HASH+expression]=new RegGrp.Item(expression,replacement,this)},compile:function(recompile){if(recompile||!this[COMPILED])this[COMPILED]=new RegExp(this,this.ignoreCase?"gi":"g");return this[COMPILED]},merge:function(values){for(var i in values)this.add(i,values[i])}, | ||
283 | 6 | exec:function(string){var group=this,patterns=group[KEYS],items=group[ITEMS],item;var result=this.compile(true).exec(string);if(result){var i=0,offset=1;while(item=items[HASH+patterns[i++]]){var next=offset+item.length+1;if(result[offset])if(item.replacement===0)return group.exec(string);else{var args=result.slice(offset,next),j=args.length;while(--j)args[j]=args[j]||"";args[0]={match:args[0],item:item};return args}offset=next}}return null},parse:function(string){string+="";var group=this,patterns= | ||
284 | 7 | group[KEYS],items=group[ITEMS];return string.replace(this.compile(),function(match){var args=[],item,offset=1,i=arguments.length;while(--i)args[i]=arguments[i]||"";while(item=items[HASH+patterns[i++]]){var next=offset+item.length+1;if(args[offset]){var replacement=item.replacement;switch(typeof replacement){case "function":return replacement.apply(group,args.slice(offset,next));case "number":return args[offset+replacement];default:return replacement}}offset=next}return match})},toString:function(){var strings= | ||
285 | 8 | [],keys=this[KEYS],items=this[ITEMS],item;for(var i=0;item=items[HASH+keys[i]];i++)strings[i]=item.source;return"("+strings.join(")|(")+")"}},{IGNORE:null,Item:Base.extend({constructor:function(source,replacement,owner){var length=source.indexOf("(")===-1?0:RegGrp.count(source);var dictionary=owner.dictionary;if(dictionary&&source.indexOf("<#")!==-1)if(REGGRP_DICT_ENTRY.test(source)){var entry=dictionary[ITEMS][HASH+source.slice(2,-1)];source=entry.replacement;length=entry._length}else source=dictionary.parse(source); | ||
286 | 9 | if(typeof replacement=="number")replacement=String(replacement);else if(replacement==null)replacement=0;if(typeof replacement=="string"&®GRP_LOOKUP.test(replacement))if(REGGRP_LOOKUP_SIMPLE.test(replacement)){var index=replacement.slice(1)-0;if(index&&index<=length)replacement=index}else{var lookup=replacement,regexp;replacement=function(match){if(!regexp)regexp=new RegExp(source,"g"+(this.ignoreCase?"i":""));return match.replace(regexp,lookup)}}this.length=length;this.source=String(source);this.replacement= | ||
287 | 10 | replacement}}),count:function(expression){return(String(expression).replace(REGGRP_ESCAPE_COUNT,"").match(REGGRP_PAREN)||"").length}});var Dictionary=RegGrp.extend({parse:function(phrase){var entries=this[ITEMS];return phrase.replace(REGGRP_DICT_ENTRIES,function(match,entry){entry=entries[HASH+entry];return entry?entry._nonCapturing:match})},add:function(expression,replacement){if(replacement instanceof RegExp)replacement=replacement.source;var nonCapturing=replacement.replace(REGGRP_LOOKUPS,_nonCapture); | ||
288 | 11 | if(replacement.indexOf("(")!==-1)var realLength=RegGrp.count(replacement);if(replacement.indexOf("<#")!==-1){replacement=this.parse(replacement);nonCapturing=this.parse(nonCapturing)}var item=this.base(expression,replacement);item._nonCapturing=nonCapturing;item._length=realLength||item.length;return item},toString:function(){return"(<#"+this[PATTERNS].join(">)|(<#")+">)"}});function _nonCapture(match,escaped){return escaped||"(?:"}function extend(object,source){if(object&&source){var proto=(typeof source== | ||
289 | 12 | "function"?Function:Object).prototype;var i=_HIDDEN.length,key;if(prototyping)while(key=_HIDDEN[--i]){var value=source[key];if(value!=proto[key])if(_BASE.test(value))_override(object,key,value);else object[key]=value}for(key in source)if(typeof proto[key]=="undefined"){var value=source[key];if(object[key]&&typeof value=="function"&&_BASE.test(value))_override(object,key,value);else object[key]=value}}return object}function _override(object,name,method){var ancestor=object[name];object[name]=function(){var previous= | ||
290 | 13 | this.base;this.base=ancestor;var returnValue=method.apply(this,arguments);this.base=previous;return returnValue}}function combine(keys,values){if(!values)values=keys;var hash={};for(var i in keys)hash[i]=values[i];return hash}function format(string){var args=arguments;var _FORMAT=new RegExp("%([1-"+arguments.length+"])","g");return String(string).replace(_FORMAT,function(match,index){return index<args.length?args[index]:match})}function match(string,expression){return String(string).match(expression)|| | ||
291 | 14 | []}function rescape(string){return String(string).replace(_RESCAPE,"\\$1")}function trim(string){return String(string).replace(_LTRIM,"").replace(_RTRIM,"")}function K(k){return function(){return k}}var Parser=RegGrp.extend({ignoreCase:true});var SINGLE_QUOTES=/'/g,ESCAPED=/'(\d+)'/g,ESCAPE=/\\/g,UNESCAPE=/\\([nrtf'"])/g;var strings=[];var encoder=new Parser({"<!\\-\\-|\\-\\->":"","\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\/":"","@(namespace|import)[^;\\n]+[;\\n]":"","'(\\\\.|[^'\\\\])*'":encodeString,'"(\\\\.|[^"\\\\])*"':encodeString, | ||
292 | 15 | "\\s+":" "});function encode(selector){return encoder.parse(selector).replace(UNESCAPE,"$1")}function decode(query){return query.replace(ESCAPED,decodeString)}function encodeString(string){var index=strings.length;strings[index]=string.slice(1,-1).replace(UNESCAPE,"$1").replace(SINGLE_QUOTES,"\\'");return"'"+index+"'"}function decodeString(match,index){var string=strings[index];if(string==null)return match;return"'"+strings[index]+"'"}function getString(value){return value.indexOf("'")===0?strings[value.slice(1, | ||
293 | 16 | -1)]:value}var rotater=new RegGrp({Width:"Height",width:"height",Left:"Top",left:"top",Right:"Bottom",right:"bottom",onX:"onY"});function rotate(fn){return rotater.parse(fn)}var eventHandlers=[];function addResize(handler){addRecalc(handler);addEventHandler(window,"onresize",handler)}function addEventHandler(element,type,handler){element.attachEvent(type,handler);eventHandlers.push(arguments)}function removeEventHandler(element,type,handler){try{element.detachEvent(type,handler)}catch(ex){}}addEventHandler(window, | ||
294 | 17 | "onunload",function(){var handler;while(handler=eventHandlers.pop())removeEventHandler(handler[0],handler[1],handler[2])});function register(handler,element,condition){if(!handler.elements)handler.elements={};if(condition)handler.elements[element.uniqueID]=element;else delete handler.elements[element.uniqueID];return condition}addEventHandler(window,"onbeforeprint",function(){if(!IE7.CSS.print)new StyleSheet("print");IE7.CSS.print.recalc()});var PIXEL=/^\d+(px)?$/i;var PERCENT=/^\d+%$/;var getPixelValue= | ||
295 | 18 | function(element,value){if(PIXEL.test(value))return parseInt(value);var style=element.style.left;var runtimeStyle=element.runtimeStyle.left;element.runtimeStyle.left=element.currentStyle.left;element.style.left=value||0;value=element.style.pixelLeft;element.style.left=style;element.runtimeStyle.left=runtimeStyle;return value};var $IE7="ie7-";var Fix=Base.extend({constructor:function(){this.fixes=[];this.recalcs=[]},init:Undefined});var recalcs=[];function addRecalc(recalc){recalcs.push(recalc)}IE7.recalc= | ||
296 | 19 | function(){IE7.HTML.recalc();IE7.CSS.recalc();for(var i=0;i<recalcs.length;i++)recalcs[i]()};function isFixed(element){return element.currentStyle["ie7-position"]=="fixed"}function getDefinedStyle(element,propertyName){return element.currentStyle[$IE7+propertyName]||element.currentStyle[propertyName]}function setOverrideStyle(element,propertyName,value){if(element.currentStyle[$IE7+propertyName]==null)element.runtimeStyle[$IE7+propertyName]=element.currentStyle[propertyName];element.runtimeStyle[propertyName]= | ||
297 | 20 | value}function createTempElement(tagName){var element=document.createElement(tagName||"object");element.style.cssText="position:absolute;padding:0;display:block;border:none;clip:rect(0 0 0 0);left:-9999";element.ie7_anon=true;return element}var NEXT_SIBLING="(e.nextSibling&&IE7._getElementSibling(e,'next'))",PREVIOUS_SIBLING=NEXT_SIBLING.replace(/next/g,"previous"),IS_ELEMENT="e.nodeName>'@'",IF_ELEMENT="if("+IS_ELEMENT+"){";var ID_ATTRIBUTE="(e.nodeName==='FORM'?IE7._getAttribute(e,'id'):e.id)"; | ||
298 | 21 | var HYPERLINK=/a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i;var FIRST_LINE_LETTER=/(.*)(:first-(line|letter))/;var SPACE=/\s/;var RULE=/((?:\\.|[^{\\])+)\{((?:\\.|[^}\\])+)\}/g;var SELECTOR=/(?:\\.|[^,\\])+/g;var styleSheets=document.styleSheets;var inheritedProperties=[];IE7.CSS=new (Fix.extend({parser:new Parser,screen:"",print:"",styles:[],rules:[],pseudoClasses:appVersion<7?"first\\-child":"",dynamicPseudoClasses:{toString:function(){var strings=[];for(var pseudoClass in this)strings.push(pseudoClass); | ||
299 | 22 | return strings.join("|")}},init:function(){var NONE="^\u0001$";var CLASS="\\[class=?[^\\]]*\\]";var pseudoClasses=[];if(this.pseudoClasses)pseudoClasses.push(this.pseudoClasses);var dynamicPseudoClasses=this.dynamicPseudoClasses.toString();if(dynamicPseudoClasses)pseudoClasses.push(dynamicPseudoClasses);pseudoClasses=pseudoClasses.join("|");var unknown=appVersion<7?["[>+~\\[(]|([:.])[\\w-]+\\1"]:[CLASS];if(pseudoClasses)unknown.push(":("+pseudoClasses+")");this.UNKNOWN=new RegExp(unknown.join("|")|| | ||
300 | 23 | NONE,"i");var complex=appVersion<7?["\\[[^\\]]+\\]|[^\\s(\\[]+\\s*[+~]"]:[CLASS];var complexRule=complex.concat();if(pseudoClasses)complexRule.push(":("+pseudoClasses+")");Rule.COMPLEX=new RegExp(complexRule.join("|")||NONE,"ig");if(this.pseudoClasses)complex.push(":("+this.pseudoClasses+")");DynamicRule.COMPLEX=new RegExp(complex.join("|")||NONE,"i");dynamicPseudoClasses="not\\(:"+dynamicPseudoClasses.split("|").join("\\)|not\\(:")+"\\)|"+dynamicPseudoClasses;DynamicRule.MATCH=new RegExp(dynamicPseudoClasses? | ||
301 | 24 | "(.*?):("+dynamicPseudoClasses+")(.*)":NONE,"i");this.createStyleSheet();this.refresh()},addEventHandler:function(){addEventHandler.apply(null,arguments)},addFix:function(expression,replacement){this.parser.add(expression,replacement)},addRecalc:function(propertyName,test,handler,replacement){propertyName=propertyName.source||propertyName;test=new RegExp("([{;\\s])"+propertyName+"\\s*:\\s*"+test+"[^;}]*");var id=this.recalcs.length;if(typeof replacement=="string")replacement=propertyName+":"+replacement; | ||
302 | 25 | this.addFix(test,function(match){if(typeof replacement=="function")replacement=replacement(match);return(replacement?replacement:match)+";ie7-"+match.slice(1)+";ie7_recalc"+id+":1"});this.recalcs.push(arguments);return id},apply:function(){this.getInlineCSS();new StyleSheet("screen");this.trash()},createStyleSheet:function(){document.getElementsByTagName("head")[0].appendChild(document.createElement("style"));this.styleSheet=styleSheets[styleSheets.length-1];this.styleSheet.ie7=true;this.styleSheet.owningElement.ie7= | ||
303 | 26 | true;this.styleSheet.cssText=HEADER},getInlineCSS:function(){var styleSheets=document.getElementsByTagName("style"),styleSheet;for(var i=styleSheets.length-1;styleSheet=styleSheets[i];i--)if(!styleSheet.disabled&&!styleSheet.ie7)styleSheet._cssText=styleSheet.innerHTML},getText:function(styleSheet,path){try{var cssText=styleSheet.cssText}catch(e){cssText=""}if(httpRequest)cssText=loadFile(styleSheet.href,path)||cssText;return cssText},recalc:function(){this.screen.recalc();var RECALCS=/ie7_recalc\d+/g; | ||
304 | 27 | var start=HEADER.match(/[{,]/g).length;var rules=this.styleSheet.rules,rule;var calcs,calc,elements,element,i,j,k,id;for(i=start;rule=rules[i];i++){var cssText=rule.style.cssText;if(calcs=cssText.match(RECALCS)){elements=cssQuery(rule.selectorText);if(elements.length)for(j=0;j<calcs.length;j++){id=calcs[j];calc=IE7.CSS.recalcs[id.slice(10)][2];for(k=0;element=elements[k];k++)if(element.currentStyle[id])calc(element,cssText)}}}},refresh:function(){this.styleSheet.cssText=HEADER+this.screen+this.print}, | ||
305 | 28 | trash:function(){for(var i=0;i<styleSheets.length;i++)if(!styleSheets[i].ie7){try{var cssText=styleSheets[i].cssText}catch(e){cssText=""}if(cssText)styleSheets[i].cssText=""}}}));var StyleSheet=Base.extend({constructor:function(media){this.media=media;this.load();IE7.CSS[media]=this;IE7.CSS.refresh()},createRule:function(selector,cssText){var match;if(PseudoElement&&(match=selector.match(PseudoElement.MATCH)))return new PseudoElement(match[1],match[2],cssText);else if(match=selector.match(DynamicRule.MATCH)){if(!HYPERLINK.test(match[0])|| | ||
306 | 29 | DynamicRule.COMPLEX.test(match[0]))return new DynamicRule(selector,match[1],match[2],match[3],cssText)}else return new Rule(selector,cssText);return selector+" {"+cssText+"}"},getText:function(){var MEDIA=/@media\s+([^{]+?)\s*\{([^@]+\})\s*\}/gi;var IMPORTS=/@import[^;\n]+/gi;var TRIM_IMPORTS=/@import\s+url\s*\(\s*["']?|["']?\s*\)\s*/gi;var URL=/(url\s*\(\s*['"]?)([\w\.]+[^:\)]*['"]?\))/gi;var self=this;var fileCache={};function getCSSText(styleSheet,path,media,level){var cssText="";if(!level){media= | ||
307 | 30 | toSimpleMedia(styleSheet.media);level=0}if(media==="none"){styleSheet.disabled=true;return""}if(media==="all"||media===self.media){try{var canAcess=!!styleSheet.cssText}catch(exe){}if(level<3&&canAcess){var hrefs=styleSheet.cssText.match(IMPORTS);for(var i=0,imported;i<styleSheet.imports.length;i++){var imported=styleSheet.imports[i];var href=styleSheet._href||styleSheet.href;imported._href=hrefs[i].replace(TRIM_IMPORTS,"");cssText+=getCSSText(imported,getPath(href,path),media,level+1)}}cssText+= | ||
308 | 31 | encode(styleSheet.href?loadStyleSheet(styleSheet,path):styleSheet.owningElement._cssText);cssText=parseMedia(cssText,self.media)}return cssText}for(var i=0;i<styleSheets.length;i++){var styleSheet=styleSheets[i];if(!styleSheet.disabled&&!styleSheet.ie7)this.cssText+=getCSSText(styleSheet)}function parseMedia(cssText,media){filterMedia.value=media;return cssText.replace(MEDIA,filterMedia)}function filterMedia(match,media,cssText){media=toSimpleMedia(media);switch(media){case "screen":case "print":if(media!== | ||
309 | 32 | filterMedia.value)return"";case "all":return cssText}return""}function toSimpleMedia(media){if(!media)return"all";var split=media.toLowerCase().split(/\s*,\s*/);media="none";for(var i=0;i<split.length;i++){if(split[i]==="all")return"all";if(split[i]==="screen"){if(media==="print")return"all";media="screen"}else if(split[i]==="print"){if(media==="screen")return"all";media="print"}}return media}function loadStyleSheet(styleSheet,path){var href=styleSheet._href||styleSheet.href;var url=makePath(href, | ||
310 | 33 | path);if(fileCache[url])return"";fileCache[url]=styleSheet.disabled?"":fixUrls(IE7.CSS.getText(styleSheet,path),getPath(href,path));return fileCache[url]}function fixUrls(cssText,pathname){return cssText.replace(URL,"$1"+pathname.slice(0,pathname.lastIndexOf("/")+1)+"$2")}},load:function(){this.cssText="";this.getText();this.parse();if(inheritedProperties.length)this.cssText=parseInherited(this.cssText);this.cssText=decode(this.cssText);fileCache={}},parse:function(){var cssText=IE7.CSS.parser.parse(this.cssText); | ||
311 | 34 | var declarations="";this.cssText=cssText.replace(/@charset[^;]+;|@font\-face[^\}]+\}/g,function(match){declarations+=match+"\n";return""});this.declarations=decode(declarations);var offset=IE7.CSS.rules.length;var rules=[],rule;while(rule=RULE.exec(this.cssText)){var cssText=rule[2];if(cssText){var fixDescendants=appVersion<7&&cssText.indexOf("AlphaImageLoader")!==-1;var selectors=rule[1].match(SELECTOR),selector;for(var i=0;selector=selectors[i];i++){selector=trim(selector);var isUnknown=IE7.CSS.UNKNOWN.test(selector); | ||
312 | 35 | selectors[i]=isUnknown?this.createRule(selector,cssText):selector+"{"+cssText+"}";if(fixDescendants)selectors[i]+=this.createRule(selector+">*","position:relative")}rules.push(selectors.join("\n"))}}this.cssText=rules.join("\n");this.rules=IE7.CSS.rules.slice(offset)},recalc:function(){var rule,i;for(i=0;rule=this.rules[i];i++)rule.recalc()},toString:function(){return this.declarations+"@media "+this.media+"{"+this.cssText+"}"}});var PseudoElement;var Rule=IE7.Rule=Base.extend({constructor:function(selector, | ||
313 | 36 | cssText){this.id=IE7.CSS.rules.length;this.className=Rule.PREFIX+this.id;var pseudoElement=selector.match(FIRST_LINE_LETTER);this.selector=(pseudoElement?pseudoElement[1]:selector)||"*";this.selectorText=this.parse(this.selector)+(pseudoElement?pseudoElement[2]:"");this.cssText=cssText;this.MATCH=new RegExp("\\s"+this.className+"(\\s|$)","g");IE7.CSS.rules.push(this);this.init()},init:Undefined,add:function(element){element.className+=" "+this.className},recalc:function(){var match=cssQuery(this.selector); | ||
314 | 37 | for(var i=0;i<match.length;i++)this.add(match[i])},parse:function(selector){var simple=selector.replace(Rule.CHILD," ").replace(Rule.COMPLEX,"");if(appVersion<7)simple=simple.replace(Rule.MULTI,"");var tags=match(simple,Rule.TAGS).length-match(selector,Rule.TAGS).length;var classes=match(simple,Rule.CLASSES).length-match(selector,Rule.CLASSES).length+1;while(classes>0&&Rule.CLASS.test(simple)){simple=simple.replace(Rule.CLASS,"");classes--}while(tags>0&&Rule.TAG.test(simple)){simple=simple.replace(Rule.TAG, | ||
315 | 38 | "$1*");tags--}simple+="."+this.className;classes=Math.min(classes,2);tags=Math.min(tags,2);var score=-10*classes-tags;if(score>0)simple=simple+","+Rule.MAP[score]+" "+simple;return simple},remove:function(element){element.className=element.className.replace(this.MATCH,"$1")},toString:function(){return format("%1 {%2}",this.selectorText,this.cssText)}},{CHILD:/>/g,CLASS:/\.[\w-]+/,CLASSES:/[.:\[]/g,MULTI:/(\.[\w-]+)+/g,PREFIX:"ie7_class",TAG:/^\w+|([\s>+~])\w+/,TAGS:/^\w|[\s>+~]\w/g,MAP:{1:"html", | ||
316 | 39 | 2:"html body",10:".ie7_html",11:"html.ie7_html",12:"html.ie7_html body",20:".ie7_html .ie7_body",21:"html.ie7_html .ie7_body",22:"html.ie7_html body.ie7_body"}});var DynamicRule=Rule.extend({constructor:function(selector,attach,dynamicPseudoClass,target,cssText){this.negated=dynamicPseudoClass.indexOf("not")===0;if(this.negated)dynamicPseudoClass=dynamicPseudoClass.slice(5,-1);this.attach=attach||"*";this.dynamicPseudoClass=IE7.CSS.dynamicPseudoClasses[dynamicPseudoClass];this.target=target;this.base(selector, | ||
317 | 40 | cssText)},recalc:function(){var attaches=cssQuery(this.attach),attach;for(var i=0;attach=attaches[i];i++){var target=this.target?cssQuery(this.target,attach):[attach];if(target.length)this.dynamicPseudoClass.apply(attach,target,this)}}});var DynamicPseudoClass=Base.extend({constructor:function(name,apply){this.name=name;this.apply=apply;this.instances={};IE7.CSS.dynamicPseudoClasses[name]=this},register:function(instance,negated){var _class=instance[2];if(!negated&&_class.negated)this.unregister(instance, | ||
318 | 41 | true);else{instance.id=_class.id+instance[0].uniqueID;if(!this.instances[instance.id]){var target=instance[1],j;for(j=0;j<target.length;j++)_class.add(target[j]);this.instances[instance.id]=instance}}},unregister:function(instance,negated){var _class=instance[2];if(!negated&&_class.negated)this.register(instance,true);else if(this.instances[instance.id]){var target=instance[1],j;for(j=0;j<target.length;j++)_class.remove(target[j]);delete this.instances[instance.id]}}});var Hover=new DynamicPseudoClass("hover", | ||
319 | 42 | function(element){var instance=arguments;IE7.CSS.addEventHandler(element,"onmouseenter",function(){Hover.register(instance)});IE7.CSS.addEventHandler(element,"onmouseleave",function(){Hover.unregister(instance)})});addEventHandler(document,"onmouseup",function(){var instances=Hover.instances;for(var i in instances)if(!instances[i][0].contains(event.srcElement))Hover.unregister(instances[i])});var ATTR={"=":"%1==='%2'","~=":"(' '+%1+' ').indexOf(' %2 ')!==-1","|=":"%1==='%2'||%1.indexOf('%2-')===0", | ||
320 | 43 | "^=":"%1.indexOf('%2')===0","$=":"%1.slice(-'%2'.length)==='%2'","*=":"%1.indexOf('%2')!==-1"};ATTR[""]="%1!=null";var FILTER={"<#attr>":function(match,name,operator,value){var attr="IE7._getAttribute(e,'"+name+"')";value=getString(value);if(operator.length>1){if(!value||operator==="~="&&SPACE.test(value))return"false&&";attr="("+attr+"||'')"}return"("+format(ATTR[operator],attr,value)+")&&"},"<#id>":ID_ATTRIBUTE+"==='$1'&&","<#class>":"e.className&&(' '+e.className+' ').indexOf(' $1 ')!==-1&&",":first-child":"!"+ | ||
321 | 44 | PREVIOUS_SIBLING+"&&",":link":"e.currentStyle['ie7-link']=='link'&&",":visited":"e.currentStyle['ie7-link']=='visited'&&"};IE7.HTML=new (Fix.extend({fixed:{},init:Undefined,addFix:function(){this.fixes.push(arguments)},apply:function(){for(var i=0;i<this.fixes.length;i++){var match=cssQuery(this.fixes[i][0]);var fix=this.fixes[i][1];for(var j=0;j<match.length;j++)fix(match[j])}},addRecalc:function(){this.recalcs.push(arguments)},recalc:function(){for(var i=0;i<this.recalcs.length;i++){var match=cssQuery(this.recalcs[i][0]); | ||
322 | 45 | var recalc=this.recalcs[i][1],element;var key=Math.pow(2,i);for(var j=0;element=match[j];j++){var uniqueID=element.uniqueID;if((this.fixed[uniqueID]&key)===0){element=recalc(element)||element;this.fixed[uniqueID]|=key}}}}}));if(appVersion<7){document.createElement("abbr");IE7.HTML.addRecalc("label",function(label){if(!label.htmlFor){var firstChildControl=cssQuery("input,textarea",label,true);if(firstChildControl)addEventHandler(label,"onclick",function(){firstChildControl.click()})}})}var NUMERIC= | ||
323 | 46 | "[.\\d]";(function(){var layout=IE7.Layout={};HEADER+="*{boxSizing:content-box}";layout.boxSizing=function(element){if(!element.currentStyle.hasLayout){element.style.height="0cm";if(element.currentStyle.verticalAlign==="auto")element.runtimeStyle.verticalAlign="top";collapseMargins(element)}};function collapseMargins(element){if(element!=viewport&&element.currentStyle.position!=="absolute"){collapseMargin(element,"marginTop");collapseMargin(element,"marginBottom")}}function collapseMargin(element, | ||
324 | 47 | type){if(!element.runtimeStyle[type]){var parentElement=element.parentElement;var isTopMargin=type==="marginTop";if(parentElement&&parentElement.currentStyle.hasLayout&&!IE7._getElementSibling(element,isTopMargin?"previous":"next"))return;var child=element[isTopMargin?"firstChild":"lastChild"];if(child&&child.nodeName<"@")child=IE7._getElementSibling(child,isTopMargin?"next":"previous");if(child&&child.currentStyle.styleFloat==="none"&&child.currentStyle.hasLayout){collapseMargin(child,type);margin= | ||
325 | 48 | _getMargin(element,element.currentStyle[type]);childMargin=_getMargin(child,child.currentStyle[type]);if(margin<0||childMargin<0)element.runtimeStyle[type]=margin+childMargin;else element.runtimeStyle[type]=Math.max(childMargin,margin);child.runtimeStyle[type]="0px"}}}function _getMargin(element,value){return value==="auto"?0:getPixelValue(element,value)}var UNIT=/^[.\d][\w]*$/,AUTO=/^(auto|0cm)$/;var apply={};layout.borderBox=function(element){apply.Width(element);apply.Height(element)};var _fixWidth= | ||
326 | 49 | function(HEIGHT){apply.Width=function(element){if(!PERCENT.test(element.currentStyle.width))_fixWidth(element);if(HEIGHT)collapseMargins(element)};function _fixWidth(element,value){if(!element.runtimeStyle.fixedWidth){if(!value)value=element.currentStyle.width;element.runtimeStyle.fixedWidth=UNIT.test(value)?Math.max(0,getFixedWidth(element,value))+"px":value;setOverrideStyle(element,"width",element.runtimeStyle.fixedWidth)}}function layoutWidth(element){if(!isFixed(element)){var layoutParent=element.offsetParent; | ||
327 | 50 | while(layoutParent&&!layoutParent.currentStyle.hasLayout)layoutParent=layoutParent.offsetParent}return(layoutParent||viewport).clientWidth}function getPixelWidth(element,value){if(PERCENT.test(value))return parseInt(parseFloat(value)/100*layoutWidth(element));return getPixelValue(element,value)}var getFixedWidth=function(element,value){var borderBox=element.currentStyle["ie7-box-sizing"]==="border-box";var adjustment=0;if(MSIE5&&!borderBox)adjustment+=getBorderWidth(element)+getWidth(element,"padding"); | ||
328 | 51 | else if(!MSIE5&&borderBox)adjustment-=getBorderWidth(element)+getWidth(element,"padding");return getPixelWidth(element,value)+adjustment};function getBorderWidth(element){return element.offsetWidth-element.clientWidth}function getWidth(element,type){return getPixelWidth(element,element.currentStyle[type+"Left"])+getPixelWidth(element,element.currentStyle[type+"Right"])}HEADER+="*{minWidth:none;maxWidth:none;min-width:none;max-width:none}";layout.minWidth=function(element){if(element.currentStyle["min-width"]!= | ||
329 | 52 | null)element.style.minWidth=element.currentStyle["min-width"];if(register(arguments.callee,element,element.currentStyle.minWidth!=="none")){layout.boxSizing(element);_fixWidth(element);resizeWidth(element)}};eval("IE7.Layout.maxWidth="+String(layout.minWidth).replace(/min/g,"max"));function resizeWidth(element){if(element==document.body)var width=element.clientWidth;else{var rect=element.getBoundingClientRect();width=rect.right-rect.left}if(element.currentStyle.minWidth!=="none"&&width<getFixedWidth(element, | ||
330 | 53 | element.currentStyle.minWidth))element.runtimeStyle.width=element.currentStyle.minWidth;else if(element.currentStyle.maxWidth!=="none"&&width>=getFixedWidth(element,element.currentStyle.maxWidth))element.runtimeStyle.width=element.currentStyle.maxWidth;else element.runtimeStyle.width=element.runtimeStyle.fixedWidth}function fixRight(element){if(register(fixRight,element,/^(fixed|absolute)$/.test(element.currentStyle.position)&&getDefinedStyle(element,"left")!=="auto"&&getDefinedStyle(element,"right")!== | ||
331 | 54 | "auto"&&AUTO.test(getDefinedStyle(element,"width")))){resizeRight(element);layout.boxSizing(element)}}layout.fixRight=fixRight;function resizeRight(element){var left=getPixelWidth(element,element.runtimeStyle._left||element.currentStyle.left);var width=layoutWidth(element)-getPixelWidth(element,element.currentStyle.right)-left-getWidth(element,"margin");if(parseInt(element.runtimeStyle.width)===width)return;element.runtimeStyle.width="";if(isFixed(element)||HEIGHT||element.offsetWidth<width){if(!MSIE5)width-= | ||
332 | 55 | getBorderWidth(element)+getWidth(element,"padding");if(width<0)width=0;element.runtimeStyle.fixedWidth=width;setOverrideStyle(element,"width",width)}}var clientWidth=0;addResize(function(){if(!viewport)return;var i,wider=clientWidth<viewport.clientWidth;clientWidth=viewport.clientWidth;var elements=layout.minWidth.elements;for(i in elements){var element=elements[i];var fixedWidth=parseInt(element.runtimeStyle.width)===getFixedWidth(element,element.currentStyle.minWidth);if(wider&&fixedWidth)element.runtimeStyle.width= | ||
333 | 56 | "";if(wider==fixedWidth)resizeWidth(element)}var elements=layout.maxWidth.elements;for(i in elements){var element=elements[i];var fixedWidth=parseInt(element.runtimeStyle.width)===getFixedWidth(element,element.currentStyle.maxWidth);if(!wider&&fixedWidth)element.runtimeStyle.width="";if(wider!==fixedWidth)resizeWidth(element)}for(i in fixRight.elements)resizeRight(fixRight.elements[i])});if(MSIE5)IE7.CSS.addRecalc("width",NUMERIC,apply.Width);if(appVersion<7){IE7.CSS.addRecalc("max-width",NUMERIC, | ||
334 | 57 | layout.maxWidth);IE7.CSS.addRecalc("right",NUMERIC,fixRight)}else if(appVersion==7)if(HEIGHT)IE7.CSS.addRecalc("height","[\\d.]+%",function(element){element.runtimeStyle.pixelHeight=parseInt(layoutWidth(element)*element.currentStyle["ie7-height"].slice(0,-1)/100)})};eval("var _fixHeight="+rotate(_fixWidth));_fixWidth();_fixHeight(true);if(appVersion<7){IE7.CSS.addRecalc("min-width",NUMERIC,layout.minWidth);IE7.CSS.addFix(/\bmin-height\s*/,"height")}})();var BLANK_GIF=makePath("blank.gif",path);var ALPHA_IMAGE_LOADER= | ||
335 | 58 | "DXImageTransform.Microsoft.AlphaImageLoader";var PNG_FILTER="progid:"+ALPHA_IMAGE_LOADER+"(src='%1',sizingMethod='%2')";var PNG;var filtered=[];function fixImage(element){if(PNG.test(element.src)){var image=new Image(element.width,element.height);image.onload=function(){element.width=image.width;element.height=image.height;image=null};image.src=element.src;element.pngSrc=element.src;addFilter(element)}}if(appVersion<7){IE7.CSS.addFix(/background(-image)?\s*:\s*([^};]*)?url\(([^\)]+)\)([^;}]*)?/, | ||
336 | 59 | function(match,$1,$2,url,$4){url=getString(url);return PNG.test(url)?"filter:"+format(PNG_FILTER,url,$4.indexOf("no-repeat")===-1?"scale":"crop")+";zoom:1;background"+($1||"")+":"+($2||"")+"none"+($4||""):match});IE7.CSS.addRecalc(/list\-style(\-image)?/,"[^};]*url",function(element){var url=element.currentStyle.listStyleImage.slice(5,-2);if(PNG.test(url))if(element.nodeName==="LI")fixListStyleImage(element,url);else if(element.nodeName==="UL")for(var i=0,li;li=element.childNodes[i];i++)if(li.nodeName=== | ||
337 | 60 | "LI")fixListStyleImage(li,url)});function fixListStyleImage(element,src){var style=element.runtimeStyle;var originalHeight=element.offsetHeight;var image=new Image;image.onload=function(){var paddingLeft=element.currentStyle.paddingLeft;paddingLeft=paddingLeft==="0px"?0:getPixelValue(element,paddingLeft);style.paddingLeft=paddingLeft+this.width+"px";style.marginLeft=-this.width+"px";style.listStyleType="none";style.listStyleImage="none";style.paddingTop=Math.max(originalHeight-element.offsetHeight, | ||
338 | 61 | 0)+"px";addFilter(element,"crop",src);element.style.zoom="100%"};image.src=src}IE7.HTML.addRecalc("img,input",function(element){if(element.nodeName==="INPUT"&&element.type!=="image")return;fixImage(element);addEventHandler(element,"onpropertychange",function(){if(!printing&&event.propertyName==="src"&&element.src.indexOf(BLANK_GIF)===-1)fixImage(element)})});var printing=false;addEventHandler(window,"onbeforeprint",function(){printing=true;for(var i=0;i<filtered.length;i++)removeFilter(filtered[i])}); | ||
339 | 62 | addEventHandler(window,"onafterprint",function(){for(var i=0;i<filtered.length;i++)addFilter(filtered[i]);printing=false})}function addFilter(element,sizingMethod,src){var filter=element.filters[ALPHA_IMAGE_LOADER];if(filter){filter.src=src||element.src;filter.enabled=true}else{element.runtimeStyle.filter=format(PNG_FILTER,src||element.src,sizingMethod||"scale");filtered.push(element)}element.src=BLANK_GIF}function removeFilter(element){element.src=element.pngSrc;element.filters[ALPHA_IMAGE_LOADER].enabled= | ||
340 | 63 | false}(function(){if(appVersion>=7)return;IE7.CSS.addRecalc("position","fixed",_positionFixed,"absolute");IE7.CSS.addRecalc("background(-attachment)?","[^};]*fixed",_backgroundFixed);var $viewport=MSIE5?"body":"documentElement";function _fixBackground(){if(body.currentStyle.backgroundAttachment!=="fixed"){if(body.currentStyle.backgroundImage==="none"){body.runtimeStyle.backgroundRepeat="no-repeat";body.runtimeStyle.backgroundImage="url("+BLANK_GIF+")"}body.runtimeStyle.backgroundAttachment="fixed"}_fixBackground= | ||
341 | 64 | Undefined}var _tmp=createTempElement("img");function _isFixed(element){return element?isFixed(element)||_isFixed(element.parentElement):false}function _setExpression(element,propertyName,expression){setTimeout("document.all."+element.uniqueID+".runtimeStyle.setExpression('"+propertyName+"','"+expression+"')",0)}function _backgroundFixed(element){if(register(_backgroundFixed,element,element.currentStyle.backgroundAttachment==="fixed"&&!element.contains(body))){_fixBackground();util.bgLeft(element); | ||
342 | 65 | util.bgTop(element);_backgroundPosition(element)}}function _backgroundPosition(element){_tmp.src=element.currentStyle.backgroundImage.slice(5,-2);var parentElement=element.canHaveChildren?element:element.parentElement;parentElement.appendChild(_tmp);util.setOffsetLeft(element);util.setOffsetTop(element);parentElement.removeChild(_tmp)}function _positionFixed(element){if(register(_positionFixed,element,isFixed(element))){setOverrideStyle(element,"position","absolute");setOverrideStyle(element,"left", | ||
343 | 66 | element.currentStyle.left);setOverrideStyle(element,"top",element.currentStyle.top);_fixBackground();IE7.Layout.fixRight(element);_foregroundPosition(element)}}function _foregroundPosition(element,recalc){document.body.getBoundingClientRect();util.positionTop(element,recalc);util.positionLeft(element,recalc,true);if(!element.runtimeStyle.autoLeft&&element.currentStyle.marginLeft==="auto"&&element.currentStyle.right!=="auto"){var left=viewport.clientWidth-util.getPixelWidth(element,element.currentStyle.right)- | ||
344 | 67 | util.getPixelWidth(element,element.runtimeStyle._left)-element.clientWidth;if(element.currentStyle.marginRight==="auto")left=parseInt(left/2);if(_isFixed(element.offsetParent))element.runtimeStyle.pixelLeft+=left;else element.runtimeStyle.shiftLeft=left}if(!element.runtimeStyle.fixedWidth)util.clipWidth(element);if(!element.runtimeStyle.fixedHeight)util.clipHeight(element)}function _resize(){var elements=_backgroundFixed.elements;for(var i in elements)_backgroundPosition(elements[i]);elements=_positionFixed.elements; | ||
345 | 68 | for(i in elements){_foregroundPosition(elements[i],true);_foregroundPosition(elements[i],true)}_timer=0}var _timer;addResize(function(){if(!_timer)_timer=setTimeout(_resize,100)});var util={};var _horizontal=function(util){util.bgLeft=function(element){element.style.backgroundPositionX=element.currentStyle.backgroundPositionX;if(!_isFixed(element))_setExpression(element,"backgroundPositionX","(parseInt(runtimeStyle.offsetLeft)+document."+$viewport+".scrollLeft)||0")};util.setOffsetLeft=function(element){var propertyName= | ||
346 | 69 | _isFixed(element)?"backgroundPositionX":"offsetLeft";element.runtimeStyle[propertyName]=util.getOffsetLeft(element,element.style.backgroundPositionX)-element.getBoundingClientRect().left-element.clientLeft+2};util.getOffsetLeft=function(element,position){switch(position){case "left":case "top":return 0;case "right":case "bottom":return viewport.clientWidth-_tmp.offsetWidth;case "center":return(viewport.clientWidth-_tmp.offsetWidth)/2;default:if(PERCENT.test(position))return parseInt((viewport.clientWidth- | ||
347 | 70 | _tmp.offsetWidth)*parseFloat(position)/100);_tmp.style.left=position;return _tmp.offsetLeft}};util.clipWidth=function(element){var fixWidth=element.runtimeStyle.fixWidth;element.runtimeStyle.borderRightWidth="";element.runtimeStyle.width=fixWidth?util.getPixelWidth(element,fixWidth)+"px":"";if(element.currentStyle.width!=="auto"){var rect=element.getBoundingClientRect();var width=element.offsetWidth-viewport.clientWidth+rect.left-2;if(width>=0){element.runtimeStyle.borderRightWidth="0px";width=Math.max(getPixelValue(element, | ||
348 | 71 | element.currentStyle.width)-width,0);setOverrideStyle(element,"width",width);return width}}};util.positionLeft=function(element,recalc){if(!recalc&&PERCENT.test(element.currentStyle.width))element.runtimeStyle.fixWidth=element.currentStyle.width;if(element.runtimeStyle.fixWidth)element.runtimeStyle.width=util.getPixelWidth(element,element.runtimeStyle.fixWidth);element.runtimeStyle.shiftLeft=0;element.runtimeStyle._left=element.currentStyle.left;element.runtimeStyle.autoLeft=element.currentStyle.right!== | ||
349 | 72 | "auto"&&element.currentStyle.left==="auto";element.runtimeStyle.left="";element.runtimeStyle.screenLeft=util.getScreenLeft(element);element.runtimeStyle.pixelLeft=element.runtimeStyle.screenLeft;if(!recalc&&!_isFixed(element.offsetParent))_setExpression(element,"pixelLeft","runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document."+$viewport+".scrollLeft")};util.getScreenLeft=function(element){var screenLeft=element.offsetLeft,nested=1;if(element.runtimeStyle.autoLeft)screenLeft=viewport.clientWidth- | ||
350 | 73 | element.offsetWidth-util.getPixelWidth(element,element.currentStyle.right);if(element.currentStyle.marginLeft!=="auto")screenLeft-=util.getPixelWidth(element,element.currentStyle.marginLeft);while(element=element.offsetParent){if(element.currentStyle.position!=="static")nested=-1;screenLeft+=element.offsetLeft*nested}return screenLeft};util.getPixelWidth=function(element,value){return PERCENT.test(value)?parseInt(parseFloat(value)/100*viewport.clientWidth):getPixelValue(element,value)}};eval("var _vertical="+ | ||
351 | 74 | rotate(_horizontal));_horizontal(util);_vertical(util)})();if(appVersion<7){var WRAPPER_STYLE={backgroundColor:"transparent",backgroundImage:"none",backgroundPositionX:null,backgroundPositionY:null,backgroundRepeat:null,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none",borderLeftWidth:0,borderLeftColor:"#000",borderTopColor:"#000",borderRightColor:"#000",borderBottomColor:"#000",height:null,marginTop:0, | ||
352 | 75 | marginBottom:0,marginRight:0,marginLeft:0,width:"100%"};IE7.CSS.addRecalc("overflow","visible",function(element){if(element.currentStyle.position==="absolute")return;if(element.parentNode.ie7_wrapped)return;if(IE7.Layout&&element.currentStyle["max-height"]!=="auto")IE7.Layout.maxHeight(element);if(element.currentStyle.marginLeft==="auto")element.style.marginLeft=0;if(element.currentStyle.marginRight==="auto")element.style.marginRight=0;var wrapper=document.createElement(ANON);wrapper.ie7_wrapped= | ||
353 | 76 | element;for(var propertyName in WRAPPER_STYLE){wrapper.style[propertyName]=element.currentStyle[propertyName];if(WRAPPER_STYLE[propertyName]!=null)element.runtimeStyle[propertyName]=WRAPPER_STYLE[propertyName]}wrapper.style.display="block";wrapper.style.position="relative";element.runtimeStyle.position="absolute";element.parentNode.insertBefore(wrapper,element);wrapper.appendChild(element)})}function ie7Quirks(){var FONT_SIZES="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");for(var i= | ||
354 | 77 | 0;i<FONT_SIZES.length;i++)FONT_SIZES[FONT_SIZES[i]]=FONT_SIZES[i-1]||"0.67em";IE7.CSS.addFix(/(font(-size)?\s*:\s*)([\w.-]+)/,function(match,label,size,value){return label+(FONT_SIZES[value]||value)});var NEGATIVE=/^\-/,LENGTH=/(em|ex)$/i;var EM=/em$/i,EX=/ex$/i;getPixelValue=function(element,value){if(PIXEL.test(value))return parseInt(value)||0;var scale=NEGATIVE.test(value)?-1:1;if(LENGTH.test(value))scale*=getFontScale(element);temp.style.width=scale<0?value.slice(1):value;body.appendChild(temp); | ||
355 | 78 | value=scale*temp.offsetWidth;temp.removeNode();return parseInt(value)};var temp=createTempElement();function getFontScale(element){var scale=1;temp.style.fontFamily=element.currentStyle.fontFamily;temp.style.lineHeight=element.currentStyle.lineHeight;while(element!=body){var fontSize=element.currentStyle["ie7-font-size"];if(fontSize)if(EM.test(fontSize))scale*=parseFloat(fontSize);else if(PERCENT.test(fontSize))scale*=parseFloat(fontSize)/100;else if(EX.test(fontSize))scale*=parseFloat(fontSize)/ | ||
356 | 79 | 2;else{temp.style.fontSize=fontSize;return 1}element=element.parentElement}return scale}IE7.CSS.addFix(/cursor\s*:\s*pointer/,"cursor:hand");IE7.CSS.addFix(/display\s*:\s*list-item/,"display:block");function fixMargin(element){var parent=element.parentElement;var margin=parent.offsetWidth-element.offsetWidth-getPaddingWidth(parent);var autoRight=element.currentStyle["ie7-margin"]&&element.currentStyle.marginRight==="auto"||element.currentStyle["ie7-margin-right"]==="auto";switch(parent.currentStyle.textAlign){case "right":margin= | ||
357 | 80 | autoRight?parseInt(margin/2):0;element.runtimeStyle.marginRight=margin+"px";break;case "center":if(autoRight)margin=0;default:if(autoRight)margin/=2;element.runtimeStyle.marginLeft=parseInt(margin)+"px"}}function getPaddingWidth(element){return getPixelValue(element,element.currentStyle.paddingLeft)+getPixelValue(element,element.currentStyle.paddingRight)}IE7.CSS.addRecalc("margin(-left|-right)?","[^};]*auto",function(element){if(register(fixMargin,element,element.parentElement&&element.currentStyle.display=== | ||
358 | 81 | "block"&&element.currentStyle.marginLeft==="auto"&&element.currentStyle.position!=="absolute"))fixMargin(element)});addResize(function(){for(var i in fixMargin.elements){var element=fixMargin.elements[i];element.runtimeStyle.marginLeft=element.runtimeStyle.marginRight="";fixMargin(element)}})}var BRACKETS="\\([^)]+\\)";encoder.add(/::(before|after)/,":$1");if(appVersion<8){if(IE7.CSS.pseudoClasses)IE7.CSS.pseudoClasses+="|";IE7.CSS.pseudoClasses+="before|after|lang"+BRACKETS;function parseInherited(cssText){return cssText.replace(new RegExp("([{;\\s])("+ | ||
359 | 82 | inheritedProperties.join("|")+")\\s*:\\s*([^;}]+)","g"),"$1$2:$3;ie7-$2:$3")}var INHERITED=/[\w-]+\s*:\s*inherit/g;var STRIP_IE7_FLAGS=/ie7\-|\s*:\s*inherit/g;var DASH_LOWER=/\-([a-z])/g;function toUpper(match,chr){return chr.toUpperCase()}IE7.CSS.addRecalc("[\\w-]+","inherit",function(element,cssText){if(element.parentElement){var inherited=cssText.match(INHERITED);for(var i=0;i<inherited.length;i++){var propertyName=inherited[i].replace(STRIP_IE7_FLAGS,"");if(element.currentStyle["ie7-"+propertyName]=== | ||
360 | 83 | "inherit"){propertyName=propertyName.replace(DASH_LOWER,toUpper);element.runtimeStyle[propertyName]=element.parentElement.currentStyle[propertyName]}}}},function(match){inheritedProperties.push(rescape(match.slice(1).split(":")[0]));return match});var Focus=new DynamicPseudoClass("focus",function(element){var instance=arguments;IE7.CSS.addEventHandler(element,"onfocus",function(){Focus.unregister(instance);Focus.register(instance)});IE7.CSS.addEventHandler(element,"onblur",function(){Focus.unregister(instance)}); | ||
361 | 84 | if(element==document.activeElement)Focus.register(instance)});var Active=new DynamicPseudoClass("active",function(element){var instance=arguments;IE7.CSS.addEventHandler(element,"onmousedown",function(){Active.register(instance)})});addEventHandler(document,"onmouseup",function(){var instances=Active.instances;for(var i in instances)Active.unregister(instances[i])});var URL=/^url\s*\(\s*([^)]*)\)$/;var POSITION_MAP={before0:"beforeBegin",before1:"afterBegin",after0:"afterEnd",after1:"beforeEnd"}; | ||
362 | 85 | var PseudoElement=IE7.PseudoElement=Rule.extend({constructor:function(selector,position,cssText){this.position=position;var content=cssText.match(PseudoElement.CONTENT),match,entity;if(content){content=content[1];match=content.split(/\s+/);for(var i=0;entity=match[i];i++)match[i]=/^attr/.test(entity)?{attr:entity.slice(5,-1)}:entity.charAt(0)==="'"?getString(entity):decode(entity);content=match}this.content=content;this.base(selector,decode(cssText))},init:function(){this.match=cssQuery(this.selector); | ||
363 | 86 | for(var i=0;i<this.match.length;i++){var runtimeStyle=this.match[i].runtimeStyle;if(!runtimeStyle[this.position])runtimeStyle[this.position]={cssText:""};runtimeStyle[this.position].cssText+=";"+this.cssText;if(this.content!=null)runtimeStyle[this.position].content=this.content}},create:function(target){var generated=target.runtimeStyle[this.position];if(generated){var content=[].concat(generated.content||"");for(var j=0;j<content.length;j++)if(typeof content[j]=="object")content[j]=target.getAttribute(content[j].attr); | ||
364 | 87 | content=content.join("");var url=content.match(URL);var cssText="overflow:hidden;"+generated.cssText.replace(/'/g,'"');var position=POSITION_MAP[this.position+Number(target.canHaveChildren)];var id="ie7_pseudo"+PseudoElement.count++;target.insertAdjacentHTML(position,format(PseudoElement.ANON,this.className,id,cssText,url?"":content));if(url){var src=getString(url[1]);var pseudoElement=document.getElementById(id);pseudoElement.src=src;addFilter(pseudoElement,"crop");var targetIsFloated=target.currentStyle.styleFloat!== | ||
365 | 88 | "none";if(pseudoElement.currentStyle.display==="inline"||targetIsFloated){if(appVersion<7&&targetIsFloated&&target.canHaveChildren){target.runtimeStyle.display="inline";target.runtimeStyle.position="relative";pseudoElement.runtimeStyle.position="absolute"}pseudoElement.style.display="inline-block";if(target.currentStyle.styleFloat!=="none")pseudoElement.style.pixelWidth=target.offsetWidth;var image=new Image;image.onload=function(){pseudoElement.style.pixelWidth=this.width;pseudoElement.style.pixelHeight= | ||
366 | 89 | Math.max(this.height,pseudoElement.offsetHeight)};image.src=src}}target.runtimeStyle[this.position]=null}},recalc:function(){if(this.content==null)return;for(var i=0;i<this.match.length;i++)this.create(this.match[i])},toString:function(){return"."+this.className+"{display:inline}"}},{CONTENT:/content\s*:\s*([^;]*)(;|$)/,ANON:"<ie7:! class='ie7_anon %1' id=%2 style='%3'>%4</ie7:!>",MATCH:/(.*):(before|after).*/,count:0});IE7._getLang=function(element){var lang="";while(element&&element.nodeType=== | ||
367 | 90 | 1){lang=element.lang||element.getAttribute("lang")||"";if(lang)break;element=element.parentNode}return lang};FILTER=extend(FILTER,{":lang\\(([^)]+)\\)":"((ii=IE7._getLang(e))==='$1'||ii.indexOf('$1-')===0)&&"})}var UNSUCCESSFUL=/^(submit|reset|button)$/;IE7.HTML.addRecalc("button,input",function(button){if(button.nodeName==="BUTTON"){var match=button.outerHTML.match(/ value="([^"]*)"/i);button.runtimeStyle.value=match?match[1]:""}if(button.type==="submit")addEventHandler(button,"onclick",function(){button.runtimeStyle.clicked= | ||
368 | 91 | true;setTimeout("document.all."+button.uniqueID+".runtimeStyle.clicked=false",1)})});IE7.HTML.addRecalc("form",function(form){addEventHandler(form,"onsubmit",function(){for(var element,i=0;element=form[i];i++)if(UNSUCCESSFUL.test(element.type)&&!element.disabled&&!element.runtimeStyle.clicked){element.disabled=true;setTimeout("document.all."+element.uniqueID+".disabled=false",1)}else if(element.nodeName==="BUTTON"&&element.type==="submit"){setTimeout("document.all."+element.uniqueID+".value='"+element.value+ | ||
369 | 92 | "'",1);element.value=element.runtimeStyle.value}})});IE7.HTML.addRecalc("img",function(img){if(img.alt&&!img.title)img.title=""});if(appVersion<8){IE7.CSS.addRecalc("border-spacing",NUMERIC,function(element){if(element.currentStyle.borderCollapse!=="collapse")element.cellSpacing=getPixelValue(element,element.currentStyle["ie7-border-spacing"].split(" ")[0])});IE7.CSS.addRecalc("box-sizing","content-box",IE7.Layout.boxSizing);IE7.CSS.addRecalc("box-sizing","border-box",IE7.Layout.borderBox)}if(appVersion< | ||
370 | 93 | 8){var IMAGE=/^image/i;IE7.HTML.addRecalc("object",function(element){if(IMAGE.test(element.type)){element.body.style.cssText="margin:0;padding:0;border:none;overflow:hidden";return element}})}var NOT_NEXT_BY_TYPE="!IE7._getElementSiblingByType(e,'next')&&",NOT_PREVIOUS_BY_TYPE=NOT_NEXT_BY_TYPE.replace("next","previous");if(IE7.CSS.pseudoClasses)IE7.CSS.pseudoClasses+="|";IE7.CSS.pseudoClasses+="(?:first|last|only)\\-(?:child|of\\-type)|empty|root|target|"+("not|nth\\-child|nth\\-last\\-child|nth\\-of\\-type|nth\\-last\\-of\\-type".split("|").join(BRACKETS+ | ||
371 | 94 | "|")+BRACKETS);var Checked=new DynamicPseudoClass("checked",function(element){if(typeof element.checked!=="boolean")return;var instance=arguments;IE7.CSS.addEventHandler(element,"onpropertychange",function(){if(event.propertyName==="checked")if(element.checked===true)Checked.register(instance);else Checked.unregister(instance)});if(element.checked===true)Checked.register(instance)});var Enabled=new DynamicPseudoClass("enabled",function(element){if(typeof element.disabled!=="boolean")return;var instance= | ||
372 | 95 | arguments;IE7.CSS.addEventHandler(element,"onpropertychange",function(){if(event.propertyName==="disabled")if(element.disabled===false)Enabled.register(instance);else Enabled.unregister(instance)});if(element.disabled===false)Enabled.register(instance)});var Disabled=new DynamicPseudoClass("disabled",function(element){if(typeof element.disabled!=="boolean")return;var instance=arguments;IE7.CSS.addEventHandler(element,"onpropertychange",function(){if(event.propertyName==="disabled")if(element.disabled=== | ||
373 | 96 | true)Disabled.register(instance);else Disabled.unregister(instance)});if(element.disabled===true)Disabled.register(instance)});var Indeterminate=new DynamicPseudoClass("indeterminate",function(element){if(typeof element.indeterminate!=="boolean")return;var instance=arguments;IE7.CSS.addEventHandler(element,"onpropertychange",function(){if(event.propertyName==="indeterminate")if(element.indeterminate===true)Indeterminate.register(instance);else Indeterminate.unregister(instance)});IE7.CSS.addEventHandler(element, | ||
374 | 97 | "onclick",function(){Indeterminate.unregister(instance)})});var Target=new DynamicPseudoClass("target",function(element){var instance=arguments;if(!element.tabIndex)element.tabIndex=0;IE7.CSS.addEventHandler(document,"onpropertychange",function(){if(event.propertyName==="activeElement")if(element.id&&element.id===location.hash.slice(1))Target.register(instance);else Target.unregister(instance)});if(element.id&&element.id===location.hash.slice(1))Target.register(instance)});var _currentIndex=1,allIndexes= | ||
375 | 98 | {_currentIndex:1};IE7._indexOf=function(element,last,ofType){var parent=element.parentNode;if(!parent||parent.nodeType!==1)return NaN;var tagName=ofType?element.nodeName:"";if(tagName==="TR"&&element.sectionRowIndex>=0){var index=element.sectionRowIndex;return last?element.parentNode.rows.length-index+1:index}if((tagName==="TD"||tagName==="TH")&&element.cellIndex>=0){index=element.cellIndex;return last?element.parentNode.cells.length-index+1:index}if(allIndexes._currentIndex!==_currentIndex)allIndexes= | ||
376 | 99 | {_currentIndex:_currentIndex};var id=parent.uniqueID+"-"+tagName,indexes=allIndexes[id];if(!indexes){indexes={};var index=0,child=parent.firstChild;while(child){if(ofType?child.nodeName===tagName:child.nodeName>"@")indexes[child.uniqueID]=++index;child=child.nextSibling}indexes.length=index;allIndexes[id]=indexes}index=indexes[element.uniqueID];return last?indexes.length-index+1:index};IE7._isEmpty=function(node){node=node.firstChild;while(node){if(node.nodeType===3||node.nodeName>"@")return false; | ||
377 | 100 | node=node.nextSibling}return true};IE7._getElementSiblingByType=function(node,direction){var tagName=node.nodeName;direction+="Sibling";do{node=node[direction];if(node&&node.nodeName===tagName)break}while(node);return node};var ONE={"+":1,"-":-1},SPACES=/ /g;FILTER=extend(extend({":nth(-last)?-(?:child|(of-type))\\((<#nth_arg>)\\)(<#filter>)?":function(match,last,ofType,args,filters){args=args.replace(SPACES,"");var index="IE7._indexOf(e,"+!!last+","+!!ofType+")";if(args==="even")args="2n";else if(args=== | ||
378 | 101 | "odd")args="2n+1";else if(!isNaN(args))args="0n"+~~args;args=args.split("n");var a=~~(ONE[args[0]]||args[0]||1),b=~~args[1];if(a===0)var expr=index+"==="+b;else expr="((ii="+index+")-("+b+"))%"+a+"===0&&ii"+(a<0?"<":">")+"="+b;return this.parse(filters)+expr+"&&"},"<#negation>":function(match,simple){if(/:not/i.test(simple))throwSelectorError();if(/^[#.:\[]/.test(simple))simple="*"+simple;return"!("+MATCHER.parse(simple).slice(3,-2)+")&&"}},FILTER),{":checked":"e.checked===true&&",":disabled":"e.disabled===true&&", | ||
379 | 102 | ":enabled":"e.disabled===false&&",":last-child":"!"+NEXT_SIBLING+"&&",":only-child":"!"+PREVIOUS_SIBLING+"&&!"+NEXT_SIBLING+"&&",":first-of-type":NOT_PREVIOUS_BY_TYPE,":last-of-type":NOT_NEXT_BY_TYPE,":only-of-type":NOT_PREVIOUS_BY_TYPE+NOT_NEXT_BY_TYPE,":empty":"IE7._isEmpty(e)&&",":root":"e==R&&",":target":"H&&"+ID_ATTRIBUTE+"===H&&"});var HTML5="article,aside,audio,canvas,details,figcaption,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(",");for(var i= | ||
380 | 103 | 0,tagName;tagName=HTML5[i];i++)document.createElement(tagName);HEADER+="datalist{display:none}details{padding-left:40px;display:block;margin:1em 0}meter,progress{vertical-align:-0.2em;width:5em;height:1em;display:inline-block}progress{width:10em;}article,aside,figcaption,footer,header,hgroup,summary,section,nav{display:block;margin:1em 0}figure{margin:1em 40px;display:block}mark{background:yellow}";IE7.CSS.addFix(/\bopacity\s*:\s*([\d.]+)/,function(match,value){return"zoom:1;filter:Alpha(opacity="+ | ||
381 | 104 | (value*100||1)+")"});var MATCHER;var cssQuery=function(){var CONTEXT=/^[>+~]/;var useContext=false;function cssQuery(selector,context,single){selector=trim(selector);if(!context)context=document;var ref=context;useContext=CONTEXT.test(selector);if(useContext){context=context.parentNode;selector="*"+selector}try{return selectQuery.create(selector,useContext)(context,single?null:[],ref)}catch(ex){return single?null:[]}}var VALID_SELECTOR=/^(\\.|[' >+~#.\[\]:*(),\w-\^|$=]|[^\x00-\xa0])+$/;var _EVALUATED= | ||
382 | 105 | /^(href|src)$/;var _ATTRIBUTES={"class":"className","for":"htmlFor"};var IE7_CLASS_NAMES=/\sie7_\w+/g;var USE_IFLAG=/^(action|cite|codebase|data|dynsrc|href|longdesc|lowsrc|src|usemap|url)$/i;IE7._getAttribute=function(element,name){if(element.getAttributeNode)var attribute=element.getAttributeNode(name);name=_ATTRIBUTES[name.toLowerCase()]||name;if(!attribute)attribute=element.attributes[name];var specified=attribute&&attribute.specified;if(element[name]&&typeof element[name]=="boolean")return name.toLowerCase(); | ||
383 | 106 | if(specified&&USE_IFLAG.test(name)||!attribute&&MSIE5||name==="value"||name==="type")return element.getAttribute(name,2);if(name==="style")return element.style.cssText.toLowerCase()||null;return specified?String(attribute.nodeValue):null};var names="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";extend(_ATTRIBUTES,combine(names.toLowerCase().split(","),names.split(",")));IE7._getElementSibling=function(node,direction){direction+="Sibling";do{node=node[direction]; | ||
384 | 107 | if(node&&node.nodeName>"@")break}while(node);return node};var IMPLIED_ASTERISK=/(^|[, >+~])([#.:\[])/g,BLOCKS=/\)\{/g,COMMA=/,/,QUOTED=/^['"]/,HEX_ESCAPE=/\\([\da-f]{2,2})/gi,LAST_CHILD=/last/i;IE7._byId=function(document,id){var result=document.all[id]||null;if(!result||result.nodeType&&IE7._getAttribute(result,"id")===id)return result;for(var i=0;i<result.length;i++)if(IE7._getAttribute(result[i],"id")===id)return result[i];return null};var CSSSelectorParser=RegGrp.extend({dictionary:new Dictionary({ident:/\-?(\\.|[_a-z]|[^\x00-\xa0])(\\.|[\w-]|[^\x00-\xa0])*/, | ||
385 | 108 | combinator:/[\s>+~]/,operator:/[\^~|$*]?=/,nth_arg:/[+-]?\d+|[+-]?\d*n(?:\s*[+-]\s*\d+)?|even|odd/,tag:/\*|<#ident>/,id:/#(<#ident>)/,"class":/\.(<#ident>)/,pseudo:/\:([\w-]+)(?:\(([^)]+)\))?/,attr:/\[(<#ident>)(?:(<#operator>)((?:\\.|[^\[\]#.:])+))?\]/,negation:/:not\((<#tag>|<#id>|<#class>|<#attr>|<#pseudo>)\)/,sequence:/(\\.|[~*]=|\+\d|\+?\d*n\s*\+\s*\d|[^\s>+~,\*])+/,filter:/[#.:\[]<#sequence>/,selector:/[^>+~](\\.|[^,])*?/,grammar:/^(<#selector>)((,<#selector>)*)$/}),ignoreCase:true});var normalizer= | ||
386 | 109 | new CSSSelectorParser({"\\\\.|[~*]\\s+=|\\+\\s+\\d":RegGrp.IGNORE,"\\[\\s+":"[","\\(\\s+":"(","\\s+\\)":")","\\s+\\]":"]","\\s*([,>+~]|<#operator>)\\s*":"$1","\\s+$":"","\\s+":" "});function normalize(selector){selector=normalizer.parse(selector.replace(HEX_ESCAPE,"\\x$1")).replace(UNESCAPE,"$1").replace(IMPLIED_ASTERISK,"$1*$2");if(!VALID_SELECTOR.test(selector))throwSelectorError();return selector}function unescape(query){return query.replace(ESCAPED,unescapeString)}function unescapeString(match, | ||
387 | 110 | index){return strings[index]}var BRACES=/\{/g,BRACES_ESCAPED=/\\{/g;function closeBlock(group){return Array((group.replace(BRACES_ESCAPED,"").match(BRACES)||"").length+1).join("}")}FILTER=new CSSSelectorParser(FILTER);var TARGET=/:target/i,ROOT=/:root/i;function getConstants(selector){var constants="";if(ROOT.test(selector))constants+=",R=d.documentElement";if(TARGET.test(selector))constants+=",H=d.location;H=H&&H.hash.replace('#','')";if(constants||selector.indexOf("#")!==-1)constants=",t=c.nodeType,d=t===9?c:c.ownerDocument||(c.document||c).parentWindow.document"+ | ||
388 | 111 | constants;return"var ii"+constants+";"}var COMBINATOR={" ":";while(e!=s&&(e=e.parentNode)&&e.nodeType===1){",">":".parentElement;if(e){","+":";while((e=e.previousSibling)&&!("+IS_ELEMENT+"))continue;if(e){","~":";while((e=e.previousSibling)){"+IF_ELEMENT};var TOKEN=/\be\b/g;MATCHER=new CSSSelectorParser({"(?:(<#selector>)(<#combinator>))?(<#tag>)(<#filter>)?$":function(match,before,combinator,tag,filters){var group="";if(tag!=="*"){var TAG=tag.toUpperCase();group+="if(e.nodeName==='"+TAG+(TAG===tag? | ||
389 | 112 | "":"'||e.nodeName==='"+tag)+"'){"}if(filters)group+="if("+FILTER.parse(filters).slice(0,-2)+"){";group=group.replace(TOKEN,"e"+this.index);if(combinator){group+="var e=e"+this.index++ +COMBINATOR[combinator];group=group.replace(TOKEN,"e"+this.index)}if(before)group+=this.parse(before);return group}});var BY_ID="e0=IE7._byId(d,'%1');if(e0){",BY_TAG_NAME="var n=c.getElementsByTagName('%1');",STORE="if(r==null)return e0;r[k++]=e0;";var TAG_NAME=1;var SELECTOR=new CSSSelectorParser({"^((?:<#selector>)?(?:<#combinator>))(<#tag>)(<#filter>)?$":true}); | ||
390 | 113 | var cache={};var selectById=new CSSSelectorParser({"^(<#tag>)#(<#ident>)(<#filter>)?( [^,]*)?$":function(match,tagName,id,filters,after){var block=format(BY_ID,id),endBlock="}";if(filters){block+=MATCHER.parse(tagName+filters);endBlock=closeBlock(block)}if(after)block+="s=c=e0;"+selectQuery.parse("*"+after);else block+=STORE;return block+endBlock},"^([^#,]+)#(<#ident>)(<#filter>)?$":function(match,before,id,filters){var block=format(BY_ID,id);if(before==="*")block+=STORE;else block+=MATCHER.parse(before+ | ||
391 | 114 | filters)+STORE+"break";return block+closeBlock(block)},"^.*$":""});var selectQuery=new CSSSelectorParser({"<#grammar>":function(match,selector,remainingSelectors){if(!this.groups)this.groups=[];var group=SELECTOR.exec(" "+selector);if(!group)throwSelectorError();this.groups.push(group.slice(1));if(remainingSelectors)return this.parse(remainingSelectors.replace(COMMA,""));var groups=this.groups,tagName=groups[0][TAG_NAME];for(var i=1;group=groups[i];i++)if(tagName!==group[TAG_NAME]){tagName="*";break}var matcher= | ||
392 | 115 | "",store=STORE+"continue filtering;";for(var i=0;group=groups[i];i++){MATCHER.index=0;if(tagName!=="*")group[TAG_NAME]="*";group=group.join("");if(group===" *"){matcher=store;break}else{group=MATCHER.parse(group);if(useContext)group+="if(e"+MATCHER.index+"==s){";matcher+=group+store+closeBlock(group)}}var isWild=tagName==="*";return(isWild?"var n=c.all;":format(BY_TAG_NAME,tagName))+"filtering:while((e0=n[i++]))"+(isWild?IF_ELEMENT.replace(TOKEN,"e0"):"{")+matcher+"}"},"^.*$":throwSelectorError}); | ||
393 | 116 | var REDUNDANT_NODETYPE_CHECKS=/\&\&(e\d+)\.nodeType===1(\)\{\s*if\(\1\.nodeName=)/g;selectQuery.create=function(selector){if(!cache[selector]){selector=normalize(selector);this.groups=null;MATCHER.index=0;var block=this.parse(selector);this.groups=null;MATCHER.index=0;if(selector.indexOf("#")!==-1){var byId=selectById.parse(selector);if(byId)block="if(t===1||t===11|!c.getElementById){"+block+"}else{"+byId+"}"}block=block.replace(REDUNDANT_NODETYPE_CHECKS,"$2");block=getConstants(selector)+decode(block); | ||
394 | 117 | cache[selector]=(new Function("return function(c,r,s){var i=0,k=0,e0;"+block+"return r}"))()}return cache[selector]};return cssQuery}();function throwSelectorError(){throw new SyntaxError("Invalid selector.");}IE7.loaded=true;(function(){try{if(!document.body)throw"continue";documentElement.doScroll("left")}catch(ex){setTimeout(arguments.callee,1);return}try{eval(script.innerHTML)}catch(ex){}if(typeof IE7_PNG_SUFFIX=="object")PNG=IE7_PNG_SUFFIX;else PNG=new RegExp(rescape(window.IE7_PNG_SUFFIX||"-trans.png")+ | ||
395 | 118 | "(\\?.*)?$","i");body=document.body;viewport=MSIE5?body:documentElement;body.className+=" ie7_body";documentElement.className+=" ie7_html";if(MSIE5)ie7Quirks();IE7.CSS.init();IE7.HTML.init();IE7.HTML.apply();IE7.CSS.apply();IE7.recalc()})()})(this,document); | ||
396 | 0 | \ No newline at end of file | 119 | \ No newline at end of file |
397 | 1 | 120 | ||
398 | === added file 'media/js/polyfills/IE9/LICENSE' | |||
399 | --- media/js/polyfills/IE9/LICENSE 1970-01-01 00:00:00 +0000 | |||
400 | +++ media/js/polyfills/IE9/LICENSE 2012-03-26 20:23:22 +0000 | |||
401 | @@ -0,0 +1,21 @@ | |||
402 | 1 | The MIT License | ||
403 | 2 | |||
404 | 3 | Copyright (c) 2004-2010 Dean Edwards | ||
405 | 4 | |||
406 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
407 | 6 | of this software and associated documentation files (the "Software"), to deal | ||
408 | 7 | in the Software without restriction, including without limitation the rights | ||
409 | 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
410 | 9 | copies of the Software, and to permit persons to whom the Software is | ||
411 | 10 | furnished to do so, subject to the following conditions: | ||
412 | 11 | |||
413 | 12 | The above copyright notice and this permission notice shall be included in | ||
414 | 13 | all copies or substantial portions of the Software. | ||
415 | 14 | |||
416 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
417 | 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
418 | 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
419 | 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
420 | 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
421 | 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
422 | 21 | THE SOFTWARE. | ||
423 | 0 | 22 | ||
424 | === added file 'media/js/polyfills/IE9/blank.gif' | |||
425 | 1 | Binary files media/js/polyfills/IE9/blank.gif 1970-01-01 00:00:00 +0000 and media/js/polyfills/IE9/blank.gif 2012-03-26 20:23:22 +0000 differ | 23 | Binary files media/js/polyfills/IE9/blank.gif 1970-01-01 00:00:00 +0000 and media/js/polyfills/IE9/blank.gif 2012-03-26 20:23:22 +0000 differ |
426 | === added file 'media/js/polyfills/IE9/squish.js' | |||
427 | --- media/js/polyfills/IE9/squish.js 1970-01-01 00:00:00 +0000 | |||
428 | +++ media/js/polyfills/IE9/squish.js 2012-03-26 20:23:22 +0000 | |||
429 | @@ -0,0 +1,1 @@ | |||
430 | 1 | if(IE7.loaded&&IE7.appVersion<7){IE7.CSS.addFix(/(float\s*:\s*(left|right))/,"display:inline;$1");if(IE7.appVersion>=6)IE7.CSS.addRecalc("float","(left|right)",function(element){IE7.Layout.boxSizing(element.parentElement);element.style.display="inline"});IE7.CSS.addRecalc("position","absolute|fixed",function(element){if(element.offsetParent&&element.offsetParent.currentStyle.position==="relative")IE7.Layout.boxSizing(element.offsetParent)})}; | ||
431 | 0 | \ No newline at end of file | 2 | \ No newline at end of file |
432 | 1 | 3 | ||
433 | === added directory 'media/js/polyfills/IE9/src' | |||
434 | === added file 'media/js/polyfills/IE9/src/IE9.src.js' | |||
435 | --- media/js/polyfills/IE9/src/IE9.src.js 1970-01-01 00:00:00 +0000 | |||
436 | +++ media/js/polyfills/IE9/src/IE9.src.js 2012-03-26 20:23:22 +0000 | |||
437 | @@ -0,0 +1,2901 @@ | |||
438 | 1 | /* | ||
439 | 2 | IE7/IE8/IE9.js - copyright 2004-2010, Dean Edwards | ||
440 | 3 | http://code.google.com/p/ie7-js/ | ||
441 | 4 | http://www.opensource.org/licenses/mit-license.php | ||
442 | 5 | */ | ||
443 | 6 | |||
444 | 7 | /* W3C compliance for Microsoft Internet Explorer */ | ||
445 | 8 | |||
446 | 9 | /* credits/thanks: | ||
447 | 10 | Shaggy, Martijn Wargers, Jimmy Cerra, Mark D Anderson, | ||
448 | 11 | Lars Dieckow, Erik Arvidsson, Gellért Gyuris, James Denny, | ||
449 | 12 | Unknown W Brackets, Benjamin Westfarer, Rob Eberhardt, | ||
450 | 13 | Bill Edney, Kevin Newman, James Crompton, Matthew Mastracci, | ||
451 | 14 | Doug Wright, Richard York, Kenneth Kolano, MegaZone, | ||
452 | 15 | Thomas Verelst, Mark 'Tarquin' Wilton-Jones, Rainer Ã…hlfors, | ||
453 | 16 | David Zulaica, Ken Kolano, Kevin Newman, Sjoerd Visscher, | ||
454 | 17 | Ingo Chao | ||
455 | 18 | */ | ||
456 | 19 | |||
457 | 20 | // timestamp: Fri, 30 Apr 2010 20:59:18 | ||
458 | 21 | |||
459 | 22 | (function(window, document) { | ||
460 | 23 | |||
461 | 24 | var IE7 = window.IE7 = { | ||
462 | 25 | version: "2.1(beta4)", | ||
463 | 26 | toString: K("[IE7]") | ||
464 | 27 | }; | ||
465 | 28 | IE7.compat = 9; | ||
466 | 29 | var appVersion = IE7.appVersion = navigator.appVersion.match(/MSIE (\d\.\d)/)[1] - 0; | ||
467 | 30 | |||
468 | 31 | if (/ie7_off/.test(top.location.search) || appVersion < 5.5 || appVersion >= IE7.compat) return; | ||
469 | 32 | |||
470 | 33 | var MSIE5 = appVersion < 6; | ||
471 | 34 | |||
472 | 35 | var Undefined = K(); | ||
473 | 36 | var documentElement = document.documentElement, body, viewport; | ||
474 | 37 | var ANON = "!"; | ||
475 | 38 | var HEADER = ":link{ie7-link:link}:visited{ie7-link:visited}"; | ||
476 | 39 | |||
477 | 40 | // ----------------------------------------------------------------------- | ||
478 | 41 | // external | ||
479 | 42 | // ----------------------------------------------------------------------- | ||
480 | 43 | |||
481 | 44 | var RELATIVE = /^[\w\.]+[^:]*$/; | ||
482 | 45 | function makePath(href, path) { | ||
483 | 46 | if (RELATIVE.test(href)) href = (path || "") + href; | ||
484 | 47 | return href; | ||
485 | 48 | }; | ||
486 | 49 | |||
487 | 50 | function getPath(href, path) { | ||
488 | 51 | href = makePath(href, path); | ||
489 | 52 | return href.slice(0, href.lastIndexOf("/") + 1); | ||
490 | 53 | }; | ||
491 | 54 | |||
492 | 55 | // Get the path to this script | ||
493 | 56 | var script = document.scripts[document.scripts.length - 1]; | ||
494 | 57 | var path = getPath(script.src); | ||
495 | 58 | |||
496 | 59 | // Use microsoft's http request object to load external files | ||
497 | 60 | try { | ||
498 | 61 | var httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); | ||
499 | 62 | } catch (ex) { | ||
500 | 63 | // ActiveX disabled | ||
501 | 64 | } | ||
502 | 65 | |||
503 | 66 | var fileCache = {}; | ||
504 | 67 | function loadFile(href, path) { | ||
505 | 68 | try { | ||
506 | 69 | href = makePath(href, path); | ||
507 | 70 | if (!fileCache[href]) { | ||
508 | 71 | httpRequest.open("GET", href, false); | ||
509 | 72 | httpRequest.send(); | ||
510 | 73 | if (httpRequest.status == 0 || httpRequest.status == 200) { | ||
511 | 74 | fileCache[href] = httpRequest.responseText; | ||
512 | 75 | } | ||
513 | 76 | } | ||
514 | 77 | } catch (ex) { | ||
515 | 78 | // ignore errors | ||
516 | 79 | } | ||
517 | 80 | return fileCache[href] || ""; | ||
518 | 81 | }; | ||
519 | 82 | |||
520 | 83 | // ----------------------------------------------------------------------- | ||
521 | 84 | // OO support | ||
522 | 85 | // ----------------------------------------------------------------------- | ||
523 | 86 | |||
524 | 87 | |||
525 | 88 | // This is a cut-down version of base2 (http://code.google.com/p/base2/) | ||
526 | 89 | |||
527 | 90 | var _slice = Array.prototype.slice; | ||
528 | 91 | |||
529 | 92 | // private | ||
530 | 93 | var _FORMAT = /%([1-9])/g; | ||
531 | 94 | var _LTRIM = /^\s\s*/; | ||
532 | 95 | var _RTRIM = /\s\s*$/; | ||
533 | 96 | var _RESCAPE = /([\/()[\]{}|*+-.,^$?\\])/g; // safe regular expressions | ||
534 | 97 | var _BASE = /\bbase\b/; | ||
535 | 98 | var _HIDDEN = ["constructor", "toString"]; // only override these when prototyping | ||
536 | 99 | |||
537 | 100 | var prototyping; | ||
538 | 101 | |||
539 | 102 | function Base(){}; | ||
540 | 103 | Base.extend = function(_instance, _static) { | ||
541 | 104 | // Build the prototype. | ||
542 | 105 | prototyping = true; | ||
543 | 106 | var _prototype = new this; | ||
544 | 107 | extend(_prototype, _instance); | ||
545 | 108 | prototyping = false; | ||
546 | 109 | |||
547 | 110 | // Create the wrapper for the constructor function. | ||
548 | 111 | var _constructor = _prototype.constructor; | ||
549 | 112 | function klass() { | ||
550 | 113 | // Don't call the constructor function when prototyping. | ||
551 | 114 | if (!prototyping) _constructor.apply(this, arguments); | ||
552 | 115 | }; | ||
553 | 116 | _prototype.constructor = klass; | ||
554 | 117 | |||
555 | 118 | // Build the static interface. | ||
556 | 119 | klass.extend = arguments.callee; | ||
557 | 120 | extend(klass, _static); | ||
558 | 121 | klass.prototype = _prototype; | ||
559 | 122 | return klass; | ||
560 | 123 | }; | ||
561 | 124 | Base.prototype.extend = function(source) { | ||
562 | 125 | return extend(this, source); | ||
563 | 126 | }; | ||
564 | 127 | |||
565 | 128 | |||
566 | 129 | // A collection of regular expressions and their associated replacement values. | ||
567 | 130 | // A Base class for creating parsers. | ||
568 | 131 | |||
569 | 132 | var HASH = "#"; | ||
570 | 133 | var ITEMS = "#"; | ||
571 | 134 | var KEYS = "."; | ||
572 | 135 | var COMPILED = "/"; | ||
573 | 136 | |||
574 | 137 | var REGGRP_BACK_REF = /\\(\d+)/g, | ||
575 | 138 | REGGRP_ESCAPE_COUNT = /\[(\\.|[^\]\\])+\]|\\.|\(\?/g, | ||
576 | 139 | REGGRP_PAREN = /\(/g, | ||
577 | 140 | REGGRP_LOOKUP = /\$(\d+)/, | ||
578 | 141 | REGGRP_LOOKUP_SIMPLE = /^\$\d+$/, | ||
579 | 142 | REGGRP_LOOKUPS = /(\[(\\.|[^\]\\])+\]|\\.|\(\?)|\(/g, | ||
580 | 143 | REGGRP_DICT_ENTRY = /^<#\w+>$/, | ||
581 | 144 | REGGRP_DICT_ENTRIES = /<#(\w+)>/g; | ||
582 | 145 | |||
583 | 146 | var RegGrp = Base.extend({ | ||
584 | 147 | constructor: function(values) { | ||
585 | 148 | this[KEYS] = []; | ||
586 | 149 | this[ITEMS] = {}; | ||
587 | 150 | this.merge(values); | ||
588 | 151 | }, | ||
589 | 152 | |||
590 | 153 | //dictionary: null, | ||
591 | 154 | //ignoreCase: false, | ||
592 | 155 | |||
593 | 156 | add: function(expression, replacement) { | ||
594 | 157 | delete this[COMPILED]; | ||
595 | 158 | if (expression instanceof RegExp) { | ||
596 | 159 | expression = expression.source; | ||
597 | 160 | } | ||
598 | 161 | if (!this[HASH + expression]) this[KEYS].push(String(expression)); | ||
599 | 162 | return this[ITEMS][HASH + expression] = new RegGrp.Item(expression, replacement, this); | ||
600 | 163 | }, | ||
601 | 164 | |||
602 | 165 | compile: function(recompile) { | ||
603 | 166 | if (recompile || !this[COMPILED]) { | ||
604 | 167 | this[COMPILED] = new RegExp(this, this.ignoreCase ? "gi" : "g"); | ||
605 | 168 | } | ||
606 | 169 | return this[COMPILED]; | ||
607 | 170 | }, | ||
608 | 171 | |||
609 | 172 | merge: function(values) { | ||
610 | 173 | for (var i in values) this.add(i, values[i]); | ||
611 | 174 | }, | ||
612 | 175 | |||
613 | 176 | exec: function(string) { | ||
614 | 177 | var group = this, | ||
615 | 178 | patterns = group[KEYS], | ||
616 | 179 | items = group[ITEMS], item; | ||
617 | 180 | var result = this.compile(true).exec(string); | ||
618 | 181 | if (result) { | ||
619 | 182 | // Loop through the RegGrp items. | ||
620 | 183 | var i = 0, offset = 1; | ||
621 | 184 | while ((item = items[HASH + patterns[i++]])) { | ||
622 | 185 | var next = offset + item.length + 1; | ||
623 | 186 | if (result[offset]) { // do we have a result? | ||
624 | 187 | if (item.replacement === 0) { | ||
625 | 188 | return group.exec(string); | ||
626 | 189 | } else { | ||
627 | 190 | var args = result.slice(offset, next), j = args.length; | ||
628 | 191 | while (--j) args[j] = args[j] || ""; // some platforms return null/undefined for non-matching sub-expressions | ||
629 | 192 | args[0] = {match: args[0], item: item}; | ||
630 | 193 | return args; | ||
631 | 194 | } | ||
632 | 195 | } | ||
633 | 196 | offset = next; | ||
634 | 197 | } | ||
635 | 198 | } | ||
636 | 199 | return null; | ||
637 | 200 | }, | ||
638 | 201 | |||
639 | 202 | parse: function(string) { | ||
640 | 203 | string += ""; // type safe | ||
641 | 204 | var group = this, | ||
642 | 205 | patterns = group[KEYS], | ||
643 | 206 | items = group[ITEMS]; | ||
644 | 207 | return string.replace(this.compile(), function(match) { | ||
645 | 208 | var args = [], item, offset = 1, i = arguments.length; | ||
646 | 209 | while (--i) args[i] = arguments[i] || ""; // some platforms return null/undefined for non-matching sub-expressions | ||
647 | 210 | // Loop through the RegGrp items. | ||
648 | 211 | while ((item = items[HASH + patterns[i++]])) { | ||
649 | 212 | var next = offset + item.length + 1; | ||
650 | 213 | if (args[offset]) { // do we have a result? | ||
651 | 214 | var replacement = item.replacement; | ||
652 | 215 | switch (typeof replacement) { | ||
653 | 216 | case "function": | ||
654 | 217 | return replacement.apply(group, args.slice(offset, next)); | ||
655 | 218 | case "number": | ||
656 | 219 | return args[offset + replacement]; | ||
657 | 220 | default: | ||
658 | 221 | return replacement; | ||
659 | 222 | } | ||
660 | 223 | } | ||
661 | 224 | offset = next; | ||
662 | 225 | } | ||
663 | 226 | return match; | ||
664 | 227 | }); | ||
665 | 228 | }, | ||
666 | 229 | |||
667 | 230 | toString: function() { | ||
668 | 231 | var strings = [], | ||
669 | 232 | keys = this[KEYS], | ||
670 | 233 | items = this[ITEMS], item; | ||
671 | 234 | for (var i = 0; item = items[HASH + keys[i]]; i++) { | ||
672 | 235 | strings[i] = item.source; | ||
673 | 236 | } | ||
674 | 237 | return "(" + strings.join(")|(") + ")"; | ||
675 | 238 | } | ||
676 | 239 | }, { | ||
677 | 240 | IGNORE: null, // a null replacement value means that there is no replacement. | ||
678 | 241 | |||
679 | 242 | Item: Base.extend({ | ||
680 | 243 | constructor: function(source, replacement, owner) { | ||
681 | 244 | var length = source.indexOf("(") === -1 ? 0 : RegGrp.count(source); | ||
682 | 245 | |||
683 | 246 | var dictionary = owner.dictionary; | ||
684 | 247 | if (dictionary && source.indexOf("<#") !== -1) { | ||
685 | 248 | if (REGGRP_DICT_ENTRY.test(source)) { | ||
686 | 249 | var entry = dictionary[ITEMS][HASH + source.slice(2, -1)]; | ||
687 | 250 | source = entry.replacement; | ||
688 | 251 | length = entry._length; | ||
689 | 252 | } else { | ||
690 | 253 | source = dictionary.parse(source); | ||
691 | 254 | } | ||
692 | 255 | } | ||
693 | 256 | |||
694 | 257 | if (typeof replacement == "number") replacement = String(replacement); | ||
695 | 258 | else if (replacement == null) replacement = 0; | ||
696 | 259 | |||
697 | 260 | // Does the expression use sub-expression lookups? | ||
698 | 261 | if (typeof replacement == "string" && REGGRP_LOOKUP.test(replacement)) { | ||
699 | 262 | if (REGGRP_LOOKUP_SIMPLE.test(replacement)) { // A simple lookup? (e.g. "$2"). | ||
700 | 263 | // Store the index (used for fast retrieval of matched strings). | ||
701 | 264 | var index = replacement.slice(1) - 0; | ||
702 | 265 | if (index && index <= length) replacement = index; | ||
703 | 266 | } else { | ||
704 | 267 | // A complicated lookup (e.g. "Hello $2 $1."). | ||
705 | 268 | var lookup = replacement, regexp; | ||
706 | 269 | replacement = function(match) { | ||
707 | 270 | if (!regexp) { | ||
708 | 271 | regexp = new RegExp(source, "g" + (this.ignoreCase ? "i": "")); | ||
709 | 272 | } | ||
710 | 273 | return match.replace(regexp, lookup); | ||
711 | 274 | }; | ||
712 | 275 | } | ||
713 | 276 | } | ||
714 | 277 | |||
715 | 278 | this.length = length; | ||
716 | 279 | this.source = String(source); | ||
717 | 280 | this.replacement = replacement; | ||
718 | 281 | } | ||
719 | 282 | }), | ||
720 | 283 | |||
721 | 284 | count: function(expression) { | ||
722 | 285 | return (String(expression).replace(REGGRP_ESCAPE_COUNT, "").match(REGGRP_PAREN) || "").length; | ||
723 | 286 | } | ||
724 | 287 | }); | ||
725 | 288 | |||
726 | 289 | var Dictionary = RegGrp.extend({ | ||
727 | 290 | parse: function(phrase) { | ||
728 | 291 | // Prevent sub-expressions in dictionary entries from capturing. | ||
729 | 292 | var entries = this[ITEMS]; | ||
730 | 293 | return phrase.replace(REGGRP_DICT_ENTRIES, function(match, entry) { | ||
731 | 294 | entry = entries[HASH + entry]; | ||
732 | 295 | return entry ? entry._nonCapturing : match; | ||
733 | 296 | }); | ||
734 | 297 | }, | ||
735 | 298 | |||
736 | 299 | add: function(expression, replacement) { | ||
737 | 300 | // Get the underlying replacement value. | ||
738 | 301 | if (replacement instanceof RegExp) { | ||
739 | 302 | replacement = replacement.source; | ||
740 | 303 | } | ||
741 | 304 | // Translate the replacement. | ||
742 | 305 | // The result is the original replacement recursively parsed by this dictionary. | ||
743 | 306 | var nonCapturing = replacement.replace(REGGRP_LOOKUPS, _nonCapture); | ||
744 | 307 | if (replacement.indexOf("(") !== -1) { | ||
745 | 308 | var realLength = RegGrp.count(replacement); | ||
746 | 309 | } | ||
747 | 310 | if (replacement.indexOf("<#") !== -1) { | ||
748 | 311 | replacement = this.parse(replacement); | ||
749 | 312 | nonCapturing = this.parse(nonCapturing); | ||
750 | 313 | } | ||
751 | 314 | var item = this.base(expression, replacement); | ||
752 | 315 | item._nonCapturing = nonCapturing; | ||
753 | 316 | item._length = realLength || item.length; // underlying number of sub-groups | ||
754 | 317 | return item; | ||
755 | 318 | }, | ||
756 | 319 | |||
757 | 320 | toString: function() { | ||
758 | 321 | return "(<#" + this[PATTERNS].join(">)|(<#") + ">)"; | ||
759 | 322 | } | ||
760 | 323 | }); | ||
761 | 324 | |||
762 | 325 | function _nonCapture(match, escaped) { | ||
763 | 326 | return escaped || "(?:"; // non-capturing | ||
764 | 327 | }; | ||
765 | 328 | |||
766 | 329 | // ========================================================================= | ||
767 | 330 | // lang/extend.js | ||
768 | 331 | // ========================================================================= | ||
769 | 332 | |||
770 | 333 | function extend(object, source) { // or extend(object, key, value) | ||
771 | 334 | if (object && source) { | ||
772 | 335 | var proto = (typeof source == "function" ? Function : Object).prototype; | ||
773 | 336 | // Add constructor, toString etc | ||
774 | 337 | var i = _HIDDEN.length, key; | ||
775 | 338 | if (prototyping) while (key = _HIDDEN[--i]) { | ||
776 | 339 | var value = source[key]; | ||
777 | 340 | if (value != proto[key]) { | ||
778 | 341 | if (_BASE.test(value)) { | ||
779 | 342 | _override(object, key, value) | ||
780 | 343 | } else { | ||
781 | 344 | object[key] = value; | ||
782 | 345 | } | ||
783 | 346 | } | ||
784 | 347 | } | ||
785 | 348 | // Copy each of the source object's properties to the target object. | ||
786 | 349 | for (key in source) if (typeof proto[key] == "undefined") { | ||
787 | 350 | var value = source[key]; | ||
788 | 351 | // Check for method overriding. | ||
789 | 352 | if (object[key] && typeof value == "function" && _BASE.test(value)) { | ||
790 | 353 | _override(object, key, value); | ||
791 | 354 | } else { | ||
792 | 355 | object[key] = value; | ||
793 | 356 | } | ||
794 | 357 | } | ||
795 | 358 | } | ||
796 | 359 | return object; | ||
797 | 360 | }; | ||
798 | 361 | |||
799 | 362 | function _override(object, name, method) { | ||
800 | 363 | // Override an existing method. | ||
801 | 364 | var ancestor = object[name]; | ||
802 | 365 | object[name] = function() { | ||
803 | 366 | var previous = this.base; | ||
804 | 367 | this.base = ancestor; | ||
805 | 368 | var returnValue = method.apply(this, arguments); | ||
806 | 369 | this.base = previous; | ||
807 | 370 | return returnValue; | ||
808 | 371 | }; | ||
809 | 372 | }; | ||
810 | 373 | |||
811 | 374 | function combine(keys, values) { | ||
812 | 375 | // Combine two arrays to make a hash. | ||
813 | 376 | if (!values) values = keys; | ||
814 | 377 | var hash = {}; | ||
815 | 378 | for (var i in keys) hash[i] = values[i]; | ||
816 | 379 | return hash; | ||
817 | 380 | }; | ||
818 | 381 | |||
819 | 382 | function format(string) { | ||
820 | 383 | // Replace %n with arguments[n]. | ||
821 | 384 | // e.g. format("%1 %2%3 %2a %1%3", "she", "se", "lls"); | ||
822 | 385 | // ==> "she sells sea shells" | ||
823 | 386 | // Only %1 - %9 supported. | ||
824 | 387 | var args = arguments; | ||
825 | 388 | var _FORMAT = new RegExp("%([1-" + arguments.length + "])", "g"); | ||
826 | 389 | return String(string).replace(_FORMAT, function(match, index) { | ||
827 | 390 | return index < args.length ? args[index] : match; | ||
828 | 391 | }); | ||
829 | 392 | }; | ||
830 | 393 | |||
831 | 394 | function match(string, expression) { | ||
832 | 395 | // Same as String.match() except that this function will return an empty | ||
833 | 396 | // array if there is no match. | ||
834 | 397 | return String(string).match(expression) || []; | ||
835 | 398 | }; | ||
836 | 399 | |||
837 | 400 | function rescape(string) { | ||
838 | 401 | // Make a string safe for creating a RegExp. | ||
839 | 402 | return String(string).replace(_RESCAPE, "\\$1"); | ||
840 | 403 | }; | ||
841 | 404 | |||
842 | 405 | // http://blog.stevenlevithan.com/archives/faster-trim-javascript | ||
843 | 406 | function trim(string) { | ||
844 | 407 | return String(string).replace(_LTRIM, "").replace(_RTRIM, ""); | ||
845 | 408 | }; | ||
846 | 409 | |||
847 | 410 | function K(k) { | ||
848 | 411 | return function() { | ||
849 | 412 | return k; | ||
850 | 413 | }; | ||
851 | 414 | }; | ||
852 | 415 | |||
853 | 416 | // ----------------------------------------------------------------------- | ||
854 | 417 | // parsing | ||
855 | 418 | // ----------------------------------------------------------------------- | ||
856 | 419 | |||
857 | 420 | var Parser = RegGrp.extend({ignoreCase: true}); | ||
858 | 421 | |||
859 | 422 | var SINGLE_QUOTES = /'/g, | ||
860 | 423 | ESCAPED = /'(\d+)'/g, | ||
861 | 424 | ESCAPE = /\\/g, | ||
862 | 425 | UNESCAPE = /\\([nrtf'"])/g; | ||
863 | 426 | |||
864 | 427 | var strings = []; | ||
865 | 428 | |||
866 | 429 | var encoder = new Parser({ | ||
867 | 430 | // comments | ||
868 | 431 | "<!\\-\\-|\\-\\->": "", | ||
869 | 432 | "\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\/": "", | ||
870 | 433 | // get rid | ||
871 | 434 | "@(namespace|import)[^;\\n]+[;\\n]": "", | ||
872 | 435 | // strings | ||
873 | 436 | "'(\\\\.|[^'\\\\])*'": encodeString, | ||
874 | 437 | '"(\\\\.|[^"\\\\])*"': encodeString, | ||
875 | 438 | // white space | ||
876 | 439 | "\\s+": " " | ||
877 | 440 | }); | ||
878 | 441 | |||
879 | 442 | function encode(selector) { | ||
880 | 443 | return encoder.parse(selector).replace(UNESCAPE, "$1"); | ||
881 | 444 | }; | ||
882 | 445 | |||
883 | 446 | function decode(query) { | ||
884 | 447 | // put string values back | ||
885 | 448 | return query.replace(ESCAPED, decodeString); | ||
886 | 449 | }; | ||
887 | 450 | |||
888 | 451 | function encodeString(string) { | ||
889 | 452 | var index = strings.length; | ||
890 | 453 | strings[index] = string.slice(1, -1) | ||
891 | 454 | .replace(UNESCAPE, "$1") | ||
892 | 455 | .replace(SINGLE_QUOTES, "\\'"); | ||
893 | 456 | return "'" + index + "'"; | ||
894 | 457 | }; | ||
895 | 458 | |||
896 | 459 | function decodeString(match, index) { | ||
897 | 460 | var string = strings[index]; | ||
898 | 461 | if (string == null) return match; | ||
899 | 462 | return "'" + strings[index] + "'"; | ||
900 | 463 | }; | ||
901 | 464 | |||
902 | 465 | function getString(value) { | ||
903 | 466 | return value.indexOf("'") === 0 ? strings[value.slice(1, - 1)] : value; | ||
904 | 467 | }; | ||
905 | 468 | |||
906 | 469 | // clone a "width" function to create a "height" function | ||
907 | 470 | var rotater = new RegGrp({ | ||
908 | 471 | Width: "Height", | ||
909 | 472 | width: "height", | ||
910 | 473 | Left: "Top", | ||
911 | 474 | left: "top", | ||
912 | 475 | Right: "Bottom", | ||
913 | 476 | right: "bottom", | ||
914 | 477 | onX: "onY" | ||
915 | 478 | }); | ||
916 | 479 | |||
917 | 480 | function rotate(fn) { | ||
918 | 481 | return rotater.parse(fn); | ||
919 | 482 | }; | ||
920 | 483 | |||
921 | 484 | // ----------------------------------------------------------------------- | ||
922 | 485 | // event handling | ||
923 | 486 | // ----------------------------------------------------------------------- | ||
924 | 487 | |||
925 | 488 | var eventHandlers = []; | ||
926 | 489 | |||
927 | 490 | function addResize(handler) { | ||
928 | 491 | addRecalc(handler); | ||
929 | 492 | addEventHandler(window, "onresize", handler); | ||
930 | 493 | }; | ||
931 | 494 | |||
932 | 495 | // add an event handler (function) to an element | ||
933 | 496 | function addEventHandler(element, type, handler) { | ||
934 | 497 | element.attachEvent(type, handler); | ||
935 | 498 | // store the handler so it can be detached later | ||
936 | 499 | eventHandlers.push(arguments); | ||
937 | 500 | }; | ||
938 | 501 | |||
939 | 502 | // remove an event handler assigned to an element by IE7 | ||
940 | 503 | function removeEventHandler(element, type, handler) { | ||
941 | 504 | try { | ||
942 | 505 | element.detachEvent(type, handler); | ||
943 | 506 | } catch (ex) { | ||
944 | 507 | // write a letter of complaint to microsoft.. | ||
945 | 508 | } | ||
946 | 509 | }; | ||
947 | 510 | |||
948 | 511 | // remove event handlers (they eat memory) | ||
949 | 512 | addEventHandler(window, "onunload", function() { | ||
950 | 513 | var handler; | ||
951 | 514 | while (handler = eventHandlers.pop()) { | ||
952 | 515 | removeEventHandler(handler[0], handler[1], handler[2]); | ||
953 | 516 | } | ||
954 | 517 | }); | ||
955 | 518 | |||
956 | 519 | function register(handler, element, condition) { // -@DRE | ||
957 | 520 | //var set = handler[element.uniqueID]; | ||
958 | 521 | if (!handler.elements) handler.elements = {}; | ||
959 | 522 | if (condition) handler.elements[element.uniqueID] = element; | ||
960 | 523 | else delete handler.elements[element.uniqueID]; | ||
961 | 524 | //return !set && condition; | ||
962 | 525 | return condition; | ||
963 | 526 | }; | ||
964 | 527 | |||
965 | 528 | addEventHandler(window, "onbeforeprint", function() { | ||
966 | 529 | if (!IE7.CSS.print) new StyleSheet("print"); | ||
967 | 530 | IE7.CSS.print.recalc(); | ||
968 | 531 | }); | ||
969 | 532 | |||
970 | 533 | // ----------------------------------------------------------------------- | ||
971 | 534 | // pixel conversion | ||
972 | 535 | // ----------------------------------------------------------------------- | ||
973 | 536 | |||
974 | 537 | // this is handy because it means that web developers can mix and match | ||
975 | 538 | // measurement units in their style sheets. it is not uncommon to | ||
976 | 539 | // express something like padding in "em" units whilst border thickness | ||
977 | 540 | // is most often expressed in pixels. | ||
978 | 541 | |||
979 | 542 | var PIXEL = /^\d+(px)?$/i; | ||
980 | 543 | var PERCENT = /^\d+%$/; | ||
981 | 544 | var getPixelValue = function(element, value) { | ||
982 | 545 | if (PIXEL.test(value)) return parseInt(value); | ||
983 | 546 | var style = element.style.left; | ||
984 | 547 | var runtimeStyle = element.runtimeStyle.left; | ||
985 | 548 | element.runtimeStyle.left = element.currentStyle.left; | ||
986 | 549 | element.style.left = value || 0; | ||
987 | 550 | value = element.style.pixelLeft; | ||
988 | 551 | element.style.left = style; | ||
989 | 552 | element.runtimeStyle.left = runtimeStyle; | ||
990 | 553 | return value; | ||
991 | 554 | }; | ||
992 | 555 | |||
993 | 556 | // ----------------------------------------------------------------------- | ||
994 | 557 | // generic | ||
995 | 558 | // ----------------------------------------------------------------------- | ||
996 | 559 | |||
997 | 560 | var $IE7 = "ie7-"; | ||
998 | 561 | |||
999 | 562 | var Fix = Base.extend({ | ||
1000 | 563 | constructor: function() { | ||
1001 | 564 | this.fixes = []; | ||
1002 | 565 | this.recalcs = []; | ||
1003 | 566 | }, | ||
1004 | 567 | init: Undefined | ||
1005 | 568 | }); | ||
1006 | 569 | |||
1007 | 570 | // a store for functions that will be called when refreshing IE7 | ||
1008 | 571 | var recalcs = []; | ||
1009 | 572 | function addRecalc(recalc) { | ||
1010 | 573 | recalcs.push(recalc); | ||
1011 | 574 | }; | ||
1012 | 575 | |||
1013 | 576 | IE7.recalc = function() { | ||
1014 | 577 | IE7.HTML.recalc(); | ||
1015 | 578 | // re-apply style sheet rules (re-calculate ie7 classes) | ||
1016 | 579 | IE7.CSS.recalc(); | ||
1017 | 580 | // apply global fixes to the document | ||
1018 | 581 | for (var i = 0; i < recalcs.length; i++) recalcs[i](); | ||
1019 | 582 | }; | ||
1020 | 583 | |||
1021 | 584 | function isFixed(element) { | ||
1022 | 585 | return element.currentStyle["ie7-position"] == "fixed"; | ||
1023 | 586 | }; | ||
1024 | 587 | |||
1025 | 588 | // original style | ||
1026 | 589 | function getDefinedStyle(element, propertyName) { | ||
1027 | 590 | return element.currentStyle[$IE7 + propertyName] || element.currentStyle[propertyName]; | ||
1028 | 591 | }; | ||
1029 | 592 | |||
1030 | 593 | function setOverrideStyle(element, propertyName, value) { | ||
1031 | 594 | if (element.currentStyle[$IE7 + propertyName] == null) { | ||
1032 | 595 | element.runtimeStyle[$IE7 + propertyName] = element.currentStyle[propertyName]; | ||
1033 | 596 | } | ||
1034 | 597 | element.runtimeStyle[propertyName] = value; | ||
1035 | 598 | }; | ||
1036 | 599 | |||
1037 | 600 | // Create a temporary element which is used to inherit styles | ||
1038 | 601 | // from the target element. | ||
1039 | 602 | function createTempElement(tagName) { | ||
1040 | 603 | var element = document.createElement(tagName || "object"); | ||
1041 | 604 | element.style.cssText = "position:absolute;padding:0;display:block;border:none;clip:rect(0 0 0 0);left:-9999"; | ||
1042 | 605 | element.ie7_anon = true; | ||
1043 | 606 | return element; | ||
1044 | 607 | }; | ||
1045 | 608 | |||
1046 | 609 | |||
1047 | 610 | // ========================================================================= | ||
1048 | 611 | // ie7-css.js | ||
1049 | 612 | // ========================================================================= | ||
1050 | 613 | |||
1051 | 614 | var NEXT_SIBLING = "(e.nextSibling&&IE7._getElementSibling(e,'next'))", | ||
1052 | 615 | PREVIOUS_SIBLING = NEXT_SIBLING.replace(/next/g, "previous"), | ||
1053 | 616 | IS_ELEMENT = "e.nodeName>'@'", | ||
1054 | 617 | IF_ELEMENT = "if(" + IS_ELEMENT + "){"; | ||
1055 | 618 | |||
1056 | 619 | var ID_ATTRIBUTE = "(e.nodeName==='FORM'?IE7._getAttribute(e,'id'):e.id)"; | ||
1057 | 620 | |||
1058 | 621 | var HYPERLINK = /a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i; | ||
1059 | 622 | var FIRST_LINE_LETTER = /(.*)(:first-(line|letter))/; | ||
1060 | 623 | var SPACE = /\s/; | ||
1061 | 624 | var RULE = /((?:\\.|[^{\\])+)\{((?:\\.|[^}\\])+)\}/g; | ||
1062 | 625 | var SELECTOR = /(?:\\.|[^,\\])+/g; | ||
1063 | 626 | |||
1064 | 627 | var styleSheets = document.styleSheets; | ||
1065 | 628 | |||
1066 | 629 | var inheritedProperties = []; | ||
1067 | 630 | |||
1068 | 631 | IE7.CSS = new (Fix.extend({ // single instance | ||
1069 | 632 | parser: new Parser, | ||
1070 | 633 | screen: "", | ||
1071 | 634 | print: "", | ||
1072 | 635 | styles: [], | ||
1073 | 636 | rules: [], | ||
1074 | 637 | pseudoClasses: appVersion < 7 ? "first\\-child" : "", | ||
1075 | 638 | dynamicPseudoClasses: { | ||
1076 | 639 | toString: function() { | ||
1077 | 640 | var strings = []; | ||
1078 | 641 | for (var pseudoClass in this) strings.push(pseudoClass); | ||
1079 | 642 | return strings.join("|"); | ||
1080 | 643 | } | ||
1081 | 644 | }, | ||
1082 | 645 | |||
1083 | 646 | init: function() { | ||
1084 | 647 | var NONE = "^\x01$"; | ||
1085 | 648 | var CLASS = "\\[class=?[^\\]]*\\]"; | ||
1086 | 649 | var pseudoClasses = []; | ||
1087 | 650 | if (this.pseudoClasses) pseudoClasses.push(this.pseudoClasses); | ||
1088 | 651 | var dynamicPseudoClasses = this.dynamicPseudoClasses.toString(); | ||
1089 | 652 | if (dynamicPseudoClasses) pseudoClasses.push(dynamicPseudoClasses); | ||
1090 | 653 | pseudoClasses = pseudoClasses.join("|"); | ||
1091 | 654 | var unknown = appVersion < 7 ? ["[>+~\\[(]|([:.])[\\w-]+\\1"] : [CLASS]; | ||
1092 | 655 | if (pseudoClasses) unknown.push(":(" + pseudoClasses + ")"); | ||
1093 | 656 | this.UNKNOWN = new RegExp(unknown.join("|") || NONE, "i"); | ||
1094 | 657 | var complex = appVersion < 7 ? ["\\[[^\\]]+\\]|[^\\s(\\[]+\\s*[+~]"] : [CLASS]; | ||
1095 | 658 | var complexRule = complex.concat(); | ||
1096 | 659 | if (pseudoClasses) complexRule.push(":(" + pseudoClasses + ")"); | ||
1097 | 660 | Rule.COMPLEX = new RegExp(complexRule.join("|") || NONE, "ig"); | ||
1098 | 661 | if (this.pseudoClasses) complex.push(":(" + this.pseudoClasses + ")"); | ||
1099 | 662 | DynamicRule.COMPLEX = new RegExp(complex.join("|") || NONE, "i"); | ||
1100 | 663 | dynamicPseudoClasses = "not\\(:" + dynamicPseudoClasses.split("|").join("\\)|not\\(:") + "\\)|" + dynamicPseudoClasses; | ||
1101 | 664 | DynamicRule.MATCH = new RegExp(dynamicPseudoClasses ? "(.*?):(" + dynamicPseudoClasses + ")(.*)" : NONE, "i"); | ||
1102 | 665 | |||
1103 | 666 | this.createStyleSheet(); | ||
1104 | 667 | this.refresh(); | ||
1105 | 668 | }, | ||
1106 | 669 | |||
1107 | 670 | addEventHandler: function() { | ||
1108 | 671 | addEventHandler.apply(null, arguments); | ||
1109 | 672 | }, | ||
1110 | 673 | |||
1111 | 674 | addFix: function(expression, replacement) { | ||
1112 | 675 | this.parser.add(expression, replacement); | ||
1113 | 676 | }, | ||
1114 | 677 | |||
1115 | 678 | addRecalc: function(propertyName, test, handler, replacement) { | ||
1116 | 679 | // recalcs occur whenever the document is refreshed using document.recalc() | ||
1117 | 680 | propertyName = propertyName.source || propertyName; | ||
1118 | 681 | test = new RegExp("([{;\\s])" + propertyName + "\\s*:\\s*" + test + "[^;}]*"); | ||
1119 | 682 | var id = this.recalcs.length; | ||
1120 | 683 | if (typeof replacement == "string") replacement = propertyName + ":" + replacement; | ||
1121 | 684 | this.addFix(test, function(match) { | ||
1122 | 685 | if (typeof replacement == "function") replacement = replacement(match); | ||
1123 | 686 | return (replacement ? replacement : match) + ";ie7-" + match.slice(1) + ";ie7_recalc" + id + ":1"; | ||
1124 | 687 | }); | ||
1125 | 688 | this.recalcs.push(arguments); | ||
1126 | 689 | return id; | ||
1127 | 690 | }, | ||
1128 | 691 | |||
1129 | 692 | apply: function() { | ||
1130 | 693 | this.getInlineCSS(); | ||
1131 | 694 | new StyleSheet("screen"); | ||
1132 | 695 | this.trash(); | ||
1133 | 696 | }, | ||
1134 | 697 | |||
1135 | 698 | createStyleSheet: function() { | ||
1136 | 699 | // create the IE7 style sheet | ||
1137 | 700 | document.getElementsByTagName("head")[0].appendChild(document.createElement("style")); | ||
1138 | 701 | this.styleSheet = styleSheets[styleSheets.length - 1]; | ||
1139 | 702 | // flag it so we can ignore it during parsing | ||
1140 | 703 | this.styleSheet.ie7 = true; | ||
1141 | 704 | this.styleSheet.owningElement.ie7 = true; | ||
1142 | 705 | this.styleSheet.cssText = HEADER; | ||
1143 | 706 | }, | ||
1144 | 707 | |||
1145 | 708 | getInlineCSS: function() {// load inline styles | ||
1146 | 709 | var styleSheets = document.getElementsByTagName("style"), styleSheet; | ||
1147 | 710 | for (var i = styleSheets.length - 1; styleSheet = styleSheets[i]; i--) { | ||
1148 | 711 | if (!styleSheet.disabled && !styleSheet.ie7) { | ||
1149 | 712 | styleSheet._cssText = styleSheet.innerHTML; | ||
1150 | 713 | } | ||
1151 | 714 | } | ||
1152 | 715 | }, | ||
1153 | 716 | |||
1154 | 717 | getText: function(styleSheet, path) { | ||
1155 | 718 | // Internet Explorer will trash unknown selectors (it converts them to "UNKNOWN"). | ||
1156 | 719 | // So we must reload external style sheets (internal style sheets can have their text | ||
1157 | 720 | // extracted through the innerHTML property). | ||
1158 | 721 | |||
1159 | 722 | // load the style sheet text from an external file | ||
1160 | 723 | try { | ||
1161 | 724 | var cssText = styleSheet.cssText; | ||
1162 | 725 | } catch (e) { | ||
1163 | 726 | cssText = ""; | ||
1164 | 727 | } | ||
1165 | 728 | if (httpRequest) cssText = loadFile(styleSheet.href, path) || cssText; | ||
1166 | 729 | return cssText; | ||
1167 | 730 | }, | ||
1168 | 731 | |||
1169 | 732 | recalc: function() { | ||
1170 | 733 | this.screen.recalc(); | ||
1171 | 734 | // we're going to read through all style rules. | ||
1172 | 735 | // certain rules have had ie7 properties added to them. | ||
1173 | 736 | // e.g. p{top:0; ie7_recalc2:1; left:0} | ||
1174 | 737 | // this flags a property in the rule as needing a fix. | ||
1175 | 738 | // the selector text is then used to query the document. | ||
1176 | 739 | // we can then loop through the results of the query | ||
1177 | 740 | // and fix the elements. | ||
1178 | 741 | // we ignore the IE7 rules - so count them in the header | ||
1179 | 742 | var RECALCS = /ie7_recalc\d+/g; | ||
1180 | 743 | var start = HEADER.match(/[{,]/g).length; | ||
1181 | 744 | // only calculate screen fixes. print fixes don't show up anyway | ||
1182 | 745 | var rules = this.styleSheet.rules, rule; | ||
1183 | 746 | var calcs, calc, elements, element, i, j, k, id; | ||
1184 | 747 | // loop through all rules | ||
1185 | 748 | for (i = start; rule = rules[i]; i++) { | ||
1186 | 749 | var cssText = rule.style.cssText; | ||
1187 | 750 | // search for the "ie7_recalc" flag (there may be more than one) | ||
1188 | 751 | if (calcs = cssText.match(RECALCS)) { | ||
1189 | 752 | // use the selector text to query the document | ||
1190 | 753 | elements = cssQuery(rule.selectorText); | ||
1191 | 754 | // if there are matching elements then loop | ||
1192 | 755 | // through the recalc functions and apply them | ||
1193 | 756 | // to each element | ||
1194 | 757 | if (elements.length) for (j = 0; j < calcs.length; j++) { | ||
1195 | 758 | // get the matching flag (e.g. ie7_recalc3) | ||
1196 | 759 | id = calcs[j]; | ||
1197 | 760 | // extract the numeric id from the end of the flag | ||
1198 | 761 | // and use it to index the collection of recalc | ||
1199 | 762 | // functions | ||
1200 | 763 | calc = IE7.CSS.recalcs[id.slice(10)][2]; | ||
1201 | 764 | for (k = 0; (element = elements[k]); k++) { | ||
1202 | 765 | // apply the fix | ||
1203 | 766 | if (element.currentStyle[id]) calc(element, cssText); | ||
1204 | 767 | } | ||
1205 | 768 | } | ||
1206 | 769 | } | ||
1207 | 770 | } | ||
1208 | 771 | }, | ||
1209 | 772 | |||
1210 | 773 | refresh: function() { | ||
1211 | 774 | this.styleSheet.cssText = HEADER + this.screen + this.print; | ||
1212 | 775 | }, | ||
1213 | 776 | |||
1214 | 777 | trash: function() { | ||
1215 | 778 | // trash the old style sheets | ||
1216 | 779 | for (var i = 0; i < styleSheets.length; i++) { | ||
1217 | 780 | if (!styleSheets[i].ie7) { | ||
1218 | 781 | try { | ||
1219 | 782 | var cssText = styleSheets[i].cssText; | ||
1220 | 783 | } catch (e) { | ||
1221 | 784 | cssText = ""; | ||
1222 | 785 | } | ||
1223 | 786 | if (cssText) styleSheets[i].cssText = ""; | ||
1224 | 787 | } | ||
1225 | 788 | } | ||
1226 | 789 | } | ||
1227 | 790 | })); | ||
1228 | 791 | |||
1229 | 792 | // ----------------------------------------------------------------------- | ||
1230 | 793 | // IE7 StyleSheet class | ||
1231 | 794 | // ----------------------------------------------------------------------- | ||
1232 | 795 | |||
1233 | 796 | var StyleSheet = Base.extend({ | ||
1234 | 797 | constructor: function(media) { | ||
1235 | 798 | this.media = media; | ||
1236 | 799 | this.load(); | ||
1237 | 800 | IE7.CSS[media] = this; | ||
1238 | 801 | IE7.CSS.refresh(); | ||
1239 | 802 | }, | ||
1240 | 803 | |||
1241 | 804 | createRule: function(selector, cssText) { | ||
1242 | 805 | var match; | ||
1243 | 806 | if (PseudoElement && (match = selector.match(PseudoElement.MATCH))) { | ||
1244 | 807 | return new PseudoElement(match[1], match[2], cssText); | ||
1245 | 808 | } else if (match = selector.match(DynamicRule.MATCH)) { | ||
1246 | 809 | if (!HYPERLINK.test(match[0]) || DynamicRule.COMPLEX.test(match[0])) { | ||
1247 | 810 | return new DynamicRule(selector, match[1], match[2], match[3], cssText); | ||
1248 | 811 | } | ||
1249 | 812 | } else { | ||
1250 | 813 | return new Rule(selector, cssText); | ||
1251 | 814 | } | ||
1252 | 815 | return selector + " {" + cssText + "}"; | ||
1253 | 816 | }, | ||
1254 | 817 | |||
1255 | 818 | getText: function() { | ||
1256 | 819 | // store for style sheet text | ||
1257 | 820 | // parse media decalarations | ||
1258 | 821 | var MEDIA = /@media\s+([^{]+?)\s*\{([^@]+\})\s*\}/gi; | ||
1259 | 822 | var IMPORTS = /@import[^;\n]+/gi; | ||
1260 | 823 | var TRIM_IMPORTS = /@import\s+url\s*\(\s*["']?|["']?\s*\)\s*/gi; | ||
1261 | 824 | var URL = /(url\s*\(\s*['"]?)([\w\.]+[^:\)]*['"]?\))/gi; | ||
1262 | 825 | |||
1263 | 826 | var self = this; | ||
1264 | 827 | |||
1265 | 828 | // Store loaded cssText URLs | ||
1266 | 829 | var fileCache = {}; | ||
1267 | 830 | |||
1268 | 831 | function getCSSText(styleSheet, path, media, level) { | ||
1269 | 832 | var cssText = ""; | ||
1270 | 833 | if (!level) { | ||
1271 | 834 | media = toSimpleMedia(styleSheet.media); | ||
1272 | 835 | level = 0; | ||
1273 | 836 | } | ||
1274 | 837 | if (media === "none") { | ||
1275 | 838 | styleSheet.disabled = true; | ||
1276 | 839 | return ""; | ||
1277 | 840 | } | ||
1278 | 841 | if (media === "all" || media === self.media) { | ||
1279 | 842 | // IE only allows importing style sheets three levels deep. | ||
1280 | 843 | // it will crash if you try to access a level below this | ||
1281 | 844 | try { | ||
1282 | 845 | var canAcess = !!styleSheet.cssText; | ||
1283 | 846 | } catch (exe) {} | ||
1284 | 847 | if (level < 3 && canAcess) { | ||
1285 | 848 | var hrefs = styleSheet.cssText.match(IMPORTS); | ||
1286 | 849 | // loop through imported style sheets | ||
1287 | 850 | for (var i = 0, imported; i < styleSheet.imports.length; i++) { | ||
1288 | 851 | var imported = styleSheet.imports[i]; | ||
1289 | 852 | var href = styleSheet._href || styleSheet.href; | ||
1290 | 853 | imported._href = hrefs[i].replace(TRIM_IMPORTS, ""); | ||
1291 | 854 | // call this function recursively to get all imported style sheets | ||
1292 | 855 | cssText += getCSSText(imported, getPath(href, path), media, level + 1); | ||
1293 | 856 | } | ||
1294 | 857 | } | ||
1295 | 858 | // retrieve inline style or load an external style sheet | ||
1296 | 859 | cssText += encode(styleSheet.href ? loadStyleSheet(styleSheet, path) : styleSheet.owningElement._cssText); | ||
1297 | 860 | cssText = parseMedia(cssText, self.media); | ||
1298 | 861 | } | ||
1299 | 862 | return cssText; | ||
1300 | 863 | }; | ||
1301 | 864 | |||
1302 | 865 | // Load all style sheets in the document | ||
1303 | 866 | for (var i = 0; i < styleSheets.length; i++) { | ||
1304 | 867 | var styleSheet = styleSheets[i]; | ||
1305 | 868 | if (!styleSheet.disabled && !styleSheet.ie7) this.cssText += getCSSText(styleSheet); | ||
1306 | 869 | } | ||
1307 | 870 | |||
1308 | 871 | // helper functions | ||
1309 | 872 | function parseMedia(cssText, media) { | ||
1310 | 873 | filterMedia.value = media; | ||
1311 | 874 | return cssText.replace(MEDIA, filterMedia); | ||
1312 | 875 | }; | ||
1313 | 876 | |||
1314 | 877 | function filterMedia(match, media, cssText) { | ||
1315 | 878 | media = toSimpleMedia(media); | ||
1316 | 879 | switch (media) { | ||
1317 | 880 | case "screen": | ||
1318 | 881 | case "print": | ||
1319 | 882 | if (media !== filterMedia.value) return ""; | ||
1320 | 883 | case "all": | ||
1321 | 884 | return cssText; | ||
1322 | 885 | } | ||
1323 | 886 | return ""; | ||
1324 | 887 | }; | ||
1325 | 888 | |||
1326 | 889 | function toSimpleMedia(media) { | ||
1327 | 890 | if (!media) return "all"; | ||
1328 | 891 | var split = media.toLowerCase().split(/\s*,\s*/); | ||
1329 | 892 | media = "none"; | ||
1330 | 893 | for (var i = 0; i < split.length; i++) { | ||
1331 | 894 | if (split[i] === "all") return "all"; | ||
1332 | 895 | if (split[i] === "screen") { | ||
1333 | 896 | if (media === "print") return "all"; | ||
1334 | 897 | media = "screen"; | ||
1335 | 898 | } else if (split[i] === "print") { | ||
1336 | 899 | if (media === "screen") return "all"; | ||
1337 | 900 | media = "print"; | ||
1338 | 901 | } | ||
1339 | 902 | } | ||
1340 | 903 | return media; | ||
1341 | 904 | }; | ||
1342 | 905 | |||
1343 | 906 | // Load an external style sheet | ||
1344 | 907 | function loadStyleSheet(styleSheet, path) { | ||
1345 | 908 | var href = styleSheet._href || styleSheet.href; | ||
1346 | 909 | var url = makePath(href, path); | ||
1347 | 910 | // If the style sheet has already loaded then don't reload it | ||
1348 | 911 | if (fileCache[url]) return ""; | ||
1349 | 912 | // Load from source | ||
1350 | 913 | fileCache[url] = styleSheet.disabled ? "" : | ||
1351 | 914 | fixUrls(IE7.CSS.getText(styleSheet, path), getPath(href, path)); | ||
1352 | 915 | return fileCache[url]; | ||
1353 | 916 | }; | ||
1354 | 917 | |||
1355 | 918 | // Fix CSS paths. | ||
1356 | 919 | // We're lumping all css text into one big style sheet so relative | ||
1357 | 920 | // paths have to be fixed. This is necessary anyway because of other | ||
1358 | 921 | // Internet Explorer bugs. | ||
1359 | 922 | function fixUrls(cssText, pathname) { | ||
1360 | 923 | // hack & slash | ||
1361 | 924 | return cssText.replace(URL, "$1" + pathname.slice(0, pathname.lastIndexOf("/") + 1) + "$2"); | ||
1362 | 925 | }; | ||
1363 | 926 | }, | ||
1364 | 927 | |||
1365 | 928 | load: function() { | ||
1366 | 929 | this.cssText = ""; | ||
1367 | 930 | this.getText(); | ||
1368 | 931 | this.parse(); | ||
1369 | 932 | if (inheritedProperties.length) { | ||
1370 | 933 | this.cssText = parseInherited(this.cssText); | ||
1371 | 934 | } | ||
1372 | 935 | this.cssText = decode(this.cssText); | ||
1373 | 936 | fileCache = {}; | ||
1374 | 937 | }, | ||
1375 | 938 | |||
1376 | 939 | parse: function() { | ||
1377 | 940 | var cssText = IE7.CSS.parser.parse(this.cssText); | ||
1378 | 941 | |||
1379 | 942 | var declarations = ""; | ||
1380 | 943 | this.cssText = cssText.replace(/@charset[^;]+;|@font\-face[^\}]+\}/g, function(match) { | ||
1381 | 944 | declarations += match + "\n"; | ||
1382 | 945 | return ""; | ||
1383 | 946 | }); | ||
1384 | 947 | this.declarations = decode(declarations); | ||
1385 | 948 | |||
1386 | 949 | // Parse the style sheet | ||
1387 | 950 | var offset = IE7.CSS.rules.length; | ||
1388 | 951 | var rules = [], rule; | ||
1389 | 952 | while ((rule = RULE.exec(this.cssText))) { | ||
1390 | 953 | var cssText = rule[2]; | ||
1391 | 954 | if (cssText) { | ||
1392 | 955 | var fixDescendants = appVersion < 7 && cssText.indexOf("AlphaImageLoader") !== -1; | ||
1393 | 956 | var selectors = rule[1].match(SELECTOR), selector; | ||
1394 | 957 | for (var i = 0; selector = selectors[i]; i++) { | ||
1395 | 958 | selector = trim(selector); | ||
1396 | 959 | var isUnknown = IE7.CSS.UNKNOWN.test(selector); | ||
1397 | 960 | selectors[i] = isUnknown ? this.createRule(selector, cssText) : selector + "{" + cssText + "}"; | ||
1398 | 961 | if (fixDescendants) selectors[i] += this.createRule(selector + ">*", "position:relative"); | ||
1399 | 962 | } | ||
1400 | 963 | rules.push(selectors.join("\n")); | ||
1401 | 964 | } | ||
1402 | 965 | } | ||
1403 | 966 | this.cssText = rules.join("\n"); | ||
1404 | 967 | this.rules = IE7.CSS.rules.slice(offset); | ||
1405 | 968 | }, | ||
1406 | 969 | |||
1407 | 970 | recalc: function() { | ||
1408 | 971 | var rule, i; | ||
1409 | 972 | for (i = 0; (rule = this.rules[i]); i++) rule.recalc(); | ||
1410 | 973 | }, | ||
1411 | 974 | |||
1412 | 975 | toString: function() { | ||
1413 | 976 | return this.declarations + "@media " + this.media + "{" + this.cssText + "}"; | ||
1414 | 977 | } | ||
1415 | 978 | }); | ||
1416 | 979 | |||
1417 | 980 | var PseudoElement; | ||
1418 | 981 | |||
1419 | 982 | // ----------------------------------------------------------------------- | ||
1420 | 983 | // IE7 style rules | ||
1421 | 984 | // ----------------------------------------------------------------------- | ||
1422 | 985 | |||
1423 | 986 | var Rule = IE7.Rule = Base.extend({ | ||
1424 | 987 | constructor: function(selector, cssText) { | ||
1425 | 988 | this.id = IE7.CSS.rules.length; | ||
1426 | 989 | this.className = Rule.PREFIX + this.id; | ||
1427 | 990 | var pseudoElement = selector.match(FIRST_LINE_LETTER); | ||
1428 | 991 | this.selector = (pseudoElement ? pseudoElement[1] : selector) || "*"; | ||
1429 | 992 | this.selectorText = this.parse(this.selector) + (pseudoElement ? pseudoElement[2] : ""); | ||
1430 | 993 | this.cssText = cssText; | ||
1431 | 994 | this.MATCH = new RegExp("\\s" + this.className + "(\\s|$)", "g"); | ||
1432 | 995 | IE7.CSS.rules.push(this); | ||
1433 | 996 | this.init(); | ||
1434 | 997 | }, | ||
1435 | 998 | |||
1436 | 999 | init: Undefined, | ||
1437 | 1000 | |||
1438 | 1001 | add: function(element) { | ||
1439 | 1002 | // allocate this class | ||
1440 | 1003 | element.className += " " + this.className; | ||
1441 | 1004 | }, | ||
1442 | 1005 | |||
1443 | 1006 | recalc: function() { | ||
1444 | 1007 | // execute the underlying css query for this class | ||
1445 | 1008 | var match = cssQuery(this.selector); | ||
1446 | 1009 | // add the class name for all matching elements | ||
1447 | 1010 | for (var i = 0; i < match.length; i++) this.add(match[i]); | ||
1448 | 1011 | }, | ||
1449 | 1012 | |||
1450 | 1013 | parse: function(selector) { | ||
1451 | 1014 | // attempt to preserve specificity for "loose" parsing by | ||
1452 | 1015 | // removing unknown tokens from a css selector but keep as | ||
1453 | 1016 | // much as we can.. | ||
1454 | 1017 | var simple = selector.replace(Rule.CHILD, " ").replace(Rule.COMPLEX, ""); | ||
1455 | 1018 | if (appVersion < 7) simple = simple.replace(Rule.MULTI, ""); | ||
1456 | 1019 | var tags = match(simple, Rule.TAGS).length - match(selector, Rule.TAGS).length; | ||
1457 | 1020 | var classes = match(simple, Rule.CLASSES).length - match(selector, Rule.CLASSES).length + 1; | ||
1458 | 1021 | while (classes > 0 && Rule.CLASS.test(simple)) { | ||
1459 | 1022 | simple = simple.replace(Rule.CLASS, ""); | ||
1460 | 1023 | classes--; | ||
1461 | 1024 | } | ||
1462 | 1025 | while (tags > 0 && Rule.TAG.test(simple)) { | ||
1463 | 1026 | simple = simple.replace(Rule.TAG, "$1*"); | ||
1464 | 1027 | tags--; | ||
1465 | 1028 | } | ||
1466 | 1029 | simple += "." + this.className; | ||
1467 | 1030 | classes = Math.min(classes, 2); | ||
1468 | 1031 | tags = Math.min(tags, 2); | ||
1469 | 1032 | var score = -10 * classes - tags; | ||
1470 | 1033 | if (score > 0) { | ||
1471 | 1034 | simple = simple + "," + Rule.MAP[score] + " " + simple; | ||
1472 | 1035 | } | ||
1473 | 1036 | return simple; | ||
1474 | 1037 | }, | ||
1475 | 1038 | |||
1476 | 1039 | remove: function(element) { | ||
1477 | 1040 | // deallocate this class | ||
1478 | 1041 | element.className = element.className.replace(this.MATCH, "$1"); | ||
1479 | 1042 | }, | ||
1480 | 1043 | |||
1481 | 1044 | toString: function() { | ||
1482 | 1045 | return format("%1 {%2}", this.selectorText, this.cssText); | ||
1483 | 1046 | } | ||
1484 | 1047 | }, { | ||
1485 | 1048 | CHILD: />/g, | ||
1486 | 1049 | CLASS: /\.[\w-]+/, | ||
1487 | 1050 | CLASSES: /[.:\[]/g, | ||
1488 | 1051 | MULTI: /(\.[\w-]+)+/g, | ||
1489 | 1052 | PREFIX: "ie7_class", | ||
1490 | 1053 | TAG: /^\w+|([\s>+~])\w+/, | ||
1491 | 1054 | TAGS: /^\w|[\s>+~]\w/g, | ||
1492 | 1055 | MAP: { | ||
1493 | 1056 | "1": "html", | ||
1494 | 1057 | "2": "html body", | ||
1495 | 1058 | "10": ".ie7_html", | ||
1496 | 1059 | "11": "html.ie7_html", | ||
1497 | 1060 | "12": "html.ie7_html body", | ||
1498 | 1061 | "20": ".ie7_html .ie7_body", | ||
1499 | 1062 | "21": "html.ie7_html .ie7_body", | ||
1500 | 1063 | "22": "html.ie7_html body.ie7_body" | ||
1501 | 1064 | } | ||
1502 | 1065 | }); | ||
1503 | 1066 | |||
1504 | 1067 | // ----------------------------------------------------------------------- | ||
1505 | 1068 | // IE7 dynamic style | ||
1506 | 1069 | // ----------------------------------------------------------------------- | ||
1507 | 1070 | |||
1508 | 1071 | // object properties: | ||
1509 | 1072 | // attach: the element that an event handler will be attached to | ||
1510 | 1073 | // target: the element that will have the IE7 class applied | ||
1511 | 1074 | |||
1512 | 1075 | var DynamicRule = Rule.extend({ | ||
1513 | 1076 | // properties | ||
1514 | 1077 | constructor: function(selector, attach, dynamicPseudoClass, target, cssText) { | ||
1515 | 1078 | this.negated = dynamicPseudoClass.indexOf("not") === 0; | ||
1516 | 1079 | if (this.negated) dynamicPseudoClass = dynamicPseudoClass.slice(5, -1); | ||
1517 | 1080 | // initialise object properties | ||
1518 | 1081 | this.attach = attach || "*"; | ||
1519 | 1082 | this.dynamicPseudoClass = IE7.CSS.dynamicPseudoClasses[dynamicPseudoClass]; | ||
1520 | 1083 | this.target = target; | ||
1521 | 1084 | this.base(selector, cssText); | ||
1522 | 1085 | }, | ||
1523 | 1086 | |||
1524 | 1087 | recalc: function() { | ||
1525 | 1088 | // execute the underlying css query for this class | ||
1526 | 1089 | var attaches = cssQuery(this.attach), attach; | ||
1527 | 1090 | // process results | ||
1528 | 1091 | for (var i = 0; attach = attaches[i]; i++) { | ||
1529 | 1092 | // retrieve the event handler's target element(s) | ||
1530 | 1093 | var target = this.target ? cssQuery(this.target, attach) : [attach]; | ||
1531 | 1094 | // attach event handlers for dynamic pseudo-classes | ||
1532 | 1095 | if (target.length) this.dynamicPseudoClass.apply(attach, target, this); | ||
1533 | 1096 | } | ||
1534 | 1097 | } | ||
1535 | 1098 | }); | ||
1536 | 1099 | |||
1537 | 1100 | // ----------------------------------------------------------------------- | ||
1538 | 1101 | // IE7 dynamic pseudo-classes | ||
1539 | 1102 | // ----------------------------------------------------------------------- | ||
1540 | 1103 | |||
1541 | 1104 | var DynamicPseudoClass = Base.extend({ | ||
1542 | 1105 | constructor: function(name, apply) { | ||
1543 | 1106 | this.name = name; | ||
1544 | 1107 | this.apply = apply; | ||
1545 | 1108 | this.instances = {}; | ||
1546 | 1109 | IE7.CSS.dynamicPseudoClasses[name] = this; | ||
1547 | 1110 | }, | ||
1548 | 1111 | |||
1549 | 1112 | register: function(instance, negated) { | ||
1550 | 1113 | // an "instance" is actually an Arguments object | ||
1551 | 1114 | var _class = instance[2]; | ||
1552 | 1115 | if (!negated && _class.negated) { | ||
1553 | 1116 | this.unregister(instance, true); | ||
1554 | 1117 | } else { | ||
1555 | 1118 | instance.id = _class.id + instance[0].uniqueID; | ||
1556 | 1119 | if (!this.instances[instance.id]) { | ||
1557 | 1120 | var target = instance[1], j; | ||
1558 | 1121 | for (j = 0; j < target.length; j++) _class.add(target[j]); | ||
1559 | 1122 | this.instances[instance.id] = instance; | ||
1560 | 1123 | } | ||
1561 | 1124 | } | ||
1562 | 1125 | }, | ||
1563 | 1126 | |||
1564 | 1127 | unregister: function(instance, negated) { | ||
1565 | 1128 | var _class = instance[2]; | ||
1566 | 1129 | if (!negated && _class.negated) { | ||
1567 | 1130 | this.register(instance, true); | ||
1568 | 1131 | } else { | ||
1569 | 1132 | if (this.instances[instance.id]) { | ||
1570 | 1133 | var target = instance[1], j; | ||
1571 | 1134 | for (j = 0; j < target.length; j++) _class.remove(target[j]); | ||
1572 | 1135 | delete this.instances[instance.id]; | ||
1573 | 1136 | } | ||
1574 | 1137 | } | ||
1575 | 1138 | } | ||
1576 | 1139 | }); | ||
1577 | 1140 | |||
1578 | 1141 | // ----------------------------------------------------------------------- | ||
1579 | 1142 | // dynamic pseudo-classes | ||
1580 | 1143 | // ----------------------------------------------------------------------- | ||
1581 | 1144 | |||
1582 | 1145 | var Hover = new DynamicPseudoClass("hover", function(element) { | ||
1583 | 1146 | var instance = arguments; | ||
1584 | 1147 | IE7.CSS.addEventHandler(element, "onmouseenter", function() { | ||
1585 | 1148 | Hover.register(instance); | ||
1586 | 1149 | }); | ||
1587 | 1150 | IE7.CSS.addEventHandler(element, "onmouseleave", function() { | ||
1588 | 1151 | Hover.unregister(instance); | ||
1589 | 1152 | }); | ||
1590 | 1153 | }); | ||
1591 | 1154 | |||
1592 | 1155 | // globally trap the mouseup event (thanks Martijn!) | ||
1593 | 1156 | addEventHandler(document, "onmouseup", function() { | ||
1594 | 1157 | var instances = Hover.instances; | ||
1595 | 1158 | for (var i in instances) | ||
1596 | 1159 | if (!instances[i][0].contains(event.srcElement)) | ||
1597 | 1160 | Hover.unregister(instances[i]); | ||
1598 | 1161 | }); | ||
1599 | 1162 | |||
1600 | 1163 | var ATTR = { | ||
1601 | 1164 | "=": "%1==='%2'", // "[@%1='%2']" | ||
1602 | 1165 | "~=": "(' '+%1+' ').indexOf(' %2 ')!==-1", // "[contains(concat(' ',@%1,' '),' %2 ')]", | ||
1603 | 1166 | "|=": "%1==='%2'||%1.indexOf('%2-')===0", // "[@%1='%2' or starts-with(@%1,'%2-')]", | ||
1604 | 1167 | "^=": "%1.indexOf('%2')===0", // "[starts-with(@%1,'%2')]", | ||
1605 | 1168 | "$=": "%1.slice(-'%2'.length)==='%2'", // "[ends-with(@%1,'%2')]", | ||
1606 | 1169 | "*=": "%1.indexOf('%2')!==-1" // "[contains(@%1,'%2')]" | ||
1607 | 1170 | }; | ||
1608 | 1171 | ATTR[""] = "%1!=null"; // "[@%1]" | ||
1609 | 1172 | |||
1610 | 1173 | var FILTER = { | ||
1611 | 1174 | "<#attr>": function(match, name, operator, value) { | ||
1612 | 1175 | var attr = "IE7._getAttribute(e,'" + name + "')"; | ||
1613 | 1176 | value = getString(value); | ||
1614 | 1177 | if (operator.length > 1) { | ||
1615 | 1178 | if (!value || operator === "~=" && SPACE.test(value)) { | ||
1616 | 1179 | return "false&&"; | ||
1617 | 1180 | } | ||
1618 | 1181 | attr = "(" + attr + "||'')"; | ||
1619 | 1182 | } | ||
1620 | 1183 | return "(" + format(ATTR[operator], attr, value) + ")&&"; | ||
1621 | 1184 | }, | ||
1622 | 1185 | |||
1623 | 1186 | "<#id>": ID_ATTRIBUTE + "==='$1'&&", | ||
1624 | 1187 | |||
1625 | 1188 | "<#class>": "e.className&&(' '+e.className+' ').indexOf(' $1 ')!==-1&&", | ||
1626 | 1189 | |||
1627 | 1190 | // PSEDUO | ||
1628 | 1191 | ":first-child": "!" + PREVIOUS_SIBLING + "&&", | ||
1629 | 1192 | ":link": "e.currentStyle['ie7-link']=='link'&&", | ||
1630 | 1193 | ":visited": "e.currentStyle['ie7-link']=='visited'&&" | ||
1631 | 1194 | }; | ||
1632 | 1195 | |||
1633 | 1196 | // ========================================================================= | ||
1634 | 1197 | // ie7-html.js | ||
1635 | 1198 | // ========================================================================= | ||
1636 | 1199 | |||
1637 | 1200 | // default font-sizes | ||
1638 | 1201 | //HEADER += "h1{font-size:2em}h2{font-size:1.5em;}h3{font-size:1.17em;}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.67em}"; | ||
1639 | 1202 | |||
1640 | 1203 | IE7.HTML = new (Fix.extend({ // single instance | ||
1641 | 1204 | fixed: {}, | ||
1642 | 1205 | |||
1643 | 1206 | init: Undefined, | ||
1644 | 1207 | |||
1645 | 1208 | addFix: function() { | ||
1646 | 1209 | // fixes are a one-off, they are applied when the document is loaded | ||
1647 | 1210 | this.fixes.push(arguments); | ||
1648 | 1211 | }, | ||
1649 | 1212 | |||
1650 | 1213 | apply: function() { | ||
1651 | 1214 | for (var i = 0; i < this.fixes.length; i++) { | ||
1652 | 1215 | var match = cssQuery(this.fixes[i][0]); | ||
1653 | 1216 | var fix = this.fixes[i][1]; | ||
1654 | 1217 | for (var j = 0; j < match.length; j++) fix(match[j]); | ||
1655 | 1218 | } | ||
1656 | 1219 | }, | ||
1657 | 1220 | |||
1658 | 1221 | addRecalc: function() { | ||
1659 | 1222 | // recalcs occur whenever the document is refreshed using document.recalc() | ||
1660 | 1223 | this.recalcs.push(arguments); | ||
1661 | 1224 | }, | ||
1662 | 1225 | |||
1663 | 1226 | recalc: function() { | ||
1664 | 1227 | // loop through the fixes | ||
1665 | 1228 | for (var i = 0; i < this.recalcs.length; i++) { | ||
1666 | 1229 | var match = cssQuery(this.recalcs[i][0]); | ||
1667 | 1230 | var recalc = this.recalcs[i][1], element; | ||
1668 | 1231 | var key = Math.pow(2, i); | ||
1669 | 1232 | for (var j = 0; (element = match[j]); j++) { | ||
1670 | 1233 | var uniqueID = element.uniqueID; | ||
1671 | 1234 | if ((this.fixed[uniqueID] & key) === 0) { | ||
1672 | 1235 | element = recalc(element) || element; | ||
1673 | 1236 | this.fixed[uniqueID] |= key; | ||
1674 | 1237 | } | ||
1675 | 1238 | } | ||
1676 | 1239 | } | ||
1677 | 1240 | } | ||
1678 | 1241 | })); | ||
1679 | 1242 | |||
1680 | 1243 | if (appVersion < 7) { | ||
1681 | 1244 | // provide support for the <abbr> tag. | ||
1682 | 1245 | document.createElement("abbr"); | ||
1683 | 1246 | |||
1684 | 1247 | // bind to the first child control | ||
1685 | 1248 | IE7.HTML.addRecalc("label", function(label) { | ||
1686 | 1249 | if (!label.htmlFor) { | ||
1687 | 1250 | var firstChildControl = cssQuery("input,textarea", label, true); | ||
1688 | 1251 | if (firstChildControl) { | ||
1689 | 1252 | addEventHandler(label, "onclick", function() { | ||
1690 | 1253 | firstChildControl.click(); | ||
1691 | 1254 | }); | ||
1692 | 1255 | } | ||
1693 | 1256 | } | ||
1694 | 1257 | }); | ||
1695 | 1258 | } | ||
1696 | 1259 | |||
1697 | 1260 | // ========================================================================= | ||
1698 | 1261 | // ie7-layout.js | ||
1699 | 1262 | // ========================================================================= | ||
1700 | 1263 | |||
1701 | 1264 | var NUMERIC = "[.\\d]"; | ||
1702 | 1265 | |||
1703 | 1266 | (function() { | ||
1704 | 1267 | var layout = IE7.Layout = {}; | ||
1705 | 1268 | |||
1706 | 1269 | // big, ugly box-model hack + min/max stuff | ||
1707 | 1270 | |||
1708 | 1271 | // #tantek > #erik > #dean { voice-family: hacker; } | ||
1709 | 1272 | |||
1710 | 1273 | // ----------------------------------------------------------------------- | ||
1711 | 1274 | // "layout" | ||
1712 | 1275 | // ----------------------------------------------------------------------- | ||
1713 | 1276 | |||
1714 | 1277 | HEADER += "*{boxSizing:content-box}"; | ||
1715 | 1278 | |||
1716 | 1279 | // give an element "layout" | ||
1717 | 1280 | layout.boxSizing = function(element) { | ||
1718 | 1281 | if (!element.currentStyle.hasLayout) { | ||
1719 | 1282 | //# element.runtimeStyle.fixedHeight = | ||
1720 | 1283 | element.style.height = "0cm"; | ||
1721 | 1284 | if (element.currentStyle.verticalAlign === "auto") | ||
1722 | 1285 | element.runtimeStyle.verticalAlign = "top"; | ||
1723 | 1286 | // when an element acquires "layout", margins no longer collapse correctly | ||
1724 | 1287 | collapseMargins(element); | ||
1725 | 1288 | } | ||
1726 | 1289 | }; | ||
1727 | 1290 | |||
1728 | 1291 | // ----------------------------------------------------------------------- | ||
1729 | 1292 | // Margin Collapse | ||
1730 | 1293 | // ----------------------------------------------------------------------- | ||
1731 | 1294 | |||
1732 | 1295 | function collapseMargins(element) { | ||
1733 | 1296 | if (element != viewport && element.currentStyle.position !== "absolute") { | ||
1734 | 1297 | collapseMargin(element, "marginTop"); | ||
1735 | 1298 | collapseMargin(element, "marginBottom"); | ||
1736 | 1299 | } | ||
1737 | 1300 | }; | ||
1738 | 1301 | |||
1739 | 1302 | function collapseMargin(element, type) { | ||
1740 | 1303 | if (!element.runtimeStyle[type]) { | ||
1741 | 1304 | var parentElement = element.parentElement; | ||
1742 | 1305 | var isTopMargin = type === "marginTop"; | ||
1743 | 1306 | if (parentElement && parentElement.currentStyle.hasLayout && !IE7._getElementSibling(element, isTopMargin ? "previous" : "next")) return; | ||
1744 | 1307 | var child = element[isTopMargin ? "firstChild" : "lastChild"]; | ||
1745 | 1308 | if (child && child.nodeName < "@") child = IE7._getElementSibling(child, isTopMargin ? "next" : "previous"); | ||
1746 | 1309 | if (child && child.currentStyle.styleFloat === "none" && child.currentStyle.hasLayout) { | ||
1747 | 1310 | collapseMargin(child, type); | ||
1748 | 1311 | margin = _getMargin(element, element.currentStyle[type]); | ||
1749 | 1312 | childMargin = _getMargin(child, child.currentStyle[type]); | ||
1750 | 1313 | if (margin < 0 || childMargin < 0) { | ||
1751 | 1314 | element.runtimeStyle[type] = margin + childMargin; | ||
1752 | 1315 | } else { | ||
1753 | 1316 | element.runtimeStyle[type] = Math.max(childMargin, margin); | ||
1754 | 1317 | } | ||
1755 | 1318 | child.runtimeStyle[type] = "0px"; | ||
1756 | 1319 | } | ||
1757 | 1320 | } | ||
1758 | 1321 | }; | ||
1759 | 1322 | |||
1760 | 1323 | function _getMargin(element, value) { | ||
1761 | 1324 | return value === "auto" ? 0 : getPixelValue(element, value); | ||
1762 | 1325 | }; | ||
1763 | 1326 | |||
1764 | 1327 | // ----------------------------------------------------------------------- | ||
1765 | 1328 | // box-model | ||
1766 | 1329 | // ----------------------------------------------------------------------- | ||
1767 | 1330 | |||
1768 | 1331 | // constants | ||
1769 | 1332 | var UNIT = /^[.\d][\w]*$/, AUTO = /^(auto|0cm)$/; | ||
1770 | 1333 | |||
1771 | 1334 | var apply = {}; | ||
1772 | 1335 | layout.borderBox = function(element){ | ||
1773 | 1336 | apply.Width(element); | ||
1774 | 1337 | apply.Height(element); | ||
1775 | 1338 | }; | ||
1776 | 1339 | |||
1777 | 1340 | var _fixWidth = function(HEIGHT) { | ||
1778 | 1341 | apply.Width = function(element) { | ||
1779 | 1342 | if (!PERCENT.test(element.currentStyle.width)) _fixWidth(element); | ||
1780 | 1343 | if (HEIGHT) collapseMargins(element); | ||
1781 | 1344 | }; | ||
1782 | 1345 | |||
1783 | 1346 | function _fixWidth(element, value) { | ||
1784 | 1347 | if (!element.runtimeStyle.fixedWidth) { | ||
1785 | 1348 | if (!value) value = element.currentStyle.width; | ||
1786 | 1349 | element.runtimeStyle.fixedWidth = UNIT.test(value) ? Math.max(0, getFixedWidth(element, value)) + "px" : value; | ||
1787 | 1350 | setOverrideStyle(element, "width", element.runtimeStyle.fixedWidth); | ||
1788 | 1351 | } | ||
1789 | 1352 | }; | ||
1790 | 1353 | |||
1791 | 1354 | function layoutWidth(element) { | ||
1792 | 1355 | if (!isFixed(element)) { | ||
1793 | 1356 | var layoutParent = element.offsetParent; | ||
1794 | 1357 | while (layoutParent && !layoutParent.currentStyle.hasLayout) layoutParent = layoutParent.offsetParent; | ||
1795 | 1358 | } | ||
1796 | 1359 | return (layoutParent || viewport).clientWidth; | ||
1797 | 1360 | }; | ||
1798 | 1361 | |||
1799 | 1362 | function getPixelWidth(element, value) { | ||
1800 | 1363 | if (PERCENT.test(value)) return parseInt(parseFloat(value) / 100 * layoutWidth(element)); | ||
1801 | 1364 | return getPixelValue(element, value); | ||
1802 | 1365 | }; | ||
1803 | 1366 | |||
1804 | 1367 | var getFixedWidth = function(element, value) { | ||
1805 | 1368 | var borderBox = element.currentStyle["ie7-box-sizing"] === "border-box"; | ||
1806 | 1369 | var adjustment = 0; | ||
1807 | 1370 | if (MSIE5 && !borderBox) | ||
1808 | 1371 | adjustment += getBorderWidth(element) + getWidth(element, "padding"); | ||
1809 | 1372 | else if (!MSIE5 && borderBox) | ||
1810 | 1373 | adjustment -= getBorderWidth(element) + getWidth(element, "padding"); | ||
1811 | 1374 | return getPixelWidth(element, value) + adjustment; | ||
1812 | 1375 | }; | ||
1813 | 1376 | |||
1814 | 1377 | // easy way to get border thickness for elements with "layout" | ||
1815 | 1378 | function getBorderWidth(element) { | ||
1816 | 1379 | return element.offsetWidth - element.clientWidth; | ||
1817 | 1380 | }; | ||
1818 | 1381 | |||
1819 | 1382 | // have to do some pixel conversion to get padding/margin thickness :-( | ||
1820 | 1383 | function getWidth(element, type) { | ||
1821 | 1384 | return getPixelWidth(element, element.currentStyle[type + "Left"]) + getPixelWidth(element, element.currentStyle[type + "Right"]); | ||
1822 | 1385 | }; | ||
1823 | 1386 | |||
1824 | 1387 | // ----------------------------------------------------------------------- | ||
1825 | 1388 | // min/max | ||
1826 | 1389 | // ----------------------------------------------------------------------- | ||
1827 | 1390 | |||
1828 | 1391 | HEADER += "*{minWidth:none;maxWidth:none;min-width:none;max-width:none}"; | ||
1829 | 1392 | |||
1830 | 1393 | // handle min-width property | ||
1831 | 1394 | layout.minWidth = function(element) { | ||
1832 | 1395 | // IE6 supports min-height so we frig it here | ||
1833 | 1396 | //#if (element.currentStyle.minHeight === "auto") element.runtimeStyle.minHeight = 0; | ||
1834 | 1397 | if (element.currentStyle["min-width"] != null) { | ||
1835 | 1398 | element.style.minWidth = element.currentStyle["min-width"]; | ||
1836 | 1399 | } | ||
1837 | 1400 | if (register(arguments.callee, element, element.currentStyle.minWidth !== "none")) { | ||
1838 | 1401 | layout.boxSizing(element); | ||
1839 | 1402 | _fixWidth(element); | ||
1840 | 1403 | resizeWidth(element); | ||
1841 | 1404 | } | ||
1842 | 1405 | }; | ||
1843 | 1406 | |||
1844 | 1407 | // clone the minWidth function to make a maxWidth function | ||
1845 | 1408 | eval("IE7.Layout.maxWidth=" + String(layout.minWidth).replace(/min/g, "max")); | ||
1846 | 1409 | |||
1847 | 1410 | // apply min/max restrictions | ||
1848 | 1411 | function resizeWidth(element) { | ||
1849 | 1412 | // check boundaries | ||
1850 | 1413 | if (element == document.body) { | ||
1851 | 1414 | var width = element.clientWidth; | ||
1852 | 1415 | } else { | ||
1853 | 1416 | var rect = element.getBoundingClientRect(); | ||
1854 | 1417 | width = rect.right - rect.left; | ||
1855 | 1418 | } | ||
1856 | 1419 | if (element.currentStyle.minWidth !== "none" && width < getFixedWidth(element, element.currentStyle.minWidth)) { | ||
1857 | 1420 | element.runtimeStyle.width = element.currentStyle.minWidth; | ||
1858 | 1421 | } else if (element.currentStyle.maxWidth !== "none" && width >= getFixedWidth(element, element.currentStyle.maxWidth)) { | ||
1859 | 1422 | element.runtimeStyle.width = element.currentStyle.maxWidth; | ||
1860 | 1423 | } else { | ||
1861 | 1424 | element.runtimeStyle.width = element.runtimeStyle.fixedWidth; | ||
1862 | 1425 | } | ||
1863 | 1426 | }; | ||
1864 | 1427 | |||
1865 | 1428 | // ----------------------------------------------------------------------- | ||
1866 | 1429 | // right/bottom | ||
1867 | 1430 | // ----------------------------------------------------------------------- | ||
1868 | 1431 | |||
1869 | 1432 | function fixRight(element) { | ||
1870 | 1433 | if (register(fixRight, element, /^(fixed|absolute)$/.test(element.currentStyle.position) && | ||
1871 | 1434 | getDefinedStyle(element, "left") !== "auto" && | ||
1872 | 1435 | getDefinedStyle(element, "right") !== "auto" && | ||
1873 | 1436 | AUTO.test(getDefinedStyle(element, "width")))) { | ||
1874 | 1437 | resizeRight(element); | ||
1875 | 1438 | layout.boxSizing(element); | ||
1876 | 1439 | } | ||
1877 | 1440 | }; | ||
1878 | 1441 | layout.fixRight = fixRight; | ||
1879 | 1442 | |||
1880 | 1443 | function resizeRight(element) { | ||
1881 | 1444 | var left = getPixelWidth(element, element.runtimeStyle._left || element.currentStyle.left); | ||
1882 | 1445 | var width = layoutWidth(element) - getPixelWidth(element, element.currentStyle.right) - left - getWidth(element, "margin"); | ||
1883 | 1446 | if (parseInt(element.runtimeStyle.width) === width) return; | ||
1884 | 1447 | element.runtimeStyle.width = ""; | ||
1885 | 1448 | if (isFixed(element) || HEIGHT || element.offsetWidth < width) { | ||
1886 | 1449 | if (!MSIE5) width -= getBorderWidth(element) + getWidth(element, "padding"); | ||
1887 | 1450 | if (width < 0) width = 0; | ||
1888 | 1451 | element.runtimeStyle.fixedWidth = width; | ||
1889 | 1452 | setOverrideStyle(element, "width", width); | ||
1890 | 1453 | } | ||
1891 | 1454 | }; | ||
1892 | 1455 | |||
1893 | 1456 | // ----------------------------------------------------------------------- | ||
1894 | 1457 | // window.onresize | ||
1895 | 1458 | // ----------------------------------------------------------------------- | ||
1896 | 1459 | |||
1897 | 1460 | // handle window resize | ||
1898 | 1461 | var clientWidth = 0; | ||
1899 | 1462 | addResize(function() { | ||
1900 | 1463 | if (!viewport) return; | ||
1901 | 1464 | var i, wider = (clientWidth < viewport.clientWidth); | ||
1902 | 1465 | clientWidth = viewport.clientWidth; | ||
1903 | 1466 | // resize elements with "min-width" set | ||
1904 | 1467 | var elements = layout.minWidth.elements; | ||
1905 | 1468 | for (i in elements) { | ||
1906 | 1469 | var element = elements[i]; | ||
1907 | 1470 | var fixedWidth = (parseInt(element.runtimeStyle.width) === getFixedWidth(element, element.currentStyle.minWidth)); | ||
1908 | 1471 | if (wider && fixedWidth) element.runtimeStyle.width = ""; | ||
1909 | 1472 | if (wider == fixedWidth) resizeWidth(element); | ||
1910 | 1473 | } | ||
1911 | 1474 | // resize elements with "max-width" set | ||
1912 | 1475 | var elements = layout.maxWidth.elements; | ||
1913 | 1476 | for (i in elements) { | ||
1914 | 1477 | var element = elements[i]; | ||
1915 | 1478 | var fixedWidth = (parseInt(element.runtimeStyle.width) === getFixedWidth(element, element.currentStyle.maxWidth)); | ||
1916 | 1479 | if (!wider && fixedWidth) element.runtimeStyle.width = ""; | ||
1917 | 1480 | if (wider !== fixedWidth) resizeWidth(element); | ||
1918 | 1481 | } | ||
1919 | 1482 | // resize elements with "right" set | ||
1920 | 1483 | for (i in fixRight.elements) resizeRight(fixRight.elements[i]); | ||
1921 | 1484 | }); | ||
1922 | 1485 | |||
1923 | 1486 | // ----------------------------------------------------------------------- | ||
1924 | 1487 | // fix CSS | ||
1925 | 1488 | // ----------------------------------------------------------------------- | ||
1926 | 1489 | if (MSIE5) { | ||
1927 | 1490 | IE7.CSS.addRecalc("width", NUMERIC, apply.Width); | ||
1928 | 1491 | } | ||
1929 | 1492 | if (appVersion < 7) { | ||
1930 | 1493 | IE7.CSS.addRecalc("max-width", NUMERIC, layout.maxWidth); | ||
1931 | 1494 | IE7.CSS.addRecalc("right", NUMERIC, fixRight); | ||
1932 | 1495 | } else if (appVersion == 7) { | ||
1933 | 1496 | if (HEIGHT) IE7.CSS.addRecalc("height", "[\\d.]+%", function(element) { | ||
1934 | 1497 | element.runtimeStyle.pixelHeight = parseInt(layoutWidth(element) * element.currentStyle["ie7-height"].slice(0, -1) / 100); | ||
1935 | 1498 | }); | ||
1936 | 1499 | } | ||
1937 | 1500 | }; | ||
1938 | 1501 | |||
1939 | 1502 | eval("var _fixHeight=" + rotate(_fixWidth)); | ||
1940 | 1503 | |||
1941 | 1504 | // apply box-model + min/max fixes | ||
1942 | 1505 | _fixWidth(); | ||
1943 | 1506 | _fixHeight(true); | ||
1944 | 1507 | |||
1945 | 1508 | if (appVersion < 7) { | ||
1946 | 1509 | IE7.CSS.addRecalc("min-width", NUMERIC, layout.minWidth); | ||
1947 | 1510 | IE7.CSS.addFix(/\bmin-height\s*/, "height"); | ||
1948 | 1511 | } | ||
1949 | 1512 | })(); | ||
1950 | 1513 | |||
1951 | 1514 | // ========================================================================= | ||
1952 | 1515 | // ie7-graphics.js | ||
1953 | 1516 | // ========================================================================= | ||
1954 | 1517 | |||
1955 | 1518 | // a small transparent image used as a placeholder | ||
1956 | 1519 | var BLANK_GIF = makePath("blank.gif", path); | ||
1957 | 1520 | |||
1958 | 1521 | var ALPHA_IMAGE_LOADER = "DXImageTransform.Microsoft.AlphaImageLoader"; | ||
1959 | 1522 | var PNG_FILTER = "progid:" + ALPHA_IMAGE_LOADER + "(src='%1',sizingMethod='%2')"; | ||
1960 | 1523 | |||
1961 | 1524 | // regular expression version of the above | ||
1962 | 1525 | var PNG; | ||
1963 | 1526 | |||
1964 | 1527 | var filtered = []; | ||
1965 | 1528 | |||
1966 | 1529 | function fixImage(element) { | ||
1967 | 1530 | if (PNG.test(element.src)) { | ||
1968 | 1531 | // we have to preserve width and height | ||
1969 | 1532 | var image = new Image(element.width, element.height); | ||
1970 | 1533 | image.onload = function() { | ||
1971 | 1534 | element.width = image.width; | ||
1972 | 1535 | element.height = image.height; | ||
1973 | 1536 | image = null; | ||
1974 | 1537 | }; | ||
1975 | 1538 | image.src = element.src; | ||
1976 | 1539 | // store the original url (we'll put it back when it's printed) | ||
1977 | 1540 | element.pngSrc = element.src; | ||
1978 | 1541 | // add the AlphaImageLoader thingy | ||
1979 | 1542 | addFilter(element); | ||
1980 | 1543 | } | ||
1981 | 1544 | }; | ||
1982 | 1545 | |||
1983 | 1546 | if (appVersion < 7) { | ||
1984 | 1547 | // ** IE7 VARIABLE | ||
1985 | 1548 | // e.g. apply the hack to all files ending in ".png" | ||
1986 | 1549 | // IE7_PNG_SUFFIX = ".png"; | ||
1987 | 1550 | // You can also set it to a RegExp | ||
1988 | 1551 | // IE7_PNG_SUFFIX = /\d+\.png$/; | ||
1989 | 1552 | |||
1990 | 1553 | // replace background(-image): url(..) .. with background(-image): .. ;filter: ..; | ||
1991 | 1554 | IE7.CSS.addFix(/background(-image)?\s*:\s*([^};]*)?url\(([^\)]+)\)([^;}]*)?/, function(match, $1, $2, url, $4) { | ||
1992 | 1555 | url = getString(url); | ||
1993 | 1556 | return PNG.test(url) ? "filter:" + format(PNG_FILTER, url, $4.indexOf("no-repeat") === -1 ? "scale" : "crop") + | ||
1994 | 1557 | ";zoom:1;background" + ($1||"") + ":" + ($2||"") + "none" + ($4||"") : match; | ||
1995 | 1558 | }); | ||
1996 | 1559 | |||
1997 | 1560 | // list-style-image | ||
1998 | 1561 | IE7.CSS.addRecalc(/list\-style(\-image)?/, "[^};]*url", function(element) { | ||
1999 | 1562 | var url = element.currentStyle.listStyleImage.slice(5, -2); | ||
2000 | 1563 | if (PNG.test(url)) { | ||
2001 | 1564 | if (element.nodeName === "LI") { | ||
2002 | 1565 | fixListStyleImage(element, url) | ||
2003 | 1566 | } else if (element.nodeName === "UL") { | ||
2004 | 1567 | for (var i = 0, li; li = element.childNodes[i]; i++) { | ||
2005 | 1568 | if (li.nodeName === "LI") fixListStyleImage(li, url); | ||
2006 | 1569 | } | ||
2007 | 1570 | } | ||
2008 | 1571 | } | ||
2009 | 1572 | }); | ||
2010 | 1573 | |||
2011 | 1574 | function fixListStyleImage(element, src) { | ||
2012 | 1575 | var style = element.runtimeStyle; | ||
2013 | 1576 | var originalHeight = element.offsetHeight; | ||
2014 | 1577 | var image = new Image; | ||
2015 | 1578 | image.onload = function() { | ||
2016 | 1579 | var paddingLeft = element.currentStyle.paddingLeft; | ||
2017 | 1580 | paddingLeft = paddingLeft === "0px" ? 0 : getPixelValue(element, paddingLeft); | ||
2018 | 1581 | style.paddingLeft = (paddingLeft + this.width) + "px"; | ||
2019 | 1582 | style.marginLeft = -this.width + "px"; | ||
2020 | 1583 | style.listStyleType = "none"; | ||
2021 | 1584 | style.listStyleImage = "none"; | ||
2022 | 1585 | style.paddingTop = Math.max(originalHeight - element.offsetHeight, 0) + "px"; | ||
2023 | 1586 | addFilter(element, "crop", src); | ||
2024 | 1587 | element.style.zoom = "100%"; | ||
2025 | 1588 | }; | ||
2026 | 1589 | image.src = src; | ||
2027 | 1590 | }; | ||
2028 | 1591 | |||
2029 | 1592 | // ----------------------------------------------------------------------- | ||
2030 | 1593 | // fix PNG transparency (HTML images) | ||
2031 | 1594 | // ----------------------------------------------------------------------- | ||
2032 | 1595 | |||
2033 | 1596 | IE7.HTML.addRecalc("img,input", function(element) { | ||
2034 | 1597 | if (element.nodeName === "INPUT" && element.type !== "image") return; | ||
2035 | 1598 | fixImage(element); | ||
2036 | 1599 | addEventHandler(element, "onpropertychange", function() { | ||
2037 | 1600 | if (!printing && event.propertyName === "src" && | ||
2038 | 1601 | element.src.indexOf(BLANK_GIF) === -1) fixImage(element); | ||
2039 | 1602 | }); | ||
2040 | 1603 | }); | ||
2041 | 1604 | |||
2042 | 1605 | // assume that background images should not be printed | ||
2043 | 1606 | // (if they are not transparent then they'll just obscure content) | ||
2044 | 1607 | // but we'll put foreground images back... | ||
2045 | 1608 | var printing = false; | ||
2046 | 1609 | addEventHandler(window, "onbeforeprint", function() { | ||
2047 | 1610 | printing = true; | ||
2048 | 1611 | for (var i = 0; i < filtered.length; i++) removeFilter(filtered[i]); | ||
2049 | 1612 | }); | ||
2050 | 1613 | addEventHandler(window, "onafterprint", function() { | ||
2051 | 1614 | for (var i = 0; i < filtered.length; i++) addFilter(filtered[i]); | ||
2052 | 1615 | printing = false; | ||
2053 | 1616 | }); | ||
2054 | 1617 | } | ||
2055 | 1618 | |||
2056 | 1619 | // apply a filter | ||
2057 | 1620 | function addFilter(element, sizingMethod, src) { | ||
2058 | 1621 | var filter = element.filters[ALPHA_IMAGE_LOADER]; | ||
2059 | 1622 | if (filter) { | ||
2060 | 1623 | filter.src = src || element.src; | ||
2061 | 1624 | filter.enabled = true; | ||
2062 | 1625 | } else { | ||
2063 | 1626 | element.runtimeStyle.filter = format(PNG_FILTER, src || element.src, sizingMethod || "scale"); | ||
2064 | 1627 | filtered.push(element); | ||
2065 | 1628 | } | ||
2066 | 1629 | // remove the real image | ||
2067 | 1630 | element.src = BLANK_GIF; | ||
2068 | 1631 | }; | ||
2069 | 1632 | |||
2070 | 1633 | function removeFilter(element) { | ||
2071 | 1634 | element.src = element.pngSrc; | ||
2072 | 1635 | element.filters[ALPHA_IMAGE_LOADER].enabled = false; | ||
2073 | 1636 | }; | ||
2074 | 1637 | |||
2075 | 1638 | // ========================================================================= | ||
2076 | 1639 | // ie7-fixed.js | ||
2077 | 1640 | // ========================================================================= | ||
2078 | 1641 | |||
2079 | 1642 | (function() { | ||
2080 | 1643 | if (appVersion >= 7) return; | ||
2081 | 1644 | |||
2082 | 1645 | // some things to consider for this hack. | ||
2083 | 1646 | // the document body requires a fixed background. even if | ||
2084 | 1647 | // it is just a blank image. | ||
2085 | 1648 | // you have to use setExpression instead of onscroll, this | ||
2086 | 1649 | // together with a fixed body background helps avoid the | ||
2087 | 1650 | // annoying screen flicker of other solutions. | ||
2088 | 1651 | |||
2089 | 1652 | IE7.CSS.addRecalc("position", "fixed", _positionFixed, "absolute"); | ||
2090 | 1653 | IE7.CSS.addRecalc("background(-attachment)?", "[^};]*fixed", _backgroundFixed); | ||
2091 | 1654 | |||
2092 | 1655 | // scrolling is relative to the documentElement (HTML tag) when in | ||
2093 | 1656 | // standards mode, otherwise it's relative to the document body | ||
2094 | 1657 | var $viewport = MSIE5 ? "body" : "documentElement"; | ||
2095 | 1658 | |||
2096 | 1659 | function _fixBackground() { | ||
2097 | 1660 | // this is required by both position:fixed and background-attachment:fixed. | ||
2098 | 1661 | // it is necessary for the document to also have a fixed background image. | ||
2099 | 1662 | // we can fake this with a blank image if necessary | ||
2100 | 1663 | if (body.currentStyle.backgroundAttachment !== "fixed") { | ||
2101 | 1664 | if (body.currentStyle.backgroundImage === "none") { | ||
2102 | 1665 | body.runtimeStyle.backgroundRepeat = "no-repeat"; | ||
2103 | 1666 | body.runtimeStyle.backgroundImage = "url(" + BLANK_GIF + ")"; // dummy | ||
2104 | 1667 | } | ||
2105 | 1668 | body.runtimeStyle.backgroundAttachment = "fixed"; | ||
2106 | 1669 | } | ||
2107 | 1670 | _fixBackground = Undefined; | ||
2108 | 1671 | }; | ||
2109 | 1672 | |||
2110 | 1673 | var _tmp = createTempElement("img"); | ||
2111 | 1674 | |||
2112 | 1675 | function _isFixed(element) { | ||
2113 | 1676 | return element ? isFixed(element) || _isFixed(element.parentElement) : false; | ||
2114 | 1677 | }; | ||
2115 | 1678 | |||
2116 | 1679 | function _setExpression(element, propertyName, expression) { | ||
2117 | 1680 | setTimeout("document.all." + element.uniqueID + ".runtimeStyle.setExpression('" + propertyName + "','" + expression + "')", 0); | ||
2118 | 1681 | }; | ||
2119 | 1682 | |||
2120 | 1683 | // ----------------------------------------------------------------------- | ||
2121 | 1684 | // backgroundAttachment: fixed | ||
2122 | 1685 | // ----------------------------------------------------------------------- | ||
2123 | 1686 | |||
2124 | 1687 | function _backgroundFixed(element) { | ||
2125 | 1688 | if (register(_backgroundFixed, element, element.currentStyle.backgroundAttachment === "fixed" && !element.contains(body))) { | ||
2126 | 1689 | _fixBackground(); | ||
2127 | 1690 | util.bgLeft(element); | ||
2128 | 1691 | util.bgTop(element); | ||
2129 | 1692 | _backgroundPosition(element); | ||
2130 | 1693 | } | ||
2131 | 1694 | }; | ||
2132 | 1695 | |||
2133 | 1696 | function _backgroundPosition(element) { | ||
2134 | 1697 | _tmp.src = element.currentStyle.backgroundImage.slice(5, -2); | ||
2135 | 1698 | var parentElement = element.canHaveChildren ? element : element.parentElement; | ||
2136 | 1699 | parentElement.appendChild(_tmp); | ||
2137 | 1700 | util.setOffsetLeft(element); | ||
2138 | 1701 | util.setOffsetTop(element); | ||
2139 | 1702 | parentElement.removeChild(_tmp); | ||
2140 | 1703 | }; | ||
2141 | 1704 | |||
2142 | 1705 | // ----------------------------------------------------------------------- | ||
2143 | 1706 | // position: fixed | ||
2144 | 1707 | // ----------------------------------------------------------------------- | ||
2145 | 1708 | |||
2146 | 1709 | function _positionFixed(element) { | ||
2147 | 1710 | if (register(_positionFixed, element, isFixed(element))) { | ||
2148 | 1711 | setOverrideStyle(element, "position", "absolute"); | ||
2149 | 1712 | setOverrideStyle(element, "left", element.currentStyle.left); | ||
2150 | 1713 | setOverrideStyle(element, "top", element.currentStyle.top); | ||
2151 | 1714 | _fixBackground(); | ||
2152 | 1715 | IE7.Layout.fixRight(element); | ||
2153 | 1716 | //IE7.Layout.fixBottom(element); | ||
2154 | 1717 | _foregroundPosition(element); | ||
2155 | 1718 | } | ||
2156 | 1719 | }; | ||
2157 | 1720 | |||
2158 | 1721 | function _foregroundPosition(element, recalc) { | ||
2159 | 1722 | document.body.getBoundingClientRect(); // force a reflow | ||
2160 | 1723 | util.positionTop(element, recalc); | ||
2161 | 1724 | util.positionLeft(element, recalc, true); | ||
2162 | 1725 | if (!element.runtimeStyle.autoLeft && element.currentStyle.marginLeft === "auto" && | ||
2163 | 1726 | element.currentStyle.right !== "auto") { | ||
2164 | 1727 | var left = viewport.clientWidth - util.getPixelWidth(element, element.currentStyle.right) - | ||
2165 | 1728 | util.getPixelWidth(element, element.runtimeStyle._left) - element.clientWidth; | ||
2166 | 1729 | if (element.currentStyle.marginRight === "auto") left = parseInt(left / 2); | ||
2167 | 1730 | if (_isFixed(element.offsetParent)) element.runtimeStyle.pixelLeft += left; | ||
2168 | 1731 | else element.runtimeStyle.shiftLeft = left; | ||
2169 | 1732 | } | ||
2170 | 1733 | if (!element.runtimeStyle.fixedWidth) util.clipWidth(element); | ||
2171 | 1734 | if (!element.runtimeStyle.fixedHeight) util.clipHeight(element); | ||
2172 | 1735 | }; | ||
2173 | 1736 | |||
2174 | 1737 | // ----------------------------------------------------------------------- | ||
2175 | 1738 | // capture window resize | ||
2176 | 1739 | // ----------------------------------------------------------------------- | ||
2177 | 1740 | |||
2178 | 1741 | function _resize() { | ||
2179 | 1742 | // if the window has been resized then some positions need to be | ||
2180 | 1743 | // recalculated (especially those aligned to "right" or "top" | ||
2181 | 1744 | var elements = _backgroundFixed.elements; | ||
2182 | 1745 | for (var i in elements) _backgroundPosition(elements[i]); | ||
2183 | 1746 | elements = _positionFixed.elements; | ||
2184 | 1747 | for (i in elements) { | ||
2185 | 1748 | _foregroundPosition(elements[i], true); | ||
2186 | 1749 | _foregroundPosition(elements[i], true); | ||
2187 | 1750 | } | ||
2188 | 1751 | _timer = 0; | ||
2189 | 1752 | }; | ||
2190 | 1753 | |||
2191 | 1754 | // use a timer (sometimes this is a good way to prevent resize loops) | ||
2192 | 1755 | var _timer; | ||
2193 | 1756 | addResize(function() { | ||
2194 | 1757 | if (!_timer) _timer = setTimeout(_resize, 100); | ||
2195 | 1758 | }); | ||
2196 | 1759 | |||
2197 | 1760 | // ----------------------------------------------------------------------- | ||
2198 | 1761 | // rotated | ||
2199 | 1762 | // ----------------------------------------------------------------------- | ||
2200 | 1763 | |||
2201 | 1764 | var util = {}; | ||
2202 | 1765 | |||
2203 | 1766 | var _horizontal = function(util) { | ||
2204 | 1767 | util.bgLeft = function(element) { | ||
2205 | 1768 | element.style.backgroundPositionX = element.currentStyle.backgroundPositionX; | ||
2206 | 1769 | if (!_isFixed(element)) { | ||
2207 | 1770 | _setExpression(element, "backgroundPositionX", "(parseInt(runtimeStyle.offsetLeft)+document." + $viewport + ".scrollLeft)||0"); | ||
2208 | 1771 | } | ||
2209 | 1772 | }; | ||
2210 | 1773 | |||
2211 | 1774 | util.setOffsetLeft = function(element) { | ||
2212 | 1775 | var propertyName = _isFixed(element) ? "backgroundPositionX" : "offsetLeft"; | ||
2213 | 1776 | element.runtimeStyle[propertyName] = | ||
2214 | 1777 | util.getOffsetLeft(element, element.style.backgroundPositionX) - | ||
2215 | 1778 | element.getBoundingClientRect().left - element.clientLeft + 2; | ||
2216 | 1779 | }; | ||
2217 | 1780 | |||
2218 | 1781 | util.getOffsetLeft = function(element, position) { | ||
2219 | 1782 | switch (position) { | ||
2220 | 1783 | case "left": | ||
2221 | 1784 | case "top": | ||
2222 | 1785 | return 0; | ||
2223 | 1786 | case "right": | ||
2224 | 1787 | case "bottom": | ||
2225 | 1788 | return viewport.clientWidth - _tmp.offsetWidth; | ||
2226 | 1789 | case "center": | ||
2227 | 1790 | return (viewport.clientWidth - _tmp.offsetWidth) / 2; | ||
2228 | 1791 | default: | ||
2229 | 1792 | if (PERCENT.test(position)) { | ||
2230 | 1793 | return parseInt((viewport.clientWidth - _tmp.offsetWidth) * parseFloat(position) / 100); | ||
2231 | 1794 | } | ||
2232 | 1795 | _tmp.style.left = position; | ||
2233 | 1796 | return _tmp.offsetLeft; | ||
2234 | 1797 | } | ||
2235 | 1798 | }; | ||
2236 | 1799 | |||
2237 | 1800 | util.clipWidth = function(element) { | ||
2238 | 1801 | var fixWidth = element.runtimeStyle.fixWidth; | ||
2239 | 1802 | element.runtimeStyle.borderRightWidth = ""; | ||
2240 | 1803 | element.runtimeStyle.width = fixWidth ? util.getPixelWidth(element, fixWidth) + "px" : ""; | ||
2241 | 1804 | if (element.currentStyle.width !== "auto") { | ||
2242 | 1805 | var rect = element.getBoundingClientRect(); | ||
2243 | 1806 | var width = element.offsetWidth - viewport.clientWidth + rect.left - 2; | ||
2244 | 1807 | if (width >= 0) { | ||
2245 | 1808 | element.runtimeStyle.borderRightWidth = "0px"; | ||
2246 | 1809 | width = Math.max(getPixelValue(element, element.currentStyle.width) - width, 0); | ||
2247 | 1810 | setOverrideStyle(element, "width", width); | ||
2248 | 1811 | return width; | ||
2249 | 1812 | } | ||
2250 | 1813 | } | ||
2251 | 1814 | }; | ||
2252 | 1815 | |||
2253 | 1816 | util.positionLeft = function(element, recalc) { | ||
2254 | 1817 | // if the element's width is in % units then it must be recalculated | ||
2255 | 1818 | // with respect to the viewport | ||
2256 | 1819 | if (!recalc && PERCENT.test(element.currentStyle.width)) { | ||
2257 | 1820 | element.runtimeStyle.fixWidth = element.currentStyle.width; | ||
2258 | 1821 | } | ||
2259 | 1822 | if (element.runtimeStyle.fixWidth) { | ||
2260 | 1823 | element.runtimeStyle.width = util.getPixelWidth(element, element.runtimeStyle.fixWidth); | ||
2261 | 1824 | } | ||
2262 | 1825 | //if (recalc) { | ||
2263 | 1826 | // // if the element is fixed on the right then no need to recalculate | ||
2264 | 1827 | // if (!element.runtimeStyle.autoLeft) return; | ||
2265 | 1828 | //} else { | ||
2266 | 1829 | element.runtimeStyle.shiftLeft = 0; | ||
2267 | 1830 | element.runtimeStyle._left = element.currentStyle.left; | ||
2268 | 1831 | // is the element fixed on the right? | ||
2269 | 1832 | element.runtimeStyle.autoLeft = element.currentStyle.right !== "auto" && element.currentStyle.left === "auto"; | ||
2270 | 1833 | //} | ||
2271 | 1834 | // reset the element's "left" value and get it's natural position | ||
2272 | 1835 | element.runtimeStyle.left = ""; | ||
2273 | 1836 | element.runtimeStyle.screenLeft = util.getScreenLeft(element); | ||
2274 | 1837 | element.runtimeStyle.pixelLeft = element.runtimeStyle.screenLeft; | ||
2275 | 1838 | // if the element is contained by another fixed element then there is no need to | ||
2276 | 1839 | // continually recalculate it's left position | ||
2277 | 1840 | if (!recalc && !_isFixed(element.offsetParent)) { | ||
2278 | 1841 | // onsrcoll produces jerky movement, so we use an expression | ||
2279 | 1842 | _setExpression(element, "pixelLeft", "runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document." + $viewport + ".scrollLeft"); | ||
2280 | 1843 | } | ||
2281 | 1844 | }; | ||
2282 | 1845 | |||
2283 | 1846 | // I've forgotten how this works... | ||
2284 | 1847 | util.getScreenLeft = function(element) { // thanks to kevin newman (captainn) | ||
2285 | 1848 | var screenLeft = element.offsetLeft, nested = 1; | ||
2286 | 1849 | if (element.runtimeStyle.autoLeft) { | ||
2287 | 1850 | screenLeft = viewport.clientWidth - element.offsetWidth - util.getPixelWidth(element, element.currentStyle.right); | ||
2288 | 1851 | } | ||
2289 | 1852 | // accommodate margins | ||
2290 | 1853 | if (element.currentStyle.marginLeft !== "auto") { | ||
2291 | 1854 | screenLeft -= util.getPixelWidth(element, element.currentStyle.marginLeft); | ||
2292 | 1855 | } | ||
2293 | 1856 | while (element = element.offsetParent) { | ||
2294 | 1857 | if (element.currentStyle.position !== "static") nested = -1; | ||
2295 | 1858 | screenLeft += element.offsetLeft * nested; | ||
2296 | 1859 | } | ||
2297 | 1860 | return screenLeft; | ||
2298 | 1861 | }; | ||
2299 | 1862 | |||
2300 | 1863 | util.getPixelWidth = function(element, value) { | ||
2301 | 1864 | return PERCENT.test(value) ? parseInt(parseFloat(value) / 100 * viewport.clientWidth) : getPixelValue(element, value); | ||
2302 | 1865 | }; | ||
2303 | 1866 | }; | ||
2304 | 1867 | eval("var _vertical=" + rotate(_horizontal)); | ||
2305 | 1868 | _horizontal(util); | ||
2306 | 1869 | _vertical(util); | ||
2307 | 1870 | })(); | ||
2308 | 1871 | |||
2309 | 1872 | // ========================================================================= | ||
2310 | 1873 | // ie7-oveflow.js | ||
2311 | 1874 | // ========================================================================= | ||
2312 | 1875 | |||
2313 | 1876 | /* --------------------------------------------------------------------- | ||
2314 | 1877 | |||
2315 | 1878 | This module alters the structure of the document. | ||
2316 | 1879 | It may adversely affect other CSS rules. Be warned. | ||
2317 | 1880 | |||
2318 | 1881 | --------------------------------------------------------------------- */ | ||
2319 | 1882 | |||
2320 | 1883 | if (appVersion < 7) { | ||
2321 | 1884 | var WRAPPER_STYLE = { | ||
2322 | 1885 | backgroundColor: "transparent", | ||
2323 | 1886 | backgroundImage: "none", | ||
2324 | 1887 | backgroundPositionX: null, | ||
2325 | 1888 | backgroundPositionY: null, | ||
2326 | 1889 | backgroundRepeat: null, | ||
2327 | 1890 | borderTopWidth: 0, | ||
2328 | 1891 | borderRightWidth: 0, | ||
2329 | 1892 | borderBottomWidth: 0, | ||
2330 | 1893 | borderLeftStyle: "none", | ||
2331 | 1894 | borderTopStyle: "none", | ||
2332 | 1895 | borderRightStyle: "none", | ||
2333 | 1896 | borderBottomStyle: "none", | ||
2334 | 1897 | borderLeftWidth: 0, | ||
2335 | 1898 | borderLeftColor: "#000", | ||
2336 | 1899 | borderTopColor: "#000", | ||
2337 | 1900 | borderRightColor: "#000", | ||
2338 | 1901 | borderBottomColor: "#000", | ||
2339 | 1902 | height: null, | ||
2340 | 1903 | marginTop: 0, | ||
2341 | 1904 | marginBottom: 0, | ||
2342 | 1905 | marginRight: 0, | ||
2343 | 1906 | marginLeft: 0, | ||
2344 | 1907 | width: "100%" | ||
2345 | 1908 | }; | ||
2346 | 1909 | |||
2347 | 1910 | IE7.CSS.addRecalc("overflow", "visible", function(element) { | ||
2348 | 1911 | if (element.currentStyle.position === "absolute") return; | ||
2349 | 1912 | |||
2350 | 1913 | // don't do this again | ||
2351 | 1914 | if (element.parentNode.ie7_wrapped) return; | ||
2352 | 1915 | |||
2353 | 1916 | // if max-height is applied, makes sure it gets applied first | ||
2354 | 1917 | if (IE7.Layout && element.currentStyle["max-height"] !== "auto") { | ||
2355 | 1918 | IE7.Layout.maxHeight(element); | ||
2356 | 1919 | } | ||
2357 | 1920 | |||
2358 | 1921 | if (element.currentStyle.marginLeft === "auto") element.style.marginLeft = 0; | ||
2359 | 1922 | if (element.currentStyle.marginRight === "auto") element.style.marginRight = 0; | ||
2360 | 1923 | |||
2361 | 1924 | var wrapper = document.createElement(ANON); | ||
2362 | 1925 | wrapper.ie7_wrapped = element; | ||
2363 | 1926 | for (var propertyName in WRAPPER_STYLE) { | ||
2364 | 1927 | wrapper.style[propertyName] = element.currentStyle[propertyName]; | ||
2365 | 1928 | if (WRAPPER_STYLE[propertyName] != null) { | ||
2366 | 1929 | element.runtimeStyle[propertyName] = WRAPPER_STYLE[propertyName]; | ||
2367 | 1930 | } | ||
2368 | 1931 | } | ||
2369 | 1932 | wrapper.style.display = "block"; | ||
2370 | 1933 | wrapper.style.position = "relative"; | ||
2371 | 1934 | element.runtimeStyle.position = "absolute"; | ||
2372 | 1935 | element.parentNode.insertBefore(wrapper, element); | ||
2373 | 1936 | wrapper.appendChild(element); | ||
2374 | 1937 | }); | ||
2375 | 1938 | } | ||
2376 | 1939 | |||
2377 | 1940 | // ========================================================================= | ||
2378 | 1941 | // ie7-quirks.js | ||
2379 | 1942 | // ========================================================================= | ||
2380 | 1943 | |||
2381 | 1944 | function ie7Quirks() { | ||
2382 | 1945 | var FONT_SIZES = "xx-small,x-small,small,medium,large,x-large,xx-large".split(","); | ||
2383 | 1946 | for (var i = 0; i < FONT_SIZES.length; i++) { | ||
2384 | 1947 | FONT_SIZES[FONT_SIZES[i]] = FONT_SIZES[i - 1] || "0.67em"; | ||
2385 | 1948 | } | ||
2386 | 1949 | |||
2387 | 1950 | IE7.CSS.addFix(/(font(-size)?\s*:\s*)([\w.-]+)/, function(match, label, size, value) { | ||
2388 | 1951 | return label + (FONT_SIZES[value] || value); | ||
2389 | 1952 | }); | ||
2390 | 1953 | |||
2391 | 1954 | var NEGATIVE = /^\-/, LENGTH = /(em|ex)$/i; | ||
2392 | 1955 | var EM = /em$/i, EX = /ex$/i; | ||
2393 | 1956 | |||
2394 | 1957 | getPixelValue = function(element, value) { | ||
2395 | 1958 | if (PIXEL.test(value)) return parseInt(value)||0; | ||
2396 | 1959 | var scale = NEGATIVE.test(value)? -1 : 1; | ||
2397 | 1960 | if (LENGTH.test(value)) scale *= getFontScale(element); | ||
2398 | 1961 | temp.style.width = scale < 0 ? value.slice(1) : value; | ||
2399 | 1962 | body.appendChild(temp); | ||
2400 | 1963 | // retrieve pixel width | ||
2401 | 1964 | value = scale * temp.offsetWidth; | ||
2402 | 1965 | // remove the temporary element | ||
2403 | 1966 | temp.removeNode(); | ||
2404 | 1967 | return parseInt(value); | ||
2405 | 1968 | }; | ||
2406 | 1969 | |||
2407 | 1970 | var temp = createTempElement(); | ||
2408 | 1971 | function getFontScale(element) { | ||
2409 | 1972 | var scale = 1; | ||
2410 | 1973 | temp.style.fontFamily = element.currentStyle.fontFamily; | ||
2411 | 1974 | temp.style.lineHeight = element.currentStyle.lineHeight; | ||
2412 | 1975 | //temp.style.fontSize = ""; | ||
2413 | 1976 | while (element != body) { | ||
2414 | 1977 | var fontSize = element.currentStyle["ie7-font-size"]; | ||
2415 | 1978 | if (fontSize) { | ||
2416 | 1979 | if (EM.test(fontSize)) scale *= parseFloat(fontSize); | ||
2417 | 1980 | else if (PERCENT.test(fontSize)) scale *= (parseFloat(fontSize) / 100); | ||
2418 | 1981 | else if (EX.test(fontSize)) scale *= (parseFloat(fontSize) / 2); | ||
2419 | 1982 | else { | ||
2420 | 1983 | temp.style.fontSize = fontSize; | ||
2421 | 1984 | return 1; | ||
2422 | 1985 | } | ||
2423 | 1986 | } | ||
2424 | 1987 | element = element.parentElement; | ||
2425 | 1988 | } | ||
2426 | 1989 | return scale; | ||
2427 | 1990 | }; | ||
2428 | 1991 | |||
2429 | 1992 | // cursor:pointer (IE5.x) | ||
2430 | 1993 | IE7.CSS.addFix(/cursor\s*:\s*pointer/, "cursor:hand"); | ||
2431 | 1994 | // display:list-item (IE5.x) | ||
2432 | 1995 | IE7.CSS.addFix(/display\s*:\s*list-item/, "display:block"); | ||
2433 | 1996 | |||
2434 | 1997 | // ----------------------------------------------------------------------- | ||
2435 | 1998 | // margin:auto | ||
2436 | 1999 | // ----------------------------------------------------------------------- | ||
2437 | 2000 | |||
2438 | 2001 | function fixMargin(element) { | ||
2439 | 2002 | var parent = element.parentElement; | ||
2440 | 2003 | var margin = parent.offsetWidth - element.offsetWidth - getPaddingWidth(parent); | ||
2441 | 2004 | var autoRight = (element.currentStyle["ie7-margin"] && element.currentStyle.marginRight === "auto") || | ||
2442 | 2005 | element.currentStyle["ie7-margin-right"] === "auto"; | ||
2443 | 2006 | switch (parent.currentStyle.textAlign) { | ||
2444 | 2007 | case "right": | ||
2445 | 2008 | margin = autoRight ? parseInt(margin / 2) : 0; | ||
2446 | 2009 | element.runtimeStyle.marginRight = margin + "px"; | ||
2447 | 2010 | break; | ||
2448 | 2011 | case "center": | ||
2449 | 2012 | if (autoRight) margin = 0; | ||
2450 | 2013 | default: | ||
2451 | 2014 | if (autoRight) margin /= 2; | ||
2452 | 2015 | element.runtimeStyle.marginLeft = parseInt(margin) + "px"; | ||
2453 | 2016 | } | ||
2454 | 2017 | }; | ||
2455 | 2018 | |||
2456 | 2019 | function getPaddingWidth(element) { | ||
2457 | 2020 | return getPixelValue(element, element.currentStyle.paddingLeft) + | ||
2458 | 2021 | getPixelValue(element, element.currentStyle.paddingRight); | ||
2459 | 2022 | }; | ||
2460 | 2023 | |||
2461 | 2024 | IE7.CSS.addRecalc("margin(-left|-right)?", "[^};]*auto", function(element) { | ||
2462 | 2025 | if (register(fixMargin, element, | ||
2463 | 2026 | element.parentElement && | ||
2464 | 2027 | element.currentStyle.display === "block" && | ||
2465 | 2028 | element.currentStyle.marginLeft === "auto" && | ||
2466 | 2029 | element.currentStyle.position !== "absolute")) { | ||
2467 | 2030 | fixMargin(element); | ||
2468 | 2031 | } | ||
2469 | 2032 | }); | ||
2470 | 2033 | |||
2471 | 2034 | addResize(function() { | ||
2472 | 2035 | for (var i in fixMargin.elements) { | ||
2473 | 2036 | var element = fixMargin.elements[i]; | ||
2474 | 2037 | element.runtimeStyle.marginLeft = | ||
2475 | 2038 | element.runtimeStyle.marginRight = ""; | ||
2476 | 2039 | fixMargin(element); | ||
2477 | 2040 | } | ||
2478 | 2041 | }); | ||
2479 | 2042 | }; | ||
2480 | 2043 | |||
2481 | 2044 | |||
2482 | 2045 | // ========================================================================= | ||
2483 | 2046 | // ie8-css.js | ||
2484 | 2047 | // ========================================================================= | ||
2485 | 2048 | |||
2486 | 2049 | var BRACKETS = "\\([^)]+\\)"; | ||
2487 | 2050 | |||
2488 | 2051 | // pseudo-elements can be declared with a double colon | ||
2489 | 2052 | encoder.add(/::(before|after)/, ":$1"); | ||
2490 | 2053 | |||
2491 | 2054 | if (appVersion < 8) { | ||
2492 | 2055 | |||
2493 | 2056 | if (IE7.CSS.pseudoClasses) IE7.CSS.pseudoClasses += "|"; | ||
2494 | 2057 | IE7.CSS.pseudoClasses += "before|after|lang" + BRACKETS; | ||
2495 | 2058 | |||
2496 | 2059 | // ----------------------------------------------------------------------- | ||
2497 | 2060 | // propertyName: inherit; | ||
2498 | 2061 | // ----------------------------------------------------------------------- | ||
2499 | 2062 | |||
2500 | 2063 | function parseInherited(cssText) { | ||
2501 | 2064 | return cssText.replace(new RegExp("([{;\\s])(" + inheritedProperties.join("|") + ")\\s*:\\s*([^;}]+)", "g"), "$1$2:$3;ie7-$2:$3"); | ||
2502 | 2065 | }; | ||
2503 | 2066 | |||
2504 | 2067 | var INHERITED = /[\w-]+\s*:\s*inherit/g; | ||
2505 | 2068 | var STRIP_IE7_FLAGS = /ie7\-|\s*:\s*inherit/g; | ||
2506 | 2069 | var DASH_LOWER = /\-([a-z])/g; | ||
2507 | 2070 | function toUpper(match, chr) {return chr.toUpperCase()}; | ||
2508 | 2071 | |||
2509 | 2072 | IE7.CSS.addRecalc("[\\w-]+", "inherit", function(element, cssText) { | ||
2510 | 2073 | if (element.parentElement) { | ||
2511 | 2074 | var inherited = cssText.match(INHERITED); | ||
2512 | 2075 | for (var i = 0; i < inherited.length; i++) { | ||
2513 | 2076 | var propertyName = inherited[i].replace(STRIP_IE7_FLAGS, ""); | ||
2514 | 2077 | if (element.currentStyle["ie7-" + propertyName] === "inherit") { | ||
2515 | 2078 | propertyName = propertyName.replace(DASH_LOWER, toUpper); | ||
2516 | 2079 | element.runtimeStyle[propertyName] = element.parentElement.currentStyle[propertyName]; | ||
2517 | 2080 | } | ||
2518 | 2081 | } | ||
2519 | 2082 | } | ||
2520 | 2083 | }, function(match) { | ||
2521 | 2084 | inheritedProperties.push(rescape(match.slice(1).split(":")[0])); | ||
2522 | 2085 | return match; | ||
2523 | 2086 | }); | ||
2524 | 2087 | |||
2525 | 2088 | // ----------------------------------------------------------------------- | ||
2526 | 2089 | // dynamic pseudo-classes | ||
2527 | 2090 | // ----------------------------------------------------------------------- | ||
2528 | 2091 | |||
2529 | 2092 | var Focus = new DynamicPseudoClass("focus", function(element) { | ||
2530 | 2093 | var instance = arguments; | ||
2531 | 2094 | |||
2532 | 2095 | IE7.CSS.addEventHandler(element, "onfocus", function() { | ||
2533 | 2096 | Focus.unregister(instance); // in case it starts with focus | ||
2534 | 2097 | Focus.register(instance); | ||
2535 | 2098 | }); | ||
2536 | 2099 | |||
2537 | 2100 | IE7.CSS.addEventHandler(element, "onblur", function() { | ||
2538 | 2101 | Focus.unregister(instance); | ||
2539 | 2102 | }); | ||
2540 | 2103 | |||
2541 | 2104 | // check the active element for initial state | ||
2542 | 2105 | if (element == document.activeElement) { | ||
2543 | 2106 | Focus.register(instance) | ||
2544 | 2107 | } | ||
2545 | 2108 | }); | ||
2546 | 2109 | |||
2547 | 2110 | var Active = new DynamicPseudoClass("active", function(element) { | ||
2548 | 2111 | var instance = arguments; | ||
2549 | 2112 | IE7.CSS.addEventHandler(element, "onmousedown", function() { | ||
2550 | 2113 | Active.register(instance); | ||
2551 | 2114 | }); | ||
2552 | 2115 | }); | ||
2553 | 2116 | |||
2554 | 2117 | // globally trap the mouseup event (thanks Martijn!) | ||
2555 | 2118 | addEventHandler(document, "onmouseup", function() { | ||
2556 | 2119 | var instances = Active.instances; | ||
2557 | 2120 | for (var i in instances) Active.unregister(instances[i]); | ||
2558 | 2121 | }); | ||
2559 | 2122 | |||
2560 | 2123 | // ----------------------------------------------------------------------- | ||
2561 | 2124 | // IE7 pseudo elements | ||
2562 | 2125 | // ----------------------------------------------------------------------- | ||
2563 | 2126 | |||
2564 | 2127 | // constants | ||
2565 | 2128 | var URL = /^url\s*\(\s*([^)]*)\)$/; | ||
2566 | 2129 | var POSITION_MAP = { | ||
2567 | 2130 | before0: "beforeBegin", | ||
2568 | 2131 | before1: "afterBegin", | ||
2569 | 2132 | after0: "afterEnd", | ||
2570 | 2133 | after1: "beforeEnd" | ||
2571 | 2134 | }; | ||
2572 | 2135 | |||
2573 | 2136 | var PseudoElement = IE7.PseudoElement = Rule.extend({ | ||
2574 | 2137 | constructor: function(selector, position, cssText) { | ||
2575 | 2138 | // initialise object properties | ||
2576 | 2139 | this.position = position; | ||
2577 | 2140 | var content = cssText.match(PseudoElement.CONTENT), match, entity; | ||
2578 | 2141 | if (content) { | ||
2579 | 2142 | content = content[1]; | ||
2580 | 2143 | match = content.split(/\s+/); | ||
2581 | 2144 | for (var i = 0; (entity = match[i]); i++) { | ||
2582 | 2145 | match[i] = /^attr/.test(entity) ? {attr: entity.slice(5, -1)} : | ||
2583 | 2146 | entity.charAt(0) === "'" ? getString(entity) : decode(entity); | ||
2584 | 2147 | } | ||
2585 | 2148 | content = match; | ||
2586 | 2149 | } | ||
2587 | 2150 | this.content = content; | ||
2588 | 2151 | // CSS text needs to be decoded immediately | ||
2589 | 2152 | this.base(selector, decode(cssText)); | ||
2590 | 2153 | }, | ||
2591 | 2154 | |||
2592 | 2155 | init: function() { | ||
2593 | 2156 | // execute the underlying css query for this class | ||
2594 | 2157 | this.match = cssQuery(this.selector); | ||
2595 | 2158 | for (var i = 0; i < this.match.length; i++) { | ||
2596 | 2159 | var runtimeStyle = this.match[i].runtimeStyle; | ||
2597 | 2160 | if (!runtimeStyle[this.position]) runtimeStyle[this.position] = {cssText:""}; | ||
2598 | 2161 | runtimeStyle[this.position].cssText += ";" + this.cssText; | ||
2599 | 2162 | if (this.content != null) runtimeStyle[this.position].content = this.content; | ||
2600 | 2163 | } | ||
2601 | 2164 | }, | ||
2602 | 2165 | |||
2603 | 2166 | create: function(target) { | ||
2604 | 2167 | var generated = target.runtimeStyle[this.position]; | ||
2605 | 2168 | if (generated) { | ||
2606 | 2169 | // copy the array of values | ||
2607 | 2170 | var content = [].concat(generated.content || ""); | ||
2608 | 2171 | for (var j = 0; j < content.length; j++) { | ||
2609 | 2172 | if (typeof content[j] == "object") { | ||
2610 | 2173 | content[j] = target.getAttribute(content[j].attr); | ||
2611 | 2174 | } | ||
2612 | 2175 | } | ||
2613 | 2176 | content = content.join(""); | ||
2614 | 2177 | var url = content.match(URL); | ||
2615 | 2178 | var cssText = "overflow:hidden;" + generated.cssText.replace(/'/g, '"'); | ||
2616 | 2179 | var position = POSITION_MAP[this.position + Number(target.canHaveChildren)]; | ||
2617 | 2180 | var id = 'ie7_pseudo' + PseudoElement.count++; | ||
2618 | 2181 | target.insertAdjacentHTML(position, format(PseudoElement.ANON, this.className, id, cssText, url ? "" : content)); | ||
2619 | 2182 | if (url) { | ||
2620 | 2183 | var src = getString(url[1]); | ||
2621 | 2184 | var pseudoElement = document.getElementById(id); | ||
2622 | 2185 | pseudoElement.src = src; | ||
2623 | 2186 | addFilter(pseudoElement, "crop"); | ||
2624 | 2187 | var targetIsFloated = target.currentStyle.styleFloat !== "none"; | ||
2625 | 2188 | if (pseudoElement.currentStyle.display === "inline" || targetIsFloated) { | ||
2626 | 2189 | if (appVersion < 7 && targetIsFloated && target.canHaveChildren) { | ||
2627 | 2190 | target.runtimeStyle.display = "inline"; | ||
2628 | 2191 | target.runtimeStyle.position = "relative"; | ||
2629 | 2192 | pseudoElement.runtimeStyle.position = "absolute"; | ||
2630 | 2193 | } | ||
2631 | 2194 | pseudoElement.style.display = "inline-block"; | ||
2632 | 2195 | if (target.currentStyle.styleFloat !== "none") { | ||
2633 | 2196 | pseudoElement.style.pixelWidth = target.offsetWidth; | ||
2634 | 2197 | } | ||
2635 | 2198 | var image = new Image; | ||
2636 | 2199 | image.onload = function() { | ||
2637 | 2200 | pseudoElement.style.pixelWidth = this.width; | ||
2638 | 2201 | pseudoElement.style.pixelHeight = Math.max(this.height, pseudoElement.offsetHeight); | ||
2639 | 2202 | }; | ||
2640 | 2203 | image.src = src; | ||
2641 | 2204 | } | ||
2642 | 2205 | } | ||
2643 | 2206 | target.runtimeStyle[this.position] = null; | ||
2644 | 2207 | } | ||
2645 | 2208 | }, | ||
2646 | 2209 | |||
2647 | 2210 | recalc: function() { | ||
2648 | 2211 | if (this.content == null) return; | ||
2649 | 2212 | for (var i = 0; i < this.match.length; i++) { | ||
2650 | 2213 | this.create(this.match[i]); | ||
2651 | 2214 | } | ||
2652 | 2215 | }, | ||
2653 | 2216 | |||
2654 | 2217 | toString: function() { | ||
2655 | 2218 | return "." + this.className + "{display:inline}"; | ||
2656 | 2219 | } | ||
2657 | 2220 | }, { | ||
2658 | 2221 | CONTENT: /content\s*:\s*([^;]*)(;|$)/, | ||
2659 | 2222 | ANON: "<ie7:! class='ie7_anon %1' id=%2 style='%3'>%4</ie7:!>", | ||
2660 | 2223 | MATCH: /(.*):(before|after).*/, | ||
2661 | 2224 | |||
2662 | 2225 | count: 0 | ||
2663 | 2226 | }); | ||
2664 | 2227 | |||
2665 | 2228 | IE7._getLang = function(element) { | ||
2666 | 2229 | var lang = ""; | ||
2667 | 2230 | while (element && element.nodeType === 1) { | ||
2668 | 2231 | lang = element.lang || element.getAttribute("lang") || ""; | ||
2669 | 2232 | if (lang) break; | ||
2670 | 2233 | element = element.parentNode; | ||
2671 | 2234 | } | ||
2672 | 2235 | return lang; | ||
2673 | 2236 | }; | ||
2674 | 2237 | |||
2675 | 2238 | FILTER = extend(FILTER, { | ||
2676 | 2239 | ":lang\\(([^)]+)\\)": "((ii=IE7._getLang(e))==='$1'||ii.indexOf('$1-')===0)&&" | ||
2677 | 2240 | }); | ||
2678 | 2241 | } | ||
2679 | 2242 | |||
2680 | 2243 | // ========================================================================= | ||
2681 | 2244 | // ie8-html.js | ||
2682 | 2245 | // ========================================================================= | ||
2683 | 2246 | |||
2684 | 2247 | var UNSUCCESSFUL = /^(submit|reset|button)$/; | ||
2685 | 2248 | |||
2686 | 2249 | // ----------------------------------------------------------------------- | ||
2687 | 2250 | // <button> | ||
2688 | 2251 | // ----------------------------------------------------------------------- | ||
2689 | 2252 | |||
2690 | 2253 | // IE bug means that innerText is submitted instead of "value" | ||
2691 | 2254 | IE7.HTML.addRecalc("button,input", function(button) { | ||
2692 | 2255 | if (button.nodeName === "BUTTON") { | ||
2693 | 2256 | var match = button.outerHTML.match(/ value="([^"]*)"/i); | ||
2694 | 2257 | button.runtimeStyle.value = match ? match[1] : ""; | ||
2695 | 2258 | } | ||
2696 | 2259 | // flag the button/input that was used to submit the form | ||
2697 | 2260 | if (button.type === "submit") { | ||
2698 | 2261 | addEventHandler(button, "onclick", function() { | ||
2699 | 2262 | button.runtimeStyle.clicked = true; | ||
2700 | 2263 | setTimeout("document.all." + button.uniqueID + ".runtimeStyle.clicked=false", 1); | ||
2701 | 2264 | }); | ||
2702 | 2265 | } | ||
2703 | 2266 | }); | ||
2704 | 2267 | |||
2705 | 2268 | // ----------------------------------------------------------------------- | ||
2706 | 2269 | // <form> | ||
2707 | 2270 | // ----------------------------------------------------------------------- | ||
2708 | 2271 | |||
2709 | 2272 | // only submit "successful controls | ||
2710 | 2273 | IE7.HTML.addRecalc("form", function(form) { | ||
2711 | 2274 | addEventHandler(form, "onsubmit", function() { | ||
2712 | 2275 | for (var element, i = 0; element = form[i]; i++) { | ||
2713 | 2276 | if (UNSUCCESSFUL.test(element.type) && !element.disabled && !element.runtimeStyle.clicked) { | ||
2714 | 2277 | element.disabled = true; | ||
2715 | 2278 | setTimeout("document.all." + element.uniqueID + ".disabled=false", 1); | ||
2716 | 2279 | } else if (element.nodeName === "BUTTON" && element.type === "submit") { | ||
2717 | 2280 | setTimeout("document.all." + element.uniqueID + ".value='" + element.value + "'", 1); | ||
2718 | 2281 | element.value = element.runtimeStyle.value; | ||
2719 | 2282 | } | ||
2720 | 2283 | } | ||
2721 | 2284 | }); | ||
2722 | 2285 | }); | ||
2723 | 2286 | |||
2724 | 2287 | // ----------------------------------------------------------------------- | ||
2725 | 2288 | // <img> | ||
2726 | 2289 | // ----------------------------------------------------------------------- | ||
2727 | 2290 | |||
2728 | 2291 | // get rid of the spurious tooltip produced by the alt attribute on images | ||
2729 | 2292 | IE7.HTML.addRecalc("img", function(img) { | ||
2730 | 2293 | if (img.alt && !img.title) img.title = ""; | ||
2731 | 2294 | }); | ||
2732 | 2295 | |||
2733 | 2296 | // ========================================================================= | ||
2734 | 2297 | // ie8-layout.js | ||
2735 | 2298 | // ========================================================================= | ||
2736 | 2299 | |||
2737 | 2300 | if (appVersion < 8) { | ||
2738 | 2301 | IE7.CSS.addRecalc("border-spacing", NUMERIC, function(element) { | ||
2739 | 2302 | if (element.currentStyle.borderCollapse !== "collapse") { | ||
2740 | 2303 | element.cellSpacing = getPixelValue(element, element.currentStyle["ie7-border-spacing"].split(" ")[0]); | ||
2741 | 2304 | } | ||
2742 | 2305 | }); | ||
2743 | 2306 | IE7.CSS.addRecalc("box-sizing", "content-box", IE7.Layout.boxSizing); | ||
2744 | 2307 | IE7.CSS.addRecalc("box-sizing", "border-box", IE7.Layout.borderBox); | ||
2745 | 2308 | } | ||
2746 | 2309 | |||
2747 | 2310 | // ========================================================================= | ||
2748 | 2311 | // ie8-graphics.js | ||
2749 | 2312 | // ========================================================================= | ||
2750 | 2313 | |||
2751 | 2314 | if (appVersion < 8) { | ||
2752 | 2315 | // fix object[type=image/*] | ||
2753 | 2316 | var IMAGE = /^image/i; | ||
2754 | 2317 | IE7.HTML.addRecalc("object", function(element) { | ||
2755 | 2318 | if (IMAGE.test(element.type)) { | ||
2756 | 2319 | element.body.style.cssText = "margin:0;padding:0;border:none;overflow:hidden"; | ||
2757 | 2320 | return element; | ||
2758 | 2321 | } | ||
2759 | 2322 | }); | ||
2760 | 2323 | } | ||
2761 | 2324 | |||
2762 | 2325 | // ========================================================================= | ||
2763 | 2326 | // ie9-css.js | ||
2764 | 2327 | // ========================================================================= | ||
2765 | 2328 | |||
2766 | 2329 | var NOT_NEXT_BY_TYPE = "!IE7._getElementSiblingByType(e,'next')&&", | ||
2767 | 2330 | NOT_PREVIOUS_BY_TYPE = NOT_NEXT_BY_TYPE.replace("next", "previous"); | ||
2768 | 2331 | |||
2769 | 2332 | if (IE7.CSS.pseudoClasses) IE7.CSS.pseudoClasses += "|"; | ||
2770 | 2333 | IE7.CSS.pseudoClasses += "(?:first|last|only)\\-(?:child|of\\-type)|empty|root|target|" + | ||
2771 | 2334 | ("not|nth\\-child|nth\\-last\\-child|nth\\-of\\-type|nth\\-last\\-of\\-type".split("|").join(BRACKETS + "|") + BRACKETS); | ||
2772 | 2335 | |||
2773 | 2336 | // :checked | ||
2774 | 2337 | var Checked = new DynamicPseudoClass("checked", function(element) { | ||
2775 | 2338 | if (typeof element.checked !== "boolean") return; | ||
2776 | 2339 | var instance = arguments; | ||
2777 | 2340 | IE7.CSS.addEventHandler(element, "onpropertychange", function() { | ||
2778 | 2341 | if (event.propertyName === "checked") { | ||
2779 | 2342 | if (element.checked === true) Checked.register(instance); | ||
2780 | 2343 | else Checked.unregister(instance); | ||
2781 | 2344 | } | ||
2782 | 2345 | }); | ||
2783 | 2346 | // check current checked state | ||
2784 | 2347 | if (element.checked === true) Checked.register(instance); | ||
2785 | 2348 | }); | ||
2786 | 2349 | |||
2787 | 2350 | // :enabled | ||
2788 | 2351 | var Enabled = new DynamicPseudoClass("enabled", function(element) { | ||
2789 | 2352 | if (typeof element.disabled !== "boolean") return; | ||
2790 | 2353 | var instance = arguments; | ||
2791 | 2354 | IE7.CSS.addEventHandler(element, "onpropertychange", function() { | ||
2792 | 2355 | if (event.propertyName === "disabled") { | ||
2793 | 2356 | if (element.disabled === false) Enabled.register(instance); | ||
2794 | 2357 | else Enabled.unregister(instance); | ||
2795 | 2358 | } | ||
2796 | 2359 | }); | ||
2797 | 2360 | // check current disabled state | ||
2798 | 2361 | if (element.disabled === false) Enabled.register(instance); | ||
2799 | 2362 | }); | ||
2800 | 2363 | |||
2801 | 2364 | // :disabled | ||
2802 | 2365 | var Disabled = new DynamicPseudoClass("disabled", function(element) { | ||
2803 | 2366 | if (typeof element.disabled !== "boolean") return; | ||
2804 | 2367 | var instance = arguments; | ||
2805 | 2368 | IE7.CSS.addEventHandler(element, "onpropertychange", function() { | ||
2806 | 2369 | if (event.propertyName === "disabled") { | ||
2807 | 2370 | if (element.disabled === true) Disabled.register(instance); | ||
2808 | 2371 | else Disabled.unregister(instance); | ||
2809 | 2372 | } | ||
2810 | 2373 | }); | ||
2811 | 2374 | // check current disabled state | ||
2812 | 2375 | if (element.disabled === true) Disabled.register(instance); | ||
2813 | 2376 | }); | ||
2814 | 2377 | |||
2815 | 2378 | // :indeterminate (Kevin Newman) | ||
2816 | 2379 | var Indeterminate = new DynamicPseudoClass("indeterminate", function(element) { | ||
2817 | 2380 | if (typeof element.indeterminate !== "boolean") return; | ||
2818 | 2381 | var instance = arguments; | ||
2819 | 2382 | IE7.CSS.addEventHandler(element, "onpropertychange", function() { | ||
2820 | 2383 | if (event.propertyName === "indeterminate") { | ||
2821 | 2384 | if (element.indeterminate === true) Indeterminate.register(instance); | ||
2822 | 2385 | else Indeterminate.unregister(instance); | ||
2823 | 2386 | } | ||
2824 | 2387 | }); | ||
2825 | 2388 | IE7.CSS.addEventHandler(element, "onclick", function() { | ||
2826 | 2389 | Indeterminate.unregister(instance); | ||
2827 | 2390 | }); | ||
2828 | 2391 | // clever Kev says no need to check this up front | ||
2829 | 2392 | }); | ||
2830 | 2393 | |||
2831 | 2394 | // :target | ||
2832 | 2395 | var Target = new DynamicPseudoClass("target", function(element) { | ||
2833 | 2396 | var instance = arguments; | ||
2834 | 2397 | // if an element has a tabIndex then it can become "active". | ||
2835 | 2398 | // The default is zero anyway but it works... | ||
2836 | 2399 | if (!element.tabIndex) element.tabIndex = 0; | ||
2837 | 2400 | // this doesn't detect the back button. I don't know how to do that without adding an iframe :-( | ||
2838 | 2401 | IE7.CSS.addEventHandler(document, "onpropertychange", function() { | ||
2839 | 2402 | if (event.propertyName === "activeElement") { | ||
2840 | 2403 | if (element.id && element.id === location.hash.slice(1)) Target.register(instance); | ||
2841 | 2404 | else Target.unregister(instance); | ||
2842 | 2405 | } | ||
2843 | 2406 | }); | ||
2844 | 2407 | // check the current location | ||
2845 | 2408 | if (element.id && element.id === location.hash.slice(1)) Target.register(instance); | ||
2846 | 2409 | }); | ||
2847 | 2410 | |||
2848 | 2411 | // Register a node and index its siblings. | ||
2849 | 2412 | var _currentIndex = 1, // -@DRE | ||
2850 | 2413 | allIndexes = {_currentIndex: 1}; | ||
2851 | 2414 | |||
2852 | 2415 | IE7._indexOf = function(element, last, ofType) { | ||
2853 | 2416 | var parent = element.parentNode; | ||
2854 | 2417 | if (!parent || parent.nodeType !== 1) return NaN; | ||
2855 | 2418 | |||
2856 | 2419 | var tagName = ofType ? element.nodeName : ""; | ||
2857 | 2420 | if (tagName === "TR" && element.sectionRowIndex >= 0) { | ||
2858 | 2421 | var index = element.sectionRowIndex; | ||
2859 | 2422 | return last ? element.parentNode.rows.length - index + 1 : index; | ||
2860 | 2423 | } | ||
2861 | 2424 | if ((tagName === "TD" || tagName === "TH") && element.cellIndex >= 0) { | ||
2862 | 2425 | index = element.cellIndex; | ||
2863 | 2426 | return last ? element.parentNode.cells.length - index + 1 : index; | ||
2864 | 2427 | } | ||
2865 | 2428 | if (allIndexes._currentIndex !== _currentIndex) { | ||
2866 | 2429 | allIndexes = {_currentIndex: _currentIndex}; | ||
2867 | 2430 | } | ||
2868 | 2431 | var id = (parent.uniqueID) + "-" + tagName, | ||
2869 | 2432 | indexes = allIndexes[id]; | ||
2870 | 2433 | if (!indexes) { | ||
2871 | 2434 | indexes = {}; | ||
2872 | 2435 | var index = 0, | ||
2873 | 2436 | child = parent.firstChild; | ||
2874 | 2437 | while (child) { | ||
2875 | 2438 | if (ofType ? child.nodeName === tagName : child.nodeName > "@") { | ||
2876 | 2439 | indexes[child.uniqueID] = ++index; | ||
2877 | 2440 | } | ||
2878 | 2441 | child = child.nextSibling; | ||
2879 | 2442 | } | ||
2880 | 2443 | indexes.length = index; | ||
2881 | 2444 | allIndexes[id] = indexes; | ||
2882 | 2445 | } | ||
2883 | 2446 | index = indexes[element.uniqueID]; | ||
2884 | 2447 | return last ? indexes.length - index + 1 : index; | ||
2885 | 2448 | }; | ||
2886 | 2449 | |||
2887 | 2450 | IE7._isEmpty = function(node) { | ||
2888 | 2451 | node = node.firstChild; | ||
2889 | 2452 | while (node) { | ||
2890 | 2453 | if (node.nodeType === 3 || node.nodeName > "@") return false; | ||
2891 | 2454 | node = node.nextSibling; | ||
2892 | 2455 | } | ||
2893 | 2456 | return true; | ||
2894 | 2457 | }; | ||
2895 | 2458 | |||
2896 | 2459 | IE7._getElementSiblingByType = function(node, direction) { | ||
2897 | 2460 | var tagName = node.nodeName; | ||
2898 | 2461 | direction += "Sibling"; | ||
2899 | 2462 | do { | ||
2900 | 2463 | node = node[direction]; | ||
2901 | 2464 | if (node && node.nodeName === tagName) break; | ||
2902 | 2465 | } while (node); | ||
2903 | 2466 | return node; | ||
2904 | 2467 | }; | ||
2905 | 2468 | |||
2906 | 2469 | var ONE = {"+": 1, "-": -1}, SPACES = / /g; | ||
2907 | 2470 | |||
2908 | 2471 | FILTER = extend(extend({ | ||
2909 | 2472 | ":nth(-last)?-(?:child|(of-type))\\((<#nth_arg>)\\)(<#filter>)?": function(match, last, ofType, args, filters) { // :nth- pseudo classes | ||
2910 | 2473 | args = args.replace(SPACES, ""); | ||
2911 | 2474 | |||
2912 | 2475 | var index = "IE7._indexOf(e," + !!last + "," + !!ofType + ")"; | ||
2913 | 2476 | |||
2914 | 2477 | if (args === "even") args = "2n"; | ||
2915 | 2478 | else if (args === "odd") args = "2n+1"; | ||
2916 | 2479 | else if (!isNaN(args)) args = "0n" + ~~args; | ||
2917 | 2480 | |||
2918 | 2481 | args = args.split("n"); | ||
2919 | 2482 | var a = ~~(ONE[args[0]] || args[0] || 1), | ||
2920 | 2483 | b = ~~args[1]; | ||
2921 | 2484 | if (a === 0) { | ||
2922 | 2485 | var expr = index + "===" + b; | ||
2923 | 2486 | } else { | ||
2924 | 2487 | expr = "((ii=" + index + ")-(" + b + "))%" + a + "===0&&ii" + (a < 0 ? "<" : ">") + "=" + b; | ||
2925 | 2488 | } | ||
2926 | 2489 | return this.parse(filters) + expr + "&&"; | ||
2927 | 2490 | }, | ||
2928 | 2491 | |||
2929 | 2492 | "<#negation>": function(match, simple) { | ||
2930 | 2493 | if (/:not/i.test(simple)) throwSelectorError(); | ||
2931 | 2494 | |||
2932 | 2495 | if (/^[#.:\[]/.test(simple)) { | ||
2933 | 2496 | simple = "*" + simple; | ||
2934 | 2497 | } | ||
2935 | 2498 | return "!(" + MATCHER.parse(simple).slice(3, -2) + ")&&"; | ||
2936 | 2499 | } | ||
2937 | 2500 | }, FILTER), { | ||
2938 | 2501 | ":checked": "e.checked===true&&", | ||
2939 | 2502 | ":disabled": "e.disabled===true&&", | ||
2940 | 2503 | ":enabled": "e.disabled===false&&", | ||
2941 | 2504 | ":last-child": "!" + NEXT_SIBLING + "&&", | ||
2942 | 2505 | ":only-child": "!" + PREVIOUS_SIBLING + "&&!" + NEXT_SIBLING + "&&", | ||
2943 | 2506 | ":first-of-type": NOT_PREVIOUS_BY_TYPE, | ||
2944 | 2507 | ":last-of-type": NOT_NEXT_BY_TYPE, | ||
2945 | 2508 | ":only-of-type": NOT_PREVIOUS_BY_TYPE + NOT_NEXT_BY_TYPE, | ||
2946 | 2509 | |||
2947 | 2510 | ":empty": "IE7._isEmpty(e)&&", | ||
2948 | 2511 | ":root": "e==R&&", | ||
2949 | 2512 | ":target": "H&&" + ID_ATTRIBUTE + "===H&&" | ||
2950 | 2513 | }); | ||
2951 | 2514 | |||
2952 | 2515 | var HTML5 = "article,aside,audio,canvas,details,figcaption,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(","); | ||
2953 | 2516 | for (var i = 0, tagName; tagName = HTML5[i]; i++) document.createElement(tagName); | ||
2954 | 2517 | |||
2955 | 2518 | HEADER += "datalist{display:none}\ | ||
2956 | 2519 | details{padding-left:40px;display:block;margin:1em 0}\ | ||
2957 | 2520 | meter,progress{vertical-align:-0.2em;width:5em;height:1em;display:inline-block}\ | ||
2958 | 2521 | progress{width:10em;}\ | ||
2959 | 2522 | article,aside,figcaption,footer,header,hgroup,summary,section,nav{display:block;margin:1em 0}\ | ||
2960 | 2523 | figure{margin:1em 40px;display:block}\ | ||
2961 | 2524 | mark{background:yellow}"; | ||
2962 | 2525 | |||
2963 | 2526 | // ========================================================================= | ||
2964 | 2527 | // ie9-layout.js | ||
2965 | 2528 | // ========================================================================= | ||
2966 | 2529 | |||
2967 | 2530 | // ========================================================================= | ||
2968 | 2531 | // ie9-graphics.js | ||
2969 | 2532 | // ========================================================================= | ||
2970 | 2533 | |||
2971 | 2534 | IE7.CSS.addFix(/\bopacity\s*:\s*([\d.]+)/, function(match, value) { | ||
2972 | 2535 | return "zoom:1;filter:Alpha(opacity=" + ((value * 100) || 1) + ")"; | ||
2973 | 2536 | }); | ||
2974 | 2537 | |||
2975 | 2538 | var MATCHER; | ||
2976 | 2539 | |||
2977 | 2540 | var cssQuery = (function() { | ||
2978 | 2541 | var CONTEXT = /^[>+~]/; | ||
2979 | 2542 | |||
2980 | 2543 | var useContext = false; | ||
2981 | 2544 | |||
2982 | 2545 | // This is not a selector engine in the strictest sense. So it's best to silently error. | ||
2983 | 2546 | function cssQuery(selector, context, single) { | ||
2984 | 2547 | selector = trim(selector); | ||
2985 | 2548 | if (!context) context = document; | ||
2986 | 2549 | var ref = context; | ||
2987 | 2550 | useContext = CONTEXT.test(selector); | ||
2988 | 2551 | if (useContext) { | ||
2989 | 2552 | context = context.parentNode; | ||
2990 | 2553 | selector = "*" + selector; | ||
2991 | 2554 | } | ||
2992 | 2555 | try { | ||
2993 | 2556 | return selectQuery.create(selector, useContext)(context, single ? null : [], ref); | ||
2994 | 2557 | } catch (ex) { | ||
2995 | 2558 | return single ? null : []; | ||
2996 | 2559 | } | ||
2997 | 2560 | }; | ||
2998 | 2561 | |||
2999 | 2562 | var VALID_SELECTOR = /^(\\.|[' >+~#.\[\]:*(),\w-\^|$=]|[^\x00-\xa0])+$/; | ||
3000 | 2563 | |||
3001 | 2564 | var _EVALUATED = /^(href|src)$/; | ||
3002 | 2565 | var _ATTRIBUTES = { | ||
3003 | 2566 | "class": "className", | ||
3004 | 2567 | "for": "htmlFor" | ||
3005 | 2568 | }; | ||
3006 | 2569 | |||
3007 | 2570 | var IE7_CLASS_NAMES = /\sie7_\w+/g; | ||
3008 | 2571 | |||
3009 | 2572 | var USE_IFLAG = /^(action|cite|codebase|data|dynsrc|href|longdesc|lowsrc|src|usemap|url)$/i; | ||
3010 | 2573 | |||
3011 | 2574 | IE7._getAttribute = function(element, name) { | ||
3012 | 2575 | if (element.getAttributeNode) { | ||
3013 | 2576 | var attribute = element.getAttributeNode(name); | ||
3014 | 2577 | } | ||
3015 | 2578 | name = _ATTRIBUTES[name.toLowerCase()] || name; | ||
3016 | 2579 | if (!attribute) attribute = element.attributes[name]; | ||
3017 | 2580 | var specified = attribute && attribute.specified; | ||
3018 | 2581 | |||
3019 | 2582 | if (element[name] && typeof element[name] == "boolean") return name.toLowerCase(); | ||
3020 | 2583 | if ((specified && USE_IFLAG.test(name)) || (!attribute && MSIE5) || name === "value" || name === "type") { | ||
3021 | 2584 | return element.getAttribute(name, 2); | ||
3022 | 2585 | } | ||
3023 | 2586 | if (name === "style") return element.style.cssText.toLowerCase() || null; | ||
3024 | 2587 | |||
3025 | 2588 | return specified ? String(attribute.nodeValue) : null; | ||
3026 | 2589 | }; | ||
3027 | 2590 | |||
3028 | 2591 | var names = "colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc"; | ||
3029 | 2592 | // Convert the list of strings to a hash, mapping the lowercase name to the camelCase name. | ||
3030 | 2593 | extend(_ATTRIBUTES, combine(names.toLowerCase().split(","), names.split(","))); | ||
3031 | 2594 | |||
3032 | 2595 | IE7._getElementSibling = function(node, direction) { | ||
3033 | 2596 | direction += "Sibling"; | ||
3034 | 2597 | do { | ||
3035 | 2598 | node = node[direction]; | ||
3036 | 2599 | if (node && node.nodeName > "@") break; | ||
3037 | 2600 | } while (node); | ||
3038 | 2601 | return node; | ||
3039 | 2602 | }; | ||
3040 | 2603 | |||
3041 | 2604 | var IMPLIED_ASTERISK = /(^|[, >+~])([#.:\[])/g, | ||
3042 | 2605 | BLOCKS = /\)\{/g, | ||
3043 | 2606 | COMMA = /,/, | ||
3044 | 2607 | QUOTED = /^['"]/, | ||
3045 | 2608 | HEX_ESCAPE = /\\([\da-f]{2,2})/gi, | ||
3046 | 2609 | LAST_CHILD = /last/i; | ||
3047 | 2610 | |||
3048 | 2611 | IE7._byId = function(document, id) { | ||
3049 | 2612 | var result = document.all[id] || null; | ||
3050 | 2613 | // Returns a single element or a collection. | ||
3051 | 2614 | if (!result || (result.nodeType && IE7._getAttribute(result, "id") === id)) return result; | ||
3052 | 2615 | // document.all has returned a collection of elements with name/id | ||
3053 | 2616 | for (var i = 0; i < result.length; i++) { | ||
3054 | 2617 | if (IE7._getAttribute(result[i], "id") === id) return result[i]; | ||
3055 | 2618 | } | ||
3056 | 2619 | return null; | ||
3057 | 2620 | }; | ||
3058 | 2621 | |||
3059 | 2622 | // ========================================================================= | ||
3060 | 2623 | // dom/selectors-api/CSSSelectorParser.js | ||
3061 | 2624 | // ========================================================================= | ||
3062 | 2625 | |||
3063 | 2626 | // http://www.w3.org/TR/css3-selectors/#w3cselgrammar (kinda) | ||
3064 | 2627 | var CSSSelectorParser = RegGrp.extend({ | ||
3065 | 2628 | dictionary: new Dictionary({ | ||
3066 | 2629 | ident: /\-?(\\.|[_a-z]|[^\x00-\xa0])(\\.|[\w-]|[^\x00-\xa0])*/, | ||
3067 | 2630 | combinator: /[\s>+~]/, | ||
3068 | 2631 | operator: /[\^~|$*]?=/, | ||
3069 | 2632 | nth_arg: /[+-]?\d+|[+-]?\d*n(?:\s*[+-]\s*\d+)?|even|odd/, | ||
3070 | 2633 | tag: /\*|<#ident>/, | ||
3071 | 2634 | id: /#(<#ident>)/, | ||
3072 | 2635 | 'class': /\.(<#ident>)/, | ||
3073 | 2636 | pseudo: /\:([\w-]+)(?:\(([^)]+)\))?/, | ||
3074 | 2637 | attr: /\[(<#ident>)(?:(<#operator>)((?:\\.|[^\[\]#.:])+))?\]/, | ||
3075 | 2638 | negation: /:not\((<#tag>|<#id>|<#class>|<#attr>|<#pseudo>)\)/, | ||
3076 | 2639 | sequence: /(\\.|[~*]=|\+\d|\+?\d*n\s*\+\s*\d|[^\s>+~,\*])+/, | ||
3077 | 2640 | filter: /[#.:\[]<#sequence>/, | ||
3078 | 2641 | selector: /[^>+~](\\.|[^,])*?/, | ||
3079 | 2642 | grammar: /^(<#selector>)((,<#selector>)*)$/ | ||
3080 | 2643 | }), | ||
3081 | 2644 | |||
3082 | 2645 | ignoreCase: true | ||
3083 | 2646 | }); | ||
3084 | 2647 | |||
3085 | 2648 | var normalizer = new CSSSelectorParser({ | ||
3086 | 2649 | "\\\\.|[~*]\\s+=|\\+\\s+\\d": RegGrp.IGNORE, | ||
3087 | 2650 | "\\[\\s+": "[", | ||
3088 | 2651 | "\\(\\s+": "(", | ||
3089 | 2652 | "\\s+\\)": ")", | ||
3090 | 2653 | "\\s+\\]": "]", | ||
3091 | 2654 | "\\s*([,>+~]|<#operator>)\\s*": "$1", | ||
3092 | 2655 | "\\s+$": "", | ||
3093 | 2656 | "\\s+": " " | ||
3094 | 2657 | }); | ||
3095 | 2658 | |||
3096 | 2659 | function normalize(selector) { | ||
3097 | 2660 | selector = normalizer.parse(selector.replace(HEX_ESCAPE, "\\x$1")) | ||
3098 | 2661 | .replace(UNESCAPE, "$1") | ||
3099 | 2662 | .replace(IMPLIED_ASTERISK, "$1*$2"); | ||
3100 | 2663 | if (!VALID_SELECTOR.test(selector)) throwSelectorError(); | ||
3101 | 2664 | return selector; | ||
3102 | 2665 | }; | ||
3103 | 2666 | |||
3104 | 2667 | function unescape(query) { | ||
3105 | 2668 | // put string values back | ||
3106 | 2669 | return query.replace(ESCAPED, unescapeString); | ||
3107 | 2670 | }; | ||
3108 | 2671 | |||
3109 | 2672 | function unescapeString(match, index) { | ||
3110 | 2673 | return strings[index]; | ||
3111 | 2674 | }; | ||
3112 | 2675 | |||
3113 | 2676 | var BRACES = /\{/g, BRACES_ESCAPED = /\\{/g; | ||
3114 | 2677 | |||
3115 | 2678 | function closeBlock(group) { | ||
3116 | 2679 | return Array((group.replace(BRACES_ESCAPED, "").match(BRACES) || "").length + 1).join("}"); | ||
3117 | 2680 | }; | ||
3118 | 2681 | |||
3119 | 2682 | FILTER = new CSSSelectorParser(FILTER); | ||
3120 | 2683 | |||
3121 | 2684 | var TARGET = /:target/i, ROOT = /:root/i; | ||
3122 | 2685 | |||
3123 | 2686 | function getConstants(selector) { | ||
3124 | 2687 | var constants = ""; | ||
3125 | 2688 | if (ROOT.test(selector)) constants += ",R=d.documentElement"; | ||
3126 | 2689 | if (TARGET.test(selector)) constants += ",H=d.location;H=H&&H.hash.replace('#','')"; | ||
3127 | 2690 | if (constants || selector.indexOf("#") !== -1) { | ||
3128 | 2691 | constants = ",t=c.nodeType,d=t===9?c:c.ownerDocument||(c.document||c).parentWindow.document" + constants; | ||
3129 | 2692 | } | ||
3130 | 2693 | return "var ii" + constants + ";"; | ||
3131 | 2694 | }; | ||
3132 | 2695 | |||
3133 | 2696 | var COMBINATOR = { | ||
3134 | 2697 | " ": ";while(e!=s&&(e=e.parentNode)&&e.nodeType===1){", | ||
3135 | 2698 | ">": ".parentElement;if(e){", | ||
3136 | 2699 | "+": ";while((e=e.previousSibling)&&!(" + IS_ELEMENT + "))continue;if(e){", | ||
3137 | 2700 | "~": ";while((e=e.previousSibling)){" + IF_ELEMENT | ||
3138 | 2701 | }; | ||
3139 | 2702 | |||
3140 | 2703 | var TOKEN = /\be\b/g; | ||
3141 | 2704 | |||
3142 | 2705 | MATCHER = new CSSSelectorParser({ | ||
3143 | 2706 | "(?:(<#selector>)(<#combinator>))?(<#tag>)(<#filter>)?$": function(match, before, combinator, tag, filters) { | ||
3144 | 2707 | var group = ""; | ||
3145 | 2708 | if (tag !== "*") { | ||
3146 | 2709 | var TAG = tag.toUpperCase(); | ||
3147 | 2710 | group += "if(e.nodeName==='" + TAG + (TAG === tag ? "" : "'||e.nodeName==='" + tag) + "'){"; | ||
3148 | 2711 | } | ||
3149 | 2712 | if (filters) { | ||
3150 | 2713 | group += "if(" + FILTER.parse(filters).slice(0, -2) + "){"; | ||
3151 | 2714 | } | ||
3152 | 2715 | group = group.replace(TOKEN, "e" + this.index); | ||
3153 | 2716 | if (combinator) { | ||
3154 | 2717 | group += "var e=e" + (this.index++) + COMBINATOR[combinator]; | ||
3155 | 2718 | group = group.replace(TOKEN, "e" + this.index); | ||
3156 | 2719 | } | ||
3157 | 2720 | if (before) { | ||
3158 | 2721 | group += this.parse(before); | ||
3159 | 2722 | } | ||
3160 | 2723 | return group; | ||
3161 | 2724 | } | ||
3162 | 2725 | }); | ||
3163 | 2726 | |||
3164 | 2727 | var BY_ID = "e0=IE7._byId(d,'%1');if(e0){", | ||
3165 | 2728 | BY_TAG_NAME = "var n=c.getElementsByTagName('%1');", | ||
3166 | 2729 | STORE = "if(r==null)return e0;r[k++]=e0;"; | ||
3167 | 2730 | |||
3168 | 2731 | var TAG_NAME = 1; | ||
3169 | 2732 | |||
3170 | 2733 | var SELECTOR = new CSSSelectorParser({ | ||
3171 | 2734 | "^((?:<#selector>)?(?:<#combinator>))(<#tag>)(<#filter>)?$": true | ||
3172 | 2735 | }); | ||
3173 | 2736 | |||
3174 | 2737 | var cache = {}; | ||
3175 | 2738 | |||
3176 | 2739 | var selectById = new CSSSelectorParser({ | ||
3177 | 2740 | "^(<#tag>)#(<#ident>)(<#filter>)?( [^,]*)?$": function(match, tagName, id, filters, after) { | ||
3178 | 2741 | var block = format(BY_ID, id), endBlock = "}"; | ||
3179 | 2742 | if (filters) { | ||
3180 | 2743 | block += MATCHER.parse(tagName + filters); | ||
3181 | 2744 | endBlock = closeBlock(block); | ||
3182 | 2745 | } | ||
3183 | 2746 | if (after) { | ||
3184 | 2747 | block += "s=c=e0;" + selectQuery.parse("*" + after); | ||
3185 | 2748 | } else { | ||
3186 | 2749 | block += STORE; | ||
3187 | 2750 | } | ||
3188 | 2751 | return block + endBlock; | ||
3189 | 2752 | }, | ||
3190 | 2753 | |||
3191 | 2754 | "^([^#,]+)#(<#ident>)(<#filter>)?$": function(match, before, id, filters) { | ||
3192 | 2755 | var block = format(BY_ID, id); | ||
3193 | 2756 | if (before === "*") { | ||
3194 | 2757 | block += STORE; | ||
3195 | 2758 | } else { | ||
3196 | 2759 | block += MATCHER.parse(before + filters) + STORE + "break"; | ||
3197 | 2760 | } | ||
3198 | 2761 | return block + closeBlock(block); | ||
3199 | 2762 | }, | ||
3200 | 2763 | |||
3201 | 2764 | "^.*$": "" | ||
3202 | 2765 | }); | ||
3203 | 2766 | |||
3204 | 2767 | var selectQuery = new CSSSelectorParser({ | ||
3205 | 2768 | "<#grammar>": function(match, selector, remainingSelectors) { | ||
3206 | 2769 | if (!this.groups) this.groups = []; | ||
3207 | 2770 | |||
3208 | 2771 | var group = SELECTOR.exec(" " + selector); | ||
3209 | 2772 | |||
3210 | 2773 | if (!group) throwSelectorError(); | ||
3211 | 2774 | |||
3212 | 2775 | this.groups.push(group.slice(1)); | ||
3213 | 2776 | |||
3214 | 2777 | if (remainingSelectors) { | ||
3215 | 2778 | return this.parse(remainingSelectors.replace(COMMA, "")); | ||
3216 | 2779 | } | ||
3217 | 2780 | |||
3218 | 2781 | var groups = this.groups, | ||
3219 | 2782 | tagName = groups[0][TAG_NAME]; // first tag name | ||
3220 | 2783 | |||
3221 | 2784 | for (var i = 1; group = groups[i]; i++) { // search tag names | ||
3222 | 2785 | if (tagName !== group[TAG_NAME]) { | ||
3223 | 2786 | tagName = "*"; // mixed tag names, so use "*" | ||
3224 | 2787 | break; | ||
3225 | 2788 | } | ||
3226 | 2789 | } | ||
3227 | 2790 | |||
3228 | 2791 | var matcher = "", store = STORE + "continue filtering;"; | ||
3229 | 2792 | |||
3230 | 2793 | for (var i = 0; group = groups[i]; i++) { | ||
3231 | 2794 | MATCHER.index = 0; | ||
3232 | 2795 | if (tagName !== "*") group[TAG_NAME] = "*"; // we are already filtering by tagName | ||
3233 | 2796 | group = group.join(""); | ||
3234 | 2797 | if (group === " *") { // select all | ||
3235 | 2798 | matcher = store; | ||
3236 | 2799 | break; | ||
3237 | 2800 | } else { | ||
3238 | 2801 | group = MATCHER.parse(group); | ||
3239 | 2802 | if (useContext) group += "if(e" + MATCHER.index + "==s){"; | ||
3240 | 2803 | matcher += group + store + closeBlock(group); | ||
3241 | 2804 | } | ||
3242 | 2805 | } | ||
3243 | 2806 | |||
3244 | 2807 | // reduce to a single loop | ||
3245 | 2808 | var isWild = tagName === "*"; | ||
3246 | 2809 | return (isWild ? "var n=c.all;" : format(BY_TAG_NAME, tagName)) + | ||
3247 | 2810 | "filtering:while((e0=n[i++]))" + | ||
3248 | 2811 | (isWild ? IF_ELEMENT.replace(TOKEN, "e0") : "{") + | ||
3249 | 2812 | matcher + | ||
3250 | 2813 | "}"; | ||
3251 | 2814 | }, | ||
3252 | 2815 | |||
3253 | 2816 | "^.*$": throwSelectorError | ||
3254 | 2817 | }); | ||
3255 | 2818 | |||
3256 | 2819 | var REDUNDANT_NODETYPE_CHECKS = /\&\&(e\d+)\.nodeType===1(\)\{\s*if\(\1\.nodeName=)/g; | ||
3257 | 2820 | |||
3258 | 2821 | selectQuery.create = function(selector) { | ||
3259 | 2822 | if (!cache[selector]) { | ||
3260 | 2823 | selector = normalize(selector); | ||
3261 | 2824 | this.groups = null; | ||
3262 | 2825 | MATCHER.index = 0; | ||
3263 | 2826 | var block = this.parse(selector); | ||
3264 | 2827 | this.groups = null; | ||
3265 | 2828 | MATCHER.index = 0; | ||
3266 | 2829 | if (selector.indexOf("#") !== -1) { | ||
3267 | 2830 | var byId = selectById.parse(selector); | ||
3268 | 2831 | if (byId) { | ||
3269 | 2832 | block = | ||
3270 | 2833 | "if(t===1||t===11|!c.getElementById){" + | ||
3271 | 2834 | block + | ||
3272 | 2835 | "}else{" + | ||
3273 | 2836 | byId + | ||
3274 | 2837 | "}"; | ||
3275 | 2838 | } | ||
3276 | 2839 | } | ||
3277 | 2840 | // remove redundant nodeType==1 checks | ||
3278 | 2841 | block = block.replace(REDUNDANT_NODETYPE_CHECKS, "$2"); | ||
3279 | 2842 | block = getConstants(selector) + decode(block); | ||
3280 | 2843 | cache[selector] = new Function("return function(c,r,s){var i=0,k=0,e0;" + block + "return r}")(); | ||
3281 | 2844 | } | ||
3282 | 2845 | return cache[selector]; | ||
3283 | 2846 | }; | ||
3284 | 2847 | |||
3285 | 2848 | return cssQuery; | ||
3286 | 2849 | })(); | ||
3287 | 2850 | |||
3288 | 2851 | function throwSelectorError() { | ||
3289 | 2852 | throw new SyntaxError("Invalid selector."); | ||
3290 | 2853 | }; | ||
3291 | 2854 | |||
3292 | 2855 | // ----------------------------------------------------------------------- | ||
3293 | 2856 | // initialisation | ||
3294 | 2857 | // ----------------------------------------------------------------------- | ||
3295 | 2858 | |||
3296 | 2859 | IE7.loaded = true; | ||
3297 | 2860 | |||
3298 | 2861 | (function() { | ||
3299 | 2862 | try { | ||
3300 | 2863 | // http://javascript.nwbox.com/IEContentLoaded/ | ||
3301 | 2864 | if (!document.body) throw "continue"; | ||
3302 | 2865 | documentElement.doScroll("left"); | ||
3303 | 2866 | } catch (ex) { | ||
3304 | 2867 | setTimeout(arguments.callee, 1); | ||
3305 | 2868 | return; | ||
3306 | 2869 | } | ||
3307 | 2870 | // execute the inner text of the IE7 script | ||
3308 | 2871 | try { | ||
3309 | 2872 | eval(script.innerHTML); | ||
3310 | 2873 | } catch (ex) { | ||
3311 | 2874 | // ignore errors | ||
3312 | 2875 | } | ||
3313 | 2876 | if (typeof IE7_PNG_SUFFIX == "object") { | ||
3314 | 2877 | PNG = IE7_PNG_SUFFIX; | ||
3315 | 2878 | } else { | ||
3316 | 2879 | PNG = new RegExp(rescape(window.IE7_PNG_SUFFIX || "-trans.png") + "(\\?.*)?$", "i"); | ||
3317 | 2880 | } | ||
3318 | 2881 | |||
3319 | 2882 | // frequently used references | ||
3320 | 2883 | body = document.body; | ||
3321 | 2884 | viewport = MSIE5 ? body : documentElement; | ||
3322 | 2885 | |||
3323 | 2886 | // classes | ||
3324 | 2887 | body.className += " ie7_body"; | ||
3325 | 2888 | documentElement.className += " ie7_html"; | ||
3326 | 2889 | |||
3327 | 2890 | if (MSIE5) ie7Quirks(); | ||
3328 | 2891 | |||
3329 | 2892 | IE7.CSS.init(); | ||
3330 | 2893 | IE7.HTML.init(); | ||
3331 | 2894 | |||
3332 | 2895 | IE7.HTML.apply(); | ||
3333 | 2896 | IE7.CSS.apply(); | ||
3334 | 2897 | |||
3335 | 2898 | IE7.recalc(); | ||
3336 | 2899 | })(); | ||
3337 | 2900 | |||
3338 | 2901 | })(this, document); | ||
3339 | 0 | 2902 | ||
3340 | === added file 'media/js/polyfills/IE9/src/squish.src.js' | |||
3341 | --- media/js/polyfills/IE9/src/squish.src.js 1970-01-01 00:00:00 +0000 | |||
3342 | +++ media/js/polyfills/IE9/src/squish.src.js 2012-03-26 20:23:22 +0000 | |||
3343 | @@ -0,0 +1,35 @@ | |||
3344 | 1 | /* --------------------------------------------------------------------- | ||
3345 | 2 | |||
3346 | 3 | Squish some IE bugs! | ||
3347 | 4 | |||
3348 | 5 | Some of these bug fixes may have adverse effects so they are | ||
3349 | 6 | not included in the standard library. Add your own if you want. | ||
3350 | 7 | |||
3351 | 8 | --------------------------------------------------------------------- */ | ||
3352 | 9 | |||
3353 | 10 | // NOTE: IE7.Layout.boxSizing is the same as the "Holly Hack" | ||
3354 | 11 | |||
3355 | 12 | if (IE7.loaded && IE7.appVersion < 7) { | ||
3356 | 13 | |||
3357 | 14 | // "doubled margin" bug | ||
3358 | 15 | // http://www.positioniseverything.net/explorer/doubled-margin.html | ||
3359 | 16 | IE7.CSS.addFix(/(float\s*:\s*(left|right))/, "display:inline;$1"); | ||
3360 | 17 | |||
3361 | 18 | // "peekaboo" bug | ||
3362 | 19 | // http://www.positioniseverything.net/explorer/peekaboo.html | ||
3363 | 20 | if (IE7.appVersion >= 6) IE7.CSS.addRecalc("float", "(left|right)", function(element) { | ||
3364 | 21 | IE7.Layout.boxSizing(element.parentElement); | ||
3365 | 22 | // "doubled margin" bug | ||
3366 | 23 | element.style.display = "inline"; | ||
3367 | 24 | }); | ||
3368 | 25 | |||
3369 | 26 | // "unscrollable content" bug | ||
3370 | 27 | // http://www.positioniseverything.net/explorer/unscrollable.html | ||
3371 | 28 | IE7.CSS.addRecalc("position", "absolute|fixed", function(element) { | ||
3372 | 29 | if (element.offsetParent && element.offsetParent.currentStyle.position === "relative") | ||
3373 | 30 | IE7.Layout.boxSizing(element.offsetParent); | ||
3374 | 31 | }); | ||
3375 | 32 | } | ||
3376 | 33 | |||
3377 | 34 | //# // get rid of Microsoft's pesky image toolbar | ||
3378 | 35 | //# document.write('<meta http-equiv="imagetoolbar" content="no">'); | ||
3379 | 0 | \ No newline at end of file | 36 | \ No newline at end of file |
3380 | 1 | 37 | ||
3381 | === added file 'media/js/polyfills/pie.js' | |||
3382 | --- media/js/polyfills/pie.js 1970-01-01 00:00:00 +0000 | |||
3383 | +++ media/js/polyfills/pie.js 2012-03-26 20:23:22 +0000 | |||
3384 | @@ -0,0 +1,140 @@ | |||
3385 | 1 | (function(){var doc=document;var PIE=window["PIE"];if(!PIE){PIE=window["PIE"]={CSS_PREFIX:"-pie-",STYLE_PREFIX:"Pie",CLASS_PREFIX:"pie_",tableCellTags:{"TD":1,"TH":1},childlessElements:{"TABLE":1,"THEAD":1,"TBODY":1,"TFOOT":1,"TR":1,"INPUT":1,"TEXTAREA":1,"SELECT":1,"OPTION":1,"IMG":1,"HR":1},focusableElements:{"A":1,"INPUT":1,"TEXTAREA":1,"SELECT":1,"BUTTON":1},inputButtonTypes:{"submit":1,"button":1,"reset":1},emptyFn:function(){}};try{doc.execCommand("BackgroundImageCache",false,true)}catch(e){}(function(){var ieVersion= | ||
3386 | 2 | 4,div=doc.createElement("div"),all=div.getElementsByTagName("i"),shape;while(div.innerHTML="<\!--[if gt IE "+ ++ieVersion+"]><i></i><![endif]--\>",all[0]);PIE.ieVersion=ieVersion;if(ieVersion===6)PIE.CSS_PREFIX=PIE.CSS_PREFIX.replace(/^-/,"");PIE.ieDocMode=doc.documentMode||PIE.ieVersion;div.innerHTML='<v:shape adj="1"/>';shape=div.firstChild;shape.style["behavior"]="url(#default#VML)";PIE.supportsVML=typeof shape["adj"]==="object"})();(function(){var vmlCreatorDoc,idNum=0,imageSizes={};PIE.Util= | ||
3387 | 3 | {createVmlElement:function(tag){var vmlPrefix="css3vml";if(!vmlCreatorDoc){vmlCreatorDoc=doc.createDocumentFragment();vmlCreatorDoc.namespaces.add(vmlPrefix,"urn:schemas-microsoft-com:vml")}return vmlCreatorDoc.createElement(vmlPrefix+":"+tag)},getUID:function(obj){return obj&&obj["_pieId"]||(obj["_pieId"]="_"+ ++idNum)},merge:function(obj1){var i,len,p,objN,args=arguments;for(i=1,len=args.length;i<len;i++){objN=args[i];for(p in objN)if(objN.hasOwnProperty(p))obj1[p]=objN[p]}return obj1},withImageSize:function(src, | ||
3388 | 4 | func,ctx){var size=imageSizes[src],img,queue;if(size)if(Object.prototype.toString.call(size)==="[object Array]")size.push([func,ctx]);else func.call(ctx,size);else{queue=imageSizes[src]=[[func,ctx]];img=new Image;img.onload=function(){size=imageSizes[src]={w:img.width,h:img.height};for(var i=0,len=queue.length;i<len;i++)queue[i][0].call(queue[i][1],size);img.onload=null};img.src=src}}}})();PIE.GradientUtil={getGradientMetrics:function(el,width,height,gradientInfo){var angle=gradientInfo.angle,startPos= | ||
3389 | 5 | gradientInfo.gradientStart,startX,startY,endX,endY,startCornerX,startCornerY,endCornerX,endCornerY,deltaX,deltaY,p,UNDEF;function findCorners(){startCornerX=angle>=90&&angle<270?width:0;startCornerY=angle<180?height:0;endCornerX=width-startCornerX;endCornerY=height-startCornerY}function normalizeAngle(){while(angle<0)angle+=360;angle=angle%360}if(startPos){startPos=startPos.coords(el,width,height);startX=startPos.x;startY=startPos.y}if(angle){angle=angle.degrees();normalizeAngle();findCorners();if(!startPos){startX= | ||
3390 | 6 | startCornerX;startY=startCornerY}p=PIE.GradientUtil.perpendicularIntersect(startX,startY,angle,endCornerX,endCornerY);endX=p[0];endY=p[1]}else if(startPos){endX=width-startX;endY=height-startY}else{startX=startY=endX=0;endY=height}deltaX=endX-startX;deltaY=endY-startY;if(angle===UNDEF){angle=!deltaX?deltaY<0?90:270:!deltaY?deltaX<0?180:0:-Math.atan2(deltaY,deltaX)/Math.PI*180;normalizeAngle();findCorners()}return{angle:angle,startX:startX,startY:startY,endX:endX,endY:endY,startCornerX:startCornerX, | ||
3391 | 7 | startCornerY:startCornerY,endCornerX:endCornerX,endCornerY:endCornerY,deltaX:deltaX,deltaY:deltaY,lineLength:PIE.GradientUtil.distance(startX,startY,endX,endY)}},perpendicularIntersect:function(x1,y1,angle,x2,y2){if(angle===0||angle===180)return[x2,y1];else if(angle===90||angle===270)return[x1,y2];else{var a1=Math.tan(-angle*Math.PI/180),c1=a1*x1-y1,a2=-1/a1,c2=a2*x2-y2,d=a2-a1,endX=(c2-c1)/d,endY=(a1*c2-a2*c1)/d;return[endX,endY]}},distance:function(p1x,p1y,p2x,p2y){var dx=p2x-p1x,dy=p2y-p1y;return Math.abs(dx=== | ||
3392 | 8 | 0?dy:dy===0?dx:Math.sqrt(dx*dx+dy*dy))}};PIE.Observable=function(){this.observers=[];this.indexes={}};PIE.Observable.prototype={observe:function(fn){var id=PIE.Util.getUID(fn),indexes=this.indexes,observers=this.observers;if(!(id in indexes)){indexes[id]=observers.length;observers.push(fn)}},unobserve:function(fn){var id=PIE.Util.getUID(fn),indexes=this.indexes;if(id&&id in indexes){delete this.observers[indexes[id]];delete indexes[id]}},fire:function(){var o=this.observers,i=o.length;while(i--)o[i]&& | ||
3393 | 9 | o[i]()}};PIE.Heartbeat=new PIE.Observable;PIE.Heartbeat.run=function(){var me=this;if(!me.running){setInterval(function(){me.fire()},250);me.running=1}};(function(){PIE.OnUnload=new PIE.Observable;function handleUnload(){PIE.OnUnload.fire();window.detachEvent("onunload",handleUnload);window["PIE"]=null}window.attachEvent("onunload",handleUnload);PIE.OnUnload.attachManagedEvent=function(target,name,handler){target.attachEvent(name,handler);this.observe(function(){target.detachEvent(name,handler)})}})(); | ||
3394 | 10 | PIE.OnResize=new PIE.Observable;PIE.OnUnload.attachManagedEvent(window,"onresize",function(){PIE.OnResize.fire()});(function(){PIE.OnScroll=new PIE.Observable;function scrolled(){PIE.OnScroll.fire()}PIE.OnUnload.attachManagedEvent(window,"onscroll",scrolled);PIE.OnResize.observe(scrolled)})();(function(){var elements;function beforePrint(){elements=PIE.Element.destroyAll()}function afterPrint(){if(elements){for(var i=0,len=elements.length;i<len;i++)PIE["attach"](elements[i]);elements=0}}PIE.OnUnload.attachManagedEvent(window, | ||
3395 | 11 | "onbeforeprint",beforePrint);PIE.OnUnload.attachManagedEvent(window,"onafterprint",afterPrint)})();PIE.OnMouseup=new PIE.Observable;PIE.OnUnload.attachManagedEvent(doc,"onmouseup",function(){PIE.OnMouseup.fire()});PIE.Length=function(){var lengthCalcEl=doc.createElement("length-calc"),parent=doc.documentElement,s=lengthCalcEl.style,conversions={},units=["mm","cm","in","pt","pc"],i=units.length,instances={};s.position="absolute";s.top=s.left="-9999px";parent.appendChild(lengthCalcEl);while(i--){lengthCalcEl.style.width= | ||
3396 | 12 | "100"+units[i];conversions[units[i]]=lengthCalcEl.offsetWidth/100}parent.removeChild(lengthCalcEl);lengthCalcEl.style.width="1em";function Length(val){this.val=val}Length.prototype={unitRE:/(px|em|ex|mm|cm|in|pt|pc|%)$/,getNumber:function(){var num=this.num,UNDEF;if(num===UNDEF)num=this.num=parseFloat(this.val);return num},getUnit:function(){var unit=this.unit,m;if(!unit){m=this.val.match(this.unitRE);unit=this.unit=m&&m[0]||"px"}return unit},isPercentage:function(){return this.getUnit()==="%"},pixels:function(el, | ||
3397 | 13 | pct100){var num=this.getNumber(),unit=this.getUnit();switch(unit){case "px":return num;case "%":return num*(typeof pct100==="function"?pct100():pct100)/100;case "em":return num*this.getEmPixels(el);case "ex":return num*this.getEmPixels(el)/2;default:return num*conversions[unit]}},getEmPixels:function(el){var fs=el.currentStyle.fontSize,px,parent,me;if(fs.indexOf("px")>0)return parseFloat(fs);else if(el.tagName in PIE.childlessElements){me=this;parent=el.parentNode;return PIE.getLength(fs).pixels(parent, | ||
3398 | 14 | function(){return me.getEmPixels(parent)})}else{el.appendChild(lengthCalcEl);px=lengthCalcEl.offsetWidth;if(lengthCalcEl.parentNode===el)el.removeChild(lengthCalcEl);return px}}};PIE.getLength=function(val){return instances[val]||(instances[val]=new Length(val))};return Length}();PIE.BgPosition=function(){var length_fifty=PIE.getLength("50%"),vert_idents={"top":1,"center":1,"bottom":1},horiz_idents={"left":1,"center":1,"right":1};function BgPosition(tokens){this.tokens=tokens}BgPosition.prototype= | ||
3399 | 15 | {getValues:function(){if(!this._values){var tokens=this.tokens,len=tokens.length,Tokenizer=PIE.Tokenizer,identType=Tokenizer.Type,length_zero=PIE.getLength("0"),type_ident=identType.IDENT,type_length=identType.LENGTH,type_percent=identType.PERCENT,type,value,vals=["left",length_zero,"top",length_zero];if(len===1){tokens.push(new Tokenizer.Token(type_ident,"center"));len++}if(len===2){if(type_ident&(tokens[0].tokenType|tokens[1].tokenType)&&tokens[0].tokenValue in vert_idents&&tokens[1].tokenValue in | ||
3400 | 16 | horiz_idents)tokens.push(tokens.shift());if(tokens[0].tokenType&type_ident)if(tokens[0].tokenValue==="center")vals[1]=length_fifty;else vals[0]=tokens[0].tokenValue;else if(tokens[0].isLengthOrPercent())vals[1]=PIE.getLength(tokens[0].tokenValue);if(tokens[1].tokenType&type_ident)if(tokens[1].tokenValue==="center")vals[3]=length_fifty;else vals[2]=tokens[1].tokenValue;else if(tokens[1].isLengthOrPercent())vals[3]=PIE.getLength(tokens[1].tokenValue)}else;this._values=vals}return this._values},coords:function(el, | ||
3401 | 17 | width,height){var vals=this.getValues(),pxX=vals[1].pixels(el,width),pxY=vals[3].pixels(el,height);return{x:vals[0]==="right"?width-pxX:pxX,y:vals[2]==="bottom"?height-pxY:pxY}}};return BgPosition}();PIE.BgSize=function(){var CONTAIN="contain",COVER="cover",AUTO="auto";function BgSize(w,h){this.w=w;this.h=h}BgSize.prototype={pixels:function(el,areaW,areaH,imgW,imgH){var me=this,w=me.w,h=me.h,areaRatio=areaW/areaH,imgRatio=imgW/imgH;if(w===CONTAIN){w=imgRatio>areaRatio?areaW:areaH*imgRatio;h=imgRatio> | ||
3402 | 18 | areaRatio?areaW/imgRatio:areaH}else if(w===COVER){w=imgRatio<areaRatio?areaW:areaH*imgRatio;h=imgRatio<areaRatio?areaW/imgRatio:areaH}else if(w===AUTO){h=h===AUTO?imgH:h.pixels(el,areaH);w=h*imgRatio}else{w=w.pixels(el,areaW);h=h===AUTO?w/imgRatio:h.pixels(el,areaH)}return{w:w,h:h}}};BgSize.DEFAULT=new BgSize(AUTO,AUTO);return BgSize}();PIE.Angle=function(){function Angle(val){this.val=val}Angle.prototype={unitRE:/[a-z]+$/i,getUnit:function(){return this._unit||(this._unit=this.val.match(this.unitRE)[0].toLowerCase())}, | ||
3403 | 19 | degrees:function(){var deg=this._deg,u,n;if(deg===undefined){u=this.getUnit();n=parseFloat(this.val,10);deg=this._deg=u==="deg"?n:u==="rad"?n/Math.PI*180:u==="grad"?n/400*360:u==="turn"?n*360:0}return deg}};return Angle}();PIE.Color=function(){var instances={};function Color(val){this.val=val}Color.rgbaRE=/\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+|\d*\.\d+)\s*\)\s*/;Color.names={"aliceblue":"F0F8FF","antiquewhite":"FAEBD7","aqua":"0FF","aquamarine":"7FFFD4","azure":"F0FFFF", | ||
3404 | 20 | "beige":"F5F5DC","bisque":"FFE4C4","black":"000","blanchedalmond":"FFEBCD","blue":"00F","blueviolet":"8A2BE2","brown":"A52A2A","burlywood":"DEB887","cadetblue":"5F9EA0","chartreuse":"7FFF00","chocolate":"D2691E","coral":"FF7F50","cornflowerblue":"6495ED","cornsilk":"FFF8DC","crimson":"DC143C","cyan":"0FF","darkblue":"00008B","darkcyan":"008B8B","darkgoldenrod":"B8860B","darkgray":"A9A9A9","darkgreen":"006400","darkkhaki":"BDB76B","darkmagenta":"8B008B","darkolivegreen":"556B2F","darkorange":"FF8C00", | ||
3405 | 21 | "darkorchid":"9932CC","darkred":"8B0000","darksalmon":"E9967A","darkseagreen":"8FBC8F","darkslateblue":"483D8B","darkslategray":"2F4F4F","darkturquoise":"00CED1","darkviolet":"9400D3","deeppink":"FF1493","deepskyblue":"00BFFF","dimgray":"696969","dodgerblue":"1E90FF","firebrick":"B22222","floralwhite":"FFFAF0","forestgreen":"228B22","fuchsia":"F0F","gainsboro":"DCDCDC","ghostwhite":"F8F8FF","gold":"FFD700","goldenrod":"DAA520","gray":"808080","green":"008000","greenyellow":"ADFF2F","honeydew":"F0FFF0", | ||
3406 | 22 | "hotpink":"FF69B4","indianred":"CD5C5C","indigo":"4B0082","ivory":"FFFFF0","khaki":"F0E68C","lavender":"E6E6FA","lavenderblush":"FFF0F5","lawngreen":"7CFC00","lemonchiffon":"FFFACD","lightblue":"ADD8E6","lightcoral":"F08080","lightcyan":"E0FFFF","lightgoldenrodyellow":"FAFAD2","lightgreen":"90EE90","lightgrey":"D3D3D3","lightpink":"FFB6C1","lightsalmon":"FFA07A","lightseagreen":"20B2AA","lightskyblue":"87CEFA","lightslategray":"789","lightsteelblue":"B0C4DE","lightyellow":"FFFFE0","lime":"0F0","limegreen":"32CD32", | ||
3407 | 23 | "linen":"FAF0E6","magenta":"F0F","maroon":"800000","mediumauqamarine":"66CDAA","mediumblue":"0000CD","mediumorchid":"BA55D3","mediumpurple":"9370D8","mediumseagreen":"3CB371","mediumslateblue":"7B68EE","mediumspringgreen":"00FA9A","mediumturquoise":"48D1CC","mediumvioletred":"C71585","midnightblue":"191970","mintcream":"F5FFFA","mistyrose":"FFE4E1","moccasin":"FFE4B5","navajowhite":"FFDEAD","navy":"000080","oldlace":"FDF5E6","olive":"808000","olivedrab":"688E23","orange":"FFA500","orangered":"FF4500", | ||
3408 | 24 | "orchid":"DA70D6","palegoldenrod":"EEE8AA","palegreen":"98FB98","paleturquoise":"AFEEEE","palevioletred":"D87093","papayawhip":"FFEFD5","peachpuff":"FFDAB9","peru":"CD853F","pink":"FFC0CB","plum":"DDA0DD","powderblue":"B0E0E6","purple":"800080","red":"F00","rosybrown":"BC8F8F","royalblue":"4169E1","saddlebrown":"8B4513","salmon":"FA8072","sandybrown":"F4A460","seagreen":"2E8B57","seashell":"FFF5EE","sienna":"A0522D","silver":"C0C0C0","skyblue":"87CEEB","slateblue":"6A5ACD","slategray":"708090","snow":"FFFAFA", | ||
3409 | 25 | "springgreen":"00FF7F","steelblue":"4682B4","tan":"D2B48C","teal":"008080","thistle":"D8BFD8","tomato":"FF6347","turquoise":"40E0D0","violet":"EE82EE","wheat":"F5DEB3","white":"FFF","whitesmoke":"F5F5F5","yellow":"FF0","yellowgreen":"9ACD32"};Color.prototype={parse:function(){if(!this._color){var me=this,v=me.val,vLower,m=v.match(Color.rgbaRE);if(m){me._color="rgb("+m[1]+","+m[2]+","+m[3]+")";me._alpha=parseFloat(m[4])}else{if((vLower=v.toLowerCase())in Color.names)v="#"+Color.names[vLower];me._color= | ||
3410 | 26 | v;me._alpha=v==="transparent"?0:1}}},colorValue:function(el){this.parse();return this._color==="currentColor"?el.currentStyle.color:this._color},alpha:function(){this.parse();return this._alpha}};PIE.getColor=function(val){return instances[val]||(instances[val]=new Color(val))};return Color}();PIE.Tokenizer=function(){function Tokenizer(css){this.css=css;this.ch=0;this.tokens=[];this.tokenIndex=0}var Type=Tokenizer.Type={ANGLE:1,CHARACTER:2,COLOR:4,DIMEN:8,FUNCTION:16,IDENT:32,LENGTH:64,NUMBER:128, | ||
3411 | 27 | OPERATOR:256,PERCENT:512,STRING:1024,URL:2048};Tokenizer.Token=function(type,value){this.tokenType=type;this.tokenValue=value};Tokenizer.Token.prototype={isLength:function(){return this.tokenType&Type.LENGTH||this.tokenType&Type.NUMBER&&this.tokenValue==="0"},isLengthOrPercent:function(){return this.isLength()||this.tokenType&Type.PERCENT}};Tokenizer.prototype={whitespace:/\s/,number:/^[\+\-]?(\d*\.)?\d+/,url:/^url\(\s*("([^"]*)"|'([^']*)'|([!#$%&*-~]*))\s*\)/i,ident:/^\-?[_a-z][\w-]*/i,string:/^("([^"]*)"|'([^']*)')/, | ||
3412 | 28 | operator:/^[\/,]/,hash:/^#[\w]+/,hashColor:/^#([\da-f]{6}|[\da-f]{3})/i,unitTypes:{"px":Type.LENGTH,"em":Type.LENGTH,"ex":Type.LENGTH,"mm":Type.LENGTH,"cm":Type.LENGTH,"in":Type.LENGTH,"pt":Type.LENGTH,"pc":Type.LENGTH,"deg":Type.ANGLE,"rad":Type.ANGLE,"grad":Type.ANGLE},colorFunctions:{"rgb":1,"rgba":1,"hsl":1,"hsla":1},next:function(forget){var css,ch,firstChar,match,val,me=this;function newToken(type,value){var tok=new Tokenizer.Token(type,value);if(!forget){me.tokens.push(tok);me.tokenIndex++}return tok} | ||
3413 | 29 | function failure(){me.tokenIndex++;return null}if(this.tokenIndex<this.tokens.length)return this.tokens[this.tokenIndex++];while(this.whitespace.test(this.css.charAt(this.ch)))this.ch++;if(this.ch>=this.css.length)return failure();ch=this.ch;css=this.css.substring(this.ch);firstChar=css.charAt(0);switch(firstChar){case "#":if(match=css.match(this.hashColor)){this.ch+=match[0].length;return newToken(Type.COLOR,match[0])}break;case '"':case "'":if(match=css.match(this.string)){this.ch+=match[0].length; | ||
3414 | 30 | return newToken(Type.STRING,match[2]||match[3]||"")}break;case "/":case ",":this.ch++;return newToken(Type.OPERATOR,firstChar);case "u":if(match=css.match(this.url)){this.ch+=match[0].length;return newToken(Type.URL,match[2]||match[3]||match[4]||"")}}if(match=css.match(this.number)){val=match[0];this.ch+=val.length;if(css.charAt(val.length)==="%"){this.ch++;return newToken(Type.PERCENT,val+"%")}if(match=css.substring(val.length).match(this.ident)){val+=match[0];this.ch+=match[0].length;return newToken(this.unitTypes[match[0].toLowerCase()]|| | ||
3415 | 31 | Type.DIMEN,val)}return newToken(Type.NUMBER,val)}if(match=css.match(this.ident)){val=match[0];this.ch+=val.length;if(val.toLowerCase()in PIE.Color.names||val==="currentColor"||val==="transparent")return newToken(Type.COLOR,val);if(css.charAt(val.length)==="("){this.ch++;if(val.toLowerCase()in this.colorFunctions){function isNum(tok){return tok&&tok.tokenType&Type.NUMBER}function isNumOrPct(tok){return tok&&tok.tokenType&(Type.NUMBER|Type.PERCENT)}function isValue(tok,val){return tok&&tok.tokenValue=== | ||
3416 | 32 | val}function next(){return me.next(1)}if((val.charAt(0)==="r"?isNumOrPct(next()):isNum(next()))&&isValue(next(),",")&&isNumOrPct(next())&&isValue(next(),",")&&isNumOrPct(next())&&(val==="rgb"||val==="hsa"||isValue(next(),",")&&isNum(next()))&&isValue(next(),")"))return newToken(Type.COLOR,this.css.substring(ch,this.ch));return failure()}return newToken(Type.FUNCTION,val)}return newToken(Type.IDENT,val)}this.ch++;return newToken(Type.CHARACTER,firstChar)},hasNext:function(){var next=this.next();this.prev(); | ||
3417 | 33 | return!!next},prev:function(){return this.tokens[this.tokenIndex-- -2]},all:function(){while(this.next());return this.tokens},until:function(func,require){var list=[],t,hit;while(t=this.next()){if(func(t)){hit=true;this.prev();break}list.push(t)}return require&&!hit?null:list}};return Tokenizer}();PIE.BoundsInfo=function(el){this.targetElement=el};PIE.BoundsInfo.prototype={_locked:0,positionChanged:function(){var last=this._lastBounds,bounds;return!last||(bounds=this.getBounds())&&(last.x!==bounds.x|| | ||
3418 | 34 | last.y!==bounds.y)},sizeChanged:function(){var last=this._lastBounds,bounds;return!last||(bounds=this.getBounds())&&(last.w!==bounds.w||last.h!==bounds.h)},getLiveBounds:function(){var el=this.targetElement,rect=el.getBoundingClientRect(),isIE9=PIE.ieDocMode===9;return{x:rect.left,y:rect.top,w:isIE9?el.offsetWidth:rect.right-rect.left,h:isIE9?el.offsetHeight:rect.bottom-rect.top}},getBounds:function(){return this._locked?this._lockedBounds||(this._lockedBounds=this.getLiveBounds()):this.getLiveBounds()}, | ||
3419 | 35 | hasBeenQueried:function(){return!!this._lastBounds},lock:function(){++this._locked},unlock:function(){if(!--this._locked){if(this._lockedBounds)this._lastBounds=this._lockedBounds;this._lockedBounds=null}}};(function(){function cacheWhenLocked(fn){var uid=PIE.Util.getUID(fn);return function(){if(this._locked){var cache=this._lockedValues||(this._lockedValues={});return uid in cache?cache[uid]:cache[uid]=fn.call(this)}else return fn.call(this)}}PIE.StyleInfoBase={_locked:0,newStyleInfo:function(proto){function StyleInfo(el){this.targetElement= | ||
3420 | 36 | el;this._lastCss=this.getCss()}PIE.Util.merge(StyleInfo.prototype,PIE.StyleInfoBase,proto);StyleInfo._propsCache={};return StyleInfo},getProps:function(){var css=this.getCss(),cache=this.constructor._propsCache;return css?css in cache?cache[css]:cache[css]=this.parseCss(css):null},getCss:cacheWhenLocked(function(){var el=this.targetElement,ctor=this.constructor,s=el.style,cs=el.currentStyle,cssProp=this.cssProperty,styleProp=this.styleProperty,prefixedCssProp=ctor._prefixedCssProp||(ctor._prefixedCssProp= | ||
3421 | 37 | PIE.CSS_PREFIX+cssProp),prefixedStyleProp=ctor._prefixedStyleProp||(ctor._prefixedStyleProp=PIE.STYLE_PREFIX+styleProp.charAt(0).toUpperCase()+styleProp.substring(1));return s[prefixedStyleProp]||cs.getAttribute(prefixedCssProp)||s[styleProp]||cs.getAttribute(cssProp)}),isActive:cacheWhenLocked(function(){return!!this.getProps()}),changed:cacheWhenLocked(function(){var currentCss=this.getCss(),changed=currentCss!==this._lastCss;this._lastCss=currentCss;return changed}),cacheWhenLocked:cacheWhenLocked, | ||
3422 | 38 | lock:function(){++this._locked},unlock:function(){if(!--this._locked)delete this._lockedValues}}})();PIE.BackgroundStyleInfo=PIE.StyleInfoBase.newStyleInfo({cssProperty:PIE.CSS_PREFIX+"background",styleProperty:PIE.STYLE_PREFIX+"Background",attachIdents:{"scroll":1,"fixed":1,"local":1},repeatIdents:{"repeat-x":1,"repeat-y":1,"repeat":1,"no-repeat":1},originAndClipIdents:{"padding-box":1,"border-box":1,"content-box":1},positionIdents:{"top":1,"right":1,"bottom":1,"left":1,"center":1},sizeIdents:{"contain":1, | ||
3423 | 39 | "cover":1},propertyNames:{CLIP:"backgroundClip",COLOR:"backgroundColor",IMAGE:"backgroundImage",ORIGIN:"backgroundOrigin",POSITION:"backgroundPosition",REPEAT:"backgroundRepeat",SIZE:"backgroundSize"},parseCss:function(css){var el=this.targetElement,cs=el.currentStyle,tokenizer,token,image,tok_type=PIE.Tokenizer.Type,type_operator=tok_type.OPERATOR,type_ident=tok_type.IDENT,type_color=tok_type.COLOR,tokType,tokVal,beginCharIndex=0,positionIdents=this.positionIdents,gradient,stop,width,height,props= | ||
3424 | 40 | {bgImages:[]};function isBgPosToken(token){return token&&token.isLengthOrPercent()||token.tokenType&type_ident&&token.tokenValue in positionIdents}function sizeToken(token){return token&&(token.isLengthOrPercent()&&PIE.getLength(token.tokenValue)||token.tokenValue==="auto"&&"auto")}if(this.getCss3()){tokenizer=new PIE.Tokenizer(css);image={};while(token=tokenizer.next()){tokType=token.tokenType;tokVal=token.tokenValue;if(!image.imgType&&tokType&tok_type.FUNCTION&&tokVal==="linear-gradient"){gradient= | ||
3425 | 41 | {stops:[],imgType:tokVal};stop={};while(token=tokenizer.next()){tokType=token.tokenType;tokVal=token.tokenValue;if(tokType&tok_type.CHARACTER&&tokVal===")"){if(stop.color)gradient.stops.push(stop);if(gradient.stops.length>1)PIE.Util.merge(image,gradient);break}if(tokType&type_color){if(gradient.angle||gradient.gradientStart){token=tokenizer.prev();if(token.tokenType!==type_operator)break;tokenizer.next()}stop={color:PIE.getColor(tokVal)};token=tokenizer.next();if(token.isLengthOrPercent())stop.offset= | ||
3426 | 42 | PIE.getLength(token.tokenValue);else tokenizer.prev()}else if(tokType&tok_type.ANGLE&&!gradient.angle&&!stop.color&&!gradient.stops.length)gradient.angle=new PIE.Angle(token.tokenValue);else if(isBgPosToken(token)&&!gradient.gradientStart&&!stop.color&&!gradient.stops.length){tokenizer.prev();gradient.gradientStart=new PIE.BgPosition(tokenizer.until(function(t){return!isBgPosToken(t)},false))}else if(tokType&type_operator&&tokVal===","){if(stop.color){gradient.stops.push(stop);stop={}}}else break}}else if(!image.imgType&& | ||
3427 | 43 | tokType&tok_type.URL){image.imgUrl=tokVal;image.imgType="image"}else if(isBgPosToken(token)&&!image.bgPosition){tokenizer.prev();image.bgPosition=new PIE.BgPosition(tokenizer.until(function(t){return!isBgPosToken(t)},false))}else if(tokType&type_ident)if(tokVal in this.repeatIdents&&!image.imgRepeat)image.imgRepeat=tokVal;else if(tokVal in this.originAndClipIdents&&!image.bgOrigin){image.bgOrigin=tokVal;if((token=tokenizer.next())&&token.tokenType&type_ident&&token.tokenValue in this.originAndClipIdents)image.bgClip= | ||
3428 | 44 | token.tokenValue;else{image.bgClip=tokVal;tokenizer.prev()}}else if(tokVal in this.attachIdents&&!image.bgAttachment)image.bgAttachment=tokVal;else return null;else if(tokType&type_color&&!props.color)props.color=PIE.getColor(tokVal);else if(tokType&type_operator&&tokVal==="/"&&!image.bgSize&&image.bgPosition){token=tokenizer.next();if(token.tokenType&type_ident&&token.tokenValue in this.sizeIdents)image.bgSize=new PIE.BgSize(token.tokenValue);else if(width=sizeToken(token)){height=sizeToken(tokenizer.next()); | ||
3429 | 45 | if(!height){height=width;tokenizer.prev()}image.bgSize=new PIE.BgSize(width,height)}else return null}else if(tokType&type_operator&&tokVal===","&&image.imgType){image.origString=css.substring(beginCharIndex,tokenizer.ch-1);beginCharIndex=tokenizer.ch;props.bgImages.push(image);image={}}else return null}if(image.imgType){image.origString=css.substring(beginCharIndex);props.bgImages.push(image)}}else this.withActualBg(PIE.ieDocMode<9?function(){var propNames=this.propertyNames,posX=cs[propNames.POSITION+ | ||
3430 | 46 | "X"],posY=cs[propNames.POSITION+"Y"],img=cs[propNames.IMAGE],color=cs[propNames.COLOR];if(color!=="transparent")props.color=PIE.getColor(color);if(img!=="none")props.bgImages=[{imgType:"image",imgUrl:(new PIE.Tokenizer(img)).next().tokenValue,imgRepeat:cs[propNames.REPEAT],bgPosition:new PIE.BgPosition((new PIE.Tokenizer(posX+" "+posY)).all())}]}:function(){var propNames=this.propertyNames,splitter=/\s*,\s*/,images=cs[propNames.IMAGE].split(splitter),color=cs[propNames.COLOR],repeats,positions,origins, | ||
3431 | 47 | clips,sizes,i,len,image,sizeParts;if(color!=="transparent")props.color=PIE.getColor(color);len=images.length;if(len&&images[0]!=="none"){repeats=cs[propNames.REPEAT].split(splitter);positions=cs[propNames.POSITION].split(splitter);origins=cs[propNames.ORIGIN].split(splitter);clips=cs[propNames.CLIP].split(splitter);sizes=cs[propNames.SIZE].split(splitter);props.bgImages=[];for(i=0;i<len;i++){image=images[i];if(image&&image!=="none"){sizeParts=sizes[i].split(" ");props.bgImages.push({origString:image+ | ||
3432 | 48 | " "+repeats[i]+" "+positions[i]+" / "+sizes[i]+" "+origins[i]+" "+clips[i],imgType:"image",imgUrl:(new PIE.Tokenizer(image)).next().tokenValue,imgRepeat:repeats[i],bgPosition:new PIE.BgPosition((new PIE.Tokenizer(positions[i])).all()),bgOrigin:origins[i],bgClip:clips[i],bgSize:new PIE.BgSize(sizeParts[0],sizeParts[1])})}}}});return props.color||props.bgImages[0]?props:null},withActualBg:function(fn){var isIE9=PIE.ieDocMode>8,propNames=this.propertyNames,rs=this.targetElement.runtimeStyle,rsImage= | ||
3433 | 49 | rs[propNames.IMAGE],rsColor=rs[propNames.COLOR],rsRepeat=rs[propNames.REPEAT],rsClip,rsOrigin,rsSize,rsPosition,ret;if(rsImage)rs[propNames.IMAGE]="";if(rsColor)rs[propNames.COLOR]="";if(rsRepeat)rs[propNames.REPEAT]="";if(isIE9){rsClip=rs[propNames.CLIP];rsOrigin=rs[propNames.ORIGIN];rsPosition=rs[propNames.POSITION];rsSize=rs[propNames.SIZE];if(rsClip)rs[propNames.CLIP]="";if(rsOrigin)rs[propNames.ORIGIN]="";if(rsPosition)rs[propNames.POSITION]="";if(rsSize)rs[propNames.SIZE]=""}ret=fn.call(this); | ||
3434 | 50 | if(rsImage)rs[propNames.IMAGE]=rsImage;if(rsColor)rs[propNames.COLOR]=rsColor;if(rsRepeat)rs[propNames.REPEAT]=rsRepeat;if(isIE9){if(rsClip)rs[propNames.CLIP]=rsClip;if(rsOrigin)rs[propNames.ORIGIN]=rsOrigin;if(rsPosition)rs[propNames.POSITION]=rsPosition;if(rsSize)rs[propNames.SIZE]=rsSize}return ret},getCss:PIE.StyleInfoBase.cacheWhenLocked(function(){return this.getCss3()||this.withActualBg(function(){var cs=this.targetElement.currentStyle,propNames=this.propertyNames;return cs[propNames.COLOR]+ | ||
3435 | 51 | " "+cs[propNames.IMAGE]+" "+cs[propNames.REPEAT]+" "+cs[propNames.POSITION+"X"]+" "+cs[propNames.POSITION+"Y"]})}),getCss3:PIE.StyleInfoBase.cacheWhenLocked(function(){var el=this.targetElement;return el.style[this.styleProperty]||el.currentStyle.getAttribute(this.cssProperty)}),isPngFix:function(){var val=0,el;if(PIE.ieVersion<7){el=this.targetElement;val=""+(el.style[PIE.STYLE_PREFIX+"PngFix"]||el.currentStyle.getAttribute(PIE.CSS_PREFIX+"png-fix"))==="true"}return val},isActive:PIE.StyleInfoBase.cacheWhenLocked(function(){return(this.getCss3()|| | ||
3436 | 52 | this.isPngFix())&&!!this.getProps()})});PIE.BorderStyleInfo=PIE.StyleInfoBase.newStyleInfo({sides:["Top","Right","Bottom","Left"],namedWidths:{"thin":"1px","medium":"3px","thick":"5px"},parseCss:function(css){var w={},s={},c={},active=false,colorsSame=true,stylesSame=true,widthsSame=true;this.withActualBorder(function(){var el=this.targetElement,cs=el.currentStyle,i=0,style,color,width,lastStyle,lastColor,lastWidth,side,ltr;for(;i<4;i++){side=this.sides[i];ltr=side.charAt(0).toLowerCase();style=s[ltr]= | ||
3437 | 53 | cs["border"+side+"Style"];color=cs["border"+side+"Color"];width=cs["border"+side+"Width"];if(i>0){if(style!==lastStyle)stylesSame=false;if(color!==lastColor)colorsSame=false;if(width!==lastWidth)widthsSame=false}lastStyle=style;lastColor=color;lastWidth=width;c[ltr]=PIE.getColor(color);width=w[ltr]=PIE.getLength(s[ltr]==="none"?"0":this.namedWidths[width]||width);if(width.pixels(this.targetElement)>0)active=true}});return active?{widths:w,styles:s,colors:c,widthsSame:widthsSame,colorsSame:colorsSame, | ||
3438 | 54 | stylesSame:stylesSame}:null},getCss:PIE.StyleInfoBase.cacheWhenLocked(function(){var el=this.targetElement,cs=el.currentStyle,css;if(!(el.tagName in PIE.tableCellTags&&el.offsetParent.currentStyle.borderCollapse==="collapse"))this.withActualBorder(function(){css=cs.borderWidth+"|"+cs.borderStyle+"|"+cs.borderColor});return css}),withActualBorder:function(fn){var rs=this.targetElement.runtimeStyle,rsWidth=rs.borderWidth,rsColor=rs.borderColor,ret;if(rsWidth)rs.borderWidth="";if(rsColor)rs.borderColor= | ||
3439 | 55 | "";ret=fn.call(this);if(rsWidth)rs.borderWidth=rsWidth;if(rsColor)rs.borderColor=rsColor;return ret}});(function(){PIE.BorderRadiusStyleInfo=PIE.StyleInfoBase.newStyleInfo({cssProperty:"border-radius",styleProperty:"borderRadius",parseCss:function(css){var p=null,x,y,tokenizer,token,length,hasNonZero=false;if(css){tokenizer=new PIE.Tokenizer(css);function collectLengths(){var arr=[],num;while((token=tokenizer.next())&&token.isLengthOrPercent()){length=PIE.getLength(token.tokenValue);num=length.getNumber(); | ||
3440 | 56 | if(num<0)return null;if(num>0)hasNonZero=true;arr.push(length)}return arr.length>0&&arr.length<5?{"tl":arr[0],"tr":arr[1]||arr[0],"br":arr[2]||arr[0],"bl":arr[3]||arr[1]||arr[0]}:null}if(x=collectLengths()){if(token){if(token.tokenType&PIE.Tokenizer.Type.OPERATOR&&token.tokenValue==="/")y=collectLengths()}else y=x;if(hasNonZero&&x&&y)p={x:x,y:y}}}return p}});var zero=PIE.getLength("0"),zeros={"tl":zero,"tr":zero,"br":zero,"bl":zero};PIE.BorderRadiusStyleInfo.ALL_ZERO={x:zeros,y:zeros}})();PIE.BorderImageStyleInfo= | ||
3441 | 57 | PIE.StyleInfoBase.newStyleInfo({cssProperty:"border-image",styleProperty:"borderImage",repeatIdents:{"stretch":1,"round":1,"repeat":1,"space":1},parseCss:function(css){var p=null,tokenizer,token,type,value,slices,widths,outsets,slashCount=0,Type=PIE.Tokenizer.Type,IDENT=Type.IDENT,NUMBER=Type.NUMBER,PERCENT=Type.PERCENT;if(css){tokenizer=new PIE.Tokenizer(css);p={};function isSlash(token){return token&&token.tokenType&Type.OPERATOR&&token.tokenValue==="/"}function isFillIdent(token){return token&& | ||
3442 | 58 | token.tokenType&IDENT&&token.tokenValue==="fill"}function collectSlicesEtc(){slices=tokenizer.until(function(tok){return!(tok.tokenType&(NUMBER|PERCENT))});if(isFillIdent(tokenizer.next())&&!p.fill)p.fill=true;else tokenizer.prev();if(isSlash(tokenizer.next())){slashCount++;widths=tokenizer.until(function(token){return!token.isLengthOrPercent()&&!(token.tokenType&IDENT&&token.tokenValue==="auto")});if(isSlash(tokenizer.next())){slashCount++;outsets=tokenizer.until(function(token){return!token.isLength()})}}else tokenizer.prev()} | ||
3443 | 59 | while(token=tokenizer.next()){type=token.tokenType;value=token.tokenValue;if(type&(NUMBER|PERCENT)&&!slices){tokenizer.prev();collectSlicesEtc()}else if(isFillIdent(token)&&!p.fill){p.fill=true;collectSlicesEtc()}else if(type&IDENT&&this.repeatIdents[value]&&!p.repeat){p.repeat={h:value};if(token=tokenizer.next())if(token.tokenType&IDENT&&this.repeatIdents[token.tokenValue])p.repeat.v=token.tokenValue;else tokenizer.prev()}else if(type&Type.URL&&!p.src)p.src=value;else return null}if(!p.src||!slices|| | ||
3444 | 60 | slices.length<1||slices.length>4||widths&&widths.length>4||slashCount===1&&widths.length<1||outsets&&outsets.length>4||slashCount===2&&outsets.length<1)return null;if(!p.repeat)p.repeat={h:"stretch"};if(!p.repeat.v)p.repeat.v=p.repeat.h;function distributeSides(tokens,convertFn){return{"t":convertFn(tokens[0]),"r":convertFn(tokens[1]||tokens[0]),"b":convertFn(tokens[2]||tokens[0]),"l":convertFn(tokens[3]||tokens[1]||tokens[0])}}p.slice=distributeSides(slices,function(tok){return PIE.getLength(tok.tokenType& | ||
3445 | 61 | NUMBER?tok.tokenValue+"px":tok.tokenValue)});if(widths&&widths[0])p.widths=distributeSides(widths,function(tok){return tok.isLengthOrPercent()?PIE.getLength(tok.tokenValue):tok.tokenValue});if(outsets&&outsets[0])p.outset=distributeSides(outsets,function(tok){return tok.isLength()?PIE.getLength(tok.tokenValue):tok.tokenValue})}return p}});PIE.BoxShadowStyleInfo=PIE.StyleInfoBase.newStyleInfo({cssProperty:"box-shadow",styleProperty:"boxShadow",parseCss:function(css){var props,getLength=PIE.getLength, | ||
3446 | 62 | Type=PIE.Tokenizer.Type,tokenizer;if(css){tokenizer=new PIE.Tokenizer(css);props={outset:[],inset:[]};function parseItem(){var token,type,value,color,lengths,inset,len;while(token=tokenizer.next()){value=token.tokenValue;type=token.tokenType;if(type&Type.OPERATOR&&value===",")break;else if(token.isLength()&&!lengths){tokenizer.prev();lengths=tokenizer.until(function(token){return!token.isLength()})}else if(type&Type.COLOR&&!color)color=value;else if(type&Type.IDENT&&value==="inset"&&!inset)inset= | ||
3447 | 63 | true;else return false}len=lengths&&lengths.length;if(len>1&&len<5){(inset?props.inset:props.outset).push({xOffset:getLength(lengths[0].tokenValue),yOffset:getLength(lengths[1].tokenValue),blur:getLength(lengths[2]?lengths[2].tokenValue:"0"),spread:getLength(lengths[3]?lengths[3].tokenValue:"0"),color:PIE.getColor(color||"currentColor")});return true}return false}while(parseItem());}return props&&(props.inset.length||props.outset.length)?props:null}});PIE.VisibilityStyleInfo=PIE.StyleInfoBase.newStyleInfo({getCss:PIE.StyleInfoBase.cacheWhenLocked(function(){var cs= | ||
3448 | 64 | this.targetElement.currentStyle;return cs.visibility+"|"+cs.display}),parseCss:function(){var el=this.targetElement,rs=el.runtimeStyle,cs=el.currentStyle,rsVis=rs.visibility,csVis;rs.visibility="";csVis=cs.visibility;rs.visibility=rsVis;return{visible:csVis!=="hidden",displayed:cs.display!=="none"}},isActive:function(){return false}});PIE.RendererBase={newRenderer:function(proto){function Renderer(el,boundsInfo,styleInfos,parent){this.targetElement=el;this.boundsInfo=boundsInfo;this.styleInfos=styleInfos; | ||
3449 | 65 | this.parent=parent}PIE.Util.merge(Renderer.prototype,PIE.RendererBase,proto);return Renderer},isPositioned:false,needsUpdate:function(){return false},prepareUpdate:PIE.emptyFn,updateProps:function(){this.destroy();if(this.isActive())this.draw()},updatePos:function(){this.isPositioned=true},updateSize:function(){if(this.isActive())this.draw();else this.destroy()},addLayer:function(index,el){this.removeLayer(index);for(var layers=this._layers||(this._layers=[]),i=index+1,len=layers.length,layer;i<len;i++){layer= | ||
3450 | 66 | layers[i];if(layer)break}layers[index]=el;this.getBox().insertBefore(el,layer||null)},getLayer:function(index){var layers=this._layers;return layers&&layers[index]||null},removeLayer:function(index){var layer=this.getLayer(index),box=this._box;if(layer&&box){box.removeChild(layer);this._layers[index]=null}},getShape:function(name,subElName,parent,group){var shapes=this._shapes||(this._shapes={}),shape=shapes[name],s;if(!shape){shape=shapes[name]=PIE.Util.createVmlElement("shape");if(subElName)shape.appendChild(shape[subElName]= | ||
3451 | 67 | PIE.Util.createVmlElement(subElName));if(group){parent=this.getLayer(group);if(!parent){this.addLayer(group,doc.createElement("group"+group));parent=this.getLayer(group)}}parent.appendChild(shape);s=shape.style;s.position="absolute";s.left=s.top=0;s["behavior"]="url(#default#VML)"}return shape},deleteShape:function(name){var shapes=this._shapes,shape=shapes&&shapes[name];if(shape){shape.parentNode.removeChild(shape);delete shapes[name]}return!!shape},getRadiiPixels:function(radii){var el=this.targetElement, | ||
3452 | 68 | bounds=this.boundsInfo.getBounds(),w=bounds.w,h=bounds.h,tlX,tlY,trX,trY,brX,brY,blX,blY,f;tlX=radii.x["tl"].pixels(el,w);tlY=radii.y["tl"].pixels(el,h);trX=radii.x["tr"].pixels(el,w);trY=radii.y["tr"].pixels(el,h);brX=radii.x["br"].pixels(el,w);brY=radii.y["br"].pixels(el,h);blX=radii.x["bl"].pixels(el,w);blY=radii.y["bl"].pixels(el,h);f=Math.min(w/(tlX+trX),h/(trY+brY),w/(blX+brX),h/(tlY+blY));if(f<1){tlX*=f;tlY*=f;trX*=f;trY*=f;brX*=f;brY*=f;blX*=f;blY*=f}return{x:{"tl":tlX,"tr":trX,"br":brX,"bl":blX}, | ||
3453 | 69 | y:{"tl":tlY,"tr":trY,"br":brY,"bl":blY}}},getBoxPath:function(shrink,mult,radii){mult=mult||1;var r,str,bounds=this.boundsInfo.getBounds(),w=bounds.w*mult,h=bounds.h*mult,radInfo=this.styleInfos.borderRadiusInfo,floor=Math.floor,ceil=Math.ceil,shrinkT=shrink?shrink.t*mult:0,shrinkR=shrink?shrink.r*mult:0,shrinkB=shrink?shrink.b*mult:0,shrinkL=shrink?shrink.l*mult:0,tlX,tlY,trX,trY,brX,brY,blX,blY;if(radii||radInfo.isActive()){r=this.getRadiiPixels(radii||radInfo.getProps());tlX=r.x["tl"]*mult;tlY= | ||
3454 | 70 | r.y["tl"]*mult;trX=r.x["tr"]*mult;trY=r.y["tr"]*mult;brX=r.x["br"]*mult;brY=r.y["br"]*mult;blX=r.x["bl"]*mult;blY=r.y["bl"]*mult;str="m"+floor(shrinkL)+","+floor(tlY)+"qy"+floor(tlX)+","+floor(shrinkT)+"l"+ceil(w-trX)+","+floor(shrinkT)+"qx"+ceil(w-shrinkR)+","+floor(trY)+"l"+ceil(w-shrinkR)+","+ceil(h-brY)+"qy"+ceil(w-brX)+","+ceil(h-shrinkB)+"l"+floor(blX)+","+ceil(h-shrinkB)+"qx"+floor(shrinkL)+","+ceil(h-blY)+" x e"}else str="m"+floor(shrinkL)+","+floor(shrinkT)+"l"+ceil(w-shrinkR)+","+floor(shrinkT)+ | ||
3455 | 71 | "l"+ceil(w-shrinkR)+","+ceil(h-shrinkB)+"l"+floor(shrinkL)+","+ceil(h-shrinkB)+"xe";return str},getBox:function(){var box=this.parent.getLayer(this.boxZIndex),s;if(!box){box=doc.createElement(this.boxName);s=box.style;s.position="absolute";s.top=s.left=0;this.parent.addLayer(this.boxZIndex,box)}return box},hideBorder:function(){var el=this.targetElement,cs=el.currentStyle,rs=el.runtimeStyle,tag=el.tagName,isIE6=PIE.ieVersion===6,sides,side,i;if(isIE6&&(tag in PIE.childlessElements||tag==="FIELDSET")|| | ||
3456 | 72 | tag==="BUTTON"||tag==="INPUT"&&el.type in PIE.inputButtonTypes){rs.borderWidth="";sides=this.styleInfos.borderInfo.sides;for(i=sides.length;i--;){side=sides[i];rs["padding"+side]="";rs["padding"+side]=PIE.getLength(cs["padding"+side]).pixels(el)+PIE.getLength(cs["border"+side+"Width"]).pixels(el)+(PIE.ieVersion!==8&&i%2?1:0)}rs.borderWidth=0}else if(isIE6){if(el.childNodes.length!==1||el.firstChild.tagName!=="ie6-mask"){var cont=doc.createElement("ie6-mask"),s=cont.style,child;s.visibility="visible"; | ||
3457 | 73 | s.zoom=1;while(child=el.firstChild)cont.appendChild(child);el.appendChild(cont);rs.visibility="hidden"}}else rs.borderColor="transparent"},unhideBorder:function(){},destroy:function(){this.parent.removeLayer(this.boxZIndex);delete this._shapes;delete this._layers}};PIE.RootRenderer=PIE.RendererBase.newRenderer({isActive:function(){var children=this.childRenderers;for(var i in children)if(children.hasOwnProperty(i)&&children[i].isActive())return true;return false},needsUpdate:function(){return this.styleInfos.visibilityInfo.changed()}, | ||
3458 | 74 | updatePos:function(){if(this.isActive()){var el=this.getPositioningElement(),par=el,docEl,parRect,tgtCS=el.currentStyle,tgtPos=tgtCS.position,boxPos,s=this.getBox().style,cs,x=0,y=0,elBounds=this.boundsInfo.getBounds();if(tgtPos==="fixed"&&PIE.ieVersion>6){x=elBounds.x;y=elBounds.y;boxPos=tgtPos}else{do par=par.offsetParent;while(par&&par.currentStyle.position==="static");if(par){parRect=par.getBoundingClientRect();cs=par.currentStyle;x=elBounds.x-parRect.left-(parseFloat(cs.borderLeftWidth)||0); | ||
3459 | 75 | y=elBounds.y-parRect.top-(parseFloat(cs.borderTopWidth)||0)}else{docEl=doc.documentElement;x=elBounds.x+docEl.scrollLeft-docEl.clientLeft;y=elBounds.y+docEl.scrollTop-docEl.clientTop}boxPos="absolute"}s.position=boxPos;s.left=x;s.top=y;s.zIndex=tgtPos==="static"?-1:tgtCS.zIndex;this.isPositioned=true}},updateSize:PIE.emptyFn,updateVisibility:function(){var vis=this.styleInfos.visibilityInfo.getProps();this.getBox().style.display=vis.visible&&vis.displayed?"":"none"},updateProps:function(){if(this.isActive())this.updateVisibility(); | ||
3460 | 76 | else this.destroy()},getPositioningElement:function(){var el=this.targetElement;return el.tagName in PIE.tableCellTags?el.offsetParent:el},getBox:function(){var box=this._box,el;if(!box){el=this.getPositioningElement();box=this._box=doc.createElement("css3-container");box.style["direction"]="ltr";this.updateVisibility();el.parentNode.insertBefore(box,el)}return box},finishUpdate:PIE.emptyFn,destroy:function(){var box=this._box,par;if(box&&(par=box.parentNode))par.removeChild(box);delete this._box; | ||
3461 | 77 | delete this._layers}});PIE.BackgroundRenderer=PIE.RendererBase.newRenderer({boxZIndex:2,boxName:"background",needsUpdate:function(){var si=this.styleInfos;return si.backgroundInfo.changed()||si.borderRadiusInfo.changed()},isActive:function(){var si=this.styleInfos;return si.borderImageInfo.isActive()||si.borderRadiusInfo.isActive()||si.backgroundInfo.isActive()||si.boxShadowInfo.isActive()&&si.boxShadowInfo.getProps().inset},draw:function(){var bounds=this.boundsInfo.getBounds();if(bounds.w&&bounds.h){this.drawBgColor(); | ||
3462 | 78 | this.drawBgImages()}},drawBgColor:function(){var props=this.styleInfos.backgroundInfo.getProps(),bounds=this.boundsInfo.getBounds(),el=this.targetElement,color=props&&props.color,shape,w,h,s,alpha;if(color&&color.alpha()>0){this.hideBackground();shape=this.getShape("bgColor","fill",this.getBox(),1);w=bounds.w;h=bounds.h;shape.stroked=false;shape.coordsize=w*2+","+h*2;shape.coordorigin="1,1";shape.path=this.getBoxPath(null,2);s=shape.style;s.width=w;s.height=h;shape.fill.color=color.colorValue(el); | ||
3463 | 79 | alpha=color.alpha();if(alpha<1)shape.fill.opacity=alpha}else this.deleteShape("bgColor")},drawBgImages:function(){var props=this.styleInfos.backgroundInfo.getProps(),bounds=this.boundsInfo.getBounds(),images=props&&props.bgImages,img,shape,w,h,s,i;if(images){this.hideBackground();w=bounds.w;h=bounds.h;i=images.length;while(i--){img=images[i];shape=this.getShape("bgImage"+i,"fill",this.getBox(),2);shape.stroked=false;shape.fill.type="tile";shape.fillcolor="none";shape.coordsize=w*2+","+h*2;shape.coordorigin= | ||
3464 | 80 | "1,1";shape.path=this.getBoxPath(0,2);s=shape.style;s.width=w;s.height=h;if(img.imgType==="linear-gradient")this.addLinearGradient(shape,img);else{shape.fill.src=img.imgUrl;this.positionBgImage(shape,i)}}}i=images?images.length:0;while(this.deleteShape("bgImage"+i++));},positionBgImage:function(shape,index){var me=this;PIE.Util.withImageSize(shape.fill.src,function(size){var el=me.targetElement,bounds=me.boundsInfo.getBounds(),elW=bounds.w,elH=bounds.h;if(elW&&elH){var fill=shape.fill,si=me.styleInfos, | ||
3465 | 81 | border=si.borderInfo.getProps(),bw=border&&border.widths,bwT=bw?bw["t"].pixels(el):0,bwR=bw?bw["r"].pixels(el):0,bwB=bw?bw["b"].pixels(el):0,bwL=bw?bw["l"].pixels(el):0,bg=si.backgroundInfo.getProps().bgImages[index],bgPos=bg.bgPosition?bg.bgPosition.coords(el,elW-size.w-bwL-bwR,elH-size.h-bwT-bwB):{x:0,y:0},repeat=bg.imgRepeat,pxX,pxY,clipT=0,clipL=0,clipR=elW+1,clipB=elH+1,clipAdjust=PIE.ieVersion===8?0:1;pxX=Math.round(bgPos.x)+bwL+0.5;pxY=Math.round(bgPos.y)+bwT+0.5;fill.position=pxX/elW+","+ | ||
3466 | 82 | pxY/elH;if(repeat&&repeat!=="repeat"){if(repeat==="repeat-x"||repeat==="no-repeat"){clipT=pxY+1;clipB=pxY+size.h+clipAdjust}if(repeat==="repeat-y"||repeat==="no-repeat"){clipL=pxX+1;clipR=pxX+size.w+clipAdjust}shape.style.clip="rect("+clipT+"px,"+clipR+"px,"+clipB+"px,"+clipL+"px)"}}})},addLinearGradient:function(shape,info){var el=this.targetElement,bounds=this.boundsInfo.getBounds(),w=bounds.w,h=bounds.h,fill=shape.fill,stops=info.stops,stopCount=stops.length,PI=Math.PI,GradientUtil=PIE.GradientUtil, | ||
3467 | 83 | perpendicularIntersect=GradientUtil.perpendicularIntersect,distance=GradientUtil.distance,metrics=GradientUtil.getGradientMetrics(el,w,h,info),angle=metrics.angle,startX=metrics.startX,startY=metrics.startY,startCornerX=metrics.startCornerX,startCornerY=metrics.startCornerY,endCornerX=metrics.endCornerX,endCornerY=metrics.endCornerY,deltaX=metrics.deltaX,deltaY=metrics.deltaY,lineLength=metrics.lineLength,vmlAngle,vmlGradientLength,vmlColors,stopPx,vmlOffsetPct,p,i,j,before,after;vmlAngle=angle%90? | ||
3468 | 84 | Math.atan2(deltaX*w/h,deltaY)/PI*180:angle+90;vmlAngle+=180;vmlAngle=vmlAngle%360;p=perpendicularIntersect(startCornerX,startCornerY,angle,endCornerX,endCornerY);vmlGradientLength=distance(startCornerX,startCornerY,p[0],p[1]);vmlColors=[];p=perpendicularIntersect(startX,startY,angle,startCornerX,startCornerY);vmlOffsetPct=distance(startX,startY,p[0],p[1])/vmlGradientLength*100;stopPx=[];for(i=0;i<stopCount;i++)stopPx.push(stops[i].offset?stops[i].offset.pixels(el,lineLength):i===0?0:i===stopCount- | ||
3469 | 85 | 1?lineLength:null);for(i=1;i<stopCount;i++){if(stopPx[i]===null){before=stopPx[i-1];j=i;do after=stopPx[++j];while(after===null);stopPx[i]=before+(after-before)/(j-i+1)}stopPx[i]=Math.max(stopPx[i],stopPx[i-1])}for(i=0;i<stopCount;i++)vmlColors.push(vmlOffsetPct+stopPx[i]/vmlGradientLength*100+"% "+stops[i].color.colorValue(el));fill["angle"]=vmlAngle;fill["type"]="gradient";fill["method"]="sigma";fill["color"]=stops[0].color.colorValue(el);fill["color2"]=stops[stopCount-1].color.colorValue(el);if(fill["colors"])fill["colors"].value= | ||
3470 | 86 | vmlColors.join(",");else fill["colors"]=vmlColors.join(",")},hideBackground:function(){var rs=this.targetElement.runtimeStyle;rs.backgroundImage="url(about:blank)";rs.backgroundColor="transparent"},destroy:function(){PIE.RendererBase.destroy.call(this);var rs=this.targetElement.runtimeStyle;rs.backgroundImage=rs.backgroundColor=""}});PIE.BorderRenderer=PIE.RendererBase.newRenderer({boxZIndex:4,boxName:"border",needsUpdate:function(){var si=this.styleInfos;return si.borderInfo.changed()||si.borderRadiusInfo.changed()}, | ||
3471 | 87 | isActive:function(){var si=this.styleInfos;return(si.borderRadiusInfo.isActive()||si.backgroundInfo.isActive())&&!si.borderImageInfo.isActive()&&si.borderInfo.isActive()},draw:function(){var el=this.targetElement,props=this.styleInfos.borderInfo.getProps(),bounds=this.boundsInfo.getBounds(),w=bounds.w,h=bounds.h,shape,stroke,s,segments,seg,i,len;if(props){this.hideBorder();segments=this.getBorderSegments(2);for(i=0,len=segments.length;i<len;i++){seg=segments[i];shape=this.getShape("borderPiece"+i, | ||
3472 | 88 | seg.stroke?"stroke":"fill",this.getBox());shape.coordsize=w*2+","+h*2;shape.coordorigin="1,1";shape.path=seg.path;s=shape.style;s.width=w;s.height=h;shape.filled=!!seg.fill;shape.stroked=!!seg.stroke;if(seg.stroke){stroke=shape.stroke;stroke["weight"]=seg.weight+"px";stroke.color=seg.color.colorValue(el);stroke["dashstyle"]=seg.stroke==="dashed"?"2 2":seg.stroke==="dotted"?"1 1":"solid";stroke["linestyle"]=seg.stroke==="double"&&seg.weight>2?"ThinThin":"Single"}else shape.fill.color=seg.fill.colorValue(el)}while(this.deleteShape("borderPiece"+ | ||
3473 | 89 | i++));}},getBorderSegments:function(mult){var el=this.targetElement,bounds,elW,elH,borderInfo=this.styleInfos.borderInfo,segments=[],floor,ceil,wT,wR,wB,wL,round=Math.round,borderProps,radiusInfo,radii,widths,styles,colors;if(borderInfo.isActive()){borderProps=borderInfo.getProps();widths=borderProps.widths;styles=borderProps.styles;colors=borderProps.colors;if(borderProps.widthsSame&&borderProps.stylesSame&&borderProps.colorsSame){if(colors["t"].alpha()>0){wT=widths["t"].pixels(el);wR=wT/2;segments.push({path:this.getBoxPath({t:wR, | ||
3474 | 90 | r:wR,b:wR,l:wR},mult),stroke:styles["t"],color:colors["t"],weight:wT})}}else{mult=mult||1;bounds=this.boundsInfo.getBounds();elW=bounds.w;elH=bounds.h;wT=round(widths["t"].pixels(el));wR=round(widths["r"].pixels(el));wB=round(widths["b"].pixels(el));wL=round(widths["l"].pixels(el));var pxWidths={"t":wT,"r":wR,"b":wB,"l":wL};radiusInfo=this.styleInfos.borderRadiusInfo;if(radiusInfo.isActive())radii=this.getRadiiPixels(radiusInfo.getProps());floor=Math.floor;ceil=Math.ceil;function radius(xy,corner){return radii? | ||
3475 | 91 | radii[xy][corner]:0}function curve(corner,shrinkX,shrinkY,startAngle,ccw,doMove){var rx=radius("x",corner),ry=radius("y",corner),deg=65535,isRight=corner.charAt(1)==="r",isBottom=corner.charAt(0)==="b";return rx>0&&ry>0?(doMove?"al":"ae")+(isRight?ceil(elW-rx):floor(rx))*mult+","+(isBottom?ceil(elH-ry):floor(ry))*mult+","+(floor(rx)-shrinkX)*mult+","+(floor(ry)-shrinkY)*mult+","+startAngle*deg+","+45*deg*(ccw?1:-1):(doMove?"m":"l")+(isRight?elW-shrinkX:shrinkX)*mult+","+(isBottom?elH-shrinkY:shrinkY)* | ||
3476 | 92 | mult}function line(side,shrink,ccw,doMove){var start=side==="t"?floor(radius("x","tl"))*mult+","+ceil(shrink)*mult:side==="r"?ceil(elW-shrink)*mult+","+floor(radius("y","tr"))*mult:side==="b"?ceil(elW-radius("x","br"))*mult+","+floor(elH-shrink)*mult:floor(shrink)*mult+","+ceil(elH-radius("y","bl"))*mult,end=side==="t"?ceil(elW-radius("x","tr"))*mult+","+ceil(shrink)*mult:side==="r"?ceil(elW-shrink)*mult+","+ceil(elH-radius("y","br"))*mult:side==="b"?floor(radius("x","bl"))*mult+","+floor(elH-shrink)* | ||
3477 | 93 | mult:floor(shrink)*mult+","+floor(radius("y","tl"))*mult;return ccw?(doMove?"m"+end:"")+"l"+start:(doMove?"m"+start:"")+"l"+end}function addSide(side,sideBefore,sideAfter,cornerBefore,cornerAfter,baseAngle){var vert=side==="l"||side==="r",sideW=pxWidths[side],beforeX,beforeY,afterX,afterY;if(sideW>0&&styles[side]!=="none"&&colors[side].alpha()>0){beforeX=pxWidths[vert?side:sideBefore];beforeY=pxWidths[vert?sideBefore:side];afterX=pxWidths[vert?side:sideAfter];afterY=pxWidths[vert?sideAfter:side]; | ||
3478 | 94 | if(styles[side]==="dashed"||styles[side]==="dotted"){segments.push({path:curve(cornerBefore,beforeX,beforeY,baseAngle+45,0,1)+curve(cornerBefore,0,0,baseAngle,1,0),fill:colors[side]});segments.push({path:line(side,sideW/2,0,1),stroke:styles[side],weight:sideW,color:colors[side]});segments.push({path:curve(cornerAfter,afterX,afterY,baseAngle,0,1)+curve(cornerAfter,0,0,baseAngle-45,1,0),fill:colors[side]})}else segments.push({path:curve(cornerBefore,beforeX,beforeY,baseAngle+45,0,1)+line(side,sideW, | ||
3479 | 95 | 0,0)+curve(cornerAfter,afterX,afterY,baseAngle,0,0)+(styles[side]==="double"&&sideW>2?curve(cornerAfter,afterX-floor(afterX/3),afterY-floor(afterY/3),baseAngle-45,1,0)+line(side,ceil(sideW/3*2),1,0)+curve(cornerBefore,beforeX-floor(beforeX/3),beforeY-floor(beforeY/3),baseAngle,1,0)+"x "+curve(cornerBefore,floor(beforeX/3),floor(beforeY/3),baseAngle+45,0,1)+line(side,floor(sideW/3),1,0)+curve(cornerAfter,floor(afterX/3),floor(afterY/3),baseAngle,0,0):"")+curve(cornerAfter,0,0,baseAngle-45,1,0)+line(side, | ||
3480 | 96 | 0,1,0)+curve(cornerBefore,0,0,baseAngle,1,0),fill:colors[side]})}}addSide("t","l","r","tl","tr",90);addSide("r","t","b","tr","br",0);addSide("b","r","l","br","bl",-90);addSide("l","b","t","bl","tl",-180)}}return segments},destroy:function(){var me=this;if(me.finalized||!me.styleInfos.borderImageInfo.isActive())me.targetElement.runtimeStyle.borderColor="";PIE.RendererBase.destroy.call(me)}});PIE.BorderImageRenderer=PIE.RendererBase.newRenderer({boxZIndex:5,pieceNames:["t","tr","r","br","b","bl","l", | ||
3481 | 97 | "tl","c"],needsUpdate:function(){return this.styleInfos.borderImageInfo.changed()},isActive:function(){return this.styleInfos.borderImageInfo.isActive()},draw:function(){this.getBox();var props=this.styleInfos.borderImageInfo.getProps(),borderProps=this.styleInfos.borderInfo.getProps(),bounds=this.boundsInfo.getBounds(),el=this.targetElement,pieces=this.pieces;PIE.Util.withImageSize(props.src,function(imgSize){var elW=bounds.w,elH=bounds.h,zero=PIE.getLength("0"),widths=props.widths||(borderProps? | ||
3482 | 98 | borderProps.widths:{"t":zero,"r":zero,"b":zero,"l":zero}),widthT=widths["t"].pixels(el),widthR=widths["r"].pixels(el),widthB=widths["b"].pixels(el),widthL=widths["l"].pixels(el),slices=props.slice,sliceT=slices["t"].pixels(el),sliceR=slices["r"].pixels(el),sliceB=slices["b"].pixels(el),sliceL=slices["l"].pixels(el);function setSizeAndPos(piece,w,h,x,y){var s=pieces[piece].style,max=Math.max;s.width=max(w,0);s.height=max(h,0);s.left=x;s.top=y}setSizeAndPos("tl",widthL,widthT,0,0);setSizeAndPos("t", | ||
3483 | 99 | elW-widthL-widthR,widthT,widthL,0);setSizeAndPos("tr",widthR,widthT,elW-widthR,0);setSizeAndPos("r",widthR,elH-widthT-widthB,elW-widthR,widthT);setSizeAndPos("br",widthR,widthB,elW-widthR,elH-widthB);setSizeAndPos("b",elW-widthL-widthR,widthB,widthL,elH-widthB);setSizeAndPos("bl",widthL,widthB,0,elH-widthB);setSizeAndPos("l",widthL,elH-widthT-widthB,0,widthT);setSizeAndPos("c",elW-widthL-widthR,elH-widthT-widthB,widthL,widthT);function setCrops(sides,crop,val){for(var i=0,len=sides.length;i<len;i++)pieces[sides[i]]["imagedata"][crop]= | ||
3484 | 100 | val}setCrops(["tl","t","tr"],"cropBottom",(imgSize.h-sliceT)/imgSize.h);setCrops(["tl","l","bl"],"cropRight",(imgSize.w-sliceL)/imgSize.w);setCrops(["bl","b","br"],"cropTop",(imgSize.h-sliceB)/imgSize.h);setCrops(["tr","r","br"],"cropLeft",(imgSize.w-sliceR)/imgSize.w);setCrops(["l","r","c"],"cropTop",sliceT/imgSize.h);setCrops(["l","r","c"],"cropBottom",sliceB/imgSize.h);setCrops(["t","b","c"],"cropLeft",sliceL/imgSize.w);setCrops(["t","b","c"],"cropRight",sliceR/imgSize.w);pieces["c"].style.display= | ||
3485 | 101 | props.fill?"":"none"},this)},getBox:function(){var box=this.parent.getLayer(this.boxZIndex),s,piece,i,pieceNames=this.pieceNames,len=pieceNames.length;if(!box){box=doc.createElement("border-image");s=box.style;s.position="absolute";this.pieces={};for(i=0;i<len;i++){piece=this.pieces[pieceNames[i]]=PIE.Util.createVmlElement("rect");piece.appendChild(PIE.Util.createVmlElement("imagedata"));s=piece.style;s["behavior"]="url(#default#VML)";s.position="absolute";s.top=s.left=0;piece["imagedata"].src=this.styleInfos.borderImageInfo.getProps().src; | ||
3486 | 102 | piece.stroked=false;piece.filled=false;box.appendChild(piece)}this.parent.addLayer(this.boxZIndex,box)}return box},prepareUpdate:function(){if(this.isActive()){var me=this,el=me.targetElement,rs=el.runtimeStyle,widths=me.styleInfos.borderImageInfo.getProps().widths;rs.borderStyle="solid";if(widths){rs.borderTopWidth=widths["t"].pixels(el)+"px";rs.borderRightWidth=widths["r"].pixels(el)+"px";rs.borderBottomWidth=widths["b"].pixels(el)+"px";rs.borderLeftWidth=widths["l"].pixels(el)+"px"}me.hideBorder()}}, | ||
3487 | 103 | destroy:function(){var me=this,rs=me.targetElement.runtimeStyle;rs.borderStyle="";if(me.finalized||!me.styleInfos.borderInfo.isActive())rs.borderColor=rs.borderWidth="";PIE.RendererBase.destroy.call(this)}});PIE.BoxShadowOutsetRenderer=PIE.RendererBase.newRenderer({boxZIndex:1,boxName:"outset-box-shadow",needsUpdate:function(){var si=this.styleInfos;return si.boxShadowInfo.changed()||si.borderRadiusInfo.changed()},isActive:function(){var boxShadowInfo=this.styleInfos.boxShadowInfo;return boxShadowInfo.isActive()&& | ||
3488 | 104 | boxShadowInfo.getProps().outset[0]},draw:function(){var me=this,el=this.targetElement,box=this.getBox(),styleInfos=this.styleInfos,shadowInfos=styleInfos.boxShadowInfo.getProps().outset,radii=styleInfos.borderRadiusInfo.getProps(),len=shadowInfos.length,i=len,j,bounds=this.boundsInfo.getBounds(),w=bounds.w,h=bounds.h,clipAdjust=PIE.ieVersion===8?1:0,corners=["tl","tr","br","bl"],corner,shadowInfo,shape,fill,ss,xOff,yOff,spread,blur,shrink,color,alpha,path,totalW,totalH,focusX,focusY,isBottom,isRight; | ||
3489 | 105 | function getShadowShape(index,corner,xOff,yOff,color,blur,path){var shape=me.getShape("shadow"+index+corner,"fill",box,len-index),fill=shape.fill;shape["coordsize"]=w*2+","+h*2;shape["coordorigin"]="1,1";shape["stroked"]=false;shape["filled"]=true;fill.color=color.colorValue(el);if(blur){fill["type"]="gradienttitle";fill["color2"]=fill.color;fill["opacity"]=0}shape.path=path;ss=shape.style;ss.left=xOff;ss.top=yOff;ss.width=w;ss.height=h;return shape}while(i--){shadowInfo=shadowInfos[i];xOff=shadowInfo.xOffset.pixels(el); | ||
3490 | 106 | yOff=shadowInfo.yOffset.pixels(el);spread=shadowInfo.spread.pixels(el),blur=shadowInfo.blur.pixels(el);color=shadowInfo.color;shrink=-spread-blur;if(!radii&&blur)radii=PIE.BorderRadiusStyleInfo.ALL_ZERO;path=this.getBoxPath({t:shrink,r:shrink,b:shrink,l:shrink},2,radii);if(blur){totalW=(spread+blur)*2+w;totalH=(spread+blur)*2+h;focusX=blur*2/totalW;focusY=blur*2/totalH;if(blur-spread>w/2||blur-spread>h/2)for(j=4;j--;){corner=corners[j];isBottom=corner.charAt(0)==="b";isRight=corner.charAt(1)==="r"; | ||
3491 | 107 | shape=getShadowShape(i,corner,xOff,yOff,color,blur,path);fill=shape.fill;fill["focusposition"]=(isRight?1-focusX:focusX)+","+(isBottom?1-focusY:focusY);fill["focussize"]="0,0";shape.style.clip="rect("+((isBottom?totalH/2:0)+clipAdjust)+"px,"+(isRight?totalW:totalW/2)+"px,"+(isBottom?totalH:totalH/2)+"px,"+((isRight?totalW/2:0)+clipAdjust)+"px)"}else{shape=getShadowShape(i,"",xOff,yOff,color,blur,path);fill=shape.fill;fill["focusposition"]=focusX+","+focusY;fill["focussize"]=1-focusX*2+","+(1-focusY* | ||
3492 | 108 | 2)}}else{shape=getShadowShape(i,"",xOff,yOff,color,blur,path);alpha=color.alpha();if(alpha<1)shape.fill.opacity=alpha}}}});PIE.ImgRenderer=PIE.RendererBase.newRenderer({boxZIndex:6,boxName:"imgEl",needsUpdate:function(){var si=this.styleInfos;return this.targetElement.src!==this._lastSrc||si.borderRadiusInfo.changed()},isActive:function(){var si=this.styleInfos;return si.borderRadiusInfo.isActive()||si.backgroundInfo.isPngFix()},draw:function(){this._lastSrc=src;this.hideActualImg();var shape=this.getShape("img", | ||
3493 | 109 | "fill",this.getBox()),fill=shape.fill,bounds=this.boundsInfo.getBounds(),w=bounds.w,h=bounds.h,borderProps=this.styleInfos.borderInfo.getProps(),borderWidths=borderProps&&borderProps.widths,el=this.targetElement,src=el.src,round=Math.round,cs=el.currentStyle,getLength=PIE.getLength,s,zero;if(!borderWidths||PIE.ieVersion<7){zero=PIE.getLength("0");borderWidths={"t":zero,"r":zero,"b":zero,"l":zero}}shape.stroked=false;fill.type="frame";fill.src=src;fill.position=(w?0.5/w:0)+","+(h?0.5/h:0);shape.coordsize= | ||
3494 | 110 | w*2+","+h*2;shape.coordorigin="1,1";shape.path=this.getBoxPath({t:round(borderWidths["t"].pixels(el)+getLength(cs.paddingTop).pixels(el)),r:round(borderWidths["r"].pixels(el)+getLength(cs.paddingRight).pixels(el)),b:round(borderWidths["b"].pixels(el)+getLength(cs.paddingBottom).pixels(el)),l:round(borderWidths["l"].pixels(el)+getLength(cs.paddingLeft).pixels(el))},2);s=shape.style;s.width=w;s.height=h},hideActualImg:function(){this.targetElement.runtimeStyle.filter="alpha(opacity=0)"},destroy:function(){PIE.RendererBase.destroy.call(this); | ||
3495 | 111 | this.targetElement.runtimeStyle.filter=""}});PIE.IE9RootRenderer=PIE.RendererBase.newRenderer({updatePos:PIE.emptyFn,updateSize:PIE.emptyFn,updateVisibility:PIE.emptyFn,updateProps:PIE.emptyFn,outerCommasRE:/^,+|,+$/g,innerCommasRE:/,+/g,setBackgroundLayer:function(zIndex,bg){var me=this,bgLayers=me._bgLayers||(me._bgLayers=[]),undef;bgLayers[zIndex]=bg||undef},finishUpdate:function(){var me=this,bgLayers=me._bgLayers,bg;if(bgLayers&&(bg=bgLayers.join(",").replace(me.outerCommasRE,"").replace(me.innerCommasRE, | ||
3496 | 112 | ","))!==me._lastBg)me._lastBg=me.targetElement.runtimeStyle.background=bg},destroy:function(){this.targetElement.runtimeStyle.background="";delete this._bgLayers}});PIE.IE9BackgroundRenderer=PIE.RendererBase.newRenderer({bgLayerZIndex:1,needsUpdate:function(){var si=this.styleInfos;return si.backgroundInfo.changed()},isActive:function(){var si=this.styleInfos;return si.backgroundInfo.isActive()||si.borderImageInfo.isActive()},draw:function(){var me=this,props=me.styleInfos.backgroundInfo.getProps(), | ||
3497 | 113 | bg,images,i=0,img,bgAreaSize,bgSize;if(props){bg=[];images=props.bgImages;if(images)while(img=images[i++])if(img.imgType==="linear-gradient"){bgAreaSize=me.getBgAreaSize(img.bgOrigin);bgSize=(img.bgSize||PIE.BgSize.DEFAULT).pixels(me.targetElement,bgAreaSize.w,bgAreaSize.h,bgAreaSize.w,bgAreaSize.h),bg.push("url(data:image/svg+xml,"+escape(me.getGradientSvg(img,bgSize.w,bgSize.h))+") "+me.bgPositionToString(img.bgPosition)+" / "+bgSize.w+"px "+bgSize.h+"px "+(img.bgAttachment||"")+" "+(img.bgOrigin|| | ||
3498 | 114 | "")+" "+(img.bgClip||""))}else bg.push(img.origString);if(props.color)bg.push(props.color.val);me.parent.setBackgroundLayer(me.bgLayerZIndex,bg.join(","))}},bgPositionToString:function(bgPosition){return bgPosition?bgPosition.tokens.map(function(token){return token.tokenValue}).join(" "):"0 0"},getBgAreaSize:function(bgOrigin){var me=this,el=me.targetElement,bounds=me.boundsInfo.getBounds(),elW=bounds.w,elH=bounds.h,w=elW,h=elH,borders,getLength,cs;if(bgOrigin!=="border-box"){borders=me.styleInfos.borderInfo.getProps(); | ||
3499 | 115 | if(borders&&(borders=borders.widths)){w-=borders["l"].pixels(el)+borders["l"].pixels(el);h-=borders["t"].pixels(el)+borders["b"].pixels(el)}}if(bgOrigin==="content-box"){getLength=PIE.getLength;cs=el.currentStyle;w-=getLength(cs.paddingLeft).pixels(el)+getLength(cs.paddingRight).pixels(el);h-=getLength(cs.paddingTop).pixels(el)+getLength(cs.paddingBottom).pixels(el)}return{w:w,h:h}},getGradientSvg:function(info,bgWidth,bgHeight){var el=this.targetElement,stopsInfo=info.stops,stopCount=stopsInfo.length, | ||
3500 | 116 | metrics=PIE.GradientUtil.getGradientMetrics(el,bgWidth,bgHeight,info),startX=metrics.startX,startY=metrics.startY,endX=metrics.endX,endY=metrics.endY,lineLength=metrics.lineLength,stopPx,i,j,before,after,svg;stopPx=[];for(i=0;i<stopCount;i++)stopPx.push(stopsInfo[i].offset?stopsInfo[i].offset.pixels(el,lineLength):i===0?0:i===stopCount-1?lineLength:null);for(i=1;i<stopCount;i++)if(stopPx[i]===null){before=stopPx[i-1];j=i;do after=stopPx[++j];while(after===null);stopPx[i]=before+(after-before)/(j- | ||
3501 | 117 | i+1)}svg=['<svg width="'+bgWidth+'" height="'+bgHeight+'" xmlns="http://www.w3.org/2000/svg">'+"<defs>"+'<linearGradient id="g" gradientUnits="userSpaceOnUse"'+' x1="'+startX/bgWidth*100+'%" y1="'+startY/bgHeight*100+'%" x2="'+endX/bgWidth*100+'%" y2="'+endY/bgHeight*100+'%">'];for(i=0;i<stopCount;i++)svg.push('<stop offset="'+stopPx[i]/lineLength+'" stop-color="'+stopsInfo[i].color.colorValue(el)+'" stop-opacity="'+stopsInfo[i].color.alpha()+'"/>');svg.push("</linearGradient>"+"</defs>"+'<rect width="100%" height="100%" fill="url(#g)"/>'+ | ||
3502 | 118 | "</svg>");return svg.join("")},destroy:function(){this.parent.setBackgroundLayer(this.bgLayerZIndex)}});PIE.IE9BorderImageRenderer=PIE.RendererBase.newRenderer({REPEAT:"repeat",STRETCH:"stretch",ROUND:"round",bgLayerZIndex:0,needsUpdate:function(){return this.styleInfos.borderImageInfo.changed()},isActive:function(){return this.styleInfos.borderImageInfo.isActive()},draw:function(){var me=this,props=me.styleInfos.borderImageInfo.getProps(),borderProps=me.styleInfos.borderInfo.getProps(),bounds=me.boundsInfo.getBounds(), | ||
3503 | 119 | repeat=props.repeat,repeatH=repeat.h,repeatV=repeat.v,el=me.targetElement,isAsync=0;PIE.Util.withImageSize(props.src,function(imgSize){var elW=bounds.w,elH=bounds.h,imgW=imgSize.w,imgH=imgSize.h,imgSrc=me.imageToDataURI(props.src,imgW,imgH),REPEAT=me.REPEAT,STRETCH=me.STRETCH,ROUND=me.ROUND,ceil=Math.ceil,zero=PIE.getLength("0"),widths=props.widths||(borderProps?borderProps.widths:{"t":zero,"r":zero,"b":zero,"l":zero}),widthT=widths["t"].pixels(el),widthR=widths["r"].pixels(el),widthB=widths["b"].pixels(el), | ||
3504 | 120 | widthL=widths["l"].pixels(el),slices=props.slice,sliceT=slices["t"].pixels(el),sliceR=slices["r"].pixels(el),sliceB=slices["b"].pixels(el),sliceL=slices["l"].pixels(el),centerW=elW-widthL-widthR,middleH=elH-widthT-widthB,imgCenterW=imgW-sliceL-sliceR,imgMiddleH=imgH-sliceT-sliceB,tileSizeT=repeatH===STRETCH?centerW:imgCenterW*widthT/sliceT,tileSizeR=repeatV===STRETCH?middleH:imgMiddleH*widthR/sliceR,tileSizeB=repeatH===STRETCH?centerW:imgCenterW*widthB/sliceB,tileSizeL=repeatV===STRETCH?middleH:imgMiddleH* | ||
3505 | 121 | widthL/sliceL,svg,patterns=[],rects=[],i=0;if(repeatH===ROUND){tileSizeT-=(tileSizeT-(centerW%tileSizeT||tileSizeT))/ceil(centerW/tileSizeT);tileSizeB-=(tileSizeB-(centerW%tileSizeB||tileSizeB))/ceil(centerW/tileSizeB)}if(repeatV===ROUND){tileSizeR-=(tileSizeR-(middleH%tileSizeR||tileSizeR))/ceil(middleH/tileSizeR);tileSizeL-=(tileSizeL-(middleH%tileSizeL||tileSizeL))/ceil(middleH/tileSizeL)}svg=['<svg width="'+elW+'" height="'+elH+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">']; | ||
3506 | 122 | function addImage(x,y,w,h,cropX,cropY,cropW,cropH,tileW,tileH){patterns.push('<pattern patternUnits="userSpaceOnUse" id="pattern'+i+'" '+'x="'+(repeatH===REPEAT?x+w/2-tileW/2:x)+'" '+'y="'+(repeatV===REPEAT?y+h/2-tileH/2:y)+'" '+'width="'+tileW+'" height="'+tileH+'">'+'<svg width="'+tileW+'" height="'+tileH+'" viewBox="'+cropX+" "+cropY+" "+cropW+" "+cropH+'" preserveAspectRatio="none">'+'<image xlink:href="'+imgSrc+'" x="0" y="0" width="'+imgW+'" height="'+imgH+'" />'+"</svg>"+"</pattern>");rects.push('<rect x="'+ | ||
3507 | 123 | x+'" y="'+y+'" width="'+w+'" height="'+h+'" fill="url(#pattern'+i+')" />');i++}addImage(0,0,widthL,widthT,0,0,sliceL,sliceT,widthL,widthT);addImage(widthL,0,centerW,widthT,sliceL,0,imgCenterW,sliceT,tileSizeT,widthT);addImage(elW-widthR,0,widthR,widthT,imgW-sliceR,0,sliceR,sliceT,widthR,widthT);addImage(0,widthT,widthL,middleH,0,sliceT,sliceL,imgMiddleH,widthL,tileSizeL);if(props.fill)addImage(widthL,widthT,centerW,middleH,sliceL,sliceT,imgCenterW,imgMiddleH,tileSizeT||tileSizeB||imgCenterW,tileSizeL|| | ||
3508 | 124 | tileSizeR||imgMiddleH);addImage(elW-widthR,widthT,widthR,middleH,imgW-sliceR,sliceT,sliceR,imgMiddleH,widthR,tileSizeR);addImage(0,elH-widthB,widthL,widthB,0,imgH-sliceB,sliceL,sliceB,widthL,widthB);addImage(widthL,elH-widthB,centerW,widthB,sliceL,imgH-sliceB,imgCenterW,sliceB,tileSizeB,widthB);addImage(elW-widthR,elH-widthB,widthR,widthB,imgW-sliceR,imgH-sliceB,sliceR,sliceB,widthR,widthB);svg.push("<defs>"+patterns.join("\n")+"</defs>"+rects.join("\n")+"</svg>");me.parent.setBackgroundLayer(me.bgLayerZIndex, | ||
3509 | 125 | "url(data:image/svg+xml,"+escape(svg.join(""))+") no-repeat border-box border-box");if(isAsync)me.parent.finishUpdate()},me);isAsync=1},imageToDataURI:function(){var uris={};return function(src,width,height){var uri=uris[src],image,canvas;if(!uri){image=new Image;canvas=doc.createElement("canvas");image.src=src;canvas.width=width;canvas.height=height;canvas.getContext("2d").drawImage(image,0,0);uri=uris[src]=canvas.toDataURL()}return uri}}(),prepareUpdate:PIE.BorderImageRenderer.prototype.prepareUpdate, | ||
3510 | 126 | destroy:function(){var me=this,rs=me.targetElement.runtimeStyle;me.parent.setBackgroundLayer(me.bgLayerZIndex);rs.borderColor=rs.borderStyle=rs.borderWidth=""}});PIE.Element=function(){var wrappers={},lazyInitCssProp=PIE.CSS_PREFIX+"lazy-init",pollCssProp=PIE.CSS_PREFIX+"poll",hoverClass=PIE.CLASS_PREFIX+"hover",activeClass=PIE.CLASS_PREFIX+"active",focusClass=PIE.CLASS_PREFIX+"focus",firstChildClass=PIE.CLASS_PREFIX+"first-child",ignorePropertyNames={"background":1,"bgColor":1,"display":1},classNameRegExes= | ||
3511 | 127 | {},dummyArray=[];function addClass(el,className){el.className+=" "+className}function removeClass(el,className){var re=classNameRegExes[className]||(classNameRegExes[className]=new RegExp("\\b"+className+"\\b","g"));el.className=el.className.replace(re,"")}function delayAddClass(el,className){var classes=dummyArray.slice.call(arguments,1),i=classes.length;setTimeout(function(){while(i--)addClass(el,classes[i])},0)}function delayRemoveClass(el,className){var classes=dummyArray.slice.call(arguments, | ||
3512 | 128 | 1),i=classes.length;setTimeout(function(){while(i--)removeClass(el,classes[i])},0)}function Element(el){var renderers,rootRenderer,boundsInfo=new PIE.BoundsInfo(el),styleInfos,styleInfosArr,initializing,initialized,eventsAttached,eventListeners=[],delayed,destroyed,poll;function init(){if(!initialized){var docEl,bounds,ieDocMode=PIE.ieDocMode,cs=el.currentStyle,lazy=cs.getAttribute(lazyInitCssProp)==="true",childRenderers;poll=cs.getAttribute(pollCssProp);poll=ieDocMode>7?poll!=="false":poll==="true"; | ||
3513 | 129 | if(!initializing){initializing=1;el.runtimeStyle.zoom=1;initFirstChildPseudoClass()}boundsInfo.lock();if(lazy&&(bounds=boundsInfo.getBounds())&&(docEl=doc.documentElement||doc.body)&&(bounds.y>docEl.clientHeight||bounds.x>docEl.clientWidth||bounds.y+bounds.h<0||bounds.x+bounds.w<0)){if(!delayed){delayed=1;PIE.OnScroll.observe(init)}}else{initialized=1;delayed=initializing=0;PIE.OnScroll.unobserve(init);if(ieDocMode===9){styleInfos={backgroundInfo:new PIE.BackgroundStyleInfo(el),borderImageInfo:new PIE.BorderImageStyleInfo(el), | ||
3514 | 130 | borderInfo:new PIE.BorderStyleInfo(el)};styleInfosArr=[styleInfos.backgroundInfo,styleInfos.borderImageInfo];rootRenderer=new PIE.IE9RootRenderer(el,boundsInfo,styleInfos);childRenderers=[new PIE.IE9BackgroundRenderer(el,boundsInfo,styleInfos,rootRenderer),new PIE.IE9BorderImageRenderer(el,boundsInfo,styleInfos,rootRenderer)]}else{styleInfos={backgroundInfo:new PIE.BackgroundStyleInfo(el),borderInfo:new PIE.BorderStyleInfo(el),borderImageInfo:new PIE.BorderImageStyleInfo(el),borderRadiusInfo:new PIE.BorderRadiusStyleInfo(el), | ||
3515 | 131 | boxShadowInfo:new PIE.BoxShadowStyleInfo(el),visibilityInfo:new PIE.VisibilityStyleInfo(el)};styleInfosArr=[styleInfos.backgroundInfo,styleInfos.borderInfo,styleInfos.borderImageInfo,styleInfos.borderRadiusInfo,styleInfos.boxShadowInfo,styleInfos.visibilityInfo];rootRenderer=new PIE.RootRenderer(el,boundsInfo,styleInfos);childRenderers=[new PIE.BoxShadowOutsetRenderer(el,boundsInfo,styleInfos,rootRenderer),new PIE.BackgroundRenderer(el,boundsInfo,styleInfos,rootRenderer),new PIE.BorderRenderer(el, | ||
3516 | 132 | boundsInfo,styleInfos,rootRenderer),new PIE.BorderImageRenderer(el,boundsInfo,styleInfos,rootRenderer)];if(el.tagName==="IMG")childRenderers.push(new PIE.ImgRenderer(el,boundsInfo,styleInfos,rootRenderer));rootRenderer.childRenderers=childRenderers}renderers=[rootRenderer].concat(childRenderers);initAncestorEventListeners();if(poll){PIE.Heartbeat.observe(update);PIE.Heartbeat.run()}update(1)}if(!eventsAttached){eventsAttached=1;if(ieDocMode<9)addListener(el,"onmove",handleMoveOrResize);addListener(el, | ||
3517 | 133 | "onresize",handleMoveOrResize);addListener(el,"onpropertychange",propChanged);addListener(el,"onmouseenter",mouseEntered);addListener(el,"onmouseleave",mouseLeft);addListener(el,"onmousedown",mousePressed);if(el.tagName in PIE.focusableElements){addListener(el,"onfocus",focused);addListener(el,"onblur",blurred)}PIE.OnResize.observe(handleMoveOrResize);PIE.OnUnload.observe(removeEventListeners)}boundsInfo.unlock()}}function handleMoveOrResize(){if(boundsInfo&&boundsInfo.hasBeenQueried())update()}function update(force){if(!destroyed)if(initialized){var i, | ||
3518 | 134 | len=renderers.length;lockAll();for(i=0;i<len;i++)renderers[i].prepareUpdate();if(force||boundsInfo.positionChanged())for(i=0;i<len;i++)renderers[i].updatePos();if(force||boundsInfo.sizeChanged())for(i=0;i<len;i++)renderers[i].updateSize();rootRenderer.finishUpdate();unlockAll()}else if(!initializing)init()}function propChanged(){var i,len=renderers.length,renderer,e=event;if(!destroyed&&!(e&&e.propertyName in ignorePropertyNames))if(initialized){lockAll();for(i=0;i<len;i++)renderers[i].prepareUpdate(); | ||
3519 | 135 | for(i=0;i<len;i++){renderer=renderers[i];if(!renderer.isPositioned)renderer.updatePos();if(renderer.needsUpdate())renderer.updateProps()}rootRenderer.finishUpdate();unlockAll()}else if(!initializing)init()}function mouseEntered(){delayAddClass(el,hoverClass)}function mouseLeft(){delayRemoveClass(el,hoverClass,activeClass)}function mousePressed(){delayAddClass(el,activeClass);PIE.OnMouseup.observe(mouseReleased)}function mouseReleased(){delayRemoveClass(el,activeClass);PIE.OnMouseup.unobserve(mouseReleased)} | ||
3520 | 136 | function focused(){delayAddClass(el,focusClass)}function blurred(){delayRemoveClass(el,focusClass)}function ancestorPropChanged(){var name=event.propertyName;if(name==="className"||name==="id")propChanged()}function lockAll(){boundsInfo.lock();for(var i=styleInfosArr.length;i--;)styleInfosArr[i].lock()}function unlockAll(){for(var i=styleInfosArr.length;i--;)styleInfosArr[i].unlock();boundsInfo.unlock()}function addListener(targetEl,type,handler){targetEl.attachEvent(type,handler);eventListeners.push([targetEl, | ||
3521 | 137 | type,handler])}function removeEventListeners(){if(eventsAttached){var i=eventListeners.length,listener;while(i--){listener=eventListeners[i];listener[0].detachEvent(listener[1],listener[2])}PIE.OnUnload.unobserve(removeEventListeners);eventsAttached=0;eventListeners=[]}}function destroy(){if(!destroyed){var i,len;removeEventListeners();destroyed=1;if(renderers)for(i=0,len=renderers.length;i<len;i++){renderers[i].finalized=1;renderers[i].destroy()}if(poll)PIE.Heartbeat.unobserve(update);PIE.OnResize.unobserve(update); | ||
3522 | 138 | renderers=boundsInfo=styleInfos=styleInfosArr=el=null}}function initAncestorEventListeners(){var watch=el.currentStyle.getAttribute(PIE.CSS_PREFIX+"watch-ancestors"),i,a;if(watch){watch=parseInt(watch,10);i=0;a=el.parentNode;while(a&&(watch==="NaN"||i++<watch)){addListener(a,"onpropertychange",ancestorPropChanged);addListener(a,"onmouseenter",mouseEntered);addListener(a,"onmouseleave",mouseLeft);addListener(a,"onmousedown",mousePressed);if(a.tagName in PIE.focusableElements){addListener(a,"onfocus", | ||
3523 | 139 | focused);addListener(a,"onblur",blurred)}a=a.parentNode}}}function initFirstChildPseudoClass(){var tmpEl=el,isFirst=1;while(tmpEl=tmpEl.previousSibling)if(tmpEl.nodeType===1){isFirst=0;break}if(isFirst)addClass(el,firstChildClass)}this.init=init;this.update=update;this.destroy=destroy;this.el=el}Element.getInstance=function(el){var id=PIE.Util.getUID(el);return wrappers[id]||(wrappers[id]=new Element(el))};Element.destroy=function(el){var id=PIE.Util.getUID(el),wrapper=wrappers[id];if(wrapper){wrapper.destroy(); | ||
3524 | 140 | delete wrappers[id]}};Element.destroyAll=function(){var els=[],wrapper;if(wrappers){for(var w in wrappers)if(wrappers.hasOwnProperty(w)){wrapper=wrappers[w];els.push(wrapper.el);wrapper.destroy()}wrappers={}}return els};return Element}();PIE["supportsVML"]=PIE.supportsVML;PIE["attach"]=function(el){if(PIE.ieDocMode<10&&PIE.supportsVML)PIE.Element.getInstance(el).init()};PIE["detach"]=function(el){PIE.Element.destroy(el)}}})(); | ||
3525 | 0 | \ No newline at end of file | 141 | \ No newline at end of file |
3526 | 1 | 142 | ||
3527 | === added file 'media/js/site.js' | |||
3528 | --- media/js/site.js 1970-01-01 00:00:00 +0000 | |||
3529 | +++ media/js/site.js 2012-03-26 20:23:22 +0000 | |||
3530 | @@ -0,0 +1,26 @@ | |||
3531 | 1 | $(document).ready(function() { | ||
3532 | 2 | $("#wireframe .container").mouseenter(function() { | ||
3533 | 3 | var wf = $(this); | ||
3534 | 4 | wf.css({border:"1px dashed #555", padding:"0px 9px"}); | ||
3535 | 5 | wf.parent().is("header") && wf.append('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>HEADER</h3></div>'); | ||
3536 | 6 | wf.parent().is("aside") && wf.append('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>ASIDE</h3></div>'); | ||
3537 | 7 | wf.parent().is("section") && wf.append('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>CONTENT</h3></div>'); | ||
3538 | 8 | wf.parent().is("footer") && wf.append('<div class="label" style="position:absolute; top:0px; left:0px; background-color:rgba(0,0,0,0.7); padding:10px; color:#fff;"><h3>FOOTER</h3></div>') | ||
3539 | 9 | }); | ||
3540 | 10 | $("#wireframe .container").mouseleave(function() { | ||
3541 | 11 | $(".label").remove(); | ||
3542 | 12 | $(this).css({border:"0px dashed #555", padding:"0px 10px"}) | ||
3543 | 13 | }) | ||
3544 | 14 | }); | ||
3545 | 15 | |||
3546 | 16 | (function(d){d.fn.invert=function(){d(this).find("*").andSelf().each(function(){var e=d(this);a("color",e);a("backgroundColor",e);d.each(["right","bottom","left","top"],function(f,g){a("border-"+g+"-color",e)});c(e)});return this};function a(h,f){var g=b(f.css(h));if(g!="transparent"&&g.substring(0,4)!="rgba"){var e=/rgb\((.+),(.+),(.+)\)/.exec(g);f.css(h,"rgb("+(255-e[1])+","+(255-e[2])+","+(255-e[3])+")")}}function b(g){if(g.substring(0,3)=="rgb"||g=="transparent"){return g}if(g.substring(0,1)=="#"){if(g.length==4){g="#"+g.substring(1,2)+g.substring(1,2)+g.substring(2,3)+g.substring(2,3)+g.substring(3,4)+g.substring(3,4)}return"rgb("+parseInt(g.substring(1,3),16)+","+parseInt(g.substring(3,5),16)+","+parseInt(g.substring(5,7),16)+")"}var e=["black","white","red","yellow","gray","blue","green","lime","fuchsia","aqua","maroon","navy","olive","purple","silver","teal"],f=["(0, 0, 0)","(255, 255, 255)","(255, 0, 0)","(255, 255, 0)","(128, 128, 128)","(0, 0, 255)","(0,128,0)","(0, 255, 0)","(255, 0, 255)","(0, 255, 255)","(128, 0, 0)","(0, 0, 128)","(128, 128, 0)","(128, 0, 128)","(192, 192, 192)","(0, 128, 128)"];g=f[d.inArray(g,e)]||g;return"rgb"+g}function c(h){if(!(h.is("img")||/^(data|url)/.test(h.css("backgroundImage")))){return}var e=new Image();d(e).bind("load",function(){var m=document.createElement("canvas");m.width=e.width;m.height=e.height;var j=m.getContext("2d"),s=0,r=0,t;try{j.drawImage(e,s,r);var k=j.getImageData(s,r,e.width,e.height);var q=k.data;for(var o=0,l=q.length;o<l;o+=4){q[o]=255-q[o];q[o+1]=255-q[o+1];q[o+2]=255-q[o+2]}j.putImageData(k,s,r);t=m.toDataURL()}catch(p){}if(h.is("img")){h.attr("src",t)}else{h.css("backgroundImage","url("+t+")")}}).each(function(){if(this.complete||this.complete===undefined){var i=this.src;this.src="#";this.src=i}});var f=h.css("backgroundImage").match(/url\((.*?)\)/),g=f&&f[1];e.src=h[0].src||g||h.css("backgroundImage")}})(jQuery); | ||
3547 | 17 | |||
3548 | 18 | var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; | ||
3549 | 19 | $(document).keydown(function(a) { | ||
3550 | 20 | kkeys.push(a.keyCode); | ||
3551 | 21 | 0 <= kkeys.toString().indexOf(konami) && ($(document).unbind("keydown", arguments.callee), $.fn.invert && $("body").invert()) | ||
3552 | 22 | }); | ||
3553 | 23 | |||
3554 | 24 | $(function() { | ||
3555 | 25 | $('.twidenash').twidenash(); | ||
3556 | 26 | }); | ||
3557 | 0 | 27 | ||
3558 | === added directory 'templates/old' | |||
3559 | === renamed file 'templates/ubuntu_website_base.html' => 'templates/old/ubuntu_website_base.html' | |||
3560 | === modified file 'templates/website_base.html' | |||
3561 | --- templates/website_base.html 2012-03-25 01:08:53 +0000 | |||
3562 | +++ templates/website_base.html 2012-03-26 20:23:22 +0000 | |||
3563 | @@ -1,36 +1,29 @@ | |||
3566 | 1 | <!DOCTYPE HTML> | 1 | <!DOCTYPE html> |
3567 | 2 | <html> | 2 | <html lang="en"> |
3568 | 3 | <head> | 3 | <head> |
3599 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 | {% block defaulthead %}{% block defaultmeta %}<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
3600 | 5 | 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
3601 | 6 | <title>{% block title %}Ubuntu Website{% endblock %}</title> | 6 | <meta name="viewport" content="width=device-width, initial-scale=1" />{% endblock %} |
3602 | 7 | 7 | {% block extrameta %}{% endblock %} | |
3603 | 8 | {% block defaulthead %} | 8 | <title>{% block title %}Linaro Website{% endblock %}</title> |
3604 | 9 | <link rel="shortcut icon" href="/assets/img/favicon.ico" type="image/x-icon" /> | 9 | |
3605 | 10 | 10 | {% block defaultstyles %}<link rel="shortcut icon" href="{{ubuntu_website_media}}/images/favicon.ico" type="image/x-icon" /> | |
3606 | 11 | <!-- stylesheets --> | 11 | <link rel="stylesheet" type="text/css" media="all" href="//fonts.googleapis.com/css?family=Ubuntu" /> |
3607 | 12 | <!--[if !IE ]><!--> | 12 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core-reset.css" /> |
3608 | 13 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core-reset.css" /> | 13 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core-grid.css" /> |
3609 | 14 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core-grid.css" /> | 14 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core.css" /> |
3610 | 15 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/core.css" /> | 15 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/extra_styles.css" />{% endblock %} |
3611 | 16 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/extra_styles.css" /> | 16 | {%block extrastyles %}{% endblock %} |
3612 | 17 | <!--<link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/default.css" /> | 17 | |
3613 | 18 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/django_extras.css" />--> | 18 | {% block defaultheadjs %}<script src="{{ubuntu_website_media}}/js/modernizr.min.js"></script> |
3614 | 19 | <!--<![endif]--> | 19 | <script src="//code.jquery.com/jquery-1.7.2.min.js"></script> |
3615 | 20 | 20 | <script>window.jQuery || document.write('<script src="{{ubuntu_website_media}}/js/jquery-1.7.2.min.js"><\/script>')</script> | |
3616 | 21 | <!--[if gte IE 7]> | 21 | <script>var website_assets="{{ubuntu_website_media}}";</script>{% endblock %} |
3617 | 22 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/ie.css" /> | 22 | <!--block extraheadjs left out by design, add other JS files to the loader.js script for async loading, |
3618 | 23 | <![endif]--> | 23 | this is done and by design, if you MUST add a <script> tag do so in the closure block and test to ensure |
3619 | 24 | 24 | no breakage has been caused, also avoid inline CSS and JS when possible, use {{ubuntu_website_media}}/css/site.css | |
3620 | 25 | <!--[if IE 6 ]> | 25 | or {{ubuntu_website_media}}/js/site.js so it correct headers are sent and can be cached properly by broswers--> |
3621 | 26 | <link rel="stylesheet" type="text/css" href="{{ubuntu_website_media}}/css/ie6.css" media="screen, projection" /> | 26 | {% endblock %}{% block extrahead %}{% endblock %} |
3592 | 27 | <![endif]--> | ||
3593 | 28 | |||
3594 | 29 | <!--[if IE ]> | ||
3595 | 30 | <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | ||
3596 | 31 | <![endif]--> | ||
3597 | 32 | {% endblock %} | ||
3598 | 33 | {% block extrahead %}{% endblock %} | ||
3622 | 34 | </head> | 27 | </head> |
3623 | 35 | <body> | 28 | <body> |
3624 | 36 | <div class="wrapper"> | 29 | <div class="wrapper"> |
3625 | @@ -75,7 +68,7 @@ | |||
3626 | 75 | <img width="108" height="50" src="{{ubuntu_website_media}}/images/linaro-connect-logo.png" alt="Linaro Connect Logo"/> | 68 | <img width="108" height="50" src="{{ubuntu_website_media}}/images/linaro-connect-logo.png" alt="Linaro Connect Logo"/> |
3627 | 76 | <h2 class="header-text"><a href="/">{% block logo_text %}Country Loco Team{% endblock %}</a></h2> | 69 | <h2 class="header-text"><a href="/">{% block logo_text %}Country Loco Team{% endblock %}</a></h2> |
3628 | 77 | </a> | 70 | </a> |
3630 | 78 | 71 | ||
3631 | 79 | </header> | 72 | </header> |
3632 | 80 | 73 | ||
3633 | 81 | 74 | ||
3634 | @@ -95,7 +88,7 @@ | |||
3635 | 95 | </nav> | 88 | </nav> |
3636 | 96 | 89 | ||
3637 | 97 | <!--<aside id="page-related">--> | 90 | <!--<aside id="page-related">--> |
3639 | 98 | 91 | ||
3640 | 99 | <!-- | 92 | <!-- |
3641 | 100 | {% block search %} | 93 | {% block search %} |
3642 | 101 | <section id="searchbox-container"> | 94 | <section id="searchbox-container"> |
3643 | @@ -106,14 +99,14 @@ | |||
3644 | 106 | {% endblock %} | 99 | {% endblock %} |
3645 | 107 | <hr class="divide" /> | 100 | <hr class="divide" /> |
3646 | 108 | </div>--> | 101 | </div>--> |
3648 | 109 | 102 | ||
3649 | 110 | <!-- </aside> --> | 103 | <!-- </aside> --> |
3650 | 111 | {% endblock %} | 104 | {% endblock %} |
3651 | 112 | 105 | ||
3652 | 113 | {% endif %} | 106 | {% endif %} |
3653 | 114 | 107 | ||
3656 | 115 | 108 | ||
3657 | 116 | 109 | ||
3658 | 117 | {% block messages %} | 110 | {% block messages %} |
3659 | 118 | {% endblock %} | 111 | {% endblock %} |
3660 | 119 | 112 | ||
3661 | @@ -122,7 +115,7 @@ | |||
3662 | 122 | 115 | ||
3663 | 123 | {% block general %} | 116 | {% block general %} |
3664 | 124 | {% endblock %} | 117 | {% endblock %} |
3666 | 125 | 118 | ||
3667 | 126 | 119 | ||
3668 | 127 | </div><!-- div.inner-wrapper --> | 120 | </div><!-- div.inner-wrapper --> |
3669 | 128 | 121 | ||
3670 | @@ -198,7 +191,7 @@ | |||
3671 | 198 | </dd> | 191 | </dd> |
3672 | 199 | {% endblock %} | 192 | {% endblock %} |
3673 | 200 | </dl> | 193 | </dl> |
3675 | 201 | 194 | ||
3676 | 202 | 195 | ||
3677 | 203 | <details class="foot-note"> | 196 | <details class="foot-note"> |
3678 | 204 | {% block footer_note %}<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sit amet lectus massa. </p>{% endblock %} | 197 | {% block footer_note %}<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent sit amet lectus massa. </p>{% endblock %} |
3679 | @@ -208,12 +201,19 @@ | |||
3680 | 208 | </footer> | 201 | </footer> |
3681 | 209 | 202 | ||
3682 | 210 | {% endif %} | 203 | {% endif %} |
3689 | 211 | <!-- IE6 hacks --> | 204 | <script> |
3690 | 212 | <!--[if IE 6 ]> | 205 | (function() { |
3691 | 213 | <script src="{{ubuntu_website_media}}/js/pngFix.js"></script> | 206 | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
3692 | 214 | <script> DD_belatedPNG.fix('.png'); </script> | 207 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
3693 | 215 | <![endif]--> | 208 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
3694 | 216 | {% block extrafooter %}{% endblock %} | 209 | })(); |
3695 | 210 | </script> | ||
3696 | 211 | <script src="{{ubuntu_website_media}}/js/loader.js"></script> | ||
3697 | 212 | <!--[if lt IE 9]> | ||
3698 | 213 | <script src="{{ubuntu_website_media}}/js/polyfills/IE9/IE9.js">IE7_PNG_SUFFIX=".png";</script> | ||
3699 | 214 | <script src="{{ubuntu_website_media}}/js/polyfills/IE9/squish.js"></script> | ||
3700 | 215 | <![endif]--> | ||
3701 | 216 | {% block closure %}{% endblock %} | ||
3702 | 217 | </div> | 217 | </div> |
3703 | 218 | </body> | 218 | </body> |
3704 | 219 | </html> | 219 | </html> |