View | Details | Raw Unified | Return to bug 8597
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/AJS.js (+525 lines)
Line 0 Link Here
1
AJS={BASE_URL:"",drag_obj:null,drag_elm:null,_drop_zones:[],_cur_pos:null,join:function(_1,_2){
2
try{
3
return _2.join(_1);
4
}
5
catch(e){
6
var r=_2[0]||"";
7
AJS.map(_2,function(_4){
8
r+=_1+_4;
9
},1);
10
return r+"";
11
}
12
},getScrollTop:function(){
13
var t;
14
if(document.documentElement&&document.documentElement.scrollTop){
15
t=document.documentElement.scrollTop;
16
}else{
17
if(document.body){
18
t=document.body.scrollTop;
19
}
20
}
21
return t;
22
},addClass:function(){
23
var _6=AJS.forceArray(arguments);
24
var _7=_6.pop();
25
var _8=function(o){
26
if(!new RegExp("(^|\\s)"+_7+"(\\s|$)").test(o.className)){
27
o.className+=(o.className?" ":"")+_7;
28
}
29
};
30
AJS.map(_6,function(_a){
31
_8(_a);
32
});
33
},setStyle:function(){
34
var _b=AJS.forceArray(arguments);
35
var _c=_b.pop();
36
var _d=_b.pop();
37
AJS.map(_b,function(_e){
38
_e.style[_d]=AJS.getCssDim(_c);
39
});
40
},_getRealScope:function(fn,_10,_11,_12){
41
var _13=window;
42
_10=AJS.$A(_10);
43
if(fn._cscope){
44
_13=fn._cscope;
45
}
46
return function(){
47
var _14=[];
48
var i=0;
49
if(_11){
50
i=1;
51
}
52
AJS.map(arguments,function(arg){
53
_14.push(arg);
54
},i);
55
_14=_14.concat(_10);
56
if(_12){
57
_14=_14.reverse();
58
}
59
return fn.apply(_13,_14);
60
};
61
},preloadImages:function(){
62
AJS.AEV(window,"load",AJS.$p(function(_17){
63
AJS.map(_17,function(src){
64
var pic=new Image();
65
pic.src=src;
66
});
67
},arguments));
68
},_createDomShortcuts:function(){
69
var _1a=["ul","li","td","tr","th","tbody","table","input","span","b","a","div","img","button","h1","h2","h3","br","textarea","form","p","select","option","iframe","script","center","dl","dt","dd","small","pre"];
70
var _1b=function(elm){
71
var _1d="return AJS.createDOM.apply(null, ['"+elm+"', arguments]);";
72
var _1e="function() { "+_1d+"    }";
73
eval("AJS."+elm.toUpperCase()+"="+_1e);
74
};
75
AJS.map(_1a,_1b);
76
AJS.TN=function(_1f){
77
return document.createTextNode(_1f);
78
};
79
},documentInsert:function(elm){
80
if(typeof (elm)=="string"){
81
elm=AJS.HTML2DOM(elm);
82
}
83
document.write("<span id=\"dummy_holder\"></span>");
84
AJS.swapDOM(AJS.$("dummy_holder"),elm);
85
},getWindowSize:function(doc){
86
doc=doc||document;
87
var _22,_23;
88
if(self.innerHeight){
89
_22=self.innerWidth;
90
_23=self.innerHeight;
91
}else{
92
if(doc.documentElement&&doc.documentElement.clientHeight){
93
_22=doc.documentElement.clientWidth;
94
_23=doc.documentElement.clientHeight;
95
}else{
96
if(doc.body){
97
_22=doc.body.clientWidth;
98
_23=doc.body.clientHeight;
99
}
100
}
101
}
102
return {"w":_22,"h":_23};
103
},flattenList:function(_24){
104
var r=[];
105
var _26=function(r,l){
106
AJS.map(l,function(o){
107
if(o==null){
108
}else{
109
if(AJS.isArray(o)){
110
_26(r,o);
111
}else{
112
r.push(o);
113
}
114
}
115
});
116
};
117
_26(r,_24);
118
return r;
119
},setEventKey:function(e){
120
e.key=e.keyCode?e.keyCode:e.charCode;
121
if(window.event){
122
e.ctrl=window.event.ctrlKey;
123
e.shift=window.event.shiftKey;
124
}else{
125
e.ctrl=e.ctrlKey;
126
e.shift=e.shiftKey;
127
}
128
switch(e.key){
129
case 63232:
130
e.key=38;
131
break;
132
case 63233:
133
e.key=40;
134
break;
135
case 63235:
136
e.key=39;
137
break;
138
case 63234:
139
e.key=37;
140
break;
141
}
142
},removeElement:function(){
143
var _2b=AJS.forceArray(arguments);
144
AJS.map(_2b,function(elm){
145
AJS.swapDOM(elm,null);
146
});
147
},_unloadListeners:function(){
148
if(AJS.listeners){
149
AJS.map(AJS.listeners,function(elm,_2e,fn){
150
AJS.REV(elm,_2e,fn);
151
});
152
}
153
AJS.listeners=[];
154
},partial:function(fn){
155
var _31=AJS.forceArray(arguments);
156
return AJS.$b(fn,null,_31.slice(1,_31.length).reverse(),false,true);
157
},getIndex:function(elm,_33,_34){
158
for(var i=0;i<_33.length;i++){
159
if(_34&&_34(_33[i])||elm==_33[i]){
160
return i;
161
}
162
}
163
return -1;
164
},isDefined:function(o){
165
return (o!="undefined"&&o!=null);
166
},isArray:function(obj){
167
return obj instanceof Array;
168
},setLeft:function(){
169
var _38=AJS.forceArray(arguments);
170
_38.splice(_38.length-1,0,"left");
171
AJS.setStyle.apply(null,_38);
172
},appendChildNodes:function(elm){
173
if(arguments.length>=2){
174
AJS.map(arguments,function(n){
175
if(AJS.isString(n)){
176
n=AJS.TN(n);
177
}
178
if(AJS.isDefined(n)){
179
elm.appendChild(n);
180
}
181
},1);
182
}
183
return elm;
184
},isOpera:function(){
185
return (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
186
},isString:function(obj){
187
return (typeof obj=="string");
188
},hideElement:function(elm){
189
var _3d=AJS.forceArray(arguments);
190
AJS.map(_3d,function(elm){
191
elm.style.display="none";
192
});
193
},setOpacity:function(elm,p){
194
elm.style.opacity=p;
195
elm.style.filter="alpha(opacity="+p*100+")";
196
},setHeight:function(){
197
var _41=AJS.forceArray(arguments);
198
_41.splice(_41.length-1,0,"height");
199
AJS.setStyle.apply(null,_41);
200
},setWidth:function(){
201
var _42=AJS.forceArray(arguments);
202
_42.splice(_42.length-1,0,"width");
203
AJS.setStyle.apply(null,_42);
204
},createArray:function(v){
205
if(AJS.isArray(v)&&!AJS.isString(v)){
206
return v;
207
}else{
208
if(!v){
209
return [];
210
}else{
211
return [v];
212
}
213
}
214
},isDict:function(o){
215
var _45=String(o);
216
return _45.indexOf(" Object")!=-1;
217
},isMozilla:function(){
218
return (navigator.userAgent.toLowerCase().indexOf("gecko")!=-1&&navigator.productSub>=20030210);
219
},_listenOnce:function(elm,_47,fn){
220
var _49=function(){
221
AJS.removeEventListener(elm,_47,_49);
222
fn(arguments);
223
};
224
return _49;
225
},addEventListener:function(elm,_4b,fn,_4d,_4e){
226
if(!_4e){
227
_4e=false;
228
}
229
var _4f=AJS.$A(elm);
230
AJS.map(_4f,function(_50){
231
if(_4d){
232
fn=AJS._listenOnce(_50,_4b,fn);
233
}
234
if(AJS.isIn(_4b,["submit","load","scroll","resize"])){
235
var old=elm["on"+_4b];
236
elm["on"+_4b]=function(){
237
if(old){
238
fn(arguments);
239
return old(arguments);
240
}else{
241
return fn(arguments);
242
}
243
};
244
return;
245
}
246
if(AJS.isIn(_4b,["keypress","keydown","keyup","click"])){
247
var _52=fn;
248
fn=function(e){
249
AJS.setEventKey(e);
250
return _52.apply(null,arguments);
251
};
252
}
253
if(_50.attachEvent){
254
_50.attachEvent("on"+_4b,fn);
255
}else{
256
if(_50.addEventListener){
257
_50.addEventListener(_4b,fn,_4e);
258
}
259
}
260
AJS.listeners=AJS.$A(AJS.listeners);
261
AJS.listeners.push([_50,_4b,fn]);
262
});
263
},createDOM:function(_54,_55){
264
var i=0,_57;
265
elm=document.createElement(_54);
266
if(AJS.isDict(_55[i])){
267
for(k in _55[0]){
268
_57=_55[0][k];
269
if(k=="style"){
270
elm.style.cssText=_57;
271
}else{
272
if(k=="class"||k=="className"){
273
elm.className=_57;
274
}else{
275
elm.setAttribute(k,_57);
276
}
277
}
278
}
279
i++;
280
}
281
if(_55[0]==null){
282
i=1;
283
}
284
AJS.map(_55,function(n){
285
if(n){
286
if(AJS.isString(n)||AJS.isNumber(n)){
287
n=AJS.TN(n);
288
}
289
elm.appendChild(n);
290
}
291
},i);
292
return elm;
293
},setTop:function(){
294
var _59=AJS.forceArray(arguments);
295
_59.splice(_59.length-1,0,"top");
296
AJS.setStyle.apply(null,_59);
297
},getElementsByTagAndClassName:function(_5a,_5b,_5c){
298
var _5d=[];
299
if(!AJS.isDefined(_5c)){
300
_5c=document;
301
}
302
if(!AJS.isDefined(_5a)){
303
_5a="*";
304
}
305
var els=_5c.getElementsByTagName(_5a);
306
var _5f=els.length;
307
var _60=new RegExp("(^|\\s)"+_5b+"(\\s|$)");
308
for(i=0,j=0;i<_5f;i++){
309
if(_60.test(els[i].className)||_5b==null){
310
_5d[j]=els[i];
311
j++;
312
}
313
}
314
return _5d;
315
},removeClass:function(){
316
var _61=AJS.forceArray(arguments);
317
var cls=_61.pop();
318
var _63=function(o){
319
o.className=o.className.replace(new RegExp("\\s?"+cls,"g"),"");
320
};
321
AJS.map(_61,function(elm){
322
_63(elm);
323
});
324
},bindMethods:function(_66){
325
for(var k in _66){
326
var _68=_66[k];
327
if(typeof (_68)=="function"){
328
_66[k]=AJS.$b(_68,_66);
329
}
330
}
331
},log:function(o){
332
if(AJS.isMozilla()){
333
console.log(o);
334
}else{
335
var div=AJS.DIV({"style":"color: green"});
336
AJS.ACN(AJS.getBody(),AJS.setHTML(div,""+o));
337
}
338
},isNumber:function(obj){
339
return (typeof obj=="number");
340
},map:function(_6c,fn,_6e,_6f){
341
var i=0,l=_6c.length;
342
if(_6e){
343
i=_6e;
344
}
345
if(_6f){
346
l=_6f;
347
}
348
for(i;i<l;i++){
349
fn.apply(null,[_6c[i],i]);
350
}
351
},removeEventListener:function(elm,_73,fn,_75){
352
if(!_75){
353
_75=false;
354
}
355
if(elm.removeEventListener){
356
elm.removeEventListener(_73,fn,_75);
357
if(AJS.isOpera()){
358
elm.removeEventListener(_73,fn,!_75);
359
}
360
}else{
361
if(elm.detachEvent){
362
elm.detachEvent("on"+_73,fn);
363
}
364
}
365
},getCssDim:function(dim){
366
if(AJS.isString(dim)){
367
return dim;
368
}else{
369
return dim+"px";
370
}
371
},setHTML:function(elm,_78){
372
elm.innerHTML=_78;
373
return elm;
374
},bind:function(fn,_7a,_7b,_7c,_7d){
375
fn._cscope=_7a;
376
return AJS._getRealScope(fn,_7b,_7c,_7d);
377
},forceArray:function(_7e){
378
var r=[];
379
AJS.map(_7e,function(elm){
380
r.push(elm);
381
});
382
return r;
383
},update:function(l1,l2){
384
for(var i in l2){
385
l1[i]=l2[i];
386
}
387
return l1;
388
},getBody:function(){
389
return AJS.$bytc("body")[0];
390
},HTML2DOM:function(_84,_85){
391
var d=AJS.DIV();
392
d.innerHTML=_84;
393
if(_85){
394
return d.childNodes[0];
395
}else{
396
return d;
397
}
398
},getElement:function(id){
399
if(AJS.isString(id)||AJS.isNumber(id)){
400
return document.getElementById(id);
401
}else{
402
return id;
403
}
404
},showElement:function(){
405
var _88=AJS.forceArray(arguments);
406
AJS.map(_88,function(elm){
407
elm.style.display="";
408
});
409
},swapDOM:function(_8a,src){
410
_8a=AJS.getElement(_8a);
411
var _8c=_8a.parentNode;
412
if(src){
413
src=AJS.getElement(src);
414
_8c.replaceChild(src,_8a);
415
}else{
416
_8c.removeChild(_8a);
417
}
418
return src;
419
},isIn:function(elm,_8e){
420
var i=AJS.getIndex(elm,_8e);
421
if(i!=-1){
422
return true;
423
}else{
424
return false;
425
}
426
}};
427
AJS.$=AJS.getElement;
428
AJS.$$=AJS.getElements;
429
AJS.$f=AJS.getFormElement;
430
AJS.$p=AJS.partial;
431
AJS.$b=AJS.bind;
432
AJS.$A=AJS.createArray;
433
AJS.DI=AJS.documentInsert;
434
AJS.ACN=AJS.appendChildNodes;
435
AJS.RCN=AJS.replaceChildNodes;
436
AJS.AEV=AJS.addEventListener;
437
AJS.REV=AJS.removeEventListener;
438
AJS.$bytc=AJS.getElementsByTagAndClassName;
439
AJS.addEventListener(window,"unload",AJS._unloadListeners);
440
AJS._createDomShortcuts();
441
AJS.Class=function(_90){
442
var fn=function(){
443
if(arguments[0]!="no_init"){
444
return this.init.apply(this,arguments);
445
}
446
};
447
fn.prototype=_90;
448
AJS.update(fn,AJS.Class.prototype);
449
return fn;
450
};
451
AJS.Class.prototype={extend:function(_92){
452
var _93=new this("no_init");
453
for(k in _92){
454
var _94=_93[k];
455
var cur=_92[k];
456
if(_94&&_94!=cur&&typeof cur=="function"){
457
cur=this._parentize(cur,_94);
458
}
459
_93[k]=cur;
460
}
461
return new AJS.Class(_93);
462
},implement:function(_96){
463
AJS.update(this.prototype,_96);
464
},_parentize:function(cur,_98){
465
return function(){
466
this.parent=_98;
467
return cur.apply(this,arguments);
468
};
469
}};
470
AJS.$=AJS.getElement;
471
AJS.$$=AJS.getElements;
472
AJS.$f=AJS.getFormElement;
473
AJS.$b=AJS.bind;
474
AJS.$p=AJS.partial;
475
AJS.$FA=AJS.forceArray;
476
AJS.$A=AJS.createArray;
477
AJS.DI=AJS.documentInsert;
478
AJS.ACN=AJS.appendChildNodes;
479
AJS.RCN=AJS.replaceChildNodes;
480
AJS.AEV=AJS.addEventListener;
481
AJS.REV=AJS.removeEventListener;
482
AJS.$bytc=AJS.getElementsByTagAndClassName;
483
AJSDeferred=function(req){
484
this.callbacks=[];
485
this.errbacks=[];
486
this.req=req;
487
};
488
AJSDeferred.prototype={excCallbackSeq:function(req,_9b){
489
var _9c=req.responseText;
490
while(_9b.length>0){
491
var fn=_9b.pop();
492
var _9e=fn(_9c,req);
493
if(_9e){
494
_9c=_9e;
495
}
496
}
497
},callback:function(){
498
this.excCallbackSeq(this.req,this.callbacks);
499
},errback:function(){
500
if(this.errbacks.length==0){
501
alert("Error encountered:\n"+this.req.responseText);
502
}
503
this.excCallbackSeq(this.req,this.errbacks);
504
},addErrback:function(fn){
505
this.errbacks.unshift(fn);
506
},addCallback:function(fn){
507
this.callbacks.unshift(fn);
508
},addCallbacks:function(fn1,fn2){
509
this.addCallback(fn1);
510
this.addErrback(fn2);
511
},sendReq:function(_a3){
512
if(AJS.isObject(_a3)){
513
this.req.send(AJS.queryArguments(_a3));
514
}else{
515
if(AJS.isDefined(_a3)){
516
this.req.send(_a3);
517
}else{
518
this.req.send("");
519
}
520
}
521
}};
522
script_loaded=true;
523
524
525
script_loaded=true;
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/AJS_fx.js (+136 lines)
Line 0 Link Here
1
AJS.fx={_shades:{0:"ffffff",1:"ffffee",2:"ffffdd",3:"ffffcc",4:"ffffbb",5:"ffffaa",6:"ffff99"},highlight:function(_1,_2){
2
var _3=new AJS.fx.Base();
3
_3.elm=AJS.$(_1);
4
_3.setOptions(_2);
5
_3.options.duration=600;
6
AJS.update(_3,{increase:function(){
7
if(this.now==7){
8
_1.style.backgroundColor="transparent";
9
}else{
10
_1.style.backgroundColor="#"+AJS.fx._shades[Math.floor(this.now)];
11
}
12
}});
13
return _3.custom(6,0);
14
},fadeIn:function(_4,_5){
15
_5=_5||{};
16
if(!_5.from){
17
_5.from=0;
18
AJS.setOpacity(_4,0);
19
}
20
if(!_5.to){
21
_5.to=1;
22
}
23
var s=new AJS.fx.Style(_4,"opacity",_5);
24
return s.custom(_5.from,_5.to);
25
},fadeOut:function(_7,_8){
26
_8=_8||{};
27
if(!_8.from){
28
_8.from=1;
29
}
30
if(!_8.to){
31
_8.to=0;
32
}
33
_8.duration=300;
34
var s=new AJS.fx.Style(_7,"opacity",_8);
35
return s.custom(_8.from,_8.to);
36
},setWidth:function(_a,_b){
37
var s=new AJS.fx.Style(_a,"width",_b);
38
return s.custom(_b.from,_b.to);
39
},setHeight:function(_d,_e){
40
var s=new AJS.fx.Style(_d,"height",_e);
41
return s.custom(_e.from,_e.to);
42
}};
43
AJS.fx.Base=new AJS.Class({init:function(){
44
AJS.bindMethods(this);
45
},setOptions:function(_10){
46
this.options=AJS.update({onStart:function(){
47
},onComplete:function(){
48
},transition:AJS.fx.Transitions.sineInOut,duration:500,wait:true,fps:50},_10||{});
49
},step:function(){
50
var _11=new Date().getTime();
51
if(_11<this.time+this.options.duration){
52
this.cTime=_11-this.time;
53
this.setNow();
54
}else{
55
setTimeout(AJS.$b(this.options.onComplete,this,[this.elm]),10);
56
this.clearTimer();
57
this.now=this.to;
58
}
59
this.increase();
60
},setNow:function(){
61
this.now=this.compute(this.from,this.to);
62
},compute:function(_12,to){
63
var _14=to-_12;
64
return this.options.transition(this.cTime,_12,_14,this.options.duration);
65
},clearTimer:function(){
66
clearInterval(this.timer);
67
this.timer=null;
68
return this;
69
},_start:function(_15,to){
70
if(!this.options.wait){
71
this.clearTimer();
72
}
73
if(this.timer){
74
return;
75
}
76
setTimeout(AJS.$p(this.options.onStart,this.elm),10);
77
this.from=_15;
78
this.to=to;
79
this.time=new Date().getTime();
80
this.timer=setInterval(this.step,Math.round(1000/this.options.fps));
81
return this;
82
},custom:function(_17,to){
83
return this._start(_17,to);
84
},set:function(to){
85
this.now=to;
86
this.increase();
87
return this;
88
},setStyle:function(elm,_1b,val){
89
if(this.property=="opacity"){
90
AJS.setOpacity(elm,val);
91
}else{
92
AJS.setStyle(elm,_1b,val);
93
}
94
}});
95
AJS.fx.Style=AJS.fx.Base.extend({init:function(elm,_1e,_1f){
96
this.parent();
97
this.elm=elm;
98
this.setOptions(_1f);
99
this.property=_1e;
100
},increase:function(){
101
this.setStyle(this.elm,this.property,this.now);
102
}});
103
AJS.fx.Styles=AJS.fx.Base.extend({init:function(elm,_21){
104
this.parent();
105
this.elm=AJS.$(elm);
106
this.setOptions(_21);
107
this.now={};
108
},setNow:function(){
109
for(p in this.from){
110
this.now[p]=this.compute(this.from[p],this.to[p]);
111
}
112
},custom:function(obj){
113
if(this.timer&&this.options.wait){
114
return;
115
}
116
var _23={};
117
var to={};
118
for(p in obj){
119
_23[p]=obj[p][0];
120
to[p]=obj[p][1];
121
}
122
return this._start(_23,to);
123
},increase:function(){
124
for(var p in this.now){
125
this.setStyle(this.elm,p,this.now[p]);
126
}
127
}});
128
AJS.fx.Transitions={linear:function(t,b,c,d){
129
return c*t/d+b;
130
},sineInOut:function(t,b,c,d){
131
return -c/2*(Math.cos(Math.PI*t/d)-1)+b;
132
}};
133
script_loaded=true;
134
135
136
script_loaded=true;
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/LGPL.txt (+502 lines)
Line 0 Link Here
1
                  GNU LESSER GENERAL PUBLIC LICENSE
2
                   Version 2.1, February 1999
3
4
 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5
     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
6
 Everyone is permitted to copy and distribute verbatim copies
7
 of this license document, but changing it is not allowed.
8
9
[This is the first released version of the Lesser GPL.  It also counts
10
 as the successor of the GNU Library Public License, version 2, hence
11
 the version number 2.1.]
12
13
                        Preamble
14
15
  The licenses for most software are designed to take away your
16
freedom to share and change it.  By contrast, the GNU General Public
17
Licenses are intended to guarantee your freedom to share and change
18
free software--to make sure the software is free for all its users.
19
20
  This license, the Lesser General Public License, applies to some
21
specially designated software packages--typically libraries--of the
22
Free Software Foundation and other authors who decide to use it.  You
23
can use it too, but we suggest you first think carefully about whether
24
this license or the ordinary General Public License is the better
25
strategy to use in any particular case, based on the explanations below.
26
27
  When we speak of free software, we are referring to freedom of use,
28
not price.  Our General Public Licenses are designed to make sure that
29
you have the freedom to distribute copies of free software (and charge
30
for this service if you wish); that you receive source code or can get
31
it if you want it; that you can change the software and use pieces of
32
it in new free programs; and that you are informed that you can do
33
these things.
34
35
  To protect your rights, we need to make restrictions that forbid
36
distributors to deny you these rights or to ask you to surrender these
37
rights.  These restrictions translate to certain responsibilities for
38
you if you distribute copies of the library or if you modify it.
39
40
  For example, if you distribute copies of the library, whether gratis
41
or for a fee, you must give the recipients all the rights that we gave
42
you.  You must make sure that they, too, receive or can get the source
43
code.  If you link other code with the library, you must provide
44
complete object files to the recipients, so that they can relink them
45
with the library after making changes to the library and recompiling
46
it.  And you must show them these terms so they know their rights.
47
48
  We protect your rights with a two-step method: (1) we copyright the
49
library, and (2) we offer you this license, which gives you legal
50
permission to copy, distribute and/or modify the library.
51
52
  To protect each distributor, we want to make it very clear that
53
there is no warranty for the free library.  Also, if the library is
54
modified by someone else and passed on, the recipients should know
55
that what they have is not the original version, so that the original
56
author's reputation will not be affected by problems that might be
57
introduced by others.
58
59
  Finally, software patents pose a constant threat to the existence of
60
any free program.  We wish to make sure that a company cannot
61
effectively restrict the users of a free program by obtaining a
62
restrictive license from a patent holder.  Therefore, we insist that
63
any patent license obtained for a version of the library must be
64
consistent with the full freedom of use specified in this license.
65
66
  Most GNU software, including some libraries, is covered by the
67
ordinary GNU General Public License.  This license, the GNU Lesser
68
General Public License, applies to certain designated libraries, and
69
is quite different from the ordinary General Public License.  We use
70
this license for certain libraries in order to permit linking those
71
libraries into non-free programs.
72
73
  When a program is linked with a library, whether statically or using
74
a shared library, the combination of the two is legally speaking a
75
combined work, a derivative of the original library.  The ordinary
76
General Public License therefore permits such linking only if the
77
entire combination fits its criteria of freedom.  The Lesser General
78
Public License permits more lax criteria for linking other code with
79
the library.
80
81
  We call this license the "Lesser" General Public License because it
82
does Less to protect the user's freedom than the ordinary General
83
Public License.  It also provides other free software developers Less
84
of an advantage over competing non-free programs.  These disadvantages
85
are the reason we use the ordinary General Public License for many
86
libraries.  However, the Lesser license provides advantages in certain
87
special circumstances.
88
89
  For example, on rare occasions, there may be a special need to
90
encourage the widest possible use of a certain library, so that it becomes
91
a de-facto standard.  To achieve this, non-free programs must be
92
allowed to use the library.  A more frequent case is that a free
93
library does the same job as widely used non-free libraries.  In this
94
case, there is little to gain by limiting the free library to free
95
software only, so we use the Lesser General Public License.
96
97
  In other cases, permission to use a particular library in non-free
98
programs enables a greater number of people to use a large body of
99
free software.  For example, permission to use the GNU C Library in
100
non-free programs enables many more people to use the whole GNU
101
operating system, as well as its variant, the GNU/Linux operating
102
system.
103
104
  Although the Lesser General Public License is Less protective of the
105
users' freedom, it does ensure that the user of a program that is
106
linked with the Library has the freedom and the wherewithal to run
107
that program using a modified version of the Library.
108
109
  The precise terms and conditions for copying, distribution and
110
modification follow.  Pay close attention to the difference between a
111
"work based on the library" and a "work that uses the library".  The
112
former contains code derived from the library, whereas the latter must
113
be combined with the library in order to run.
114
115
            GNU LESSER GENERAL PUBLIC LICENSE
116
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
118
  0. This License Agreement applies to any software library or other
119
program which contains a notice placed by the copyright holder or
120
other authorized party saying it may be distributed under the terms of
121
this Lesser General Public License (also called "this License").
122
Each licensee is addressed as "you".
123
124
  A "library" means a collection of software functions and/or data
125
prepared so as to be conveniently linked with application programs
126
(which use some of those functions and data) to form executables.
127
128
  The "Library", below, refers to any such software library or work
129
which has been distributed under these terms.  A "work based on the
130
Library" means either the Library or any derivative work under
131
copyright law: that is to say, a work containing the Library or a
132
portion of it, either verbatim or with modifications and/or translated
133
straightforwardly into another language.  (Hereinafter, translation is
134
included without limitation in the term "modification".)
135
136
  "Source code" for a work means the preferred form of the work for
137
making modifications to it.  For a library, complete source code means
138
all the source code for all modules it contains, plus any associated
139
interface definition files, plus the scripts used to control compilation
140
and installation of the library.
141
142
  Activities other than copying, distribution and modification are not
143
covered by this License; they are outside its scope.  The act of
144
running a program using the Library is not restricted, and output from
145
such a program is covered only if its contents constitute a work based
146
on the Library (independent of the use of the Library in a tool for
147
writing it).  Whether that is true depends on what the Library does
148
and what the program that uses the Library does.
149
150
  1. You may copy and distribute verbatim copies of the Library's
151
complete source code as you receive it, in any medium, provided that
152
you conspicuously and appropriately publish on each copy an
153
appropriate copyright notice and disclaimer of warranty; keep intact
154
all the notices that refer to this License and to the absence of any
155
warranty; and distribute a copy of this License along with the
156
Library.
157
158
  You may charge a fee for the physical act of transferring a copy,
159
and you may at your option offer warranty protection in exchange for a
160
fee.
161
162
  2. You may modify your copy or copies of the Library or any portion
163
of it, thus forming a work based on the Library, and copy and
164
distribute such modifications or work under the terms of Section 1
165
above, provided that you also meet all of these conditions:
166
167
    a) The modified work must itself be a software library.
