1
0

Include minified versions of JS plugins.

Included minified version from plugin repository if supllied there.
If not, used http://marijnhaverbeke.nl/uglifyjs on the unminified
source file (keeping "head" comments, which usually include license
info).

Saved ~42% of plugins.js. \o/

References 
This commit is contained in:
Matthias Mees
2014-06-25 13:43:07 +02:00
parent 93790772ae
commit a87944ef44
10 changed files with 58 additions and 6305 deletions

@ -4,148 +4,7 @@
* Source: https://github.com/yatil/accessifyhtml5.js
*/
var AccessifyHTML5 = function (defaults, more_fixes) {
"use strict";
var fixes = {
'article' : {'role': 'article' },
'aside' : {'role': 'complementary' },
'nav' : {'role': 'navigation' },
'main' : {'role': 'main' },
'output' : {'aria-live': 'polite' },
'section' : {'role': 'region' },
'[required]': {'aria-required': 'true' }
},
result = { ok:[], warn:[], fail:[] },
error = result.fail,
fix, elems, attr, value, key, obj, i, mo, by_match, el_label,
ATTR_SECURE = new RegExp("aria-[a-z]+|role|tabindex|title|alt|data-[\\w-]+|lang|"
+ "style|maxlength|placeholder|pattern|required|type|target|accesskey|longdesc"),
ID_PREFIX = "acfy-id-",
n_label = 0,
Doc = document;
if (Doc.querySelectorAll) {
if (defaults) {
if (defaults.header) {
fixes[defaults.header] = {
'role': 'banner'
};
}
if (defaults.footer) {
fixes[defaults.footer] = {
'role': 'contentinfo'
};
}
if (defaults.main) {
fixes[defaults.main] = {
'role': 'main'
};
fixes.main = {
'role': ''
};
}
}
// Either replace fixes...
if (more_fixes && more_fixes._CONFIG_
&& more_fixes._CONFIG_.ignore_defaults) {
fixes = more_fixes;
} else {
// ..Or concatenate - the default.
for (mo in more_fixes) {
fixes[mo] = more_fixes[mo];
}
}
for (fix in fixes) {
if (fix.match(/^_(CONFIG|[A-Z]+)_/)) {
continue; // Silently ignore.
}
if (fixes.hasOwnProperty(fix)) {
//Question: should we catch and report (or ignore) bad selector syntax?
try {
elems = Doc.querySelectorAll(fix);
} catch (ex) {
error.push({ sel:fix, attr:null, val:null,
msg:"Invalid syntax for `document.querySelectorAll` function", ex:ex });
}
obj = fixes[fix];
if (!elems || elems.length < 1) {
result.warn.push({ sel:fix, attr:null, val:null, msg:"Not found" });
}
for (i = 0; i < elems.length; i++) {
for (key in obj) {
if (obj.hasOwnProperty(key)) {
attr = key;
value = obj[key];
if (attr.match(/_?note/)) { // Ignore notes/comments.
continue;
}
if (!attr.match(ATTR_SECURE)) {
error.push({ sel:fix, attr:attr, val:null, msg:"Attribute not allowed",
re:ATTR_SECURE });
continue;
}
if (!(typeof value).match(/string|number|boolean/)) {
error.push({ sel:fix, attr:attr, val:value, msg:"Value-type not allowed" });
continue;
}
// Connect up 'aria-labelledby'. //Question: do we accept poor spelling/ variations?
by_match = attr.match(/(describ|label)l?edby/);
if (by_match) {
try {
el_label = Doc.querySelector(value); //Not: elems[i].querySel()
} catch (ex) {
error.push({ sel:fix, attr:attr, val:value,
msg:"Invalid selector syntax (2) - see 'val'", ex:ex });
}
if (! el_label) {
error.push({ sel:fix, attr:attr, val:value,
msg:"Labelledby ref not found - see 'val'" });
continue;
}
if (! el_label.id) {
el_label.id = ID_PREFIX + n_label;
}
value = el_label.id;
attr = "aria-" + ("label" === by_match[1] ? "labelledby" : "describedby");
n_label++;
}
if (!elems[i].hasAttribute(attr)) {
elems[i].setAttribute(attr, value);
result.ok.push({ sel:fix, attr:attr, val:value, msg:"Added" });
}
else {
result.warn.push({ sel:fix, attr:attr, val:value, msg:"Already present, skipped" });
}
}
}
} //End: for (i..elems..i++)
}
} //End: for (fix in fixes)
}
result.input = fixes;
return result;
};
var AccessifyHTML5=function(e,f){var c={article:{role:"article"},aside:{role:"complementary"},nav:{role:"navigation"},main:{role:"main"},output:{"aria-live":"polite"},section:{role:"region"},"[required]":{"aria-required":"true"}},g={ok:[],warn:[],fail:[]},k=g.fail,b,h,a,d,n,p,l,r,m,s=RegExp("aria-[a-z]+|role|tabindex|title|alt|data-[\\w-]+|lang|style|maxlength|placeholder|pattern|required|type|target|accesskey|longdesc"),t=0,q=document;if(q.querySelectorAll){e&&(e.header&&(c[e.header]={role:"banner"}),
e.footer&&(c[e.footer]={role:"contentinfo"}),e.main&&(c[e.main]={role:"main"},c.main={role:""}));if(f&&f._CONFIG_&&f._CONFIG_.ignore_defaults)c=f;else for(a in f)c[a]=f[a];for(b in c)if(!b.match(/^_(CONFIG|[A-Z]+)_/)&&c.hasOwnProperty(b)){try{h=q.querySelectorAll(b)}catch(u){k.push({sel:b,attr:null,val:null,msg:"Invalid syntax for `document.querySelectorAll` function",ex:u})}p=c[b];(!h||1>h.length)&&g.warn.push({sel:b,attr:null,val:null,msg:"Not found"});for(l=0;l<h.length;l++)for(n in p)if(p.hasOwnProperty(n)&&
(a=n,d=p[n],!a.match(/_?note/)))if(a.match(s))if((typeof d).match(/string|number|boolean/)){if(r=a.match(/(describ|label)l?edby/)){try{m=q.querySelector(d)}catch(v){k.push({sel:b,attr:a,val:d,msg:"Invalid selector syntax (2) - see 'val'",ex:v})}if(!m){k.push({sel:b,attr:a,val:d,msg:"Labelledby ref not found - see 'val'"});continue}m.id||(m.id="acfy-id-"+t);d=m.id;a="aria-"+("label"===r[1]?"labelledby":"describedby");t++}h[l].hasAttribute(a)?g.warn.push({sel:b,attr:a,val:d,msg:"Already present, skipped"}):
(h[l].setAttribute(a,d),g.ok.push({sel:b,attr:a,val:d,msg:"Added"}))}else k.push({sel:b,attr:a,val:d,msg:"Value-type not allowed"});else k.push({sel:b,attr:a,val:null,msg:"Attribute not allowed",re:s})}}g.input=c;return g};

