KUNTUL | JINGKONTOT
JINGKONTOT


Server : Apache/2.4.41 (Ubuntu)
System : Linux journalup 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/js/pkp.min.js
/*
 jQuery Form Plugin
 version: 3.51.0-2014.06.20
 Requires jQuery v1.5 or later
 Copyright (c) 2014 M. Alsup
 Examples and documentation at: http://malsup.com/jquery/form/
 Project repository: https://github.com/malsup/form
 Dual licensed under the MIT and GPL licenses.
 https://github.com/malsup/form#copyright-and-license
*/
(function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a("undefined"!=typeof jQuery?jQuery:window.Zepto)})(function(a){function b(m){var y=m.data;m.isDefaultPrevented()||(m.preventDefault(),a(m.target).ajaxSubmit(y))}function c(m){var y=m.target,C=a(y);if(!C.is("[type=submit],[type=image]")){y=C.closest("[type=submit]");if(0===y.length)return;y=y[0]}var D=this;D.clk=y;"image"==y.type&&(void 0!==m.offsetX?(D.clk_x=m.offsetX,D.clk_y=m.offsetY):"function"==typeof a.fn.offset?(C=C.offset(),
D.clk_x=m.pageX-C.left,D.clk_y=m.pageY-C.top):(D.clk_x=m.pageX-y.offsetLeft,D.clk_y=m.pageY-y.offsetTop));setTimeout(function(){D.clk=D.clk_x=D.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var m="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(m):window.opera&&window.opera.postError&&window.opera.postError(m)}}var e=void 0!==a("<input type='file'/>").get(0).files;var k=void 0!==window.FormData;var t=!!a.fn.prop;a.fn.attr2=function(){if(!t)return this.attr.apply(this,
arguments);var m=this.prop.apply(this,arguments);return m&&m.jquery||"string"===typeof m?m:this.attr.apply(this,arguments)};a.fn.ajaxSubmit=function(m){function y(v){v=a.param(v,m.traditional).split("&");var x=v.length,B=[],H;for(H=0;H<x;H++){v[H]=v[H].replace(/\+/g," ");var G=v[H].split("=");B.push([decodeURIComponent(G[0]),decodeURIComponent(G[1])])}return B}function C(v){for(var x=new FormData,B=0;B<v.length;B++)x.append(v[B].name,v[B].value);if(m.extraData)for(v=y(m.extraData),B=0;B<v.length;B++)v[B]&&
x.append(v[B][0],v[B][1]);m.data=null;B=a.extend(!0,{},a.ajaxSettings,m,{contentType:!1,processData:!1,cache:!1,type:I||"POST"});m.uploadProgress&&(B.xhr=function(){var G=a.ajaxSettings.xhr();G.upload&&G.upload.addEventListener("progress",function(K){var Q=0,T=K.loaded||K.position,U=K.total;K.lengthComputable&&(Q=Math.ceil(T/U*100));m.uploadProgress(K,T,U,Q)},!1);return G});B.data=null;var H=B.beforeSend;B.beforeSend=function(G,K){K.data=m.formData?m.formData:x;H&&H.call(this,G,K)};return a.ajax(B)}
function D(v){function x(w){var F=null;try{w.contentWindow&&(F=w.contentWindow.document)}catch(M){d("cannot get iframe.contentWindow document: "+M)}if(F)return F;try{F=w.contentDocument?w.contentDocument:w.document}catch(M){d("cannot get iframe.contentDocument: "+M),F=w.document}return F}function B(){function w(){try{var Z=x(X).readyState;d("state = "+Z);Z&&"uninitialized"==Z.toLowerCase()&&setTimeout(w,50)}catch(da){d("Server abort: ",da," (",da.name,")"),H(2),U&&clearTimeout(U),U=void 0}}var F=
A.attr2("target"),M=A.attr2("action"),O=A.attr("enctype")||A.attr("encoding")||"multipart/form-data";G.setAttribute("target",ea);I&&!/post/i.test(I)||G.setAttribute("method","POST");M!=E.url&&G.setAttribute("action",E.url);E.skipEncodingOverride||I&&!/post/i.test(I)||A.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});E.timeout&&(U=setTimeout(function(){T=!0;H(1)},E.timeout));var aa=[];try{if(E.extraData)for(var W in E.extraData)E.extraData.hasOwnProperty(W)&&(a.isPlainObject(E.extraData[W])&&
E.extraData[W].hasOwnProperty("name")&&E.extraData[W].hasOwnProperty("value")?aa.push(a('<input type="hidden" name="'+E.extraData[W].name+'">').val(E.extraData[W].value).appendTo(G)[0]):aa.push(a('<input type="hidden" name="'+W+'">').val(E.extraData[W]).appendTo(G)[0]));E.iframeTarget||ba.appendTo("body");X.attachEvent?X.attachEvent("onload",H):X.addEventListener("load",H,!1);setTimeout(w,15);try{G.submit()}catch(Z){document.createElement("form").submit.apply(G)}}finally{G.setAttribute("action",M),
G.setAttribute("enctype",O),F?G.setAttribute("target",F):A.removeAttr("target"),a(aa).remove()}}function H(w){if(!J.aborted&&!n)if(g=x(X),g||(d("cannot access response document"),w=2),1===w&&J)J.abort("timeout"),Y.reject(J,"timeout");else if(2==w&&J)J.abort("server abort"),Y.reject(J,"error","server abort");else if(g&&g.location.href!=E.iframeSrc||T){X.detachEvent?X.detachEvent("onload",H):X.removeEventListener("load",H,!1);w="success";var F;try{if(T)throw"timeout";var M="xml"==E.dataType||g.XMLDocument||
a.isXMLDoc(g);d("isXml="+M);if(!M&&window.opera&&(null===g.body||!g.body.innerHTML)&&--l){d("requeing onLoad callback, DOM not available");setTimeout(H,250);return}var O=g.body?g.body:g.documentElement;J.responseText=O?O.innerHTML:null;J.responseXML=g.XMLDocument?g.XMLDocument:g;M&&(E.dataType="xml");J.getResponseHeader=function(fa){return{"content-type":E.dataType}[fa.toLowerCase()]};O&&(J.status=Number(O.getAttribute("status"))||J.status,J.statusText=O.getAttribute("statusText")||J.statusText);
var aa=(E.dataType||"").toLowerCase(),W=/(json|script|text)/.test(aa);if(W||E.textarea){var Z=g.getElementsByTagName("textarea")[0];if(Z)J.responseText=Z.value,J.status=Number(Z.getAttribute("status"))||J.status,J.statusText=Z.getAttribute("statusText")||J.statusText;else if(W){var da=g.getElementsByTagName("pre")[0],ha=g.getElementsByTagName("body")[0];da?J.responseText=da.textContent?da.textContent:da.innerText:ha&&(J.responseText=ha.textContent?ha.textContent:ha.innerText)}}else"xml"==aa&&!J.responseXML&&
J.responseText&&(J.responseXML=p(J.responseText));try{f=z(J,aa,E)}catch(fa){w="parsererror",J.error=F=fa||w}}catch(fa){d("error caught: ",fa),w="error",J.error=F=fa||w}J.aborted&&(d("upload aborted"),w=null);J.status&&(w=200<=J.status&&300>J.status||304===J.status?"success":"error");"success"===w?(E.success&&E.success.call(E.context,f,"success",J),Y.resolve(J.responseText,"success",J),Q&&a.event.trigger("ajaxSuccess",[J,E])):w&&(void 0===F&&(F=J.statusText),E.error&&E.error.call(E.context,J,w,F),
Y.reject(J,"error",F),Q&&a.event.trigger("ajaxError",[J,E,F]));Q&&a.event.trigger("ajaxComplete",[J,E]);Q&&!--a.active&&a.event.trigger("ajaxStop");E.complete&&E.complete.call(E.context,J,w);n=!0;E.timeout&&clearTimeout(U);setTimeout(function(){E.iframeTarget?ba.attr("src",E.iframeSrc):ba.remove();J.responseXML=null},100)}}var G=A[0],K,Q,T,U,Y=a.Deferred();Y.abort=function(w){J.abort(w)};if(v)for(K=0;K<S.length;K++)v=a(S[K]),t?v.prop("disabled",!1):v.removeAttr("disabled");var E=a.extend(!0,{},a.ajaxSettings,
m);E.context=E.context||E;var ea="jqFormIO"+(new Date).getTime();if(E.iframeTarget){var ba=a(E.iframeTarget);(K=ba.attr2("name"))?ea=K:ba.attr2("name",ea)}else ba=a('<iframe name="'+ea+'" src="'+E.iframeSrc+'" />'),ba.css({position:"absolute",top:"-1000px",left:"-1000px"});var X=ba[0];var J={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(w){var F="timeout"===w?"timeout":
"aborted";d("aborting upload... "+F);this.aborted=1;try{X.contentWindow.document.execCommand&&X.contentWindow.document.execCommand("Stop")}catch(M){}ba.attr("src",E.iframeSrc);J.error=F;E.error&&E.error.call(E.context,J,F,w);Q&&a.event.trigger("ajaxError",[J,E,F]);E.complete&&E.complete.call(E.context,J,F)}};(Q=E.global)&&0===a.active++&&a.event.trigger("ajaxStart");Q&&a.event.trigger("ajaxSend",[J,E]);if(E.beforeSend&&!1===E.beforeSend.call(E.context,J,E))return E.global&&a.active--,Y.reject(),Y;
if(J.aborted)return Y.reject(),Y;(v=G.clk)&&(K=v.name)&&!v.disabled&&(E.extraData=E.extraData||{},E.extraData[K]=v.value,"image"==v.type&&(E.extraData[K+".x"]=G.clk_x,E.extraData[K+".y"]=G.clk_y));v=a("meta[name=csrf-token]").attr("content");(K=a("meta[name=csrf-param]").attr("content"))&&v&&(E.extraData=E.extraData||{},E.extraData[K]=v);E.forceSync?B():setTimeout(B,10);var f,g,l=50,n,p=a.parseXML||function(w,F){window.ActiveXObject?(F=new ActiveXObject("Microsoft.XMLDOM"),F.async="false",F.loadXML(w)):
F=(new DOMParser).parseFromString(w,"text/xml");return F&&F.documentElement&&"parsererror"!=F.documentElement.nodeName?F:null},r=a.parseJSON||function(w){return window.eval("("+w+")")},z=function(w,F,M){var O=w.getResponseHeader("content-type")||"",aa="xml"===F||!F&&0<=O.indexOf("xml");w=aa?w.responseXML:w.responseText;aa&&"parsererror"===w.documentElement.nodeName&&a.error&&a.error("parsererror");M&&M.dataFilter&&(w=M.dataFilter(w,F));"string"===typeof w&&("json"===F||!F&&0<=O.indexOf("json")?w=
r(w):("script"===F||!F&&0<=O.indexOf("javascript"))&&a.globalEval(w));return w};return Y}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var A=this;"function"==typeof m?m={success:m}:void 0===m&&(m={});var I=m.type||this.attr2("method");var L=m.url||this.attr2("action");(L=(L="string"===typeof L?a.trim(L):"")||window.location.href||"")&&(L=(L.match(/^([^#]+)/)||[])[1]);m=a.extend(!0,{url:L,success:a.ajaxSettings.success,type:I||a.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||
"")?"javascript:false":"about:blank"},m);L={};this.trigger("form-pre-serialize",[this,m,L]);if(L.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(m.beforeSerialize&&!1===m.beforeSerialize(this,m))return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var P=m.traditional;void 0===P&&(P=a.ajaxSettings.traditional);var S=[],N=this.formToArray(m.semantic,S);if(m.data){m.extraData=m.data;var h=a.param(m.data,P)}if(m.beforeSubmit&&!1===m.beforeSubmit(N,
this,m))return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[N,this,m,L]);if(L.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;L=a.param(N,P);h&&(L=L?L+"&"+h:h);"GET"==m.type.toUpperCase()?(m.url+=(0<=m.url.indexOf("?")?"&":"?")+L,m.data=null):m.data=L;var V=[];m.resetForm&&V.push(function(){A.resetForm()});m.clearForm&&V.push(function(){A.clearForm(m.includeHidden)});if(!m.dataType&&m.target){var R=m.success||
function(){};V.push(function(v){var x=m.replaceTarget?"replaceWith":"html";a(m.target)[x](v).each(R,arguments)})}else m.success&&V.push(m.success);m.success=function(v,x,B){for(var H=m.context||this,G=0,K=V.length;G<K;G++)V[G].apply(H,[v,x,B||A,A])};if(m.error){var ca=m.error;m.error=function(v,x,B){ca.apply(m.context||this,[v,x,B,A])}}if(m.complete){var q=m.complete;m.complete=function(v,x){q.apply(m.context||this,[v,x,A])}}h=0<a("input[type=file]:enabled",this).filter(function(){return""!==a(this).val()}).length;
L="multipart/form-data"==A.attr("enctype")||"multipart/form-data"==A.attr("encoding");P=e&&k;d("fileAPI :"+P);var u;!1!==m.iframe&&(m.iframe||(h||L)&&!P)?m.closeKeepAlive?a.get(m.closeKeepAlive,function(){u=D(N)}):u=D(N):u=(h||L)&&P?C(N):a.ajax(m);A.removeData("jqxhr").data("jqxhr",u);for(h=0;h<S.length;h++)S[h]=null;this.trigger("form-submit-notify",[this,m]);return this};a.fn.ajaxForm=function(m){m=m||{};m.delegation=m.delegation&&a.isFunction(a.fn.on);if(!m.delegation&&0===this.length){var y=this.selector,
C=this.context;if(!a.isReady&&y)return d("DOM not ready, queuing ajaxForm"),a(function(){a(y,C).ajaxForm(m)}),this;d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));return this}return m.delegation?(a(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,c).on("submit.form-plugin",this.selector,m,b).on("click.form-plugin",this.selector,m,c),this):this.ajaxFormUnbind().bind("submit.form-plugin",m,b).bind("click.form-plugin",m,c)};
a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(m,y){var C=[];if(0===this.length)return C;var D=this[0],A=this.attr("id"),I=m?D.getElementsByTagName("*"):D.elements;I&&!/MSIE [678]/.test(navigator.userAgent)&&(I=a(I).get());A&&(A=a(':input[form="'+A+'"]').get(),A.length&&(I=(I||[]).concat(A)));if(!I||!I.length)return C;var L,P;var S=0;for(P=I.length;S<P;S++){var N=I[S];if((A=N.name)&&!N.disabled)if(m&&D.clk&&"image"==N.type)D.clk==
N&&(C.push({name:A,value:a(N).val(),type:N.type}),C.push({name:A+".x",value:D.clk_x},{name:A+".y",value:D.clk_y}));else if((L=a.fieldValue(N,!0))&&L.constructor==Array){y&&y.push(N);var h=0;for(N=L.length;h<N;h++)C.push({name:A,value:L[h]})}else if(e&&"file"==N.type)if(y&&y.push(N),L=N.files,L.length)for(h=0;h<L.length;h++)C.push({name:A,value:L[h],type:N.type});else C.push({name:A,value:"",type:N.type});else null!==L&&"undefined"!=typeof L&&(y&&y.push(N),C.push({name:A,value:L,type:N.type,required:N.required}))}!m&&
D.clk&&(m=a(D.clk),y=m[0],(A=y.name)&&!y.disabled&&"image"==y.type&&(C.push({name:A,value:m.val()}),C.push({name:A+".x",value:D.clk_x},{name:A+".y",value:D.clk_y})));return C};a.fn.formSerialize=function(m){return a.param(this.formToArray(m))};a.fn.fieldSerialize=function(m){var y=[];this.each(function(){var C=this.name;if(C){var D=a.fieldValue(this,m);if(D&&D.constructor==Array)for(var A=0,I=D.length;A<I;A++)y.push({name:C,value:D[A]});else null!==D&&"undefined"!=typeof D&&y.push({name:this.name,
value:D})}});return a.param(y)};a.fn.fieldValue=function(m){for(var y=[],C=0,D=this.length;C<D;C++){var A=a.fieldValue(this[C],m);null===A||"undefined"==typeof A||A.constructor==Array&&!A.length||(A.constructor==Array?a.merge(y,A):y.push(A))}return y};a.fieldValue=function(m,y){var C=m.name,D=m.type,A=m.tagName.toLowerCase();void 0===y&&(y=!0);if(y&&(!C||m.disabled||"reset"==D||"button"==D||("checkbox"==D||"radio"==D)&&!m.checked||("submit"==D||"image"==D)&&m.form&&m.form.clk!=m||"select"==A&&-1==
m.selectedIndex))return null;if("select"==A){A=m.selectedIndex;if(0>A)return null;y=[];m=m.options;C=(D="select-one"==D)?A+1:m.length;for(A=D?A:0;A<C;A++){var I=m[A];if(I.selected){var L=I.value;L||(L=I.attributes&&I.attributes.value&&!I.attributes.value.specified?I.text:I.value);if(D)return L;y.push(L)}}return y}return a(m).val()};a.fn.clearForm=function(m){return this.each(function(){a("input,select,textarea",this).clearFields(m)})};a.fn.clearFields=a.fn.clearInputs=function(m){var y=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;
return this.each(function(){var C=this.type,D=this.tagName.toLowerCase();y.test(C)||"textarea"==D?this.value="":"checkbox"==C||"radio"==C?this.checked=!1:"select"==D?this.selectedIndex=-1:"file"==C?/MSIE/.test(navigator.userAgent)?a(this).replaceWith(a(this).clone(!0)):a(this).val(""):m&&(!0===m&&/hidden/.test(C)||"string"==typeof m&&a(this).is(m))&&(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(m){void 0===m&&(m=!0);return this.each(function(){this.disabled=!m})};a.fn.selected=function(m){void 0===m&&(m=!0);return this.each(function(){var y=this.type;"checkbox"==y||"radio"==y?this.checked=m:"option"==this.tagName.toLowerCase()&&(y=a(this).parent("select"),m&&y[0]&&"select-one"==y[0].type&&y.find("option").selected(!1),this.selected=m)})};a.fn.ajaxSubmit.debug=!1});(function(a){a.widget("ui.tagit",{options:{allowDuplicates:!1,caseSensitive:!0,fieldName:"tags",placeholderText:null,readOnly:!1,removeConfirmation:!1,tagLimit:null,availableTags:[],autocomplete:{},showAutocompleteOnFocus:!1,allowSpaces:!1,singleField:!1,singleFieldDelimiter:",",singleFieldNode:null,animate:!0,tabIndex:null,beforeTagAdded:null,afterTagAdded:null,beforeTagRemoved:null,afterTagRemoved:null,onTagClicked:null,onTagLimitExceeded:null,onTagAdded:null,onTagRemoved:null,tagSource:null},_create:function(){var b=
this;this.element.is("input")?(this.tagList=a("<ul></ul>").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.addClass("tagit-hidden-field")):this.tagList=this.element.find("ul, ol").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(k,t){var m=k.term.toLowerCase();k=a.grep(this.options.availableTags,function(y){return 0===y.toLowerCase().indexOf(m)});this.options.allowDuplicates||(k=this._subtractArray(k,this.assignedTags()));t(k)});this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(k,t){b._showAutocomplete()}),"undefined"===typeof this.options.autocomplete.minLength&&(this.options.autocomplete.minLength=
0));a.isFunction(this.options.autocomplete.source)&&(this.options.autocomplete.source=a.proxy(this.options.autocomplete.source,this));a.isFunction(this.options.tagSource)&&(this.options.tagSource=a.proxy(this.options.tagSource,this));this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(a('<li class="tagit-new"></li>').append(this.tagInput)).click(function(k){var t=a(k.target);t.hasClass("tagit-label")?(t=t.closest(".tagit-choice"),t.hasClass("removed")||b._trigger("onTagClicked",
k,{tag:t,tagLabel:b.tagLabel(t)})):b.tagInput.focus()});var c=!1;if(this.options.singleField)if(this.options.singleFieldNode){var d=a(this.options.singleFieldNode),e=d.val().split(this.options.singleFieldDelimiter);d.val("");a.each(e,function(k,t){b.createTag(t,null,!0);c=!0})}else this.options.singleFieldNode=a('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />'),this.tagList.after(this.options.singleFieldNode);c||this.tagList.children("li").each(function(){a(this).hasClass("tagit-new")||
(b.createTag(a(this).text(),a(this).attr("class"),!0),a(this).remove())});this.tagInput.keydown(function(k){if(k.which==a.ui.keyCode.BACKSPACE&&""===b.tagInput.val()){var t=b._lastTag();!b.options.removeConfirmation||t.hasClass("remove")?b.removeTag(t):b.options.removeConfirmation&&t.addClass("remove ui-state-highlight")}else b.options.removeConfirmation&&b._lastTag().removeClass("remove ui-state-highlight");if(","===k.key&&!1===k.shiftKey||k.which===a.ui.keyCode.ENTER||k.which==a.ui.keyCode.TAB&&
""!==b.tagInput.val()||k.which==a.ui.keyCode.SPACE&&!0!==b.options.allowSpaces&&('"'!=a.trim(b.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==a.trim(b.tagInput.val()).charAt(0)&&'"'==a.trim(b.tagInput.val()).charAt(a.trim(b.tagInput.val()).length-1)&&0!==a.trim(b.tagInput.val()).length-1))k.which===a.ui.keyCode.ENTER&&""===b.tagInput.val()||k.preventDefault(),b.options.autocomplete.autoFocus&&b.tagInput.data("autocomplete-open")||(b.tagInput.autocomplete("close"),b.createTag(b._cleanedInput()))}).blur(function(k){b.tagInput.data("autocomplete-open")||
b.createTag(b._cleanedInput())});if(this.options.availableTags||this.options.tagSource||this.options.autocomplete.source)d={select:function(k,t){b.createTag(t.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(k,t){b.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose.tagit",function(k,t){b.tagInput.data("autocomplete-open",!1)}),this.tagInput.autocomplete("widget").addClass("tagit-autocomplete")},
destroy:function(){a.Widget.prototype.destroy.call(this);this.element.unbind(".tagit");this.tagList.unbind(".tagit");this.tagInput.removeData("autocomplete-open");this.tagList.removeClass("tagit ui-widget ui-widget-content ui-corner-all tagit-hidden-field");this.element.is("input")?(this.element.removeClass("tagit-hidden-field"),this.tagList.remove()):(this.element.children("li").each(function(){a(this).hasClass("tagit-new")?a(this).remove():(a(this).removeClass("tagit-choice ui-widget-content ui-state-default ui-state-highlight ui-corner-all remove tagit-choice-editable tagit-choice-read-only"),
a(this).text(a(this).children(".tagit-label").text()))}),this.singleFieldNode&&this.singleFieldNode.remove());return this},_cleanedInput:function(){return a.trim(this.tagInput.val().replace(/^"(.*)"$/,"$1"))},_lastTag:function(){return this.tagList.find(".tagit-choice:last:not(.removed)")},_tags:function(){return this.tagList.find(".tagit-choice:not(.removed)")},assignedTags:function(){var b=this,c=[];this.options.singleField?(c=a(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter),
""===c[0]&&(c=[])):this._tags().each(function(){c.push(b.tagLabel(this))});return c},_updateSingleTagsField:function(b){a(this.options.singleFieldNode).val(b.join(this.options.singleFieldDelimiter)).trigger("change")},_subtractArray:function(b,c){for(var d=[],e=0;e<b.length;e++)-1==a.inArray(b[e],c)&&d.push(b[e]);return d},tagLabel:function(b){return this.options.singleField?a(b).find(".tagit-label:first").text():a(b).find("input:first").val()},_showAutocomplete:function(){this.tagInput.autocomplete("search",
"")},_findTagByLabel:function(b){var c=this,d=null;this._tags().each(function(e){if(c._formatStr(b)==c._formatStr(c.tagLabel(this)))return d=a(this),!1});return d},_isNew:function(b){return!this._findTagByLabel(b)},_formatStr:function(b){return this.options.caseSensitive?b:a.trim(b.toLowerCase())},_effectExists:function(b){return!(!a.effects||!(a.effects[b]||a.effects.effect&&a.effects.effect[b]))},createTag:function(b,c,d){var e=this;b=a.trim(b);this.options.preprocessTag&&(b=this.options.preprocessTag(b));
if(""===b)return!1;if(!this.options.allowDuplicates&&!this._isNew(b))return b=this._findTagByLabel(b),!1!==this._trigger("onTagExists",null,{existingTag:b,duringInitialization:d})&&this._effectExists("highlight")&&b.effect("highlight"),!1;if(this.options.tagLimit&&this._tags().length>=this.options.tagLimit)return this._trigger("onTagLimitExceeded",null,{duringInitialization:d}),!1;var k=a(this.options.onTagClicked?'<a class="tagit-label"></a>':'<span class="tagit-label"></span>').text(b),t=a("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(c).append(k);
this.options.readOnly?t.addClass("tagit-choice-read-only"):(t.addClass("tagit-choice-editable"),c=a("<span></span>").addClass("ui-icon ui-icon-close"),c=a('<a><span class="text-icon">\u00d7</span></a>').addClass("tagit-close").append(c).click(function(m){e.removeTag(t)}),t.append(c));this.options.singleField||(k=k.html(),t.append('<input type="hidden" value="'+k+'" name="'+this.options.fieldName+'" class="tagit-hidden-field" />'));!1!==this._trigger("beforeTagAdded",null,{tag:t,tagLabel:this.tagLabel(t),
duringInitialization:d})&&(this.options.singleField&&(k=this.assignedTags(),k.push(b),this._updateSingleTagsField(k)),this._trigger("onTagAdded",null,t),this.tagInput.val(""),this.tagInput.parent().before(t),this._trigger("afterTagAdded",null,{tag:t,tagLabel:this.tagLabel(t),duringInitialization:d}),this.options.showAutocompleteOnFocus&&!d&&setTimeout(function(){e._showAutocomplete()},0))},removeTag:function(b,c){c="undefined"===typeof c?this.options.animate:c;b=a(b);this._trigger("onTagRemoved",
null,b);if(!1!==this._trigger("beforeTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})){if(this.options.singleField){var d=this.assignedTags(),e=this.tagLabel(b);d=a.grep(d,function(t){return t!=e});this._updateSingleTagsField(d)}if(c){b.addClass("removed");c=this._effectExists("blind")?["blind",{direction:"horizontal"},"fast"]:["fast"];var k=this;c.push(function(){b.remove();k._trigger("afterTagRemoved",null,{tag:b,tagLabel:k.tagLabel(b)})});b.fadeOut("fast").hide.apply(b,c).dequeue()}else b.remove(),
this._trigger("afterTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})}},removeTagByLabel:function(b,c){var d=this._findTagByLabel(b);if(!d)throw"No such tag exists with the name '"+b+"'";this.removeTag(d,c)},removeAll:function(){var b=this;this._tags().each(function(c,d){b.removeTag(d,!1)})}})})(jQuery);jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var e=c.call(this),k=e.parentNode,t=k.insertBefore(document.createTextNode(""),e.nextSibling);return function(){if(k===this)throw Error("You can't sort elements if any one is a descendant of another.");k.insertBefore(this,t);k.removeChild(t)}});return a.call(this,b).each(function(e){d[e].call(c.call(this))})}}();/*
 jQuery Cookie Plugin v1.4.0
 https://github.com/carhartl/jquery-cookie

 Copyright 2013 Klaus Hartl
 Released under the MIT license
*/
(function(a){"function"===typeof define&&define.amd?define(["jquery"],a):a(jQuery)})(function(a){function b(k){k=e.json?JSON.stringify(k):String(k);return e.raw?k:encodeURIComponent(k)}function c(k,t){if(e.raw)var m=k;else a:{0===k.indexOf('"')&&(k=k.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{k=decodeURIComponent(k.replace(d," "))}catch(y){m=void 0;break a}try{m=e.json?JSON.parse(k):k;break a}catch(y){}m=void 0}return a.isFunction(t)?t(m):m}var d=/\+/g,e=a.cookie=function(k,t,m){if(void 0!==
t&&!a.isFunction(t)){m=a.extend({},e.defaults,m);if("number"===typeof m.expires){var y=m.expires,C=m.expires=new Date;C.setDate(C.getDate()+y)}return document.cookie=[e.raw?k:encodeURIComponent(k),"=",b(t),m.expires?"; expires="+m.expires.toUTCString():"",m.path?"; path="+m.path:"",m.domain?"; domain="+m.domain:"",m.secure?"; secure":""].join("")}m=k?void 0:{};y=document.cookie?document.cookie.split("; "):[];C=0;for(var D=y.length;C<D;C++){var A=y[C].split("=");var I=A.shift();I=e.raw?I:decodeURIComponent(I);
A=A.join("=");if(k&&k===I){m=c(A,t);break}k||void 0===(A=c(A))||(m[I]=A)}return m};e.defaults={};a.removeCookie=function(k,t){return void 0!==a.cookie(k)?(a.cookie(k,"",a.extend({},t,{expires:-1})),!0):!1}});(function(a){a.fn.equalizeElementHeights=function(){var b=this.map(function(c,d){return a(d).height()}).get();return this.height(Math.max.apply(this,b))}})(jQuery);jQuery&&function(a){a.extend(a.fn,{selectBox:function(b,c){var d,e="",k=navigator.platform.match(/mac/i),t=function(q,u){if(navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i)||"select"!==q.tagName.toLowerCase())return!1;q=a(q);if(q.data("selectBox-control"))return!1;var v=a('<a class="selectBox" />'),x=q.attr("multiple")||1<parseInt(q.attr("size"));u=u||{};v.width(q.outerWidth()).addClass(q.attr("class")).attr("title",q.attr("title")||"").attr("tabindex",parseInt(q.attr("tabindex"))).css("display",
"inline-block").bind("focus.selectBox",function(){this!==document.activeElement&&document.body!==document.activeElement&&a(document.activeElement).blur();v.hasClass("selectBox-active")||(v.addClass("selectBox-active"),q.trigger("focus"))}).bind("blur.selectBox",function(){v.hasClass("selectBox-active")&&(v.removeClass("selectBox-active"),q.trigger("blur"))});a(window).data("selectBox-bindings")||a(window).data("selectBox-bindings",!0).bind("scroll.selectBox",I).bind("resize.selectBox",I);q.attr("disabled")&&
v.addClass("selectBox-disabled");q.bind("click.selectBox",function(K){v.focus();K.preventDefault()});if(x){var B=m(q,"inline");v.append(B).data("selectBox-options",B).addClass("selectBox-inline selectBox-menuShowing").bind("keydown.selectBox",function(K){h(q,K)}).bind("keypress.selectBox",function(K){V(q,K)}).bind("mousedown.selectBox",function(K){a(K.target).is("A.selectBox-inline")&&K.preventDefault();v.hasClass("selectBox-focus")||v.focus()}).insertAfter(q);if(!q[0].style.height){x=q.attr("size")?
parseInt(q.attr("size")):5;var H=v.clone().removeAttr("id").css({position:"absolute",top:"-9999em"}).show().appendTo("body");H.find(".selectBox-options").html("<li><a>\u00a0</a></li>");var G=parseInt(H.find(".selectBox-options A:first").html("&nbsp;").outerHeight());H.remove();v.height(G*x)}}else x=a('<span class="selectBox-label" />'),H=a('<span class="selectBox-arrow" />'),x.attr("class",y(q)).text(C(q)),B=m(q,"dropdown"),B.appendTo("BODY"),v.data("selectBox-options",B).addClass("selectBox-dropdown").append(x).append(H).bind("mousedown.selectBox",
function(K){v.hasClass("selectBox-menuShowing")?I():(K.stopPropagation(),B.data("selectBox-down-at-x",K.screenX).data("selectBox-down-at-y",K.screenY),A(q))}).bind("keydown.selectBox",function(K){h(q,K)}).bind("keypress.selectBox",function(K){V(q,K)}).bind("open.selectBox",function(K,Q){Q&&!0===Q._selectBox||A(q)}).bind("close.selectBox",function(K,Q){Q&&!0===Q._selectBox||I()}).insertAfter(q),H=v.width()-H.outerWidth()-parseInt(x.css("paddingLeft"))-parseInt(x.css("paddingLeft")),x.width(H);ca(v);
q.addClass("selectBox").data("selectBox-control",v).data("selectBox-settings",u).hide()},m=function(q,u){var v=function(H,G){H.children("OPTION, OPTGROUP").each(function(){if(a(this).is("OPTION"))if(0<a(this).length){var K=a(this),Q=G,T=a("<li />"),U=a("<a />");T.addClass(K.attr("class"));T.data(K.data());U.attr("rel",K.val()).text(K.text());T.append(U);K.attr("disabled")&&T.addClass("selectBox-disabled");K.attr("selected")&&T.addClass("selectBox-selected");Q.append(T)}else G.append("<li>\u00a0</li>");
else K=a('<li class="selectBox-optgroup" />'),K.text(a(this).attr("label")),G.append(K),G=v(a(this),G)});return G};switch(u){case "inline":var x=a('<ul class="selectBox-options" />');x=v(q,x);x.find("A").bind("mouseover.selectBox",function(H){P(q,a(this).parent())}).bind("mouseout.selectBox",function(H){S(q,a(this).parent())}).bind("mousedown.selectBox",function(H){H.preventDefault();q.selectBox("control").hasClass("selectBox-active")||q.selectBox("control").focus()}).bind("mouseup.selectBox",function(H){I();
L(q,a(this).parent(),H)});ca(x);return x;case "dropdown":x=a('<ul class="selectBox-dropdown-menu selectBox-options" />');x=v(q,x);x.data("selectBox-select",q).css("display","none").appendTo("BODY").find("A").bind("mousedown.selectBox",function(H){H.preventDefault();H.screenX===x.data("selectBox-down-at-x")&&H.screenY===x.data("selectBox-down-at-y")&&(x.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),I())}).bind("mouseup.selectBox",function(H){if(H.screenX!==x.data("selectBox-down-at-x")||
H.screenY!==x.data("selectBox-down-at-y"))x.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),L(q,a(this).parent()),I()}).bind("mouseover.selectBox",function(H){P(q,a(this).parent())}).bind("mouseout.selectBox",function(H){S(q,a(this).parent())});u=q.attr("class")||"";if(""!==u){u=u.split(" ");for(var B in u)x.addClass(u[B]+"-selectBox-dropdown-menu")}ca(x);return x}},y=function(q){return("selectBox-label "+(a(q).find("OPTION:selected").attr("class")||"")).replace(/\s+$/,"")},C=
function(q){return a(q).find("OPTION:selected").text()||"\u00a0"},D=function(q){q=a(q);var u=q.data("selectBox-control");u&&u.find(".selectBox-label").attr("class",y(q)).text(C(q))},A=function(q){q=a(q);var u=q.data("selectBox-control"),v=q.data("selectBox-settings"),x=u.data("selectBox-options");if(u.hasClass("selectBox-disabled"))return!1;I();var B=isNaN(u.css("borderBottomWidth"))?0:parseInt(u.css("borderBottomWidth"));x.width(u.innerWidth()).css({top:u.offset().top+u.outerHeight()-B,left:u.offset().left});
if(q.triggerHandler("beforeopen"))return!1;B=function(){q.triggerHandler("open",{_selectBox:!0})};switch(v.menuTransition){case "fade":x.fadeIn(v.menuSpeed,B);break;case "slide":x.slideDown(v.menuSpeed,B);break;default:x.show(v.menuSpeed,B)}v.menuSpeed||B();v=x.find(".selectBox-selected:first");N(q,v,!0);P(q,v);u.addClass("selectBox-menuShowing");a(document).bind("mousedown.selectBox",function(H){a(H.target).parents().andSelf().hasClass("selectBox-options")||I()})},I=function(){0!==a(".selectBox-dropdown-menu:visible").length&&
(a(document).unbind("mousedown.selectBox"),a(".selectBox-dropdown-menu").each(function(){var q=a(this),u=q.data("selectBox-select"),v=u.data("selectBox-control"),x=u.data("selectBox-settings");if(u.triggerHandler("beforeclose"))return!1;var B=function(){u.triggerHandler("close",{_selectBox:!0})};if(x){switch(x.menuTransition){case "fade":q.fadeOut(x.menuSpeed,B);break;case "slide":q.slideUp(x.menuSpeed,B);break;default:q.hide(x.menuSpeed,B)}x.menuSpeed||B();v.removeClass("selectBox-menuShowing")}else a(this).hide(),
a(this).triggerHandler("close",{_selectBox:!0}),a(this).removeClass("selectBox-menuShowing")}))},L=function(q,u,v){q=a(q);u=a(u);var x=q.data("selectBox-control");q.data("selectBox-settings");if(x.hasClass("selectBox-disabled")||0===u.length||u.hasClass("selectBox-disabled"))return!1;q.attr("multiple")?v.shiftKey&&x.data("selectBox-last-selected")?(u.toggleClass("selectBox-selected"),v=u.index()>x.data("selectBox-last-selected").index()?u.siblings().slice(x.data("selectBox-last-selected").index(),
u.index()):u.siblings().slice(u.index(),x.data("selectBox-last-selected").index()),v=v.not(".selectBox-optgroup, .selectBox-disabled"),u.hasClass("selectBox-selected")?v.addClass("selectBox-selected"):v.removeClass("selectBox-selected")):k&&v.metaKey||!k&&v.ctrlKey?u.toggleClass("selectBox-selected"):(u.siblings().removeClass("selectBox-selected"),u.addClass("selectBox-selected")):(u.siblings().removeClass("selectBox-selected"),u.addClass("selectBox-selected"));x.hasClass("selectBox-dropdown")&&x.find(".selectBox-label").text(u.text());
var B=0,H=[];q.attr("multiple")?x.find(".selectBox-selected A").each(function(){H[B++]=a(this).attr("rel")}):H=u.find("A").attr("rel");x.data("selectBox-last-selected",u);q.val()!==H&&(q.val(H),D(q),q.trigger("change"));return!0},P=function(q,u){q=a(q);u=a(u);q.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover");u.addClass("selectBox-hover")},S=function(q,u){q=a(q);a(u);q.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover")},
N=function(q,u,v){if(u&&0!==u.length){q=a(q);q=q.data("selectBox-control");var x=q.data("selectBox-options");q=q.hasClass("selectBox-dropdown")?x:x.parent();x=parseInt(u.offset().top-q.position().top);var B=parseInt(x+u.outerHeight());v?q.scrollTop(u.offset().top-q.offset().top+q.scrollTop()-q.height()/2):(0>x&&q.scrollTop(u.offset().top-q.offset().top+q.scrollTop()),B>q.height()&&q.scrollTop(u.offset().top+u.outerHeight()-q.offset().top+q.scrollTop()-q.height()))}},h=function(q,u){q=a(q);var v=q.data("selectBox-control"),
x=v.data("selectBox-options"),B=q.data("selectBox-settings"),H;if(!v.hasClass("selectBox-disabled"))switch(u.keyCode){case 8:u.preventDefault();e="";break;case 9:case 27:I();S(q);break;case 13:v.hasClass("selectBox-menuShowing")?(L(q,x.find("LI.selectBox-hover:first"),u),v.hasClass("selectBox-dropdown")&&I()):A(q);break;case 38:case 37:u.preventDefault();if(v.hasClass("selectBox-menuShowing")){var G=x.find(".selectBox-hover").prev("LI");v=x.find("LI:not(.selectBox-optgroup)").length;for(H=0;(0===
G.length||G.hasClass("selectBox-disabled")||G.hasClass("selectBox-optgroup"))&&!(G=G.prev("LI"),0===G.length&&(G=B.loopOptions?x.find("LI:last"):x.find("LI:first")),++H>=v););P(q,G);L(q,G,u);N(q,G)}else A(q);break;case 40:case 39:if(u.preventDefault(),v.hasClass("selectBox-menuShowing")){G=x.find(".selectBox-hover").next("LI");v=x.find("LI:not(.selectBox-optgroup)").length;for(H=0;(0===G.length||G.hasClass("selectBox-disabled")||G.hasClass("selectBox-optgroup"))&&!(G=G.next("LI"),0===G.length&&(G=
B.loopOptions?x.find("LI:first"):x.find("LI:last")),++H>=v););P(q,G);L(q,G,u);N(q,G)}else A(q)}},V=function(q,u){q=a(q);var v=q.data("selectBox-control"),x=v.data("selectBox-options");if(!v.hasClass("selectBox-disabled"))switch(u.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:v.hasClass("selectBox-menuShowing")||A(q),u.preventDefault(),clearTimeout(d),e+=String.fromCharCode(u.charCode||u.keyCode),x.find("A").each(function(){if(a(this).text().substr(0,e.length).toLowerCase()===
e.toLowerCase())return P(q,a(this).parent()),N(q,a(this).parent()),!1}),d=setTimeout(function(){e=""},1E3)}},R=function(q,u){q=a(q);q.val(u);u=q.val();null===u&&(u=q.children().first().val(),q.val(u));var v=q.data("selectBox-control");if(v){var x=q.data("selectBox-settings");v=v.data("selectBox-options");D(q);v.find(".selectBox-selected").removeClass("selectBox-selected");v.find("A").each(function(){if("object"===typeof u)for(var B=0;B<u.length;B++)a(this).attr("rel")==u[B]&&a(this).parent().addClass("selectBox-selected");
else a(this).attr("rel")==u&&a(this).parent().addClass("selectBox-selected")});x.change&&x.change.call(q)}},ca=function(q){a(q).css("MozUserSelect","none").bind("selectstart",function(u){u.preventDefault()})};switch(b){case "control":return a(this).data("selectBox-control");case "settings":if(!c)return a(this).data("selectBox-settings");a(this).each(function(){a(this).data("selectBox-settings",a.extend(!0,a(this).data("selectBox-settings"),c))});break;case "options":if(void 0===c)return a(this).data("selectBox-control").data("selectBox-options");
a(this).each(function(){var q=a(this);var u=q.data("selectBox-control");q.data("selectBox-settings");switch(typeof c){case "string":q.html(c);break;case "object":for(B in q.html(""),c)if(null!==c[B])if("object"===typeof c[B]){var v=a('<optgroup label="'+B+'" />');for(x in c[B])v.append('<option value="'+x+'">'+c[B][x]+"</option>");q.append(v)}else v=a('<option value="'+B+'">'+c[B]+"</option>"),q.append(v)}if(u){u.data("selectBox-options").remove();var x=u.hasClass("selectBox-dropdown")?"dropdown":
"inline";var B=m(q,x);u.data("selectBox-options",B);switch(x){case "inline":u.append(B);break;case "dropdown":D(q),a("BODY").append(B)}}});break;case "value":if(void 0===c)return a(this).val();a(this).each(function(){R(this,c)});break;case "refresh":a(this).each(function(){var q=a(this);q.selectBox("options",q.html())});break;case "enable":a(this).each(function(){var q=a(this);q.attr("disabled",!1);(q=q.data("selectBox-control"))&&q.removeClass("selectBox-disabled")});break;case "disable":a(this).each(function(){var q=
a(this);q.attr("disabled",!0);(q=q.data("selectBox-control"))&&q.addClass("selectBox-disabled")});break;case "destroy":a(this).each(function(){var q=a(this);var u=q.data("selectBox-control");u&&(u.data("selectBox-options").remove(),u.remove(),q.removeClass("selectBox").removeData("selectBox-control").data("selectBox-control",null).removeData("selectBox-settings").data("selectBox-settings",null).show())});break;default:a(this).each(function(){t(this,b)})}return a(this)}})}(jQuery);(function(){function a(f){return function(g,l,n,p){l=V(l,p,4);var r=!B(g)&&h.keys(g),z=(r||g).length,w=0<f?0:z-1;3>arguments.length&&(n=g[r?r[w]:w],w+=f);for(var F=l,M=n;0<=w&&w<z;w+=f){var O=r?r[w]:w;M=F(M,g[O],O,g)}return M}}function b(f){return function(g,l,n){l=R(l,n);n=x(g);for(var p=0<f?0:n-1;0<=p&&p<n;p+=f)if(l(g[p],p,g))return p;return-1}}function c(f,g,l){return function(n,p,r){var z=0,w=x(n);if("number"==typeof r)0<f?z=0<=r?r:Math.max(r+w,z):w=0<=r?Math.min(r+1,w):r+w+1;else if(l&&r&&w)return r=
l(n,p),n[r]===p?r:-1;if(p!==p)return r=g(C.call(n,z,w),h.isNaN),0<=r?r+z:-1;for(r=0<f?z:w-1;0<=r&&r<w;r+=f)if(n[r]===p)return r;return-1}}function d(f,g){var l=T.length,n=f.constructor;n=h.isFunction(n)&&n.prototype||m;var p="constructor";for(h.has(f,p)&&!h.contains(g,p)&&g.push(p);l--;)p=T[l],p in f&&f[p]!==n[p]&&!h.contains(g,p)&&g.push(p)}var e=this,k=e._,t=Array.prototype,m=Object.prototype,y=t.push,C=t.slice,D=m.toString,A=m.hasOwnProperty,I=Array.isArray,L=Object.keys,P=Function.prototype.bind,
S=Object.create,N=function(){},h=function(f){if(f instanceof h)return f;if(!(this instanceof h))return new h(f);this._wrapped=f};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=h),exports._=h):e._=h;h.VERSION="1.8.3";var V=function(f,g,l){if(void 0===g)return f;switch(null==l?3:l){case 1:return function(n){return f.call(g,n)};case 2:return function(n,p){return f.call(g,n,p)};case 3:return function(n,p,r){return f.call(g,n,p,r)};case 4:return function(n,
p,r,z){return f.call(g,n,p,r,z)}}return function(){return f.apply(g,arguments)}},R=function(f,g,l){return null==f?h.identity:h.isFunction(f)?V(f,g,l):h.isObject(f)?h.matcher(f):h.property(f)};h.iteratee=function(f,g){return R(f,g,Infinity)};var ca=function(f,g){return function(l){var n=arguments.length;if(2>n||null==l)return l;for(var p=1;p<n;p++)for(var r=arguments[p],z=f(r),w=z.length,F=0;F<w;F++){var M=z[F];g&&void 0!==l[M]||(l[M]=r[M])}return l}},q=function(f){if(!h.isObject(f))return{};if(S)return S(f);
N.prototype=f;f=new N;N.prototype=null;return f},u=function(f){return function(g){return null==g?void 0:g[f]}},v=Math.pow(2,53)-1,x=u("length"),B=function(f){f=x(f);return"number"==typeof f&&0<=f&&f<=v};h.each=h.forEach=function(f,g,l){g=V(g,l);var n;if(B(f))for(l=0,n=f.length;l<n;l++)g(f[l],l,f);else{var p=h.keys(f);l=0;for(n=p.length;l<n;l++)g(f[p[l]],p[l],f)}return f};h.map=h.collect=function(f,g,l){g=R(g,l);l=!B(f)&&h.keys(f);for(var n=(l||f).length,p=Array(n),r=0;r<n;r++){var z=l?l[r]:r;p[r]=
g(f[z],z,f)}return p};h.reduce=h.foldl=h.inject=a(1);h.reduceRight=h.foldr=a(-1);h.find=h.detect=function(f,g,l){g=B(f)?h.findIndex(f,g,l):h.findKey(f,g,l);if(void 0!==g&&-1!==g)return f[g]};h.filter=h.select=function(f,g,l){var n=[];g=R(g,l);h.each(f,function(p,r,z){g(p,r,z)&&n.push(p)});return n};h.reject=function(f,g,l){return h.filter(f,h.negate(R(g)),l)};h.every=h.all=function(f,g,l){g=R(g,l);l=!B(f)&&h.keys(f);for(var n=(l||f).length,p=0;p<n;p++){var r=l?l[p]:p;if(!g(f[r],r,f))return!1}return!0};
h.some=h.any=function(f,g,l){g=R(g,l);l=!B(f)&&h.keys(f);for(var n=(l||f).length,p=0;p<n;p++){var r=l?l[p]:p;if(g(f[r],r,f))return!0}return!1};h.contains=h.includes=h.include=function(f,g,l,n){B(f)||(f=h.values(f));if("number"!=typeof l||n)l=0;return 0<=h.indexOf(f,g,l)};h.invoke=function(f,g){var l=C.call(arguments,2),n=h.isFunction(g);return h.map(f,function(p){var r=n?g:p[g];return null==r?r:r.apply(p,l)})};h.pluck=function(f,g){return h.map(f,h.property(g))};h.where=function(f,g){return h.filter(f,
h.matcher(g))};h.findWhere=function(f,g){return h.find(f,h.matcher(g))};h.max=function(f,g,l){var n=-Infinity,p=-Infinity,r;if(null==g&&null!=f){f=B(f)?f:h.values(f);for(var z=0,w=f.length;z<w;z++)l=f[z],l>n&&(n=l)}else g=R(g,l),h.each(f,function(F,M,O){r=g(F,M,O);if(r>p||-Infinity===r&&-Infinity===n)n=F,p=r});return n};h.min=function(f,g,l){var n=Infinity,p=Infinity,r;if(null==g&&null!=f){f=B(f)?f:h.values(f);for(var z=0,w=f.length;z<w;z++)l=f[z],l<n&&(n=l)}else g=R(g,l),h.each(f,function(F,M,O){r=
g(F,M,O);if(r<p||Infinity===r&&Infinity===n)n=F,p=r});return n};h.shuffle=function(f){f=B(f)?f:h.values(f);for(var g=f.length,l=Array(g),n=0,p;n<g;n++)p=h.random(0,n),p!==n&&(l[n]=l[p]),l[p]=f[n];return l};h.sample=function(f,g,l){return null==g||l?(B(f)||(f=h.values(f)),f[h.random(f.length-1)]):h.shuffle(f).slice(0,Math.max(0,g))};h.sortBy=function(f,g,l){g=R(g,l);return h.pluck(h.map(f,function(n,p,r){return{value:n,index:p,criteria:g(n,p,r)}}).sort(function(n,p){var r=n.criteria,z=p.criteria;if(r!==
z){if(r>z||void 0===r)return 1;if(r<z||void 0===z)return-1}return n.index-p.index}),"value")};var H=function(f){return function(g,l,n){var p={};l=R(l,n);h.each(g,function(r,z){z=l(r,z,g);f(p,r,z)});return p}};h.groupBy=H(function(f,g,l){h.has(f,l)?f[l].push(g):f[l]=[g]});h.indexBy=H(function(f,g,l){f[l]=g});h.countBy=H(function(f,g,l){h.has(f,l)?f[l]++:f[l]=1});h.toArray=function(f){return f?h.isArray(f)?C.call(f):B(f)?h.map(f,h.identity):h.values(f):[]};h.size=function(f){return null==f?0:B(f)?f.length:
h.keys(f).length};h.partition=function(f,g,l){g=R(g,l);var n=[],p=[];h.each(f,function(r,z,w){(g(r,z,w)?n:p).push(r)});return[n,p]};h.first=h.head=h.take=function(f,g,l){if(null!=f)return null==g||l?f[0]:h.initial(f,f.length-g)};h.initial=function(f,g,l){return C.call(f,0,Math.max(0,f.length-(null==g||l?1:g)))};h.last=function(f,g,l){if(null!=f)return null==g||l?f[f.length-1]:h.rest(f,Math.max(0,f.length-g))};h.rest=h.tail=h.drop=function(f,g,l){return C.call(f,null==g||l?1:g)};h.compact=function(f){return h.filter(f,
h.identity)};var G=function(f,g,l,n){var p=[],r=0;n=n||0;for(var z=x(f);n<z;n++){var w=f[n];if(B(w)&&(h.isArray(w)||h.isArguments(w))){g||(w=G(w,g,l));var F=0,M=w.length;for(p.length+=M;F<M;)p[r++]=w[F++]}else l||(p[r++]=w)}return p};h.flatten=function(f,g){return G(f,g,!1)};h.without=function(f){return h.difference(f,C.call(arguments,1))};h.uniq=h.unique=function(f,g,l,n){h.isBoolean(g)||(n=l,l=g,g=!1);null!=l&&(l=R(l,n));n=[];for(var p=[],r=0,z=x(f);r<z;r++){var w=f[r],F=l?l(w,r,f):w;g?(r&&p===
F||n.push(w),p=F):l?h.contains(p,F)||(p.push(F),n.push(w)):h.contains(n,w)||n.push(w)}return n};h.union=function(){return h.uniq(G(arguments,!0,!0))};h.intersection=function(f){for(var g=[],l=arguments.length,n=0,p=x(f);n<p;n++){var r=f[n];if(!h.contains(g,r)){for(var z=1;z<l&&h.contains(arguments[z],r);z++);z===l&&g.push(r)}}return g};h.difference=function(f){var g=G(arguments,!0,!0,1);return h.filter(f,function(l){return!h.contains(g,l)})};h.zip=function(){return h.unzip(arguments)};h.unzip=function(f){for(var g=
f&&h.max(f,x).length||0,l=Array(g),n=0;n<g;n++)l[n]=h.pluck(f,n);return l};h.object=function(f,g){for(var l={},n=0,p=x(f);n<p;n++)g?l[f[n]]=g[n]:l[f[n][0]]=f[n][1];return l};h.findIndex=b(1);h.findLastIndex=b(-1);h.sortedIndex=function(f,g,l,n){l=R(l,n,1);g=l(g);n=0;for(var p=x(f);n<p;){var r=Math.floor((n+p)/2);l(f[r])<g?n=r+1:p=r}return n};h.indexOf=c(1,h.findIndex,h.sortedIndex);h.lastIndexOf=c(-1,h.findLastIndex);h.range=function(f,g,l){null==g&&(g=f||0,f=0);l=l||1;g=Math.max(Math.ceil((g-f)/
l),0);for(var n=Array(g),p=0;p<g;p++,f+=l)n[p]=f;return n};var K=function(f,g,l,n,p){if(!(n instanceof g))return f.apply(l,p);g=q(f.prototype);f=f.apply(g,p);return h.isObject(f)?f:g};h.bind=function(f,g){if(P&&f.bind===P)return P.apply(f,C.call(arguments,1));if(!h.isFunction(f))throw new TypeError("Bind must be called on a function");var l=C.call(arguments,2),n=function(){return K(f,n,g,this,l.concat(C.call(arguments)))};return n};h.partial=function(f){var g=C.call(arguments,1),l=function(){for(var n=
0,p=g.length,r=Array(p),z=0;z<p;z++)r[z]=g[z]===h?arguments[n++]:g[z];for(;n<arguments.length;)r.push(arguments[n++]);return K(f,l,this,this,r)};return l};h.bindAll=function(f){var g,l=arguments.length;if(1>=l)throw Error("bindAll must be passed function names");for(g=1;g<l;g++){var n=arguments[g];f[n]=h.bind(f[n],f)}return f};h.memoize=function(f,g){var l=function(n){var p=l.cache,r=""+(g?g.apply(this,arguments):n);h.has(p,r)||(p[r]=f.apply(this,arguments));return p[r]};l.cache={};return l};h.delay=
function(f,g){var l=C.call(arguments,2);return setTimeout(function(){return f.apply(null,l)},g)};h.defer=h.partial(h.delay,h,1);h.throttle=function(f,g,l){var n,p,r,z=null,w=0;l||(l={});var F=function(){w=!1===l.leading?0:h.now();z=null;r=f.apply(n,p);z||(n=p=null)};return function(){var M=h.now();w||!1!==l.leading||(w=M);var O=g-(M-w);n=this;p=arguments;0>=O||O>g?(z&&(clearTimeout(z),z=null),w=M,r=f.apply(n,p),z||(n=p=null)):z||!1===l.trailing||(z=setTimeout(F,O));return r}};h.debounce=function(f,
g,l){var n,p,r,z,w,F=function(){var M=h.now()-z;M<g&&0<=M?n=setTimeout(F,g-M):(n=null,l||(w=f.apply(r,p),n||(r=p=null)))};return function(){r=this;p=arguments;z=h.now();var M=l&&!n;n||(n=setTimeout(F,g));M&&(w=f.apply(r,p),r=p=null);return w}};h.wrap=function(f,g){return h.partial(g,f)};h.negate=function(f){return function(){return!f.apply(this,arguments)}};h.compose=function(){var f=arguments,g=f.length-1;return function(){for(var l=g,n=f[g].apply(this,arguments);l--;)n=f[l].call(this,n);return n}};
h.after=function(f,g){return function(){if(1>--f)return g.apply(this,arguments)}};h.before=function(f,g){var l;return function(){0<--f&&(l=g.apply(this,arguments));1>=f&&(g=null);return l}};h.once=h.partial(h.before,2);var Q=!{toString:null}.propertyIsEnumerable("toString"),T="valueOf isPrototypeOf toString propertyIsEnumerable hasOwnProperty toLocaleString".split(" ");h.keys=function(f){if(!h.isObject(f))return[];if(L)return L(f);var g=[],l;for(l in f)h.has(f,l)&&g.push(l);Q&&d(f,g);return g};h.allKeys=
function(f){if(!h.isObject(f))return[];var g=[],l;for(l in f)g.push(l);Q&&d(f,g);return g};h.values=function(f){for(var g=h.keys(f),l=g.length,n=Array(l),p=0;p<l;p++)n[p]=f[g[p]];return n};h.mapObject=function(f,g,l){g=R(g,l);l=h.keys(f);for(var n=l.length,p={},r,z=0;z<n;z++)r=l[z],p[r]=g(f[r],r,f);return p};h.pairs=function(f){for(var g=h.keys(f),l=g.length,n=Array(l),p=0;p<l;p++)n[p]=[g[p],f[g[p]]];return n};h.invert=function(f){for(var g={},l=h.keys(f),n=0,p=l.length;n<p;n++)g[f[l[n]]]=l[n];return g};
h.functions=h.methods=function(f){var g=[],l;for(l in f)h.isFunction(f[l])&&g.push(l);return g.sort()};h.extend=ca(h.allKeys);h.extendOwn=h.assign=ca(h.keys);h.findKey=function(f,g,l){g=R(g,l);l=h.keys(f);for(var n,p=0,r=l.length;p<r;p++)if(n=l[p],g(f[n],n,f))return n};h.pick=function(f,g,l){var n={},p=f;if(null==p)return n;if(h.isFunction(g)){var r=h.allKeys(p);var z=V(g,l)}else r=G(arguments,!1,!1,1),z=function(aa,W,Z){return W in Z},p=Object(p);for(var w=0,F=r.length;w<F;w++){var M=r[w],O=p[M];
z(O,M,p)&&(n[M]=O)}return n};h.omit=function(f,g,l){if(h.isFunction(g))g=h.negate(g);else{var n=h.map(G(arguments,!1,!1,1),String);g=function(p,r){return!h.contains(n,r)}}return h.pick(f,g,l)};h.defaults=ca(h.allKeys,!0);h.create=function(f,g){f=q(f);g&&h.extendOwn(f,g);return f};h.clone=function(f){return h.isObject(f)?h.isArray(f)?f.slice():h.extend({},f):f};h.tap=function(f,g){g(f);return f};h.isMatch=function(f,g){var l=h.keys(g),n=l.length;if(null==f)return!n;f=Object(f);for(var p=0;p<n;p++){var r=
l[p];if(g[r]!==f[r]||!(r in f))return!1}return!0};var U=function(f,g,l,n){if(f===g)return 0!==f||1/f===1/g;if(null==f||null==g)return f===g;f instanceof h&&(f=f._wrapped);g instanceof h&&(g=g._wrapped);var p=D.call(f);if(p!==D.call(g))return!1;switch(p){case "[object RegExp]":case "[object String]":return""+f===""+g;case "[object Number]":return+f!==+f?+g!==+g:0===+f?1/+f===1/g:+f===+g;case "[object Date]":case "[object Boolean]":return+f===+g}p="[object Array]"===p;if(!p){if("object"!=typeof f||
"object"!=typeof g)return!1;var r=f.constructor,z=g.constructor;if(r!==z&&!(h.isFunction(r)&&r instanceof r&&h.isFunction(z)&&z instanceof z)&&"constructor"in f&&"constructor"in g)return!1}l=l||[];n=n||[];for(r=l.length;r--;)if(l[r]===f)return n[r]===g;l.push(f);n.push(g);if(p){r=f.length;if(r!==g.length)return!1;for(;r--;)if(!U(f[r],g[r],l,n))return!1}else{p=h.keys(f);r=p.length;if(h.keys(g).length!==r)return!1;for(;r--;)if(z=p[r],!h.has(g,z)||!U(f[z],g[z],l,n))return!1}l.pop();n.pop();return!0};
h.isEqual=function(f,g){return U(f,g)};h.isEmpty=function(f){return null==f?!0:B(f)&&(h.isArray(f)||h.isString(f)||h.isArguments(f))?0===f.length:0===h.keys(f).length};h.isElement=function(f){return!(!f||1!==f.nodeType)};h.isArray=I||function(f){return"[object Array]"===D.call(f)};h.isObject=function(f){var g=typeof f;return"function"===g||"object"===g&&!!f};h.each("Arguments Function String Number Date RegExp Error".split(" "),function(f){h["is"+f]=function(g){return D.call(g)==="[object "+f+"]"}});
h.isArguments(arguments)||(h.isArguments=function(f){return h.has(f,"callee")});"function"!=typeof/./&&"object"!=typeof Int8Array&&(h.isFunction=function(f){return"function"==typeof f||!1});h.isFinite=function(f){return isFinite(f)&&!isNaN(parseFloat(f))};h.isNaN=function(f){return h.isNumber(f)&&f!==+f};h.isBoolean=function(f){return!0===f||!1===f||"[object Boolean]"===D.call(f)};h.isNull=function(f){return null===f};h.isUndefined=function(f){return void 0===f};h.has=function(f,g){return null!=f&&
A.call(f,g)};h.noConflict=function(){e._=k;return this};h.identity=function(f){return f};h.constant=function(f){return function(){return f}};h.noop=function(){};h.property=u;h.propertyOf=function(f){return null==f?function(){}:function(g){return f[g]}};h.matcher=h.matches=function(f){f=h.extendOwn({},f);return function(g){return h.isMatch(g,f)}};h.times=function(f,g,l){var n=Array(Math.max(0,f));g=V(g,l,1);for(l=0;l<f;l++)n[l]=g(l);return n};h.random=function(f,g){null==g&&(g=f,f=0);return f+Math.floor(Math.random()*
(g-f+1))};h.now=Date.now||function(){return(new Date).getTime()};I={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};ca=h.invert(I);u=function(f){var g=function(r){return f[r]},l="(?:"+h.keys(f).join("|")+")",n=RegExp(l),p=RegExp(l,"g");return function(r){r=null==r?"":""+r;return n.test(r)?r.replace(p,g):r}};h.escape=u(I);h.unescape=u(ca);h.result=function(f,g,l){g=null==f?void 0:f[g];void 0===g&&(g=l);return h.isFunction(g)?g.call(f):g};var Y=0;h.uniqueId=function(f){var g=
++Y+"";return f?f+g:g};h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var E=/(.)^/,ea={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},ba=/\\|'|\r|\n|\u2028|\u2029/g,X=function(f){return"\\"+ea[f]};h.template=function(f,g,l){!g&&l&&(g=l);g=h.defaults({},g,h.templateSettings);l=RegExp([(g.escape||E).source,(g.interpolate||E).source,(g.evaluate||E).source].join("|")+"|$","g");var n=0,p="__p+='";f.replace(l,function(z,w,
F,M,O){p+=f.slice(n,O).replace(ba,X);n=O+z.length;w?p+="'+\n((__t=("+w+"))==null?'':_.escape(__t))+\n'":F?p+="'+\n((__t=("+F+"))==null?'':__t)+\n'":M&&(p+="';\n"+M+"\n__p+='");return z});p+="';\n";g.variable||(p="with(obj||{}){\n"+p+"}\n");p="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+p+"return __p;\n";try{var r=new Function(g.variable||"obj","_",p)}catch(z){throw z.source=p,z;}l=function(z){return r.call(this,z,h)};l.source="function("+(g.variable||
"obj")+"){\n"+p+"}";return l};h.chain=function(f){f=h(f);f._chain=!0;return f};var J=function(f,g){return f._chain?h(g).chain():g};h.mixin=function(f){h.each(h.functions(f),function(g){var l=h[g]=f[g];h.prototype[g]=function(){var n=[this._wrapped];y.apply(n,arguments);return J(this,l.apply(h,n))}})};h.mixin(h);h.each("pop push reverse shift sort splice unshift".split(" "),function(f){var g=t[f];h.prototype[f]=function(){var l=this._wrapped;g.apply(l,arguments);"shift"!==f&&"splice"!==f||0!==l.length||
delete l[0];return J(this,l)}});h.each(["concat","join","slice"],function(f){var g=t[f];h.prototype[f]=function(){return J(this,g.apply(this._wrapped,arguments))}});h.prototype.value=function(){return this._wrapped};h.prototype.valueOf=h.prototype.toJSON=h.prototype.value;h.prototype.toString=function(){return""+this._wrapped};"function"===typeof define&&define.amd&&define("underscore",[],function(){return h})}).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 b=a.pkp.classes.Helper.CHARS_,c=Array(36),d=0,e;for(e=0;36>e;e++)if(8==e||13==e||18==e||23==e)c[e]="-";else if(14==e)c[e]="4";else{2>=d&&(d=33554432+16777216*Math.random()|0);var k=d&15;d>>=4;c[e]=b[19==e?k&3|8:k]}return c.join("")};a.pkp.classes.Helper.inherits=function(b,c){var d=function(){};d.prototype=c.prototype;b.parent_=c.prototype;b.prototype=new d;b.prototype.constructor=b;c.prototype.constructor==Object.prototype.constructor&&(c.prototype.constructor=
c)};a.pkp.classes.Helper.objectFactory=function(b,c){var d=a.pkp.classes.Helper.resolveObjectName(b);var e=a.pkp.classes.Helper.getObjectProxyInstance();a.extend(!0,e,a.pkp.classes.ObjectProxy);a.pkp.classes.Helper.inherits(e,d);a.extend(!0,e.prototype,a.pkp.classes.ObjectProxy.prototype);return new e(b,c)};a.pkp.classes.Helper.resolveObjectName=function(b){var c;var d=b.split(".");if("$"!=d.shift())throw Error(['Namespace "',d[0],'" for object "',b,'" is currently not supported!'].join(""));var e=
d[d.length-1];if(e.charAt(0).toUpperCase()!==e.charAt(0))throw Error(['The name "',b,'" does not point to aconstructor which must always be upper case!'].join(""));e=a;for(c in d)if(e=e[d[c]],void 0===e)throw Error(['Constructor for object "',b,'" not found!'].join(""));if(!a.isFunction(e))throw Error(['The name "',b,'" does not point to a,constructor which must always be a function!'].join());return e};a.pkp.classes.Helper.getObjectProxyInstance=function(){var b=function(c,d){this.objectName_=c;
this.parent.apply(this,d)};b.objectName_="";b.prototype.parent=function(c,d){};return b};a.pkp.classes.Helper.injectMixin=function(b,c){c=a.pkp.classes.Helper.objectFactory(c,[]);a.extend(!0,b,c)};a.pkp.classes.Helper.curry=function(b,c,d){if(2<arguments.length){var e;var k=Array.prototype.slice.call(arguments,2);return function(){e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,k);return b.apply(c,e)}}return function(){return b.apply(c,arguments)}};a.pkp.classes.Helper.escapeJQuerySelector=
function(b){return b.replace("@","\\@")}})(jQuery);(function(a){a.pkp.classes.ObjectProxy=function(){};a.pkp.classes.ObjectProxy.prototype.objectName_="";a.pkp.classes.ObjectProxy.prototype.self=function(b,c){var d;for(d=this.constructor;d;d=d.parent_&&d.parent_.constructor)if(d.hasOwnProperty(b)){d=d[b];if(a.isFunction(d)){var e=Array.prototype.slice.call(arguments,1);return d.apply(this,e)}return d}throw Error(['Static property "',b,'" not found!'].join(""));};a.pkp.classes.ObjectProxy.prototype.parent=function(b,c){var d;var e=a.pkp.classes.ObjectProxy.prototype.parent.caller;
if(e.parent_){var k=Array.prototype.slice.call(arguments);return e.parent_.constructor.apply(this,k)}k=Array.prototype.slice.call(arguments,1);if(this.hasOwnProperty(b)&&this[b]===e)return this.constructor.parent_[b].apply(this,k);var t=!1;for(d=this.constructor;d;d=d.parent_&&d.parent_.constructor)if(d.prototype.hasOwnProperty(b)&&d.prototype[b]===e)t=!0;else if(t)return d.prototype[b].apply(this,k);throw Error("Trying to call parent from a method of one name to a method of a different name");};
a.pkp.classes.ObjectProxy.prototype.getObjectName=function(){return this.objectName_}})(jQuery);(function(a){a.pkp.classes.Handler=function(b,c){if(1<b.length)throw Error("jQuery selector contained more than one handler!");this.$htmlElement_=b;if(void 0!==this.data("handler"))throw Error(['The handler "',this.getObjectName(),'" has already been bound to the selected element!'].join(""));this.eventBindings_={};this.dataItems_={};this.publishedEvents_={};this.handlerChildren_=[];this.globalEventListeners_={};var d=this.$htmlElement_.parents();var e=this;d.each(function(k){a.pkp.classes.Handler.hasHandler(a(d[k]))&&
a.pkp.classes.Handler.getHandler(a(d[k])).handlerChildren_.push(e)});c.eventBridge&&(this.eventBridge_=c.eventBridge);if(c.publishChangeEvents)for(this.publishChangeEvents_=c.publishChangeEvents,b=0;b<this.publishChangeEvents_.length;b++)this.publishEvent(this.publishChangeEvents_[b]);else this.publishChangeEvents_=[];this.data("handler",this)};a.pkp.classes.Handler.prototype.publishChangeEvents_=null;a.pkp.classes.Handler.prototype.$htmlElement_=null;a.pkp.classes.Handler.prototype.eventBindings_=
null;a.pkp.classes.Handler.prototype.dataItems_=null;a.pkp.classes.Handler.prototype.publishedEvents_=null;a.pkp.classes.Handler.prototype.eventBridge_=null;a.pkp.classes.Handler.prototype.globalEventListeners_=null;a.pkp.classes.Handler.getHandler=function(b){b=b.data("pkp.handler");if(!(b instanceof a.pkp.classes.Handler))throw Error("There is no handler bound to this element!");return b};a.pkp.classes.Handler.hasHandler=function(b){return b.data("pkp.handler")instanceof a.pkp.classes.Handler};
a.pkp.classes.Handler.prototype.getHtmlElement=function(){a.pkp.classes.Handler.checkContext_(this);return this.$htmlElement_};a.pkp.classes.Handler.prototype.publishChangeEvents=function(){var b;for(b=0;b<this.publishChangeEvents_.length;b++)this.trigger(this.publishChangeEvents_[b])};a.pkp.classes.Handler.prototype.handleEvent=function(b){var c;var d=a(this);var e=a.pkp.classes.Handler.getHandler(d);if(d[0]!==e.getHtmlElement.call(e)[0])throw Error("An invalid handler is bound to the calling element of an event!");
d=e.eventBindings_[b.type];if(void 0===d)return!1;var k=a.makeArray(arguments);var t=!0;k.unshift(this);var m=0;for(c=d.length;m<c&&(!1===d[m].apply(e,k)&&(t=!1),!b.isImmediatePropagationStopped());m++);b.stopPropagation();return t};a.pkp.classes.Handler.prototype.callbackWrapper=function(b,c){a.pkp.classes.Handler.checkContext_(this);c||(c=this);return function(){var d=a.makeArray(arguments);d.unshift(this);return b.apply(c,d)}};a.pkp.classes.Handler.prototype.remoteResponse=function(b,c){return this.handleJson(c)};
a.pkp.classes.Handler.prototype.remove=function(){a.pkp.classes.Handler.checkContext_(this);var b;var 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(b){if(!b)throw Error("Server error: Server returned no or invalid data!");if(!0===b.status)return _.each(b.events,function(c){var d=_.has(c,"data")?c.data:
null;!_.isNull(d)&&d.isGlobalEvent?(d.handler=this,pkp.eventBus.$emit(c.name,d)):this.trigger(c.name,d)},this),b;b.content&&alert(b.content);return!1};a.pkp.classes.Handler.prototype.setHtmlElement=function(b){a.pkp.classes.Handler.checkContext_(this);return this.$htmlElement_=b};a.pkp.classes.Handler.prototype.bind=function(b,c){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[b]){this.eventBindings_[b]=[];var d=".pkpHandler";"pkpRemoveHandler"===b&&(d=".pkpHandlerRemove");this.getHtmlElement().bind(b+
d,this.handleEvent)}this.eventBindings_[b].push(c)};a.pkp.classes.Handler.prototype.unbind=function(b,c){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[b])return!1;var d;var e=0;for(d=this.eventBindings_[b].length;e<d;e++)if(this.eventBindings_[b][e]===c){this.eventBindings_[b].splice([e],1);break}0===this.eventBindings_[b].length&&(delete this.eventBindings_[b],this.getHtmlElement().unbind(b,this.handleEvent));return!0};a.pkp.classes.Handler.prototype.bindGlobal=function(b,c){"undefined"===
typeof this.globalEventListeners_[b]&&(this.globalEventListeners_[b]=[]);c=this.callbackWrapper(c);this.globalEventListeners_[b].push(c);pkp.eventBus.$on(b,c)};a.pkp.classes.Handler.prototype.unbindGlobal=function(b,c){var d=this.callbackWrapper(c);"undefined"!==typeof this.globalEventListeners_[b]&&(this.globalEventListeners=_.reject(this.globalEventListeners,function(e){return e===d}));pkp.eventBus.$off(b,d)};a.pkp.classes.Handler.prototype.unbindGlobalAll=function(){"undefined"!==typeof this.globalEventListeners_&&
_.each(this.globalEventListeners_,function(b,c){_.each(b,function(d){pkp.eventBus.$off(c,d)})});this.globalEventListeners=null;this.unbindGlobalChildren()};a.pkp.classes.Handler.prototype.unbindGlobalChildren=function(){_.each(this.handlerChildren_,function(b){"undefined"!==typeof b.unbindGlobalAll?b.unbindGlobalAll():"undefined"!==typeof b.$destroy&&(delete pkp.registry._instances[b.id],b.$destroy())})};a.pkp.classes.Handler.prototype.data=function(b,c){a.pkp.classes.Handler.checkContext_(this);
b="pkp."+b;void 0!==c&&(this.dataItems_[b]=!0);return 1<arguments.length?this.getHtmlElement().data(b,c):this.getHtmlElement().data(b)};a.pkp.classes.Handler.prototype.trigger=function(b,c){void 0===c&&(c=null);this.getHtmlElement().triggerHandler(b,c);this.publishedEvents_[b]||this.triggerPublicEvent_(b,c)};a.pkp.classes.Handler.prototype.publishEvent=function(b){this.publishedEvents_[b]||(this.publishedEvents_[b]=!0,this.bind(b,function(c,d,e){var k=null;2<arguments.length&&(k=Array.prototype.slice.call(arguments,
2));this.triggerPublicEvent_(b,k)}))};a.pkp.classes.Handler.prototype.switchViz=function(b){a(b.currentTarget).parent().parent().find("span").toggle()};a.pkp.classes.Handler.prototype.initializeTinyMCE=function(){if("undefined"!==typeof tinyMCE){var b=this.getHtmlElement().attr("id"),c=tinyMCE.EditorManager.settings;c.defaultToolbar=c.toolbar;a("#"+b).find(".richContent").each(function(){var d=a(this).attr("id"),e=a("<div></div>"),k=a("<div></div>"),t=tinyMCE.EditorManager.settings;a(this).hasClass("extendedRichContent")?
t.toolbar=t.richToolbar:t.toolbar=t.defaultToolbar;tinyMCE.EditorManager.createEditor(d,t).render();if(a(this).hasClass("localizable")||a(this).hasClass("flag"))if(e.addClass("mceLocalizationIcon localizable"),e.attr("id","mceLocalizationIcon-"+d),a(this).wrap(k),a(this).parent().append(e),a(this).hasClass("localizable"))e.addClass("mceGlobe");else if(a(this).hasClass("flag")&&(d=a(this).attr("class").split(" "),d.length))for(k=0;k<d.length;k++)if(d[k].match(/^flag_[a-z]{2}_[A-Z]{2}$/)){e.addClass(d[k]);
break}})}};a.pkp.classes.Handler.prototype.triggerPublicEvent_=function(b,c){this.getHtmlElement().parent().trigger(b,c);this.eventBridge_&&a('[id^="'+this.eventBridge_+'"]').trigger(b,c)};a.pkp.classes.Handler.prototype.replaceWith=function(b){this.unbindGlobalAll();this.getHtmlElement().replaceWith(b)};a.pkp.classes.Handler.prototype.replacePartialWith=function(b,c){a.pkp.classes.Handler.hasHandler(c)?a.pkp.classes.Handler.getHandler(c).replaceWith(b):(this.unbindPartial(c),c.replaceWith(b))};a.pkp.classes.Handler.prototype.html=
function(b){this.unbindGlobalChildren();this.getHtmlElement().html(b)};a.pkp.classes.Handler.prototype.unbindPartial=function(b){a("*",b).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(b){if(!(b instanceof a.pkp.classes.Handler))throw Error("Trying to call handler method in non-handler context!");}})(jQuery);(function(a){a.pkp.classes.TinyMCEHelper=function(){throw Error("Trying to instantiate the TinyMCEHelper singleton!");};a.pkp.classes.TinyMCEHelper.prototype.getVariableMap=function(b){b=a(b).attr("data-variables");return void 0!==b?a.parseJSON(decodeURIComponent(b)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap=function(b){b=a(b).attr("data-variablesType");return void 0!==b?a.parseJSON(decodeURIComponent(b)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableElement=function(b,
c,d){d=a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap(d);return void 0!=d[b]&&(d=d[b],d==a.pkp.cons.INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT)?a("<div/>").append(a("<span/>").text(c)):a("<div/>").append(a("<span/>").addClass("pkpTag mceNonEditable").attr("data-symbolic",b).text(c))}})(jQuery);(function(a){a.pkp.classes.linkAction=a.pkp.classes.linkAction||{};a.pkp.classes.linkAction.LinkActionRequest=function(b,c){this.$linkActionElement=b;this.options=c;b.is("a")&&c.url&&b.attr("href",c.url)};a.pkp.classes.linkAction.LinkActionRequest.prototype.$linkActionElement=null;a.pkp.classes.linkAction.LinkActionRequest.prototype.options=null;a.pkp.classes.linkAction.LinkActionRequest.prototype.activate=function(b,c){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(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.RedirectRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.RedirectRequest.prototype.activate=function(b,c){var d=this.getOptions();window.open(d.url,d.name,d.specs);return this.parent("activate",b,c)}})(jQuery);(function(a){a.pkp.classes.linkAction.OpenWindowRequest=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.OpenWindowRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.OpenWindowRequest.prototype.activate=function(b,c){var d=this.getOptions();window.open(d.url);return this.parent("activate",b,c)}})(jQuery);(function(a){a.pkp.classes.linkAction.PostAndRedirectRequest=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.PostAndRedirectRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.postJsonData_=null;a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.activate=function(b,c){b=this.parent("activate",b,c);c=this.getOptions();var d=a.pkp.classes.Helper.curry(this.handleResponse_,this);a.post(c.postUrl,d,
"json");return b};a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.finishCallback_=function(){var b=this.getLinkActionElement();b=a.pkp.classes.Handler.getHandler(b);this.finish();b.handleJson(this.postJsonData_)};a.pkp.classes.linkAction.PostAndRedirectRequest.prototype.handleResponse_=function(b){var c=this.getOptions(),d=null,e=null;this.postJsonData_=b;d=setInterval(function(){0==a.active&&(clearInterval(d),window.location=c.url)},100);e=a.pkp.classes.Helper.curry(this.finishCallback_,
this);setTimeout(e,2E3)}})(jQuery);(function(a){a.pkp.classes.linkAction.NullAction=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.NullAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.NullAction.prototype.activate=function(b,c){return this.parent("activate",b,c)};a.pkp.classes.linkAction.NullAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.EventAction=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.EventAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.EventAction.prototype.activate=function(b,c){a(this.options.target).trigger(this.options.event,this.options);return this.parent("activate",b,c)};a.pkp.classes.linkAction.EventAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.AjaxRequest=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.AjaxRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.AjaxRequest.prototype.activate=function(b,c){b=this.parent("activate",b,c);c=this.getOptions();var d=a.pkp.classes.Helper.curry(this.handleResponse,this);switch(c.requestType){case "get":a.getJSON(c.url,d);break;case "post":a.post(c.url,d,"json")}return b};a.pkp.classes.linkAction.AjaxRequest.prototype.handleResponse=
function(b){this.getLinkActionElement().data("pkp.handler").handleJson(b);this.finish()}})(jQuery);(function(a){a.pkp.classes.linkAction.ModalRequest=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.ModalRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.ModalRequest.prototype.$modal_=null;a.pkp.classes.linkAction.ModalRequest.prototype.activate=function(b,c){var d=this.getOptions(),e=this.getLinkActionElement(),k=e.text();void 0===d.title&&(""===k&&(k=e.attr("title")),d.title=k);e=a.pkp.classes.Helper.uuid();if(!d.modalHandler)throw Error('The "modalHandler" setting is required in a ModalRequest');
k=this.getLinkActionElement();k=a.pkp.classes.Handler.getHandler(k);k=a.extend(!0,{eventBridge:k.getStaticId()},d);this.$modal_=a('<div id="'+e+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler(d.modalHandler,k);a.pkp.classes.Handler.getHandler(this.$modal_).bind("pkpRemoveHandler",a.pkp.classes.Helper.curry(this.finish,this));return this.parent("activate",b,c)};a.pkp.classes.linkAction.ModalRequest.prototype.finish=function(){0!==this.$linkActionElement.attr("id").indexOf("newRoundTabContainer")&&
this.$linkActionElement.focus();this.$modal_.remove();return this.parent("finish")}})(jQuery);(function(a){a.pkp.classes.notification=a.pkp.classes.notification||{};a.pkp.classes.notification.NotificationHelper=function(){};a.pkp.classes.notification.NotificationHelper.redirectNotifyUserEvent=function(b,c){var d,e;if(void 0!==c.content)b.getHtmlElement().parent().trigger("notifyUser",[c]);else{var k=b.getHtmlElement();var t=!1;!(b instanceof a.pkp.controllers.SiteHandler)&&0<a(c).parents(".pkp_controllers_grid").length&&(k.parent().trigger("notifyUser"),t=!0);k=a(".pkp_notification",k);var m=
[];var y=0;for(d=k.length;y<d;y++){var C=a(k[y]);if(!(0<C.parents(":hidden").length)){var D=C.parents();var A=0;for(e=D.length;A<e;A++){var I=a(D[A]).data("pkp.handler");if(I instanceof a.pkp.classes.Handler){var L=a(D[A]);break}}if(L.has(c[0]).length||L[0]===c[0]){if(0<C.parents(".ui-accordion:first").length&&(D=C.parents(".ui-accordion:first"),!D.has(c[0])))continue;m.push(C)}}}if(m.length)for(y=m.length-1;-1<y;y--)m[y].triggerHandler("notifyUser");else t||b.getHtmlElement().parent().trigger("notifyUser")}}})(jQuery);(function(a){a.pkp.classes.features=a.pkp.classes.features||{};a.pkp.classes.features.Feature=function(b,c){this.gridHandler=b;this.options_=c;this.addFeatureHtml(this.getGridHtmlElement(),c)};a.pkp.classes.features.Feature.prototype.gridHandler=null;a.pkp.classes.features.Feature.prototype.options_=null;a.pkp.classes.features.Feature.prototype.setOptions=function(b){this.options_=b};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(b){return!1};a.pkp.classes.features.Feature.prototype.replaceElement=function(b){return!1};a.pkp.classes.features.Feature.prototype.resequenceRows=function(b){return!1};a.pkp.classes.features.Feature.prototype.refreshGrid=function(b){return!1};a.pkp.classes.features.Feature.prototype.replaceElementResponseHandler=function(b){return!1};a.pkp.classes.features.Feature.prototype.callbackWrapper=function(b,
c){return this.gridHandler.callbackWrapper(b,c)};a.pkp.classes.features.Feature.prototype.addFeatureHtml=function(b,c){};a.pkp.classes.features.Feature.prototype.getGridHtmlElement=function(){return this.gridHandler.getHtmlElement()}})(jQuery);(function(a){a.pkp.classes.features.OrderItemsFeature=function(b,c){this.parent(b,c);this.$orderButton_=a(".pkp_linkaction_orderItems",this.getGridHtmlElement());this.$finishControl_=a(".order_finish_controls",this.getGridHtmlElement());0===this.$orderButton_.length&&(this.isOrdering=!0);this.itemsOrder=[]};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderItemsFeature,a.pkp.classes.features.Feature);a.pkp.classes.features.OrderItemsFeature.prototype.itemsOrder=null;a.pkp.classes.features.OrderItemsFeature.prototype.isOrdering=
!1;a.pkp.classes.features.OrderItemsFeature.prototype.$orderButton_=null;a.pkp.classes.features.OrderItemsFeature.prototype.$cancelButton_=null;a.pkp.classes.features.OrderItemsFeature.prototype.$saveButton_=null;a.pkp.classes.features.OrderItemsFeature.prototype.$finishControl_=null;a.pkp.classes.features.OrderItemsFeature.prototype.getOrderButton=function(){return this.$orderButton_};a.pkp.classes.features.OrderItemsFeature.prototype.getFinishControl=function(){return this.$finishControl_};a.pkp.classes.features.OrderItemsFeature.prototype.getSaveOrderButton=
function(){return this.getFinishControl().find(".saveButton")};a.pkp.classes.features.OrderItemsFeature.prototype.getCancelOrderButton=function(){return this.getFinishControl().find(".cancelFormButton")};a.pkp.classes.features.OrderItemsFeature.prototype.getMoveItemRowActionSelector=function(){return".orderable .pkp_linkaction_moveItem"};a.pkp.classes.features.OrderItemsFeature.prototype.getMoveItemClasses=function(){return"pkp_helpers_moveicon ordering"};a.pkp.classes.features.OrderItemsFeature.prototype.dragStartCallback=
function(b,c,d){};a.pkp.classes.features.OrderItemsFeature.prototype.dragStopCallback=function(b,c,d){};a.pkp.classes.features.OrderItemsFeature.prototype.updateOrderCallback=function(b,c,d){};a.pkp.classes.features.OrderItemsFeature.prototype.init=function(){this.addOrderingClassToRows();this.toggleMoveItemRowAction(this.isOrdering);this.getGridHtmlElement().find("div.order_message").hide();this.toggleOrderLink_();this.isOrdering&&this.setupSortablePlugin()};a.pkp.classes.features.OrderItemsFeature.prototype.addFeatureHtml=
function(b,c){if(void 0!==c.orderFinishControls){var d=a(c.orderFinishControls);b.find("table").last().after(d);d.hide()}void 0!==c.orderMessage&&(c=c.orderMessage,b=b.find(".gridRow").filter(function(e,k){return!a(this).find("a.pkp_linkaction_moveItem").length}),b.find("td:first-child").prepend(c));this.updateOrderLinkVisibility_()};a.pkp.classes.features.OrderItemsFeature.prototype.addOrderingClassToRows=function(){this.gridHandler.getRows().filter(function(b,c){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(b,c){};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(){this.gridHandler.updateControlRowsPosition();this.unbindOrderFinishControlsHandlers_();
var b=this.gridHandler.getRows();this.storeOrder(b);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(b){this.isOrdering=b;this.toggleGridLinkActions_();this.toggleOrderLink_();this.toggleFinishControl_();this.toggleItemsDragMode();this.setupSortablePlugin();this.setupNonOrderableMessage_()};a.pkp.classes.features.OrderItemsFeature.prototype.storeOrder=
function(b){var c;this.itemsOrder=[];var d=0;for(c=b.length;d<c;d++){var e=a(b[d]);var k=e.attr("id");this.itemsOrder.push(k);this.storeRowOrder(d,e)}};a.pkp.classes.features.OrderItemsFeature.prototype.toggleItemsDragMode=function(){var b=this.isOrdering,c=this.gridHandler.getRows().filter(".orderable"),d=this.getMoveItemClasses();b?c.addClass(d):c.removeClass(d);this.toggleMoveItemRowAction(b)};a.pkp.classes.features.OrderItemsFeature.prototype.applySortPlgOnElements=function(b,c,d){var e=this.isOrdering,
k=this.gridHandler.callbackWrapper(this.dragStartCallback,this),t=this.gridHandler.callbackWrapper(this.dragStopCallback,this),m=this.gridHandler.callbackWrapper(this.updateOrderCallback,this);c={disabled:!e,items:c,activate:k,deactivate:t,update:m,tolerance:"pointer"};"object"===typeof d&&(c=a.extend(!0,c,d));b.sortable(c)};a.pkp.classes.features.OrderItemsFeature.prototype.getRowsDataId=function(b){var c,d=[];for(c in this.itemsOrder){var e=a("#"+this.itemsOrder[c],b);1>e.length||(e=this.gridHandler.getRowDataId(e),
d.push(e))}return d};a.pkp.classes.features.OrderItemsFeature.prototype.toggleMoveItemRowAction=function(b){var c=this.getGridHtmlElement(),d=a("div.row_actions",c),e="a:not("+this.getMoveItemRowActionSelector()+")",k=d.find(e);d=a(this.getMoveItemRowActionSelector(),c);b?(k.addClass("pkp_helpers_display_none"),d.show(),this.gridHandler.showRowActionsDiv()):(k.removeClass("pkp_helpers_display_none"),b=a(".gridRow div.row_actions",c),e=b.find(e),0===e.length&&this.gridHandler.hideRowActionsDiv(),d.hide())};
a.pkp.classes.features.OrderItemsFeature.prototype.addElement=function(b){this.addOrderingClassToRows();this.toggleItemsDragMode();return!1};a.pkp.classes.features.OrderItemsFeature.prototype.replaceElement=function(b){this.addOrderingClassToRows();this.toggleItemsDragMode();return!1};a.pkp.classes.features.OrderItemsFeature.prototype.replaceElementResponseHandler=function(b){this.updateOrderLinkVisibility_();this.setupNonOrderableMessage_();return!1};a.pkp.classes.features.OrderItemsFeature.prototype.updateOrderLinkVisibility_=
function(){var b=a(".pkp_linkaction_orderItems",this.getGridHtmlElement());1>=this.gridHandler.getRows().length?b.hide():b.show()};a.pkp.classes.features.OrderItemsFeature.prototype.toggleGridLinkActions_=function(){var b=this.isOrdering,c=a(".pkp_controllers_linkAction",this.getGridHtmlElement()).not(this.getMoveItemRowActionSelector()).not(this.getOrderButton()).not(this.getFinishControl().find("*"));this.gridHandler.changeLinkActionsState(!b,c)};a.pkp.classes.features.OrderItemsFeature.prototype.toggleOrderLink_=
function(){if(this.isOrdering)this.$orderButton_.unbind("click"),this.$orderButton_.attr("disabled","disabled");else{var b=this.gridHandler.callbackWrapper(this.clickOrderHandler,this);this.$orderButton_.click(b);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 b=this.getSaveOrderButton(),c=this.getCancelOrderButton(),d=this.gridHandler.callbackWrapper(this.cancelOrderHandler,this),e=this.gridHandler.callbackWrapper(this.saveOrderHandler,this);b.click(e);c.click(d)};a.pkp.classes.features.OrderItemsFeature.prototype.unbindOrderFinishControlsHandlers_=function(){this.getSaveOrderButton().unbind("click");this.getCancelOrderButton().unbind("click")};a.pkp.classes.features.OrderItemsFeature.prototype.setupNonOrderableMessage_=
function(){this.isOrdering?this.gridHandler.getRows().hover(function(){a(this).find("div.order_message").toggle()}):this.gridHandler.getRows().unbind("mouseenter mouseleave")}})(jQuery);(function(a){a.pkp.classes.features.OrderGridItemsFeature=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderGridItemsFeature,a.pkp.classes.features.OrderItemsFeature);a.pkp.classes.features.OrderGridItemsFeature.prototype.setupSortablePlugin=function(){this.applySortPlgOnElements(this.getGridHtmlElement(),"tr.orderable",null)};a.pkp.classes.features.OrderGridItemsFeature.prototype.saveOrderHandler=function(){var b=this.getOptions();this.parent("saveOrderHandler");
var c=JSON.stringify(this.getItemsDataId());var d=this.callbackWrapper(this.saveOrderResponseHandler_,this);a.post(b.saveItemsSequenceUrl,{data:c},d,"json");return!1};a.pkp.classes.features.OrderGridItemsFeature.prototype.getItemsDataId=function(){return this.getRowsDataId(this.getGridHtmlElement())};a.pkp.classes.features.OrderGridItemsFeature.prototype.saveOrderResponseHandler_=function(b,c){this.gridHandler.handleJson(c);this.toggleState(!1)}})(jQuery);(function(a){a.pkp.classes.features.OrderCategoryGridItemsFeature=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.OrderCategoryGridItemsFeature,a.pkp.classes.features.OrderGridItemsFeature);a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.setupSortablePlugin=function(){var b;this.applySortPlgOnElements(this.getGridHtmlElement(),"tbody.orderable",null);var c=navigator.userAgent.toLowerCase();if(!(/msie/.test(c)&&8>=parseInt(c.substr(c.indexOf("msie")+
5,1),10))){c=this.gridHandler.getCategories();var d=0;for(b=c.length;d<b;d++){var e=a(c[d]);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 b=this.getCategorySequence_(this.itemsOrder);this.parent("cancelOrderHandler");
this.gridHandler.resequenceCategories(b);return!1};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.toggleItemsDragMode=function(){this.parent("toggleItemsDragMode");var b=this.gridHandler.getCategories(),c;var d=0;for(c=b.length;d<c;d++){var e=a(b[d]);this.toggleCategoryDragMode_(e)}};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.addOrderingClassToRows=function(){var b=this.getOptions();b=parseInt(b.type,10);if(b==a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_ONLY||b==
a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_AND_ROWS){var c=this.gridHandler.getCategories();c.addClass("orderable")}b!=a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_ROWS_ONLY&&b!=a.pkp.cons.ORDER_CATEGORY_GRID_CATEGORIES_AND_ROWS||this.parent("addOrderingClassToRows");this.gridHandler.getCategoryRow().removeClass("orderable")};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.getItemsDataId=function(){var b=this.getCategorySequence_(this.itemsOrder),c=[],d;var e=0;for(d=b.length;e<d;e++){var k=
a("#"+b[e]);var t=this.getRowsDataId(k);k=this.gridHandler.getCategoryDataId(k);c.push({categoryId:k,rowsId:t})}return c};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.toggleCategoryDragMode_=function(b){var c=this.isOrdering;b=this.gridHandler.getCategoryRow(b);b=a("td:first",b);var d=this.getMoveItemClasses();c?b.addClass(d):b.removeClass(d)};a.pkp.classes.features.OrderCategoryGridItemsFeature.prototype.getCategorySequence_=function(b){var c,d=[];var e=0;for(c=b.length;e<c;e++){var k=
this.gridHandler.getCategoryDataIdByRowId(b[e]);k=this.gridHandler.getCategoryIdPrefix()+k;-1<a.inArray(k,d)||d.push(k)}return d}})(jQuery);(function(a){a.pkp.classes.features.GeneralPagingFeature=function(b,c){c.defaultItemsPerPage=parseInt(c.defaultItemsPerPage,10);c.currentItemsPerPage=parseInt(c.currentItemsPerPage,10);c.itemsTotal=c.itemsTotal?parseInt(c.itemsTotal,10):0;c.currentPage=parseInt(c.currentPage,10);this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.GeneralPagingFeature,a.pkp.classes.features.Feature);a.pkp.classes.features.GeneralPagingFeature.prototype.getOptions=function(){return this.parent("getOptions")};
a.pkp.classes.features.GeneralPagingFeature.prototype.setGridParams=function(b){var c=this.getOptions();c.hasOwnProperty("filter")&&(c=a.parseJSON(c.filter),a.extend(!0,b,c));this.gridHandler.setFetchExtraParams(b)}})(jQuery);(function(a){a.pkp.classes.features.PagingFeature=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.PagingFeature,a.pkp.classes.features.GeneralPagingFeature);a.pkp.classes.features.PagingFeature.prototype.init=function(){this.configPagingLinks_();this.configItemsPerPageElement_()};a.pkp.classes.features.PagingFeature.prototype.addFeatureHtml=function(b,c){b.append(c.pagingMarkup)};a.pkp.classes.features.PagingFeature.prototype.resequenceRows=function(b){b=this.gridHandler.getRows();
var c;var d=this.getOptions();d=b.length-d.currentItemsPerPage;if(0<d)for(c=0;c<d;c++)this.gridHandler.deleteElement(b.first(),!0);return!1};a.pkp.classes.features.PagingFeature.prototype.refreshGrid=function(b){var c=this.getOptions();b=this.gridHandler.getFetchExtraParams();b[c.pageParamName]=c.currentPage;b[c.itemsPerPageParamName]=c.currentItemsPerPage;c=this.gridHandler.getRows().first();var d=this.gridHandler.getRows().last();b.topLimitRowId=0==c.length?0:this.gridHandler.getRowDataId(c);b.bottomLimitRowId=
0==d.length?0:this.gridHandler.getRowDataId(d);this.setGridParams(b);return!1};a.pkp.classes.features.PagingFeature.prototype.replaceElementResponseHandler=function(b){var c=this.getOptions();if(void 0!=b.deletedRowReplacement){var d=b.deletedRowReplacement;this.gridHandler.insertOrReplaceElement(d)}void 0!=b.pagingInfo&&(d=b.pagingInfo,this.setOptions(d),this.gridHandler.replacePartialWith(d.pagingMarkup,a("div.gridPaging",this.getGridHtmlElement())),this.init());b.loadLastPage&&this.getGridHtmlElement().trigger("dataChanged");
void 0!=b.newTopRow&&(d=this.gridHandler.getRows(),c.currentItemsPerPage==d.length&&this.gridHandler.deleteElement(d.last(),!0),d=b.newTopRow,this.gridHandler.insertOrReplaceElement(d,!0));return!1};a.pkp.classes.features.PagingFeature.prototype.configPagingLinks_=function(){var b,c,d,e;var k=this.getOptions();if(b=a("div.gridPaging",this.getGridHtmlElement())){var t=this.callbackWrapper(function(C,D){d=new RegExp("[?&]"+k.pageParamName+"(?:=([^&]*))?","i");e=d.exec(a(D.target).attr("href"));null!=
e&&(k.currentPage=parseInt(e[1],10),this.getGridHtmlElement().trigger("dataChanged"));return!1},this);b=b.find("a").not(".showMoreItems").not(".showLessItems");var m=0;for(c=b.length;m<c;m++){var y=a(b[m]);y.click(t)}}};a.pkp.classes.features.PagingFeature.prototype.configItemsPerPageElement_=function(){var b;var c=this.getOptions();if(b=a("div.gridPaging",this.getGridHtmlElement())){var d=this.callbackWrapper(function(m,y){c.currentItemsPerPage=parseInt(a("option",y.target).filter(":selected").attr("value"),
10);c.currentPage=1;this.getGridHtmlElement().trigger("dataChanged");return!1},this);var e=b.find("select.itemsPerPage");var k=[10,25,50,75,100];0>a.inArray(c.defaultItemsPerPage,k)&&k.push(c.defaultItemsPerPage);k.sort(function(m,y){return m-y});if(c.itemsTotal<=k[0])a("div.gridItemsPerPage",b).hide();else{var t=k.length-1;for(b=0;b<=t;b++)e.append(a('<option value="'+k[b]+'">'+k[b]+"</option>"));e.val(c.currentItemsPerPage.toString());e.change(d)}}}})(jQuery);(function(a){a.pkp.classes.features.InfiniteScrollingFeature=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.InfiniteScrollingFeature,a.pkp.classes.features.GeneralPagingFeature);a.pkp.classes.features.InfiniteScrollingFeature.prototype.$scrollableElement_=a();a.pkp.classes.features.InfiniteScrollingFeature.prototype.observeScrollCallback_=function(){};a.pkp.classes.features.InfiniteScrollingFeature.prototype.init=function(){var b=a("div.scrollable",this.getGridHtmlElement());
b.length||(this.gridHandler.publishEvent("pkpObserveScrolling"),this.gridHandler.publishEvent("pkpRemoveScrollingObserver"));this.$scrollableElement_=b;this.observeScrollCallback_=this.gridHandler.callbackWrapper(this.observeScroll_,this);this.addScrollHandler_();this.fixGridHeight_();this.addPagingDataToRows_()};a.pkp.classes.features.InfiniteScrollingFeature.prototype.addFeatureHtml=function(b,c){b.append(c.pagingMarkup);b.find(".pkp_linkaction_moreItems").click(this.gridHandler.callbackWrapper(this.loadMoreItems_,
this))};a.pkp.classes.features.InfiniteScrollingFeature.prototype.refreshGrid=function(b){var c=this.getOptions();var d=this.gridHandler.getFetchExtraParams();d[c.pageParamName]=c.currentPage;b&&b!==a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID&&(b=this.gridHandler.getRowByDataId(b),1==b.length&&(d[c.pageParamName]=Number(b.attr("data-paging"))));d[c.itemsPerPageParamName]=c.currentItemsPerPage;this.setGridParams(d);return!1};a.pkp.classes.features.InfiniteScrollingFeature.prototype.replaceElementResponseHandler=
function(b){this.getOptions();if(void 0!=b.deletedRowReplacement){var c=b.deletedRowReplacement;this.gridHandler.insertOrReplaceElement(c);this.updatePagingDataInAllRows_()}this.addScrollHandler_();void 0!=b.pagingInfo&&(b=b.pagingInfo,this.setOptions(b),void 0!=b.pagingMarkup&&a("div.gridPagingScrolling",this.getGridHtmlElement()).replaceWith(b.pagingMarkup));this.addPagingDataToRows_();this.toggleLoadingContainer_();this.getGridHtmlElement().find(".pkp_linkaction_moreItems").click(this.gridHandler.callbackWrapper(this.loadMoreItems_,
this));return!1};a.pkp.classes.features.InfiniteScrollingFeature.prototype.observeScroll_=function(b,c){if(this.getOptions().itemsTotal==this.gridHandler.getRows().length||!this.getGridHtmlElement().is(":visible"))return!1;if(a(b).hasClass("scrollable")){c=a(b).height();var d=b.scrollHeight}else c=a.pkp.controllers.SiteHandler.prototype.getWindowDimensions(),c=c.height,d=this.getGridHtmlElement().offset().top+this.getGridHtmlElement().height();c+a(b).scrollTop()>=d&&(this.$scrollableElement_.length?
this.$scrollableElement_.unbind("scroll"):this.getGridHtmlElement().trigger("pkpRemoveScrollingObserver",[this.observeScrollCallback_]),this.loadMoreItems_());return!1};a.pkp.classes.features.InfiniteScrollingFeature.prototype.fixGridHeight_=function(){var b=a("div.scrollable",this.getGridHtmlElement()),c,d,e,k,t;0<b.length&&(k=setInterval(function(){if(b.is(":visible"))for(clearInterval(k),t=b.length,c=0,d=t;c<d;c++)e=a(b[c]),e.get(0).scrollHeight>e.height()&&e.css("max-height",e.get(0).scrollHeight-
10)},300))};a.pkp.classes.features.InfiniteScrollingFeature.prototype.addPagingDataToRows_=function(){var b=this.getOptions();this.gridHandler.getRows().filter("tr:not([data-paging])").attr("data-paging",b.currentPage)};a.pkp.classes.features.InfiniteScrollingFeature.prototype.updatePagingDataInAllRows_=function(){var b=this.getOptions(),c,d=1,e=1;var k=this.gridHandler.getRows();k.removeAttr("data-paging");var t=0;for(c=k.length;t<c;t++)a(k[t]).attr("data-paging",d),e++,e>b.currentItemsPerPage&&
(e=1,d++)};a.pkp.classes.features.InfiniteScrollingFeature.prototype.addScrollHandler_=function(){var b=this.$scrollableElement_;b.length?b.scroll(this.observeScrollCallback_):this.getGridHtmlElement().trigger("pkpObserveScrolling",[this.observeScrollCallback_])};a.pkp.classes.features.InfiniteScrollingFeature.prototype.toggleLoadingContainer_=function(b){var c=this.getGridHtmlElement().find("div.gridPagingScrolling div.pkp_loading"),d=this.$scrollableElement_;c=c.height();b?(this.getGridHtmlElement().addClass("loading"),
b=d.scrollTop(),d.scrollTop(b+c)):this.getGridHtmlElement().removeClass("loading")};a.pkp.classes.features.InfiniteScrollingFeature.prototype.loadMoreItems_=function(){var b=this.getOptions();this.toggleLoadingContainer_(!0);b.currentPage=Number(a("tr.gridRow",this.getGridHtmlElement()).last().attr("data-paging"))+1;this.getGridHtmlElement().trigger("dataChanged",[a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID])}})(jQuery);(function(a){a.pkp.classes.features.CollapsibleGridFeature=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.classes.features.CollapsibleGridFeature,a.pkp.classes.features.Feature);a.pkp.classes.features.CollapsibleGridFeature.prototype.getControlSelector=function(){return"a[id^='collapsibleGridControl-expandGridControlLink-button-']"};a.pkp.classes.features.CollapsibleGridFeature.prototype.init=function(){a(this.getControlSelector(),this.getGridHtmlElement()).click(this.callbackWrapper(this.toggleGridClickHandler_,
this))};a.pkp.classes.features.CollapsibleGridFeature.prototype.addFeatureHtml=function(b,c){b.find("div.grid_header_bar").prepend(c.collapsibleLink)};a.pkp.classes.features.CollapsibleGridFeature.prototype.toggleGridClickHandler_=function(b,c){b=this.getGridHtmlElement().find(this.getControlSelector());this.getGridHtmlElement().find("div.grid_header").siblings().toggle();b.toggleClass("expand_all").toggleClass("collapse_all");this.getGridHtmlElement().find("div.grid_header_bar .search_extras_collapse").click();
this.getGridHtmlElement().find("div.grid_header span.options").toggle();return!1}})(jQuery);(function(a){a.pkp.controllers.SiteHandler=function(b,c){this.parent(b,c);this.options_=c;this.unsavedFormElements_=[];a(".go").button();this.bind("redirectRequested",this.redirectToUrl);this.bind("notifyUser",this.fetchNotificationHandler_);this.bind("updateHeader",this.updateHeaderHandler_);this.bind("callWhenClickOutside",this.callWhenClickOutsideHandler_);this.bind("mousedown",this.mouseDownHandler_);a(window).bind("beforeunload",this.pageUnloadHandler_);a.ajaxSetup({cache:!1});c.hasSystemNotifications&&
this.trigger("notifyUser");this.bindGlobal("notify",this.handleNotifyEvent);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("pkpTags",a.pkp.app.baseUrl+"/plugins/generic/tinymce/plugins/pkpTags/plugin.js");tinyMCE.PluginManager.load("pkpwordcount",a.pkp.app.baseUrl+"/plugins/generic/tinymce/plugins/pkpWordcount/plugin.js");var b=a.pkp.app.tinyMceContentCSS;a.pkp.app.cdnEnabled&&(b=b+", "+a.pkp.app.tinyMceContentFont);b={width:"100%",resize:"both",entity_encoding:"raw",plugins:"paste,fullscreen,link,lists,code,image,-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 | image | pkpTags",richToolbar:"copy paste | bold italic underline | bullist numlist | superscript subscript | link unlink code fullscreen | image | pkpTags",statusbar:!1,content_css:b};"undefined"!==typeof a.pkp.plugins.generic.tinymceplugin&&"undefined"!==typeof a.pkp.plugins.generic.tinymceplugin.uploadUrl&&(b.paste_data_images=
!0,b.relative_urls=!1,b.remove_script_host=!1,b.images_upload_handler=function(c,d,e){var k=new FormData;k.append("file",c.blob(),c.filename());a.ajax({method:"POST",url:a.pkp.plugins.generic.tinymceplugin.uploadUrl,data:k,processData:!1,contentType:!1,headers:{"X-Csrf-Token":a.pkp.currentUser.csrfToken},success:function(t){d(t.url)},error:function(t){e(t.responseJSON.errorMessage)}})});b="undefined"!==typeof a.pkp.plugins.generic.tinymceplugin&&typeof a.pkp.plugins.generic.tinymceplugin.tinymceParams?
a.extend({},b,a.pkp.plugins.generic.tinymceplugin.tinymceParams):a.extend({},b);b.init_instance_callback=a.pkp.controllers.SiteHandler.prototype.triggerTinyMCEInitialized;b.setup=a.pkp.controllers.SiteHandler.prototype.triggerTinyMCESetup;tinyMCE.init(b)}};a.pkp.controllers.SiteHandler.prototype.triggerTinyMCEInitialized=function(b){a("#"+a.pkp.classes.Helper.escapeJQuerySelector(b.id)).trigger("tinyMCEInitialized",[b])};a.pkp.controllers.SiteHandler.prototype.triggerTinyMCESetup=function(b){var c=
a("#"+a.pkp.classes.Helper.escapeJQuerySelector(b.id));c.attr("readonly")&&(b.settings.readonly=!0);c.attr("wordCount")&&0<c.attr("wordCount")&&(b.settings.plugins+=",pkpwordcount",b.settings.statusbar=!0);c=c.attr("rows")||10;b.settings.height=(20*c).toString()+"px";b.on("init",function(d){var e=a("#"+d.id);var k=a("#"+d.id).attr("placeholder");if(""!==k){var t=a("<span></span>");t.html(k);t.addClass("mcePlaceholder");t.attr("id","mcePlaceholder-"+d.id);d.target.getContent().length&&t.hide();d=a("<div></div>");
d.addClass("mcePlaceholderParent");e.wrap(d);e.parent().append(t)}});b.on("activate",function(d){a("#mcePlaceholder-"+d.id).hide()});b.on("deactivate",function(d){d.target.getContent().length||a("#mcePlaceholder-"+d.id).show();d.target.dom.addClass(d.target.dom.select("li"),"show")});b.on("BeforeSetContent",function(d){var e=a.pkp.classes.TinyMCEHelper.prototype.getVariableMap("#"+a.pkp.classes.Helper.escapeJQuerySelector(b.id));d.content=d.content.replace(/\{\$([a-zA-Z]+)\}(?![^<]*>)/g,function(k,
t,m,y){return void 0!==e[t]?a.pkp.classes.TinyMCEHelper.prototype.getVariableElement(t,e[t],"#"+b.id).html():k})});b.on("SaveContent",function(d){var e=a("<div>"+d.content+"</div>");e.find(".pkpTag").replaceWith(function(){return"{$"+a(this).attr("data-symbolic")+"}"});d.content=e.html()});b.on("FullscreenStateChanged init",function(d){d=d.target;var e=a(d.editorContainer);d.plugins.fullscreen&&(d.plugins.fullscreen.isFullscreen()?e.find(".mce-toolbar[role='menubar']").show():e.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(b,c,d){window.location=d};a.pkp.controllers.SiteHandler.prototype.registerUnsavedFormElement_=function(b,c,d){b=a(d.target.lastElementChild).attr("id");-1==a.inArray(b,this.unsavedFormElements_)&&this.unsavedFormElements_.push(b)};a.pkp.controllers.SiteHandler.prototype.unregisterUnsavedFormElement_=function(b,
c,d){b=a(d.target.lastElementChild).attr("id");b=a.inArray(b,this.unsavedFormElements_);-1!==b&&delete this.unsavedFormElements_[b]};a.pkp.controllers.SiteHandler.prototype.unregisterAllFormElements_=function(){this.unsavedFormElements_=[]};a.pkp.controllers.SiteHandler.prototype.fetchNotificationHandler_=function(b,c,d){void 0!==d?this.showNotification_(d):a.ajax({url:this.options_.fetchNotificationUrl,data:this.options_.requestOptions,success:this.callbackWrapper(this.showNotificationResponseHandler_),
dataType:"json",async:!1})};a.pkp.controllers.SiteHandler.prototype.updateHeaderHandler_=function(b,c){a.pkp.classes.Handler.getHandler(a("#navigationUserWrapper")).reload()};a.pkp.controllers.SiteHandler.prototype.callWhenClickOutsideHandler_=function(b,c,d){void 0!==d.container&&(b=d.container.attr("id"),d.clear?delete this.outsideClickChecks_[b]:void 0!==d.callback&&(this.outsideClickChecks_[b]=d))};a.pkp.controllers.SiteHandler.prototype.mouseDownHandler_=function(b,c){var d;if(!a.isEmptyObject(this.outsideClickChecks_))for(d in this.outsideClickChecks_)this.processOutsideClickCheck_(this.outsideClickChecks_[d],
c);return!0};a.pkp.controllers.SiteHandler.prototype.processOutsideClickCheck_=function(b,c){if("click"!==c.type&&"mousedown"!==c.type&&"mouseup"!==c.type)throw Error("Can not check outside click with the passed event: "+c.type+".");var d=b.container;return d.is(":hidden")?!1:0===d.has(c.target).length?(delete this.outsideClickChecks_[d.attr("id")],b.callback(),!0):!1};a.pkp.controllers.SiteHandler.prototype.pageUnloadHandler_=function(b,c){var d;b=a.pkp.classes.Handler.getHandler(a("body"));c=0;
for(d in b.unsavedFormElements_)d&&c++;if(0<c)return a.pkp.locale.form_dataHasChanged};a.pkp.controllers.SiteHandler.prototype.isFormUnsaved=function(b){return null!==this.unsavedFormElements_&&void 0!==this.unsavedFormElements_[b]?!0:!1};a.pkp.controllers.SiteHandler.prototype.showNotificationResponseHandler_=function(b,c){this.showNotification_(c)};a.pkp.controllers.SiteHandler.prototype.showNotification_=function(b){var c,d;b=this.handleJson(b);if(!1!==b&&b.content.general)for(c in b=b.content.general,
b)for(d in b[c])new PNotify(b[c][d])};a.pkp.controllers.SiteHandler.prototype.handleNotifyEvent=function(b,c){new PNotify(c)};a.pkp.controllers.SiteHandler.prototype.openModal_=function(b,c,d,e){this.getHtmlElement().addClass("modal_is_visible")};a.pkp.controllers.SiteHandler.prototype.closeModal_=function(b,c,d,e){b=this.getHtmlElement();b.find(".pkp_modal.is_visible").length||b.removeClass("modal_is_visible")};a.pkp.controllers.SiteHandler.prototype.registerScrollingObserver_=function(b,c,d,e){a(document).scroll(e);
return!1};a.pkp.controllers.SiteHandler.prototype.unregisterScrollingObserver_=function(b,c,d,e){a(document).unbind("scroll",e);return!1}})(jQuery);(function(a){a.pkp.controllers.UrlInDivHandler=function(b,c){this.parent(b,c);this.sourceUrl_=c.sourceUrl;this.reload();c.refreshOn&&this.bindGlobal(c.refreshOn,this.reload)};a.pkp.classes.Helper.inherits(a.pkp.controllers.UrlInDivHandler,a.pkp.classes.Handler);a.pkp.controllers.UrlInDivHandler.sourceUrl_=null;a.pkp.controllers.UrlInDivHandler.prototype.reload=function(){a.get(this.sourceUrl_,this.callbackWrapper(this.handleLoadedContent_),"json")};a.pkp.controllers.UrlInDivHandler.prototype.getSourceUrl=
function(){return this.sourceUrl_};a.pkp.controllers.UrlInDivHandler.prototype.setSourceUrl=function(b){this.sourceUrl_=b};a.pkp.controllers.UrlInDivHandler.prototype.handleLoadedContent_=function(b,c){b=this.handleJson(c);var d=this;!0===b.status?void 0===b.content?this.getHtmlElement().hide():(/msie/.test(navigator.userAgent.toLowerCase())?this.html(b.content):(this.getHtmlElement().hide(),this.html(b.content),this.getHtmlElement().fadeIn(400)),a(function(){d.trigger("urlInDivLoaded",[d.getHtmlElement().attr("id")])})):
alert(b.content);return!1}})(jQuery);(function(a){a.pkp.controllers.EditorialActionsHandler=function(b,c){this.parent(b,c);b.find(".pkp_workflow_change_decision").click(this.callbackWrapper(this.showActions_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.EditorialActionsHandler,a.pkp.classes.Handler);a.pkp.controllers.EditorialActionsHandler.prototype.showActions_=function(b,c){this.getHtmlElement().find(".pkp_workflow_change_decision").hide();this.getHtmlElement().find(".pkp_workflow_decided_actions").show()}})(jQuery);(function(a){a.pkp.controllers.ExtrasOnDemandHandler=function(b,c){this.parent(b,c);a(".toggleExtras",b).click(this.callbackWrapper(this.toggleExtras))};a.pkp.classes.Helper.inherits(a.pkp.controllers.ExtrasOnDemandHandler,a.pkp.classes.Handler);a.pkp.controllers.ExtrasOnDemandHandler.prototype.toggleExtras=function(b,c){b=this.getHtmlElement();c.preventDefault();b.toggleClass("active");b.hasClass("active")&&(c=b.closest(".scrollable"),0<c.length&&this.scrollToMakeVisible_(b,c))};a.pkp.controllers.ExtrasOnDemandHandler.prototype.scrollToMakeVisible_=
function(b,c){var d=b.position().top;var e=c.position().top;var k=parseInt(c.scrollTop(),10);d>e?(b=Math.ceil(d+b.height()-c.height()),0<b&&c.scrollTop(k+b)):(k=Math.max(Math.floor(k+d-e),0),c.scrollTop(k))}})(jQuery);(function(a){a.pkp.controllers.PageHandler=function(b,c){this.parent(b,c);this.bind("redirectRequested",this.redirectToUrl);this.bind("notifyUser",this.redirectNotifyUserEventHandler_);this.bind("redirectDataChangedToGrid",this.redirectDataChangedEventHandler_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.PageHandler,a.pkp.classes.Handler);a.pkp.controllers.PageHandler.prototype.redirectToUrl=function(b,c,d){window.location=d};a.pkp.controllers.PageHandler.prototype.redirectNotifyUserEventHandler_=
function(b,c,d){!0===d.status?this.getHtmlElement().parent().trigger("notifyUser",[d]):a.pkp.classes.notification.NotificationHelper.redirectNotifyUserEvent(this,d)};a.pkp.controllers.PageHandler.prototype.redirectDataChangedEventHandler_=function(b,c,d){b=a("a",c.target);var e=a.pkp.classes.Handler.getHandler(b).getUrl();b=a(".pkp_controllers_grid",this.getHtmlElement()).filter(function(){var k=0;a(this).find("a").each(function(){a(this).attr("href")==e&&k++});return 0<k});0<b.length&&b.each(function(){a(this).trigger("dataChanged",
[d])})}})(jQuery);(function(a){a.pkp.controllers.TabHandler=function(b,c){var d,e=this;this.parent(b,c);this.bind("tabsbeforeactivate",this.tabsBeforeActivate);this.bind("tabsactivate",this.tabsActivate);this.bind("tabscreate",this.tabsCreate);this.bind("tabsbeforeload",this.tabsBeforeLoad);this.bind("tabsload",this.tabsLoad);this.bind("containerReloadRequested",this.tabsReloadRequested);this.bind("addTab",this.addTab);c.emptyLastTab&&(this.emptyLastTab_=c.emptyLastTab);var k=document.location.toString();if(k.match("#")){k=
k.split("#")[1];var t=b.find("li a");for(d=0;d<t.length;d++)k==t[d].getAttribute("name")&&(c.selected=d)}b.tabs({beforeLoad:function(m,y){y.ajaxSettings.dataType="json";y.jqXHR.setRequestHeader("Accept","application/json");y.ajaxSettings.dataFilter=e.callbackWrapper(e.dataFilter)},disabled:c.disabled,active:c.selected});window.addEventListener("hashchange",function(m){m=m.newURL.split("#");2>m.length||(m=b.find('li > a[name="'+m[1]+'"]'),m.length&&m.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(b,c,d){var e=!1;this.$currentTab_.find("form").each(function(k){if(a.pkp.classes.Handler.getHandler(a("#"+a(this).attr("id"))).formChangesTracked)return e=!0,!1});this.$currentTab_.find(".hasDatepicker").datepicker("hide");if(e)if(confirm(a.pkp.locale.form_dataHasChanged))this.trigger("unregisterAllForms");
else return!1;this.emptyLastTab_&&(a(window).one("error",function(k,t,m){return!1}),this.$currentTab_&&(this.unbindPartial(this.$currentTab_),this.$currentTab_.empty()));return!0};a.pkp.controllers.TabHandler.prototype.tabsCreate=function(b,c,d){this.currentTabIndex_=d.tab.index();this.$currentTab_=d.panel.jquery?d.panel:a(d.panel);return!0};a.pkp.controllers.TabHandler.prototype.tabsActivate=function(b,c,d){this.currentTabIndex_=d.newTab.index();this.$currentTab_=d.newPanel.jquery?d.newPanel:a(d.newPanel);
return!0};a.pkp.controllers.TabHandler.prototype.tabsLoad=function(b,c,d){return!0};a.pkp.controllers.TabHandler.prototype.tabsBeforeLoad=function(b,c,d){this.unbindPartial(a("#"+d.tab.attr("aria-controls")));d.ajaxSettings.cache=!1;d.ajaxSettings.dataFilter=this.callbackWrapper(this.dataFilter)};a.pkp.controllers.TabHandler.prototype.dataFilter=function(b,c){b=this.handleJson(a.parseJSON(c));return!1===b?"":JSON.stringify(b.content)};a.pkp.controllers.TabHandler.prototype.tabsReloadRequested=function(b,
c,d){this.getHtmlElement();var e=this;a.get(d.tabsUrl,function(k){e.replaceWith(k.content)})};a.pkp.controllers.TabHandler.prototype.addTab=function(b,c,d){var e=this.getHtmlElement();b=e.children("ul").children("li").length+1;c=a("<a/>").text(d.title).attr("href",d.url);d=a("<a/>").addClass("close").text(a.pkp.locale.common_close).attr("href","#");c=a("<li/>").append(c).append(d);d.click(function(){var k=a(this).closest("li"),t=a("#"+k.attr("aria-controls"));var m=!1;t.find("form").each(function(){if(a.pkp.classes.Handler.getHandler(a(this)).formChangesTracked&&
!confirm(a.pkp.locale.form_dataHasChanged))return m=!0,!1});if(!m){t.find("form").each(function(){var C=a.pkp.classes.Handler.getHandler(a(this));C&&C.unregisterForm()});var y=k.eq(0).index();e.tabs("option","active")==y&&e.tabs("option","active",y-1);k.remove();t.remove();e.tabs("refresh")}});e.children("ul").append(c);e.tabs("refresh");e.tabs("option","active",b-1)};a.pkp.controllers.TabHandler.prototype.getCurrentTab=function(){return this.$currentTab_};a.pkp.controllers.TabHandler.prototype.getCurrentTabIndex=
function(){return this.currentTabIndex_}})(jQuery);(function(a){a.pkp.controllers.MenuHandler=function(b,c){this.parent(b,c);var d=this;setTimeout(function(){d.callbackWrapper(d.setDropdownAlignment())},1);a(window).resize(this.callbackWrapper(this.onResize));this.getHtmlElement().on("focus mouseenter",'[aria-haspopup="true"]',function(e){a(e.currentTarget).attr("aria-expanded","true")});this.getHtmlElement().on("blur mouseleave",'[aria-haspopup="true"]',function(e){a(e.currentTarget).attr("aria-expanded","false")})};a.pkp.classes.Helper.inherits(a.pkp.controllers.MenuHandler,
a.pkp.classes.Handler);a.pkp.controllers.MenuHandler.prototype.setDropdownAlignment=function(){a(this);var b=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c=Math.max(document.documentElement.clientHeight,window.innerHeight||0);this.getHtmlElement().find('[aria-haspopup="true"]').each(function(){var d=a(this),e=d.children("ul");d.offset().left+e.outerWidth()>b?d.addClass("align_right"):d.removeClass("align_right");e.attr("style","");var k=d.offset().top;var t=0;d.hasClass("submenuOpensBelow")&&
(t=k+d.outerHeight());var m=k+e.outerHeight();if(m>c){m-=c;var y=k-m;y<t&&(m=0<t?t:-Math.abs(m)-y,e.css("overflow-y","scroll"),e.css("bottom",-Math.abs(c-k-d.outerHeight())+"px"));e.css("top",m+"px")}})};a.pkp.controllers.MenuHandler.prototype.onResize=function(){clearTimeout(this.resize_check);this.resize_check=setTimeout(this.callbackWrapper(this.setDropdownAlignment),1E3)}})(jQuery);(function(a){a.pkp.controllers.UploaderHandler=function(b,c){this.parent(b,c);if(!b.is("div"))throw Error("An uploader widget controller can only be attached to a div!");var d={url:c.uploadUrl,flash_swf_url:c.baseUrl+"/lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.swf",silverlight_xap_url:c.baseUrl+"/lib/pkp/lib/vendor/moxiecode/plupload/js/Moxie.xap"};typeof c.filters&&(d.filters=c.filters);typeof c.resize&&(d.resize=c.resize);typeof c.browse_button&&(d.browse_button=c.browse_button);typeof c.multipart_params&&
(d.multipart_params=c.multipart_params);d=a.extend({},this.self("DEFAULT_PROPERTIES_"),d);this.pluploader=new plupload.Uploader(d);this.pluploader.init();this.updateStatus("waiting");this.$progress=b.find(".pkpUploaderProgress .percentage");this.$progressBar=b.find(".pkpUploaderProgressBar");this.$fileName=b.find(".pkpUploaderFilename");this.pluploader.bind("FilesAdded",this.callbackWrapper(this.startUpload));this.pluploader.bind("UploadProgress",this.callbackWrapper(this.updateProgress));this.pluploader.bind("Error",
this.callbackWrapper(this.handleError));this.pluploader.bind("FileUploaded",this.callbackWrapper(this.uploadComplete));this.pluploader.bind("QueueChanged",this.callbackWrapper(this.refreshUploader));var e=a("#"+d.browse_button,this.getHtmlElement());e.click(function(t){return!1});this.pluploader.refresh();var k=this;setTimeout(function(){k.getHtmlElement().find(".moxie-shim input").focus(function(t){e.addClass("in_focus")}).blur(function(t){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(b,c,d){1<c.files.length&&c.removeFile(c.files[0]);this.updateStatus("uploading");c.start()};a.pkp.controllers.UploaderHandler.prototype.updateProgress=function(b,c,d){this.$progress.html(d.percent);this.$progressBar.css("width",d.percent+"%")};a.pkp.controllers.UploaderHandler.prototype.uploadComplete=function(b,c,d,e){b=a.parseJSON(e.response);c=d.name;b.status?("undefined"!==typeof b.uploadedFile&&(c=b.uploadedFile.name||
b.uploadedFile.fileLabel,d.storedData=b.uploadedFile),this.$fileName.html(c),this.updateStatus("complete"),this.$progress.html("0"),this.$progressBar.css("width",0)):this.showError(b.content)};a.pkp.controllers.UploaderHandler.prototype.handleError=function(b,c,d){this.showError(d.message)};a.pkp.controllers.UploaderHandler.prototype.showError=function(b){this.$progress.html("0");this.$progressBar.css("width",0);this.updateStatus("error");this.getHtmlElement().find(".pkpUploaderError").html(b)};a.pkp.controllers.UploaderHandler.prototype.refreshUploader=
function(b,c,d){c.refresh()};a.pkp.controllers.UploaderHandler.prototype.updateStatus=function(b){this.getHtmlElement().removeClass("loading waiting uploading error complete").addClass(b)};a.pkp.controllers.UploaderHandler.DEFAULT_PROPERTIES_={runtimes:"html5,flash,silverlight,html4",max_file_size:a.pkp.cons.UPLOAD_MAX_FILESIZE,multi_selection:!1,file_data_name:"uploadedFile",multipart:!0,headers:{browser_user_agent:navigator.userAgent},browse_button:"pkpUploaderButton",drop_element:"pkpUploaderDropZone"}})(jQuery);(function(a){a.pkp.controllers.AutocompleteHandler=function(b,c){this.parent(b,c);this.sourceUrl_=c.sourceUrl;c.sourceUrl=void 0;this.disableSync_=c.disableSync;var d={};d.source=this.callbackWrapper(this.fetchAutocomplete);d.appendTo="#"+b.attr("id");c=a.extend({},this.self("DEFAULT_PROPERTIES_"),d,c);this.textInput=b.find(":text");this.disableSync_||this.textInput.keyup(this.callbackWrapper(this.synchronizeFields_));this.textInput.autocomplete(c);this.hiddenInput_=b.find("input:hidden");this.bind("autocompleteselect",
this.itemSelected);this.bind("autocompletefocus",this.itemFocused);this.textInput.blur(this.callbackWrapper(this.textInputBlurHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.AutocompleteHandler,a.pkp.classes.Handler);a.pkp.controllers.AutocompleteHandler.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(b,c,d){b=this.hiddenInput_;c=this.textInput;""!==d.item.value&&(b.val(d.item.value),c.val(d.item.label));return!1};a.pkp.controllers.AutocompleteHandler.prototype.itemFocused=function(b,c,d){b=this.textInput;""!==d.item.value&&b.val(d.item.label);return!1};a.pkp.controllers.AutocompleteHandler.prototype.fetchAutocomplete=function(b,c,d){var e=this.textInput;e.addClass("spinner");a.post(this.getAutocompleteUrl(),{term:c.term},
function(k){e.removeClass("spinner");d(k.content)},"json")};a.pkp.controllers.AutocompleteHandler.prototype.getAutocompleteUrl=function(){return this.sourceUrl_};a.pkp.controllers.AutocompleteHandler.prototype.setAutocompleteUrl=function(b){this.sourceUrl_=b};a.pkp.controllers.AutocompleteHandler.prototype.textInputBlurHandler_=function(b,c,d){""===this.hiddenInput_.val()&&this.textInput.val("")};a.pkp.controllers.AutocompleteHandler.prototype.synchronizeFields_=function(){this.hiddenInput_.val(String(this.textInput.val()))}})(jQuery);(function(a){a.pkp.controllers.RevealMoreHandler=function(b,c){this.parent(b,c);b.outerHeight()>c.height&&(b.addClass("isHidden").css("max-height",c.height+"px"),a(".revealMoreButton",b).click(this.callbackWrapper(this.revealMore)))};a.pkp.classes.Helper.inherits(a.pkp.controllers.RevealMoreHandler,a.pkp.classes.Handler);a.pkp.controllers.RevealMoreHandler.prototype.revealMore=function(b,c){this.getHtmlElement().removeClass("isHidden").removeAttr("style");c.preventDefault();c.stopPropagation()}})(jQuery);(function(a){a.pkp.controllers.NotificationHandler=function(b,c){this.parent(b,c);this.options_=c;this.bind("notifyUser",this.fetchNotificationHandler_);this.getHtmlElement().hide();this.getHtmlElement().triggerHandler("notifyUser");this.options_.refreshOn&&this.bindGlobal(this.options_.refreshOn,this.fetchNotificationHandler_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.NotificationHandler,a.pkp.classes.Handler);a.pkp.controllers.NotificationHandler.prototype.options_=null;a.pkp.controllers.NotificationHandler.prototype.trivialTimer_=
null;a.pkp.controllers.NotificationHandler.prototype.fetchNotificationHandler_=function(){var b={};b.requestOptions=this.options_.requestOptions;a.ajax({type:"POST",url:this.options_.fetchNotificationUrl,data:b,success:this.callbackWrapper(this.showNotificationResponseHandler_),dataType:"json",async:!1})};a.pkp.controllers.NotificationHandler.prototype.showNotificationResponseHandler_=function(b,c){clearTimeout(this.trivialTimer_);b=this.getHtmlElement();var d=this.handleJson(c),e;if(!1!==d)if(d.content.inPlace){var k=
this.concatenateNotifications_(d.content.inPlace);c=this.removeAlreadyShownNotifications_(d);this.unbindPartial(b);b.html(k);b.show();d=this.getTrivialNotifications_(d.content.inPlace);if(!this.visibleWithoutScrolling_()&&c)for(e in b.parent().trigger("notifyUser",[c]),d)b=d[e],b=a("#pkp_notification_"+b,this.getHtmlElement()),this.unbindPartial(b),b.remove();0===b.children().length?b.hide():this.addTimerToNotifications(d)}else this.unbindPartial(this.getHtmlElement()),this.getHtmlElement().empty(),
this.getHtmlElement().hide()};a.pkp.controllers.NotificationHandler.prototype.visibleWithoutScrolling_=function(){var b=this.getHtmlElement(),c=b.offset().top+this.getHtmlElement().height()/2,d=a(window).scrollTop(),e=d+a(window).height(),k=b.parents(".ui-dialog-content");return 0<k.length&&(b=k.offset().top,k=b+k.height(),c<b||c>k)?!1:c<d||c>e?!1:!0};a.pkp.controllers.NotificationHandler.prototype.removeAlreadyShownNotifications_=function(b){var c=!0,d,e;for(d in b.content.inPlace)for(e in b.content.inPlace[d]){var k=
a("#pkp_notification_"+e);0<k.length?(delete b.content.inPlace[d][e],delete b.content.general[d][e]):c=!1}return c?!1:b};a.pkp.controllers.NotificationHandler.prototype.concatenateNotifications_=function(b){var c="",d,e;for(d in b)for(e in b[d])c+=b[d][e];return c};a.pkp.controllers.NotificationHandler.prototype.getTrivialNotifications_=function(b){var c=[],d,e;for(d in b)if(1==d)for(e in b[d])c.push(e);return c};a.pkp.controllers.NotificationHandler.prototype.addTimerToNotifications=function(b){var c=
this;var d=function(){var e=a(this);c.unbindPartial(e);e.remove()};b.length&&(this.trivialTimer_=setTimeout(function(){var e;for(e in b){var k=a("#pkp_notification_"+b[e]);k.fadeOut(400,d)}},6E3))}})(jQuery);(function(a){a.pkp.controllers.HelpPanelHandler=function(b,c){this.parent(b,{});a("body").click(function(d){var e=a(d.target);if(e.hasClass("requestHelpPanel")||e.parents(".requestHelpPanel").length)d.preventDefault(),d=a.extend({},e.data(),{caller:e}),b.trigger("pkp.HelpPanel.Open",d)});b.find(".pkpCloseHelpPanel").click(function(d){d.preventDefault();b.trigger("pkp.HelpPanel.Close")});b.find(".pkpHomeHelpPanel").click(function(d){d.preventDefault();b.trigger("pkp.HelpPanel.Home")});b.find(".pkpPreviousHelpPanel").click(this.callbackWrapper(function(d){this.loadHelpContent_(this.previousTopic_,
this.helpLocale_)}));b.find(".pkpNextHelpPanel").click(this.callbackWrapper(function(d){this.loadHelpContent_(this.nextTopic_,this.helpLocale_)}));b.on("pkp.HelpPanel.Open",this.callbackWrapper(this.openPanel_)).on("pkp.HelpPanel.Close",this.callbackWrapper(this.closePanel_)).on("pkp.HelpPanel.Home",this.callbackWrapper(this.homePanel_));this.helpUrl_=c.helpUrl;this.helpLocale_=c.helpLocale};a.pkp.classes.Helper.inherits(a.pkp.controllers.HelpPanelHandler,a.pkp.classes.Handler);a.pkp.controllers.HelpPanelHandler.prototype.caller_=
null;a.pkp.controllers.HelpPanelHandler.prototype.helpUrl_=null;a.pkp.controllers.HelpPanelHandler.prototype.helpLocale_=null;a.pkp.controllers.HelpPanelHandler.prototype.currentTopic_=null;a.pkp.controllers.HelpPanelHandler.prototype.previousTopic_=null;a.pkp.controllers.HelpPanelHandler.prototype.nextTopic_=null;a.pkp.controllers.HelpPanelHandler.prototype.requestedSection_=null;a.pkp.controllers.HelpPanelHandler.prototype.openPanel_=function(b,c,d){var e=this.getHtmlElement();"undefined"!==typeof d.caller&&
(this.caller_=d.caller);e.addClass("is_visible");a("body").addClass("help_panel_is_visible");e.on("click.pkp.HelpPanel keyup.pkp.HelpPanel",this.callbackWrapper(this.handleWrapperEvents));e.on("click.pkp.HelpPanelContentLink",".content a",this.callbackWrapper(this.handleContentLinks_));this.loadHelpContent_(d.topic,this.helpLocale_);this.requestedSection_=d.section||"";setTimeout(function(){e.focus()},300)};a.pkp.controllers.HelpPanelHandler.prototype.loadHelpContent_=function(b,c){c=c||this.helpLocale_;
this.currentTopic_=b||"";b=this.helpUrl_+"/index/"+c+"/";this.getHtmlElement().addClass("is_loading");b+=encodeURIComponent(this.currentTopic_).replace(/%2F/g,"/");a.get(b,null,this.callbackWrapper(this.updateContentHandler_),"json")};a.pkp.controllers.HelpPanelHandler.prototype.updateContentHandler_=function(b,c){c=this.handleJson(c).content;var d=this.getHtmlElement();this.currentTopic_.indexOf("#");b=d.find(".panel");this.previousTopic_=c.previous;this.nextTopic_=c.next;d.find(".content").replaceWith('<div class="content">'+
c.content+"</div>");b.scrollTop(0);this.requestedSection_&&(c=d.find('a[name="'+this.requestedSection_+'"]'),c.length&&b.scrollTop(c.offset().top-50));this.getHtmlElement().removeClass("is_loading")};a.pkp.controllers.HelpPanelHandler.prototype.handleContentLinks_=function(b,c){b=a(b).attr("href");c.preventDefault();if("http"==b.substring(0,4))return window.open(b),!1;b=b.split("/");c=b.slice(1).join("/");b=b[0];if(-1<c.indexOf("#")){var d=c.split("#");c=d[0];this.requestedSection_=d[1]}this.loadHelpContent_(c,
b);return!1};a.pkp.controllers.HelpPanelHandler.prototype.closePanel_=function(){var b=this.getHtmlElement();b.removeClass("is_visible");a("body").removeClass("help_panel_is_visible");b.find(".content").empty();null!==this.caller_&&this.caller_.focus();b.off("click.pkp.HelpPanel keyup.pkp.HelpPanel");b.off("click.pkp.HelpPanelContentLink",".content a");this.caller_=null};a.pkp.controllers.HelpPanelHandler.prototype.homePanel_=function(){this.loadHelpContent_(null,this.helpLocale_)};a.pkp.controllers.HelpPanelHandler.prototype.handleWrapperEvents=
function(b,c){b=this.getHtmlElement();"click"==c.type&&b.is(a(c.target))?b.trigger("pkp.HelpPanel.Close"):"keyup"==c.type&&27==c.which&&b.trigger("pkp.HelpPanel.Close")}})(jQuery);(function(a){a.pkp.controllers.form=a.pkp.controllers.form||{};a.pkp.controllers.form.FormHandler=function(b,c){var d;this.parent(b,c);if(!b.is("form"))throw Error("A form handler controller can only be bound to an HTML form element!");c.submitHandler&&(this.callerSubmitHandler_=c.submitHandler);b.find(".datepicker").each(function(){var e=a(this);e.datepicker({altField:"#"+e.prop("id")+"-altField",altFormat:"yy-mm-dd",dateFormat:a("#"+e.prop("id")+"-altField").attr("data-date-format")});e.prop("name",
e.prop("name")+"-removed")});c.cancelRedirectUrl&&(this.cancelRedirectUrl_=c.cancelRedirectUrl);"undefined"!==typeof c.trackFormChanges&&(this.trackFormChanges=c.trackFormChanges);c.disableControlsOnSubmit&&(this.disableControlsOnSubmit=c.disableControlsOnSubmit);c.enableDisablePairs&&(this.enableDisablePairs_=c.enableDisablePairs,this.setupEnableDisablePairs());for(d in this.enableDisablePairs_)b.find("[id^='"+d+"']").trigger("updatePair");c=b.validate({onfocusout:this.callbackWrapper(this.onFocusOutValidation_),
errorClass:"error",highlight:function(e,k){a(e).parent().parent().addClass(k)},unhighlight:function(e,k){a(e).parent().parent().removeClass(k)},submitHandler:this.callbackWrapper(this.submitHandler_),showErrors:this.callbackWrapper(this.showErrors),errorPlacement:function(e,k){k.is(":checkbox")?k.parent().closest(":not(label)").append(e):e.insertAfter(k)}});a("[id^='cancelFormButton-']",b).click(this.callbackWrapper(this.cancelForm));b.find(".showMore, .showLess").bind("click",this.switchViz);c.checkForm()?
this.trigger("formValid"):this.trigger("formInvalid");a(".pkpEditableToggle",b).click(this.callbackWrapper(this.toggleEditableControl));this.initializeTinyMCE();a("[id^='submitFormButton']",b).click(this.callbackWrapper(this.pushTinyMCEChanges_));a(":input",b).change(this.callbackWrapper(this.formChange));this.bind("formChange",this.callbackWrapper(this.formChange));b.click(this.callbackWrapper(this.hideDatepicker_));this.publishEvent("tinyMCEInitialized");this.bind("tinyMCEInitialized",this.tinyMCEInitHandler_);
this.bind("containerClose",this.containerCloseHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.FormHandler,a.pkp.classes.Handler);a.pkp.controllers.form.FormHandler.prototype.disableControlsOnSubmit=!1;a.pkp.controllers.form.FormHandler.prototype.trackFormChanges=!0;a.pkp.controllers.form.FormHandler.prototype.callerSubmitHandler_=null;a.pkp.controllers.form.FormHandler.prototype.cancelRedirectUrl_=null;a.pkp.controllers.form.FormHandler.prototype.formChangesTracked=!1;a.pkp.controllers.form.FormHandler.prototype.enableDisablePairs_=
null;a.pkp.controllers.form.FormHandler.prototype.showErrors=function(b,c,d){"undefined"!==typeof tinyMCE&&tinyMCE.EditorManager.triggerSave();var e=a.extend(!0,{},b);setTimeout(this.callbackWrapper(function(){e.defaultShowErrors();e=null}),250);b.checkForm()?this.trigger("formValid"):(this.trigger("formInvalid"),this.enableFormControls())};a.pkp.controllers.form.FormHandler.prototype.formChange=function(b,c){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(b,c){this.unregisterForm();this.trigger("formCanceled");
return!1};a.pkp.controllers.form.FormHandler.prototype.unregisterForm=function(){this.formChangesTracked=!1;this.trigger("unregisterChangedForm")};a.pkp.controllers.form.FormHandler.prototype.setupEnableDisablePairs=function(){var b=this.getHtmlElement(),c;for(c in this.enableDisablePairs_)a(b).find("[id^='"+c+"']").bind("click updatePair",this.callbackWrapper(this.toggleDependentElement_));return!0};a.pkp.controllers.form.FormHandler.prototype.submitFormWithoutValidation=function(b){b.settings.submitHandler=
null;this.disableFormControls();this.getHtmlElement().submit();this.formChangesTracked=!1};a.pkp.controllers.form.FormHandler.prototype.hideSpinner=function(){this.getHtmlElement().find(".formButtons .pkp_spinner").removeClass("is_visible")};a.pkp.controllers.form.FormHandler.prototype.toggleEditableControl=function(b,c){c.preventDefault();b=a(b).parents('[data-pkp-editable="true"]');b.length&&b.toggleClass("isEditing")};a.pkp.controllers.form.FormHandler.prototype.submitHandler_=function(b,c){var d=
!1;a(c).find(".formWidget").each(function(){var e=new a.Event("formSubmitRequested");d||(a(this).trigger(e),d=e.isDefaultPrevented())});d||(a(c).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(b,c)):this.submitFormWithoutValidation(b))};a.pkp.controllers.form.FormHandler.prototype.pushTinyMCEChanges_=
function(b,c){"undefined"!==typeof tinyMCE&&tinyMCE.EditorManager.triggerSave();return!0};a.pkp.controllers.form.FormHandler.prototype.toggleDependentElement_=function(b,c){c=this.getHtmlElement();var d=a(b).attr("id");c=a(c).find("[id^='"+this.enableDisablePairs_[d]+"']");a(b).is(":checked")?a(c).prop("disabled",!1):a(c).prop("disabled",!0);return!0};a.pkp.controllers.form.FormHandler.prototype.tinyMCEInitHandler_=function(b,c,d){var e=d.id;d.on("blur",this.callbackWrapper(function(k){k.save();k=
this.getHtmlElement();var t=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(e),k);k.validate().element(t)}))};a.pkp.controllers.form.FormHandler.prototype.containerCloseHandler=function(b,c,d){a(this.getHtmlElement()).find(".hasDatepicker").datepicker("hide");if(this.formChangesTracked)if(confirm(a.pkp.locale.form_dataHasChanged))this.trigger("unregisterAllForms");else return d.closePermitted=!1;"undefined"!==typeof d&&(d.closePermitted=!0);return!0};a.pkp.controllers.form.FormHandler.prototype.onFocusOutValidation_=
function(b,c){var d=this.getHtmlElement();a(c).parents("#"+d.attr("id")).length&&b.element(c);return!0};a.pkp.controllers.form.FormHandler.prototype.hideDatepicker_=function(b,c){b=c.originalEvent;"undefined"!=typeof b&&(b=b.target,c=this.getHtmlElement(),a(b).hasClass("hasDatepicker")||a(b).hasClass("ui-datepicker")||a(b).hasClass("ui-icon")||a(b).hasClass("ui-datepicker-next")||a(b).hasClass("ui-datepicker-prev")||a(b).parent().parents(".ui-datepicker").length||a(c).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(b,c){this.parent(b,c);this.eventName_=c.eventName;this.defaultKey_=c.defaultKey;this.publishEvent(this.eventName_);this.getOptionsUrl_=c.getOptionsUrl;this.trackFormChanges=!1;b.find("select").change(this.callbackWrapper(this.selectOptionHandler_));this.loadOptions_();this.bind("containerReloadRequested",this.containerReloadHandler_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.DropdownHandler,a.pkp.classes.Handler);a.pkp.controllers.form.DropdownHandler.prototype.eventName_=
null;a.pkp.controllers.form.DropdownHandler.prototype.defaultKey_=null;a.pkp.controllers.form.DropdownHandler.prototype.currentKey_=null;a.pkp.controllers.form.DropdownHandler.prototype.getOptionsUrl_=null;a.pkp.controllers.form.DropdownHandler.prototype.selectOptionHandler_=function(b,c){this.trigger(this.eventName_,[a(b).val()])};a.pkp.controllers.form.DropdownHandler.prototype.loadOptions_=function(){a.get(this.getOptionsUrl_,this.callbackWrapper(this.setOptionList_),"json")};a.pkp.controllers.form.DropdownHandler.prototype.setOptionList_=
function(b,c){b=this.handleJson(c);c=this.getHtmlElement().find("select");var d;for(d in b.content){var e=a("<option/>");e.attr("value",d);if(this.defaultKey_==d||this.currentKey_==d)e.attr("selected","selected"),this.trigger(this.eventName_,[d]);e.text(b.content[d]);c.append(e)}this.trigger("dropDownOptionSet")};a.pkp.controllers.form.DropdownHandler.prototype.containerReloadHandler_=function(b,c){b=this.getHtmlElement().find("select");this.currentKey_=b.find("option:selected").attr("value");b.find('option[value!="0"]').remove();
this.loadOptions_()}})(jQuery);(function(a){a.pkp.controllers.form.AjaxFormHandler=function(b,c){c.submitHandler=this.submitForm;this.parent(b,c);"undefined"!==typeof c.confirmText&&(this.confirmText=c.confirmText);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.confirmText=
"";a.pkp.controllers.form.AjaxFormHandler.prototype.submitForm=function(b,c){b=this.getHtmlElement();this.disableFormControls();this.confirmText.length&&!confirm(this.confirmText)||a.post(b.attr("action"),b.serialize(),this.callbackWrapper(this.handleResponse),"json")};a.pkp.controllers.form.AjaxFormHandler.prototype.refreshFormHandler_=function(b,c,d){d&&this.replaceWith(d)};a.pkp.controllers.form.AjaxFormHandler.prototype.handleResponse=function(b,c){c=this.handleJson(c);if(!1!==c)if(""===c.content)b=
new a.Event("formSubmitted"),a(this.getHtmlElement()).find(".formWidget").trigger(b),this.trigger("formSubmitted"),this.publishChangeEvents(),this.disableControlsOnSubmit&&this.enableFormControls();else{if(void 0!==c.reloadContainer)return this.trigger("dataChanged"),this.trigger("containerReloadRequested",[c]),c.status;this.replaceWith(c.content)}else this.enableFormControls();this.trigger("notifyUser",[this.getHtmlElement()]);this.hideSpinner();return c.status}})(jQuery);(function(a){a.pkp.controllers.form.ClientFormHandler=function(b,c){c.submitHandler=this.submitForm;this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.ClientFormHandler,a.pkp.controllers.form.FormHandler);a.pkp.controllers.form.ClientFormHandler.prototype.submitForm=function(b,c){b=this.getHtmlElement().serializeArray();b.push({name:"clientSubmit",value:!0});this.trigger("formSubmitted",[a.param(b)])}})(jQuery);(function(a){a.pkp.controllers.form.ToggleFormHandler=function(b){this.parent(b,{trackFormChanges:!1});b.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(b,c){this.parent(b,c);if(void 0===c.readOnly||null===c.readOnly)void 0!==c.resetUploader&&(this.resetUploader_=c.resetUploader),void 0!==c.$preview&&c.$preview.length&&(this.$preview=c.$preview,this.bind("fileDeleted",this.callbackWrapper(this.fileDeleted))),this.attachUploader_(c.$uploader,c.uploaderOptions),this.uploaderSetup(c.$uploader)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.FileUploadFormHandler,a.pkp.controllers.form.AjaxFormHandler);
a.pkp.controllers.form.FileUploadFormHandler.prototype.resetUploader_=!1;a.pkp.controllers.form.FileUploadFormHandler.prototype.$preview=!1;a.pkp.controllers.form.FileUploadFormHandler.prototype.handleResponse=function(b,c){if(this.resetUploader_){var d=a("#plupload",this.getHtmlElement()).plupload("getUploader");d.splice();d.refresh();a("#temporaryFileId",this.getHtmlElement()).val("")}return this.parent("handleResponse",b,c)};a.pkp.controllers.form.FileUploadFormHandler.prototype.uploaderSetup=
function(b){a.pkp.classes.Handler.getHandler(b).pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse))};a.pkp.controllers.form.FileUploadFormHandler.prototype.handleUploadResponse=function(b,c,d,e){b=this.handleJson(a.parseJSON(e.response));!1!==b&&(this.trigger("fileUploaded",[b.uploadedFile]),this.$preview&&this.$preview.hide(),""===b.content?(c=this.getHtmlElement(),c=c.find("#temporaryFileId"),c.val(b.temporaryFileId)):this.replaceWith(b.content))};a.pkp.controllers.form.FileUploadFormHandler.prototype.fileDeleted=
function(){this.$preview&&this.$preview.hide()};a.pkp.controllers.form.FileUploadFormHandler.prototype.attachUploader_=function(b,c){b.pkpHandler("$.pkp.controllers.UploaderHandler",c)}})(jQuery);(function(a){a.pkp.controllers.form.MultilingualInputHandler=function(b,c){this.parent(b,c);(b.hasClass("pkpTagit")?b.find(":input").filter(":visible"):b.find(":input").first()).focus(this.callbackWrapper(this.focusHandler_));b.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(b,c){this.showPopover_()};a.pkp.controllers.form.MultilingualInputHandler.prototype.blurHandler_=function(b,c){setTimeout(this.callbackWrapper(function(){this.hasElementInFocus_()||this.hidePopover_()}),100);return!0};a.pkp.controllers.form.MultilingualInputHandler.prototype.hidePopover_=function(){var b=this.getHtmlElement();b.removeClass("localization_popover_container_focus");b.find(".localization_popover").hide();
this.isIncomplete_()};a.pkp.controllers.form.MultilingualInputHandler.prototype.showPopover_=function(){var b=this.getHtmlElement();b.addClass("localization_popover_container_focus");b.find(".localization_popover").width(b.width());b.find(".localization_popover").show()};a.pkp.controllers.form.MultilingualInputHandler.prototype.hasElementInFocus_=function(){return this.getHtmlElement().has(document.activeElement).length?!0:!1};a.pkp.controllers.form.MultilingualInputHandler.prototype.isIncomplete_=
function(){var b=this.getHtmlElement(),c=[],d=0;"undefined"!==typeof tinyMCE&&(this.getHtmlElement().find(".richContent").length?b.find("textarea").each(function(){a(this).attr("id");c.push(a(this));tinyMCE.EditorManager.get(a(this).attr("id")).getContent()&&d++}):(c=b.find(":input"),c.each(function(){a(this).val()&&d++})),0<d&&d<c.length?b.removeClass("localizationComplete").addClass("localizationIncomplete"):d===c.length?b.removeClass("localizationIncomplete").addClass("localizationComplete"):b.removeClass("localizationIncomplete localizationComplete"))};
a.pkp.controllers.form.MultilingualInputHandler.prototype.tinyMCEInitHandler_=function(){if(this.getHtmlElement().find(".richContent").length&&"undefined"!==typeof tinyMCE){var b=this.getHtmlElement(),c=tinyMCE.EditorManager.get(b.find("textarea").first().attr("id"));c.on("focus",this.callbackWrapper(function(){this.trigger("callWhenClickOutside",{container:this.getHtmlElement(),callback:this.callbackWrapper(this.hidePopover_)});this.showPopover_()}));c.on("blur",this.callbackWrapper(function(){if(a(c.getContainer()).find("iframe").attr("id")==
a(document.activeElement).attr("id"))return!1;setTimeout(this.callbackWrapper(function(){this.hasElementInFocus_()||this.hidePopover_()}),0)}))}}})(jQuery);(function(a){a.pkp.controllers.form.CancelActionAjaxFormHandler=function(b,c){var d=this;this.parent(b,c);this.cancelUrl_=c.cancelUrl;this.cancelActionHandler=function(){d.handleCancelAction()};a(window).on("unload",this.cancelActionHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.CancelActionAjaxFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.cancelActionHandler=null;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.cancelUrl_=
null;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.isComplete_=!1;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.containerCloseHandler=function(b,c){this.handleCancelAction();return this.parent("containerCloseHandler",b,c)};a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.submitForm=function(b,c){this.isComplete_=!0;this.parent("submitForm",b,c)};a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.handleCancelAction=function(){null!==this.cancelActionHandler&&
(a(window).off("unload",this.cancelActionHandler),this.cancelActionHandler=null);this.isComplete_||null===this.cancelUrl_||a.post(this.cancelUrl_)}})(jQuery);(function(a){a.pkp.controllers.form.UserFormHandler=function(b,c){this.parent(b,c);c.fetchUsernameSuggestionUrl&&c.usernameSuggestionTextAlert&&(this.fetchUsernameSuggestionUrl_=c.fetchUsernameSuggestionUrl,this.usernameSuggestionTextAlert_=c.usernameSuggestionTextAlert);a('[id^="suggestUsernameButton"]',b).click(this.callbackWrapper(this.generateUsername));c.hideNonReviewerInterests&&(a('[id^="reviewerGroup-"]',b).click(this.callbackWrapper(this.setInterestsVisibility_)),this.setInterestsVisibility_())};
a.pkp.classes.Helper.inherits(a.pkp.controllers.form.UserFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.form.UserFormHandler.prototype.fetchUsernameSuggestionUrl_="";a.pkp.controllers.form.UserFormHandler.prototype.usernameSuggestionTextAlert_="";a.pkp.controllers.form.UserFormHandler.prototype.generateUsername=function(b,c){c.preventDefault();c=this.getHtmlElement();var d=a('[name="sitePrimaryLocale"]',c).val();b=a('[name="givenName['+d+']"]',c).val();c=a('[name="familyName['+
d+']"]',c).val();b=this.fetchUsernameSuggestionUrl_.replace("GIVEN_NAME_PLACEHOLDER",b).replace("FAMILY_NAME_PLACEHOLDER",c);a.get(b,this.callbackWrapper(this.setUsername),"json")};a.pkp.controllers.form.UserFormHandler.prototype.setUsername=function(b,c){b=this.handleJson(c);c=this.getHtmlElement();if(!1===b)throw Error("JSON response must be set to true!");a('[id^="username"]',c).val(b.content).trigger("blur")};a.pkp.controllers.form.UserFormHandler.prototype.setInterestsVisibility_=function(){var b=
this.getHtmlElement(),c=a("#interests",b);a('[id^="reviewerGroup-"]:checked',b).size()?c.show(300):c.hide(300)}})(jQuery);(function(a){a.pkp.controllers.form.reviewer=a.pkp.controllers.form.reviewer||{};a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler=function(b,c){this.parent(b,c);b.find("[id^='submitFormButton-']").click(this.callbackWrapper(this.updateCommentsRequired_));b.find("[type^='submit']").click(this.callbackWrapper(this.updateRecommendationRequired_));b.find("[type^='submit']").click(this.callbackWrapper(this.updateSaveOrSubmit_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler,
a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler.prototype.updateRecommendationRequired_=function(b,c){c=this.getHtmlElement().find('[id^="recommendation"]');c.length&&(b.id.includes("submitFormButton-")?c.attr("required","1"):c.removeAttr("required"));return!0};a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler.prototype.updateCommentsRequired_=function(b,c){b=this.getHtmlElement().find('[id^="comments"]');1==a("#reviewAttachmentsGridContainer").find("tbody.empty:visible").length?
b.attr("required","1"):b.removeAttr("required");return!0};a.pkp.controllers.form.reviewer.ReviewerReviewStep3FormHandler.prototype.updateSaveOrSubmit_=function(b,c){c=this.getHtmlElement();switch(a(b).attr("name")){case "submitFormButton":c.find('input[name="isSave"]').val("0");break;case "saveFormButton":c.find('input[name="isSave"]').val("1")}return!0}})(jQuery);(function(a){a.pkp.controllers.grid=a.pkp.controllers.grid||{};a.pkp.controllers.grid.GridHandler=function(b,c){this.parent(b,c);this.initialize(c);this.initFeatures_(c.features)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.GridHandler,a.pkp.classes.Handler);a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID={};a.pkp.controllers.grid.GridHandler.prototype.bodySelector=null;a.pkp.controllers.grid.GridHandler.prototype.fetchRowUrl=null;a.pkp.controllers.grid.GridHandler.prototype.fetchRowsUrl=
null;a.pkp.controllers.grid.GridHandler.prototype.gridId_=null;a.pkp.controllers.grid.GridHandler.prototype.fetchGridUrl_=null;a.pkp.controllers.grid.GridHandler.prototype.features_=null;a.pkp.controllers.grid.GridHandler.prototype.fetchExtraParams_=null;a.pkp.controllers.grid.GridHandler.prototype.getFetchExtraParams=function(){return this.fetchExtraParams_};a.pkp.controllers.grid.GridHandler.prototype.setFetchExtraParams=function(b){this.fetchExtraParams_=b};a.pkp.controllers.grid.GridHandler.prototype.getFetchRowUrl=
function(){return this.fetchRowUrl};a.pkp.controllers.grid.GridHandler.prototype.getFetchRowsUrl=function(){return this.fetchRowsUrl};a.pkp.controllers.grid.GridHandler.prototype.getRows=function(){return a(".gridRow",this.getHtmlElement()).not(".gridRowDeleted")};a.pkp.controllers.grid.GridHandler.prototype.getGridIdPrefix=function(){return"component-"+this.gridId_};a.pkp.controllers.grid.GridHandler.prototype.getRowIdPrefix=function(){return this.getGridIdPrefix()+"-row-"};a.pkp.controllers.grid.GridHandler.prototype.getRowByDataId=
function(b,c){return a("#"+this.getRowIdPrefix()+a.pkp.classes.Helper.escapeJQuerySelector(String(b)),this.getHtmlElement())};a.pkp.controllers.grid.GridHandler.prototype.getRowDataId=function(b){return b.attr("id").slice(this.getRowIdPrefix().length)};a.pkp.controllers.grid.GridHandler.prototype.getParentRow=function(b){return b.parents(".gridRow:first")};a.pkp.controllers.grid.GridHandler.prototype.getElementsByType=function(b){return b.hasClass("gridRow")?(b=b.parents("tbody:first"),a(".gridRow",
b)):null};a.pkp.controllers.grid.GridHandler.prototype.getEmptyElement=function(b){return b.hasClass("gridRow")?b.parents("tbody:first").next(".empty"):null};a.pkp.controllers.grid.GridHandler.prototype.toggleRowActions=function(b,c){c.preventDefault();a(b).toggleClass("show_extras");a(b).toggleClass("hide_extras");b=a(b).parents("tr").next(".row_controls");this.applyToggleRowActionEffect_(b)};a.pkp.controllers.grid.GridHandler.prototype.hideAllVisibleRowActions=function(){this.getHtmlElement().find("a.hide_extras").click()};
a.pkp.controllers.grid.GridHandler.prototype.hideRowActionsDiv=function(){var b;var c=a(".gridRow div.row_actions",this.getHtmlElement());c.hide();var d=0;for(b=c.length;d<b;d++)a(c[d])};a.pkp.controllers.grid.GridHandler.prototype.showRowActionsDiv=function(){a(".gridRow div.row_actions",this.getHtmlElement()).show()};a.pkp.controllers.grid.GridHandler.prototype.changeLinkActionsState=function(b,c){void 0===c&&(c=a(".pkp_controllers_linkAction",this.getHtmlElement()));c.each(function(){var d=a.pkp.classes.Handler.getHandler(a(this));
b?d.enableLink():d.disableLink()})};a.pkp.controllers.grid.GridHandler.prototype.resequenceRows=function(b){var c;if(b){for(c in b){var d=b[c];var e=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(String(d)));0==e.length&&(e=this.getRowByDataId(d));if(0==e.length)throw Error("Row with id "+d+" not found!");this.addElement(e)}this.updateControlRowsPosition();this.callFeaturesHook("resequenceRows",b)}};a.pkp.controllers.grid.GridHandler.prototype.updateControlRowsPosition=function(){var b;var c=this.getRows();
var d=0;for(b=c.length;d<b;d++){var e=a(c[d]);var k=this.getControlRowByGridRow(e);0<k.length&&k.insertAfter(e)}};a.pkp.controllers.grid.GridHandler.prototype.insertOrReplaceElement=function(b,c){b=a(b);var d=b.attr("id");var e=this.getHtmlElement();d=d?e.find("#"+a.pkp.classes.Helper.escapeJQuerySelector(d)):null;if(null!==d&&1<d.length)throw Error("There were "+d.length+" rather than 0 or 1 elements to be replaced!");this.hasSameNumOfColumns(b)?(null!==d&&1===d.length?this.replaceElement(d,b):this.addElement(b,
null,c),this.activateRowActions_()):a.get(this.fetchGridUrl_,null,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.deleteElement=function(b,c){if(1!==b.length)throw Error("There were "+b.length+" rather than 1 element to delete!");b.addClass("gridRowDeleted");var d=!1;1==this.getElementsByType(b).length&&(d=!0);b.hasClass("gridRow")&&this.deleteControlsRow_(b);var e=this.getEmptyElement(b);var k=this;var t=function(){k.unbindPartial(b);b.remove();
d&&e.fadeIn(100)};void 0!=c&&c?t():b.fadeOut(500,t)};a.pkp.controllers.grid.GridHandler.prototype.initialize=function(b){this.bind("dataChanged",this.refreshGridHandler);this.bind("addRow",this.addRowHandler_);this.bind("formSubmitted",this.refreshGridWithFilterHandler_);this.gridId_=b.gridId;this.fetchRowUrl=b.fetchRowUrl;this.fetchRowsUrl=b.fetchRowsUrl;this.fetchGridUrl_=b.fetchGridUrl;0<a("div.scrollable",this.getHtmlElement()).length?this.bodySelector="div.scrollable table":this.bodySelector=
b.bodySelector;this.activateRowActions_();this.setFetchExtraParams({});this.getHtmlElement().find(".pkp_form").hide();var c=this.getHtmlElement().find(".pkp_linkaction_search");0!==c.length?c.click(this.callbackWrapper(function(){this.getHtmlElement().find(".pkp_form").toggle();c.toggleClass("is_open")})):this.getHtmlElement().find(".pkp_form").toggle();this.trigger("gridInitialized")};a.pkp.controllers.grid.GridHandler.prototype.callFeaturesHook=function(b,c){var d;a.isArray(c)||(c=[c]);for(d in this.features_)this.features_[d][b].apply(this.features_[d],
c)};a.pkp.controllers.grid.GridHandler.prototype.refreshGridHandler=function(b,c,d,e){this.callFeaturesHook("refreshGrid",d);b=this.getFetchExtraParams();e||(d?d==a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID?a.get(this.fetchRowsUrl,b,this.callbackWrapper(this.replaceElementResponseHandler),"json"):(b.rowId=d,a.get(this.fetchRowUrl,b,this.callbackWrapper(this.replaceElementResponseHandler),"json")):a.get(this.fetchGridUrl_,b,this.callbackWrapper(this.replaceGridResponseHandler_),"json"));this.trigger("gridRefreshRequested");
this.publishChangeEvents()};a.pkp.controllers.grid.GridHandler.prototype.addElement=function(b,c,d){if(void 0===c||null===c)c=this.getHtmlElement().find(this.bodySelector);void 0!=d&&d?c.prepend(b):c.append(b);(c=this.getEmptyElement(b))&&c.hide();this.callFeaturesHook("addElement",b)};a.pkp.controllers.grid.GridHandler.prototype.replaceElement=function(b,c){c.hasClass("gridRow")&&this.deleteControlsRow_(b);this.replacePartialWith(c,b);this.callFeaturesHook("replaceElement",c)};a.pkp.controllers.grid.GridHandler.prototype.hasSameNumOfColumns=
function(b,c){var d=this.getHtmlElement().find("th").length;b=b.first().find("td");c=c?b.attr("colspan"):b.length;return d==c};a.pkp.controllers.grid.GridHandler.prototype.replaceElementResponseHandler=function(b,c){var d;b=this.handleJson(c);if(!1!==b)if(b.elementNotFound)c=b.elementNotFound,c=this.getRowByDataId(c),0<c.length&&this.deleteElement(c);else{var e=a(b.content);if(1<e.filter("tr:not('.row_controls')").length){c=e.filter("tr.gridRow");var k=e.filter("tr.row_controls");var t=0;for(d=c.length;t<
d;t++){e=a(c[t]);var m=this.getControlRowByGridRow(e,k);this.insertOrReplaceElement(e.add(m))}}else this.insertOrReplaceElement(b.content);this.resequenceRows(b.sequenceMap)}this.callFeaturesHook("replaceElementResponseHandler",b)};a.pkp.controllers.grid.GridHandler.prototype.refreshGridWithFilterHandler_=function(b,c,d){a.post(this.fetchGridUrl_,d,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.addRowHandler_=function(b,c,d){a.get(this.fetchRowUrl,
d,this.callbackWrapper(this.replaceElementResponseHandler),"json")};a.pkp.controllers.grid.GridHandler.prototype.replaceGridResponseHandler_=function(b,c){b=this.handleJson(c);if(!1!==b){var d=this.getHtmlElement();c=d.parent();d=d.find(".filter").is(":visible");this.replaceWith(b.content);b=a('div[id^="'+this.getGridIdPrefix()+'"]',c);this.setHtmlElement(b);this.activateRowActions_();d&&b.find(".pkp_linkaction_search").click()}};a.pkp.controllers.grid.GridHandler.prototype.deleteControlsRow_=function(b){b=
a("#"+a.pkp.classes.Helper.escapeJQuerySelector(b.attr("id"))+"-control-row",this.getHtmlElement());b.is("tr")&&b.hasClass("row_controls")&&(this.unbindPartial(b),b.remove())};a.pkp.controllers.grid.GridHandler.prototype.getControlRowByGridRow=function(b,c){c=void 0===c||null===c?this.getHtmlElement().find("tr"):c;b=b.attr("id");return c.filter("#"+a.pkp.classes.Helper.escapeJQuerySelector(b+"-control-row"))};a.pkp.controllers.grid.GridHandler.prototype.activateRowActions_=function(){var b=this.getHtmlElement();
this.getHtmlElement().find("tr.gridRow").not(".category");b.find("a.show_extras").unbind("click").bind("click",this.callbackWrapper(this.toggleRowActions))};a.pkp.controllers.grid.GridHandler.prototype.applyToggleRowActionEffect_=function(b){b.prev().find("td:not(.indent_row)").add(b.prev());b.toggle()};a.pkp.controllers.grid.GridHandler.prototype.addFeature_=function(b,c){this.features_||(this.features_=[]);this.features_[b]=c};a.pkp.controllers.grid.GridHandler.prototype.initFeatures_=function(b){var c;
for(c in b){var d=b[c].JSClass;null!==d&&(d=a.pkp.classes.Helper.objectFactory(d,[this,b[c].options]),this.addFeature_(c,d),this.features_[c].init())}}})(jQuery);(function(a){a.pkp.controllers.grid.CategoryGridHandler=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.CategoryGridHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryIdPrefix=function(){return this.getGridIdPrefix()+"-category-"};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategories=function(){return a(".category_grid_body:not(.empty)",this.getHtmlElement())};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryByDataId=
function(b){return a("#"+this.getCategoryIdPrefix()+b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryRow=function(b){var c=this.getHtmlElement();void 0!==b&&(c=b);return a("tr.category",c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowsInCategory=function(b){return a("tr.gridRow",b).not(".category")};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryEmptyPlaceholder=function(b){b="#"+b.attr("id")+"-emptyPlaceholder";return a(b,this.getHtmlElement())};
a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataId=function(b){b=b.attr("id");var c=this.getCategoryIdPrefix().length;return b.slice(c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataIdByRowId=function(b){b=b.replace(this.getCategoryIdPrefix()," ");b=b.match("(.*)-row");return a.trim(b[1])};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowIdPrefix=function(){return this.getGridIdPrefix()+"-category-"};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowByDataId=
function(b){this.parent("getRowByDataId",b);return a("#"+this.getRowIdPrefix()+this.currentCategoryId_+"-row-"+b,this.getHtmlElement())};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowDataId=function(b){b=b.attr("id").slice(this.getRowIdPrefix().length);b=b.match("-row-(.*)");return a.trim(b[1])};a.pkp.controllers.grid.CategoryGridHandler.prototype.appendCategory=function(b){this.getHtmlElement().find(this.bodySelector).append(b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.resequenceCategories=
function(b){var c;for(c in b){var d=b[c];d=a("#"+d);this.appendCategory(d)}this.updateEmptyPlaceholderPosition()};a.pkp.controllers.grid.CategoryGridHandler.prototype.updateEmptyPlaceholderPosition=function(){var b=this.getCategories(),c;var d=0;for(c=b.length;d<c;d++){var e=a(b[d]);var k=this.getCategoryEmptyPlaceholder(e);0<k.length&&k.insertAfter(e)}};a.pkp.controllers.grid.CategoryGridHandler.prototype.initialize=function(b){this.fetchCategoryUrl_=b.fetchCategoryUrl;this.parent("initialize",b)};
a.pkp.controllers.grid.CategoryGridHandler.prototype.getElementsByType=function(b){return b.hasClass("category_grid_body")?this.getCategories():this.parent("getElementsByType",b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getEmptyElement=function(b){return b.hasClass("category_grid_body")?this.getHtmlElement().find(".empty").not(".category_placeholder"):this.parent("getEmptyElement",b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.refreshGridHandler=function(b,c,d){var e=!1;void 0!==
d&&(void 0!==d.parentElementId?(e={rowId:d[0],rowCategoryId:d.parentElementId},this.currentCategoryId_=d.parentElementId,a.get(this.fetchRowUrl,e,this.callbackWrapper(this.replaceElementResponseHandler),"json")):a.get(this.fetchCategoryUrl_,{rowId:d},this.callbackWrapper(this.replaceElementResponseHandler),"json"),e=!0);this.parent("refreshGridHandler",b,c,d,e)};a.pkp.controllers.grid.CategoryGridHandler.prototype.deleteElement=function(b){var c;if(1<b.length&&(2==b.length&&b.hasClass("category_grid_body")&&
b.hasClass("category")&&(b=b.filter(".category_grid_body")),this.currentCategoryId_)){var d=this.getCategoryByDataId(this.currentCategoryId_);var e=0;for(c=b.length;e<c;e++){var k=a(b[e]).parents("#"+d.attr("id"));if(1===k.length){b=a(b[e]);break}}}b.hasClass("category_grid_body")&&(d=this.getCategoryEmptyPlaceholder(b),this.unbindPartial(d),d.remove());this.parent("deleteElement",b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.addElement=function(b){var c=null;b.hasClass("gridRow")&&(c=
this.getCategoryDataIdByRowId(b.attr("id")),c=this.getCategoryByDataId(c));this.parent("addElement",b,c);b.hasClass("category_grid_body")&&(b=this.getEmptyElement(b),this.getHtmlElement().find(this.bodySelector).append(b))};a.pkp.controllers.grid.CategoryGridHandler.prototype.replaceElement=function(b,c){if(c.hasClass("category_grid_body")){var d=this.getCategoryEmptyPlaceholder(b);this.unbindPartial(d);d.remove()}this.parent("replaceElement",b,c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.hasSameNumOfColumns=
function(b){var c=b,d=!1;b.hasClass("category_grid_body")&&(c=b.find("tr"),d=!0);return this.parent("hasSameNumOfColumns",c,d)}})(jQuery);(function(a){a.pkp.controllers.grid.files=a.pkp.controllers.grid.files||{review:{}};a.pkp.controllers.grid.files.review.AuthorReviewRevisionsGridHandler=function(b,c){this.parent(b,c);this.bindGlobal("refreshRevisionsGrid",function(){this.refreshGridHandler()})};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.files.review.AuthorReviewRevisionsGridHandler,a.pkp.controllers.grid.GridHandler)})(jQuery);(function(a){a.pkp.controllers.listbuilder=a.pkp.controllers.listbuilder||{};a.pkp.controllers.listbuilder.ListbuilderHandler=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.listbuilder.ListbuilderHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.sourceType_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveUrl_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveFieldName_=null;
a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.fetchOptionsUrl_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.editItemCallingContext_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.availableOptions_=!1;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.initialize=function(b){this.parent("initialize",b);this.sourceType_=b.sourceType;this.saveUrl_=b.saveUrl;this.saveFieldName_=b.saveFieldName;this.fetchOptionsUrl_=b.fetchOptionsUrl;this.availableOptions_=
b.availableOptions;b=this.getHtmlElement();b.find(".actions .pkp_linkaction_addItem").mousedown(this.callbackWrapper(this.addItemHandler_));this.attachContentHandlers_(b);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 b=this.getHtmlElement().find(".gridRowEdit:visible");0!==b.length&&(this.saveRow(b),b.removeClass("gridRowEdit"))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.save=function(){var b=this.getHtmlElement().find("input.deletions").val(),c=[],d=this;this.getHtmlElement().find('.gridRow input.isModified[value="1"]').each(function(t,m){t=a(m).parents(".gridRow");t=d.buildParamsFromInputs_(t.find(":input"));
c.push(t)});var e=this.getRows().length;b=JSON.stringify({deletions:b,changes:c,numberOfRows:e});if(e=this.getSaveUrl_())a.post(e,{data:b},this.callbackWrapper(this.saveResponseHandler_,null),"json");else{var k=this.getSaveFieldName_();e=this.getHtmlElement().find(":input[type=hidden]").filter(function(){return a(this).attr("name")==k}).first();0===e.length&&(e=a('<input type="hidden" />'),e.attr("name",k),this.getHtmlElement().append(e));e.attr("value",b)}};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRow=
function(b){b.addClass("saveRowResponsePlaceholder");b=this.buildParamsFromInputs_(b.find(":input"));b.modify=!0;this.disableControls();a.ajax({url:this.getFetchRowUrl(),data:b,success:this.callbackWrapper(this.saveRowResponseHandler_,null),dataType:"json",async:!1})};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.getEmptyElement=function(b){return this.getHtmlElement().find(".empty")};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.addItemHandler_=function(b,c){this.availableOptions_&&
setTimeout(this.callbackWrapper(function(){this.closeEdits();this.disableControls();a.get(this.getFetchRowUrl(),{modify:!0},this.callbackWrapper(this.appendRowResponseHandler_,null),"json")}),0);return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.deleteItemHandler_=function(b,c){this.closeEdits();c=a(b);b=c.closest(".gridRow");c=c.closest(".pkp_controllers_listbuilder").find(".deletions");var d=b.find('input[name="rowId"]').val();void 0!==d&&(c.val(c.val()+" "+d),this.getHtmlElement().trigger("formChange"));
this.deleteElement(b);this.availableOptions_=!0;return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.appendRowResponseHandler_=function(b,c){b=this.handleJson(c);!1!==b&&(b=a(b.content),this.getHtmlElement().find(".empty").hide().before(b),this.attachContentHandlers_(b),b.addClass("gridRowEdit"),b.find(":input").not('[type="hidden"]').first().focus(),this.sourceType_==a.pkp.cons.LISTBUILDER_SOURCE_TYPE_SELECT?(this.disableControls(),a.get(this.fetchOptionsUrl_,{},this.callbackWrapper(this.fetchOptionsResponseHandler_,
null),"json")):this.enableControls(),this.callFeaturesHook("addElement",b));return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.fetchOptionsResponseHandler_=function(b,c){b=this.handleJson(c);c=this.getHtmlElement();var d=[],e,k,t;if(!1!==b){c.find(".gridCellDisplay :input").each(function(P,S){d[P]=a(S).val()});c=c.find(".gridRowEdit:visible .selectMenu:input");var m=0;for(e=c.length;m<e;m++){var y=a(c[m]);var C=y.parents(".gridCellContainer");var D=0;y.children().empty();var A=null;
for(A in b.content[m])if(A!=a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL)if("object"==typeof b.content[m][A]){if(void 0!==b.content[m][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&"object"==typeof b.content[m][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&(t=b.content[m][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL][A])){var I=a("<optgroup></optgroup>");I.attr("label",t);y.append(I);t=null;var L=0;for(t in b.content[m][A])if(k=this.populatePulldown_(I,d,b.content[m][A][t],t))D++,L++;0===L&&I.remove()}}else(k=this.populatePulldown_(y,
d,b.content[m][A],A))&&D++;y=k;1===D&&y&&(y.attr("selected","selected"),this.availableOptions_=!1);0===D&&(C.find(".gridCellDisplay").show(),C.find(".gridCellEdit").hide())}}this.enableControls();return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.populatePulldown_=function(b,c,d,e){var k=b.parents(".gridCellContainer").find(".gridCellDisplay :input").val(),t=!1,m;if(e!=k)for(m=0;m<c.length;m++)c[m]==e&&(t=!0);if(t)return!1;c=a("<option/>");c.attr("value",e);c.text(d);e==k&&c.attr("selected",
"selected");b.append(c);return c};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.editItemHandler_=function(b,c){this.closeEdits();this.editItemCallingContext_=b;setTimeout(this.callbackWrapper(function(){var d=a(this.editItemCallingContext_).closest(".gridRow");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"))}),0);return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.buildParamsFromInputs_=function(b){var c={};a.each(b.serializeArray(),function(d,e){d=e.name;e=e.value;c[d]=void 0===c[d]?e:a.isArray(c[d])?c[d].concat(e):[c[d],e]});return c};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.inputKeystrokeHandler_=function(b,c){if(13==c.which){var d=a(b);b=d.parents(".gridRow");c=b.find(":input:visible");d=c.index(d);c.length==d+1?this.saveRow(b):c[d+1].focus();return!1}return!0};
a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.inputBlurHandler_=function(b,c){a(b).closest(".gridRow").addClass("editingRowPlaceholder");setTimeout(this.callbackWrapper(function(){var d=a(".editingRowPlaceholder"),e=!1;d.find(":input").each(function(k,t){t===document.activeElement&&(e=!0)});d.removeClass("editingRowPlaceholder");e||this.closeEdits()}),0);return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRowResponseHandler_=function(b,c){b=this.handleJson(c);!1!==
b&&(b=a(b.content),c=this.getHtmlElement().find(".saveRowResponsePlaceholder").attr("id"),this.getHtmlElement().find(".saveRowResponsePlaceholder").replaceWith(b),b.attr("id",c),this.attachContentHandlers_(b),this.callFeaturesHook("replaceElement",b));this.getHtmlElement().trigger("formChange");this.enableControls()};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveResponseHandler_=function(b,c){};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.attachContentHandlers_=function(b){b.find(".gridCellDisplay").click(this.callbackWrapper(this.editItemHandler_));
b.find(":input").keypress(this.callbackWrapper(this.inputKeystrokeHandler_)).blur(this.callbackWrapper(this.inputBlurHandler_));b.find(".pkp_linkaction_delete").click(this.callbackWrapper(this.deleteItemHandler_))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.formSubmitHandler_=function(b,c){this.save();this.getHtmlElement().find(".gridRow :input").attr("disabled","disabled");return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.formSubmittedHandler_=function(b,c){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.modal=a.pkp.controllers.modal||{};a.pkp.controllers.modal.ModalHandler=function(b,c){this.parent(b,c);if(!this.checkOptions(c))throw Error("Missing or invalid modal options!");c=a.extend(!0,{},c);this.options=this.mergeOptions(c);b.html(this.modalBuild()[0].outerHTML);this.modalOpen(b);b.find(".pkpModalCloseButton").click(this.callbackWrapper(this.modalClose));b.on("click keyup",this.callbackWrapper(this.handleWrapperEvents));this.publishEvent("redirectRequested");this.publishEvent("dataChanged");
this.publishEvent("containerReloadRequested");this.publishEvent("updateHeader");this.publishEvent("gridRefreshRequested");this.bind("notifyUser",this.redirectNotifyUserEventHandler_);this.bindGlobal("form-success",this.onFormSuccess_)};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,closeCleanVueInstances:[]};a.pkp.controllers.modal.ModalHandler.options=null;a.pkp.controllers.modal.ModalHandler.prototype.checkOptions=function(b){return"object"===typeof b&&void 0===b.buttons};a.pkp.controllers.modal.ModalHandler.prototype.mergeOptions=function(b){return a.extend(!0,{},this.self("DEFAULT_OPTIONS_"),b)};a.pkp.controllers.modal.ModalHandler.prototype.modalBuild=function(){var b=a('<div class="pkp_modal_panel"></div>');"undefined"!==typeof this.options.title?b.append('<div class="header">'+
this.options.title+"</div>"):b.append('<div class="header"></div>');this.options.canClose&&b.append('<a href="#" class="close pkpModalCloseButton"><span class="pkp_screen_reader">'+this.options.closeButtonText+"</span></a>");b.append('<div class="content"></div>');b.attr("role","dialog").attr("aria-label",this.options.title);return b};a.pkp.controllers.modal.ModalHandler.prototype.modalOpen=function(b){a("body").append(b);setTimeout(function(){b.addClass("is_visible")},10);setTimeout(function(){b.focus()},
300);b.trigger("pkpModalOpen",[b])};a.pkp.controllers.modal.ModalHandler.prototype.modalClose=function(b,c){var d=this,e=this.getHtmlElement();b=e.find("form").first();if(1==b.length&&(c={closePermitted:!0},b.trigger("containerClose",[c]),!c.closePermitted))return!1;e.removeClass("is_visible");this.trigger("pkpModalClose");setTimeout(function(){var k=d.options.closeCleanVueInstances,t;if(k.length)for(t=0;t<k.length;t++){var m=k[t];"undefined"!==typeof pkp.registry._instances[m]&&(m=pkp.registry._instances[m],
m.$destroy())}d.unbindPartial(e);e.empty();d.remove();"function"===typeof d.options.closeCallback&&d.options.closeCallback.call()},300);return!1};a.pkp.controllers.modal.ModalHandler.prototype.handleWrapperEvents=function(b,c){"click"==c.type&&b==c.target?a.pkp.classes.Handler.getHandler(a(b)).modalClose():"keyup"==c.type&&27==c.which&&a.pkp.classes.Handler.getHandler(a(b)).modalClose()};a.pkp.controllers.modal.ModalHandler.prototype.redirectNotifyUserEventHandler_=function(b,c,d){a.pkp.classes.notification.NotificationHelper.redirectNotifyUserEvent(this,
d)};a.pkp.controllers.modal.ModalHandler.prototype.onFormSuccess_=function(b,c){this.options.closeOnFormSuccessId&&this.options.closeOnFormSuccessId===c&&this.modalClose()}})(jQuery);(function(a){a.pkp.controllers.modal.ConfirmationModalHandler=function(b,c){this.parent(b,c);this.callback_=c.callback||null;this.callbackArgs_=c.callbackArgs||null;b.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(b){return this.parent("checkOptions",b)?"string"===typeof b.okButton&&(!1===b.cancelButton||"string"===typeof b.cancelButton)&&"string"===typeof b.dialogText:!1};a.pkp.controllers.modal.ConfirmationModalHandler.prototype.modalBuild=function(){var b=this.parent("modalBuild"),c='<button class="ok pkpModalConfirmButton">'+this.options.okButton+"</button>";b.addClass("pkp_modal_confirmation").find(".content").append('<div class="message">'+
this.options.dialogText+"</div>");this.options.cancelButton&&(c+='<button class="cancel pkpModalCloseButton">'+this.options.cancelButton+"</button>");b.append('<div class="footer">'+c+"</div>");b.attr("role","dialog").attr("aria-label",this.options.title);return b};a.pkp.controllers.modal.ConfirmationModalHandler.prototype.modalConfirm=function(b,c){this.modalClose(b);this.callback_&&this.callback_.call(null,this.callbackArgs_)}})(jQuery);(function(a){a.pkp.controllers.modal.RedirectConfirmationModalHandler=function(b,c){this.parent(b,c);this.remoteUrl_=c.remoteUrl};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.RedirectConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.remoteUrl_=null;a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.checkOptions=function(b){return this.parent("checkOptions",b)?"string"===typeof b.cancelButton&&
"string"===typeof b.remoteUrl:!1};a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.modalConfirm=function(b,c){document.location=this.remoteUrl_}})(jQuery);(function(a){a.pkp.controllers.modal.RemoteActionConfirmationModalHandler=function(b,c){this.parent(b,c);this.remoteAction_=c.remoteAction;this.postData_=c.postData||{};this.postData_.csrfToken=c.csrfToken};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.RemoteActionConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteAction_=null;a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.postData_=
null;a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.checkOptions=function(b){return this.parent("checkOptions",b)?"string"===typeof b.cancelButton&&"string"===typeof b.remoteAction:!1};a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.modalConfirm=function(b,c){c.preventDefault();a.post(this.remoteAction_,this.postData_,this.callbackWrapper(this.remoteResponse),"json")};a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteResponse=
function(b,c){!1!==this.parent("remoteResponse",b,c)&&this.modalClose(b);return!1}})(jQuery);(function(a){a.pkp.controllers.modal.ButtonConfirmationModalHandler=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.ButtonConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.ButtonConfirmationModalHandler.prototype.checkOptions=function(b){return this.parent("checkOptions",b)?"object"==typeof b.$button&&1==b.$button.length:!1};a.pkp.controllers.modal.ButtonConfirmationModalHandler.prototype.modalConfirm=function(b,
c){c=this.options.$button;this.modalClose(b);"submit"==c.attr("type")?c.trigger("submit"):c.click()}})(jQuery);(function(a){a.pkp.controllers.modal.JsEventConfirmationModalHandler=function(b,c){this.parent(b,c);this.jsEvent_=c.jsEvent;this.extraArguments_=c.extraArguments};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.JsEventConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.jsEvent_=null;a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.extraArguments_=null;a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.checkOptions=
function(b){return this.parent("checkOptions",b)?"string"===typeof b.cancelButton&&"string"===typeof b.jsEvent:!1};a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.modalConfirm=function(b,c){this.trigger(this.jsEvent_,this.extraArguments_);this.modalClose(b)}})(jQuery);(function(a){a.pkp.controllers.modal.AjaxModalHandler=function(b,c){this.parent(b,c);this.bind("formSubmitted",this.formSubmitted);this.bind("formCanceled",this.modalClose);this.bind("ajaxHtmlError",this.modalClose);this.bind("modalFinished",this.modalClose)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.AjaxModalHandler,a.pkp.controllers.modal.ModalHandler);a.pkp.controllers.modal.AjaxModalHandler.prototype.checkOptions=function(b){return this.parent("checkOptions",b)?"string"===typeof b.url:
!1};a.pkp.controllers.modal.AjaxModalHandler.prototype.mergeOptions=function(b){return this.parent("mergeOptions",b)};a.pkp.controllers.modal.AjaxModalHandler.prototype.modalOpen=function(b){this.parent("modalOpen",b);b.find(".content").pkpAjaxHtml(this.options.url)};a.pkp.controllers.modal.AjaxModalHandler.prototype.formSubmitted=function(b,c){this.getHtmlElement().parent().trigger("notifyUser");this.modalClose()}})(jQuery);(function(a){a.pkp.controllers.modal.WizardModalHandler=function(b,c){this.parent(b,c);this.bind("wizardClose",this.wizardClose);this.bind("wizardCancel",this.wizardClose)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.WizardModalHandler,a.pkp.controllers.modal.AjaxModalHandler);a.pkp.controllers.modal.WizardModalHandler.prototype.modalClose=function(b,c,d){d?this.parent("modalClose",b,c):(d=new a.Event("wizardCancelRequested"),d.stopPropagation(),this.getHtmlElement().children().first().trigger(d),
d.isDefaultPrevented()||this.parent("modalClose",b,c));return!1};a.pkp.controllers.modal.WizardModalHandler.prototype.wizardClose=function(b,c){this.modalClose(b,c,!0)}})(jQuery);(function(a){a.pkp.controllers.modals=a.pkp.controllers.modals||{editorDecision:{form:{}}};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler=function(b,c){this.parent(b,c);null!==c.peerReviewUrl&&(this.peerReviewUrl_=c.peerReviewUrl,a("#importPeerReviews",b).click(this.callbackWrapper(this.importPeerReviews)));null!==c.revisionsEmail&&(this.revisionsEmail_=c.revisionsEmail);null!==c.resubmitEmail&&(this.resubmitEmail_=c.resubmitEmail);a("#skipEmail-send, #skipEmail-skip, #skipDiscussion-send, #skipDiscussion-skip",
b).change(this.callbackWrapper(this.toggleEmailDisplay));a('input[name="decision"]',b).change(this.callbackWrapper(this.toggleDecisionEmail));this.setStep("email");var d=this;a(".promoteForm-step-btn",b).click(function(e){e.preventDefault();e.stopPropagation();e=a(e.target).data("step");d.setStep(e)})};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(b,c){a.getJSON(this.peerReviewUrl_,this.callbackWrapper(this.insertPeerReviews));return!1};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.insertPeerReviews=function(b,c){b=
this.handleJson(c);c=this.getHtmlElement();c=a('textarea[id^="personalMessage"]',c);c=tinyMCE.get(c.attr("id"));var d=c.getContent();!1!==b&&c.setContent(d+b.content+"<br>");this.trigger("notifyUser",[this.getHtmlElement()])};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.toggleEmailDisplay=function(){var b=a("#sendReviews-emailContent"),c=this.getHtmlElement(),d=!1,e=!1,k=a("#libraryFileAttachments");a("#skipEmail-send, #skipEmail-skip",c).each(function(){"skipEmail-send"===
a(this).attr("id")&&a(this).prop("checked")?d=!0:"skipEmail-skip"===a(this).attr("id")&&a(this).prop("checked")&&(d=!1)});c=a("#skipDiscussion-send, #skipDiscussion-skip",c);c.length&&c.each(function(){"skipDiscussion-send"===a(this).attr("id")&&a(this).prop("checked")?e=!0:"skipDiscussion-skip"===a(this).attr("id")&&a(this).prop("checked")&&(e=!1)});d||e?(b.fadeIn(),k.fadeIn()):(b.fadeOut(),k.fadeOut())};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.toggleDecisionEmail=
function(){var b="",c=a("#skipEmail-send").prop("checked"),d=a("#sendReviews-emailContent"),e=a('textarea[id^="personalMessage"]').attr("id"),k=this;a('input[name="decision"]').each(function(){"decisionRevisions"===a(this).attr("id")&&a(this).prop("checked")?b=k.revisionsEmail_:"decisionResubmit"===a(this).attr("id")&&a(this).prop("checked")&&(b=k.resubmitEmail_)});tinyMCE.get(e).setContent(b);c&&d.hide().fadeIn()};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.setStep=
function(b){var c=a('#promoteForm-step1, .promoteForm-step-btn[data-step="files"]'),d=a('#promoteForm-step2, #promoteForm-complete-btn, .promoteForm-step-btn[data-step="email"]');"files"===b?(d.show(),c.hide()):(c.show(),d.hide())}})(jQuery);(function(a){jQuery.pkp.controllers.linkAction=jQuery.pkp.controllers.linkAction||{};a.pkp.controllers.linkAction.LinkActionHandler=function(b,c){this.parent(b,c);this.staticId_=c.staticId?c.staticId:b.attr("id");if(!c.actionRequest||!c.actionRequestOptions)throw Error('The "actionRequest" and "actionRequestOptions"settings are required in a LinkActionHandler');c.actionRequestOptions.finishCallback=this.callbackWrapper(this.enableLink);this.linkActionRequest_=a.pkp.classes.Helper.objectFactory(c.actionRequest,
[b,c.actionRequestOptions]);this.bindActionRequest();this.publishEvent("dataChanged");this.bind("dataChanged",this.dataChangedHandler_);this.bind("pkpModalClose",this.removeDisabledAttribute_);c.selfActivate&&this.trigger("click")};a.pkp.classes.Helper.inherits(a.pkp.controllers.linkAction.LinkActionHandler,a.pkp.classes.Handler);a.pkp.controllers.linkAction.LinkActionHandler.prototype.linkActionRequest_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.staticId_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.getStaticId=
function(){return this.staticId_};a.pkp.controllers.linkAction.LinkActionHandler.prototype.getUrl=function(){return this.linkActionRequest_.getUrl()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.activateAction=function(b,c){this.linkActionRequest_.shouldDebounce()&&this.disableLink();return this.linkActionRequest_.activate.call(this.linkActionRequest_,b,c)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.bindActionRequest=function(){this.bind("click",this.activateAction)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.enableLink=
function(){var b=a(this.getHtmlElement());this.getHtmlElement().is(":submit")||this.removeDisabledAttribute_();var c=this.getUrl();this.getHtmlElement().is("a")&&c&&b.attr("href",c);this.unbind("click",this.noAction_);this.bindActionRequest()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.disableLink=function(){var b=a(this.getHtmlElement());b.attr("disabled","disabled");this.getHtmlElement().is("a")&&b.attr("href","#");this.unbind("click",this.activateAction);this.bind("click",this.noAction_)};
a.pkp.controllers.linkAction.LinkActionHandler.prototype.removeDisabledAttribute_=function(){a(this.getHtmlElement()).removeAttr("disabled")};a.pkp.controllers.linkAction.LinkActionHandler.prototype.dataChangedHandler_=function(b,c,d){0===this.getHtmlElement().parents(".pkp_controllers_grid").length&&this.trigger("redirectDataChangedToGrid",[d]);this.trigger("notifyUser",[this.getHtmlElement()])};a.pkp.controllers.linkAction.LinkActionHandler.prototype.noAction_=function(){return!1}})(jQuery);(function(a){a.pkp.controllers.wizard=a.pkp.controllers.wizard||{};a.pkp.controllers.wizard.WizardHandler=function(b,c){this.parent(b,c);this.addWizardButtons_(b,c);this.enforceLinear_=c.hasOwnProperty("enforceLinear")?c.enforceLinear:!0;this.startWizard();this.bindWizardEvents();this.bind("formValid",this.formValid);this.bind("formInvalid",this.formInvalid);this.bind("formSubmitted",this.formSubmitted)};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.WizardHandler,a.pkp.controllers.TabHandler);
a.pkp.controllers.wizard.WizardHandler.prototype.$continueButton_=null;a.pkp.controllers.wizard.WizardHandler.prototype.$progressIndicator_=null;a.pkp.controllers.wizard.WizardHandler.prototype.continueButtonText_=null;a.pkp.controllers.wizard.WizardHandler.prototype.finishButtonText_=null;a.pkp.controllers.wizard.WizardHandler.prototype.enforceLinear_=null;a.pkp.controllers.wizard.WizardHandler.prototype.showProgressIndicator_=function(){this.getProgressIndicator().css("opacity",1)};a.pkp.controllers.wizard.WizardHandler.prototype.hideProgressIndicator_=
function(){this.getProgressIndicator().css("opacity",0)};a.pkp.controllers.wizard.WizardHandler.prototype.continueRequest=function(b,c){b=new a.Event("wizardAdvanceRequested");this.getCurrentTab().children().first().trigger(b);b.isDefaultPrevented()||this.advanceOrClose_();return!1};a.pkp.controllers.wizard.WizardHandler.prototype.formValid=function(b,c){this.enableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.formInvalid=function(b,c){this.disableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.formSubmitted=
function(b,c){this.advanceOrClose_()};a.pkp.controllers.wizard.WizardHandler.prototype.cancelRequest=function(b,c){this.checkForm_(!1);b=new a.Event("wizardCancelRequested");this.getCurrentTab().children().first().trigger(b);b.isDefaultPrevented()||this.trigger("wizardCancel");return!1};a.pkp.controllers.wizard.WizardHandler.prototype.wizardCancelRequested=function(b,c){return this.checkForm_(!0)?!1:!0};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvanceRequested=function(b,c){if(b=this.getForm_())b.submit()&&
(this.disableContinueButton(),this.showProgressIndicator_()),c.preventDefault()};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvance=function(b,c){var d=this.getCurrentStep();b=this.getNumberOfSteps()-1;c=d+1;if(c>b)throw Error("Trying to set an invalid wizard step!");var e=this.getHtmlElement();e.tabs("enable",c);e.tabs("option","active",c);this.enforceLinear_&&e.tabs("disable",d);d=this.getContinueButton();c===b&&d.text(this.getFinishButtonText());this.hideProgressIndicator_();this.enableContinueButton()};
a.pkp.controllers.wizard.WizardHandler.prototype.startWizard=function(){var b=this.getHtmlElement(),c;if(0!==this.getCurrentStep()){b.tabs("enable",0);b.tabs("option","active",0);var d=this.getContinueButton();d.text(this.getContinueButtonText())}if(this.enforceLinear_){d=[];for(c=1;c<this.getNumberOfSteps();c++)d.push(c);b.tabs("option","disabled",d)}};a.pkp.controllers.wizard.WizardHandler.prototype.bindWizardEvents=function(){this.bind("wizardCancelRequested",this.wizardCancelRequested);this.bind("wizardAdvanceRequested",
this.wizardAdvanceRequested);this.bind("wizardAdvance",this.wizardAdvance)};a.pkp.controllers.wizard.WizardHandler.prototype.getCurrentStep=function(){return this.getCurrentTabIndex()};a.pkp.controllers.wizard.WizardHandler.prototype.getContinueButton=function(){return this.$continueButton_};a.pkp.controllers.wizard.WizardHandler.prototype.getProgressIndicator=function(){return this.$progressIndicator_};a.pkp.controllers.wizard.WizardHandler.prototype.getContinueButtonText=function(){return this.continueButtonText_};
a.pkp.controllers.wizard.WizardHandler.prototype.getFinishButtonText=function(){return this.finishButtonText_};a.pkp.controllers.wizard.WizardHandler.prototype.getNumberOfSteps=function(){return this.getHtmlElement().find("ul").first().children().length};a.pkp.controllers.wizard.WizardHandler.prototype.getForm_=function(){var b;var c=this.getCurrentTab().children();for(b=0;b<c.length;b++){var d=a(c[b]);if(d.is("form"))return d}return null};a.pkp.controllers.wizard.WizardHandler.prototype.advanceOrClose_=
function(){var b=this.getCurrentStep(),c=this.getNumberOfSteps()-1;b<c?this.trigger("wizardAdvance"):this.trigger("wizardClose")};a.pkp.controllers.wizard.WizardHandler.prototype.checkForm_=function(b){var c=this.getForm_();if(null!==c)if(c=a.pkp.classes.Handler.getHandler(a("#"+c.attr("id"))),b){if(c.formChangesTracked)if(confirm(a.pkp.locale.form_dataHasChanged))c.unregisterForm();else return!0}else c.unregisterForm();return!1};a.pkp.controllers.wizard.WizardHandler.prototype.addWizardButtons_=
function(b,c){var d=a('<div id="wizardButtons" class="modal_buttons"></div>');if(c.continueButtonText){var e=a('<button id="continueButton" class="pkp_button"></button>').text(c.continueButtonText);d.append(e);var k=a('<span class="pkp_spinner"></span>');d.append(k);e.bind("click",this.callbackWrapper(this.continueRequest));this.$continueButton_=e;this.$progressIndicator_=k;this.continueButtonText_=c.continueButtonText;this.finishButtonText_=c.finishButtonText?c.finishButtonText:c.continueButtonText}c.cancelButtonText&&
(c=a('<a id="cancelButton" class="cancel" href="#"></a>').text(c.cancelButtonText),d.append(c),c.bind("click",this.callbackWrapper(this.cancelRequest)));b.after(d)};a.pkp.controllers.wizard.WizardHandler.prototype.disableContinueButton=function(){this.getContinueButton().attr("disabled","disabled")};a.pkp.controllers.wizard.WizardHandler.prototype.enableContinueButton=function(){this.getContinueButton().removeAttr("disabled")}})(jQuery);(function(a){a.pkp.controllers.grid.queries=a.pkp.controllers.grid.queries||{};a.pkp.controllers.grid.queries.ReadQueryHandler=function(b,c){this.fetchNoteFormUrl_=c.fetchNoteFormUrl;this.fetchParticipantsListUrl_=c.fetchParticipantsListUrl;b.find(".openNoteForm a").click(this.callbackWrapper(this.showNoteFormHandler_));b.bind("dataChanged",this.callbackWrapper(this.reloadParticipantsList_));b.bind("user-left-discussion",function(){b.parent().trigger("modalFinished")});this.loadParticipantsList()};
a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.queries.ReadQueryHandler,a.pkp.classes.Handler);a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.fetchNoteFormUrl_=null;a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.fetchParticipantsListUrl_=null;a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.loadParticipantsList=function(){a.get(this.fetchParticipantsListUrl_,this.callbackWrapper(this.showFetchedParticipantsList_),"json")};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showNoteFormHandler_=
function(b){a(b).parents(".queryEditButtons").addClass("is_loading");a.get(this.fetchNoteFormUrl_,this.callbackWrapper(this.showFetchedNoteForm_),"json")};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showFetchedNoteForm_=function(b,c){b=this.handleJson(c);c=a("#newNotePlaceholder",this.getHtmlElement());var d=a(".queryEditButtons.is_loading",this.getHtmlElement());this.unbindPartial(d);d.remove();this.unbindPartial(c);c.html(b.content)};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showFetchedParticipantsList_=
function(b,c){b=this.handleJson(c);c=a("#participantsListPlaceholder",this.getHtmlElement());var d=a(".leaveQueryForm",this.getHtmlElement());b.showLeaveQueryButton?d.show():d.hide();this.unbindPartial(c);c.children().remove();c.append(b.content)};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.reloadParticipantsList_=function(b,c,d){this.loadParticipantsList()}})(jQuery);(function(a){a.pkp.controllers.wizard.fileUpload=a.pkp.controllers.wizard.fileUpload||{};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler=function(b,c){this.parent(b,c);this.csrfToken_=c.csrfToken;this.deleteUrl_=c.deleteUrl;this.metadataUrl_=c.metadataUrl;this.finishUrl_=c.finishUrl;this.bind("fileUploaded",this.handleFileUploaded);this.bind("filesRemoved",this.handleRemovedFiles);this.disableContinueButton()};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler,
a.pkp.controllers.wizard.WizardHandler);a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.csrfToken_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.deleteUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.metadataUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.finishUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.uploadedFile_=null;a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsBeforeActivate=
function(b,c,d){if(0<d.newTab.index()){if(!this.uploadedFile_)throw Error("Uploaded file missing!");this.getHtmlElement();switch(d.newTab.index()){case 1:var 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",b,c,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardAdvance=function(b,c){b=this.getCurrentStep();
c=this.getNumberOfSteps()-1;var d=b+1,e=this.getHtmlElement();if(d>c)throw Error("Trying to set an invalid wizard step!");e.tabs("enable",d);e.tabs("option","active",d);0===b&&e.tabs("disable",b);d===c&&(b=this.getContinueButton(),b.text(this.getFinishButtonText()),this.enableContinueButton())};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsLoad=function(b,c,d){var e=this.getHtmlElement(),k=this.getProgressIndicator();2===d.tab.index()&&(e=a("#newFile",e),e.length&&e.bind("click",
this.callbackWrapper(this.startWizard)));k.hide();return this.parent("tabsLoad",b,c,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.formValid=function(b,c){(0!==this.getCurrentStep()||0!==this.getHtmlElement().find("#uploadConfirmationForm").length||this.uploadedFile_)&&this.parent("formValid",b,c)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelRequested=function(b,c){if(this.parent("wizardCancelRequested",b,c))if(this.uploadedFile_)this.uploadedFile_.csrfToken=
this.csrfToken_,a.post(this.deleteUrl_,this.uploadedFile_,a.pkp.classes.Helper.curry(this.wizardCancelSuccess,this,b,c),"json"),this.uploadedFile_=null,c.preventDefault();else return!0;return!1};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelSuccess=function(b,c,d){!1!==this.handleJson(d)&&this.trigger("wizardCancel")};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleFileUploaded=function(b,c,d){this.uploadedFile_=d};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleRemovedFiles=
function(b,c,d,e){var k;if("undefined"!==typeof e&&e.length)for(k in e){if("undefined"===typeof e[k].storedData)break;e[k].storedData.csrfToken=this.csrfToken_;a.post(this.deleteUrl_,e[k].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(b,c){this.parent(b,c);this.hasFileSelector_=c.hasFileSelector;this.hasGenreSelector_=c.hasGenreSelector;c.presetRevisedFileId&&(this.presetRevisedFileId_=c.presetRevisedFileId);this.fileGenres_=c.fileGenres;this.$uploader_=c.$uploader;this.attachUploader_(this.$uploader_,c.uploaderOptions);this.uploaderSetup(c.$uploader);this.$revisedFileSelector_=
b.find("#revisedFileId").change(this.callbackWrapper(this.revisedFileChange));this.hasGenreSelector_&&(this.$genreSelector=b.find("#genreId").change(this.callbackWrapper(this.genreChange)));this.setUploaderVisibility_()};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.hasFileSelector_=!1;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$revisedFileSelector_=
null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.hasGenreSelector_=!1;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$genreSelector_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.presetRevisedFileId_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.fileGenres_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$uploader_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.uploaderSetup=
function(b){b=a.pkp.classes.Handler.getHandler(b);b.pluploader.bind("BeforeUpload",this.callbackWrapper(this.prepareFileUploadRequest));b.pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse));b.pluploader.bind("FilesRemoved",this.callbackWrapper(this.handleRemovedFiles))};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.prepareFileUploadRequest=function(b,c){this.getHtmlElement();b={};this.hasFileSelector_?(this.$revisedFileSelector_.attr("disabled",
"disabled"),b.revisedFileId=this.$revisedFileSelector_.val()):b.revisedFileId=null!==this.presetRevisedFileId_?this.presetRevisedFileId_:0;this.hasGenreSelector_?(this.$genreSelector.attr("disabled","disabled"),b.genreId=this.$genreSelector.val()):b.genreId="";c.settings.multipart_params=b};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleUploadResponse=function(b,c,d,e){b=this.handleJson(a.parseJSON(e.response));this.getHtmlElement();!1!==b&&(this.trigger("fileUploaded",
b.uploadedFile),""!==b.content&&this.replaceWith(b.content));this.getHtmlElement().valid()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleRemovedFiles=function(b,c,d){this.trigger("filesRemoved",[c,d])};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.submitForm=function(b,c){this.trigger("formSubmitted")};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.revisedFileChange=function(b,c){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(b,c){this.setUploaderVisibility_()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.attachUploader_=function(b,c){b.pkpHandler("$.pkp.controllers.UploaderHandler",c)};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.setUploaderVisibility_=
function(){this.hasGenreSelector_&&this.$genreSelector.val()||this.$revisedFileSelector_.val()?this.showUploader_():this.hasGenreSelector_||this.hasFileSelector_?this.hideUploader_():this.showUploader_()};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(b,c){this.parent(b,c);b.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(b,c){b=this.getHtmlElement();0<parseInt(b.find("#revisedFileId").val(),10)&&(b.submit(),c.preventDefault())};a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler.prototype.handleResponse=function(b,c){!0===c.status&&this.trigger("fileUploaded",c.uploadedFile);return this.parent("handleResponse",b,c)}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus=a.pkp.controllers.grid.navigationMenus||{form:{}};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler=function(b,c){this.okButton_=c.okButton;this.warningModalTitle_=c.warningModalTitle;this.submenuWarning_=c.submenuWarning;this.itemTypeConditionalWarnings_=c.itemTypeConditionalWarnings;b.on("click",".btnConditionalDisplay",this.callbackWrapper(this.showConditionalDisplayWarning));b.on("click",".btnSubmenuWarning",this.callbackWrapper(this.showSubmenuWarning));
this.parent(b,c);this.initSorting()};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.okButton_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.warningModalTitle_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.submenuWarning_=void 0;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.itemTypeConditionalWarnings_=
null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.initSorting=function(){var b=this;a(".btnSubmenuWarning",this.getHtmlElement()).remove();a("#pkpNavAssigned > li").each(function(){var c=a(this).children("ul"),d=c.children(),e=d.find("li");c.length?d.length?(e.length&&e.each(function(){a(this).appendTo(c)}),a(this).find("> .item > .item_buttons .btnSubmenuWarning").length||a(this).find("> .item > .item_buttons").prepend(a("<button></button>").addClass("btnSubmenuWarning").append(a("<span></span>").addClass("fa fa-exclamation-triangle")).append(a("<span></span>").addClass("-screenReader").text(b.submenuWarning_)))):
c.replaceWith("<ul></ul>"):a(this).append("<ul></ul>")});a("#pkpNavUnassigned > li").each(function(){var 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 b=a("#pkpNavManagement"),c=0,d="";this.initSorting();a("input",b).remove();a("#pkpNavAssigned > li").each(function(){d="menuTree["+a(this).data("id")+"]";b.append('<input type="hidden" name="'+d+'[seq]" value="'+c+'">');c++;var e=a(this).data("id");a(this).find("li").each(function(){d="menuTree["+a(this).data("id")+"]";b.append('<input type="hidden" name="'+d+'[seq]" value="'+c+'">');b.append('<input type="hidden" name="'+
d+'[parentId]" value="'+e+'">');c++})})};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showConditionalDisplayWarning=function(b){b=a(b).closest("li").data("type");var c={title:this.warningModalTitle_,okButton:this.okButton_,cancelButton:!1,dialogText:this.itemTypeConditionalWarnings_[b]};null!==this.itemTypeConditionalWarnings_[b]&&a('<div id="'+a.pkp.classes.Helper.uuid()+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",
c);return!1};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showSubmenuWarning=function(){var b={title:this.warningModalTitle_,okButton:this.okButton_,cancelButton:!1,dialogText:this.submenuWarning_};a('<div id="'+a.pkp.classes.Helper.uuid()+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",b);return!1}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler=function(b,c){this.parent(b,c);this.previewUrl_=c.previewUrl;this.itemTypeDescriptions_=c.itemTypeDescriptions;this.itemTypeConditionalWarnings_=c.itemTypeConditionalWarnings;a("#previewButton",b).click(this.callbackWrapper(this.showPreview_));a("#menuItemType",b).change(this.callbackWrapper(this.setType));a("#menuItemType",b).trigger("change")};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler,
a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.previewUrl_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.itemTypeDescriptions_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.itemTypeConditionalWarnings_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.showPreview_=function(b,c){b=this.getHtmlElement();
a.post(this.previewUrl_,b.serialize(),function(d){var e=window.open("about:blank");e.document.open();e.document.write(d);e.document.close()});return!0};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.setType=function(){var b=a("#menuItemType",this.getHtmlElement()).val(),c=a('#menuItemTypeSection [for="menuItemType"]');a(".NMI_TYPE_CUSTOM_EDIT",this.getHtmlElement()).hide();a("#"+b).fadeIn();"undefined"!==typeof this.itemTypeDescriptions_[b]&&c.text(this.itemTypeDescriptions_[b])}})(jQuery);(function(a){a.pkp.controllers.grid.representations=a.pkp.controllers.grid.representations||{form:{}};a.pkp.controllers.grid.representations.form.RepresentationFormHandler=function(b,c){this.parent(b,c);(this.remoteRepresentation_=c.remoteRepresentation)?(a("#remotelyHostedContent").prop("checked",!0),a("#remote").show(20),a("#urlPathSection").hide()):(a("#remotelyHostedContent").prop("checked",!1),a("#remote").hide(),a("#urlPathSection").show(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(b,c){a("#remotelyHostedContent").prop("checked")?(a("#remote").show(20),a("#urlPathSection").hide(),a('input[id^="urlPath"]').val("")):(a("#remote").hide(20),a('input[id^="urlRemote"]').val(""),a("#urlPathSection").show(20));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(b,c){this.parent(b,c);a('[id^="generatePassword"]',b).click(this.callbackWrapper(this.setGenerateRandom));a('[id^="generatePassword"]',b).attr("checked")&&this.setGenerateRandom('[id^="generatePassword"]')};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler,a.pkp.controllers.form.UserFormHandler);
a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler.prototype.submitForm=function(b,c){var d=this.getHtmlElement();a(":password",d).removeAttr("disabled");this.parent("submitForm",b,c)};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler.prototype.setGenerateRandom=function(b){var c=a(b);b=this.getHtmlElement();if(c.prop("checked")){c="********";var d="disabled"}else d=c="";a(":password",b).prop("disabled",d).val(c);a('[id^="sendNotify"]',b).attr("disabled",d).prop("checked",
d)}})(jQuery);(function(a){a.pkp.controllers.grid.settings.roles=a.pkp.controllers.grid.settings.roles||{form:{}};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler=function(b,c){var d=a('[id^="roleId"]',b);this.parent(b,c);c.selfRegistrationRoleIds&&(this.selfRegistrationRoleIds_=c.selfRegistrationRoleIds);c.recommendOnlyRoleIds&&(this.recommendOnlyRoleIds_=c.recommendOnlyRoleIds);c.notChangeMetadataEditPermissionRoles&&(this.notChangeMetadataEditPermissionRoles_=c.notChangeMetadataEditPermissionRoles);
this.roleForbiddenStages_=c.roleForbiddenStagesJSON.content;this.stagesSelector_=c.stagesSelector;this.updatePermitSelfRegistration(d.val());this.updatePermitMetadataEdit(d.val(),!1);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.notChangeMetadataEditPermissionRoles_=null;a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.changeRoleId=function(b){b=a(b).val();this.updatePermitSelfRegistration(b);this.updatePermitMetadataEdit(b,!0);
this.updateStageOptions(b);this.updateRecommendOnly(b)};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updatePermitSelfRegistration=function(b){var c=a('[id^="permitSelfRegistration"]');this.getHtmlElement();var d,e=!1;for(d=0;d<this.selfRegistrationRoleIds_.length;d++)this.selfRegistrationRoleIds_[d]==b&&(e=!0);e?c.removeAttr("disabled"):(c.attr("disabled","disabled"),c.removeAttr("checked"))};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updatePermitMetadataEdit=
function(b,c){var d,e=a('[id^="permitMetadataEdit"]'),k=!1;for(d=0;d<this.notChangeMetadataEditPermissionRoles_.length;d++)this.notChangeMetadataEditPermissionRoles_[d]==b&&(k=!0);k?(e.attr("disabled","disabled"),e.attr("checked","checked"),e.prop("checked","checked")):(e.removeAttr("disabled"),c&&e.removeAttr("checked"))};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updateStageOptions=function(b){var c=this.getHtmlElement(),d=c.find("#userGroupStageContainer"),e=a(this.stagesSelector_,
c).filter("input"),k;e.removeAttr("disabled");if(void 0!=this.roleForbiddenStages_[b])for(k=0;k<this.roleForbiddenStages_[b].length;k++){var t=this.roleForbiddenStages_[b][k];e.filter('input[value="'+t+'"]').attr("disabled","disabled")}0==c.find("input[id^='assignedStages-']:enabled").length?(d.hide("slow"),a("#showTitle").attr("disabled","disabled")):(d.show("slow"),a("#showTitle").removeAttr("disabled"))};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updateRecommendOnly=
function(b){var c=a("[id^='recommendOnly']",this.getHtmlElement()),d,e=!1;for(d=0;d<this.recommendOnlyRoleIds_.length;d++)this.recommendOnlyRoleIds_[d]==b&&(e=!0);e?c.removeAttr("disabled"):(c.attr("disabled","disabled"),c.removeAttr("checked"))}})(jQuery);(function(a){a.pkp.controllers.grid.notifications=a.pkp.controllers.grid.notifications||{};a.pkp.controllers.grid.notifications.NotificationsGridHandler=function(b,c){b.find('a[id*="markNew"]').click(this.callbackWrapper(this.markNewHandler_));b.find('a[id*="markRead"]').click(this.callbackWrapper(this.markReadHandler_));b.find('a[id*="deleteNotification"]').click(this.callbackWrapper(this.deleteHandler_));this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.notifications.NotificationsGridHandler,
a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markNewUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markReadUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.deleteUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.initialize=function(b){this.markNewUrl_=b.markNewUrl;this.markReadUrl_=b.markReadUrl;this.deleteUrl_=b.deleteUrl;this.parent("initialize",
b)};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.getSelectedNotifications_=function(){var b=[];this.getHtmlElement().find("input:checkbox:checked").each(function(){b.push(a(this).val())});return b};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markNewHandler_=function(b,c){a.post(this.markNewUrl_,{selectedElements:this.getSelectedNotifications_()},this.callbackWrapper(this.responseHandler_,null),"json");return!1};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markReadHandler_=
function(b,c){a.post(this.markReadUrl_,{selectedElements:this.getSelectedNotifications_()},this.callbackWrapper(this.responseHandler_,null),"json");return!1};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.deleteHandler_=function(b,c){a.post(this.deleteUrl_,{selectedElements:this.getSelectedNotifications_()},this.callbackWrapper(this.responseHandler_,null),"json");return!1};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.responseHandler_=function(b,
c){b=this.getFetchExtraParams();b.selectedNotificationIds=c.content;this.setFetchExtraParams(b);this.handleJson(c)}})(jQuery);(function(a){a.pkp.controllers.tab=a.pkp.controllers.tab||{};a.pkp.controllers.tab.workflow=a.pkp.controllers.tab.workflow||{};a.pkp.controllers.tab.workflow.WorkflowTabHandler=function(b,c){var d,e;this.parent(b,c);if(d=document.location.toString().match("workflow/([^/]+)/")){d=d[1];var k=b.find("li a");for(e=0;e<k.length;e++)b=new RegExp(d),k[e].getAttribute("class").match(b)&&(c.selected=e)}};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(b,c){this.parent(b,c);this.bind("noteAdded",this.handleRefreshNoteList);this.bind("noteDeleted",this.handleRefreshNoteList)};a.pkp.classes.Helper.inherits(a.pkp.controllers.informationCenter.NotesHandler,a.pkp.classes.Handler);a.pkp.controllers.informationCenter.NotesHandler.prototype.handleRefreshNoteList=function(b,c,d){a(".pkp_modal").first().scrollTop(0);this.replaceWith(d)}})(jQuery);(function(a){a.pkp.controllers.statistics=a.pkp.controllers.statistics||{};a.pkp.controllers.statistics.ReportGeneratorFormHandler=function(b,c){var d;c.trackFormChanges=!1;c.transformButtons=!1;this.parent(b,c);this.getHtmlElement().find(":submit").button();a("#reportUrlFormArea",b).hide();this.timeFilterWrapperSelector_=c.timeFilterWrapperSelector;this.rangeByDaySelector_=c.rangeByDaySelector;this.rangeByMonthSelector_=c.rangeByMonthSelector;this.startDayElementSelector_=c.startDayElementSelector;
this.endDayElementSelector_=c.endDayElementSelector;this.optionalColumns_=c.optionalColumns;this.aggregationOptionsSelector_=c.aggregationOptionsSelector;this.fetchFormUrl_=c.fetchFormUrl;this.$metricTypeSelectElement_=d=a(c.metricTypeSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));a(".pkp_loading",b).hide();this.$reportTemplateSelectElement_=b=a(c.reportTemplateSelectSelector,this.getHtmlElement());1==b.length&&b.change(this.callbackWrapper(this.fetchFormHandler_));
this.columnsSelector_=c.columnsSelector;b=a(c.aggregationOptionsSelector);0<b.length&&b.change(this.callbackWrapper(this.aggregationOptionsChangeHandler_));b=a(c.currentMonthSelector,this.getHtmlElement()).add(c.yesterdaySelector,this.getHtmlElement()[0]);2==b.length&&b.click(this.callbackWrapper(this.currentTimeElementsClickHandler_));b=a(c.rangeByMonthSelector,this.getHtmlElement()).add(c.rangeByDaySelector,this.getHtmlElement()[0]);2==b.length&&b.click(this.callbackWrapper(this.rangeTimeElementsClickHandler_));
this.dateRangeElementsWrapper_=a(c.dateRangeWrapperSelector,this.getHtmlElement());1==b.filter("input:checked").length?b.filter("input:checked").click():this.dateRangeElementsWrapper_.hide();this.fileAssocTypes_=c.fileAssocTypes;this.$fileTypeSelectElement_=a(c.fileTypeSelectSelector,this.getHtmlElement());b=a(c.objectTypeSelectSelector,this.getHtmlElement());1==this.$fileTypeSelectElement_.length&&(this.$fileTypeSelectElement_.attr("disabled","disabled"),b.change(this.callbackWrapper(this.updateFileTypeSelectHandler_)));
b.change();this.fetchRegionsUrl_=c.fetchRegionsUrl;this.$regionSelectElement_=a(c.regionSelectSelector,this.getHtmlElement());1==this.$regionSelectElement_.length&&(c=a(c.countrySelectSelector,this.getHtmlElement()),c.change(this.callbackWrapper(this.fetchRegionHandler_)));this.addOptionalColumnsClass_()};a.pkp.classes.Helper.inherits(a.pkp.controllers.statistics.ReportGeneratorFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchFormUrl_=
null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchArticlesUrl_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.$metricTypeSelectElement_={};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.$reportTemplateSelectElement_={};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.$regionSelectElement_={};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchRegionsUrl_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.$fileAssocTypes_=
{};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.rangeByDaySelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.rangeByMonthSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.startDayElementSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.endDayElementSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.timeFilterWrapperSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.columnsSelector_=
null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.optionalColumns_={};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.aggregationOptionsSelector_=null;a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.handleResponse=function(b,c){var d=this.handleJson(c);!1!==d&&void 0!==d.reportUrl&&(a("#reportUrlFormArea",this.getHtmlElement()).show().find(":input").val(d.reportUrl),window.location=d.reportUrl);this.parent("handleResponse",b,c);return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchFormHandler_=
function(b,c){var d={};b=a(this.timeFilterWrapperSelector_,this.getHtmlElement()).serializeArray();a.each(b,function(e,k){d[k.name]=k.value});a(".pkp_loading",this.getHtmlElement()).show();b=a("option:selected",this.$metricTypeSelectElement_);void 0!==b[0]&&void 0!==b[0].value&&(d.metricType=b[0].value);b=a("option:selected",this.$reportTemplateSelectElement_);void 0!==b[0]&&void 0!==b[0].value&&(d.reportTemplate=b[0].value);d.refreshForm=!0;a.get(this.fetchFormUrl_,d,this.callbackWrapper(this.handleResponse,
null),"json");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.updateFileTypeSelectHandler_=function(b,c){var d;b=a(b);b=a("option:selected",b);if(1==b.length)for(d in b=b[0].value,this.fileAssocTypes_)if(this.fileAssocTypes_[d]==b)return this.$fileTypeSelectElement_.removeAttr("disabled"),!1;this.$fileTypeSelectElement_.attr("disabled","disabled");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.fetchRegionHandler_=function(b,c){this.$regionSelectElement_.empty();
b=a(b);b=a("option:selected",b);1==b.length&&(b=b[0].label,a.get(this.fetchRegionsUrl_,{countryId:b},this.callbackWrapper(this.updateRegionSelectCallback_,null),"json"));return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.updateRegionSelectCallback_=function(b,c){b=this.$regionSelectElement_;b.empty();c=this.handleJson(c);if(!1!==c){var d=c.content;var e=0;for(c=d.length;e<c;e++)b.append(a("<option />").val(d[e].id).text(d[e].name))}return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.currentTimeElementsClickHandler_=
function(b,c){this.dateRangeElementsWrapper_.hide();return!0};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.rangeTimeElementsClickHandler_=function(b,c){c=a(this.startDayElementSelector_).add(this.endDayElementSelector_);this.dateRangeElementsWrapper_.show();"#"+a(b).attr("id")==this.rangeByDaySelector_&&c.show();"#"+a(b).attr("id")==this.rangeByMonthSelector_&&c.hide();return!0};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.aggregationOptionsChangeHandler_=
function(b,c){c=a(this.columnsSelector_);b=a(b);c=c.find('option[value="'+b.attr("value")+'"]');b.is(":checked")?c.attr("selected","selected"):c.removeAttr("selected");return!1};a.pkp.controllers.statistics.ReportGeneratorFormHandler.prototype.addOptionalColumnsClass_=function(){var b;var c=a(this.columnsSelector_);var d=a(this.aggregationOptionsSelector_);var e=a("#orderByFormArea select",this.getHtmlElement());c=c.add(e);e=this.optionalColumns_;for(b in e)c.find('option[value="'+b+'"]').addClass("optionalColumn"),
d.filter('input[value="'+b+'"]').parent().addClass("optionalColumn")}})(jQuery);(function(a){a.pkp.controllers.dashboard=a.pkp.controllers.dashboard||{form:{}};a.pkp.controllers.dashboard.form.DashboardTaskFormHandler=function(b,c){this.parent(b,c);this.singleContextSubmissionUrl_=c.singleContextSubmissionUrl;a("#singleContext",b).click(this.callbackWrapper(this.startSingleContextSubmission_));a("#multipleContext",b).change(this.callbackWrapper(this.startMultipleContextSubmission_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.dashboard.form.DashboardTaskFormHandler,a.pkp.controllers.form.FormHandler);
a.pkp.controllers.dashboard.form.DashboardTaskFormHandler.prototype.singleContextSubmissionUrl_=null;a.pkp.controllers.dashboard.form.DashboardTaskFormHandler.prototype.startSingleContextSubmission_=function(){window.location.href=this.singleContextSubmissionUrl_};a.pkp.controllers.dashboard.form.DashboardTaskFormHandler.prototype.startMultipleContextSubmission_=function(){var b=this.getHtmlElement().find("#multipleContext").val();0!=b&&(window.location.href=b)}})(jQuery);(function(a){a.pkp.pages=a.pkp.pages||{header:{}};a.pkp.pages.header.HeaderHandler=function(b,c){this.options_=c;this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.pages.header.HeaderHandler,a.pkp.classes.Handler);a.pkp.pages.header.HeaderHandler.prototype.options_=null})(jQuery);(function(a){a.pkp.pages.header.TasksHandler=function(b,c){this.options_=c;this.parent(b,c);a("#notificationsToggle").click(this.callbackWrapper(this.appendToggleIndicator_));this.bind("updateUnreadNotificationsCount",this.fetchUnreadNotificationsCountHandler_)};a.pkp.classes.Helper.inherits(a.pkp.pages.header.TasksHandler,a.pkp.classes.Handler);a.pkp.pages.header.TasksHandler.prototype.options_=null;a.pkp.pages.header.TasksHandler.prototype.appendToggleIndicator_=function(b,c){b=this.getHtmlElement();
var d=b.find("#notificationsPopover"),e=b.find("#notificationsToggle");d.toggle();e.toggleClass("expandedIndicator");e.hasClass("expandedIndicator")?(this.trigger("callWhenClickOutside",[{container:b,callback:this.callbackWrapper(this.appendToggleIndicator_)}]),setTimeout(this.callbackWrapper(this.setPopoverSize_),500)):(d.css("height","").css("overflow-y",""),c&&this.trigger("callWhenClickOutside",[{container:b,clear:!0}]))};a.pkp.pages.header.TasksHandler.prototype.setPopoverSize_=function(){var b=
this.getHtmlElement().find("#notificationsPopover"),c=a(window).height()-60;c<b.height()&&b.height(c).css("overflow-y","scroll")};a.pkp.pages.header.TasksHandler.prototype.fetchUnreadNotificationsCountHandler_=function(b,c){a.get(this.options_.fetchUnreadNotificationsCountUrl,this.callbackWrapper(this.updateUnreadNotificationsCountHandler_),"json")};a.pkp.pages.header.TasksHandler.prototype.updateUnreadNotificationsCountHandler_=function(b,c){b=this.getHtmlElement().find("#unreadNotificationCount");
b.html(c.content);"0"==c.content?b.removeClass("hasTasks"):b.addClass("hasTasks")}})(jQuery);(function(a){a.pkp.pages.submission=a.pkp.pages.submission||{};a.pkp.pages.submission.SubmissionTabHandler=function(b,c){this.parent(b,c);this.submissionProgress_=c.submissionProgress;this.cancelUrl_=c.cancelUrl;this.cancelConfirmText_=c.cancelConfirmText;this.bind("setStep",this.setStepHandler);this.bind("formCanceled",this.formCanceledHandler);this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(this.submissionProgress_))};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionTabHandler,
a.pkp.controllers.TabHandler);a.pkp.pages.submission.SubmissionTabHandler.prototype.submissionProgress_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.cancelUrl_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.cancelConfirmText_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.setStepHandler=function(b,c,d){this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(d));this.getHtmlElement().tabs("option","active",d-1)};a.pkp.pages.submission.SubmissionTabHandler.prototype.formCanceledHandler=
function(b,c,d){confirm(this.cancelConfirmText_)&&(window.location=this.cancelUrl_)};a.pkp.pages.submission.SubmissionTabHandler.prototype.getDisabledSteps=function(b){switch(parseInt(b,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(b,c){this.parent(b,c);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(b){a(".section-policy").hide();a(".section-policy.section-id-"+a("#sectionId").val()).fadeIn()}})(jQuery);(function(a){a.pkp.pages.submission.SubmissionStep2FormHandler=function(b,c){this.parent(b,c);this.bind("urlInDivLoaded",this.showFileUploadWizard_)};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionStep2FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.pages.submission.SubmissionStep2FormHandler.prototype.showFileUploadWizard_=function(b,c,d){a("#"+d).find('[id*="-addFile-button-"], [id*="-addGalley-button-"]').click()}})(jQuery);jQuery.pkp.pages.submission=jQuery.pkp.pages.submission||{};
(function(a){a.pkp.pages.submission.SubmissionStep3FormHandler=function(b,c){this.parent(b,c);this.bind("gridRefreshRequested",this.fetchChaptersGrid_);this.authorsGridContainer_=c.authorsGridContainer;this.chaptersGridContainer_=c.chaptersGridContainer};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionStep3FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.pages.submission.SubmissionStep3FormHandler.prototype.chaptersGridContainer_="";a.pkp.pages.submission.SubmissionStep3FormHandler.prototype.fetchChaptersGrid_=
function(b,c){c.target.id==this.authorsGridContainer_&&a("#"+this.chaptersGridContainer_).find(".pkp_controllers_grid").trigger("dataChanged")}})(jQuery);(function(a){a.pkp.pages.workflow=a.pkp.pages.workflow||{};a.pkp.pages.workflow.WorkflowHandler=function(b,c){this.parent(b,c);this.bind("stageParticipantsChanged",this.handleStageParticipantsChanged_);this.bind("dataChanged",this.dataChangedHandler_)};a.pkp.classes.Helper.inherits(a.pkp.pages.workflow.WorkflowHandler,a.pkp.classes.Handler);a.pkp.pages.workflow.WorkflowHandler.prototype.handleStageParticipantsChanged_=function(b,c){var d,e,k,t;b=this.getHtmlElement().find(".editorDecisionActions");
var m=this.getHtmlElement().find("#submissionProgressBarDiv");this.getHtmlElement().find("#stageTabs").find("li").each(function(y){if(a(this).hasClass("ui-state-active")){e=a(this).find("a").attr("class");if(d=e.match(/stageId(\d)/))k=d[1],y=a.pkp.classes.Handler.getHandler(m),t=y.getSourceUrl(),y.setSourceUrl(t.replace(/stageId=\d/,"stageId="+k));return!1}});b.add(m).each(function(){a.pkp.classes.Handler.getHandler(a(this)).reload()})};a.pkp.pages.workflow.WorkflowHandler.prototype.dataChangedHandler_=
function(b,c,d){b=a(c.target,this.getHtmlElement()).children("a");b.length&&b.attr("id").match(/submissionEntry/)&&(b=a('[id^="formatsGridContainer"]',this.getHtmlElement()).children("div"),b.trigger("dataChanged",[d]),b.trigger("notifyUser",[b]))}})(jQuery);(function(a){a.pkp.controllers.grid.users=a.pkp.controllers.grid.users||{};a.pkp.controllers.grid.users.UserGridHandler=function(b,c){this.parent(b,c);this.bindGlobal("userMerged",function(){this.trigger("modalFinished");this.refreshGridHandler()});this.bindGlobal("userGroupUpdated",function(){this.refreshGridHandler()})};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.UserGridHandler,a.pkp.controllers.grid.GridHandler)})(jQuery);(function(a){a.pkp.controllers.grid.users.reviewer=a.pkp.controllers.grid.users.reviewer||{};a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler=function(b,c){this.parent(b,c);b.find(".button").button();a("#selectReviewerButton").click(this.callbackWrapper(this.selectReviewer));a("#regularReviewerForm").hide();this.bind("refreshForm",this.handleRefresh_);this.bindGlobal("reviewersSelected",this.updateReviewerSelection)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler,
a.pkp.classes.Handler);a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler.prototype.selectedReviewer=null;a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler.prototype.updateReviewerSelection=function(b,c){c.length?(this.selectedReviewer=c[0],b=this.selectedReviewer.id,c=this.selectedReviewer.fullName):(this.selectedReviewer=null,b=c="");a("#reviewerId",this.getHtmlElement()).val(b);a('[id^="selectedReviewerName"]',this.getHtmlElement()).html(c)};a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler.prototype.selectReviewer=
function(b){this.selectedReviewer&&(a("#searchGridAndButton").hide(),a("#regularReviewerForm").show())};a.pkp.controllers.grid.users.reviewer.AdvancedReviewerSearchHandler.prototype.handleRefresh_=function(b,c,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(b,c){this.parent(b,c);b.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(b,c,d){this.getHtmlElement().change()}})(jQuery);(function(a){a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler=function(b,c){this.parent(b,c);c.templateUrl&&(this.templateUrl_=c.templateUrl);b.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(b,c){b=this.getHtmlElement();a.post(this.templateUrl_,b.find("#template").serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.updateTemplate=function(b,c){b=this.getHtmlElement();c=this.handleJson(c);
b=b.find('textarea[name="personalMessage"]');b=tinyMCE.EditorManager.get(b.attr("id"));!1!==c&&""!==c.content&&b.setContent(c.content);return c.status}})(jQuery);(function(a){a.pkp.controllers.grid.users.stageParticipant=a.pkp.controllers.grid.users.stageParticipant||{};a.pkp.controllers.grid.users.stageParticipant.StageParticipantGridHandler=function(b,c){this.parent(b,c);this.bind("dataChanged",function(){this.refreshGridHandler();a("#submissionEditorDecisionsDiv,#copyeditingEditorDecisionsDiv,[id^=reviewDecisionsDiv]").each(function(){a.pkp.classes.Handler.getHandler(a(this)).reload()})})};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.stageParticipant.StageParticipantGridHandler,
a.pkp.controllers.grid.CategoryGridHandler)})(jQuery);(function(a){a.pkp.controllers.grid.users.stageParticipant.form=a.pkp.controllers.grid.users.stageParticipant.form||{};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler=function(b,c){this.parent(b,c);c.templateUrl&&(this.templateUrl_=c.templateUrl);c.possibleRecommendOnlyUserGroupIds&&(this.possibleRecommendOnlyUserGroupIds_=c.possibleRecommendOnlyUserGroupIds);c.recommendOnlyUserGroupIds&&(this.recommendOnlyUserGroupIds_=c.recommendOnlyUserGroupIds);c.notChangeMetadataEditPermissionRoles&&
(this.notChangeMetadataEditPermissionRoles_=c.notChangeMetadataEditPermissionRoles);c.permitMetadataEditUserGroupIds&&(this.permitMetadataEditUserGroupIds_=c.permitMetadataEditUserGroupIds);c.blindReviewerIds&&(this.blindReviewerIds_=c.blindReviewerIds);c.blindReviewerWarning&&(this.blindReviewerWarning_=c.blindReviewerWarning);c.blindReviewerWarningOk&&(this.blindReviewerWarningOk_=c.blindReviewerWarningOk);a("input[name='userGroupId'], input[name='userIdSelected']",b).change(this.callbackWrapper(this.updateRecommendOnly));
a("input[name='userGroupId'], input[name='userIdSelected']",b).change(this.callbackWrapper(this.updateSubmissionMetadataEditPermitOption));a("input[name='userIdSelected']",b).change(this.callbackWrapper(this.maybeTriggerReviewerWarning));b.find("#template").change(this.callbackWrapper(this.selectTemplateHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.templateUrl_=
null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.blindReviewerIds_=null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.blindReviewerWarning_=null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.blindReviewerWarningOk_=null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.notChangeMetadataEditPermissionRoles_=null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.permitMetadataEditUserGroupIds_=
null;a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.selectTemplateHandler_=function(b,c){b=this.getHtmlElement();a.post(this.templateUrl_,b.find("#template").serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.updateTemplate=function(b,c){var d=this.getHtmlElement();b=this.handleJson(c);c=c.content;d=d.find('textarea[name="message"]');var e=tinyMCE.EditorManager.get(d.attr("id"));
c.variables&&d.attr("data-variables",JSON.stringify(c.variables));e.setContent(c.body);return b.status};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.updateRecommendOnly=function(b,c){var d=this.getHtmlElement(),e=d.find("input[name='userGroupId']");c=d.find("input[id^='recommendOnly']");d=d.find(".recommendOnlyWrapper");e=e.val();if("userGroupId"==a(b).prop("name"))c.attr("disabled","disabled"),c.removeAttr("checked"),d.hide();else if("userIdSelected"==
a(b).prop("name")&&!d.is(":visible"))for(b=0;b<this.possibleRecommendOnlyUserGroupIds_.length;b++)if(this.possibleRecommendOnlyUserGroupIds_[b]==e){c.removeAttr("disabled");d.show();for(b=0;b<this.recommendOnlyUserGroupIds_.length;b++)if(this.recommendOnlyUserGroupIds_[b]==e){c.prop("checked",!0);break}break}else c.attr("disabled","disabled"),d.hide()};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.maybeTriggerReviewerWarning=function(b,c){!(b=a(b).val())||
0>this.blindReviewerIds_.indexOf(b)||(b={title:"",okButton:this.blindReviewerWarningOk_,cancelButton:!1,dialogText:this.blindReviewerWarning_},a('<div id="'+a.pkp.classes.Helper.uuid()+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",b))};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.updateSubmissionMetadataEditPermitOption=function(b,c){var d=this.getHtmlElement(),e=d.find("input[name='userGroupId']");
c=d.find("input[id^='canChangeMetadata']");d=d.find(".submissionEditMetadataPermit");var k=!1;e=e.val();if("userGroupId"==a(b).prop("name"))c.attr("disabled","disabled"),c.removeAttr("checked"),d.hide();else if("userIdSelected"==a(b).prop("name")&&!d.is(":visible")){for(b=0;b<this.notChangeMetadataEditPermissionRoles_.length;b++)if(this.notChangeMetadataEditPermissionRoles_[b]==e){k=!0;break}if(k)c.attr("disabled","disabled"),d.hide();else for(c.removeAttr("disabled"),d.show(),b=0;b<this.permitMetadataEditUserGroupIds_.length;b++)if(this.permitMetadataEditUserGroupIds_[b]==
e){c.prop("checked",!0);break}}};a.pkp.controllers.grid.users.stageParticipant.form.StageParticipantNotifyHandler.prototype.handleResponse=function(b,c){var d=a("#queriesGrid .pkp_controllers_grid");a.pkp.classes.Handler.hasHandler(d)&&a.pkp.classes.Handler.getHandler(d).trigger("dataChanged");return this.parent("handleResponse",b,c)}})(jQuery);(function(a){a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler=function(b,c){this.parent(b,c);a("select[name^='filterUserGroupId']",b).change(this.callbackWrapper(this.addUserGroupId));a("input[name='userId']").click(function(){var d=a("input[name='userId']:checked").val();a("input[name='userIdSelected']").val(d).trigger("change")});this.addUserGroupId()};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler,a.pkp.controllers.form.ClientFormHandler);
a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler.prototype.addUserGroupId=function(){var b=this.getHtmlElement().find("select[name^='filterUserGroupId']").val();a("input[name='userGroupId']").val(b).trigger("change")}})(jQuery);(function(a){a.pkp.pages.reviewer=a.pkp.pages.reviewer||{};a.pkp.pages.reviewer.ReviewerTabHandler=function(b,c){this.parent(b,c);this.reviewStep_=c.reviewStep;this.bind("setStep",this.setStepHandler);this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(this.reviewStep_))};a.pkp.classes.Helper.inherits(a.pkp.pages.reviewer.ReviewerTabHandler,a.pkp.controllers.TabHandler);a.pkp.pages.reviewer.ReviewerTabHandler.prototype.reviewStep_=null;a.pkp.pages.reviewer.ReviewerTabHandler.prototype.setStepHandler=
function(b,c,d){this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(d));this.getHtmlElement().tabs("option","active",d-1)};a.pkp.pages.reviewer.ReviewerTabHandler.prototype.getDisabledSteps=function(b){switch(b){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(b,c){this.parent(b,c);b.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(b,c){this.parent(b,c);b.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(b,c,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(b,c){this.parent(b,c);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(b,c){this.parent(b,c);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.fn.pkpHandler=function(b,c){this.each(function(){var d=a(this);c=c||{};a.pkp.classes.Helper.objectFactory(b,[d,c])});return this};a.fn.pkpAjaxHtml=function(b,c){var d=this.first();a.ajax({url:b,dataType:"json",success:function(e){d.find("#loading").hide();!0===e.status?(e.content&&d.html(e.content),c&&c()):(d.trigger("ajaxHtmlError",e.content),alert(e.content))},error:function(){alert("Failed Ajax request or invalid JSON returned.")}});d.html("<div id='loading' class='throbber'></div>");
return this}})(jQuery);

KUNTUL | JINGKONTOT |