168
169
    b) You must cause the files modified to carry prominent notices
170
    stating that you changed the files and the date of any change.
171
172
    c) You must cause the whole of the work to be licensed at no
173
    charge to all third parties under the terms of this License.
174
175
    d) If a facility in the modified Library refers to a function or a
176
    table of data to be supplied by an application program that uses
177
    the facility, other than as an argument passed when the facility
178
    is invoked, then you must make a good faith effort to ensure that,
179
    in the event an application does not supply such function or
180
    table, the facility still operates, and performs whatever part of
181
    its purpose remains meaningful.
182
183
    (For example, a function in a library to compute square roots has
184
    a purpose that is entirely well-defined independent of the
185
    application.  Therefore, Subsection 2d requires that any
186
    application-supplied function or table used by this function must
187
    be optional: if the application does not supply it, the square
188
    root function must still compute square roots.)
189
190
These requirements apply to the modified work as a whole.  If
191
identifiable sections of that work are not derived from the Library,
192
and can be reasonably considered independent and separate works in
193
themselves, then this License, and its terms, do not apply to those
194
sections when you distribute them as separate works.  But when you
195
distribute the same sections as part of a whole which is a work based
196
on the Library, the distribution of the whole must be on the terms of
197
this License, whose permissions for other licensees extend to the
198
entire whole, and thus to each and every part regardless of who wrote
199
it.
200
201
Thus, it is not the intent of this section to claim rights or contest
202
your rights to work written entirely by you; rather, the intent is to
203
exercise the right to control the distribution of derivative or
204
collective works based on the Library.
205
206
In addition, mere aggregation of another work not based on the Library
207
with the Library (or with a work based on the Library) on a volume of
208
a storage or distribution medium does not bring the other work under
209
the scope of this License.
210
211
  3. You may opt to apply the terms of the ordinary GNU General Public
212
License instead of this License to a given copy of the Library.  To do
213
this, you must alter all the notices that refer to this License, so
214
that they refer to the ordinary GNU General Public License, version 2,
215
instead of to this License.  (If a newer version than version 2 of the
216
ordinary GNU General Public License has appeared, then you can specify
217
that version instead if you wish.)  Do not make any other change in
218
these notices.
219
220
  Once this change is made in a given copy, it is irreversible for
221
that copy, so the ordinary GNU General Public License applies to all
222
subsequent copies and derivative works made from that copy.
223
224
  This option is useful when you wish to copy part of the code of
225
the Library into a program that is not a library.
226
227
  4. You may copy and distribute the Library (or a portion or
228
derivative of it, under Section 2) in object code or executable form
229
under the terms of Sections 1 and 2 above provided that you accompany
230
it with the complete corresponding machine-readable source code, which
231
must be distributed under the terms of Sections 1 and 2 above on a
232
medium customarily used for software interchange.
233
234
  If distribution of object code is made by offering access to copy
235
from a designated place, then offering equivalent access to copy the
236
source code from the same place satisfies the requirement to
237
distribute the source code, even though third parties are not
238
compelled to copy the source along with the object code.
239
240
  5. A program that contains no derivative of any portion of the
241
Library, but is designed to work with the Library by being compiled or
242
linked with it, is called a "work that uses the Library".  Such a
243
work, in isolation, is not a derivative work of the Library, and
244
therefore falls outside the scope of this License.
245
246
  However, linking a "work that uses the Library" with the Library
247
creates an executable that is a derivative of the Library (because it
248
contains portions of the Library), rather than a "work that uses the
249
library".  The executable is therefore covered by this License.
250
Section 6 states terms for distribution of such executables.
251
252
  When a "work that uses the Library" uses material from a header file
253
that is part of the Library, the object code for the work may be a
254
derivative work of the Library even though the source code is not.
255
Whether this is true is especially significant if the work can be
256
linked without the Library, or if the work is itself a library.  The
257
threshold for this to be true is not precisely defined by law.
258
259
  If such an object file uses only numerical parameters, data
260
structure layouts and accessors, and small macros and small inline
261
functions (ten lines or less in length), then the use of the object
262
file is unrestricted, regardless of whether it is legally a derivative
263
work.  (Executables containing this object code plus portions of the
264
Library will still fall under Section 6.)
265
266
  Otherwise, if the work is a derivative of the Library, you may
267
distribute the object code for the work under the terms of Section 6.
268
Any executables containing that work also fall under Section 6,
269
whether or not they are linked directly with the Library itself.
270
271
  6. As an exception to the Sections above, you may also combine or
272
link a "work that uses the Library" with the Library to produce a
273
work containing portions of the Library, and distribute that work
274
under terms of your choice, provided that the terms permit
275
modification of the work for the customer's own use and reverse
276
engineering for debugging such modifications.
277
278
  You must give prominent notice with each copy of the work that the
279
Library is used in it and that the Library and its use are covered by
280
this License.  You must supply a copy of this License.  If the work
281
during execution displays copyright notices, you must include the
282
copyright notice for the Library among them, as well as a reference
283
directing the user to the copy of this License.  Also, you must do one
284
of these things:
285
286
    a) Accompany the work with the complete corresponding
287
    machine-readable source code for the Library including whatever
288
    changes were used in the work (which must be distributed under
289
    Sections 1 and 2 above); and, if the work is an executable linked
290
    with the Library, with the complete machine-readable "work that
291
    uses the Library", as object code and/or source code, so that the
292
    user can modify the Library and then relink to produce a modified
293
    executable containing the modified Library.  (It is understood
294
    that the user who changes the contents of definitions files in the
295
    Library will not necessarily be able to recompile the application
296
    to use the modified definitions.)
297
298
    b) Use a suitable shared library mechanism for linking with the
299
    Library.  A suitable mechanism is one that (1) uses at run time a
300
    copy of the library already present on the user's computer system,
301
    rather than copying library functions into the executable, and (2)
302
    will operate properly with a modified version of the library, if
303
    the user installs one, as long as the modified version is
304
    interface-compatible with the version that the work was made with.
305
306
    c) Accompany the work with a written offer, valid for at
307
    least three years, to give the same user the materials
308
    specified in Subsection 6a, above, for a charge no more
309
    than the cost of performing this distribution.
310
311
    d) If distribution of the work is made by offering access to copy
312
    from a designated place, offer equivalent access to copy the above
313
    specified materials from the same place.
314
315
    e) Verify that the user has already received a copy of these
316
    materials or that you have already sent this user a copy.
317
318
  For an executable, the required form of the "work that uses the
319
Library" must include any data and utility programs needed for
320
reproducing the executable from it.  However, as a special exception,
321
the materials to be distributed need not include anything that is
322
normally distributed (in either source or binary form) with the major
323
components (compiler, kernel, and so on) of the operating system on
324
which the executable runs, unless that component itself accompanies
325
the executable.
326
327
  It may happen that this requirement contradicts the license
328
restrictions of other proprietary libraries that do not normally
329
accompany the operating system.  Such a contradiction means you cannot
330
use both them and the Library together in an executable that you
331
distribute.
332
333
  7. You may place library facilities that are a work based on the
334
Library side-by-side in a single library together with other library
335
facilities not covered by this License, and distribute such a combined
336
library, provided that the separate distribution of the work based on
337
the Library and of the other library facilities is otherwise
338
permitted, and provided that you do these two things:
339
340
    a) Accompany the combined library with a copy of the same work
341
    based on the Library, uncombined with any other library
342
    facilities.  This must be distributed under the terms of the
343
    Sections above.
344
345
    b) Give prominent notice with the combined library of the fact
346
    that part of it is a work based on the Library, and explaining
347
    where to find the accompanying uncombined form of the same work.
348
349
  8. You may not copy, modify, sublicense, link with, or distribute
350
the Library except as expressly provided under this License.  Any
351
attempt otherwise to copy, modify, sublicense, link with, or
352
distribute the Library is void, and will automatically terminate your
353
rights under this License.  However, parties who have received copies,
354
or rights, from you under this License will not have their licenses
355
terminated so long as such parties remain in full compliance.
356
357
  9. You are not required to accept this License, since you have not
358
signed it.  However, nothing else grants you permission to modify or
359
distribute the Library or its derivative works.  These actions are
360
prohibited by law if you do not accept this License.  Therefore, by
361
modifying or distributing the Library (or any work based on the
362
Library), you indicate your acceptance of this License to do so, and
363
all its terms and conditions for copying, distributing or modifying
364
the Library or works based on it.
365
366
  10. Each time you redistribute the Library (or any work based on the
367
Library), the recipient automatically receives a license from the
368
original licensor to copy, distribute, link with or modify the Library
369
subject to these terms and conditions.  You may not impose any further
370
restrictions on the recipients' exercise of the rights granted herein.
371
You are not responsible for enforcing compliance by third parties with
372
this License.
373
374
  11. If, as a consequence of a court judgment or allegation of patent
375
infringement or for any other reason (not limited to patent issues),
376
conditions are imposed on you (whether by court order, agreement or
377
otherwise) that contradict the conditions of this License, they do not
378
excuse you from the conditions of this License.  If you cannot
379
distribute so as to satisfy simultaneously your obligations under this
380
License and any other pertinent obligations, then as a consequence you
381
may not distribute the Library at all.  For example, if a patent
382
license would not permit royalty-free redistribution of the Library by
383
all those who receive copies directly or indirectly through you, then
384
the only way you could satisfy both it and this License would be to
385
refrain entirely from distribution of the Library.
386
387
If any portion of this section is held invalid or unenforceable under any
388
particular circumstance, the balance of the section is intended to apply,
389
and the section as a whole is intended to apply in other circumstances.
390
391
It is not the purpose of this section to induce you to infringe any
392
patents or other property right claims or to contest validity of any
393
such claims; this section has the sole purpose of protecting the
394
integrity of the free software distribution system which is
395
implemented by public license practices.  Many people have made
396
generous contributions to the wide range of software distributed
397
through that system in reliance on consistent application of that
398
system; it is up to the author/donor to decide if he or she is willing
399
to distribute software through any other system and a licensee cannot
400
impose that choice.
401
402
This section is intended to make thoroughly clear what is believed to
403
be a consequence of the rest of this License.
404
405
  12. If the distribution and/or use of the Library is restricted in
406
certain countries either by patents or by copyrighted interfaces, the
407
original copyright holder who places the Library under this License may add
408
an explicit geographical distribution limitation excluding those countries,
409
so that distribution is permitted only in or among countries not thus
410
excluded.  In such case, this License incorporates the limitation as if
411
written in the body of this License.
412
413
  13. The Free Software Foundation may publish revised and/or new
414
versions of the Lesser General Public License from time to time.
415
Such new versions will be similar in spirit to the present version,
416
but may differ in detail to address new problems or concerns.
417
418
Each version is given a distinguishing version number.  If the Library
419
specifies a version number of this License which applies to it and
420
"any later version", you have the option of following the terms and
421
conditions either of that version or of any later version published by
422
the Free Software Foundation.  If the Library does not specify a
423
license version number, you may choose any version ever published by
424
the Free Software Foundation.
425
426
  14. If you wish to incorporate parts of the Library into other free
427
programs whose distribution conditions are incompatible with these,
428
write to the author to ask for permission.  For software which is
429
copyrighted by the Free Software Foundation, write to the Free
430
Software Foundation; we sometimes make exceptions for this.  Our
431
decision will be guided by the two goals of preserving the free status
432
of all derivatives of our free software and of promoting the sharing
433
and reuse of software generally.
434
435
                          NO WARRANTY
436
437
  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444
LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
447
  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456
DAMAGES.
457
458
                END OF TERMS AND CONDITIONS
459
460
           How to Apply These Terms to Your New Libraries
461
462
  If you develop a new library, and you want it to be of the greatest
463
possible use to the public, we recommend making it free software that
464
everyone can redistribute and change.  You can do so by permitting
465
redistribution under these terms (or, alternatively, under the terms of the
466
ordinary General Public License).
467
468
  To apply these terms, attach the following notices to the library.  It is
469
safest to attach them to the start of each source file to most effectively
470
convey the exclusion of warranty; and each file should have at least the
471
"copyright" line and a pointer to where the full notice is found.
472
473
    <one line to give the library's name and a brief idea of what it does.>
474
    Copyright (C) <year>  <name of author>
475
476
    This library is free software; you can redistribute it and/or
477
    modify it under the terms of the GNU Lesser General Public
478
    License as published by the Free Software Foundation; either
479
    version 2.1 of the License, or (at your option) any later version.
480
481
    This library is distributed in the hope that it will be useful,
482
    but WITHOUT ANY WARRANTY; without even the implied warranty of
483
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
484
    Lesser General Public License for more details.
485
486
    You should have received a copy of the GNU Lesser General Public
487
    License along with this library; if not, write to the Free Software
488
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
489
490
Also add information on how to contact you by electronic and paper mail.
491
492
You should also get your employer (if you work as a programmer) or your
493
school, if any, to sign a "copyright disclaimer" for the library, if
494
necessary.  Here is a sample; alter the names:
495
496
  Yoyodyne, Inc., hereby disclaims all copyright interest in the
497
  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
499
  <signature of Ty Coon>, 1 April 1990
500
  Ty Coon, President of Vice
501
502
That's all there is to it!
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/about.html (+50 lines)
Line 0 Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
    <title>GreyBox - About</title>
5
6
    <script type="text/javascript">
7
        var GB_ROOT_DIR = "./greybox/";
8
    </script>
9
10
    <script type="text/javascript" src="greybox/AJS.js"></script>
11
    <script type="text/javascript" src="greybox/AJS_fx.js"></script>
12
    <script type="text/javascript" src="greybox/gb_scripts.js"></script>
13
    <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
14
15
    <script type="text/javascript" src="static_files/help.js"></script>
16
    <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
17
</head>
18
19
<body>
20
21
<script>
22
    insertHeader();
23
    insertMenu('about');
24
</script>
25
26
<p>
27
GreyBox is copyrighted work by <a href="http://amix.dk/">Amir Salihefendic</a>.
28
</p>
29
30
<p>
31
It is based on <a href="http://orangoo.com/labs/AJS/">AJS</a> JavaScript library.
32
</p>
33
34
<p>
35
It is realesed under <a href="LGPL.txt">LGPL</a>.
36
</p>
37
38
<h3>Links</h3>
39
<ul>
40
    <li> <a href="http://orangoo.com/labs/GreyBox/">GreyBox official site</a> </li>
41
</ul>
42
43
<h3>Need help?</h3>
44
<ul>
45
    <li><a href="http://groups.google.com/group/greybox">GreyBox Google group</a> - A group where you can ask questions and get answers</li>
46
    <li><a href="http://orangoo.com/labs/GreyBox/FAQ/">GreyBox FAQ</a> -Frequently Asked Questions about GreyBox</li>
47
</ul>
48
49
</body>
50
</html>
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/advance_usage.html (+182 lines)
Line 0 Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
    <title>GreyBox - Advance usage</title>
5
6
    <script type="text/javascript">
7
        var GB_ROOT_DIR = "./greybox/";
8
    </script>
9
10
    <script type="text/javascript" src="greybox/AJS.js"></script>
11
    <script type="text/javascript" src="greybox/AJS_fx.js"></script>
12
    <script type="text/javascript" src="greybox/gb_scripts.js"></script>
13
    <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
14
15
    <script type="text/javascript" src="static_files/help.js"></script>
16
    <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
17
</head>
18
<body>
19
20
<script>
21
insertHeader();
22
insertMenu('adv_usage');
23
</script>
24
25
<h2>Methods for showing windows</h2>
26
27
<h3 class="first">GB_show</h3>
28
29
<h4>Signature:</h4>
30
<script>
31
insertCode(
32
    'GB_show(caption, url, /*optional*/ height, width, callback_fn)'
33
);
34
</script>
35
36
<h4>Example:</h4>
37
<script>
38
insertCode(
39
    '<a href="http://google.com/" onclick="return GB_show(\'Google\', this.href)">Visit Google</a>'
40
);
41
</script>
42
43
<h4>Example rendered:</h4>
44
<a href="http://google.com/" onclick="return GB_show('Google', this.href)">Visit Google</a>
45
46
47
<h3>GB_showCenter</h3>
48
49
<h4>Signature:</h4>
50
<script>
51
insertCode(
52
    'GB_showCenter(caption, url, /* optional */ height, width, callback_fn)'
53
);
54
</script>
55
56
<h4>Example:</h4>
57
<script>
58
insertCode(
59
    '<a href="http://google.com/" onclick="return GB_showCenter(\'Google\', this.href)">Visit Google</a>'
60
);
61
</script>
62
63
<h4>Example rendered:</h4>
64
<a href="http://google.com/" onclick="return GB_showCenter('Google', this.href)">Visit Google</a>
65
66
67
<h3>GB_showFullScreen</h3>
68
69
<h4>Signature:</h4>
70
<script>
71
insertCode(
72
    'GB_showFullScreen(caption, url, callback_fn)'
73
);
74
</script>
75
76
<h4>Example:</h4>
77
<script>
78
insertCode(
79
    '<a href="http://google.com/" onclick="return GB_showFullScreen(\'Google\', this.href)">Visit Google</a>'
80
);
81
</script>
82
83
<h4>Example rendered:</h4>
84
<a href="http://google.com/" onclick="return GB_showFullScreen('Google', this.href)">Visit Google</a>
85
86
<h2>Methods for showing overlays</h2>
87
88
<h3 class="first">GB_showImage</h3>
89
<h4>Signature:</h4>
90
<script>
91
insertCode(
92
    'GB_showImage(caption, url, callback_fn)'
93
);
94
</script>
95
96
<h4>Example:</h4>
97
<script>
98
insertCode(
99
        '<a href="http://static.flickr.com/119/294309231_a3d2a339b9.jpg"\n'+
100
        'onclick="return GB_showImage(\'Flower\', this.href)">A flower in my hand</a>'
101
);
102
</script>
103
104
<h4>Example rendered:</h4>
105
<a href="http://static.flickr.com/119/294309231_a3d2a339b9.jpg" onclick="return GB_showImage('Flower', this.href)">A flower in my hand</a>
106
107
<h3>GB_showPage</h3>
108
<h4>Signature:</h4>
109
<script>
110
insertCode(
111
    'GB_showPage(caption, url, callback_fn)'
112
);
113
</script>
114
115
<h4>Example:</h4>
116
<script>
117
insertCode(
118
    '<a href="http://google.com" onclick="return GB_showPage(\'Google\', this.href)">Show Google in another layout</a>'
119
);
120
</script>
121
122
<h4>Example rendered:</h4>
123
<a href="http://google.com" onclick="return GB_showPage('Google', this.href)">Show Google in another layout</a>
124
125
126
<h2>Methods for showing sets</h2>
127
128
<h3 class="first">GB_showFullScreenSet</h3>
129
<h4>Signature:</h4>
130
<script>
131
insertCode(
132
    'GB_showFullScreenSet(set, start_index, callback_fn)'
133
);
134
</script>
135
136
<h4>Example:</h4>
137
<script>
138
insertCode(
139
    "<script>",
140
    "var page_set = [{'caption': 'Google', 'url': 'http://google.com/'},",
141
    "    {'caption': 'Yahoo', 'url': 'http://yahoo.com/'}];",
142
    "<\/script>",
143
    '<a href="#" onclick="return GB_showFullScreenSet(page_set, 1)">Show first page in page_set</a>'
144
);
145
</script>
146
147
<h4>Example rendered:</h4>
148
<script>
149
var page_set = [{'caption': 'Google', 'url': 'http://google.com/'},
150
    {'caption': 'Yahoo', 'url': 'http://yahoo.com/'}];
151
</script>
152
<a href="#" onclick="return GB_showFullScreenSet(page_set, 1)">Show first page in page_set</a>
153
154
<h3>GB_showImageSet</h3>
155
<h4>Signature:</h4>
156
<script>
157
insertCode(
158
    'GB_showImageSet(set, start_index, callback_fn)'
159
);
160
</script>
161
162
<h4>Example:</h4>
163
<script>
164
insertCode(
165
    "<script>",
166
    "var image_set = [{'caption': 'Flower', 'url': 'http://static.flickr.com/119/294309231_a3d2a339b9.jpg'},",
167
    "    {'caption': 'Nice waterfall', 'url': 'http://www.widerange.org/images/large/plitvicka.jpg'}];",
168
    "<\/script>",
169
    '<a href="#" onclick="return GB_showImageSet(image_set, 1)">Show first picture in image_set</a>'
170
);
171
</script>
172
173
<h4>Example rendered:</h4>
174
<script>
175
var image_set = [{'caption': 'Flower', 'url': 'http://static.flickr.com/119/294309231_a3d2a339b9.jpg'},
176
    {'caption': 'Nice waterfall', 'url': 'http://www.widerange.org/images/large/plitvicka.jpg'}];
