/
pkp.min.js
449 lines (449 loc) · 259 KB
/
pkp.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
(function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a("undefined"!=typeof jQuery?jQuery:window.Zepto)})(function(a){function b(b){var c=b.data;b.isDefaultPrevented()||(b.preventDefault(),a(b.target).ajaxSubmit(c))}function c(b){var c=b.target,d=a(c);if(!d.is("[type=submit],[type=image]")){c=d.closest("[type=submit]");if(0===c.length)return;c=c[0]}var e=this;e.clk=c;"image"==c.type&&(void 0!==b.offsetX?(e.clk_x=b.offsetX,e.clk_y=b.offsetY):"function"==typeof a.fn.offset?(d=d.offset(),
e.clk_x=b.pageX-d.left,e.clk_y=b.pageY-d.top):(e.clk_x=b.pageX-c.offsetLeft,e.clk_y=b.pageY-c.offsetTop));setTimeout(function(){e.clk=e.clk_x=e.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var b="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(b):window.opera&&window.opera.postError&&window.opera.postError(b)}}var e,f;e=void 0!==a("<input type='file'/>").get(0).files;f=void 0!==window.FormData;var h=!!a.fn.prop;a.fn.attr2=function(){if(!h)return this.attr.apply(this,
arguments);var a=this.prop.apply(this,arguments);return a&&a.jquery||"string"===typeof a?a:this.attr.apply(this,arguments)};a.fn.ajaxSubmit=function(b){function c(e){function f(a){var b=null;try{a.contentWindow&&(b=a.contentWindow.document)}catch(c){d("cannot get iframe.contentWindow document: "+c)}if(b)return b;try{b=a.contentDocument?a.contentDocument:a.document}catch(e){d("cannot get iframe.contentDocument: "+e),b=a.document}return b}function g(){function b(){try{var a=f(m).readyState;d("state = "+
a);a&&"uninitialized"==a.toLowerCase()&&setTimeout(b,50)}catch(c){d("Server abort: ",c," (",c.name,")"),v(I),G&&clearTimeout(G),G=void 0}}var c=q.attr2("target"),e=q.attr2("action"),B=q.attr("enctype")||q.attr("encoding")||"multipart/form-data";i.setAttribute("target",w);(!n||/post/i.test(n))&&i.setAttribute("method","POST");e!=l.url&&i.setAttribute("action",l.url);!l.skipEncodingOverride&&(!n||/post/i.test(n))&&q.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});l.timeout&&(G=
setTimeout(function(){t=!0;v(O)},l.timeout));var h=[];try{if(l.extraData)for(var C in l.extraData)l.extraData.hasOwnProperty(C)&&(a.isPlainObject(l.extraData[C])&&l.extraData[C].hasOwnProperty("name")&&l.extraData[C].hasOwnProperty("value")?h.push(a('<input type="hidden" name="'+l.extraData[C].name+'">').val(l.extraData[C].value).appendTo(i)[0]):h.push(a('<input type="hidden" name="'+C+'">').val(l.extraData[C]).appendTo(i)[0]));l.iframeTarget||p.appendTo("body");m.attachEvent?m.attachEvent("onload",
v):m.addEventListener("load",v,!1);setTimeout(b,15);try{i.submit()}catch(x){document.createElement("form").submit.apply(i)}}finally{i.setAttribute("action",e),i.setAttribute("enctype",B),c?i.setAttribute("target",c):q.removeAttr("target"),a(h).remove()}}function v(b){if(!r.aborted&&!P)if(x=f(m),x||(d("cannot access response document"),b=I),b===O&&r)r.abort("timeout"),B.reject(r,"timeout");else if(b==I&&r)r.abort("server abort"),B.reject(r,"error","server abort");else if(x&&x.location.href!=l.iframeSrc||
t){m.detachEvent?m.detachEvent("onload",v):m.removeEventListener("load",v,!1);var b="success",c;try{if(t)throw"timeout";var e="xml"==l.dataType||x.XMLDocument||a.isXMLDoc(x);d("isXml="+e);if(!e&&(window.opera&&(null===x.body||!x.body.innerHTML))&&--T){d("requeing onLoad callback, DOM not available");setTimeout(v,250);return}var g=x.body?x.body:x.documentElement;r.responseText=g?g.innerHTML:null;r.responseXML=x.XMLDocument?x.XMLDocument:x;e&&(l.dataType="xml");r.getResponseHeader=function(a){return{"content-type":l.dataType}[a.toLowerCase()]};
g&&(r.status=Number(g.getAttribute("status"))||r.status,r.statusText=g.getAttribute("statusText")||r.statusText);var h=(l.dataType||"").toLowerCase(),j=/(json|script|text)/.test(h);if(j||l.textarea){var i=x.getElementsByTagName("textarea")[0];if(i)r.responseText=i.value,r.status=Number(i.getAttribute("status"))||r.status,r.statusText=i.getAttribute("statusText")||r.statusText;else if(j){var k=x.getElementsByTagName("pre")[0],n=x.getElementsByTagName("body")[0];k?r.responseText=k.textContent?k.textContent:
k.innerText:n&&(r.responseText=n.textContent?n.textContent:n.innerText)}}else"xml"==h&&(!r.responseXML&&r.responseText)&&(r.responseXML=u(r.responseText));try{var e=r,g=l,q=e.getResponseHeader("content-type")||"",w="xml"===h||!h&&0<=q.indexOf("xml"),s=w?e.responseXML:e.responseText;w&&"parsererror"===s.documentElement.nodeName&&a.error&&a.error("parsererror");g&&g.dataFilter&&(s=g.dataFilter(s,h));"string"===typeof s&&("json"===h||!h&&0<=q.indexOf("json")?s=E(s):("script"===h||!h&&0<=q.indexOf("javascript"))&&
a.globalEval(s));C=s}catch(y){b="parsererror",r.error=c=y||b}}catch(z){d("error caught: ",z),b="error",r.error=c=z||b}r.aborted&&(d("upload aborted"),b=null);r.status&&(b=200<=r.status&&300>r.status||304===r.status?"success":"error");"success"===b?(l.success&&l.success.call(l.context,C,"success",r),B.resolve(r.responseText,"success",r),A&&a.event.trigger("ajaxSuccess",[r,l])):b&&(void 0===c&&(c=r.statusText),l.error&&l.error.call(l.context,r,b,c),B.reject(r,"error",c),A&&a.event.trigger("ajaxError",
[r,l,c]));A&&a.event.trigger("ajaxComplete",[r,l]);A&&!--a.active&&a.event.trigger("ajaxStop");l.complete&&l.complete.call(l.context,r,b);P=!0;l.timeout&&clearTimeout(G);setTimeout(function(){l.iframeTarget?p.attr("src",l.iframeSrc):p.remove();r.responseXML=null},100)}}var i=q[0],k,l,A,w,p,m,r,t,G,B=a.Deferred();B.abort=function(a){r.abort(a)};if(e)for(k=0;k<s.length;k++)e=a(s[k]),h?e.prop("disabled",!1):e.removeAttr("disabled");l=a.extend(!0,{},a.ajaxSettings,b);l.context=l.context||l;w="jqFormIO"+
(new Date).getTime();l.iframeTarget?(p=a(l.iframeTarget),(k=p.attr2("name"))?w=k:p.attr2("name",w)):(p=a('<iframe name="'+w+'" src="'+l.iframeSrc+'" />'),p.css({position:"absolute",top:"-1000px",left:"-1000px"}));m=p[0];r={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(b){var c="timeout"===b?"timeout":"aborted";d("aborting upload... "+c);this.aborted=1;try{m.contentWindow.document.execCommand&&
m.contentWindow.document.execCommand("Stop")}catch(e){}p.attr("src",l.iframeSrc);r.error=c;l.error&&l.error.call(l.context,r,c,b);A&&a.event.trigger("ajaxError",[r,l,c]);l.complete&&l.complete.call(l.context,r,c)}};(A=l.global)&&0===a.active++&&a.event.trigger("ajaxStart");A&&a.event.trigger("ajaxSend",[r,l]);if(l.beforeSend&&!1===l.beforeSend.call(l.context,r,l))return l.global&&a.active--,B.reject(),B;if(r.aborted)return B.reject(),B;if(e=i.clk)if((k=e.name)&&!e.disabled)l.extraData=l.extraData||
{},l.extraData[k]=e.value,"image"==e.type&&(l.extraData[k+".x"]=i.clk_x,l.extraData[k+".y"]=i.clk_y);var O=1,I=2,e=a("meta[name=csrf-token]").attr("content");if((k=a("meta[name=csrf-param]").attr("content"))&&e)l.extraData=l.extraData||{},l.extraData[k]=e;l.forceSync?g():setTimeout(g,10);var C,x,T=50,P,u=a.parseXML||function(a,b){window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml");return b&&b.documentElement&&
"parsererror"!=b.documentElement.nodeName?b:null},E=a.parseJSON||function(a){return window.eval("("+a+")")};return B}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var n,k,q=this;"function"==typeof b?b={success:b}:void 0===b&&(b={});n=b.type||this.attr2("method");k=b.url||this.attr2("action");(k=(k="string"===typeof k?a.trim(k):"")||window.location.href||"")&&(k=(k.match(/^([^#]+)/)||[])[1]);b=a.extend(!0,{url:k,success:a.ajaxSettings.success,type:n||a.ajaxSettings.type,
iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},b);k={};this.trigger("form-pre-serialize",[this,b,k]);if(k.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(b.beforeSerialize&&!1===b.beforeSerialize(this,b))return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var p=b.traditional;void 0===p&&(p=a.ajaxSettings.traditional);var s=[],m,u=this.formToArray(b.semantic,s);b.data&&(b.extraData=b.data,m=a.param(b.data,
p));if(b.beforeSubmit&&!1===b.beforeSubmit(u,this,b))return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[u,this,b,k]);if(k.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;k=a.param(u,p);m&&(k=k?k+"&"+m:m);"GET"==b.type.toUpperCase()?(b.url+=(0<=b.url.indexOf("?")?"&":"?")+k,b.data=null):b.data=k;var t=[];b.resetForm&&t.push(function(){q.resetForm()});b.clearForm&&t.push(function(){q.clearForm(b.includeHidden)});
if(!b.dataType&&b.target){var g=b.success||function(){};t.push(function(c){var d=b.replaceTarget?"replaceWith":"html";a(b.target)[d](c).each(g,arguments)})}else b.success&&t.push(b.success);b.success=function(a,c,d){for(var e=b.context||this,f=0,g=t.length;f<g;f++)t[f].apply(e,[a,c,d||q,q])};if(b.error){var D=b.error;b.error=function(a,c,d){D.apply(b.context||this,[a,c,d,q])}}if(b.complete){var v=b.complete;b.complete=function(a,c){v.apply(b.context||this,[a,c,q])}}m=0<a("input[type=file]:enabled",
this).filter(function(){return""!==a(this).val()}).length;k="multipart/form-data"==q.attr("enctype")||"multipart/form-data"==q.attr("encoding");p=e&&f;d("fileAPI :"+p);var l;if(!1!==b.iframe&&(b.iframe||(m||k)&&!p))b.closeKeepAlive?a.get(b.closeKeepAlive,function(){l=c(u)}):l=c(u);else if((m||k)&&p){var A=new FormData;for(k=0;k<u.length;k++)A.append(u[k].name,u[k].value);if(b.extraData){k=a.param(b.extraData,b.traditional).split("&");p=k.length;m=[];var w,E;for(w=0;w<p;w++)k[w]=k[w].replace(/\+/g,
" "),E=k[w].split("="),m.push([decodeURIComponent(E[0]),decodeURIComponent(E[1])]);for(k=0;k<m.length;k++)m[k]&&A.append(m[k][0],m[k][1])}b.data=null;m=a.extend(!0,{},a.ajaxSettings,b,{contentType:!1,processData:!1,cache:!1,type:n||"POST"});b.uploadProgress&&(m.xhr=function(){var c=a.ajaxSettings.xhr();c.upload&&c.upload.addEventListener("progress",function(a){var c=0,d=a.loaded||a.position,e=a.total;a.lengthComputable&&(c=Math.ceil(100*(d/e)));b.uploadProgress(a,d,e,c)},!1);return c});m.data=null;
var z=m.beforeSend;m.beforeSend=function(a,c){c.data=b.formData?b.formData:A;z&&z.call(this,a,c)};l=a.ajax(m)}else l=a.ajax(b);q.removeData("jqxhr").data("jqxhr",l);for(m=0;m<s.length;m++)s[m]=null;this.trigger("form-submit-notify",[this,b]);return this};a.fn.ajaxForm=function(e){e=e||{};e.delegation=e.delegation&&a.isFunction(a.fn.on);if(!e.delegation&&0===this.length){var f=this.selector,h=this.context;if(!a.isReady&&f)return d("DOM not ready, queuing ajaxForm"),a(function(){a(f,h).ajaxForm(e)}),
this;d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return e.delegation?(a(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,c).on("submit.form-plugin",this.selector,e,b).on("click.form-plugin",this.selector,e,c),this):this.ajaxFormUnbind().bind("submit.form-plugin",e,b).bind("click.form-plugin",e,c)};a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(b,
c){var d=[];if(0===this.length)return d;var f=this[0],h=this.attr("id"),p=b?f.getElementsByTagName("*"):f.elements;p&&!/MSIE [678]/.test(navigator.userAgent)&&(p=a(p).get());h&&(h=a(':input[form="'+h+'"]').get(),h.length&&(p=(p||[]).concat(h)));if(!p||!p.length)return d;var s,m,u,t,g;s=0;for(g=p.length;s<g;s++)if(t=p[s],(h=t.name)&&!t.disabled)if(b&&f.clk&&"image"==t.type)f.clk==t&&(d.push({name:h,value:a(t).val(),type:t.type}),d.push({name:h+".x",value:f.clk_x},{name:h+".y",value:f.clk_y}));else if((u=
a.fieldValue(t,!0))&&u.constructor==Array){c&&c.push(t);m=0;for(t=u.length;m<t;m++)d.push({name:h,value:u[m]})}else if(e&&"file"==t.type)if(c&&c.push(t),u=t.files,u.length)for(m=0;m<u.length;m++)d.push({name:h,value:u[m],type:t.type});else d.push({name:h,value:"",type:t.type});else null!==u&&"undefined"!=typeof u&&(c&&c.push(t),d.push({name:h,value:u,type:t.type,required:t.required}));if(!b&&f.clk&&(p=a(f.clk),s=p[0],(h=s.name)&&!s.disabled&&"image"==s.type))d.push({name:h,value:p.val()}),d.push({name:h+
".x",value:f.clk_x},{name:h+".y",value:f.clk_y});return d};a.fn.formSerialize=function(b){return a.param(this.formToArray(b))};a.fn.fieldSerialize=function(b){var c=[];this.each(function(){var d=this.name;if(d){var e=a.fieldValue(this,b);if(e&&e.constructor==Array)for(var f=0,h=e.length;f<h;f++)c.push({name:d,value:e[f]});else null!==e&&"undefined"!=typeof e&&c.push({name:this.name,value:e})}});return a.param(c)};a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;d<e;d++){var f=a.fieldValue(this[d],
b);null===f||("undefined"==typeof f||f.constructor==Array&&!f.length)||(f.constructor==Array?a.merge(c,f):c.push(f))}return c};a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();void 0===c&&(c=!0);if(c&&(!d||b.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!b.checked||("submit"==e||"image"==e)&&b.form&&b.form.clk!=b||"select"==f&&-1==b.selectedIndex))return null;if("select"==f){var h=b.selectedIndex;if(0>h)return null;for(var d=[],f=b.options,s=(e="select-one"==
e)?h+1:f.length,h=e?h:0;h<s;h++){var m=f[h];if(m.selected){var u=m.value;u||(u=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value);if(e)return u;d.push(u)}}return d}return a(b).val()};a.fn.clearForm=function(b){return this.each(function(){a("input,select,textarea",this).clearFields(b)})};a.fn.clearFields=a.fn.clearInputs=function(b){var c=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var d=this.type,
e=this.tagName.toLowerCase();if(c.test(d)||"textarea"==e)this.value="";else if("checkbox"==d||"radio"==d)this.checked=!1;else if("select"==e)this.selectedIndex=-1;else if("file"==d)/MSIE/.test(navigator.userAgent)?a(this).replaceWith(a(this).clone(!0)):a(this).val("");else if(b&&(!0===b&&/hidden/.test(d)||"string"==typeof b&&a(this).is(b)))this.value=""})};a.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})};
a.fn.enable=function(a){void 0===a&&(a=!0);return this.each(function(){this.disabled=!a})};a.fn.selected=function(b){void 0===b&&(b=!0);return this.each(function(){var c=this.type;"checkbox"==c||"radio"==c?this.checked=b:"option"==this.tagName.toLowerCase()&&(c=a(this).parent("select"),b&&(c[0]&&"select-one"==c[0].type)&&c.find("option").selected(!1),this.selected=b)})};a.fn.ajaxSubmit.debug=!1});(function(a){a.widget("ui.tagit",{options:{allowDuplicates:!1,caseSensitive:!0,fieldName:"tags",placeholderText:null,readOnly:!1,removeConfirmation:!1,tagLimit:null,availableTags:[],autocomplete:{},showAutocompleteOnFocus:!1,allowSpaces:!1,singleField:!1,singleFieldDelimiter:",",singleFieldNode:null,animate:!0,tabIndex:null,beforeTagAdded:null,afterTagAdded:null,beforeTagRemoved:null,afterTagRemoved:null,onTagClicked:null,onTagLimitExceeded:null,onTagAdded:null,onTagRemoved:null,tagSource:null},_create:function(){var b=
this;this.element.is("input")?(this.tagList=a("<ul></ul>").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.addClass("tagit-hidden-field")):this.tagList=this.element.find("ul, ol").andSelf().last();this.tagInput=a('<input type="text" />').addClass("ui-widget-content");this.options.readOnly&&this.tagInput.attr("disabled","disabled");this.options.tabIndex&&this.tagInput.attr("tabindex",this.options.tabIndex);this.options.placeholderText&&this.tagInput.attr("placeholder",
this.options.placeholderText);this.options.autocomplete.source||(this.options.autocomplete.source=function(b,c){var d=b.term.toLowerCase(),e=a.grep(this.options.availableTags,function(a){return 0===a.toLowerCase().indexOf(d)});this.options.allowDuplicates||(e=this._subtractArray(e,this.assignedTags()));c(e)});this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(){b._showAutocomplete()}),"undefined"===typeof this.options.autocomplete.minLength&&(this.options.autocomplete.minLength=0));
a.isFunction(this.options.autocomplete.source)&&(this.options.autocomplete.source=a.proxy(this.options.autocomplete.source,this));a.isFunction(this.options.tagSource)&&(this.options.tagSource=a.proxy(this.options.tagSource,this));this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(a('<li class="tagit-new"></li>').append(this.tagInput)).click(function(c){var d=a(c.target);d.hasClass("tagit-label")?(d=d.closest(".tagit-choice"),d.hasClass("removed")||b._trigger("onTagClicked",
c,{tag:d,tagLabel:b.tagLabel(d)})):b.tagInput.focus()});var c=!1;if(this.options.singleField)if(this.options.singleFieldNode){var d=a(this.options.singleFieldNode),e=d.val().split(this.options.singleFieldDelimiter);d.val("");a.each(e,function(a,d){b.createTag(d,null,!0);c=!0})}else this.options.singleFieldNode=a('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />'),this.tagList.after(this.options.singleFieldNode);c||this.tagList.children("li").each(function(){a(this).hasClass("tagit-new")||
(b.createTag(a(this).text(),a(this).attr("class"),!0),a(this).remove())});this.tagInput.keydown(function(c){if(c.which==a.ui.keyCode.BACKSPACE&&""===b.tagInput.val()){var d=b._lastTag();!b.options.removeConfirmation||d.hasClass("remove")?b.removeTag(d):b.options.removeConfirmation&&d.addClass("remove ui-state-highlight")}else b.options.removeConfirmation&&b._lastTag().removeClass("remove ui-state-highlight");if(c.which===a.ui.keyCode.COMMA&&!1===c.shiftKey||c.which===a.ui.keyCode.ENTER||c.which==
a.ui.keyCode.TAB&&""!==b.tagInput.val()||c.which==a.ui.keyCode.SPACE&&!0!==b.options.allowSpaces&&('"'!=a.trim(b.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==a.trim(b.tagInput.val()).charAt(0)&&'"'==a.trim(b.tagInput.val()).charAt(a.trim(b.tagInput.val()).length-1)&&0!==a.trim(b.tagInput.val()).length-1))if(c.which===a.ui.keyCode.ENTER&&""===b.tagInput.val()||c.preventDefault(),!b.options.autocomplete.autoFocus||!b.tagInput.data("autocomplete-open"))b.tagInput.autocomplete("close"),b.createTag(b._cleanedInput())}).blur(function(){b.tagInput.data("autocomplete-open")||
b.createTag(b._cleanedInput())});if(this.options.availableTags||this.options.tagSource||this.options.autocomplete.source)d={select:function(a,c){b.createTag(c.item.value);return!1}},a.extend(d,this.options.autocomplete),d.source=this.options.tagSource||d.source,this.tagInput.autocomplete(d).bind("autocompleteopen.tagit",function(){b.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose.tagit",function(){b.tagInput.data("autocomplete-open",!1)}),this.tagInput.autocomplete("widget").addClass("tagit-autocomplete")},
destroy:function(){a.Widget.prototype.destroy.call(this);this.element.unbind(".tagit");this.tagList.unbind(".tagit");this.tagInput.removeData("autocomplete-open");this.tagList.removeClass("tagit ui-widget ui-widget-content ui-corner-all tagit-hidden-field");this.element.is("input")?(this.element.removeClass("tagit-hidden-field"),this.tagList.remove()):(this.element.children("li").each(function(){a(this).hasClass("tagit-new")?a(this).remove():(a(this).removeClass("tagit-choice ui-widget-content ui-state-default ui-state-highlight ui-corner-all remove tagit-choice-editable tagit-choice-read-only"),
a(this).text(a(this).children(".tagit-label").text()))}),this.singleFieldNode&&this.singleFieldNode.remove());return this},_cleanedInput:function(){return a.trim(this.tagInput.val().replace(/^"(.*)"$/,"$1"))},_lastTag:function(){return this.tagList.find(".tagit-choice:last:not(.removed)")},_tags:function(){return this.tagList.find(".tagit-choice:not(.removed)")},assignedTags:function(){var b=this,c=[];this.options.singleField?(c=a(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter),
""===c[0]&&(c=[])):this._tags().each(function(){c.push(b.tagLabel(this))});return c},_updateSingleTagsField:function(b){a(this.options.singleFieldNode).val(b.join(this.options.singleFieldDelimiter)).trigger("change")},_subtractArray:function(b,c){for(var d=[],e=0;e<b.length;e++)-1==a.inArray(b[e],c)&&d.push(b[e]);return d},tagLabel:function(b){return this.options.singleField?a(b).find(".tagit-label:first").text():a(b).find("input:first").val()},_showAutocomplete:function(){this.tagInput.autocomplete("search",
"")},_findTagByLabel:function(b){var c=this,d=null;this._tags().each(function(){if(c._formatStr(b)==c._formatStr(c.tagLabel(this)))return d=a(this),!1});return d},_isNew:function(a){return!this._findTagByLabel(a)},_formatStr:function(b){return this.options.caseSensitive?b:a.trim(b.toLowerCase())},_effectExists:function(b){return Boolean(a.effects&&(a.effects[b]||a.effects.effect&&a.effects.effect[b]))},createTag:function(b,c,d){var e=this,b=a.trim(b);this.options.preprocessTag&&(b=this.options.preprocessTag(b));
if(""===b)return!1;if(!this.options.allowDuplicates&&!this._isNew(b))return b=this._findTagByLabel(b),!1!==this._trigger("onTagExists",null,{existingTag:b,duringInitialization:d})&&this._effectExists("highlight")&&b.effect("highlight"),!1;if(this.options.tagLimit&&this._tags().length>=this.options.tagLimit)return this._trigger("onTagLimitExceeded",null,{duringInitialization:d}),!1;var f=a(this.options.onTagClicked?'<a class="tagit-label"></a>':'<span class="tagit-label"></span>').text(b),h=a("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(c).append(f);
this.options.readOnly?h.addClass("tagit-choice-read-only"):(h.addClass("tagit-choice-editable"),c=a("<span></span>").addClass("ui-icon ui-icon-close"),c=a('<a><span class="text-icon">\u00d7</span></a>').addClass("tagit-close").append(c).click(function(){e.removeTag(h)}),h.append(c));this.options.singleField||(f=f.html(),h.append('<input type="hidden" value="'+f+'" name="'+this.options.fieldName+'" class="tagit-hidden-field" />'));!1!==this._trigger("beforeTagAdded",null,{tag:h,tagLabel:this.tagLabel(h),
duringInitialization:d})&&(this.options.singleField&&(f=this.assignedTags(),f.push(b),this._updateSingleTagsField(f)),this._trigger("onTagAdded",null,h),this.tagInput.val(""),this.tagInput.parent().before(h),this._trigger("afterTagAdded",null,{tag:h,tagLabel:this.tagLabel(h),duringInitialization:d}),this.options.showAutocompleteOnFocus&&!d&&setTimeout(function(){e._showAutocomplete()},0))},removeTag:function(b,c){c="undefined"===typeof c?this.options.animate:c;b=a(b);this._trigger("onTagRemoved",
null,b);if(!1!==this._trigger("beforeTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})){if(this.options.singleField){var d=this.assignedTags(),e=this.tagLabel(b),d=a.grep(d,function(a){return a!=e});this._updateSingleTagsField(d)}if(c){b.addClass("removed");var d=this._effectExists("blind")?["blind",{direction:"horizontal"},"fast"]:["fast"],f=this;d.push(function(){b.remove();f._trigger("afterTagRemoved",null,{tag:b,tagLabel:f.tagLabel(b)})});b.fadeOut("fast").hide.apply(b,d).dequeue()}else b.remove(),
this._trigger("afterTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})}},removeTagByLabel:function(a,c){var d=this._findTagByLabel(a);if(!d)throw"No such tag exists with the name '"+a+"'";this.removeTag(d,c)},removeAll:function(){var a=this;this._tags().each(function(c,d){a.removeTag(d,!1)})}})})(jQuery);jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){var c=c||function(){return this},d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d);b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}();(function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a(jQuery)})(function(a){function b(a){return e.raw?a:encodeURIComponent(a)}function c(b,c){var j;if(e.raw)j=b;else a:{var i=b;0===i.indexOf('"')&&(i=i.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{i=decodeURIComponent(i.replace(d," "))}catch(n){j=void 0;break a}try{j=e.json?JSON.parse(i):i;break a}catch(k){}j=void 0}return a.isFunction(c)?c(j):j}var d=/\+/g,e=a.cookie=function(d,h,j){if(void 0!==h&&!a.isFunction(h)){j=
a.extend({},e.defaults,j);if("number"===typeof j.expires){var i=j.expires,n=j.expires=new Date;n.setDate(n.getDate()+i)}return document.cookie=[b(d),"=",b(e.json?JSON.stringify(h):String(h)),j.expires?"; expires="+j.expires.toUTCString():"",j.path?"; path="+j.path:"",j.domain?"; domain="+j.domain:"",j.secure?"; secure":""].join("")}for(var j=d?void 0:{},i=document.cookie?document.cookie.split("; "):[],n=0,k=i.length;n<k;n++){var q=i[n].split("="),p;p=q.shift();p=e.raw?p:decodeURIComponent(p);q=q.join("=");
if(d&&d===p){j=c(q,h);break}if(!d&&void 0!==(q=c(q)))j[p]=q}return j};e.defaults={};a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}});(function(a){a.fn.equalizeElementHeights=function(){var b=this.map(function(b,d){return a(d).height()}).get();return this.height(Math.max.apply(this,b))}})(jQuery);(function(a){a.fn.jLabel=function(b){function c(b){this.equals=function(a){return a.attr("id")==this.input.attr("id")};this.input=b;var c=a("label[for="+b.attr("id")+"]");0==c.size()&&(c=a("<label>").attr("for",b.attr("id")).text(b.attr("title")));b.before(c);c.css({"font-family":b.css("font-family"),"font-size":b.css("font-size"),"font-style":b.css("font-style"),"font-variant":b.css("font-variant"),"font-weight":b.css("font-weight"),"letter-spacing":b.css("letter-spacing"),"line-height":b.css("line-height"),
"text-decoration":b.css("text-decoration"),"text-transform":b.css("text-transform"),color:b.css("color"),cursor:b.css("cursor"),width:b.css("width"),display:"inline-block",overflow:"hidden"});c.mousedown(function(){return!1}).css({position:"relative","z-index":"100","margin-right":-c.width(),left:h.xShift+parseInt(b.css("padding-left"))+"px",top:h.yShift+"px"});this.label=c;""!=this.input.val()&&this.label.hide()}function d(b){var c;a.each(f,function(){if(this.equals(b))return c=this,!1});return c}
function e(a){var b=d(a).label;""==a.val()?b.stop().fadeTo(h.speed,h.opacity):b.is(":visible")&&b.stop().fadeTo(h.speed,0,function(){b.hide()})}var f=[],h=a.extend({},a.fn.jLabel.defaults,b);return this.each(function(){var b=a(this);f.push(new c(b));b.focus(function(){var b=a(this);""==b.val()&&d(b).label.stop().fadeTo(h.speed,h.opacity)}).blur(function(){var b=a(this);""==b.val()&&d(b).label.stop().fadeTo(h.speed,1)}).keyup(function(){e(a(this))}).change(function(){e(a(this))})})};a.fn.jLabel.defaults=
{speed:200,opacity:0.4,xShift:2,yShift:0}})(jQuery);jQuery&&function(a){a.extend(a.fn,{selectBox:function(b,c){var d,e="",f=navigator.platform.match(/mac/i),h=function(b,c){var d,e=function(b,c){b.children("OPTION, OPTGROUP").each(function(){if(a(this).is("OPTION"))if(0<a(this).length){var b=a(this),d=c,f=a("<li />"),g=a("<a />");f.addClass(b.attr("class"));f.data(b.data());g.attr("rel",b.val()).text(b.text());f.append(g);b.attr("disabled")&&f.addClass("selectBox-disabled");b.attr("selected")&&f.addClass("selectBox-selected");d.append(f)}else c.append("<li>\u00a0</li>");
else b=a('<li class="selectBox-optgroup" />'),b.text(a(this).attr("label")),c.append(b),c=e(a(this),c)});return c};switch(c){case "inline":return d=a('<ul class="selectBox-options" />'),d=e(b,d),d.find("A").bind("mouseover.selectBox",function(){s(b,a(this).parent())}).bind("mouseout.selectBox",function(){m(b,a(this).parent())}).bind("mousedown.selectBox",function(a){a.preventDefault();b.selectBox("control").hasClass("selectBox-active")||b.selectBox("control").focus()}).bind("mouseup.selectBox",function(c){q();
p(b,a(this).parent(),c)}),D(d),d;case "dropdown":d=a('<ul class="selectBox-dropdown-menu selectBox-options" />');d=e(b,d);d.data("selectBox-select",b).css("display","none").appendTo("BODY").find("A").bind("mousedown.selectBox",function(a){a.preventDefault();a.screenX===d.data("selectBox-down-at-x")&&a.screenY===d.data("selectBox-down-at-y")&&(d.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),q())}).bind("mouseup.selectBox",function(c){c.screenX===d.data("selectBox-down-at-x")&&
c.screenY===d.data("selectBox-down-at-y")||(d.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),p(b,a(this).parent()),q())}).bind("mouseover.selectBox",function(){s(b,a(this).parent())}).bind("mouseout.selectBox",function(){m(b,a(this).parent())});var f=b.attr("class")||"";if(""!==f){var f=f.split(" "),g;for(g in f)d.addClass(f[g]+"-selectBox-dropdown-menu")}D(d);return d}},j=function(b){return("selectBox-label "+(a(b).find("OPTION:selected").attr("class")||"")).replace(/\s+$/,"")},
i=function(b){return a(b).find("OPTION:selected").text()||"\u00a0"},n=function(b){var b=a(b),c=b.data("selectBox-control");c&&c.find(".selectBox-label").attr("class",j(b)).text(i(b))},k=function(b){var b=a(b),c=b.data("selectBox-control"),d=b.data("selectBox-settings"),e=c.data("selectBox-options");if(c.hasClass("selectBox-disabled"))return!1;q();var f=isNaN(c.css("borderBottomWidth"))?0:parseInt(c.css("borderBottomWidth"));e.width(c.innerWidth()).css({top:c.offset().top+c.outerHeight()-f,left:c.offset().left});
if(b.triggerHandler("beforeopen"))return!1;f=function(){b.triggerHandler("open",{_selectBox:!0})};switch(d.menuTransition){case "fade":e.fadeIn(d.menuSpeed,f);break;case "slide":e.slideDown(d.menuSpeed,f);break;default:e.show(d.menuSpeed,f)}d.menuSpeed||f();d=e.find(".selectBox-selected:first");u(b,d,!0);s(b,d);c.addClass("selectBox-menuShowing");a(document).bind("mousedown.selectBox",function(b){a(b.target).parents().andSelf().hasClass("selectBox-options")||q()})},q=function(){0!==a(".selectBox-dropdown-menu:visible").length&&
(a(document).unbind("mousedown.selectBox"),a(".selectBox-dropdown-menu").each(function(){var b=a(this),c=b.data("selectBox-select"),d=c.data("selectBox-control"),e=c.data("selectBox-settings");if(c.triggerHandler("beforeclose"))return!1;var f=function(){c.triggerHandler("close",{_selectBox:!0})};if(e){switch(e.menuTransition){case "fade":b.fadeOut(e.menuSpeed,f);break;case "slide":b.slideUp(e.menuSpeed,f);break;default:b.hide(e.menuSpeed,f)}e.menuSpeed||f();d.removeClass("selectBox-menuShowing")}else a(this).hide(),
a(this).triggerHandler("close",{_selectBox:!0}),a(this).removeClass("selectBox-menuShowing")}))},p=function(b,c,d){var b=a(b),c=a(c),e=b.data("selectBox-control");b.data("selectBox-settings");if(e.hasClass("selectBox-disabled")||0===c.length||c.hasClass("selectBox-disabled"))return!1;b.attr("multiple")?d.shiftKey&&e.data("selectBox-last-selected")?(c.toggleClass("selectBox-selected"),d=c.index()>e.data("selectBox-last-selected").index()?c.siblings().slice(e.data("selectBox-last-selected").index(),
c.index()):c.siblings().slice(c.index(),e.data("selectBox-last-selected").index()),d=d.not(".selectBox-optgroup, .selectBox-disabled"),c.hasClass("selectBox-selected")?d.addClass("selectBox-selected"):d.removeClass("selectBox-selected")):f&&d.metaKey||!f&&d.ctrlKey?c.toggleClass("selectBox-selected"):(c.siblings().removeClass("selectBox-selected"),c.addClass("selectBox-selected")):(c.siblings().removeClass("selectBox-selected"),c.addClass("selectBox-selected"));e.hasClass("selectBox-dropdown")&&e.find(".selectBox-label").text(c.text());
var g=0,h=[];b.attr("multiple")?e.find(".selectBox-selected A").each(function(){h[g++]=a(this).attr("rel")}):h=c.find("A").attr("rel");e.data("selectBox-last-selected",c);b.val()!==h&&(b.val(h),n(b),b.trigger("change"));return!0},s=function(b,c){b=a(b);c=a(c);b.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover");c.addClass("selectBox-hover")},m=function(b,c){b=a(b);a(c);b.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover")},
u=function(b,c,d){if(c&&0!==c.length){var b=a(b),b=b.data("selectBox-control"),e=b.data("selectBox-options"),b=b.hasClass("selectBox-dropdown")?e:e.parent(),e=parseInt(c.offset().top-b.position().top),f=parseInt(e+c.outerHeight());d?b.scrollTop(c.offset().top-b.offset().top+b.scrollTop()-b.height()/2):(0>e&&b.scrollTop(c.offset().top-b.offset().top+b.scrollTop()),f>b.height()&&b.scrollTop(c.offset().top+c.outerHeight()-b.offset().top+b.scrollTop()-b.height()))}},t=function(b,c){var b=a(b),d=b.data("selectBox-control"),
f=d.data("selectBox-options"),g=b.data("selectBox-settings"),h=0,i=0;if(!d.hasClass("selectBox-disabled"))switch(c.keyCode){case 8:c.preventDefault();e="";break;case 9:case 27:q();m(b);break;case 13:d.hasClass("selectBox-menuShowing")?(p(b,f.find("LI.selectBox-hover:first"),c),d.hasClass("selectBox-dropdown")&&q()):k(b);break;case 38:case 37:c.preventDefault();if(d.hasClass("selectBox-menuShowing")){d=f.find(".selectBox-hover").prev("LI");h=f.find("LI:not(.selectBox-optgroup)").length;for(i=0;(0===
d.length||d.hasClass("selectBox-disabled")||d.hasClass("selectBox-optgroup"))&&!(d=d.prev("LI"),0===d.length&&(d=g.loopOptions?f.find("LI:last"):f.find("LI:first")),++i>=h););s(b,d);p(b,d,c);u(b,d)}else k(b);break;case 40:case 39:if(c.preventDefault(),d.hasClass("selectBox-menuShowing")){d=f.find(".selectBox-hover").next("LI");h=f.find("LI:not(.selectBox-optgroup)").length;for(i=0;(0===d.length||d.hasClass("selectBox-disabled")||d.hasClass("selectBox-optgroup"))&&!(d=d.next("LI"),0===d.length&&(d=
g.loopOptions?f.find("LI:first"):f.find("LI:last")),++i>=h););s(b,d);p(b,d,c);u(b,d)}else k(b)}},g=function(b,c){var b=a(b),f=b.data("selectBox-control"),g=f.data("selectBox-options");if(!f.hasClass("selectBox-disabled"))switch(c.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:f.hasClass("selectBox-menuShowing")||k(b),c.preventDefault(),clearTimeout(d),e+=String.fromCharCode(c.charCode||c.keyCode),g.find("A").each(function(){if(a(this).text().substr(0,e.length).toLowerCase()===
e.toLowerCase())return s(b,a(this).parent()),u(b,a(this).parent()),!1}),d=setTimeout(function(){e=""},1E3)}},D=function(b){a(b).css("MozUserSelect","none").bind("selectstart",function(a){a.preventDefault()})};switch(b){case "control":return a(this).data("selectBox-control");case "settings":if(!c)return a(this).data("selectBox-settings");a(this).each(function(){a(this).data("selectBox-settings",a.extend(!0,a(this).data("selectBox-settings"),c))});break;case "options":if(void 0===c)return a(this).data("selectBox-control").data("selectBox-options");
a(this).each(function(){var b,d=c;b=a(this);var e=b.data("selectBox-control");b.data("selectBox-settings");switch(typeof c){case "string":b.html(c);break;case "object":b.html("");for(var f in c)if(null!==c[f]){if("object"===typeof c[f]){var d=a('<optgroup label="'+f+'" />'),g;for(g in c[f])d.append('<option value="'+g+'">'+c[f][g]+"</option>")}else d=a('<option value="'+f+'">'+c[f]+"</option>");b.append(d)}}if(e)switch(e.data("selectBox-options").remove(),f=e.hasClass("selectBox-dropdown")?"dropdown":
"inline",d=h(b,f),e.data("selectBox-options",d),f){case "inline":e.append(d);break;case "dropdown":n(b),a("BODY").append(d)}});break;case "value":if(void 0===c)return a(this).val();a(this).each(function(){var b,d=c;b=a(this);b.val(d);d=b.val();null===d&&(d=b.children().first().val(),b.val(d));var e=b.data("selectBox-control");if(e){var f=b.data("selectBox-settings"),e=e.data("selectBox-options");n(b);e.find(".selectBox-selected").removeClass("selectBox-selected");e.find("A").each(function(){if("object"===
typeof d)for(var b=0;b<d.length;b++)a(this).attr("rel")==d[b]&&a(this).parent().addClass("selectBox-selected");else a(this).attr("rel")==d&&a(this).parent().addClass("selectBox-selected")});f.change&&f.change.call(b)}});break;case "refresh":a(this).each(function(){var b;b=a(this);b.selectBox("options",b.html())});break;case "enable":a(this).each(function(){var b;b=a(this);b.attr("disabled",!1);(b=b.data("selectBox-control"))&&b.removeClass("selectBox-disabled")});break;case "disable":a(this).each(function(){var b;
b=a(this);b.attr("disabled",!0);(b=b.data("selectBox-control"))&&b.addClass("selectBox-disabled")});break;case "destroy":a(this).each(function(){var b;b=a(this);var c=b.data("selectBox-control");c&&(c.data("selectBox-options").remove(),c.remove(),b.removeClass("selectBox").removeData("selectBox-control").data("selectBox-control",null).removeData("selectBox-settings").data("selectBox-settings",null).show())});break;default:a(this).each(function(){var c=this,d;if(!navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i)&&
"select"===c.tagName.toLowerCase()&&(c=a(c),!c.data("selectBox-control"))){var e=a('<a class="selectBox" />'),f=c.attr("multiple")||1<parseInt(c.attr("size")),n=b||{};e.width(c.outerWidth()).addClass(c.attr("class")).attr("title",c.attr("title")||"").attr("tabindex",parseInt(c.attr("tabindex"))).css("display","inline-block").bind("focus.selectBox",function(){this!==document.activeElement&&document.body!==document.activeElement&&a(document.activeElement).blur();e.hasClass("selectBox-active")||(e.addClass("selectBox-active"),
c.trigger("focus"))}).bind("blur.selectBox",function(){e.hasClass("selectBox-active")&&(e.removeClass("selectBox-active"),c.trigger("blur"))});a(window).data("selectBox-bindings")||a(window).data("selectBox-bindings",!0).bind("scroll.selectBox",q).bind("resize.selectBox",q);c.attr("disabled")&&e.addClass("selectBox-disabled");c.bind("click.selectBox",function(a){e.focus();a.preventDefault()});if(f){if(d=h(c,"inline"),e.append(d).data("selectBox-options",d).addClass("selectBox-inline selectBox-menuShowing").bind("keydown.selectBox",
function(a){t(c,a)}).bind("keypress.selectBox",function(a){g(c,a)}).bind("mousedown.selectBox",function(b){a(b.target).is("A.selectBox-inline")&&b.preventDefault();e.hasClass("selectBox-focus")||e.focus()}).insertAfter(c),!c[0].style.height){var f=c.attr("size")?parseInt(c.attr("size")):5,p=e.clone().removeAttr("id").css({position:"absolute",top:"-9999em"}).show().appendTo("body");p.find(".selectBox-options").html("<li><a>\u00a0</a></li>");var m=parseInt(p.find(".selectBox-options A:first").html(" ").outerHeight());
p.remove();e.height(m*f)}}else f=a('<span class="selectBox-label" />'),p=a('<span class="selectBox-arrow" />'),f.attr("class",j(c)).text(i(c)),d=h(c,"dropdown"),d.appendTo("BODY"),e.data("selectBox-options",d).addClass("selectBox-dropdown").append(f).append(p).bind("mousedown.selectBox",function(a){e.hasClass("selectBox-menuShowing")?q():(a.stopPropagation(),d.data("selectBox-down-at-x",a.screenX).data("selectBox-down-at-y",a.screenY),k(c))}).bind("keydown.selectBox",function(a){t(c,a)}).bind("keypress.selectBox",
function(a){g(c,a)}).bind("open.selectBox",function(a,b){b&&!0===b._selectBox||k(c)}).bind("close.selectBox",function(a,b){b&&!0===b._selectBox||q()}).insertAfter(c),p=e.width()-p.outerWidth()-parseInt(f.css("paddingLeft"))-parseInt(f.css("paddingLeft")),f.width(p);D(e);c.addClass("selectBox").data("selectBox-control",e).data("selectBox-settings",n).hide()}})}return a(this)}})}(jQuery);(function(){function a(a){return function(b,c,d,e){var c=D(c,e,4),f=!y(b)&&g.keys(b),h=(f||b).length,i=0<a?0:h-1;3>arguments.length&&(d=b[f?f[i]:i],i+=a);for(var k=c,j=d;0<=i&&i<h;i+=a)var n=f?f[i]:i,j=k(j,b[n],n,b);return j}}function b(a){return function(b,c,d){for(var c=v(c,d),d=z(b),e=0<a?0:d-1;0<=e&&e<d;e+=a)if(c(b[e],e,b))return e;return-1}}function c(a,b,c){return function(d,e,f){var h=0,i=z(d);if("number"==typeof f)0<a?h=0<=f?f:Math.max(f+i,h):i=0<=f?Math.min(f+1,i):f+i+1;else if(c&&f&&i)return f=
c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(n.call(d,h,i),g.isNaN),0<=f?f+h:-1;for(f=0<a?h:i-1;0<=f&&f<i;f+=a)if(d[f]===e)return f;return-1}}function d(a,b){var c=Q.length,d=a.constructor,d=g.isFunction(d)&&d.prototype||j,e="constructor";for(g.has(a,e)&&!g.contains(b,e)&&b.push(e);c--;)e=Q[c],e in a&&(a[e]!==d[e]&&!g.contains(b,e))&&b.push(e)}var e=this,f=e._,h=Array.prototype,j=Object.prototype,i=h.push,n=h.slice,k=j.toString,q=j.hasOwnProperty,p=Array.isArray,s=Object.keys,m=Function.prototype.bind,
u=Object.create,t=function(){},g=function(a){if(a instanceof g)return a;if(!(this instanceof g))return new g(a);this._wrapped=a};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=g),exports._=g):e._=g;g.VERSION="1.8.3";var D=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,
d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},v=function(a,b,c){return null==a?g.identity:g.isFunction(a)?D(a,b,c):g.isObject(a)?g.matcher(a):g.property(a)};g.iteratee=function(a,b){return v(a,b,Infinity)};var l=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;e<d;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;i<h;i++){var k=g[i];if(!b||void 0===c[k])c[k]=f[k]}return c}},A=function(a){if(!g.isObject(a))return{};if(u)return u(a);
t.prototype=a;a=new t;t.prototype=null;return a},w=function(a){return function(b){return null==b?void 0:b[a]}},E=Math.pow(2,53)-1,z=w("length"),y=function(a){a=z(a);return"number"==typeof a&&0<=a&&a<=E};g.each=g.forEach=function(a,b,c){var b=D(b,c),d;if(y(a)){c=0;for(d=a.length;c<d;c++)b(a[c],c,a)}else{var e=g.keys(a),c=0;for(d=e.length;c<d;c++)b(a[e[c]],e[c],a)}return a};g.map=g.collect=function(a,b,c){for(var b=v(b,c),c=!y(a)&&g.keys(a),d=(c||a).length,e=Array(d),f=0;f<d;f++){var h=c?c[f]:f;e[f]=
b(a[h],h,a)}return e};g.reduce=g.foldl=g.inject=a(1);g.reduceRight=g.foldr=a(-1);g.find=g.detect=function(a,b,c){b=y(a)?g.findIndex(a,b,c):g.findKey(a,b,c);if(void 0!==b&&-1!==b)return a[b]};g.filter=g.select=function(a,b,c){var d=[],b=v(b,c);g.each(a,function(a,c,e){b(a,c,e)&&d.push(a)});return d};g.reject=function(a,b,c){return g.filter(a,g.negate(v(b)),c)};g.every=g.all=function(a,b,c){for(var b=v(b,c),c=!y(a)&&g.keys(a),d=(c||a).length,e=0;e<d;e++){var f=c?c[e]:e;if(!b(a[f],f,a))return!1}return!0};
g.some=g.any=function(a,b,c){for(var b=v(b,c),c=!y(a)&&g.keys(a),d=(c||a).length,e=0;e<d;e++){var f=c?c[e]:e;if(b(a[f],f,a))return!0}return!1};g.contains=g.includes=g.include=function(a,b,c,d){y(a)||(a=g.values(a));if("number"!=typeof c||d)c=0;return 0<=g.indexOf(a,b,c)};g.invoke=function(a,b){var c=n.call(arguments,2),d=g.isFunction(b);return g.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})};g.pluck=function(a,b){return g.map(a,g.property(b))};g.where=function(a,b){return g.filter(a,
g.matcher(b))};g.findWhere=function(a,b){return g.find(a,g.matcher(b))};g.max=function(a,b,c){var d=-Infinity,e=-Infinity,f;if(null==b&&null!=a)for(var a=y(a)?a:g.values(a),h=0,i=a.length;h<i;h++)c=a[h],c>d&&(d=c);else b=v(b,c),g.each(a,function(a,c,g){f=b(a,c,g);if(f>e||-Infinity===f&&-Infinity===d)d=a,e=f});return d};g.min=function(a,b,c){var d=Infinity,e=Infinity,f;if(null==b&&null!=a)for(var a=y(a)?a:g.values(a),h=0,i=a.length;h<i;h++)c=a[h],c<d&&(d=c);else b=v(b,c),g.each(a,function(a,c,g){f=
b(a,c,g);if(f<e||Infinity===f&&Infinity===d)d=a,e=f});return d};g.shuffle=function(a){for(var a=y(a)?a:g.values(a),b=a.length,c=Array(b),d=0,e;d<b;d++)e=g.random(0,d),e!==d&&(c[d]=c[e]),c[e]=a[d];return c};g.sample=function(a,b,c){return null==b||c?(y(a)||(a=g.values(a)),a[g.random(a.length-1)]):g.shuffle(a).slice(0,Math.max(0,b))};g.sortBy=function(a,b,c){b=v(b,c);return g.pluck(g.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==
d){if(c>d||void 0===c)return 1;if(c<d||void 0===d)return-1}return a.index-b.index}),"value")};var H=function(a){return function(b,c,d){var e={},c=v(c,d);g.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)});return e}};g.groupBy=H(function(a,b,c){g.has(a,c)?a[c].push(b):a[c]=[b]});g.indexBy=H(function(a,b,c){a[c]=b});g.countBy=H(function(a,b,c){g.has(a,c)?a[c]++:a[c]=1});g.toArray=function(a){return!a?[]:g.isArray(a)?n.call(a):y(a)?g.map(a,g.identity):g.values(a)};g.size=function(a){return null==a?0:y(a)?
a.length:g.keys(a).length};g.partition=function(a,b,c){var b=v(b,c),d=[],e=[];g.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)});return[d,e]};g.first=g.head=g.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:g.initial(a,a.length-b)};g.initial=function(a,b,c){return n.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))};g.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:g.rest(a,Math.max(0,a.length-b))};g.rest=g.tail=g.drop=function(a,b,c){return n.call(a,null==b||c?1:b)};g.compact=
function(a){return g.filter(a,g.identity)};var F=function(a,b,c,d){for(var e=[],f=0,d=d||0,h=z(a);d<h;d++){var i=a[d];if(y(i)&&(g.isArray(i)||g.isArguments(i))){b||(i=F(i,b,c));var k=0,j=i.length;for(e.length+=j;k<j;)e[f++]=i[k++]}else c||(e[f++]=i)}return e};g.flatten=function(a,b){return F(a,b,!1)};g.without=function(a){return g.difference(a,n.call(arguments,1))};g.uniq=g.unique=function(a,b,c,d){g.isBoolean(b)||(d=c,c=b,b=!1);null!=c&&(c=v(c,d));for(var d=[],e=[],f=0,h=z(a);f<h;f++){var i=a[f],
k=c?c(i,f,a):i;b?((!f||e!==k)&&d.push(i),e=k):c?g.contains(e,k)||(e.push(k),d.push(i)):g.contains(d,i)||d.push(i)}return d};g.union=function(){return g.uniq(F(arguments,!0,!0))};g.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=z(a);d<e;d++){var f=a[d];if(!g.contains(b,f)){for(var h=1;h<c&&g.contains(arguments[h],f);h++);h===c&&b.push(f)}}return b};g.difference=function(a){var b=F(arguments,!0,!0,1);return g.filter(a,function(a){return!g.contains(b,a)})};g.zip=function(){return g.unzip(arguments)};
g.unzip=function(a){for(var b=a&&g.max(a,z).length||0,c=Array(b),d=0;d<b;d++)c[d]=g.pluck(a,d);return c};g.object=function(a,b){for(var c={},d=0,e=z(a);d<e;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c};g.findIndex=b(1);g.findLastIndex=b(-1);g.sortedIndex=function(a,b,c,d){for(var c=v(c,d,1),b=c(b),d=0,e=z(a);d<e;){var f=Math.floor((d+e)/2);c(a[f])<b?d=f+1:e=f}return d};g.indexOf=c(1,g.findIndex,g.sortedIndex);g.lastIndexOf=c(-1,g.findLastIndex);g.range=function(a,b,c){null==b&&(b=a||0,a=0);for(var c=
c||1,b=Math.max(Math.ceil((b-a)/c),0),d=Array(b),e=0;e<b;e++,a+=c)d[e]=a;return d};var M=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);b=A(a.prototype);a=a.apply(b,e);return g.isObject(a)?a:b};g.bind=function(a,b){if(m&&a.bind===m)return m.apply(a,n.call(arguments,1));if(!g.isFunction(a))throw new TypeError("Bind must be called on a function");var c=n.call(arguments,2),d=function(){return M(a,d,b,this,c.concat(n.call(arguments)))};return d};g.partial=function(a){var b=n.call(arguments,
1),c=function(){for(var d=0,e=b.length,f=Array(e),h=0;h<e;h++)f[h]=b[h]===g?arguments[d++]:b[h];for(;d<arguments.length;)f.push(arguments[d++]);return M(a,c,this,this,f)};return c};g.bindAll=function(a){var b,c=arguments.length,d;if(1>=c)throw Error("bindAll must be passed function names");for(b=1;b<c;b++)d=arguments[b],a[d]=g.bind(a[d],a);return a};g.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);g.has(e,f)||(e[f]=a.apply(this,arguments));return e[f]};c.cache=
{};return c};g.delay=function(a,b){var c=n.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)};g.defer=g.partial(g.delay,g,1);g.throttle=function(a,b,c){var d,e,f,h=null,i=0;c||(c={});var k=function(){i=!1===c.leading?0:g.now();h=null;f=a.apply(d,e);h||(d=e=null)};return function(){var j=g.now();!i&&!1===c.leading&&(i=j);var n=b-(j-i);d=this;e=arguments;0>=n||n>b?(h&&(clearTimeout(h),h=null),i=j,f=a.apply(d,e),h||(d=e=null)):!h&&!1!==c.trailing&&(h=setTimeout(k,n));return f}};
g.debounce=function(a,b,c){var d,e,f,h,i,k=function(){var j=g.now()-h;j<b&&0<=j?d=setTimeout(k,b-j):(d=null,c||(i=a.apply(f,e),d||(f=e=null)))};return function(){f=this;e=arguments;h=g.now();var j=c&&!d;d||(d=setTimeout(k,b));j&&(i=a.apply(f,e),f=e=null);return i}};g.wrap=function(a,b){return g.partial(b,a)};g.negate=function(a){return function(){return!a.apply(this,arguments)}};g.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,
d);return d}};g.after=function(a,b){return function(){if(1>--a)return b.apply(this,arguments)}};g.before=function(a,b){var c;return function(){0<--a&&(c=b.apply(this,arguments));1>=a&&(b=null);return c}};g.once=g.partial(g.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),Q="valueOf isPrototypeOf toString propertyIsEnumerable hasOwnProperty toLocaleString".split(" ");g.keys=function(a){if(!g.isObject(a))return[];if(s)return s(a);var b=[],c;for(c in a)g.has(a,c)&&b.push(c);N&&d(a,b);
return b};g.allKeys=function(a){if(!g.isObject(a))return[];var b=[],c;for(c in a)b.push(c);N&&d(a,b);return b};g.values=function(a){for(var b=g.keys(a),c=b.length,d=Array(c),e=0;e<c;e++)d[e]=a[b[e]];return d};g.mapObject=function(a,b,c){for(var b=v(b,c),c=g.keys(a),d=c.length,e={},f,h=0;h<d;h++)f=c[h],e[f]=b(a[f],f,a);return e};g.pairs=function(a){for(var b=g.keys(a),c=b.length,d=Array(c),e=0;e<c;e++)d[e]=[b[e],a[b[e]]];return d};g.invert=function(a){for(var b={},c=g.keys(a),d=0,e=c.length;d<e;d++)b[a[c[d]]]=
c[d];return b};g.functions=g.methods=function(a){var b=[],c;for(c in a)g.isFunction(a[c])&&b.push(c);return b.sort()};g.extend=l(g.allKeys);g.extendOwn=g.assign=l(g.keys);g.findKey=function(a,b,c){for(var b=v(b,c),c=g.keys(a),d,e=0,f=c.length;e<f;e++)if(d=c[e],b(a[d],d,a))return d};g.pick=function(a,b,c){var d={},e=a,f,h;if(null==e)return d;g.isFunction(b)?(h=g.allKeys(e),f=D(b,c)):(h=F(arguments,!1,!1,1),f=function(a,b,c){return b in c},e=Object(e));for(var i=0,k=h.length;i<k;i++){var j=h[i],n=e[j];
f(n,j,e)&&(d[j]=n)}return d};g.omit=function(a,b,c){if(g.isFunction(b))b=g.negate(b);else var d=g.map(F(arguments,!1,!1,1),String),b=function(a,b){return!g.contains(d,b)};return g.pick(a,b,c)};g.defaults=l(g.allKeys,!0);g.create=function(a,b){var c=A(a);b&&g.extendOwn(c,b);return c};g.clone=function(a){return!g.isObject(a)?a:g.isArray(a)?a.slice():g.extend({},a)};g.tap=function(a,b){b(a);return a};g.isMatch=function(a,b){var c=g.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;f<d;f++){var h=
c[f];if(b[h]!==e[h]||!(h in e))return!1}return!0};var K=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof g&&(a=a._wrapped);b instanceof g&&(b=b._wrapped);var e=k.call(a);if(e!==k.call(b))return!1;switch(e){case "[object RegExp]":case "[object String]":return""+a===""+b;case "[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case "[object Date]":case "[object Boolean]":return+a===+b}e="[object Array]"===e;if(!e){if("object"!=typeof a||
"object"!=typeof b)return!1;var f=a.constructor,h=b.constructor;if(f!==h&&(!g.isFunction(f)||!(f instanceof f&&g.isFunction(h)&&h instanceof h))&&"constructor"in a&&"constructor"in b)return!1}c=c||[];d=d||[];for(f=c.length;f--;)if(c[f]===a)return d[f]===b;c.push(a);d.push(b);if(e){f=a.length;if(f!==b.length)return!1;for(;f--;)if(!K(a[f],b[f],c,d))return!1}else{e=g.keys(a);f=e.length;if(g.keys(b).length!==f)return!1;for(;f--;)if(h=e[f],!g.has(b,h)||!K(a[h],b[h],c,d))return!1}c.pop();d.pop();return!0};
g.isEqual=function(a,b){return K(a,b)};g.isEmpty=function(a){return null==a?!0:y(a)&&(g.isArray(a)||g.isString(a)||g.isArguments(a))?0===a.length:0===g.keys(a).length};g.isElement=function(a){return!!(a&&1===a.nodeType)};g.isArray=p||function(a){return"[object Array]"===k.call(a)};g.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a};g.each("Arguments Function String Number Date RegExp Error".split(" "),function(a){g["is"+a]=function(b){return k.call(b)==="[object "+a+"]"}});
g.isArguments(arguments)||(g.isArguments=function(a){return g.has(a,"callee")});"function"!=typeof/./&&"object"!=typeof Int8Array&&(g.isFunction=function(a){return"function"==typeof a||!1});g.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))};g.isNaN=function(a){return g.isNumber(a)&&a!==+a};g.isBoolean=function(a){return!0===a||!1===a||"[object Boolean]"===k.call(a)};g.isNull=function(a){return null===a};g.isUndefined=function(a){return void 0===a};g.has=function(a,b){return null!=a&&
q.call(a,b)};g.noConflict=function(){e._=f;return this};g.identity=function(a){return a};g.constant=function(a){return function(){return a}};g.noop=function(){};g.property=w;g.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}};g.matcher=g.matches=function(a){a=g.extendOwn({},a);return function(b){return g.isMatch(b,a)}};g.times=function(a,b,c){for(var d=Array(Math.max(0,a)),b=D(b,c,1),c=0;c<a;c++)d[c]=b(c);return d};g.random=function(a,b){null==b&&(b=a,a=0);return a+Math.floor(Math.random()*
(b-a+1))};g.now=Date.now||function(){return(new Date).getTime()};p={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};l=g.invert(p);w=function(a){var b=function(b){return a[b]},c="(?:"+g.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){a=null==a?"":""+a;return d.test(a)?a.replace(e,b):a}};g.escape=w(p);g.unescape=w(l);g.result=function(a,b,c){b=null==a?void 0:a[b];void 0===b&&(b=c);return g.isFunction(b)?b.call(a):b};var U=0;g.uniqueId=function(a){var b=
++U+"";return a?a+b:b};g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var J=/(.)^/,S={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},R=/\\|'|\r|\n|\u2028|\u2029/g,r=function(a){return"\\"+S[a]};g.template=function(a,b,c){!b&&c&&(b=c);var b=g.defaults({},b,g.templateSettings),c=RegExp([(b.escape||J).source,(b.interpolate||J).source,(b.evaluate||J).source].join("|")+"|$","g"),d=0,e="__p+='";a.replace(c,function(b,c,f,
g,h){e+=a.slice(d,h).replace(R,r);d=h+b.length;c?e+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":f?e+="'+\n((__t=("+f+"))==null?'':__t)+\n'":g&&(e+="';\n"+g+"\n__p+='");return b});e+="';\n";b.variable||(e="with(obj||{}){\n"+e+"}\n");e="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+e+"return __p;\n";try{var f=new Function(b.variable||"obj","_",e)}catch(h){throw h.source=e,h;}c=function(a){return f.call(this,a,g)};c.source="function("+(b.variable||"obj")+
"){\n"+e+"}";return c};g.chain=function(a){a=g(a);a._chain=!0;return a};var L=function(a,b){return a._chain?g(b).chain():b};g.mixin=function(a){g.each(g.functions(a),function(b){var c=g[b]=a[b];g.prototype[b]=function(){var a=[this._wrapped];i.apply(a,arguments);return L(this,c.apply(g,a))}})};g.mixin(g);g.each("pop push reverse shift sort splice unshift".split(" "),function(a){var b=h[a];g.prototype[a]=function(){var c=this._wrapped;b.apply(c,arguments);("shift"===a||"splice"===a)&&0===c.length&&
delete c[0];return L(this,c)}});g.each(["concat","join","slice"],function(a){var b=h[a];g.prototype[a]=function(){return L(this,b.apply(this._wrapped,arguments))}});g.prototype.value=function(){return this._wrapped};g.prototype.valueOf=g.prototype.toJSON=g.prototype.value;g.prototype.toString=function(){return""+this._wrapped};"function"===typeof define&&define.amd&&define("underscore",[],function(){return g})}).call(this);var JSON;JSON||(JSON={});
(function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=j[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var e,j,s,m,u=f,t,g=d[a];g&&("object"===typeof g&&"function"===typeof g.toJSON)&&(g=g.toJSON(a));"function"===typeof i&&(g=i.call(d,a,g));switch(typeof g){case "string":return b(g);case "number":return isFinite(g)?String(g):"null";case "boolean":case "null":return String(g);case "object":if(!g)return"null";
f+=h;t=[];if("[object Array]"===Object.prototype.toString.apply(g)){m=g.length;for(e=0;e<m;e+=1)t[e]=c(e,g)||"null";s=0===t.length?"[]":f?"[\n"+f+t.join(",\n"+f)+"\n"+u+"]":"["+t.join(",")+"]";f=u;return s}if(i&&"object"===typeof i){m=i.length;for(e=0;e<m;e+=1)"string"===typeof i[e]&&(j=i[e],(s=c(j,g))&&t.push(b(j)+(f?": ":":")+s))}else for(j in g)Object.prototype.hasOwnProperty.call(g,j)&&(s=c(j,g))&&t.push(b(j)+(f?": ":":")+s);s=0===t.length?"{}":f?"{\n"+f+t.join(",\n"+f)+"\n"+u+"}":"{"+t.join(",")+
"}";f=u;return s}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var d=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,h,j={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},i;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;h=f="";if("number"===typeof d)for(e=0;e<d;e+=1)h+=" ";else"string"===typeof d&&(h=d);if((i=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e,a=String(a);d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();(function(a){a.pkp=a.pkp||{};a.pkp.classes=a.pkp.classes||{};a.pkp.controllers=a.pkp.controllers||{};a.pkp.plugins=a.pkp.plugins||{};a.pkp.plugins.blocks=a.pkp.plugins.blocks||{};a.pkp.plugins.generic=a.pkp.plugins.generic||{};a.pkp.plugins.pubIds=a.pkp.plugins.pubIds||{};a.pkp.plugins.importexport=a.pkp.plugins.importexport||{};a.pkp.classes.Helper=function(){throw Error("Trying to instantiate the Helper singleton!");};a.pkp.classes.Helper.CHARS_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
a.pkp.classes.Helper.uuid=function(){var b=a.pkp.classes.Helper.CHARS_,c=Array(36),d=0,e,f;for(f=0;36>f;f++)8==f||13==f||18==f||23==f?c[f]="-":14==f?c[f]="4":(2>=d&&(d=33554432+16777216*Math.random()|0),e=d&15,d>>=4,c[f]=b[19==f?e&3|8:e]);return c.join("")};a.pkp.classes.Helper.inherits=function(a,c){var d=function(){};d.prototype=c.prototype;a.parent_=c.prototype;a.prototype=new d;a.prototype.constructor=a;c.prototype.constructor==Object.prototype.constructor&&(c.prototype.constructor=c)};a.pkp.classes.Helper.objectFactory=
function(b,c){var d,e;d=a.pkp.classes.Helper.resolveObjectName(b);e=a.pkp.classes.Helper.getObjectProxyInstance();a.extend(!0,e,a.pkp.classes.ObjectProxy);a.pkp.classes.Helper.inherits(e,d);a.extend(!0,e.prototype,a.pkp.classes.ObjectProxy.prototype);return new e(b,c)};a.pkp.classes.Helper.resolveObjectName=function(b){var c,d,e;c=b.split(".");if("$"!=c.shift())throw Error(['Namespace "',c[0],'" for object "',b,'" is currently not supported!'].join(""));e=c[c.length-1];if(e.charAt(0).toUpperCase()!==
e.charAt(0))throw Error(['The name "',b,'" does not point to aconstructor which must always be upper case!'].join(""));e=a;for(d in c)if(e=e[c[d]],void 0===e)throw Error(['Constructor for object "',b,'" not found!'].join(""));if(!a.isFunction(e))throw Error(['The name "',b,'" does not point to a,constructor which must always be a function!'].join());return e};a.pkp.classes.Helper.getObjectProxyInstance=function(){var a=function(a,b){this.objectName_=a;this.parent.apply(this,b)};a.objectName_="";a.prototype.parent=
function(){};return a};a.pkp.classes.Helper.injectMixin=function(b,c){var d=a.pkp.classes.Helper.objectFactory(c,[]);a.extend(!0,b,d)};a.pkp.classes.Helper.curry=function(a,c,d){if(2<arguments.length){var e,f;e=Array.prototype.slice.call(arguments,2);return function(){f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,e);return a.apply(c,f)}}return function(){return a.apply(c,arguments)}};a.pkp.classes.Helper.escapeJQuerySelector=function(a){return a.replace("@","\\@")}})(jQuery);(function(a){a.pkp.classes.ObjectProxy=function(){};a.pkp.classes.ObjectProxy.prototype.objectName_="";a.pkp.classes.ObjectProxy.prototype.self=function(b,c){var d,e;for(d=this.constructor;d;d=d.parent_&&d.parent_.constructor)if(d.hasOwnProperty(b))return d=d[b],a.isFunction(d)?(e=Array.prototype.slice.call(arguments,1),d.apply(this,e)):d;throw Error(['Static property "',b,'" not found!'].join(""));};a.pkp.classes.ObjectProxy.prototype.parent=function(b,c){var d,e,f,h;d=a.pkp.classes.ObjectProxy.prototype.parent.caller;
if(d.parent_)return e=Array.prototype.slice.call(arguments),d.parent_.constructor.apply(this,e);e=Array.prototype.slice.call(arguments,1);if(this.hasOwnProperty(b)&&this[b]===d)return this.constructor.parent_[b].apply(this,e);f=!1;for(h=this.constructor;h;h=h.parent_&&h.parent_.constructor)if(h.prototype.hasOwnProperty(b)&&h.prototype[b]===d)f=!0;else if(f)return h.prototype[b].apply(this,e);throw Error("Trying to call parent from a method of one name to a method of a different name");};a.pkp.classes.ObjectProxy.prototype.getObjectName=
function(){return this.objectName_}})(jQuery);(function(a){a.pkp.classes.Handler=function(b,c){var d,e,f;if(1<b.length)throw Error("jQuery selector contained more than one handler!");this.$htmlElement_=b;if(void 0!==this.data("handler"))throw Error(['The handler "',this.getObjectName(),'" has already been bound to the selected element!'].join(""));this.eventBindings_={};this.dataItems_={};this.publishedEvents_={};this.handlerChildren_=[];this.globalEventListeners_={};d=this.$htmlElement_.parents();e=this;d.each(function(b){a.pkp.classes.Handler.hasHandler(a(d[b]))&&
a.pkp.classes.Handler.getHandler(a(d[b])).handlerChildren_.push(e)});c.eventBridge&&(this.eventBridge_=c.eventBridge);if(c.publishChangeEvents){this.publishChangeEvents_=c.publishChangeEvents;for(f=0;f<this.publishChangeEvents_.length;f++)this.publishEvent(this.publishChangeEvents_[f])}else this.publishChangeEvents_=[];this.data("handler",this)};a.pkp.classes.Handler.prototype.publishChangeEvents_=null;a.pkp.classes.Handler.prototype.$htmlElement_=null;a.pkp.classes.Handler.prototype.eventBindings_=
null;a.pkp.classes.Handler.prototype.dataItems_=null;a.pkp.classes.Handler.prototype.publishedEvents_=null;a.pkp.classes.Handler.prototype.eventBridge_=null;a.pkp.classes.Handler.prototype.globalEventListeners_=null;a.pkp.classes.Handler.getHandler=function(b){b=b.data("pkp.handler");if(!(b instanceof a.pkp.classes.Handler))throw Error("There is no handler bound to this element!");return b};a.pkp.classes.Handler.hasHandler=function(b){return b.data("pkp.handler")instanceof a.pkp.classes.Handler};
a.pkp.classes.Handler.prototype.getHtmlElement=function(){a.pkp.classes.Handler.checkContext_(this);return this.$htmlElement_};a.pkp.classes.Handler.prototype.publishChangeEvents=function(){var a;for(a=0;a<this.publishChangeEvents_.length;a++)this.trigger(this.publishChangeEvents_[a])};a.pkp.classes.Handler.prototype.handleEvent=function(b){var c,d,e,f,h,j;c=a(this);d=a.pkp.classes.Handler.getHandler(c);if(c[0]!==d.getHtmlElement.call(d)[0])throw Error("An invalid handler is bound to the calling element of an event!");
c=d.eventBindings_[b.type];if(void 0===c)return!1;e=a.makeArray(arguments);f=!0;e.unshift(this);h=0;for(j=c.length;h<j&&!(!1===c[h].apply(d,e)&&(f=!1),b.isImmediatePropagationStopped());h++);b.stopPropagation();return f};a.pkp.classes.Handler.prototype.callbackWrapper=function(b,c){a.pkp.classes.Handler.checkContext_(this);c||(c=this);return function(){var d;d=a.makeArray(arguments);d.unshift(this);return b.apply(c,d)}};a.pkp.classes.Handler.prototype.remoteResponse=function(a,c){return this.handleJson(c)};
a.pkp.classes.Handler.prototype.remove=function(){a.pkp.classes.Handler.checkContext_(this);var b,c;b=this.getHtmlElement();b.unbind(".pkpHandler");for(c in this.dataItems_)"pkp.handler"!==c&&b.removeData(c);b.trigger("pkpRemoveHandler");b.unbind(".pkpHandlerRemove");b.removeData("pkp.handler")};a.pkp.classes.Handler.prototype.handleJson=function(a){if(!a)throw Error("Server error: Server returned no or invalid data!");if(!0===a.status)return _.each(a.events,function(a){var b=_.has(a,"data")?a.data:
null;!_.isNull(b)&&b.isGlobalEvent?(b.handler=this,pkp.eventBus.$emit(a.name,b)):this.trigger(a.name,b)},this),a;a.content&&alert(a.content);return!1};a.pkp.classes.Handler.prototype.setHtmlElement=function(b){a.pkp.classes.Handler.checkContext_(this);return this.$htmlElement_=b};a.pkp.classes.Handler.prototype.bind=function(b,c){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[b]){this.eventBindings_[b]=[];var d;d=".pkpHandler";"pkpRemoveHandler"===b&&(d=".pkpHandlerRemove");this.getHtmlElement().bind(b+
d,this.handleEvent)}this.eventBindings_[b].push(c)};a.pkp.classes.Handler.prototype.unbind=function(b,c){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[b])return!1;var d,e;d=0;for(e=this.eventBindings_[b].length;d<e;d++)if(this.eventBindings_[b][d]===c){this.eventBindings_[b].splice([d],1);break}0===this.eventBindings_[b].length&&(delete this.eventBindings_[b],this.getHtmlElement().unbind(b,this.handleEvent));return!0};a.pkp.classes.Handler.prototype.bindGlobal=function(a,c){"undefined"===
typeof this.globalEventListeners_[a]&&(this.globalEventListeners_[a]=[]);var d=this.callbackWrapper(c);this.globalEventListeners_[a].push(d);pkp.eventBus.$on(a,d)};a.pkp.classes.Handler.prototype.unbindGlobal=function(a,c){var d=this.callbackWrapper(c);"undefined"!==typeof this.globalEventListeners_[a]&&(this.globalEventListeners=_.reject(this.globalEventListeners,function(a){return a===d}));pkp.eventBus.$off(a,d)};a.pkp.classes.Handler.prototype.unbindGlobalAll=function(){"undefined"!==typeof this.globalEventListeners_&&
_.each(this.globalEventListeners_,function(a,c){_.each(a,function(a){pkp.eventBus.$off(c,a)})});this.globalEventListeners=null;this.unbindGlobalChildren()};a.pkp.classes.Handler.prototype.unbindGlobalChildren=function(){_.each(this.handlerChildren_,function(a){"undefined"!==typeof a.unbindGlobalAll?a.unbindGlobalAll():"undefined"!==typeof a.$destroy&&(delete pkp.registry._instances[a.id],a.$destroy())})};a.pkp.classes.Handler.prototype.data=function(b,c){a.pkp.classes.Handler.checkContext_(this);
b="pkp."+b;void 0!==c&&(this.dataItems_[b]=!0);return 1<arguments.length?this.getHtmlElement().data(b,c):this.getHtmlElement().data(b)};a.pkp.classes.Handler.prototype.trigger=function(a,c){void 0===c&&(c=null);this.getHtmlElement().triggerHandler(a,c);this.publishedEvents_[a]||this.triggerPublicEvent_(a,c)};a.pkp.classes.Handler.prototype.publishEvent=function(a){this.publishedEvents_[a]||(this.publishedEvents_[a]=!0,this.bind(a,function(c,d,e){var f=null;2<arguments.length&&(f=Array.prototype.slice.call(arguments,
2));this.triggerPublicEvent_(a,f)}))};a.pkp.classes.Handler.prototype.switchViz=function(b){a(b.currentTarget).parent().parent().find("span").toggle()};a.pkp.classes.Handler.prototype.initializeTinyMCE=function(){if("undefined"!==typeof tinyMCE){var b=this.getHtmlElement().attr("id"),c=tinyMCE.EditorManager.settings;c.defaultToolbar=c.toolbar;a("#"+b).find(".richContent").each(function(){var b=a(this).attr("id"),c=a("<div></div>"),f=a("<div></div>"),h=tinyMCE.EditorManager.settings;h.toolbar=a(this).hasClass("extendedRichContent")?
h.richToolbar:h.defaultToolbar;tinyMCE.EditorManager.createEditor(b,h).render();if(a(this).hasClass("localizable")||a(this).hasClass("flag"))if(c.addClass("mceLocalizationIcon localizable"),c.attr("id","mceLocalizationIcon-"+b),a(this).wrap(f),a(this).parent().append(c),a(this).hasClass("localizable"))c.addClass("mceGlobe");else if(a(this).hasClass("flag")&&(b=a(this).attr("class").split(" "),b.length))for(f=0;f<b.length;f++)if(b[f].match(/^flag_[a-z]{2}_[A-Z]{2}$/)){c.addClass(b[f]);break}})}};a.pkp.classes.Handler.prototype.triggerPublicEvent_=
function(b,c){this.getHtmlElement().parent().trigger(b,c);this.eventBridge_&&a('[id^="'+this.eventBridge_+'"]').trigger(b,c)};a.pkp.classes.Handler.prototype.replaceWith=function(a){this.unbindGlobalAll();this.getHtmlElement().replaceWith(a)};a.pkp.classes.Handler.prototype.replacePartialWith=function(b,c){a.pkp.classes.Handler.hasHandler(c)?a.pkp.classes.Handler.getHandler(c).replaceWith(b):(this.unbindPartial(c),c.replaceWith(b))};a.pkp.classes.Handler.prototype.html=function(a){this.unbindGlobalChildren();
this.getHtmlElement().html(a)};a.pkp.classes.Handler.prototype.unbindPartial=function(b){a("*",b).each(function(){if(a.pkp.classes.Handler.hasHandler(a(this))){var b=a.pkp.classes.Handler.getHandler(a(this));b.callbackWrapper(b.unbindGlobalAll())}})};a.pkp.classes.Handler.checkContext_=function(b){if(!(b instanceof a.pkp.classes.Handler))throw Error("Trying to call handler method in non-handler context!");}})(jQuery);(function(a){a.pkp.classes.TinyMCEHelper=function(){throw Error("Trying to instantiate the TinyMCEHelper singleton!");};a.pkp.classes.TinyMCEHelper.prototype.getVariableMap=function(b){b=a(b).attr("data-variables");return void 0!==b?a.parseJSON(decodeURIComponent(b)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap=function(b){b=a(b).attr("data-variablesType");return void 0!==b?a.parseJSON(decodeURIComponent(b)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableElement=function(b,
c,d){d=a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap(d);return void 0!=d[b]&&(d=d[b],d==a.pkp.cons.INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT)?a("<div/>").append(a("<span/>").text(c)):a("<div/>").append(a("<span/>").addClass("pkpTag mceNonEditable").attr("data-symbolic",b).text(c))}})(jQuery);(function(a){a.pkp.classes.linkAction=a.pkp.classes.linkAction||{};a.pkp.classes.linkAction.LinkActionRequest=function(a,c){this.$linkActionElement=a;this.options=c;a.is("a")&&c.url&&a.attr("href",c.url)};a.pkp.classes.linkAction.LinkActionRequest.prototype.$linkActionElement=null;a.pkp.classes.linkAction.LinkActionRequest.prototype.options=null;a.pkp.classes.linkAction.LinkActionRequest.prototype.activate=function(){this.getLinkActionElement().trigger("actionStart");return!1};a.pkp.classes.linkAction.LinkActionRequest.prototype.finish=
function(){this.options.finishCallback&&this.options.finishCallback();this.getLinkActionElement().trigger("actionStop");return!1};a.pkp.classes.linkAction.LinkActionRequest.prototype.getUrl=function(){return this.options.url?this.options.url:null};a.pkp.classes.linkAction.LinkActionRequest.prototype.getOptions=function(){return this.options};a.pkp.classes.linkAction.LinkActionRequest.prototype.getLinkActionElement=function(){return this.$linkActionElement};a.pkp.classes.linkAction.LinkActionRequest.prototype.shouldDebounce=
function(){return!0}})(jQuery);(function(a){a.pkp.classes.linkAction.RedirectRequest=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.RedirectRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.RedirectRequest.prototype.activate=function(a,c){var d=this.getOptions();window.open(d.url,d.name,d.specs);return this.parent("activate",a,c)}})(jQuery);(function(a){a.pkp.classes.linkAction.OpenWindowRequest=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.OpenWindowRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.OpenWindowRequest.prototype.activate=function(a,c){var d=this.getOptions();window.open(d.url);return this.parent("activate",a,c)}})(jQuery);(function(a){a.pkp.classes.linkAction.PostAndRedirectRequest=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.PostAndRedirectRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.postJsonData_=null;a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.activate=function(b,c){var d=this.parent("activate",b,c),e=this.getOptions(),f=a.pkp.classes.Helper.curry(this.handleResponse_,this);a.post(e.postUrl,f,
"json");return d};a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.finishCallback_=function(){var b=this.getLinkActionElement(),b=a.pkp.classes.Handler.getHandler(b);this.finish();b.handleJson(this.postJsonData_)};a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.handleResponse_=function(b){var c=this.getOptions(),d=null,e=null;this.postJsonData_=b;d=setInterval(function(){0==a.active&&(clearInterval(d),window.location=c.url)},100);e=a.pkp.classes.Helper.curry(this.finishCallback_,
this);setTimeout(e,2E3)}})(jQuery);(function(a){a.pkp.classes.linkAction.NullAction=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.NullAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.NullAction.prototype.activate=function(a,c){return this.parent("activate",a,c)};a.pkp.classes.linkAction.NullAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.EventAction=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.EventAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.EventAction.prototype.activate=function(b,c){a(this.options.target).trigger(this.options.event,this.options);return this.parent("activate",b,c)};a.pkp.classes.linkAction.EventAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.AjaxRequest=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.AjaxRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.AjaxRequest.prototype.activate=function(b,c){var d=this.parent("activate",b,c),e=this.getOptions(),f=a.pkp.classes.Helper.curry(this.handleResponse,this);switch(e.requestType){case "get":a.getJSON(e.url,f);break;case "post":a.post(e.url,f,"json")}return d};a.pkp.classes.linkAction.AjaxRequest.prototype.handleResponse=
function(a){this.getLinkActionElement().data("pkp.handler").handleJson(a);this.finish()}})(jQuery);(function(a){a.pkp.classes.linkAction.ModalRequest=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.ModalRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.ModalRequest.prototype.$modal_=null;a.pkp.classes.linkAction.ModalRequest.prototype.activate=function(b,c){var d=this.getOptions(),e=this.getLinkActionElement(),f=e.text();void 0===d.title&&(""===f&&(f=e.attr("title")),d.title=f);e=a.pkp.classes.Helper.uuid();if(!d.modalHandler)throw Error('The "modalHandler" setting is required in a ModalRequest');
f=this.getLinkActionElement();f=a.pkp.classes.Handler.getHandler(f);f=a.extend(!0,{eventBridge:f.getStaticId()},d);this.$modal_=a('<div id="'+e+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler(d.modalHandler,f);a.pkp.classes.Handler.getHandler(this.$modal_).bind("pkpRemoveHandler",a.pkp.classes.Helper.curry(this.finish,this));return this.parent("activate",b,c)};a.pkp.classes.linkAction.ModalRequest.prototype.finish=function(){0!==this.$linkActionElement.attr("id").indexOf("newRoundTabContainer")&&
this.$linkActionElement.focus();this.$modal_.remove();return this.parent("finish")}})(jQuery);(function(a){a.pkp.classes.notification=a.pkp.classes.notification||{};a.pkp.classes.notification.NotificationHelper=function(){};a.pkp.classes.notification.NotificationHelper.redirectNotifyUserEvent=function(b,c){var d,e,f,h,j,i,n,k,q,p,s;if(void 0!==c.content)b.getHtmlElement().parent().trigger("notifyUser",[c]);else{d=b.getHtmlElement();e=!1;!(b instanceof a.pkp.controllers.SiteHandler)&&0<a(c).parents(".pkp_controllers_grid").length&&(d.parent().trigger("notifyUser"),e=!0);d=a(".pkp_notification",
d);f=[];h=0;for(j=d.length;h<j;h++)if(n=a(d[h]),!(0<n.parents(":hidden").length)){i=n.parents();q=0;for(p=i.length;q<p;q++)if(k=a(i[q]).data("pkp.handler"),k instanceof a.pkp.classes.Handler){s=a(i[q]);break}if(s.has(c[0]).length||s[0]===c[0]){if(0<n.parents(".ui-accordion:first").length&&(i=n.parents(".ui-accordion:first"),!i.has(c[0])))continue;f.push(n)}}if(f.length)for(h=f.length-1;-1<h;h--)f[h].triggerHandler("notifyUser");else e||b.getHtmlElement().parent().trigger("notifyUser")}}})(jQuery);(function(a){a.pkp.classes.features=a.pkp.classes.features||{};a.pkp.classes.features.Feature=function(a,c){this.gridHandler=a;this.options_=c;this.addFeatureHtml(this.getGridHtmlElement(),c)};a.pkp.classes.features.Feature.prototype.gridHandler=null;a.pkp.classes.features.Feature.prototype.options_=null;a.pkp.classes.features.Feature.prototype.setOptions=function(a){this.options_=a};a.pkp.classes.features.Feature.prototype.getOptions=function(){return this.options_};a.pkp.classes.features.Feature.prototype.init=
function(){throw Error("Abstract method!");};a.pkp.classes.features.Feature.prototype.addElement=function(){return!1};a.pkp.classes.features.Feature.prototype.replaceElement=function(){return!1};a.pkp.classes.features.Feature.prototype.resequenceRows=function(){return!1};a.pkp.classes.features.Feature.prototype.refreshGrid=function(){return!1};a.pkp.classes.features.Feature.prototype.replaceElementResponseHandler=function(){return!1};a.pkp.classes.features.Feature.prototype.callbackWrapper=function(a,
c){return this.gridHandler.callbackWrapper(a,c)};a.pkp.classes.features.Feature.prototype.addFeatureHtml=function(){};a.pkp.classes.features.Feature.prototype.getGridHtmlElement=function(){return this.gridHandler.getHtmlElement()}})(jQuery);(function(a){a.pkp.classes.features.OrderItemsFeature=function(b,c){this.parent(b,c);this.$orderButton_=a(".pkp_linkaction_orderItems",this.getGridHtmlElement());this.$finishControl_=a(".order_finish_controls",this.getGridHtmlElement());0===this.$orderButton_.length&&(this.isOrdering=!0);this.itemsOrder=[]};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderItemsFeature,a.pkp.classes.features.Feature);a.pkp.classes.features.OrderItemsFeature.prototype.itemsOrder=null;a.pkp.classes.features.OrderItemsFeature.prototype.isOrdering=
!1;a.pkp.classes.features.OrderItemsFeature.prototype.$orderButton_=null;a.pkp.classes.features.OrderItemsFeature.prototype.$cancelButton_=null;a.pkp.classes.features.OrderItemsFeature.prototype.$saveButton_=null;a.pkp.classes.features.OrderItemsFeature.prototype.$finishControl_=null;a.pkp.classes.features.OrderItemsFeature.prototype.getOrderButton=function(){return this.$orderButton_};a.pkp.classes.features.OrderItemsFeature.prototype.getFinishControl=function(){return this.$finishControl_};a.pkp.classes.features.OrderItemsFeature.prototype.getSaveOrderButton=
function(){return this.getFinishControl().find(".saveButton")};a.pkp.classes.features.OrderItemsFeature.prototype.getCancelOrderButton=function(){return this.getFinishControl().find(".cancelFormButton")};a.pkp.classes.features.OrderItemsFeature.prototype.getMoveItemRowActionSelector=function(){return".orderable .pkp_linkaction_moveItem"};a.pkp.classes.features.OrderItemsFeature.prototype.getMoveItemClasses=function(){return"pkp_helpers_moveicon ordering"};a.pkp.classes.features.OrderItemsFeature.prototype.dragStartCallback=
function(){};a.pkp.classes.features.OrderItemsFeature.prototype.dragStopCallback=function(){};a.pkp.classes.features.OrderItemsFeature.prototype.updateOrderCallback=function(){};a.pkp.classes.features.OrderItemsFeature.prototype.init=function(){this.addOrderingClassToRows();this.toggleMoveItemRowAction(this.isOrdering);this.getGridHtmlElement().find("div.order_message").hide();this.toggleOrderLink_();this.isOrdering&&this.setupSortablePlugin()};a.pkp.classes.features.OrderItemsFeature.prototype.addFeatureHtml=
function(b,c){var d,e;void 0!==c.orderFinishControls&&(d=a(c.orderFinishControls),b.find("table").last().after(d),d.hide());void 0!==c.orderMessage&&(d=c.orderMessage,e=b.find(".gridRow").filter(function(){return!Boolean(a(this).find("a.pkp_linkaction_moveItem").length)}),e.find("td:first-child").prepend(d));this.updateOrderLinkVisibility_()};a.pkp.classes.features.OrderItemsFeature.prototype.addOrderingClassToRows=function(){this.gridHandler.getRows().filter(function(){return a(this).find("a.pkp_linkaction_moveItem").length}).addClass("orderable")};
a.pkp.classes.features.OrderItemsFeature.prototype.setupSortablePlugin=function(){};a.pkp.classes.features.OrderItemsFeature.prototype.storeRowOrder=function(){};a.pkp.classes.features.OrderItemsFeature.prototype.clickOrderHandler=function(){this.gridHandler.hideAllVisibleRowActions();this.storeOrder(this.gridHandler.getRows());this.toggleState(!0);return!1};a.pkp.classes.features.OrderItemsFeature.prototype.saveOrderHandler=function(){var a;this.gridHandler.updateControlRowsPosition();this.unbindOrderFinishControlsHandlers_();
a=this.gridHandler.getRows();this.storeOrder(a);return!1};a.pkp.classes.features.OrderItemsFeature.prototype.cancelOrderHandler=function(){this.gridHandler.resequenceRows(this.itemsOrder);this.toggleState(!1);return!1};a.pkp.classes.features.OrderItemsFeature.prototype.toggleState=function(a){this.isOrdering=a;this.toggleGridLinkActions_();this.toggleOrderLink_();this.toggleFinishControl_();this.toggleItemsDragMode();this.setupSortablePlugin();this.setupNonOrderableMessage_()};a.pkp.classes.features.OrderItemsFeature.prototype.storeOrder=
function(b){var c,d,e,f;this.itemsOrder=[];c=0;for(d=b.length;c<d;c++)e=a(b[c]),f=e.attr("id"),this.itemsOrder.push(f),this.storeRowOrder(c,e)};a.pkp.classes.features.OrderItemsFeature.prototype.toggleItemsDragMode=function(){var a=this.isOrdering,c=this.gridHandler.getRows().filter(".orderable"),d=this.getMoveItemClasses();a?c.addClass(d):c.removeClass(d);this.toggleMoveItemRowAction(a)};a.pkp.classes.features.OrderItemsFeature.prototype.applySortPlgOnElements=function(b,c,d){var e=this.isOrdering,
f=this.gridHandler.callbackWrapper(this.dragStartCallback,this),h=this.gridHandler.callbackWrapper(this.dragStopCallback,this),j=this.gridHandler.callbackWrapper(this.updateOrderCallback,this),c={disabled:!e,items:c,activate:f,deactivate:h,update:j,tolerance:"pointer"};"object"===typeof d&&(c=a.extend(!0,c,d));b.sortable(c)};a.pkp.classes.features.OrderItemsFeature.prototype.getRowsDataId=function(b){var c,d=[],e;for(c in this.itemsOrder)e=a("#"+this.itemsOrder[c],b),1>e.length||(e=this.gridHandler.getRowDataId(e),
d.push(e));return d};a.pkp.classes.features.OrderItemsFeature.prototype.toggleMoveItemRowAction=function(b){var c=this.getGridHtmlElement(),d=a("div.row_actions",c),e="a:not("+this.getMoveItemRowActionSelector()+")",f=d.find(e),d=a(this.getMoveItemRowActionSelector(),c);b?(f.addClass("pkp_helpers_display_none"),d.show(),this.gridHandler.showRowActionsDiv()):(f.removeClass("pkp_helpers_display_none"),b=a(".gridRow div.row_actions",c),e=b.find(e),0===e.length&&this.gridHandler.hideRowActionsDiv(),d.hide())};
a.pkp.classes.features.OrderItemsFeature.prototype.addElement=function(){this.addOrderingClassToRows();this.toggleItemsDragMode();return!1};a.pkp.classes.features.OrderItemsFeature.prototype.replaceElement=function(){this.addOrderingClassToRows();this.toggleItemsDragMode();return!1};a.pkp.classes.features.OrderItemsFeature.prototype.replaceElementResponseHandler=function(){this.updateOrderLinkVisibility_();this.setupNonOrderableMessage_();return!1};a.pkp.classes.features.OrderItemsFeature.prototype.updateOrderLinkVisibility_=
function(){var b=a(".pkp_linkaction_orderItems",this.getGridHtmlElement());1>=this.gridHandler.getRows().length?b.hide():b.show()};a.pkp.classes.features.OrderItemsFeature.prototype.toggleGridLinkActions_=function(){var b=this.isOrdering,c=a(".pkp_controllers_linkAction",this.getGridHtmlElement()).not(this.getMoveItemRowActionSelector()).not(this.getOrderButton()).not(this.getFinishControl().find("*"));this.gridHandler.changeLinkActionsState(!b,c)};a.pkp.classes.features.OrderItemsFeature.prototype.toggleOrderLink_=
function(){if(this.isOrdering)this.$orderButton_.unbind("click"),this.$orderButton_.attr("disabled","disabled");else{var a=this.gridHandler.callbackWrapper(this.clickOrderHandler,this);this.$orderButton_.click(a);this.$orderButton_.removeAttr("disabled")}};a.pkp.classes.features.OrderItemsFeature.prototype.toggleFinishControl_=function(){this.isOrdering?(this.bindOrderFinishControlsHandlers_(),this.getFinishControl().slideDown(300)):(this.unbindOrderFinishControlsHandlers_(),this.getFinishControl().slideUp(300))};
a.pkp.classes.features.OrderItemsFeature.prototype.bindOrderFinishControlsHandlers_=function(){var a=this.getSaveOrderButton(),c=this.getCancelOrderButton(),d=this.gridHandler.callbackWrapper(this.cancelOrderHandler,this),e=this.gridHandler.callbackWrapper(this.saveOrderHandler,this);a.click(e);c.click(d)};a.pkp.classes.features.OrderItemsFeature.prototype.unbindOrderFinishControlsHandlers_=function(){this.getSaveOrderButton().unbind("click");this.getCancelOrderButton().unbind("click")};a.pkp.classes.features.OrderItemsFeature.prototype.setupNonOrderableMessage_=
function(){this.isOrdering?this.gridHandler.getRows().hover(function(){a(this).find("div.order_message").toggle()}):this.gridHandler.getRows().unbind("mouseenter mouseleave")}})(jQuery);(function(a){a.pkp.classes.features.OrderGridItemsFeature=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderGridItemsFeature,a.pkp.classes.features.OrderItemsFeature);a.pkp.classes.features.OrderGridItemsFeature.prototype.setupSortablePlugin=function(){this.applySortPlgOnElements(this.getGridHtmlElement(),"tr.orderable",null)};a.pkp.classes.features.OrderGridItemsFeature.prototype.saveOrderHandler=function(){var b,c,d=this.getOptions();this.parent("saveOrderHandler");
b=JSON.stringify(this.getItemsDataId());c=this.callbackWrapper(this.saveOrderResponseHandler_,this);a.post(d.saveItemsSequenceUrl,{data:b},c,"json");return!1};a.pkp.classes.features.OrderGridItemsFeature.prototype.getItemsDataId=function(){return this.getRowsDataId(this.getGridHtmlElement())};a.pkp.classes.features.OrderGridItemsFeature.prototype.saveOrderResponseHandler_=function(a,c){this.gridHandler.handleJson(c);this.toggleState(!1)}})(jQuery);(function(a){a.pkp.classes.features.OrderCategoryGridItemsFeature=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderCategoryGridItemsFeature,a.pkp.classes.features.OrderGridItemsFeature);a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.setupSortablePlugin=function(){var b,c,d,e;this.applySortPlgOnElements(this.getGridHtmlElement(),"tbody.orderable",null);b=navigator.userAgent.toLowerCase();if(!(/msie/.test(b)&&8>=parseInt(b.substr(b.indexOf("msie")+
5,1),10))){b=this.gridHandler.getCategories();c=0;for(d=b.length;c<d;c++)e=a(b[c]),this.applySortPlgOnElements(e,"tr.orderable",null)}};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.saveOrderHandler=function(){this.gridHandler.updateEmptyPlaceholderPosition();this.parent("saveOrderHandler");return!1};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.cancelOrderHandler=function(){var a=this.getCategorySequence_(this.itemsOrder);this.parent("cancelOrderHandler");this.gridHandler.resequenceCategories(a);
return!1};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.toggleItemsDragMode=function(){this.parent("toggleItemsDragMode");var b=this.gridHandler.getCategories(),c,d,e;c=0;for(d=b.length;c<d;c++)e=a(b[c]),this.toggleCategoryDragMode_(e)};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.addOrderingClassToRows=function(){var b=this.getOptions().type,c;if(b==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_ONLY||b==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_AND_ROWS)c=this.gridHandler.getCategories(),
c.addClass("orderable");(b==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_ROWS_ONLY||b==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_AND_ROWS)&&this.parent("addOrderingClassToRows");this.gridHandler.getCategoryRow().removeClass("orderable")};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.getItemsDataId=function(){var b=this.getCategorySequence_(this.itemsOrder),c=[],d,e,f,h;d=0;for(e=b.length;d<e;d++)f=a("#"+b[d]),h=this.getRowsDataId(f),f=this.gridHandler.getCategoryDataId(f),c.push({categoryId:f,
rowsId:h});return c};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.toggleCategoryDragMode_=function(b){var c=this.isOrdering,b=this.gridHandler.getCategoryRow(b),b=a("td:first",b),d=this.getMoveItemClasses();c?b.addClass(d):b.removeClass(d)};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.getCategorySequence_=function(b){var c,d,e=[],f;c=0;for(d=b.length;c<d;c++)f=this.gridHandler.getCategoryDataIdByRowId(b[c]),f=this.gridHandler.getCategoryIdPrefix()+f,-1<a.inArray(f,
e)||e.push(f);return e}})(jQuery);(function(a){a.pkp.classes.features.OrderListbuilderItemsFeature=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderListbuilderItemsFeature,a.pkp.classes.features.OrderItemsFeature);a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.addFeatureHtml=function(b,c){var d,e,f,h,j,i;this.parent("addFeatureHtml",b,c);d=this.getSequenceInput_();e=this.gridHandler.getRows();f=0;for(h=e.length;f<h;f++)j=a(e[f]),i=d.clone(),a("td.first_column",j).append(i)};
a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.setupSortablePlugin=function(){this.applySortPlgOnElements(this.getGridHtmlElement(),"tr.orderable",null)};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.init=function(){this.parent("init");this.toggleItemsDragMode()};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.toggleState=function(a){this.parent("toggleState",a);this.toggleContentHandlers_()};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.storeRowOrder=
function(a,c){c.find(".itemSequence").attr("value",a+1);c.find(".isModified").attr("value",1)};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.saveOrderHandler=function(){this.parent("saveOrderHandler");this.toggleState(!1);return!1};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.updateOrderCallback=function(){var a;this.parent("updateOrderCallback");a=this.gridHandler.getRows();this.storeOrder(a)};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.clickOrderHandler=
function(){var b=a("select:visible",this.getGridHtmlElement()),c,d;if(0<b.length){c=0;for(d=b.length;c<d;c++)this.gridHandler.saveRow(a(b[c]).parents(".gridRow"))}return this.parent("clickOrderHandler")};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.addElement=function(a){this.parent("addElement",a);this.formatAndStoreNewRow_(a);return!1};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.replaceElement=function(a){this.parent("replaceElement",a);this.formatAndStoreNewRow_(a);
return!1};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.getSequenceInput_=function(){return a('<input type="hidden" name="newRowId[sequence]" class="itemSequence" />')};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.toggleContentHandlers_=function(){var b=this.gridHandler.getRows(),c,d,e;c=0;for(d=b.length;c<d;c++)e=a(b[c]),this.isOrdering?e.find(".gridCellDisplay").unbind("click"):this.gridHandler.attachContentHandlers_(e)};a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.formatAndStoreNewRow_=
function(a){a.children().after(this.getSequenceInput_());a=this.gridHandler.getRows();this.storeOrder(a)}})(jQuery);(function(a){a.pkp.classes.features.OrderMultipleListsItemsFeature=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderMultipleListsItemsFeature,a.pkp.classes.features.OrderListbuilderItemsFeature);a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.addFeatureHtml=function(b,c){var d,e,f,h,j,i,n;this.parent("addFeatureHtml",b,c);d=a('<input type="hidden" name="newRowId[listId]" class="itemList" />');e=this.gridHandler.getRows();f=0;for(h=e.length;f<
h;f++)j=a(e[f]),i=this.gridHandler.getListIdByRow(j),n=d.clone(),n.attr("value",i),a("td.first_column",j).append(n)};a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.storeRowOrder=function(a,c){var d,e;this.parent("storeRowOrder",a,c);d=c.find(".itemList");e=this.gridHandler.getListIdByRow(c);d.attr("value",e)};a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.setupSortablePlugin=function(){var a=this.gridHandler.getLists().find("tbody");this.applySortPlgOnElements(a,
"tr.orderable",{connectWith:a})};a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.dragStartCallback=function(a,c,d){a=this.gridHandler.getListByRow(d.item);this.gridHandler.toggleListNoItemsRow(a,1,".ui-sortable-placeholder, .ui-sortable-helper")};a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.dragStopCallback=function(a,c,d){a=this.gridHandler.getListByRow(d.item);this.gridHandler.toggleListNoItemsRow(a,0,null)}})(jQuery);(function(a){a.pkp.classes.features.GeneralPagingFeature=function(a,c){c.defaultItemsPerPage=parseInt(c.defaultItemsPerPage,10);c.currentItemsPerPage=parseInt(c.currentItemsPerPage,10);c.itemsTotal=c.itemsTotal?parseInt(c.itemsTotal,10):0;c.currentPage=parseInt(c.currentPage,10);this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.GeneralPagingFeature,a.pkp.classes.features.Feature);a.pkp.classes.features.GeneralPagingFeature.prototype.getOptions=function(){return this.parent("getOptions")};
a.pkp.classes.features.GeneralPagingFeature.prototype.setGridParams=function(b){var c=this.getOptions();c.hasOwnProperty("filter")&&(c=a.parseJSON(c.filter),a.extend(!0,b,c));this.gridHandler.setFetchExtraParams(b)}})(jQuery);(function(a){a.pkp.classes.features.PagingFeature=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.PagingFeature,a.pkp.classes.features.GeneralPagingFeature);a.pkp.classes.features.PagingFeature.prototype.init=function(){this.configPagingLinks_();this.configItemsPerPageElement_()};a.pkp.classes.features.PagingFeature.prototype.addFeatureHtml=function(a,c){a.append(c.pagingMarkup)};a.pkp.classes.features.PagingFeature.prototype.resequenceRows=function(){var a=this.gridHandler.getRows(),
c,d;c=this.getOptions();c=a.length-c.currentItemsPerPage;if(0<c)for(d=0;d<c;d++)this.gridHandler.deleteElement(a.first(),!0);return!1};a.pkp.classes.features.PagingFeature.prototype.refreshGrid=function(){var a=this.getOptions(),c,d;c=this.gridHandler.getFetchExtraParams();c[a.pageParamName]=a.currentPage;c[a.itemsPerPageParamName]=a.currentItemsPerPage;a=this.gridHandler.getRows().first();d=this.gridHandler.getRows().last();c.topLimitRowId=0==a.length?0:this.gridHandler.getRowDataId(a);c.bottomLimitRowId=
0==d.length?0:this.gridHandler.getRowDataId(d);this.setGridParams(c);return!1};a.pkp.classes.features.PagingFeature.prototype.replaceElementResponseHandler=function(b){var c,d;d=this.getOptions();void 0!=b.deletedRowReplacement&&(c=b.deletedRowReplacement,this.gridHandler.insertOrReplaceElement(c));void 0!=b.pagingInfo&&(c=b.pagingInfo,this.setOptions(c),this.gridHandler.replacePartialWith(c.pagingMarkup,a("div.gridPaging",this.getGridHtmlElement())),this.init());b.loadLastPage&&this.getGridHtmlElement().trigger("dataChanged");
void 0!=b.newTopRow&&(c=this.gridHandler.getRows(),d.currentItemsPerPage==c.length&&this.gridHandler.deleteElement(c.last(),!0),c=b.newTopRow,this.gridHandler.insertOrReplaceElement(c,!0));return!1};a.pkp.classes.features.PagingFeature.prototype.configPagingLinks_=function(){var b,c,d,e,f,h,j,i;b=this.getOptions();if(c=a("div.gridPaging",this.getGridHtmlElement())){i=this.callbackWrapper(function(c,d){h=RegExp("[?&]"+b.pageParamName+"(?:=([^&]*))?","i");j=h.exec(a(d.target).attr("href"));null!=j&&
(b.currentPage=parseInt(j[1],10),this.getGridHtmlElement().trigger("dataChanged"));return!1},this);c=c.find("a").not(".showMoreItems").not(".showLessItems");d=0;for(e=c.length;d<e;d++)f=a(c[d]),f.click(i)}};a.pkp.classes.features.PagingFeature.prototype.configItemsPerPageElement_=function(){var b,c,d,e,f,h;b=this.getOptions();if(c=a("div.gridPaging",this.getGridHtmlElement()))if(h=this.callbackWrapper(function(c,d){b.currentItemsPerPage=parseInt(a("option",d.target).filter(":selected").attr("value"),
10);b.currentPage=1;this.getGridHtmlElement().trigger("dataChanged");return!1},this),e=c.find("select.itemsPerPage"),f=[10,25,50,75,100],0>a.inArray(b.defaultItemsPerPage,f)&&f.push(b.defaultItemsPerPage),f.sort(function(a,b){return a-b}),b.itemsTotal<=f[0])a("div.gridItemsPerPage",c).hide();else{d=f.length-1;for(c=0;c<=d;c++)e.append(a('<option value="'+f[c]+'">'+f[c]+"</option>"));e.val(b.currentItemsPerPage.toString());e.change(h)}}})(jQuery);(function(a){a.pkp.classes.features.InfiniteScrollingFeature=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.InfiniteScrollingFeature,a.pkp.classes.features.GeneralPagingFeature);a.pkp.classes.features.InfiniteScrollingFeature.prototype.$scrollableElement_=a();a.pkp.classes.features.InfiniteScrollingFeature.prototype.observeScrollCallback_=function(){};a.pkp.classes.features.InfiniteScrollingFeature.prototype.init=function(){var b=a("div.scrollable",this.getGridHtmlElement());
b.length||(this.gridHandler.publishEvent("pkpObserveScrolling"),this.gridHandler.publishEvent("pkpRemoveScrollingObserver"));this.$scrollableElement_=b;this.observeScrollCallback_=this.gridHandler.callbackWrapper(this.observeScroll_,this);this.addScrollHandler_();this.fixGridHeight_();this.addPagingDataToRows_()};a.pkp.classes.features.InfiniteScrollingFeature.prototype.addFeatureHtml=function(a,c){a.append(c.pagingMarkup);a.find(".pkp_linkaction_moreItems").click(this.gridHandler.callbackWrapper(this.loadMoreItems_,
this))};a.pkp.classes.features.InfiniteScrollingFeature.prototype.refreshGrid=function(b){var c=this.getOptions(),d;d=this.gridHandler.getFetchExtraParams();d[c.pageParamName]=c.currentPage;b&&b!==a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID&&(b=this.gridHandler.getRowByDataId(b),1==b.length&&(d[c.pageParamName]=Number(b.attr("data-paging"))));d[c.itemsPerPageParamName]=c.currentItemsPerPage;this.setGridParams(d);return!1};a.pkp.classes.features.InfiniteScrollingFeature.prototype.replaceElementResponseHandler=
function(b){var c;this.getOptions();void 0!=b.deletedRowReplacement&&(c=b.deletedRowReplacement,this.gridHandler.insertOrReplaceElement(c),this.updatePagingDataInAllRows_());this.addScrollHandler_();void 0!=b.pagingInfo&&(b=b.pagingInfo,this.setOptions(b),void 0!=b.pagingMarkup&&a("div.gridPagingScrolling",this.getGridHtmlElement()).replaceWith(b.pagingMarkup));this.addPagingDataToRows_();this.toggleLoadingContainer_();this.getGridHtmlElement().find(".pkp_linkaction_moreItems").click(this.gridHandler.callbackWrapper(this.loadMoreItems_,
this));return!1};a.pkp.classes.features.InfiniteScrollingFeature.prototype.observeScroll_=function(b){var c,d;if(this.getOptions().itemsTotal==this.gridHandler.getRows().length||!this.getGridHtmlElement().is(":visible"))return!1;a(b).hasClass("scrollable")?(c=a(b).height(),d=b.scrollHeight):(c=a.pkp.controllers.SiteHandler.prototype.getWindowDimensions(),c=c.height,d=this.getGridHtmlElement().offset().top+this.getGridHtmlElement().height());c+a(b).scrollTop()>=d&&(this.$scrollableElement_.length?
this.$scrollableElement_.unbind("scroll"):this.getGridHtmlElement().trigger("pkpRemoveScrollingObserver",[this.observeScrollCallback_]),this.loadMoreItems_());return!1};a.pkp.classes.features.InfiniteScrollingFeature.prototype.fixGridHeight_=function(){var b=a("div.scrollable",this.getGridHtmlElement()),c,d,e,f;0<b.length&&(e=setInterval(function(){if(b.is(":visible")){clearInterval(e);f=b.length;for(c=0;c<f;c++)d=a(b[c]),d.get(0).scrollHeight>d.height()&&d.css("max-height",d.get(0).scrollHeight-
10)}},300))};a.pkp.classes.features.InfiniteScrollingFeature.prototype.addPagingDataToRows_=function(){var a=this.getOptions();this.gridHandler.getRows().filter("tr:not([data-paging])").attr("data-paging",a.currentPage)};a.pkp.classes.features.InfiniteScrollingFeature.prototype.updatePagingDataInAllRows_=function(){var b,c=this.getOptions(),d,e,f=1,h=1;b=this.gridHandler.getRows();b.removeAttr("data-paging");d=0;for(e=b.length;d<e;d++)a(b[d]).attr("data-paging",f),h++,h>c.currentItemsPerPage&&(h=
1,f++)};a.pkp.classes.features.InfiniteScrollingFeature.prototype.addScrollHandler_=function(){var a=this.$scrollableElement_;a.length?a.scroll(this.observeScrollCallback_):this.getGridHtmlElement().trigger("pkpObserveScrolling",[this.observeScrollCallback_])};a.pkp.classes.features.InfiniteScrollingFeature.prototype.toggleLoadingContainer_=function(a){var c=this.getGridHtmlElement().find("div.gridPagingScrolling div.pkp_loading"),d=this.$scrollableElement_,c=c.height();a?(this.getGridHtmlElement().addClass("loading"),
a=d.scrollTop(),d.scrollTop(a+c)):this.getGridHtmlElement().removeClass("loading")};a.pkp.classes.features.InfiniteScrollingFeature.prototype.loadMoreItems_=function(){var b=this.getOptions();this.toggleLoadingContainer_(!0);b.currentPage=Number(a("tr.gridRow",this.getGridHtmlElement()).last().attr("data-paging"))+1;this.getGridHtmlElement().trigger("dataChanged",[a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID])}})(jQuery);(function(a){a.pkp.classes.features.CollapsibleGridFeature=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.CollapsibleGridFeature,a.pkp.classes.features.Feature);a.pkp.classes.features.CollapsibleGridFeature.prototype.getControlSelector=function(){return"a[id^='collapsibleGridControl-expandGridControlLink-button-']"};a.pkp.classes.features.CollapsibleGridFeature.prototype.init=function(){a(this.getControlSelector(),this.getGridHtmlElement()).click(this.callbackWrapper(this.toggleGridClickHandler_,
this))};a.pkp.classes.features.CollapsibleGridFeature.prototype.addFeatureHtml=function(a,c){a.find("div.grid_header_bar").prepend(c.collapsibleLink)};a.pkp.classes.features.CollapsibleGridFeature.prototype.toggleGridClickHandler_=function(){var a=this.getGridHtmlElement().find(this.getControlSelector());this.getGridHtmlElement().find("div.grid_header").siblings().toggle();a.toggleClass("expand_all").toggleClass("collapse_all");this.getGridHtmlElement().find("div.grid_header_bar .search_extras_collapse").click();
this.getGridHtmlElement().find("div.grid_header span.options").toggle();return!1}})(jQuery);(function(a){a.pkp.controllers.SiteHandler=function(b,c){this.parent(b,c);this.options_=c;this.unsavedFormElements_=[];a(".go").button();this.bind("redirectRequested",this.redirectToUrl);this.bind("notifyUser",this.fetchNotificationHandler_);this.bind("updateHeader",this.updateHeaderHandler_);this.bind("callWhenClickOutside",this.callWhenClickOutsideHandler_);this.bind("mousedown",this.mouseDownHandler_);a(window).bind("beforeunload",this.pageUnloadHandler_);a.ajaxSetup({cache:!1});c.hasSystemNotifications&&
this.trigger("notifyUser");this.bind("formChanged",this.callbackWrapper(this.registerUnsavedFormElement_));this.bind("unregisterChangedForm",this.callbackWrapper(this.unregisterUnsavedFormElement_));this.bind("unregisterAllForms",this.callbackWrapper(this.unregisterAllFormElements_));this.bind("pkpModalOpen",this.callbackWrapper(this.openModal_));this.bind("pkpModalClose",this.callbackWrapper(this.closeModal_));this.bind("pkpObserveScrolling",this.callbackWrapper(this.registerScrollingObserver_));
this.bind("pkpRemoveScrollingObserver",this.callbackWrapper(this.unregisterScrollingObserver_));this.outsideClickChecks_={};this.initializeTinyMCE()};a.pkp.classes.Helper.inherits(a.pkp.controllers.SiteHandler,a.pkp.classes.Handler);a.pkp.controllers.SiteHandler.prototype.helpContext_=null;a.pkp.controllers.SiteHandler.prototype.options_=null;a.pkp.controllers.SiteHandler.prototype.outsideClickChecks_=null;a.pkp.controllers.SiteHandler.prototype.unsavedFormElements_=null;a.pkp.controllers.SiteHandler.prototype.initializeTinyMCE=
function(){if("undefined"!==typeof tinyMCE){tinyMCE.PluginManager.load("jbimages",a.pkp.app.baseUrl+"/plugins/generic/tinymce/plugins/justboil.me/plugin.js");tinyMCE.PluginManager.load("pkpTags",a.pkp.app.baseUrl+"/plugins/generic/tinymce/plugins/pkpTags/plugin.js");tinyMCE.PluginManager.load("pkpwordcount",a.pkp.app.baseUrl+"/plugins/generic/tinymce/plugins/pkpWordcount/plugin.js");var b;b={width:"100%",resize:"both",entity_encoding:"raw",plugins:"paste,fullscreen,link,lists,code,-jbimages,-pkpTags,noneditable",
convert_urls:!1,forced_root_block:"p",paste_auto_cleanup_on_paste:!0,apply_source_formatting:!1,theme:"modern",toolbar:"copy paste | bold italic underline | link unlink code fullscreen | jbimages | pkpTags",richToolbar:"copy paste | bold italic underline | bullist numlist | superscript subscript | link unlink code fullscreen | jbimages | pkpTags",statusbar:!1,content_css:a.pkp.app.baseUrl+"/plugins/generic/tinymce/styles/content.css"};b="undefined"!==typeof a.pkp.plugins.tinymceplugin&&typeof a.pkp.plugins.tinymceplugin.tinymceParams?
a.extend({},b,a.pkp.plugins.tinymceplugin.tinymceParams):a.extend({},b);b.init_instance_callback=a.pkp.controllers.SiteHandler.prototype.triggerTinyMCEInitialized;b.setup=a.pkp.controllers.SiteHandler.prototype.triggerTinyMCESetup;tinyMCE.init(b)}};a.pkp.controllers.SiteHandler.prototype.triggerTinyMCEInitialized=function(b){a("#"+a.pkp.classes.Helper.escapeJQuerySelector(b.id)).trigger("tinyMCEInitialized",[b])};a.pkp.controllers.SiteHandler.prototype.triggerTinyMCESetup=function(b){var c=a("#"+
a.pkp.classes.Helper.escapeJQuerySelector(b.id));c.attr("readonly")&&(b.settings.readonly=!0);c.attr("wordCount")&&0<c.attr("wordCount")&&(b.settings.plugins+=",pkpwordcount",b.settings.statusbar=!0);c=c.attr("rows")||10;b.settings.height=(20*c).toString()+"px";b.on("init",function(b){var c=a("#"+b.id),f,h;f=a("#"+b.id).attr("placeholder");""!==f&&(h=a("<span></span>"),h.html(f),h.addClass("mcePlaceholder"),h.attr("id","mcePlaceholder-"+b.id),b.target.getContent().length&&h.hide(),b=a("<div></div>"),
b.addClass("mcePlaceholderParent"),c.wrap(b),c.parent().append(h))});b.on("activate",function(b){a("#mcePlaceholder-"+b.id).hide()});b.on("deactivate",function(b){b.target.getContent().length||a("#mcePlaceholder-"+b.id).show();b.target.dom.addClass(b.target.dom.select("li"),"show")});b.on("BeforeSetContent",function(c){var e=a.pkp.classes.TinyMCEHelper.prototype.getVariableMap("#"+a.pkp.classes.Helper.escapeJQuerySelector(b.id));c.content=c.content.replace(/\{\$([a-zA-Z]+)\}(?![^<]*>)/g,function(c,
d){return void 0!==e[d]?a.pkp.classes.TinyMCEHelper.prototype.getVariableElement(d,e[d],"#"+b.id).html():c})});b.on("SaveContent",function(b){var c=a("<div>"+b.content+"</div>");c.find(".pkpTag").replaceWith(function(){return"{$"+a(this).attr("data-symbolic")+"}"});b.content=c.html()});b.on("FullscreenStateChanged init",function(b){var b=b.target,c=a(b.editorContainer);b.plugins.fullscreen&&(b.plugins.fullscreen.isFullscreen()?c.find(".mce-toolbar[role='menubar']").show():c.find(".mce-toolbar[role='menubar']").hide())})};
a.pkp.controllers.SiteHandler.prototype.getWindowDimensions=function(){return{height:a(window).height(),width:a(window).width()}};a.pkp.controllers.SiteHandler.prototype.redirectToUrl=function(a,c,d){window.location=d};a.pkp.controllers.SiteHandler.prototype.registerUnsavedFormElement_=function(b,c,d){b=a(d.target.lastElementChild).attr("id");-1==a.inArray(b,this.unsavedFormElements_)&&this.unsavedFormElements_.push(b)};a.pkp.controllers.SiteHandler.prototype.unregisterUnsavedFormElement_=function(b,
c,d){b=a(d.target.lastElementChild).attr("id");b=a.inArray(b,this.unsavedFormElements_);-1!==b&&delete this.unsavedFormElements_[b]};a.pkp.controllers.SiteHandler.prototype.unregisterAllFormElements_=function(){this.unsavedFormElements_=[]};a.pkp.controllers.SiteHandler.prototype.fetchNotificationHandler_=function(b,c,d){void 0!==d?this.showNotification_(d):a.ajax({url:this.options_.fetchNotificationUrl,data:this.options_.requestOptions,success:this.callbackWrapper(this.showNotificationResponseHandler_),
dataType:"json",async:!1})};a.pkp.controllers.SiteHandler.prototype.updateHeaderHandler_=function(){a.pkp.classes.Handler.getHandler(a("#navigationUserWrapper")).reload()};a.pkp.controllers.SiteHandler.prototype.callWhenClickOutsideHandler_=function(a,c,d){void 0!==d.container&&void 0!==d.callback&&(a=d.container.attr("id"),this.outsideClickChecks_[a]=d)};a.pkp.controllers.SiteHandler.prototype.mouseDownHandler_=function(b,c){var d;if(!a.isEmptyObject(this.outsideClickChecks_))for(d in this.outsideClickChecks_)this.processOutsideClickCheck_(this.outsideClickChecks_[d],
c);return!0};a.pkp.controllers.SiteHandler.prototype.processOutsideClickCheck_=function(a,c){if("click"!==c.type&&"mousedown"!==c.type&&"mouseup"!==c.type)throw Error("Can not check outside click with the passed event: "+c.type+".");var d=a.container;return d.is(":hidden")?!1:0===d.has(c.target).length?(delete this.outsideClickChecks_[d.attr("id")],a.callback(),!0):!1};a.pkp.controllers.SiteHandler.prototype.pageUnloadHandler_=function(){var b,c,d;b=a.pkp.classes.Handler.getHandler(a("body"));c=0;
for(d in b.unsavedFormElements_)d&&c++;if(0<c)return a.pkp.locale.form_dataHasChanged};a.pkp.controllers.SiteHandler.prototype.isFormUnsaved=function(a){return null!==this.unsavedFormElements_&&void 0!==this.unsavedFormElements_[a]?!0:!1};a.pkp.controllers.SiteHandler.prototype.showNotificationResponseHandler_=function(a,c){this.showNotification_(c)};a.pkp.controllers.SiteHandler.prototype.showNotification_=function(a){var c,d,a=this.handleJson(a);if(!1!==a&&a.content.general)for(c in a=a.content.general,
a)for(d in a[c])new PNotify(a[c][d])};a.pkp.controllers.SiteHandler.prototype.openModal_=function(){this.getHtmlElement().addClass("modal_is_visible")};a.pkp.controllers.SiteHandler.prototype.closeModal_=function(){var a=this.getHtmlElement();a.find(".pkp_modal.is_visible").length||a.removeClass("modal_is_visible")};a.pkp.controllers.SiteHandler.prototype.registerScrollingObserver_=function(b,c,d,e){a(document).scroll(e);return!1};a.pkp.controllers.SiteHandler.prototype.unregisterScrollingObserver_=
function(b,c,d,e){a(document).unbind("scroll",e);return!1}})(jQuery);(function(a){a.pkp.controllers.UrlInDivHandler=function(a,c){this.parent(a,c);this.sourceUrl_=c.sourceUrl;this.reload();c.refreshOn&&this.bindGlobal(c.refreshOn,this.reload)};a.pkp.classes.Helper.inherits(a.pkp.controllers.UrlInDivHandler,a.pkp.classes.Handler);a.pkp.controllers.UrlInDivHandler.sourceUrl_=null;a.pkp.controllers.UrlInDivHandler.prototype.reload=function(){a.get(this.sourceUrl_,this.callbackWrapper(this.handleLoadedContent_),"json")};a.pkp.controllers.UrlInDivHandler.prototype.getSourceUrl=
function(){return this.sourceUrl_};a.pkp.controllers.UrlInDivHandler.prototype.setSourceUrl=function(a){this.sourceUrl_=a};a.pkp.controllers.UrlInDivHandler.prototype.handleLoadedContent_=function(b,c){var d=this.handleJson(c),e=this;!0===d.status?void 0===d.content?this.getHtmlElement().hide():(/msie/.test(navigator.userAgent.toLowerCase())?this.html(d.content):(this.getHtmlElement().hide(),this.html(d.content),this.getHtmlElement().fadeIn(400)),a(function(){e.trigger("urlInDivLoaded",[e.getHtmlElement().attr("id")])})):
alert(d.content);return!1}})(jQuery);(function(a){a.pkp.controllers.ExtrasOnDemandHandler=function(b,c){this.parent(b,c);a(".toggleExtras",b).click(this.callbackWrapper(this.toggleExtras))};a.pkp.classes.Helper.inherits(a.pkp.controllers.ExtrasOnDemandHandler,a.pkp.classes.Handler);a.pkp.controllers.ExtrasOnDemandHandler.prototype.toggleExtras=function(a,c){var d=this.getHtmlElement(),e;c.preventDefault();d.toggleClass("active");d.hasClass("active")&&(e=d.closest(".scrollable"),0<e.size()&&this.scrollToMakeVisible_(d,e))};a.pkp.controllers.ExtrasOnDemandHandler.prototype.scrollToMakeVisible_=
function(a,c){var d,e,f;d=a.position().top;e=c.position().top;f=parseInt(c.scrollTop(),10);d>e?(d=Math.ceil(d+a.height()-c.height()),0<d&&c.scrollTop(f+d)):(f=Math.max(Math.floor(f+d-e),0),c.scrollTop(f))}})(jQuery);(function(a){a.pkp.controllers.PageHandler=function(a,c){this.parent(a,c);this.bind("redirectRequested",this.redirectToUrl);this.bind("notifyUser",this.redirectNotifyUserEventHandler_);this.bind("redirectDataChangedToGrid",this.redirectDataChangedEventHandler_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.PageHandler,a.pkp.classes.Handler);a.pkp.controllers.PageHandler.prototype.redirectToUrl=function(a,c,d){window.location=d};a.pkp.controllers.PageHandler.prototype.redirectNotifyUserEventHandler_=
function(b,c,d){!0===d.status?this.getHtmlElement().parent().trigger("notifyUser",[d]):a.pkp.classes.notification.NotificationHelper.redirectNotifyUserEvent(this,d)};a.pkp.controllers.PageHandler.prototype.redirectDataChangedEventHandler_=function(b,c,d){var b=a("a",c.target),e=a.pkp.classes.Handler.getHandler(b).getUrl(),b=a(".pkp_controllers_grid",this.getHtmlElement()).filter(function(){var b=0;a(this).find("a").each(function(){a(this).attr("href")==e&&b++});return 0<b});0<b.length&&b.each(function(){a(this).trigger("dataChanged",
[d])})}})(jQuery);(function(a){a.pkp.controllers.TabHandler=function(b,c){var d,e,f;this.parent(b,c);this.bind("tabsbeforeactivate",this.tabsBeforeActivate);this.bind("tabsactivate",this.tabsActivate);this.bind("tabscreate",this.tabsCreate);this.bind("tabsbeforeload",this.tabsBeforeLoad);this.bind("tabsload",this.tabsLoad);this.bind("containerReloadRequested",this.tabsReloadRequested);this.bind("addTab",this.addTab);c.emptyLastTab&&(this.emptyLastTab_=c.emptyLastTab);d=document.location.toString();if(d.match("#")){d=
d.split("#")[1];e=b.find("li a");for(f=0;f<e.length;f++)d==e[f].getAttribute("name")&&(c.selected=f)}b.tabs({ajaxOptions:{dataType:"json",cache:!1,dataFilter:this.callbackWrapper(this.dataFilter)},disabled:c.disabled,active:c.selected});b.children(".ui-tabs-nav").find("li > a").focus(function(){a(this).click()})};a.pkp.classes.Helper.inherits(a.pkp.controllers.TabHandler,a.pkp.classes.Handler);a.pkp.controllers.TabHandler.prototype.$currentTab_=null;a.pkp.controllers.TabHandler.prototype.currentTabIndex_=
0;a.pkp.controllers.TabHandler.prototype.tabsBeforeActivate=function(){var b=!1;this.$currentTab_.find("form").each(function(){if(a.pkp.classes.Handler.getHandler(a("#"+a(this).attr("id"))).formChangesTracked)return b=!0,!1});this.$currentTab_.find(".hasDatepicker").datepicker("hide");if(b)if(confirm(a.pkp.locale.form_dataHasChanged))this.trigger("unregisterAllForms");else return!1;this.emptyLastTab_&&(a(window).one("error",function(){return!1}),this.$currentTab_&&(this.unbindPartial(this.$currentTab_),
this.$currentTab_.empty()));return!0};a.pkp.controllers.TabHandler.prototype.tabsCreate=function(b,c,d){this.currentTabIndex_=d.tab.index();this.$currentTab_=d.panel.jquery?d.panel:a(d.panel);return!0};a.pkp.controllers.TabHandler.prototype.tabsActivate=function(b,c,d){this.currentTabIndex_=d.newTab.index();this.$currentTab_=d.newPanel.jquery?d.newPanel:a(d.newPanel);return!0};a.pkp.controllers.TabHandler.prototype.tabsLoad=function(){return!0};a.pkp.controllers.TabHandler.prototype.tabsBeforeLoad=
function(b,c,d){this.unbindPartial(a("#"+d.tab.attr("aria-controls")));d.ajaxSettings.cache=!1;d.ajaxSettings.dataFilter=this.callbackWrapper(this.dataFilter)};a.pkp.controllers.TabHandler.prototype.dataFilter=function(b,c){var d=this.handleJson(a.parseJSON(c));return!1===d?"":JSON.stringify(d.content)};a.pkp.controllers.TabHandler.prototype.tabsReloadRequested=function(b,c,d){this.getHtmlElement();var e=this;a.get(d.tabsUrl,function(b){b=a.parseJSON(b);e.replaceWith(b.content)})};a.pkp.controllers.TabHandler.prototype.addTab=
function(b,c,d){var e=this.getHtmlElement(),b=e.children("ul").children("li").length+1,c=a("<a/>").text(d.title).attr("href",d.url),d=a("<a/>").addClass("close").text(a.pkp.locale.common_close).attr("href","#"),c=a("<li/>").append(c).append(d);d.click(function(){var b=a(this).closest("li"),c=a("#"+b.attr("aria-controls")),d,i;i=!1;c.find("form").each(function(){if(a.pkp.classes.Handler.getHandler(a(this)).formChangesTracked&&!confirm(a.pkp.locale.form_dataHasChanged))return i=!0,!1});i||(c.find("form").each(function(){var b=
a.pkp.classes.Handler.getHandler(a(this));b&&b.unregisterForm()}),d=b.eq(0).index(),e.tabs("option","active")==d&&e.tabs("option","active",d-1),b.remove(),c.remove(),e.tabs("refresh"))});e.children("ul").append(c);e.tabs("refresh");e.tabs("option","active",b-1)};a.pkp.controllers.TabHandler.prototype.getCurrentTab=function(){return this.$currentTab_};a.pkp.controllers.TabHandler.prototype.getCurrentTabIndex=function(){return this.currentTabIndex_}})(jQuery);(function(a){a.pkp.controllers.MenuHandler=function(b,c){this.parent(b,c);var d=this;setTimeout(function(){d.callbackWrapper(d.setDropdownAlignment())},1);a(window).resize(this.callbackWrapper(this.onResize));this.getHtmlElement().on("focus mouseenter",'[aria-haspopup="true"]',function(b){a(b.currentTarget).attr("aria-expanded","true")});this.getHtmlElement().on("blur mouseleave",'[aria-haspopup="true"]',function(b){a(b.currentTarget).attr("aria-expanded","false")})};a.pkp.classes.Helper.inherits(a.pkp.controllers.MenuHandler,
a.pkp.classes.Handler);a.pkp.controllers.MenuHandler.prototype.setDropdownAlignment=function(){a(this);var b=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c=Math.max(document.documentElement.clientHeight,window.innerHeight||0);this.getHtmlElement().find('[aria-haspopup="true"]').each(function(){var d=a(this),e=d.children("ul"),f,h,j,i;d.offset().left+e.outerWidth()>b?d.addClass("align_right"):d.removeClass("align_right");e.attr("style","");f=d.offset().top;h=0;d.hasClass("submenuOpensBelow")&&
(h=f+d.outerHeight());j=f+e.outerHeight();j>c&&(j-=c,i=f-j,i<h&&(j=0<h?h:-Math.abs(j)-i,e.css("overflow-y","scroll"),e.css("bottom",-Math.abs(c-f-d.outerHeight())+"px")),e.css("top",j+"px"))})};a.pkp.controllers.MenuHandler.prototype.onResize=function(){clearTimeout(this.resize_check);this.resize_check=setTimeout(this.callbackWrapper(this.setDropdownAlignment),1E3)}})(jQuery);(function(a){a.pkp.controllers.UploaderHandler=function(b,c){this.parent(b,c);if(!b.is("div"))throw Error("An uploader widget controller can only be attached to a div!");var d,e,f;d={url:c.uploadUrl,flash_swf_url:c.baseUrl+"/lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.swf",silverlight_xap_url:c.baseUrl+"/lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.xap"};typeof c.filters&&(d.filters=c.filters);typeof c.resize&&(d.resize=c.resize);typeof c.browse_button&&(d.browse_button=c.browse_button);typeof c.multipart_params&&
(d.multipart_params=c.multipart_params);d=a.extend({},this.self("DEFAULT_PROPERTIES_"),d);this.pluploader=new plupload.Uploader(d);this.pluploader.init();this.updateStatus("waiting");this.$progress=b.find(".pkpUploaderProgress .percentage");this.$progressBar=b.find(".pkpUploaderProgressBar");this.$fileName=b.find(".pkpUploaderFilename");this.pluploader.bind("FilesAdded",this.callbackWrapper(this.startUpload));this.pluploader.bind("UploadProgress",this.callbackWrapper(this.updateProgress));this.pluploader.bind("Error",
this.callbackWrapper(this.handleError));this.pluploader.bind("FileUploaded",this.callbackWrapper(this.uploadComplete));this.pluploader.bind("QueueChanged",this.callbackWrapper(this.refreshUploader));e=a("#"+d.browse_button,this.getHtmlElement());e.click(function(){return!1});this.pluploader.refresh();f=this;setTimeout(function(){f.getHtmlElement().find(".moxie-shim input").focus(function(){e.addClass("in_focus")}).blur(function(){e.removeClass("in_focus")})},100)};a.pkp.classes.Helper.inherits(a.pkp.controllers.UploaderHandler,
a.pkp.classes.Handler);a.pkp.controllers.UploaderHandler.prototype.startUpload=function(a,c){1<c.files.length&&c.removeFile(c.files[0]);this.updateStatus("uploading");c.start()};a.pkp.controllers.UploaderHandler.prototype.updateProgress=function(a,c,d){this.$progress.html(d.percent);this.$progressBar.css("width",d.percent+"%")};a.pkp.controllers.UploaderHandler.prototype.uploadComplete=function(b,c,d,e){b=a.parseJSON(e.response);c=d.name;b.status?("undefined"!==typeof b.uploadedFile&&(c=b.uploadedFile.name||
b.uploadedFile.fileLabel,d.storedData=b.uploadedFile),this.$fileName.html(c),this.updateStatus("complete"),this.$progress.html("0"),this.$progressBar.css("width",0)):this.showError(b.content)};a.pkp.controllers.UploaderHandler.prototype.handleError=function(a,c,d){this.showError(d.message)};a.pkp.controllers.UploaderHandler.prototype.showError=function(a){this.$progress.html("0");this.$progressBar.css("width",0);this.updateStatus("error");this.getHtmlElement().find(".pkpUploaderError").html(a)};a.pkp.controllers.UploaderHandler.prototype.refreshUploader=
function(a,c){c.refresh()};a.pkp.controllers.UploaderHandler.prototype.updateStatus=function(a){this.getHtmlElement().removeClass("loading waiting uploading error complete").addClass(a)};a.pkp.controllers.UploaderHandler.DEFAULT_PROPERTIES_={runtimes:"html5,flash,silverlight,html4",max_file_size:a.pkp.cons.UPLOAD_MAX_FILESIZE,multi_selection:!1,file_data_name:"uploadedFile",multipart:!0,headers:{browser_user_agent:navigator.userAgent},browse_button:"pkpUploaderButton",drop_element:"pkpUploaderDropZone"}})(jQuery);(function(a){a.pkp.controllers.AutocompleteHandler=function(b,c){var d;this.parent(b,c);this.sourceUrl_=c.sourceUrl;c.sourceUrl=void 0;this.jLabelText_=c.jLabelText;this.disableSync_=c.disableSync;d={};d.source=this.callbackWrapper(this.fetchAutocomplete);d.appendTo="#"+b.attr("id");d=a.extend({},this.self("DEFAULT_PROPERTIES_"),d,c);this.textInput=b.find(":text");this.disableSync_||this.textInput.keyup(this.callbackWrapper(this.synchronizeFields_));this.textInput.autocomplete(d);this.textInput.attr("title",
this.jLabelText_);a("#"+this.textInput.attr("id")).jLabel();this.textInput.attr("title","");this.textLabel_=b.find("label");this.hiddenInput_=b.find("input:hidden");this.bind("autocompleteselect",this.itemSelected);this.bind("autocompletefocus",this.itemFocused);this.textInput.blur(this.callbackWrapper(this.textInputBlurHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.AutocompleteHandler,a.pkp.classes.Handler);a.pkp.controllers.AutocompleteHandler.textLabel_=null;a.pkp.controllers.AutocompleteHandler.jLabelText_=
null;a.pkp.controllers.AutocompleteHandler.disableSync_=null;a.pkp.controllers.AutocompleteHandler.DEFAULT_PROPERTIES_={minLength:2};a.pkp.controllers.AutocompleteHandler.prototype.hiddenInput_=null;a.pkp.controllers.AutocompleteHandler.prototype.sourceUrl_=null;a.pkp.controllers.AutocompleteHandler.prototype.textInput=null;a.pkp.controllers.AutocompleteHandler.prototype.itemSelected=function(a,c,d){a=this.hiddenInput_;c=this.textInput;""!==d.item.value&&(a.val(d.item.value),c.val(d.item.label),c.trigger("keyup"));
return!1};a.pkp.controllers.AutocompleteHandler.prototype.itemFocused=function(a,c,d){a=this.textInput;""!==d.item.value&&a.val(d.item.label);return!1};a.pkp.controllers.AutocompleteHandler.prototype.fetchAutocomplete=function(b,c,d){var e;e=this.textInput;e.addClass("spinner");a.post(this.getAutocompleteUrl(),{term:c.term},function(a){e.removeClass("spinner");d(a.content)},"json")};a.pkp.controllers.AutocompleteHandler.prototype.getAutocompleteUrl=function(){return this.sourceUrl_};a.pkp.controllers.AutocompleteHandler.prototype.setAutocompleteUrl=
function(a){this.sourceUrl_=a};a.pkp.controllers.AutocompleteHandler.prototype.textInputBlurHandler_=function(){""===this.hiddenInput_.val()&&this.textInput.val("")};a.pkp.controllers.AutocompleteHandler.prototype.synchronizeFields_=function(){this.hiddenInput_.val(String(this.textInput.val()))}})(jQuery);(function(a){a.pkp.controllers.RevealMoreHandler=function(b,c){this.parent(b,c);b.outerHeight()>c.height&&(b.addClass("isHidden").css("max-height",c.height+"px"),a(".revealMoreButton",b).click(this.callbackWrapper(this.revealMore)))};a.pkp.classes.Helper.inherits(a.pkp.controllers.RevealMoreHandler,a.pkp.classes.Handler);a.pkp.controllers.RevealMoreHandler.prototype.revealMore=function(a,c){this.getHtmlElement().removeClass("isHidden").removeAttr("style");c.preventDefault();c.stopPropagation()}})(jQuery);(function(a){a.pkp.controllers.NotificationHandler=function(a,c){this.parent(a,c);this.options_=c;this.bind("notifyUser",this.fetchNotificationHandler_);this.getHtmlElement().hide();this.getHtmlElement().triggerHandler("notifyUser");this.options_.refreshOn&&this.bindGlobal(this.options_.refreshOn,this.fetchNotificationHandler_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.NotificationHandler,a.pkp.classes.Handler);a.pkp.controllers.NotificationHandler.prototype.options_=null;a.pkp.controllers.NotificationHandler.prototype.trivialTimer_=
null;a.pkp.controllers.NotificationHandler.prototype.fetchNotificationHandler_=function(){var b={};b.requestOptions=this.options_.requestOptions;a.ajax({type:"POST",url:this.options_.fetchNotificationUrl,data:b,success:this.callbackWrapper(this.showNotificationResponseHandler_),dataType:"json",async:!1})};a.pkp.controllers.NotificationHandler.prototype.showNotificationResponseHandler_=function(b,c){clearTimeout(this.trivialTimer_);var d=this.getHtmlElement(),e=this.handleJson(c),f,h,j;if(!1!==e)if(e.content.inPlace){f=
this.concatenateNotifications_(e.content.inPlace);h=this.removeAlreadyShownNotifications_(e);this.unbindPartial(d);d.html(f);d.show();e=this.getTrivialNotifications_(e.content.inPlace);if(!this.visibleWithoutScrolling_()&&h)for(j in d.parent().trigger("notifyUser",[h]),e)d=e[j],d=a("#pkp_notification_"+d,this.getHtmlElement()),this.unbindPartial(d),d.remove();0===d.children().length?d.hide():this.addTimerToNotifications(e)}else this.unbindPartial(this.getHtmlElement()),this.getHtmlElement().empty(),
this.getHtmlElement().hide()};a.pkp.controllers.NotificationHandler.prototype.visibleWithoutScrolling_=function(){var b=this.getHtmlElement(),c=b.offset().top+this.getHtmlElement().height()/2,d=a(window).scrollTop(),e=d+a(window).height(),f=b.parents(".ui-dialog-content");return 0<f.length&&(b=f.offset().top,f=b+f.height(),c<b||c>f)?!1:c<d||c>e?!1:!0};a.pkp.controllers.NotificationHandler.prototype.removeAlreadyShownNotifications_=function(b){var c=!0,d,e,f;for(d in b.content.inPlace)for(e in b.content.inPlace[d])f=
a("#pkp_notification_"+e),0<f.length?(delete b.content.inPlace[d][e],delete b.content.general[d][e]):c=!1;return c?!1:b};a.pkp.controllers.NotificationHandler.prototype.concatenateNotifications_=function(a){var c="",d,e;for(d in a)for(e in a[d])c+=a[d][e];return c};a.pkp.controllers.NotificationHandler.prototype.getTrivialNotifications_=function(a){var c=[],d,e;for(d in a)if(1==d)for(e in a[d])c.push(e);return c};a.pkp.controllers.NotificationHandler.prototype.addTimerToNotifications=function(b){var c=
function(){this.unbindPartial(a(this));a(this).remove()};b.length&&(this.trivialTimer_=setTimeout(function(){var d,e;for(d in b)e=a("#pkp_notification_"+b[d]),e.fadeOut(400,c())},6E3))}})(jQuery);(function(a){a.pkp.controllers.HelpPanelHandler=function(b,c){this.parent(b,{});a("body").click(function(c){var e=a(c.target);if(e.hasClass("requestHelpPanel")||e.parents(".requestHelpPanel").length)c.preventDefault(),c=a.extend({},e.data(),{caller:e}),b.trigger("pkp.HelpPanel.Open",c)});b.find(".pkpCloseHelpPanel").click(function(a){a.preventDefault();b.trigger("pkp.HelpPanel.Close")});b.find(".pkpHomeHelpPanel").click(function(a){a.preventDefault();b.trigger("pkp.HelpPanel.Home")});b.find(".pkpPreviousHelpPanel").click(this.callbackWrapper(function(){this.loadHelpContent_(this.previousTopic_,
this.helpLocale_)}));b.find(".pkpNextHelpPanel").click(this.callbackWrapper(function(){this.loadHelpContent_(this.nextTopic_,this.helpLocale_)}));b.on("pkp.HelpPanel.Open",this.callbackWrapper(this.openPanel_)).on("pkp.HelpPanel.Close",this.callbackWrapper(this.closePanel_)).on("pkp.HelpPanel.Home",this.callbackWrapper(this.homePanel_));this.helpUrl_=c.helpUrl;this.helpLocale_=c.helpLocale};a.pkp.classes.Helper.inherits(a.pkp.controllers.HelpPanelHandler,a.pkp.classes.Handler);a.pkp.controllers.HelpPanelHandler.prototype.caller_=
null;a.pkp.controllers.HelpPanelHandler.prototype.helpUrl_=null;a.pkp.controllers.HelpPanelHandler.prototype.helpLocale_=null;a.pkp.controllers.HelpPanelHandler.prototype.currentTopic_=null;a.pkp.controllers.HelpPanelHandler.prototype.previousTopic_=null;a.pkp.controllers.HelpPanelHandler.prototype.nextTopic_=null;a.pkp.controllers.HelpPanelHandler.prototype.openPanel_=function(b,c,d){var e=this.getHtmlElement();"undefined"!==typeof d.caller&&(this.caller_=d.caller);e.addClass("is_visible");a("body").addClass("help_panel_is_visible");
e.on("click.pkp.HelpPanel keyup.pkp.HelpPanel",this.callbackWrapper(this.handleWrapperEvents));e.on("click.pkp.HelpPanelContentLink",".content a",this.callbackWrapper(this.handleContentLinks_));this.loadHelpContent_(d.topic,this.helpLocale_);setTimeout(function(){e.focus()},300)};a.pkp.controllers.HelpPanelHandler.prototype.loadHelpContent_=function(b,c){c=c||this.helpLocale_;this.currentTopic_=b||"";var d=this.helpUrl_+"/index/"+c+"/";this.getHtmlElement().addClass("is_loading");d+=encodeURIComponent(this.currentTopic_).replace(/%2F/g,
"/");a.get(d,null,this.callbackWrapper(this.updateContentHandler_),"json")};a.pkp.controllers.HelpPanelHandler.prototype.updateContentHandler_=function(a,c){var d=this.handleJson(c).content,e=this.getHtmlElement(),f=this.currentTopic_.indexOf("#"),h=e.find(".panel");this.previousTopic_=d.previous;this.nextTopic_=d.next;e.find(".content").replaceWith('<div class="content">'+d.content+"</div>");h.scrollTop(0);-1!==f&&(d=e.find("a[name="+this.currentTopic_.substr(f+1)+"]"),d.length&&h.scrollTop(d.offset().top-
50));this.getHtmlElement().removeClass("is_loading")};a.pkp.controllers.HelpPanelHandler.prototype.handleContentLinks_=function(b,c){var d=a(b).attr("href");c.preventDefault();"http"==d.substring(0,4)?window.open(d):(d=d.split("/"),this.loadHelpContent_(d.slice(1).join("/"),d[0]));return!1};a.pkp.controllers.HelpPanelHandler.prototype.closePanel_=function(){var b=this.getHtmlElement();b.removeClass("is_visible");a("body").removeClass("help_panel_is_visible");b.find(".content").empty();null!==this.caller_&&
this.caller_.focus();b.off("click.pkp.HelpPanel keyup.pkp.HelpPanel");b.off("click.pkp.HelpPanelContentLink",".content a");this.caller_=null};a.pkp.controllers.HelpPanelHandler.prototype.homePanel_=function(){this.loadHelpContent_(null,this.helpLocale_)};a.pkp.controllers.HelpPanelHandler.prototype.handleWrapperEvents=function(b,c){var d=this.getHtmlElement();"click"==c.type&&d.is(a(c.target))?d.trigger("pkp.HelpPanel.Close"):"keyup"==c.type&&27==c.which&&d.trigger("pkp.HelpPanel.Close")}})(jQuery);(function(a){a.pkp.controllers.form=a.pkp.controllers.form||{};a.pkp.controllers.form.FormHandler=function(b,c){var d;this.parent(b,c);if(!b.is("form"))throw Error("A form handler controller can only be bound to an HTML form element!");c.submitHandler&&(this.callerSubmitHandler_=c.submitHandler);a(".datepicker").each(function(){a(this).datepicker({altField:"#"+a(this).prop("id")+"-altField",altFormat:"yy-mm-dd",dateFormat:a("#"+a(this).prop("id")+"-altField").attr("data-date-format")});a(this).hasClass("hasDatepicker")||
a(this).prop("name",a(this).prop("name")+"-removed")});c.cancelRedirectUrl&&(this.cancelRedirectUrl_=c.cancelRedirectUrl);"undefined"!==typeof c.trackFormChanges&&(this.trackFormChanges=c.trackFormChanges);c.disableControlsOnSubmit&&(this.disableControlsOnSubmit=c.disableControlsOnSubmit);c.enableDisablePairs&&(this.enableDisablePairs_=c.enableDisablePairs,this.setupEnableDisablePairs());for(d in this.enableDisablePairs_)b.find("[id^='"+d+"']").trigger("updatePair");d=b.validate({onfocusout:this.callbackWrapper(this.onFocusOutValidation_),
errorClass:"error",highlight:function(b,c){a(b).parent().parent().addClass(c)},unhighlight:function(b,c){a(b).parent().parent().removeClass(c)},submitHandler:this.callbackWrapper(this.submitHandler_),showErrors:this.callbackWrapper(this.showErrors)});a("[id^='cancelFormButton-']",b).click(this.callbackWrapper(this.cancelForm));b.find(".showMore, .showLess").bind("click",this.switchViz);d.checkForm()?this.trigger("formValid"):this.trigger("formInvalid");a(".pkpEditableToggle",b).click(this.callbackWrapper(this.toggleEditableControl));
this.initializeTinyMCE();a("[id^='submitFormButton']",b).click(this.callbackWrapper(this.pushTinyMCEChanges_));a(":input",b).change(this.callbackWrapper(this.formChange));this.bind("formChange",this.callbackWrapper(this.formChange));b.click(this.callbackWrapper(this.hideDatepicker_));this.publishEvent("tinyMCEInitialized");this.bind("tinyMCEInitialized",this.tinyMCEInitHandler_);this.bind("containerClose",this.containerCloseHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.FormHandler,
a.pkp.classes.Handler);a.pkp.controllers.form.FormHandler.prototype.disableControlsOnSubmit=!1;a.pkp.controllers.form.FormHandler.prototype.trackFormChanges=!0;a.pkp.controllers.form.FormHandler.prototype.callerSubmitHandler_=null;a.pkp.controllers.form.FormHandler.prototype.cancelRedirectUrl_=null;a.pkp.controllers.form.FormHandler.prototype.formChangesTracked=!1;a.pkp.controllers.form.FormHandler.prototype.enableDisablePairs_=null;a.pkp.controllers.form.FormHandler.prototype.showErrors=function(b){"undefined"!==
typeof tinyMCE&&tinyMCE.EditorManager.triggerSave();var c=a.extend(!0,{},b);setTimeout(this.callbackWrapper(function(){c.defaultShowErrors();c=null}),250);b.checkForm()?this.trigger("formValid"):(this.trigger("formInvalid"),this.enableFormControls())};a.pkp.controllers.form.FormHandler.prototype.formChange=function(){this.trackFormChanges&&!this.formChangesTracked&&(this.formChangesTracked=!0,this.trigger("formChanged"))};a.pkp.controllers.form.FormHandler.prototype.disableFormControls=function(){this.disableControlsOnSubmit&&
this.getHtmlElement().find(":submit").attr("disabled","disabled").addClass("ui-state-disabled");return!0};a.pkp.controllers.form.FormHandler.prototype.enableFormControls=function(){this.getHtmlElement().find(":submit").removeAttr("disabled").removeClass("ui-state-disabled");return!0};a.pkp.controllers.form.FormHandler.prototype.cancelForm=function(){this.unregisterForm();this.trigger("formCanceled");return!1};a.pkp.controllers.form.FormHandler.prototype.unregisterForm=function(){this.formChangesTracked=
!1;this.trigger("unregisterChangedForm")};a.pkp.controllers.form.FormHandler.prototype.setupEnableDisablePairs=function(){var b=this.getHtmlElement(),c;for(c in this.enableDisablePairs_)a(b).find("[id^='"+c+"']").bind("click updatePair",this.callbackWrapper(this.toggleDependentElement_));return!0};a.pkp.controllers.form.FormHandler.prototype.submitFormWithoutValidation=function(a){a.settings.submitHandler=null;this.disableFormControls();this.getHtmlElement().submit();this.formChangesTracked=!1};a.pkp.controllers.form.FormHandler.prototype.hideSpinner=
function(){this.getHtmlElement().find(".formButtons .pkp_spinner").removeClass("is_visible")};a.pkp.controllers.form.FormHandler.prototype.toggleEditableControl=function(b,c){c.preventDefault();var d=a(b).parents('[data-pkp-editable="true"]');d.length&&d.toggleClass("isEditing")};a.pkp.controllers.form.FormHandler.prototype.submitHandler_=function(b,c){var d=!1;a(c).find(".formWidget").each(function(){var b=new a.Event("formSubmitRequested");d||(a(this).trigger(b),d=b.isDefaultPrevented())});d||(this.showSpinner_(),
this.trigger("unregisterChangedForm"),null!==this.callerSubmitHandler_?(this.formChangesTracked=!1,this.callbackWrapper(this.callerSubmitHandler_).call(b,c)):this.submitFormWithoutValidation(b))};a.pkp.controllers.form.FormHandler.prototype.pushTinyMCEChanges_=function(){"undefined"!==typeof tinyMCE&&tinyMCE.EditorManager.triggerSave();return!0};a.pkp.controllers.form.FormHandler.prototype.toggleDependentElement_=function(b){var c,d;c=this.getHtmlElement();d=a(b).attr("id");c=a(c).find("[id^='"+this.enableDisablePairs_[d]+
"']");a(b).is(":checked")?a(c).prop("disabled",!1):a(c).prop("disabled",!0);return!0};a.pkp.controllers.form.FormHandler.prototype.tinyMCEInitHandler_=function(b,c,d){var e=d.id;d.on("blur",this.callbackWrapper(function(b){b.save();var b=this.getHtmlElement(),c=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(e),b);b.validate().element(c)}))};a.pkp.controllers.form.FormHandler.prototype.containerCloseHandler=function(b,c,d){a(this.getHtmlElement()).find(".hasDatepicker").datepicker("hide");if(this.formChangesTracked)if(confirm(a.pkp.locale.form_dataHasChanged))this.trigger("unregisterAllForms");
else return d.closePermitted=!1;"undefined"!==typeof d&&(d.closePermitted=!0);return!0};a.pkp.controllers.form.FormHandler.prototype.onFocusOutValidation_=function(b,c){var d=this.getHtmlElement();a(c).parents("#"+d.attr("id")).length&&b.element(c);return!0};a.pkp.controllers.form.FormHandler.prototype.hideDatepicker_=function(b,c){var d,e;d=c.originalEvent;"undefined"!=typeof d&&(d=d.target,e=this.getHtmlElement(),!a(d).hasClass("hasDatepicker")&&(!a(d).hasClass("ui-datepicker")&&!a(d).hasClass("ui-icon")&&
!a(d).hasClass("ui-datepicker-next")&&!a(d).hasClass("ui-datepicker-prev")&&!a(d).parent().parents(".ui-datepicker").length)&&a(e).find(".hasDatepicker").datepicker("hide"))};a.pkp.controllers.form.FormHandler.prototype.showSpinner_=function(){this.getHtmlElement().find(".formButtons .pkp_spinner").addClass("is_visible")}})(jQuery);(function(a){a.pkp.controllers.form.DropdownHandler=function(a,c){this.parent(a,c);this.eventName_=c.eventName;this.defaultKey_=c.defaultKey;this.publishEvent(this.eventName_);this.getOptionsUrl_=c.getOptionsUrl;this.trackFormChanges=!1;a.find("select").change(this.callbackWrapper(this.selectOptionHandler_));this.loadOptions_();this.bind("containerReloadRequested",this.containerReloadHandler_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.DropdownHandler,a.pkp.classes.Handler);a.pkp.controllers.form.DropdownHandler.prototype.eventName_=
null;a.pkp.controllers.form.DropdownHandler.prototype.defaultKey_=null;a.pkp.controllers.form.DropdownHandler.prototype.currentKey_=null;a.pkp.controllers.form.DropdownHandler.prototype.getOptionsUrl_=null;a.pkp.controllers.form.DropdownHandler.prototype.selectOptionHandler_=function(b){this.trigger(this.eventName_,[a(b).val()])};a.pkp.controllers.form.DropdownHandler.prototype.loadOptions_=function(){a.get(this.getOptionsUrl_,this.callbackWrapper(this.setOptionList_),"json")};a.pkp.controllers.form.DropdownHandler.prototype.setOptionList_=
function(b,c){var d=this.handleJson(c),e=this.getHtmlElement().find("select"),f,h;for(f in d.content){h=a("<option/>");h.attr("value",f);if(this.defaultKey_==f||this.currentKey_==f)h.attr("selected","selected"),this.trigger(this.eventName_,[f]);h.text(d.content[f]);e.append(h)}this.trigger("dropDownOptionSet")};a.pkp.controllers.form.DropdownHandler.prototype.containerReloadHandler_=function(){var a=this.getHtmlElement().find("select");this.currentKey_=a.find("option:selected").attr("value");a.find('option[value!="0"]').remove();
this.loadOptions_()}})(jQuery);(function(a){a.pkp.controllers.form.AjaxFormHandler=function(a,c){c.submitHandler=this.submitForm;this.parent(a,c);this.bind("refreshForm",this.refreshFormHandler_);this.publishEvent("containerReloadRequested")};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.AjaxFormHandler,a.pkp.controllers.form.FormHandler);a.pkp.controllers.form.AjaxFormHandler.prototype.disableControlsOnSubmit=!0;a.pkp.controllers.form.AjaxFormHandler.prototype.submitForm=function(){var b=this.getHtmlElement();this.disableFormControls();
a.post(b.attr("action"),b.serialize(),this.callbackWrapper(this.handleResponse),"json")};a.pkp.controllers.form.AjaxFormHandler.prototype.refreshFormHandler_=function(a,c,d){d&&this.replaceWith(d)};a.pkp.controllers.form.AjaxFormHandler.prototype.handleResponse=function(b,c){var d,e;e=this.handleJson(c);if(!1!==e)if(""===e.content)d=new a.Event("formSubmitted"),a(this.getHtmlElement()).find(".formWidget").trigger(d),this.trigger("formSubmitted"),this.publishChangeEvents(),this.disableControlsOnSubmit&&
this.enableFormControls();else{if(void 0!==e.reloadContainer)return this.trigger("dataChanged"),this.trigger("containerReloadRequested",[e]),e.status;this.replaceWith(e.content)}else this.enableFormControls();this.trigger("notifyUser",[this.getHtmlElement()]);this.hideSpinner();return e.status}})(jQuery);(function(a){a.pkp.controllers.form.ClientFormHandler=function(a,c){c.submitHandler=this.submitForm;this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.ClientFormHandler,a.pkp.controllers.form.FormHandler);a.pkp.controllers.form.ClientFormHandler.prototype.submitForm=function(){var b;b=this.getHtmlElement().serializeArray();b.push({name:"clientSubmit",value:!0});this.trigger("formSubmitted",[a.param(b)])}})(jQuery);(function(a){a.pkp.controllers.form.ToggleFormHandler=function(a){this.parent(a,{trackFormChanges:!1});a.change(this.callbackWrapper(this.toggleHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.ToggleFormHandler,a.pkp.controllers.form.ClientFormHandler);a.pkp.controllers.form.ToggleFormHandler.prototype.toggleHandler_=function(){this.getHtmlElement().submit();return!0}})(jQuery);(function(a){a.pkp.controllers.form.FileUploadFormHandler=function(a,c){this.parent(a,c);if(void 0===c.readOnly||null===c.readOnly)void 0!==c.resetUploader&&(this.resetUploader_=c.resetUploader),void 0!==c.$preview&&c.$preview.length&&(this.$preview=c.$preview,this.bind("fileDeleted",this.callbackWrapper(this.fileDeleted))),this.attachUploader_(c.$uploader,c.uploaderOptions),this.uploaderSetup(c.$uploader)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.FileUploadFormHandler,a.pkp.controllers.form.AjaxFormHandler);
a.pkp.controllers.form.FileUploadFormHandler.prototype.resetUploader_=!1;a.pkp.controllers.form.FileUploadFormHandler.prototype.$preview=!1;a.pkp.controllers.form.FileUploadFormHandler.prototype.handleResponse=function(b,c){var d;this.resetUploader_&&(d=a("#plupload",this.getHtmlElement()).plupload("getUploader"),d.splice(),d.refresh(),a("#temporaryFileId",this.getHtmlElement()).val(""));return this.parent("handleResponse",b,c)};a.pkp.controllers.form.FileUploadFormHandler.prototype.uploaderSetup=
function(b){a.pkp.classes.Handler.getHandler(b).pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse))};a.pkp.controllers.form.FileUploadFormHandler.prototype.handleUploadResponse=function(b,c,d,e){b=this.handleJson(a.parseJSON(e.response));!1!==b&&(this.trigger("fileUploaded",[b.uploadedFile]),this.$preview&&this.$preview.hide(),""===b.content?(c=this.getHtmlElement(),c=c.find("#temporaryFileId"),c.val(b.temporaryFileId)):this.replaceWith(b.content))};a.pkp.controllers.form.FileUploadFormHandler.prototype.fileDeleted=
function(){this.$preview&&this.$preview.hide()};a.pkp.controllers.form.FileUploadFormHandler.prototype.attachUploader_=function(a,c){a.pkpHandler("$.pkp.controllers.UploaderHandler",c)}})(jQuery);(function(a){a.pkp.controllers.form.MultilingualInputHandler=function(a,c){this.parent(a,c);var d=null,d=a.hasClass("pkpTagit")?a.find(":input").filter(":visible"):a.find(":input").first();d.focus(this.callbackWrapper(this.focusHandler_));a.find(":input").blur(this.callbackWrapper(this.blurHandler_));this.publishEvent("tinyMCEInitialized");this.tinyMCEInitHandler_();setTimeout(this.callbackWrapper(this.isIncomplete_),500)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.MultilingualInputHandler,
a.pkp.classes.Handler);a.pkp.controllers.form.MultilingualInputHandler.prototype.focusHandler_=function(){this.showPopover_()};a.pkp.controllers.form.MultilingualInputHandler.prototype.blurHandler_=function(){setTimeout(this.callbackWrapper(function(){this.hasElementInFocus_()||this.hidePopover_()}),0);return!0};a.pkp.controllers.form.MultilingualInputHandler.prototype.hidePopover_=function(){var a=this.getHtmlElement();a.removeClass("localization_popover_container_focus");a.find(".localization_popover").hide();
this.isIncomplete_()};a.pkp.controllers.form.MultilingualInputHandler.prototype.showPopover_=function(){var a=this.getHtmlElement();a.addClass("localization_popover_container_focus");a.find(".localization_popover").width(a.width());a.find(".localization_popover").show()};a.pkp.controllers.form.MultilingualInputHandler.prototype.hasElementInFocus_=function(){return this.getHtmlElement().has(document.activeElement).length?!0:!1};a.pkp.controllers.form.MultilingualInputHandler.prototype.isIncomplete_=
function(){var b=this.getHtmlElement(),c=[],d=0;"undefined"!==typeof tinyMCE&&(this.getHtmlElement().find(".richContent").length?b.find("textarea").each(function(){a(this).attr("id");c.push(a(this));tinyMCE.EditorManager.get(a(this).attr("id")).getContent()&&d++}):(c=b.find(":input"),c.each(function(){a(this).val()&&d++})),0<d&&d<c.length?b.removeClass("localizationComplete").addClass("localizationIncomplete"):d===c.length?b.removeClass("localizationIncomplete").addClass("localizationComplete"):b.removeClass("localizationIncomplete localizationComplete"))};
a.pkp.controllers.form.MultilingualInputHandler.prototype.tinyMCEInitHandler_=function(){if(this.getHtmlElement().find(".richContent").length&&"undefined"!==typeof tinyMCE){var b=this.getHtmlElement(),c=tinyMCE.EditorManager.get(b.find("textarea").first().attr("id"));c.on("focus",this.callbackWrapper(function(){this.trigger("callWhenClickOutside",{container:this.getHtmlElement(),callback:this.callbackWrapper(this.hidePopover_)});this.showPopover_()}));c.on("blur",this.callbackWrapper(function(){if(a(c.getContainer()).find("iframe").attr("id")==
a(document.activeElement).attr("id"))return!1;setTimeout(this.callbackWrapper(function(){this.hasElementInFocus_()||this.hidePopover_()}),0)}))}}})(jQuery);(function(a){a.pkp.controllers.form.CancelActionAjaxFormHandler=function(b,c){var d=this;this.parent(b,c);this.cancelUrl_=c.cancelUrl;this.cancelActionHandler=function(){d.handleCancelAction()};a(window).on("unload",this.cancelActionHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.CancelActionAjaxFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.cancelActionHandler=null;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.cancelUrl_=
null;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.isComplete_=!1;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.containerCloseHandler=function(a,c){this.handleCancelAction();return this.parent("containerCloseHandler",a,c)};a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.submitForm=function(a,c){this.isComplete_=!0;this.parent("submitForm",a,c)};a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.handleCancelAction=function(){null!==this.cancelActionHandler&&
(a(window).off("unload",this.cancelActionHandler),this.cancelActionHandler=null);!this.isComplete_&&null!==this.cancelUrl_&&a.post(this.cancelUrl_)}})(jQuery);(function(a){a.pkp.controllers.form.ThemeOptionsHandler=function(b,c){this.parent(b,c);var d,e,f;d=b.find("#activeThemeOptions");d.length&&(f=this,b.find("#themePluginPath").change(function(){f.unbindPartial(d);d.empty()}),d.find('input[type="color"]').each(function(){var b=a(this);b.spectrum({preferredFormat:"hex",showInitial:!0,showInput:!0,showButtons:!1,change:function(a){e=a.toHexString();b.val(e)}})}))};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.ThemeOptionsHandler,a.pkp.classes.Handler)})(jQuery);(function(a){a.pkp.controllers.form.UserFormHandler=function(b,c){this.parent(b,c);c.fetchUsernameSuggestionUrl&&c.usernameSuggestionTextAlert&&(this.fetchUsernameSuggestionUrl_=c.fetchUsernameSuggestionUrl,this.usernameSuggestionTextAlert_=c.usernameSuggestionTextAlert);a('[id^="suggestUsernameButton"]',b).click(this.callbackWrapper(this.generateUsername));c.hideNonReviewerInterests&&(a('[id^="reviewerGroup-"]',b).click(this.callbackWrapper(this.setInterestsVisibility_)),this.setInterestsVisibility_())};
a.pkp.classes.Helper.inherits(a.pkp.controllers.form.UserFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.form.UserFormHandler.prototype.fetchUsernameSuggestionUrl_="";a.pkp.controllers.form.UserFormHandler.prototype.usernameSuggestionTextAlert_="";a.pkp.controllers.form.UserFormHandler.prototype.generateUsername=function(b,c){c.preventDefault();var d=this.getHtmlElement(),e,f;f=a('[name="sitePrimaryLocale"]',d).val();e=a('[name="givenName['+f+']"]',d).val();d=a('[name="familyName['+
f+']"]',d).val();e=this.fetchUsernameSuggestionUrl_.replace("GIVEN_NAME_PLACEHOLDER",e).replace("FAMILY_NAME_PLACEHOLDER",d);a.get(e,this.callbackWrapper(this.setUsername),"json")};a.pkp.controllers.form.UserFormHandler.prototype.setUsername=function(b,c){var d=this.handleJson(c),e=this.getHtmlElement();if(!1===d)throw Error("JSON response must be set to true!");a('[id^="username"]',e).val(d.content).trigger("blur")};a.pkp.controllers.form.UserFormHandler.prototype.setInterestsVisibility_=function(){var b=
this.getHtmlElement(),c=a("#interests",b);a('[id^="reviewerGroup-"]:checked',b).size()?c.show(300):c.hide(300)}})(jQuery);(function(a){a.pkp.controllers.form.reviewer=a.pkp.controllers.form.reviewer||{};a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler=function(a,c){this.parent(a,c);a.find("[id^='submitFormButton-']").click(this.callbackWrapper(this.updateCommentsRequired_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler.prototype.updateCommentsRequired_=function(){var b=
this.getHtmlElement().find('[id^="comments"]');1==a("#reviewAttachmentsGridContainer").find("tbody.empty:visible").length?b.attr("required","1"):b.removeAttr("required");return!0}})(jQuery);(function(a){a.pkp.controllers.grid=a.pkp.controllers.grid||{};a.pkp.controllers.grid.GridHandler=function(a,c){this.parent(a,c);this.initialize(c);this.initFeatures_(c.features)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.GridHandler,a.pkp.classes.Handler);a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID={};a.pkp.controllers.grid.GridHandler.prototype.bodySelector=null;a.pkp.controllers.grid.GridHandler.prototype.fetchRowUrl=null;a.pkp.controllers.grid.GridHandler.prototype.fetchRowsUrl=
null;a.pkp.controllers.grid.GridHandler.prototype.gridId_=null;a.pkp.controllers.grid.GridHandler.prototype.fetchGridUrl_=null;a.pkp.controllers.grid.GridHandler.prototype.features_=null;a.pkp.controllers.grid.GridHandler.prototype.fetchExtraParams_=null;a.pkp.controllers.grid.GridHandler.prototype.getFetchExtraParams=function(){return this.fetchExtraParams_};a.pkp.controllers.grid.GridHandler.prototype.setFetchExtraParams=function(a){this.fetchExtraParams_=a};a.pkp.controllers.grid.GridHandler.prototype.getFetchRowUrl=
function(){return this.fetchRowUrl};a.pkp.controllers.grid.GridHandler.prototype.getFetchRowsUrl=function(){return this.fetchRowsUrl};a.pkp.controllers.grid.GridHandler.prototype.getRows=function(){return a(".gridRow",this.getHtmlElement()).not(".gridRowDeleted")};a.pkp.controllers.grid.GridHandler.prototype.getGridIdPrefix=function(){return"component-"+this.gridId_};a.pkp.controllers.grid.GridHandler.prototype.getRowIdPrefix=function(){return this.getGridIdPrefix()+"-row-"};a.pkp.controllers.grid.GridHandler.prototype.getRowByDataId=
function(b){return a("#"+this.getRowIdPrefix()+a.pkp.classes.Helper.escapeJQuerySelector(String(b)),this.getHtmlElement())};a.pkp.controllers.grid.GridHandler.prototype.getRowDataId=function(a){return a.attr("id").slice(this.getRowIdPrefix().length)};a.pkp.controllers.grid.GridHandler.prototype.getParentRow=function(a){return a.parents(".gridRow:first")};a.pkp.controllers.grid.GridHandler.prototype.getElementsByType=function(b){return b.hasClass("gridRow")?(b=b.parents("tbody:first"),a(".gridRow",
b)):null};a.pkp.controllers.grid.GridHandler.prototype.getEmptyElement=function(a){return a.hasClass("gridRow")?a.parents("tbody:first").next(".empty"):null};a.pkp.controllers.grid.GridHandler.prototype.toggleRowActions=function(b,c){c.preventDefault();a(b).toggleClass("show_extras");a(b).toggleClass("hide_extras");var d=a(b).parents("tr").next(".row_controls");this.applyToggleRowActionEffect_(d)};a.pkp.controllers.grid.GridHandler.prototype.hideAllVisibleRowActions=function(){this.getHtmlElement().find("a.hide_extras").click()};
a.pkp.controllers.grid.GridHandler.prototype.hideRowActionsDiv=function(){var b,c,d;b=a(".gridRow div.row_actions",this.getHtmlElement());b.hide();c=0;for(d=b.length;c<d;c++)a(b[c])};a.pkp.controllers.grid.GridHandler.prototype.showRowActionsDiv=function(){a(".gridRow div.row_actions",this.getHtmlElement()).show()};a.pkp.controllers.grid.GridHandler.prototype.changeLinkActionsState=function(b,c){void 0===c&&(c=a(".pkp_controllers_linkAction",this.getHtmlElement()));c.each(function(){var c;c=a.pkp.classes.Handler.getHandler(a(this));
b?c.enableLink():c.disableLink()})};a.pkp.controllers.grid.GridHandler.prototype.resequenceRows=function(b){var c,d,e;if(b){for(d in b){c=b[d];e=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(String(c)));0==e.length&&(e=this.getRowByDataId(c));if(0==e.length)throw Error("Row with id "+c+" not found!");this.addElement(e)}this.updateControlRowsPosition();this.callFeaturesHook("resequenceRows",b)}};a.pkp.controllers.grid.GridHandler.prototype.updateControlRowsPosition=function(){var b,c,d,e,f;b=this.getRows();
c=0;for(d=b.length;c<d;c++)e=a(b[c]),f=this.getControlRowByGridRow(e),0<f.length&&f.insertAfter(e)};a.pkp.controllers.grid.GridHandler.prototype.insertOrReplaceElement=function(b,c){var d,e,f;d=a(b);e=d.attr("id");f=this.getHtmlElement();e=e?f.find("#"+a.pkp.classes.Helper.escapeJQuerySelector(e)):null;if(null!==e&&1<e.length)throw Error("There were "+e.length+" rather than 0 or 1 elements to be replaced!");this.hasSameNumOfColumns(d)?(null!==e&&1===e.length?this.replaceElement(e,d):this.addElement(d,
null,c),this.activateRowActions_()):a.get(this.fetchGridUrl_,null,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.deleteElement=function(a,c){var d,e,f,h;if(1!==a.length)throw Error("There were "+a.length+" rather than 1 element to delete!");a.addClass("gridRowDeleted");d=!1;1==this.getElementsByType(a).length&&(d=!0);a.hasClass("gridRow")&&this.deleteControlsRow_(a);e=this.getEmptyElement(a);h=this;f=function(){h.unbindPartial(a);a.remove();
d&&e.fadeIn(100)};void 0!=c&&c?f():a.fadeOut(500,f)};a.pkp.controllers.grid.GridHandler.prototype.initialize=function(b){var c;this.bind("dataChanged",this.refreshGridHandler);this.bind("addRow",this.addRowHandler_);this.bind("formSubmitted",this.refreshGridWithFilterHandler_);this.gridId_=b.gridId;this.fetchRowUrl=b.fetchRowUrl;this.fetchRowsUrl=b.fetchRowsUrl;this.fetchGridUrl_=b.fetchGridUrl;this.bodySelector=0<a("div.scrollable",this.getHtmlElement()).length?"div.scrollable table":b.bodySelector;
this.activateRowActions_();this.setFetchExtraParams({});this.getHtmlElement().find(".pkp_form").hide();c=this.getHtmlElement().find(".pkp_linkaction_search");0!==c.length?c.click(this.callbackWrapper(function(){this.getHtmlElement().find(".pkp_form").toggle();c.toggleClass("is_open")})):this.getHtmlElement().find(".pkp_form").toggle();this.trigger("gridInitialized")};a.pkp.controllers.grid.GridHandler.prototype.callFeaturesHook=function(b,c){var d;a.isArray(c)||(c=[c]);for(d in this.features_)this.features_[d][b].apply(this.features_[d],
c)};a.pkp.controllers.grid.GridHandler.prototype.refreshGridHandler=function(b,c,d,e){this.callFeaturesHook("refreshGrid",d);b=this.getFetchExtraParams();e||(d?d==a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID?a.get(this.fetchRowsUrl,b,this.callbackWrapper(this.replaceElementResponseHandler),"json"):(b.rowId=d,a.get(this.fetchRowUrl,b,this.callbackWrapper(this.replaceElementResponseHandler),"json")):a.get(this.fetchGridUrl_,b,this.callbackWrapper(this.replaceGridResponseHandler_),"json"));this.trigger("gridRefreshRequested");
this.publishChangeEvents()};a.pkp.controllers.grid.GridHandler.prototype.addElement=function(a,c,d){if(void 0===c||null===c)c=this.getHtmlElement().find(this.bodySelector);void 0!=d&&d?c.prepend(a):c.append(a);this.getEmptyElement(a).hide();this.callFeaturesHook("addElement",a)};a.pkp.controllers.grid.GridHandler.prototype.replaceElement=function(a,c){c.hasClass("gridRow")&&this.deleteControlsRow_(a);this.replacePartialWith(c,a);this.callFeaturesHook("replaceElement",c)};a.pkp.controllers.grid.GridHandler.prototype.hasSameNumOfColumns=
function(a,c){var d,e;d=this.getHtmlElement().find("th").length;e=a.first().find("td");e=c?e.attr("colspan"):e.length;return d==e};a.pkp.controllers.grid.GridHandler.prototype.replaceElementResponseHandler=function(b,c){var d,e,f,h,j,i,n;e=this.handleJson(c);if(!1!==e)if(e.elementNotFound)d=e.elementNotFound,d=this.getRowByDataId(d),0<d.length&&this.deleteElement(d);else{f=a(e.content);if(1<f.filter("tr:not('.row_controls')").length){d=f.filter("tr.gridRow");j=f.filter("tr.row_controls");i=0;for(n=
d.length;i<n;i++)f=a(d[i]),h=this.getControlRowByGridRow(f,j),this.insertOrReplaceElement(f.add(h))}else this.insertOrReplaceElement(e.content);this.resequenceRows(e.sequenceMap)}this.callFeaturesHook("replaceElementResponseHandler",e)};a.pkp.controllers.grid.GridHandler.prototype.refreshGridWithFilterHandler_=function(b,c,d){a.post(this.fetchGridUrl_,d,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.addRowHandler_=function(b,c,d){a.get(this.fetchRowUrl,
d,this.callbackWrapper(this.replaceElementResponseHandler),"json")};a.pkp.controllers.grid.GridHandler.prototype.replaceGridResponseHandler_=function(b,c){var d,e,f;d=this.handleJson(c);!1!==d&&(e=this.getHtmlElement(),f=e.parent(),e=e.find(".filter").is(":visible"),this.replaceWith(d.content),d=a('div[id^="'+this.getGridIdPrefix()+'"]',f),this.setHtmlElement(d),this.activateRowActions_(),e&&d.find(".pkp_linkaction_search").click())};a.pkp.controllers.grid.GridHandler.prototype.deleteControlsRow_=
function(b){b=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(b.attr("id"))+"-control-row",this.getHtmlElement());b.is("tr")&&b.hasClass("row_controls")&&(this.unbindPartial(b),b.remove())};a.pkp.controllers.grid.GridHandler.prototype.getControlRowByGridRow=function(b,c){var d,e;e=void 0===c||null===c?this.getHtmlElement().find("tr"):c;d=b.attr("id")+"-control-row";return e.filter("#"+a.pkp.classes.Helper.escapeJQuerySelector(d))};a.pkp.controllers.grid.GridHandler.prototype.activateRowActions_=function(){var a=
this.getHtmlElement();this.getHtmlElement().find("tr.gridRow").not(".category");a.find("a.show_extras").unbind("click").bind("click",this.callbackWrapper(this.toggleRowActions))};a.pkp.controllers.grid.GridHandler.prototype.applyToggleRowActionEffect_=function(a){a.prev().find("td:not(.indent_row)").add(a.prev());a.toggle()};a.pkp.controllers.grid.GridHandler.prototype.addFeature_=function(a,c){this.features_||(this.features_=[]);this.features_[a]=c};a.pkp.controllers.grid.GridHandler.prototype.initFeatures_=
function(b){var c,d;for(c in b)d=b[c].JSClass,null!==d&&(d=a.pkp.classes.Helper.objectFactory(d,[this,b[c].options]),this.addFeature_(c,d),this.features_[c].init())}})(jQuery);(function(a){a.pkp.controllers.grid.CategoryGridHandler=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.CategoryGridHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryIdPrefix=function(){return this.getGridIdPrefix()+"-category-"};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategories=function(){return a(".category_grid_body:not(.empty)",this.getHtmlElement())};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryByDataId=
function(b){return a("#"+this.getCategoryIdPrefix()+b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryRow=function(b){var c=this.getHtmlElement();void 0!==b&&(c=b);return a("tr.category",c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowsInCategory=function(b){return a("tr.gridRow",b).not(".category")};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryEmptyPlaceholder=function(b){b="#"+b.attr("id")+"-emptyPlaceholder";return a(b,this.getHtmlElement())};
a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataId=function(a){var a=a.attr("id"),c=this.getCategoryIdPrefix().length;return a.slice(c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataIdByRowId=function(b){b=b.replace(this.getCategoryIdPrefix()," ");b=b.match("(.*)-row");return a.trim(b[1])};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowIdPrefix=function(){return this.getGridIdPrefix()+"-category-"};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowByDataId=
function(b,c){this.parent("getRowByDataId",b,c);return a("#"+this.getRowIdPrefix()+c+"-row-"+b,this.getHtmlElement())};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowDataId=function(b){b=b.attr("id").slice(this.getRowIdPrefix().length);b=b.match("-row-(.*)");return a.trim(b[1])};a.pkp.controllers.grid.CategoryGridHandler.prototype.appendCategory=function(a){this.getHtmlElement().find(this.bodySelector).append(a)};a.pkp.controllers.grid.CategoryGridHandler.prototype.resequenceCategories=
function(b){var c,d;for(d in b)c=b[d],c=a("#"+c),this.appendCategory(c);this.updateEmptyPlaceholderPosition()};a.pkp.controllers.grid.CategoryGridHandler.prototype.updateEmptyPlaceholderPosition=function(){var b=this.getCategories(),c,d,e,f;c=0;for(d=b.length;c<d;c++)e=a(b[c]),f=this.getCategoryEmptyPlaceholder(e),0<f.length&&f.insertAfter(e)};a.pkp.controllers.grid.CategoryGridHandler.prototype.initialize=function(a){this.fetchCategoryUrl_=a.fetchCategoryUrl;this.parent("initialize",a)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getElementsByType=
function(a){return a.hasClass("category_grid_body")?this.getCategories():this.parent("getElementsByType",a)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getEmptyElement=function(a){return a.hasClass("category_grid_body")?this.getHtmlElement().find(".empty").not(".category_placeholder"):this.parent("getEmptyElement",a)};a.pkp.controllers.grid.CategoryGridHandler.prototype.refreshGridHandler=function(b,c,d){var e=!1;void 0!==d&&(void 0!==d.parentElementId?(e={rowId:d[0],rowCategoryId:d.parentElementId},
this.currentCategoryId_=d.parentElementId,a.get(this.fetchRowUrl,e,this.callbackWrapper(this.replaceElementResponseHandler),"json")):a.get(this.fetchCategoryUrl_,{rowId:d},this.callbackWrapper(this.replaceElementResponseHandler),"json"),e=!0);this.parent("refreshGridHandler",b,c,d,e)};a.pkp.controllers.grid.CategoryGridHandler.prototype.deleteElement=function(b){var c,d,e,f;if(1<b.length&&(2==b.length&&(b.hasClass("category_grid_body")&&b.hasClass("category"))&&(b=b.filter(".category_grid_body")),
this.currentCategoryId_)){c=this.getCategoryByDataId(this.currentCategoryId_);d=0;for(e=b.length;d<e;d++)if(f=a(b[d]).parents("#"+c.attr("id")),1===f.length){b=a(b[d]);break}}b.hasClass("category_grid_body")&&(c=this.getCategoryEmptyPlaceholder(b),this.unbindPartial(c),c.remove());this.parent("deleteElement",b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.addElement=function(a){var c=null;a.hasClass("gridRow")&&(c=this.getCategoryDataIdByRowId(a.attr("id")),c=this.getCategoryByDataId(c));
this.parent("addElement",a,c);a.hasClass("category_grid_body")&&(a=this.getEmptyElement(a),this.getHtmlElement().find(this.bodySelector).append(a))};a.pkp.controllers.grid.CategoryGridHandler.prototype.replaceElement=function(a,c){if(c.hasClass("category_grid_body")){var d=this.getCategoryEmptyPlaceholder(a);this.unbindPartial(d);d.remove()}this.parent("replaceElement",a,c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.hasSameNumOfColumns=function(a){var c=a,d=!1;a.hasClass("category_grid_body")&&
(c=a.find("tr"),d=!0);return this.parent("hasSameNumOfColumns",c,d)}})(jQuery);(function(a){a.pkp.controllers.listbuilder=a.pkp.controllers.listbuilder||{};a.pkp.controllers.listbuilder.ListbuilderHandler=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.listbuilder.ListbuilderHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.sourceType_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveUrl_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveFieldName_=null;
a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.fetchOptionsUrl_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.editItemCallingContext_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.availableOptions_=!1;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.initialize=function(a){this.parent("initialize",a);this.sourceType_=a.sourceType;this.saveUrl_=a.saveUrl;this.saveFieldName_=a.saveFieldName;this.fetchOptionsUrl_=a.fetchOptionsUrl;this.availableOptions_=
a.availableOptions;a=this.getHtmlElement();a.find(".actions .pkp_linkaction_addItem").mousedown(this.callbackWrapper(this.addItemHandler_));this.attachContentHandlers_(a);this.bind("formSubmitRequested",this.formSubmitHandler_);this.bind("formSubmitted",this.formSubmittedHandler_)};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.getSaveUrl_=function(){return this.saveUrl_};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.getSaveFieldName_=function(){return this.saveFieldName_};
a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.closeEdits=function(){var a=this.getHtmlElement().find(".gridRowEdit:visible");0!==a.length&&(this.saveRow(a),a.removeClass("gridRowEdit"))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.save=function(){var b=this.getHtmlElement().find("input.deletions").val(),c=[],d,e,f=this;this.getHtmlElement().find('.gridRow input.isModified[value="1"]').each(function(b,d){var e=a(d).parents(".gridRow"),e=f.buildParamsFromInputs_(e.find(":input"));
c.push(e)});d=this.getRows().length;b=JSON.stringify({deletions:b,changes:c,numberOfRows:d});(d=this.getSaveUrl_())?a.post(d,{data:b},this.callbackWrapper(this.saveResponseHandler_,null),"json"):(e=this.getSaveFieldName_(),d=this.getHtmlElement().find(":input[type=hidden]").filter(function(){return a(this).attr("name")==e}).first(),0===d.length&&(d=a('<input type="hidden" />'),d.attr("name",e),this.getHtmlElement().append(d)),d.attr("value",b))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRow=
function(b){b.addClass("saveRowResponsePlaceholder");b=this.buildParamsFromInputs_(b.find(":input"));b.modify=!0;this.disableControls();a.ajax({url:this.getFetchRowUrl(),data:b,success:this.callbackWrapper(this.saveRowResponseHandler_,null),dataType:"json",async:!1})};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.getEmptyElement=function(){return this.getHtmlElement().find(".empty")};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.addItemHandler_=function(){this.availableOptions_&&
setTimeout(this.callbackWrapper(function(){this.closeEdits();this.disableControls();a.get(this.getFetchRowUrl(),{modify:!0},this.callbackWrapper(this.appendRowResponseHandler_,null),"json")}),0);return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.deleteItemHandler_=function(b){this.closeEdits();var c=a(b),b=c.closest(".gridRow"),c=c.closest(".pkp_controllers_listbuilder").find(".deletions"),d=b.find('input[name="rowId"]').val();void 0!==d&&(c.val(c.val()+" "+d),this.getHtmlElement().trigger("formChange"));
this.deleteElement(b);this.availableOptions_=!0;return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.appendRowResponseHandler_=function(b,c){var d=this.handleJson(c);!1!==d&&(d=a(d.content),this.getHtmlElement().find(".empty").hide().before(d),this.attachContentHandlers_(d),d.addClass("gridRowEdit"),d.find(":input").not('[type="hidden"]').first().focus(),this.sourceType_==a.pkp.cons.LISTBUILDER_SOURCE_TYPE_SELECT?(this.disableControls(),a.get(this.fetchOptionsUrl_,{},this.callbackWrapper(this.fetchOptionsResponseHandler_,
null),"json")):this.enableControls(),this.callFeaturesHook("addElement",d));return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.fetchOptionsResponseHandler_=function(b,c){var d=this.handleJson(c),e=this.getHtmlElement(),f=[],h,j,i,n,k,q,p,s,m,u;if(!1!==d){e.find(".gridCellDisplay :input").each(function(b,c){f[b]=a(c).val()});e=e.find(".gridRowEdit:visible .selectMenu:input");h=0;for(j=e.length;h<j;h++){i=a(e[h]);n=i.parents(".gridCellContainer");k=0;i.children().empty();q=null;for(q in d.content[h])if(q!=
a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL)if("object"==typeof d.content[h][q]){if(void 0!==d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&"object"==typeof d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&(s=d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL][q])){m=a("<optgroup></optgroup>");m.attr("label",s);i.append(m);s=null;u=0;for(s in d.content[h][q])if(p=this.populatePulldown_(m,f,d.content[h][q][s],s))k++,u++;0===u&&m.remove()}}else(p=this.populatePulldown_(i,f,d.content[h][q],q))&&
k++;i=p;1===k&&i&&(i.attr("selected","selected"),this.availableOptions_=!1);0===k&&(n.find(".gridCellDisplay").show(),n.find(".gridCellEdit").hide())}}this.enableControls();return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.populatePulldown_=function(b,c,d,e){var f=b.parents(".gridCellContainer").find(".gridCellDisplay :input").val(),h=!1,j;if(e!=f)for(j=0;j<c.length;j++)c[j]==e&&(h=!0);if(h)return!1;c=a("<option/>");c.attr("value",e);c.text(d);e==f&&c.attr("selected","selected");
b.append(c);return c};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.editItemHandler_=function(b){this.closeEdits();this.editItemCallingContext_=b;setTimeout(this.callbackWrapper(function(){var b=a(this.editItemCallingContext_).closest(".gridRow");b.addClass("gridRowEdit");b.find(":input").not('[type="hidden"]').first().focus();this.sourceType_==a.pkp.cons.LISTBUILDER_SOURCE_TYPE_SELECT&&(this.disableControls(),a.get(this.fetchOptionsUrl_,{},this.callbackWrapper(this.fetchOptionsResponseHandler_,
null),"json"))}),0);return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.buildParamsFromInputs_=function(b){var c={};a.each(b.serializeArray(),function(b,e){var f=e.name,h=e.value;c[f]=void 0===c[f]?h:a.isArray(c[f])?c[f].concat(h):[c[f],h]});return c};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.inputKeystrokeHandler_=function(b,c){var d,e,f;return 13==c.which?(d=a(b),e=d.parents(".gridRow"),f=e.find(":input:visible"),d=f.index(d),f.length==d+1?this.saveRow(e):f[d+1].focus(),
!1):!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.inputBlurHandler_=function(b){a(b).closest(".gridRow").addClass("editingRowPlaceholder");setTimeout(this.callbackWrapper(function(){var b=a(".editingRowPlaceholder"),d=!1;b.find(":input").each(function(a,b){b===document.activeElement&&(d=!0)});b.removeClass("editingRowPlaceholder");d||this.closeEdits()}),0);return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRowResponseHandler_=function(b,c){var d=this.handleJson(c),
e;!1!==d&&(d=a(d.content),e=this.getHtmlElement().find(".saveRowResponsePlaceholder").attr("id"),this.getHtmlElement().find(".saveRowResponsePlaceholder").replaceWith(d),d.attr("id",e),this.attachContentHandlers_(d),this.callFeaturesHook("replaceElement",d));this.getHtmlElement().trigger("formChange");this.enableControls()};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveResponseHandler_=function(){};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.attachContentHandlers_=
function(a){a.find(".gridCellDisplay").click(this.callbackWrapper(this.editItemHandler_));a.find(":input").keypress(this.callbackWrapper(this.inputKeystrokeHandler_)).blur(this.callbackWrapper(this.inputBlurHandler_));a.find(".pkp_linkaction_delete").click(this.callbackWrapper(this.deleteItemHandler_))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.formSubmitHandler_=function(){this.save();this.getHtmlElement().find(".gridRow :input").attr("disabled","disabled");return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.formSubmittedHandler_=
function(){this.getHtmlElement().find(".gridRow :input").removeAttr("disabled")};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.disableControls=function(){this.getHtmlElement().find('span[class="options"] > a[id*="addItem"]').unbind("mousedown");this.getHtmlElement().find('span[class="options"] > a[id*="addItem"]').mousedown(function(){return!1});this.getHtmlElement().find(".h3").addClass("spinner")};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.enableControls=function(){this.getHtmlElement().find('span[class="options"] > a[id*="addItem"]').mousedown(this.callbackWrapper(this.addItemHandler_));
this.getHtmlElement().find(".h3").removeClass("spinner")}})(jQuery);(function(a){a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler,a.pkp.controllers.listbuilder.ListbuilderHandler);a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.$lists_=null;a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getRowsByList=function(a){return a.find(".gridRow")};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getLists=
function(){return this.$lists_};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.setLists=function(b){jQuery();var c,d;if(!a.isArray(b))throw Error("Lists id must be passed using an array object!");for(c in b)d=this.getListById(b[c]),this.$lists_=this.$lists_?this.$lists_.add(d):d};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getListById=function(b){b=this.getGridIdPrefix()+"-table-"+b;return a("#"+b,this.getHtmlElement())};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getListByRow=
function(a){return a.parents("table:first")};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getListIdByRow=function(a){a=this.getListByRow(a);return this.getListId(a)};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getListId=function(a){var c=this.getGridIdPrefix()+"-table-";return a.attr("id").slice(c.length)};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getListNoItemsRow=function(a){return a.find("tr.empty")};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.initialize=
function(a){this.parent("initialize",a);this.setLists(a.listsId)};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.toggleListNoItemsRow=function(a,c,d){var e=this.getListNoItemsRow(a),f=this.getRowsByList(a);d&&(f=f.not(d));f.length==c?(e.detach(),a.append(e),e.show()):(e.detach(),a.append(e),e.hide())}})(jQuery);(function(a){a.pkp.controllers.modal=a.pkp.controllers.modal||{};a.pkp.controllers.modal.ModalHandler=function(b,c){this.parent(b,c);if(!this.checkOptions(c))throw Error("Missing or invalid modal options!");var d=a.extend(!0,{},c);this.options=this.mergeOptions(d);b.html(this.modalBuild()[0].outerHTML);this.modalOpen(b);b.find(".pkpModalCloseButton").click(this.callbackWrapper(this.modalClose));b.on("click keyup",this.callbackWrapper(this.handleWrapperEvents));this.publishEvent("redirectRequested");
this.publishEvent("dataChanged");this.publishEvent("containerReloadRequested");this.publishEvent("updateHeader");this.publishEvent("gridRefreshRequested");this.bind("notifyUser",this.redirectNotifyUserEventHandler_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.ModalHandler,a.pkp.classes.Handler);a.pkp.controllers.modal.ModalHandler.DEFAULT_OPTIONS_={autoOpen:!0,width:710,modal:!0,draggable:!1,resizable:!1,position:{my:"center",at:"center center-10%",of:window},canClose:!0,closeCallback:!1};
a.pkp.controllers.modal.ModalHandler.options=null;a.pkp.controllers.modal.ModalHandler.prototype.checkOptions=function(a){return"object"===typeof a&&void 0===a.buttons};a.pkp.controllers.modal.ModalHandler.prototype.mergeOptions=function(b){return a.extend(!0,{},this.self("DEFAULT_OPTIONS_"),b)};a.pkp.controllers.modal.ModalHandler.prototype.modalBuild=function(){var b=a('<div class="pkp_modal_panel"></div>');"undefined"!==this.options.title&&b.append('<div class="header">'+this.options.title+"</div>");
this.options.canClose&&b.append('<a href="#" class="close pkpModalCloseButton"><span class="pkp_screen_reader">'+this.options.closeButtonText+"</span></a>");b.append('<div class="content"></div>');b.attr("role","dialog").attr("aria-label",this.options.title);return b};a.pkp.controllers.modal.ModalHandler.prototype.modalOpen=function(b){a("body").append(b);setTimeout(function(){b.addClass("is_visible")},10);setTimeout(function(){b.focus()},300);b.trigger("pkpModalOpen",[b])};a.pkp.controllers.modal.ModalHandler.prototype.modalClose=
function(){var a=this,c=this.getHtmlElement(),d=c.find("form").first(),e;if(1==d.length&&(e={closePermitted:!0},d.trigger("containerClose",[e]),!e.closePermitted))return!1;c.removeClass("is_visible");this.trigger("pkpModalClose");setTimeout(function(){a.unbindPartial(c);c.empty();a.remove();"function"===typeof a.options.closeCallback&&a.options.closeCallback.call()},300);return!1};a.pkp.controllers.modal.ModalHandler.prototype.handleWrapperEvents=function(b,c){"click"==c.type&&b==c.target?a.pkp.classes.Handler.getHandler(a(b)).modalClose():
"keyup"==c.type&&27==c.which&&a.pkp.classes.Handler.getHandler(a(b)).modalClose()};a.pkp.controllers.modal.ModalHandler.prototype.redirectNotifyUserEventHandler_=function(b,c,d){a.pkp.classes.notification.NotificationHelper.redirectNotifyUserEvent(this,d)}})(jQuery);(function(a){a.pkp.controllers.modal.ConfirmationModalHandler=function(a,c){this.parent(a,c);this.callback_=c.callback||null;this.callbackArgs_=c.callbackArgs||null;a.find(".pkpModalConfirmButton").on("click",this.callbackWrapper(this.modalConfirm))};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.ConfirmationModalHandler,a.pkp.controllers.modal.ModalHandler);a.pkp.controllers.modal.ConfirmationModalHandler.prototype.callback_=null;a.pkp.controllers.modal.ConfirmationModalHandler.prototype.callbackArgs_=
null;a.pkp.controllers.modal.ConfirmationModalHandler.prototype.checkOptions=function(a){return!this.parent("checkOptions",a)?!1:"string"===typeof a.okButton&&(!1===a.cancelButton||"string"===typeof a.cancelButton)&&"string"===typeof a.dialogText};a.pkp.controllers.modal.ConfirmationModalHandler.prototype.modalBuild=function(){var a=this.parent("modalBuild"),c='<a href="#" class="ok pkpModalConfirmButton">'+this.options.okButton+"</a>";a.addClass("pkp_modal_confirmation").find(".content").append('<div class="message">'+
this.options.dialogText+"</div>");this.options.cancelButton&&(c+='<a href="#" class="cancel pkpModalCloseButton">'+this.options.cancelButton+"</a>");a.append('<div class="footer">'+c+"</div>");a.attr("role","dialog").attr("aria-label",this.options.title);return a};a.pkp.controllers.modal.ConfirmationModalHandler.prototype.modalConfirm=function(a){this.modalClose(a);this.callback_&&this.callback_.call(null,this.callbackArgs_)}})(jQuery);(function(a){a.pkp.controllers.modal.RedirectConfirmationModalHandler=function(a,c){this.parent(a,c);this.remoteUrl_=c.remoteUrl};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.RedirectConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.remoteUrl_=null;a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.checkOptions=function(a){return!this.parent("checkOptions",a)?!1:"string"===typeof a.cancelButton&&
"string"===typeof a.remoteUrl};a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.modalConfirm=function(){document.location=this.remoteUrl_}})(jQuery);(function(a){a.pkp.controllers.modal.RemoteActionConfirmationModalHandler=function(a,c){this.parent(a,c);this.remoteAction_=c.remoteAction;this.postData_=c.postData||{};this.postData_.csrfToken=c.csrfToken};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.RemoteActionConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteAction_=null;a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.postData_=
null;a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.checkOptions=function(a){return!this.parent("checkOptions",a)?!1:"string"===typeof a.cancelButton&&"string"===typeof a.remoteAction};a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.modalConfirm=function(b,c){c.preventDefault();a.post(this.remoteAction_,this.postData_,this.callbackWrapper(this.remoteResponse),"json")};a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteResponse=
function(a,c){!1!==this.parent("remoteResponse",a,c)&&this.modalClose(a);return!1}})(jQuery);(function(a){a.pkp.controllers.modal.ButtonConfirmationModalHandler=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.ButtonConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.ButtonConfirmationModalHandler.prototype.checkOptions=function(a){return!this.parent("checkOptions",a)?!1:"object"==typeof a.$button&&1==a.$button.length};a.pkp.controllers.modal.ButtonConfirmationModalHandler.prototype.modalConfirm=function(a){var c=
this.options.$button;this.modalClose(a);"submit"==c.attr("type")?c.trigger("submit"):c.click()}})(jQuery);(function(a){a.pkp.controllers.modal.JsEventConfirmationModalHandler=function(a,c){this.parent(a,c);this.jsEvent_=c.jsEvent;this.extraArguments_=c.extraArguments};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.JsEventConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.jsEvent_=null;a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.extraArguments_=null;a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.checkOptions=
function(a){return!this.parent("checkOptions",a)?!1:"string"===typeof a.cancelButton&&"string"===typeof a.jsEvent};a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.modalConfirm=function(a){this.trigger(this.jsEvent_,this.extraArguments_);this.modalClose(a)}})(jQuery);(function(a){a.pkp.controllers.modal.AjaxModalHandler=function(a,c){this.parent(a,c);this.bind("formSubmitted",this.formSubmitted);this.bind("formCanceled",this.modalClose);this.bind("ajaxHtmlError",this.modalClose);this.bind("modalFinished",this.modalClose)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.AjaxModalHandler,a.pkp.controllers.modal.ModalHandler);a.pkp.controllers.modal.AjaxModalHandler.prototype.checkOptions=function(a){return!this.parent("checkOptions",a)?!1:"string"===typeof a.url};
a.pkp.controllers.modal.AjaxModalHandler.prototype.mergeOptions=function(a){return this.parent("mergeOptions",a)};a.pkp.controllers.modal.AjaxModalHandler.prototype.modalOpen=function(a){this.parent("modalOpen",a);a.find(".content").pkpAjaxHtml(this.options.url)};a.pkp.controllers.modal.AjaxModalHandler.prototype.formSubmitted=function(){this.getHtmlElement().parent().trigger("notifyUser");this.modalClose()}})(jQuery);(function(a){a.pkp.controllers.modal.WizardModalHandler=function(a,c){this.parent(a,c);this.bind("wizardClose",this.wizardClose);this.bind("wizardCancel",this.wizardClose)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.WizardModalHandler,a.pkp.controllers.modal.AjaxModalHandler);a.pkp.controllers.modal.WizardModalHandler.prototype.modalClose=function(b,c,d){d?this.parent("modalClose",b,c):(d=new a.Event("wizardCancelRequested"),d.stopPropagation(),this.getHtmlElement().children().first().trigger(d),
d.isDefaultPrevented()||this.parent("modalClose",b,c));return!1};a.pkp.controllers.modal.WizardModalHandler.prototype.wizardClose=function(a,c){this.modalClose(a,c,!0)}})(jQuery);(function(a){a.pkp.controllers.modals=a.pkp.controllers.modals||{editorDecision:{form:{}}};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler=function(b,c){this.parent(b,c);null!==c.peerReviewUrl&&(this.peerReviewUrl_=c.peerReviewUrl,a("#importPeerReviews",b).click(this.callbackWrapper(this.importPeerReviews)));null!==c.revisionsEmail&&(this.revisionsEmail_=c.revisionsEmail);null!==c.resubmitEmail&&(this.resubmitEmail_=c.resubmitEmail);a("#skipEmail-send, #skipEmail-skip, #skipDiscussion-send, #skipDiscussion-skip",
b).change(this.callbackWrapper(this.toggleEmailDisplay));a('input[name="decision"]',b).change(this.callbackWrapper(this.toggleDecisionEmail));this.setStep("email");var d=this;a(".promoteForm-step-btn",b).click(function(b){b.preventDefault();b.stopPropagation();b=a(b.target).data("step");d.setStep(b)})};a.pkp.classes.Helper.inherits(a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.peerReviewUrl_=
null;a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.revisionsEmail_=null;a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.resubmitEmail_=null;a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.importPeerReviews=function(){a.getJSON(this.peerReviewUrl_,this.callbackWrapper(this.insertPeerReviews));return!1};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.insertPeerReviews=function(b,c){var d=
this.handleJson(c),e=this.getHtmlElement(),e=a('textarea[id^="personalMessage"]',e),e=tinyMCE.get(e.attr("id")),f=e.getContent();!1!==d&&e.setContent(f+d.content+"<br>");this.trigger("notifyUser",[this.getHtmlElement()])};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.toggleEmailDisplay=function(){var b=a("#sendReviews-emailContent"),c=this.getHtmlElement(),d=!1,e=!1,f=a("#libraryFileAttachments");a("#skipEmail-send, #skipEmail-skip",c).each(function(){"skipEmail-send"===
a(this).attr("id")&&a(this).prop("checked")?d=!0:"skipEmail-skip"===a(this).attr("id")&&a(this).prop("checked")&&(d=!1)});c=a("#skipDiscussion-send, #skipDiscussion-skip",c);c.length&&c.each(function(){"skipDiscussion-send"===a(this).attr("id")&&a(this).prop("checked")?e=!0:"skipDiscussion-skip"===a(this).attr("id")&&a(this).prop("checked")&&(e=!1)});!d&&!e?(b.fadeOut(),f.fadeOut()):(b.fadeIn(),f.fadeIn())};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.toggleDecisionEmail=
function(){var b="",c=a("#skipEmail-send").prop("checked"),d=a("#sendReviews-emailContent"),e=a('textarea[id^="personalMessage"]').attr("id"),f=this;a('input[name="decision"]').each(function(){"decisionRevisions"===a(this).attr("id")&&a(this).prop("checked")?b=f.revisionsEmail_:"decisionResubmit"===a(this).attr("id")&&a(this).prop("checked")&&(b=f.resubmitEmail_)});tinyMCE.get(e).setContent(b);c&&d.hide().fadeIn()};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.setStep=
function(b){var c=a('#promoteForm-step1, .promoteForm-step-btn[data-step="files"]'),d=a('#promoteForm-step2, #promoteForm-complete-btn, .promoteForm-step-btn[data-step="email"]');"files"===b?(d.show(),c.hide()):(c.show(),d.hide())}})(jQuery);(function(a){jQuery.pkp.controllers.linkAction=jQuery.pkp.controllers.linkAction||{};a.pkp.controllers.linkAction.LinkActionHandler=function(b,c){this.parent(b,c);this.staticId_=c.staticId?c.staticId:b.attr("id");if(!c.actionRequest||!c.actionRequestOptions)throw Error('The "actionRequest" and "actionRequestOptions"settings are required in a LinkActionHandler');c.actionRequestOptions.finishCallback=this.callbackWrapper(this.enableLink);this.linkActionRequest_=a.pkp.classes.Helper.objectFactory(c.actionRequest,
[b,c.actionRequestOptions]);this.bindActionRequest();this.publishEvent("dataChanged");this.bind("dataChanged",this.dataChangedHandler_);this.bind("pkpModalClose",this.removeDisabledAttribute_);c.selfActivate&&this.trigger("click")};a.pkp.classes.Helper.inherits(a.pkp.controllers.linkAction.LinkActionHandler,a.pkp.classes.Handler);a.pkp.controllers.linkAction.LinkActionHandler.prototype.linkActionRequest_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.staticId_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.getStaticId=
function(){return this.staticId_};a.pkp.controllers.linkAction.LinkActionHandler.prototype.getUrl=function(){return this.linkActionRequest_.getUrl()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.activateAction=function(a,c){this.linkActionRequest_.shouldDebounce()&&this.disableLink();return this.linkActionRequest_.activate.call(this.linkActionRequest_,a,c)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.bindActionRequest=function(){this.bind("click",this.activateAction)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.enableLink=
function(){var b,c;b=a(this.getHtmlElement());this.getHtmlElement().is(":submit")||this.removeDisabledAttribute_();c=this.getUrl();this.getHtmlElement().is("a")&&c&&b.attr("href",c);this.unbind("click",this.noAction_);this.bindActionRequest()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.disableLink=function(){var b=a(this.getHtmlElement());b.attr("disabled","disabled");this.getHtmlElement().is("a")&&b.attr("href","#");this.unbind("click",this.activateAction);this.bind("click",this.noAction_)};
a.pkp.controllers.linkAction.LinkActionHandler.prototype.removeDisabledAttribute_=function(){a(this.getHtmlElement()).removeAttr("disabled")};a.pkp.controllers.linkAction.LinkActionHandler.prototype.dataChangedHandler_=function(a,c,d){0===this.getHtmlElement().parents(".pkp_controllers_grid").length&&this.trigger("redirectDataChangedToGrid",[d]);this.trigger("notifyUser",[this.getHtmlElement()])};a.pkp.controllers.linkAction.LinkActionHandler.prototype.noAction_=function(){return!1}})(jQuery);(function(a){a.pkp.controllers.wizard=a.pkp.controllers.wizard||{};a.pkp.controllers.wizard.WizardHandler=function(a,c){this.parent(a,c);this.addWizardButtons_(a,c);this.enforceLinear_=c.hasOwnProperty("enforceLinear")?c.enforceLinear:!0;this.startWizard();this.bindWizardEvents();this.bind("formValid",this.formValid);this.bind("formInvalid",this.formInvalid);this.bind("formSubmitted",this.formSubmitted)};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.WizardHandler,a.pkp.controllers.TabHandler);
a.pkp.controllers.wizard.WizardHandler.prototype.$continueButton_=null;a.pkp.controllers.wizard.WizardHandler.prototype.$progressIndicator_=null;a.pkp.controllers.wizard.WizardHandler.prototype.continueButtonText_=null;a.pkp.controllers.wizard.WizardHandler.prototype.finishButtonText_=null;a.pkp.controllers.wizard.WizardHandler.prototype.enforceLinear_=null;a.pkp.controllers.wizard.WizardHandler.prototype.showProgressIndicator_=function(){this.getProgressIndicator().css("opacity",1)};a.pkp.controllers.wizard.WizardHandler.prototype.hideProgressIndicator_=
function(){this.getProgressIndicator().css("opacity",0)};a.pkp.controllers.wizard.WizardHandler.prototype.continueRequest=function(){var b=new a.Event("wizardAdvanceRequested");this.getCurrentTab().children().first().trigger(b);b.isDefaultPrevented()||this.advanceOrClose_();return!1};a.pkp.controllers.wizard.WizardHandler.prototype.formValid=function(){this.enableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.formInvalid=function(){this.disableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.formSubmitted=
function(){this.advanceOrClose_()};a.pkp.controllers.wizard.WizardHandler.prototype.cancelRequest=function(){this.checkForm_(!1);var b=new a.Event("wizardCancelRequested");this.getCurrentTab().children().first().trigger(b);b.isDefaultPrevented()||this.trigger("wizardCancel");return!1};a.pkp.controllers.wizard.WizardHandler.prototype.wizardCancelRequested=function(){return this.checkForm_(!0)?!1:!0};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvanceRequested=function(a,c){var d=this.getForm_();
d&&(d.submit()&&(this.disableContinueButton(),this.showProgressIndicator_()),c.preventDefault())};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvance=function(){var a=this.getCurrentStep(),c=this.getNumberOfSteps()-1,d=a+1,e;if(d>c)throw Error("Trying to set an invalid wizard step!");e=this.getHtmlElement();e.tabs("enable",d);e.tabs("option","active",d);this.enforceLinear_&&e.tabs("disable",a);a=this.getContinueButton();d===c&&a.text(this.getFinishButtonText());this.hideProgressIndicator_();
this.enableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.startWizard=function(){var a=this.getHtmlElement(),c,d;0!==this.getCurrentStep()&&(a.tabs("enable",0),a.tabs("option","active",0),c=this.getContinueButton(),c.text(this.getContinueButtonText()));if(this.enforceLinear_){c=[];for(d=1;d<this.getNumberOfSteps();d++)c.push(d);a.tabs("option","disabled",c)}};a.pkp.controllers.wizard.WizardHandler.prototype.bindWizardEvents=function(){this.bind("wizardCancelRequested",this.wizardCancelRequested);
this.bind("wizardAdvanceRequested",this.wizardAdvanceRequested);this.bind("wizardAdvance",this.wizardAdvance)};a.pkp.controllers.wizard.WizardHandler.prototype.getCurrentStep=function(){return this.getCurrentTabIndex()};a.pkp.controllers.wizard.WizardHandler.prototype.getContinueButton=function(){return this.$continueButton_};a.pkp.controllers.wizard.WizardHandler.prototype.getProgressIndicator=function(){return this.$progressIndicator_};a.pkp.controllers.wizard.WizardHandler.prototype.getContinueButtonText=
function(){return this.continueButtonText_};a.pkp.controllers.wizard.WizardHandler.prototype.getFinishButtonText=function(){return this.finishButtonText_};a.pkp.controllers.wizard.WizardHandler.prototype.getNumberOfSteps=function(){return this.getHtmlElement().find("ul").first().children().length};a.pkp.controllers.wizard.WizardHandler.prototype.getForm_=function(){var b,c,d;d=this.getCurrentTab().children();for(b=0;b<d.length;b++)if(c=a(d[b]),c.is("form"))return c;return null};a.pkp.controllers.wizard.WizardHandler.prototype.advanceOrClose_=
function(){var a=this.getCurrentStep(),c=this.getNumberOfSteps()-1;a<c?this.trigger("wizardAdvance"):this.trigger("wizardClose")};a.pkp.controllers.wizard.WizardHandler.prototype.checkForm_=function(b){var c=this.getForm_();if(null!==c)if(c=a.pkp.classes.Handler.getHandler(a("#"+c.attr("id"))),b){if(c.formChangesTracked)if(confirm(a.pkp.locale.form_dataHasChanged))c.unregisterForm();else return!0}else c.unregisterForm();return!1};a.pkp.controllers.wizard.WizardHandler.prototype.addWizardButtons_=
function(b,c){var d=a('<div id="wizardButtons" class="modal_buttons"></div>'),e,f;c.continueButtonText&&(e=a('<button id="continueButton" class="pkp_button"></button>').text(c.continueButtonText),d.append(e),f=a('<span class="pkp_spinner"></span>'),d.append(f),e.bind("click",this.callbackWrapper(this.continueRequest)),this.$continueButton_=e,this.$progressIndicator_=f,this.continueButtonText_=c.continueButtonText,this.finishButtonText_=c.finishButtonText?c.finishButtonText:c.continueButtonText);c.cancelButtonText&&
(e=a('<a id="cancelButton" class="cancel" href="#"></a>').text(c.cancelButtonText),d.append(e),e.bind("click",this.callbackWrapper(this.cancelRequest)));b.after(d)};a.pkp.controllers.wizard.WizardHandler.prototype.disableContinueButton=function(){this.getContinueButton().attr("disabled","disabled")};a.pkp.controllers.wizard.WizardHandler.prototype.enableContinueButton=function(){this.getContinueButton().removeAttr("disabled")}})(jQuery);(function(a){a.pkp.controllers.grid.queries=a.pkp.controllers.grid.queries||{};a.pkp.controllers.grid.queries.ReadQueryHandler=function(a,c){this.fetchNoteFormUrl_=c.fetchNoteFormUrl;this.fetchParticipantsListUrl_=c.fetchParticipantsListUrl;a.find(".openNoteForm a").click(this.callbackWrapper(this.showNoteFormHandler_));a.bind("dataChanged",this.callbackWrapper(this.reloadParticipantsList_));this.loadParticipantsList()};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.queries.ReadQueryHandler,
a.pkp.classes.Handler);a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.fetchNoteFormUrl_=null;a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.fetchParticipantsListUrl_=null;a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.loadParticipantsList=function(){a.get(this.fetchParticipantsListUrl_,this.callbackWrapper(this.showFetchedParticipantsList_),"json")};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showNoteFormHandler_=function(b){a(b).parents(".openNoteForm").addClass("is_loading");
a.get(this.fetchNoteFormUrl_,this.callbackWrapper(this.showFetchedNoteForm_),"json")};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showFetchedNoteForm_=function(b,c){var d=this.handleJson(c),e=a("#newNotePlaceholder",this.getHtmlElement()),f=a(".openNoteForm.is_loading",this.getHtmlElement());this.unbindPartial(f);f.remove();this.unbindPartial(e);e.html(d.content)};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showFetchedParticipantsList_=function(b,c){var d=this.handleJson(c),
e=a("#participantsListPlaceholder",this.getHtmlElement());this.unbindPartial(e);e.children().remove();e.append(d.content)};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.reloadParticipantsList_=function(){this.loadParticipantsList()}})(jQuery);(function(a){a.pkp.controllers.wizard.fileUpload=a.pkp.controllers.wizard.fileUpload||{};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler=function(a,c){this.parent(a,c);this.csrfToken_=c.csrfToken;this.deleteUrl_=c.deleteUrl;this.metadataUrl_=c.metadataUrl;this.finishUrl_=c.finishUrl;this.bind("fileUploaded",this.handleFileUploaded);this.bind("filesRemoved",this.handleRemovedFiles);this.disableContinueButton()};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler,
a.pkp.controllers.wizard.WizardHandler);a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.csrfToken_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.deleteUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.metadataUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.finishUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.uploadedFile_=null;a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsBeforeActivate=
function(a,c,d){if(0<d.newTab.index()){if(!this.uploadedFile_)throw Error("Uploaded file missing!");this.getHtmlElement();var e="";switch(d.newTab.index()){case 1:e=this.metadataUrl_;break;case 2:e=this.finishUrl_;break;default:throw Error("Unsupported tab index.");}e=e+"&fileId="+this.uploadedFile_.fileId;d.newTab.find(".ui-tabs-anchor").attr("href",e)}return this.parent("tabsBeforeActivate",a,c,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardAdvance=function(){var a=
this.getCurrentStep(),c=this.getNumberOfSteps()-1,d=a+1,e=this.getHtmlElement();if(d>c)throw Error("Trying to set an invalid wizard step!");e.tabs("enable",d);e.tabs("option","active",d);0===a&&e.tabs("disable",a);d===c&&(a=this.getContinueButton(),a.text(this.getFinishButtonText()),this.enableContinueButton())};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsLoad=function(b,c,d){var e=this.getHtmlElement(),f=this.getProgressIndicator();2===d.tab.index()&&(e=a("#newFile",
e),e.length&&e.bind("click",this.callbackWrapper(this.startWizard)));f.hide();return this.parent("tabsLoad",b,c,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.formValid=function(a,c){0===this.getCurrentStep()&&0===this.getHtmlElement().find("#uploadConfirmationForm").length&&!this.uploadedFile_||this.parent("formValid",a,c)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelRequested=function(b,c){if(this.parent("wizardCancelRequested",b,
c))if(this.uploadedFile_)this.uploadedFile_.csrfToken=this.csrfToken_,a.post(this.deleteUrl_,this.uploadedFile_,a.pkp.classes.Helper.curry(this.wizardCancelSuccess,this,b,c),"json"),this.uploadedFile_=null,c.preventDefault();else return!0;return!1};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelSuccess=function(a,c,d){!1!==this.handleJson(d)&&this.trigger("wizardCancel")};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleFileUploaded=function(a,
c,d){this.uploadedFile_=d};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleRemovedFiles=function(b,c,d,e){var f;if("undefined"!==typeof e&&e.length)for(f in e){if("undefined"===typeof e[f].storedData)break;e[f].storedData.csrfToken=this.csrfToken_;a.post(this.deleteUrl_,e[f].storedData)}};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.startWizard=function(){this.uploadedFile_=null;this.parent("startWizard")}})(jQuery);(function(a){a.pkp.controllers.wizard.fileUpload.form=a.pkp.controllers.wizard.fileUpload.form||{};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler=function(a,c){this.parent(a,c);this.hasFileSelector_=c.hasFileSelector;this.hasGenreSelector_=c.hasGenreSelector;c.presetRevisedFileId&&(this.presetRevisedFileId_=c.presetRevisedFileId);this.fileGenres_=c.fileGenres;this.$uploader_=c.$uploader;this.attachUploader_(this.$uploader_,c.uploaderOptions);this.uploaderSetup(c.$uploader);this.$revisedFileSelector_=
a.find("#revisedFileId").change(this.callbackWrapper(this.revisedFileChange));this.hasGenreSelector_&&(this.$genreSelector=a.find("#genreId").change(this.callbackWrapper(this.genreChange)));this.setUploaderVisibility_()};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.hasFileSelector_=!1;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$revisedFileSelector_=
null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.hasGenreSelector_=!1;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$genreSelector_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.presetRevisedFileId_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.fileGenres_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$uploader_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.uploaderSetup=
function(b){b=a.pkp.classes.Handler.getHandler(b);b.pluploader.bind("BeforeUpload",this.callbackWrapper(this.prepareFileUploadRequest));b.pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse));b.pluploader.bind("FilesRemoved",this.callbackWrapper(this.handleRemovedFiles))};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.prepareFileUploadRequest=function(a,c){this.getHtmlElement();var d={};this.hasFileSelector_?(this.$revisedFileSelector_.attr("disabled",
"disabled"),d.revisedFileId=this.$revisedFileSelector_.val()):d.revisedFileId=null!==this.presetRevisedFileId_?this.presetRevisedFileId_:0;this.hasGenreSelector_?(this.$genreSelector.attr("disabled","disabled"),d.genreId=this.$genreSelector.val()):d.genreId="";c.settings.multipart_params=d};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleUploadResponse=function(b,c,d,e){b=this.handleJson(a.parseJSON(e.response));this.getHtmlElement();!1!==b&&(this.trigger("fileUploaded",
b.uploadedFile),""!==b.content&&this.replaceWith(b.content));this.getHtmlElement().valid()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleRemovedFiles=function(a,c,d){this.trigger("filesRemoved",[c,d])};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.submitForm=function(){this.trigger("formSubmitted")};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.revisedFileChange=function(){this.$revisedFileSelector_.val()?(this.$genreSelector.val(this.fileGenres_[this.$revisedFileSelector_.val()]),
this.$genreSelector.attr("disabled","disabled")):this.$genreSelector.removeAttr("disabled");this.setUploaderVisibility_();return!1};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.genreChange=function(){this.setUploaderVisibility_()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.attachUploader_=function(a,c){a.pkpHandler("$.pkp.controllers.UploaderHandler",c)};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.setUploaderVisibility_=
function(){this.hasGenreSelector_&&this.$genreSelector.val()||this.$revisedFileSelector_.val()?this.showUploader_():!this.hasGenreSelector_&&!this.hasFileSelector_?this.showUploader_():this.hideUploader_()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.hideUploader_=function(){this.$uploader_.addClass("pkp_screen_reader")};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.showUploader_=function(){this.$uploader_.removeClass("pkp_screen_reader");a.pkp.classes.Handler.getHandler(this.$uploader_).pluploader.refresh()}})(jQuery);(function(a){a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler=function(a,c){this.parent(a,c);a.find("#possibleRevision").show("slide");this.trigger("unregisterChangedForm");this.bind("wizardAdvanceRequested",this.wizardAdvanceRequested);this.trackFormChanges=!1};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler.prototype.wizardAdvanceRequested=
function(a,c){var d=this.getHtmlElement();0<parseInt(d.find("#revisedFileId").val(),10)&&(d.submit(),c.preventDefault())};a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler.prototype.handleResponse=function(a,c){!0===c.status&&this.trigger("fileUploaded",c.uploadedFile);return this.parent("handleResponse",a,c)}})(jQuery);(function(a){a.pkp.controllers.tab=a.pkp.controllers.tab||{settings:{form:{}}};a.pkp.controllers.tab.settings.form.FileViewFormHandler=function(a,c){this.parent(a,c);this.fetchFileUrl_=c.fetchFileUrl;this.bind("dataChanged",this.refreshForm_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.settings.form.FileViewFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.tab.settings.form.FileViewFormHandler.prototype.fetchFileUrl_=null;a.pkp.controllers.tab.settings.form.FileViewFormHandler.prototype.refreshForm_=
function(b,c,d){a.get(this.fetchFileUrl_,{settingName:d},this.callbackWrapper(this.refreshResponseHandler_),"json")};a.pkp.controllers.tab.settings.form.FileViewFormHandler.prototype.refreshResponseHandler_=function(a,c){var d,e=this.handleJson(c);e.noData?(d=this.getFileHtmlElement_(e.noData),this.unbindPartial(d),d.empty()):(d=this.getFileHtmlElement_(e.elementId),this.unbindPartial(d),d.html(e.content))};a.pkp.controllers.tab.settings.form.FileViewFormHandler.prototype.getFileHtmlElement_=function(b){var c=
this.getHtmlElement();return a("#"+b,c)}})(jQuery);(function(a){a.pkp.controllers.tab.settings.announcements=a.pkp.controllers.tab.settings.announcements||{form:{}};a.pkp.controllers.tab.settings.announcements.form.AnnouncementSettingsFormHandler=function(b,c){this.parent(b,c);a("#enableAnnouncementsHomepage",b).click(this.callbackWrapper(this.toggleEnableAnnouncementsHomepage))};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.settings.announcements.form.AnnouncementSettingsFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.tab.settings.announcements.form.AnnouncementSettingsFormHandler.prototype.toggleEnableAnnouncementsHomepage=
function(){var b=a("#numAnnouncementsHomepage",this.getHtmlElement());b.attr("disabled")?b.removeAttr("disabled"):b.attr("disabled","disabled")}})(jQuery);(function(a){a.pkp.controllers.tab.settings.permissions=a.pkp.controllers.tab.settings.permissions||{form:{}};a.pkp.controllers.tab.settings.permissions.form.PermissionSettingsFormHandler=function(b,c){this.parent(b,c);a("#licenseURLSelect",b).change(this.callbackWrapper(this.licenseURLSelectChange));a('input[id^="licenseURL-"]',b).keyup(this.callbackWrapper(this.licenseURLOtherChange));a('input[id^="copyrightHolderType-"]',b).change(this.callbackWrapper(this.copyrightHolderRadioSelect));a("#resetPermissionsButton",
b).button().click(this.callbackWrapper(this.resetPermissionsHandler));this.resetPermissionsUrl=c.resetPermissionsUrl;this.resetPermissionsConfirmText=c.resetPermissionsConfirmText};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.settings.permissions.form.PermissionSettingsFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.tab.settings.permissions.form.PermissionSettingsFormHandler.prototype.resetPermissionsUrl=null;a.pkp.controllers.tab.settings.permissions.form.PermissionSettingsFormHandler.prototype.resetPermissionsConfirmText=
null;a.pkp.controllers.tab.settings.permissions.form.PermissionSettingsFormHandler.prototype.licenseURLSelectChange=function(){var a=this.getHtmlElement(),c=a.find("#licenseURLSelect");a.find('input[id^="licenseURL-"]').val(c.val())};a.pkp.controllers.tab.settings.permissions.form.PermissionSettingsFormHandler.prototype.licenseURLOtherChange=function(){this.getHtmlElement().find("#licenseURLSelect").val("")};a.pkp.controllers.tab.settings.permissions.form.PermissionSettingsFormHandler.prototype.copyrightHolderRadioSelect=
function(b){var c=this.getHtmlElement(),b=a(b),c=c.find('input[id^="copyrightHolderOther-"]');"other"===b.val()?c.removeAttr("disabled"):c.attr("disabled","disabled")};a.pkp.controllers.tab.settings.permissions.form.PermissionSettingsFormHandler.prototype.resetPermissionsHandler=function(){confirm(this.resetPermissionsConfirmText)&&a.post(this.resetPermissionsUrl,{},function(){a("body").trigger("notifyUser")})}})(jQuery);(function(a){a.pkp.controllers.tab.settings.paymentMethod=a.pkp.controllers.tab.settings.paymentMethod||{};a.pkp.controllers.tab.settings.paymentMethod.PaymentMethodHandler=function(a,c){this.parent(a,c);this.paymentMethodFormUrlTemplate_=c.paymentMethodFormUrlTemplate;this.bind("selectPaymentMethod",this.selectPaymentMethodHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.settings.paymentMethod.PaymentMethodHandler,a.pkp.classes.Handler);a.pkp.controllers.tab.settings.paymentMethod.PaymentMethodHandler.prototype.paymentMethodFormUrlTemplate_=
"";a.pkp.controllers.tab.settings.paymentMethod.PaymentMethodHandler.prototype.getPaymentMethodFormUrl_=function(b){a("#paymentPluginName").val(b);return this.paymentMethodFormUrlTemplate_.replace("PAYMENT_PLUGIN_NAME",b)};a.pkp.controllers.tab.settings.paymentMethod.PaymentMethodHandler.prototype.selectPaymentMethodHandler=function(b,c,d){0!==d?a.get(this.getPaymentMethodFormUrl_(d),this.callbackWrapper(this.showFetchedPaymentMethodForm_),"json"):a("#paymentMethodFormContainer").children().remove()};
a.pkp.controllers.tab.settings.paymentMethod.PaymentMethodHandler.prototype.showFetchedPaymentMethodForm_=function(b,c){var d=this.handleJson(c),e=a("#paymentMethodFormContainer");e.children().remove();e.append(d.content)}})(jQuery);(function(a){a.pkp.controllers.grid.notifications=a.pkp.controllers.grid.notifications||{};a.pkp.controllers.grid.notifications.NotificationsGridHandler=function(a,c){a.find('a[id*="markNew"]').mousedown(this.callbackWrapper(this.markNewHandler_));a.find('a[id*="markRead"]').mousedown(this.callbackWrapper(this.markReadHandler_));a.find('a[id*="deleteNotifications"]').mousedown(this.callbackWrapper(this.deleteHandler_));this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.notifications.NotificationsGridHandler,
a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markNewUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markReadUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.deleteUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.initialize=function(a){this.markNewUrl_=a.markNewUrl;this.markReadUrl_=a.markReadUrl;this.deleteUrl_=a.deleteUrl;this.parent("initialize",
a)};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.getSelectedNotifications_=function(){var b=[];this.getHtmlElement().find("input:checkbox:checked").each(function(){b.push(a(this).val())});return b};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markNewHandler_=function(){a.post(this.markNewUrl_,{selectedElements:this.getSelectedNotifications_()},this.callbackWrapper(this.responseHandler_,null),"json");return!1};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markReadHandler_=
function(){a.post(this.markReadUrl_,{selectedElements:this.getSelectedNotifications_()},this.callbackWrapper(this.responseHandler_,null),"json");return!1};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.deleteHandler_=function(){a.post(this.deleteUrl_,{selectedElements:this.getSelectedNotifications_()},this.callbackWrapper(this.responseHandler_,null),"json");return!1};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.responseHandler_=function(a,c){var d=
this.getFetchExtraParams();d.selectedNotificationIds=c.content;this.setFetchExtraParams(d);this.handleJson(c)}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus=a.pkp.controllers.grid.navigationMenus||{form:{}};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler=function(a,c){this.okButton_=c.okButton;this.warningModalTitle_=c.warningModalTitle;this.submenuWarning_=c.submenuWarning;this.itemTypeConditionalWarnings_=c.itemTypeConditionalWarnings;a.on("click",".btnConditionalDisplay",this.callbackWrapper(this.showConditionalDisplayWarning));a.on("click",".btnSubmenuWarning",this.callbackWrapper(this.showSubmenuWarning));
this.parent(a,c);this.initSorting()};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.okButton_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.warningModalTitle_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.submenuWarning_=void 0;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.itemTypeConditionalWarnings_=
null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.initSorting=function(){var b=this;a(".btnSubmenuWarning",this.getHtmlElement()).remove();a("#pkpNavAssigned > li").each(function(){var c=a(this).children("ul"),d=c.children(),e=d.find("li");c.length?d.length?(e.length&&e.each(function(){a(this).appendTo(c)}),a(this).find("> .item > .item_buttons .btnSubmenuWarning").length||a(this).find("> .item > .item_buttons").prepend(a("<button></button>").addClass("btnSubmenuWarning").append(a("<span></span>").addClass("fa fa-exclamation-triangle")).append(a("<span></span>").addClass("-screenReader").text(b.submenuWarning_)))):
c.replaceWith("<ul></ul>"):a(this).append("<ul></ul>")});a("#pkpNavUnassigned > li").each(function(){var b=a(this).children("ul");b.length&&b.find("li").each(function(){a(this).appendTo(a("#pkpNavUnassigned"))});b.remove()});a("#pkpNavManagement ul").sortable({placeholder:"pkp_nav_item_placeholder",delay:250,connectWith:"#pkpNavManagement ul",update:this.callbackWrapper(this.updateSorting),start:function(){a("#pkpNavAssigned").addClass("pkp_is_sorting")},stop:function(){a("#pkpNavAssigned").removeClass("pkp_is_sorting")}})};
a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.updateSorting=function(){var b=a("#pkpNavManagement"),c=0,d="";this.initSorting();a("input",b).remove();a("#pkpNavAssigned > li").each(function(){d="menuTree["+a(this).data("id")+"]";b.append('<input type="hidden" name="'+d+'[seq]" value="'+c+'">');c++;var e=a(this).data("id");a(this).find("li").each(function(){d="menuTree["+a(this).data("id")+"]";b.append('<input type="hidden" name="'+d+'[seq]" value="'+c+'">');b.append('<input type="hidden" name="'+
d+'[parentId]" value="'+e+'">');c++})})};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showConditionalDisplayWarning=function(b){var b=a(b).closest("li").data("type"),c={title:this.warningModalTitle_,okButton:this.okButton_,cancelButton:!1,dialogText:this.itemTypeConditionalWarnings_[b]};null!==this.itemTypeConditionalWarnings_[b]&&a('<div id="'+a.pkp.classes.Helper.uuid()+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",
c);return!1};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showSubmenuWarning=function(){var b={title:this.warningModalTitle_,okButton:this.okButton_,cancelButton:!1,dialogText:this.submenuWarning_};a('<div id="'+a.pkp.classes.Helper.uuid()+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",b);return!1}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler=function(b,c){this.parent(b,c);this.previewUrl_=c.previewUrl;this.itemTypeDescriptions_=c.itemTypeDescriptions;this.itemTypeConditionalWarnings_=c.itemTypeConditionalWarnings;a("#previewButton",b).click(this.callbackWrapper(this.showPreview_));a("#menuItemType",b).change(this.callbackWrapper(this.setType));a("#menuItemType",b).trigger("change")};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler,
a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.previewUrl_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.itemTypeDescriptions_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.itemTypeConditionalWarnings_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.showPreview_=function(){var b=this.getHtmlElement();
a.post(this.previewUrl_,b.serialize(),function(a){var b=window.open("about:blank");b.document.open();b.document.write(a);b.document.close()});return!0};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.setType=function(){var b=a("#menuItemType",this.getHtmlElement()).val(),c=a('#menuItemTypeSection [for="menuItemType"]');a(".NMI_TYPE_CUSTOM_EDIT",this.getHtmlElement()).hide();a("#"+b).fadeIn();"undefined"!==typeof this.itemTypeDescriptions_[b]&&c.text(this.itemTypeDescriptions_[b])}})(jQuery);(function(a){a.pkp.controllers.grid.representations=a.pkp.controllers.grid.representations||{form:{}};a.pkp.controllers.grid.representations.form.RepresentationFormHandler=function(b,c){this.parent(b,c);(this.remoteRepresentation_=c.remoteRepresentation)?(a("#remotelyHostedContent").prop("checked",!0),a("#remote").show(20)):(a("#remotelyHostedContent").prop("checked",!1),a("#remote").hide(20));a("#remotelyHostedContent").change(this.callbackWrapper(this.toggleRemote_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.representations.form.RepresentationFormHandler,
a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.representations.form.RepresentationFormHandler.prototype.toggleRemote_=function(){a("#remotelyHostedContent").prop("checked")?a("#remote").show(20):(a("#remote").hide(20),a('input[id^="remoteURL"]').val(""));return!0}})(jQuery);(function(a){a.pkp.pages=a.pkp.pages||{header:{}};a.pkp.pages.header.HeaderHandler=function(a,c){this.options_=c;this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.pages.header.HeaderHandler,a.pkp.classes.Handler);a.pkp.pages.header.HeaderHandler.prototype.options_=null})(jQuery);(function(a){a.pkp.pages.header.TasksHandler=function(b,c){this.options_=c;this.parent(b,c);a("#notificationsToggle").click(this.callbackWrapper(this.appendToggleIndicator_));this.bind("updateUnreadNotificationsCount",this.fetchUnreadNotificationsCountHandler_)};a.pkp.classes.Helper.inherits(a.pkp.pages.header.TasksHandler,a.pkp.classes.Handler);a.pkp.pages.header.TasksHandler.prototype.options_=null;a.pkp.pages.header.TasksHandler.prototype.appendToggleIndicator_=function(){var a=this.getHtmlElement(),
c=a.find("#notificationsPopover"),d=a.find("#notificationsToggle");c.toggle();d.toggleClass("expandedIndicator");d.hasClass("expandedIndicator")?(this.trigger("callWhenClickOutside",[{container:a,callback:this.callbackWrapper(this.appendToggleIndicator_)}]),setTimeout(this.callbackWrapper(this.setPopoverSize_),500)):c.css("height","").css("overflow-y","")};a.pkp.pages.header.TasksHandler.prototype.setPopoverSize_=function(){var b=this.getHtmlElement().find("#notificationsPopover"),c=a(window).height()-
60;c<b.height()&&b.height(c).css("overflow-y","scroll")};a.pkp.pages.header.TasksHandler.prototype.fetchUnreadNotificationsCountHandler_=function(){a.get(this.options_.fetchUnreadNotificationsCountUrl,this.callbackWrapper(this.updateUnreadNotificationsCountHandler_),"json")};a.pkp.pages.header.TasksHandler.prototype.updateUnreadNotificationsCountHandler_=function(a,c){var d=this.getHtmlElement().find("#unreadNotificationCount");d.html(c.content);"0"==c.content?d.removeClass("hasTasks"):d.addClass("hasTasks")}})(jQuery);(function(a){a.pkp.pages.admin=a.pkp.pages.admin||{};a.pkp.pages.admin.ContextsHandler=function(b,c){var d=a("#openWizard a");d&&d.attr("style","display:none");this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.pages.admin.ContextsHandler,a.pkp.classes.Handler)})(jQuery);(function(a){a.pkp.pages.submission=a.pkp.pages.submission||{};a.pkp.pages.submission.SubmissionTabHandler=function(a,c){this.parent(a,c);this.submissionProgress_=c.submissionProgress;this.cancelUrl_=c.cancelUrl;this.cancelConfirmText_=c.cancelConfirmText;this.bind("setStep",this.setStepHandler);this.bind("formCanceled",this.formCanceledHandler);this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(this.submissionProgress_))};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionTabHandler,
a.pkp.controllers.TabHandler);a.pkp.pages.submission.SubmissionTabHandler.prototype.submissionProgress_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.cancelUrl_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.cancelConfirmText_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.setStepHandler=function(a,c,d){this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(d));this.getHtmlElement().tabs("option","active",d-1)};a.pkp.pages.submission.SubmissionTabHandler.prototype.formCanceledHandler=
function(){confirm(this.cancelConfirmText_)&&(window.location=this.cancelUrl_)};a.pkp.pages.submission.SubmissionTabHandler.prototype.getDisabledSteps=function(a){switch(parseInt(a,10)){case 0:return[];case 1:return[1,2,3,4,5];case 2:return[2,3,4,5];case 3:return[3,4,5];case 4:return[4,5];case 5:return[]}throw Error("Illegal submission step number!");}})(jQuery);(function(a){a.pkp.controllers.grid.settings=a.pkp.controllers.grid.settings||{user:{form:{}}};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler=function(b,c){this.parent(b,c);a('[id^="generatePassword"]',b).click(this.callbackWrapper(this.setGenerateRandom));a('[id^="generatePassword"]',b).attr("checked")&&this.setGenerateRandom('[id^="generatePassword"]')};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler,a.pkp.controllers.form.UserFormHandler);
a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler.prototype.submitForm=function(b,c){var d=this.getHtmlElement();a(":password",d).removeAttr("disabled");this.parent("submitForm",b,c)};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler.prototype.setGenerateRandom=function(b){var b=a(b),c=this.getHtmlElement(),d="",e=0;b.prop("checked")?(d="********",e="disabled"):e=d="";a(":password",c).prop("disabled",e).val(d);a('[id^="sendNotify"]',c).attr("disabled",e).prop("checked",
e)}})(jQuery);(function(a){a.pkp.controllers.grid.settings.roles=a.pkp.controllers.grid.settings.roles||{form:{}};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler=function(b,c){var d=a('[id^="roleId"]',b);this.parent(b,c);c.selfRegistrationRoleIds&&(this.selfRegistrationRoleIds_=c.selfRegistrationRoleIds);c.recommendOnlyRoleIds&&(this.recommendOnlyRoleIds_=c.recommendOnlyRoleIds);this.roleForbiddenStages_=c.roleForbiddenStagesJSON.content;this.stagesSelector_=c.stagesSelector;this.updatePermitSelfRegistration(d.val());
this.updateStageOptions(d.val());this.updateRecommendOnly(d.val());d.change(this.callbackWrapper(this.changeRoleId))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.selfRegistrationRoleIds_=null;a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.roleForbiddenStages_=null;a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.stagesSelector_=
null;a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.changeRoleId=function(b){b=a(b).val();this.updatePermitSelfRegistration(b);this.updateStageOptions(b);this.updateRecommendOnly(b)};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updatePermitSelfRegistration=function(b){var c=a('[id^="permitSelfRegistration"]');this.getHtmlElement();var d,e=!1;for(d=0;d<this.selfRegistrationRoleIds_.length;d++)this.selfRegistrationRoleIds_[d]==b&&(e=!0);e?c.removeAttr("disabled"):
(c.attr("disabled","disabled"),c.removeAttr("checked"))};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updateStageOptions=function(b){var c=this.getHtmlElement(),d=c.find("#userGroupStageContainer"),e=a(this.stagesSelector_,c).filter("input"),f,h=null;e.removeAttr("disabled");if(void 0!=this.roleForbiddenStages_[b])for(f=0;f<this.roleForbiddenStages_[b].length;f++)h=this.roleForbiddenStages_[b][f],e.filter('input[value="'+h+'"]').attr("disabled","disabled");0==c.find("input[id^='assignedStages-']:enabled").length?
(d.hide("slow"),a("#showTitle").attr("disabled","disabled")):(d.show("slow"),a("#showTitle").removeAttr("disabled"))};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updateRecommendOnly=function(b){var c=a("[id^='recommendOnly']",this.getHtmlElement()),d,e=!1;for(d=0;d<this.recommendOnlyRoleIds_.length;d++)this.recommendOnlyRoleIds_[d]==b&&(e=!0);e?c.removeAttr("disabled"):(c.attr("disabled","disabled"),c.removeAttr("checked"))}})(jQuery);(function(a){a.pkp.controllers.grid.settings.metadata=a.pkp.controllers.grid.settings.metadata||{};a.pkp.controllers.grid.settings.metadata.MetadataGridHandler=function(a,c){a.find(":checkbox").change(this.callbackWrapper(this.checkboxHandler_));this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.settings.metadata.MetadataGridHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.settings.metadata.MetadataGridHandler.prototype.initialize=function(b){this.parent("initialize",
b);a(this.getHtmlElement()).find(":checkbox").change()};a.pkp.controllers.grid.settings.metadata.MetadataGridHandler.prototype.checkboxHandler_=function(b){b=a(b);b.is(":checked");var c=a(this.getHtmlElement());b.prop("name");this.getRows().each(function(){var b=a(this).prop("id").split("-").pop(),e=c.find(":checkbox[name="+b+"EnabledWorkflow]"),f=c.find(":checkbox[name="+b+"EnabledSubmission]"),b=c.find(":checkbox[name="+b+"Required]");(f.prop("checked")||b.prop("checked"))&&e.prop("checked",!0);
e.prop("readonly",f.prop("checked")||b.prop("checked"));b.prop("checked")&&f.prop("checked",!0);f.prop("readonly",b.prop("checked"))});return!1}})(jQuery);(function(a){a.pkp.controllers.tab.settings.siteAccessOptions=a.pkp.controllers.tab.settings.siteAccessOptions||{form:{}};a.pkp.controllers.tab.settings.siteAccessOptions.form.SiteAccessOptionsFormHandler=function(b,c){this.parent(b,c);a("#disableUserReg-0",b).click(this.callbackWrapper(this.changeRegOptsState));a("#disableUserReg-1",b).click(this.callbackWrapper(this.changeRegOptsState))};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.settings.siteAccessOptions.form.SiteAccessOptionsFormHandler,
a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.tab.settings.siteAccessOptions.form.SiteAccessOptionsFormHandler.prototype.changeRegOptsState=function(a){"disableUserReg-0"===a.id?this.setRegOptsDisabled_(!1):(this.setRegOptsDisabled_(!0),this.setRegOptsChecked_(!1))};a.pkp.controllers.tab.settings.siteAccessOptions.form.SiteAccessOptionsFormHandler.prototype.setRegOptsDisabled_=function(b){b?a('[id^="allow"]').attr("disabled","disabled"):a('[id^="allow"]').removeAttr("disabled")};a.pkp.controllers.tab.settings.siteAccessOptions.form.SiteAccessOptionsFormHandler.prototype.setRegOptsChecked_=
function(b){b?a('[id^="allow"]').attr("checked","checked"):a('[id^="allow"]').removeAttr("checked")}})(jQuery);(function(a){a.pkp.controllers.tab.workflow=a.pkp.controllers.tab.workflow||{};a.pkp.controllers.tab.workflow.WorkflowTabHandler=function(a,c){var d,e,f,h;this.parent(a,c);if(d=document.location.toString().match("workflow/([^/]+)/")){d=d[1];h=a.find("li a");for(f=0;f<h.length;f++)e=RegExp(d),h[f].getAttribute("class").match(e)&&(c.selected=f)}};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.workflow.WorkflowTabHandler,a.pkp.controllers.TabHandler)})(jQuery);(function(a){a.pkp.controllers.dashboard=a.pkp.controllers.dashboard||{form:{}};a.pkp.controllers.dashboard.form.DashboardTaskFormHandler=function(b,c){this.parent(b,c);this.singleContextSubmissionUrl_=c.singleContextSubmissionUrl;a("#singleContext",b).click(this.callbackWrapper(this.startSingleContextSubmission_));a("#multipleContext",b).change(this.callbackWrapper(this.startMultipleContextSubmission_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.dashboard.form.DashboardTaskFormHandler,a.pkp.controllers.form.FormHandler);
a.pkp.controllers.dashboard.form.DashboardTaskFormHandler.prototype.singleContextSubmissionUrl_=null;a.pkp.controllers.dashboard.form.DashboardTaskFormHandler.prototype.startSingleContextSubmission_=function(){window.location.href=this.singleContextSubmissionUrl_};a.pkp.controllers.dashboard.form.DashboardTaskFormHandler.prototype.startMultipleContextSubmission_=function(){var a=this.getHtmlElement().find("#multipleContext").val();0!=a&&(window.location.href=a)}})(jQuery);jQuery.pkp.controllers.informationCenter=jQuery.pkp.controllers.informationCenter||{};
(function(a){a.pkp.controllers.informationCenter.NotesHandler=function(a,c){this.parent(a,c);this.bind("noteAdded",this.handleRefreshNoteList);this.bind("noteDeleted",this.handleRefreshNoteList)};a.pkp.classes.Helper.inherits(a.pkp.controllers.informationCenter.NotesHandler,a.pkp.classes.Handler);a.pkp.controllers.informationCenter.NotesHandler.prototype.handleRefreshNoteList=function(b,c,d){a(".pkp_modal").first().scrollTop(0);this.replaceWith(d)}})(jQuery);(function(a){a.pkp.controllers.statistics=a.pkp.controllers.statistics||{};a.pkp.controllers.statistics.ReportGeneratorFormHandler=function(b,c){var d;c.trackFormChanges=!1;c.transformButtons=!1;this.parent(b,c);this.getHtmlElement().find(":submit").button();a("#reportUrlFormArea",b).hide();this.timeFilterWrapperSelector_=c.timeFilterWrapperSelector;this.rangeByDaySelector_=c.rangeByDaySelector;this.rangeByMonthSelector_=c.rangeByMonthSelector;this.startDayElementSelector_=c.startDayElementSelector;
this.endDayElementSelector_=c.endDayElementSelector;this.optionalColumns_=c.optionalColumns;this.aggregationOptionsSelector_=c.aggregationOptionsSelector;this.fetchFormUrl_=c.fetchFormUrl;this.$metricTypeSelectElement_=d=a(c.metricTypeSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));a(".pkp_loading",b).hide();this.$reportTemplateSelectElement_=d=a(c.reportTemplateSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));
this.columnsSelector_=c.columnsSelector;d=a(c.aggregationOptionsSelector);0<d.length&&d.change(this.callbackWrapper(this.aggregationOptionsChangeHandler_));d=a(c.currentMonthSelector,this.getHtmlElement()).add(c.yesterdaySelector,this.getHtmlElement()[0]);2==d.length&&d.click(this.callbackWrapper(this.currentTimeElementsClickHandler_));d=a(c.rangeByMonthSelector,this.getHtmlElement()).add(c.rangeByDaySelector,this.getHtmlElement()[0]);2==d.length&&d.click(this.callbackWrapper(this.rangeTimeElementsClickHandler_));
this.dateRangeElementsWrapper_=a(c.dateRangeWrapperSelector,this.getHtmlElement());1==d.filter("input:checked").length?d.filter("input:checked").click():this.dateRangeElementsWrapper_.hide();this.fileAssocTypes_=c.fileAssocTypes;this.$fileTypeSelectElement_=a(c.fileTypeSelectSelector,this.getHtmlElement());d=a(c.objectTypeSelectSelector,this.getHtmlElement());1==this.$fileTypeSelectElement_.length&&(this.$fileTypeSelectElement_.attr("disabled","disabled"),d.change(this.callbackWrapper(this.updateFileTypeSelectHandler_)));
d.change();this.fetchRegionsUrl_=c.fetchRegionsUrl;this.$regionSelectElement_=a(c.regionSelectSelector,this.getHtmlElement());1==this.$regionSelectElement_.length&&(d=a(c.countrySelectSelector,this.getHtmlElement()),d.change(this.callbackWrapper(this.fetchRegionHandler_)));this.addOptionalColumnsClass_()};a.pkp.classes.Helper.inherits(a.pkp.controllers.statistics.ReportGeneratorFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchFormUrl_=
null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchArticlesUrl_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.$metricTypeSelectElement_={};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.$reportTemplateSelectElement_={};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.$regionSelectElement_={};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchRegionsUrl_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.$fileAssocTypes_=
{};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.rangeByDaySelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.rangeByMonthSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.startDayElementSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.endDayElementSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.timeFilterWrapperSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.columnsSelector_=
null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.optionalColumns_={};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.aggregationOptionsSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.handleResponse=function(b,c){var d=this.handleJson(c);!1!==d&&void 0!==d.reportUrl&&(a("#reportUrlFormArea",this.getHtmlElement()).show().find(":input").val(d.reportUrl),window.location=d.reportUrl);this.parent("handleResponse",b,c);return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchFormHandler_=
function(){var b,c={};b=a(this.timeFilterWrapperSelector_,this.getHtmlElement()).serializeArray();a.each(b,function(a,b){c[b.name]=b.value});a(".pkp_loading",this.getHtmlElement()).show();b=a("option:selected",this.$metricTypeSelectElement_);void 0!==b[0]&&void 0!==b[0].value&&(c.metricType=b[0].value);b=a("option:selected",this.$reportTemplateSelectElement_);void 0!==b[0]&&void 0!==b[0].value&&(c.reportTemplate=b[0].value);c.refreshForm=!0;a.get(this.fetchFormUrl_,c,this.callbackWrapper(this.handleResponse,
null),"json");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.updateFileTypeSelectHandler_=function(b){var c,b=a(b),b=a("option:selected",b);if(1==b.length)for(c in b=b[0].value,this.fileAssocTypes_)if(this.fileAssocTypes_[c]==b)return this.$fileTypeSelectElement_.removeAttr("disabled"),!1;this.$fileTypeSelectElement_.attr("disabled","disabled");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchRegionHandler_=function(b){this.$regionSelectElement_.empty();
b=a(b);b=a("option:selected",b);1==b.length&&(b=b[0].label,a.get(this.fetchRegionsUrl_,{countryId:b},this.callbackWrapper(this.updateRegionSelectCallback_,null),"json"));return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.updateRegionSelectCallback_=function(b,c){var d,e,f,h;d=this.$regionSelectElement_;d.empty();e=this.handleJson(c);if(!1!==e){f=e.content;h=0;for(e=f.length;h<e;h++)d.append(a("<option />").val(f[h].id).text(f[h].name))}return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.currentTimeElementsClickHandler_=
function(){this.dateRangeElementsWrapper_.hide();return!0};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.rangeTimeElementsClickHandler_=function(b){var c=a(this.startDayElementSelector_).add(this.endDayElementSelector_);this.dateRangeElementsWrapper_.show();"#"+a(b).attr("id")==this.rangeByDaySelector_&&c.show();"#"+a(b).attr("id")==this.rangeByMonthSelector_&&c.hide();return!0};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.aggregationOptionsChangeHandler_=
function(b){var c;c=a(this.columnsSelector_);b=a(b);c=c.find('option[value="'+b.attr("value")+'"]');b.is(":checked")?c.attr("selected","selected"):c.removeAttr("selected");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.addOptionalColumnsClass_=function(){var b,c,d,e;d=a(this.columnsSelector_);e=a(this.aggregationOptionsSelector_);c=a("#orderByFormArea select",this.getHtmlElement());d=d.add(c);c=this.optionalColumns_;for(b in c)d.find('option[value="'+b+'"]').addClass("optionalColumn"),
e.filter('input[value="'+b+'"]').parent().addClass("optionalColumn")}})(jQuery);jQuery.pkp.pages.submission=jQuery.pkp.pages.submission||{};(function(a){a.pkp.pages.submission.SubmissionStep2FormHandler=function(a,c){this.parent(a,c);this.bind("urlInDivLoaded",this.showFileUploadWizard_)};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionStep2FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.pages.submission.SubmissionStep2FormHandler.prototype.showFileUploadWizard_=function(b,c,d){"submissionFilesGridDiv"==d&&a("#"+d).find('[id*="-addFile-button-"]').click()}})(jQuery);jQuery.pkp.pages.submission=jQuery.pkp.pages.submission||{};
(function(a){a.pkp.pages.submission.SubmissionStep3FormHandler=function(a,c){this.parent(a,c);this.bind("gridRefreshRequested",this.fetchChaptersGrid_);this.authorsGridContainer_=c.authorsGridContainer;this.chaptersGridContainer_=c.chaptersGridContainer};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionStep3FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.pages.submission.SubmissionStep3FormHandler.prototype.chaptersGridContainer_="";a.pkp.pages.submission.SubmissionStep3FormHandler.prototype.fetchChaptersGrid_=
function(b,c){c.target.id==this.authorsGridContainer_&&a("#"+this.chaptersGridContainer_).find(".pkp_controllers_grid").trigger("dataChanged")}})(jQuery);(function(a){a.pkp.pages.workflow=a.pkp.pages.workflow||{};a.pkp.pages.workflow.WorkflowHandler=function(a,c){this.parent(a,c);this.bind("stageParticipantsChanged",this.handleStageParticipantsChanged_);this.bind("dataChanged",this.dataChangedHandler_)};a.pkp.classes.Helper.inherits(a.pkp.pages.workflow.WorkflowHandler,a.pkp.classes.Handler);a.pkp.pages.workflow.WorkflowHandler.prototype.handleStageParticipantsChanged_=function(){var b,c,d,e,f=this.getHtmlElement().find(".editorDecisionActions"),h=
this.getHtmlElement().find("#submissionProgressBarDiv");this.getHtmlElement().find("#stageTabs").find("li").each(function(){if(a(this).hasClass("ui-state-active")){c=a(this).find("a").attr("class");if(b=c.match(/stageId(\d)/)){d=b[1];var f=a.pkp.classes.Handler.getHandler(h);e=f.getSourceUrl();f.setSourceUrl(e.replace(/stageId=\d/,"stageId="+d))}return!1}});f.add(h).each(function(){a.pkp.classes.Handler.getHandler(a(this)).reload()})};a.pkp.pages.workflow.WorkflowHandler.prototype.dataChangedHandler_=
function(b,c,d){b=a(c.target,this.getHtmlElement()).children("a");b.length&&b.attr("id").match(/submissionEntry/)&&(b=a('[id^="formatsGridContainer"]',this.getHtmlElement()).children("div"),b.trigger("dataChanged",[d]),b.trigger("notifyUser",[b]))}})(jQuery);(function(a){a.pkp.controllers.grid.users=a.pkp.controllers.grid.users||{};a.pkp.controllers.grid.users.UserGridHandler=function(a,c){this.parent(a,c);this.bindGlobal("userMerged",function(){this.trigger("modalFinished");this.refreshGridHandler()})};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.UserGridHandler,a.pkp.controllers.grid.GridHandler)})(jQuery);(function(a){a.pkp.controllers.grid.users.reviewer=a.pkp.controllers.grid.users.reviewer||{};a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler=function(b,c){this.parent(b,c);b.find(".button").button();a("#selectReviewerButton").click(this.callbackWrapper(this.selectReviewer));a("#regularReviewerForm").hide();this.bind("refreshForm",this.handleRefresh_);this.bindGlobal("reviewersSelected",this.updateReviewerSelection)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler,
a.pkp.classes.Handler);a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler.prototype.selectedReviewer=null;a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler.prototype.updateReviewerSelection=function(b,c){var d="",e="";c.length?(this.selectedReviewer=c[0],d=this.selectedReviewer.id,e=this.selectedReviewer.fullName):(this.selectedReviewer=null,d=e="");a("#reviewerId",this.getHtmlElement()).val(d);a('[id^="selectedReviewerName"]',this.getHtmlElement()).html(e)};a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler.prototype.selectReviewer=
function(){this.selectedReviewer&&(a("#searchGridAndButton").hide(),a("#regularReviewerForm").show())};a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler.prototype.handleRefresh_=function(a,c,d){d&&this.replaceWith(d)}})(jQuery);(function(a){a.pkp.controllers.grid.users.reviewer.ReadReviewHandler=function(a,c){this.parent(a,c);this.reviewCompleted_=c.reviewCompleted;a.find("[id^='submitFormButton-']").click(this.callbackWrapper(this.reviewFilesRequired_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.reviewer.ReadReviewHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.users.reviewer.ReadReviewHandler.prototype.reviewCompleted_=!1;a.pkp.controllers.grid.users.reviewer.ReadReviewHandler.prototype.reviewFilesRequired_=
function(){if(!this.reviewCompleted_&&1==a("#readReviewAttachmentsGridContainer").find("tbody.empty:visible").length)return this.showWarning_(),!1;this.hideWarning_();return!0};a.pkp.controllers.grid.users.reviewer.ReadReviewHandler.prototype.hideWarning_=function(){this.getHtmlElement().find("#noFilesWarning").hide(250)};a.pkp.controllers.grid.users.reviewer.ReadReviewHandler.prototype.showWarning_=function(){this.getHtmlElement().find("#noFilesWarning").show(250)}})(jQuery);(function(a){a.pkp.controllers.grid.users.reviewer.form=a.pkp.controllers.grid.users.reviewer.form||{};a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler=function(a,c){this.parent(a,c);a.change(this.callbackWrapper(this.handleFormChange));this.bind("urlInDivLoaded",this.handleFileListLoad_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler,a.pkp.controllers.form.UserFormHandler);a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler.prototype.handleFormChange=
function(){this.getHtmlElement().find('input[name="selectedFiles[]"]:checked').length?this.hideWarning():this.showWarning()};a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler.prototype.hideWarning=function(){this.getHtmlElement().find("#noFilesWarning").hide(250)};a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler.prototype.showWarning=function(){this.getHtmlElement().find("#noFilesWarning").show(250)};a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler.prototype.handleFileListLoad_=
function(){this.getHtmlElement().change()}})(jQuery);(function(a){a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler=function(a,c){this.parent(a,c);c.templateUrl&&(this.templateUrl_=c.templateUrl);a.find("#template").change(this.callbackWrapper(this.selectTemplateHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler,a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler);a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.templateUrl_=null;a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.showWarning=
function(){this.parent("showWarning");this.getHtmlElement().find("#reviewerFormFooter").trigger("expandFileList")};a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.selectTemplateHandler_=function(){var b=this.getHtmlElement();a.post(this.templateUrl_,b.find("#template").serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.updateTemplate=function(a,c){var d=this.getHtmlElement(),e=this.handleJson(c),
d=d.find('textarea[name="personalMessage"]'),d=tinyMCE.EditorManager.get(d.attr("id"));!1!==e&&""!==e.content&&d.setContent(e.content);return e.status}})(jQuery);(function(a){a.pkp.controllers.grid.users.stageParticipant=a.pkp.controllers.grid.users.stageParticipant||{};a.pkp.controllers.grid.users.stageParticipant.StageParticipantGridHandler=function(b,c){this.parent(b,c);this.bind("dataChanged",function(){this.refreshGridHandler();a("#submissionEditorDecisionsDiv,#copyeditingEditorDecisionsDiv,[id^=reviewDecisionsDiv]").each(function(){a.pkp.classes.Handler.getHandler(a(this)).reload()})})};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.stageParticipant.StageParticipantGridHandler,
a.pkp.controllers.grid.CategoryGridHandler)})(jQuery);(function(a){a.pkp.controllers.grid.users.stageParticipant.form=a.pkp.controllers.grid.users.stageParticipant.form||{};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler=function(b,c){this.parent(b,c);c.templateUrl&&(this.templateUrl_=c.templateUrl);c.possibleRecommendOnlyUserGroupIds&&(this.possibleRecommendOnlyUserGroupIds_=c.possibleRecommendOnlyUserGroupIds);c.recommendOnlyUserGroupIds&&(this.recommendOnlyUserGroupIds_=c.recommendOnlyUserGroupIds);c.blindReviewerIds&&
(this.blindReviewerIds_=c.blindReviewerIds);c.blindReviewerWarning&&(this.blindReviewerWarning_=c.blindReviewerWarning);c.blindReviewerWarningOk&&(this.blindReviewerWarningOk_=c.blindReviewerWarningOk);a("input[name='userGroupId'], input[name='userIdSelected']",b).change(this.callbackWrapper(this.updateRecommendOnly));a("input[name='userIdSelected']",b).change(this.callbackWrapper(this.maybeTriggerReviewerWarning));b.find("#template").change(this.callbackWrapper(this.selectTemplateHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler,
a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.templateUrl_=null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.blindReviewerIds_=null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.blindReviewerWarning_=null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.blindReviewerWarningOk_=null;
a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.selectTemplateHandler_=function(){var b=this.getHtmlElement();a.post(this.templateUrl_,b.find("#template").serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.updateTemplate=function(a,c){var d=this.getHtmlElement(),e=this.handleJson(c),f=c.content,d=d.find('textarea[name="message"]'),h=tinyMCE.EditorManager.get(d.attr("id"));
f.variables&&d.attr("data-variables",JSON.stringify(f.variables));h.setContent(f.body);return e.status};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.updateRecommendOnly=function(b){var c=this.getHtmlElement(),d=c.find("input[name='userGroupId']"),e=c.find("input[id^='recommendOnly']"),c=c.find(".recommendOnlyWrapper"),d=d.val();if("userGroupId"==a(b).prop("name"))e.attr("disabled","disabled"),e.removeAttr("checked"),c.hide();else if("userIdSelected"==
a(b).prop("name")&&!c.is(":visible"))for(b=0;b<this.possibleRecommendOnlyUserGroupIds_.length;b++)if(this.possibleRecommendOnlyUserGroupIds_[b]==d){e.removeAttr("disabled");c.show();for(b=0;b<this.recommendOnlyUserGroupIds_.length;b++)if(this.recommendOnlyUserGroupIds_[b]==d){e.prop("checked",!0);break}break}};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.maybeTriggerReviewerWarning=function(b){if((b=a(b).val())&&!(0>this.blindReviewerIds_.indexOf(b)))b=
{title:"",okButton:this.blindReviewerWarningOk_,cancelButton:!1,dialogText:this.blindReviewerWarning_},a('<div id="'+a.pkp.classes.Helper.uuid()+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",b)};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.handleResponse=function(b,c){var d=a("#queriesGrid .pkp_controllers_grid");a.pkp.classes.Handler.hasHandler(d)&&a.pkp.classes.Handler.getHandler(d).trigger("dataChanged");
return this.parent("handleResponse",b,c)}})(jQuery);(function(a){a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler=function(b,c){this.parent(b,c);a("select[name^='filterUserGroupId']",b).change(this.callbackWrapper(this.addUserGroupId));a("input[name='userId']").click(function(){var b=a("input[name='userId']:checked").val();a("input[name='userIdSelected']").val(b).trigger("change")});this.addUserGroupId()};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler,a.pkp.controllers.form.ClientFormHandler);
a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler.prototype.addUserGroupId=function(){var b=this.getHtmlElement().find("select[name^='filterUserGroupId']").val();a("input[name='userGroupId']").val(b).trigger("change")}})(jQuery);(function(a){a.pkp.pages.reviewer=a.pkp.pages.reviewer||{};a.pkp.pages.reviewer.ReviewerTabHandler=function(a,c){this.parent(a,c);this.reviewStep_=c.reviewStep;this.bind("setStep",this.setStepHandler);this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(this.reviewStep_))};a.pkp.classes.Helper.inherits(a.pkp.pages.reviewer.ReviewerTabHandler,a.pkp.controllers.TabHandler);a.pkp.pages.reviewer.ReviewerTabHandler.prototype.reviewStep_=null;a.pkp.pages.reviewer.ReviewerTabHandler.prototype.setStepHandler=
function(a,c,d){this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(d));this.getHtmlElement().tabs("option","active",d-1)};a.pkp.pages.reviewer.ReviewerTabHandler.prototype.getDisabledSteps=function(a){switch(a){case 1:return[1,2,3];case 2:return[2,3];case 3:return[3];case 4:return[]}throw Error("Illegal review step number.");}})(jQuery);(function(a){a.pkp.pages.authorDashboard=a.pkp.pages.authorDashboard||{};a.pkp.pages.authorDashboard.SubmissionEmailHandler=function(a,c){this.parent(a,c);a.find('a[id^="submissionEmail"]').click(this.callbackWrapper(this.activateAction))};a.pkp.classes.Helper.inherits(a.pkp.pages.authorDashboard.SubmissionEmailHandler,a.pkp.controllers.linkAction.LinkActionHandler)})(jQuery);(function(a){a.pkp.controllers.grid.content=a.pkp.controllers.grid.content||{spotlights:{form:{}}};a.pkp.controllers.grid.content.spotlights.form.SpotlightFormHandler=function(b,c){this.parent(b,c);this.autocompleteUrl_=c.autocompleteUrl;a('[id^="assocId_input"]',b).keyup(this.callbackWrapper(this.addNameToAutocompleteUrl))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.content.spotlights.form.SpotlightFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.content.spotlights.form.SpotlightFormHandler.prototype.autocompleteUrl_=
null;a.pkp.controllers.grid.content.spotlights.form.SpotlightFormHandler.prototype.addNameToAutocompleteUrl=function(b){var c=this.getHtmlElement().find("#assocId_container"),c=a.pkp.classes.Handler.getHandler(c),d=this.autocompleteUrl_.replace("/(&name=[^&]*)/",""),d=d+("&name="+encodeURIComponent(b.value));c.setAutocompleteUrl(d)}})(jQuery);(function(a){a.pkp.controllers.modals.editorDecision.ApproveProofsHandler=function(a,c){this.parent(a,c);this.bind("gridRefreshRequested",this.callbackWrapper(function(){this.trigger("dataChanged")}))};a.pkp.classes.Helper.inherits(a.pkp.controllers.modals.editorDecision.ApproveProofsHandler,a.pkp.classes.Handler)})(jQuery);(function(a){a.pkp.controllers.modals.catalogEntry=a.pkp.controllers.modals.catalogEntry||{form:{}};a.pkp.controllers.modals.catalogEntry.form.RepresentativeFormHandler=function(a,c){this.parent(a,c);a.find(":radio").change(this.callbackWrapper(this.radioToggleHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.modals.catalogEntry.form.RepresentativeFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.modals.catalogEntry.form.RepresentativeFormHandler.prototype.radioToggleHandler_=
function(a){var c=this.getHtmlElement();"agent"==a.id?(c.find("#agentRole").parent().removeClass("hidden"),c.find("#agentRole").show(),c.find("#supplierRole").hide()):"supplier"==a.id&&(c.find("#agentRole").hide(),c.find("#supplierRole").parent().removeClass("hidden"),c.find("#supplierRole").show())}})(jQuery);(function(a){a.pkp.controllers.modals.catalogEntry.form.PublicationFormatMetadataFormHandler=function(a,c){this.parent(a,c);a.find("#override").click(this.callbackWrapper(this.overrideToggleHandler_));a.find("#override").triggerHandler("click")};a.pkp.classes.Helper.inherits(a.pkp.controllers.modals.catalogEntry.form.PublicationFormatMetadataFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.modals.catalogEntry.form.PublicationFormatMetadataFormHandler.prototype.overrideToggleHandler_=
function(b){var c=this.getHtmlElement().find('[id^="fileSize"]');a(b).is(":checked")?c.attr("disabled",""):c.attr("disabled","disabled")}})(jQuery);(function(a){a.pkp.controllers.grid.files=a.pkp.controllers.grid.files||{proof:{form:{}}};a.pkp.controllers.grid.files.proof.form.ApprovedProofFormHandler=function(b,c){this.parent(b,c);this.salesType_=c.salesType;b.find("#notAvailable, #openAccess, #directSales").click(this.callbackWrapper(this.checkHandler_));var d=a('input[id^="price"]');d.on("change keyup paste",this.callbackWrapper(this.changeHandler_));""!==this.salesType_&&(""===d.attr("value")?(a("#notAvailable").attr("checked","true"),d.attr("disabled",
"true")):"0"===d.attr("value")?(a("#openAccess").attr("checked","true"),d.attr("disabled","true").attr("value","")):a("#directSales").attr("checked","true"))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.files.proof.form.ApprovedProofFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.files.proof.form.ApprovedProofFormHandler.prototype.salesType_=null;a.pkp.controllers.grid.files.proof.form.ApprovedProofFormHandler.prototype.checkHandler_=function(b){var c=a('input[id^="price"]');
"directSales"===a(b).attr("id")?(c.removeAttr("disabled"),""===c.val()?this.disableFormControls():this.enableFormControls()):(c.attr("disabled","true"),this.enableFormControls());return!0};a.pkp.controllers.grid.files.proof.form.ApprovedProofFormHandler.prototype.changeHandler_=function(b){b=a(b);""===b.val()||isNaN(b.val())?this.disableFormControls():this.enableFormControls();return!0}})(jQuery);(function(a){a.pkp.controllers.tab.catalogEntry=a.pkp.controllers.tab.catalogEntry||{};a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler=function(a,c){c.selectedFormatId&&(c.selected=this.getTabPositionByFormatId_(c.selectedFormatId,a));this.parent(a,c);this.bind("gridRefreshRequested",this.gridRefreshRequested);c.tabsUrl&&(this.tabsUrl_=c.tabsUrl);c.tabContentUrl&&(this.tabContentUrl_=c.tabContentUrl);this.bind("gridInitialized",this.addFormatsGridRowActionHandlers_);this.publishEvent("gridInitialized")};
a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler,a.pkp.controllers.TabHandler);a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler.prototype.tabContentUrl_=null;a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler.prototype.gridRefreshRequested=function(b,c){var d=a(c.target);d.attr("id").match(/^formatsGridContainer/)&&(this.tabsUrl_&&this.tabContentUrl_)&&(this.getHtmlElement(),a.get(this.tabsUrl_,null,this.callbackWrapper(this.updateTabsHandler_),
"json"));d.attr("id").match(/approvedProofGrid/)&&this.trigger("dataChanged")};a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler.prototype.updateTabsHandler_=function(a,c){var d=this.handleJson(c),e=this.getHtmlElement(),f=e.find("li a"),h={},j=/publication(\d+)/,i,n,k;for(n=0;n<f.length;n++)k=f[n].getAttribute("id"),k=j.exec(k),null!==k&&(h[k[1]]=n);for(i in d.formats)h.hasOwnProperty(i)||(f=this.tabContentUrl_+"&representationId="+encodeURIComponent(i),f=f.replace(/[$]/g,"$$$$"),e.tabs("add",
f,d.formats[i]),e.find("li a").filter(":last").attr("id","publication"+i));for(i in h)d.formats.hasOwnProperty(i)?e.find("li a").filter('[id="publication'+i+'"]').html(d.formats[i]):e.tabs("remove",h[i])};a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler.prototype.addFormatsGridRowActionHandlers_=function(){var b=a('[id^="formatsGridContainer"]',this.getHtmlElement());b.length&&(b=a('a[id*="publicationFormatTab"]',b),b.click(this.callbackWrapper(this.formatsGridLinkClickHandler_)))};a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler.prototype.formatsGridLinkClickHandler_=
function(b){var c=a('[id^="formatsGridContainer"]',this.getHtmlElement()).children("div"),c=a.pkp.classes.Handler.getHandler(c),b=c.getParentRow(a(b)),b=c.getRowDataId(b);this.getHtmlElement().tabs({active:this.getTabPositionByFormatId_(b,this.getHtmlElement())})};a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler.prototype.getTabPositionByFormatId_=function(b,c){var d=a("#publication"+b,c).parent("li");return d.length?c.find("li").index(d):null};a.pkp.controllers.tab.catalogEntry.CatalogEntryTabHandler.prototype.tabsReloadRequested=
function(b,c,d){var e=this.getHtmlElement();a.get(d.tabsUrl,function(b){b=a.parseJSON(b);e.prev("div").remove();e.replaceWith(b.content)})}})(jQuery);(function(a){a.pkp.controllers.catalog=a.pkp.controllers.catalog||{form:{}};a.pkp.controllers.catalog.form.CatalogMetadataFormHandler=function(b,c){this.parent(b,c);c.workTypeEditedVolume&&(this.workTypeEditedVolume_=c.workTypeEditedVolume);c.workTypeAuthoredWork&&(this.workTypeAuthoredWork_=c.workTypeAuthoredWork);a("#workType",b).change(this.callbackWrapper(this.toggleVolumeEditors));a("#audienceRangeExact",b).change(this.callbackWrapper(this.ensureValidAudienceRanges_));c.arePermissionsAttached&&
b.find("#attachPermissions").prop("checked",!0);this.coverImageMessage_=c.coverImageMessage;a('input[id^="copyrightHolder-"]',b).keyup(this.callbackWrapper(this.checkAttachMetadata));a('input[id^="copyrightYear-"]',b).keyup(this.callbackWrapper(this.checkAttachMetadata));a('input[id^="licenseURL-"]',b).keyup(this.callbackWrapper(this.checkAttachMetadata));a('input[id="confirm"]',b).change(function(){this.checked&&a("#attachPermissions").prop("checked",!0)});this.bind("fileUploaded",this.callbackWrapper(this.handleCoverImageUpload))};
a.pkp.classes.Helper.inherits(a.pkp.controllers.catalog.form.CatalogMetadataFormHandler,a.pkp.controllers.form.FileUploadFormHandler);a.pkp.controllers.catalog.form.CatalogMetadataFormHandler.prototype.audienceValues_=null;a.pkp.controllers.catalog.form.CatalogMetadataFormHandler.prototype.coverImageMessage_=null;a.pkp.controllers.catalog.form.CatalogMetadataFormHandler.prototype.workTypeEditedVolume_=null;a.pkp.controllers.catalog.form.CatalogMetadataFormHandler.prototype.workTypeAuthoredWork_=null;
a.pkp.controllers.catalog.form.CatalogMetadataFormHandler.prototype.ensureValidAudienceRanges_=function(b){var c=this.getHtmlElement();""!==a(b).val()?(this.audienceValues_=[c.find("#audienceRangeFrom").val(),c.find("#audienceRangeTo").val()],c.find("#audienceRangeFrom, #audienceRangeTo").val("").attr("disabled","disabled")):(c.find("#audienceRangeFrom, #audienceRangeTo").attr("disabled",""),c.find("#audienceRangeFrom").val(this.audienceValues_[0]),c.find("#audienceRangeTo").val(this.audienceValues_[1]))};
a.pkp.controllers.catalog.form.CatalogMetadataFormHandler.prototype.checkAttachMetadata=function(){this.getHtmlElement().find("#attachPermissions").prop("checked",!0)};a.pkp.controllers.catalog.form.CatalogMetadataFormHandler.prototype.handleCoverImageUpload=function(){var a=this.getHtmlElement().find(".currentCoverImage").addClass("changed");a.find("img").remove();a.find(".coverImageMessage").html(this.coverImageMessage_)};a.pkp.controllers.catalog.form.CatalogMetadataFormHandler.prototype.toggleVolumeEditors=
function(b){var b=a(b),c=a("#volumeEditors",this.getHtmlElement());b.val()==this.workTypeEditedVolume_?c.fadeIn():c.fadeOut()}})(jQuery);(function(a){a.pkp.controllers.monographList=a.pkp.controllers.monographList||{};a.pkp.controllers.monographList.MonographListHandler=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.monographList.MonographListHandler,a.pkp.classes.Handler);a.pkp.controllers.monographList.MonographListHandler.prototype.getMonographs=function(){throw Error("Method must be implemented by subclasses.");};a.pkp.controllers.monographList.MonographListHandler.prototype.formatList=function(){for(var a=
this.getMonographs(),c=a.first().width()+10,d=this.getHtmlElement().width(),c=Math.floor(d/c),d=0;d<a.size();d+=c)a.slice(d,d+c).equalizeElementHeights()}})(jQuery);(function(a){a.fn.pkpHandler=function(b,c){this.each(function(){var d=a(this);c=c||{};a.pkp.classes.Helper.objectFactory(b,[d,c])});return this};a.fn.pkpAjaxHtml=function(b,c){var d=this.first();a.ajax({url:b,dataType:"json",success:function(a){d.find("#loading").hide();!0===a.status?(a.content&&d.html(a.content),c&&c()):(d.trigger("ajaxHtmlError",a.content),alert(a.content))},error:function(){alert("Failed Ajax request or invalid JSON returned.")}});d.html("<div id='loading' class='throbber'></div>");
return this}})(jQuery);