(function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a("undefined"!=typeof jQuery?jQuery:window.Zepto)})(function(a){function c(c){var b=c.data;c.isDefaultPrevented()||(c.preventDefault(),a(c.target).ajaxSubmit(b))}function b(c){var b=c.target,d=a(b);if(!d.is("[type=submit],[type=image]")){b=d.closest("[type=submit]");if(0===b.length)return;b=b[0]}var e=this;e.clk=b;"image"==b.type&&(void 0!==c.offsetX?(e.clk_x=c.offsetX,e.clk_y=c.offsetY):"function"==typeof a.fn.offset?(d=d.offset(),
e.clk_x=c.pageX-d.left,e.clk_y=c.pageY-d.top):(e.clk_x=c.pageX-b.offsetLeft,e.clk_y=c.pageY-b.offsetTop));setTimeout(function(){e.clk=e.clk_x=e.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(c):window.opera&&window.opera.postError&&window.opera.postError(c)}}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(c){function b(e){function f(a){var c=null;try{a.contentWindow&&(c=a.contentWindow.document)}catch(b){d("cannot get iframe.contentWindow document: "+b)}if(c)return c;try{c=a.contentDocument?a.contentDocument:a.document}catch(e){d("cannot get iframe.contentDocument: "+e),c=a.document}return c}function g(){function c(){try{var a=f(m).readyState;d("state = "+
a);a&&"uninitialized"==a.toLowerCase()&&setTimeout(c,50)}catch(b){d("Server abort: ",b," (",b.name,")"),v(I),G&&clearTimeout(G),G=void 0}}var b=p.attr2("target"),e=p.attr2("action"),B=p.attr("enctype")||p.attr("encoding")||"multipart/form-data";u.setAttribute("target",y);(!l||/post/i.test(l))&&u.setAttribute("method","POST");e!=i.url&&u.setAttribute("action",i.url);!i.skipEncodingOverride&&(!l||/post/i.test(l))&&p.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});i.timeout&&(G=
setTimeout(function(){E=!0;v(O)},i.timeout));var h=[];try{if(i.extraData)for(var C in i.extraData)i.extraData.hasOwnProperty(C)&&(a.isPlainObject(i.extraData[C])&&i.extraData[C].hasOwnProperty("name")&&i.extraData[C].hasOwnProperty("value")?h.push(a('<input type="hidden" name="'+i.extraData[C].name+'">').val(i.extraData[C].value).appendTo(u)[0]):h.push(a('<input type="hidden" name="'+C+'">').val(i.extraData[C]).appendTo(u)[0]));i.iframeTarget||n.appendTo("body");m.attachEvent?m.attachEvent("onload",
v):m.addEventListener("load",v,!1);setTimeout(c,15);try{u.submit()}catch(z){document.createElement("form").submit.apply(u)}}finally{u.setAttribute("action",e),u.setAttribute("enctype",B),b?u.setAttribute("target",b):p.removeAttr("target"),a(h).remove()}}function v(c){if(!q.aborted&&!P)if(z=f(m),z||(d("cannot access response document"),c=I),c===O&&q)q.abort("timeout"),B.reject(q,"timeout");else if(c==I&&q)q.abort("server abort"),B.reject(q,"error","server abort");else if(z&&z.location.href!=i.iframeSrc||
E){m.detachEvent?m.detachEvent("onload",v):m.removeEventListener("load",v,!1);var c="success",b;try{if(E)throw"timeout";var e="xml"==i.dataType||z.XMLDocument||a.isXMLDoc(z);d("isXml="+e);if(!e&&(window.opera&&(null===z.body||!z.body.innerHTML))&&--T){d("requeing onLoad callback, DOM not available");setTimeout(v,250);return}var g=z.body?z.body:z.documentElement;q.responseText=g?g.innerHTML:null;q.responseXML=z.XMLDocument?z.XMLDocument:z;e&&(i.dataType="xml");q.getResponseHeader=function(a){return{"content-type":i.dataType}[a.toLowerCase()]};
g&&(q.status=Number(g.getAttribute("status"))||q.status,q.statusText=g.getAttribute("statusText")||q.statusText);var h=(i.dataType||"").toLowerCase(),j=/(json|script|text)/.test(h);if(j||i.textarea){var u=z.getElementsByTagName("textarea")[0];if(u)q.responseText=u.value,q.status=Number(u.getAttribute("status"))||q.status,q.statusText=u.getAttribute("statusText")||q.statusText;else if(j){var x=z.getElementsByTagName("pre")[0],l=z.getElementsByTagName("body")[0];x?q.responseText=x.textContent?x.textContent:
x.innerText:l&&(q.responseText=l.textContent?l.textContent:l.innerText)}}else"xml"==h&&(!q.responseXML&&q.responseText)&&(q.responseXML=s(q.responseText));try{var e=q,g=i,p=e.getResponseHeader("content-type")||"",y="xml"===h||!h&&0<=p.indexOf("xml"),w=y?e.responseXML:e.responseText;y&&"parsererror"===w.documentElement.nodeName&&a.error&&a.error("parsererror");g&&g.dataFilter&&(w=g.dataFilter(w,h));"string"===typeof w&&("json"===h||!h&&0<=p.indexOf("json")?w=A(w):("script"===h||!h&&0<=p.indexOf("javascript"))&&
a.globalEval(w));C=w}catch(r){c="parsererror",q.error=b=r||c}}catch(t){d("error caught: ",t),c="error",q.error=b=t||c}q.aborted&&(d("upload aborted"),c=null);q.status&&(c=200<=q.status&&300>q.status||304===q.status?"success":"error");"success"===c?(i.success&&i.success.call(i.context,C,"success",q),B.resolve(q.responseText,"success",q),k&&a.event.trigger("ajaxSuccess",[q,i])):c&&(void 0===b&&(b=q.statusText),i.error&&i.error.call(i.context,q,c,b),B.reject(q,"error",b),k&&a.event.trigger("ajaxError",
[q,i,b]));k&&a.event.trigger("ajaxComplete",[q,i]);k&&!--a.active&&a.event.trigger("ajaxStop");i.complete&&i.complete.call(i.context,q,c);P=!0;i.timeout&&clearTimeout(G);setTimeout(function(){i.iframeTarget?n.attr("src",i.iframeSrc):n.remove();q.responseXML=null},100)}}var u=p[0],x,i,k,y,n,m,q,E,G,B=a.Deferred();B.abort=function(a){q.abort(a)};if(e)for(x=0;x<r.length;x++)e=a(r[x]),h?e.prop("disabled",!1):e.removeAttr("disabled");i=a.extend(!0,{},a.ajaxSettings,c);i.context=i.context||i;y="jqFormIO"+
(new Date).getTime();i.iframeTarget?(n=a(i.iframeTarget),(x=n.attr2("name"))?y=x:n.attr2("name",y)):(n=a('<iframe name="'+y+'" src="'+i.iframeSrc+'" />'),n.css({position:"absolute",top:"-1000px",left:"-1000px"}));m=n[0];q={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(c){var b="timeout"===c?"timeout":"aborted";d("aborting upload... "+b);this.aborted=1;try{m.contentWindow.document.execCommand&&
m.contentWindow.document.execCommand("Stop")}catch(e){}n.attr("src",i.iframeSrc);q.error=b;i.error&&i.error.call(i.context,q,b,c);k&&a.event.trigger("ajaxError",[q,i,b]);i.complete&&i.complete.call(i.context,q,b)}};(k=i.global)&&0===a.active++&&a.event.trigger("ajaxStart");k&&a.event.trigger("ajaxSend",[q,i]);if(i.beforeSend&&!1===i.beforeSend.call(i.context,q,i))return i.global&&a.active--,B.reject(),B;if(q.aborted)return B.reject(),B;if(e=u.clk)if((x=e.name)&&!e.disabled)i.extraData=i.extraData||
{},i.extraData[x]=e.value,"image"==e.type&&(i.extraData[x+".x"]=u.clk_x,i.extraData[x+".y"]=u.clk_y);var O=1,I=2,e=a("meta[name=csrf-token]").attr("content");if((x=a("meta[name=csrf-param]").attr("content"))&&e)i.extraData=i.extraData||{},i.extraData[x]=e;i.forceSync?g():setTimeout(g,10);var C,z,T=50,P,s=a.parseXML||function(a,c){window.ActiveXObject?(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(a)):c=(new DOMParser).parseFromString(a,"text/xml");return c&&c.documentElement&&
"parsererror"!=c.documentElement.nodeName?c:null},A=a.parseJSON||function(a){return window.eval("("+a+")")};return B}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var l,k,p=this;"function"==typeof c?c={success:c}:void 0===c&&(c={});l=c.type||this.attr2("method");k=c.url||this.attr2("action");(k=(k="string"===typeof k?a.trim(k):"")||window.location.href||"")&&(k=(k.match(/^([^#]+)/)||[])[1]);c=a.extend(!0,{url:k,success:a.ajaxSettings.success,type:l||a.ajaxSettings.type,
iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},c);k={};this.trigger("form-pre-serialize",[this,c,k]);if(k.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(c.beforeSerialize&&!1===c.beforeSerialize(this,c))return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var n=c.traditional;void 0===n&&(n=a.ajaxSettings.traditional);var r=[],m,s=this.formToArray(c.semantic,r);c.data&&(c.extraData=c.data,m=a.param(c.data,
n));if(c.beforeSubmit&&!1===c.beforeSubmit(s,this,c))return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[s,this,c,k]);if(k.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;k=a.param(s,n);m&&(k=k?k+"&"+m:m);"GET"==c.type.toUpperCase()?(c.url+=(0<=c.url.indexOf("?")?"&":"?")+k,c.data=null):c.data=k;var t=[];c.resetForm&&t.push(function(){p.resetForm()});c.clearForm&&t.push(function(){p.clearForm(c.includeHidden)});
if(!c.dataType&&c.target){var g=c.success||function(){};t.push(function(b){var d=c.replaceTarget?"replaceWith":"html";a(c.target)[d](b).each(g,arguments)})}else c.success&&t.push(c.success);c.success=function(a,b,d){for(var e=c.context||this,f=0,g=t.length;f<g;f++)t[f].apply(e,[a,b,d||p,p])};if(c.error){var D=c.error;c.error=function(a,b,d){D.apply(c.context||this,[a,b,d,p])}}if(c.complete){var v=c.complete;c.complete=function(a,b){v.apply(c.context||this,[a,b,p])}}m=0<a("input[type=file]:enabled",
this).filter(function(){return""!==a(this).val()}).length;k="multipart/form-data"==p.attr("enctype")||"multipart/form-data"==p.attr("encoding");n=e&&f;d("fileAPI :"+n);var u;if(!1!==c.iframe&&(c.iframe||(m||k)&&!n))c.closeKeepAlive?a.get(c.closeKeepAlive,function(){u=b(s)}):u=b(s);else if((m||k)&&n){var x=new FormData;for(k=0;k<s.length;k++)x.append(s[k].name,s[k].value);if(c.extraData){k=a.param(c.extraData,c.traditional).split("&");n=k.length;m=[];var y,E;for(y=0;y<n;y++)k[y]=k[y].replace(/\+/g,
" "),E=k[y].split("="),m.push([decodeURIComponent(E[0]),decodeURIComponent(E[1])]);for(k=0;k<m.length;k++)m[k]&&x.append(m[k][0],m[k][1])}c.data=null;m=a.extend(!0,{},a.ajaxSettings,c,{contentType:!1,processData:!1,cache:!1,type:l||"POST"});c.uploadProgress&&(m.xhr=function(){var b=a.ajaxSettings.xhr();b.upload&&b.upload.addEventListener("progress",function(a){var b=0,d=a.loaded||a.position,e=a.total;a.lengthComputable&&(b=Math.ceil(100*(d/e)));c.uploadProgress(a,d,e,b)},!1);return b});m.data=null;
var A=m.beforeSend;m.beforeSend=function(a,b){b.data=c.formData?c.formData:x;A&&A.call(this,a,b)};u=a.ajax(m)}else u=a.ajax(c);p.removeData("jqxhr").data("jqxhr",u);for(m=0;m<r.length;m++)r[m]=null;this.trigger("form-submit-notify",[this,c]);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,c).off("click.form-plugin",this.selector,b).on("submit.form-plugin",this.selector,e,c).on("click.form-plugin",this.selector,e,b),this):this.ajaxFormUnbind().bind("submit.form-plugin",e,c).bind("click.form-plugin",e,b)};a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(c,
b){var d=[];if(0===this.length)return d;var f=this[0],h=this.attr("id"),n=c?f.getElementsByTagName("*"):f.elements;n&&!/MSIE [678]/.test(navigator.userAgent)&&(n=a(n).get());h&&(h=a(':input[form="'+h+'"]').get(),h.length&&(n=(n||[]).concat(h)));if(!n||!n.length)return d;var r,m,s,t,g;r=0;for(g=n.length;r<g;r++)if(t=n[r],(h=t.name)&&!t.disabled)if(c&&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((s=
a.fieldValue(t,!0))&&s.constructor==Array){b&&b.push(t);m=0;for(t=s.length;m<t;m++)d.push({name:h,value:s[m]})}else if(e&&"file"==t.type)if(b&&b.push(t),s=t.files,s.length)for(m=0;m<s.length;m++)d.push({name:h,value:s[m],type:t.type});else d.push({name:h,value:"",type:t.type});else null!==s&&"undefined"!=typeof s&&(b&&b.push(t),d.push({name:h,value:s,type:t.type,required:t.required}));if(!c&&f.clk&&(n=a(f.clk),r=n[0],(h=r.name)&&!r.disabled&&"image"==r.type))d.push({name:h,value:n.val()}),d.push({name:h+
".x",value:f.clk_x},{name:h+".y",value:f.clk_y});return d};a.fn.formSerialize=function(c){return a.param(this.formToArray(c))};a.fn.fieldSerialize=function(c){var b=[];this.each(function(){var d=this.name;if(d){var e=a.fieldValue(this,c);if(e&&e.constructor==Array)for(var f=0,h=e.length;f<h;f++)b.push({name:d,value:e[f]});else null!==e&&"undefined"!=typeof e&&b.push({name:this.name,value:e})}});return a.param(b)};a.fn.fieldValue=function(c){for(var b=[],d=0,e=this.length;d<e;d++){var f=a.fieldValue(this[d],
c);null===f||("undefined"==typeof f||f.constructor==Array&&!f.length)||(f.constructor==Array?a.merge(b,f):b.push(f))}return b};a.fieldValue=function(c,b){var d=c.name,e=c.type,f=c.tagName.toLowerCase();void 0===b&&(b=!0);if(b&&(!d||c.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!c.checked||("submit"==e||"image"==e)&&c.form&&c.form.clk!=c||"select"==f&&-1==c.selectedIndex))return null;if("select"==f){var h=c.selectedIndex;if(0>h)return null;for(var d=[],f=c.options,r=(e="select-one"==
e)?h+1:f.length,h=e?h:0;h<r;h++){var m=f[h];if(m.selected){var s=m.value;s||(s=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value);if(e)return s;d.push(s)}}return d}return a(c).val()};a.fn.clearForm=function(c){return this.each(function(){a("input,select,textarea",this).clearFields(c)})};a.fn.clearFields=a.fn.clearInputs=function(c){var b=/^(?: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(b.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(c&&(!0===c&&/hidden/.test(d)||"string"==typeof c&&a(this).is(c)))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(c){void 0===c&&(c=!0);return this.each(function(){var b=this.type;"checkbox"==b||"radio"==b?this.checked=c:"option"==this.tagName.toLowerCase()&&(b=a(this).parent("select"),c&&(b[0]&&"select-one"==b[0].type)&&b.find("option").selected(!1),this.selected=c)})};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 c=
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").addBack().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(c,b){var d=c.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()));b(e)});this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(){c._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(b){var d=a(b.target);d.hasClass("tagit-label")?(d=d.closest(".tagit-choice"),d.hasClass("removed")||c._trigger("onTagClicked",
b,{tag:d,tagLabel:c.tagLabel(d)})):c.tagInput.focus()});var b=!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){c.createTag(d,null,!0);b=!0})}else this.options.singleFieldNode=a('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />'),this.tagList.after(this.options.singleFieldNode);b||this.tagList.children("li").each(function(){a(this).hasClass("tagit-new")||
(c.createTag(a(this).text(),a(this).attr("class"),!0),a(this).remove())});this.tagInput.keydown(function(b){if(b.which==a.ui.keyCode.BACKSPACE&&""===c.tagInput.val()){var d=c._lastTag();!c.options.removeConfirmation||d.hasClass("remove")?c.removeTag(d):c.options.removeConfirmation&&d.addClass("remove ui-state-highlight")}else c.options.removeConfirmation&&c._lastTag().removeClass("remove ui-state-highlight");if(","===b.key&&!1===b.shiftKey||b.which===a.ui.keyCode.ENTER||b.which==a.ui.keyCode.TAB&&
""!==c.tagInput.val()||b.which==a.ui.keyCode.SPACE&&!0!==c.options.allowSpaces&&('"'!=a.trim(c.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==a.trim(c.tagInput.val()).charAt(0)&&'"'==a.trim(c.tagInput.val()).charAt(a.trim(c.tagInput.val()).length-1)&&0!==a.trim(c.tagInput.val()).length-1))if(b.which===a.ui.keyCode.ENTER&&""===c.tagInput.val()||b.preventDefault(),!c.options.autocomplete.autoFocus||!c.tagInput.data("autocomplete-open"))c.tagInput.autocomplete("close"),c.createTag(c._cleanedInput())}).blur(function(){c.tagInput.data("autocomplete-open")||
c.createTag(c._cleanedInput())});if(this.options.availableTags||this.options.tagSource||this.options.autocomplete.source)d={select:function(a,b){c.createTag(b.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(){c.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose.tagit",function(){c.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 c=this,b=[];this.options.singleField?(b=a(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter),
""===b[0]&&(b=[])):this._tags().each(function(){b.push(c.tagLabel(this))});return b},_updateSingleTagsField:function(c){a(this.options.singleFieldNode).val(c.join(this.options.singleFieldDelimiter)).trigger("change")},_subtractArray:function(c,b){for(var d=[],e=0;e<c.length;e++)-1==a.inArray(c[e],b)&&d.push(c[e]);return d},tagLabel:function(c){return this.options.singleField?a(c).find(".tagit-label:first").text():a(c).find("input:first").val()},_showAutocomplete:function(){this.tagInput.autocomplete("search",
"")},_findTagByLabel:function(c){var b=this,d=null;this._tags().each(function(){if(b._formatStr(c)==b._formatStr(b.tagLabel(this)))return d=a(this),!1});return d},_isNew:function(a){return!this._findTagByLabel(a)},_formatStr:function(c){return this.options.caseSensitive?c:a.trim(c.toLowerCase())},_effectExists:function(c){return Boolean(a.effects&&(a.effects[c]||a.effects.effect&&a.effects.effect[c]))},createTag:function(c,b,d){var e=this,c=a.trim(c);this.options.preprocessTag&&(c=this.options.preprocessTag(c));
if(""===c)return!1;if(!this.options.allowDuplicates&&!this._isNew(c))return c=this._findTagByLabel(c),!1!==this._trigger("onTagExists",null,{existingTag:c,duringInitialization:d})&&this._effectExists("highlight")&&c.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(c),h=a("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(b).append(f);
this.options.readOnly?h.addClass("tagit-choice-read-only"):(h.addClass("tagit-choice-editable"),b=a("<span></span>").addClass("ui-icon ui-icon-close"),b=a('<a><span class="text-icon">\u00d7</span></a>').addClass("tagit-close").append(b).click(function(){e.removeTag(h)}),h.append(b));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(c),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(c,b){b="undefined"===typeof b?this.options.animate:b;c=a(c);this._trigger("onTagRemoved",
null,c);if(!1!==this._trigger("beforeTagRemoved",null,{tag:c,tagLabel:this.tagLabel(c)})){if(this.options.singleField){var d=this.assignedTags(),e=this.tagLabel(c),d=a.grep(d,function(a){return a!=e});this._updateSingleTagsField(d)}if(b){c.addClass("removed");var d=this._effectExists("blind")?["blind",{direction:"horizontal"},"fast"]:["fast"],f=this;d.push(function(){c.remove();f._trigger("afterTagRemoved",null,{tag:c,tagLabel:f.tagLabel(c)})});c.fadeOut("fast").hide.apply(c,d).dequeue()}else c.remove(),
this._trigger("afterTagRemoved",null,{tag:c,tagLabel:this.tagLabel(c)})}},removeTagByLabel:function(a,b){var d=this._findTagByLabel(a);if(!d)throw"No such tag exists with the name '"+a+"'";this.removeTag(d,b)},removeAll:function(){var a=this;this._tags().each(function(b,d){a.removeTag(d,!1)})}})})(jQuery);jQuery.fn.sortElements=function(){var a=[].sort;return function(c,b){var b=b||function(){return this},d=this.map(function(){var a=b.call(this),c=a.parentNode,d=c.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(c===this)throw Error("You can't sort elements if any one is a descendant of another.");c.insertBefore(this,d);c.removeChild(d)}});return a.call(this,c).each(function(a){d[a].call(b.call(this))})}}();(function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a(jQuery)})(function(a){function c(a){return e.raw?a:encodeURIComponent(a)}function b(c,b){var j;if(e.raw)j=c;else a:{var i=c;0===i.indexOf('"')&&(i=i.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{i=decodeURIComponent(i.replace(d," "))}catch(l){j=void 0;break a}try{j=e.json?JSON.parse(i):i;break a}catch(k){}j=void 0}return a.isFunction(b)?b(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,l=j.expires=new Date;l.setDate(l.getDate()+i)}return document.cookie=[c(d),"=",c(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("; "):[],l=0,k=i.length;l<k;l++){var p=i[l].split("="),n;n=p.shift();n=e.raw?n:decodeURIComponent(n);p=p.join("=");
if(d&&d===n){j=b(p,h);break}if(!d&&void 0!==(p=b(p)))j[n]=p}return j};e.defaults={};a.removeCookie=function(c,b){return void 0!==a.cookie(c)?(a.cookie(c,"",a.extend({},b,{expires:-1})),!0):!1}});(function(a){a.fn.equalizeElementHeights=function(){var c=this.map(function(c,d){return a(d).height()}).get();return this.height(Math.max.apply(this,c))}})(jQuery);jQuery&&function(a){a.extend(a.fn,{selectBox:function(c,b){var d,e="",f=navigator.platform.match(/mac/i),h=function(c,b){var d,e=function(c,b){c.children("OPTION, OPTGROUP").each(function(){if(a(this).is("OPTION"))if(0<a(this).length){var c=a(this),d=b,f=a("<li />"),g=a("<a />");f.addClass(c.attr("class"));f.data(c.data());g.attr("rel",c.val()).text(c.text());f.append(g);c.attr("disabled")&&f.addClass("selectBox-disabled");c.attr("selected")&&f.addClass("selectBox-selected");d.append(f)}else b.append("<li>\u00a0</li>");
else c=a('<li class="selectBox-optgroup" />'),c.text(a(this).attr("label")),b.append(c),b=e(a(this),b)});return b};switch(b){case "inline":return d=a('<ul class="selectBox-options" />'),d=e(c,d),d.find("A").bind("mouseover.selectBox",function(){r(c,a(this).parent())}).bind("mouseout.selectBox",function(){m(c,a(this).parent())}).bind("mousedown.selectBox",function(a){a.preventDefault();c.selectBox("control").hasClass("selectBox-active")||c.selectBox("control").focus()}).bind("mouseup.selectBox",function(b){p();
n(c,a(this).parent(),b)}),D(d),d;case "dropdown":d=a('<ul class="selectBox-dropdown-menu selectBox-options" />');d=e(c,d);d.data("selectBox-select",c).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"),p())}).bind("mouseup.selectBox",function(b){b.screenX===d.data("selectBox-down-at-x")&&
b.screenY===d.data("selectBox-down-at-y")||(d.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),n(c,a(this).parent()),p())}).bind("mouseover.selectBox",function(){r(c,a(this).parent())}).bind("mouseout.selectBox",function(){m(c,a(this).parent())});var f=c.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(c){return("selectBox-label "+(a(c).find("OPTION:selected").attr("class")||"")).replace(/\s+$/,"")},
i=function(c){return a(c).find("OPTION:selected").text()||"\u00a0"},l=function(c){var c=a(c),b=c.data("selectBox-control");b&&b.find(".selectBox-label").attr("class",j(c)).text(i(c))},k=function(c){var c=a(c),b=c.data("selectBox-control"),d=c.data("selectBox-settings"),e=b.data("selectBox-options");if(b.hasClass("selectBox-disabled"))return!1;p();var f=isNaN(b.css("borderBottomWidth"))?0:parseInt(b.css("borderBottomWidth"));e.width(b.innerWidth()).css({top:b.offset().top+b.outerHeight()-f,left:b.offset().left});
if(c.triggerHandler("beforeopen"))return!1;f=function(){c.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");s(c,d,!0);r(c,d);b.addClass("selectBox-menuShowing");a(document).bind("mousedown.selectBox",function(c){a(c.target).parents().andSelf().hasClass("selectBox-options")||p()})},p=function(){0!==a(".selectBox-dropdown-menu:visible").length&&
(a(document).unbind("mousedown.selectBox"),a(".selectBox-dropdown-menu").each(function(){var c=a(this),b=c.data("selectBox-select"),d=b.data("selectBox-control"),e=b.data("selectBox-settings");if(b.triggerHandler("beforeclose"))return!1;var f=function(){b.triggerHandler("close",{_selectBox:!0})};if(e){switch(e.menuTransition){case "fade":c.fadeOut(e.menuSpeed,f);break;case "slide":c.slideUp(e.menuSpeed,f);break;default:c.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")}))},n=function(c,b,d){var c=a(c),b=a(b),e=c.data("selectBox-control");c.data("selectBox-settings");if(e.hasClass("selectBox-disabled")||0===b.length||b.hasClass("selectBox-disabled"))return!1;c.attr("multiple")?d.shiftKey&&e.data("selectBox-last-selected")?(b.toggleClass("selectBox-selected"),d=b.index()>e.data("selectBox-last-selected").index()?b.siblings().slice(e.data("selectBox-last-selected").index(),
b.index()):b.siblings().slice(b.index(),e.data("selectBox-last-selected").index()),d=d.not(".selectBox-optgroup, .selectBox-disabled"),b.hasClass("selectBox-selected")?d.addClass("selectBox-selected"):d.removeClass("selectBox-selected")):f&&d.metaKey||!f&&d.ctrlKey?b.toggleClass("selectBox-selected"):(b.siblings().removeClass("selectBox-selected"),b.addClass("selectBox-selected")):(b.siblings().removeClass("selectBox-selected"),b.addClass("selectBox-selected"));e.hasClass("selectBox-dropdown")&&e.find(".selectBox-label").text(b.text());
var g=0,h=[];c.attr("multiple")?e.find(".selectBox-selected A").each(function(){h[g++]=a(this).attr("rel")}):h=b.find("A").attr("rel");e.data("selectBox-last-selected",b);c.val()!==h&&(c.val(h),l(c),c.trigger("change"));return!0},r=function(c,b){c=a(c);b=a(b);c.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover");b.addClass("selectBox-hover")},m=function(c,b){c=a(c);a(b);c.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover")},
s=function(c,b,d){if(b&&0!==b.length){var c=a(c),c=c.data("selectBox-control"),e=c.data("selectBox-options"),c=c.hasClass("selectBox-dropdown")?e:e.parent(),e=parseInt(b.offset().top-c.position().top),f=parseInt(e+b.outerHeight());d?c.scrollTop(b.offset().top-c.offset().top+c.scrollTop()-c.height()/2):(0>e&&c.scrollTop(b.offset().top-c.offset().top+c.scrollTop()),f>c.height()&&c.scrollTop(b.offset().top+b.outerHeight()-c.offset().top+c.scrollTop()-c.height()))}},t=function(c,b){var c=a(c),d=c.data("selectBox-control"),
f=d.data("selectBox-options"),g=c.data("selectBox-settings"),h=0,i=0;if(!d.hasClass("selectBox-disabled"))switch(b.keyCode){case 8:b.preventDefault();e="";break;case 9:case 27:p();m(c);break;case 13:d.hasClass("selectBox-menuShowing")?(n(c,f.find("LI.selectBox-hover:first"),b),d.hasClass("selectBox-dropdown")&&p()):k(c);break;case 38:case 37:b.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););r(c,d);n(c,d,b);s(c,d)}else k(c);break;case 40:case 39:if(b.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););r(c,d);n(c,d,b);s(c,d)}else k(c)}},g=function(c,b){var c=a(c),f=c.data("selectBox-control"),g=f.data("selectBox-options");if(!f.hasClass("selectBox-disabled"))switch(b.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:f.hasClass("selectBox-menuShowing")||k(c),b.preventDefault(),clearTimeout(d),e+=String.fromCharCode(b.charCode||b.keyCode),g.find("A").each(function(){if(a(this).text().substr(0,e.length).toLowerCase()===
e.toLowerCase())return r(c,a(this).parent()),s(c,a(this).parent()),!1}),d=setTimeout(function(){e=""},1E3)}},D=function(c){a(c).css("MozUserSelect","none").bind("selectstart",function(a){a.preventDefault()})};switch(c){case "control":return a(this).data("selectBox-control");case "settings":if(!b)return a(this).data("selectBox-settings");a(this).each(function(){a(this).data("selectBox-settings",a.extend(!0,a(this).data("selectBox-settings"),b))});break;case "options":if(void 0===b)return a(this).data("selectBox-control").data("selectBox-options");
a(this).each(function(){var c,d=b;c=a(this);var e=c.data("selectBox-control");c.data("selectBox-settings");switch(typeof b){case "string":c.html(b);break;case "object":c.html("");for(var f in b)if(null!==b[f]){if("object"===typeof b[f]){var d=a('<optgroup label="'+f+'" />'),g;for(g in b[f])d.append('<option value="'+g+'">'+b[f][g]+"</option>")}else d=a('<option value="'+f+'">'+b[f]+"</option>");c.append(d)}}if(e)switch(e.data("selectBox-options").remove(),f=e.hasClass("selectBox-dropdown")?"dropdown":
"inline",d=h(c,f),e.data("selectBox-options",d),f){case "inline":e.append(d);break;case "dropdown":l(c),a("BODY").append(d)}});break;case "value":if(void 0===b)return a(this).val();a(this).each(function(){var c,d=b;c=a(this);c.val(d);d=c.val();null===d&&(d=c.children().first().val(),c.val(d));var e=c.data("selectBox-control");if(e){var f=c.data("selectBox-settings"),e=e.data("selectBox-options");l(c);e.find(".selectBox-selected").removeClass("selectBox-selected");e.find("A").each(function(){if("object"===
typeof d)for(var c=0;c<d.length;c++)a(this).attr("rel")==d[c]&&a(this).parent().addClass("selectBox-selected");else a(this).attr("rel")==d&&a(this).parent().addClass("selectBox-selected")});f.change&&f.change.call(c)}});break;case "refresh":a(this).each(function(){var c;c=a(this);c.selectBox("options",c.html())});break;case "enable":a(this).each(function(){var c;c=a(this);c.attr("disabled",!1);(c=c.data("selectBox-control"))&&c.removeClass("selectBox-disabled")});break;case "disable":a(this).each(function(){var c;
c=a(this);c.attr("disabled",!0);(c=c.data("selectBox-control"))&&c.addClass("selectBox-disabled")});break;case "destroy":a(this).each(function(){var c;c=a(this);var b=c.data("selectBox-control");b&&(b.data("selectBox-options").remove(),b.remove(),c.removeClass("selectBox").removeData("selectBox-control").data("selectBox-control",null).removeData("selectBox-settings").data("selectBox-settings",null).show())});break;default:a(this).each(function(){var b=this,d;if(!navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i)&&
"select"===b.tagName.toLowerCase()&&(b=a(b),!b.data("selectBox-control"))){var e=a('<a class="selectBox" />'),f=b.attr("multiple")||1<parseInt(b.attr("size")),m=c||{};e.width(b.outerWidth()).addClass(b.attr("class")).attr("title",b.attr("title")||"").attr("tabindex",parseInt(b.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"),
b.trigger("focus"))}).bind("blur.selectBox",function(){e.hasClass("selectBox-active")&&(e.removeClass("selectBox-active"),b.trigger("blur"))});a(window).data("selectBox-bindings")||a(window).data("selectBox-bindings",!0).bind("scroll.selectBox",p).bind("resize.selectBox",p);b.attr("disabled")&&e.addClass("selectBox-disabled");b.bind("click.selectBox",function(a){e.focus();a.preventDefault()});if(f){if(d=h(b,"inline"),e.append(d).data("selectBox-options",d).addClass("selectBox-inline selectBox-menuShowing").bind("keydown.selectBox",
function(a){t(b,a)}).bind("keypress.selectBox",function(a){g(b,a)}).bind("mousedown.selectBox",function(c){a(c.target).is("A.selectBox-inline")&&c.preventDefault();e.hasClass("selectBox-focus")||e.focus()}).insertAfter(b),!b[0].style.height){var f=b.attr("size")?parseInt(b.attr("size")):5,l=e.clone().removeAttr("id").css({position:"absolute",top:"-9999em"}).show().appendTo("body");l.find(".selectBox-options").html("<li><a>\u00a0</a></li>");var n=parseInt(l.find(".selectBox-options A:first").html(" ").outerHeight());
l.remove();e.height(n*f)}}else f=a('<span class="selectBox-label" />'),l=a('<span class="selectBox-arrow" />'),f.attr("class",j(b)).text(i(b)),d=h(b,"dropdown"),d.appendTo("BODY"),e.data("selectBox-options",d).addClass("selectBox-dropdown").append(f).append(l).bind("mousedown.selectBox",function(a){e.hasClass("selectBox-menuShowing")?p():(a.stopPropagation(),d.data("selectBox-down-at-x",a.screenX).data("selectBox-down-at-y",a.screenY),k(b))}).bind("keydown.selectBox",function(a){t(b,a)}).bind("keypress.selectBox",
function(a){g(b,a)}).bind("open.selectBox",function(a,c){c&&!0===c._selectBox||k(b)}).bind("close.selectBox",function(a,c){c&&!0===c._selectBox||p()}).insertAfter(b),l=e.width()-l.outerWidth()-parseInt(f.css("paddingLeft"))-parseInt(f.css("paddingLeft")),f.width(l);D(e);b.addClass("selectBox").data("selectBox-control",e).data("selectBox-settings",m).hide()}})}return a(this)}})}(jQuery);(function(){function a(a){return function(c,b,d,e){var b=D(b,e,4),f=!w(c)&&g.keys(c),h=(f||c).length,i=0<a?0:h-1;3>arguments.length&&(d=c[f?f[i]:i],i+=a);for(var j=b,k=d;0<=i&&i<h;i+=a)var l=f?f[i]:i,k=j(k,c[l],l,c);return k}}function c(a){return function(c,b,d){for(var b=v(b,d),d=A(c),e=0<a?0:d-1;0<=e&&e<d;e+=a)if(b(c[e],e,c))return e;return-1}}function b(a,c,b){return function(d,e,f){var h=0,i=A(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(b&&f&&i)return f=
b(d,e),d[f]===e?f:-1;if(e!==e)return f=c(l.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,c){var b=Q.length,d=a.constructor,d=g.isFunction(d)&&d.prototype||j,e="constructor";for(g.has(a,e)&&!g.contains(c,e)&&c.push(e);b--;)e=Q[b],e in a&&(a[e]!==d[e]&&!g.contains(c,e))&&c.push(e)}var e=this,f=e._,h=Array.prototype,j=Object.prototype,i=h.push,l=h.slice,k=j.toString,p=j.hasOwnProperty,n=Array.isArray,r=Object.keys,m=Function.prototype.bind,
s=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,c,b){if(void 0===c)return a;switch(null==b?3:b){case 1:return function(b){return a.call(c,b)};case 2:return function(b,d){return a.call(c,b,d)};case 3:return function(b,d,e){return a.call(c,b,d,e)};case 4:return function(b,
d,e,f){return a.call(c,b,d,e,f)}}return function(){return a.apply(c,arguments)}},v=function(a,c,b){return null==a?g.identity:g.isFunction(a)?D(a,c,b):g.isObject(a)?g.matcher(a):g.property(a)};g.iteratee=function(a,c){return v(a,c,Infinity)};var u=function(a,c){return function(b){var d=arguments.length;if(2>d||null==b)return b;for(var e=1;e<d;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;i<h;i++){var j=g[i];if(!c||void 0===b[j])b[j]=f[j]}return b}},x=function(a){if(!g.isObject(a))return{};if(s)return s(a);
t.prototype=a;a=new t;t.prototype=null;return a},y=function(a){return function(c){return null==c?void 0:c[a]}},E=Math.pow(2,53)-1,A=y("length"),w=function(a){a=A(a);return"number"==typeof a&&0<=a&&a<=E};g.each=g.forEach=function(a,c,b){var c=D(c,b),d;if(w(a)){b=0;for(d=a.length;b<d;b++)c(a[b],b,a)}else{var e=g.keys(a),b=0;for(d=e.length;b<d;b++)c(a[e[b]],e[b],a)}return a};g.map=g.collect=function(a,c,b){for(var c=v(c,b),b=!w(a)&&g.keys(a),d=(b||a).length,e=Array(d),f=0;f<d;f++){var h=b?b[f]:f;e[f]=
c(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,c,b){c=w(a)?g.findIndex(a,c,b):g.findKey(a,c,b);if(void 0!==c&&-1!==c)return a[c]};g.filter=g.select=function(a,c,b){var d=[],c=v(c,b);g.each(a,function(a,b,e){c(a,b,e)&&d.push(a)});return d};g.reject=function(a,c,b){return g.filter(a,g.negate(v(c)),b)};g.every=g.all=function(a,c,b){for(var c=v(c,b),b=!w(a)&&g.keys(a),d=(b||a).length,e=0;e<d;e++){var f=b?b[e]:e;if(!c(a[f],f,a))return!1}return!0};
g.some=g.any=function(a,c,b){for(var c=v(c,b),b=!w(a)&&g.keys(a),d=(b||a).length,e=0;e<d;e++){var f=b?b[e]:e;if(c(a[f],f,a))return!0}return!1};g.contains=g.includes=g.include=function(a,c,b,d){w(a)||(a=g.values(a));if("number"!=typeof b||d)b=0;return 0<=g.indexOf(a,c,b)};g.invoke=function(a,c){var b=l.call(arguments,2),d=g.isFunction(c);return g.map(a,function(a){var e=d?c:a[c];return null==e?e:e.apply(a,b)})};g.pluck=function(a,c){return g.map(a,g.property(c))};g.where=function(a,c){return g.filter(a,
g.matcher(c))};g.findWhere=function(a,c){return g.find(a,g.matcher(c))};g.max=function(a,c,b){var d=-Infinity,e=-Infinity,f;if(null==c&&null!=a)for(var a=w(a)?a:g.values(a),h=0,i=a.length;h<i;h++)b=a[h],b>d&&(d=b);else c=v(c,b),g.each(a,function(a,b,g){f=c(a,b,g);if(f>e||-Infinity===f&&-Infinity===d)d=a,e=f});return d};g.min=function(a,c,b){var d=Infinity,e=Infinity,f;if(null==c&&null!=a)for(var a=w(a)?a:g.values(a),h=0,i=a.length;h<i;h++)b=a[h],b<d&&(d=b);else c=v(c,b),g.each(a,function(a,b,g){f=
c(a,b,g);if(f<e||Infinity===f&&Infinity===d)d=a,e=f});return d};g.shuffle=function(a){for(var a=w(a)?a:g.values(a),c=a.length,b=Array(c),d=0,e;d<c;d++)e=g.random(0,d),e!==d&&(b[d]=b[e]),b[e]=a[d];return b};g.sample=function(a,c,b){return null==c||b?(w(a)||(a=g.values(a)),a[g.random(a.length-1)]):g.shuffle(a).slice(0,Math.max(0,c))};g.sortBy=function(a,c,b){c=v(c,b);return g.pluck(g.map(a,function(a,b,d){return{value:a,index:b,criteria:c(a,b,d)}}).sort(function(a,c){var b=a.criteria,d=c.criteria;if(b!==
d){if(b>d||void 0===b)return 1;if(b<d||void 0===d)return-1}return a.index-c.index}),"value")};var H=function(a){return function(c,b,d){var e={},b=v(b,d);g.each(c,function(d,f){var g=b(d,f,c);a(e,d,g)});return e}};g.groupBy=H(function(a,c,b){g.has(a,b)?a[b].push(c):a[b]=[c]});g.indexBy=H(function(a,c,b){a[b]=c});g.countBy=H(function(a,c,b){g.has(a,b)?a[b]++:a[b]=1});g.toArray=function(a){return!a?[]:g.isArray(a)?l.call(a):w(a)?g.map(a,g.identity):g.values(a)};g.size=function(a){return null==a?0:w(a)?
a.length:g.keys(a).length};g.partition=function(a,c,b){var c=v(c,b),d=[],e=[];g.each(a,function(a,b,f){(c(a,b,f)?d:e).push(a)});return[d,e]};g.first=g.head=g.take=function(a,c,b){return null==a?void 0:null==c||b?a[0]:g.initial(a,a.length-c)};g.initial=function(a,c,b){return l.call(a,0,Math.max(0,a.length-(null==c||b?1:c)))};g.last=function(a,c,b){return null==a?void 0:null==c||b?a[a.length-1]:g.rest(a,Math.max(0,a.length-c))};g.rest=g.tail=g.drop=function(a,c,b){return l.call(a,null==c||b?1:c)};g.compact=
function(a){return g.filter(a,g.identity)};var F=function(a,c,b,d){for(var e=[],f=0,d=d||0,h=A(a);d<h;d++){var i=a[d];if(w(i)&&(g.isArray(i)||g.isArguments(i))){c||(i=F(i,c,b));var j=0,k=i.length;for(e.length+=k;j<k;)e[f++]=i[j++]}else b||(e[f++]=i)}return e};g.flatten=function(a,c){return F(a,c,!1)};g.without=function(a){return g.difference(a,l.call(arguments,1))};g.uniq=g.unique=function(a,c,b,d){g.isBoolean(c)||(d=b,b=c,c=!1);null!=b&&(b=v(b,d));for(var d=[],e=[],f=0,h=A(a);f<h;f++){var i=a[f],
j=b?b(i,f,a):i;c?((!f||e!==j)&&d.push(i),e=j):b?g.contains(e,j)||(e.push(j),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 c=[],b=arguments.length,d=0,e=A(a);d<e;d++){var f=a[d];if(!g.contains(c,f)){for(var h=1;h<b&&g.contains(arguments[h],f);h++);h===b&&c.push(f)}}return c};g.difference=function(a){var c=F(arguments,!0,!0,1);return g.filter(a,function(a){return!g.contains(c,a)})};g.zip=function(){return g.unzip(arguments)};
g.unzip=function(a){for(var c=a&&g.max(a,A).length||0,b=Array(c),d=0;d<c;d++)b[d]=g.pluck(a,d);return b};g.object=function(a,c){for(var b={},d=0,e=A(a);d<e;d++)c?b[a[d]]=c[d]:b[a[d][0]]=a[d][1];return b};g.findIndex=c(1);g.findLastIndex=c(-1);g.sortedIndex=function(a,c,b,d){for(var b=v(b,d,1),c=b(c),d=0,e=A(a);d<e;){var f=Math.floor((d+e)/2);b(a[f])<c?d=f+1:e=f}return d};g.indexOf=b(1,g.findIndex,g.sortedIndex);g.lastIndexOf=b(-1,g.findLastIndex);g.range=function(a,c,b){null==c&&(c=a||0,a=0);for(var b=
b||1,c=Math.max(Math.ceil((c-a)/b),0),d=Array(c),e=0;e<c;e++,a+=b)d[e]=a;return d};var M=function(a,c,b,d,e){if(!(d instanceof c))return a.apply(b,e);c=x(a.prototype);a=a.apply(c,e);return g.isObject(a)?a:c};g.bind=function(a,c){if(m&&a.bind===m)return m.apply(a,l.call(arguments,1));if(!g.isFunction(a))throw new TypeError("Bind must be called on a function");var b=l.call(arguments,2),d=function(){return M(a,d,c,this,b.concat(l.call(arguments)))};return d};g.partial=function(a){var c=l.call(arguments,
1),b=function(){for(var d=0,e=c.length,f=Array(e),h=0;h<e;h++)f[h]=c[h]===g?arguments[d++]:c[h];for(;d<arguments.length;)f.push(arguments[d++]);return M(a,b,this,this,f)};return b};g.bindAll=function(a){var c,b=arguments.length,d;if(1>=b)throw Error("bindAll must be passed function names");for(c=1;c<b;c++)d=arguments[c],a[d]=g.bind(a[d],a);return a};g.memoize=function(a,c){var b=function(d){var e=b.cache,f=""+(c?c.apply(this,arguments):d);g.has(e,f)||(e[f]=a.apply(this,arguments));return e[f]};b.cache=
{};return b};g.delay=function(a,c){var b=l.call(arguments,2);return setTimeout(function(){return a.apply(null,b)},c)};g.defer=g.partial(g.delay,g,1);g.throttle=function(a,c,b){var d,e,f,h=null,i=0;b||(b={});var j=function(){i=!1===b.leading?0:g.now();h=null;f=a.apply(d,e);h||(d=e=null)};return function(){var k=g.now();!i&&!1===b.leading&&(i=k);var l=c-(k-i);d=this;e=arguments;0>=l||l>c?(h&&(clearTimeout(h),h=null),i=k,f=a.apply(d,e),h||(d=e=null)):!h&&!1!==b.trailing&&(h=setTimeout(j,l));return f}};
g.debounce=function(a,c,b){var d,e,f,h,i,j=function(){var k=g.now()-h;k<c&&0<=k?d=setTimeout(j,c-k):(d=null,b||(i=a.apply(f,e),d||(f=e=null)))};return function(){f=this;e=arguments;h=g.now();var k=b&&!d;d||(d=setTimeout(j,c));k&&(i=a.apply(f,e),f=e=null);return i}};g.wrap=function(a,c){return g.partial(c,a)};g.negate=function(a){return function(){return!a.apply(this,arguments)}};g.compose=function(){var a=arguments,c=a.length-1;return function(){for(var b=c,d=a[c].apply(this,arguments);b--;)d=a[b].call(this,
d);return d}};g.after=function(a,c){return function(){if(1>--a)return c.apply(this,arguments)}};g.before=function(a,c){var b;return function(){0<--a&&(b=c.apply(this,arguments));1>=a&&(c=null);return b}};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(r)return r(a);var c=[],b;for(b in a)g.has(a,b)&&c.push(b);N&&d(a,c);
return c};g.allKeys=function(a){if(!g.isObject(a))return[];var c=[],b;for(b in a)c.push(b);N&&d(a,c);return c};g.values=function(a){for(var c=g.keys(a),b=c.length,d=Array(b),e=0;e<b;e++)d[e]=a[c[e]];return d};g.mapObject=function(a,c,b){for(var c=v(c,b),b=g.keys(a),d=b.length,e={},f,h=0;h<d;h++)f=b[h],e[f]=c(a[f],f,a);return e};g.pairs=function(a){for(var c=g.keys(a),b=c.length,d=Array(b),e=0;e<b;e++)d[e]=[c[e],a[c[e]]];return d};g.invert=function(a){for(var c={},b=g.keys(a),d=0,e=b.length;d<e;d++)c[a[b[d]]]=
b[d];return c};g.functions=g.methods=function(a){var c=[],b;for(b in a)g.isFunction(a[b])&&c.push(b);return c.sort()};g.extend=u(g.allKeys);g.extendOwn=g.assign=u(g.keys);g.findKey=function(a,c,b){for(var c=v(c,b),b=g.keys(a),d,e=0,f=b.length;e<f;e++)if(d=b[e],c(a[d],d,a))return d};g.pick=function(a,c,b){var d={},e=a,f,h;if(null==e)return d;g.isFunction(c)?(h=g.allKeys(e),f=D(c,b)):(h=F(arguments,!1,!1,1),f=function(a,c,b){return c in b},e=Object(e));for(var i=0,j=h.length;i<j;i++){var k=h[i],l=e[k];
f(l,k,e)&&(d[k]=l)}return d};g.omit=function(a,c,b){if(g.isFunction(c))c=g.negate(c);else var d=g.map(F(arguments,!1,!1,1),String),c=function(a,c){return!g.contains(d,c)};return g.pick(a,c,b)};g.defaults=u(g.allKeys,!0);g.create=function(a,c){var b=x(a);c&&g.extendOwn(b,c);return b};g.clone=function(a){return!g.isObject(a)?a:g.isArray(a)?a.slice():g.extend({},a)};g.tap=function(a,c){c(a);return a};g.isMatch=function(a,c){var b=g.keys(c),d=b.length;if(null==a)return!d;for(var e=Object(a),f=0;f<d;f++){var h=
b[f];if(c[h]!==e[h]||!(h in e))return!1}return!0};var K=function(a,c,b,d){if(a===c)return 0!==a||1/a===1/c;if(null==a||null==c)return a===c;a instanceof g&&(a=a._wrapped);c instanceof g&&(c=c._wrapped);var e=k.call(a);if(e!==k.call(c))return!1;switch(e){case "[object RegExp]":case "[object String]":return""+a===""+c;case "[object Number]":return+a!==+a?+c!==+c:0===+a?1/+a===1/c:+a===+c;case "[object Date]":case "[object Boolean]":return+a===+c}e="[object Array]"===e;if(!e){if("object"!=typeof a||
"object"!=typeof c)return!1;var f=a.constructor,h=c.constructor;if(f!==h&&(!g.isFunction(f)||!(f instanceof f&&g.isFunction(h)&&h instanceof h))&&"constructor"in a&&"constructor"in c)return!1}b=b||[];d=d||[];for(f=b.length;f--;)if(b[f]===a)return d[f]===c;b.push(a);d.push(c);if(e){f=a.length;if(f!==c.length)return!1;for(;f--;)if(!K(a[f],c[f],b,d))return!1}else{e=g.keys(a);f=e.length;if(g.keys(c).length!==f)return!1;for(;f--;)if(h=e[f],!g.has(c,h)||!K(a[h],c[h],b,d))return!1}b.pop();d.pop();return!0};
g.isEqual=function(a,c){return K(a,c)};g.isEmpty=function(a){return null==a?!0:w(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=n||function(a){return"[object Array]"===k.call(a)};g.isObject=function(a){var c=typeof a;return"function"===c||"object"===c&&!!a};g.each("Arguments Function String Number Date RegExp Error".split(" "),function(a){g["is"+a]=function(c){return k.call(c)==="[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,c){return null!=a&&
p.call(a,c)};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=y;g.propertyOf=function(a){return null==a?function(){}:function(c){return a[c]}};g.matcher=g.matches=function(a){a=g.extendOwn({},a);return function(c){return g.isMatch(c,a)}};g.times=function(a,c,b){for(var d=Array(Math.max(0,a)),c=D(c,b,1),b=0;b<a;b++)d[b]=c(b);return d};g.random=function(a,c){null==c&&(c=a,a=0);return a+Math.floor(Math.random()*
(c-a+1))};g.now=Date.now||function(){return(new Date).getTime()};n={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};u=g.invert(n);y=function(a){var c=function(c){return a[c]},b="(?:"+g.keys(a).join("|")+")",d=RegExp(b),e=RegExp(b,"g");return function(a){a=null==a?"":""+a;return d.test(a)?a.replace(e,c):a}};g.escape=y(n);g.unescape=y(u);g.result=function(a,c,b){c=null==a?void 0:a[c];void 0===c&&(c=b);return g.isFunction(c)?c.call(a):c};var U=0;g.uniqueId=function(a){var c=
++U+"";return a?a+c:c};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,q=function(a){return"\\"+S[a]};g.template=function(a,c,b){!c&&b&&(c=b);var c=g.defaults({},c,g.templateSettings),b=RegExp([(c.escape||J).source,(c.interpolate||J).source,(c.evaluate||J).source].join("|")+"|$","g"),d=0,e="__p+='";a.replace(b,function(c,b,f,
g,h){e+=a.slice(d,h).replace(R,q);d=h+c.length;b?e+="'+\n((__t=("+b+"))==null?'':_.escape(__t))+\n'":f?e+="'+\n((__t=("+f+"))==null?'':__t)+\n'":g&&(e+="';\n"+g+"\n__p+='");return c});e+="';\n";c.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(c.variable||"obj","_",e)}catch(h){throw h.source=e,h;}b=function(a){return f.call(this,a,g)};b.source="function("+(c.variable||"obj")+
"){\n"+e+"}";return b};g.chain=function(a){a=g(a);a._chain=!0;return a};var L=function(a,c){return a._chain?g(c).chain():c};g.mixin=function(a){g.each(g.functions(a),function(c){var b=g[c]=a[c];g.prototype[c]=function(){var a=[this._wrapped];i.apply(a,arguments);return L(this,b.apply(g,a))}})};g.mixin(g);g.each("pop push reverse shift sort splice unshift".split(" "),function(a){var c=h[a];g.prototype[a]=function(){var b=this._wrapped;c.apply(b,arguments);("shift"===a||"splice"===a)&&0===b.length&&
delete b[0];return L(this,b)}});g.each(["concat","join","slice"],function(a){var c=h[a];g.prototype[a]=function(){return L(this,c.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);(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 c=a.pkp.classes.Helper.CHARS_,b=Array(36),d=0,e,f;for(f=0;36>f;f++)8==f||13==f||18==f||23==f?b[f]="-":14==f?b[f]="4":(2>=d&&(d=33554432+16777216*Math.random()|0),e=d&15,d>>=4,b[f]=c[19==f?e&3|8:e]);return b.join("")};a.pkp.classes.Helper.inherits=function(a,b){var d=function(){};d.prototype=b.prototype;a.parent_=b.prototype;a.prototype=new d;a.prototype.constructor=a;b.prototype.constructor==Object.prototype.constructor&&(b.prototype.constructor=b)};a.pkp.classes.Helper.objectFactory=
function(c,b){var d,e;d=a.pkp.classes.Helper.resolveObjectName(c);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(c,b)};a.pkp.classes.Helper.resolveObjectName=function(c){var b,d,e;b=c.split();if("$"!=b.shift())throw Error(['Namespace "',b[0],'" for object "',c,'" is currently not supported!'].join(""));e=b[b.length-1];if(e.charAt(0).toUpperCase()!==
e.charAt(0))throw Error(['The name "',c,'" does not point to aconstructor which must always be upper case!'].join(""));e=a;for(d in b)if(e=e[b[d]],void 0===e)throw Error(['Constructor for object "',c,'" not found!'].join(""));if(!a.isFunction(e))throw Error(['The name "',c,'" 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,c){this.objectName_=a;this.parent.apply(this,c)};a.objectName_="";a.prototype.parent=
function(){};return a};a.pkp.classes.Helper.injectMixin=function(c,b){var d=a.pkp.classes.Helper.objectFactory(b,[]);a.extend(!0,c,d)};a.pkp.classes.Helper.curry=function(a,b,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(b,f)}}return function(){return a.apply(b,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(c,b){var d,e;for(d=this.constructor;d;d=d.parent_&&d.parent_.constructor)if(d.hasOwnProperty(c))return d=d[c],a.isFunction(d)?(e=Array.prototype.slice.call(arguments,1),d.apply(this,e)):d;throw Error(['Static property "',c,'" not found!'].join(""));};a.pkp.classes.ObjectProxy.prototype.parent=function(c,b){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(c)&&this[c]===d)return this.constructor.parent_[c].apply(this,e);f=!1;for(h=this.constructor;h;h=h.parent_&&h.parent_.constructor)if(h.prototype.hasOwnProperty(c)&&h.prototype[c]===d)f=!0;else if(f)return h.prototype[c].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(c,b){var d,e,f;if(1<c.length)throw Error("jQuery selector contained more than one handler!");this.$htmlElement_=c;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(c){a.pkp.classes.Handler.hasHandler(a(d[c]))&&
a.pkp.classes.Handler.getHandler(a(d[c])).handlerChildren_.push(e)});b.eventBridge&&(this.eventBridge_=b.eventBridge);if(b.publishChangeEvents){this.publishChangeEvents_=b.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(c){c=c.data("pkp.handler");if(!(c instanceof a.pkp.classes.Handler))throw Error("There is no handler bound to this element!");return c};a.pkp.classes.Handler.hasHandler=function(c){return c.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(c){var b,d,e,f,h,j;b=a(this);d=a.pkp.classes.Handler.getHandler(b);if(b[0]!==d.getHtmlElement.call(d)[0])throw Error("An invalid handler is bound to the calling element of an event!");
b=d.eventBindings_[c.type];if(void 0===b)return!1;e=a.makeArray(arguments);f=!0;e.unshift(this);h=0;for(j=b.length;h<j&&!(!1===b[h].apply(d,e)&&(f=!1),c.isImmediatePropagationStopped());h++);c.stopPropagation();return f};a.pkp.classes.Handler.prototype.callbackWrapper=function(c,b){a.pkp.classes.Handler.checkContext_(this);b||(b=this);return function(){var d;d=a.makeArray(arguments);d.unshift(this);return c.apply(b,d)}};a.pkp.classes.Handler.prototype.remoteResponse=function(a,b){return this.handleJson(b)};
a.pkp.classes.Handler.prototype.remove=function(){a.pkp.classes.Handler.checkContext_(this);var c,b;c=this.getHtmlElement();c.unbind(".pkpHandler");for(b in this.dataItems_)"pkp.handler"!==b&&c.removeData(b);c.trigger("pkpRemoveHandler");c.unbind(".pkpHandlerRemove");c.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 c=_.has(a,"data")?a.data:
null;!_.isNull(c)&&c.isGlobalEvent?(c.handler=this,pkp.eventBus.$emit(a.name,c)):this.trigger(a.name,c)},this),a;a.content&&alert(a.content);return!1};a.pkp.classes.Handler.prototype.setHtmlElement=function(c){a.pkp.classes.Handler.checkContext_(this);return this.$htmlElement_=c};a.pkp.classes.Handler.prototype.bind=function(c,b){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[c]){this.eventBindings_[c]=[];var d;d=".pkpHandler";"pkpRemoveHandler"===c&&(d=".pkpHandlerRemove");this.getHtmlElement().bind(c+
d,this.handleEvent)}this.eventBindings_[c].push(b)};a.pkp.classes.Handler.prototype.unbind=function(c,b){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[c])return!1;var d,e;d=0;for(e=this.eventBindings_[c].length;d<e;d++)if(this.eventBindings_[c][d]===b){this.eventBindings_[c].splice([d],1);break}0===this.eventBindings_[c].length&&(delete this.eventBindings_[c],this.getHtmlElement().unbind(c,this.handleEvent));return!0};a.pkp.classes.Handler.prototype.bindGlobal=function(a,b){"undefined"===
typeof this.globalEventListeners_[a]&&(this.globalEventListeners_[a]=[]);var d=this.callbackWrapper(b);this.globalEventListeners_[a].push(d);pkp.eventBus.$on(a,d)};a.pkp.classes.Handler.prototype.unbindGlobal=function(a,b){var d=this.callbackWrapper(b);"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,b){_.each(a,function(a){pkp.eventBus.$off(b,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(c,b){a.pkp.classes.Handler.checkContext_(this);
c="pkp."+c;void 0!==b&&(this.dataItems_[c]=!0);return 1<arguments.length?this.getHtmlElement().data(c,b):this.getHtmlElement().data(c)};a.pkp.classes.Handler.prototype.trigger=function(a,b){void 0===b&&(b=null);this.getHtmlElement().triggerHandler(a,b);this.publishedEvents_[a]||this.triggerPublicEvent_(a,b)};a.pkp.classes.Handler.prototype.publishEvent=function(a){this.publishedEvents_[a]||(this.publishedEvents_[a]=!0,this.bind(a,function(b,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(c){a(c.currentTarget).parent().parent().find("span").toggle()};a.pkp.classes.Handler.prototype.initializeTinyMCE=function(){if("undefined"!==typeof tinyMCE){var c=this.getHtmlElement().attr("id"),b=tinyMCE.EditorManager.settings;b.defaultToolbar=b.toolbar;a("#"+c).find(".richContent").each(function(){var c=a(this).attr("id"),b=a("<div></div>"),f=a("<div></div>"),h=tinyMCE.EditorManager.settings;h.toolbar=a(this).hasClass("extendedRichContent")?
h.richToolbar:h.defaultToolbar;tinyMCE.EditorManager.createEditor(c,h).render();if(a(this).hasClass("localizable")||a(this).hasClass("flag"))if(b.addClass("mceLocalizationIcon localizable"),b.attr("id","mceLocalizationIcon-"+c),a(this).wrap(f),a(this).parent().append(b),a(this).hasClass("localizable"))b.addClass("mceGlobe");else if(a(this).hasClass("flag")&&(c=a(this).attr("class").split(" "),c.length))for(f=0;f<c.length;f++)if(c[f].match(/^flag_[a-z]{2}_[A-Z]{2}$/)){b.addClass(c[f]);break}})}};a.pkp.classes.Handler.prototype.triggerPublicEvent_=
function(c,b){this.getHtmlElement().parent().trigger(c,b);this.eventBridge_&&a('[id^="'+this.eventBridge_+'"]').trigger(c,b)};a.pkp.classes.Handler.prototype.replaceWith=function(a){this.unbindGlobalAll();this.getHtmlElement().replaceWith(a)};a.pkp.classes.Handler.prototype.replacePartialWith=function(c,b){a.pkp.classes.Handler.hasHandler(b)?a.pkp.classes.Handler.getHandler(b).replaceWith(c):(this.unbindPartial(b),b.replaceWith(c))};a.pkp.classes.Handler.prototype.html=function(a){this.unbindGlobalChildren();
this.getHtmlElement().html(a)};a.pkp.classes.Handler.prototype.unbindPartial=function(c){a("*",c).each(function(){if(a.pkp.classes.Handler.hasHandler(a(this))){var c=a.pkp.classes.Handler.getHandler(a(this));c.callbackWrapper(c.unbindGlobalAll())}})};a.pkp.classes.Handler.checkContext_=function(c){if(!(c 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(c){c=a(c).attr("data-variables");return void 0!==c?a.parseJSON(decodeURIComponent(c)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap=function(c){c=a(c).attr("data-variablesType");return void 0!==c?a.parseJSON(decodeURIComponent(c)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableElement=function(c,
b,d){d=a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap(d);return void 0!=d[c]&&(d=d[c],d==a.pkp.cons.INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT)?a("<div/>").append(a("<span/>").text(b)):a("<div/>").append(a("<span/>").addClass("pkpTag mceNonEditable").attr("data-symbolic",c).text(b))}})(jQuery);(function(a){a.pkp.classes.linkAction=a.pkp.classes.linkAction||{};a.pkp.classes.linkAction.LinkActionRequest=function(a,b){this.$linkActionElement=a;this.options=b;a.is("a")&&b.url&&a.attr("href",b.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,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.RedirectRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.RedirectRequest.prototype.activate=function(a,b){var d=this.getOptions();window.open(d.url,d.name,d.specs);return this.parent("activate",a,b)}})(jQuery);(function(a){a.pkp.classes.linkAction.OpenWindowRequest=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.OpenWindowRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.OpenWindowRequest.prototype.activate=function(a,b){var d=this.getOptions();window.open(d.url);return this.parent("activate",a,b)}})(jQuery);(function(a){a.pkp.classes.linkAction.PostAndRedirectRequest=function(a,b){this.parent(a,b)};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(c,b){var d=this.parent("activate",c,b),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 c=this.getLinkActionElement(),c=a.pkp.classes.Handler.getHandler(c);this.finish();c.handleJson(this.postJsonData_)};a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.handleResponse_=function(c){var b=this.getOptions(),d=null,e=null;this.postJsonData_=c;d=setInterval(function(){0==a.active&&(clearInterval(d),window.location=b.url)},100);e=a.pkp.classes.Helper.curry(this.finishCallback_,
this);setTimeout(e,2E3)}})(jQuery);(function(a){a.pkp.classes.linkAction.NullAction=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.NullAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.NullAction.prototype.activate=function(a,b){return this.parent("activate",a,b)};a.pkp.classes.linkAction.NullAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.EventAction=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.EventAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.EventAction.prototype.activate=function(c,b){a(this.options.target).trigger(this.options.event,this.options);return this.parent("activate",c,b)};a.pkp.classes.linkAction.EventAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.AjaxRequest=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.AjaxRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.AjaxRequest.prototype.activate=function(c,b){var d=this.parent("activate",c,b),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,b){this.parent(a,b)};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(c,b){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",c,b)};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(c,b){var d,e,f,h,j,i,l,k,p,n,r;if(void 0!==b.content)c.getHtmlElement().parent().trigger("notifyUser",[b]);else{d=c.getHtmlElement();e=!1;!(c instanceof a.pkp.controllers.SiteHandler)&&0<a(b).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(l=a(d[h]),!(0<l.parents(":hidden").length)){i=l.parents();p=0;for(n=i.length;p<n;p++)if(k=a(i[p]).data("pkp.handler"),k instanceof a.pkp.classes.Handler){r=a(i[p]);break}if(r.has(b[0]).length||r[0]===b[0]){if(0<l.parents(".ui-accordion:first").length&&(i=l.parents(".ui-accordion:first"),!i.has(b[0])))continue;f.push(l)}}if(f.length)for(h=f.length-1;-1<h;h--)f[h].triggerHandler("notifyUser");else e||c.getHtmlElement().parent().trigger("notifyUser")}}})(jQuery);(function(a){a.pkp.classes.features=a.pkp.classes.features||{};a.pkp.classes.features.Feature=function(a,b){this.gridHandler=a;this.options_=b;this.addFeatureHtml(this.getGridHtmlElement(),b)};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,
b){return this.gridHandler.callbackWrapper(a,b)};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(c,b){this.parent(c,b);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(c,b){var d,e;void 0!==b.orderFinishControls&&(d=a(b.orderFinishControls),c.find("table").last().after(d),d.hide());void 0!==b.orderMessage&&(d=b.orderMessage,e=c.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(c){var b,d,e,f;this.itemsOrder=[];b=0;for(d=c.length;b<d;b++)e=a(c[b]),f=e.attr("id"),this.itemsOrder.push(f),this.storeRowOrder(b,e)};a.pkp.classes.features.OrderItemsFeature.prototype.toggleItemsDragMode=function(){var a=this.isOrdering,b=this.gridHandler.getRows().filter(".orderable"),d=this.getMoveItemClasses();a?b.addClass(d):b.removeClass(d);this.toggleMoveItemRowAction(a)};a.pkp.classes.features.OrderItemsFeature.prototype.applySortPlgOnElements=function(c,b,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),b={disabled:!e,items:b,activate:f,deactivate:h,update:j,tolerance:"pointer"};"object"===typeof d&&(b=a.extend(!0,b,d));c.sortable(b)};a.pkp.classes.features.OrderItemsFeature.prototype.getRowsDataId=function(c){var b,d=[],e;for(b in this.itemsOrder)e=a("#"+this.itemsOrder[b],c),1>e.length||(e=this.gridHandler.getRowDataId(e),
d.push(e));return d};a.pkp.classes.features.OrderItemsFeature.prototype.toggleMoveItemRowAction=function(c){var b=this.getGridHtmlElement(),d=a("div.row_actions",b),e="a:not("+this.getMoveItemRowActionSelector()+")",f=d.find(e),d=a(this.getMoveItemRowActionSelector(),b);c?(f.addClass("pkp_helpers_display_none"),d.show(),this.gridHandler.showRowActionsDiv()):(f.removeClass("pkp_helpers_display_none"),c=a(".gridRow div.row_actions",b),e=c.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 c=a(".pkp_linkaction_orderItems",this.getGridHtmlElement());1>=this.gridHandler.getRows().length?c.hide():c.show()};a.pkp.classes.features.OrderItemsFeature.prototype.toggleGridLinkActions_=function(){var c=this.isOrdering,b=a(".pkp_controllers_linkAction",this.getGridHtmlElement()).not(this.getMoveItemRowActionSelector()).not(this.getOrderButton()).not(this.getFinishControl().find("*"));this.gridHandler.changeLinkActionsState(!c,b)};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(),b=this.getCancelOrderButton(),d=this.gridHandler.callbackWrapper(this.cancelOrderHandler,this),e=this.gridHandler.callbackWrapper(this.saveOrderHandler,this);a.click(e);b.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,b){this.parent(a,b)};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 c,b,d=this.getOptions();this.parent("saveOrderHandler");
c=JSON.stringify(this.getItemsDataId());b=this.callbackWrapper(this.saveOrderResponseHandler_,this);a.post(d.saveItemsSequenceUrl,{data:c},b,"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,b){this.gridHandler.handleJson(b);this.toggleState(!1)}})(jQuery);(function(a){a.pkp.classes.features.OrderCategoryGridItemsFeature=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderCategoryGridItemsFeature,a.pkp.classes.features.OrderGridItemsFeature);a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.setupSortablePlugin=function(){var c,b,d,e;this.applySortPlgOnElements(this.getGridHtmlElement(),"tbody.orderable",null);c=navigator.userAgent.toLowerCase();if(!(/msie/.test(c)&&8>=parseInt(c.substr(c.indexOf("msie")+
5,1),10))){c=this.gridHandler.getCategories();b=0;for(d=c.length;b<d;b++)e=a(c[b]),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 c=this.gridHandler.getCategories(),b,d,e;b=0;for(d=c.length;b<d;b++)e=a(c[b]),this.toggleCategoryDragMode_(e)};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.addOrderingClassToRows=function(){var c=this.getOptions().type,b;if(c==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_ONLY||c==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_AND_ROWS)b=this.gridHandler.getCategories(),
b.addClass("orderable");(c==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_ROWS_ONLY||c==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 c=this.getCategorySequence_(this.itemsOrder),b=[],d,e,f,h;d=0;for(e=c.length;d<e;d++)f=a("#"+c[d]),h=this.getRowsDataId(f),f=this.gridHandler.getCategoryDataId(f),b.push({categoryId:f,
rowsId:h});return b};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.toggleCategoryDragMode_=function(c){var b=this.isOrdering,c=this.gridHandler.getCategoryRow(c),c=a("td:first",c),d=this.getMoveItemClasses();b?c.addClass(d):c.removeClass(d)};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.getCategorySequence_=function(c){var b,d,e=[],f;b=0;for(d=c.length;b<d;b++)f=this.gridHandler.getCategoryDataIdByRowId(c[b]),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,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderListbuilderItemsFeature,a.pkp.classes.features.OrderItemsFeature);a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.addFeatureHtml=function(c,b){var d,e,f,h,j,i;this.parent("addFeatureHtml",c,b);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,b){b.find(".itemSequence").attr("value",a+1);b.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 c=a("select:visible",this.getGridHtmlElement()),b,d;if(0<c.length){b=0;for(d=c.length;b<d;b++)this.gridHandler.saveRow(a(c[b]).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 c=this.gridHandler.getRows(),b,d,e;b=0;for(d=c.length;b<d;b++)e=a(c[b]),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,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderMultipleListsItemsFeature,a.pkp.classes.features.OrderListbuilderItemsFeature);a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.addFeatureHtml=function(c,b){var d,e,f,h,j,i,l;this.parent("addFeatureHtml",c,b);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),l=d.clone(),l.attr("value",i),a("td.first_column",j).append(l)};a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.storeRowOrder=function(a,b){var d,e;this.parent("storeRowOrder",a,b);d=b.find(".itemList");e=this.gridHandler.getListIdByRow(b);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,b,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,b,d){a=this.gridHandler.getListByRow(d.item);this.gridHandler.toggleListNoItemsRow(a,0,null)}})(jQuery);(function(a){a.pkp.classes.features.GeneralPagingFeature=function(a,b){b.defaultItemsPerPage=parseInt(b.defaultItemsPerPage,10);b.currentItemsPerPage=parseInt(b.currentItemsPerPage,10);b.itemsTotal=b.itemsTotal?parseInt(b.itemsTotal,10):0;b.currentPage=parseInt(b.currentPage,10);this.parent(a,b)};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(c){var b=this.getOptions();b.hasOwnProperty("filter")&&(b=a.parseJSON(b.filter),a.extend(!0,c,b));this.gridHandler.setFetchExtraParams(c)}})(jQuery);(function(a){a.pkp.classes.features.PagingFeature=function(a,b){this.parent(a,b)};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,b){a.append(b.pagingMarkup)};a.pkp.classes.features.PagingFeature.prototype.resequenceRows=function(){var a=this.gridHandler.getRows(),
b,d;b=this.getOptions();b=a.length-b.currentItemsPerPage;if(0<b)for(d=0;d<b;d++)this.gridHandler.deleteElement(a.first(),!0);return!1};a.pkp.classes.features.PagingFeature.prototype.refreshGrid=function(){var a=this.getOptions(),b,d;b=this.gridHandler.getFetchExtraParams();b[a.pageParamName]=a.currentPage;b[a.itemsPerPageParamName]=a.currentItemsPerPage;a=this.gridHandler.getRows().first();d=this.gridHandler.getRows().last();b.topLimitRowId=0==a.length?0:this.gridHandler.getRowDataId(a);b.bottomLimitRowId=
0==d.length?0:this.gridHandler.getRowDataId(d);this.setGridParams(b);return!1};a.pkp.classes.features.PagingFeature.prototype.replaceElementResponseHandler=function(c){var b,d;d=this.getOptions();void 0!=c.deletedRowReplacement&&(b=c.deletedRowReplacement,this.gridHandler.insertOrReplaceElement(b));void 0!=c.pagingInfo&&(b=c.pagingInfo,this.setOptions(b),this.gridHandler.replacePartialWith(b.pagingMarkup,a("div.gridPaging",this.getGridHtmlElement())),this.init());c.loadLastPage&&this.getGridHtmlElement().trigger("dataChanged");
void 0!=c.newTopRow&&(b=this.gridHandler.getRows(),d.currentItemsPerPage==b.length&&this.gridHandler.deleteElement(b.last(),!0),b=c.newTopRow,this.gridHandler.insertOrReplaceElement(b,!0));return!1};a.pkp.classes.features.PagingFeature.prototype.configPagingLinks_=function(){var c,b,d,e,f,h,j,i;c=this.getOptions();if(b=a("div.gridPaging",this.getGridHtmlElement())){i=this.callbackWrapper(function(b,d){h=RegExp("[?&]"+c.pageParamName+"(?:=([^&]*))?","i");j=h.exec(a(d.target).attr("href"));null!=j&&
(c.currentPage=parseInt(j[1],10),this.getGridHtmlElement().trigger("dataChanged"));return!1},this);b=b.find("a").not(".showMoreItems").not(".showLessItems");d=0;for(e=b.length;d<e;d++)f=a(b[d]),f.click(i)}};a.pkp.classes.features.PagingFeature.prototype.configItemsPerPageElement_=function(){var c,b,d,e,f,h;c=this.getOptions();if(b=a("div.gridPaging",this.getGridHtmlElement()))if(h=this.callbackWrapper(function(b,d){c.currentItemsPerPage=parseInt(a("option",d.target).filter(":selected").attr("value"),
10);c.currentPage=1;this.getGridHtmlElement().trigger("dataChanged");return!1},this),e=b.find("select.itemsPerPage"),f=[10,25,50,75,100],0>a.inArray(c.defaultItemsPerPage,f)&&f.push(c.defaultItemsPerPage),f.sort(function(a,c){return a-c}),c.itemsTotal<=f[0])a("div.gridItemsPerPage",b).hide();else{d=f.length-1;for(b=0;b<=d;b++)e.append(a('<option value="'+f[b]+'">'+f[b]+"</option>"));e.val(c.currentItemsPerPage.toString());e.change(h)}}})(jQuery);(function(a){a.pkp.classes.features.InfiniteScrollingFeature=function(a,b){this.parent(a,b)};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 c=a("div.scrollable",this.getGridHtmlElement());
c.length||(this.gridHandler.publishEvent("pkpObserveScrolling"),this.gridHandler.publishEvent("pkpRemoveScrollingObserver"));this.$scrollableElement_=c;this.observeScrollCallback_=this.gridHandler.callbackWrapper(this.observeScroll_,this);this.addScrollHandler_();this.fixGridHeight_();this.addPagingDataToRows_()};a.pkp.classes.features.InfiniteScrollingFeature.prototype.addFeatureHtml=function(a,b){a.append(b.pagingMarkup);a.find(".pkp_linkaction_moreItems").click(this.gridHandler.callbackWrapper(this.loadMoreItems_,
this))};a.pkp.classes.features.InfiniteScrollingFeature.prototype.refreshGrid=function(c){var b=this.getOptions(),d;d=this.gridHandler.getFetchExtraParams();d[b.pageParamName]=b.currentPage;c&&c!==a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID&&(c=this.gridHandler.getRowByDataId(c),1==c.length&&(d[b.pageParamName]=Number(c.attr("data-paging"))));d[b.itemsPerPageParamName]=b.currentItemsPerPage;this.setGridParams(d);return!1};a.pkp.classes.features.InfiniteScrollingFeature.prototype.replaceElementResponseHandler=
function(c){var b;this.getOptions();void 0!=c.deletedRowReplacement&&(b=c.deletedRowReplacement,this.gridHandler.insertOrReplaceElement(b),this.updatePagingDataInAllRows_());this.addScrollHandler_();void 0!=c.pagingInfo&&(c=c.pagingInfo,this.setOptions(c),void 0!=c.pagingMarkup&&a("div.gridPagingScrolling",this.getGridHtmlElement()).replaceWith(c.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(c){var b,d;if(this.getOptions().itemsTotal==this.gridHandler.getRows().length||!this.getGridHtmlElement().is(":visible"))return!1;a(c).hasClass("scrollable")?(b=a(c).height(),d=c.scrollHeight):(b=a.pkp.controllers.SiteHandler.prototype.getWindowDimensions(),b=b.height,d=this.getGridHtmlElement().offset().top+this.getGridHtmlElement().height());b+a(c).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 c=a("div.scrollable",this.getGridHtmlElement()),b,d,e,f;0<c.length&&(e=setInterval(function(){if(c.is(":visible")){clearInterval(e);f=c.length;for(b=0;b<f;b++)d=a(c[b]),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 c,b=this.getOptions(),d,e,f=1,h=1;c=this.gridHandler.getRows();c.removeAttr("data-paging");d=0;for(e=c.length;d<e;d++)a(c[d]).attr("data-paging",f),h++,h>b.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 b=this.getGridHtmlElement().find("div.gridPagingScrolling div.pkp_loading"),d=this.$scrollableElement_,b=b.height();a?(this.getGridHtmlElement().addClass("loading"),
a=d.scrollTop(),d.scrollTop(a+b)):this.getGridHtmlElement().removeClass("loading")};a.pkp.classes.features.InfiniteScrollingFeature.prototype.loadMoreItems_=function(){var c=this.getOptions();this.toggleLoadingContainer_(!0);c.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,b){this.parent(a,b)};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,b){a.find("div.grid_header_bar").prepend(b.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(c,b){this.parent(c,b);this.options_=b;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});b.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 c;c={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"};c="undefined"!==typeof a.pkp.plugins.tinymceplugin&&typeof a.pkp.plugins.tinymceplugin.tinymceParams?
a.extend({},c,a.pkp.plugins.tinymceplugin.tinymceParams):a.extend({},c);c.init_instance_callback=a.pkp.controllers.SiteHandler.prototype.triggerTinyMCEInitialized;c.setup=a.pkp.controllers.SiteHandler.prototype.triggerTinyMCESetup;tinyMCE.init(c)}};a.pkp.controllers.SiteHandler.prototype.triggerTinyMCEInitialized=function(c){a("#"+a.pkp.classes.Helper.escapeJQuerySelector(c.id)).trigger("tinyMCEInitialized",[c])};a.pkp.controllers.SiteHandler.prototype.triggerTinyMCESetup=function(c){var b=a("#"+
a.pkp.classes.Helper.escapeJQuerySelector(c.id));b.attr("readonly")&&(c.settings.readonly=!0);b.attr("wordCount")&&0<b.attr("wordCount")&&(c.settings.plugins+=",pkpwordcount",c.settings.statusbar=!0);b=b.attr("rows")||10;c.settings.height=(20*b).toString()+"px";c.on("init",function(c){var b=a("#"+c.id),f,h;f=a("#"+c.id).attr("placeholder");""!==f&&(h=a("<span></span>"),h.html(f),h.addClass("mcePlaceholder"),h.attr("id","mcePlaceholder-"+c.id),c.target.getContent().length&&h.hide(),c=a("<div></div>"),
c.addClass("mcePlaceholderParent"),b.wrap(c),b.parent().append(h))});c.on("activate",function(c){a("#mcePlaceholder-"+c.id).hide()});c.on("deactivate",function(c){c.target.getContent().length||a("#mcePlaceholder-"+c.id).show();c.target.dom.addClass(c.target.dom.select("li"),"show")});c.on("BeforeSetContent",function(b){var e=a.pkp.classes.TinyMCEHelper.prototype.getVariableMap("#"+a.pkp.classes.Helper.escapeJQuerySelector(c.id));b.content=b.content.replace(/\{\$([a-zA-Z]+)\}(?![^<]*>)/g,function(b,
d){return void 0!==e[d]?a.pkp.classes.TinyMCEHelper.prototype.getVariableElement(d,e[d],"#"+c.id).html():b})});c.on("SaveContent",function(c){var b=a("<div>"+c.content+"</div>");b.find(".pkpTag").replaceWith(function(){return"{$"+a(this).attr("data-symbolic")+"}"});c.content=b.html()});c.on("FullscreenStateChanged init",function(c){var c=c.target,b=a(c.editorContainer);c.plugins.fullscreen&&(c.plugins.fullscreen.isFullscreen()?b.find(".mce-toolbar[role='menubar']").show():b.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,b,d){window.location=d};a.pkp.controllers.SiteHandler.prototype.registerUnsavedFormElement_=function(c,b,d){c=a(d.target.lastElementChild).attr("id");-1==a.inArray(c,this.unsavedFormElements_)&&this.unsavedFormElements_.push(c)};a.pkp.controllers.SiteHandler.prototype.unregisterUnsavedFormElement_=function(c,
b,d){c=a(d.target.lastElementChild).attr("id");c=a.inArray(c,this.unsavedFormElements_);-1!==c&&delete this.unsavedFormElements_[c]};a.pkp.controllers.SiteHandler.prototype.unregisterAllFormElements_=function(){this.unsavedFormElements_=[]};a.pkp.controllers.SiteHandler.prototype.fetchNotificationHandler_=function(c,b,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,b,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(c,b){var d;if(!a.isEmptyObject(this.outsideClickChecks_))for(d in this.outsideClickChecks_)this.processOutsideClickCheck_(this.outsideClickChecks_[d],
b);return!0};a.pkp.controllers.SiteHandler.prototype.processOutsideClickCheck_=function(a,b){if("click"!==b.type&&"mousedown"!==b.type&&"mouseup"!==b.type)throw Error("Can not check outside click with the passed event: "+b.type+);var d=a.container;return d.is(":hidden")?!1:0===d.has(b.target).length?(delete this.outsideClickChecks_[d.attr("id")],a.callback(),!0):!1};a.pkp.controllers.SiteHandler.prototype.pageUnloadHandler_=function(){var c,b,d;c=a.pkp.classes.Handler.getHandler(a("body"));b=0;
for(d in c.unsavedFormElements_)d&&b++;if(0<b)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,b){this.showNotification_(b)};a.pkp.controllers.SiteHandler.prototype.showNotification_=function(a){var b,d,a=this.handleJson(a);if(!1!==a&&a.content.general)for(b in a=a.content.general,
a)for(d in a[b])new PNotify(a[b][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(c,b,d,e){a(document).scroll(e);return!1};a.pkp.controllers.SiteHandler.prototype.unregisterScrollingObserver_=
function(c,b,d,e){a(document).unbind("scroll",e);return!1}})(jQuery);(function(a){a.pkp.controllers.UrlInDivHandler=function(a,b){this.parent(a,b);this.sourceUrl_=b.sourceUrl;this.reload();b.refreshOn&&this.bindGlobal(b.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(c,b){var d=this.handleJson(b),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(c,b){this.parent(c,b);a(".toggleExtras",c).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,b){var d=this.getHtmlElement(),e;b.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,b){var d,e,f;d=a.position().top;e=b.position().top;f=parseInt(b.scrollTop(),10);d>e?(d=Math.ceil(d+a.height()-b.height()),0<d&&b.scrollTop(f+d)):(f=Math.max(Math.floor(f+d-e),0),b.scrollTop(f))}})(jQuery);(function(a){a.pkp.controllers.PageHandler=function(a,b){this.parent(a,b);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,b,d){window.location=d};a.pkp.controllers.PageHandler.prototype.redirectNotifyUserEventHandler_=
function(c,b,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(c,b,d){var c=a("a",b.target),e=a.pkp.classes.Handler.getHandler(c).getUrl(),c=a(".pkp_controllers_grid",this.getHtmlElement()).filter(function(){var c=0;a(this).find("a").each(function(){a(this).attr("href")==e&&c++});return 0<c});0<c.length&&c.each(function(){a(this).trigger("dataChanged",
[d])})}})(jQuery);(function(a){a.pkp.controllers.TabHandler=function(a,b){var d,e,f;this.parent(a,b);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);b.emptyLastTab&&(this.emptyLastTab_=b.emptyLastTab);d=document.location.toString();if(d.match("#")){d=
d.split("#")[1];e=a.find("li a");for(f=0;f<e.length;f++)d==e[f].getAttribute("name")&&(b.selected=f)}a.tabs({ajaxOptions:{dataType:"json",cache:!1,dataFilter:this.callbackWrapper(this.dataFilter)},disabled:b.disabled,active:b.selected});window.addEventListener("hashchange",function(b){b=b.newURL.split("#");2>b.length||(b=b[1],b=a.find('li > a[name="'+b+'"]'),b.length&&b.click())},!1)};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 c=!1;this.$currentTab_.find("form").each(function(){if(a.pkp.classes.Handler.getHandler(a("#"+a(this).attr("id"))).formChangesTracked)return c=!0,!1});this.$currentTab_.find(".hasDatepicker").datepicker("hide");if(c)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(c,b,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(c,b,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(c,b,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(c,b){var d=this.handleJson(a.parseJSON(b));return!1===d?"":JSON.stringify(d.content)};a.pkp.controllers.TabHandler.prototype.tabsReloadRequested=function(c,b,d){this.getHtmlElement();var e=this;a.get(d.tabsUrl,function(a){e.replaceWith(a.content)})};
a.pkp.controllers.TabHandler.prototype.addTab=function(c,b,d){var e=this.getHtmlElement(),c=e.children("ul").children("li").length+1,b=a("<a/>").text(d.title).attr("href",d.url),d=a("<a/>").addClass("close").text(a.pkp.locale.common_close).attr("href","#"),b=a("<li/>").append(b).append(d);d.click(function(){var c=a(this).closest("li"),b=a("#"+c.attr("aria-controls")),d,i;i=!1;b.find("form").each(function(){if(a.pkp.classes.Handler.getHandler(a(this)).formChangesTracked&&!confirm(a.pkp.locale.form_dataHasChanged))return i=
!0,!1});i||(b.find("form").each(function(){var c=a.pkp.classes.Handler.getHandler(a(this));c&&c.unregisterForm()}),d=c.eq(0).index(),e.tabs("option","active")==d&&e.tabs("option","active",d-1),c.remove(),b.remove(),e.tabs("refresh"))});e.children("ul").append(b);e.tabs("refresh");e.tabs("option","active",c-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(c,b){this.parent(c,b);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(c){a(c.currentTarget).attr("aria-expanded","true")});this.getHtmlElement().on("blur mouseleave",'[aria-haspopup="true"]',function(c){a(c.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 c=Math.max(document.documentElement.clientWidth,window.innerWidth||0),b=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()>c?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>b&&(j-=b,i=f-j,i<h&&(j=0<h?h:-Math.abs(j)-i,e.css("overflow-y","scroll"),e.css("bottom",-Math.abs(b-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(c,b){this.parent(c,b);if(!c.is("div"))throw Error("An uploader widget controller can only be attached to a div!");var d,e,f;d={url:b.uploadUrl,flash_swf_url:b.baseUrl+"/lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.swf",silverlight_xap_url:b.baseUrl+"/lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.xap"};typeof b.filters&&(d.filters=b.filters);typeof b.resize&&(d.resize=b.resize);typeof b.browse_button&&(d.browse_button=b.browse_button);typeof b.multipart_params&&
(d.multipart_params=b.multipart_params);d=a.extend({},this.self("DEFAULT_PROPERTIES_"),d);this.pluploader=new plupload.Uploader(d);this.pluploader.init();this.updateStatus("waiting");this.$progress=c.find(".pkpUploaderProgress .percentage");this.$progressBar=c.find(".pkpUploaderProgressBar");this.$fileName=c.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,b){1<b.files.length&&b.removeFile(b.files[0]);this.updateStatus("uploading");b.start()};a.pkp.controllers.UploaderHandler.prototype.updateProgress=function(a,b,d){this.$progress.html(d.percent);this.$progressBar.css("width",d.percent+"%")};a.pkp.controllers.UploaderHandler.prototype.uploadComplete=function(c,b,d,e){c=a.parseJSON(e.response);b=d.name;c.status?("undefined"!==typeof c.uploadedFile&&(b=c.uploadedFile.name||
c.uploadedFile.fileLabel,d.storedData=c.uploadedFile),this.$fileName.html(b),this.updateStatus("complete"),this.$progress.html("0"),this.$progressBar.css("width",0)):this.showError(c.content)};a.pkp.controllers.UploaderHandler.prototype.handleError=function(a,b,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,b){b.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(c,b){var d;this.parent(c,b);this.sourceUrl_=b.sourceUrl;b.sourceUrl=void 0;this.disableSync_=b.disableSync;d={};d.source=this.callbackWrapper(this.fetchAutocomplete);d.appendTo="#"+c.attr("id");d=a.extend({},this.self("DEFAULT_PROPERTIES_"),d,b);this.textInput=c.find(":text");this.disableSync_||this.textInput.keyup(this.callbackWrapper(this.synchronizeFields_));this.textInput.autocomplete(d);this.hiddenInput_=c.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.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,b,d){a=this.hiddenInput_;b=this.textInput;""!==d.item.value&&(a.val(d.item.value),b.val(d.item.label));return!1};a.pkp.controllers.AutocompleteHandler.prototype.itemFocused=function(a,b,d){a=this.textInput;""!==d.item.value&&a.val(d.item.label);return!1};a.pkp.controllers.AutocompleteHandler.prototype.fetchAutocomplete=function(c,b,d){var e;e=this.textInput;e.addClass("spinner");a.post(this.getAutocompleteUrl(),{term:b.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(c,b){this.parent(c,b);c.outerHeight()>b.height&&(c.addClass("isHidden").css("max-height",b.height+"px"),a(".revealMoreButton",c).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,b){this.getHtmlElement().removeClass("isHidden").removeAttr("style");b.preventDefault();b.stopPropagation()}})(jQuery);(function(a){a.pkp.controllers.NotificationHandler=function(a,b){this.parent(a,b);this.options_=b;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 c={};c.requestOptions=this.options_.requestOptions;a.ajax({type:"POST",url:this.options_.fetchNotificationUrl,data:c,success:this.callbackWrapper(this.showNotificationResponseHandler_),dataType:"json",async:!1})};a.pkp.controllers.NotificationHandler.prototype.showNotificationResponseHandler_=function(c,b){clearTimeout(this.trivialTimer_);var d=this.getHtmlElement(),e=this.handleJson(b),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 c=this.getHtmlElement(),b=c.offset().top+this.getHtmlElement().height()/2,d=a(window).scrollTop(),e=d+a(window).height(),f=c.parents(".ui-dialog-content");return 0<f.length&&(c=f.offset().top,f=c+f.height(),b<c||b>f)?!1:b<d||b>e?!1:!0};a.pkp.controllers.NotificationHandler.prototype.removeAlreadyShownNotifications_=function(c){var b=!0,d,e,f;for(d in c.content.inPlace)for(e in c.content.inPlace[d])f=
a("#pkp_notification_"+e),0<f.length?(delete c.content.inPlace[d][e],delete c.content.general[d][e]):b=!1;return b?!1:c};a.pkp.controllers.NotificationHandler.prototype.concatenateNotifications_=function(a){var b="",d,e;for(d in a)for(e in a[d])b+=a[d][e];return b};a.pkp.controllers.NotificationHandler.prototype.getTrivialNotifications_=function(a){var b=[],d,e;for(d in a)if(1==d)for(e in a[d])b.push(e);return b};a.pkp.controllers.NotificationHandler.prototype.addTimerToNotifications=function(c){var b,
d;b=this;d=function(){var c=a(this);b.unbindPartial(c);c.remove()};c.length&&(this.trivialTimer_=setTimeout(function(){var b,f;for(b in c)f=a("#pkp_notification_"+c[b]),f.fadeOut(400,d)},6E3))}})(jQuery);(function(a){a.pkp.controllers.HelpPanelHandler=function(c,b){this.parent(c,{});a("body").click(function(b){var e=a(b.target);if(e.hasClass("requestHelpPanel")||e.parents(".requestHelpPanel").length)b.preventDefault(),b=a.extend({},e.data(),{caller:e}),c.trigger("pkp.HelpPanel.Open",b)});c.find(".pkpCloseHelpPanel").click(function(a){a.preventDefault();c.trigger("pkp.HelpPanel.Close")});c.find(".pkpHomeHelpPanel").click(function(a){a.preventDefault();c.trigger("pkp.HelpPanel.Home")});c.find(".pkpPreviousHelpPanel").click(this.callbackWrapper(function(){this.loadHelpContent_(this.previousTopic_,
this.helpLocale_)}));c.find(".pkpNextHelpPanel").click(this.callbackWrapper(function(){this.loadHelpContent_(this.nextTopic_,this.helpLocale_)}));c.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_=b.helpUrl;this.helpLocale_=b.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(c,b,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(c,b){b=b||this.helpLocale_;this.currentTopic_=c||"";var d=this.helpUrl_+"/index/"+b+"/";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,b){var d=this.handleJson(b).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(c,b){var d=a(c).attr("href");b.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 c=this.getHtmlElement();c.removeClass("is_visible");a("body").removeClass("help_panel_is_visible");c.find(".content").empty();null!==this.caller_&&
this.caller_.focus();c.off("click.pkp.HelpPanel keyup.pkp.HelpPanel");c.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(c,b){var d=this.getHtmlElement();"click"==b.type&&d.is(a(b.target))?d.trigger("pkp.HelpPanel.Close"):"keyup"==b.type&&27==b.which&&d.trigger("pkp.HelpPanel.Close")}})(jQuery);(function(a){a.pkp.controllers.form=a.pkp.controllers.form||{};a.pkp.controllers.form.FormHandler=function(c,b){var d;this.parent(c,b);if(!c.is("form"))throw Error("A form handler controller can only be bound to an HTML form element!");b.submitHandler&&(this.callerSubmitHandler_=b.submitHandler);c.find(".datepicker").each(function(){var c=a(this);c.datepicker({altField:"#"+c.prop("id")+"-altField",altFormat:"yy-mm-dd",dateFormat:a("#"+c.prop("id")+"-altField").attr("data-date-format")});c.prop("name",
c.prop("name")+"-removed")});b.cancelRedirectUrl&&(this.cancelRedirectUrl_=b.cancelRedirectUrl);"undefined"!==typeof b.trackFormChanges&&(this.trackFormChanges=b.trackFormChanges);b.disableControlsOnSubmit&&(this.disableControlsOnSubmit=b.disableControlsOnSubmit);b.enableDisablePairs&&(this.enableDisablePairs_=b.enableDisablePairs,this.setupEnableDisablePairs());for(d in this.enableDisablePairs_)c.find("[id^='"+d+"']").trigger("updatePair");d=c.validate({onfocusout:this.callbackWrapper(this.onFocusOutValidation_),
errorClass:"error",highlight:function(c,b){a(c).parent().parent().addClass(b)},unhighlight:function(c,b){a(c).parent().parent().removeClass(b)},submitHandler:this.callbackWrapper(this.submitHandler_),showErrors:this.callbackWrapper(this.showErrors)});a("[id^='cancelFormButton-']",c).click(this.callbackWrapper(this.cancelForm));c.find(".showMore, .showLess").bind("click",this.switchViz);d.checkForm()?this.trigger("formValid"):this.trigger("formInvalid");a(".pkpEditableToggle",c).click(this.callbackWrapper(this.toggleEditableControl));
this.initializeTinyMCE();a("[id^='submitFormButton']",c).click(this.callbackWrapper(this.pushTinyMCEChanges_));a(":input",c).change(this.callbackWrapper(this.formChange));this.bind("formChange",this.callbackWrapper(this.formChange));c.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(c){"undefined"!==
typeof tinyMCE&&tinyMCE.EditorManager.triggerSave();var b=a.extend(!0,{},c);setTimeout(this.callbackWrapper(function(){b.defaultShowErrors();b=null}),250);c.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 c=this.getHtmlElement(),b;for(b in this.enableDisablePairs_)a(c).find("[id^='"+b+"']").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(c,b){b.preventDefault();var d=a(c).parents('[data-pkp-editable="true"]');d.length&&d.toggleClass("isEditing")};a.pkp.controllers.form.FormHandler.prototype.submitHandler_=function(c,b){var d=!1;a(b).find(".formWidget").each(function(){var c=new a.Event("formSubmitRequested");d||(a(this).trigger(c),d=c.isDefaultPrevented())});d||(a(b).find(".datepicker").each(function(){""===
a(this).prop("value")&&a("#"+a(this).prop("id")+"-altField").prop("value","")}),this.showSpinner_(),this.trigger("unregisterChangedForm"),null!==this.callerSubmitHandler_?(this.formChangesTracked=!1,this.callbackWrapper(this.callerSubmitHandler_).call(c,b)):this.submitFormWithoutValidation(c))};a.pkp.controllers.form.FormHandler.prototype.pushTinyMCEChanges_=function(){"undefined"!==typeof tinyMCE&&tinyMCE.EditorManager.triggerSave();return!0};a.pkp.controllers.form.FormHandler.prototype.toggleDependentElement_=
function(c){var b,d;b=this.getHtmlElement();d=a(c).attr("id");b=a(b).find("[id^='"+this.enableDisablePairs_[d]+"']");a(c).is(":checked")?a(b).prop("disabled",!1):a(b).prop("disabled",!0);return!0};a.pkp.controllers.form.FormHandler.prototype.tinyMCEInitHandler_=function(c,b,d){var e=d.id;d.on("blur",this.callbackWrapper(function(c){c.save();var c=this.getHtmlElement(),b=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(e),c);c.validate().element(b)}))};a.pkp.controllers.form.FormHandler.prototype.containerCloseHandler=
function(c,b,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(c,b){var d=this.getHtmlElement();a(b).parents("#"+d.attr("id")).length&&c.element(b);return!0};a.pkp.controllers.form.FormHandler.prototype.hideDatepicker_=
function(c,b){var d,e;d=b.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,b){this.parent(a,b);this.eventName_=b.eventName;this.defaultKey_=b.defaultKey;this.publishEvent(this.eventName_);this.getOptionsUrl_=b.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(c){this.trigger(this.eventName_,[a(c).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(c,b){var d=this.handleJson(b),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,b){b.submitHandler=this.submitForm;this.parent(a,b);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 c=this.getHtmlElement();this.disableFormControls();
a.post(c.attr("action"),c.serialize(),this.callbackWrapper(this.handleResponse),"json")};a.pkp.controllers.form.AjaxFormHandler.prototype.refreshFormHandler_=function(a,b,d){d&&this.replaceWith(d)};a.pkp.controllers.form.AjaxFormHandler.prototype.handleResponse=function(c,b){var d,e;e=this.handleJson(b);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,b){b.submitHandler=this.submitForm;this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.ClientFormHandler,a.pkp.controllers.form.FormHandler);a.pkp.controllers.form.ClientFormHandler.prototype.submitForm=function(){var c;c=this.getHtmlElement().serializeArray();c.push({name:"clientSubmit",value:!0});this.trigger("formSubmitted",[a.param(c)])}})(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,b){this.parent(a,b);if(void 0===b.readOnly||null===b.readOnly)void 0!==b.resetUploader&&(this.resetUploader_=b.resetUploader),void 0!==b.$preview&&b.$preview.length&&(this.$preview=b.$preview,this.bind("fileDeleted",this.callbackWrapper(this.fileDeleted))),this.attachUploader_(b.$uploader,b.uploaderOptions),this.uploaderSetup(b.$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(c,b){var d;this.resetUploader_&&(d=a("#plupload",this.getHtmlElement()).plupload("getUploader"),d.splice(),d.refresh(),a("#temporaryFileId",this.getHtmlElement()).val(""));return this.parent("handleResponse",c,b)};a.pkp.controllers.form.FileUploadFormHandler.prototype.uploaderSetup=
function(c){a.pkp.classes.Handler.getHandler(c).pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse))};a.pkp.controllers.form.FileUploadFormHandler.prototype.handleUploadResponse=function(c,b,d,e){c=this.handleJson(a.parseJSON(e.response));!1!==c&&(this.trigger("fileUploaded",[c.uploadedFile]),this.$preview&&this.$preview.hide(),""===c.content?(b=this.getHtmlElement(),b=b.find("#temporaryFileId"),b.val(c.temporaryFileId)):this.replaceWith(c.content))};a.pkp.controllers.form.FileUploadFormHandler.prototype.fileDeleted=
function(){this.$preview&&this.$preview.hide()};a.pkp.controllers.form.FileUploadFormHandler.prototype.attachUploader_=function(a,b){a.pkpHandler("$.pkp.controllers.UploaderHandler",b)}})(jQuery);(function(a){a.pkp.controllers.form.MultilingualInputHandler=function(a,b){this.parent(a,b);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 c=this.getHtmlElement(),b=[],d=0;"undefined"!==typeof tinyMCE&&(this.getHtmlElement().find(".richContent").length?c.find("textarea").each(function(){a(this).attr("id");b.push(a(this));tinyMCE.EditorManager.get(a(this).attr("id")).getContent()&&d++}):(b=c.find(":input"),b.each(function(){a(this).val()&&d++})),0<d&&d<b.length?c.removeClass("localizationComplete").addClass("localizationIncomplete"):d===b.length?c.removeClass("localizationIncomplete").addClass("localizationComplete"):c.removeClass("localizationIncomplete localizationComplete"))};
a.pkp.controllers.form.MultilingualInputHandler.prototype.tinyMCEInitHandler_=function(){if(this.getHtmlElement().find(".richContent").length&&"undefined"!==typeof tinyMCE){var c=this.getHtmlElement(),b=tinyMCE.EditorManager.get(c.find("textarea").first().attr("id"));b.on("focus",this.callbackWrapper(function(){this.trigger("callWhenClickOutside",{container:this.getHtmlElement(),callback:this.callbackWrapper(this.hidePopover_)});this.showPopover_()}));b.on("blur",this.callbackWrapper(function(){if(a(b.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(c,b){var d=this;this.parent(c,b);this.cancelUrl_=b.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,b){this.handleCancelAction();return this.parent("containerCloseHandler",a,b)};a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.submitForm=function(a,b){this.isComplete_=!0;this.parent("submitForm",a,b)};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(c,b){this.parent(c,b);var d,e,f;d=c.find("#activeThemeOptions");d.length&&(f=this,c.find("#themePluginPath").change(function(){f.unbindPartial(d);d.empty()}),d.find('input[type="color"]').each(function(){var c=a(this);c.spectrum({preferredFormat:"hex",showInitial:!0,showInput:!0,showButtons:!1,change:function(a){e=a.toHexString();c.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(c,b){this.parent(c,b);b.fetchUsernameSuggestionUrl&&b.usernameSuggestionTextAlert&&(this.fetchUsernameSuggestionUrl_=b.fetchUsernameSuggestionUrl,this.usernameSuggestionTextAlert_=b.usernameSuggestionTextAlert);a('[id^="suggestUsernameButton"]',c).click(this.callbackWrapper(this.generateUsername));b.hideNonReviewerInterests&&(a('[id^="reviewerGroup-"]',c).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(c,b){b.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(c,b){var d=this.handleJson(b),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 c=
this.getHtmlElement(),b=a("#interests",c);a('[id^="reviewerGroup-"]:checked',c).size()?b.show(300):b.hide(300)}})(jQuery);(function(a){a.pkp.controllers.form.reviewer=a.pkp.controllers.form.reviewer||{};a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler=function(a,b){this.parent(a,b);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 c=
this.getHtmlElement().find('[id^="comments"]');1==a("#reviewAttachmentsGridContainer").find("tbody.empty:visible").length?c.attr("required","1"):c.removeAttr("required");return!0}})(jQuery);(function(a){a.pkp.controllers.grid=a.pkp.controllers.grid||{};a.pkp.controllers.grid.GridHandler=function(a,b){this.parent(a,b);this.initialize(b);this.initFeatures_(b.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(c){return a("#"+this.getRowIdPrefix()+a.pkp.classes.Helper.escapeJQuerySelector(String(c)),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(c){return c.hasClass("gridRow")?(c=c.parents("tbody:first"),a(".gridRow",
c)):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(c,b){b.preventDefault();a(c).toggleClass("show_extras");a(c).toggleClass("hide_extras");var d=a(c).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 c,b,d;c=a(".gridRow div.row_actions",this.getHtmlElement());c.hide();b=0;for(d=c.length;b<d;b++)a(c[b])};a.pkp.controllers.grid.GridHandler.prototype.showRowActionsDiv=function(){a(".gridRow div.row_actions",this.getHtmlElement()).show()};a.pkp.controllers.grid.GridHandler.prototype.changeLinkActionsState=function(c,b){void 0===b&&(b=a(".pkp_controllers_linkAction",this.getHtmlElement()));b.each(function(){var b;b=a.pkp.classes.Handler.getHandler(a(this));
c?b.enableLink():b.disableLink()})};a.pkp.controllers.grid.GridHandler.prototype.resequenceRows=function(c){var b,d,e;if(c){for(d in c){b=c[d];e=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(String(b)));0==e.length&&(e=this.getRowByDataId(b));if(0==e.length)throw Error("Row with id "+b+" not found!");this.addElement(e)}this.updateControlRowsPosition();this.callFeaturesHook("resequenceRows",c)}};a.pkp.controllers.grid.GridHandler.prototype.updateControlRowsPosition=function(){var c,b,d,e,f;c=this.getRows();
b=0;for(d=c.length;b<d;b++)e=a(c[b]),f=this.getControlRowByGridRow(e),0<f.length&&f.insertAfter(e)};a.pkp.controllers.grid.GridHandler.prototype.insertOrReplaceElement=function(c,b){var d,e,f;d=a(c);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,b),this.activateRowActions_()):a.get(this.fetchGridUrl_,null,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.deleteElement=function(a,b){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!=b&&b?f():a.fadeOut(500,f)};a.pkp.controllers.grid.GridHandler.prototype.initialize=function(c){var b;this.bind("dataChanged",this.refreshGridHandler);this.bind("addRow",this.addRowHandler_);this.bind("formSubmitted",this.refreshGridWithFilterHandler_);this.gridId_=c.gridId;this.fetchRowUrl=c.fetchRowUrl;this.fetchRowsUrl=c.fetchRowsUrl;this.fetchGridUrl_=c.fetchGridUrl;this.bodySelector=0<a("div.scrollable",this.getHtmlElement()).length?"div.scrollable table":c.bodySelector;
this.activateRowActions_();this.setFetchExtraParams({});this.getHtmlElement().find(".pkp_form").hide();b=this.getHtmlElement().find(".pkp_linkaction_search");0!==b.length?b.click(this.callbackWrapper(function(){this.getHtmlElement().find(".pkp_form").toggle();b.toggleClass("is_open")})):this.getHtmlElement().find(".pkp_form").toggle();this.trigger("gridInitialized")};a.pkp.controllers.grid.GridHandler.prototype.callFeaturesHook=function(c,b){var d;a.isArray(b)||(b=[b]);for(d in this.features_)this.features_[d][c].apply(this.features_[d],
b)};a.pkp.controllers.grid.GridHandler.prototype.refreshGridHandler=function(c,b,d,e){this.callFeaturesHook("refreshGrid",d);c=this.getFetchExtraParams();e||(d?d==a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID?a.get(this.fetchRowsUrl,c,this.callbackWrapper(this.replaceElementResponseHandler),"json"):(c.rowId=d,a.get(this.fetchRowUrl,c,this.callbackWrapper(this.replaceElementResponseHandler),"json")):a.get(this.fetchGridUrl_,c,this.callbackWrapper(this.replaceGridResponseHandler_),"json"));this.trigger("gridRefreshRequested");
this.publishChangeEvents()};a.pkp.controllers.grid.GridHandler.prototype.addElement=function(a,b,d){if(void 0===b||null===b)b=this.getHtmlElement().find(this.bodySelector);void 0!=d&&d?b.prepend(a):b.append(a);this.getEmptyElement(a).hide();this.callFeaturesHook("addElement",a)};a.pkp.controllers.grid.GridHandler.prototype.replaceElement=function(a,b){b.hasClass("gridRow")&&this.deleteControlsRow_(a);this.replacePartialWith(b,a);this.callFeaturesHook("replaceElement",b)};a.pkp.controllers.grid.GridHandler.prototype.hasSameNumOfColumns=
function(a,b){var d,e;d=this.getHtmlElement().find("th").length;e=a.first().find("td");e=b?e.attr("colspan"):e.length;return d==e};a.pkp.controllers.grid.GridHandler.prototype.replaceElementResponseHandler=function(c,b){var d,e,f,h,j,i,l;e=this.handleJson(b);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(l=
d.length;i<l;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(c,b,d){a.post(this.fetchGridUrl_,d,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.addRowHandler_=function(c,b,d){a.get(this.fetchRowUrl,
d,this.callbackWrapper(this.replaceElementResponseHandler),"json")};a.pkp.controllers.grid.GridHandler.prototype.replaceGridResponseHandler_=function(c,b){var d,e,f;d=this.handleJson(b);!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(c){c=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(c.attr("id"))+"-control-row",this.getHtmlElement());c.is("tr")&&c.hasClass("row_controls")&&(this.unbindPartial(c),c.remove())};a.pkp.controllers.grid.GridHandler.prototype.getControlRowByGridRow=function(c,b){var d,e;e=void 0===b||null===b?this.getHtmlElement().find("tr"):b;d=c.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,b){this.features_||(this.features_=[]);this.features_[a]=b};a.pkp.controllers.grid.GridHandler.prototype.initFeatures_=
function(c){var b,d;for(b in c)d=c[b].JSClass,null!==d&&(d=a.pkp.classes.Helper.objectFactory(d,[this,c[b].options]),this.addFeature_(b,d),this.features_[b].init())}})(jQuery);(function(a){a.pkp.controllers.grid.CategoryGridHandler=function(a,b){this.parent(a,b)};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(c){return a("#"+this.getCategoryIdPrefix()+c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryRow=function(c){var b=this.getHtmlElement();void 0!==c&&(b=c);return a("tr.category",b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowsInCategory=function(c){return a("tr.gridRow",c).not(".category")};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryEmptyPlaceholder=function(c){c="#"+c.attr("id")+"-emptyPlaceholder";return a(c,this.getHtmlElement())};
a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataId=function(a){var a=a.attr("id"),b=this.getCategoryIdPrefix().length;return a.slice(b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataIdByRowId=function(c){c=c.replace(this.getCategoryIdPrefix()," ");c=c.match("(.*)-row");return a.trim(c[1])};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowIdPrefix=function(){return this.getGridIdPrefix()+"-category-"};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowByDataId=
function(c,b){this.parent("getRowByDataId",c,b);return a("#"+this.getRowIdPrefix()+b+"-row-"+c,this.getHtmlElement())};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowDataId=function(c){c=c.attr("id").slice(this.getRowIdPrefix().length);c=c.match("-row-(.*)");return a.trim(c[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(c){var b,d;for(d in c)b=c[d],b=a("#"+b),this.appendCategory(b);this.updateEmptyPlaceholderPosition()};a.pkp.controllers.grid.CategoryGridHandler.prototype.updateEmptyPlaceholderPosition=function(){var c=this.getCategories(),b,d,e,f;b=0;for(d=c.length;b<d;b++)e=a(c[b]),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(c,b,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",c,b,d,e)};a.pkp.controllers.grid.CategoryGridHandler.prototype.deleteElement=function(c){var b,d,e,f;if(1<c.length&&(2==c.length&&(c.hasClass("category_grid_body")&&c.hasClass("category"))&&(c=c.filter(".category_grid_body")),
this.currentCategoryId_)){b=this.getCategoryByDataId(this.currentCategoryId_);d=0;for(e=c.length;d<e;d++)if(f=a(c[d]).parents("#"+b.attr("id")),1===f.length){c=a(c[d]);break}}c.hasClass("category_grid_body")&&(b=this.getCategoryEmptyPlaceholder(c),this.unbindPartial(b),b.remove());this.parent("deleteElement",c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.addElement=function(a){var b=null;a.hasClass("gridRow")&&(b=this.getCategoryDataIdByRowId(a.attr("id")),b=this.getCategoryByDataId(b));
this.parent("addElement",a,b);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,b){if(b.hasClass("category_grid_body")){var d=this.getCategoryEmptyPlaceholder(a);this.unbindPartial(d);d.remove()}this.parent("replaceElement",a,b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.hasSameNumOfColumns=function(a){var b=a,d=!1;a.hasClass("category_grid_body")&&
(b=a.find("tr"),d=!0);return this.parent("hasSameNumOfColumns",b,d)}})(jQuery);(function(a){a.pkp.controllers.listbuilder=a.pkp.controllers.listbuilder||{};a.pkp.controllers.listbuilder.ListbuilderHandler=function(a,b){this.parent(a,b)};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 c=this.getHtmlElement().find("input.deletions").val(),b=[],d,e,f=this;this.getHtmlElement().find('.gridRow input.isModified[value="1"]').each(function(c,d){var e=a(d).parents(".gridRow"),e=f.buildParamsFromInputs_(e.find(":input"));
b.push(e)});d=this.getRows().length;c=JSON.stringify({deletions:c,changes:b,numberOfRows:d});(d=this.getSaveUrl_())?a.post(d,{data:c},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",c))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRow=
function(c){c.addClass("saveRowResponsePlaceholder");c=this.buildParamsFromInputs_(c.find(":input"));c.modify=!0;this.disableControls();a.ajax({url:this.getFetchRowUrl(),data:c,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(c){this.closeEdits();var b=a(c),c=b.closest(".gridRow"),b=b.closest(".pkp_controllers_listbuilder").find(".deletions"),d=c.find('input[name="rowId"]').val();void 0!==d&&(b.val(b.val()+" "+d),this.getHtmlElement().trigger("formChange"));
this.deleteElement(c);this.availableOptions_=!0;return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.appendRowResponseHandler_=function(c,b){var d=this.handleJson(b);!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(c,b){var d=this.handleJson(b),e=this.getHtmlElement(),f=[],h,j,i,l,k,p,n,r,m,s;if(!1!==d){e.find(".gridCellDisplay :input").each(function(c,b){f[c]=a(b).val()});e=e.find(".gridRowEdit:visible .selectMenu:input");h=0;for(j=e.length;h<j;h++){i=a(e[h]);l=i.parents(".gridCellContainer");k=0;i.children().empty();p=null;for(p in d.content[h])if(p!=
a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL)if("object"==typeof d.content[h][p]){if(void 0!==d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&"object"==typeof d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&(r=d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL][p])){m=a("<optgroup></optgroup>");m.attr("label",r);i.append(m);r=null;s=0;for(r in d.content[h][p])if(n=this.populatePulldown_(m,f,d.content[h][p][r],r))k++,s++;0===s&&m.remove()}}else(n=this.populatePulldown_(i,f,d.content[h][p],p))&&
k++;i=n;1===k&&i&&(i.attr("selected","selected"),this.availableOptions_=!1);0===k&&(l.find(".gridCellDisplay").show(),l.find(".gridCellEdit").hide())}}this.enableControls();return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.populatePulldown_=function(c,b,d,e){var f=c.parents(".gridCellContainer").find(".gridCellDisplay :input").val(),h=!1,j;if(e!=f)for(j=0;j<b.length;j++)b[j]==e&&(h=!0);if(h)return!1;b=a("<option/>");b.attr("value",e);b.text(d);e==f&&b.attr("selected","selected");
c.append(b);return b};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.editItemHandler_=function(c){this.closeEdits();this.editItemCallingContext_=c;setTimeout(this.callbackWrapper(function(){var c=a(this.editItemCallingContext_).closest(".gridRow");c.addClass("gridRowEdit");c.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(c){var b={};a.each(c.serializeArray(),function(c,e){var f=e.name,h=e.value;b[f]=void 0===b[f]?h:a.isArray(b[f])?b[f].concat(h):[b[f],h]});return b};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.inputKeystrokeHandler_=function(c,b){var d,e,f;return 13==b.which?(d=a(c),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(c){a(c).closest(".gridRow").addClass("editingRowPlaceholder");setTimeout(this.callbackWrapper(function(){var c=a(".editingRowPlaceholder"),d=!1;c.find(":input").each(function(a,c){c===document.activeElement&&(d=!0)});c.removeClass("editingRowPlaceholder");d||this.closeEdits()}),0);return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRowResponseHandler_=function(c,b){var d=this.handleJson(b),
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,b){this.parent(a,b)};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(c){jQuery();var b,d;if(!a.isArray(c))throw Error("Lists id must be passed using an array object!");for(b in c)d=this.getListById(c[b]),this.$lists_=this.$lists_?this.$lists_.add(d):d};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getListById=function(c){c=this.getGridIdPrefix()+"-table-"+c;return a("#"+c,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 b=this.getGridIdPrefix()+"-table-";return a.attr("id").slice(b.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,b,d){var e=this.getListNoItemsRow(a),f=this.getRowsByList(a);d&&(f=f.not(d));f.length==b?(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(c,b){this.parent(c,b);if(!this.checkOptions(b))throw Error("Missing or invalid modal options!");var d=a.extend(!0,{},b);this.options=this.mergeOptions(d);c.html(this.modalBuild()[0].outerHTML);this.modalOpen(c);c.find(".pkpModalCloseButton").click(this.callbackWrapper(this.modalClose));c.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(c){return a.extend(!0,{},this.self("DEFAULT_OPTIONS_"),c)};a.pkp.controllers.modal.ModalHandler.prototype.modalBuild=function(){var c=a('<div class="pkp_modal_panel"></div>');"undefined"!==this.options.title&&c.append('<div class="header">'+this.options.title+"</div>");
this.options.canClose&&c.append('<a href="#" class="close pkpModalCloseButton"><span class="pkp_screen_reader">'+this.options.closeButtonText+"</span></a>");c.append('<div class="content"></div>');c.attr("role","dialog").attr("aria-label",this.options.title);return c};a.pkp.controllers.modal.ModalHandler.prototype.modalOpen=function(c){a("body").append(c);setTimeout(function(){c.addClass("is_visible")},10);setTimeout(function(){c.focus()},300);c.trigger("pkpModalOpen",[c])};a.pkp.controllers.modal.ModalHandler.prototype.modalClose=
function(){var a=this,b=this.getHtmlElement(),d=b.find("form").first(),e;if(1==d.length&&(e={closePermitted:!0},d.trigger("containerClose",[e]),!e.closePermitted))return!1;b.removeClass("is_visible");this.trigger("pkpModalClose");setTimeout(function(){a.unbindPartial(b);b.empty();a.remove();"function"===typeof a.options.closeCallback&&a.options.closeCallback.call()},300);return!1};a.pkp.controllers.modal.ModalHandler.prototype.handleWrapperEvents=function(c,b){"click"==b.type&&c==b.target?a.pkp.classes.Handler.getHandler(a(c)).modalClose():
"keyup"==b.type&&27==b.which&&a.pkp.classes.Handler.getHandler(a(c)).modalClose()};a.pkp.controllers.modal.ModalHandler.prototype.redirectNotifyUserEventHandler_=function(c,b,d){a.pkp.classes.notification.NotificationHelper.redirectNotifyUserEvent(this,d)}})(jQuery);(function(a){a.pkp.controllers.modal.ConfirmationModalHandler=function(a,b){this.parent(a,b);this.callback_=b.callback||null;this.callbackArgs_=b.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"),b='<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&&(b+='<a href="#" class="cancel pkpModalCloseButton">'+this.options.cancelButton+"</a>");a.append('<div class="footer">'+b+"</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,b){this.parent(a,b);this.remoteUrl_=b.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,b){this.parent(a,b);this.remoteAction_=b.remoteAction;this.postData_=b.postData||{};this.postData_.csrfToken=b.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(c,b){b.preventDefault();a.post(this.remoteAction_,this.postData_,this.callbackWrapper(this.remoteResponse),"json")};a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteResponse=
function(a,b){!1!==this.parent("remoteResponse",a,b)&&this.modalClose(a);return!1}})(jQuery);(function(a){a.pkp.controllers.modal.ButtonConfirmationModalHandler=function(a,b){this.parent(a,b)};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 b=
this.options.$button;this.modalClose(a);"submit"==b.attr("type")?b.trigger("submit"):b.click()}})(jQuery);(function(a){a.pkp.controllers.modal.JsEventConfirmationModalHandler=function(a,b){this.parent(a,b);this.jsEvent_=b.jsEvent;this.extraArguments_=b.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,b){this.parent(a,b);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,b){this.parent(a,b);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(c,b,d){d?this.parent("modalClose",c,b):(d=new a.Event("wizardCancelRequested"),d.stopPropagation(),this.getHtmlElement().children().first().trigger(d),
d.isDefaultPrevented()||this.parent("modalClose",c,b));return!1};a.pkp.controllers.modal.WizardModalHandler.prototype.wizardClose=function(a,b){this.modalClose(a,b,!0)}})(jQuery);(function(a){a.pkp.controllers.modals=a.pkp.controllers.modals||{editorDecision:{form:{}}};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler=function(c,b){this.parent(c,b);null!==b.peerReviewUrl&&(this.peerReviewUrl_=b.peerReviewUrl,a("#importPeerReviews",c).click(this.callbackWrapper(this.importPeerReviews)));null!==b.revisionsEmail&&(this.revisionsEmail_=b.revisionsEmail);null!==b.resubmitEmail&&(this.resubmitEmail_=b.resubmitEmail);a("#skipEmail-send, #skipEmail-skip, #skipDiscussion-send, #skipDiscussion-skip",
c).change(this.callbackWrapper(this.toggleEmailDisplay));a('input[name="decision"]',c).change(this.callbackWrapper(this.toggleDecisionEmail));this.setStep("email");var d=this;a(".promoteForm-step-btn",c).click(function(c){c.preventDefault();c.stopPropagation();c=a(c.target).data("step");d.setStep(c)})};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(c,b){var d=
this.handleJson(b),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 c=a("#sendReviews-emailContent"),b=this.getHtmlElement(),d=!1,e=!1,f=a("#libraryFileAttachments");a("#skipEmail-send, #skipEmail-skip",b).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)});b=a("#skipDiscussion-send, #skipDiscussion-skip",b);b.length&&b.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?(c.fadeOut(),f.fadeOut()):(c.fadeIn(),f.fadeIn())};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.toggleDecisionEmail=
function(){var c="",b=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")?c=f.revisionsEmail_:"decisionResubmit"===a(this).attr("id")&&a(this).prop("checked")&&(c=f.resubmitEmail_)});tinyMCE.get(e).setContent(c);b&&d.hide().fadeIn()};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.setStep=
function(c){var b=a('#promoteForm-step1, .promoteForm-step-btn[data-step="files"]'),d=a('#promoteForm-step2, #promoteForm-complete-btn, .promoteForm-step-btn[data-step="email"]');"files"===c?(d.show(),b.hide()):(b.show(),d.hide())}})(jQuery);(function(a){jQuery.pkp.controllers.linkAction=jQuery.pkp.controllers.linkAction||{};a.pkp.controllers.linkAction.LinkActionHandler=function(c,b){this.parent(c,b);this.staticId_=b.staticId?b.staticId:c.attr("id");if(!b.actionRequest||!b.actionRequestOptions)throw Error('The "actionRequest" and "actionRequestOptions"settings are required in a LinkActionHandler');b.actionRequestOptions.finishCallback=this.callbackWrapper(this.enableLink);this.linkActionRequest_=a.pkp.classes.Helper.objectFactory(b.actionRequest,
[c,b.actionRequestOptions]);this.bindActionRequest();this.publishEvent("dataChanged");this.bind("dataChanged",this.dataChangedHandler_);this.bind("pkpModalClose",this.removeDisabledAttribute_);b.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,b){this.linkActionRequest_.shouldDebounce()&&this.disableLink();return this.linkActionRequest_.activate.call(this.linkActionRequest_,a,b)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.bindActionRequest=function(){this.bind("click",this.activateAction)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.enableLink=
function(){var c,b;c=a(this.getHtmlElement());this.getHtmlElement().is(":submit")||this.removeDisabledAttribute_();b=this.getUrl();this.getHtmlElement().is("a")&&b&&c.attr("href",b);this.unbind("click",this.noAction_);this.bindActionRequest()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.disableLink=function(){var c=a(this.getHtmlElement());c.attr("disabled","disabled");this.getHtmlElement().is("a")&&c.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,b,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,b){this.parent(a,b);this.addWizardButtons_(a,b);this.enforceLinear_=b.hasOwnProperty("enforceLinear")?b.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 c=new a.Event("wizardAdvanceRequested");this.getCurrentTab().children().first().trigger(c);c.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 c=new a.Event("wizardCancelRequested");this.getCurrentTab().children().first().trigger(c);c.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,b){var d=this.getForm_();
d&&(d.submit()&&(this.disableContinueButton(),this.showProgressIndicator_()),b.preventDefault())};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvance=function(){var a=this.getCurrentStep(),b=this.getNumberOfSteps()-1,d=a+1,e;if(d>b)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===b&&a.text(this.getFinishButtonText());this.hideProgressIndicator_();
this.enableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.startWizard=function(){var a=this.getHtmlElement(),b,d;0!==this.getCurrentStep()&&(a.tabs("enable",0),a.tabs("option","active",0),b=this.getContinueButton(),b.text(this.getContinueButtonText()));if(this.enforceLinear_){b=[];for(d=1;d<this.getNumberOfSteps();d++)b.push(d);a.tabs("option","disabled",b)}};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 c,b,d;d=this.getCurrentTab().children();for(c=0;c<d.length;c++)if(b=a(d[c]),b.is("form"))return b;return null};a.pkp.controllers.wizard.WizardHandler.prototype.advanceOrClose_=
function(){var a=this.getCurrentStep(),b=this.getNumberOfSteps()-1;a<b?this.trigger("wizardAdvance"):this.trigger("wizardClose")};a.pkp.controllers.wizard.WizardHandler.prototype.checkForm_=function(c){var b=this.getForm_();if(null!==b)if(b=a.pkp.classes.Handler.getHandler(a("#"+b.attr("id"))),c){if(b.formChangesTracked)if(confirm(a.pkp.locale.form_dataHasChanged))b.unregisterForm();else return!0}else b.unregisterForm();return!1};a.pkp.controllers.wizard.WizardHandler.prototype.addWizardButtons_=
function(c,b){var d=a('<div id="wizardButtons" class="modal_buttons"></div>'),e,f;b.continueButtonText&&(e=a('<button id="continueButton" class="pkp_button"></button>').text(b.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_=b.continueButtonText,this.finishButtonText_=b.finishButtonText?b.finishButtonText:b.continueButtonText);b.cancelButtonText&&
(e=a('<a id="cancelButton" class="cancel" href="#"></a>').text(b.cancelButtonText),d.append(e),e.bind("click",this.callbackWrapper(this.cancelRequest)));c.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,b){this.fetchNoteFormUrl_=b.fetchNoteFormUrl;this.fetchParticipantsListUrl_=b.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(c){a(c).parents(".openNoteForm").addClass("is_loading");
a.get(this.fetchNoteFormUrl_,this.callbackWrapper(this.showFetchedNoteForm_),"json")};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showFetchedNoteForm_=function(c,b){var d=this.handleJson(b),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(c,b){var d=this.handleJson(b),
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,b){this.parent(a,b);this.csrfToken_=b.csrfToken;this.deleteUrl_=b.deleteUrl;this.metadataUrl_=b.metadataUrl;this.finishUrl_=b.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,b,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,b,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardAdvance=function(){var a=
this.getCurrentStep(),b=this.getNumberOfSteps()-1,d=a+1,e=this.getHtmlElement();if(d>b)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===b&&(a=this.getContinueButton(),a.text(this.getFinishButtonText()),this.enableContinueButton())};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsLoad=function(c,b,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",c,b,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.formValid=function(a,b){0===this.getCurrentStep()&&0===this.getHtmlElement().find("#uploadConfirmationForm").length&&!this.uploadedFile_||this.parent("formValid",a,b)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelRequested=function(c,b){if(this.parent("wizardCancelRequested",c,
b))if(this.uploadedFile_)this.uploadedFile_.csrfToken=this.csrfToken_,a.post(this.deleteUrl_,this.uploadedFile_,a.pkp.classes.Helper.curry(this.wizardCancelSuccess,this,c,b),"json"),this.uploadedFile_=null,b.preventDefault();else return!0;return!1};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelSuccess=function(a,b,d){!1!==this.handleJson(d)&&this.trigger("wizardCancel")};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleFileUploaded=function(a,
b,d){this.uploadedFile_=d};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleRemovedFiles=function(c,b,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,b){this.parent(a,b);this.hasFileSelector_=b.hasFileSelector;this.hasGenreSelector_=b.hasGenreSelector;b.presetRevisedFileId&&(this.presetRevisedFileId_=b.presetRevisedFileId);this.fileGenres_=b.fileGenres;this.$uploader_=b.$uploader;this.attachUploader_(this.$uploader_,b.uploaderOptions);this.uploaderSetup(b.$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(c){c=a.pkp.classes.Handler.getHandler(c);c.pluploader.bind("BeforeUpload",this.callbackWrapper(this.prepareFileUploadRequest));c.pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse));c.pluploader.bind("FilesRemoved",this.callbackWrapper(this.handleRemovedFiles))};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.prepareFileUploadRequest=function(a,b){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="";b.settings.multipart_params=d};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleUploadResponse=function(c,b,d,e){c=this.handleJson(a.parseJSON(e.response));this.getHtmlElement();!1!==c&&(this.trigger("fileUploaded",
c.uploadedFile),""!==c.content&&this.replaceWith(c.content));this.getHtmlElement().valid()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleRemovedFiles=function(a,b,d){this.trigger("filesRemoved",[b,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,b){a.pkpHandler("$.pkp.controllers.UploaderHandler",b)};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,b){this.parent(a,b);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,b){var d=this.getHtmlElement();0<parseInt(d.find("#revisedFileId").val(),10)&&(d.submit(),b.preventDefault())};a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler.prototype.handleResponse=function(a,b){!0===b.status&&this.trigger("fileUploaded",b.uploadedFile);return this.parent("handleResponse",a,b)}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus=a.pkp.controllers.grid.navigationMenus||{form:{}};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler=function(a,b){this.okButton_=b.okButton;this.warningModalTitle_=b.warningModalTitle;this.submenuWarning_=b.submenuWarning;this.itemTypeConditionalWarnings_=b.itemTypeConditionalWarnings;a.on("click",".btnConditionalDisplay",this.callbackWrapper(this.showConditionalDisplayWarning));a.on("click",".btnSubmenuWarning",this.callbackWrapper(this.showSubmenuWarning));
this.parent(a,b);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 c=this;a(".btnSubmenuWarning",this.getHtmlElement()).remove();a("#pkpNavAssigned > li").each(function(){var b=a(this).children("ul"),d=b.children(),e=d.find("li");b.length?d.length?(e.length&&e.each(function(){a(this).appendTo(b)}),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(c.submenuWarning_)))):
b.replaceWith("<ul></ul>"):a(this).append("<ul></ul>")});a("#pkpNavUnassigned > li").each(function(){var c=a(this).children("ul");c.length&&c.find("li").each(function(){a(this).appendTo(a("#pkpNavUnassigned"))});c.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 c=a("#pkpNavManagement"),b=0,d="";this.initSorting();a("input",c).remove();a("#pkpNavAssigned > li").each(function(){d="menuTree["+a(this).data("id")+"]";c.append('<input type="hidden" name="'+d+'[seq]" value="'+b+'">');b++;var e=a(this).data("id");a(this).find("li").each(function(){d="menuTree["+a(this).data("id")+"]";c.append('<input type="hidden" name="'+d+'[seq]" value="'+b+'">');c.append('<input type="hidden" name="'+
d+'[parentId]" value="'+e+'">');b++})})};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showConditionalDisplayWarning=function(c){var c=a(c).closest("li").data("type"),b={title:this.warningModalTitle_,okButton:this.okButton_,cancelButton:!1,dialogText:this.itemTypeConditionalWarnings_[c]};null!==this.itemTypeConditionalWarnings_[c]&&a('<div id="'+a.pkp.classes.Helper.uuid()+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",
b);return!1};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showSubmenuWarning=function(){var c={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",c);return!1}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler=function(c,b){this.parent(c,b);this.previewUrl_=b.previewUrl;this.itemTypeDescriptions_=b.itemTypeDescriptions;this.itemTypeConditionalWarnings_=b.itemTypeConditionalWarnings;a("#previewButton",c).click(this.callbackWrapper(this.showPreview_));a("#menuItemType",c).change(this.callbackWrapper(this.setType));a("#menuItemType",c).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 c=this.getHtmlElement();
a.post(this.previewUrl_,c.serialize(),function(a){var c=window.open("about:blank");c.document.open();c.a);c.document.close()});return!0};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.setType=function(){var c=a("#menuItemType",this.getHtmlElement()).val(),b=a('#menuItemTypeSection [for="menuItemType"]');a(".NMI_TYPE_CUSTOM_EDIT",this.getHtmlElement()).hide();a("#"+c).fadeIn();"undefined"!==typeof this.itemTypeDescriptions_[c]&&b.text(this.itemTypeDescriptions_[c])}})(jQuery);(function(a){a.pkp.controllers.grid.representations=a.pkp.controllers.grid.representations||{form:{}};a.pkp.controllers.grid.representations.form.RepresentationFormHandler=function(c,b){this.parent(c,b);(this.remoteRepresentation_=b.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.controllers.grid.settings=a.pkp.controllers.grid.settings||{user:{form:{}}};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler=function(c,b){this.parent(c,b);a('[id^="generatePassword"]',c).click(this.callbackWrapper(this.setGenerateRandom));a('[id^="generatePassword"]',c).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(c,b){var d=this.getHtmlElement();a(":password",d).removeAttr("disabled");this.parent("submitForm",c,b)};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler.prototype.setGenerateRandom=function(c){var c=a(c),b=this.getHtmlElement(),d="",e=0;c.prop("checked")?(d="********",e="disabled"):e=d="";a(":password",b).prop("disabled",e).val(d);a('[id^="sendNotify"]',b).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(c,b){var d=a('[id^="roleId"]',c);this.parent(c,b);b.selfRegistrationRoleIds&&(this.selfRegistrationRoleIds_=b.selfRegistrationRoleIds);b.recommendOnlyRoleIds&&(this.recommendOnlyRoleIds_=b.recommendOnlyRoleIds);this.roleForbiddenStages_=b.roleForbiddenStagesJSON.content;this.stagesSelector_=b.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(c){c=a(c).val();this.updatePermitSelfRegistration(c);this.updateStageOptions(c);this.updateRecommendOnly(c)};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updatePermitSelfRegistration=function(c){var b=a('[id^="permitSelfRegistration"]');this.getHtmlElement();var d,e=!1;for(d=0;d<this.selfRegistrationRoleIds_.length;d++)this.selfRegistrationRoleIds_[d]==c&&(e=!0);e?b.removeAttr("disabled"):
(b.attr("disabled","disabled"),b.removeAttr("checked"))};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updateStageOptions=function(c){var b=this.getHtmlElement(),d=b.find("#userGroupStageContainer"),e=a(this.stagesSelector_,b).filter("input"),f,h=null;e.removeAttr("disabled");if(void 0!=this.roleForbiddenStages_[c])for(f=0;f<this.roleForbiddenStages_[c].length;f++)h=this.roleForbiddenStages_[c][f],e.filter('input[value="'+h+'"]').attr("disabled","disabled");0==b.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(c){var b=a("[id^='recommendOnly']",this.getHtmlElement()),d,e=!1;for(d=0;d<this.recommendOnlyRoleIds_.length;d++)this.recommendOnlyRoleIds_[d]==c&&(e=!0);e?b.removeAttr("disabled"):(b.attr("disabled","disabled"),b.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,b){a.find(":checkbox").change(this.callbackWrapper(this.checkboxHandler_));this.parent(a,b)};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(c){this.parent("initialize",
c);a(this.getHtmlElement()).find(":checkbox").change()};a.pkp.controllers.grid.settings.metadata.MetadataGridHandler.prototype.checkboxHandler_=function(c){c=a(c);c.is(":checked");var b=a(this.getHtmlElement());c.prop("name");this.getRows().each(function(){var c=a(this).prop("id").split("-").pop(),e=b.find(":checkbox[name="+c+"EnabledWorkflow]"),f=b.find(":checkbox[name="+c+"EnabledSubmission]"),c=b.find(":checkbox[name="+c+"Required]");(f.prop("checked")||c.prop("checked"))&&e.prop("checked",!0);
e.prop("readonly",f.prop("checked")||c.prop("checked"));c.prop("checked")&&f.prop("checked",!0);f.prop("readonly",c.prop("checked"))});return!1}})(jQuery);(function(a){a.pkp.controllers.tab=a.pkp.controllers.tab||{settings:{form:{}}};a.pkp.controllers.tab.settings.form.FileViewFormHandler=function(a,b){this.parent(a,b);this.fetchFileUrl_=b.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(c,b,d){a.get(this.fetchFileUrl_,{settingName:d},this.callbackWrapper(this.refreshResponseHandler_),"json")};a.pkp.controllers.tab.settings.form.FileViewFormHandler.prototype.refreshResponseHandler_=function(a,b){var d,e=this.handleJson(b);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(c){var b=
this.getHtmlElement();return a("#"+c,b)}})(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(c,b){this.parent(c,b);a("#enableAnnouncementsHomepage",c).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 c=a("#numAnnouncementsHomepage",this.getHtmlElement());c.attr("disabled")?c.removeAttr("disabled"):c.attr("disabled","disabled")}})(jQuery);(function(a){a.pkp.controllers.tab.settings.archiving=a.pkp.controllers.tab.settings.archiving||{form:{}};a.pkp.controllers.tab.settings.archiving.form.ArchivingSettingsFormHandler=function(c,b){this.parent(c,b);a(".expand-others").click(function(){a("#otherLockss").slideToggle("fast")});"1"==a("#isPLNPluginInstalled").val()&&a("#otherLockss").hide()};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.settings.archiving.form.ArchivingSettingsFormHandler,a.pkp.controllers.form.AjaxFormHandler)})(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(c,b){this.parent(c,b);a("#licenseURLSelect",c).change(this.callbackWrapper(this.licenseURLSelectChange));a('input[id^="licenseURL-"]',c).keyup(this.callbackWrapper(this.licenseURLOtherChange));a('input[id^="copyrightHolderType-"]',c).change(this.callbackWrapper(this.copyrightHolderRadioSelect));a("#resetPermissionsButton",
c).button().click(this.callbackWrapper(this.resetPermissionsHandler));this.resetPermissionsUrl=b.resetPermissionsUrl;this.resetPermissionsConfirmText=b.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(),b=a.find("#licenseURLSelect");a.find('input[id^="licenseURL-"]').val(b.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(c){var b=this.getHtmlElement(),c=a(c),b=b.find('input[id^="copyrightHolderOther-"]');"other"===c.val()?b.removeAttr("disabled"):b.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,b){this.parent(a,b);this.paymentMethodFormUrlTemplate_=b.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(c){a("#paymentPluginName").val(c);return this.paymentMethodFormUrlTemplate_.replace("PAYMENT_PLUGIN_NAME",c)};a.pkp.controllers.tab.settings.paymentMethod.PaymentMethodHandler.prototype.selectPaymentMethodHandler=function(c,b,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(c,b){var d=this.handleJson(b),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,b){a.find('a[id*="markNew"]').click(this.callbackWrapper(this.markNewHandler_));a.find('a[id*="markRead"]').click(this.callbackWrapper(this.markReadHandler_));a.find('a[id*="deleteNotifications"]').click(this.callbackWrapper(this.deleteHandler_));this.parent(a,b)};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 c=[];this.getHtmlElement().find("input:checkbox:checked").each(function(){c.push(a(this).val())});return c};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,b){var d=
this.getFetchExtraParams();d.selectedNotificationIds=b.content;this.setFetchExtraParams(d);this.handleJson(b)}})(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(c,b){this.parent(c,b);a("#disableUserReg-0",c).click(this.callbackWrapper(this.changeRegOptsState));a("#disableUserReg-1",c).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(c){c?a('[id^="allow"]').attr("disabled","disabled"):a('[id^="allow"]').removeAttr("disabled")};a.pkp.controllers.tab.settings.siteAccessOptions.form.SiteAccessOptionsFormHandler.prototype.setRegOptsChecked_=
function(c){c?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,b){var d,e,f,h;this.parent(a,b);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)&&(b.selected=f)}};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.workflow.WorkflowTabHandler,a.pkp.controllers.TabHandler)})(jQuery);jQuery.pkp.controllers.informationCenter=jQuery.pkp.controllers.informationCenter||{};
(function(a){a.pkp.controllers.informationCenter.NotesHandler=function(a,b){this.parent(a,b);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(c,b,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(c,b){var d;b.trackFormChanges=!1;b.transformButtons=!1;this.parent(c,b);this.getHtmlElement().find(":submit").button();a("#reportUrlFormArea",c).hide();this.timeFilterWrapperSelector_=b.timeFilterWrapperSelector;this.rangeByDaySelector_=b.rangeByDaySelector;this.rangeByMonthSelector_=b.rangeByMonthSelector;this.startDayElementSelector_=b.startDayElementSelector;
this.endDayElementSelector_=b.endDayElementSelector;this.optionalColumns_=b.optionalColumns;this.aggregationOptionsSelector_=b.aggregationOptionsSelector;this.fetchFormUrl_=b.fetchFormUrl;this.$metricTypeSelectElement_=d=a(b.metricTypeSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));a(".pkp_loading",c).hide();this.$reportTemplateSelectElement_=d=a(b.reportTemplateSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));
this.columnsSelector_=b.columnsSelector;d=a(b.aggregationOptionsSelector);0<d.length&&d.change(this.callbackWrapper(this.aggregationOptionsChangeHandler_));d=a(b.currentMonthSelector,this.getHtmlElement()).add(b.yesterdaySelector,this.getHtmlElement()[0]);2==d.length&&d.click(this.callbackWrapper(this.currentTimeElementsClickHandler_));d=a(b.rangeByMonthSelector,this.getHtmlElement()).add(b.rangeByDaySelector,this.getHtmlElement()[0]);2==d.length&&d.click(this.callbackWrapper(this.rangeTimeElementsClickHandler_));
this.dateRangeElementsWrapper_=a(b.dateRangeWrapperSelector,this.getHtmlElement());1==d.filter("input:checked").length?d.filter("input:checked").click():this.dateRangeElementsWrapper_.hide();this.fileAssocTypes_=b.fileAssocTypes;this.$fileTypeSelectElement_=a(b.fileTypeSelectSelector,this.getHtmlElement());d=a(b.objectTypeSelectSelector,this.getHtmlElement());1==this.$fileTypeSelectElement_.length&&(this.$fileTypeSelectElement_.attr("disabled","disabled"),d.change(this.callbackWrapper(this.updateFileTypeSelectHandler_)));
d.change();this.fetchRegionsUrl_=b.fetchRegionsUrl;this.$regionSelectElement_=a(b.regionSelectSelector,this.getHtmlElement());1==this.$regionSelectElement_.length&&(d=a(b.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(c,b){var d=this.handleJson(b);!1!==d&&void 0!==d.reportUrl&&(a("#reportUrlFormArea",this.getHtmlElement()).show().find(":input").val(d.reportUrl),window.location=d.reportUrl);this.parent("handleResponse",c,b);return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchFormHandler_=
function(){var c,b={};c=a(this.timeFilterWrapperSelector_,this.getHtmlElement()).serializeArray();a.each(c,function(a,c){b[c.name]=c.value});a(".pkp_loading",this.getHtmlElement()).show();c=a("option:selected",this.$metricTypeSelectElement_);void 0!==c[0]&&void 0!==c[0].value&&(b.metricType=c[0].value);c=a("option:selected",this.$reportTemplateSelectElement_);void 0!==c[0]&&void 0!==c[0].value&&(b.reportTemplate=c[0].value);b.refreshForm=!0;a.get(this.fetchFormUrl_,b,this.callbackWrapper(this.handleResponse,
null),"json");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.updateFileTypeSelectHandler_=function(c){var b,c=a(c),c=a("option:selected",c);if(1==c.length)for(b in c=c[0].value,this.fileAssocTypes_)if(this.fileAssocTypes_[b]==c)return this.$fileTypeSelectElement_.removeAttr("disabled"),!1;this.$fileTypeSelectElement_.attr("disabled","disabled");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchRegionHandler_=function(c){this.$regionSelectElement_.empty();
c=a(c);c=a("option:selected",c);1==c.length&&(c=c[0].label,a.get(this.fetchRegionsUrl_,{countryId:c},this.callbackWrapper(this.updateRegionSelectCallback_,null),"json"));return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.updateRegionSelectCallback_=function(c,b){var d,e,f,h;d=this.$regionSelectElement_;d.empty();e=this.handleJson(b);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(c){var b=a(this.startDayElementSelector_).add(this.endDayElementSelector_);this.dateRangeElementsWrapper_.show();"#"+a(c).attr("id")==this.rangeByDaySelector_&&b.show();"#"+a(c).attr("id")==this.rangeByMonthSelector_&&b.hide();return!0};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.aggregationOptionsChangeHandler_=
function(c){var b;b=a(this.columnsSelector_);c=a(c);b=b.find('option[value="'+c.attr("value")+'"]');c.is(":checked")?b.attr("selected","selected"):b.removeAttr("selected");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.addOptionalColumnsClass_=function(){var c,b,d,e;d=a(this.columnsSelector_);e=a(this.aggregationOptionsSelector_);b=a("#orderByFormArea select",this.getHtmlElement());d=d.add(b);b=this.optionalColumns_;for(c in b)d.find('option[value="'+c+'"]').addClass("optionalColumn"),
e.filter('input[value="'+c+'"]').parent().addClass("optionalColumn")}})(jQuery);(function(a){a.pkp.controllers.dashboard=a.pkp.controllers.dashboard||{form:{}};a.pkp.controllers.dashboard.form.DashboardTaskFormHandler=function(c,b){this.parent(c,b);this.singleContextSubmissionUrl_=b.singleContextSubmissionUrl;a("#singleContext",c).click(this.callbackWrapper(this.startSingleContextSubmission_));a("#multipleContext",c).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);(function(a){a.pkp.pages=a.pkp.pages||{header:{}};a.pkp.pages.header.HeaderHandler=function(a,b){this.options_=b;this.parent(a,b)};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(c,b){this.options_=b;this.parent(c,b);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(),
b=a.find("#notificationsPopover"),d=a.find("#notificationsToggle");b.toggle();d.toggleClass("expandedIndicator");d.hasClass("expandedIndicator")?(this.trigger("callWhenClickOutside",[{container:a,callback:this.callbackWrapper(this.appendToggleIndicator_)}]),setTimeout(this.callbackWrapper(this.setPopoverSize_),500)):b.css("height","").css("overflow-y","")};a.pkp.pages.header.TasksHandler.prototype.setPopoverSize_=function(){var c=this.getHtmlElement().find("#notificationsPopover"),b=a(window).height()-
60;b<c.height()&&c.height(b).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,b){var d=this.getHtmlElement().find("#unreadNotificationCount");d.html(b.content);"0"==b.content?d.removeClass("hasTasks"):d.addClass("hasTasks")}})(jQuery);(function(a){a.pkp.pages.admin=a.pkp.pages.admin||{};a.pkp.pages.admin.ContextsHandler=function(c,b){var d=a("#openWizard a");d&&d.attr("style","display:none");this.parent(c,b)};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,b){this.parent(a,b);this.submissionProgress_=b.submissionProgress;this.cancelUrl_=b.cancelUrl;this.cancelConfirmText_=b.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,b,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);jQuery.pkp.pages.submission=jQuery.pkp.pages.submission||{};
(function(a){a.pkp.pages.submission.SubmissionStep1FormHandler=function(c,b){this.parent(c,b);this.showSectionPolicy(null);a("#sectionId").change(this.callbackWrapper(this.showSectionPolicy))};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionStep1FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.pages.submission.SubmissionStep1FormHandler.prototype.showSectionPolicy=function(){a(".section-policy").hide();a(".section-policy.section-id-"+a("#sectionId").val()).fadeIn()}})(jQuery);(function(a){a.pkp.pages.submission.SubmissionStep2FormHandler=function(a,b){this.parent(a,b);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(c,b,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,b){this.parent(a,b);this.bind("gridRefreshRequested",this.fetchChaptersGrid_);this.authorsGridContainer_=b.authorsGridContainer;this.chaptersGridContainer_=b.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(c,b){b.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,b){this.parent(a,b);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 c,b,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")){b=a(this).find("a").attr("class");if(c=b.match(/stageId(\d)/)){d=c[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(c,b,d){c=a(b.target,this.getHtmlElement()).children("a");c.length&&c.attr("id").match(/submissionEntry/)&&(c=a('[id^="formatsGridContainer"]',this.getHtmlElement()).children("div"),c.trigger("dataChanged",[d]),c.trigger("notifyUser",[c]))}})(jQuery);(function(a){a.pkp.controllers.grid.users=a.pkp.controllers.grid.users||{};a.pkp.controllers.grid.users.UserGridHandler=function(a,b){this.parent(a,b);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(c,b){this.parent(c,b);c.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(c,b){var d="",e="";b.length?(this.selectedReviewer=b[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,b,d){d&&this.replaceWith(d)}})(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,b){this.parent(a,b);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,b){this.parent(a,b);b.templateUrl&&(this.templateUrl_=b.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 c=this.getHtmlElement();a.post(this.templateUrl_,c.find("#template").serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.updateTemplate=function(a,b){var d=this.getHtmlElement(),e=this.handleJson(b),
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(c,b){this.parent(c,b);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(c,b){this.parent(c,b);b.templateUrl&&(this.templateUrl_=b.templateUrl);b.possibleRecommendOnlyUserGroupIds&&(this.possibleRecommendOnlyUserGroupIds_=b.possibleRecommendOnlyUserGroupIds);b.recommendOnlyUserGroupIds&&(this.recommendOnlyUserGroupIds_=b.recommendOnlyUserGroupIds);b.blindReviewerIds&&
(this.blindReviewerIds_=b.blindReviewerIds);b.blindReviewerWarning&&(this.blindReviewerWarning_=b.blindReviewerWarning);b.blindReviewerWarningOk&&(this.blindReviewerWarningOk_=b.blindReviewerWarningOk);a("input[name='userGroupId'], input[name='userIdSelected']",c).change(this.callbackWrapper(this.updateRecommendOnly));a("input[name='userIdSelected']",c).change(this.callbackWrapper(this.maybeTriggerReviewerWarning));c.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 c=this.getHtmlElement();a.post(this.templateUrl_,c.find("#template").serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.updateTemplate=function(a,b){var d=this.getHtmlElement(),e=this.handleJson(b),f=b.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(c){var b=this.getHtmlElement(),d=b.find("input[name='userGroupId']"),e=b.find("input[id^='recommendOnly']"),b=b.find(".recommendOnlyWrapper"),d=d.val();if("userGroupId"==a(c).prop("name"))e.attr("disabled","disabled"),e.removeAttr("checked"),b.hide();else if("userIdSelected"==
a(c).prop("name")&&!b.is(":visible"))for(c=0;c<this.possibleRecommendOnlyUserGroupIds_.length;c++)if(this.possibleRecommendOnlyUserGroupIds_[c]==d){e.removeAttr("disabled");b.show();for(c=0;c<this.recommendOnlyUserGroupIds_.length;c++)if(this.recommendOnlyUserGroupIds_[c]==d){e.prop("checked",!0);break}break}};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.maybeTriggerReviewerWarning=function(c){if((c=a(c).val())&&!(0>this.blindReviewerIds_.indexOf(c)))c=
{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",c)};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.handleResponse=function(c,b){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",c,b)}})(jQuery);(function(a){a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler=function(c,b){this.parent(c,b);a("select[name^='filterUserGroupId']",c).change(this.callbackWrapper(this.addUserGroupId));a("input[name='userId']").click(function(){var c=a("input[name='userId']:checked").val();a("input[name='userIdSelected']").val(c).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 c=this.getHtmlElement().find("select[name^='filterUserGroupId']").val();a("input[name='userGroupId']").val(c).trigger("change")}})(jQuery);(function(a){a.pkp.pages.reviewer=a.pkp.pages.reviewer||{};a.pkp.pages.reviewer.ReviewerTabHandler=function(a,b){this.parent(a,b);this.reviewStep_=b.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,b,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,b){this.parent(a,b);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.articleGalleys=a.pkp.controllers.grid.articleGalleys||{};a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler=function(a,b){this.parent(a,b);a.bind("uploadFile",this.callbackWrapper(this.uploadFileHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler.prototype.uploadFileHandler_=function(c,b,d){var e='a[id^="component-grid-articlegalleys-articlegalleygrid-row-'+
d+'-addFile-button-"]';a.when(a(e)).then(function(){a(function(){a(e).click()})})}})(jQuery);(function(a){a.pkp.controllers.grid.issues=a.pkp.controllers.grid.issues||{};a.pkp.controllers.grid.issues.BackIssueGridHandler=function(a,b){this.parent(a,b);this.bindGlobal("issuePublished",this.refreshGridHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.issues.BackIssueGridHandler,a.pkp.controllers.grid.GridHandler)})(jQuery);(function(a){a.pkp.controllers.grid.issues.FutureIssueGridHandler=function(a,b){this.parent(a,b);this.bindGlobal("issueUnpublished",this.refreshGridHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.issues.FutureIssueGridHandler,a.pkp.controllers.grid.GridHandler)})(jQuery);(function(a){a.pkp.controllers.tab.issueEntry=a.pkp.controllers.tab.issueEntry||{};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler=function(a,b){b.selectedGalleyId&&(b.selected=this.getTabPositionByGalleyId_(b.selectedGalleyId,a));this.parent(a,b);this.bind("gridRefreshRequested",this.gridRefreshRequested);b.tabsUrl&&(this.tabsUrl_=b.tabsUrl);b.tabContentUrl&&(this.tabContentUrl_=b.tabContentUrl);this.bind("gridInitialized",this.addGalleysGridRowActionHandlers_);this.publishEvent("gridInitialized")};
a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler,a.pkp.controllers.TabHandler);a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.tabContentUrl_=null;a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.gridRefreshRequested=function(c,b){a(b.target).attr("id").match(/^galleysGridContainer/)&&this.tabsUrl_&&this.tabContentUrl_&&a.get(this.tabsUrl_,null,this.callbackWrapper(this.updateTabsHandler_),"json")};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.updateTabsHandler_=
function(a,b){var d=this.handleJson(b),e=this.getHtmlElement(),f=e.find("li a"),h={},j=/galley(\d+)/,i,l,k;for(l=0;l<f.length;l++)k=f[l].getAttribute("id"),k=j.exec(k),null!==k&&(h[k[1]]=l);for(i in d.galleys)h.hasOwnProperty(i)||(f=this.tabContentUrl_+"&galleyId="+encodeURIComponent(i),f=f.replace(/[$]/g,"$$$$"),e.tabs("add",f,d.galleys[i]),e.find("li a").filter(":last").attr("id","galley"+i));for(i in h)d.galleys.hasOwnProperty(i)?e.find("li a").filter('[id="galley'+i+'"]').html(d.galleys[i]):e.tabs("remove",
h[i])};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.addGalleysGridRowActionHandlers_=function(){var c=a('[id^="galleysGridContainer"]',this.getHtmlElement());c.length&&(c=a('a[id*="galleyTab"]',c),c.click(this.callbackWrapper(this.galleysGridLinkClickHandler_)))};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.galleysGridLinkClickHandler_=function(c){var b=a('[id^="galleysGridContainer"]',this.getHtmlElement()).children("div"),b=a.pkp.classes.Handler.getHandler(b),
c=b.getParentRow(a(c)),c=b.getRowDataId(c);this.getHtmlElement().tabs({active:this.getTabPositionByGalleyId_(c,this.getHtmlElement())})};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.getTabPositionByGalleyId_=function(c,b){var d=a("#galley"+c,b).parent("li");return d.length?b.find("li").index(d):null}})(jQuery);(function(a){a.pkp.controllers.tab.issueEntry.form=a.pkp.controllers.tab.issueEntry.form||{};a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler=function(c,b){this.parent(c,b);a("#paymentReceivedButton",c).click(this.callbackWrapper(this.paymentReceivedHandler));a("#waivePaymentButton",c).click(this.callbackWrapper(this.waivePaymentHandler));b.arePermissionsAttached&&c.find("#attachPermissions").prop("checked",!0);a("#issueId",c).change(this.callbackWrapper(this.checkAttachMetadata));
a('input[id^="copyrightHolder-"]',c).keyup(this.callbackWrapper(this.checkAttachMetadata));a('input[id^="copyrightYear-"]',c).keyup(this.callbackWrapper(this.checkAttachMetadata));a('input[id^="licenseURL-"]',c).keyup(this.callbackWrapper(this.checkAttachMetadata))};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler.prototype.paymentReceivedHandler=
function(){var a=this.getHtmlElement();a.find('input[name="waivePublicationFee"]').val("1");a.find('input[name="markAsPaid"]').val("1");a.submit()};a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler.prototype.waivePaymentHandler=function(){var a=this.getHtmlElement();a.find('input[name="waivePublicationFee"]').val("1");a.submit()};a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler.prototype.checkAttachMetadata=function(){this.getHtmlElement().find("#attachPermissions").prop("checked",
!0)}})(jQuery);(function(a){a.fn.pkpHandler=function(c,b){this.each(function(){var d=a(this);b=b||{};a.pkp.classes.Helper.objectFactory(c,[d,b])});return this};a.fn.pkpAjaxHtml=function(c,b){var d=this.first();a.ajax({url:c,dataType:"json",success:function(a){d.find("#loading").hide();!0===a.status?(a.content&&d.html(a.content),b&&b()):(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);
(function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a("undefined"!=typeof jQuery?jQuery:window.Zepto)})(function(a){function c(c){var b=c.data;c.isDefaultPrevented()||(c.preventDefault(),a(c.target).ajaxSubmit(b))}function b(c){var b=c.target,d=a(b);if(!d.is("[type=submit],[type=image]")){b=d.closest("[type=submit]");if(0===b.length)return;b=b[0]}var e=this;e.clk=b;"image"==b.type&&(void 0!==c.offsetX?(e.clk_x=c.offsetX,e.clk_y=c.offsetY):"function"==typeof a.fn.offset?(d=d.offset(),
e.clk_x=c.pageX-d.left,e.clk_y=c.pageY-d.top):(e.clk_x=c.pageX-b.offsetLeft,e.clk_y=c.pageY-b.offsetTop));setTimeout(function(){e.clk=e.clk_x=e.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(c):window.opera&&window.opera.postError&&window.opera.postError(c)}}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(c){function b(e){function f(a){var c=null;try{a.contentWindow&&(c=a.contentWindow.document)}catch(b){d("cannot get iframe.contentWindow document: "+b)}if(c)return c;try{c=a.contentDocument?a.contentDocument:a.document}catch(e){d("cannot get iframe.contentDocument: "+e),c=a.document}return c}function g(){function c(){try{var a=f(m).readyState;d("state = "+
a);a&&"uninitialized"==a.toLowerCase()&&setTimeout(c,50)}catch(b){d("Server abort: ",b," (",b.name,")"),v(I),G&&clearTimeout(G),G=void 0}}var b=p.attr2("target"),e=p.attr2("action"),B=p.attr("enctype")||p.attr("encoding")||"multipart/form-data";u.setAttribute("target",y);(!l||/post/i.test(l))&&u.setAttribute("method","POST");e!=i.url&&u.setAttribute("action",i.url);!i.skipEncodingOverride&&(!l||/post/i.test(l))&&p.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});i.timeout&&(G=
setTimeout(function(){E=!0;v(O)},i.timeout));var h=[];try{if(i.extraData)for(var C in i.extraData)i.extraData.hasOwnProperty(C)&&(a.isPlainObject(i.extraData[C])&&i.extraData[C].hasOwnProperty("name")&&i.extraData[C].hasOwnProperty("value")?h.push(a('<input type="hidden" name="'+i.extraData[C].name+'">').val(i.extraData[C].value).appendTo(u)[0]):h.push(a('<input type="hidden" name="'+C+'">').val(i.extraData[C]).appendTo(u)[0]));i.iframeTarget||n.appendTo("body");m.attachEvent?m.attachEvent("onload",
v):m.addEventListener("load",v,!1);setTimeout(c,15);try{u.submit()}catch(z){document.createElement("form").submit.apply(u)}}finally{u.setAttribute("action",e),u.setAttribute("enctype",B),b?u.setAttribute("target",b):p.removeAttr("target"),a(h).remove()}}function v(c){if(!q.aborted&&!P)if(z=f(m),z||(d("cannot access response document"),c=I),c===O&&q)q.abort("timeout"),B.reject(q,"timeout");else if(c==I&&q)q.abort("server abort"),B.reject(q,"error","server abort");else if(z&&z.location.href!=i.iframeSrc||
E){m.detachEvent?m.detachEvent("onload",v):m.removeEventListener("load",v,!1);var c="success",b;try{if(E)throw"timeout";var e="xml"==i.dataType||z.XMLDocument||a.isXMLDoc(z);d("isXml="+e);if(!e&&(window.opera&&(null===z.body||!z.body.innerHTML))&&--T){d("requeing onLoad callback, DOM not available");setTimeout(v,250);return}var g=z.body?z.body:z.documentElement;q.responseText=g?g.innerHTML:null;q.responseXML=z.XMLDocument?z.XMLDocument:z;e&&(i.dataType="xml");q.getResponseHeader=function(a){return{"content-type":i.dataType}[a.toLowerCase()]};
g&&(q.status=Number(g.getAttribute("status"))||q.status,q.statusText=g.getAttribute("statusText")||q.statusText);var h=(i.dataType||"").toLowerCase(),j=/(json|script|text)/.test(h);if(j||i.textarea){var u=z.getElementsByTagName("textarea")[0];if(u)q.responseText=u.value,q.status=Number(u.getAttribute("status"))||q.status,q.statusText=u.getAttribute("statusText")||q.statusText;else if(j){var x=z.getElementsByTagName("pre")[0],l=z.getElementsByTagName("body")[0];x?q.responseText=x.textContent?x.textContent:
x.innerText:l&&(q.responseText=l.textContent?l.textContent:l.innerText)}}else"xml"==h&&(!q.responseXML&&q.responseText)&&(q.responseXML=s(q.responseText));try{var e=q,g=i,p=e.getResponseHeader("content-type")||"",y="xml"===h||!h&&0<=p.indexOf("xml"),w=y?e.responseXML:e.responseText;y&&"parsererror"===w.documentElement.nodeName&&a.error&&a.error("parsererror");g&&g.dataFilter&&(w=g.dataFilter(w,h));"string"===typeof w&&("json"===h||!h&&0<=p.indexOf("json")?w=A(w):("script"===h||!h&&0<=p.indexOf("javascript"))&&
a.globalEval(w));C=w}catch(r){c="parsererror",q.error=b=r||c}}catch(t){d("error caught: ",t),c="error",q.error=b=t||c}q.aborted&&(d("upload aborted"),c=null);q.status&&(c=200<=q.status&&300>q.status||304===q.status?"success":"error");"success"===c?(i.success&&i.success.call(i.context,C,"success",q),B.resolve(q.responseText,"success",q),k&&a.event.trigger("ajaxSuccess",[q,i])):c&&(void 0===b&&(b=q.statusText),i.error&&i.error.call(i.context,q,c,b),B.reject(q,"error",b),k&&a.event.trigger("ajaxError",
[q,i,b]));k&&a.event.trigger("ajaxComplete",[q,i]);k&&!--a.active&&a.event.trigger("ajaxStop");i.complete&&i.complete.call(i.context,q,c);P=!0;i.timeout&&clearTimeout(G);setTimeout(function(){i.iframeTarget?n.attr("src",i.iframeSrc):n.remove();q.responseXML=null},100)}}var u=p[0],x,i,k,y,n,m,q,E,G,B=a.Deferred();B.abort=function(a){q.abort(a)};if(e)for(x=0;x<r.length;x++)e=a(r[x]),h?e.prop("disabled",!1):e.removeAttr("disabled");i=a.extend(!0,{},a.ajaxSettings,c);i.context=i.context||i;y="jqFormIO"+
(new Date).getTime();i.iframeTarget?(n=a(i.iframeTarget),(x=n.attr2("name"))?y=x:n.attr2("name",y)):(n=a('<iframe name="'+y+'" src="'+i.iframeSrc+'" />'),n.css({position:"absolute",top:"-1000px",left:"-1000px"}));m=n[0];q={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(c){var b="timeout"===c?"timeout":"aborted";d("aborting upload... "+b);this.aborted=1;try{m.contentWindow.document.execCommand&&
m.contentWindow.document.execCommand("Stop")}catch(e){}n.attr("src",i.iframeSrc);q.error=b;i.error&&i.error.call(i.context,q,b,c);k&&a.event.trigger("ajaxError",[q,i,b]);i.complete&&i.complete.call(i.context,q,b)}};(k=i.global)&&0===a.active++&&a.event.trigger("ajaxStart");k&&a.event.trigger("ajaxSend",[q,i]);if(i.beforeSend&&!1===i.beforeSend.call(i.context,q,i))return i.global&&a.active--,B.reject(),B;if(q.aborted)return B.reject(),B;if(e=u.clk)if((x=e.name)&&!e.disabled)i.extraData=i.extraData||
{},i.extraData[x]=e.value,"image"==e.type&&(i.extraData[x+".x"]=u.clk_x,i.extraData[x+".y"]=u.clk_y);var O=1,I=2,e=a("meta[name=csrf-token]").attr("content");if((x=a("meta[name=csrf-param]").attr("content"))&&e)i.extraData=i.extraData||{},i.extraData[x]=e;i.forceSync?g():setTimeout(g,10);var C,z,T=50,P,s=a.parseXML||function(a,c){window.ActiveXObject?(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(a)):c=(new DOMParser).parseFromString(a,"text/xml");return c&&c.documentElement&&
"parsererror"!=c.documentElement.nodeName?c:null},A=a.parseJSON||function(a){return window.eval("("+a+")")};return B}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var l,k,p=this;"function"==typeof c?c={success:c}:void 0===c&&(c={});l=c.type||this.attr2("method");k=c.url||this.attr2("action");(k=(k="string"===typeof k?a.trim(k):"")||window.location.href||"")&&(k=(k.match(/^([^#]+)/)||[])[1]);c=a.extend(!0,{url:k,success:a.ajaxSettings.success,type:l||a.ajaxSettings.type,
iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},c);k={};this.trigger("form-pre-serialize",[this,c,k]);if(k.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(c.beforeSerialize&&!1===c.beforeSerialize(this,c))return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var n=c.traditional;void 0===n&&(n=a.ajaxSettings.traditional);var r=[],m,s=this.formToArray(c.semantic,r);c.data&&(c.extraData=c.data,m=a.param(c.data,
n));if(c.beforeSubmit&&!1===c.beforeSubmit(s,this,c))return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[s,this,c,k]);if(k.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;k=a.param(s,n);m&&(k=k?k+"&"+m:m);"GET"==c.type.toUpperCase()?(c.url+=(0<=c.url.indexOf("?")?"&":"?")+k,c.data=null):c.data=k;var t=[];c.resetForm&&t.push(function(){p.resetForm()});c.clearForm&&t.push(function(){p.clearForm(c.includeHidden)});
if(!c.dataType&&c.target){var g=c.success||function(){};t.push(function(b){var d=c.replaceTarget?"replaceWith":"html";a(c.target)[d](b).each(g,arguments)})}else c.success&&t.push(c.success);c.success=function(a,b,d){for(var e=c.context||this,f=0,g=t.length;f<g;f++)t[f].apply(e,[a,b,d||p,p])};if(c.error){var D=c.error;c.error=function(a,b,d){D.apply(c.context||this,[a,b,d,p])}}if(c.complete){var v=c.complete;c.complete=function(a,b){v.apply(c.context||this,[a,b,p])}}m=0<a("input[type=file]:enabled",
this).filter(function(){return""!==a(this).val()}).length;k="multipart/form-data"==p.attr("enctype")||"multipart/form-data"==p.attr("encoding");n=e&&f;d("fileAPI :"+n);var u;if(!1!==c.iframe&&(c.iframe||(m||k)&&!n))c.closeKeepAlive?a.get(c.closeKeepAlive,function(){u=b(s)}):u=b(s);else if((m||k)&&n){var x=new FormData;for(k=0;k<s.length;k++)x.append(s[k].name,s[k].value);if(c.extraData){k=a.param(c.extraData,c.traditional).split("&");n=k.length;m=[];var y,E;for(y=0;y<n;y++)k[y]=k[y].replace(/\+/g,
" "),E=k[y].split("="),m.push([decodeURIComponent(E[0]),decodeURIComponent(E[1])]);for(k=0;k<m.length;k++)m[k]&&x.append(m[k][0],m[k][1])}c.data=null;m=a.extend(!0,{},a.ajaxSettings,c,{contentType:!1,processData:!1,cache:!1,type:l||"POST"});c.uploadProgress&&(m.xhr=function(){var b=a.ajaxSettings.xhr();b.upload&&b.upload.addEventListener("progress",function(a){var b=0,d=a.loaded||a.position,e=a.total;a.lengthComputable&&(b=Math.ceil(100*(d/e)));c.uploadProgress(a,d,e,b)},!1);return b});m.data=null;
var A=m.beforeSend;m.beforeSend=function(a,b){b.data=c.formData?c.formData:x;A&&A.call(this,a,b)};u=a.ajax(m)}else u=a.ajax(c);p.removeData("jqxhr").data("jqxhr",u);for(m=0;m<r.length;m++)r[m]=null;this.trigger("form-submit-notify",[this,c]);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,c).off("click.form-plugin",this.selector,b).on("submit.form-plugin",this.selector,e,c).on("click.form-plugin",this.selector,e,b),this):this.ajaxFormUnbind().bind("submit.form-plugin",e,c).bind("click.form-plugin",e,b)};a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(c,
b){var d=[];if(0===this.length)return d;var f=this[0],h=this.attr("id"),n=c?f.getElementsByTagName("*"):f.elements;n&&!/MSIE [678]/.test(navigator.userAgent)&&(n=a(n).get());h&&(h=a(':input[form="'+h+'"]').get(),h.length&&(n=(n||[]).concat(h)));if(!n||!n.length)return d;var r,m,s,t,g;r=0;for(g=n.length;r<g;r++)if(t=n[r],(h=t.name)&&!t.disabled)if(c&&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((s=
a.fieldValue(t,!0))&&s.constructor==Array){b&&b.push(t);m=0;for(t=s.length;m<t;m++)d.push({name:h,value:s[m]})}else if(e&&"file"==t.type)if(b&&b.push(t),s=t.files,s.length)for(m=0;m<s.length;m++)d.push({name:h,value:s[m],type:t.type});else d.push({name:h,value:"",type:t.type});else null!==s&&"undefined"!=typeof s&&(b&&b.push(t),d.push({name:h,value:s,type:t.type,required:t.required}));if(!c&&f.clk&&(n=a(f.clk),r=n[0],(h=r.name)&&!r.disabled&&"image"==r.type))d.push({name:h,value:n.val()}),d.push({name:h+
".x",value:f.clk_x},{name:h+".y",value:f.clk_y});return d};a.fn.formSerialize=function(c){return a.param(this.formToArray(c))};a.fn.fieldSerialize=function(c){var b=[];this.each(function(){var d=this.name;if(d){var e=a.fieldValue(this,c);if(e&&e.constructor==Array)for(var f=0,h=e.length;f<h;f++)b.push({name:d,value:e[f]});else null!==e&&"undefined"!=typeof e&&b.push({name:this.name,value:e})}});return a.param(b)};a.fn.fieldValue=function(c){for(var b=[],d=0,e=this.length;d<e;d++){var f=a.fieldValue(this[d],
c);null===f||("undefined"==typeof f||f.constructor==Array&&!f.length)||(f.constructor==Array?a.merge(b,f):b.push(f))}return b};a.fieldValue=function(c,b){var d=c.name,e=c.type,f=c.tagName.toLowerCase();void 0===b&&(b=!0);if(b&&(!d||c.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!c.checked||("submit"==e||"image"==e)&&c.form&&c.form.clk!=c||"select"==f&&-1==c.selectedIndex))return null;if("select"==f){var h=c.selectedIndex;if(0>h)return null;for(var d=[],f=c.options,r=(e="select-one"==
e)?h+1:f.length,h=e?h:0;h<r;h++){var m=f[h];if(m.selected){var s=m.value;s||(s=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value);if(e)return s;d.push(s)}}return d}return a(c).val()};a.fn.clearForm=function(c){return this.each(function(){a("input,select,textarea",this).clearFields(c)})};a.fn.clearFields=a.fn.clearInputs=function(c){var b=/^(?: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(b.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(c&&(!0===c&&/hidden/.test(d)||"string"==typeof c&&a(this).is(c)))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(c){void 0===c&&(c=!0);return this.each(function(){var b=this.type;"checkbox"==b||"radio"==b?this.checked=c:"option"==this.tagName.toLowerCase()&&(b=a(this).parent("select"),c&&(b[0]&&"select-one"==b[0].type)&&b.find("option").selected(!1),this.selected=c)})};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 c=
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").addBack().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(c,b){var d=c.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()));b(e)});this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(){c._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(b){var d=a(b.target);d.hasClass("tagit-label")?(d=d.closest(".tagit-choice"),d.hasClass("removed")||c._trigger("onTagClicked",
b,{tag:d,tagLabel:c.tagLabel(d)})):c.tagInput.focus()});var b=!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){c.createTag(d,null,!0);b=!0})}else this.options.singleFieldNode=a('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />'),this.tagList.after(this.options.singleFieldNode);b||this.tagList.children("li").each(function(){a(this).hasClass("tagit-new")||
(c.createTag(a(this).text(),a(this).attr("class"),!0),a(this).remove())});this.tagInput.keydown(function(b){if(b.which==a.ui.keyCode.BACKSPACE&&""===c.tagInput.val()){var d=c._lastTag();!c.options.removeConfirmation||d.hasClass("remove")?c.removeTag(d):c.options.removeConfirmation&&d.addClass("remove ui-state-highlight")}else c.options.removeConfirmation&&c._lastTag().removeClass("remove ui-state-highlight");if(","===b.key&&!1===b.shiftKey||b.which===a.ui.keyCode.ENTER||b.which==a.ui.keyCode.TAB&&
""!==c.tagInput.val()||b.which==a.ui.keyCode.SPACE&&!0!==c.options.allowSpaces&&('"'!=a.trim(c.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==a.trim(c.tagInput.val()).charAt(0)&&'"'==a.trim(c.tagInput.val()).charAt(a.trim(c.tagInput.val()).length-1)&&0!==a.trim(c.tagInput.val()).length-1))if(b.which===a.ui.keyCode.ENTER&&""===c.tagInput.val()||b.preventDefault(),!c.options.autocomplete.autoFocus||!c.tagInput.data("autocomplete-open"))c.tagInput.autocomplete("close"),c.createTag(c._cleanedInput())}).blur(function(){c.tagInput.data("autocomplete-open")||
c.createTag(c._cleanedInput())});if(this.options.availableTags||this.options.tagSource||this.options.autocomplete.source)d={select:function(a,b){c.createTag(b.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(){c.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose.tagit",function(){c.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 c=this,b=[];this.options.singleField?(b=a(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter),
""===b[0]&&(b=[])):this._tags().each(function(){b.push(c.tagLabel(this))});return b},_updateSingleTagsField:function(c){a(this.options.singleFieldNode).val(c.join(this.options.singleFieldDelimiter)).trigger("change")},_subtractArray:function(c,b){for(var d=[],e=0;e<c.length;e++)-1==a.inArray(c[e],b)&&d.push(c[e]);return d},tagLabel:function(c){return this.options.singleField?a(c).find(".tagit-label:first").text():a(c).find("input:first").val()},_showAutocomplete:function(){this.tagInput.autocomplete("search",
"")},_findTagByLabel:function(c){var b=this,d=null;this._tags().each(function(){if(b._formatStr(c)==b._formatStr(b.tagLabel(this)))return d=a(this),!1});return d},_isNew:function(a){return!this._findTagByLabel(a)},_formatStr:function(c){return this.options.caseSensitive?c:a.trim(c.toLowerCase())},_effectExists:function(c){return Boolean(a.effects&&(a.effects[c]||a.effects.effect&&a.effects.effect[c]))},createTag:function(c,b,d){var e=this,c=a.trim(c);this.options.preprocessTag&&(c=this.options.preprocessTag(c));
if(""===c)return!1;if(!this.options.allowDuplicates&&!this._isNew(c))return c=this._findTagByLabel(c),!1!==this._trigger("onTagExists",null,{existingTag:c,duringInitialization:d})&&this._effectExists("highlight")&&c.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(c),h=a("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(b).append(f);
this.options.readOnly?h.addClass("tagit-choice-read-only"):(h.addClass("tagit-choice-editable"),b=a("<span></span>").addClass("ui-icon ui-icon-close"),b=a('<a><span class="text-icon">×</span></a>').addClass("tagit-close").append(b).click(function(){e.removeTag(h)}),h.append(b));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(c),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(c,b){b="undefined"===typeof b?this.options.animate:b;c=a(c);this._trigger("onTagRemoved",
null,c);if(!1!==this._trigger("beforeTagRemoved",null,{tag:c,tagLabel:this.tagLabel(c)})){if(this.options.singleField){var d=this.assignedTags(),e=this.tagLabel(c),d=a.grep(d,function(a){return a!=e});this._updateSingleTagsField(d)}if(b){c.addClass("removed");var d=this._effectExists("blind")?["blind",{direction:"horizontal"},"fast"]:["fast"],f=this;d.push(function(){c.remove();f._trigger("afterTagRemoved",null,{tag:c,tagLabel:f.tagLabel(c)})});c.fadeOut("fast").hide.apply(c,d).dequeue()}else c.remove(),
this._trigger("afterTagRemoved",null,{tag:c,tagLabel:this.tagLabel(c)})}},removeTagByLabel:function(a,b){var d=this._findTagByLabel(a);if(!d)throw"No such tag exists with the name '"+a+"'";this.removeTag(d,b)},removeAll:function(){var a=this;this._tags().each(function(b,d){a.removeTag(d,!1)})}})})(jQuery);jQuery.fn.sortElements=function(){var a=[].sort;return function(c,b){var b=b||function(){return this},d=this.map(function(){var a=b.call(this),c=a.parentNode,d=c.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(c===this)throw Error("You can't sort elements if any one is a descendant of another.");c.insertBefore(this,d);c.removeChild(d)}});return a.call(this,c).each(function(a){d[a].call(b.call(this))})}}();(function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a(jQuery)})(function(a){function c(a){return e.raw?a:encodeURIComponent(a)}function b(c,b){var j;if(e.raw)j=c;else a:{var i=c;0===i.indexOf('"')&&(i=i.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{i=decodeURIComponent(i.replace(d," "))}catch(l){j=void 0;break a}try{j=e.json?JSON.parse(i):i;break a}catch(k){}j=void 0}return a.isFunction(b)?b(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,l=j.expires=new Date;l.setDate(l.getDate()+i)}return document.cookie=[c(d),"=",c(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("; "):[],l=0,k=i.length;l<k;l++){var p=i[l].split("="),n;n=p.shift();n=e.raw?n:decodeURIComponent(n);p=p.join("=");
if(d&&d===n){j=b(p,h);break}if(!d&&void 0!==(p=b(p)))j[n]=p}return j};e.defaults={};a.removeCookie=function(c,b){return void 0!==a.cookie(c)?(a.cookie(c,"",a.extend({},b,{expires:-1})),!0):!1}});(function(a){a.fn.equalizeElementHeights=function(){var c=this.map(function(c,d){return a(d).height()}).get();return this.height(Math.max.apply(this,c))}})(jQuery);jQuery&&function(a){a.extend(a.fn,{selectBox:function(c,b){var d,e="",f=navigator.platform.match(/mac/i),h=function(c,b){var d,e=function(c,b){c.children("OPTION, OPTGROUP").each(function(){if(a(this).is("OPTION"))if(0<a(this).length){var c=a(this),d=b,f=a("<li />"),g=a("<a />");f.addClass(c.attr("class"));f.data(c.data());g.attr("rel",c.val()).text(c.text());f.append(g);c.attr("disabled")&&f.addClass("selectBox-disabled");c.attr("selected")&&f.addClass("selectBox-selected");d.append(f)}else b.append("<li> </li>");
else c=a('<li class="selectBox-optgroup" />'),c.text(a(this).attr("label")),b.append(c),b=e(a(this),b)});return b};switch(b){case "inline":return d=a('<ul class="selectBox-options" />'),d=e(c,d),d.find("A").bind("mouseover.selectBox",function(){r(c,a(this).parent())}).bind("mouseout.selectBox",function(){m(c,a(this).parent())}).bind("mousedown.selectBox",function(a){a.preventDefault();c.selectBox("control").hasClass("selectBox-active")||c.selectBox("control").focus()}).bind("mouseup.selectBox",function(b){p();
n(c,a(this).parent(),b)}),D(d),d;case "dropdown":d=a('<ul class="selectBox-dropdown-menu selectBox-options" />');d=e(c,d);d.data("selectBox-select",c).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"),p())}).bind("mouseup.selectBox",function(b){b.screenX===d.data("selectBox-down-at-x")&&
b.screenY===d.data("selectBox-down-at-y")||(d.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),n(c,a(this).parent()),p())}).bind("mouseover.selectBox",function(){r(c,a(this).parent())}).bind("mouseout.selectBox",function(){m(c,a(this).parent())});var f=c.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(c){return("selectBox-label "+(a(c).find("OPTION:selected").attr("class")||"")).replace(/\s+$/,"")},
i=function(c){return a(c).find("OPTION:selected").text()||" "},l=function(c){var c=a(c),b=c.data("selectBox-control");b&&b.find(".selectBox-label").attr("class",j(c)).text(i(c))},k=function(c){var c=a(c),b=c.data("selectBox-control"),d=c.data("selectBox-settings"),e=b.data("selectBox-options");if(b.hasClass("selectBox-disabled"))return!1;p();var f=isNaN(b.css("borderBottomWidth"))?0:parseInt(b.css("borderBottomWidth"));e.width(b.innerWidth()).css({top:b.offset().top+b.outerHeight()-f,left:b.offset().left});
if(c.triggerHandler("beforeopen"))return!1;f=function(){c.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");s(c,d,!0);r(c,d);b.addClass("selectBox-menuShowing");a(document).bind("mousedown.selectBox",function(c){a(c.target).parents().andSelf().hasClass("selectBox-options")||p()})},p=function(){0!==a(".selectBox-dropdown-menu:visible").length&&
(a(document).unbind("mousedown.selectBox"),a(".selectBox-dropdown-menu").each(function(){var c=a(this),b=c.data("selectBox-select"),d=b.data("selectBox-control"),e=b.data("selectBox-settings");if(b.triggerHandler("beforeclose"))return!1;var f=function(){b.triggerHandler("close",{_selectBox:!0})};if(e){switch(e.menuTransition){case "fade":c.fadeOut(e.menuSpeed,f);break;case "slide":c.slideUp(e.menuSpeed,f);break;default:c.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")}))},n=function(c,b,d){var c=a(c),b=a(b),e=c.data("selectBox-control");c.data("selectBox-settings");if(e.hasClass("selectBox-disabled")||0===b.length||b.hasClass("selectBox-disabled"))return!1;c.attr("multiple")?d.shiftKey&&e.data("selectBox-last-selected")?(b.toggleClass("selectBox-selected"),d=b.index()>e.data("selectBox-last-selected").index()?b.siblings().slice(e.data("selectBox-last-selected").index(),
b.index()):b.siblings().slice(b.index(),e.data("selectBox-last-selected").index()),d=d.not(".selectBox-optgroup, .selectBox-disabled"),b.hasClass("selectBox-selected")?d.addClass("selectBox-selected"):d.removeClass("selectBox-selected")):f&&d.metaKey||!f&&d.ctrlKey?b.toggleClass("selectBox-selected"):(b.siblings().removeClass("selectBox-selected"),b.addClass("selectBox-selected")):(b.siblings().removeClass("selectBox-selected"),b.addClass("selectBox-selected"));e.hasClass("selectBox-dropdown")&&e.find(".selectBox-label").text(b.text());
var g=0,h=[];c.attr("multiple")?e.find(".selectBox-selected A").each(function(){h[g++]=a(this).attr("rel")}):h=b.find("A").attr("rel");e.data("selectBox-last-selected",b);c.val()!==h&&(c.val(h),l(c),c.trigger("change"));return!0},r=function(c,b){c=a(c);b=a(b);c.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover");b.addClass("selectBox-hover")},m=function(c,b){c=a(c);a(b);c.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover")},
s=function(c,b,d){if(b&&0!==b.length){var c=a(c),c=c.data("selectBox-control"),e=c.data("selectBox-options"),c=c.hasClass("selectBox-dropdown")?e:e.parent(),e=parseInt(b.offset().top-c.position().top),f=parseInt(e+b.outerHeight());d?c.scrollTop(b.offset().top-c.offset().top+c.scrollTop()-c.height()/2):(0>e&&c.scrollTop(b.offset().top-c.offset().top+c.scrollTop()),f>c.height()&&c.scrollTop(b.offset().top+b.outerHeight()-c.offset().top+c.scrollTop()-c.height()))}},t=function(c,b){var c=a(c),d=c.data("selectBox-control"),
f=d.data("selectBox-options"),g=c.data("selectBox-settings"),h=0,i=0;if(!d.hasClass("selectBox-disabled"))switch(b.keyCode){case 8:b.preventDefault();e="";break;case 9:case 27:p();m(c);break;case 13:d.hasClass("selectBox-menuShowing")?(n(c,f.find("LI.selectBox-hover:first"),b),d.hasClass("selectBox-dropdown")&&p()):k(c);break;case 38:case 37:b.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););r(c,d);n(c,d,b);s(c,d)}else k(c);break;case 40:case 39:if(b.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););r(c,d);n(c,d,b);s(c,d)}else k(c)}},g=function(c,b){var c=a(c),f=c.data("selectBox-control"),g=f.data("selectBox-options");if(!f.hasClass("selectBox-disabled"))switch(b.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:f.hasClass("selectBox-menuShowing")||k(c),b.preventDefault(),clearTimeout(d),e+=String.fromCharCode(b.charCode||b.keyCode),g.find("A").each(function(){if(a(this).text().substr(0,e.length).toLowerCase()===
e.toLowerCase())return r(c,a(this).parent()),s(c,a(this).parent()),!1}),d=setTimeout(function(){e=""},1E3)}},D=function(c){a(c).css("MozUserSelect","none").bind("selectstart",function(a){a.preventDefault()})};switch(c){case "control":return a(this).data("selectBox-control");case "settings":if(!b)return a(this).data("selectBox-settings");a(this).each(function(){a(this).data("selectBox-settings",a.extend(!0,a(this).data("selectBox-settings"),b))});break;case "options":if(void 0===b)return a(this).data("selectBox-control").data("selectBox-options");
a(this).each(function(){var c,d=b;c=a(this);var e=c.data("selectBox-control");c.data("selectBox-settings");switch(typeof b){case "string":c.html(b);break;case "object":c.html("");for(var f in b)if(null!==b[f]){if("object"===typeof b[f]){var d=a('<optgroup label="'+f+'" />'),g;for(g in b[f])d.append('<option value="'+g+'">'+b[f][g]+"</option>")}else d=a('<option value="'+f+'">'+b[f]+"</option>");c.append(d)}}if(e)switch(e.data("selectBox-options").remove(),f=e.hasClass("selectBox-dropdown")?"dropdown":
"inline",d=h(c,f),e.data("selectBox-options",d),f){case "inline":e.append(d);break;case "dropdown":l(c),a("BODY").append(d)}});break;case "value":if(void 0===b)return a(this).val();a(this).each(function(){var c,d=b;c=a(this);c.val(d);d=c.val();null===d&&(d=c.children().first().val(),c.val(d));var e=c.data("selectBox-control");if(e){var f=c.data("selectBox-settings"),e=e.data("selectBox-options");l(c);e.find(".selectBox-selected").removeClass("selectBox-selected");e.find("A").each(function(){if("object"===
typeof d)for(var c=0;c<d.length;c++)a(this).attr("rel")==d[c]&&a(this).parent().addClass("selectBox-selected");else a(this).attr("rel")==d&&a(this).parent().addClass("selectBox-selected")});f.change&&f.change.call(c)}});break;case "refresh":a(this).each(function(){var c;c=a(this);c.selectBox("options",c.html())});break;case "enable":a(this).each(function(){var c;c=a(this);c.attr("disabled",!1);(c=c.data("selectBox-control"))&&c.removeClass("selectBox-disabled")});break;case "disable":a(this).each(function(){var c;
c=a(this);c.attr("disabled",!0);(c=c.data("selectBox-control"))&&c.addClass("selectBox-disabled")});break;case "destroy":a(this).each(function(){var c;c=a(this);var b=c.data("selectBox-control");b&&(b.data("selectBox-options").remove(),b.remove(),c.removeClass("selectBox").removeData("selectBox-control").data("selectBox-control",null).removeData("selectBox-settings").data("selectBox-settings",null).show())});break;default:a(this).each(function(){var b=this,d;if(!navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i)&&
"select"===b.tagName.toLowerCase()&&(b=a(b),!b.data("selectBox-control"))){var e=a('<a class="selectBox" />'),f=b.attr("multiple")||1<parseInt(b.attr("size")),m=c||{};e.width(b.outerWidth()).addClass(b.attr("class")).attr("title",b.attr("title")||"").attr("tabindex",parseInt(b.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"),
b.trigger("focus"))}).bind("blur.selectBox",function(){e.hasClass("selectBox-active")&&(e.removeClass("selectBox-active"),b.trigger("blur"))});a(window).data("selectBox-bindings")||a(window).data("selectBox-bindings",!0).bind("scroll.selectBox",p).bind("resize.selectBox",p);b.attr("disabled")&&e.addClass("selectBox-disabled");b.bind("click.selectBox",function(a){e.focus();a.preventDefault()});if(f){if(d=h(b,"inline"),e.append(d).data("selectBox-options",d).addClass("selectBox-inline selectBox-menuShowing").bind("keydown.selectBox",
function(a){t(b,a)}).bind("keypress.selectBox",function(a){g(b,a)}).bind("mousedown.selectBox",function(c){a(c.target).is("A.selectBox-inline")&&c.preventDefault();e.hasClass("selectBox-focus")||e.focus()}).insertAfter(b),!b[0].style.height){var f=b.attr("size")?parseInt(b.attr("size")):5,l=e.clone().removeAttr("id").css({position:"absolute",top:"-9999em"}).show().appendTo("body");l.find(".selectBox-options").html("<li><a> </a></li>");var n=parseInt(l.find(".selectBox-options A:first").html(" ").outerHeight());
l.remove();e.height(n*f)}}else f=a('<span class="selectBox-label" />'),l=a('<span class="selectBox-arrow" />'),f.attr("class",j(b)).text(i(b)),d=h(b,"dropdown"),d.appendTo("BODY"),e.data("selectBox-options",d).addClass("selectBox-dropdown").append(f).append(l).bind("mousedown.selectBox",function(a){e.hasClass("selectBox-menuShowing")?p():(a.stopPropagation(),d.data("selectBox-down-at-x",a.screenX).data("selectBox-down-at-y",a.screenY),k(b))}).bind("keydown.selectBox",function(a){t(b,a)}).bind("keypress.selectBox",
function(a){g(b,a)}).bind("open.selectBox",function(a,c){c&&!0===c._selectBox||k(b)}).bind("close.selectBox",function(a,c){c&&!0===c._selectBox||p()}).insertAfter(b),l=e.width()-l.outerWidth()-parseInt(f.css("paddingLeft"))-parseInt(f.css("paddingLeft")),f.width(l);D(e);b.addClass("selectBox").data("selectBox-control",e).data("selectBox-settings",m).hide()}})}return a(this)}})}(jQuery);(function(){function a(a){return function(c,b,d,e){var b=D(b,e,4),f=!w(c)&&g.keys(c),h=(f||c).length,i=0<a?0:h-1;3>arguments.length&&(d=c[f?f[i]:i],i+=a);for(var j=b,k=d;0<=i&&i<h;i+=a)var l=f?f[i]:i,k=j(k,c[l],l,c);return k}}function c(a){return function(c,b,d){for(var b=v(b,d),d=A(c),e=0<a?0:d-1;0<=e&&e<d;e+=a)if(b(c[e],e,c))return e;return-1}}function b(a,c,b){return function(d,e,f){var h=0,i=A(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(b&&f&&i)return f=
b(d,e),d[f]===e?f:-1;if(e!==e)return f=c(l.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,c){var b=Q.length,d=a.constructor,d=g.isFunction(d)&&d.prototype||j,e="constructor";for(g.has(a,e)&&!g.contains(c,e)&&c.push(e);b--;)e=Q[b],e in a&&(a[e]!==d[e]&&!g.contains(c,e))&&c.push(e)}var e=this,f=e._,h=Array.prototype,j=Object.prototype,i=h.push,l=h.slice,k=j.toString,p=j.hasOwnProperty,n=Array.isArray,r=Object.keys,m=Function.prototype.bind,
s=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,c,b){if(void 0===c)return a;switch(null==b?3:b){case 1:return function(b){return a.call(c,b)};case 2:return function(b,d){return a.call(c,b,d)};case 3:return function(b,d,e){return a.call(c,b,d,e)};case 4:return function(b,
d,e,f){return a.call(c,b,d,e,f)}}return function(){return a.apply(c,arguments)}},v=function(a,c,b){return null==a?g.identity:g.isFunction(a)?D(a,c,b):g.isObject(a)?g.matcher(a):g.property(a)};g.iteratee=function(a,c){return v(a,c,Infinity)};var u=function(a,c){return function(b){var d=arguments.length;if(2>d||null==b)return b;for(var e=1;e<d;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;i<h;i++){var j=g[i];if(!c||void 0===b[j])b[j]=f[j]}return b}},x=function(a){if(!g.isObject(a))return{};if(s)return s(a);
t.prototype=a;a=new t;t.prototype=null;return a},y=function(a){return function(c){return null==c?void 0:c[a]}},E=Math.pow(2,53)-1,A=y("length"),w=function(a){a=A(a);return"number"==typeof a&&0<=a&&a<=E};g.each=g.forEach=function(a,c,b){var c=D(c,b),d;if(w(a)){b=0;for(d=a.length;b<d;b++)c(a[b],b,a)}else{var e=g.keys(a),b=0;for(d=e.length;b<d;b++)c(a[e[b]],e[b],a)}return a};g.map=g.collect=function(a,c,b){for(var c=v(c,b),b=!w(a)&&g.keys(a),d=(b||a).length,e=Array(d),f=0;f<d;f++){var h=b?b[f]:f;e[f]=
c(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,c,b){c=w(a)?g.findIndex(a,c,b):g.findKey(a,c,b);if(void 0!==c&&-1!==c)return a[c]};g.filter=g.select=function(a,c,b){var d=[],c=v(c,b);g.each(a,function(a,b,e){c(a,b,e)&&d.push(a)});return d};g.reject=function(a,c,b){return g.filter(a,g.negate(v(c)),b)};g.every=g.all=function(a,c,b){for(var c=v(c,b),b=!w(a)&&g.keys(a),d=(b||a).length,e=0;e<d;e++){var f=b?b[e]:e;if(!c(a[f],f,a))return!1}return!0};
g.some=g.any=function(a,c,b){for(var c=v(c,b),b=!w(a)&&g.keys(a),d=(b||a).length,e=0;e<d;e++){var f=b?b[e]:e;if(c(a[f],f,a))return!0}return!1};g.contains=g.includes=g.include=function(a,c,b,d){w(a)||(a=g.values(a));if("number"!=typeof b||d)b=0;return 0<=g.indexOf(a,c,b)};g.invoke=function(a,c){var b=l.call(arguments,2),d=g.isFunction(c);return g.map(a,function(a){var e=d?c:a[c];return null==e?e:e.apply(a,b)})};g.pluck=function(a,c){return g.map(a,g.property(c))};g.where=function(a,c){return g.filter(a,
g.matcher(c))};g.findWhere=function(a,c){return g.find(a,g.matcher(c))};g.max=function(a,c,b){var d=-Infinity,e=-Infinity,f;if(null==c&&null!=a)for(var a=w(a)?a:g.values(a),h=0,i=a.length;h<i;h++)b=a[h],b>d&&(d=b);else c=v(c,b),g.each(a,function(a,b,g){f=c(a,b,g);if(f>e||-Infinity===f&&-Infinity===d)d=a,e=f});return d};g.min=function(a,c,b){var d=Infinity,e=Infinity,f;if(null==c&&null!=a)for(var a=w(a)?a:g.values(a),h=0,i=a.length;h<i;h++)b=a[h],b<d&&(d=b);else c=v(c,b),g.each(a,function(a,b,g){f=
c(a,b,g);if(f<e||Infinity===f&&Infinity===d)d=a,e=f});return d};g.shuffle=function(a){for(var a=w(a)?a:g.values(a),c=a.length,b=Array(c),d=0,e;d<c;d++)e=g.random(0,d),e!==d&&(b[d]=b[e]),b[e]=a[d];return b};g.sample=function(a,c,b){return null==c||b?(w(a)||(a=g.values(a)),a[g.random(a.length-1)]):g.shuffle(a).slice(0,Math.max(0,c))};g.sortBy=function(a,c,b){c=v(c,b);return g.pluck(g.map(a,function(a,b,d){return{value:a,index:b,criteria:c(a,b,d)}}).sort(function(a,c){var b=a.criteria,d=c.criteria;if(b!==
d){if(b>d||void 0===b)return 1;if(b<d||void 0===d)return-1}return a.index-c.index}),"value")};var H=function(a){return function(c,b,d){var e={},b=v(b,d);g.each(c,function(d,f){var g=b(d,f,c);a(e,d,g)});return e}};g.groupBy=H(function(a,c,b){g.has(a,b)?a[b].push(c):a[b]=[c]});g.indexBy=H(function(a,c,b){a[b]=c});g.countBy=H(function(a,c,b){g.has(a,b)?a[b]++:a[b]=1});g.toArray=function(a){return!a?[]:g.isArray(a)?l.call(a):w(a)?g.map(a,g.identity):g.values(a)};g.size=function(a){return null==a?0:w(a)?
a.length:g.keys(a).length};g.partition=function(a,c,b){var c=v(c,b),d=[],e=[];g.each(a,function(a,b,f){(c(a,b,f)?d:e).push(a)});return[d,e]};g.first=g.head=g.take=function(a,c,b){return null==a?void 0:null==c||b?a[0]:g.initial(a,a.length-c)};g.initial=function(a,c,b){return l.call(a,0,Math.max(0,a.length-(null==c||b?1:c)))};g.last=function(a,c,b){return null==a?void 0:null==c||b?a[a.length-1]:g.rest(a,Math.max(0,a.length-c))};g.rest=g.tail=g.drop=function(a,c,b){return l.call(a,null==c||b?1:c)};g.compact=
function(a){return g.filter(a,g.identity)};var F=function(a,c,b,d){for(var e=[],f=0,d=d||0,h=A(a);d<h;d++){var i=a[d];if(w(i)&&(g.isArray(i)||g.isArguments(i))){c||(i=F(i,c,b));var j=0,k=i.length;for(e.length+=k;j<k;)e[f++]=i[j++]}else b||(e[f++]=i)}return e};g.flatten=function(a,c){return F(a,c,!1)};g.without=function(a){return g.difference(a,l.call(arguments,1))};g.uniq=g.unique=function(a,c,b,d){g.isBoolean(c)||(d=b,b=c,c=!1);null!=b&&(b=v(b,d));for(var d=[],e=[],f=0,h=A(a);f<h;f++){var i=a[f],
j=b?b(i,f,a):i;c?((!f||e!==j)&&d.push(i),e=j):b?g.contains(e,j)||(e.push(j),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 c=[],b=arguments.length,d=0,e=A(a);d<e;d++){var f=a[d];if(!g.contains(c,f)){for(var h=1;h<b&&g.contains(arguments[h],f);h++);h===b&&c.push(f)}}return c};g.difference=function(a){var c=F(arguments,!0,!0,1);return g.filter(a,function(a){return!g.contains(c,a)})};g.zip=function(){return g.unzip(arguments)};
g.unzip=function(a){for(var c=a&&g.max(a,A).length||0,b=Array(c),d=0;d<c;d++)b[d]=g.pluck(a,d);return b};g.object=function(a,c){for(var b={},d=0,e=A(a);d<e;d++)c?b[a[d]]=c[d]:b[a[d][0]]=a[d][1];return b};g.findIndex=c(1);g.findLastIndex=c(-1);g.sortedIndex=function(a,c,b,d){for(var b=v(b,d,1),c=b(c),d=0,e=A(a);d<e;){var f=Math.floor((d+e)/2);b(a[f])<c?d=f+1:e=f}return d};g.indexOf=b(1,g.findIndex,g.sortedIndex);g.lastIndexOf=b(-1,g.findLastIndex);g.range=function(a,c,b){null==c&&(c=a||0,a=0);for(var b=
b||1,c=Math.max(Math.ceil((c-a)/b),0),d=Array(c),e=0;e<c;e++,a+=b)d[e]=a;return d};var M=function(a,c,b,d,e){if(!(d instanceof c))return a.apply(b,e);c=x(a.prototype);a=a.apply(c,e);return g.isObject(a)?a:c};g.bind=function(a,c){if(m&&a.bind===m)return m.apply(a,l.call(arguments,1));if(!g.isFunction(a))throw new TypeError("Bind must be called on a function");var b=l.call(arguments,2),d=function(){return M(a,d,c,this,b.concat(l.call(arguments)))};return d};g.partial=function(a){var c=l.call(arguments,
1),b=function(){for(var d=0,e=c.length,f=Array(e),h=0;h<e;h++)f[h]=c[h]===g?arguments[d++]:c[h];for(;d<arguments.length;)f.push(arguments[d++]);return M(a,b,this,this,f)};return b};g.bindAll=function(a){var c,b=arguments.length,d;if(1>=b)throw Error("bindAll must be passed function names");for(c=1;c<b;c++)d=arguments[c],a[d]=g.bind(a[d],a);return a};g.memoize=function(a,c){var b=function(d){var e=b.cache,f=""+(c?c.apply(this,arguments):d);g.has(e,f)||(e[f]=a.apply(this,arguments));return e[f]};b.cache=
{};return b};g.delay=function(a,c){var b=l.call(arguments,2);return setTimeout(function(){return a.apply(null,b)},c)};g.defer=g.partial(g.delay,g,1);g.throttle=function(a,c,b){var d,e,f,h=null,i=0;b||(b={});var j=function(){i=!1===b.leading?0:g.now();h=null;f=a.apply(d,e);h||(d=e=null)};return function(){var k=g.now();!i&&!1===b.leading&&(i=k);var l=c-(k-i);d=this;e=arguments;0>=l||l>c?(h&&(clearTimeout(h),h=null),i=k,f=a.apply(d,e),h||(d=e=null)):!h&&!1!==b.trailing&&(h=setTimeout(j,l));return f}};
g.debounce=function(a,c,b){var d,e,f,h,i,j=function(){var k=g.now()-h;k<c&&0<=k?d=setTimeout(j,c-k):(d=null,b||(i=a.apply(f,e),d||(f=e=null)))};return function(){f=this;e=arguments;h=g.now();var k=b&&!d;d||(d=setTimeout(j,c));k&&(i=a.apply(f,e),f=e=null);return i}};g.wrap=function(a,c){return g.partial(c,a)};g.negate=function(a){return function(){return!a.apply(this,arguments)}};g.compose=function(){var a=arguments,c=a.length-1;return function(){for(var b=c,d=a[c].apply(this,arguments);b--;)d=a[b].call(this,
d);return d}};g.after=function(a,c){return function(){if(1>--a)return c.apply(this,arguments)}};g.before=function(a,c){var b;return function(){0<--a&&(b=c.apply(this,arguments));1>=a&&(c=null);return b}};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(r)return r(a);var c=[],b;for(b in a)g.has(a,b)&&c.push(b);N&&d(a,c);
return c};g.allKeys=function(a){if(!g.isObject(a))return[];var c=[],b;for(b in a)c.push(b);N&&d(a,c);return c};g.values=function(a){for(var c=g.keys(a),b=c.length,d=Array(b),e=0;e<b;e++)d[e]=a[c[e]];return d};g.mapObject=function(a,c,b){for(var c=v(c,b),b=g.keys(a),d=b.length,e={},f,h=0;h<d;h++)f=b[h],e[f]=c(a[f],f,a);return e};g.pairs=function(a){for(var c=g.keys(a),b=c.length,d=Array(b),e=0;e<b;e++)d[e]=[c[e],a[c[e]]];return d};g.invert=function(a){for(var c={},b=g.keys(a),d=0,e=b.length;d<e;d++)c[a[b[d]]]=
b[d];return c};g.functions=g.methods=function(a){var c=[],b;for(b in a)g.isFunction(a[b])&&c.push(b);return c.sort()};g.extend=u(g.allKeys);g.extendOwn=g.assign=u(g.keys);g.findKey=function(a,c,b){for(var c=v(c,b),b=g.keys(a),d,e=0,f=b.length;e<f;e++)if(d=b[e],c(a[d],d,a))return d};g.pick=function(a,c,b){var d={},e=a,f,h;if(null==e)return d;g.isFunction(c)?(h=g.allKeys(e),f=D(c,b)):(h=F(arguments,!1,!1,1),f=function(a,c,b){return c in b},e=Object(e));for(var i=0,j=h.length;i<j;i++){var k=h[i],l=e[k];
f(l,k,e)&&(d[k]=l)}return d};g.omit=function(a,c,b){if(g.isFunction(c))c=g.negate(c);else var d=g.map(F(arguments,!1,!1,1),String),c=function(a,c){return!g.contains(d,c)};return g.pick(a,c,b)};g.defaults=u(g.allKeys,!0);g.create=function(a,c){var b=x(a);c&&g.extendOwn(b,c);return b};g.clone=function(a){return!g.isObject(a)?a:g.isArray(a)?a.slice():g.extend({},a)};g.tap=function(a,c){c(a);return a};g.isMatch=function(a,c){var b=g.keys(c),d=b.length;if(null==a)return!d;for(var e=Object(a),f=0;f<d;f++){var h=
b[f];if(c[h]!==e[h]||!(h in e))return!1}return!0};var K=function(a,c,b,d){if(a===c)return 0!==a||1/a===1/c;if(null==a||null==c)return a===c;a instanceof g&&(a=a._wrapped);c instanceof g&&(c=c._wrapped);var e=k.call(a);if(e!==k.call(c))return!1;switch(e){case "[object RegExp]":case "[object String]":return""+a===""+c;case "[object Number]":return+a!==+a?+c!==+c:0===+a?1/+a===1/c:+a===+c;case "[object Date]":case "[object Boolean]":return+a===+c}e="[object Array]"===e;if(!e){if("object"!=typeof a||
"object"!=typeof c)return!1;var f=a.constructor,h=c.constructor;if(f!==h&&(!g.isFunction(f)||!(f instanceof f&&g.isFunction(h)&&h instanceof h))&&"constructor"in a&&"constructor"in c)return!1}b=b||[];d=d||[];for(f=b.length;f--;)if(b[f]===a)return d[f]===c;b.push(a);d.push(c);if(e){f=a.length;if(f!==c.length)return!1;for(;f--;)if(!K(a[f],c[f],b,d))return!1}else{e=g.keys(a);f=e.length;if(g.keys(c).length!==f)return!1;for(;f--;)if(h=e[f],!g.has(c,h)||!K(a[h],c[h],b,d))return!1}b.pop();d.pop();return!0};
g.isEqual=function(a,c){return K(a,c)};g.isEmpty=function(a){return null==a?!0:w(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=n||function(a){return"[object Array]"===k.call(a)};g.isObject=function(a){var c=typeof a;return"function"===c||"object"===c&&!!a};g.each("Arguments Function String Number Date RegExp Error".split(" "),function(a){g["is"+a]=function(c){return k.call(c)==="[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,c){return null!=a&&
p.call(a,c)};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=y;g.propertyOf=function(a){return null==a?function(){}:function(c){return a[c]}};g.matcher=g.matches=function(a){a=g.extendOwn({},a);return function(c){return g.isMatch(c,a)}};g.times=function(a,c,b){for(var d=Array(Math.max(0,a)),c=D(c,b,1),b=0;b<a;b++)d[b]=c(b);return d};g.random=function(a,c){null==c&&(c=a,a=0);return a+Math.floor(Math.random()*
(c-a+1))};g.now=Date.now||function(){return(new Date).getTime()};n={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};u=g.invert(n);y=function(a){var c=function(c){return a[c]},b="(?:"+g.keys(a).join("|")+")",d=RegExp(b),e=RegExp(b,"g");return function(a){a=null==a?"":""+a;return d.test(a)?a.replace(e,c):a}};g.escape=y(n);g.unescape=y(u);g.result=function(a,c,b){c=null==a?void 0:a[c];void 0===c&&(c=b);return g.isFunction(c)?c.call(a):c};var U=0;g.uniqueId=function(a){var c=
++U+"";return a?a+c:c};g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var J=/(.)^/,S={"'":"'","\\":"\\","\r":"r","\n":"n","
":"u2028","
":"u2029"},R=/\\|'|\r|\n|
|
/g,q=function(a){return"\\"+S[a]};g.template=function(a,c,b){!c&&b&&(c=b);var c=g.defaults({},c,g.templateSettings),b=RegExp([(c.escape||J).source,(c.interpolate||J).source,(c.evaluate||J).source].join("|")+"|$","g"),d=0,e="__p+='";a.replace(b,function(c,b,f,
g,h){e+=a.slice(d,h).replace(R,q);d=h+c.length;b?e+="'+\n((__t=("+b+"))==null?'':_.escape(__t))+\n'":f?e+="'+\n((__t=("+f+"))==null?'':__t)+\n'":g&&(e+="';\n"+g+"\n__p+='");return c});e+="';\n";c.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(c.variable||"obj","_",e)}catch(h){throw h.source=e,h;}b=function(a){return f.call(this,a,g)};b.source="function("+(c.variable||"obj")+
"){\n"+e+"}";return b};g.chain=function(a){a=g(a);a._chain=!0;return a};var L=function(a,c){return a._chain?g(c).chain():c};g.mixin=function(a){g.each(g.functions(a),function(c){var b=g[c]=a[c];g.prototype[c]=function(){var a=[this._wrapped];i.apply(a,arguments);return L(this,b.apply(g,a))}})};g.mixin(g);g.each("pop push reverse shift sort splice unshift".split(" "),function(a){var c=h[a];g.prototype[a]=function(){var b=this._wrapped;c.apply(b,arguments);("shift"===a||"splice"===a)&&0===b.length&&
delete b[0];return L(this,b)}});g.each(["concat","join","slice"],function(a){var c=h[a];g.prototype[a]=function(){return L(this,c.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);(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 c=a.pkp.classes.Helper.CHARS_,b=Array(36),d=0,e,f;for(f=0;36>f;f++)8==f||13==f||18==f||23==f?b[f]="-":14==f?b[f]="4":(2>=d&&(d=33554432+16777216*Math.random()|0),e=d&15,d>>=4,b[f]=c[19==f?e&3|8:e]);return b.join("")};a.pkp.classes.Helper.inherits=function(a,b){var d=function(){};d.prototype=b.prototype;a.parent_=b.prototype;a.prototype=new d;a.prototype.constructor=a;b.prototype.constructor==Object.prototype.constructor&&(b.prototype.constructor=b)};a.pkp.classes.Helper.objectFactory=
function(c,b){var d,e;d=a.pkp.classes.Helper.resolveObjectName(c);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(c,b)};a.pkp.classes.Helper.resolveObjectName=function(c){var b,d,e;b=c.split();if("$"!=b.shift())throw Error(['Namespace "',b[0],'" for object "',c,'" is currently not supported!'].join(""));e=b[b.length-1];if(e.charAt(0).toUpperCase()!==
e.charAt(0))throw Error(['The name "',c,'" does not point to aconstructor which must always be upper case!'].join(""));e=a;for(d in b)if(e=e[b[d]],void 0===e)throw Error(['Constructor for object "',c,'" not found!'].join(""));if(!a.isFunction(e))throw Error(['The name "',c,'" 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,c){this.objectName_=a;this.parent.apply(this,c)};a.objectName_="";a.prototype.parent=
function(){};return a};a.pkp.classes.Helper.injectMixin=function(c,b){var d=a.pkp.classes.Helper.objectFactory(b,[]);a.extend(!0,c,d)};a.pkp.classes.Helper.curry=function(a,b,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(b,f)}}return function(){return a.apply(b,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(c,b){var d,e;for(d=this.constructor;d;d=d.parent_&&d.parent_.constructor)if(d.hasOwnProperty(c))return d=d[c],a.isFunction(d)?(e=Array.prototype.slice.call(arguments,1),d.apply(this,e)):d;throw Error(['Static property "',c,'" not found!'].join(""));};a.pkp.classes.ObjectProxy.prototype.parent=function(c,b){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(c)&&this[c]===d)return this.constructor.parent_[c].apply(this,e);f=!1;for(h=this.constructor;h;h=h.parent_&&h.parent_.constructor)if(h.prototype.hasOwnProperty(c)&&h.prototype[c]===d)f=!0;else if(f)return h.prototype[c].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(c,b){var d,e,f;if(1<c.length)throw Error("jQuery selector contained more than one handler!");this.$htmlElement_=c;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(c){a.pkp.classes.Handler.hasHandler(a(d[c]))&&
a.pkp.classes.Handler.getHandler(a(d[c])).handlerChildren_.push(e)});b.eventBridge&&(this.eventBridge_=b.eventBridge);if(b.publishChangeEvents){this.publishChangeEvents_=b.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(c){c=c.data("pkp.handler");if(!(c instanceof a.pkp.classes.Handler))throw Error("There is no handler bound to this element!");return c};a.pkp.classes.Handler.hasHandler=function(c){return c.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(c){var b,d,e,f,h,j;b=a(this);d=a.pkp.classes.Handler.getHandler(b);if(b[0]!==d.getHtmlElement.call(d)[0])throw Error("An invalid handler is bound to the calling element of an event!");
b=d.eventBindings_[c.type];if(void 0===b)return!1;e=a.makeArray(arguments);f=!0;e.unshift(this);h=0;for(j=b.length;h<j&&!(!1===b[h].apply(d,e)&&(f=!1),c.isImmediatePropagationStopped());h++);c.stopPropagation();return f};a.pkp.classes.Handler.prototype.callbackWrapper=function(c,b){a.pkp.classes.Handler.checkContext_(this);b||(b=this);return function(){var d;d=a.makeArray(arguments);d.unshift(this);return c.apply(b,d)}};a.pkp.classes.Handler.prototype.remoteResponse=function(a,b){return this.handleJson(b)};
a.pkp.classes.Handler.prototype.remove=function(){a.pkp.classes.Handler.checkContext_(this);var c,b;c=this.getHtmlElement();c.unbind(".pkpHandler");for(b in this.dataItems_)"pkp.handler"!==b&&c.removeData(b);c.trigger("pkpRemoveHandler");c.unbind(".pkpHandlerRemove");c.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 c=_.has(a,"data")?a.data:
null;!_.isNull(c)&&c.isGlobalEvent?(c.handler=this,pkp.eventBus.$emit(a.name,c)):this.trigger(a.name,c)},this),a;a.content&&alert(a.content);return!1};a.pkp.classes.Handler.prototype.setHtmlElement=function(c){a.pkp.classes.Handler.checkContext_(this);return this.$htmlElement_=c};a.pkp.classes.Handler.prototype.bind=function(c,b){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[c]){this.eventBindings_[c]=[];var d;d=".pkpHandler";"pkpRemoveHandler"===c&&(d=".pkpHandlerRemove");this.getHtmlElement().bind(c+
d,this.handleEvent)}this.eventBindings_[c].push(b)};a.pkp.classes.Handler.prototype.unbind=function(c,b){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[c])return!1;var d,e;d=0;for(e=this.eventBindings_[c].length;d<e;d++)if(this.eventBindings_[c][d]===b){this.eventBindings_[c].splice([d],1);break}0===this.eventBindings_[c].length&&(delete this.eventBindings_[c],this.getHtmlElement().unbind(c,this.handleEvent));return!0};a.pkp.classes.Handler.prototype.bindGlobal=function(a,b){"undefined"===
typeof this.globalEventListeners_[a]&&(this.globalEventListeners_[a]=[]);var d=this.callbackWrapper(b);this.globalEventListeners_[a].push(d);pkp.eventBus.$on(a,d)};a.pkp.classes.Handler.prototype.unbindGlobal=function(a,b){var d=this.callbackWrapper(b);"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,b){_.each(a,function(a){pkp.eventBus.$off(b,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(c,b){a.pkp.classes.Handler.checkContext_(this);
c="pkp."+c;void 0!==b&&(this.dataItems_[c]=!0);return 1<arguments.length?this.getHtmlElement().data(c,b):this.getHtmlElement().data(c)};a.pkp.classes.Handler.prototype.trigger=function(a,b){void 0===b&&(b=null);this.getHtmlElement().triggerHandler(a,b);this.publishedEvents_[a]||this.triggerPublicEvent_(a,b)};a.pkp.classes.Handler.prototype.publishEvent=function(a){this.publishedEvents_[a]||(this.publishedEvents_[a]=!0,this.bind(a,function(b,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(c){a(c.currentTarget).parent().parent().find("span").toggle()};a.pkp.classes.Handler.prototype.initializeTinyMCE=function(){if("undefined"!==typeof tinyMCE){var c=this.getHtmlElement().attr("id"),b=tinyMCE.EditorManager.settings;b.defaultToolbar=b.toolbar;a("#"+c).find(".richContent").each(function(){var c=a(this).attr("id"),b=a("<div></div>"),f=a("<div></div>"),h=tinyMCE.EditorManager.settings;h.toolbar=a(this).hasClass("extendedRichContent")?
h.richToolbar:h.defaultToolbar;tinyMCE.EditorManager.createEditor(c,h).render();if(a(this).hasClass("localizable")||a(this).hasClass("flag"))if(b.addClass("mceLocalizationIcon localizable"),b.attr("id","mceLocalizationIcon-"+c),a(this).wrap(f),a(this).parent().append(b),a(this).hasClass("localizable"))b.addClass("mceGlobe");else if(a(this).hasClass("flag")&&(c=a(this).attr("class").split(" "),c.length))for(f=0;f<c.length;f++)if(c[f].match(/^flag_[a-z]{2}_[A-Z]{2}$/)){b.addClass(c[f]);break}})}};a.pkp.classes.Handler.prototype.triggerPublicEvent_=
function(c,b){this.getHtmlElement().parent().trigger(c,b);this.eventBridge_&&a('[id^="'+this.eventBridge_+'"]').trigger(c,b)};a.pkp.classes.Handler.prototype.replaceWith=function(a){this.unbindGlobalAll();this.getHtmlElement().replaceWith(a)};a.pkp.classes.Handler.prototype.replacePartialWith=function(c,b){a.pkp.classes.Handler.hasHandler(b)?a.pkp.classes.Handler.getHandler(b).replaceWith(c):(this.unbindPartial(b),b.replaceWith(c))};a.pkp.classes.Handler.prototype.html=function(a){this.unbindGlobalChildren();
this.getHtmlElement().html(a)};a.pkp.classes.Handler.prototype.unbindPartial=function(c){a("*",c).each(function(){if(a.pkp.classes.Handler.hasHandler(a(this))){var c=a.pkp.classes.Handler.getHandler(a(this));c.callbackWrapper(c.unbindGlobalAll())}})};a.pkp.classes.Handler.checkContext_=function(c){if(!(c 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(c){c=a(c).attr("data-variables");return void 0!==c?a.parseJSON(decodeURIComponent(c)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap=function(c){c=a(c).attr("data-variablesType");return void 0!==c?a.parseJSON(decodeURIComponent(c)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableElement=function(c,
b,d){d=a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap(d);return void 0!=d[c]&&(d=d[c],d==a.pkp.cons.INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT)?a("<div/>").append(a("<span/>").text(b)):a("<div/>").append(a("<span/>").addClass("pkpTag mceNonEditable").attr("data-symbolic",c).text(b))}})(jQuery);(function(a){a.pkp.classes.linkAction=a.pkp.classes.linkAction||{};a.pkp.classes.linkAction.LinkActionRequest=function(a,b){this.$linkActionElement=a;this.options=b;a.is("a")&&b.url&&a.attr("href",b.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,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.RedirectRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.RedirectRequest.prototype.activate=function(a,b){var d=this.getOptions();window.open(d.url,d.name,d.specs);return this.parent("activate",a,b)}})(jQuery);(function(a){a.pkp.classes.linkAction.OpenWindowRequest=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.OpenWindowRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.OpenWindowRequest.prototype.activate=function(a,b){var d=this.getOptions();window.open(d.url);return this.parent("activate",a,b)}})(jQuery);(function(a){a.pkp.classes.linkAction.PostAndRedirectRequest=function(a,b){this.parent(a,b)};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(c,b){var d=this.parent("activate",c,b),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 c=this.getLinkActionElement(),c=a.pkp.classes.Handler.getHandler(c);this.finish();c.handleJson(this.postJsonData_)};a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.handleResponse_=function(c){var b=this.getOptions(),d=null,e=null;this.postJsonData_=c;d=setInterval(function(){0==a.active&&(clearInterval(d),window.location=b.url)},100);e=a.pkp.classes.Helper.curry(this.finishCallback_,
this);setTimeout(e,2E3)}})(jQuery);(function(a){a.pkp.classes.linkAction.NullAction=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.NullAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.NullAction.prototype.activate=function(a,b){return this.parent("activate",a,b)};a.pkp.classes.linkAction.NullAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.EventAction=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.EventAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.EventAction.prototype.activate=function(c,b){a(this.options.target).trigger(this.options.event,this.options);return this.parent("activate",c,b)};a.pkp.classes.linkAction.EventAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.AjaxRequest=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.AjaxRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.AjaxRequest.prototype.activate=function(c,b){var d=this.parent("activate",c,b),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,b){this.parent(a,b)};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(c,b){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",c,b)};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(c,b){var d,e,f,h,j,i,l,k,p,n,r;if(void 0!==b.content)c.getHtmlElement().parent().trigger("notifyUser",[b]);else{d=c.getHtmlElement();e=!1;!(c instanceof a.pkp.controllers.SiteHandler)&&0<a(b).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(l=a(d[h]),!(0<l.parents(":hidden").length)){i=l.parents();p=0;for(n=i.length;p<n;p++)if(k=a(i[p]).data("pkp.handler"),k instanceof a.pkp.classes.Handler){r=a(i[p]);break}if(r.has(b[0]).length||r[0]===b[0]){if(0<l.parents(".ui-accordion:first").length&&(i=l.parents(".ui-accordion:first"),!i.has(b[0])))continue;f.push(l)}}if(f.length)for(h=f.length-1;-1<h;h--)f[h].triggerHandler("notifyUser");else e||c.getHtmlElement().parent().trigger("notifyUser")}}})(jQuery);(function(a){a.pkp.classes.features=a.pkp.classes.features||{};a.pkp.classes.features.Feature=function(a,b){this.gridHandler=a;this.options_=b;this.addFeatureHtml(this.getGridHtmlElement(),b)};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,
b){return this.gridHandler.callbackWrapper(a,b)};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(c,b){this.parent(c,b);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(c,b){var d,e;void 0!==b.orderFinishControls&&(d=a(b.orderFinishControls),c.find("table").last().after(d),d.hide());void 0!==b.orderMessage&&(d=b.orderMessage,e=c.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(c){var b,d,e,f;this.itemsOrder=[];b=0;for(d=c.length;b<d;b++)e=a(c[b]),f=e.attr("id"),this.itemsOrder.push(f),this.storeRowOrder(b,e)};a.pkp.classes.features.OrderItemsFeature.prototype.toggleItemsDragMode=function(){var a=this.isOrdering,b=this.gridHandler.getRows().filter(".orderable"),d=this.getMoveItemClasses();a?b.addClass(d):b.removeClass(d);this.toggleMoveItemRowAction(a)};a.pkp.classes.features.OrderItemsFeature.prototype.applySortPlgOnElements=function(c,b,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),b={disabled:!e,items:b,activate:f,deactivate:h,update:j,tolerance:"pointer"};"object"===typeof d&&(b=a.extend(!0,b,d));c.sortable(b)};a.pkp.classes.features.OrderItemsFeature.prototype.getRowsDataId=function(c){var b,d=[],e;for(b in this.itemsOrder)e=a("#"+this.itemsOrder[b],c),1>e.length||(e=this.gridHandler.getRowDataId(e),
d.push(e));return d};a.pkp.classes.features.OrderItemsFeature.prototype.toggleMoveItemRowAction=function(c){var b=this.getGridHtmlElement(),d=a("div.row_actions",b),e="a:not("+this.getMoveItemRowActionSelector()+")",f=d.find(e),d=a(this.getMoveItemRowActionSelector(),b);c?(f.addClass("pkp_helpers_display_none"),d.show(),this.gridHandler.showRowActionsDiv()):(f.removeClass("pkp_helpers_display_none"),c=a(".gridRow div.row_actions",b),e=c.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 c=a(".pkp_linkaction_orderItems",this.getGridHtmlElement());1>=this.gridHandler.getRows().length?c.hide():c.show()};a.pkp.classes.features.OrderItemsFeature.prototype.toggleGridLinkActions_=function(){var c=this.isOrdering,b=a(".pkp_controllers_linkAction",this.getGridHtmlElement()).not(this.getMoveItemRowActionSelector()).not(this.getOrderButton()).not(this.getFinishControl().find("*"));this.gridHandler.changeLinkActionsState(!c,b)};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(),b=this.getCancelOrderButton(),d=this.gridHandler.callbackWrapper(this.cancelOrderHandler,this),e=this.gridHandler.callbackWrapper(this.saveOrderHandler,this);a.click(e);b.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,b){this.parent(a,b)};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 c,b,d=this.getOptions();this.parent("saveOrderHandler");
c=JSON.stringify(this.getItemsDataId());b=this.callbackWrapper(this.saveOrderResponseHandler_,this);a.post(d.saveItemsSequenceUrl,{data:c},b,"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,b){this.gridHandler.handleJson(b);this.toggleState(!1)}})(jQuery);(function(a){a.pkp.classes.features.OrderCategoryGridItemsFeature=function(a,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderCategoryGridItemsFeature,a.pkp.classes.features.OrderGridItemsFeature);a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.setupSortablePlugin=function(){var c,b,d,e;this.applySortPlgOnElements(this.getGridHtmlElement(),"tbody.orderable",null);c=navigator.userAgent.toLowerCase();if(!(/msie/.test(c)&&8>=parseInt(c.substr(c.indexOf("msie")+
5,1),10))){c=this.gridHandler.getCategories();b=0;for(d=c.length;b<d;b++)e=a(c[b]),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 c=this.gridHandler.getCategories(),b,d,e;b=0;for(d=c.length;b<d;b++)e=a(c[b]),this.toggleCategoryDragMode_(e)};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.addOrderingClassToRows=function(){var c=this.getOptions().type,b;if(c==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_ONLY||c==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_AND_ROWS)b=this.gridHandler.getCategories(),
b.addClass("orderable");(c==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_ROWS_ONLY||c==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 c=this.getCategorySequence_(this.itemsOrder),b=[],d,e,f,h;d=0;for(e=c.length;d<e;d++)f=a("#"+c[d]),h=this.getRowsDataId(f),f=this.gridHandler.getCategoryDataId(f),b.push({categoryId:f,
rowsId:h});return b};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.toggleCategoryDragMode_=function(c){var b=this.isOrdering,c=this.gridHandler.getCategoryRow(c),c=a("td:first",c),d=this.getMoveItemClasses();b?c.addClass(d):c.removeClass(d)};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.getCategorySequence_=function(c){var b,d,e=[],f;b=0;for(d=c.length;b<d;b++)f=this.gridHandler.getCategoryDataIdByRowId(c[b]),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,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderListbuilderItemsFeature,a.pkp.classes.features.OrderItemsFeature);a.pkp.classes.features.OrderListbuilderItemsFeature.prototype.addFeatureHtml=function(c,b){var d,e,f,h,j,i;this.parent("addFeatureHtml",c,b);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,b){b.find(".itemSequence").attr("value",a+1);b.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 c=a("select:visible",this.getGridHtmlElement()),b,d;if(0<c.length){b=0;for(d=c.length;b<d;b++)this.gridHandler.saveRow(a(c[b]).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 c=this.gridHandler.getRows(),b,d,e;b=0;for(d=c.length;b<d;b++)e=a(c[b]),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,b){this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderMultipleListsItemsFeature,a.pkp.classes.features.OrderListbuilderItemsFeature);a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.addFeatureHtml=function(c,b){var d,e,f,h,j,i,l;this.parent("addFeatureHtml",c,b);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),l=d.clone(),l.attr("value",i),a("td.first_column",j).append(l)};a.pkp.classes.features.OrderMultipleListsItemsFeature.prototype.storeRowOrder=function(a,b){var d,e;this.parent("storeRowOrder",a,b);d=b.find(".itemList");e=this.gridHandler.getListIdByRow(b);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,b,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,b,d){a=this.gridHandler.getListByRow(d.item);this.gridHandler.toggleListNoItemsRow(a,0,null)}})(jQuery);(function(a){a.pkp.classes.features.GeneralPagingFeature=function(a,b){b.defaultItemsPerPage=parseInt(b.defaultItemsPerPage,10);b.currentItemsPerPage=parseInt(b.currentItemsPerPage,10);b.itemsTotal=b.itemsTotal?parseInt(b.itemsTotal,10):0;b.currentPage=parseInt(b.currentPage,10);this.parent(a,b)};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(c){var b=this.getOptions();b.hasOwnProperty("filter")&&(b=a.parseJSON(b.filter),a.extend(!0,c,b));this.gridHandler.setFetchExtraParams(c)}})(jQuery);(function(a){a.pkp.classes.features.PagingFeature=function(a,b){this.parent(a,b)};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,b){a.append(b.pagingMarkup)};a.pkp.classes.features.PagingFeature.prototype.resequenceRows=function(){var a=this.gridHandler.getRows(),
b,d;b=this.getOptions();b=a.length-b.currentItemsPerPage;if(0<b)for(d=0;d<b;d++)this.gridHandler.deleteElement(a.first(),!0);return!1};a.pkp.classes.features.PagingFeature.prototype.refreshGrid=function(){var a=this.getOptions(),b,d;b=this.gridHandler.getFetchExtraParams();b[a.pageParamName]=a.currentPage;b[a.itemsPerPageParamName]=a.currentItemsPerPage;a=this.gridHandler.getRows().first();d=this.gridHandler.getRows().last();b.topLimitRowId=0==a.length?0:this.gridHandler.getRowDataId(a);b.bottomLimitRowId=
0==d.length?0:this.gridHandler.getRowDataId(d);this.setGridParams(b);return!1};a.pkp.classes.features.PagingFeature.prototype.replaceElementResponseHandler=function(c){var b,d;d=this.getOptions();void 0!=c.deletedRowReplacement&&(b=c.deletedRowReplacement,this.gridHandler.insertOrReplaceElement(b));void 0!=c.pagingInfo&&(b=c.pagingInfo,this.setOptions(b),this.gridHandler.replacePartialWith(b.pagingMarkup,a("div.gridPaging",this.getGridHtmlElement())),this.init());c.loadLastPage&&this.getGridHtmlElement().trigger("dataChanged");
void 0!=c.newTopRow&&(b=this.gridHandler.getRows(),d.currentItemsPerPage==b.length&&this.gridHandler.deleteElement(b.last(),!0),b=c.newTopRow,this.gridHandler.insertOrReplaceElement(b,!0));return!1};a.pkp.classes.features.PagingFeature.prototype.configPagingLinks_=function(){var c,b,d,e,f,h,j,i;c=this.getOptions();if(b=a("div.gridPaging",this.getGridHtmlElement())){i=this.callbackWrapper(function(b,d){h=RegExp("[?&]"+c.pageParamName+"(?:=([^&]*))?","i");j=h.exec(a(d.target).attr("href"));null!=j&&
(c.currentPage=parseInt(j[1],10),this.getGridHtmlElement().trigger("dataChanged"));return!1},this);b=b.find("a").not(".showMoreItems").not(".showLessItems");d=0;for(e=b.length;d<e;d++)f=a(b[d]),f.click(i)}};a.pkp.classes.features.PagingFeature.prototype.configItemsPerPageElement_=function(){var c,b,d,e,f,h;c=this.getOptions();if(b=a("div.gridPaging",this.getGridHtmlElement()))if(h=this.callbackWrapper(function(b,d){c.currentItemsPerPage=parseInt(a("option",d.target).filter(":selected").attr("value"),
10);c.currentPage=1;this.getGridHtmlElement().trigger("dataChanged");return!1},this),e=b.find("select.itemsPerPage"),f=[10,25,50,75,100],0>a.inArray(c.defaultItemsPerPage,f)&&f.push(c.defaultItemsPerPage),f.sort(function(a,c){return a-c}),c.itemsTotal<=f[0])a("div.gridItemsPerPage",b).hide();else{d=f.length-1;for(b=0;b<=d;b++)e.append(a('<option value="'+f[b]+'">'+f[b]+"</option>"));e.val(c.currentItemsPerPage.toString());e.change(h)}}})(jQuery);(function(a){a.pkp.classes.features.InfiniteScrollingFeature=function(a,b){this.parent(a,b)};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 c=a("div.scrollable",this.getGridHtmlElement());
c.length||(this.gridHandler.publishEvent("pkpObserveScrolling"),this.gridHandler.publishEvent("pkpRemoveScrollingObserver"));this.$scrollableElement_=c;this.observeScrollCallback_=this.gridHandler.callbackWrapper(this.observeScroll_,this);this.addScrollHandler_();this.fixGridHeight_();this.addPagingDataToRows_()};a.pkp.classes.features.InfiniteScrollingFeature.prototype.addFeatureHtml=function(a,b){a.append(b.pagingMarkup);a.find(".pkp_linkaction_moreItems").click(this.gridHandler.callbackWrapper(this.loadMoreItems_,
this))};a.pkp.classes.features.InfiniteScrollingFeature.prototype.refreshGrid=function(c){var b=this.getOptions(),d;d=this.gridHandler.getFetchExtraParams();d[b.pageParamName]=b.currentPage;c&&c!==a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID&&(c=this.gridHandler.getRowByDataId(c),1==c.length&&(d[b.pageParamName]=Number(c.attr("data-paging"))));d[b.itemsPerPageParamName]=b.currentItemsPerPage;this.setGridParams(d);return!1};a.pkp.classes.features.InfiniteScrollingFeature.prototype.replaceElementResponseHandler=
function(c){var b;this.getOptions();void 0!=c.deletedRowReplacement&&(b=c.deletedRowReplacement,this.gridHandler.insertOrReplaceElement(b),this.updatePagingDataInAllRows_());this.addScrollHandler_();void 0!=c.pagingInfo&&(c=c.pagingInfo,this.setOptions(c),void 0!=c.pagingMarkup&&a("div.gridPagingScrolling",this.getGridHtmlElement()).replaceWith(c.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(c){var b,d;if(this.getOptions().itemsTotal==this.gridHandler.getRows().length||!this.getGridHtmlElement().is(":visible"))return!1;a(c).hasClass("scrollable")?(b=a(c).height(),d=c.scrollHeight):(b=a.pkp.controllers.SiteHandler.prototype.getWindowDimensions(),b=b.height,d=this.getGridHtmlElement().offset().top+this.getGridHtmlElement().height());b+a(c).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 c=a("div.scrollable",this.getGridHtmlElement()),b,d,e,f;0<c.length&&(e=setInterval(function(){if(c.is(":visible")){clearInterval(e);f=c.length;for(b=0;b<f;b++)d=a(c[b]),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 c,b=this.getOptions(),d,e,f=1,h=1;c=this.gridHandler.getRows();c.removeAttr("data-paging");d=0;for(e=c.length;d<e;d++)a(c[d]).attr("data-paging",f),h++,h>b.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 b=this.getGridHtmlElement().find("div.gridPagingScrolling div.pkp_loading"),d=this.$scrollableElement_,b=b.height();a?(this.getGridHtmlElement().addClass("loading"),
a=d.scrollTop(),d.scrollTop(a+b)):this.getGridHtmlElement().removeClass("loading")};a.pkp.classes.features.InfiniteScrollingFeature.prototype.loadMoreItems_=function(){var c=this.getOptions();this.toggleLoadingContainer_(!0);c.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,b){this.parent(a,b)};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,b){a.find("div.grid_header_bar").prepend(b.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(c,b){this.parent(c,b);this.options_=b;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});b.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 c;c={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"};c="undefined"!==typeof a.pkp.plugins.tinymceplugin&&typeof a.pkp.plugins.tinymceplugin.tinymceParams?
a.extend({},c,a.pkp.plugins.tinymceplugin.tinymceParams):a.extend({},c);c.init_instance_callback=a.pkp.controllers.SiteHandler.prototype.triggerTinyMCEInitialized;c.setup=a.pkp.controllers.SiteHandler.prototype.triggerTinyMCESetup;tinyMCE.init(c)}};a.pkp.controllers.SiteHandler.prototype.triggerTinyMCEInitialized=function(c){a("#"+a.pkp.classes.Helper.escapeJQuerySelector(c.id)).trigger("tinyMCEInitialized",[c])};a.pkp.controllers.SiteHandler.prototype.triggerTinyMCESetup=function(c){var b=a("#"+
a.pkp.classes.Helper.escapeJQuerySelector(c.id));b.attr("readonly")&&(c.settings.readonly=!0);b.attr("wordCount")&&0<b.attr("wordCount")&&(c.settings.plugins+=",pkpwordcount",c.settings.statusbar=!0);b=b.attr("rows")||10;c.settings.height=(20*b).toString()+"px";c.on("init",function(c){var b=a("#"+c.id),f,h;f=a("#"+c.id).attr("placeholder");""!==f&&(h=a("<span></span>"),h.html(f),h.addClass("mcePlaceholder"),h.attr("id","mcePlaceholder-"+c.id),c.target.getContent().length&&h.hide(),c=a("<div></div>"),
c.addClass("mcePlaceholderParent"),b.wrap(c),b.parent().append(h))});c.on("activate",function(c){a("#mcePlaceholder-"+c.id).hide()});c.on("deactivate",function(c){c.target.getContent().length||a("#mcePlaceholder-"+c.id).show();c.target.dom.addClass(c.target.dom.select("li"),"show")});c.on("BeforeSetContent",function(b){var e=a.pkp.classes.TinyMCEHelper.prototype.getVariableMap("#"+a.pkp.classes.Helper.escapeJQuerySelector(c.id));b.content=b.content.replace(/\{\$([a-zA-Z]+)\}(?![^<]*>)/g,function(b,
d){return void 0!==e[d]?a.pkp.classes.TinyMCEHelper.prototype.getVariableElement(d,e[d],"#"+c.id).html():b})});c.on("SaveContent",function(c){var b=a("<div>"+c.content+"</div>");b.find(".pkpTag").replaceWith(function(){return"{$"+a(this).attr("data-symbolic")+"}"});c.content=b.html()});c.on("FullscreenStateChanged init",function(c){var c=c.target,b=a(c.editorContainer);c.plugins.fullscreen&&(c.plugins.fullscreen.isFullscreen()?b.find(".mce-toolbar[role='menubar']").show():b.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,b,d){window.location=d};a.pkp.controllers.SiteHandler.prototype.registerUnsavedFormElement_=function(c,b,d){c=a(d.target.lastElementChild).attr("id");-1==a.inArray(c,this.unsavedFormElements_)&&this.unsavedFormElements_.push(c)};a.pkp.controllers.SiteHandler.prototype.unregisterUnsavedFormElement_=function(c,
b,d){c=a(d.target.lastElementChild).attr("id");c=a.inArray(c,this.unsavedFormElements_);-1!==c&&delete this.unsavedFormElements_[c]};a.pkp.controllers.SiteHandler.prototype.unregisterAllFormElements_=function(){this.unsavedFormElements_=[]};a.pkp.controllers.SiteHandler.prototype.fetchNotificationHandler_=function(c,b,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,b,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(c,b){var d;if(!a.isEmptyObject(this.outsideClickChecks_))for(d in this.outsideClickChecks_)this.processOutsideClickCheck_(this.outsideClickChecks_[d],
b);return!0};a.pkp.controllers.SiteHandler.prototype.processOutsideClickCheck_=function(a,b){if("click"!==b.type&&"mousedown"!==b.type&&"mouseup"!==b.type)throw Error("Can not check outside click with the passed event: "+b.type+);var d=a.container;return d.is(":hidden")?!1:0===d.has(b.target).length?(delete this.outsideClickChecks_[d.attr("id")],a.callback(),!0):!1};a.pkp.controllers.SiteHandler.prototype.pageUnloadHandler_=function(){var c,b,d;c=a.pkp.classes.Handler.getHandler(a("body"));b=0;
for(d in c.unsavedFormElements_)d&&b++;if(0<b)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,b){this.showNotification_(b)};a.pkp.controllers.SiteHandler.prototype.showNotification_=function(a){var b,d,a=this.handleJson(a);if(!1!==a&&a.content.general)for(b in a=a.content.general,
a)for(d in a[b])new PNotify(a[b][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(c,b,d,e){a(document).scroll(e);return!1};a.pkp.controllers.SiteHandler.prototype.unregisterScrollingObserver_=
function(c,b,d,e){a(document).unbind("scroll",e);return!1}})(jQuery);(function(a){a.pkp.controllers.UrlInDivHandler=function(a,b){this.parent(a,b);this.sourceUrl_=b.sourceUrl;this.reload();b.refreshOn&&this.bindGlobal(b.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(c,b){var d=this.handleJson(b),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(c,b){this.parent(c,b);a(".toggleExtras",c).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,b){var d=this.getHtmlElement(),e;b.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,b){var d,e,f;d=a.position().top;e=b.position().top;f=parseInt(b.scrollTop(),10);d>e?(d=Math.ceil(d+a.height()-b.height()),0<d&&b.scrollTop(f+d)):(f=Math.max(Math.floor(f+d-e),0),b.scrollTop(f))}})(jQuery);(function(a){a.pkp.controllers.PageHandler=function(a,b){this.parent(a,b);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,b,d){window.location=d};a.pkp.controllers.PageHandler.prototype.redirectNotifyUserEventHandler_=
function(c,b,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(c,b,d){var c=a("a",b.target),e=a.pkp.classes.Handler.getHandler(c).getUrl(),c=a(".pkp_controllers_grid",this.getHtmlElement()).filter(function(){var c=0;a(this).find("a").each(function(){a(this).attr("href")==e&&c++});return 0<c});0<c.length&&c.each(function(){a(this).trigger("dataChanged",
[d])})}})(jQuery);(function(a){a.pkp.controllers.TabHandler=function(a,b){var d,e,f;this.parent(a,b);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);b.emptyLastTab&&(this.emptyLastTab_=b.emptyLastTab);d=document.location.toString();if(d.match("#")){d=
d.split("#")[1];e=a.find("li a");for(f=0;f<e.length;f++)d==e[f].getAttribute("name")&&(b.selected=f)}a.tabs({ajaxOptions:{dataType:"json",cache:!1,dataFilter:this.callbackWrapper(this.dataFilter)},disabled:b.disabled,active:b.selected});window.addEventListener("hashchange",function(b){b=b.newURL.split("#");2>b.length||(b=b[1],b=a.find('li > a[name="'+b+'"]'),b.length&&b.click())},!1)};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 c=!1;this.$currentTab_.find("form").each(function(){if(a.pkp.classes.Handler.getHandler(a("#"+a(this).attr("id"))).formChangesTracked)return c=!0,!1});this.$currentTab_.find(".hasDatepicker").datepicker("hide");if(c)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(c,b,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(c,b,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(c,b,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(c,b){var d=this.handleJson(a.parseJSON(b));return!1===d?"":JSON.stringify(d.content)};a.pkp.controllers.TabHandler.prototype.tabsReloadRequested=function(c,b,d){this.getHtmlElement();var e=this;a.get(d.tabsUrl,function(a){e.replaceWith(a.content)})};
a.pkp.controllers.TabHandler.prototype.addTab=function(c,b,d){var e=this.getHtmlElement(),c=e.children("ul").children("li").length+1,b=a("<a/>").text(d.title).attr("href",d.url),d=a("<a/>").addClass("close").text(a.pkp.locale.common_close).attr("href","#"),b=a("<li/>").append(b).append(d);d.click(function(){var c=a(this).closest("li"),b=a("#"+c.attr("aria-controls")),d,i;i=!1;b.find("form").each(function(){if(a.pkp.classes.Handler.getHandler(a(this)).formChangesTracked&&!confirm(a.pkp.locale.form_dataHasChanged))return i=
!0,!1});i||(b.find("form").each(function(){var c=a.pkp.classes.Handler.getHandler(a(this));c&&c.unregisterForm()}),d=c.eq(0).index(),e.tabs("option","active")==d&&e.tabs("option","active",d-1),c.remove(),b.remove(),e.tabs("refresh"))});e.children("ul").append(b);e.tabs("refresh");e.tabs("option","active",c-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(c,b){this.parent(c,b);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(c){a(c.currentTarget).attr("aria-expanded","true")});this.getHtmlElement().on("blur mouseleave",'[aria-haspopup="true"]',function(c){a(c.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 c=Math.max(document.documentElement.clientWidth,window.innerWidth||0),b=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()>c?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>b&&(j-=b,i=f-j,i<h&&(j=0<h?h:-Math.abs(j)-i,e.css("overflow-y","scroll"),e.css("bottom",-Math.abs(b-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(c,b){this.parent(c,b);if(!c.is("div"))throw Error("An uploader widget controller can only be attached to a div!");var d,e,f;d={url:b.uploadUrl,flash_swf_url:b.baseUrl+"/lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.swf",silverlight_xap_url:b.baseUrl+"/lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.xap"};typeof b.filters&&(d.filters=b.filters);typeof b.resize&&(d.resize=b.resize);typeof b.browse_button&&(d.browse_button=b.browse_button);typeof b.multipart_params&&
(d.multipart_params=b.multipart_params);d=a.extend({},this.self("DEFAULT_PROPERTIES_"),d);this.pluploader=new plupload.Uploader(d);this.pluploader.init();this.updateStatus("waiting");this.$progress=c.find(".pkpUploaderProgress .percentage");this.$progressBar=c.find(".pkpUploaderProgressBar");this.$fileName=c.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,b){1<b.files.length&&b.removeFile(b.files[0]);this.updateStatus("uploading");b.start()};a.pkp.controllers.UploaderHandler.prototype.updateProgress=function(a,b,d){this.$progress.html(d.percent);this.$progressBar.css("width",d.percent+"%")};a.pkp.controllers.UploaderHandler.prototype.uploadComplete=function(c,b,d,e){c=a.parseJSON(e.response);b=d.name;c.status?("undefined"!==typeof c.uploadedFile&&(b=c.uploadedFile.name||
c.uploadedFile.fileLabel,d.storedData=c.uploadedFile),this.$fileName.html(b),this.updateStatus("complete"),this.$progress.html("0"),this.$progressBar.css("width",0)):this.showError(c.content)};a.pkp.controllers.UploaderHandler.prototype.handleError=function(a,b,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,b){b.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(c,b){var d;this.parent(c,b);this.sourceUrl_=b.sourceUrl;b.sourceUrl=void 0;this.disableSync_=b.disableSync;d={};d.source=this.callbackWrapper(this.fetchAutocomplete);d.appendTo="#"+c.attr("id");d=a.extend({},this.self("DEFAULT_PROPERTIES_"),d,b);this.textInput=c.find(":text");this.disableSync_||this.textInput.keyup(this.callbackWrapper(this.synchronizeFields_));this.textInput.autocomplete(d);this.hiddenInput_=c.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.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,b,d){a=this.hiddenInput_;b=this.textInput;""!==d.item.value&&(a.val(d.item.value),b.val(d.item.label));return!1};a.pkp.controllers.AutocompleteHandler.prototype.itemFocused=function(a,b,d){a=this.textInput;""!==d.item.value&&a.val(d.item.label);return!1};a.pkp.controllers.AutocompleteHandler.prototype.fetchAutocomplete=function(c,b,d){var e;e=this.textInput;e.addClass("spinner");a.post(this.getAutocompleteUrl(),{term:b.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(c,b){this.parent(c,b);c.outerHeight()>b.height&&(c.addClass("isHidden").css("max-height",b.height+"px"),a(".revealMoreButton",c).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,b){this.getHtmlElement().removeClass("isHidden").removeAttr("style");b.preventDefault();b.stopPropagation()}})(jQuery);(function(a){a.pkp.controllers.NotificationHandler=function(a,b){this.parent(a,b);this.options_=b;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 c={};c.requestOptions=this.options_.requestOptions;a.ajax({type:"POST",url:this.options_.fetchNotificationUrl,data:c,success:this.callbackWrapper(this.showNotificationResponseHandler_),dataType:"json",async:!1})};a.pkp.controllers.NotificationHandler.prototype.showNotificationResponseHandler_=function(c,b){clearTimeout(this.trivialTimer_);var d=this.getHtmlElement(),e=this.handleJson(b),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 c=this.getHtmlElement(),b=c.offset().top+this.getHtmlElement().height()/2,d=a(window).scrollTop(),e=d+a(window).height(),f=c.parents(".ui-dialog-content");return 0<f.length&&(c=f.offset().top,f=c+f.height(),b<c||b>f)?!1:b<d||b>e?!1:!0};a.pkp.controllers.NotificationHandler.prototype.removeAlreadyShownNotifications_=function(c){var b=!0,d,e,f;for(d in c.content.inPlace)for(e in c.content.inPlace[d])f=
a("#pkp_notification_"+e),0<f.length?(delete c.content.inPlace[d][e],delete c.content.general[d][e]):b=!1;return b?!1:c};a.pkp.controllers.NotificationHandler.prototype.concatenateNotifications_=function(a){var b="",d,e;for(d in a)for(e in a[d])b+=a[d][e];return b};a.pkp.controllers.NotificationHandler.prototype.getTrivialNotifications_=function(a){var b=[],d,e;for(d in a)if(1==d)for(e in a[d])b.push(e);return b};a.pkp.controllers.NotificationHandler.prototype.addTimerToNotifications=function(c){var b,
d;b=this;d=function(){var c=a(this);b.unbindPartial(c);c.remove()};c.length&&(this.trivialTimer_=setTimeout(function(){var b,f;for(b in c)f=a("#pkp_notification_"+c[b]),f.fadeOut(400,d)},6E3))}})(jQuery);(function(a){a.pkp.controllers.HelpPanelHandler=function(c,b){this.parent(c,{});a("body").click(function(b){var e=a(b.target);if(e.hasClass("requestHelpPanel")||e.parents(".requestHelpPanel").length)b.preventDefault(),b=a.extend({},e.data(),{caller:e}),c.trigger("pkp.HelpPanel.Open",b)});c.find(".pkpCloseHelpPanel").click(function(a){a.preventDefault();c.trigger("pkp.HelpPanel.Close")});c.find(".pkpHomeHelpPanel").click(function(a){a.preventDefault();c.trigger("pkp.HelpPanel.Home")});c.find(".pkpPreviousHelpPanel").click(this.callbackWrapper(function(){this.loadHelpContent_(this.previousTopic_,
this.helpLocale_)}));c.find(".pkpNextHelpPanel").click(this.callbackWrapper(function(){this.loadHelpContent_(this.nextTopic_,this.helpLocale_)}));c.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_=b.helpUrl;this.helpLocale_=b.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(c,b,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(c,b){b=b||this.helpLocale_;this.currentTopic_=c||"";var d=this.helpUrl_+"/index/"+b+"/";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,b){var d=this.handleJson(b).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(c,b){var d=a(c).attr("href");b.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 c=this.getHtmlElement();c.removeClass("is_visible");a("body").removeClass("help_panel_is_visible");c.find(".content").empty();null!==this.caller_&&
this.caller_.focus();c.off("click.pkp.HelpPanel keyup.pkp.HelpPanel");c.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(c,b){var d=this.getHtmlElement();"click"==b.type&&d.is(a(b.target))?d.trigger("pkp.HelpPanel.Close"):"keyup"==b.type&&27==b.which&&d.trigger("pkp.HelpPanel.Close")}})(jQuery);(function(a){a.pkp.controllers.form=a.pkp.controllers.form||{};a.pkp.controllers.form.FormHandler=function(c,b){var d;this.parent(c,b);if(!c.is("form"))throw Error("A form handler controller can only be bound to an HTML form element!");b.submitHandler&&(this.callerSubmitHandler_=b.submitHandler);c.find(".datepicker").each(function(){var c=a(this);c.datepicker({altField:"#"+c.prop("id")+"-altField",altFormat:"yy-mm-dd",dateFormat:a("#"+c.prop("id")+"-altField").attr("data-date-format")});c.prop("name",
c.prop("name")+"-removed")});b.cancelRedirectUrl&&(this.cancelRedirectUrl_=b.cancelRedirectUrl);"undefined"!==typeof b.trackFormChanges&&(this.trackFormChanges=b.trackFormChanges);b.disableControlsOnSubmit&&(this.disableControlsOnSubmit=b.disableControlsOnSubmit);b.enableDisablePairs&&(this.enableDisablePairs_=b.enableDisablePairs,this.setupEnableDisablePairs());for(d in this.enableDisablePairs_)c.find("[id^='"+d+"']").trigger("updatePair");d=c.validate({onfocusout:this.callbackWrapper(this.onFocusOutValidation_),
errorClass:"error",highlight:function(c,b){a(c).parent().parent().addClass(b)},unhighlight:function(c,b){a(c).parent().parent().removeClass(b)},submitHandler:this.callbackWrapper(this.submitHandler_),showErrors:this.callbackWrapper(this.showErrors)});a("[id^='cancelFormButton-']",c).click(this.callbackWrapper(this.cancelForm));c.find(".showMore, .showLess").bind("click",this.switchViz);d.checkForm()?this.trigger("formValid"):this.trigger("formInvalid");a(".pkpEditableToggle",c).click(this.callbackWrapper(this.toggleEditableControl));
this.initializeTinyMCE();a("[id^='submitFormButton']",c).click(this.callbackWrapper(this.pushTinyMCEChanges_));a(":input",c).change(this.callbackWrapper(this.formChange));this.bind("formChange",this.callbackWrapper(this.formChange));c.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(c){"undefined"!==
typeof tinyMCE&&tinyMCE.EditorManager.triggerSave();var b=a.extend(!0,{},c);setTimeout(this.callbackWrapper(function(){b.defaultShowErrors();b=null}),250);c.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 c=this.getHtmlElement(),b;for(b in this.enableDisablePairs_)a(c).find("[id^='"+b+"']").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(c,b){b.preventDefault();var d=a(c).parents('[data-pkp-editable="true"]');d.length&&d.toggleClass("isEditing")};a.pkp.controllers.form.FormHandler.prototype.submitHandler_=function(c,b){var d=!1;a(b).find(".formWidget").each(function(){var c=new a.Event("formSubmitRequested");d||(a(this).trigger(c),d=c.isDefaultPrevented())});d||(a(b).find(".datepicker").each(function(){""===
a(this).prop("value")&&a("#"+a(this).prop("id")+"-altField").prop("value","")}),this.showSpinner_(),this.trigger("unregisterChangedForm"),null!==this.callerSubmitHandler_?(this.formChangesTracked=!1,this.callbackWrapper(this.callerSubmitHandler_).call(c,b)):this.submitFormWithoutValidation(c))};a.pkp.controllers.form.FormHandler.prototype.pushTinyMCEChanges_=function(){"undefined"!==typeof tinyMCE&&tinyMCE.EditorManager.triggerSave();return!0};a.pkp.controllers.form.FormHandler.prototype.toggleDependentElement_=
function(c){var b,d;b=this.getHtmlElement();d=a(c).attr("id");b=a(b).find("[id^='"+this.enableDisablePairs_[d]+"']");a(c).is(":checked")?a(b).prop("disabled",!1):a(b).prop("disabled",!0);return!0};a.pkp.controllers.form.FormHandler.prototype.tinyMCEInitHandler_=function(c,b,d){var e=d.id;d.on("blur",this.callbackWrapper(function(c){c.save();var c=this.getHtmlElement(),b=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(e),c);c.validate().element(b)}))};a.pkp.controllers.form.FormHandler.prototype.containerCloseHandler=
function(c,b,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(c,b){var d=this.getHtmlElement();a(b).parents("#"+d.attr("id")).length&&c.element(b);return!0};a.pkp.controllers.form.FormHandler.prototype.hideDatepicker_=
function(c,b){var d,e;d=b.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,b){this.parent(a,b);this.eventName_=b.eventName;this.defaultKey_=b.defaultKey;this.publishEvent(this.eventName_);this.getOptionsUrl_=b.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(c){this.trigger(this.eventName_,[a(c).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(c,b){var d=this.handleJson(b),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,b){b.submitHandler=this.submitForm;this.parent(a,b);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 c=this.getHtmlElement();this.disableFormControls();
a.post(c.attr("action"),c.serialize(),this.callbackWrapper(this.handleResponse),"json")};a.pkp.controllers.form.AjaxFormHandler.prototype.refreshFormHandler_=function(a,b,d){d&&this.replaceWith(d)};a.pkp.controllers.form.AjaxFormHandler.prototype.handleResponse=function(c,b){var d,e;e=this.handleJson(b);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,b){b.submitHandler=this.submitForm;this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.ClientFormHandler,a.pkp.controllers.form.FormHandler);a.pkp.controllers.form.ClientFormHandler.prototype.submitForm=function(){var c;c=this.getHtmlElement().serializeArray();c.push({name:"clientSubmit",value:!0});this.trigger("formSubmitted",[a.param(c)])}})(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,b){this.parent(a,b);if(void 0===b.readOnly||null===b.readOnly)void 0!==b.resetUploader&&(this.resetUploader_=b.resetUploader),void 0!==b.$preview&&b.$preview.length&&(this.$preview=b.$preview,this.bind("fileDeleted",this.callbackWrapper(this.fileDeleted))),this.attachUploader_(b.$uploader,b.uploaderOptions),this.uploaderSetup(b.$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(c,b){var d;this.resetUploader_&&(d=a("#plupload",this.getHtmlElement()).plupload("getUploader"),d.splice(),d.refresh(),a("#temporaryFileId",this.getHtmlElement()).val(""));return this.parent("handleResponse",c,b)};a.pkp.controllers.form.FileUploadFormHandler.prototype.uploaderSetup=
function(c){a.pkp.classes.Handler.getHandler(c).pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse))};a.pkp.controllers.form.FileUploadFormHandler.prototype.handleUploadResponse=function(c,b,d,e){c=this.handleJson(a.parseJSON(e.response));!1!==c&&(this.trigger("fileUploaded",[c.uploadedFile]),this.$preview&&this.$preview.hide(),""===c.content?(b=this.getHtmlElement(),b=b.find("#temporaryFileId"),b.val(c.temporaryFileId)):this.replaceWith(c.content))};a.pkp.controllers.form.FileUploadFormHandler.prototype.fileDeleted=
function(){this.$preview&&this.$preview.hide()};a.pkp.controllers.form.FileUploadFormHandler.prototype.attachUploader_=function(a,b){a.pkpHandler("$.pkp.controllers.UploaderHandler",b)}})(jQuery);(function(a){a.pkp.controllers.form.MultilingualInputHandler=function(a,b){this.parent(a,b);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 c=this.getHtmlElement(),b=[],d=0;"undefined"!==typeof tinyMCE&&(this.getHtmlElement().find(".richContent").length?c.find("textarea").each(function(){a(this).attr("id");b.push(a(this));tinyMCE.EditorManager.get(a(this).attr("id")).getContent()&&d++}):(b=c.find(":input"),b.each(function(){a(this).val()&&d++})),0<d&&d<b.length?c.removeClass("localizationComplete").addClass("localizationIncomplete"):d===b.length?c.removeClass("localizationIncomplete").addClass("localizationComplete"):c.removeClass("localizationIncomplete localizationComplete"))};
a.pkp.controllers.form.MultilingualInputHandler.prototype.tinyMCEInitHandler_=function(){if(this.getHtmlElement().find(".richContent").length&&"undefined"!==typeof tinyMCE){var c=this.getHtmlElement(),b=tinyMCE.EditorManager.get(c.find("textarea").first().attr("id"));b.on("focus",this.callbackWrapper(function(){this.trigger("callWhenClickOutside",{container:this.getHtmlElement(),callback:this.callbackWrapper(this.hidePopover_)});this.showPopover_()}));b.on("blur",this.callbackWrapper(function(){if(a(b.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(c,b){var d=this;this.parent(c,b);this.cancelUrl_=b.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,b){this.handleCancelAction();return this.parent("containerCloseHandler",a,b)};a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.submitForm=function(a,b){this.isComplete_=!0;this.parent("submitForm",a,b)};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(c,b){this.parent(c,b);var d,e,f;d=c.find("#activeThemeOptions");d.length&&(f=this,c.find("#themePluginPath").change(function(){f.unbindPartial(d);d.empty()}),d.find('input[type="color"]').each(function(){var c=a(this);c.spectrum({preferredFormat:"hex",showInitial:!0,showInput:!0,showButtons:!1,change:function(a){e=a.toHexString();c.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(c,b){this.parent(c,b);b.fetchUsernameSuggestionUrl&&b.usernameSuggestionTextAlert&&(this.fetchUsernameSuggestionUrl_=b.fetchUsernameSuggestionUrl,this.usernameSuggestionTextAlert_=b.usernameSuggestionTextAlert);a('[id^="suggestUsernameButton"]',c).click(this.callbackWrapper(this.generateUsername));b.hideNonReviewerInterests&&(a('[id^="reviewerGroup-"]',c).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(c,b){b.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(c,b){var d=this.handleJson(b),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 c=
this.getHtmlElement(),b=a("#interests",c);a('[id^="reviewerGroup-"]:checked',c).size()?b.show(300):b.hide(300)}})(jQuery);(function(a){a.pkp.controllers.form.reviewer=a.pkp.controllers.form.reviewer||{};a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler=function(a,b){this.parent(a,b);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 c=
this.getHtmlElement().find('[id^="comments"]');1==a("#reviewAttachmentsGridContainer").find("tbody.empty:visible").length?c.attr("required","1"):c.removeAttr("required");return!0}})(jQuery);(function(a){a.pkp.controllers.grid=a.pkp.controllers.grid||{};a.pkp.controllers.grid.GridHandler=function(a,b){this.parent(a,b);this.initialize(b);this.initFeatures_(b.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(c){return a("#"+this.getRowIdPrefix()+a.pkp.classes.Helper.escapeJQuerySelector(String(c)),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(c){return c.hasClass("gridRow")?(c=c.parents("tbody:first"),a(".gridRow",
c)):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(c,b){b.preventDefault();a(c).toggleClass("show_extras");a(c).toggleClass("hide_extras");var d=a(c).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 c,b,d;c=a(".gridRow div.row_actions",this.getHtmlElement());c.hide();b=0;for(d=c.length;b<d;b++)a(c[b])};a.pkp.controllers.grid.GridHandler.prototype.showRowActionsDiv=function(){a(".gridRow div.row_actions",this.getHtmlElement()).show()};a.pkp.controllers.grid.GridHandler.prototype.changeLinkActionsState=function(c,b){void 0===b&&(b=a(".pkp_controllers_linkAction",this.getHtmlElement()));b.each(function(){var b;b=a.pkp.classes.Handler.getHandler(a(this));
c?b.enableLink():b.disableLink()})};a.pkp.controllers.grid.GridHandler.prototype.resequenceRows=function(c){var b,d,e;if(c){for(d in c){b=c[d];e=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(String(b)));0==e.length&&(e=this.getRowByDataId(b));if(0==e.length)throw Error("Row with id "+b+" not found!");this.addElement(e)}this.updateControlRowsPosition();this.callFeaturesHook("resequenceRows",c)}};a.pkp.controllers.grid.GridHandler.prototype.updateControlRowsPosition=function(){var c,b,d,e,f;c=this.getRows();
b=0;for(d=c.length;b<d;b++)e=a(c[b]),f=this.getControlRowByGridRow(e),0<f.length&&f.insertAfter(e)};a.pkp.controllers.grid.GridHandler.prototype.insertOrReplaceElement=function(c,b){var d,e,f;d=a(c);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,b),this.activateRowActions_()):a.get(this.fetchGridUrl_,null,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.deleteElement=function(a,b){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!=b&&b?f():a.fadeOut(500,f)};a.pkp.controllers.grid.GridHandler.prototype.initialize=function(c){var b;this.bind("dataChanged",this.refreshGridHandler);this.bind("addRow",this.addRowHandler_);this.bind("formSubmitted",this.refreshGridWithFilterHandler_);this.gridId_=c.gridId;this.fetchRowUrl=c.fetchRowUrl;this.fetchRowsUrl=c.fetchRowsUrl;this.fetchGridUrl_=c.fetchGridUrl;this.bodySelector=0<a("div.scrollable",this.getHtmlElement()).length?"div.scrollable table":c.bodySelector;
this.activateRowActions_();this.setFetchExtraParams({});this.getHtmlElement().find(".pkp_form").hide();b=this.getHtmlElement().find(".pkp_linkaction_search");0!==b.length?b.click(this.callbackWrapper(function(){this.getHtmlElement().find(".pkp_form").toggle();b.toggleClass("is_open")})):this.getHtmlElement().find(".pkp_form").toggle();this.trigger("gridInitialized")};a.pkp.controllers.grid.GridHandler.prototype.callFeaturesHook=function(c,b){var d;a.isArray(b)||(b=[b]);for(d in this.features_)this.features_[d][c].apply(this.features_[d],
b)};a.pkp.controllers.grid.GridHandler.prototype.refreshGridHandler=function(c,b,d,e){this.callFeaturesHook("refreshGrid",d);c=this.getFetchExtraParams();e||(d?d==a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID?a.get(this.fetchRowsUrl,c,this.callbackWrapper(this.replaceElementResponseHandler),"json"):(c.rowId=d,a.get(this.fetchRowUrl,c,this.callbackWrapper(this.replaceElementResponseHandler),"json")):a.get(this.fetchGridUrl_,c,this.callbackWrapper(this.replaceGridResponseHandler_),"json"));this.trigger("gridRefreshRequested");
this.publishChangeEvents()};a.pkp.controllers.grid.GridHandler.prototype.addElement=function(a,b,d){if(void 0===b||null===b)b=this.getHtmlElement().find(this.bodySelector);void 0!=d&&d?b.prepend(a):b.append(a);this.getEmptyElement(a).hide();this.callFeaturesHook("addElement",a)};a.pkp.controllers.grid.GridHandler.prototype.replaceElement=function(a,b){b.hasClass("gridRow")&&this.deleteControlsRow_(a);this.replacePartialWith(b,a);this.callFeaturesHook("replaceElement",b)};a.pkp.controllers.grid.GridHandler.prototype.hasSameNumOfColumns=
function(a,b){var d,e;d=this.getHtmlElement().find("th").length;e=a.first().find("td");e=b?e.attr("colspan"):e.length;return d==e};a.pkp.controllers.grid.GridHandler.prototype.replaceElementResponseHandler=function(c,b){var d,e,f,h,j,i,l;e=this.handleJson(b);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(l=
d.length;i<l;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(c,b,d){a.post(this.fetchGridUrl_,d,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.addRowHandler_=function(c,b,d){a.get(this.fetchRowUrl,
d,this.callbackWrapper(this.replaceElementResponseHandler),"json")};a.pkp.controllers.grid.GridHandler.prototype.replaceGridResponseHandler_=function(c,b){var d,e,f;d=this.handleJson(b);!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(c){c=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(c.attr("id"))+"-control-row",this.getHtmlElement());c.is("tr")&&c.hasClass("row_controls")&&(this.unbindPartial(c),c.remove())};a.pkp.controllers.grid.GridHandler.prototype.getControlRowByGridRow=function(c,b){var d,e;e=void 0===b||null===b?this.getHtmlElement().find("tr"):b;d=c.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,b){this.features_||(this.features_=[]);this.features_[a]=b};a.pkp.controllers.grid.GridHandler.prototype.initFeatures_=
function(c){var b,d;for(b in c)d=c[b].JSClass,null!==d&&(d=a.pkp.classes.Helper.objectFactory(d,[this,c[b].options]),this.addFeature_(b,d),this.features_[b].init())}})(jQuery);(function(a){a.pkp.controllers.grid.CategoryGridHandler=function(a,b){this.parent(a,b)};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(c){return a("#"+this.getCategoryIdPrefix()+c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryRow=function(c){var b=this.getHtmlElement();void 0!==c&&(b=c);return a("tr.category",b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowsInCategory=function(c){return a("tr.gridRow",c).not(".category")};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryEmptyPlaceholder=function(c){c="#"+c.attr("id")+"-emptyPlaceholder";return a(c,this.getHtmlElement())};
a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataId=function(a){var a=a.attr("id"),b=this.getCategoryIdPrefix().length;return a.slice(b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataIdByRowId=function(c){c=c.replace(this.getCategoryIdPrefix()," ");c=c.match("(.*)-row");return a.trim(c[1])};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowIdPrefix=function(){return this.getGridIdPrefix()+"-category-"};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowByDataId=
function(c,b){this.parent("getRowByDataId",c,b);return a("#"+this.getRowIdPrefix()+b+"-row-"+c,this.getHtmlElement())};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowDataId=function(c){c=c.attr("id").slice(this.getRowIdPrefix().length);c=c.match("-row-(.*)");return a.trim(c[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(c){var b,d;for(d in c)b=c[d],b=a("#"+b),this.appendCategory(b);this.updateEmptyPlaceholderPosition()};a.pkp.controllers.grid.CategoryGridHandler.prototype.updateEmptyPlaceholderPosition=function(){var c=this.getCategories(),b,d,e,f;b=0;for(d=c.length;b<d;b++)e=a(c[b]),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(c,b,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",c,b,d,e)};a.pkp.controllers.grid.CategoryGridHandler.prototype.deleteElement=function(c){var b,d,e,f;if(1<c.length&&(2==c.length&&(c.hasClass("category_grid_body")&&c.hasClass("category"))&&(c=c.filter(".category_grid_body")),
this.currentCategoryId_)){b=this.getCategoryByDataId(this.currentCategoryId_);d=0;for(e=c.length;d<e;d++)if(f=a(c[d]).parents("#"+b.attr("id")),1===f.length){c=a(c[d]);break}}c.hasClass("category_grid_body")&&(b=this.getCategoryEmptyPlaceholder(c),this.unbindPartial(b),b.remove());this.parent("deleteElement",c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.addElement=function(a){var b=null;a.hasClass("gridRow")&&(b=this.getCategoryDataIdByRowId(a.attr("id")),b=this.getCategoryByDataId(b));
this.parent("addElement",a,b);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,b){if(b.hasClass("category_grid_body")){var d=this.getCategoryEmptyPlaceholder(a);this.unbindPartial(d);d.remove()}this.parent("replaceElement",a,b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.hasSameNumOfColumns=function(a){var b=a,d=!1;a.hasClass("category_grid_body")&&
(b=a.find("tr"),d=!0);return this.parent("hasSameNumOfColumns",b,d)}})(jQuery);(function(a){a.pkp.controllers.listbuilder=a.pkp.controllers.listbuilder||{};a.pkp.controllers.listbuilder.ListbuilderHandler=function(a,b){this.parent(a,b)};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 c=this.getHtmlElement().find("input.deletions").val(),b=[],d,e,f=this;this.getHtmlElement().find('.gridRow input.isModified[value="1"]').each(function(c,d){var e=a(d).parents(".gridRow"),e=f.buildParamsFromInputs_(e.find(":input"));
b.push(e)});d=this.getRows().length;c=JSON.stringify({deletions:c,changes:b,numberOfRows:d});(d=this.getSaveUrl_())?a.post(d,{data:c},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",c))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRow=
function(c){c.addClass("saveRowResponsePlaceholder");c=this.buildParamsFromInputs_(c.find(":input"));c.modify=!0;this.disableControls();a.ajax({url:this.getFetchRowUrl(),data:c,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(c){this.closeEdits();var b=a(c),c=b.closest(".gridRow"),b=b.closest(".pkp_controllers_listbuilder").find(".deletions"),d=c.find('input[name="rowId"]').val();void 0!==d&&(b.val(b.val()+" "+d),this.getHtmlElement().trigger("formChange"));
this.deleteElement(c);this.availableOptions_=!0;return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.appendRowResponseHandler_=function(c,b){var d=this.handleJson(b);!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(c,b){var d=this.handleJson(b),e=this.getHtmlElement(),f=[],h,j,i,l,k,p,n,r,m,s;if(!1!==d){e.find(".gridCellDisplay :input").each(function(c,b){f[c]=a(b).val()});e=e.find(".gridRowEdit:visible .selectMenu:input");h=0;for(j=e.length;h<j;h++){i=a(e[h]);l=i.parents(".gridCellContainer");k=0;i.children().empty();p=null;for(p in d.content[h])if(p!=
a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL)if("object"==typeof d.content[h][p]){if(void 0!==d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&"object"==typeof d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&(r=d.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL][p])){m=a("<optgroup></optgroup>");m.attr("label",r);i.append(m);r=null;s=0;for(r in d.content[h][p])if(n=this.populatePulldown_(m,f,d.content[h][p][r],r))k++,s++;0===s&&m.remove()}}else(n=this.populatePulldown_(i,f,d.content[h][p],p))&&
k++;i=n;1===k&&i&&(i.attr("selected","selected"),this.availableOptions_=!1);0===k&&(l.find(".gridCellDisplay").show(),l.find(".gridCellEdit").hide())}}this.enableControls();return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.populatePulldown_=function(c,b,d,e){var f=c.parents(".gridCellContainer").find(".gridCellDisplay :input").val(),h=!1,j;if(e!=f)for(j=0;j<b.length;j++)b[j]==e&&(h=!0);if(h)return!1;b=a("<option/>");b.attr("value",e);b.text(d);e==f&&b.attr("selected","selected");
c.append(b);return b};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.editItemHandler_=function(c){this.closeEdits();this.editItemCallingContext_=c;setTimeout(this.callbackWrapper(function(){var c=a(this.editItemCallingContext_).closest(".gridRow");c.addClass("gridRowEdit");c.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(c){var b={};a.each(c.serializeArray(),function(c,e){var f=e.name,h=e.value;b[f]=void 0===b[f]?h:a.isArray(b[f])?b[f].concat(h):[b[f],h]});return b};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.inputKeystrokeHandler_=function(c,b){var d,e,f;return 13==b.which?(d=a(c),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(c){a(c).closest(".gridRow").addClass("editingRowPlaceholder");setTimeout(this.callbackWrapper(function(){var c=a(".editingRowPlaceholder"),d=!1;c.find(":input").each(function(a,c){c===document.activeElement&&(d=!0)});c.removeClass("editingRowPlaceholder");d||this.closeEdits()}),0);return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRowResponseHandler_=function(c,b){var d=this.handleJson(b),
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,b){this.parent(a,b)};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(c){jQuery();var b,d;if(!a.isArray(c))throw Error("Lists id must be passed using an array object!");for(b in c)d=this.getListById(c[b]),this.$lists_=this.$lists_?this.$lists_.add(d):d};a.pkp.controllers.listbuilder.MultipleListsListbuilderHandler.prototype.getListById=function(c){c=this.getGridIdPrefix()+"-table-"+c;return a("#"+c,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 b=this.getGridIdPrefix()+"-table-";return a.attr("id").slice(b.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,b,d){var e=this.getListNoItemsRow(a),f=this.getRowsByList(a);d&&(f=f.not(d));f.length==b?(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(c,b){this.parent(c,b);if(!this.checkOptions(b))throw Error("Missing or invalid modal options!");var d=a.extend(!0,{},b);this.options=this.mergeOptions(d);c.html(this.modalBuild()[0].outerHTML);this.modalOpen(c);c.find(".pkpModalCloseButton").click(this.callbackWrapper(this.modalClose));c.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(c){return a.extend(!0,{},this.self("DEFAULT_OPTIONS_"),c)};a.pkp.controllers.modal.ModalHandler.prototype.modalBuild=function(){var c=a('<div class="pkp_modal_panel"></div>');"undefined"!==this.options.title&&c.append('<div class="header">'+this.options.title+"</div>");
this.options.canClose&&c.append('<a href="#" class="close pkpModalCloseButton"><span class="pkp_screen_reader">'+this.options.closeButtonText+"</span></a>");c.append('<div class="content"></div>');c.attr("role","dialog").attr("aria-label",this.options.title);return c};a.pkp.controllers.modal.ModalHandler.prototype.modalOpen=function(c){a("body").append(c);setTimeout(function(){c.addClass("is_visible")},10);setTimeout(function(){c.focus()},300);c.trigger("pkpModalOpen",[c])};a.pkp.controllers.modal.ModalHandler.prototype.modalClose=
function(){var a=this,b=this.getHtmlElement(),d=b.find("form").first(),e;if(1==d.length&&(e={closePermitted:!0},d.trigger("containerClose",[e]),!e.closePermitted))return!1;b.removeClass("is_visible");this.trigger("pkpModalClose");setTimeout(function(){a.unbindPartial(b);b.empty();a.remove();"function"===typeof a.options.closeCallback&&a.options.closeCallback.call()},300);return!1};a.pkp.controllers.modal.ModalHandler.prototype.handleWrapperEvents=function(c,b){"click"==b.type&&c==b.target?a.pkp.classes.Handler.getHandler(a(c)).modalClose():
"keyup"==b.type&&27==b.which&&a.pkp.classes.Handler.getHandler(a(c)).modalClose()};a.pkp.controllers.modal.ModalHandler.prototype.redirectNotifyUserEventHandler_=function(c,b,d){a.pkp.classes.notification.NotificationHelper.redirectNotifyUserEvent(this,d)}})(jQuery);(function(a){a.pkp.controllers.modal.ConfirmationModalHandler=function(a,b){this.parent(a,b);this.callback_=b.callback||null;this.callbackArgs_=b.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"),b='<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&&(b+='<a href="#" class="cancel pkpModalCloseButton">'+this.options.cancelButton+"</a>");a.append('<div class="footer">'+b+"</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,b){this.parent(a,b);this.remoteUrl_=b.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,b){this.parent(a,b);this.remoteAction_=b.remoteAction;this.postData_=b.postData||{};this.postData_.csrfToken=b.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(c,b){b.preventDefault();a.post(this.remoteAction_,this.postData_,this.callbackWrapper(this.remoteResponse),"json")};a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteResponse=
function(a,b){!1!==this.parent("remoteResponse",a,b)&&this.modalClose(a);return!1}})(jQuery);(function(a){a.pkp.controllers.modal.ButtonConfirmationModalHandler=function(a,b){this.parent(a,b)};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 b=
this.options.$button;this.modalClose(a);"submit"==b.attr("type")?b.trigger("submit"):b.click()}})(jQuery);(function(a){a.pkp.controllers.modal.JsEventConfirmationModalHandler=function(a,b){this.parent(a,b);this.jsEvent_=b.jsEvent;this.extraArguments_=b.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,b){this.parent(a,b);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,b){this.parent(a,b);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(c,b,d){d?this.parent("modalClose",c,b):(d=new a.Event("wizardCancelRequested"),d.stopPropagation(),this.getHtmlElement().children().first().trigger(d),
d.isDefaultPrevented()||this.parent("modalClose",c,b));return!1};a.pkp.controllers.modal.WizardModalHandler.prototype.wizardClose=function(a,b){this.modalClose(a,b,!0)}})(jQuery);(function(a){a.pkp.controllers.modals=a.pkp.controllers.modals||{editorDecision:{form:{}}};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler=function(c,b){this.parent(c,b);null!==b.peerReviewUrl&&(this.peerReviewUrl_=b.peerReviewUrl,a("#importPeerReviews",c).click(this.callbackWrapper(this.importPeerReviews)));null!==b.revisionsEmail&&(this.revisionsEmail_=b.revisionsEmail);null!==b.resubmitEmail&&(this.resubmitEmail_=b.resubmitEmail);a("#skipEmail-send, #skipEmail-skip, #skipDiscussion-send, #skipDiscussion-skip",
c).change(this.callbackWrapper(this.toggleEmailDisplay));a('input[name="decision"]',c).change(this.callbackWrapper(this.toggleDecisionEmail));this.setStep("email");var d=this;a(".promoteForm-step-btn",c).click(function(c){c.preventDefault();c.stopPropagation();c=a(c.target).data("step");d.setStep(c)})};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(c,b){var d=
this.handleJson(b),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 c=a("#sendReviews-emailContent"),b=this.getHtmlElement(),d=!1,e=!1,f=a("#libraryFileAttachments");a("#skipEmail-send, #skipEmail-skip",b).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)});b=a("#skipDiscussion-send, #skipDiscussion-skip",b);b.length&&b.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?(c.fadeOut(),f.fadeOut()):(c.fadeIn(),f.fadeIn())};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.toggleDecisionEmail=
function(){var c="",b=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")?c=f.revisionsEmail_:"decisionResubmit"===a(this).attr("id")&&a(this).prop("checked")&&(c=f.resubmitEmail_)});tinyMCE.get(e).setContent(c);b&&d.hide().fadeIn()};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.setStep=
function(c){var b=a('#promoteForm-step1, .promoteForm-step-btn[data-step="files"]'),d=a('#promoteForm-step2, #promoteForm-complete-btn, .promoteForm-step-btn[data-step="email"]');"files"===c?(d.show(),b.hide()):(b.show(),d.hide())}})(jQuery);(function(a){jQuery.pkp.controllers.linkAction=jQuery.pkp.controllers.linkAction||{};a.pkp.controllers.linkAction.LinkActionHandler=function(c,b){this.parent(c,b);this.staticId_=b.staticId?b.staticId:c.attr("id");if(!b.actionRequest||!b.actionRequestOptions)throw Error('The "actionRequest" and "actionRequestOptions"settings are required in a LinkActionHandler');b.actionRequestOptions.finishCallback=this.callbackWrapper(this.enableLink);this.linkActionRequest_=a.pkp.classes.Helper.objectFactory(b.actionRequest,
[c,b.actionRequestOptions]);this.bindActionRequest();this.publishEvent("dataChanged");this.bind("dataChanged",this.dataChangedHandler_);this.bind("pkpModalClose",this.removeDisabledAttribute_);b.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,b){this.linkActionRequest_.shouldDebounce()&&this.disableLink();return this.linkActionRequest_.activate.call(this.linkActionRequest_,a,b)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.bindActionRequest=function(){this.bind("click",this.activateAction)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.enableLink=
function(){var c,b;c=a(this.getHtmlElement());this.getHtmlElement().is(":submit")||this.removeDisabledAttribute_();b=this.getUrl();this.getHtmlElement().is("a")&&b&&c.attr("href",b);this.unbind("click",this.noAction_);this.bindActionRequest()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.disableLink=function(){var c=a(this.getHtmlElement());c.attr("disabled","disabled");this.getHtmlElement().is("a")&&c.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,b,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,b){this.parent(a,b);this.addWizardButtons_(a,b);this.enforceLinear_=b.hasOwnProperty("enforceLinear")?b.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 c=new a.Event("wizardAdvanceRequested");this.getCurrentTab().children().first().trigger(c);c.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 c=new a.Event("wizardCancelRequested");this.getCurrentTab().children().first().trigger(c);c.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,b){var d=this.getForm_();
d&&(d.submit()&&(this.disableContinueButton(),this.showProgressIndicator_()),b.preventDefault())};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvance=function(){var a=this.getCurrentStep(),b=this.getNumberOfSteps()-1,d=a+1,e;if(d>b)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===b&&a.text(this.getFinishButtonText());this.hideProgressIndicator_();
this.enableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.startWizard=function(){var a=this.getHtmlElement(),b,d;0!==this.getCurrentStep()&&(a.tabs("enable",0),a.tabs("option","active",0),b=this.getContinueButton(),b.text(this.getContinueButtonText()));if(this.enforceLinear_){b=[];for(d=1;d<this.getNumberOfSteps();d++)b.push(d);a.tabs("option","disabled",b)}};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 c,b,d;d=this.getCurrentTab().children();for(c=0;c<d.length;c++)if(b=a(d[c]),b.is("form"))return b;return null};a.pkp.controllers.wizard.WizardHandler.prototype.advanceOrClose_=
function(){var a=this.getCurrentStep(),b=this.getNumberOfSteps()-1;a<b?this.trigger("wizardAdvance"):this.trigger("wizardClose")};a.pkp.controllers.wizard.WizardHandler.prototype.checkForm_=function(c){var b=this.getForm_();if(null!==b)if(b=a.pkp.classes.Handler.getHandler(a("#"+b.attr("id"))),c){if(b.formChangesTracked)if(confirm(a.pkp.locale.form_dataHasChanged))b.unregisterForm();else return!0}else b.unregisterForm();return!1};a.pkp.controllers.wizard.WizardHandler.prototype.addWizardButtons_=
function(c,b){var d=a('<div id="wizardButtons" class="modal_buttons"></div>'),e,f;b.continueButtonText&&(e=a('<button id="continueButton" class="pkp_button"></button>').text(b.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_=b.continueButtonText,this.finishButtonText_=b.finishButtonText?b.finishButtonText:b.continueButtonText);b.cancelButtonText&&
(e=a('<a id="cancelButton" class="cancel" href="#"></a>').text(b.cancelButtonText),d.append(e),e.bind("click",this.callbackWrapper(this.cancelRequest)));c.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,b){this.fetchNoteFormUrl_=b.fetchNoteFormUrl;this.fetchParticipantsListUrl_=b.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(c){a(c).parents(".openNoteForm").addClass("is_loading");
a.get(this.fetchNoteFormUrl_,this.callbackWrapper(this.showFetchedNoteForm_),"json")};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showFetchedNoteForm_=function(c,b){var d=this.handleJson(b),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(c,b){var d=this.handleJson(b),
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,b){this.parent(a,b);this.csrfToken_=b.csrfToken;this.deleteUrl_=b.deleteUrl;this.metadataUrl_=b.metadataUrl;this.finishUrl_=b.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,b,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,b,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardAdvance=function(){var a=
this.getCurrentStep(),b=this.getNumberOfSteps()-1,d=a+1,e=this.getHtmlElement();if(d>b)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===b&&(a=this.getContinueButton(),a.text(this.getFinishButtonText()),this.enableContinueButton())};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsLoad=function(c,b,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",c,b,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.formValid=function(a,b){0===this.getCurrentStep()&&0===this.getHtmlElement().find("#uploadConfirmationForm").length&&!this.uploadedFile_||this.parent("formValid",a,b)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelRequested=function(c,b){if(this.parent("wizardCancelRequested",c,
b))if(this.uploadedFile_)this.uploadedFile_.csrfToken=this.csrfToken_,a.post(this.deleteUrl_,this.uploadedFile_,a.pkp.classes.Helper.curry(this.wizardCancelSuccess,this,c,b),"json"),this.uploadedFile_=null,b.preventDefault();else return!0;return!1};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelSuccess=function(a,b,d){!1!==this.handleJson(d)&&this.trigger("wizardCancel")};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleFileUploaded=function(a,
b,d){this.uploadedFile_=d};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleRemovedFiles=function(c,b,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,b){this.parent(a,b);this.hasFileSelector_=b.hasFileSelector;this.hasGenreSelector_=b.hasGenreSelector;b.presetRevisedFileId&&(this.presetRevisedFileId_=b.presetRevisedFileId);this.fileGenres_=b.fileGenres;this.$uploader_=b.$uploader;this.attachUploader_(this.$uploader_,b.uploaderOptions);this.uploaderSetup(b.$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(c){c=a.pkp.classes.Handler.getHandler(c);c.pluploader.bind("BeforeUpload",this.callbackWrapper(this.prepareFileUploadRequest));c.pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse));c.pluploader.bind("FilesRemoved",this.callbackWrapper(this.handleRemovedFiles))};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.prepareFileUploadRequest=function(a,b){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="";b.settings.multipart_params=d};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleUploadResponse=function(c,b,d,e){c=this.handleJson(a.parseJSON(e.response));this.getHtmlElement();!1!==c&&(this.trigger("fileUploaded",
c.uploadedFile),""!==c.content&&this.replaceWith(c.content));this.getHtmlElement().valid()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleRemovedFiles=function(a,b,d){this.trigger("filesRemoved",[b,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,b){a.pkpHandler("$.pkp.controllers.UploaderHandler",b)};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,b){this.parent(a,b);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,b){var d=this.getHtmlElement();0<parseInt(d.find("#revisedFileId").val(),10)&&(d.submit(),b.preventDefault())};a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler.prototype.handleResponse=function(a,b){!0===b.status&&this.trigger("fileUploaded",b.uploadedFile);return this.parent("handleResponse",a,b)}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus=a.pkp.controllers.grid.navigationMenus||{form:{}};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler=function(a,b){this.okButton_=b.okButton;this.warningModalTitle_=b.warningModalTitle;this.submenuWarning_=b.submenuWarning;this.itemTypeConditionalWarnings_=b.itemTypeConditionalWarnings;a.on("click",".btnConditionalDisplay",this.callbackWrapper(this.showConditionalDisplayWarning));a.on("click",".btnSubmenuWarning",this.callbackWrapper(this.showSubmenuWarning));
this.parent(a,b);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 c=this;a(".btnSubmenuWarning",this.getHtmlElement()).remove();a("#pkpNavAssigned > li").each(function(){var b=a(this).children("ul"),d=b.children(),e=d.find("li");b.length?d.length?(e.length&&e.each(function(){a(this).appendTo(b)}),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(c.submenuWarning_)))):
b.replaceWith("<ul></ul>"):a(this).append("<ul></ul>")});a("#pkpNavUnassigned > li").each(function(){var c=a(this).children("ul");c.length&&c.find("li").each(function(){a(this).appendTo(a("#pkpNavUnassigned"))});c.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 c=a("#pkpNavManagement"),b=0,d="";this.initSorting();a("input",c).remove();a("#pkpNavAssigned > li").each(function(){d="menuTree["+a(this).data("id")+"]";c.append('<input type="hidden" name="'+d+'[seq]" value="'+b+'">');b++;var e=a(this).data("id");a(this).find("li").each(function(){d="menuTree["+a(this).data("id")+"]";c.append('<input type="hidden" name="'+d+'[seq]" value="'+b+'">');c.append('<input type="hidden" name="'+
d+'[parentId]" value="'+e+'">');b++})})};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showConditionalDisplayWarning=function(c){var c=a(c).closest("li").data("type"),b={title:this.warningModalTitle_,okButton:this.okButton_,cancelButton:!1,dialogText:this.itemTypeConditionalWarnings_[c]};null!==this.itemTypeConditionalWarnings_[c]&&a('<div id="'+a.pkp.classes.Helper.uuid()+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",
b);return!1};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showSubmenuWarning=function(){var c={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",c);return!1}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler=function(c,b){this.parent(c,b);this.previewUrl_=b.previewUrl;this.itemTypeDescriptions_=b.itemTypeDescriptions;this.itemTypeConditionalWarnings_=b.itemTypeConditionalWarnings;a("#previewButton",c).click(this.callbackWrapper(this.showPreview_));a("#menuItemType",c).change(this.callbackWrapper(this.setType));a("#menuItemType",c).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 c=this.getHtmlElement();
a.post(this.previewUrl_,c.serialize(),function(a){var c=window.open("about:blank");c.document.open();c.a);c.document.close()});return!0};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.setType=function(){var c=a("#menuItemType",this.getHtmlElement()).val(),b=a('#menuItemTypeSection [for="menuItemType"]');a(".NMI_TYPE_CUSTOM_EDIT",this.getHtmlElement()).hide();a("#"+c).fadeIn();"undefined"!==typeof this.itemTypeDescriptions_[c]&&b.text(this.itemTypeDescriptions_[c])}})(jQuery);(function(a){a.pkp.controllers.grid.representations=a.pkp.controllers.grid.representations||{form:{}};a.pkp.controllers.grid.representations.form.RepresentationFormHandler=function(c,b){this.parent(c,b);(this.remoteRepresentation_=b.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.controllers.grid.settings=a.pkp.controllers.grid.settings||{user:{form:{}}};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler=function(c,b){this.parent(c,b);a('[id^="generatePassword"]',c).click(this.callbackWrapper(this.setGenerateRandom));a('[id^="generatePassword"]',c).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(c,b){var d=this.getHtmlElement();a(":password",d).removeAttr("disabled");this.parent("submitForm",c,b)};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler.prototype.setGenerateRandom=function(c){var c=a(c),b=this.getHtmlElement(),d="",e=0;c.prop("checked")?(d="********",e="disabled"):e=d="";a(":password",b).prop("disabled",e).val(d);a('[id^="sendNotify"]',b).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(c,b){var d=a('[id^="roleId"]',c);this.parent(c,b);b.selfRegistrationRoleIds&&(this.selfRegistrationRoleIds_=b.selfRegistrationRoleIds);b.recommendOnlyRoleIds&&(this.recommendOnlyRoleIds_=b.recommendOnlyRoleIds);this.roleForbiddenStages_=b.roleForbiddenStagesJSON.content;this.stagesSelector_=b.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(c){c=a(c).val();this.updatePermitSelfRegistration(c);this.updateStageOptions(c);this.updateRecommendOnly(c)};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updatePermitSelfRegistration=function(c){var b=a('[id^="permitSelfRegistration"]');this.getHtmlElement();var d,e=!1;for(d=0;d<this.selfRegistrationRoleIds_.length;d++)this.selfRegistrationRoleIds_[d]==c&&(e=!0);e?b.removeAttr("disabled"):
(b.attr("disabled","disabled"),b.removeAttr("checked"))};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updateStageOptions=function(c){var b=this.getHtmlElement(),d=b.find("#userGroupStageContainer"),e=a(this.stagesSelector_,b).filter("input"),f,h=null;e.removeAttr("disabled");if(void 0!=this.roleForbiddenStages_[c])for(f=0;f<this.roleForbiddenStages_[c].length;f++)h=this.roleForbiddenStages_[c][f],e.filter('input[value="'+h+'"]').attr("disabled","disabled");0==b.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(c){var b=a("[id^='recommendOnly']",this.getHtmlElement()),d,e=!1;for(d=0;d<this.recommendOnlyRoleIds_.length;d++)this.recommendOnlyRoleIds_[d]==c&&(e=!0);e?b.removeAttr("disabled"):(b.attr("disabled","disabled"),b.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,b){a.find(":checkbox").change(this.callbackWrapper(this.checkboxHandler_));this.parent(a,b)};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(c){this.parent("initialize",
c);a(this.getHtmlElement()).find(":checkbox").change()};a.pkp.controllers.grid.settings.metadata.MetadataGridHandler.prototype.checkboxHandler_=function(c){c=a(c);c.is(":checked");var b=a(this.getHtmlElement());c.prop("name");this.getRows().each(function(){var c=a(this).prop("id").split("-").pop(),e=b.find(":checkbox[name="+c+"EnabledWorkflow]"),f=b.find(":checkbox[name="+c+"EnabledSubmission]"),c=b.find(":checkbox[name="+c+"Required]");(f.prop("checked")||c.prop("checked"))&&e.prop("checked",!0);
e.prop("readonly",f.prop("checked")||c.prop("checked"));c.prop("checked")&&f.prop("checked",!0);f.prop("readonly",c.prop("checked"))});return!1}})(jQuery);(function(a){a.pkp.controllers.tab=a.pkp.controllers.tab||{settings:{form:{}}};a.pkp.controllers.tab.settings.form.FileViewFormHandler=function(a,b){this.parent(a,b);this.fetchFileUrl_=b.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(c,b,d){a.get(this.fetchFileUrl_,{settingName:d},this.callbackWrapper(this.refreshResponseHandler_),"json")};a.pkp.controllers.tab.settings.form.FileViewFormHandler.prototype.refreshResponseHandler_=function(a,b){var d,e=this.handleJson(b);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(c){var b=
this.getHtmlElement();return a("#"+c,b)}})(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(c,b){this.parent(c,b);a("#enableAnnouncementsHomepage",c).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 c=a("#numAnnouncementsHomepage",this.getHtmlElement());c.attr("disabled")?c.removeAttr("disabled"):c.attr("disabled","disabled")}})(jQuery);(function(a){a.pkp.controllers.tab.settings.archiving=a.pkp.controllers.tab.settings.archiving||{form:{}};a.pkp.controllers.tab.settings.archiving.form.ArchivingSettingsFormHandler=function(c,b){this.parent(c,b);a(".expand-others").click(function(){a("#otherLockss").slideToggle("fast")});"1"==a("#isPLNPluginInstalled").val()&&a("#otherLockss").hide()};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.settings.archiving.form.ArchivingSettingsFormHandler,a.pkp.controllers.form.AjaxFormHandler)})(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(c,b){this.parent(c,b);a("#licenseURLSelect",c).change(this.callbackWrapper(this.licenseURLSelectChange));a('input[id^="licenseURL-"]',c).keyup(this.callbackWrapper(this.licenseURLOtherChange));a('input[id^="copyrightHolderType-"]',c).change(this.callbackWrapper(this.copyrightHolderRadioSelect));a("#resetPermissionsButton",
c).button().click(this.callbackWrapper(this.resetPermissionsHandler));this.resetPermissionsUrl=b.resetPermissionsUrl;this.resetPermissionsConfirmText=b.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(),b=a.find("#licenseURLSelect");a.find('input[id^="licenseURL-"]').val(b.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(c){var b=this.getHtmlElement(),c=a(c),b=b.find('input[id^="copyrightHolderOther-"]');"other"===c.val()?b.removeAttr("disabled"):b.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,b){this.parent(a,b);this.paymentMethodFormUrlTemplate_=b.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(c){a("#paymentPluginName").val(c);return this.paymentMethodFormUrlTemplate_.replace("PAYMENT_PLUGIN_NAME",c)};a.pkp.controllers.tab.settings.paymentMethod.PaymentMethodHandler.prototype.selectPaymentMethodHandler=function(c,b,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(c,b){var d=this.handleJson(b),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,b){a.find('a[id*="markNew"]').click(this.callbackWrapper(this.markNewHandler_));a.find('a[id*="markRead"]').click(this.callbackWrapper(this.markReadHandler_));a.find('a[id*="deleteNotifications"]').click(this.callbackWrapper(this.deleteHandler_));this.parent(a,b)};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 c=[];this.getHtmlElement().find("input:checkbox:checked").each(function(){c.push(a(this).val())});return c};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,b){var d=
this.getFetchExtraParams();d.selectedNotificationIds=b.content;this.setFetchExtraParams(d);this.handleJson(b)}})(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(c,b){this.parent(c,b);a("#disableUserReg-0",c).click(this.callbackWrapper(this.changeRegOptsState));a("#disableUserReg-1",c).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(c){c?a('[id^="allow"]').attr("disabled","disabled"):a('[id^="allow"]').removeAttr("disabled")};a.pkp.controllers.tab.settings.siteAccessOptions.form.SiteAccessOptionsFormHandler.prototype.setRegOptsChecked_=
function(c){c?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,b){var d,e,f,h;this.parent(a,b);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)&&(b.selected=f)}};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.workflow.WorkflowTabHandler,a.pkp.controllers.TabHandler)})(jQuery);jQuery.pkp.controllers.informationCenter=jQuery.pkp.controllers.informationCenter||{};
(function(a){a.pkp.controllers.informationCenter.NotesHandler=function(a,b){this.parent(a,b);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(c,b,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(c,b){var d;b.trackFormChanges=!1;b.transformButtons=!1;this.parent(c,b);this.getHtmlElement().find(":submit").button();a("#reportUrlFormArea",c).hide();this.timeFilterWrapperSelector_=b.timeFilterWrapperSelector;this.rangeByDaySelector_=b.rangeByDaySelector;this.rangeByMonthSelector_=b.rangeByMonthSelector;this.startDayElementSelector_=b.startDayElementSelector;
this.endDayElementSelector_=b.endDayElementSelector;this.optionalColumns_=b.optionalColumns;this.aggregationOptionsSelector_=b.aggregationOptionsSelector;this.fetchFormUrl_=b.fetchFormUrl;this.$metricTypeSelectElement_=d=a(b.metricTypeSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));a(".pkp_loading",c).hide();this.$reportTemplateSelectElement_=d=a(b.reportTemplateSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));
this.columnsSelector_=b.columnsSelector;d=a(b.aggregationOptionsSelector);0<d.length&&d.change(this.callbackWrapper(this.aggregationOptionsChangeHandler_));d=a(b.currentMonthSelector,this.getHtmlElement()).add(b.yesterdaySelector,this.getHtmlElement()[0]);2==d.length&&d.click(this.callbackWrapper(this.currentTimeElementsClickHandler_));d=a(b.rangeByMonthSelector,this.getHtmlElement()).add(b.rangeByDaySelector,this.getHtmlElement()[0]);2==d.length&&d.click(this.callbackWrapper(this.rangeTimeElementsClickHandler_));
this.dateRangeElementsWrapper_=a(b.dateRangeWrapperSelector,this.getHtmlElement());1==d.filter("input:checked").length?d.filter("input:checked").click():this.dateRangeElementsWrapper_.hide();this.fileAssocTypes_=b.fileAssocTypes;this.$fileTypeSelectElement_=a(b.fileTypeSelectSelector,this.getHtmlElement());d=a(b.objectTypeSelectSelector,this.getHtmlElement());1==this.$fileTypeSelectElement_.length&&(this.$fileTypeSelectElement_.attr("disabled","disabled"),d.change(this.callbackWrapper(this.updateFileTypeSelectHandler_)));
d.change();this.fetchRegionsUrl_=b.fetchRegionsUrl;this.$regionSelectElement_=a(b.regionSelectSelector,this.getHtmlElement());1==this.$regionSelectElement_.length&&(d=a(b.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(c,b){var d=this.handleJson(b);!1!==d&&void 0!==d.reportUrl&&(a("#reportUrlFormArea",this.getHtmlElement()).show().find(":input").val(d.reportUrl),window.location=d.reportUrl);this.parent("handleResponse",c,b);return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchFormHandler_=
function(){var c,b={};c=a(this.timeFilterWrapperSelector_,this.getHtmlElement()).serializeArray();a.each(c,function(a,c){b[c.name]=c.value});a(".pkp_loading",this.getHtmlElement()).show();c=a("option:selected",this.$metricTypeSelectElement_);void 0!==c[0]&&void 0!==c[0].value&&(b.metricType=c[0].value);c=a("option:selected",this.$reportTemplateSelectElement_);void 0!==c[0]&&void 0!==c[0].value&&(b.reportTemplate=c[0].value);b.refreshForm=!0;a.get(this.fetchFormUrl_,b,this.callbackWrapper(this.handleResponse,
null),"json");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.updateFileTypeSelectHandler_=function(c){var b,c=a(c),c=a("option:selected",c);if(1==c.length)for(b in c=c[0].value,this.fileAssocTypes_)if(this.fileAssocTypes_[b]==c)return this.$fileTypeSelectElement_.removeAttr("disabled"),!1;this.$fileTypeSelectElement_.attr("disabled","disabled");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchRegionHandler_=function(c){this.$regionSelectElement_.empty();
c=a(c);c=a("option:selected",c);1==c.length&&(c=c[0].label,a.get(this.fetchRegionsUrl_,{countryId:c},this.callbackWrapper(this.updateRegionSelectCallback_,null),"json"));return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.updateRegionSelectCallback_=function(c,b){var d,e,f,h;d=this.$regionSelectElement_;d.empty();e=this.handleJson(b);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(c){var b=a(this.startDayElementSelector_).add(this.endDayElementSelector_);this.dateRangeElementsWrapper_.show();"#"+a(c).attr("id")==this.rangeByDaySelector_&&b.show();"#"+a(c).attr("id")==this.rangeByMonthSelector_&&b.hide();return!0};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.aggregationOptionsChangeHandler_=
function(c){var b;b=a(this.columnsSelector_);c=a(c);b=b.find('option[value="'+c.attr("value")+'"]');c.is(":checked")?b.attr("selected","selected"):b.removeAttr("selected");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.addOptionalColumnsClass_=function(){var c,b,d,e;d=a(this.columnsSelector_);e=a(this.aggregationOptionsSelector_);b=a("#orderByFormArea select",this.getHtmlElement());d=d.add(b);b=this.optionalColumns_;for(c in b)d.find('option[value="'+c+'"]').addClass("optionalColumn"),
e.filter('input[value="'+c+'"]').parent().addClass("optionalColumn")}})(jQuery);(function(a){a.pkp.controllers.dashboard=a.pkp.controllers.dashboard||{form:{}};a.pkp.controllers.dashboard.form.DashboardTaskFormHandler=function(c,b){this.parent(c,b);this.singleContextSubmissionUrl_=b.singleContextSubmissionUrl;a("#singleContext",c).click(this.callbackWrapper(this.startSingleContextSubmission_));a("#multipleContext",c).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);(function(a){a.pkp.pages=a.pkp.pages||{header:{}};a.pkp.pages.header.HeaderHandler=function(a,b){this.options_=b;this.parent(a,b)};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(c,b){this.options_=b;this.parent(c,b);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(),
b=a.find("#notificationsPopover"),d=a.find("#notificationsToggle");b.toggle();d.toggleClass("expandedIndicator");d.hasClass("expandedIndicator")?(this.trigger("callWhenClickOutside",[{container:a,callback:this.callbackWrapper(this.appendToggleIndicator_)}]),setTimeout(this.callbackWrapper(this.setPopoverSize_),500)):b.css("height","").css("overflow-y","")};a.pkp.pages.header.TasksHandler.prototype.setPopoverSize_=function(){var c=this.getHtmlElement().find("#notificationsPopover"),b=a(window).height()-
60;b<c.height()&&c.height(b).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,b){var d=this.getHtmlElement().find("#unreadNotificationCount");d.html(b.content);"0"==b.content?d.removeClass("hasTasks"):d.addClass("hasTasks")}})(jQuery);(function(a){a.pkp.pages.admin=a.pkp.pages.admin||{};a.pkp.pages.admin.ContextsHandler=function(c,b){var d=a("#openWizard a");d&&d.attr("style","display:none");this.parent(c,b)};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,b){this.parent(a,b);this.submissionProgress_=b.submissionProgress;this.cancelUrl_=b.cancelUrl;this.cancelConfirmText_=b.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,b,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);jQuery.pkp.pages.submission=jQuery.pkp.pages.submission||{};
(function(a){a.pkp.pages.submission.SubmissionStep1FormHandler=function(c,b){this.parent(c,b);this.showSectionPolicy(null);a("#sectionId").change(this.callbackWrapper(this.showSectionPolicy))};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionStep1FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.pages.submission.SubmissionStep1FormHandler.prototype.showSectionPolicy=function(){a(".section-policy").hide();a(".section-policy.section-id-"+a("#sectionId").val()).fadeIn()}})(jQuery);(function(a){a.pkp.pages.submission.SubmissionStep2FormHandler=function(a,b){this.parent(a,b);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(c,b,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,b){this.parent(a,b);this.bind("gridRefreshRequested",this.fetchChaptersGrid_);this.authorsGridContainer_=b.authorsGridContainer;this.chaptersGridContainer_=b.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(c,b){b.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,b){this.parent(a,b);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 c,b,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")){b=a(this).find("a").attr("class");if(c=b.match(/stageId(\d)/)){d=c[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(c,b,d){c=a(b.target,this.getHtmlElement()).children("a");c.length&&c.attr("id").match(/submissionEntry/)&&(c=a('[id^="formatsGridContainer"]',this.getHtmlElement()).children("div"),c.trigger("dataChanged",[d]),c.trigger("notifyUser",[c]))}})(jQuery);(function(a){a.pkp.controllers.grid.users=a.pkp.controllers.grid.users||{};a.pkp.controllers.grid.users.UserGridHandler=function(a,b){this.parent(a,b);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(c,b){this.parent(c,b);c.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(c,b){var d="",e="";b.length?(this.selectedReviewer=b[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,b,d){d&&this.replaceWith(d)}})(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,b){this.parent(a,b);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,b){this.parent(a,b);b.templateUrl&&(this.templateUrl_=b.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 c=this.getHtmlElement();a.post(this.templateUrl_,c.find("#template").serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.updateTemplate=function(a,b){var d=this.getHtmlElement(),e=this.handleJson(b),
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(c,b){this.parent(c,b);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(c,b){this.parent(c,b);b.templateUrl&&(this.templateUrl_=b.templateUrl);b.possibleRecommendOnlyUserGroupIds&&(this.possibleRecommendOnlyUserGroupIds_=b.possibleRecommendOnlyUserGroupIds);b.recommendOnlyUserGroupIds&&(this.recommendOnlyUserGroupIds_=b.recommendOnlyUserGroupIds);b.blindReviewerIds&&
(this.blindReviewerIds_=b.blindReviewerIds);b.blindReviewerWarning&&(this.blindReviewerWarning_=b.blindReviewerWarning);b.blindReviewerWarningOk&&(this.blindReviewerWarningOk_=b.blindReviewerWarningOk);a("input[name='userGroupId'], input[name='userIdSelected']",c).change(this.callbackWrapper(this.updateRecommendOnly));a("input[name='userIdSelected']",c).change(this.callbackWrapper(this.maybeTriggerReviewerWarning));c.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 c=this.getHtmlElement();a.post(this.templateUrl_,c.find("#template").serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.updateTemplate=function(a,b){var d=this.getHtmlElement(),e=this.handleJson(b),f=b.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(c){var b=this.getHtmlElement(),d=b.find("input[name='userGroupId']"),e=b.find("input[id^='recommendOnly']"),b=b.find(".recommendOnlyWrapper"),d=d.val();if("userGroupId"==a(c).prop("name"))e.attr("disabled","disabled"),e.removeAttr("checked"),b.hide();else if("userIdSelected"==
a(c).prop("name")&&!b.is(":visible"))for(c=0;c<this.possibleRecommendOnlyUserGroupIds_.length;c++)if(this.possibleRecommendOnlyUserGroupIds_[c]==d){e.removeAttr("disabled");b.show();for(c=0;c<this.recommendOnlyUserGroupIds_.length;c++)if(this.recommendOnlyUserGroupIds_[c]==d){e.prop("checked",!0);break}break}};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.maybeTriggerReviewerWarning=function(c){if((c=a(c).val())&&!(0>this.blindReviewerIds_.indexOf(c)))c=
{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",c)};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.handleResponse=function(c,b){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",c,b)}})(jQuery);(function(a){a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler=function(c,b){this.parent(c,b);a("select[name^='filterUserGroupId']",c).change(this.callbackWrapper(this.addUserGroupId));a("input[name='userId']").click(function(){var c=a("input[name='userId']:checked").val();a("input[name='userIdSelected']").val(c).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 c=this.getHtmlElement().find("select[name^='filterUserGroupId']").val();a("input[name='userGroupId']").val(c).trigger("change")}})(jQuery);(function(a){a.pkp.pages.reviewer=a.pkp.pages.reviewer||{};a.pkp.pages.reviewer.ReviewerTabHandler=function(a,b){this.parent(a,b);this.reviewStep_=b.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,b,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,b){this.parent(a,b);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.articleGalleys=a.pkp.controllers.grid.articleGalleys||{};a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler=function(a,b){this.parent(a,b);a.bind("uploadFile",this.callbackWrapper(this.uploadFileHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler.prototype.uploadFileHandler_=function(c,b,d){var e='a[id^="component-grid-articlegalleys-articlegalleygrid-row-'+
d+'-addFile-button-"]';a.when(a(e)).then(function(){a(function(){a(e).click()})})}})(jQuery);(function(a){a.pkp.controllers.grid.issues=a.pkp.controllers.grid.issues||{};a.pkp.controllers.grid.issues.BackIssueGridHandler=function(a,b){this.parent(a,b);this.bindGlobal("issuePublished",this.refreshGridHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.issues.BackIssueGridHandler,a.pkp.controllers.grid.GridHandler)})(jQuery);(function(a){a.pkp.controllers.grid.issues.FutureIssueGridHandler=function(a,b){this.parent(a,b);this.bindGlobal("issueUnpublished",this.refreshGridHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.issues.FutureIssueGridHandler,a.pkp.controllers.grid.GridHandler)})(jQuery);(function(a){a.pkp.controllers.tab.issueEntry=a.pkp.controllers.tab.issueEntry||{};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler=function(a,b){b.selectedGalleyId&&(b.selected=this.getTabPositionByGalleyId_(b.selectedGalleyId,a));this.parent(a,b);this.bind("gridRefreshRequested",this.gridRefreshRequested);b.tabsUrl&&(this.tabsUrl_=b.tabsUrl);b.tabContentUrl&&(this.tabContentUrl_=b.tabContentUrl);this.bind("gridInitialized",this.addGalleysGridRowActionHandlers_);this.publishEvent("gridInitialized")};
a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler,a.pkp.controllers.TabHandler);a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.tabContentUrl_=null;a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.gridRefreshRequested=function(c,b){a(b.target).attr("id").match(/^galleysGridContainer/)&&this.tabsUrl_&&this.tabContentUrl_&&a.get(this.tabsUrl_,null,this.callbackWrapper(this.updateTabsHandler_),"json")};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.updateTabsHandler_=
function(a,b){var d=this.handleJson(b),e=this.getHtmlElement(),f=e.find("li a"),h={},j=/galley(\d+)/,i,l,k;for(l=0;l<f.length;l++)k=f[l].getAttribute("id"),k=j.exec(k),null!==k&&(h[k[1]]=l);for(i in d.galleys)h.hasOwnProperty(i)||(f=this.tabContentUrl_+"&galleyId="+encodeURIComponent(i),f=f.replace(/[$]/g,"$$$$"),e.tabs("add",f,d.galleys[i]),e.find("li a").filter(":last").attr("id","galley"+i));for(i in h)d.galleys.hasOwnProperty(i)?e.find("li a").filter('[id="galley'+i+'"]').html(d.galleys[i]):e.tabs("remove",
h[i])};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.addGalleysGridRowActionHandlers_=function(){var c=a('[id^="galleysGridContainer"]',this.getHtmlElement());c.length&&(c=a('a[id*="galleyTab"]',c),c.click(this.callbackWrapper(this.galleysGridLinkClickHandler_)))};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.galleysGridLinkClickHandler_=function(c){var b=a('[id^="galleysGridContainer"]',this.getHtmlElement()).children("div"),b=a.pkp.classes.Handler.getHandler(b),
c=b.getParentRow(a(c)),c=b.getRowDataId(c);this.getHtmlElement().tabs({active:this.getTabPositionByGalleyId_(c,this.getHtmlElement())})};a.pkp.controllers.tab.issueEntry.IssueEntryTabHandler.prototype.getTabPositionByGalleyId_=function(c,b){var d=a("#galley"+c,b).parent("li");return d.length?b.find("li").index(d):null}})(jQuery);(function(a){a.pkp.controllers.tab.issueEntry.form=a.pkp.controllers.tab.issueEntry.form||{};a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler=function(c,b){this.parent(c,b);a("#paymentReceivedButton",c).click(this.callbackWrapper(this.paymentReceivedHandler));a("#waivePaymentButton",c).click(this.callbackWrapper(this.waivePaymentHandler));b.arePermissionsAttached&&c.find("#attachPermissions").prop("checked",!0);a("#issueId",c).change(this.callbackWrapper(this.checkAttachMetadata));
a('input[id^="copyrightHolder-"]',c).keyup(this.callbackWrapper(this.checkAttachMetadata));a('input[id^="copyrightYear-"]',c).keyup(this.callbackWrapper(this.checkAttachMetadata));a('input[id^="licenseURL-"]',c).keyup(this.callbackWrapper(this.checkAttachMetadata))};a.pkp.classes.Helper.inherits(a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler.prototype.paymentReceivedHandler=
function(){var a=this.getHtmlElement();a.find('input[name="waivePublicationFee"]').val("1");a.find('input[name="markAsPaid"]').val("1");a.submit()};a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler.prototype.waivePaymentHandler=function(){var a=this.getHtmlElement();a.find('input[name="waivePublicationFee"]').val("1");a.submit()};a.pkp.controllers.tab.issueEntry.form.IssueEntryPublicationMetadataFormHandler.prototype.checkAttachMetadata=function(){this.getHtmlElement().find("#attachPermissions").prop("checked",
!0)}})(jQuery);(function(a){a.fn.pkpHandler=function(c,b){this.each(function(){var d=a(this);b=b||{};a.pkp.classes.Helper.objectFactory(c,[d,b])});return this};a.fn.pkpAjaxHtml=function(c,b){var d=this.first();a.ajax({url:c,dataType:"json",success:function(a){d.find("#loading").hide();!0===a.status?(a.content&&d.html(a.content),b&&b()):(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);
© 2023 Quttera Ltd. All rights reserved.