177
</script>
178
<a href="#" onclick="return GB_showImageSet(image_set, 1)">Show first picture in image_set</a>
179
180
181
</body>
182
</html>
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/combiner.py (+134 lines)
Line 0 Link Here
1
#!/usr/bin/env python
2
"""
3
Used to combine the different parts of GreyBox.
4
- Python 2.4 required
5
- Java 1.4+ required
6
- Dojo's JavaScript compressor (http://dojotoolkit.org/docs/compressor_system.html). Place it under compression_lib/custom_rhino.jar
7
"""
8
import os, sys, shutil
9
from compression_lib import AJS_minify
10
11
12
if __name__ == '__main__':
13
    args = sys.argv
14
15
    if len(args) < 2:
16
        print """
17
Usage is:
18
    python combiner.py [full|gallery|window]
19
Example usage:
20
    python combiner.py full
21
The files will be store in greybox_dist/* depending on the dist. type
22
"""
23
        sys.exit(0)
24
25
    type = args[1]
26
    output_dir = 'greybox'
27
28
    ##
29
    # Config file list
30
    #
31
    js = []
32
    css = []
33
    static = []
34
35
    append = lambda l, x: l.append('greybox_source/%s' % x)
36
37
    def appendBase():
38
        append(js, 'base/base.js')
39
        append(js, 'auto_deco.js')
40
        append(css, 'base/base.css')
41
        append(static, 'base/indicator.gif')
42
        append(static, 'base/loader_frame.html')
43
44
    def appendSet():
45
        append(js, 'set/set.js')
46
        append(css, 'set/set.css')
47
        append(static, 'set/next.gif')
48
        append(static, 'set/prev.gif')
49
50
    def appendGallery():
51
        append(js, 'gallery/gallery.js')
52
        append(css, 'gallery/gallery.css')
53
        append(static, 'gallery/g_close.gif')
54
55
    def appendWindow():
56
        append(js, 'window/window.js')
57
        append(css, 'window/window.css')
58
        append(static, 'window/header_bg.gif')
59
        append(static, 'window/w_close.gif')
60
61
    appendBase()
62
63
    if type == 'full':
64
        appendGallery()
65
        appendSet()
66
        appendWindow()
67
    elif type == 'gallery':
68
        appendGallery()
69
        appendSet()
70
    elif type == 'window':
71
        appendWindow()
72
    else:
73
        sys.exit('Uknown type')
74
75
    print 'Follwoing styles are used:'
76
    for style in css:
77
        print '   %s' % style
78
79
    print 'Follwoing JavaScript is used:'
80
    for script in js:
81
        print '   %s' % script
82
83
    ##
84
    # Copy the files
85
    #
86
    try:
87
        shutil.rmtree(output_dir)
88
    except:
89
        pass
90
    os.mkdir(output_dir)
91
92
    def concatFiles(f_list):
93
        data = []
94
        for f in f_list:
95
            data.append(open(f, 'r').read())
96
        return '\n\n'.join(data)
97
98
    def copyFiles(f_list):
99
        for f in f_list:
100
            shutil.copy(f, output_dir)
101
102
    copyFiles(static)
103
    fp = open('%s/%s' % (output_dir, 'gb_styles.css'), 'w')
104
    fp.write(concatFiles(css))
105
    fp.close()
106
    print 'Compressed styles in %s' % ('greybox/gb_styles.css')
107
108
    ##
109
    # Concat js
110
    #
111
    fp = open('%s/%s' % (output_dir, 'gb_scripts_tmp.js'), 'w')
112
    fp.write(concatFiles(js))
113
    fp.close()
114
115
    AJS_minify.AJS_SRC = 'greybox_source/base/AJS.js'
116
    AJS_minify.AJS_MINI_SRC = 'greybox/AJS_tmp.js'
117
    files = ['greybox/gb_scripts_tmp.js', 'greybox_source/base/AJS_fx.js', 'static_files/help.js']
118
    code_analyzer = AJS_minify.ExternalCodeAnalyzer(files)
119
    composer = AJS_minify.AjsComposer(code_analyzer.findFunctions())
120
    composer.writeToOutput()
121
122
    os.popen('java -jar compression_lib/custom_rhino.jar -c greybox/AJS_tmp.js > greybox/AJS.js')
123
    os.remove('greybox/AJS_tmp.js')
124
    os.popen('java -jar compression_lib/custom_rhino.jar -c greybox_source/base/AJS_fx.js > greybox/AJS_fx.js')
125
    print 'Compressed AJS.js and AJS.js into greybox/'
126
127
    os.popen('java -jar compression_lib/custom_rhino.jar -c greybox/gb_scripts_tmp.js > greybox/gb_scripts.js')
128
    os.remove('greybox/gb_scripts_tmp.js')
129
    print 'Compressed JavaScript in %s' % ('greybox/gb_scripts.css')
130
131
    #Append script_loaded
132
    open('greybox/AJS.js', 'a').write('\nscript_loaded=true;')
133
    open('greybox/AJS_fx.js', 'a').write('\nscript_loaded=true;')
134
    open('greybox/gb_scripts.js', 'a').write('\nscript_loaded=true;')
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/compressing_greybox.html (+55 lines)
Line 0 Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
    <title>GreyBox - Compressing GreyBox</title>
5
6
    <script type="text/javascript">
7
        var GB_ROOT_DIR = "./greybox/";
8
    </script>
9
10
    <script type="text/javascript" src="greybox/AJS.js"></script>
11
    <script type="text/javascript" src="greybox/AJS_fx.js"></script>
12
    <script type="text/javascript" src="greybox/gb_scripts.js"></script>
13
    <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
14
15
    <script type="text/javascript" src="static_files/help.js"></script>
16
    <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
17
</head>
18
<body>
19
20
<script>
21
insertHeader();
22
insertMenu('cmpr');
23
</script>
24
25
<h2>Code structure</h2>
26
<ul>
27
    <li><b>greybox:</b> Generated and compressed JavaScript and CSS is located here</li>
28
    <li><b>greybox_source:</b> CSS and JavaScript structured in directories.</li>
29
</ul>
30
It's not recommend that you alter code in the <b>greybox</b> directory, since it's computer generated and very unreadable!
31
32
33
<h2>Download Dojo ShrinkSafe</h2>
34
To make the filesize as small as possible GreyBox JavaScript is compressed down using <a href="http://alex.dojotoolkit.org/shrinksafe/">Dojo ShrinkSafe</a>. This library requires <a href="http://www.java.com/getjava/">Java</a>, so make sure you got Java installed. Download following JAR file:
35
<ul>
36
    <li><a href="http://svn.dojotoolkit.org/dojo/trunk/buildscripts/lib/custom_rhino.jar">custom_rhino.jar</a></li>
37
</ul>
38
Place <b>custom_rhino.jar</b> in GreyBox's <b>compression_lib</b> directory.
39
40
41
<h2>Compressing GreyBox</h2>
42
Now, you are ready to compress GreyBox. This is done by running a Python script called <b>combiner.py</b>. I.e. you need to download and install <a href="http://www.python.org/download/">Pyhton</a>.
43
44
<p>
45
You can run <b>combiner.py</b> in following ways:
46
</p>
47
48
<ul>
49
    <li><b>python combiner.py full:</b> Compress everything</li>
50
    <li><b>python combiner.py gallery:</b> Compress only gallery related CSS and JavaScript</li>
51
    <li><b>python combiner.py window:</b> Compress only window related CSS and JavaScript</li>
52
</ul>
53
54
</body>
55
</html>
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/compression_lib/AJS_minify.py (+255 lines)
Line 0 Link Here
1
#!/usr/bin/env python
2
#Last-update: 08/05/07 12:39:17
3
import re
4
import sys
5
from sets import Set
6
7
##
8
# External files
9
#
10
AJS_SRC = 'AJS.js'
11
AJS_MINI_SRC = 'AJS_compressed.js'
12
13
14
##
15
# Standard stuff that may change in the future
16
#
17
DOM_SHORTCUTS = [
18
    "ul", "li", "td", "tr", "th",
19
    "tbody", "table", "input", "span", "b",
20
    "a", "div", "img", "button", "h1",
21
    "h2", "h3", "br", "textarea", "form",
22
    "p", "select", "option", "iframe", "script",
23
    "center", "dl", "dt", "dd", "small",
24
    "pre", "tn"
25
]
26
27
FN_SHORTCUTS = {
28
    '$': 'getElement',
29
    '$$': 'getElements',
30
    '$f': 'getFormElement',
31
    '$b': 'bind',
32
    '$p': 'partial',
33
    '$A': 'createArray',
34
    'DI': 'documentInsert',
35
    'ACN': 'appendChildNodes',
36
    'RCN': 'replaceChildNodes',
37
    'AEV': 'addEventListener',
38
    'REV': 'removeEventListener',
39
    '$bytc': 'getElementsByTagAndClassName'
40
}
41
42
AJS_TEMPLATE = """//AJS JavaScript library (minify'ed version)
43
//Copyright (c) 2006 Amir Salihefendic. All rights reserved.
44
//Copyright (c) 2005 Bob Ippolito. All rights reserved.
45
//License: http://www.opensource.org/licenses/mit-license.php
46
//Visit http://orangoo.com/AmiNation/AJS for full version.
47
AJS = {
48
BASE_URL: "",
49
drag_obj: null,
50
drag_elm: null,
51
_drop_zones: [],
52
_cur_pos: null,
53
54
%(functions)s
55
}
56
57
AJS.$ = AJS.getElement;
58
AJS.$$ = AJS.getElements;
59
AJS.$f = AJS.getFormElement;
60
AJS.$p = AJS.partial;
61
AJS.$b = AJS.bind;
62
AJS.$A = AJS.createArray;
63
AJS.DI = AJS.documentInsert;
64
AJS.ACN = AJS.appendChildNodes;
65
AJS.RCN = AJS.replaceChildNodes;
66
AJS.AEV = AJS.addEventListener;
67
AJS.REV = AJS.removeEventListener;
68
AJS.$bytc = AJS.getElementsByTagAndClassName;
69
70
AJS.addEventListener(window, 'unload', AJS._unloadListeners);
71
AJS._createDomShortcuts();
72
73
%(AJSClass)s
74
75
%(AJSDeferred)s
76
script_loaded = true;
77
"""
78
79
80
def getAjsCode():
81
    return open(AJS_SRC).read()
82
83
def writeAjsMini(code):
84
    open(AJS_MINI_SRC, "w").write(code)
85
86
87
class AjsAnalyzer:
88
89
    def __init__(self):
90
        self.code = getAjsCode()
91
        self.ajs_fns = {}
92
        self.ajs_deps = {}
93
        self._parseAJS()
94
        self._findDeps()
95
96
    def _parseAJS(self):
97
        ajs_code = re.search("AJS =(.|\n)*\n}\n", self.code).group(0)
98
        fns = re.findall("\s+((\w*?):.*?{(.|\n)*?\n\s*})(,|\n+})\n", ajs_code)
99
        for f in fns:
100
            self.ajs_fns[f[1]] = f[0]
101
102
    def getFnCode(self, fn_name, caller=None):
103
        """
104
        Returns the code of function and it's dependencies as a list
105
        """
106
        fn_name = self._unfoldFn(fn_name)
107
        r = []
108
        if self.ajs_fns.get(fn_name):
109
            r.append(self.ajs_fns[fn_name])
110
            for dep_fn in self.ajs_deps[fn_name]:
111
                if fn_name != dep_fn and dep_fn != caller:
112
                    r.extend(self.getFnCode(dep_fn, fn_name))
113
        elif fn_name not in ['listeners', 'Class']:
114
            print 'Could not find "%s"' % fn_name
115
        return r
116
117
    def getAjsClassCode(self):
118
        return re.search("AJS.Class =(.|\n)*\n};\n", self.code).group(0)
119
120
    def getAjsDeferredCode(self):
121
        return re.search("AJSDeferred =(.|\n)*\n};\n", self.code).group(0)
122
123
    def _findDeps(self):
124
        """
125
        Parses AJS and for every function it finds dependencies for the other functions.
126
        """
127
        for fn_name, fn_code in self.ajs_fns.items():
128
            self.ajs_deps[fn_name] = self._findFns(fn_code)
129
130
    def _findFns(self, inner):
131
        """
132
        Searches after AJS.fnX( in inner and returns all the fnX in a Set.
133
        """
134
        s = re.findall("AJS\.([\w_$]*?)(?:\(|,|\.)", inner)
135
        s = list(Set(s))
136
        return self._unfoldFns(s)
137
138
    def _unfoldFns(self, list):
139
        """
140
        Unfolds:
141
            AJS.B, AJS.H1 etc. to _createDomShortcuts
142
            AJS.$ to AJS.getElement etc.
143
        """
144
        return [self._unfoldFn(n) for n in list]
145
146
    def _unfoldFn(self, fn_name):
147
        if fn_name.lower() in DOM_SHORTCUTS:
148
            return "_createDomShortcuts"
149
        elif FN_SHORTCUTS.get(fn_name):
150
            return FN_SHORTCUTS[fn_name]
151
        else:
152
            return fn_name
153
154
155
class ExternalCodeAnalyzer:
156
157
    def __init__(self, files):
158
        self.found_ajs_fns = []
159
        self.files = files
160
161
    def findFunctions(self):
162
        for f in self.files:
163
            self.found_ajs_fns.extend( self._parseFile(f) )
164
        return list(Set(self.found_ajs_fns))
165
166
    def _parseFile(self, f):
167
        """
168
        Parses the file, looks for AJS functions and returns all the found functions.
169
        """
170
        code = open(f).read()
171
        return re.findall("AJS\.([\w_$]*?)\(", code)
172
173
174
175
class AjsComposer:
176
177
    def __init__(self, fn_list):
178
        self.code = getAjsCode()
179
        self.analyzer = AjsAnalyzer()
180
        self.fn_list = fn_list
181
182
        #Append standard functions
183
        req = ['_unloadListeners', 'createDOM', '_createDomShortcuts', 'log', 'addEventListener']
184
        self.fn_list.extend(req)
185
186
        #Append AJSDeferred only if needed
187
        in_list = lambda x: x in self.fn_list
188
        if in_list('getRequest') or in_list('loadJSONDoc'):
189
            self.deferred = self._minify(self.analyzer.getAjsDeferredCode())
190
            self.fn_list.append('isObject')
191
        else:
192
            self.deferred = ''
193
194
    def writeToOutput(self):
195
        fns = self._getFns()
196
        d = {}
197
        d['functions'] = ",\n".join(fns)
198
        d['AJSDeferred'] = self.deferred
199
        d['AJSClass'] = self.analyzer.getAjsClassCode()
200
201
        mini_code = AJS_TEMPLATE % d
202
        writeAjsMini(mini_code)
203
204
    def _minify(self, code):
205
        new_lines = []
206
        for l in code.split("\n"):
207
            if l not in ['\n', '']:
208
                new_lines.append(l.lstrip())
209
        return "\n".join(new_lines)
210
211
    def _getFns(self):
212
        """
213
        Returns a list with real code of functions
214
        """
215
        r = []
216
        for fn in self.fn_list:
217
            r.extend(self.analyzer.getFnCode(fn))
218
219
        r = list(Set(r))
220
        return [self._minify(fn) for fn in r]
221
222
223
if __name__ == '__main__':
224
    args = sys.argv
225
226
    if len(args) < 3:
227
        print """Usage is:
228
    python AJS_minify.py [-o output_file] ajs_file js_file.js html_using_ajs.html ...
229
Example usage:
230
    Using relative paths:
231
        python AJS_minify.py -o AJS_mini.js AJS.js test.js index.html
232
        This will create AJS_mini.js from test.js and index.html.
233
    Using absolute paths:
234
        python AJS_minify.py ~/Desktop/AJS/AJS.js ~/Desktop/GreyBox_v3_42/greybox/greybox.js
235
        This will create a new file called '%s' that has the needed AJS functions.""" % AJS_MINI_SRC
236
237
        sys.exit(0)
238
239
    if sys.argv[1] == '-o':
240
        AJS_MINI_SRC = sys.argv[2]
241
        AJS_SRC = sys.argv[3]
242
        FILES = sys.argv[4:]
243
    else:
244
        AJS_SRC = sys.argv[1]
245
        FILES = sys.argv[2:]
246
247
    print 'Parsing through:\n    %s' % "\n    ".join(FILES)
248
249
    code_analyzer = ExternalCodeAnalyzer(FILES)
250
    found_fns = code_analyzer.findFunctions()
251
    print 'Found following AJS functions:\n    %s' % ("\n    ".join(found_fns))
252
253
    composer = AjsComposer(found_fns)
254
    composer.writeToOutput()
255
    print "Written the minified code to '%s'" % AJS_MINI_SRC
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/compression_lib/__init__.py (+1 lines)
Line 0 Link Here
1
#
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/examples.html (+95 lines)
Line 0 Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
    <title>GreyBox - Examples</title>
5
6
    <script type="text/javascript">
7
        var GB_ROOT_DIR = "./greybox/";
8
    </script>
9
10
    <script type="text/javascript" src="greybox/AJS.js"></script>
11
    <script type="text/javascript" src="greybox/AJS_fx.js"></script>
12
    <script type="text/javascript" src="greybox/gb_scripts.js"></script>
13
    <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
14
15
    <script type="text/javascript" src="static_files/help.js"></script>
16
    <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
17
</head>
18
<body>
19
20
<script>
21
    insertHeader();
22
    insertMenu('examples');
23
</script>
24
25
26
<h3>One website</h3>
27
<ul>
28
    <li>
29
        <a href="http://google.com/" title="Google" rel="gb_page_center[640, 480]">Launch google.com in a 640x480 window</a>
30
    </li>
31
    <li>
32
        <a href="http://google.com/" title="Google" rel="gb_page_fs[]">Launch google.com in fullscreen window</a>
33
    </li>
34
</ul>
35
36
<h3>Website gallery</h3>
37
<ul>
38
    <li>
39
        <a href="http://google.com/" title="Google" rel="gb_pageset[search_sites]">Launch Google search</a>
40
    </li>
41
    <li>
42
        <a href="http://search.yahoo.com/" rel="gb_pageset[search_sites]">Launch Yahoo search</a>
43
    </li>
44
    <li>
45
        <a href="http://www.koders.com/" rel="gb_pageset[search_sites]">Launch Koders search</a>
46
    </li>
47
</ul>
48
49
<h3>Image gallery</h3>
50
<script type="text/javascript">
51
var image_set = [{'caption': 'Flower', 'url': 'http://static.flickr.com/119/294309231_a3d2a339b9.jpg'},
52
                 {'caption': 'Nice waterfall', 'url': 'http://www.widerange.org/images/large/plitvicka.jpg'}];
53
</script>
54
55
<ul>
56
    <li>
57
        <a href="#" onclick="return GB_showImageSet(image_set, 1)">Launch gallery</a>
58
    </li>
59
60
    <li>
61
        <a href="static_files/night_valley.jpg" rel="gb_imageset[nice_pics]" title="Night valley">
62
            <img src="static_files/night_valley_thumb.jpg" />
63
        </a>
64
    </li>
65
66
    <li>
67
        <a href="static_files/salt.jpg" rel="gb_imageset[nice_pics]" title="Salt flats in Chile">
68
            <img src="static_files/salt_thumb.gif" />
69
        </a>
70
    </li>
71
</ul>
72
73
<h3>Without loading</h3>
74
<script type="text/javascript">
75
GB_myShow = function(caption, url, /* optional */ height, width, callback_fn) {
76
    var options = {
77
        caption: caption,
78
        height: height || 500,
79
        width: width || 500,
80
        fullscreen: false,
81
        show_loading: false,
82
        callback_fn: callback_fn
83
    }
84
    var win = new GB_Window(options);
85
    return win.show(url);
86
}
87
</script>
88
<ul>
89
    <li>
90
        <a href="http://google.com/" onclick="return GB_myShow('Google', this.href)">Visit Google without loading</a>
91
    </li>
