mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
update libraries
This commit is contained in:
parent
669d1a9bc2
commit
9f8085036a
2
app.hta
2
app.hta
|
@ -47,7 +47,7 @@
|
|||
Selection="No"
|
||||
/>
|
||||
<title>NextVPN</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=7" />
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
|
||||
<meta name="description" content="Welsonjs: Build a windows desktop apps fastly without installing packages" />
|
||||
<meta name="keywords" content="webapp" />
|
||||
|
|
11
app/assets/js/es6-sham-0.35.5.min.js
vendored
Normal file
11
app/assets/js/es6-sham-0.35.5.min.js
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
/*!
|
||||
* https://github.com/paulmillr/es6-shim
|
||||
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
|
||||
* and contributors, MIT License
|
||||
* es6-sham: v0.35.4
|
||||
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
|
||||
* Details and documentation:
|
||||
* https://github.com/paulmillr/es6-shim/
|
||||
*/
|
||||
(function(t,e){if(typeof define==="function"&&define.amd){define(e)}else if(typeof exports==="object"){module.exports=e()}else{t.returnExports=e()}})(this,function(){"use strict";var t=new Function("return this;");var e=t();var r=e.Object;var n=Function.call.bind(Function.call);var o=Function.toString;var i=String.prototype.match;var f=function(t){try{t();return false}catch(e){return true}};var u=function(){return!f(function(){r.defineProperty({},"x",{get:function(){}})})};var a=!!r.defineProperty&&u();(function(){if(r.setPrototypeOf){return}var t=r.getOwnPropertyNames;var e=r.getOwnPropertyDescriptor;var n=r.create;var o=r.defineProperty;var i=r.getPrototypeOf;var f=r.prototype;var u=function(r,n){t(n).forEach(function(t){o(r,t,e(n,t))});return r};var a=function(t,e){return u(n(e),t)};var c,s;try{c=e(f,"__proto__").set;c.call({},null);s=function(t,e){c.call(t,e);return t}}catch(p){c={__proto__:null};if(c instanceof r){s=a}else{c.__proto__=f;if(c instanceof r){s=function(t,e){t.__proto__=e;return t}}else{s=function(t,e){if(i(t)){t.__proto__=e;return t}else{return a(t,e)}}}}}r.setPrototypeOf=s})();if(a&&function foo(){}.name!=="foo"){r.defineProperty(Function.prototype,"name",{configurable:true,enumerable:false,get:function(){if(this===Function.prototype){return""}var t=n(o,this);var e=n(i,t,/\s*function\s+([^(\s]*)\s*/);var f=e&&e[1];r.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:f});return f}})}});
|
||||
//# sourceMappingURL=es6-sham.map
|
11
app/assets/js/es6-sham.min.js
vendored
11
app/assets/js/es6-sham.min.js
vendored
|
@ -1,11 +0,0 @@
|
|||
/*!
|
||||
* https://github.com/paulmillr/es6-shim
|
||||
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
|
||||
* and contributors, MIT License
|
||||
* es6-sham: v0.35.1
|
||||
* see https://github.com/paulmillr/es6-shim/blob/0.35.1/LICENSE
|
||||
* Details and documentation:
|
||||
* https://github.com/paulmillr/es6-shim/
|
||||
*/
|
||||
(function(t,e){if(typeof define==="function"&&define.amd){define(e)}else if(typeof exports==="object"){module.exports=e()}else{t.returnExports=e()}})(this,function(){"use strict";var t=new Function("return this;");var e=t();var r=e.Object;var n=Function.call.bind(Function.call);var o=Function.toString;var i=String.prototype.match;var f=function(t){try{t();return false}catch(e){return true}};var a=function(){return!f(function(){r.defineProperty({},"x",{get:function(){}})})};var u=!!r.defineProperty&&a();(function(){if(r.setPrototypeOf){return}var t=r.getOwnPropertyNames;var e=r.getOwnPropertyDescriptor;var n=r.create;var o=r.defineProperty;var i=r.getPrototypeOf;var f=r.prototype;var a=function(r,n){t(n).forEach(function(t){o(r,t,e(n,t))});return r};var u=function(t,e){return a(n(e),t)};var c,s;try{c=e(f,"__proto__").set;c.call({},null);s=function(t,e){c.call(t,e);return t}}catch(l){c={__proto__:null};if(c instanceof r){s=u}else{c.__proto__=f;if(c instanceof r){s=function(t,e){t.__proto__=e;return t}}else{s=function(t,e){if(i(t)){t.__proto__=e;return t}else{return u(t,e)}}}}}r.setPrototypeOf=s})();if(u&&function foo(){}.name!=="foo"){r.defineProperty(Function.prototype,"name",{configurable:true,enumerable:false,get:function(){var t=n(o,this);var e=n(i,t,/\s*function\s+([^\(\s]*)\s*/);var f=e&&e[1];r.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:f});return f}})}});
|
||||
//# sourceMappingURL=es6-sham.map
|
12
app/assets/js/es6-shim-0.35.5.min.js
vendored
Normal file
12
app/assets/js/es6-shim-0.35.5.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12
app/assets/js/es6-shim.min.js
vendored
12
app/assets/js/es6-shim.min.js
vendored
File diff suppressed because one or more lines are too long
5
app/assets/js/respond.min.js
vendored
5
app/assets/js/respond.min.js
vendored
|
@ -1,5 +0,0 @@
|
|||
/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
|
||||
* Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
|
||||
* */
|
||||
|
||||
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
|
5
app/assets/js/selectivizr-min.js
vendored
5
app/assets/js/selectivizr-min.js
vendored
|
@ -1,5 +0,0 @@
|
|||
/*!
|
||||
* selectivizr v1.0.2 - (c) Keith Clark, freely distributable under the terms of the MIT license.
|
||||
* selectivizr.com
|
||||
*/
|
||||
(function(j){function A(a){return a.replace(B,h).replace(C,function(a,d,b){for(var a=b.split(","),b=0,e=a.length;b<e;b++){var s=D(a[b].replace(E,h).replace(F,h))+o,l=[];a[b]=s.replace(G,function(a,b,c,d,e){if(b){if(l.length>0){var a=l,f,e=s.substring(0,e).replace(H,i);if(e==i||e.charAt(e.length-1)==o)e+="*";try{f=t(e)}catch(k){}if(f){e=0;for(c=f.length;e<c;e++){for(var d=f[e],h=d.className,j=0,m=a.length;j<m;j++){var g=a[j];if(!RegExp("(^|\\s)"+g.className+"(\\s|$)").test(d.className)&&g.b&&(g.b===!0||g.b(d)===!0))h=u(h,g.className,!0)}d.className=h}}l=[]}return b}else{if(b=c?I(c):!v||v.test(d)?{className:w(d),b:!0}:null)return l.push(b),"."+b.className;return a}})}return d+a.join(",")})}function I(a){var c=!0,d=w(a.slice(1)),b=a.substring(0,5)==":not(",e,f;b&&(a=a.slice(5,-1));var l=a.indexOf("(");l>-1&&(a=a.substring(0,l));if(a.charAt(0)==":")switch(a.slice(1)){case "root":c=function(a){return b?a!=p:a==p};break;case "target":if(m==8){c=function(a){function c(){var d=location.hash,e=d.slice(1);return b?d==i||a.id!=e:d!=i&&a.id==e}k(j,"hashchange",function(){g(a,d,c())});return c()};break}return!1;case "checked":c=function(a){J.test(a.type)&&k(a,"propertychange",function(){event.propertyName=="checked"&&g(a,d,a.checked!==b)});return a.checked!==b};break;case "disabled":b=!b;case "enabled":c=function(c){if(K.test(c.tagName))return k(c,"propertychange",function(){event.propertyName=="$disabled"&&g(c,d,c.a===b)}),q.push(c),c.a=c.disabled,c.disabled===b;return a==":enabled"?b:!b};break;case "focus":e="focus",f="blur";case "hover":e||(e="mouseenter",f="mouseleave");c=function(a){k(a,b?f:e,function(){g(a,d,!0)});k(a,b?e:f,function(){g(a,d,!1)});return b};break;default:if(!L.test(a))return!1}return{className:d,b:c}}function w(a){return M+"-"+(m==6&&N?O++:a.replace(P,function(a){return a.charCodeAt(0)}))}function D(a){return a.replace(x,h).replace(Q,o)}function g(a,c,d){var b=a.className,c=u(b,c,d);if(c!=b)a.className=c,a.parentNode.className+=i}function u(a,c,d){var b=RegExp("(^|\\s)"+c+"(\\s|$)"),e=b.test(a);return d?e?a:a+o+c:e?a.replace(b,h).replace(x,h):a}function k(a,c,d){a.attachEvent("on"+c,d)}function r(a,c){if(/^https?:\/\//i.test(a))return c.substring(0,c.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null;if(a.charAt(0)=="/")return c.substring(0,c.indexOf("/",8))+a;var d=c.split(/[?#]/)[0];a.charAt(0)!="?"&&d.charAt(d.length-1)!="/"&&(d=d.substring(0,d.lastIndexOf("/")+1));return d+a}function y(a){if(a)return n.open("GET",a,!1),n.send(),(n.status==200?n.responseText:i).replace(R,i).replace(S,function(c,d,b,e,f){return y(r(b||f,a))}).replace(T,function(c,d,b){d=d||i;return" url("+d+r(b,a)+d+") "});return i}function U(){var a,c;a=f.getElementsByTagName("BASE");for(var d=a.length>0?a[0].href:f.location.href,b=0;b<f.styleSheets.length;b++)if(c=f.styleSheets[b],c.href!=i&&(a=r(c.href,d)))c.cssText=A(y(a));q.length>0&&setInterval(function(){for(var a=0,c=q.length;a<c;a++){var b=q[a];if(b.disabled!==b.a)b.disabled?(b.disabled=!1,b.a=!0,b.disabled=!0):b.a=b.disabled}},250)}if(!/*@cc_on!@*/true){var f=document,p=f.documentElement,n=function(){if(j.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return null}}(),m=/MSIE (\d+)/.exec(navigator.userAgent)[1];if(!(f.compatMode!="CSS1Compat"||m<6||m>8||!n)){var z={NW:"*.Dom.select",MooTools:"$$",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",Sizzle:"*",jQuery:"*",dojo:"*.query"},t,q=[],O=0,N=!0,M="slvzr",R=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g,S=/@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g,T=/\burl\(\s*(["']?)(?!data:)([^"')]+)\1\s*\)/g,L=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,B=/:(:first-(?:line|letter))/g,C=/(^|})\s*([^\{]*?[\[:][^{]+)/g,G=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,H=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,P=/[^\w-]/g,K=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,J=/^(checkbox|radio)$/,v=m>6?/[\$\^*]=(['"])\1/:null,E=/([(\[+~])\s+/g,F=/\s+([)\]+~])/g,Q=/\s+/g,x=/^\s*((?:[\S\s]*\S)?)\s*$/,i="",o=" ",h="$1";(function(a,c){function d(){try{p.doScroll("left")}catch(a){setTimeout(d,50);return}b("poll")}function b(d){if(!(d.type=="readystatechange"&&f.readyState!="complete")&&((d.type=="load"?a:f).detachEvent("on"+d.type,b,!1),!e&&(e=!0)))c.call(a,d.type||d)}var e=!1,g=!0;if(f.readyState=="complete")c.call(a,i);else{if(f.createEventObject&&p.doScroll){try{g=!a.frameElement}catch(h){}g&&d()}k(f,"readystatechange",b);k(a,"load",b)}})(j,function(){for(var a in z){var c,d,b=j;if(j[a]){for(c=z[a].replace("*",a).split(".");(d=c.shift())&&(b=b[d]););if(typeof b=="function"){t=b;U();break}}}})}}})(this);
|
2
app/assets/js/webreflection-ie8-0.8.1.min.js
vendored
Normal file
2
app/assets/js/webreflection-ie8-0.8.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
271
app/assets/js/welsonjs-respond-1.4.2-modified.js
Normal file
271
app/assets/js/welsonjs-respond-1.4.2-modified.js
Normal file
|
@ -0,0 +1,271 @@
|
|||
var FILE = require('lib/file');
|
||||
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
(function(w) {
|
||||
"use strict";
|
||||
w.matchMedia = w.matchMedia || function(doc, undefined) {
|
||||
var bool, docElem = doc.documentElement,
|
||||
refNode = docElem.firstElementChild || docElem.firstChild,
|
||||
fakeBody = doc.createElement("body"),
|
||||
div = doc.createElement("div");
|
||||
div.id = "mq-test-1";
|
||||
div.style.cssText = "position:absolute;top:-100em";
|
||||
fakeBody.style.background = "none";
|
||||
fakeBody.appendChild(div);
|
||||
return function(q) {
|
||||
div.innerHTML = '­<style media="' + q + '"> #mq-test-1 { width: 42px; }</style>';
|
||||
docElem.insertBefore(fakeBody, refNode);
|
||||
bool = div.offsetWidth === 42;
|
||||
docElem.removeChild(fakeBody);
|
||||
return {
|
||||
matches: bool,
|
||||
media: q
|
||||
};
|
||||
};
|
||||
}(w.document);
|
||||
})(this);
|
||||
|
||||
/*! Respond.js v1.4.0: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
|
||||
(function(w) {
|
||||
"use strict";
|
||||
var respond = {};
|
||||
w.respond = respond;
|
||||
respond.update = function() {};
|
||||
var requestQueue = [],
|
||||
xmlHttp = function() {
|
||||
var xmlhttpmethod = false;
|
||||
try {
|
||||
xmlhttpmethod = new w.XMLHttpRequest();
|
||||
} catch (e) {
|
||||
xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
return function() {
|
||||
return xmlhttpmethod;
|
||||
};
|
||||
}(),
|
||||
ajax = function(url, callback) {
|
||||
var req = xmlHttp();
|
||||
if (!req) {
|
||||
return;
|
||||
}
|
||||
if (!FILE.fileExists(url)) {
|
||||
req.open("GET", url, true);
|
||||
req.onreadystatechange = function() {
|
||||
if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) {
|
||||
return;
|
||||
}
|
||||
callback(req.responseText);
|
||||
};
|
||||
if (req.readyState === 4) {
|
||||
return;
|
||||
}
|
||||
req.send(null);
|
||||
} else {
|
||||
responseText = FILE.readFile(url, "utf-8");
|
||||
callback(responseText);
|
||||
}
|
||||
};
|
||||
respond.ajax = ajax;
|
||||
respond.queue = requestQueue;
|
||||
respond.regex = {
|
||||
media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
|
||||
keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
|
||||
urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
|
||||
findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
|
||||
only: /(only\s+)?([a-zA-Z]+)\s?/,
|
||||
minw: /\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,
|
||||
maxw: /\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/
|
||||
};
|
||||
respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches;
|
||||
if (respond.mediaQueriesSupported) {
|
||||
return;
|
||||
}
|
||||
var doc = w.document,
|
||||
docElem = doc.documentElement,
|
||||
mediastyles = [],
|
||||
rules = [],
|
||||
appendedEls = [],
|
||||
parsedSheets = {},
|
||||
resizeThrottle = 30,
|
||||
head = doc.getElementsByTagName("head")[0] || docElem,
|
||||
base = doc.getElementsByTagName("base")[0],
|
||||
links = head.getElementsByTagName("link"),
|
||||
lastCall, resizeDefer, eminpx, getEmValue = function() {
|
||||
var ret, div = doc.createElement("div"),
|
||||
body = doc.body,
|
||||
originalHTMLFontSize = docElem.style.fontSize,
|
||||
originalBodyFontSize = body && body.style.fontSize,
|
||||
fakeUsed = false;
|
||||
div.style.cssText = "position:absolute;font-size:1em;width:1em";
|
||||
if (!body) {
|
||||
body = fakeUsed = doc.createElement("body");
|
||||
body.style.background = "none";
|
||||
}
|
||||
docElem.style.fontSize = "100%";
|
||||
body.style.fontSize = "100%";
|
||||
body.appendChild(div);
|
||||
if (fakeUsed) {
|
||||
docElem.insertBefore(body, docElem.firstChild);
|
||||
}
|
||||
ret = div.offsetWidth;
|
||||
if (fakeUsed) {
|
||||
docElem.removeChild(body);
|
||||
} else {
|
||||
body.removeChild(div);
|
||||
}
|
||||
docElem.style.fontSize = originalHTMLFontSize;
|
||||
if (originalBodyFontSize) {
|
||||
body.style.fontSize = originalBodyFontSize;
|
||||
}
|
||||
ret = eminpx = parseFloat(ret);
|
||||
return ret;
|
||||
},
|
||||
applyMedia = function(fromResize) {
|
||||
var name = "clientWidth",
|
||||
docElemProp = docElem[name],
|
||||
currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp,
|
||||
styleBlocks = {},
|
||||
lastLink = links[links.length - 1],
|
||||
now = new Date().getTime();
|
||||
if (fromResize && lastCall && now - lastCall < resizeThrottle) {
|
||||
w.clearTimeout(resizeDefer);
|
||||
resizeDefer = w.setTimeout(applyMedia, resizeThrottle);
|
||||
return;
|
||||
} else {
|
||||
lastCall = now;
|
||||
}
|
||||
for (var i in mediastyles) {
|
||||
if (mediastyles.hasOwnProperty(i)) {
|
||||
var thisstyle = mediastyles[i],
|
||||
min = thisstyle.minw,
|
||||
max = thisstyle.maxw,
|
||||
minnull = min === null,
|
||||
maxnull = max === null,
|
||||
em = "em";
|
||||
if (!!min) {
|
||||
min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
|
||||
}
|
||||
if (!!max) {
|
||||
max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
|
||||
}
|
||||
if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
|
||||
if (!styleBlocks[thisstyle.media]) {
|
||||
styleBlocks[thisstyle.media] = [];
|
||||
}
|
||||
styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var j in appendedEls) {
|
||||
if (appendedEls.hasOwnProperty(j)) {
|
||||
if (appendedEls[j] && appendedEls[j].parentNode === head) {
|
||||
head.removeChild(appendedEls[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
appendedEls.length = 0;
|
||||
for (var k in styleBlocks) {
|
||||
if (styleBlocks.hasOwnProperty(k)) {
|
||||
var ss = doc.createElement("style"),
|
||||
css = styleBlocks[k].join("\n");
|
||||
ss.type = "text/css";
|
||||
ss.media = k;
|
||||
head.insertBefore(ss, lastLink.nextSibling);
|
||||
if (ss.styleSheet) {
|
||||
ss.styleSheet.cssText = css;
|
||||
} else {
|
||||
ss.appendChild(doc.createTextNode(css));
|
||||
}
|
||||
appendedEls.push(ss);
|
||||
}
|
||||
}
|
||||
},
|
||||
translate = function(styles, href, media) {
|
||||
var qs = styles.replace(respond.regex.keyframes, "").match(respond.regex.media),
|
||||
ql = qs && qs.length || 0;
|
||||
href = href.substring(0, href.lastIndexOf("/"));
|
||||
var repUrls = function(css) {
|
||||
return css.replace(respond.regex.urls, "$1" + href + "$2$3");
|
||||
},
|
||||
useMedia = !ql && media;
|
||||
if (href.length) {
|
||||
href += "/";
|
||||
}
|
||||
if (useMedia) {
|
||||
ql = 1;
|
||||
}
|
||||
for (var i = 0; i < ql; i++) {
|
||||
var fullq, thisq, eachq, eql;
|
||||
if (useMedia) {
|
||||
fullq = media;
|
||||
rules.push(repUrls(styles));
|
||||
} else {
|
||||
fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1;
|
||||
rules.push(RegExp.$2 && repUrls(RegExp.$2));
|
||||
}
|
||||
eachq = fullq.split(",");
|
||||
eql = eachq.length;
|
||||
for (var j = 0; j < eql; j++) {
|
||||
thisq = eachq[j];
|
||||
mediastyles.push({
|
||||
media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all",
|
||||
rules: rules.length - 1,
|
||||
hasquery: thisq.indexOf("(") > -1,
|
||||
minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
|
||||
maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
|
||||
});
|
||||
}
|
||||
}
|
||||
applyMedia();
|
||||
},
|
||||
makeRequests = function() {
|
||||
if (requestQueue.length) {
|
||||
var thisRequest = requestQueue.shift();
|
||||
ajax(thisRequest.href, function(styles) {
|
||||
translate(styles, thisRequest.href, thisRequest.media);
|
||||
parsedSheets[thisRequest.href] = true;
|
||||
w.setTimeout(function() {
|
||||
makeRequests();
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
},
|
||||
ripCSS = function() {
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
var sheet = links[i],
|
||||
href = sheet.href,
|
||||
media = sheet.media,
|
||||
isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
|
||||
if (!!href && isCSS && !parsedSheets[href]) {
|
||||
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
|
||||
translate(sheet.styleSheet.rawCssText, href, media);
|
||||
parsedSheets[href] = true;
|
||||
} else {
|
||||
if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) {
|
||||
if (href.substring(0, 2) === "//") {
|
||||
href = w.location.protocol + href;
|
||||
}
|
||||
requestQueue.push({
|
||||
href: href,
|
||||
media: media
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
makeRequests();
|
||||
};
|
||||
ripCSS();
|
||||
respond.update = ripCSS;
|
||||
respond.getEmValue = getEmValue;
|
||||
|
||||
function callMedia() {
|
||||
applyMedia(true);
|
||||
}
|
||||
if (w.addEventListener) {
|
||||
w.addEventListener("resize", callMedia, false);
|
||||
} else if (w.attachEvent) {
|
||||
w.attachEvent("onresize", callMedia);
|
||||
}
|
||||
})(this);
|
579
app/assets/js/welsonjs-selectivizr-1.0.2-modified.js
Normal file
579
app/assets/js/welsonjs-selectivizr-1.0.2-modified.js
Normal file
|
@ -0,0 +1,579 @@
|
|||
/*
|
||||
selectivizr v1.0.2b - (c) Keith Clark, freely distributable under the terms
|
||||
of the MIT license.
|
||||
|
||||
selectivizr.com
|
||||
*/
|
||||
/*
|
||||
|
||||
Notes about this source
|
||||
-----------------------
|
||||
|
||||
* The #DEBUG_START and #DEBUG_END comments are used to mark blocks of code
|
||||
that will be removed prior to building a final release version (using a
|
||||
pre-compression script)
|
||||
|
||||
|
||||
References:
|
||||
-----------
|
||||
|
||||
* CSS Syntax : http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#style
|
||||
* Selectors : http://www.w3.org/TR/css3-selectors/#selectors
|
||||
* IE Compatability : http://msdn.microsoft.com/en-us/library/cc351024(VS.85).aspx
|
||||
* W3C Selector Tests : http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/
|
||||
|
||||
*/
|
||||
var FILE = require('lib/file');
|
||||
|
||||
(function(win) {
|
||||
|
||||
// If browser isn't IE, then stop execution! This handles the script
|
||||
// being loaded by non IE browsers because the developer didn't use
|
||||
// conditional comments.
|
||||
if ( /*@cc_on!@*/ true) return;
|
||||
|
||||
// =========================== Init Objects ============================
|
||||
|
||||
var doc = document;
|
||||
var root = doc.documentElement;
|
||||
var xhr = getXHRObject();
|
||||
var ieVersion = /MSIE (\d+)/.exec(navigator.userAgent)[1];
|
||||
|
||||
// If were not in standards mode, IE is too old / new or we can't create
|
||||
// an XMLHttpRequest object then we should get out now.
|
||||
if (doc.compatMode != 'CSS1Compat' || ieVersion < 6 || ieVersion > 8 || !xhr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// ========================= Common Objects ============================
|
||||
|
||||
// Compatiable selector engines in order of CSS3 support. Note: '*' is
|
||||
// a placholder for the object key name. (basically, crude compression)
|
||||
var selectorEngines = {
|
||||
"NW": "*.Dom.select",
|
||||
"MooTools": "$$",
|
||||
"DOMAssistant": "*.$",
|
||||
"Prototype": "$$",
|
||||
"YAHOO": "*.util.Selector.query",
|
||||
"Sizzle": "*",
|
||||
"jQuery": "*",
|
||||
"dojo": "*.query"
|
||||
};
|
||||
|
||||
var selectorMethod;
|
||||
var enabledWatchers = []; // array of :enabled/:disabled elements to poll
|
||||
var ie6PatchID = 0; // used to solve ie6's multiple class bug
|
||||
var patchIE6MultipleClasses = true; // if true adds class bloat to ie6
|
||||
var namespace = "slvzr";
|
||||
|
||||
// Stylesheet parsing regexp's
|
||||
var RE_COMMENT = /(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g;
|
||||
var RE_IMPORT = /@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g;
|
||||
var RE_ASSET_URL = /\burl\(\s*(["']?)(?!data:)([^"')]+)\1\s*\)/g;
|
||||
var RE_PSEUDO_STRUCTURAL = /^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/;
|
||||
var RE_PSEUDO_ELEMENTS = /:(:first-(?:line|letter))/g;
|
||||
var RE_SELECTOR_GROUP = /(^|})\s*([^\{]*?[\[:][^{]+)/g;
|
||||
var RE_SELECTOR_PARSE = /([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g;
|
||||
var RE_LIBRARY_INCOMPATIBLE_PSEUDOS = /(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g;
|
||||
var RE_PATCH_CLASS_NAME_REPLACE = /[^\w-]/g;
|
||||
|
||||
// HTML UI element regexp's
|
||||
var RE_INPUT_ELEMENTS = /^(INPUT|SELECT|TEXTAREA|BUTTON)$/;
|
||||
var RE_INPUT_CHECKABLE_TYPES = /^(checkbox|radio)$/;
|
||||
|
||||
// Broken attribute selector implementations (IE7/8 native [^=""], [$=""] and [*=""])
|
||||
var BROKEN_ATTR_IMPLEMENTATIONS = ieVersion > 6 ? /[\$\^*]=(['"])\1/ : null;
|
||||
|
||||
// Whitespace normalization regexp's
|
||||
var RE_TIDY_TRAILING_WHITESPACE = /([(\[+~])\s+/g;
|
||||
var RE_TIDY_LEADING_WHITESPACE = /\s+([)\]+~])/g;
|
||||
var RE_TIDY_CONSECUTIVE_WHITESPACE = /\s+/g;
|
||||
var RE_TIDY_TRIM_WHITESPACE = /^\s*((?:[\S\s]*\S)?)\s*$/;
|
||||
|
||||
// String constants
|
||||
var EMPTY_STRING = "";
|
||||
var SPACE_STRING = " ";
|
||||
var PLACEHOLDER_STRING = "$1";
|
||||
|
||||
// =========================== Patching ================================
|
||||
|
||||
// --[ patchStyleSheet() ]----------------------------------------------
|
||||
// Scans the passed cssText for selectors that require emulation and
|
||||
// creates one or more patches for each matched selector.
|
||||
function patchStyleSheet(cssText) {
|
||||
return cssText.replace(RE_PSEUDO_ELEMENTS, PLACEHOLDER_STRING).
|
||||
replace(RE_SELECTOR_GROUP, function(m, prefix, selectorText) {
|
||||
var selectorGroups = selectorText.split(",");
|
||||
for (var c = 0, cs = selectorGroups.length; c < cs; c++) {
|
||||
var selector = normalizeSelectorWhitespace(selectorGroups[c]) + SPACE_STRING;
|
||||
var patches = [];
|
||||
selectorGroups[c] = selector.replace(RE_SELECTOR_PARSE,
|
||||
function(match, combinator, pseudo, attribute, index) {
|
||||
if (combinator) {
|
||||
if (patches.length > 0) {
|
||||
applyPatches(selector.substring(0, index), patches);
|
||||
patches = [];
|
||||
}
|
||||
return combinator;
|
||||
} else {
|
||||
var patch = (pseudo) ? patchPseudoClass(pseudo) : patchAttribute(attribute);
|
||||
if (patch) {
|
||||
patches.push(patch);
|
||||
return "." + patch.className;
|
||||
}
|
||||
return match;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
return prefix + selectorGroups.join(",");
|
||||
});
|
||||
};
|
||||
|
||||
// --[ patchAttribute() ]-----------------------------------------------
|
||||
// returns a patch for an attribute selector.
|
||||
function patchAttribute(attr) {
|
||||
return (!BROKEN_ATTR_IMPLEMENTATIONS || BROKEN_ATTR_IMPLEMENTATIONS.test(attr)) ? {
|
||||
className: createClassName(attr),
|
||||
applyClass: true
|
||||
} : null;
|
||||
};
|
||||
|
||||
// --[ patchPseudoClass() ]---------------------------------------------
|
||||
// returns a patch for a pseudo-class
|
||||
function patchPseudoClass(pseudo) {
|
||||
|
||||
var applyClass = true;
|
||||
var className = createClassName(pseudo.slice(1));
|
||||
var isNegated = pseudo.substring(0, 5) == ":not(";
|
||||
var activateEventName;
|
||||
var deactivateEventName;
|
||||
|
||||
// if negated, remove :not()
|
||||
if (isNegated) {
|
||||
pseudo = pseudo.slice(5, -1);
|
||||
}
|
||||
|
||||
// bracket contents are irrelevant - remove them
|
||||
var bracketIndex = pseudo.indexOf("(")
|
||||
if (bracketIndex > -1) {
|
||||
pseudo = pseudo.substring(0, bracketIndex);
|
||||
}
|
||||
|
||||
// check we're still dealing with a pseudo-class
|
||||
if (pseudo.charAt(0) == ":") {
|
||||
switch (pseudo.slice(1)) {
|
||||
|
||||
case "root":
|
||||
applyClass = function(e) {
|
||||
return isNegated ? e != root : e == root;
|
||||
}
|
||||
break;
|
||||
|
||||
case "target":
|
||||
// :target is only supported in IE8
|
||||
if (ieVersion == 8) {
|
||||
applyClass = function(e) {
|
||||
var handler = function() {
|
||||
var hash = location.hash;
|
||||
var hashID = hash.slice(1);
|
||||
return isNegated ? (hash == EMPTY_STRING || e.id != hashID) : (hash != EMPTY_STRING && e.id == hashID);
|
||||
};
|
||||
addEvent(win, "hashchange", function() {
|
||||
toggleElementClass(e, className, handler());
|
||||
})
|
||||
return handler();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
||||
case "checked":
|
||||
applyClass = function(e) {
|
||||
if (RE_INPUT_CHECKABLE_TYPES.test(e.type)) {
|
||||
addEvent(e, "propertychange", function() {
|
||||
if (event.propertyName == "checked") {
|
||||
toggleElementClass(e, className, e.checked !== isNegated);
|
||||
}
|
||||
})
|
||||
}
|
||||
return e.checked !== isNegated;
|
||||
}
|
||||
break;
|
||||
|
||||
case "disabled":
|
||||
isNegated = !isNegated;
|
||||
|
||||
case "enabled":
|
||||
applyClass = function(e) {
|
||||
if (RE_INPUT_ELEMENTS.test(e.tagName)) {
|
||||
addEvent(e, "propertychange", function() {
|
||||
if (event.propertyName == "$disabled") {
|
||||
toggleElementClass(e, className, e.$disabled === isNegated);
|
||||
}
|
||||
});
|
||||
enabledWatchers.push(e);
|
||||
e.$disabled = e.disabled;
|
||||
return e.disabled === isNegated;
|
||||
}
|
||||
return pseudo == ":enabled" ? isNegated : !isNegated;
|
||||
}
|
||||
break;
|
||||
|
||||
case "focus":
|
||||
activateEventName = "focus";
|
||||
deactivateEventName = "blur";
|
||||
|
||||
case "hover":
|
||||
if (!activateEventName) {
|
||||
activateEventName = "mouseenter";
|
||||
deactivateEventName = "mouseleave";
|
||||
}
|
||||
applyClass = function(e) {
|
||||
addEvent(e, isNegated ? deactivateEventName : activateEventName, function() {
|
||||
toggleElementClass(e, className, true);
|
||||
})
|
||||
addEvent(e, isNegated ? activateEventName : deactivateEventName, function() {
|
||||
toggleElementClass(e, className, false);
|
||||
})
|
||||
return isNegated;
|
||||
}
|
||||
break;
|
||||
|
||||
// everything else
|
||||
default:
|
||||
// If we don't support this pseudo-class don't create
|
||||
// a patch for it
|
||||
if (!RE_PSEUDO_STRUCTURAL.test(pseudo)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return {
|
||||
className: className,
|
||||
applyClass: applyClass
|
||||
};
|
||||
};
|
||||
|
||||
// --[ applyPatches() ]-------------------------------------------------
|
||||
// uses the passed selector text to find DOM nodes and patch them
|
||||
function applyPatches(selectorText, patches) {
|
||||
var elms;
|
||||
|
||||
// Although some selector libraries can find :checked :enabled etc.
|
||||
// we need to find all elements that could have that state because
|
||||
// it can be changed by the user.
|
||||
var domSelectorText = selectorText.replace(RE_LIBRARY_INCOMPATIBLE_PSEUDOS, EMPTY_STRING);
|
||||
|
||||
// If the dom selector equates to an empty string or ends with
|
||||
// whitespace then we need to append a universal selector (*) to it.
|
||||
if (domSelectorText == EMPTY_STRING || domSelectorText.charAt(domSelectorText.length - 1) == SPACE_STRING) {
|
||||
domSelectorText += "*";
|
||||
}
|
||||
|
||||
// Ensure we catch errors from the selector library
|
||||
try {
|
||||
elms = selectorMethod(domSelectorText);
|
||||
} catch (ex) {
|
||||
// #DEBUG_START
|
||||
log("Selector '" + selectorText + "' threw exception '" + ex + "'");
|
||||
// #DEBUG_END
|
||||
}
|
||||
|
||||
|
||||
if (elms) {
|
||||
for (var d = 0, dl = elms.length; d < dl; d++) {
|
||||
var elm = elms[d];
|
||||
var cssClasses = elm.className;
|
||||
for (var f = 0, fl = patches.length; f < fl; f++) {
|
||||
var patch = patches[f];
|
||||
|
||||
if (!hasPatch(elm, patch)) {
|
||||
if (patch.applyClass && (patch.applyClass === true || patch.applyClass(elm) === true)) {
|
||||
cssClasses = toggleClass(cssClasses, patch.className, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
elm.className = cssClasses;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// --[ hasPatch() ]-----------------------------------------------------
|
||||
// checks for the exsistence of a patch on an element
|
||||
function hasPatch(elm, patch) {
|
||||
return new RegExp("(^|\\s)" + patch.className + "(\\s|$)").test(elm.className);
|
||||
};
|
||||
|
||||
|
||||
// =========================== Utility =================================
|
||||
|
||||
function createClassName(className) {
|
||||
return namespace + "-" + ((ieVersion == 6 && patchIE6MultipleClasses) ?
|
||||
ie6PatchID++
|
||||
:
|
||||
className.replace(RE_PATCH_CLASS_NAME_REPLACE, function(a) {
|
||||
return a.charCodeAt(0)
|
||||
}));
|
||||
};
|
||||
|
||||
// --[ log() ]----------------------------------------------------------
|
||||
// #DEBUG_START
|
||||
function log(message) {
|
||||
if (win.console) {
|
||||
win.console.log(message);
|
||||
}
|
||||
};
|
||||
// #DEBUG_END
|
||||
|
||||
// --[ trim() ]---------------------------------------------------------
|
||||
// removes leading, trailing whitespace from a string
|
||||
function trim(text) {
|
||||
return text.replace(RE_TIDY_TRIM_WHITESPACE, PLACEHOLDER_STRING);
|
||||
};
|
||||
|
||||
// --[ normalizeWhitespace() ]------------------------------------------
|
||||
// removes leading, trailing and consecutive whitespace from a string
|
||||
function normalizeWhitespace(text) {
|
||||
return trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);
|
||||
};
|
||||
|
||||
// --[ normalizeSelectorWhitespace() ]----------------------------------
|
||||
// tidies whitespace around selector brackets and combinators
|
||||
function normalizeSelectorWhitespace(selectorText) {
|
||||
return normalizeWhitespace(selectorText.replace(RE_TIDY_TRAILING_WHITESPACE, PLACEHOLDER_STRING).replace(RE_TIDY_LEADING_WHITESPACE, PLACEHOLDER_STRING));
|
||||
};
|
||||
|
||||
// --[ toggleElementClass() ]-------------------------------------------
|
||||
// toggles a single className on an element
|
||||
function toggleElementClass(elm, className, on) {
|
||||
var oldClassName = elm.className;
|
||||
var newClassName = toggleClass(oldClassName, className, on);
|
||||
if (newClassName != oldClassName) {
|
||||
elm.className = newClassName;
|
||||
elm.parentNode.className += EMPTY_STRING;
|
||||
}
|
||||
};
|
||||
|
||||
// --[ toggleClass() ]--------------------------------------------------
|
||||
// adds / removes a className from a string of classNames. Used to
|
||||
// manage multiple class changes without forcing a DOM redraw
|
||||
function toggleClass(classList, className, on) {
|
||||
var re = RegExp("(^|\\s)" + className + "(\\s|$)");
|
||||
var classExists = re.test(classList);
|
||||
if (on) {
|
||||
return classExists ? classList : classList + SPACE_STRING + className;
|
||||
} else {
|
||||
return classExists ? trim(classList.replace(re, PLACEHOLDER_STRING)) : classList;
|
||||
}
|
||||
};
|
||||
|
||||
// --[ addEvent() ]-----------------------------------------------------
|
||||
function addEvent(elm, eventName, eventHandler) {
|
||||
elm.attachEvent("on" + eventName, eventHandler);
|
||||
};
|
||||
|
||||
// --[ getXHRObject() ]-------------------------------------------------
|
||||
function getXHRObject() {
|
||||
if (win.XMLHttpRequest) {
|
||||
return new XMLHttpRequest;
|
||||
}
|
||||
try {
|
||||
return new ActiveXObject('Microsoft.XMLHTTP');
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
// --[ loadStyleSheet() ]-----------------------------------------------
|
||||
function loadStyleSheet(url) {
|
||||
var pos = url.indexOf('://');
|
||||
var scheme = (pos < 0) ? "" : url.substring(0, pos);
|
||||
if (scheme != 'file' && !FILE.fileExists(url)) {
|
||||
xhr.open("GET", url, false);
|
||||
xhr.send();
|
||||
return (xhr.status == 200) ? xhr.responseText : EMPTY_STRING;
|
||||
} else {
|
||||
var filepath = url.substring(pos + 4);
|
||||
var responseText = FILE.readFile(filepath, "utf-8");
|
||||
return responseText;
|
||||
}
|
||||
};
|
||||
|
||||
// --[ resolveUrl() ]---------------------------------------------------
|
||||
// Converts a URL fragment to a fully qualified URL using the specified
|
||||
// context URL. Returns null if same-origin policy is broken
|
||||
function resolveUrl(url, contextUrl) {
|
||||
|
||||
function getProtocolAndHost(url) {
|
||||
return url.substring(0, url.indexOf("/", 8));
|
||||
};
|
||||
|
||||
// absolute path
|
||||
if (/^https?:\/\//i.test(url)) {
|
||||
return getProtocolAndHost(contextUrl) == getProtocolAndHost(url) ? url : null;
|
||||
}
|
||||
|
||||
// root-relative path
|
||||
if (url.charAt(0) == "/") {
|
||||
return getProtocolAndHost(contextUrl) + url;
|
||||
}
|
||||
|
||||
// relative path
|
||||
var contextUrlPath = contextUrl.split(/[?#]/)[0]; // ignore query string in the contextUrl
|
||||
if (url.charAt(0) != "?" && contextUrlPath.charAt(contextUrlPath.length - 1) != "/") {
|
||||
contextUrlPath = contextUrlPath.substring(0, contextUrlPath.lastIndexOf("/") + 1);
|
||||
}
|
||||
|
||||
return contextUrlPath + url;
|
||||
};
|
||||
|
||||
// --[ parseStyleSheet() ]----------------------------------------------
|
||||
// Downloads the stylesheet specified by the URL, removes it's comments
|
||||
// and recursivly replaces @import rules with their contents, ultimately
|
||||
// returning the full cssText.
|
||||
function parseStyleSheet(url) {
|
||||
if (url) {
|
||||
return loadStyleSheet(url).replace(RE_COMMENT, EMPTY_STRING).
|
||||
replace(RE_IMPORT, function(match, quoteChar, importUrl, quoteChar2, importUrl2) {
|
||||
return parseStyleSheet(resolveUrl(importUrl || importUrl2, url));
|
||||
}).
|
||||
replace(RE_ASSET_URL, function(match, quoteChar, assetUrl) {
|
||||
quoteChar = quoteChar || EMPTY_STRING;
|
||||
return " url(" + quoteChar + resolveUrl(assetUrl, url) + quoteChar + ") ";
|
||||
});
|
||||
}
|
||||
return EMPTY_STRING;
|
||||
};
|
||||
|
||||
// --[ init() ]---------------------------------------------------------
|
||||
function init() {
|
||||
// honour the <base> tag
|
||||
var url, stylesheet;
|
||||
var baseTags = doc.getElementsByTagName("BASE");
|
||||
var baseUrl = (baseTags.length > 0) ? baseTags[0].href : doc.location.href;
|
||||
|
||||
/* Note: This code prevents IE from freezing / crashing when using
|
||||
@font-face .eot files but it modifies the <head> tag and could
|
||||
trigger the IE stylesheet limit. It will also cause FOUC issues.
|
||||
If you choose to use it, make sure you comment out the for loop
|
||||
directly below this comment.
|
||||
|
||||
var head = doc.getElementsByTagName("head")[0];
|
||||
for (var c=doc.styleSheets.length-1; c>=0; c--) {
|
||||
stylesheet = doc.styleSheets[c]
|
||||
head.appendChild(doc.createElement("style"))
|
||||
var patchedStylesheet = doc.styleSheets[doc.styleSheets.length-1];
|
||||
|
||||
if (stylesheet.href != EMPTY_STRING) {
|
||||
url = resolveUrl(stylesheet.href, baseUrl)
|
||||
if (url) {
|
||||
patchedStylesheet.cssText = patchStyleSheet( parseStyleSheet( url ) )
|
||||
stylesheet.disabled = true
|
||||
setTimeout( function () {
|
||||
stylesheet.owningElement.parentNode.removeChild(stylesheet.owningElement)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
for (var c = 0; c < doc.styleSheets.length; c++) {
|
||||
stylesheet = doc.styleSheets[c]
|
||||
if (stylesheet.href != EMPTY_STRING) {
|
||||
url = resolveUrl(stylesheet.href, baseUrl);
|
||||
if (url) {
|
||||
stylesheet.cssText = patchStyleSheet(parseStyleSheet(url));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// :enabled & :disabled polling script (since we can't hook
|
||||
// onpropertychange event when an element is disabled)
|
||||
if (enabledWatchers.length > 0) {
|
||||
setInterval(function() {
|
||||
for (var c = 0, cl = enabledWatchers.length; c < cl; c++) {
|
||||
var e = enabledWatchers[c];
|
||||
if (e.disabled !== e.$disabled) {
|
||||
if (e.disabled) {
|
||||
e.disabled = false;
|
||||
e.$disabled = true;
|
||||
e.disabled = true;
|
||||
} else {
|
||||
e.$disabled = e.disabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 250)
|
||||
}
|
||||
};
|
||||
|
||||
// Bind selectivizr to the ContentLoaded event.
|
||||
ContentLoaded(win, function() {
|
||||
// Determine the "best fit" selector engine
|
||||
for (var engine in selectorEngines) {
|
||||
var members, member, context = win;
|
||||
if (win[engine]) {
|
||||
members = selectorEngines[engine].replace("*", engine).split(".");
|
||||
while ((member = members.shift()) && (context = context[member])) {}
|
||||
if (typeof context == "function") {
|
||||
selectorMethod = context;
|
||||
init();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*!
|
||||
* ContentLoaded.js by Diego Perini, modified for IE<9 only (to save space)
|
||||
*
|
||||
* Author: Diego Perini (diego.perini at gmail.com)
|
||||
* Summary: cross-browser wrapper for DOMContentLoaded
|
||||
* Updated: 20101020
|
||||
* License: MIT
|
||||
* Version: 1.2
|
||||
*
|
||||
* URL:
|
||||
* http://javascript.nwbox.com/ContentLoaded/
|
||||
* http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
|
||||
*
|
||||
*/
|
||||
|
||||
// @w window reference
|
||||
// @f function reference
|
||||
function ContentLoaded(win, fn) {
|
||||
|
||||
var done = false,
|
||||
top = true,
|
||||
init = function(e) {
|
||||
if (e.type == "readystatechange" && doc.readyState != "complete") return;
|
||||
(e.type == "load" ? win : doc).detachEvent("on" + e.type, init, false);
|
||||
if (!done && (done = true)) fn.call(win, e.type || e);
|
||||
},
|
||||
poll = function() {
|
||||
try {
|
||||
root.doScroll("left");
|
||||
} catch (e) {
|
||||
setTimeout(poll, 50);
|
||||
return;
|
||||
}
|
||||
init('poll');
|
||||
};
|
||||
|
||||
if (doc.readyState == "complete") fn.call(win, EMPTY_STRING);
|
||||
else {
|
||||
if (doc.createEventObject && root.doScroll) {
|
||||
try {
|
||||
top = !win.frameElement;
|
||||
} catch (e) {}
|
||||
if (top) poll();
|
||||
}
|
||||
addEvent(doc, "readystatechange", init);
|
||||
addEvent(win, "load", init);
|
||||
}
|
||||
};
|
||||
})(this);
|
14
style.css
14
style.css
|
@ -32,14 +32,18 @@ ol, ul {
|
|||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.compatible-css3 {
|
||||
behavior: url(app/assets/htc/PIE.htc);
|
||||
}
|
||||
|
|
37
webloader.js
37
webloader.js
|
@ -1,5 +1,9 @@
|
|||
/*
|
||||
* webloader.js
|
||||
* Go Namhyeon (gnh1201@gmail.com)
|
||||
* 2020-07-07
|
||||
* https://github.com/gnh1201/welsonjs
|
||||
*
|
||||
*/
|
||||
var FILE = require('lib/file');
|
||||
|
||||
|
@ -127,14 +131,14 @@ var IEVersion = (function() {
|
|||
|
||||
return {
|
||||
enableMovableWindow: function() {
|
||||
var grip = document.getElementById('app'),
|
||||
var grip = document.getElementById("app"),
|
||||
oX, oY,
|
||||
mouseDown = function(e) {
|
||||
if (e.offsetY + e.offsetX < 0) return;
|
||||
oX = e.screenX;
|
||||
oY = e.screenY;
|
||||
window.addEventListener('mousemove', mouseMove);
|
||||
window.addEventListener('mouseup', mouseUp);
|
||||
window.addEventListener("mousemove", mouseMove);
|
||||
window.addEventListener("mouseup", mouseUp);
|
||||
},
|
||||
mouseMove = function(e) {
|
||||
window.moveTo(screenX + e.screenX - oX, screenY + e.screenY - oY);
|
||||
|
@ -142,16 +146,16 @@ return {
|
|||
oY = e.screenY;
|
||||
},
|
||||
gripMouseMove = function(e) {
|
||||
this.style.cursor = (e.offsetY + e.offsetX > -1) ? 'move' : 'default';
|
||||
this.style.cursor = (e.offsetY + e.offsetX > -1) ? "move" : "default";
|
||||
},
|
||||
mouseUp = function(e) {
|
||||
window.removeEventListener('mousemove', mouseMove);
|
||||
window.removeEventListener('mouseup', mouseUp);
|
||||
window.removeEventListener("mousemove", mouseMove);
|
||||
window.removeEventListener("mouseup", mouseUp);
|
||||
};
|
||||
|
||||
enableEventListener(grip);
|
||||
grip.addEventListener('mousedown', mouseDown);
|
||||
grip.addEventListener('mousemove', gripMouseMove);
|
||||
grip.addEventListener("mousedown", mouseDown);
|
||||
grip.addEventListener("mousemove", gripMouseMove);
|
||||
},
|
||||
getIEVersion: function() {
|
||||
return IEVersion;
|
||||
|
@ -205,7 +209,7 @@ return {
|
|||
var self = this;
|
||||
|
||||
// "load contents";
|
||||
var contents = FILE.readFile("app\\app.html", "utf-8");
|
||||
var contents = FILE.readFile("app\\index.html", "utf-8");
|
||||
document.getElementById("app").innerHTML = contents;
|
||||
|
||||
// "load stylesheets dynamically";
|
||||
|
@ -229,13 +233,15 @@ return {
|
|||
};
|
||||
|
||||
// "load javascripts dynamically";
|
||||
self.addScript("app/assets/js/es5-shim.min.js");
|
||||
self.addScript("app/assets/js/es5-sham.min.js");
|
||||
self.addScript("app/assets/js/json3.min.js");
|
||||
self.addScript("app/assets/js/es6-shim.min.js");
|
||||
self.addScript("app/assets/js/es6-sham.min.js");
|
||||
self.addScript("app/assets/js/es5-shim-4.5.14.min.js");
|
||||
self.addScript("app/assets/js/es5-sham-4.5.14.min.js");
|
||||
self.addScript("app/assets/js/json3-3.3.2.min.js");
|
||||
self.addScript("app/assets/js/es6-shim-0.35.5.min.js");
|
||||
self.addScript("app/assets/js/es6-sham-0.35.5.min.js");
|
||||
self.addScript("app/assets/js/html5shiv-printshiv-3.7.3.min.js");
|
||||
if (self.getIEVersion() < 9) {
|
||||
self.addScript("app/assets/js/html5shiv-printshiv-3.7.3.min.js");
|
||||
self.addScript("app/assets/js/welsonjs-respond-1.4.2-modified.js");
|
||||
self.addScript("app/assets/js/welsonjs-selectivizr-1.0.2-modified.js");
|
||||
self.addScript("app/assets/js/jquery-1.11.3.min.js", jqLoaded, function(el) {
|
||||
return window.jQuery;
|
||||
});
|
||||
|
@ -251,6 +257,7 @@ return {
|
|||
|
||||
// "load jQuery plugins";
|
||||
if (self.getIEVersion() < 10) {
|
||||
self.addScript("app/assets/js/PIE-1.0.0.js");
|
||||
self.addScript("app/assets/js/jquery.html5-placeholder-shim.js");
|
||||
}
|
||||
self.addScript("app/assets/js/jquery.form.min.js");
|
||||
|
|
Loading…
Reference in New Issue
Block a user