Files
@ 026a2bce00a8
Branch filter:
Location: light9/static/QueryString.js - annotation
026a2bce00a8
3.5 KiB
application/javascript
preview camera at res=1080 to match what vidref will use. didn't help
Ignore-this: 3af03061c6926c0ee718fa0f7c7eb6ab
Ignore-this: 3af03061c6926c0ee718fa0f7c7eb6ab
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 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 a4632a7b2e17 | // This is public domain code written in 2011 by Jan Wolter and distributed
// for free at http://unixpapa.com/js/querystring.html
//
// Query String Parser
//
// qs= new QueryString()
// qs= new QueryString(string)
//
// Create a query string object based on the given query string. If
// no string is given, we use the one from the current page by default.
//
// qs.value(key)
//
// Return a value for the named key. If the key was not defined,
// it will return undefined. If the key was multiply defined it will
// return the last value set. If it was defined without a value, it
// will return an empty string.
//
// qs.values(key)
//
// Return an array of values for the named key. If the key was not
// defined, an empty array will be returned. If the key was multiply
// defined, the values will be given in the order they appeared on
// in the query string.
//
// qs.keys()
//
// Return an array of unique keys in the query string. The order will
// not necessarily be the same as in the original query, and repeated
// keys will only be listed once.
//
// QueryString.decode(string)
//
// This static method is an error tolerant version of the builtin
// function decodeURIComponent(), modified to also change pluses into
// spaces, so that it is suitable for query string decoding. You
// shouldn't usually need to call this yourself as the value(),
// values(), and keys() methods already decode everything they return.
//
// Note: W3C recommends that ; be accepted as an alternative to & for
// separating query string fields. To support that, simply insert a semicolon
// immediately after each ampersand in the regular expression in the first
// function below.
function QueryString(qs)
{
this.dict= {};
// If no query string was passed in use the one from the current page
if (!qs) qs= location.search;
// Delete leading question mark, if there is one
if (qs.charAt(0) == '?') qs= qs.substring(1);
// Parse it
var re= /([^=&]+)(=([^&]*))?/g;
while (match= re.exec(qs))
{
var key= decodeURIComponent(match[1].replace(/\+/g,' '));
var value= match[3] ? QueryString.decode(match[3]) : '';
if (this.dict[key])
this.dict[key].push(value);
else
this.dict[key]= [value];
}
}
QueryString.decode= function(s)
{
s= s.replace(/\+/g,' ');
s= s.replace(/%([EF][0-9A-F])%([89AB][0-9A-F])%([89AB][0-9A-F])/gi,
function(code,hex1,hex2,hex3)
{
var n1= parseInt(hex1,16)-0xE0;
var n2= parseInt(hex2,16)-0x80;
if (n1 == 0 && n2 < 32) return code;
var n3= parseInt(hex3,16)-0x80;
var n= (n1<<12) + (n2<<6) + n3;
if (n > 0xFFFF) return code;
return String.fromCharCode(n);
});
s= s.replace(/%([CD][0-9A-F])%([89AB][0-9A-F])/gi,
function(code,hex1,hex2)
{
var n1= parseInt(hex1,16)-0xC0;
if (n1 < 2) return code;
var n2= parseInt(hex2,16)-0x80;
return String.fromCharCode((n1<<6)+n2);
});
s= s.replace(/%([0-7][0-9A-F])/gi,
function(code,hex)
{
return String.fromCharCode(parseInt(hex,16));
});
return s;
};
QueryString.prototype.value= function (key)
{
var a= this.dict[key];
return a ? a[a.length-1] : undefined;
};
QueryString.prototype.values= function (key)
{
var a= this.dict[key];
return a ? a : [];
};
QueryString.prototype.keys= function ()
{
var a= [];
for (var key in this.dict)
a.push(key);
return a;
};
|