92
</ul>
93
94
</body>
95
</html>
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/auto_deco.js (+67 lines)
Line 0 Link Here
1
var GB_SETS = {};
2
function decoGreyboxLinks() {
3
    var as = AJS.$bytc('a');
4
    AJS.map(as, function(a) {
5
        if(a.getAttribute('href') && a.getAttribute('rel')) {
6
            var rel = a.getAttribute('rel');
7
            if(rel.indexOf('gb_') == 0) {
8
                var name = rel.match(/\w+/)[0];
9
                var attrs = rel.match(/\[(.*)\]/)[1];
10
                var index = 0;
11
12
                var item = {
13
                    'caption': a.title || '',
14
                    'url': a.href
15
                }
16
17
                //Set up GB_SETS
18
                if(name == 'gb_pageset' || name == 'gb_imageset') {
19
                    if(!GB_SETS[attrs]) { GB_SETS[attrs] = []; }
20
                    GB_SETS[attrs].push(item);
21
                    index = GB_SETS[attrs].length;
22
                }
23
24
                //Append onclick
25
                if(name == 'gb_pageset') {
26
                    a.onclick = function() {
27
                        GB_showFullScreenSet(GB_SETS[attrs], index);
28
                        return false;
29
                    };
30
                }
31
                if(name == 'gb_imageset') {
32
                    a.onclick = function() {
33
                        GB_showImageSet(GB_SETS[attrs], index);
34
                        return false;
35
                    };
36
                }
37
                if(name == 'gb_image') {
38
                    a.onclick = function() {
39
                        GB_showImage(item.caption, item.url);
40
                        return false;
41
                    };
42
                }
43
                if(name == 'gb_page') {
44
                    a.onclick = function() {
45
                        var sp = attrs.split(/, ?/);
46
                        GB_show(item.caption, item.url, parseInt(sp[1]), parseInt(sp[0]));
47
                        return false;
48
                    };
49
                }
50
                if(name == 'gb_page_fs') {
51
                    a.onclick = function() {
52
                        GB_showFullScreen(item.caption, item.url);
53
                        return false;
54
                    };
55
                }
56
                if(name == 'gb_page_center') {
57
                    a.onclick = function() {
58
                        var sp = attrs.split(/, ?/);
59
                        GB_showCenter(item.caption, item.url, parseInt(sp[1]), parseInt(sp[0]));
60
                        return false;
61
                    };
62
                }
63
            }
64
        }});
65
}
66
67
AJS.AEV(window, 'load', decoGreyboxLinks);
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/base/AJS.js (+1371 lines)
Line 0 Link Here
1
/*
2
Last Modified: 29/01/07 14:16:09
3
4
AJS JavaScript library
5
    A very small library with a lot of functionality
6
AUTHOR
7
    4mir Salihefendic (http://amix.dk) - amix@amix.dk
8
LICENSE
9
    Copyright (c) 2006 Amir Salihefendic. All rights reserved.
10
    Copyright (c) 2005 Bob Ippolito. All rights reserved.
11
    http://www.opensource.org/licenses/mit-license.php
12
VERSION
13
    3.7
14
SITE
15
    http://orangoo.com/AmiNation/AJS
16
**/
17
if(!AJS) {
18
var AJS = {
19
    BASE_URL: "",
20
21
    drag_obj: null,
22
    drag_elm: null,
23
    _drop_zones: [],
24
    _drag_zones: [],
25
    _cur_pos: null,
26
27
    ajaxErrorHandler: null,
28
29
////
30
// General accessor functions
31
////
32
    getQueryArgument: function(var_name) {
33
        var query = window.location.search.substring(1);
34
        var vars = query.split("&");
35
        for (var i=0;i<vars.length;i++) {
36
            var pair = vars[i].split("=");
37
            if (pair[0] == var_name) {
38
                return pair[1];
39
            }
40
        }
41
        return null;
42
    },
43
44
    isIe: function() {
45
        return (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1);
46
    },
47
    isNetscape7: function() {
48
        return (navigator.userAgent.toLowerCase().indexOf("netscape") != -1 && navigator.userAgent.toLowerCase().indexOf("7.") != -1);
49
    },
50
    isSafari: function() {
51
        return (navigator.userAgent.toLowerCase().indexOf("khtml") != -1);
52
    },
53
    isOpera: function() {
54
        return (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
55
    },
56
    isMozilla: function() {
57
        return (navigator.userAgent.toLowerCase().indexOf("gecko") != -1 && navigator.productSub >= 20030210);
58
    },
59
60
61
////
62
// Array functions
63
////
64
    //Shortcut: AJS.$A
65
    createArray: function(v) {
66
        if(AJS.isArray(v) && !AJS.isString(v))
67
            return v;
68
        else if(!v)
69
            return [];
70
        else
71
            return [v];
72
    },
73
74
    forceArray: function(args) {
75
        var r = [];
76
        AJS.map(args, function(elm) {
77
            r.push(elm);
78
        });
79
        return r;
80
    },
81
82
    join: function(delim, list) {
83
        try {
84
            return list.join(delim);
85
        }
86
        catch(e) {
87
            var r = list[0] || '';
88
            AJS.map(list, function(elm) {
89
                r += delim + elm;
90
            }, 1);
91
            return r + '';
92
        }
93
    },
94
95
    isIn: function(elm, list) {
96
        var i = AJS.getIndex(elm, list);
97
        if(i != -1)
98
            return true;
99
        else
100
            return false;
101
    },
102
103
    getIndex: function(elm, list/*optional*/, eval_fn) {
104
        for(var i=0; i < list.length; i++)
105
            if(eval_fn && eval_fn(list[i]) || elm == list[i])
106
                return i;
107
        return -1;
108
    },
109
110
    getFirst: function(list) {
111
        if(list.length > 0)
112
            return list[0];
113
        else
114
            return null;
115
    },
116
117
    getLast: function(list) {
118
        if(list.length > 0)
119
            return list[list.length-1];
120
        else
121
            return null;
122
    },
123
124
    update: function(l1, l2) {
125
        for(var i in l2)
126
            l1[i] = l2[i];
127
        return l1;
128
    },
129
130
    flattenList: function(list) {
131
        var r = [];
132
        var _flatten = function(r, l) {
133
            AJS.map(l, function(o) {
134
                if(o == null) {}
135
                else if (AJS.isArray(o))
136
                    _flatten(r, o);
137
                else
138
                    r.push(o);
139
            });
140
        }
141
        _flatten(r, list);
142
        return r;
143
    },
144
145
146
////
147
// Functional programming
148
////
149
    map: function(list, fn,/*optional*/ start_index, end_index) {
150
        var i = 0, l = list.length;
151
        if(start_index)
152
             i = start_index;
153
        if(end_index)
154
             l = end_index;
155
        for(i; i < l; i++)
156
            fn.apply(null, [list[i], i]);
157
    },
158
159
    rmap: function(list, fn) {
160
        var i = list.length-1, l = 0;
161
        for(i; i >= l; i--)
162
            fn.apply(null, [list[i], i]);
163
    },
164
165
    filter: function(list, fn, /*optional*/ start_index, end_index) {
166
        var r = [];
167
        AJS.map(list, function(elm) {
168
            if(fn(elm))
169
                r.push(elm);
170
        }, start_index, end_index);
171
        return r;
172
    },
173
174
    partial: function(fn) {
175
        var args = AJS.forceArray(arguments);
176
        return AJS.$b(fn, null, args.slice(1, args.length).reverse(), false, true);
177
    },
178
179
180
////
181
// DOM functions
182
////
183
    //Shortcut: AJS.$
184
    getElement: function(id) {
185
        if(AJS.isString(id) || AJS.isNumber(id))
186
            return document.getElementById(id);
187
        else
188
            return id;
189
    },
190
191
    //Shortcut: AJS.$$
192
    getElements: function(/*id1, id2, id3*/) {
193
        var args = AJS.forceArray(arguments);
194
        var elements = new Array();
195
            for (var i = 0; i < args.length; i++) {
196
                var element = AJS.getElement(args[i]);
197
                elements.push(element);
198
            }
199
            return elements;
200
    },
201
202
    //Shortcut: AJS.$bytc
203
    getElementsByTagAndClassName: function(tag_name, class_name, /*optional*/ parent) {
204
        var class_elements = [];
205
        if(!AJS.isDefined(parent))
206
            parent = document;
207
        if(!AJS.isDefined(tag_name))
208
            tag_name = '*';
209
210
        var els = parent.getElementsByTagName(tag_name);
211
        var els_len = els.length;
212
        var pattern = new RegExp("(^|\\s)" + class_name + "(\\s|$)");
213
214
        for (i = 0, j = 0; i < els_len; i++) {
215
            if ( pattern.test(els[i].className) || class_name == null ) {
216
                class_elements[j] = els[i];
217
                j++;
218
            }
219
        }
220
        return class_elements;
221
    },
222
223
    _nodeWalk: function(elm, tag_name, class_name, fn_next_elm) {
224
        var p = fn_next_elm(elm);
225
226
        var checkFn;
227
        if(tag_name && class_name) {
228
            checkFn = function(p) {
229
                return AJS.nodeName(p) == tag_name && AJS.hasClass(p, class_name);
230
            }
231
        }
232
        else if(tag_name) {
233
            checkFn = function(p) { return AJS.nodeName(p) == tag_name; }
234
        }
235
        else {
236
            checkFn = function(p) { return AJS.hasClass(p, class_name); }
237
        }
238
239
        while(p) {
240
            if(checkFn(p))
241
                return p;
242
            p = fn_next_elm(p);
243
        }
244
        return null;
245
    },
246
247
    getParentBytc: function(elm, tag_name, class_name) {
248
        return AJS._nodeWalk(elm, tag_name, class_name, function(m) { return m.parentNode; });
249
    },
250
251
    getPreviousSiblingBytc: function(elm, tag_name, class_name) {
252
        return AJS._nodeWalk(elm, tag_name, class_name, function(m) { return m.previousSibling; });
253
    },
254
255
    getNextSiblingBytc: function(elm, tag_name, class_name) {
256
        return AJS._nodeWalk(elm, tag_name, class_name, function(m) { return m.nextSibling; });
257
    },
258
259
    //Shortcut: AJS.$f
260
    getFormElement: function(form, name) {
261
        form = AJS.$(form);
262
        var r = null;
263
        AJS.map(form.elements, function(elm) {
264
            if(elm.name && elm.name == name)
265
                r = elm;
266
        });
267
        return r;
268
    },
269
270
    formContents: function(form) {
271
        var form = AJS.$(form);
272
        var r = {};
273
        var fn = function(elms) {
274
            AJS.map(elms, function(e) {
275
                if(e.name)
276
                    r[e.name] = e.value || '';
277
            });
278
        }
279
        fn(AJS.$bytc('input', null, form));
280
        fn(AJS.$bytc('textarea', null, form));
281
        return r;
282
    },
283
284
    getBody: function() {
285
        return AJS.$bytc('body')[0]
286
    },
287
288
    nodeName: function(elm) {
289
        return elm.nodeName.toLowerCase();
290
    },
291
292
    hasParent: function(elm, parent_to_consider, max_look_up) {
293
        if(elm == parent_to_consider)
294
            return true;
295
        if(max_look_up == 0)
296
            return false;
297
        return AJS.hasParent(elm.parentNode, parent_to_consider, max_look_up-1);
298
    },
299
300
    isElementHidden: function(elm) {
301
        return elm.style.visibility == "hidden";
302
    },
303
304
    //Shortcut: AJS.DI
305
    documentInsert: function(elm) {
306
        if(typeof(elm) == 'string')
307
            elm = AJS.HTML2DOM(elm);
308
        document.write('<span id="dummy_holder"></span>');
309
        AJS.swapDOM(AJS.$('dummy_holder'), elm);
310
    },
311
312
    cloner: function(element) {
313
        return function() {
314
            return element.cloneNode(true);
315
        }
316
    },
317
318
    appendToTop: function(elm/*, elms...*/) {
319
        var args = AJS.forceArray(arguments).slice(1);
320
        if(args.length >= 1) {
321
            var first_child = elm.firstChild;
322
            if(first_child) {
323
                while(true) {
324
                    var t_elm = args.shift();
325
                    if(t_elm)
326
                        AJS.insertBefore(t_elm, first_child);
327
                    else
328
                        break;
329
                }
330
            }
331
            else {
332
                AJS.ACN.apply(null, arguments);
333
            }
334
        }
335
        return elm;
336
    },
337
338
    //Shortcut: AJS.ACN
339
    appendChildNodes: function(elm/*, elms...*/) {
340
        if(arguments.length >= 2) {
341
            AJS.map(arguments, function(n) {
342
                if(AJS.isString(n))
343
                    n = AJS.TN(n);
344
                if(AJS.isDefined(n))
345
                    elm.appendChild(n);
346
            }, 1);
347
        }
348
        return elm;
349
    },
350
351
    //Shortcut: AJS.RCN
352
    replaceChildNodes: function(elm/*, elms...*/) {
353
        var child;
354
        while ((child = elm.firstChild))
355
            elm.removeChild(child);
356
        if (arguments.length < 2)
357
            return elm;
358
        else
359
            return AJS.appendChildNodes.apply(null, arguments);
360
        return elm;
361
    },
362
363
    insertAfter: function(elm, reference_elm) {
364
        reference_elm.parentNode.insertBefore(elm, reference_elm.nextSibling);
365
        return elm;
366
    },
367
368
    insertBefore: function(elm, reference_elm) {
369
        reference_elm.parentNode.insertBefore(elm, reference_elm);
370
        return elm;
371
    },
372
373
    showElement: function(/*elms...*/) {
374
        var args = AJS.forceArray(arguments);
375
        AJS.map(args, function(elm) { elm.style.display = ''});
376
    },
377
378
    hideElement: function(elm) {
379
        var args = AJS.forceArray(arguments);
380
        AJS.map(args, function(elm) { elm.style.display = 'none'});
381
    },
382
383
    swapDOM: function(dest, src) {
384
        dest = AJS.getElement(dest);
385
        var parent = dest.parentNode;
386
        if (src) {
387
            src = AJS.getElement(src);
388
            parent.replaceChild(src, dest);
389
        } else {
390
            parent.removeChild(dest);
391
        }
392
        return src;
393
    },
394
395
    removeElement: function(/*elm1, elm2...*/) {
396
        var args = AJS.forceArray(arguments);
397
        AJS.map(args, function(elm) { AJS.swapDOM(elm, null); });
398
    },
399
400
    createDOM: function(name, attrs) {
401
        var i=0, attr;
402
        elm = document.createElement(name);
403
404
        if(AJS.isDict(attrs[i])) {
405
            for(k in attrs[0]) {
406
                attr = attrs[0][k];
407
                if(k == "style")
408
                    elm.style.cssText = attr;
409
                else if(k == "class" || k == 'className')
410
                    elm.className = attr;
411
                else {
412
                    elm.setAttribute(k, attr);
413
                }
414
            }
415
            i++;
416
        }
417
418
        if(attrs[0] == null)
419
            i = 1;
420
421
        AJS.map(attrs, function(n) {
422
            if(n) {
423
                if(AJS.isString(n) || AJS.isNumber(n))
424
                    n = AJS.TN(n);
425
                elm.appendChild(n);
426
            }
427
        }, i);
428
        return elm;
429
    },
430
431
    _createDomShortcuts: function() {
432
        var elms = [
433
                "ul", "li", "td", "tr", "th",
434
                "tbody", "table", "input", "span", "b",
435
                "a", "div", "img", "button", "h1",
436
                "h2", "h3", "br", "textarea", "form",
437
                "p", "select", "option", "iframe", "script",
438
                "center", "dl", "dt", "dd", "small",
439
                "pre"
440
        ];
441
        var extends_ajs = function(elm) {
442
            var c_dom = "return AJS.createDOM.apply(null, ['" + elm + "', arguments]);";
443
            var c_fun_dom = 'function() { ' + c_dom + '    }';
444
            eval("AJS." + elm.toUpperCase() + "=" + c_fun_dom);
445
        }
446
        AJS.map(elms, extends_ajs);
447
        AJS.TN = function(text) { return document.createTextNode(text) };
448
    },
449
450
    getCssDim: function(dim) {
451
        if(AJS.isString(dim))
452
            return dim;
453
        else
454
            return dim + "px";
455
    },
456
    getCssProperty: function(elm, prop) {
457
        elm = AJS.$(elm);
458
        var y;
459
        if(elm.currentStyle)
460
            y = elm.currentStyle[prop];
461
     else if (window.getComputedStyle)
462
            y = document.defaultView.getComputedStyle(elm,null).getPropertyValue(prop);
463
      return y;
464
    },
465
466
    setStyle: function(/*elm1, elm2..., property, new_value*/) {
467
        var args = AJS.forceArray(arguments);
468
        var new_val = args.pop();
469
        var property = args.pop();
470
        AJS.map(args, function(elm) {
471
            elm.style[property] = AJS.getCssDim(new_val);
472
        });
473
    },
474
475
    setWidth: function(/*elm1, elm2..., width*/) {
476
        var args = AJS.forceArray(arguments);
477
        args.splice(args.length-1, 0, 'width');
478
        AJS.setStyle.apply(null, args);
479
    },
480
    setHeight: function(/*elm1, elm2..., height*/) {
481
        var args = AJS.forceArray(arguments);
482
        args.splice(args.length-1, 0, 'height');
483
        AJS.setStyle.apply(null, args);
484
    },
485
    setLeft: function(/*elm1, elm2..., left*/) {
486
        var args = AJS.forceArray(arguments);
487
        args.splice(args.length-1, 0, 'left');
488
        AJS.setStyle.apply(null, args);
489
    },
490
    setTop: function(/*elm1, elm2..., top*/) {
491
        var args = AJS.forceArray(arguments);
492
        args.splice(args.length-1, 0, 'top');
493
        AJS.setStyle.apply(null, args);
494
    },
495
    setClass: function(/*elm1, elm2..., className*/) {
496
        var args = AJS.forceArray(arguments);
497
        var c = args.pop();
498
        AJS.map(args, function(elm) { elm.className = c});
499
    },
500
    addClass: function(/*elm1, elm2..., className*/) {
501
        var args = AJS.forceArray(arguments);
502
        var cls = args.pop();
503
        var add_class = function(o) {
504
            if(!new RegExp("(^|\\s)" + cls + "(\\s|$)").test(o.className))
505
                o.className += (o.className ? " " : "") + cls;
506
        };
507
        AJS.map(args, function(elm) { add_class(elm); });
508
    },
509
    hasClass: function(elm, cls) {
510
        if(!elm.className)
511
            return false;
512
        return elm.className == cls ||
513
               elm.className.search(new RegExp(" " + cls)) != -1
514
    },
515
    removeClass: function(/*elm1, elm2..., className*/) {
516
        var args = AJS.forceArray(arguments);
517
        var cls = args.pop();
518
        var rm_class = function(o) {
519
            o.className = o.className.replace(new RegExp("\\s?" + cls, 'g'), "");
520
        };
521
        AJS.map(args, function(elm) { rm_class(elm); });
522
    },
523
524
    setHTML: function(elm, html) {
525
        elm.innerHTML = html;
526
        return elm;
527
    },
528
529
    RND: function(tmpl, ns, scope) {
530
        scope = scope || window;
531
        var fn = function(w, g) {
532
            g = g.split("|");
533
            var cnt = ns[g[0]];
534
            for(var i=1; i < g.length; i++)
535
                cnt = scope[g[i]](cnt);
536
            if(cnt == '')
537
                return '';
538
            if(cnt == 0 || cnt == -1)
539
                cnt += '';
540
            return cnt || w;
541
        };
542
        return tmpl.replace(/%\(([A-Za-z0-9_|.]*)\)/g, fn);
543
    },
544
545
    HTML2DOM: function(html,/*optional*/ first_child) {
546
        var d = AJS.DIV();
547
        d.innerHTML = html;
548
        if(first_child)
549
            return d.childNodes[0];
550
        else
551
            return d;
552
    },
553
554
    preloadImages: function(/*img_src1, ..., img_srcN*/) {
555
        AJS.AEV(window, 'load', AJS.$p(function(args) {
556
            AJS.map(args, function(src) {
557
                var pic = new Image();
558
                pic.src = src;
559
            });
560
        }, arguments));
561
    },
562
563
564
////
565
// Effects
566
////
567
    setOpacity: function(elm, p) {
568
        elm.style.opacity = p;
569
        elm.style.filter = "alpha(opacity="+ p*100 +")";
570
    },
571
572
573
////
574
// Ajax functions
575
////
576
    getXMLHttpRequest: function() {
577
        var try_these = [
578
            function () { return new XMLHttpRequest(); },
579
            function () { return new ActiveXObject('Msxml2.XMLHTTP'); },
580
            function () { return new ActiveXObject('Microsoft.XMLHTTP'); },
581
            function () { return new ActiveXObject('Msxml2.XMLHTTP.4.0'); },
582
            function () { throw "Browser does not support XMLHttpRequest"; }
583
        ];
584
        for (var i = 0; i < try_these.length; i++) {
585
            var func = try_these[i];
586
            try {
587
                return func();
588
            } catch (e) {
589
            }
590
        }
591
    },
592
593
    getRequest: function(url, data, type) {
594
        if(!type)
595
            type = "POST";
596
        var req = AJS.getXMLHttpRequest();
597
598
        if(url.indexOf("http://") == -1) {
599
            if(AJS.BASE_URL != '') {
600
                if(AJS.BASE_URL.lastIndexOf('/') != AJS.BASE_URL.length-1)
601
                    AJS.BASE_URL += '/';
602
                url = AJS.BASE_URL + url;
603
            }
604
            else
605
                url = window.location + url;
606
        }
607
608
        req.open(type, url, true);
609
        if(type == "POST")
610
            req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
611
        return AJS._sendXMLHttpRequest(req);
612
    },
613
614
    _sendXMLHttpRequest: function(req, data) {
615
        var d = new AJSDeferred(req);
616
617
        var onreadystatechange = function () {
618
            if (req.readyState == 4) {
619
                var status = '';
620
                try {
621
                    status = req.status;
622
                }
623
                catch(e) {};
624
                if(status == 200 || status == 304 || req.responseText == null) {
625
                    d.callback();
626
                }
627
                else {
628
                    if(AJS.ajaxErrorHandler)
629
                        AJS.ajaxErrorHandler(req.responseText, req);
630
                    else
631
                        d.errback();
632
                }
633
            }
634
        }
635
        req.onreadystatechange = onreadystatechange;
636
        return d;
637
    },
638
639
    _reprString: function(o) {
640
        return ('"' + o.replace(/(["\\])/g, '\\$1') + '"'
641
        ).replace(/[\f]/g, "\\f"
642
        ).replace(/[\b]/g, "\\b"
643
        ).replace(/[\n]/g, "\\n"
644
        ).replace(/[\t]/g, "\\t"
645
        ).replace(/[\r]/g, "\\r");
646
    },
647
648
    serializeJSON: function(o) {
649
        var objtype = typeof(o);
650
        if (objtype == "undefined") {
651
            return "undefined";
652
        } else if (objtype == "number" || objtype == "boolean") {
653
            return o + "";
654
        } else if (o === null) {
655
            return "null";
656
        }
657
        if (objtype == "string") {
658
            return AJS._reprString(o);
659
        }
660
        var me = arguments.callee;
661
        if (objtype != "function" && typeof(o.length) == "number") {
662
            var res = [];
663
            for (var i = 0; i < o.length; i++) {
664
                var val = me(o[i]);
665
                if (typeof(val) != "string") {
666
                    val = "undefined";
667
                }
668
                res.push(val);
669
            }
670
            return "[" + res.join(",") + "]";
671
        }
672
        // it's a function with no adapter, bad
673
        if (objtype == "function")
674
            return null;
675
        res = [];
676
        for (var k in o) {
677
            var useKey;
678
            if (typeof(k) == "number") {
679
                useKey = '"' + k + '"';
680
            } else if (typeof(k) == "string") {
681
                useKey = AJS._reprString(k);
682
            } else {
683
                // skip non-string or number keys
684
                continue;
685
            }
686
            val = me(o[k]);
687
            if (typeof(val) != "string") {
688
                // skip non-serializable values
689
                continue;
690
            }
691
            res.push(useKey + ":" + val);
692
        }
693
        return "{" + res.join(",") + "}";
694
    },
695
696
    loadJSONDoc: function(url) {
697
        var d = AJS.getRequest(url);
698
        var eval_req = function(data, req) {
699
            var text = req.responseText;
700
            if(text == "Error")
701
                d.errback(req);
702
            else
703
                return AJS.evalTxt(text);
704
        };
705
        d.addCallback(eval_req);
706
        return d;
707
    },
708
709
    evalTxt: function(txt) {
710
        try {
711
            return eval('('+ txt + ')');
712
        }
713
        catch(e) {
714
            return eval(txt);
715
        }
716
    },
717
718
    evalScriptTags: function(html) {
719
        var script_data = html.match(/<script.*?>((\n|\r|.)*?)<\/script>/g);
720
        if(script_data != null) {
721
            for(var i=0; i < script_data.length; i++) {
722
                var script_only = script_data[i].replace(/<script.*?>/g, "");
723
                script_only = script_only.replace(/<\/script>/g, "");
724
                eval(script_only);
725
            }
726
        }
727
    },
728
729
    queryArguments: function(data) {
730
        var post_data = [];
731
        for(k in data)
732
            post_data.push(k + "=" + AJS.urlencode(data[k]));
733
        return post_data.join("&");
734
    },
735
736
737
////
738
// Position and size
739
////
740
    getMousePos: function(e) {
741
        var posx = 0;
742
        var posy = 0;
743
        if (!e) var e = window.event;
744
        if (e.pageX || e.pageY)
745
        {
746
            posx = e.pageX;
747
            posy = e.pageY;
748
        }
749
        else if (e.clientX || e.clientY)
750
        {
751
            posx = e.clientX + document.body.scrollLeft;
752
            posy = e.clientY + document.body.scrollTop;
753
        }
754
        return {x: posx, y: posy};
755
    },
756
757
    getScrollTop: function() {
758
        //From: http://www.quirksmode.org/js/doctypes.html
759
        var t;
760
        if (document.documentElement && document.documentElement.scrollTop)
761
                t = document.documentElement.scrollTop;
762
        else if (document.body)
763
                t = document.body.scrollTop;
764
        return t;
765
    },
766
767
    absolutePosition: function(elm) {
768
        var posObj = {'x': elm.offsetLeft, 'y': elm.offsetTop};
769
        if(elm.offsetParent) {
770
            var temp_pos = AJS.absolutePosition(elm.offsetParent);
771
            posObj.x += temp_pos.x;
772
            posObj.y += temp_pos.y;
773
        }
774
        // safari bug
775
        if (AJS.isSafari() && elm.style.position == 'absolute' ) {
776
            posObj.x -= document.body.offsetLeft;
777
            posObj.y -= document.body.offsetTop;
778
        }
779
        return posObj;
780
    },
781
782
    getWindowSize: function(doc) {
783
        doc = doc || document;
784
        var win_w, win_h;
785
        if (self.innerHeight) {
786
            win_w = self.innerWidth;
787
            win_h = self.innerHeight;
788
        } else if (doc.documentElement && doc.documentElement.clientHeight) {
789
            win_w = doc.documentElement.clientWidth;
790
            win_h = doc.documentElement.clientHeight;
791
        } else if (doc.body) {
792
            win_w = doc.body.clientWidth;
793
            win_h = doc.body.clientHeight;
794
        }
795
        return {'w': win_w, 'h': win_h};
796
    },
797
798
    isOverlapping: function(elm1, elm2) {
799
        var pos_elm1 = AJS.absolutePosition(elm1);
800
        var pos_elm2 = AJS.absolutePosition(elm2);
801
802
        var top1 = pos_elm1.y;
803
        var left1 = pos_elm1.x;
804
        var right1 = left1 + elm1.offsetWidth;
805
        var bottom1 = top1 + elm1.offsetHeight;
806
        var top2 = pos_elm2.y;
807
        var left2 = pos_elm2.x;
808
        var right2 = left2 + elm2.offsetWidth;
809
        var bottom2 = top2 + elm2.offsetHeight;
810
        var getSign = function(v) {
811
            if(v > 0) return "+";
812
            else if(v < 0) return "-";
813
            else return 0;
814
        }
815
816
        if ((getSign(top1 - bottom2) != getSign(bottom1 - top2)) &&
817
                (getSign(left1 - right2) != getSign(right1 - left2)))
818
            return true;
819
        return false;
820
    },
821
822
823
////
824
// Events
825
////
826
    getEventElm: function(e) {
827
        if(e && !e.type && !e.keyCode)
828
            return e
829
        var targ;
830
        if (!e) var e = window.event;
831
        if (e.target) targ = e.target;
832
        else if (e.srcElement) targ = e.srcElement;
833
        if (targ.nodeType == 3) // defeat Safari bug
834
            targ = targ.parentNode;
835
        return targ;
836
    },
837
838
    _getRealScope: function(fn, /*optional*/ extra_args, dont_send_event, rev_extra_args) {
839
        var scope = window;
840
        extra_args = AJS.$A(extra_args);
841
        if(fn._cscope)
842
            scope = fn._cscope;
843
844
        return function() {
845
            //Append all the orginal arguments + extra_args
846
            var args = [];
847
            var i = 0;
848
            if(dont_send_event)
849
                i = 1;
850
851
            AJS.map(arguments, function(arg) { args.push(arg) }, i);
852
            args = args.concat(extra_args);
853
            if(rev_extra_args)
854
                args = args.reverse();
855
            return fn.apply(scope, args);
856
        };
857
    },
858
859
    _unloadListeners: function() {
860
        if(AJS.listeners)
861
            AJS.map(AJS.listeners, function(elm, type, fn) { AJS.REV(elm, type, fn) });
862
        AJS.listeners = [];
863
    },
864
865
    setEventKey: function(e) {
866
        e.key = e.keyCode ? e.keyCode : e.charCode;
867
868
        if(window.event) {
869
            e.ctrl = window.event.ctrlKey;
870
            e.shift = window.event.shiftKey;
871
        }
872
        else {
873
            e.ctrl = e.ctrlKey;
874
            e.shift = e.shiftKey;
875
        }
876
        switch(e.key) {
877
            case 63232:
878
                e.key = 38;
879
                break;
880
            case 63233:
881
                e.key = 40;
882
                break;
883
            case 63235:
884
                e.key = 39;
885
                break;
886
            case 63234:
887
                e.key = 37;
888
                break;
889
        }
890
    },
891
892
    //Shortcut: AJS.AEV
893
    addEventListener: function(elm, type, fn, /*optional*/listen_once, cancle_bubble) {
894
        if(!cancle_bubble)
895
            cancle_bubble = false;
896
897
        var elms = AJS.$A(elm);
898
        AJS.map(elms, function(elmz) {
899
            if(listen_once)
900
                fn = AJS._listenOnce(elmz, type, fn);
901
902
            //Hack since it does not work in all browsers
903
            if(AJS.isIn(type, ['submit', 'load', 'scroll', 'resize'])) {
904
                var old = elm['on' + type];
905
                elm['on' + type] = function() {
906
                    if(old) {
907
                        fn(arguments);
908
                        return old(arguments);
909
                    }
910
                    else
911
                        return fn(arguments);
912
                };
913
                return;
914
            }
915
916
            //Fix keyCode
917
            if(AJS.isIn(type, ['keypress', 'keydown', 'keyup', 'click'])) {
918
                var old_fn = fn;
919
                fn = function(e) {
920
                    AJS.setEventKey(e);
921
                    return old_fn.apply(null, arguments);
922
                }
923
            }
924
925
            if (elmz.attachEvent) {
926
                //FIXME: We ignore cancle_bubble for IE... could be a problem?
927
                elmz.attachEvent("on" + type, fn);
928
            }
929
            else if(elmz.addEventListener)
930
                elmz.addEventListener(type, fn, cancle_bubble);
931
932
            AJS.listeners = AJS.$A(AJS.listeners);
933
            AJS.listeners.push([elmz, type, fn]);
934
        });
935
    },
936
937
    //Shortcut: AJS.REV
938
    removeEventListener: function(elm, type, fn, /*optional*/cancle_bubble) {
939
        if(!cancle_bubble)
940
            cancle_bubble = false;
941
        if(elm.removeEventListener) {
942
            elm.removeEventListener(type, fn, cancle_bubble);
943
            if(AJS.isOpera())
944
                elm.removeEventListener(type, fn, !cancle_bubble);
945
        }
946
        else if(elm.detachEvent)
947
            elm.detachEvent("on" + type, fn);
948
    },
949
950
    //Shortcut: AJS.$b
951
    bind: function(fn, scope, /*optional*/ extra_args, dont_send_event, rev_extra_args) {
952
        fn._cscope = scope;
953
        return AJS._getRealScope(fn, extra_args, dont_send_event, rev_extra_args);
954
    },
955
956
    bindMethods: function(self) {
957
        for (var k in self) {
958
            var func = self[k];
959
            if (typeof(func) == 'function') {
960
                self[k] = AJS.$b(func, self);
961
            }
962
        }
963
    },
964
965
    _listenOnce: function(elm, type, fn) {
966
        var r_fn = function() {
967
            AJS.removeEventListener(elm, type, r_fn);
968
            fn(arguments);
969
        }
970
        return r_fn;
971
    },
972
973
    callLater: function(fn, interval) {
974
        var fn_no_send = function() {
975
            fn();
976
        };
977
        window.setTimeout(fn_no_send, interval);
978
    },
979
980
    preventDefault: function(e) {
981
        if(AJS.isIe())
982
            window.event.returnValue = false;
983
        else
984
            e.preventDefault();
985
    },
986
987
988
////
989
// Drag and drop
990
////
991
    dragAble: function(elm, /*optional*/ handler, args) {
992
        if(!args)
993
            args = {};
994
        if(!AJS.isDefined(args['move_x']))
995
            args['move_x'] = true;
996
        if(!AJS.isDefined(args['move_y']))
997
            args['move_y'] = true;
998
        if(!AJS.isDefined(args['moveable']))
999
            args['moveable'] = false;
1000
        if(!AJS.isDefined(args['hide_on_move']))
1001
            args['hide_on_move'] = true;
1002
        if(!AJS.isDefined(args['on_mouse_up']))
1003
            args['on_mouse_up'] = null;
1004
        if(!AJS.isDefined(args['cursor']))
1005
            args['cursor'] = 'move';
1006
        if(!AJS.isDefined(args['max_move']))
1007
            args['max_move'] = {'top': null, 'left': null};
1008
1009
        elm = AJS.$(elm);
1010
1011
        if(!handler)
1012
            handler = elm;
1013
1014
        handler = AJS.$(handler);
1015
        var old_cursor = handler.style.cursor;
1016
        handler.style.cursor = args['cursor'];
1017
        elm.style.position = 'relative';
1018
1019
        AJS.addClass(handler, '_ajs_handler');
1020
        handler._args = args;
1021
        handler._elm = elm;
1022
        AJS.AEV(handler, 'mousedown', AJS._dragStart);
1023
    },
1024
1025
    _dragStart: function(e) {
1026
        var handler = AJS.getEventElm(e);
1027
        if(!AJS.hasClass(handler, '_ajs_handler')) {
1028
            handler = AJS.getParentBytc(handler, null, '_ajs_handler');
1029
        }
1030
        if(handler)
1031
            AJS._dragInit(e, handler._elm, handler._args);
1032
    },
1033
1034
    dropZone: function(elm, args) {
1035
        elm = AJS.$(elm);
1036
        var item = {elm: elm};
1037
        AJS.update(item, args);
1038
        AJS._drop_zones.push(item);
1039
    },
1040
1041
    removeDragAble: function(elm) {
1042
        AJS.REV(elm, 'mousedown', AJS._dragStart);
1043
        elm.style.cursor = '';
1044
    },
1045
1046
    removeDropZone: function(elm) {
1047
        var i = AJS.getIndex(elm, AJS._drop_zones, function(item) {
1048
            if(item.elm == elm) return true;
1049
        });
1050
        if(i != -1) {
1051
            AJS._drop_zones.splice(i, 1);
1052
        }
1053
    },
1054
1055
    _dragInit: function(e, click_elm, args) {
1056
        AJS.drag_obj = new Object();
1057
        AJS.drag_obj.args = args;
1058
1059
        AJS.drag_obj.click_elm = click_elm;
1060
        AJS.drag_obj.mouse_pos = AJS.getMousePos(e);
1061
        AJS.drag_obj.click_elm_pos = AJS.absolutePosition(click_elm);
1062
1063
        AJS.AEV(document, 'mousemove', AJS._dragMove, false, true);
1064
        AJS.AEV(document, 'mouseup', AJS._dragStop, false, true);
1065
1066
        if (AJS.isIe())
1067
            window.event.cancelBubble = true;
1068
        AJS.preventDefault(e);
1069
    },
1070
1071
    _initDragElm: function(elm) {
1072
        if(AJS.drag_elm && AJS.drag_elm.style.display == 'none')
1073
            AJS.removeElement(AJS.drag_elm);
1074
1075
        if(!AJS.drag_elm) {
1076
            AJS.drag_elm = AJS.DIV();
1077
            var d = AJS.drag_elm;
1078
            AJS.insertBefore(d, AJS.getBody().firstChild);
1079
            AJS.setHTML(d, elm.innerHTML);
1080
1081
            d.className = elm.className;
1082
            d.style.cssText = elm.style.cssText;
1083
1084
            d.style.position = 'absolute';
1085
            d.style.zIndex = 10000;
1086
1087
            var t = AJS.absolutePosition(elm);
1088
            AJS.setTop(d, t.y);
1089
            AJS.setLeft(d, t.x);
1090
1091
            if(AJS.drag_obj.args.on_init) {
1092
                AJS.drag_obj.args.on_init(elm);
1093
            }
1094
        }
1095
    },
1096
1097
    _dragMove: function(e) {
1098
        var drag_obj = AJS.drag_obj;
1099
        var click_elm = drag_obj.click_elm;
1100
1101
        AJS._initDragElm(click_elm);
1102
        var drag_elm = AJS.drag_elm;
1103
1104
        if(drag_obj.args['hide_on_move'])
1105
            click_elm.style.visibility = 'hidden';
1106
1107
        var cur_pos = AJS.getMousePos(e);
1108
1109
        var mouse_pos = drag_obj.mouse_pos;
1110
1111
        var click_elm_pos = drag_obj.click_elm_pos;
1112
1113
        AJS.map(AJS._drop_zones, function(d_z) {
1114
            if(AJS.isOverlapping(d_z['elm'], drag_elm)) {
1115
                if(d_z['elm'] != drag_elm) {
1116
                    var on_hover = d_z['on_hover'];
1117
                    if(on_hover)
1118
                        on_hover(d_z['elm'], click_elm, drag_elm);
1119
                }
1120
            }
1121
        });
1122
1123
        if(drag_obj.args['on_drag'])
1124
            drag_obj.args['on_drag'](click_elm, e);
1125
1126
        var max_move_top = drag_obj.args['max_move']['top'];
1127
        var max_move_left = drag_obj.args['max_move']['left'];
1128
        var p;
1129
        if(drag_obj.args['move_x']) {
1130
            p = cur_pos.x - (mouse_pos.x - click_elm_pos.x);
1131
            if(max_move_left == null || max_move_left <= p)
1132
                AJS.setLeft(elm, p);
1133
        }
1134
1135
        if(drag_obj.args['move_y']) {
1136
            p = cur_pos.y - (mouse_pos.y - click_elm_pos.y);
1137
            if(max_move_top == null || max_move_top <= p)
1138
                AJS.setTop(elm, p);
1139
        }
1140
        if(AJS.isIe()) {
1141
            window.event.cancelBubble = true;
1142
            window.event.returnValue = false;
1143
        }
1144
        else
1145
            e.preventDefault();
1146
    },
1147
1148
    _dragStop: function(e) {
1149
        var drag_obj = AJS.drag_obj;
1150
        var drag_elm = AJS.drag_elm;
1151
        var click_elm = drag_obj.click_elm;
1152
1153
        AJS.REV(document, "mousemove", AJS._dragMove, true);
1154
        AJS.REV(document, "mouseup", AJS._dragStop, true);
1155
1156
        var dropped = false;
1157
        AJS.map(AJS._drop_zones, function(d_z) {
1158
            if(AJS.isOverlapping(d_z['elm'], click_elm)) {
1159
                if(d_z['elm'] != click_elm) {
1160
                    var on_drop = d_z['on_drop'];
1161
                    if(on_drop) {
1162
                        dropped = true;
1163
                        on_drop(d_z['elm'], click_elm);
1164
                    }
1165
                }
1166
            }
1167
        });
1168
1169
        if(drag_obj.args['moveable']) {
1170
            var t = parseInt(click_elm.style.top) || 0;
1171
            var l = parseInt(click_elm.style.left) || 0;
1172
            var drag_elm_xy = AJS.absolutePosition(drag_elm);
1173
            var click_elm_xy = AJS.absolutePosition(click_elm);
1174
            AJS.setTop(click_elm, t + drag_elm_xy.y - click_elm_xy.y);
1175
            AJS.setLeft(click_elm, l + drag_elm_xy.x - click_elm_xy.x);
1176
        }
1177
1178
        if(!dropped && drag_obj.args['on_mouse_up'])
1179
            drag_obj.args['on_mouse_up'](click_elm, e);
1180
1181
        if(drag_obj.args['hide_on_move'])
1182
            drag_obj.click_elm.style.visibility = 'visible';
1183
1184
        if(drag_obj.args.on_end) {
1185
            drag_obj.args.on_end(click_elm);
1186
        }
1187
1188
        AJS._dragObj = null;
1189
        if(drag_elm)
1190
            AJS.hideElement(drag_elm);
1191
        AJS.drag_elm = null;
1192
    },
1193
1194
1195
////
1196
// Misc.
1197
////
1198
    keys: function(obj) {
1199
        var rval = [];
1200
        for (var prop in obj) {
1201
            rval.push(prop);
1202
        }
1203
        return rval;
1204
    },
1205
1206
    values: function(obj) {
1207
        var rval = [];
1208
        for (var prop in obj) {
1209
            rval.push(obj[prop]);
1210
        }
1211
        return rval;
1212
    },
1213
1214
    urlencode: function(str) {
1215
        return encodeURIComponent(str.toString());
1216
    },
1217
1218
    isDefined: function(o) {
1219
        return (o != "undefined" && o != null)
1220
    },
1221
1222
    isArray: function(obj) {
1223
        return obj instanceof Array;
1224
    },
1225
1226
    isString: function(obj) {
1227
        return (typeof obj == 'string');
1228
    },
1229
1230
    isNumber: function(obj) {
1231
        return (typeof obj == 'number');
1232
    },
1233
1234
    isObject: function(obj) {
1235
        return (typeof obj == 'object');
1236
    },
1237
1238
    isFunction: function(obj) {
1239
        return (typeof obj == 'function');
1240
    },
1241
1242
    isDict: function(o) {
1243
        var str_repr = String(o);
1244
        return str_repr.indexOf(" Object") != -1;
1245
    },
1246
1247
    exportToGlobalScope: function() {
1248
        for(e in AJS)
1249
            eval(e + " = AJS." + e);
1250
    },
1251
1252
    log: function(o) {
1253
        if(AJS.isMozilla())
1254
            console.log(o);
1255
        else {
1256
            var div = AJS.DIV({'style': 'color: green'});
1257
            AJS.ACN(AJS.getBody(), AJS.setHTML(div, ''+o));
1258
        }
1259
    }
1260
1261
}
1262
1263
AJS.Class = function(members) {
1264
    var fn = function() {
1265
        if(arguments[0] != 'no_init') {
1266
            return this.init.apply(this, arguments);
1267
        }
1268
    }
1269
    fn.prototype = members;
1270
    AJS.update(fn, AJS.Class.prototype);
1271
    return fn;
1272
}
1273
AJS.Class.prototype = {
1274
    extend: function(members) {
1275
        var parent = new this('no_init');
1276
        for(k in members) {
1277
            var prev = parent[k];
1278
            var cur = members[k];
1279
            if (prev && prev != cur && typeof cur == 'function') {
1280
                cur = this._parentize(cur, prev);
1281
            }
1282
            parent[k] = cur;
1283
        }
1284
        return new AJS.Class(parent);
1285
    },
1286
1287
    implement: function(members) {
1288
        AJS.update(this.prototype, members);
1289
    },
1290
1291
    _parentize: function(cur, prev) {
1292
        return function(){
1293
            this.parent = prev;
1294
            return cur.apply(this, arguments);
1295
        }
1296
    }
1297
};
1298
1299
//Shortcuts
1300
AJS.$ = AJS.getElement;
1301
AJS.$$ = AJS.getElements;
1302
AJS.$f = AJS.getFormElement;
1303
AJS.$b = AJS.bind;
1304
AJS.$p = AJS.partial;
1305
AJS.$FA = AJS.forceArray;
1306
AJS.$A = AJS.createArray;
1307
AJS.DI = AJS.documentInsert;
1308
AJS.ACN = AJS.appendChildNodes;
1309
AJS.RCN = AJS.replaceChildNodes;
1310
AJS.AEV = AJS.addEventListener;
1311
AJS.REV = AJS.removeEventListener;
1312
AJS.$bytc = AJS.getElementsByTagAndClassName;
1313
1314
AJSDeferred = function(req) {
1315
    this.callbacks = [];
1316
    this.errbacks = [];
1317
    this.req = req;
1318
}
1319
AJSDeferred.prototype = {
1320
    excCallbackSeq: function(req, list) {
1321
        var data = req.responseText;
1322
        while (list.length > 0) {
1323
            var fn = list.pop();
1324
            var new_data = fn(data, req);
1325
            if(new_data)
1326
                data = new_data;
1327
        }
1328
    },
1329
1330
    callback: function () {
1331
        this.excCallbackSeq(this.req, this.callbacks);
1332
    },
1333
1334
    errback: function() {
1335
        if(this.errbacks.length == 0)
1336
            alert("Error encountered:\n" + this.req.responseText);
1337
1338
        this.excCallbackSeq(this.req, this.errbacks);
1339
    },
1340
1341
    addErrback: function(fn) {
1342
        this.errbacks.unshift(fn);
1343
    },
1344
1345
    addCallback: function(fn) {
1346
        this.callbacks.unshift(fn);
1347
    },
1348
1349
    addCallbacks: function(fn1, fn2) {
1350
        this.addCallback(fn1);
1351
        this.addErrback(fn2);
1352
    },
1353
1354
    sendReq: function(data) {
1355
        if(AJS.isObject(data)) {
1356
            this.req.send(AJS.queryArguments(data));
1357
        }
1358
        else if(AJS.isDefined(data))
1359
            this.req.send(data);
1360
        else {
1361
            this.req.send("");
1362
        }
1363
    }
1364
};
1365
1366
//Prevent memory-leaks
1367
AJS.addEventListener(window, 'unload', AJS._unloadListeners);
1368
AJS._createDomShortcuts()
1369
}
1370
1371
script_loaded = true;
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/base/AJS_fx.js (+194 lines)
Line 0 Link Here
1
/*
2
Last Modified: 25/12/06 18:26:30
3
4
AJS effects
5
    A very small library with a lot of functionality
6
AUTHOR
7
    4mir Salihefendic (http://amix.dk) - amix@amix.dk
8
LICENSE
9
    Copyright (c) 2006 Amir Salihefendic. All rights reserved.
10
    Copyright (c) 2005 Bob Ippolito. All rights reserved.
11
    Copyright (c) 2006 Valerio Proietti, http://www.mad4milk.net
12
    http://www.opensource.org/licenses/mit-license.php
13
VERSION
14
    3.6
15
SITE
16
    http://orangoo.com/AmiNation/AJS
17
**/
18
AJS.fx = {
19
    _shades: {0: 'ffffff', 1: 'ffffee', 2: 'ffffdd',
20
              3: 'ffffcc', 4: 'ffffbb', 5: 'ffffaa',
21
              6: 'ffff99'},
22
23
    highlight: function(elm, options) {
24
        var base = new AJS.fx.Base();
25
        base.elm = AJS.$(elm);
26
        base.setOptions(options);
27
        base.options.duration = 600;
28
29
        AJS.update(base, {
30
            increase: function(){
31
                if(this.now == 7)
32
                    elm.style.backgroundColor = 'transparent';
33
                else
34
                    elm.style.backgroundColor = '#' + AJS.fx._shades[Math.floor(this.now)];
35
            }
36
        });
37
        return base.custom(6, 0);
38
    },
39
40
    fadeIn: function(elm, options) {
41
        options = options || {};
42
        if(!options.from) {
43
            options.from = 0;
44
            AJS.setOpacity(elm, 0);
45
        }
46
        if(!options.to) options.to = 1;
47
        var s = new AJS.fx.Style(elm, 'opacity', options);
48
        return s.custom(options.from, options.to);
49
    },
50
51
    fadeOut: function(elm, options) {
52
        options = options || {};
53
        if(!options.from) options.from = 1;
54
        if(!options.to) options.to = 0;
55
        options.duration = 300;
56
        var s = new AJS.fx.Style(elm, 'opacity', options);
57
        return s.custom(options.from, options.to);
58
    },
59
60
    setWidth: function(elm, options) {
61
        var s = new AJS.fx.Style(elm, 'width', options);
62
        return s.custom(options.from, options.to);
63
    },
64
65
    setHeight: function(elm, options) {
66
        var s = new AJS.fx.Style(elm, 'height', options);
67
        return s.custom(options.from, options.to);
68
    }
69
}
70
71
72
//From moo.fx
73
AJS.fx.Base = new AJS.Class({
74
    init: function() {
75
        AJS.bindMethods(this);
76
    },
77
78
    setOptions: function(options){
79
        this.options = AJS.update({
80
                onStart: function(){},
81
                onComplete: function(){},
82
                transition: AJS.fx.Transitions.sineInOut,
83
                duration: 500,
84
                wait: true,
85
                fps: 50
86
        }, options || {});
87
    },
88
89
    step: function(){
90
        var time = new Date().getTime();
91
        if (time < this.time + this.options.duration){
92
            this.cTime = time - this.time;
93
            this.setNow();
94
        } else {
95
            setTimeout(AJS.$b(this.options.onComplete, this, [this.elm]), 10);
96
            this.clearTimer();
97
            this.now = this.to;
98
        }
99
        this.increase();
100
    },
101
102
    setNow: function(){
103
        this.now = this.compute(this.from, this.to);
104
    },
105
106
    compute: function(from, to){
107
        var change = to - from;
108
        return this.options.transition(this.cTime, from, change, this.options.duration);
109
    },
110
111
    clearTimer: function(){
112
        clearInterval(this.timer);
113
        this.timer = null;
114
        return this;
115
    },
116
117
    _start: function(from, to){
118
        if (!this.options.wait) this.clearTimer();
119
        if (this.timer) return;
120
        setTimeout(AJS.$p(this.options.onStart, this.elm), 10);
121
        this.from = from;
122
        this.to = to;
123
        this.time = new Date().getTime();
124
        this.timer = setInterval(this.step, Math.round(1000/this.options.fps));
125
        return this;
126
    },
127
128
    custom: function(from, to){
129
        return this._start(from, to);
130
    },
131
132
    set: function(to){
133
        this.now = to;
134
        this.increase();
135
        return this;
136
    },
137
138
    setStyle: function(elm, property, val) {
139
        if(this.property == 'opacity')
140
            AJS.setOpacity(elm, val);
141
        else
142
            AJS.setStyle(elm, property, val);
143
    }
144
});
145
146
AJS.fx.Style = AJS.fx.Base.extend({
147
    init: function(elm, property, options) {
148
        this.parent();
149
        this.elm = elm;
150
        this.setOptions(options);
151
        this.property = property;
152
    },
153
154
    increase: function(){
155
        this.setStyle(this.elm, this.property, this.now);
156
    }
157
});
158
159
AJS.fx.Styles = AJS.fx.Base.extend({
160
    init: function(elm, options){
161
        this.parent();
162
        this.elm = AJS.$(elm);
163
        this.setOptions(options);
164
        this.now = {};
165
    },
166
167
    setNow: function(){
168
        for (p in this.from)
169
            this.now[p] = this.compute(this.from[p], this.to[p]);
170
    },
171
172
    custom: function(obj){
173
        if (this.timer && this.options.wait) return;
174
        var from = {};
175
        var to = {};
176
        for (p in obj){
177
                from[p] = obj[p][0];
178
                to[p] = obj[p][1];
179
        }
180
        return this._start(from, to);
181
    },
182
183
    increase: function(){
184
        for (var p in this.now) this.setStyle(this.elm, p, this.now[p]);
185
    }
186
});
187
188
//Transitions (c) 2003 Robert Penner (http://www.robertpenner.com/easing/), BSD License.
189
AJS.fx.Transitions = {
190
    linear: function(t, b, c, d) { return c*t/d + b; },
191
    sineInOut: function(t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }
192
};
193
194
script_loaded = true;
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/base/base.css (+32 lines)
Line 0 Link Here
1
/* Last-Modified: 28/06/06 00:08:22 */
2
#GB_overlay {
3
    background-color: #000;
4
    position: absolute;
5
    margin: auto;
6
    top: 0;
7
    left: 0;
8
    z-index: 100;
9
}
10
11
#GB_window {
12
    left: 0;
13
    top: 0;
14
    font-size: 1px;
15
    position: absolute;
16
    overflow: visible;
17
    z-index: 150;
18
}
19
20
#GB_window .content {
21
    width: auto;
22
    margin: 0;
23
    padding: 0;
24
}
25
26
#GB_frame {
27
    border: 0;
28
    margin: 0;
29
    padding: 0;
30
    overflow: auto;
31
    white-space: nowrap;
32
}
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/base/base.js (+192 lines)
Line 0 Link Here
1
var GB_CURRENT = null;
2
3
GB_hide = function() {
4
    GB_CURRENT.hide();
5
}
6
7
GreyBox = new AJS.Class({
8
    init: function(options) {
9
        this.use_fx = AJS.fx;
10
        this.type = "page";
11
        this.overlay_click_close = false;
12
        this.salt = 0;
13
        this.root_dir = GB_ROOT_DIR;
14
        this.callback_fns = [];
15
        this.reload_on_close = false;
16
        this.src_loader = this.root_dir + 'loader_frame.html';
17
18
        //Solve the www issue
19
        var h_www = window.location.hostname.indexOf('www');
20
        var src_www = this.src_loader.indexOf('www');
21
        if(h_www != -1 && src_www == -1)
22
            this.src_loader = this.src_loader.replace('://', '://www.');
23
24
        if(h_www == -1 && src_www != -1)
25
            this.src_loader = this.src_loader.replace('://www.', '://');
26
27
        this.show_loading = true;
28
        AJS.update(this, options);
29
    },
30
31
    addCallback: function(fn) {
32
        if(fn) this.callback_fns.push(fn);
33
    },
34
35
    show: function(url) {
36
        GB_CURRENT = this;
37
        this.url = url;
38
39
        var elms = [AJS.$bytc("object"), AJS.$bytc("select")];
40
        AJS.map(AJS.flattenList(elms), function(elm) {
41
            elm.style.visibility = "hidden";
42
        });
43
44
        this.createElements();
45
        return false;
46
    },
47
48
    hide: function() {
49
        var c_bs = this.callback_fns;
50
        if(c_bs != []) {
51
            AJS.map(c_bs, function(fn) {
52
                fn();
53
            });
54
        }
55
56
        this.onHide();
57
        if(this.use_fx) {
58
            var elm = this.overlay;
59
            AJS.fx.fadeOut(this.overlay, {
60
                onComplete: function() {
61
                    AJS.removeElement(elm);
62
                    elm = null;
63
                },
64
                duration: 300
65
            });
66
            AJS.removeElement(this.g_window);
67
        }
68
        else {
69
            AJS.removeElement(this.g_window, this.overlay);
70
        }
71
72
        this.removeFrame();
73
74
        AJS.REV(window, "scroll", _GB_setOverlayDimension);
75
        AJS.REV(window, "resize", _GB_update);
76
77
        var elms = [AJS.$bytc("object"), AJS.$bytc("select")];
78
        AJS.map(AJS.flattenList(elms), function(elm) {
79
            elm.style.visibility = "visible";
80
        });
81
82
        GB_CURRENT = null;
83
84
        if(this.reload_on_close)
85
            window.location.reload();
86
    },
87
88
    update: function() {
89
        this.setOverlayDimension();
90
        this.setFrameSize();
91
        this.setWindowPosition();
92
    },
93
94
    createElements: function() {
95
        this.initOverlay();
96
97
        this.g_window = AJS.DIV({'id': 'GB_window'});
98
        AJS.hideElement(this.g_window);
99
        AJS.getBody().insertBefore(this.g_window, this.overlay.nextSibling);
100
101
        this.initFrame();
102
        this.initHook();
103
        this.update();
104
105
        var me = this;
106
        if(this.use_fx) {
107
            AJS.fx.fadeIn(this.overlay, {
108
                duration: 300,
109
                to: 0.7,
110
                onComplete: function() {
111
                    me.onShow();
112
                    AJS.showElement(me.g_window);
113
                    me.startLoading();
114
                }
115
            });
116
        }
117
        else {
118
            AJS.setOpacity(this.overlay, 0.7);
119
            AJS.showElement(this.g_window);
120
            this.onShow();
121
            this.startLoading();
122
        }
123
124
        AJS.AEV(window, "scroll", _GB_setOverlayDimension);
125
        AJS.AEV(window, "resize", _GB_update);
126
    },
127
128
    removeFrame: function() {
129
        try{ AJS.removeElement(this.iframe); }
130
        catch(e) {}
131
132
        this.iframe = null;
133
    },
134
135
    startLoading: function() {
136
        this.iframe.src = this.src_loader + '?s='+this.salt++;
137
        AJS.showElement(this.iframe);
138
    },
139
140
    setOverlayDimension: function() {
141
        var page_size = AJS.getWindowSize();
142
        if(AJS.isMozilla() || AJS.isOpera())
143
            AJS.setWidth(this.overlay, "100%");
144
        else
145
            AJS.setWidth(this.overlay, page_size.w);
146
147
        var max_height = Math.max(AJS.getScrollTop()+page_size.h, AJS.getScrollTop()+this.height);
148
149
        if(max_height < AJS.getScrollTop())
150
            AJS.setHeight(this.overlay, max_height);
151
        else
152
            AJS.setHeight(this.overlay, AJS.getScrollTop()+page_size.h);
153
    },
154
155
    initOverlay: function() {
156
        this.overlay = AJS.DIV({'id': 'GB_overlay'});
157
158
        if(this.overlay_click_close)
159
            AJS.AEV(this.overlay, "click", GB_hide);
160
161
        AJS.setOpacity(this.overlay, 0);
162
        AJS.getBody().insertBefore(this.overlay, AJS.getBody().firstChild);
163
    },
164
165
    initFrame: function() {
166
        if(!this.iframe) {
167
            var d = {'name': 'GB_frame', 'class': 'GB_frame', 'frameBorder': 0};
168
            this.iframe = AJS.IFRAME(d);
169
            this.middle_cnt = AJS.DIV({'class': 'content'}, this.iframe);
170
171
            this.top_cnt = AJS.DIV();
172
            this.bottom_cnt = AJS.DIV();
173
174
            AJS.ACN(this.g_window, this.top_cnt, this.middle_cnt, this.bottom_cnt);
175
        }
176
    },
177
178
    /* Can be implemented */
179
    onHide: function() {},
180
    onShow: function() {},
181
    setFrameSize: function() {},
182
    setWindowPosition: function() {},
183
    initHook: function() {}
184
185
});
186
187
_GB_update = function() { if(GB_CURRENT) GB_CURRENT.update(); }
188
_GB_setOverlayDimension = function() { if(GB_CURRENT) GB_CURRENT.setOverlayDimension(); }
189
190
AJS.preloadImages(GB_ROOT_DIR+'indicator.gif');
191
192
script_loaded = true;
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/base/loader_frame.html (+104 lines)
Line 0 Link Here
1
<!--
2
Notice: I feel so dirty doing this, but its the only way to make it cross browser.
3
-->
4
<html>
5
<head>
6
  <script>
