Added some minor exception handling improvements
This commit is contained in:
parent
29a3aceeb0
commit
c2a89b07dd
12 changed files with 1141 additions and 1140 deletions
|
|
@ -3,8 +3,8 @@ function fa(a){return a.replace(/[&<>"']/g,function(a){return ea[a]})}function g
|
|||
function s(a,b,c,d,e,f){b=!!b;var l=0,g=null,m=ca(a),n=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");b&&(n.onreadystatechange=function(){4===n.readyState&&(g=n.responseText,200==n.status||!n.status&&g.length&&"file:"==(window?window.location.protocol:"file:")||(l=n.status||-1),e&&(d?e.call(d,m,g,l,f):e(m,g,l,f)))});if(c){var q="",u;for(u in c)c.hasOwnProperty(u)&&(q&&(q+="&"),q+=u+"="+encodeURIComponent(c[u]));q=q.replace(/%20/g,"+");n.open("POST",a,
|
||||
b);n.setRequestHeader("Content-type","application/x-www-form-urlencoded");n.send(q)}else n.open("GET",a,b),n.send();a=[];b||(g=n.responseText,200!=n.status&&(l=n.status||-1),e&&(d?e.call(d,m,g,l,f):e(m,g,l,f)),a=[l,g]);return a}function ka(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window?window.alert(a):console.log(a)}function la(a){var b=!1;window&&(b=window.confirm(a));return b}
|
||||
function ma(){if(void 0===ja){var a;try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"===window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}ja=a}return ja}function na(a){var b;try{b=window.localStorage.getItem(a)}catch(c){}return b}function oa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}
|
||||
function pa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var qa={init:[],show:[],exit:[]},ra=!1,sa=!0;function ua(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function v(a){qa.init.push(a)}function va(a){if(sa)for(var b=0;b<a.length;b++)a[b]()}function wa(a){!sa&&a?(sa=!0,ra&&xa("init")):sa=a}
|
||||
function xa(a){qa[a]&&va(qa[a])}ua("onload",function(){ra=!0;va(qa.init)});ua("onpageshow",function(){va(qa.show)});ua(pa("Opera")||pa("iOS")?"onunload":"onbeforeunload",function(){va(qa.exit)});
|
||||
function pa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var qa={init:[],show:[],exit:[]},ra=!1,sa=!0;function ua(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function v(a){qa.init.push(a)}
|
||||
function va(a){if(sa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to Jeff@pcjs.org. Thanks.")}}function wa(a){!sa&&a?(sa=!0,ra&&xa("init")):sa=a}function xa(a){qa[a]&&va(qa[a])}ua("onload",function(){ra=!0;va(qa.init)});ua("onpageshow",function(){va(qa.show)});ua(pa("Opera")||pa("iOS")?"onunload":"onbeforeunload",function(){va(qa.exit)});
|
||||
function w(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.name;this.mj=b.comment;this.Hn=b;void 0===this.id&&(this.id="");b=this.id.indexOf(".");0<b?(this.ug=this.id.substr(0,b),this.Ih=this.id.substr(b+1)):this.Ih=this.id;this[a]=c;this.Dh=null;this.Xc=this.Ab=this.Dc=this.uh=this.og=!1;this.pa={};this.Ma=null;this.ug&&this.ug.match(/\d+/);x[x.length]=this}var ya=void 0,za={};
|
||||
if(window){ya||(ya=window.location.search.substr(1));for(var Aa,Ba=/\+/g,Ca=/([^&=]+)=?([^&]*)/g;Aa=Ca.exec(ya);)za[decodeURIComponent(Aa[1].replace(Ba," "))]=decodeURIComponent(Aa[2].replace(Ba," "))}function Da(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}function y(a,b){b.prototype=Da(a.prototype)}var x=[];
|
||||
function Ea(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<x.length;b++){var d=x[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Fa(a,b){if(void 0!==a){var c;b&&0<(c=b.indexOf("."))&&(a=b.substr(0,c+1)+a);for(c=0;c<x.length;c++)if(x[c].id===a)return x[c]}return null}
|
||||
|
|
|
|||
Loading…
Reference in a new issue