@ -12,109 +12,4 @@
plusplus: true */
/*! @source http://purl.eligrey.com/github/canvas-toBlob.js/blob/master/canvas-toBlob.js */
(function(view) {
"use strict";
var
Uint8Array = view.Uint8Array
, HTMLCanvasElement = view.HTMLCanvasElement
, canvas_proto = HTMLCanvasElement && HTMLCanvasElement.prototype
, is_base64_regex = /\s*;\s*base64\s*(?:;|$)/i
, to_data_url = "toDataURL"
, base64_ranks
, decode_base64 = function(base64) {
var
len = base64.length
, buffer = new Uint8Array(len / 4 * 3 | 0)
, i = 0
, outptr = 0
, last = [0, 0]
, state = 0
, save = 0
, rank
, code
, undef
;
while (len--) {
code = base64.charCodeAt(i++);
rank = base64_ranks[code-43];
if (rank !== 255 && rank !== undef) {
last[1] = last[0];
last[0] = code;
save = (save << 6) | rank;
state++;
if (state === 4) {
buffer[outptr++] = save >>> 16;
if (last[1] !== 61 /* padding character */) {
buffer[outptr++] = save >>> 8;
}
if (last[0] !== 61 /* padding character */) {
buffer[outptr++] = save;
}
state = 0;
}
}
}
// 2/3 chance there's going to be some null bytes at the end, but that
// doesn't really matter with most image formats.
// If it somehow matters for you, truncate the buffer up outptr.
return buffer;
}
;
if (Uint8Array) {
base64_ranks = new Uint8Array([
62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1
, -1, -1, 0, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35
, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
]);
}
if (HTMLCanvasElement && !canvas_proto.toBlob) {
canvas_proto.toBlob = function(callback, type /*, ...args*/) {
if (!type) {
type = "image/png";
} if (this.mozGetAsFile) {
callback(this.mozGetAsFile("canvas", type));
return;
}
var
args = Array.prototype.slice.call(arguments, 1)
, dataURI = this[to_data_url].apply(this, args)
, header_end = dataURI.indexOf(",")
, data = dataURI.substring(header_end + 1)
, is_base64 = is_base64_regex.test(dataURI.substring(0, header_end))
, blob
;
if (Blob.fake) {
// no reason to decode a data: URI that's just going to become a data URI again
blob = new Blob
if (is_base64) {
blob.encoding = "base64";
} else {
blob.encoding = "URI";
}
blob.data = data;
blob.size = data.length;
} else if (Uint8Array) {
if (is_base64) {
blob = new Blob([decode_base64(data)], {type: type});
} else {
blob = new Blob([decodeURIComponent(data)], {type: type});
}
}
callback(blob);
};
if (canvas_proto.toDataURLHD) {
canvas_proto.toBlobHD = function() {
to_data_url = "toDataURLHD";
var blob = this.toBlob();
to_data_url = "toDataURL";
return blob;
}
} else {
canvas_proto.toBlobHD = canvas_proto.toBlob;
}
}
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
!function(a){"use strict";var g,b=a.Uint8Array,c=a.HTMLCanvasElement,d=c&&c.prototype,e=/\s*;\s*base64\s*(?:;|$)/i,f="toDataURL",h=function(a){for(var k,l,m,c=a.length,d=new b(0|3*(c/4)),e=0,f=0,h=[0,0],i=0,j=0;c--;)l=a.charCodeAt(e++),k=g[l-43],255!==k&&k!==m&&(h[1]=h[0],h[0]=l,j=j<<6|k,i++,4===i&&(d[f++]=j>>>16,61!==h[1]&&(d[f++]=j>>>8),61!==h[0]&&(d[f++]=j),i=0));return d};b&&(g=new b([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])),c&&!d.toBlob&&(d.toBlob=function(a,c){if(c||(c="image/png"),this.mozGetAsFile)return a(this.mozGetAsFile("canvas",c)),void 0;var l,d=Array.prototype.slice.call(arguments,1),g=this[f].apply(this,d),i=g.indexOf(","),j=g.substring(i+1),k=e.test(g.substring(0,i));Blob.fake?(l=new Blob,l.encoding=k?"base64":"URI",l.data=j,l.size=j.length):b&&(l=k?new Blob([h(j)],{type:c}):new Blob([decodeURIComponent(j)],{type:c})),a(l)},d.toBlobHD=d.toDataURLHD?function(){f="toDataURLHD";var a=this.toBlob();return f="toDataURL",a}:d.toBlob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this);

@ -9,118 +9,4 @@
* Date: 2006-09-19
* Rev: 001
*/
$.autoscroll = {
settings: {},
interval: 0,
event: null,
init: function(opts) {
$.autoscroll.settings = {
step: 80,
trigger: 75,
interval: 80,
mod_key: 17
};
if (opts) {
for (o in opts) {
$.autoscroll.settings[o] = opts[o];
}
}
$.autoscroll.setKeyEvent();
document.onmousemove= $.autoscroll.setMouseEvent;
},
stop: function() {
clearInterval($.autoscroll.interval);
$.autoscroll.interval = 0;
},
setKeyEvent: function(e) {
if ($.autoscroll.interval == 0) {
$.autoscroll.interval = setInterval($.autoscroll.step, $.autoscroll.settings.interval);
}
},
setMouseEvent: function(e) {
var e = e || window.event;
var de = document.documentElement;
var b = document.body;
$.autoscroll.event = {
cursor: {
x: e.pageX || (e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0)),
y: e.pageY || (e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0))
},
win: {
w: window.innerWidth || (de.clientWidth && de.clientWidth != 0 ? de.clientWidth : b.offsetWidth),
h: window.innerHeight || (de.clientHeight && de.clientWidth != 0 ? de.clientHeight : b.offsetHeight)
},
scroll: {
x: (document.all ?
(!de.scrollLeft ? b.scrollLeft : de.scrollLeft)
:
(window.pageXOffset ? window.pageXOffset : window.scrollX)
),
y: (document.all ?
(!de.scrollTop ? b.scrollTop : de.scrollTop)
:
(window.pageYOffset ? window.pageYOffset : window.scrollY)
)
}
};
},
step: function() {
var e = $.autoscroll.event;
if (!e) {
return;
}
var hot_l = e.scroll.x;
var hot_r = e.scroll.x + e.win.w;
var x = e.cursor.x;
var hot_t = e.scroll.y;
var hot_b = e.scroll.y + e.win.h;
var y = e.cursor.y;
if (hot_l <= x && x <= (hot_l + $.autoscroll.settings.trigger)) {
var ratio = (1 - ((x - hot_l) / $.autoscroll.settings.trigger));
var step = Math.round(ratio * $.autoscroll.settings.step, 0);
e.scroll.x += -step;
e.cursor.x += -step;
} else if ((hot_r - $.autoscroll.settings.trigger) <= x && x <= hot_r) {
var ratio = (1 - ((hot_r - x) / $.autoscroll.settings.trigger));
var step = Math.round(ratio * $.autoscroll.settings.step, 0);
e.scroll.x += step;
e.cursor.x += step;
}
if (hot_t <= y && y <= (hot_t + $.autoscroll.settings.trigger)) {
var ratio = (1 - ((y - hot_t) / $.autoscroll.settings.trigger));
var step = Math.round(ratio * $.autoscroll.settings.step, 0);
e.scroll.y += -step;
e.cursor.y += -step;
} else if ((hot_b - $.autoscroll.settings.trigger) <= y && y <= hot_b) {
var ratio = (1 - ((hot_b - y) / $.autoscroll.settings.trigger));
var step = Math.round(ratio * $.autoscroll.settings.step, 0);
e.scroll.y += step;
e.cursor.y += step;
}
if (e.scroll.x < 0) {
e.scroll.x = 0;
e.cursor.x = 0;
}
if (e.scroll.y < 0) {
e.scroll.y = 0;
e.cursor.y = 0;
}
window.scrollTo(e.scroll.x, e.scroll.y);
}
};
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[(function(e){return d[e]})];e=(function(){return'\\w+'});c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('$.2={5:{},f:0,m:18,14:i(t){$.2.5={4:G,9:15,f:G,B:17};c(t){12(o 16 t){$.2.5[o]=t[o]}}g.19=$.2.C;g.1a=$.2.I;g.1b=i(){1c($.2.f);$.2.f=0}},I:i(e){3 e=e||8.m;3 k=e.K?e.K:e.A?e.A:e.M;c($.2.f==0&&($.2.5.B==k)){$.2.f=N($.2.4,$.2.5.f)}},C:i(e){3 e=e||8.m;3 6=g.P;3 b=g.Q;$.2.m={a:{x:e.R||(e.W+(6.l||b.l)-(6.S||0)),y:e.T||(e.U+(6.j||b.j)-(6.X||0))},z:{w:8.Y||(6.n&&6.n!=0?6.n:b.Z),h:8.10||(6.D&&6.n!=0?6.D:b.11)},7:{x:(g.H?(!6.l?b.l:6.l):(8.F?8.F:8.13)),y:(g.H?(!6.j?b.j:6.j):(8.J?8.J:8.L))}}},4:i(){3 e=$.2.m;c(!e){O}3 p=e.7.x;3 q=e.7.x+e.z.w;3 x=e.a.x;3 r=e.7.y;3 v=e.7.y+e.z.h;3 y=e.a.y;c(p<=x&&x<=(p+$.2.5.9)){3 d=(1-((x-p)/$.2.5.9));3 4=u.s(d*$.2.5.4,0);e.7.x+=-4;e.a.x+=-4}E c((q-$.2.5.9)<=x&&x<=q){3 d=(1-((q-x)/$.2.5.9));3 4=u.s(d*$.2.5.4,0);e.7.x+=4;e.a.x+=4}c(r<=y&&y<=(r+$.2.5.9)){3 d=(1-((y-r)/$.2.5.9));3 4=u.s(d*$.2.5.4,0);e.7.y+=-4;e.a.y+=-4}E c((v-$.2.5.9)<=y&&y<=v){3 d=(1-((v-y)/$.2.5.9));3 4=u.s(d*$.2.5.4,0);e.7.y+=4;e.a.y+=4}c(e.7.x<0){e.7.x=0;e.a.x=0}c(e.7.y<0){e.7.y=0;e.a.y=0}8.V(e.7.x,e.7.y)}};',62,75,'||autoscroll|var|step|settings|de|scroll|window|trigger|cursor||if|ratio||interval|document||function|scrollTop||scrollLeft|event|clientWidth||hot_l|hot_r|hot_t|round|opts|Math|hot_b||||win|keyCode|mod_key|setMouseEvent|clientHeight|else|pageXOffset|80|all|setKeyEvent|pageYOffset|charCode|scrollY|which|setInterval|return|documentElement|body|pageX|clientLeft|pageY|clientY|scrollTo|clientX|clientTop|innerWidth|offsetWidth|innerHeight|offsetHeight|for|scrollX|init|75|in||null|onmousemove|onkeydown|onkeyup|clearInterval'.split('|'),0,{}))