7
    var GB = parent.GB_CURRENT;
8
    document.write('<script type="text/javascript" src="AJS.js"><\/script>');
9
    if(GB.use_fx) {
10
        document.write('<script type="text/javascript" src="AJS_fx.js"><\/script>');
11
    }
12
  </script>
13
  <style>
14
    body {
15
      padding: 0;
16
      margin: 0;
17
      overflow: hidden;
18
    }
19
20
    #GB_frame {
21
      visibility: hidden;
22
      width: 100%;
23
      height: 100%;
24
    }
25
26
    #loading {
27
      padding-top: 50px;
28
      position: absolute;
29
      width: 100%;
30
      top: 0;
31
      text-align: center;
32
      vertical-align: middle;
33
    }
34
  </style>
35
</head>
36
<body>
37
38
<div id="loading">
39
  <img src="indicator.gif">
40
</div>
41
42
<script>
43
var loading = AJS.$('loading');
44
var gb_type = GB.type;
45
var gb_url = GB.url;
46
47
//Start loading in the iframe
48
if(gb_type == "page") {
49
  document.write('<iframe id="GB_frame" src="' + gb_url + '" frameborder="0"></iframe>');
50
}
51
else {
52
  var img_holder = new Image();
53
  img_holder.src = gb_url;
54
  document.write('<img id="GB_frame" src="' + gb_url + '">');
55
}
56
var frame = AJS.$('GB_frame');
57
</script>
58
59
</body>
60
<script>
61
function setupOuterGB() {
62
    frame.style.visibility = 'visible';
63
    GB.setFrameSize();
64
    GB.setWindowPosition();
65
}
66
67
function loaded() {
68
    AJS.removeElement(loading);
69
70
    GB.overlay.innerHTML += "&nbsp;"; //Safari bugfix
71
72
    if(gb_type == "image") {
73
        if(img_holder.width != 0 && img_holder.height != 0) {
74
            var width = img_holder.width;
75
            var height = img_holder.height;
76
77
            GB.width = width;
78
            GB.height = height;
79
80
            setupOuterGB();
81
82
            if(GB.use_fx) {
83
                AJS.setOpacity(frame, 0);
84
                AJS.fx.fadeIn(frame);
85
            }
86
        }
87
    }
88
    else {
89
        GB.width = frame.offsetWidth;
90
        GB.height = frame.offsetHeight;
91
        setupOuterGB();
92
    }
93
}
94
95
if(GB.show_loading) {
96
    AJS.AEV(window, 'load', function(e) {
97
        loaded();
98
    });
99
}
100
else {
101
    loaded();
102
}
103
</script>
104
</html>
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/gallery/gallery.css (+51 lines)
Line 0 Link Here
1
.GB_Gallery {
2
    margin: 0 22px 0 22px;
3
}
4
5
.GB_Gallery .content {
6
    background-color: #fff;
7
    border: 3px solid #ddd;
8
}
9
10
.GB_header {
11
    top: 10px;
12
    left: 0;
13
    margin: 0;
14
    z-index: 500;
15
    position: absolute;
16
    border-bottom: 2px solid #555;
17
    border-top: 2px solid #555;
18
}
19
20
.GB_header .inner {
21
    background-color: #333;
22
    font-family: Arial, Verdana, sans-serif;
23
    padding: 2px 20px 2px 20px;
24
}
25
26
.GB_header table {
27
    margin: 0;
28
    width: 100%;
29
    border-collapse: collapse;
30
}
31
32
.GB_header .caption {
33
    text-align: left;
34
    color: #eee;
35
    white-space: nowrap;
36
    font-size: 20px;
37
}
38
39
.GB_header .close {
40
    text-align: right;
41
}
42
43
.GB_header .close img {
44
    z-index: 500;
45
    cursor: pointer;
46
}
47
48
.GB_header .middle {
49
    white-space: nowrap;
50
    text-align: center;
51
}
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/gallery/gallery.js (+114 lines)
Line 0 Link Here
1
GB_showImage = function(caption, url, callback_fn) {
2
    var options = {
3
        width: 300,
4
        height: 300,
5
        type: 'image',
6
7
        fullscreen: false,
8
        center_win: true,
9
        caption: caption,
10
        callback_fn: callback_fn
11
    }
12
    var win = new GB_Gallery(options);
13
    return win.show(url);
14
}
15
16
GB_showPage = function(caption, url, callback_fn) {
17
    var options = {
18
        type: 'page',
19
20
        caption: caption,
21
        callback_fn: callback_fn,
22
        fullscreen: true,
23
        center_win: false
24
    }
25
    var win = new GB_Gallery(options);
26
    return win.show(url);
27
}
28
29
GB_Gallery = GreyBox.extend({
30
    init: function(options) {
31
        this.parent({});
32
        this.img_close = this.root_dir + 'g_close.gif';
33
        AJS.update(this, options);
34
        this.addCallback(this.callback_fn);
35
    },
36
37
    initHook: function() {
38
        AJS.addClass(this.g_window, 'GB_Gallery');
39
40
        var inner = AJS.DIV({'class': 'inner'});
41
        this.header = AJS.DIV({'class': 'GB_header'}, inner);
42
        AJS.setOpacity(this.header, 0);
43
        AJS.getBody().insertBefore(this.header, this.overlay.nextSibling);
44
45
        var td_caption = AJS.TD({'id': 'GB_caption', 'class': 'caption', 'width': '40%'}, this.caption);
46
        var td_middle = AJS.TD({'id': 'GB_middle', 'class': 'middle', 'width': '20%'});
47
48
        var img_close = AJS.IMG({'src': this.img_close});
49
        AJS.AEV(img_close, 'click', GB_hide);
50
        var td_close = AJS.TD({'class': 'close', 'width': '40%'}, img_close);
51
52
        var tbody = AJS.TBODY(AJS.TR(td_caption, td_middle, td_close));
53
54
        var table = AJS.TABLE({'cellspacing': '0', 'cellpadding': 0, 'border': 0}, tbody);
55
        AJS.ACN(inner, table);
56
57
        if(this.fullscreen)
58
            AJS.AEV(window, 'scroll', AJS.$b(this.setWindowPosition, this));
59
        else
60
            AJS.AEV(window, 'scroll', AJS.$b(this._setHeaderPos, this));
61
    },
62
63
    setFrameSize: function() {
64
        var overlay_w = this.overlay.offsetWidth;
65
        var page_size = AJS.getWindowSize();
66
67
        if(this.fullscreen) {
68
            this.width = overlay_w-40;
69
            this.height = page_size.h-80;
70
        }
71
        AJS.setWidth(this.iframe, this.width);
72
        AJS.setHeight(this.iframe, this.height);
73
74
        AJS.setWidth(this.header, overlay_w);
75
    },
76
77
    _setHeaderPos: function() {
78
        AJS.setTop(this.header, AJS.getScrollTop()+10);
79
    },
80
81
    setWindowPosition: function() {
82
        var overlay_w = this.overlay.offsetWidth;
83
        var page_size = AJS.getWindowSize();
84
        AJS.setLeft(this.g_window, ((overlay_w - 50 - this.width)/2));
85
86
        var header_top = AJS.getScrollTop()+55;
87
        if(!this.center_win) {
88
            AJS.setTop(this.g_window, header_top);
89
        }
90
        else {
91
            var fl = ((page_size.h - this.height) /2) + 20 + AJS.getScrollTop();
92
            if(fl < 0) fl = 0;
93
            if(header_top > fl) {
94
                fl = header_top;
95
            }
96
            AJS.setTop(this.g_window, fl);
97
        }
98
        this._setHeaderPos();
99
    },
100
101
    onHide: function() {
102
        AJS.removeElement(this.header);
103
        AJS.removeClass(this.g_window, 'GB_Gallery');
104
    },
105
106
    onShow: function() {
107
        if(this.use_fx)
108
            AJS.fx.fadeIn(this.header, {to: 1});
109
        else
110
            AJS.setOpacity(this.header, 1);
111
    }
112
});
113
114
AJS.preloadImages(GB_ROOT_DIR+'g_close.gif');
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/set/set.css (+20 lines)
Line 0 Link Here
1
#GB_middle {
2
    color: #eee;
