Commit 84d0cb8d authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Remove unused Helios's booth files

parent 0981fb39
*~
\ No newline at end of file
The Helios Booth
================
LICENSE: this code is released under the GPL v3 or later.
\ No newline at end of file
/*
* JavaScript HTML 5 Worker for BOOTH
*/
// import needed resources
importScripts("js/underscore-min.js");
importScripts("js/jscrypto/jsbn.js",
"js/jscrypto/jsbn2.js",
"js/jscrypto/sjcl.js",
"js/jscrypto/class.js",
"js/jscrypto/bigint.js",
"js/jscrypto/random.js",
"js/jscrypto/elgamal.js",
"js/jscrypto/sha2.js",
"js/jscrypto/helios.js");
var console = {
'log' : function(msg) {
self.postMessage({'type':'log','msg':msg});
}
};
var ELECTION = null;
var Q_NUM = null;
function do_setup(message) {
console.log("setting up worker " + message.question_num);
ELECTION = HELIOS.Election.fromJSONString(message.election);
Q_NUM = message.question_num;
}
function do_encrypt(message) {
console.log("encrypting answer for question " + ELECTION.questions[Q_NUM]);
var encrypted_answer = new HELIOS.EncryptedAnswer(ELECTION.questions[Q_NUM], message.answer, ELECTION.public_key, message.zkp);
console.log("done encrypting");
// send the result back
self.postMessage({
'type': 'result',
'encrypted_answer': encrypted_answer.toJSONObject(true),
'id':message.id
});
}
// receive either
// a) an election and an integer position of the question
// that this worker will be used to encrypt
// {'type': 'setup', 'question_num' : 2, 'election' : election_json}
//
// b) an answer that needs encrypting
// {'type': 'encrypt', 'answer' : answer_json}
//
self.onmessage = function(event) {
// dispatch to method
self['do_' + event.data.type](event.data);
}
body {
font-family: Arial;
background: white;
padding: 0px;
margin: 0px;
}
#wrapper {
position: absolute;
padding: 0px;
background: white;
border: 1px solid #666;
top: 2%;
margin-left: 5%;
margin-top: 0px;
width: 90%;
}
#content {
padding: 20px 30px 20px 30px;
}
#header {
padding-top: 0px;
text-align: center;
padding-bottom: 5px;
}
#header h1 {
font-size: 28pt;
padding: 0px;
margin: 0px;
line-height: 120%;
}
#header h2 {
font-size: 20pt;
padding: 0px;
margin: 0px;
line-height: 100%;
font-weight: normal;
}
#banner {
width: 100%;
text-align: center;
padding: 2px 0px 2px 0px;
background: #ccc;
font-size: 18pt;
border-bottom: 1px solid #666;
}
#progress_div {
width: 100%;
font-size: 14pt;
}
#progress_div table {
border-collapse: collapse;
text-align: center;
border: 0px;
}
#progress_div td.unselected {
background: #ccc;
color: #888;
border: 1px solid #333;
}
#progress_div td.selected {
background: #fc9;
color: black;
font-weight: bold;
border: 1px solid black;
}
#footer {
position: relative;
bottom: 0px;
width: 100%;
text-align: center;
margin-top: 10px;
padding: 2px 0px 2px 0px;
background: #ddd;
border-top: 1px solid #666;
}
#page h2 {
background: #fc9;
border-bottom: 1px solid #f90;
padding: 5px 0px 2px 5px;
}
h3 {
font-size: 1.6em;
}
#election_info {
font-size: 16pt;
}
#election_hash {
font-family: courier;
}
form.prettyform {
font-size: 1.4em;
}
form.prettyform label,input,textarea,select {
line-height: 1.8;
}
form.prettyform label {
display: block;
text-align: right;
float: left;
width: 200px;
padding-right: 10px;
}
form.prettyform br {
clear: left;
}
form.prettyform input, form.prettyform textarea, button {
border: 1px solid black;
margin: 5px;
font-size: 16pt;
}
input.pretty {
font-size: 16pt;
border: 1px solid black;
}
input.prettysmall {
font-size: 12pt;
border: 1px solid black;
}
table.pretty {
margin: 1em 1em 1em 2em;
background: whitesmoke;
border-collapse: collapse;
width: 80%;
}
table.pretty th, td {
border: 1px silver solid;
padding: 0.3em;
}
#answers {
padding-left: 210px;
padding-top: 0px;
margin-top: 0px;
}
#questions_div {
font-size: 1.4em;
}
div.selected {
background: lightblue;
}
a:link {color:#00a;}
a:visited {color:#00a;}
a:active {color:blue;}
a:hover, a.subfoot:hover, a.linknav:hover, a.sublinknav:hover {color:blue;text-decoration:underline;}
body {
margin:0px;
padding: 0px;
background:#ddd;
font-family: "Trebuchet MS",verdana,sans-serif;
font-size: 14px;
color:#333;
}
#container {
margin-top:20px;
margin-right:50px;
margin-left:50px;
background:white;
border-top:1px solid #666;
border-left:1px solid #666;
border-right:1px solid #666;
border-bottom:1px solid #666;
background-color: white;
padding-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
}
#content {
padding: 20px;
font-size: 1.3em;
}
.selected {
background: lightblue;
display: inline-block;
}
h1, h2, h3, h4, pre {
line-height:120%;
margin: 0px;
}
p {
line-height:120%;
}
h1 {
padding: 30px;
font-size: 2em;
text-align: center;
background: #eee;
border-bottom: 1px solid #888;
}
h2 {
font-size: 2em;
}
h3 {
font-size: 1.8em;
}
#election {
background: white;
border: 1px solid black;
}
#question-menu {
border-right: 1px dotted #888;
background: #eee;
height: 40em;
width: 14em;
}
#question {
background: #fff;
height: 39em;
margin-left: 14.05em;
padding-left: 1em;
padding-top: 1em;
}
.question_short {
padding-top: 15px;
padding-bottom: 10px;
padding-left: 5px;
font-size: 18pt;
border-bottom: 1px dotted #888;
}
.question_selected {
padding-top: 15px;
padding-bottom: 10px;
padding-left: 5px;
margin-right: -1px;
font-size: 18pt;
border-bottom: 1px dotted #888;
background: #fff;
}
#navigation {
position: relative;
bottom: 10px;
padding-left: 210px;
padding-right: 10px;
text-align: center;
}
.data {
font-family: courier;
}
{"cast_url": "http://localhost:8000/cast/", "uuid": "82cd836a-65f4-11de-8c90-001b63948875", "name": "Distributed Proofreaders Foundation", "openreg": true, "public_key": {"g": "68111451286792593845145063691659993410221812806874234365854504719057401858372594942893291581957322023471947260828209362467690671421429979048643907159864269436501403220400197614308904460547529574693875218662505553938682573554719632491024304637643868603338114042760529545510633271426088675581644231528918421974", "p": "169989719781940995935039590956086833929670733351333885026079217526937746166790934510618940073906514429409914370072173967782198129423558224854191320917329420870526887804017711055077916007496804049206725568956610515399196848621653907978580213217522397058071043503404700268425750722626265208099856407306527012763", "q": "84994859890970497967519795478043416964835366675666942513039608763468873083395467255309470036953257214704957185036086983891099064711779112427095660458664710435263443902008855527538958003748402024603362784478305257699598424310826953989290106608761198529035521751702350134212875361313132604049928203653263506381", "y": "166381348774608583478438068541900979308284008775524113662477325596101906734254387151724992928319196422498626340355054333287202185267035983610044362456796963319559762922405260105538812887763994476127275234333452789887229585512484617401407171125923170313708217690722245099929673448997254171816215353834880048567"}, "questions": [{"answer_urls": ["http:\/\/www.pgdp.net\/phpBB2\/viewtopic.php?p=539704#539704", "http:\/\/www.pgdp.net\/phpBB2\/viewtopic.php?p=539706#539706", "http:\/\/www.pgdp.net\/phpBB2\/viewtopic.php?p=539708#539708", "http:\/\/www.pgdp.net\/phpBB2\/viewtopic.php?p=539709#539709", "http:\/\/www.pgdp.net\/phpBB2\/viewtopic.php?p=539710#539710"], "answers": ["fvandrog: Frank van Drogen", "jhutch: Joshua Hutchinson", "rfrank: Roger Frank", "Simple Simon: David Jones", "TheEileen: Eileen Gormly"], "max": 3, "question": "Please choose 3 of the following 5 people to serve as Board members of the Distributed Proofreaders Foundation. Names are in alphabetical order by DP ID.", "short_name": "Choose new DPF Board Members"}]}
\ No newline at end of file
This diff is collapsed.
/* jTemplates 0.6.6 (http://jtemplates.tpython.com) Copyright (c) 2008 Tomasz Gloc (http://www.tpython.com)
Please do not remove or modify above line. Thanks. Dual licensed under the MIT and GPL licenses. */
eval(function(p,a,c,k,e,r){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--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}('9(2Q.8&&!2Q.8.2V){(7(){5 A=7(s,q,j){4.1t=[];4.1w={};4.2v=C;4.1A={};4.15={};4.j=8.1q({2r:17,2S:3F,2b:17,2O:17},j);4.2K(s,q);9(s){4.1h(4.15[\'1E\'],q)}4.15=C};A.f.1X=\'0.6.6\';A.f.2K=7(s,q){5 2x=/\\{#33 *(\\w*?)\\}/g;5 2u,1y,B;5 1k=C;2n((2u=2x.3J(s))!=C){1k=2x.1k;1y=2u[1];B=s.2i(\'{#/33 \'+1y+\'}\',1k);9(B==-1){13 c 16(\'Z: A "\'+1y+\'" 28 1F 3t.\');}4.15[1y]=s.23(1k,B)}9(1k===C){4.15[\'1E\']=s;a}H(5 i 1D 4.15){9(i!=\'1E\'){4.1A[i]=c A()}}H(5 i 1D 4.15){9(i!=\'1E\'){4.1A[i].1h(4.15[i],8.1q({},q||{},4.1A||{}));4.15[i]=C}}};A.f.1h=7(s,q){9(s==1r){4.1t.z(c 18(\'\',1));a}s=s.L(/[\\n\\r]/g,\'\');s=s.L(/\\{\\*.*?\\*\\}/g,\'\');4.2v=8.1q({},4.1A||{},q||{});5 h=4.1t;5 I=s.1f(/\\{#.*?\\}/g);5 O=0,B=0;5 e;5 19=0;5 1Q=0;H(5 i=0,l=(I)?(I.G):(0);i<l;++i){9(19){B=s.2i(\'{#/1m}\');9(B==-1){13 c 16("Z: 31 3P 2Z 1m.");}9(B>O){h.z(c 18(s.23(O,B),1))}O=B+11;19=0;i=8.3O(\'{#/1m}\',I);2X}B=s.2i(I[i],O);9(B>O){h.z(c 18(s.23(O,B),19))}5 3M=I[i].1f(/\\{#([\\w\\/]+).*?\\}/);5 2q=J.$1;2U(2q){y\'3I\':++1Q;h.1M();y\'9\':e=c 1i(I[i],h);h.z(e);h=e;N;y\'1b\':h.1M();N;y\'/9\':2n(1Q){h=h.1J();--1Q}y\'/H\':y\'/2h\':h=h.1J();N;y\'2h\':e=c 1l(I[i],h);h.z(e);h=e;N;y\'2g\':h.z(c 2e(I[i],4.2v));N;y\'b\':h.z(c 2d(I[i]));N;y\'2a\':h.z(c 29(I[i]));N;y\'3w\':h.z(c 18(\'{\'));N;y\'3v\':h.z(c 18(\'}\'));N;y\'1m\':19=1;N;y\'/1m\':13 c 16("Z: 31 2N 2Z 1m.");2M:13 c 16(\'Z: 3s 3r \'+2q+\'.\');}O=B+I[i].G}9(s.G>O){h.z(c 18(s.3p(O),19))}};A.f.F=7(d,b,x){5 $T=4.1s(d,{21:4.j.2S,2y:4.j.2r});5 $P=8.1q(4.1w,b);9(4.j.2b){$P=4.1s($P,{21:4.j.2b,2y:17})}5 $Q=x;$Q.1X=4.1X;5 X=\'\';H(5 i=0,l=4.1t.G;i<l;++i){X+=4.1t[i].F($T,$P,$Q)}a X};A.f.2p=7(1v,1B){4.1w[1v]=1B};A.f.2C=7(2W){a 2W.L(/&/g,\'&3c;\').L(/>/g,\'&36;\').L(/</g,\'&2A;\').L(/"/g,\'&37;\').L(/\'/g,\'&#39;\')};A.f.1s=7(d,1p){9(d==C){a d}2U(d.2z){y 1U:5 o={};H(5 i 1D d){o[i]=4.1s(d[i],1p)}a o;y 3V:5 o=[];H(5 i=0,l=d.G;i<l;++i){o[i]=4.1s(d[i],1p)}a o;y 35:a(1p.21)?(4.2C(d)):(d);y 3U:9(1p.2y){13 c 16("Z: 3T 3S 1F 3R.");}2M:a d}};5 18=7(2w,19){4.1R=2w;4.34=19};18.f.F=7(d,b,x){5 t=4.1R;9(!4.34){5 $T=d;5 $P=b;5 $Q=x;t=t.L(/\\{(.*?)\\}/g,7(3Q,32){5 12=14(32);9(1z 12==\'7\'){5 j=8.E(x,\'1d\').j;9(j.2r||!j.2O){a\'\'}1b{12=12($T,$P,$Q)}}a(12===1r)?(""):(35(12))})}a t};5 1i=7(R,1P){4.1O=1P;R.1f(/\\{#(?:1b)*9 (.*?)\\}/);4.30=J.$1;4.1c=[];4.1e=[];4.1n=4.1c};1i.f.z=7(e){4.1n.z(e)};1i.f.1J=7(){a 4.1O};1i.f.1M=7(){4.1n=4.1e};1i.f.F=7(d,b,x){5 $T=d;5 $P=b;5 $Q=x;5 2t=(14(4.30))?(4.1c):(4.1e);5 X=\'\';H(5 i=0,l=2t.G;i<l;++i){X+=2t[i].F(d,b,x)}a X};5 1l=7(R,1P){4.1O=1P;R.1f(/\\{#2h (.+?) 3N (\\w+?)( .+)*\\}/);4.2Y=J.$1;4.m=J.$2;4.V=J.$3||C;9(4.V!==C){5 o=4.V.3L(/[= ]/);9(o[0]===\'\'){o.3K()}4.V={};H(5 i=0,l=o.G;i<l;i+=2){4.V[o[i]]=o[i+1]}}1b{4.V={}}4.1c=[];4.1e=[];4.1n=4.1c};1l.f.z=7(e){4.1n.z(e)};1l.f.1J=7(){a 4.1O};1l.f.1M=7(){4.1n=4.1e};1l.f.F=7(d,b,x){5 $T=d;5 $P=b;5 $Q=x;5 K=14(4.2Y);5 1x=[];5 2o=1z K;9(2o==\'2T\'){5 2m=[];8.10(K,7(k,v){1x.z(k);2m.z(v)});K=2m}5 s=2l(14(4.V.2N)||0);5 1o=2l(14(4.V.1o)||1);5 e=K.G;5 X=\'\';5 i,l;9(4.V.K){5 12=s+2l(14(4.V.K));e=(12>e)?(e):(12)}9(e>s){5 Y=0;5 2k=3H.3G((e-s)/1o);5 1j,1K;H(;s<e;s+=1o,++Y){1j=1x[s];1K=K[s];9((2o==\'2T\')&&(1j 1D 1U)&&(1U[1j]===$T[1j])){2X}5 p=$T[4.m]=1K;p.$1T=s;p.$Y=Y;p.$1I=(Y==0);p.$1N=(s+1o>=e);p.$1H=2k;$T[4.m+\'$1T\']=s;$T[4.m+\'$Y\']=Y;$T[4.m+\'$1I\']=(Y==0);$T[4.m+\'$1N\']=(s+1o>=e);$T[4.m+\'$1H\']=2k;$T[4.m+\'$1x\']=1j;$T[4.m+\'$1z\']=1z 1K;H(i=0,l=4.1c.G;i<l;++i){X+=4.1c[i].F($T,b,x)}D p.$1T;D p.$Y;D p.$1I;D p.$1N;D p.$1H;D $T[4.m+\'$1T\'];D $T[4.m+\'$Y\'];D $T[4.m+\'$1I\'];D $T[4.m+\'$1N\'];D $T[4.m+\'$1H\'];D $T[4.m+\'$1x\'];D $T[4.m+\'$1z\'];D $T[4.m]}}1b{H(i=0,l=4.1e.G;i<l;++i){X+=4.1e[i].F($T,b,x)}}a X};5 2e=7(R,q){R.1f(/\\{#2g (.*?)(?: 3E=(.*?))?\\}/);4.2f=q[J.$1];9(4.2f==1r){13 c 16(\'Z: 3D 3C 2g: \'+J.$1);}4.2R=J.$2};2e.f.F=7(d,b,x){5 $T=d;a 4.2f.F(14(4.2R),b,x)};5 2d=7(R){R.1f(/\\{#b 1v=(\\w*?) 1B=(.*?)\\}/);4.m=J.$1;4.1R=J.$2};2d.f.F=7(d,b,x){5 $T=d;5 $P=b;5 $Q=x;b[4.m]=14(4.1R);a\'\'};5 29=7(R){R.1f(/\\{#2a 3B=(.*?)\\}/);4.2c=14(J.$1);4.26=4.2c.G;9(4.26<=0){13 c 16(\'Z: 2a 3z 3y 3x\');}4.1V=0;4.27=-1};29.f.F=7(d,b,x){5 1W=8.E(x,\'1u\');9(1W!=4.27){4.27=1W;4.1V=0}5 i=4.1V++%4.26;a 4.2c[i]};8.M.1h=7(s,q,j){9(s.2z===A){8(4).10(7(){8.E(4,\'1d\',s);8.E(4,\'1u\',0)})}1b{8(4).10(7(){8.E(4,\'1d\',c A(s,q,j));8.E(4,\'1u\',0)})}};8.M.3u=7(1g,q,j){5 s=8.1Y({1a:1g,25:17}).2L;8(4).1h(s,q,j)};8.M.3q=7(24,q,j){5 s=$(\'#\'+24).2w();9(s==C){s=$(\'#\'+24).2J();s=s.L(/&2A;/g,"<").L(/&36;/g,">")}s=8.3o(s);s=s.L(/^<\\!\\[3n\\[([\\s\\S]*)\\]\\]>$/3m,\'$1\');8(4).1h(s,q,j)};8.M.3l=7(){5 K=0;8(4).10(7(){9(8.E(4,\'1d\')){++K}});a K};8.M.3k=7(){8(4).2P();8(4).10(7(){8.2I(4,\'1d\')})};8.M.2p=7(1v,1B){8(4).10(7(){5 t=8.E(4,\'1d\');9(t===1r){13 c 16(\'Z: A 28 1F 2H.\');}t.2p(1v,1B)})};8.M.22=7(d,b){8(4).10(7(){5 t=8.E(4,\'1d\');9(t===1r){13 c 16(\'Z: A 28 1F 2H.\');}8.E(4,\'1u\',8.E(4,\'1u\')+1);8(4).2J(t.F(d,b,4))})};8.M.3j=7(1g,b){5 W=4;5 s=8.1Y({1a:1g,25:17,3i:17,3h:\'3A\',3g:7(d){8(W).22(d,b)}})};5 1L=7(1a,b,1C,1G,U){4.2G=1a;4.1w=b;4.2F=1C;4.2E=1G;4.U=U;4.20=C;5 W=4;8(U).10(7(){8.E(4,\'2j\',W)});4.1Z()};1L.f.1Z=7(){4.2D();9(4.U.G==0){a}5 W=4;8.3f(4.2G,4.2E,7(d){8(W.U).22(d,W.1w)});4.20=3e(7(){W.1Z()},4.2F)};1L.f.2D=7(){4.U=8.2B(4.U,7(o){9(8.3d.3b){5 n=o.2s;2n(n&&n!=3a){n=n.2s}a n!=C}1b{a o.2s!=C}})};8.M.38=7(1a,b,1C,1G){5 u=c 1L(1a,b,1C,1G,4);a u.20};8.M.2P=7(){8(4).10(7(){5 1S=8.E(4,\'2j\');9(1S==C){a}5 W=4;1S.U=8.2B(1S.U,7(o){a o!=W});8.2I(4,\'2j\')})};8.1q({2V:7(s,q,j){a c A(s,q,j)},3W:7(1g,q,j){5 s=8.1Y({1a:1g,25:17}).2L;a c A(s,q,j)}})})(8)}',62,245,'||||this|var||function|jQuery|if|return|param|new|||prototype||node||settings|||_name||||includes|||||||element|case|push|Template|se|null|delete|data|get|length|for|op|RegExp|count|replace|fn|break|ss|||oper|||objs|_option|that|ret|iteration|jTemplates|each||tmp|throw|eval|_templates_code|Error|false|TextNode|literalMode|url|else|_onTrue|jTemplate|_onFalse|match|url_|setTemplate|opIF|ckey|lastIndex|opFOREACH|literal|_currentState|step|filter|extend|undefined|cloneData|_tree|jTemplateSID|name|_param|key|tname|typeof|_templates|value|interval|in|MAIN|not|args|total|first|getParent|cval|Updater|switchToElse|last|_parent|par|elseif_level|_value|updater|index|Object|_index|sid|version|ajax|run|timer|escapeData|processTemplate|substring|elementName|async|_length|_lastSessionID|is|Cycle|cycle|filter_params|_values|UserParam|Include|_template|include|foreach|indexOf|jTemplateUpdater|_total|Number|arr|while|mode|setParam|op_|disallow_functions|parentNode|tab|iter|_includes|val|reg|noFunc|constructor|lt|grep|escapeHTML|detectDeletedNodes|_args|_interval|_url|defined|removeData|html|splitTemplates|responseText|default|begin|runnable_functions|processTemplateStop|window|_root|filter_data|object|switch|createTemplate|txt|continue|_arg|of|_cond|No|__a1|template|_literalMode|String|gt|quot|processTemplateStart||document|msie|amp|browser|setTimeout|getJSON|success|dataType|cache|processTemplateURL|removeTemplate|hasTemplate|im|CDATA|trim|substr|setTemplateElement|tag|unknown|closed|setTemplateURL|rdelim|ldelim|elements|no|has|json|values|find|Cannot|root|true|ceil|Math|elseif|exec|shift|split|ppp|as|inArray|end|__a0|allowed|are|Functions|Function|Array|createTemplateURL'.split('|'),0,{}))
\ No newline at end of file
(function($){function toIntegersAtLease(n)
{return n<10?'0'+n:n;}
Date.prototype.toJSON=function(date)
{return date.getUTCFullYear()+'-'+
toIntegersAtLease(date.getUTCMonth()+1)+'-'+
toIntegersAtLease(date.getUTCDate());};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};
$.quoteString=function(string)
{if(escapeable.test(string))
{return'"'+string.replace(escapeable,function(a)
{var c=meta[a];if(typeof c==='string'){return c;}
c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};
$.toJSON=function(o)
{var type=typeof(o);if(type=="undefined")
return"null";else if(type=="number"||type=="boolean")
return o+"";else if(o===null)
return"null";if(type=="string")
{return $.quoteString(o);}
if(type=="object"&&typeof o.toJSONObject=="function")
return $.toJSON(o.toJSONObject());if(type!="function"&&typeof(o.length)=="number")
{var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i]));}
return"["+ret.join(", ")+"]";}
if(type=="function"){throw new TypeError("Unable to convert object of type 'function' to json.");}
ret=[];for(var k in o){var name;var type=typeof(k);if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;val=$.toJSON(o[k]);if(typeof(val)!="string"){continue;}
ret.push(name+": "+val);}
return"{"+ret.join(", ")+"}";}
$.evalJSON=function(src)
{return eval("("+src+")");}
$.secureEvalJSON=function(src)
{var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");}})(jQuery);
\ No newline at end of file
/**
* jQuery.query - Query String Modification and Creation for jQuery
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
* Date: 2009/06/14
*
* @author Blair Mitchelmore
* @version 2.1.5
*
**/
new function(settings) {
// Various Settings
var $separator = settings.separator || '&';
var $spaces = settings.spaces === false ? false : true;
var $suffix = settings.suffix === false ? '' : '[]';
var $prefix = settings.prefix === false ? false : true;
var $hash = $prefix ? settings.hash === true ? "#" : "?" : "";
var $numbers = settings.numbers === false ? false : true;
jQuery.query = new function() {
var is = function(o, t) {
return o != undefined && o !== null && (!!t ? o.constructor == t : true);
};
var parse = function(path) {
var m, rx = /\[([^[]*)\]/g, match = /^(\S+?)(\[\S*\])?$/.exec(path), base = match[1], tokens = [];
while (m = rx.exec(match[2])) tokens.push(m[1]);
return [base, tokens];
};
var set = function(target, tokens, value) {
var o, token = tokens.shift();
if (typeof target != 'object') target = null;
if (token === "") {
if (!target) target = [];
if (is(target, Array)) {
target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
} else if (is(target, Object)) {
var i = 0;
while (target[i++] != null);
target[--i] = tokens.length == 0 ? value : set(target[i], tokens.slice(0), value);
} else {
target = [];
target.push(tokens.length == 0 ? value : set(null, tokens.slice(0), value));
}
} else if (token && token.match(/^\s*[0-9]+\s*$/)) {
var index = parseInt(token, 10);
if (!target) target = [];
target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
} else if (token) {
var index = token.replace(/^\s*|\s*$/g, "");
if (!target) target = {};
if (is(target, Array)) {
var temp = {};
for (var i = 0; i < target.length; ++i) {
temp[i] = target[i];
}
target = temp;
}
target[index] = tokens.length == 0 ? value : set(target[index], tokens.slice(0), value);
} else {
return value;
}
return target;
};
var queryObject = function(a) {
var self = this;
self.keys = {};
if (a.queryObject) {
jQuery.each(a.get(), function(key, val) {
self.SET(key, val);
});
} else {
jQuery.each(arguments, function() {
var q = "" + this;
q = q.replace(/^[?#]/,''); // remove any leading ? || #
q = q.replace(/[;&]$/,''); // remove any trailing & || ;
if ($spaces) q = q.replace(/[+]/g,' '); // replace +'s with spaces
jQuery.each(q.split(/[&;]/), function(){
var key = decodeURIComponent(this.split('=')[0]);
var val = decodeURIComponent(this.split('=')[1]);
if (!key) return;
if ($numbers) {
if (/^[+-]?[0-9]+\.[0-9]*$/.test(val)) // simple float regex
val = parseFloat(val);
else if (/^[+-]?[0-9]+$/.test(val)) // simple int regex
val = parseInt(val, 10);
}
val = (!val && val !== 0) ? true : val;
if (val !== false && val !== true && typeof val != 'number')
val = val;
self.SET(key, val);
});
});
}
return self;
};
queryObject.prototype = {
queryObject: true,
has: function(key, type) {
var value = this.get(key);
return is(value, type);
},
GET: function(key) {
if (!is(key)) return this.keys;
var parsed = parse(key), base = parsed[0], tokens = parsed[1];
var target = this.keys[base];
while (target != null && tokens.length != 0) {
target = target[tokens.shift()];
}
return typeof target == 'number' ? target : target || "";
},
get: function(key) {
var target = this.GET(key);
if (is(target, Object))
return jQuery.extend(true, {}, target);
else if (is(target, Array))
return target.slice(0);
return target;
},
SET: function(key, val) {
var value = !is(val) ? null : val;
var parsed = parse(key), base = parsed[0], tokens = parsed[1];
var target = this.keys[base];
this.keys[base] = set(target, tokens.slice(0), value);
return this;
},
set: function(key, val) {
return this.copy().SET(key, val);
},
REMOVE: function(key) {
return this.SET(key, null).COMPACT();
},
remove: function(key) {
return this.copy().REMOVE(key);
},
EMPTY: function() {
var self = this;
jQuery.each(self.keys, function(key, value) {
delete self.keys[key];
});
return self;
},
load: function(url) {
var hash = url.replace(/^.*?[#](.+?)(?:\?.+)?$/, "$1");
var search = url.replace(/^.*?[?](.+?)(?:#.+)?$/, "$1");
return new queryObject(url.length == search.length ? '' : search, url.length == hash.length ? '' : hash);
},
empty: function() {
return this.copy().EMPTY();
},
copy: function() {
return new queryObject(this);
},
COMPACT: function() {
function build(orig) {
var obj = typeof orig == "object" ? is(orig, Array) ? [] : {} : orig;
if (typeof orig == 'object') {
function add(o, key, value) {
if (is(o, Array))
o.push(value);
else