-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathpamm.html
22 lines (22 loc) · 4.26 KB
/
pamm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE HTML>
<html><head><title>PAMM Protocol Handler Redirect</title>
<script>
/*
* Purl (A JavaScript URL parser) v2.3.1
* Developed and maintanined by Mark Perkins, [email protected]
* Source repository: https://github.com/allmarkedup/jQuery-URL-Parser
* Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.
*/
(function(e){if(typeof define==="function"&&define.amd){define(e)}else{window.purl=e()}})(function(){function s(e,n){var i=decodeURI(e),s=r[n||false?"strict":"loose"].exec(i),o={attr:{},param:{},seg:{}},u=14;while(u--){o.attr[t[u]]=s[u]||""}o.param["query"]=l(o.attr["query"]);o.param["fragment"]=l(o.attr["fragment"]);o.seg["path"]=o.attr.path.replace(/^\/+|\/+$/g,"").split("/");o.seg["fragment"]=o.attr.fragment.replace(/^\/+|\/+$/g,"").split("/");o.attr["base"]=o.attr.host?(o.attr.protocol?o.attr.protocol+"://"+o.attr.host:o.attr.host)+(o.attr.port?":"+o.attr.port:""):"";return o}function o(t){var n=t.tagName;if(typeof n!=="undefined")return e[n.toLowerCase()];return n}function u(e,t){if(e[t].length===0)return e[t]={};var n={};for(var r in e[t])n[r]=e[t][r];e[t]=n;return n}function a(e,t,n,r){var s=e.shift();if(!s){if(d(t[n])){t[n].push(r)}else if("object"==typeof t[n]){t[n]=r}else if("undefined"==typeof t[n]){t[n]=r}else{t[n]=[t[n],r]}}else{var o=t[n]=t[n]||[];if("]"==s){if(d(o)){if(""!==r)o.push(r)}else if("object"==typeof o){o[v(o).length]=r}else{o=t[n]=[t[n],r]}}else if(~s.indexOf("]")){s=s.substr(0,s.length-1);if(!i.test(s)&&d(o))o=u(t,n);a(e,o,s,r)}else{if(!i.test(s)&&d(o))o=u(t,n);a(e,o,s,r)}}}function f(e,t,n){if(~t.indexOf("]")){var r=t.split("[");a(r,e,"base",n)}else{if(!i.test(t)&&d(e.base)){var s={};for(var o in e.base)s[o]=e.base[o];e.base=s}if(t!==""){c(e.base,t,n)}}return e}function l(e){return p(String(e).split(/&|;/),function(e,t){try{t=decodeURIComponent(t.replace(/\+/g," "))}catch(n){}var r=t.indexOf("="),i=h(t),s=t.substr(0,i||r),o=t.substr(i||r,t.length);o=o.substr(o.indexOf("=")+1,o.length);if(s===""){s=t;o=""}return f(e,s,o)},{base:{}}).base}function c(e,t,n){var r=e[t];if(typeof r==="undefined"){e[t]=n}else if(d(r)){r.push(n)}else{e[t]=[r,n]}}function h(e){var t=e.length,n,r;for(var i=0;i<t;++i){r=e[i];if("]"==r)n=false;if("["==r)n=true;if("="==r&&!n)return i}}function p(e,t){var n=0,r=e.length>>0,i=arguments[2];while(n<r){if(n in e)i=t.call(undefined,i,e[n],n,e);++n}return i}function d(e){return Object.prototype.toString.call(e)==="[object Array]"}function v(e){var t=[];for(var n in e){if(e.hasOwnProperty(n))t.push(n)}return t}function m(e,t){if(arguments.length===1&&e===true){t=true;e=undefined}t=t||false;e=e||window.location.toString();return{data:s(e,t),attr:function(e){e=n[e]||e;return typeof e!=="undefined"?this.data.attr[e]:this.data.attr},param:function(e){return typeof e!=="undefined"?this.data.param.query[e]:this.data.param.query},fparam:function(e){return typeof e!=="undefined"?this.data.param.fragment[e]:this.data.param.fragment},segment:function(e){if(typeof e==="undefined"){return this.data.seg.path}else{e=e<0?this.data.seg.path.length+e:e-1;return this.data.seg.path[e]}},fsegment:function(e){if(typeof e==="undefined"){return this.data.seg.fragment}else{e=e<0?this.data.seg.fragment.length+e:e-1;return this.data.seg.fragment[e]}}}}var e={a:"href",img:"src",form:"action",base:"href",script:"src",iframe:"src",link:"href",embed:"src",object:"data"},t=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"],n={anchor:"fragment"},r={strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/},i=/^[0-9]+$/;m.jQuery=function(e){if(e!=null){e.fn.url=function(t){var n="";if(this.length){n=e(this).attr(o(this[0]))||""}return m(n,t)};e.url=m}};m.jQuery(window.jQuery);return m})
</script>
<script>
var url = purl();
var identifier = url.param('identifier');
if(identifier) {
window.location.replace('pamm://install/'+identifier);
}
else {
document.write("Fail: " + JSON.stringify(url));
}
</script>
</head><body></body></html>