3
}
4
5
#GB_middle img {
6
    cursor: pointer;
7
    vertical-align: middle;
8
}
9
10
#GB_middle .disabled {
11
    cursor: default;
12
}
13
14
#GB_middle .left {
15
    padding-right: 10px;
16
}
17
18
#GB_middle .right {
19
    padding-left: 10px;
20
}
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/set/set.js (+101 lines)
Line 0 Link Here
1
GB_showFullScreenSet = function(set, start_index, callback_fn) {
2
    var options = {
3
        type: 'page',
4
        fullscreen: true,
5
        center_win: false
6
    }
7
    var gb_sets = new GB_Sets(options, set);
8
    gb_sets.addCallback(callback_fn);
9
    gb_sets.showSet(start_index-1);
10
    return false;
11
}
12
13
GB_showImageSet = function(set, start_index, callback_fn) {
14
    var options = {
15
        type: 'image',
16
        fullscreen: false,
17
        center_win: true,
18
        width: 300,
19
        height: 300
20
    }
21
    var gb_sets = new GB_Sets(options, set);
22
    gb_sets.addCallback(callback_fn);
23
    gb_sets.showSet(start_index-1);
24
    return false;
25
}
26
27
GB_Sets = GB_Gallery.extend({
28
    init: function(options, set) {
29
        this.parent(options);
30
        if(!this.img_next) this.img_next = this.root_dir + 'next.gif';
31
        if(!this.img_prev) this.img_prev = this.root_dir + 'prev.gif';
32
        this.current_set = set;
33
    },
34
35
    showSet: function(start_index) {
36
        this.current_index = start_index;
37
38
        var item = this.current_set[this.current_index];
39
        this.show(item.url);
40
        this._setCaption(item.caption);
41
42
        this.btn_prev = AJS.IMG({'class': 'left', src: this.img_prev});
43
        this.btn_next = AJS.IMG({'class': 'right', src: this.img_next});
44
45
        AJS.AEV(this.btn_prev, 'click', AJS.$b(this.switchPrev, this));
46
        AJS.AEV(this.btn_next, 'click', AJS.$b(this.switchNext, this));
47
48
        GB_STATUS = AJS.SPAN({'class': 'GB_navStatus'});
49
        AJS.ACN(AJS.$('GB_middle'), this.btn_prev, GB_STATUS, this.btn_next);
50
51
        this.updateStatus();
52
    },
53
54
    updateStatus: function() {
55
        AJS.setHTML(GB_STATUS, (this.current_index + 1) + ' / ' + this.current_set.length);
56
        if(this.current_index == 0) {
57
            AJS.addClass(this.btn_prev, 'disabled');
58
        }
59
        else {
60
            AJS.removeClass(this.btn_prev, 'disabled');
61
        }
62
63
        if(this.current_index == this.current_set.length-1) {
64
            AJS.addClass(this.btn_next, 'disabled');
65
        }
66
        else {
67
            AJS.removeClass(this.btn_next, 'disabled');
68
        }
69
    },
70
71
    _setCaption: function(caption) {
72
        AJS.setHTML(AJS.$('GB_caption'), caption);
73
    },
74
75
    updateFrame: function() {
76
        var item = this.current_set[this.current_index];
77
        this._setCaption(item.caption);
78
        this.url = item.url;
79
        this.startLoading();
80
    },
81
82
    switchPrev: function() {
83
        if(this.current_index != 0) {
84
            this.current_index--;
85
            this.updateFrame();
86
            this.updateStatus();
87
        }
88
    },
89
90
    switchNext: function() {
91
        if(this.current_index != this.current_set.length-1) {
92
            this.current_index++
93
            this.updateFrame();
94
            this.updateStatus();
95
        }
96
    }
97
});
98
99
AJS.AEV(window, 'load', function() {
100
    AJS.preloadImages(GB_ROOT_DIR+'next.gif', GB_ROOT_DIR+'prev.gif');
101
});
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/window/window.css (+39 lines)
Line 0 Link Here
1
.GB_Window .content {
2
    background-color: #fff;
3
    border: 3px solid #ccc;
4
    border-top: none;
5
}
6
7
.GB_Window .header {
8
    border-bottom: 1px solid #aaa;
9
    border-top: 1px solid #999;
10
    border-left: 3px solid #ccc;
11
    border-right: 3px solid #ccc;
12
    margin: 0;
13
14
    height: 22px;
15
    font-size: 12px;
16
    padding: 3px 0;
17
    color: #333;
18
}
19
20
.GB_Window .caption {
21
    font-size: 12px;
22
    text-align: left;
23
    font-weight: bold;
24
    white-space: nowrap;
25
    padding-right: 20px;
26
}
27
28
.GB_Window .close { text-align: right; }
29
.GB_Window .close span {
30
    font-size: 12px;
31
    cursor: pointer;
32
}
33
.GB_Window .close img {
34
    cursor: pointer;
35
    padding: 0 3px 0 0;
36
}
37
38
.GB_Window .on { border-bottom: 1px solid #333; }
39
.GB_Window .click { border-bottom: 1px solid red; }
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/greybox_source/window/window.js (+109 lines)
Line 0 Link Here
1
GB_show = function(caption, url, /* optional */ height, width, callback_fn) {
2
    var options = {
3
        caption: caption,
4
        height: height || 500,
5
        width: width || 500,
6
        fullscreen: false,
7
        callback_fn: callback_fn
8
    }
9
    var win = new GB_Window(options);
10
    return win.show(url);
11
}
12
13
GB_showCenter = function(caption, url, /* optional */ height, width, callback_fn) {
14
    var options = {
15
        caption: caption,
16
        center_win: true,
17
        height: height || 500,
18
        width: width || 500,
19
        fullscreen: false,
20
        callback_fn: callback_fn
21
    }
22
    var win = new GB_Window(options);
23
    return win.show(url);
24
}
25
26
GB_showFullScreen = function(caption, url, callback_fn) {
27
    var options = {
28
        caption: caption,
29
        fullscreen: true,
30
        callback_fn: callback_fn
31
    }
32
    var win = new GB_Window(options);
33
    return win.show(url);
34
}
35
36
GB_Window = GreyBox.extend({
37
    init: function(options) {
38
        this.parent({});
39
        this.img_header = this.root_dir+"header_bg.gif";
40
        this.img_close = this.root_dir+"w_close.gif";
41
        this.show_close_img = true;
42
        AJS.update(this, options);
43
        this.addCallback(this.callback_fn);
44
    },
45
46
    initHook: function() {
47
        AJS.addClass(this.g_window, 'GB_Window');
48
49
        this.header = AJS.TABLE({'class': 'header'});
50
        this.header.style.backgroundImage = "url("+ this.img_header +")";
51
52
        var td_caption = AJS.TD({'class': 'caption'}, this.caption);
53
        var td_close = AJS.TD({'class': 'close'});
54
55
        if(this.show_close_img) {
56
            var img_close = AJS.IMG({'src': this.img_close});
57
            var span = AJS.SPAN('Close');
58
59
            var btn = AJS.DIV(img_close, span);
60
61
            AJS.AEV([img_close, span], 'mouseover', function() { AJS.addClass(span, 'on'); });
62
            AJS.AEV([img_close, span], 'mouseout', function() { AJS.removeClass(span, 'on'); });
63
            AJS.AEV([img_close, span], 'mousedown', function() { AJS.addClass(span, 'click'); });
64
            AJS.AEV([img_close, span], 'mouseup', function() { AJS.removeClass(span, 'click'); });
65
            AJS.AEV([img_close, span], 'click', GB_hide);
66
67
            AJS.ACN(td_close, btn);
68
        }
69
70
        tbody_header = AJS.TBODY();
71
        AJS.ACN(tbody_header, AJS.TR(td_caption, td_close));
72
73
        AJS.ACN(this.header, tbody_header);
74
        AJS.ACN(this.top_cnt, this.header);
75
76
        if(this.fullscreen)
77
            AJS.AEV(window, 'scroll', AJS.$b(this.setWindowPosition, this));
78
    },
79
80
    setFrameSize: function() {
81
        if(this.fullscreen) {
82
            var page_size = AJS.getWindowSize();
83
            overlay_h = page_size.h;
84
            this.width = Math.round(this.overlay.offsetWidth - (this.overlay.offsetWidth/100)*10);
85
            this.height = Math.round(overlay_h - (overlay_h/100)*10);
86
        }
87
88
        AJS.setWidth(this.header, this.width+6); //6 is for the left+right border
89
        AJS.setWidth(this.iframe, this.width);
90
        AJS.setHeight(this.iframe, this.height);
91
    },
92
93
    setWindowPosition: function() {
94
        var page_size = AJS.getWindowSize();
95
        AJS.setLeft(this.g_window, ((page_size.w - this.width)/2)-13);
96
97
        if(!this.center_win) {
98
            AJS.setTop(this.g_window, AJS.getScrollTop());
99
        }
100
        else {
101
            var fl = ((page_size.h - this.height) /2) - 20 + AJS.getScrollTop();
102
            if(fl < 0)
103
                fl = 0;
104
            AJS.setTop(this.g_window, fl);
105
        }
106
    }
107
});
108
109
AJS.preloadImages(GB_ROOT_DIR+'w_close.gif', GB_ROOT_DIR+'header_bg.gif');
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/installation.html (+49 lines)
Line 0 Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
    <title>GreyBox - Installation</title>
5
6
    <script type="text/javascript" src="greybox/AJS.js"></script>
7
8
    <script type="text/javascript" src="static_files/help.js"></script>
9
    <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
10
</head>
11
<body>
12
13
<script>
14
    insertHeader();
15
    insertMenu('installation');
16
</script>
17
18
<ol>
19
<li>
20
Append following to your header section (in between <code>&lt;header&gt;...&lt;/header&gt;</code>).
21
<br />
22
<span class="hl">GB_ROOT_DIR</span> is the URL where static files are located:
23
<pre>
24
<code>&lt;script type="text/javascript"&gt;
25
    var GB_ROOT_DIR = "http://mydomain.com/greybox/";
26
&lt;/script&gt;</code>
27
</pre>
28
</li>
29
GB_ROOT_DIR should be absolute.
30
31
<li>
32
Append also following scripts and one stylesheet:
33
<pre>
34
<code>&lt;script type="text/javascript" src="greybox/AJS.js"&gt;&lt;/script&gt;
35
&lt;script type="text/javascript" src="greybox/AJS_fx.js"&gt;&lt;/script&gt;
36
&lt;script type="text/javascript" src="greybox/gb_scripts.js"&gt;&lt;/script&gt;
37
&lt;link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" /&gt;</code>
38
</pre>
39
40
AJS_fx.js is optional, it's used for effects. If you don't wish effects, then don't include AJS_fx.js in your header section.
41
</li>
42
43
<li>
44
That's it, you are now ready to use GreyBox!
45
</li>
46
</ol>
47
48
</body>
49
</html>
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/normal_usage.html (+126 lines)
Line 0 Link Here
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
    <title>GreyBox - Normal usage</title>
5
6
    <script type="text/javascript">
7
        var GB_ROOT_DIR = "./greybox/";
8
    </script>
9
10
    <script type="text/javascript" src="greybox/AJS.js"></script>
11
    <script type="text/javascript" src="greybox/AJS_fx.js"></script>
12
    <script type="text/javascript" src="greybox/gb_scripts.js"></script>
13
    <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
14
15
    <script type="text/javascript" src="static_files/help.js"></script>
16
    <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
17
</head>
18
19
<body>
20
21
<script>
22
    insertHeader();
23
    insertMenu('nrm_usage');
24
</script>
25
26
<h2>Showing images</h2>
27
28
<h3 class="first">Showing one image:</h3>
29
<h4>Syntax:</h4>
30
<pre>
31
<code>&lt;a href="URL" title="CAPTION" rel="gb_image[]"&gt;HTML&lt;/a&gt;</code>
32
</pre>
33
34
<h4>Example:</h4>
35
<pre>
36
<code>&lt;a href="http://static.flickr.com/119/294309231_a3d2a339b9.jpg" title="Flower" rel="gb_image[]"&gt;Show flower&lt;/a&gt;</code>
37
</pre>
38
39
<h4>Example rendered:</h4>
40
<a href="http://static.flickr.com/119/294309231_a3d2a339b9.jpg" title="Flower" rel="gb_image[]">Show flower</a>
41
42
43
<h3>Showing a group of images:</h3>
44
<h4>Syntax:</h4>
45
<pre>
46
<code>&lt;a href="URL" title="CAPTION" rel="gb_imageset[NAME]"&gt;HTML&lt;/a&gt;</code>
47
<code>&lt;a href="URL" title="CAPTION" rel="gb_imageset[NAME]"&gt;HTML&lt;/a&gt;</code>
48
</pre>
49
50
<h4>Example:</h4>
51
<pre>
52
<code>&lt;a href="static_files/salt.jpg" rel="gb_imageset[nice_pics]" title="Salt flats in Chile"&gt;Salt flats&lt;/a&gt;</code>
53
<code>&lt;a href="static_files/night_valley.jpg" rel="gb_imageset[nice_pics]" title="Night valley"&gt;Night valley&lt;/a&gt;</code>
54
</pre>
55
56
<h4>Example rendered:</h4>
57
<a href="static_files/salt.jpg" rel="gb_imageset[nice_pics]" title="Salt flats in Chile">Salt flats</a>
58
<a href="static_files/night_valley.jpg" rel="gb_imageset[nice_pics]" title="Night valley">Night valley</a>
59
60
61
<h2>Showing pages</h2>
62
63
<h3>Showing one page:</h3>
64
<h4>Syntax:</h4>
65
<pre>
66
<code>&lt;a href="URL" title="CAPTION" rel="gb_page[WIDTH, HEIGHT]"&gt;HTML&lt;/a&gt;</code>
67
</pre>
68
69
<h4>Example:</h4>
70
<pre>
71
<code>&lt;a href="http://google.com/" title="Google" rel="gb_page[500, 500]"&gt;Launch Google.com&lt;/a&gt;</code>
72
</pre>
73
74
<h4>Example rendered:</h4>
75
<a href="http://google.com/" title="Google" rel="gb_page[500, 500]">Launch Google.com</a>
76
77
78
<h3>Showing one page as center window:</h3>
79
<h4>Syntax:</h4>
80
<pre>
81
<code>&lt;a href="URL" title="CAPTION" rel="gb_page_center[WIDTH, HEIGHT]"&gt;HTML&lt;/a&gt;</code>
82
</pre>
83
84
<h4>Example:</h4>
85
<pre>
86
<code>&lt;a href="http://google.com/" title="Google" rel="gb_page_center[500, 500]"&gt;Launch Google.com&lt;/a&gt;</code>
87
</pre>
88
89
<h4>Example rendered:</h4>
90
<a href="http://google.com/" title="Google" rel="gb_page_center[500, 500]">Launch Google.com</a>
91
92
93
<h3>Showing one page in fullscreen:</h3>
94
<h4>Syntax:</h4>
95
<pre>
96
<code>&lt;a href="URL" title="CAPTION" rel="gb_page_fs[]"&gt;HTML&lt;/a&gt;</code>
97
</pre>
98
99
<h4>Example:</h4>
100
<pre>
101
<code>&lt;a href="http://google.com/" title="Google" rel="gb_page_fs[]"&gt;Launch Google.com&lt;/a&gt;</code>
102
</pre>
103
104
<h4>Example rendered:</h4>
105
<a href="http://google.com/" title="Google" rel="gb_page_fs[]">Launch Google.com</a>
106
107
<h3>Showing a group of pages:</h3>
108
<h4>Syntax:</h4>
109
<pre>
110
<code>&lt;a href="URL" title="CAPTION" rel="gb_pageset[NAME]"&gt;HTML&lt;/a&gt;</code>
111
<code>&lt;a href="URL" title="CAPTION" rel="gb_pageset[NAME]"&gt;HTML&lt;/a&gt;</code>
112
</pre>
113
114
<h4>Example:</h4>
115
<pre>
116
<code>&lt;a href="http://google.com/" title="Google" rel="gb_pageset[search_sites]"&gt;Launch Google search&lt;/a&gt;</code>
117
<code>&lt;a href="http://search.yahoo.com/" rel="gb_pageset[search_sites]"&gt;Launch Yahoo search&lt;/a&gt;</code>
118
</pre>
119
120
<h4>Example rendered:</h4>
121
<a href="http://google.com/" title="Google" rel="gb_pageset[search_sites]">Launch Google search</a>
122
<a href="http://search.yahoo.com/" rel="gb_pageset[search_sites]">Launch Yahoo search</a>
123
124
125
</body>
126
</html>
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/static_files/help.css (+93 lines)
Line 0 Link Here
1
body {
2
    font-family: helvetica, verdana, sans-serif;
3
    font-size: 12px;
4
    background-color: #fff;
5
    padding: 10px 35px 35px 35px;
6
    width: 800px;
7
    margin: auto;
8
}
9
10
#top {
11
    text-align: center;
12
}
13
14
h2 {
15
    font-size: 18px;
16
    color: #333;
17
    margin: 35px 0 10px 0;
18
}
19
20
h3 {
21
    color: #333;
22
    border-bottom: 1px solid #999;
23
    font-size: 15px;
24
    margin: 30px 0 3px 0;
25
}
26
27
.first {
28
    margin-top: 20px;
29
}
30
31
h4 {
32
    color: black;
33
    font-size: 13px;
34
    margin: 10px 0 5px 0;
35
}
36
37
pre {
38
    font-size: 11px;
39
    margin-top: 5px;
40
    padding: 4px;
41
    background-color: #e3e2c6;
42
    border: 1px solid #999;
43
}
44
45
.hl {
46
    background-color: #ffffcc;
47
}
48
49
ol {
50
    margin: 0;
51
    padding: 0 0px 0 20px;
52
}
53
54
li {
55
    padding: 5px 0 5px 0;
56
}
57
58
img {
59
    border: 0;
60
}
61
62
/*
63
 * Menu
64
 */