@ -5,113 +5,4 @@
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as anonymous module.
define(['jquery'], factory);
} else {
// Browser globals.
factory(jQuery);
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
} catch(e) {
return;
}
try {
// If we can't parse the cookie, ignore it, it's unusable.
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (value !== undefined && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// Read
var result = key ? undefined : {};
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
var cookies = document.cookie ? document.cookie.split('; ') : [];
for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');
if (key && key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
if ($.cookie(key) !== undefined) {
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return true;
}
return false;
};
}));
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function c(a){return h.raw?a:encodeURIComponent(a)}function d(a){return h.raw?a:decodeURIComponent(a)}function e(a){return c(h.json?JSON.stringify(a):String(a))}function f(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{a=decodeURIComponent(a.replace(b," "))}catch(c){return}try{return h.json?JSON.parse(a):a}catch(c){}}function g(b,c){var d=h.raw?b:f(b);return a.isFunction(c)?c(d):d}var b=/\+/g,h=a.cookie=function(b,f,i){if(void 0!==f&&!a.isFunction(f)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setDate(k.getDate()+j)}return document.cookie=[c(b),"=",e(f),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=b?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=d(p.shift()),r=p.join("=");if(b&&b===q){l=g(r,f);break}b||void 0===(r=g(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}});

@ -1,151 +1,2 @@
/*! http://mths.be/details v0.1.0 by @mathias | includes http://mths.be/noselect v1.0.3 */
;(function(document, $) {
var proto = $.fn,
details,
// :'(
isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]',
// Feature test for native `<details>` support
isDetailsSupported = (function(doc) {
var el = doc.createElement('details'),
fake,
root,
diff;
if (!('open' in el)) {
return false;
}
root = doc.body || (function() {
var de = doc.documentElement;
fake = true;
return de.insertBefore(doc.createElement('body'), de.firstElementChild || de.firstChild);
}());
el.innerHTML = '<summary>a</summary>b';
el.style.display = 'block';
root.appendChild(el);
diff = el.offsetHeight;
el.open = true;
diff = diff != el.offsetHeight;
root.removeChild(el);
if (fake) {
root.parentNode.removeChild(root);
}
return diff;
}(document)),
toggleOpen = function($details, $detailsSummary, $detailsNotSummary, toggle) {
var isOpen = $details.prop('open'),
close = isOpen && toggle || !isOpen && !toggle;
if (close) {
$details.removeClass('open').prop('open', false).triggerHandler('close.details');
$detailsSummary.attr('aria-expanded', false);
$detailsNotSummary.hide();
} else {
$details.addClass('open').prop('open', true).triggerHandler('open.details');
$detailsSummary.attr('aria-expanded', true);
$detailsNotSummary.show();
}
};
/* http://mths.be/noselect v1.0.3 */
proto.noSelect = function() {
// Since the string 'none' is used three times, storing it in a variable gives better results after minification
var none = 'none';
// onselectstart and ondragstart for WebKit & IE
// onmousedown for WebKit & Opera
return this.bind('selectstart dragstart mousedown', function() {
return false;
}).css({
'MozUserSelect': none,
'msUserSelect': none,
'webkitUserSelect': none,
'userSelect': none
});
};
// Execute the fallback only if theres no native `details` support
if (isDetailsSupported) {
details = proto.details = function() {
return this.each(function() {
var $details = $(this),
$summary = $('summary', $details).first();
$summary.attr({
'role': 'button',
'aria-expanded': $details.prop('open')
}).on('click', function() {
// the value of the `open` property is the old value
var close = $details.prop('open');
$summary.attr('aria-expanded', !close);
$details.triggerHandler((close ? 'close' : 'open') + '.details');
});
});
};
details.support = isDetailsSupported;
} else {
details = proto.details = function() {
// Loop through all `details` elements
return this.each(function() {
// Store a reference to the current `details` element in a variable
var $details = $(this),
// Store a reference to the `summary` element of the current `details` element (if any) in a variable
$detailsSummary = $('summary', $details).first(),
// Do the same for the info within the `details` element
$detailsNotSummary = $details.children(':not(summary)'),
// This will be used later to look for direct child text nodes
$detailsNotSummaryContents = $details.contents(':not(summary)');
// If there is no `summary` in the current `details` element…
if (!$detailsSummary.length) {
// …create one with default text
$detailsSummary = $('<summary>').text('Details').prependTo($details);
}
// Look for direct child text nodes
if ($detailsNotSummary.length != $detailsNotSummaryContents.length) {
// Wrap child text nodes in a `span` element
$detailsNotSummaryContents.filter(function() {
// Only keep the node in the collection if its a text node containing more than only whitespace
// http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#space-character
return this.nodeType == 3 && /[^ \t\n\f\r]/.test(this.data);
}).wrap('<span>');
// There are now no direct child text nodes anymore — theyre wrapped in `span` elements
$detailsNotSummary = $details.children(':not(summary)');
}
// Hide content unless theres an `open` attribute
$details.prop('open', typeof $details.attr('open') == 'string');
toggleOpen($details, $detailsSummary, $detailsNotSummary);
// Add `role=button` and set the `tabindex` of the `summary` element to `0` to make it keyboard accessible
$detailsSummary.attr('role', 'button').noSelect().prop('tabIndex', 0).on('click', function() {
// Focus on the `summary` element
$detailsSummary.focus();
// Toggle the `open` and `aria-expanded` attributes and the `open` property of the `details` element and display the additional info
toggleOpen($details, $detailsSummary, $detailsNotSummary, true);
}).keyup(function(event) {
if (32 == event.keyCode || (13 == event.keyCode && !isOpera)) {
// Space or Enter is pressed — trigger the `click` event on the `summary` element
// Opera already seems to trigger the `click` event when Enter is pressed
event.preventDefault();
$detailsSummary.click();
}
});
});
};
details.support = isDetailsSupported;
}
}(document, jQuery));
;(function(a,f){var e=f.fn,d,c=Object.prototype.toString.call(window.opera)=='[object Opera]',g=(function(l){var j=l.createElement('details'),i,h,k;if(!('open' in j)){return false}h=l.body||(function(){var m=l.documentElement;i=true;return m.insertBefore(l.createElement('body'),m.firstElementChild||m.firstChild)}());j.innerHTML='<summary>a</summary>b';j.style.display='block';h.appendChild(j);k=j.offsetHeight;j.open=true;k=k!=j.offsetHeight;h.removeChild(j);if(i){h.parentNode.removeChild(h)}return k}(a)),b=function(i,l,k,h){var j=i.prop('open'),m=j&&h||!j&&!h;if(m){i.removeClass('open').prop('open',false).triggerHandler('close.details');l.attr('aria-expanded',false);k.hide()}else{i.addClass('open').prop('open',true).triggerHandler('open.details');l.attr('aria-expanded',true);k.show()}};e.noSelect=function(){var h='none';return this.bind('selectstart dragstart mousedown',function(){return false}).css({MozUserSelect:h,msUserSelect:h,webkitUserSelect:h,userSelect:h})};if(g){d=e.details=function(){return this.each(function(){var i=f(this),h=f('summary',i).first();h.attr({role:'button','aria-expanded':i.prop('open')}).on('click',function(){var j=i.prop('open');h.attr('aria-expanded',!j);i.triggerHandler((j?'close':'open')+'.details')})})};d.support=g}else{d=e.details=function(){return this.each(function(){var h=f(this),j=f('summary',h).first(),i=h.children(':not(summary)'),k=h.contents(':not(summary)');if(!j.length){j=f('<summary>').text('Details').prependTo(h)}if(i.length!=k.length){k.filter(function(){return this.nodeType==3&&/[^ \t\n\f\r]/.test(this.data)}).wrap('<span>');i=h.children(':not(summary)')}h.prop('open',typeof h.attr('open')=='string');b(h,j,i);j.attr('role','button').noSelect().prop('tabIndex',0).on('click',function(){j.focus();b(h,j,i,true)}).keyup(function(l){if(32==l.keyCode||(13==l.keyCode&&!c)){l.preventDefault();j.click()}})})};d.support=g}}(document,jQuery));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -13,83 +13,6 @@
* http://www.gnu.org/licenses/gpl.html
*
* Version: 1.3
*
* Changelog
* * v1.3: compatibility fix for jQuery 1.9.x (removed $.browser)
*
* Usage:
$(window).load(function(){
$('p').syncHeight();
});
*/
(function($) {
var getHeightProperty = function() {
var browser_id = 0;
var property = [
// To avoid content overflow in synchronised boxes on font scaling, we
// use 'min-height' property for modern browsers ...
['min-height','0px'],
// and 'height' property for Internet Explorer.
['height','1%']
];
var bMatch = /(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase()) || [],
browser = bMatch[1] || "",
browserVersion = bMatch[2] || "0";
// check for IE6 ...
if(browser == 'msie' && browserVersion < 7){
browser_id = 1;
}
return { 'name': property[browser_id][0],
'autoheightVal': property[browser_id][1] };
};
$.getSyncedHeight = function(selector) {
var max = 0;
var heightProperty = getHeightProperty();
// get maximum element height ...
$(selector).each(function() {
// fallback to auto height before height check ...
$(this).css(heightProperty.name, heightProperty.autoheightVal);
var val = $(this).height();
if(val > max){
max = val;
}
});
return max;
};
$.fn.syncHeight = function(config) {
var defaults = {
updateOnResize: false, // re-sync element heights after a browser resize event (useful in flexible layouts)
height: false
};
var options = $.extend(defaults, config);
var e = this;
var max = 0;
var heightPropertyName = getHeightProperty().name;
if(typeof(options.height) === "number") {
max = options.height;
} else {
max = $.getSyncedHeight(this);
}
// set synchronized element height ...
$(this).each(function() {
$(this).css(heightPropertyName, max+'px');
});
// optional sync refresh on resize event ...
if (options.updateOnResize === true) {
$(window).resize(function(){
$(e).syncHeight();
});
}
return this;
};
})(jQuery);
!function(a){var b=function(){var a=0,b=[["min-height","0px"],["height","1%"]],c=/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[],d=c[1]||"",e=c[2]||"0";return"msie"==d&&7>e&&(a=1),{name:b[a][0],autoheightVal:b[a][1]}};a.getSyncedHeight=function(c){var d=0,e=b();return a(c).each(function(){a(this).css(e.name,e.autoheightVal);var b=a(this).height();b>d&&(d=b)}),d},a.fn.syncHeight=function(c){var d={updateOnResize:!1,height:!1},e=a.extend(d,c),f=this,g=0,h=b().name;return g="number"==typeof e.height?e.height:a.getSyncedHeight(this),a(this).each(function(){a(this).css(h,g+"px")}),e.updateOnResize===!0&&a(window).resize(function(){a(f).syncHeight()}),this}}(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long