65
#menu {
66
    border-bottom: 1px solid #999;
67
    margin: 20px 0px;
68
    padding: 10px 0pt 5px;
69
    text-align: center;
70
}
71
72
#menu li {
73
    display: inline;
74
    margin: 0px;
75
    padding: 0px;
76
}
77
78
#menu a {
79
    background: #ddd none repeat;
80
    border: 1px solid #999;
81
    margin: 0 5px 0 5px;
82
    padding: 5px;
83
}
84
85
#menu a.current {
86
    background: #fff none repeat;
87
    border-bottom: 1px solid #fff;
88
}
89
90
#menu a {
91
    color: black;
92
    text-decoration: none;
93
}
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/GreyBox_v5_5/static_files/help.js (+52 lines)
Line 0 Link Here
1
var tmpl_header = AJS.join('', [
2
    '<div id="top"> <img src="static_files/logo.gif" alt="" /> <br />',
3
    '<span style="font-weight: bold; color: #333">A pop-up window that doesn\'t suck.</span>',
4
    '</div>'
5
]);
6
7
function insertHeader() {
8
    AJS.DI(tmpl_header);
9
}
10
11
var LINKS = {
12
    'installation': 'installation.html',
13
    'examples': 'examples.html',
14
    'nrm_usage': 'normal_usage.html',
15
    'adv_usage': 'advance_usage.html',
16
    'cmpr': 'compressing_greybox.html',
17
    'about': 'about.html'
18
}
19
20
function insertMenu(current_page) {
21
    var menu = AJS.UL({id: 'menu'});
22
    var create_item = function(cls, name) {
23
        var item = AJS.LI({'class': cls});
24
        AJS.ACN(item, AJS.A({href: LINKS[cls]}, name));
25
        return item;
26
    }
27
    var items = [
28
        create_item('installation', 'Installation'),
29
        create_item('examples', 'Examples'),
30
        create_item('nrm_usage', 'Normal usage'),
31
        create_item('adv_usage', 'Advance usage'),
32
        create_item('cmpr', 'Compressing GreyBox'),
33
        create_item('about', 'About')
34
    ];
35
36
    AJS.map(items, function(item) {
37
        if(item.className == current_page) {
38
            AJS.addClass(AJS.$bytc('a', null, item)[0], 'current');
39
        }
40
        AJS.ACN(menu, item);
41
    });
42
    AJS.DI(menu);
43
}
44
45
function insertCode() {
46
    var code = AJS.join('\n', arguments);
47
    var result = '<pre><code>';
48
    code = code.replace(/</g, '&lt;').replace(/>/g, '&gt;');
49
    result += code;
50
    result += '</code></pre>';
51
    document.write(result);
52
}
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/gb_scripts.js (+436 lines)
Line 0 Link Here
1
var GB_CURRENT=null;
2
GB_hide=function(){
3
GB_CURRENT.hide();
4
};
5
GreyBox=new AJS.Class({init:function(_1){
6
this.use_fx=AJS.fx;
7
this.type="page";
8
this.overlay_click_close=false;
9
this.salt=0;
10
this.root_dir=GB_ROOT_DIR;
11
this.callback_fns=[];
12
this.reload_on_close=false;
13
this.src_loader=this.root_dir+"loader_frame.html";
14
var _2=window.location.hostname.indexOf("www");
15
var _3=this.src_loader.indexOf("www");
16
if(_2!=-1&&_3==-1){
17
this.src_loader=this.src_loader.replace("://","://www.");
18
}
19
if(_2==-1&&_3!=-1){
20
this.src_loader=this.src_loader.replace("://www.","://");
21
}
22
this.show_loading=true;
23
AJS.update(this,_1);
24
},addCallback:function(fn){
25
if(fn){
26
this.callback_fns.push(fn);
27
}
28
},show:function(_5){
29
GB_CURRENT=this;
30
this.url=_5;
31
var _6=[AJS.$bytc("object"),AJS.$bytc("select")];
32
AJS.map(AJS.flattenList(_6),function(_7){
33
_7.style.visibility="hidden";
34
});
35
this.createElements();
36
return false;
37
},hide:function(){
38
var _8=this.callback_fns;
39
if(_8!=[]){
40
AJS.map(_8,function(fn){
41
fn();
42
});
43
}
44
this.onHide();
45
if(this.use_fx){
46
var _a=this.overlay;
47
AJS.fx.fadeOut(this.overlay,{onComplete:function(){
48
AJS.removeElement(_a);
49
_a=null;
50
},duration:300});
51
AJS.removeElement(this.g_window);
52
}else{
53
AJS.removeElement(this.g_window,this.overlay);
54
}
55
this.removeFrame();
56
AJS.REV(window,"scroll",_GB_setOverlayDimension);
57
AJS.REV(window,"resize",_GB_update);
58
var _b=[AJS.$bytc("object"),AJS.$bytc("select")];
59
AJS.map(AJS.flattenList(_b),function(_c){
60
_c.style.visibility="visible";
61
});
62
GB_CURRENT=null;
63
if(this.reload_on_close){
64
window.location.reload();
65
}
66
},update:function(){
67
this.setOverlayDimension();
68
this.setFrameSize();
69
this.setWindowPosition();
70
},createElements:function(){
71
this.initOverlay();
72
this.g_window=AJS.DIV({"id":"GB_window"});
73
AJS.hideElement(this.g_window);
74
AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling);
75
this.initFrame();
76
this.initHook();
77
this.update();
78
var me=this;
79
if(this.use_fx){
80
AJS.fx.fadeIn(this.overlay,{duration:300,to:0.7,onComplete:function(){
81
me.onShow();
82
AJS.showElement(me.g_window);
83
me.startLoading();
84
}});
85
}else{
86
AJS.setOpacity(this.overlay,0.7);
87
AJS.showElement(this.g_window);
88
this.onShow();
89
this.startLoading();
90
}
91
AJS.AEV(window,"scroll",_GB_setOverlayDimension);
92
AJS.AEV(window,"resize",_GB_update);
93
},removeFrame:function(){
94
try{
95
AJS.removeElement(this.iframe);
96
}
97
catch(e){
98
}
99
this.iframe=null;
100
},startLoading:function(){
101
this.iframe.src=this.src_loader+"?s="+this.salt++;
102
AJS.showElement(this.iframe);
103
},setOverlayDimension:function(){
104
var _e=AJS.getWindowSize();
105
if(AJS.isMozilla()||AJS.isOpera()){
106
AJS.setWidth(this.overlay,"100%");
107
}else{
108
AJS.setWidth(this.overlay,_e.w);
109
}
110
var _f=Math.max(AJS.getScrollTop()+_e.h,AJS.getScrollTop()+this.height);
111
if(_f<AJS.getScrollTop()){
112
AJS.setHeight(this.overlay,_f);
113
}else{
114
AJS.setHeight(this.overlay,AJS.getScrollTop()+_e.h);
115
}
116
},initOverlay:function(){
117
this.overlay=AJS.DIV({"id":"GB_overlay"});
118
if(this.overlay_click_close){
119
AJS.AEV(this.overlay,"click",GB_hide);
120
}
121
AJS.setOpacity(this.overlay,0);
122
AJS.getBody().insertBefore(this.overlay,AJS.getBody().firstChild);
123
},initFrame:function(){
124
if(!this.iframe){
125
var d={"name":"GB_frame","class":"GB_frame","frameBorder":0};
126
this.iframe=AJS.IFRAME(d);
127
this.middle_cnt=AJS.DIV({"class":"content"},this.iframe);
128
this.top_cnt=AJS.DIV();
129
this.bottom_cnt=AJS.DIV();
130
AJS.ACN(this.g_window,this.top_cnt,this.middle_cnt,this.bottom_cnt);
131
}
132
},onHide:function(){
133
},onShow:function(){
134
},setFrameSize:function(){
135
},setWindowPosition:function(){
136
},initHook:function(){
137
}});
138
_GB_update=function(){
139
if(GB_CURRENT){
140
GB_CURRENT.update();
141
}
142
};
143
_GB_setOverlayDimension=function(){
144
if(GB_CURRENT){
145
GB_CURRENT.setOverlayDimension();
146
}
147
};
148
AJS.preloadImages(GB_ROOT_DIR+"indicator.gif");
149
script_loaded=true;
150
var GB_SETS={};
151
function decoGreyboxLinks(){
152
var as=AJS.$bytc("a");
153
AJS.map(as,function(a){
154
if(a.getAttribute("href")&&a.getAttribute("rel")){
155
var rel=a.getAttribute("rel");
156
if(rel.indexOf("gb_")==0){
157
var _14=rel.match(/\w+/)[0];
158
var _15=rel.match(/\[(.*)\]/)[1];
159
var _16=0;
160
var _17={"caption":a.title||"","url":a.href};
161
if(_14=="gb_pageset"||_14=="gb_imageset"){
162
if(!GB_SETS[_15]){
163
GB_SETS[_15]=[];
164
}
165
GB_SETS[_15].push(_17);
166
_16=GB_SETS[_15].length;
167
}
168
if(_14=="gb_pageset"){
169
a.onclick=function(){
170
GB_showFullScreenSet(GB_SETS[_15],_16);
171
return false;
172
};
173
}
174
if(_14=="gb_imageset"){
175
a.onclick=function(){
176
GB_showImageSet(GB_SETS[_15],_16);
177
return false;
178
};
179
}
180
if(_14=="gb_image"){
181
a.onclick=function(){
182
GB_showImage(_17.caption,_17.url);
183
return false;
184
};
185
}
186
if(_14=="gb_page"){
187
a.onclick=function(){
188
var sp=_15.split(/, ?/);
189
GB_show(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));
190
return false;
191
};
192
}
193
if(_14=="gb_page_fs"){
194
a.onclick=function(){
195
GB_showFullScreen(_17.caption,_17.url);
196
return false;
197
};
198
}
199
if(_14=="gb_page_center"){
200
a.onclick=function(){
201
var sp=_15.split(/, ?/);
202
GB_showCenter(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));
203
return false;
204
};
205
}
206
}
207
}
208
});
209
}
210
AJS.AEV(window,"load",decoGreyboxLinks);
211
GB_showImage=function(_1a,url,_1c){
212
var _1d={width:300,height:300,type:"image",fullscreen:false,center_win:true,caption:_1a,callback_fn:_1c};
213
var win=new GB_Gallery(_1d);
214
return win.show(url);
215
};
216
GB_showPage=function(_1f,url,_21){
217
var _22={type:"page",caption:_1f,callback_fn:_21,fullscreen:true,center_win:false};
218
var win=new GB_Gallery(_22);
219
return win.show(url);
220
};
221
GB_Gallery=GreyBox.extend({init:function(_24){
222
this.parent({});
223
this.img_close=this.root_dir+"g_close.gif";
224
AJS.update(this,_24);
225
this.addCallback(this.callback_fn);
226
},initHook:function(){
227
AJS.addClass(this.g_window,"GB_Gallery");
228
var _25=AJS.DIV({"class":"inner"});
229
this.header=AJS.DIV({"class":"GB_header"},_25);
230
AJS.setOpacity(this.header,0);
231
AJS.getBody().insertBefore(this.header,this.overlay.nextSibling);
232
var _26=AJS.TD({"id":"GB_caption","class":"caption","width":"40%"},this.caption);
233
var _27=AJS.TD({"id":"GB_middle","class":"middle","width":"20%"});
234
var _28=AJS.IMG({"src":this.img_close});
235
AJS.AEV(_28,"click",GB_hide);
236
var _29=AJS.TD({"class":"close","width":"40%"},_28);
237
var _2a=AJS.TBODY(AJS.TR(_26,_27,_29));
238
var _2b=AJS.TABLE({"cellspacing":"0","cellpadding":0,"border":0},_2a);
239
AJS.ACN(_25,_2b);
240
if(this.fullscreen){
241
AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
242
}else{
243
AJS.AEV(window,"scroll",AJS.$b(this._setHeaderPos,this));
244
}
245
},setFrameSize:function(){
246
var _2c=this.overlay.offsetWidth;
247
var _2d=AJS.getWindowSize();
248
if(this.fullscreen){
249
this.width=_2c-40;
250
this.height=_2d.h-80;
251
}
252
AJS.setWidth(this.iframe,this.width);
253
AJS.setHeight(this.iframe,this.height);
254
AJS.setWidth(this.header,_2c);
255
},_setHeaderPos:function(){
256
AJS.setTop(this.header,AJS.getScrollTop()+10);
257
},setWindowPosition:function(){
258
var _2e=this.overlay.offsetWidth;
259
var _2f=AJS.getWindowSize();
260
AJS.setLeft(this.g_window,((_2e-50-this.width)/2));
261
var _30=AJS.getScrollTop()+55;
262
if(!this.center_win){
263
AJS.setTop(this.g_window,_30);
264
}else{
265
var fl=((_2f.h-this.height)/2)+20+AJS.getScrollTop();
266
if(fl<0){
267
fl=0;
268
}
269
if(_30>fl){
270
fl=_30;
271
}
272
AJS.setTop(this.g_window,fl);
273
}
274
this._setHeaderPos();
275
},onHide:function(){
276
AJS.removeElement(this.header);
277
AJS.removeClass(this.g_window,"GB_Gallery");
278
},onShow:function(){
279
if(this.use_fx){
280
AJS.fx.fadeIn(this.header,{to:1});
281
}else{
282
AJS.setOpacity(this.header,1);
283
}
284
}});
285
AJS.preloadImages(GB_ROOT_DIR+"g_close.gif");
286
GB_showFullScreenSet=function(set,_33,_34){
287
var _35={type:"page",fullscreen:true,center_win:false};
288
var _36=new GB_Sets(_35,set);
289
_36.addCallback(_34);
290
_36.showSet(_33-1);
291
return false;
292
};
293
GB_showImageSet=function(set,_38,_39){
294
var _3a={type:"image",fullscreen:false,center_win:true,width:300,height:300};
295
var _3b=new GB_Sets(_3a,set);
296
_3b.addCallback(_39);
297
_3b.showSet(_38-1);
298
return false;
299
};
300
GB_Sets=GB_Gallery.extend({init:function(_3c,set){
301
this.parent(_3c);
302
if(!this.img_next){
303
this.img_next=this.root_dir+"next.gif";
304
}
305
if(!this.img_prev){
306
this.img_prev=this.root_dir+"prev.gif";
307
}
308
this.current_set=set;
309
},showSet:function(_3e){
310
this.current_index=_3e;
311
var _3f=this.current_set[this.current_index];
312
this.show(_3f.url);
313
this._setCaption(_3f.caption);
314
this.btn_prev=AJS.IMG({"class":"left",src:this.img_prev});
315
this.btn_next=AJS.IMG({"class":"right",src:this.img_next});
316
AJS.AEV(this.btn_prev,"click",AJS.$b(this.switchPrev,this));
317
AJS.AEV(this.btn_next,"click",AJS.$b(this.switchNext,this));
318
GB_STATUS=AJS.SPAN({"class":"GB_navStatus"});
319
AJS.ACN(AJS.$("GB_middle"),this.btn_prev,GB_STATUS,this.btn_next);
320
this.updateStatus();
321
},updateStatus:function(){
322
AJS.setHTML(GB_STATUS,(this.current_index+1)+" / "+this.current_set.length);
323
if(this.current_index==0){
324
AJS.addClass(this.btn_prev,"disabled");
325
}else{
326
AJS.removeClass(this.btn_prev,"disabled");
327
}
328
if(this.current_index==this.current_set.length-1){
329
AJS.addClass(this.btn_next,"disabled");
330
}else{
331
AJS.removeClass(this.btn_next,"disabled");
332
}
333
},_setCaption:function(_40){
334
AJS.setHTML(AJS.$("GB_caption"),_40);
335
},updateFrame:function(){
336
var _41=this.current_set[this.current_index];
337
this._setCaption(_41.caption);
338
this.url=_41.url;
339
this.startLoading();
340
},switchPrev:function(){
341
if(this.current_index!=0){
342
this.current_index--;
343
this.updateFrame();
344
this.updateStatus();
345
}
346
},switchNext:function(){
347
if(this.current_index!=this.current_set.length-1){
348
this.current_index++;
349
this.updateFrame();
350
this.updateStatus();
351
}
352
}});
353
AJS.AEV(window,"load",function(){
354
AJS.preloadImages(GB_ROOT_DIR+"next.gif",GB_ROOT_DIR+"prev.gif");
355
});
356
GB_show=function(_42,url,_44,_45,_46){
357
var _47={caption:_42,height:_44||500,width:_45||500,fullscreen:false,callback_fn:_46};
358
var win=new GB_Window(_47);
359
return win.show(url);
360
};
361
GB_showCenter=function(_49,url,_4b,_4c,_4d){
362
var _4e={caption:_49,center_win:true,height:_4b||500,width:_4c||500,fullscreen:false,callback_fn:_4d};
363
var win=new GB_Window(_4e);
364
return win.show(url);
365
};
366
GB_showFullScreen=function(_50,url,_52){
367
var _53={caption:_50,fullscreen:true,callback_fn:_52};
368
var win=new GB_Window(_53);
369
return win.show(url);
370
};
371
GB_Window=GreyBox.extend({init:function(_55){
372
this.parent({});
373
this.img_header=this.root_dir+"header_bg.gif";
374
this.img_close=this.root_dir+"w_close.gif";
375
this.show_close_img=true;
376
AJS.update(this,_55);
377
this.addCallback(this.callback_fn);
378
},initHook:function(){
379
AJS.addClass(this.g_window,"GB_Window");
380
this.header=AJS.TABLE({"class":"header"});
381
this.header.style.backgroundImage="url("+this.img_header+")";
382
var _56=AJS.TD({"class":"caption"},this.caption);
383
var _57=AJS.TD({"class":"close"});
384
if(this.show_close_img){
385
var _58=AJS.IMG({"src":this.img_close});
386
var _59=AJS.SPAN("Close");
387
var btn=AJS.DIV(_58,_59);
388
AJS.AEV([_58,_59],"mouseover",function(){
389
AJS.addClass(_59,"on");
390
});
391
AJS.AEV([_58,_59],"mouseout",function(){
392
AJS.removeClass(_59,"on");
393
});
394
AJS.AEV([_58,_59],"mousedown",function(){
395
AJS.addClass(_59,"click");
396
});
397
AJS.AEV([_58,_59],"mouseup",function(){
398
AJS.removeClass(_59,"click");
399
});
400
AJS.AEV([_58,_59],"click",GB_hide);
401
AJS.ACN(_57,btn);
402
}
403
tbody_header=AJS.TBODY();
404
AJS.ACN(tbody_header,AJS.TR(_56,_57));
405
AJS.ACN(this.header,tbody_header);
406
AJS.ACN(this.top_cnt,this.header);
407
if(this.fullscreen){
408
AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
409
}
410
},setFrameSize:function(){
411
if(this.fullscreen){
412
var _5b=AJS.getWindowSize();
413
overlay_h=_5b.h;
414
this.width=Math.round(this.overlay.offsetWidth-(this.overlay.offsetWidth/100)*10);
415
this.height=Math.round(overlay_h-(overlay_h/100)*10);
416
}
417
AJS.setWidth(this.header,this.width+6);
418
AJS.setWidth(this.iframe,this.width);
419
AJS.setHeight(this.iframe,this.height);
420
},setWindowPosition:function(){
421
var _5c=AJS.getWindowSize();
422
AJS.setLeft(this.g_window,((_5c.w-this.width)/2)-13);
423
if(!this.center_win){
424
AJS.setTop(this.g_window,AJS.getScrollTop());
425
}else{
426
var fl=((_5c.h-this.height)/2)-20+AJS.getScrollTop();
427
if(fl<0){
428
fl=0;
429
}
430
AJS.setTop(this.g_window,fl);
431
}
432
}});
433
AJS.preloadImages(GB_ROOT_DIR+"w_close.gif",GB_ROOT_DIR+"header_bg.gif");
434
435
436
script_loaded=true;
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/gb_styles.css (+158 lines)
Line 0 Link Here
1
/* Last-Modified: 28/06/06 00:08:22 */
2
#GB_overlay {
3
    background-color: #000;
4
    position: absolute;
5
    margin: auto;
6
    top: 0;
7
    left: 0;
8
    z-index: 100;
9
}
10
11
#GB_window {
12
    left: 0;
13
    top: 0;
14
    font-size: 1px;
15
    position: absolute;
16
    overflow: visible;
17
    z-index: 150;
18
}
19
20
#GB_window .content {
21
    width: auto;
22
    margin: 0;
23
    padding: 0;
24
}
25
26
#GB_frame {
27
    border: 0;
28
    margin: 0;
29
    padding: 0;
30
    overflow: auto;
31
    white-space: nowrap;
32
}
33
34
35
.GB_Gallery {
36
    margin: 0 22px 0 22px;
37
}
38
39
.GB_Gallery .content {
40
    background-color: #fff;
41
    border: 3px solid #ddd;
42
}
43
44
.GB_header {
45
    top: 10px;
46
    left: 0;
47
    margin: 0;
48
    z-index: 500;
49
    position: absolute;
50
    border-bottom: 2px solid #555;
51
    border-top: 2px solid #555;
52
}
53
54
.GB_header .inner {
55
    background-color: #333;
56
    font-family: Arial, Verdana, sans-serif;
57
    padding: 2px 20px 2px 20px;
58
}
59
60
.GB_header table {
61
    margin: 0;
62
    width: 100%;
63
    border-collapse: separate;
64
    border-right: 0px;
65
    border-top: 0px;
66
}
67
68
.GB_header td {
69
    background-color: #333333;
70
    border-bottom: 0px;
71
    border-left: 0px;
72
    padding: 0em 0em;
73
}
74
75
.GB_header .caption {
76
    text-align: left;
77
    color: #eee;
78
    white-space: nowrap;
79
    font-size: 20px;
80
    border-collapse: separate;
81
}
82
83
.GB_header .close {
84
    text-align: right;
85
}
86
87
.GB_header .close img {
88
    z-index: 500;
89
    cursor: pointer;
90
}
91
92
.GB_header .middle {
93
    white-space: nowrap;
94
    text-align: center;
95
}
96
97
98
#GB_middle {
99
    color: #eee;
100
}
101
102
#GB_middle img {
103
    cursor: pointer;
104
    vertical-align: middle;
105
}
106
107
#GB_middle .disabled {
108
    cursor: default;
109
}
110
111
#GB_middle .left {
112
    padding-right: 10px;
113
}
114
115
#GB_middle .right {
116
    padding-left: 10px;
117
}
118
119
120
.GB_Window .content {
121
    background-color: #fff;
122
    border: 3px solid #ccc;
123
    border-top: none;
124
}
125
126
.GB_Window .header {
127
    border-bottom: 1px solid #aaa;
128
    border-top: 1px solid #999;
129
    border-left: 3px solid #ccc;
130
    border-right: 3px solid #ccc;
131
    margin: 0;
132
133
    height: 22px;
134
    font-size: 12px;
135
    padding: 3px 0;
136
    color: #333;
137
}
138
139
.GB_Window .caption {
140
    font-size: 12px;
141
    text-align: left;
142
    font-weight: bold;
143
    white-space: nowrap;
144
    padding-right: 20px;
145
}
146
147
.GB_Window .close { text-align: right; }
148
.GB_Window .close span {
149
    font-size: 12px;
150
    cursor: pointer;
151
}
152
.GB_Window .close img {
153
    cursor: pointer;
154
    padding: 0 3px 0 0;
155
}
156
157
.GB_Window .on { border-bottom: 1px solid #333; }
158
.GB_Window .click { border-bottom: 1px solid red; }
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/greybox/loader_frame.html (+104 lines)
Line 0 Link Here
1
<!--
2
Notice: I feel so dirty doing this, but its the only way to make it cross browser.
3
-->
4
<html>
5
<head>
6
  <script>
7
    var GB = parent.GB_CURRENT;
8
    document.write('<script type="text/javascript" src="AJS.js"><\/script>');
9
    if(GB.use_fx) {
10
        document.write('<script type="text/javascript" src="AJS_fx.js"><\/script>');
11
    }
12
  </script>
13
  <style>
14
    body {
15
      padding: 0;
16
      margin: 0;
17
      overflow: hidden;
18
    }
19
20
    #GB_frame {
21
      visibility: hidden;
22
      width: 100%;
23
      height: 100%;
24
    }
25
26
    #loading {
27
      padding-top: 50px;
28
      position: absolute;
29
      width: 100%;
30
      top: 0;
31
      text-align: center;
32
      vertical-align: middle;
33
    }
34
  </style>
35
</head>
36
<body>
37
38
<div id="loading">
39
  <img src="indicator.gif">
40
</div>
41
42
<script>
43
var loading = AJS.$('loading');
44
var gb_type = GB.type;
45
var gb_url = GB.url;
46
47
//Start loading in the iframe
48
if(gb_type == "page") {
49
  document.write('<iframe id="GB_frame" src="' + gb_url + '" frameborder="0"></iframe>');
50
}
51
else {
52
  var img_holder = new Image();
53
  img_holder.src = gb_url;
54
  document.write('<img id="GB_frame" src="' + gb_url + '">');
55
}
56
var frame = AJS.$('GB_frame');
57
</script>
58
59
</body>
60
<script>
61
function setupOuterGB() {
62
    frame.style.visibility = 'visible';
63
    GB.setFrameSize();
64
    GB.setWindowPosition();
65
}
66
67
function loaded() {
68
    AJS.removeElement(loading);
69
70
    GB.overlay.innerHTML += "&nbsp;"; //Safari bugfix
71
72
    if(gb_type == "image") {
73
        if(img_holder.width != 0 && img_holder.height != 0) {
74
            var width = img_holder.width;
75
            var height = img_holder.height;
76
77
            GB.width = width;
78
            GB.height = height;
79
80
            setupOuterGB();
81
82
            if(GB.use_fx) {
83
                AJS.setOpacity(frame, 0);
84
                AJS.fx.fadeIn(frame);
85
            }
86
        }
87
    }
88
    else {
89
        GB.width = frame.offsetWidth;
90
        GB.height = frame.offsetHeight;
91
        setupOuterGB();
92
    }
93
}
94
95
if(GB.show_loading) {
96
    AJS.AEV(window, 'load', function(e) {
97
        loaded();
98
    });
99
}
100
else {
101
    loaded();
102
}
103
</script>
104
</html>
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/jquery/jquery-ui.css (+435 lines)
Line 0 Link Here
1
/*!
2
 * jQuery UI CSS Framework 1.8.20
3
 *
4
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5
 * Dual licensed under the MIT or GPL Version 2 licenses.
6
 * http://jquery.org/license
7
 *
8
 * http://docs.jquery.com/UI/Theming/API
9
 */
10
11
/* Layout helpers
12
----------------------------------*/
13
.ui-helper-hidden { display: none; }
14
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
17
.ui-helper-clearfix:after { clear: both; }
18
.ui-helper-clearfix { zoom: 1; }
19
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
20
21
22
/* Interaction Cues
23
----------------------------------*/
24
.ui-state-disabled { cursor: default !important; }
25
26
27
/* Icons
28
----------------------------------*/
29
30
/* states and images */
31
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
32
33
34
/* Misc visuals
35
----------------------------------*/
36
37
/* Overlays */
38
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
39
40
41
/*!
42
 * jQuery UI CSS Framework 1.8.20
43
 *
44
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
45
 * Dual licensed under the MIT or GPL Version 2 licenses.
46
 * http://jquery.org/license
47
 *
48
 * http://docs.jquery.com/UI/Theming/API
49
 *
50
 * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
51
 */
52
53
54
/* Component containers
55
----------------------------------*/
56
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
57
.ui-widget .ui-widget { font-size: 1em; }
58
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
59
.ui-widget-content { border: 1px solid #B9D8D9; background: #ffffff; color: #222222; }
60
.ui-widget-content a { color: #222222; }
61
.ui-widget-header { border: 1px solid #B9D8D9; background: #E6F0F2 none; color: #222222; font-weight: bold; }
62
.ui-widget-header a { color: #222222; }
63
64
/* Interaction states
65
----------------------------------*/
66
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #B9D8D9; background: #F4F8F9 none; font-weight: normal; color: #555555; }
67
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
68
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #B9D8D9; background: #E6F0F2 none; font-weight: normal; color: #212121; }
69
.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
70
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff none; font-weight: normal; color: #212121; }
71
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
72
.ui-widget :active { outline: none; }
73
74
/* Interaction Cues
75
----------------------------------*/
76
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #fcefa1; background: #fbf9ee; color: #363636; }
77
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
78
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec; color: #cd0a0a; }
79
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
80
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
81
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
82
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
83
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
84
85
/* Icons
86
----------------------------------*/
87
88
/* states and images */
89
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
90
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
91
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
92
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
93
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
94
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
95
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
96
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
97
98
/* positioning */
99
.ui-icon-carat-1-n { background-position: 0 0; }
100
.ui-icon-carat-1-ne { background-position: -16px 0; }
101
.ui-icon-carat-1-e { background-position: -32px 0; }
102
.ui-icon-carat-1-se { background-position: -48px 0; }
103
.ui-icon-carat-1-s { background-position: -64px 0; }
104
.ui-icon-carat-1-sw { background-position: -80px 0; }
105
.ui-icon-carat-1-w { background-position: -96px 0; }
106
.ui-icon-carat-1-nw { background-position: -112px 0; }
107
.ui-icon-carat-2-n-s { background-position: -128px 0; }
108
.ui-icon-carat-2-e-w { background-position: -144px 0; }
109
.ui-icon-triangle-1-n { background-position: 0 -16px; }
110
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
111
.ui-icon-triangle-1-e { background-position: -32px -16px; }
112
.ui-icon-triangle-1-se { background-position: -48px -16px; }
113
.ui-icon-triangle-1-s { background-position: -64px -16px; }
114
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
115
.ui-icon-triangle-1-w { background-position: -96px -16px; }
116
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
117
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
118
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
119
.ui-icon-arrow-1-n { background-position: 0 -32px; }
120
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
121
.ui-icon-arrow-1-e { background-position: -32px -32px; }
122
.ui-icon-arrow-1-se { background-position: -48px -32px; }
123
.ui-icon-arrow-1-s { background-position: -64px -32px; }
124
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
125
.ui-icon-arrow-1-w { background-position: -96px -32px; }
126
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
127
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
128
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
129
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
130
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
131
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
132
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
133
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
134
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
135
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
136
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
137
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
138
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
139
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
140
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
141
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
142
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
143
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
144
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
145
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
146
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
147
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
148
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
149
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
150
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
151
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
152
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
153
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
154
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
155
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
156
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
157
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
158
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
159
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
160
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
161
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
162
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
163
.ui-icon-arrow-4 { background-position: 0 -80px; }
164
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
165
.ui-icon-extlink { background-position: -32px -80px; }
166
.ui-icon-newwin { background-position: -48px -80px; }
167
.ui-icon-refresh { background-position: -64px -80px; }
168
.ui-icon-shuffle { background-position: -80px -80px; }
169
.ui-icon-transfer-e-w { background-position: -96px -80px; }
170
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
171
.ui-icon-folder-collapsed { background-position: 0 -96px; }
172
.ui-icon-folder-open { background-position: -16px -96px; }
173
.ui-icon-document { background-position: -32px -96px; }
174
.ui-icon-document-b { background-position: -48px -96px; }
175
.ui-icon-note { background-position: -64px -96px; }
176
.ui-icon-mail-closed { background-position: -80px -96px; }
177
.ui-icon-mail-open { background-position: -96px -96px; }
178
.ui-icon-suitcase { background-position: -112px -96px; }
179
.ui-icon-comment { background-position: -128px -96px; }
180
.ui-icon-person { background-position: -144px -96px; }
181
.ui-icon-print { background-position: -160px -96px; }
182
.ui-icon-trash { background-position: -176px -96px; }
183
.ui-icon-locked { background-position: -192px -96px; }
184
.ui-icon-unlocked { background-position: -208px -96px; }
185
.ui-icon-bookmark { background-position: -224px -96px; }
186
.ui-icon-tag { background-position: -240px -96px; }
187
.ui-icon-home { background-position: 0 -112px; }
188
.ui-icon-flag { background-position: -16px -112px; }
189
.ui-icon-calendar { background-position: -32px -112px; }
190
.ui-icon-cart { background-position: -48px -112px; }
191
.ui-icon-pencil { background-position: -64px -112px; }
192
.ui-icon-clock { background-position: -80px -112px; }
193
.ui-icon-disk { background-position: -96px -112px; }
194
.ui-icon-calculator { background-position: -112px -112px; }
195
.ui-icon-zoomin { background-position: -128px -112px; }
196
.ui-icon-zoomout { background-position: -144px -112px; }
197
.ui-icon-search { background-position: -160px -112px; }
198
.ui-icon-wrench { background-position: -176px -112px; }
199
.ui-icon-gear { background-position: -192px -112px; }
200
.ui-icon-heart { background-position: -208px -112px; }
201
.ui-icon-star { background-position: -224px -112px; }
202
.ui-icon-link { background-position: -240px -112px; }
203
.ui-icon-cancel { background-position: 0 -128px; }
204
.ui-icon-plus { background-position: -16px -128px; }
205
.ui-icon-plusthick { background-position: -32px -128px; }
206
.ui-icon-minus { background-position: -48px -128px; }
207
.ui-icon-minusthick { background-position: -64px -128px; }
208
.ui-icon-close { background-position: -80px -128px; }
209
.ui-icon-closethick { background-position: -96px -128px; }
210
.ui-icon-key { background-position: -112px -128px; }
211
.ui-icon-lightbulb { background-position: -128px -128px; }
212
.ui-icon-scissors { background-position: -144px -128px; }
213
.ui-icon-clipboard { background-position: -160px -128px; }
214
.ui-icon-copy { background-position: -176px -128px; }
215
.ui-icon-contact { background-position: -192px -128px; }
216
.ui-icon-image { background-position: -208px -128px; }
217
.ui-icon-video { background-position: -224px -128px; }
218
.ui-icon-script { background-position: -240px -128px; }
219
.ui-icon-alert { background-position: 0 -144px; }
220
.ui-icon-info { background-position: -16px -144px; }
221
.ui-icon-notice { background-position: -32px -144px; }
222
.ui-icon-help { background-position: -48px -144px; }
223
.ui-icon-check { background-position: -64px -144px; }
224
.ui-icon-bullet { background-position: -80px -144px; }
225
.ui-icon-radio-off { background-position: -96px -144px; }
226
.ui-icon-radio-on { background-position: -112px -144px; }
227
.ui-icon-pin-w { background-position: -128px -144px; }
228
.ui-icon-pin-s { background-position: -144px -144px; }
229
.ui-icon-play { background-position: 0 -160px; }
230
.ui-icon-pause { background-position: -16px -160px; }
231
.ui-icon-seek-next { background-position: -32px -160px; }
232
.ui-icon-seek-prev { background-position: -48px -160px; }
233
.ui-icon-seek-end { background-position: -64px -160px; }
234
.ui-icon-seek-start { background-position: -80px -160px; }
235
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
236
.ui-icon-seek-first { background-position: -80px -160px; }
237
.ui-icon-stop { background-position: -96px -160px; }
238
.ui-icon-eject { background-position: -112px -160px; }
239
.ui-icon-volume-off { background-position: -128px -160px; }
240
.ui-icon-volume-on { background-position: -144px -160px; }
241
.ui-icon-power { background-position: 0 -176px; }
242
.ui-icon-signal-diag { background-position: -16px -176px; }
243
.ui-icon-signal { background-position: -32px -176px; }
244
.ui-icon-battery-0 { background-position: -48px -176px; }
245
.ui-icon-battery-1 { background-position: -64px -176px; }
246
.ui-icon-battery-2 { background-position: -80px -176px; }
247
.ui-icon-battery-3 { background-position: -96px -176px; }
248
.ui-icon-circle-plus { background-position: 0 -192px; }
249
.ui-icon-circle-minus { background-position: -16px -192px; }
250
.ui-icon-circle-close { background-position: -32px -192px; }
251
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
252
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
253
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
254
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
255
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
256
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
257
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
258
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
259
.ui-icon-circle-zoomin { background-position: -176px -192px; }
260
.ui-icon-circle-zoomout { background-position: -192px -192px; }
261
.ui-icon-circle-check { background-position: -208px -192px; }
262
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
263
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
264
.ui-icon-circlesmall-close { background-position: -32px -208px; }
265
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
266
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
267
.ui-icon-squaresmall-close { background-position: -80px -208px; }
268
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
269
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
270
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
271
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
272
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
273
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
274
275
276
/* Misc visuals
277
----------------------------------*/
278
279
/* Corner radius */
280
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
281
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
282
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
283
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
284
285
/* Overlays */
286
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
287
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
288
 * jQuery UI Autocomplete 1.8.20
289
 *
290
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
291
 * Dual licensed under the MIT or GPL Version 2 licenses.
292
 * http://jquery.org/license
293
 *
294
 * http://docs.jquery.com/UI/Autocomplete#theming
295
 */
296
.ui-autocomplete { position: absolute; cursor: default; -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,.3); -moz-box-shadow: 2px 2px 2px rgba(0,0,0,.3); box-shadow: 2px 2px 2px rgba(0,0,0,.3); }
297
298
.ui-autocomplete.ui-widget-content .ui-state-hover { border: 1px solid #B9D8D9; background: #E6F0F2 none; font-weight: normal; color: #212121;
299
}
300
301
.ui-autocomplete-loading {
302
    background: #FFF url("../../img/loading-small.gif") right center no-repeat;
303
}
304
305
/* workarounds */
306
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
307
308
/*
309
 * jQuery UI Menu 1.8.20
310
 *
311
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
312
 * Dual licensed under the MIT or GPL Version 2 licenses.
313
 * http://jquery.org/license
314
 *
315
 * http://docs.jquery.com/UI/Menu#theming
316
 */
317
.ui-menu {
318
    list-style:none;
319
    padding: 2px;
320
    margin: 0;
321
    display:block;
322
    float: left;
323
}
324
.ui-menu li {
325
    list-style:none;
326
}
327
.ui-menu .ui-menu {
328
    margin-top: -3px;
329
}
330
.ui-menu .ui-menu-item {
331
    margin:0;
332
    padding: 0;
333
    zoom: 1;
334
    float: left;
335
    clear: left;
336
    width: 100%;
337
}
338
.ui-menu .ui-menu-item a {
339
    text-decoration:none;
340
    display:block;
341
    padding:.2em .4em;
342
    line-height:1.5;
343
    zoom:1;
344
}
345
.ui-menu .ui-menu-item a.ui-state-hover,
346
.ui-menu .ui-menu-item a.ui-state-active {
347
    font-weight: normal;
348
    margin: -1px;
349
}
350
/*!
351
 * jQuery UI Tabs 1.8.20
352
 *
353
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
354
 * Dual licensed under the MIT or GPL Version 2 licenses.
355
 * http://jquery.org/license
356
 *
357
 * http://docs.jquery.com/UI/Tabs#theming
358
 */
359
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
360
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
361
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
362
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
363
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
364
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
365
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
366
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
367
.ui-tabs .ui-tabs-hide { display: none !important; }
368
/*!
369
 * jQuery UI Datepicker 1.8.20
370
 *
371
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
372
 * Dual licensed under the MIT or GPL Version 2 licenses.
373
 * http://jquery.org/license
374
 *
375
 * http://docs.jquery.com/UI/Datepicker#theming
376
 */
377
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
378
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
379
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
380
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
381
.ui-datepicker .ui-datepicker-prev { left:2px; }
382
.ui-datepicker .ui-datepicker-next { right:2px; }
383
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
384
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
385
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
386
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
387
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
388
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
389
.ui-datepicker select.ui-datepicker-month,
390
.ui-datepicker select.ui-datepicker-year { width: 49%;}
391
.ui-datepicker table {width: 100%; font-size: .9em; border : 0; border-collapse: collapse; margin:0 0 .4em; }
392
.ui-datepicker th { background : transparent none; padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
393
.ui-datepicker td { border: 0; padding: 1px; }
394
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
395
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
396
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
397
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
398
399
/* with multiple calendars */
400
.ui-datepicker.ui-datepicker-multi { width:auto; }
401
.ui-datepicker-multi .ui-datepicker-group { float:left; }
402
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
403
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
404
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
405
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
406
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
407
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
408
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
409
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
410
411
/* RTL support */
412
.ui-datepicker-rtl { direction: rtl; }
413
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
414
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
415
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
416
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
417
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
418
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
419
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
420
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
421
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
422
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
423
424
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
425
.ui-datepicker-cover {
426
    display: none; /*sorry for IE5*/
427
    display/**/: block; /*sorry for IE5*/
428
    position: absolute; /*must have*/
429
    z-index: -1; /*must have*/
430
    filter: mask(); /*must have*/
431
    top: -4px; /*must have*/
432
    left: -4px; /*must have*/
433
    width: 200px; /*must have*/
434
    height: 200px; /*must have*/
435
}
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/jquery/jquery-ui.js (+29 lines)
Line 0 Link Here
1
/*! jQuery UI - v1.8.21 - 2012-06-05
2
* https://github.com/jquery/jquery-ui
3
* Includes: jquery.ui.core.js
4
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
5
(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.21",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
6
* https://github.com/jquery/jquery-ui
7
* Includes: jquery.ui.widget.js
8
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
9
(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
10
* https://github.com/jquery/jquery-ui
11
* Includes: jquery.ui.mouse.js
12
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
13
(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
14
* https://github.com/jquery/jquery-ui
15
* Includes: jquery.ui.position.js
16
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
17
(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
18
* https://github.com/jquery/jquery-ui
19
* Includes: jquery.ui.autocomplete.js
20
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
21
(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d),a.pending--,a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
22
* https://github.com/jquery/jquery-ui
23
* Includes: jquery.ui.tabs.js
24
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
25
(function(a,b){function e(){return++c}function f(){return++d}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},destroy:function(){var b=this.options;return this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;return this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))),this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;return this.anchors.eq(a).trigger(this.options.event+".tabs"),this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}return this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.21"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){e()}:function(a){a.clientX&&c.rotate(null)});return a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate),this}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
26
* https://github.com/jquery/jquery-ui
27
* Includes: jquery.ui.datepicker.js
28
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
29
(function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length)return;c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length)return;d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.21"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);return c&&!c.inline&&this._setDateFromField(c,b),c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(d){$.datepicker.log(d)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b)};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1;var f=this._get(b,"onClose");f&&f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0]))return;this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0]))return;var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;return c&&s++,c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;return r+=f[0].length,parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase())return f=c[0],r+=d.length,!1});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;return c&&m++,c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;return c&&e++,c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()==a.lastVal)return;var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;return b.setDate(b.getDate()+a),b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());return f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0)),this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;return e=d&&e>d?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.21",window["DP_jQuery_"+dpuuid]=$})(jQuery);;
(-)a/koha-tmpl/opac-tmpl/ccsr/en/lib/jquery/jquery.js (+4 lines)
Line 0 Link Here
1
/*! jQuery v1.7.2 jquery.com | jquery.org/license */
2
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((