AnonSec Team
Server IP : 103.11.96.170  /  Your IP : 18.118.31.32
Web Server : Microsoft-IIS/10.0
System : Windows NT WIN-F6SLGVICLOP 10.0 build 17763 (Windows Server 2016) AMD64
User : elibrary.unsap.ac.id ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF
Directory (0777) :  D:/localhost/ejournal/js/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : D:/localhost/ejournal/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(b){var c=b.data;b.isDefaultPrevented()||(b.preventDefault(),a(b.target).ajaxSubmit(c))}function c(b){var c=b.target,d=a(c);if(!d.is("[type=submit],[type=image]")){c=d.closest("[type=submit]");if(0===c.length)return;c=c[0]}var e=this;e.clk=c;"image"==c.type&&(void 0!==b.offsetX?(e.clk_x=b.offsetX,e.clk_y=b.offsetY):"function"==typeof a.fn.offset?(d=d.offset(),
e.clk_x=b.pageX-d.left,e.clk_y=b.pageY-d.top):(e.clk_x=b.pageX-c.offsetLeft,e.clk_y=b.pageY-c.offsetTop));setTimeout(function(){e.clk=e.clk_x=e.clk_y=null},100)}function d(){if(a.fn.ajaxSubmit.debug){var b="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(b):window.opera&&window.opera.postError&&window.opera.postError(b)}}var e=void 0!==a("<input type='file'/>").get(0).files;var g=void 0!==window.FormData;var k=!!a.fn.prop;a.fn.attr2=function(){if(!k)return this.attr.apply(this,
arguments);var a=this.prop.apply(this,arguments);return a&&a.jquery||"string"===typeof a?a:this.attr.apply(this,arguments)};a.fn.ajaxSubmit=function(b){function c(c){c=a.param(c,b.traditional).split("&");var d=c.length,e=[],f;for(f=0;f<d;f++){c[f]=c[f].replace(/\+/g," ");var g=c[f].split("=");e.push([decodeURIComponent(g[0]),decodeURIComponent(g[1])])}return e}function h(d){for(var e=new FormData,f=0;f<d.length;f++)e.append(d[f].name,d[f].value);if(b.extraData)for(d=c(b.extraData),f=0;f<d.length;f++)d[f]&&
e.append(d[f][0],d[f][1]);b.data=null;f=a.extend(!0,{},a.ajaxSettings,b,{contentType:!1,processData:!1,cache:!1,type:w||"POST"});b.uploadProgress&&(f.xhr=function(){var c=a.ajaxSettings.xhr();c.upload&&c.upload.addEventListener("progress",function(a){var c=0,d=a.loaded||a.position,e=a.total;a.lengthComputable&&(c=Math.ceil(d/e*100));b.uploadProgress(a,d,e,c)},!1);return c});f.data=null;var g=f.beforeSend;f.beforeSend=function(a,c){c.data=b.formData?b.formData:e;g&&g.call(this,a,c)};return a.ajax(f)}
function y(c){function e(a){var b=null;try{a.contentWindow&&(b=a.contentWindow.document)}catch(L){d("cannot get iframe.contentWindow document: "+L)}if(b)return b;try{b=a.contentDocument?a.contentDocument:a.document}catch(L){d("cannot get iframe.contentDocument: "+L),b=a.document}return b}function f(){function b(){try{var a=e(u).readyState;d("state = "+a);a&&"uninitialized"==a.toLowerCase()&&setTimeout(b,50)}catch(V){d("Server abort: ",V," (",V.name,")"),g(2),I&&clearTimeout(I),I=void 0}}var c=q.attr2("target"),
l=q.attr2("action"),f=q.attr("enctype")||q.attr("encoding")||"multipart/form-data";x.setAttribute("target",y);w&&!/post/i.test(w)||x.setAttribute("method","POST");l!=m.url&&x.setAttribute("action",m.url);m.skipEncodingOverride||w&&!/post/i.test(w)||q.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});m.timeout&&(I=setTimeout(function(){r=!0;g(1)},m.timeout));var n=[];try{if(m.extraData)for(var A in m.extraData)m.extraData.hasOwnProperty(A)&&(a.isPlainObject(m.extraData[A])&&m.extraData[A].hasOwnProperty("name")&&
m.extraData[A].hasOwnProperty("value")?n.push(a('<input type="hidden" name="'+m.extraData[A].name+'">').val(m.extraData[A].value).appendTo(x)[0]):n.push(a('<input type="hidden" name="'+A+'">').val(m.extraData[A]).appendTo(x)[0]));m.iframeTarget||t.appendTo("body");u.attachEvent?u.attachEvent("onload",g):u.addEventListener("load",g,!1);setTimeout(b,15);try{x.submit()}catch(aa){document.createElement("form").submit.apply(x)}}finally{x.setAttribute("action",l),x.setAttribute("enctype",f),c?x.setAttribute("target",
c):q.removeAttr("target"),a(n).remove()}}function g(b){if(!p.aborted&&!K)if(n=e(u),n||(d("cannot access response document"),b=2),1===b&&p)p.abort("timeout"),v.reject(p,"timeout");else if(2==b&&p)p.abort("server abort"),v.reject(p,"error","server abort");else if(n&&n.location.href!=m.iframeSrc||r){u.detachEvent?u.detachEvent("onload",g):u.removeEventListener("load",g,!1);b="success";var c;try{if(r)throw"timeout";var f="xml"==m.dataType||n.XMLDocument||a.isXMLDoc(n);d("isXml="+f);if(!f&&window.opera&&
(null===n.body||!n.body.innerHTML)&&--A){d("requeing onLoad callback, DOM not available");setTimeout(g,250);return}var x=n.body?n.body:n.documentElement;p.responseText=x?x.innerHTML:null;p.responseXML=n.XMLDocument?n.XMLDocument:n;f&&(m.dataType="xml");p.getResponseHeader=function(a){return{"content-type":m.dataType}[a.toLowerCase()]};x&&(p.status=Number(x.getAttribute("status"))||p.status,p.statusText=x.getAttribute("statusText")||p.statusText);var h=(m.dataType||"").toLowerCase(),P=/(json|script|text)/.test(h);
if(P||m.textarea){var k=n.getElementsByTagName("textarea")[0];if(k)p.responseText=k.value,p.status=Number(k.getAttribute("status"))||p.status,p.statusText=k.getAttribute("statusText")||p.statusText;else if(P){var G=n.getElementsByTagName("pre")[0],q=n.getElementsByTagName("body")[0];G?p.responseText=G.textContent?G.textContent:G.innerText:q&&(p.responseText=q.textContent?q.textContent:q.innerText)}}else"xml"==h&&!p.responseXML&&p.responseText&&(p.responseXML=N(p.responseText));try{l=O(p,h,m)}catch(M){b=
"parsererror",p.error=c=M||b}}catch(M){d("error caught: ",M),b="error",p.error=c=M||b}p.aborted&&(d("upload aborted"),b=null);p.status&&(b=200<=p.status&&300>p.status||304===p.status?"success":"error");"success"===b?(m.success&&m.success.call(m.context,l,"success",p),v.resolve(p.responseText,"success",p),C&&a.event.trigger("ajaxSuccess",[p,m])):b&&(void 0===c&&(c=p.statusText),m.error&&m.error.call(m.context,p,b,c),v.reject(p,"error",c),C&&a.event.trigger("ajaxError",[p,m,c]));C&&a.event.trigger("ajaxComplete",
[p,m]);C&&!--a.active&&a.event.trigger("ajaxStop");m.complete&&m.complete.call(m.context,p,b);K=!0;m.timeout&&clearTimeout(I);setTimeout(function(){m.iframeTarget?t.attr("src",m.iframeSrc):t.remove();p.responseXML=null},100)}}var x=q[0],h,C,r,I,v=a.Deferred();v.abort=function(a){p.abort(a)};if(c)for(h=0;h<D.length;h++)c=a(D[h]),k?c.prop("disabled",!1):c.removeAttr("disabled");var m=a.extend(!0,{},a.ajaxSettings,b);m.context=m.context||m;var y="jqFormIO"+(new Date).getTime();if(m.iframeTarget){var t=
a(m.iframeTarget);(h=t.attr2("name"))?y=h:t.attr2("name",y)}else t=a('<iframe name="'+y+'" src="'+m.iframeSrc+'" />'),t.css({position:"absolute",top:"-1000px",left:"-1000px"});var u=t[0];var p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(b){var c="timeout"===b?"timeout":"aborted";d("aborting upload... "+c);this.aborted=1;try{u.contentWindow.document.execCommand&&
u.contentWindow.document.execCommand("Stop")}catch(L){}t.attr("src",m.iframeSrc);p.error=c;m.error&&m.error.call(m.context,p,c,b);C&&a.event.trigger("ajaxError",[p,m,c]);m.complete&&m.complete.call(m.context,p,c)}};(C=m.global)&&0===a.active++&&a.event.trigger("ajaxStart");C&&a.event.trigger("ajaxSend",[p,m]);if(m.beforeSend&&!1===m.beforeSend.call(m.context,p,m))return m.global&&a.active--,v.reject(),v;if(p.aborted)return v.reject(),v;(c=x.clk)&&(h=c.name)&&!c.disabled&&(m.extraData=m.extraData||
{},m.extraData[h]=c.value,"image"==c.type&&(m.extraData[h+".x"]=x.clk_x,m.extraData[h+".y"]=x.clk_y));c=a("meta[name=csrf-token]").attr("content");(h=a("meta[name=csrf-param]").attr("content"))&&c&&(m.extraData=m.extraData||{},m.extraData[h]=c);m.forceSync?f():setTimeout(f,10);var l,n,A=50,K,N=a.parseXML||function(a,b){window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml");return b&&b.documentElement&&"parsererror"!=
b.documentElement.nodeName?b:null},P=a.parseJSON||function(a){return window.eval("("+a+")")},O=function(b,c,d){var e=b.getResponseHeader("content-type")||"",l="xml"===c||!c&&0<=e.indexOf("xml");b=l?b.responseXML:b.responseText;l&&"parsererror"===b.documentElement.nodeName&&a.error&&a.error("parsererror");d&&d.dataFilter&&(b=d.dataFilter(b,c));"string"===typeof b&&("json"===c||!c&&0<=e.indexOf("json")?b=P(b):("script"===c||!c&&0<=e.indexOf("javascript"))&&a.globalEval(b));return b};return v}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),
this;var q=this;"function"==typeof b?b={success:b}:void 0===b&&(b={});var w=b.type||this.attr2("method");var t=b.url||this.attr2("action");(t=(t="string"===typeof t?a.trim(t):"")||window.location.href||"")&&(t=(t.match(/^([^#]+)/)||[])[1]);b=a.extend(!0,{url:t,success:a.ajaxSettings.success,type:w||a.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},b);t={};this.trigger("form-pre-serialize",[this,b,t]);if(t.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),
this;if(b.beforeSerialize&&!1===b.beforeSerialize(this,b))return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var z=b.traditional;void 0===z&&(z=a.ajaxSettings.traditional);var D=[],u=this.formToArray(b.semantic,D);if(b.data){b.extraData=b.data;var f=a.param(b.data,z)}if(b.beforeSubmit&&!1===b.beforeSubmit(u,this,b))return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[u,this,b,t]);if(t.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),
this;t=a.param(u,z);f&&(t=t?t+"&"+f:f);"GET"==b.type.toUpperCase()?(b.url+=(0<=b.url.indexOf("?")?"&":"?")+t,b.data=null):b.data=t;var F=[];b.resetForm&&F.push(function(){q.resetForm()});b.clearForm&&F.push(function(){q.clearForm(b.includeHidden)});if(!b.dataType&&b.target){var B=b.success||function(){};F.push(function(c){var d=b.replaceTarget?"replaceWith":"html";a(b.target)[d](c).each(B,arguments)})}else b.success&&F.push(b.success);b.success=function(a,c,d){for(var e=b.context||this,f=0,g=F.length;f<
g;f++)F[f].apply(e,[a,c,d||q,q])};if(b.error){var H=b.error;b.error=function(a,c,d){H.apply(b.context||this,[a,c,d,q])}}if(b.complete){var x=b.complete;b.complete=function(a,c){x.apply(b.context||this,[a,c,q])}}f=0<a("input[type=file]:enabled",this).filter(function(){return""!==a(this).val()}).length;t="multipart/form-data"==q.attr("enctype")||"multipart/form-data"==q.attr("encoding");z=e&&g;d("fileAPI :"+z);var C;!1!==b.iframe&&(b.iframe||(f||t)&&!z)?b.closeKeepAlive?a.get(b.closeKeepAlive,function(){C=
y(u)}):C=y(u):C=(f||t)&&z?h(u):a.ajax(b);q.removeData("jqxhr").data("jqxhr",C);for(f=0;f<D.length;f++)D[f]=null;this.trigger("form-submit-notify",[this,b]);return this};a.fn.ajaxForm=function(e){e=e||{};e.delegation=e.delegation&&a.isFunction(a.fn.on);if(!e.delegation&&0===this.length){var g=this.selector,h=this.context;if(!a.isReady&&g)return d("DOM not ready, queuing ajaxForm"),a(function(){a(g,h).ajaxForm(e)}),this;d("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)"));
return this}return e.delegation?(a(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,c).on("submit.form-plugin",this.selector,e,b).on("click.form-plugin",this.selector,e,c),this):this.ajaxFormUnbind().bind("submit.form-plugin",e,b).bind("click.form-plugin",e,c)};a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};a.fn.formToArray=function(b,c){var d=[];if(0===this.length)return d;var g=this[0],h=this.attr("id"),k=b?g.getElementsByTagName("*"):
g.elements;k&&!/MSIE [678]/.test(navigator.userAgent)&&(k=a(k).get());h&&(h=a(':input[form="'+h+'"]').get(),h.length&&(k=(k||[]).concat(h)));if(!k||!k.length)return d;var r,z;var D=0;for(z=k.length;D<z;D++){var u=k[D];if((h=u.name)&&!u.disabled)if(b&&g.clk&&"image"==u.type)g.clk==u&&(d.push({name:h,value:a(u).val(),type:u.type}),d.push({name:h+".x",value:g.clk_x},{name:h+".y",value:g.clk_y}));else if((r=a.fieldValue(u,!0))&&r.constructor==Array){c&&c.push(u);var f=0;for(u=r.length;f<u;f++)d.push({name:h,
value:r[f]})}else if(e&&"file"==u.type)if(c&&c.push(u),r=u.files,r.length)for(f=0;f<r.length;f++)d.push({name:h,value:r[f],type:u.type});else d.push({name:h,value:"",type:u.type});else null!==r&&"undefined"!=typeof r&&(c&&c.push(u),d.push({name:h,value:r,type:u.type,required:u.required}))}!b&&g.clk&&(b=a(g.clk),c=b[0],(h=c.name)&&!c.disabled&&"image"==c.type&&(d.push({name:h,value:b.val()}),d.push({name:h+".x",value:g.clk_x},{name:h+".y",value:g.clk_y})));return d};a.fn.formSerialize=function(b){return a.param(this.formToArray(b))};
a.fn.fieldSerialize=function(b){var c=[];this.each(function(){var d=this.name;if(d){var e=a.fieldValue(this,b);if(e&&e.constructor==Array)for(var g=0,h=e.length;g<h;g++)c.push({name:d,value:e[g]});else null!==e&&"undefined"!=typeof e&&c.push({name:this.name,value:e})}});return a.param(c)};a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;d<e;d++){var g=a.fieldValue(this[d],b);null===g||"undefined"==typeof g||g.constructor==Array&&!g.length||(g.constructor==Array?a.merge(c,g):c.push(g))}return c};
a.fieldValue=function(b,c){var d=b.name,e=b.type,g=b.tagName.toLowerCase();void 0===c&&(c=!0);if(c&&(!d||b.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!b.checked||("submit"==e||"image"==e)&&b.form&&b.form.clk!=b||"select"==g&&-1==b.selectedIndex))return null;if("select"==g){g=b.selectedIndex;if(0>g)return null;c=[];b=b.options;d=(e="select-one"==e)?g+1:b.length;for(g=e?g:0;g<d;g++){var k=b[g];if(k.selected){var h=k.value;h||(h=k.attributes&&k.attributes.value&&!k.attributes.value.specified?
k.text:k.value);if(e)return h;c.push(h)}}return c}return a(b).val()};a.fn.clearForm=function(b){return this.each(function(){a("input,select,textarea",this).clearFields(b)})};a.fn.clearFields=a.fn.clearInputs=function(b){var c=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var d=this.type,e=this.tagName.toLowerCase();c.test(d)||"textarea"==e?this.value="":"checkbox"==d||"radio"==d?this.checked=!1:"select"==e?this.selectedIndex=
-1:"file"==d?/MSIE/.test(navigator.userAgent)?a(this).replaceWith(a(this).clone(!0)):a(this).val(""):b&&(!0===b&&/hidden/.test(d)||"string"==typeof b&&a(this).is(b))&&(this.value="")})};a.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})};a.fn.enable=function(a){void 0===a&&(a=!0);return this.each(function(){this.disabled=!a})};a.fn.selected=function(b){void 0===b&&(b=!0);return this.each(function(){var c=
this.type;"checkbox"==c||"radio"==c?this.checked=b:"option"==this.tagName.toLowerCase()&&(c=a(this).parent("select"),b&&c[0]&&"select-one"==c[0].type&&c.find("option").selected(!1),this.selected=b)})};a.fn.ajaxSubmit.debug=!1});(function(a){a.widget("ui.tagit",{options:{allowDuplicates:!1,caseSensitive:!0,fieldName:"tags",placeholderText:null,readOnly:!1,removeConfirmation:!1,tagLimit:null,availableTags:[],autocomplete:{},showAutocompleteOnFocus:!1,allowSpaces:!1,singleField:!1,singleFieldDelimiter:",",singleFieldNode:null,animate:!0,tabIndex:null,beforeTagAdded:null,afterTagAdded:null,beforeTagRemoved:null,afterTagRemoved:null,onTagClicked:null,onTagLimitExceeded:null,onTagAdded:null,onTagRemoved:null,tagSource:null},_create:function(){var b=
this;this.element.is("input")?(this.tagList=a("<ul></ul>").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.addClass("tagit-hidden-field")):this.tagList=this.element.find("ul, ol").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(b,c){var d=b.term.toLowerCase();b=a.grep(this.options.availableTags,function(a){return 0===a.toLowerCase().indexOf(d)});this.options.allowDuplicates||(b=this._subtractArray(b,this.assignedTags()));c(b)});this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(a,c){b._showAutocomplete()}),"undefined"===typeof this.options.autocomplete.minLength&&(this.options.autocomplete.minLength=
0));a.isFunction(this.options.autocomplete.source)&&(this.options.autocomplete.source=a.proxy(this.options.autocomplete.source,this));a.isFunction(this.options.tagSource)&&(this.options.tagSource=a.proxy(this.options.tagSource,this));this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(a('<li class="tagit-new"></li>').append(this.tagInput)).click(function(c){var d=a(c.target);d.hasClass("tagit-label")?(d=d.closest(".tagit-choice"),d.hasClass("removed")||b._trigger("onTagClicked",
c,{tag:d,tagLabel:b.tagLabel(d)})):b.tagInput.focus()});var c=!1;if(this.options.singleField)if(this.options.singleFieldNode){var d=a(this.options.singleFieldNode),e=d.val().split(this.options.singleFieldDelimiter);d.val("");a.each(e,function(a,d){b.createTag(d,null,!0);c=!0})}else this.options.singleFieldNode=a('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />'),this.tagList.after(this.options.singleFieldNode);c||this.tagList.children("li").each(function(){a(this).hasClass("tagit-new")||
(b.createTag(a(this).text(),a(this).attr("class"),!0),a(this).remove())});this.tagInput.keydown(function(c){if(c.which==a.ui.keyCode.BACKSPACE&&""===b.tagInput.val()){var d=b._lastTag();!b.options.removeConfirmation||d.hasClass("remove")?b.removeTag(d):b.options.removeConfirmation&&d.addClass("remove ui-state-highlight")}else b.options.removeConfirmation&&b._lastTag().removeClass("remove ui-state-highlight");if(","===c.key&&!1===c.shiftKey||c.which===a.ui.keyCode.ENTER||c.which==a.ui.keyCode.TAB&&
""!==b.tagInput.val()||c.which==a.ui.keyCode.SPACE&&!0!==b.options.allowSpaces&&('"'!=a.trim(b.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==a.trim(b.tagInput.val()).charAt(0)&&'"'==a.trim(b.tagInput.val()).charAt(a.trim(b.tagInput.val()).length-1)&&0!==a.trim(b.tagInput.val()).length-1))c.which===a.ui.keyCode.ENTER&&""===b.tagInput.val()||c.preventDefault(),b.options.autocomplete.autoFocus&&b.tagInput.data("autocomplete-open")||(b.tagInput.autocomplete("close"),b.createTag(b._cleanedInput()))}).blur(function(a){b.tagInput.data("autocomplete-open")||
b.createTag(b._cleanedInput())});if(this.options.availableTags||this.options.tagSource||this.options.autocomplete.source)d={select:function(a,c){b.createTag(c.item.value);return!1}},a.extend(d,this.options.autocomplete),d.source=this.options.tagSource||d.source,this.tagInput.autocomplete(d).bind("autocompleteopen.tagit",function(a,c){b.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose.tagit",function(a,c){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(a){return!this._findTagByLabel(a)},_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 g=a(this.options.onTagClicked?'<a class="tagit-label"></a>':'<span class="tagit-label"></span>').text(b),k=a("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(c).append(g);
this.options.readOnly?k.addClass("tagit-choice-read-only"):(k.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(a){e.removeTag(k)}),k.append(c));this.options.singleField||(g=g.html(),k.append('<input type="hidden" value="'+g+'" name="'+this.options.fieldName+'" class="tagit-hidden-field" />'));!1!==this._trigger("beforeTagAdded",null,{tag:k,tagLabel:this.tagLabel(k),
duringInitialization:d})&&(this.options.singleField&&(g=this.assignedTags(),g.push(b),this._updateSingleTagsField(g)),this._trigger("onTagAdded",null,k),this.tagInput.val(""),this.tagInput.parent().before(k),this._trigger("afterTagAdded",null,{tag:k,tagLabel:this.tagLabel(k),duringInitialization:d}),this.options.showAutocompleteOnFocus&&!d&&setTimeout(function(){e._showAutocomplete()},0))},removeTag:function(b,c){c="undefined"===typeof c?this.options.animate:c;b=a(b);this._trigger("onTagRemoved",
null,b);if(!1!==this._trigger("beforeTagRemoved",null,{tag:b,tagLabel:this.tagLabel(b)})){if(this.options.singleField){var d=this.assignedTags(),e=this.tagLabel(b);d=a.grep(d,function(a){return a!=e});this._updateSingleTagsField(d)}if(c){b.addClass("removed");c=this._effectExists("blind")?["blind",{direction:"horizontal"},"fast"]:["fast"];var g=this;c.push(function(){b.remove();g._trigger("afterTagRemoved",null,{tag:b,tagLabel:g.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(a,c){var b=this._findTagByLabel(a);if(!b)throw"No such tag exists with the name '"+a+"'";this.removeTag(b,c)},removeAll:function(){var a=this;this._tags().each(function(b,d){a.removeTag(d,!1)})}})})(jQuery);jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d);b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}();/*
 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(a){a=e.json?JSON.stringify(a):String(a);return e.raw?a:encodeURIComponent(a)}function c(b,c){if(e.raw)var g=b;else a:{0===b.indexOf('"')&&(b=b.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{b=decodeURIComponent(b.replace(d," "))}catch(r){g=void 0;break a}try{g=e.json?JSON.parse(b):b;break a}catch(r){}g=void 0}return a.isFunction(c)?c(g):g}var d=/\+/g,e=a.cookie=function(d,k,h){if(void 0!==
k&&!a.isFunction(k)){h=a.extend({},e.defaults,h);if("number"===typeof h.expires){var g=h.expires,v=h.expires=new Date;v.setDate(v.getDate()+g)}return document.cookie=[e.raw?d:encodeURIComponent(d),"=",b(k),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join("")}h=d?void 0:{};g=document.cookie?document.cookie.split("; "):[];v=0;for(var y=g.length;v<y;v++){var q=g[v].split("=");var w=q.shift();w=e.raw?w:decodeURIComponent(w);
q=q.join("=");if(d&&d===w){h=c(q,k);break}d||void 0===(q=c(q))||(h[w]=q)}return h};e.defaults={};a.removeCookie=function(b,c){return void 0!==a.cookie(b)?(a.cookie(b,"",a.extend({},c,{expires:-1})),!0):!1}});(function(a){a.fn.equalizeElementHeights=function(){var b=this.map(function(b,d){return a(d).height()}).get();return this.height(Math.max.apply(this,b))}})(jQuery);jQuery&&function(a){a.extend(a.fn,{selectBox:function(b,c){var d,e="",g=navigator.platform.match(/mac/i),k=function(b,c){if(navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i)||"select"!==b.tagName.toLowerCase())return!1;b=a(b);if(b.data("selectBox-control"))return!1;var d=a('<a class="selectBox" />'),e=b.attr("multiple")||1<parseInt(b.attr("size"));c=c||{};d.width(b.outerWidth()).addClass(b.attr("class")).attr("title",b.attr("title")||"").attr("tabindex",parseInt(b.attr("tabindex"))).css("display",
"inline-block").bind("focus.selectBox",function(){this!==document.activeElement&&document.body!==document.activeElement&&a(document.activeElement).blur();d.hasClass("selectBox-active")||(d.addClass("selectBox-active"),b.trigger("focus"))}).bind("blur.selectBox",function(){d.hasClass("selectBox-active")&&(d.removeClass("selectBox-active"),b.trigger("blur"))});a(window).data("selectBox-bindings")||a(window).data("selectBox-bindings",!0).bind("scroll.selectBox",w).bind("resize.selectBox",w);b.attr("disabled")&&
d.addClass("selectBox-disabled");b.bind("click.selectBox",function(a){d.focus();a.preventDefault()});if(e){var g=h(b,"inline");d.append(g).data("selectBox-options",g).addClass("selectBox-inline selectBox-menuShowing").bind("keydown.selectBox",function(a){f(b,a)}).bind("keypress.selectBox",function(a){F(b,a)}).bind("mousedown.selectBox",function(b){a(b.target).is("A.selectBox-inline")&&b.preventDefault();d.hasClass("selectBox-focus")||d.focus()}).insertAfter(b);if(!b[0].style.height){e=b.attr("size")?
parseInt(b.attr("size")):5;var x=d.clone().removeAttr("id").css({position:"absolute",top:"-9999em"}).show().appendTo("body");x.find(".selectBox-options").html("<li><a>\u00a0</a></li>");var k=parseInt(x.find(".selectBox-options A:first").html("&nbsp;").outerHeight());x.remove();d.height(k*e)}}else e=a('<span class="selectBox-label" />'),x=a('<span class="selectBox-arrow" />'),e.attr("class",r(b)).text(v(b)),g=h(b,"dropdown"),g.appendTo("BODY"),d.data("selectBox-options",g).addClass("selectBox-dropdown").append(e).append(x).bind("mousedown.selectBox",
function(a){d.hasClass("selectBox-menuShowing")?w():(a.stopPropagation(),g.data("selectBox-down-at-x",a.screenX).data("selectBox-down-at-y",a.screenY),q(b))}).bind("keydown.selectBox",function(a){f(b,a)}).bind("keypress.selectBox",function(a){F(b,a)}).bind("open.selectBox",function(a,c){c&&!0===c._selectBox||q(b)}).bind("close.selectBox",function(a,b){b&&!0===b._selectBox||w()}).insertAfter(b),x=d.width()-x.outerWidth()-parseInt(e.css("paddingLeft"))-parseInt(e.css("paddingLeft")),e.width(x);H(d);
b.addClass("selectBox").data("selectBox-control",d).data("selectBox-settings",c).hide()},h=function(b,c){var d=function(b,c){b.children("OPTION, OPTGROUP").each(function(){if(a(this).is("OPTION"))if(0<a(this).length){var b=a(this),e=c,f=a("<li />"),g=a("<a />");f.addClass(b.attr("class"));f.data(b.data());g.attr("rel",b.val()).text(b.text());f.append(g);b.attr("disabled")&&f.addClass("selectBox-disabled");b.attr("selected")&&f.addClass("selectBox-selected");e.append(f)}else c.append("<li>\u00a0</li>");
else b=a('<li class="selectBox-optgroup" />'),b.text(a(this).attr("label")),c.append(b),c=d(a(this),c)});return c};switch(c){case "inline":var e=a('<ul class="selectBox-options" />');e=d(b,e);e.find("A").bind("mouseover.selectBox",function(c){z(b,a(this).parent())}).bind("mouseout.selectBox",function(c){D(b,a(this).parent())}).bind("mousedown.selectBox",function(a){a.preventDefault();b.selectBox("control").hasClass("selectBox-active")||b.selectBox("control").focus()}).bind("mouseup.selectBox",function(c){w();
t(b,a(this).parent(),c)});H(e);return e;case "dropdown":e=a('<ul class="selectBox-dropdown-menu selectBox-options" />');e=d(b,e);e.data("selectBox-select",b).css("display","none").appendTo("BODY").find("A").bind("mousedown.selectBox",function(a){a.preventDefault();a.screenX===e.data("selectBox-down-at-x")&&a.screenY===e.data("selectBox-down-at-y")&&(e.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),w())}).bind("mouseup.selectBox",function(c){if(c.screenX!==e.data("selectBox-down-at-x")||
c.screenY!==e.data("selectBox-down-at-y"))e.removeData("selectBox-down-at-x").removeData("selectBox-down-at-y"),t(b,a(this).parent()),w()}).bind("mouseover.selectBox",function(c){z(b,a(this).parent())}).bind("mouseout.selectBox",function(c){D(b,a(this).parent())});c=b.attr("class")||"";if(""!==c){c=c.split(" ");for(var f in c)e.addClass(c[f]+"-selectBox-dropdown-menu")}H(e);return e}},r=function(b){return("selectBox-label "+(a(b).find("OPTION:selected").attr("class")||"")).replace(/\s+$/,"")},v=function(b){return a(b).find("OPTION:selected").text()||
"\u00a0"},y=function(b){b=a(b);var c=b.data("selectBox-control");c&&c.find(".selectBox-label").attr("class",r(b)).text(v(b))},q=function(b){b=a(b);var c=b.data("selectBox-control"),d=b.data("selectBox-settings"),e=c.data("selectBox-options");if(c.hasClass("selectBox-disabled"))return!1;w();var f=isNaN(c.css("borderBottomWidth"))?0:parseInt(c.css("borderBottomWidth"));e.width(c.innerWidth()).css({top:c.offset().top+c.outerHeight()-f,left:c.offset().left});if(b.triggerHandler("beforeopen"))return!1;
f=function(){b.triggerHandler("open",{_selectBox:!0})};switch(d.menuTransition){case "fade":e.fadeIn(d.menuSpeed,f);break;case "slide":e.slideDown(d.menuSpeed,f);break;default:e.show(d.menuSpeed,f)}d.menuSpeed||f();d=e.find(".selectBox-selected:first");u(b,d,!0);z(b,d);c.addClass("selectBox-menuShowing");a(document).bind("mousedown.selectBox",function(b){a(b.target).parents().andSelf().hasClass("selectBox-options")||w()})},w=function(){0!==a(".selectBox-dropdown-menu:visible").length&&(a(document).unbind("mousedown.selectBox"),
a(".selectBox-dropdown-menu").each(function(){var b=a(this),c=b.data("selectBox-select"),d=c.data("selectBox-control"),e=c.data("selectBox-settings");if(c.triggerHandler("beforeclose"))return!1;var f=function(){c.triggerHandler("close",{_selectBox:!0})};if(e){switch(e.menuTransition){case "fade":b.fadeOut(e.menuSpeed,f);break;case "slide":b.slideUp(e.menuSpeed,f);break;default:b.hide(e.menuSpeed,f)}e.menuSpeed||f();d.removeClass("selectBox-menuShowing")}else a(this).hide(),a(this).triggerHandler("close",
{_selectBox:!0}),a(this).removeClass("selectBox-menuShowing")}))},t=function(b,c,d){b=a(b);c=a(c);var e=b.data("selectBox-control");b.data("selectBox-settings");if(e.hasClass("selectBox-disabled")||0===c.length||c.hasClass("selectBox-disabled"))return!1;b.attr("multiple")?d.shiftKey&&e.data("selectBox-last-selected")?(c.toggleClass("selectBox-selected"),d=c.index()>e.data("selectBox-last-selected").index()?c.siblings().slice(e.data("selectBox-last-selected").index(),c.index()):c.siblings().slice(c.index(),
e.data("selectBox-last-selected").index()),d=d.not(".selectBox-optgroup, .selectBox-disabled"),c.hasClass("selectBox-selected")?d.addClass("selectBox-selected"):d.removeClass("selectBox-selected")):g&&d.metaKey||!g&&d.ctrlKey?c.toggleClass("selectBox-selected"):(c.siblings().removeClass("selectBox-selected"),c.addClass("selectBox-selected")):(c.siblings().removeClass("selectBox-selected"),c.addClass("selectBox-selected"));e.hasClass("selectBox-dropdown")&&e.find(".selectBox-label").text(c.text());
var f=0,k=[];b.attr("multiple")?e.find(".selectBox-selected A").each(function(){k[f++]=a(this).attr("rel")}):k=c.find("A").attr("rel");e.data("selectBox-last-selected",c);b.val()!==k&&(b.val(k),y(b),b.trigger("change"));return!0},z=function(b,c){b=a(b);c=a(c);b.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover");c.addClass("selectBox-hover")},D=function(b,c){b=a(b);a(c);b.data("selectBox-control").data("selectBox-options").find(".selectBox-hover").removeClass("selectBox-hover")},
u=function(b,c,d){if(c&&0!==c.length){b=a(b);b=b.data("selectBox-control");var e=b.data("selectBox-options");b=b.hasClass("selectBox-dropdown")?e:e.parent();e=parseInt(c.offset().top-b.position().top);var f=parseInt(e+c.outerHeight());d?b.scrollTop(c.offset().top-b.offset().top+b.scrollTop()-b.height()/2):(0>e&&b.scrollTop(c.offset().top-b.offset().top+b.scrollTop()),f>b.height()&&b.scrollTop(c.offset().top+c.outerHeight()-b.offset().top+b.scrollTop()-b.height()))}},f=function(b,c){b=a(b);var d=b.data("selectBox-control"),
f=d.data("selectBox-options"),g=b.data("selectBox-settings"),k;if(!d.hasClass("selectBox-disabled"))switch(c.keyCode){case 8:c.preventDefault();e="";break;case 9:case 27:w();D(b);break;case 13:d.hasClass("selectBox-menuShowing")?(t(b,f.find("LI.selectBox-hover:first"),c),d.hasClass("selectBox-dropdown")&&w()):q(b);break;case 38:case 37:c.preventDefault();if(d.hasClass("selectBox-menuShowing")){var h=f.find(".selectBox-hover").prev("LI");d=f.find("LI:not(.selectBox-optgroup)").length;for(k=0;(0===
h.length||h.hasClass("selectBox-disabled")||h.hasClass("selectBox-optgroup"))&&!(h=h.prev("LI"),0===h.length&&(h=g.loopOptions?f.find("LI:last"):f.find("LI:first")),++k>=d););z(b,h);t(b,h,c);u(b,h)}else q(b);break;case 40:case 39:if(c.preventDefault(),d.hasClass("selectBox-menuShowing")){h=f.find(".selectBox-hover").next("LI");d=f.find("LI:not(.selectBox-optgroup)").length;for(k=0;(0===h.length||h.hasClass("selectBox-disabled")||h.hasClass("selectBox-optgroup"))&&!(h=h.next("LI"),0===h.length&&(h=
g.loopOptions?f.find("LI:first"):f.find("LI:last")),++k>=d););z(b,h);t(b,h,c);u(b,h)}else q(b)}},F=function(b,c){b=a(b);var f=b.data("selectBox-control"),g=f.data("selectBox-options");if(!f.hasClass("selectBox-disabled"))switch(c.keyCode){case 9:case 27:case 13:case 38:case 37:case 40:case 39:break;default:f.hasClass("selectBox-menuShowing")||q(b),c.preventDefault(),clearTimeout(d),e+=String.fromCharCode(c.charCode||c.keyCode),g.find("A").each(function(){if(a(this).text().substr(0,e.length).toLowerCase()===
e.toLowerCase())return z(b,a(this).parent()),u(b,a(this).parent()),!1}),d=setTimeout(function(){e=""},1E3)}},B=function(b,c){b=a(b);b.val(c);c=b.val();null===c&&(c=b.children().first().val(),b.val(c));var d=b.data("selectBox-control");if(d){var e=b.data("selectBox-settings");d=d.data("selectBox-options");y(b);d.find(".selectBox-selected").removeClass("selectBox-selected");d.find("A").each(function(){if("object"===typeof c)for(var b=0;b<c.length;b++)a(this).attr("rel")==c[b]&&a(this).parent().addClass("selectBox-selected");
else a(this).attr("rel")==c&&a(this).parent().addClass("selectBox-selected")});e.change&&e.change.call(b)}},H=function(b){a(b).css("MozUserSelect","none").bind("selectstart",function(a){a.preventDefault()})};switch(b){case "control":return a(this).data("selectBox-control");case "settings":if(!c)return a(this).data("selectBox-settings");a(this).each(function(){a(this).data("selectBox-settings",a.extend(!0,a(this).data("selectBox-settings"),c))});break;case "options":if(void 0===c)return a(this).data("selectBox-control").data("selectBox-options");
a(this).each(function(){var b=a(this);var d=b.data("selectBox-control");b.data("selectBox-settings");switch(typeof c){case "string":b.html(c);break;case "object":for(g in b.html(""),c)if(null!==c[g])if("object"===typeof c[g]){var e=a('<optgroup label="'+g+'" />');for(f in c[g])e.append('<option value="'+f+'">'+c[g][f]+"</option>");b.append(e)}else e=a('<option value="'+g+'">'+c[g]+"</option>"),b.append(e)}if(d){d.data("selectBox-options").remove();var f=d.hasClass("selectBox-dropdown")?"dropdown":
"inline";var g=h(b,f);d.data("selectBox-options",g);switch(f){case "inline":d.append(g);break;case "dropdown":y(b),a("BODY").append(g)}}});break;case "value":if(void 0===c)return a(this).val();a(this).each(function(){B(this,c)});break;case "refresh":a(this).each(function(){var b=a(this);b.selectBox("options",b.html())});break;case "enable":a(this).each(function(){var b=a(this);b.attr("disabled",!1);(b=b.data("selectBox-control"))&&b.removeClass("selectBox-disabled")});break;case "disable":a(this).each(function(){var b=
a(this);b.attr("disabled",!0);(b=b.data("selectBox-control"))&&b.addClass("selectBox-disabled")});break;case "destroy":a(this).each(function(){var b=a(this);var c=b.data("selectBox-control");c&&(c.data("selectBox-options").remove(),c.remove(),b.removeClass("selectBox").removeData("selectBox-control").data("selectBox-control",null).removeData("selectBox-settings").data("selectBox-settings",null).show())});break;default:a(this).each(function(){k(this,b)})}return a(this)}})}(jQuery);(function(){function a(b){return function(a,c,d,e){c=F(c,e,4);var l=!E(a)&&f.keys(a),n=(l||a).length,g=0<b?0:n-1;3>arguments.length&&(d=a[l?l[g]:g],g+=b);for(var A=c,K=d;0<=g&&g<n;g+=b){var N=l?l[g]:g;K=A(K,a[N],N,a)}return K}}function b(b){return function(a,c,d){c=B(c,d);d=G(a);for(var e=0<b?0:d-1;0<=e&&e<d;e+=b)if(c(a[e],e,a))return e;return-1}}function c(b,a,c){return function(d,e,l){var n=0,g=G(d);if("number"==typeof l)0<b?n=0<=l?l:Math.max(l+g,n):g=0<=l?Math.min(l+1,g):l+g+1;else if(c&&l&&g)return l=
c(d,e),d[l]===e?l:-1;if(e!==e)return l=a(v.call(d,n,g),f.isNaN),0<=l?l+n:-1;for(l=0<b?n:g-1;0<=l&&l<g;l+=b)if(d[l]===e)return l;return-1}}function d(b,a){var c=U.length,d=b.constructor;d=f.isFunction(d)&&d.prototype||h;var e="constructor";for(f.has(b,e)&&!f.contains(a,e)&&a.push(e);c--;)e=U[c],e in b&&b[e]!==d[e]&&!f.contains(a,e)&&a.push(e)}var e=this,g=e._,k=Array.prototype,h=Object.prototype,r=k.push,v=k.slice,y=h.toString,q=h.hasOwnProperty,w=Array.isArray,t=Object.keys,z=Function.prototype.bind,
D=Object.create,u=function(){},f=function(b){if(b instanceof f)return b;if(!(this instanceof f))return new f(b);this._wrapped=b};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=f),exports._=f):e._=f;f.VERSION="1.8.3";var F=function(b,a,c){if(void 0===a)return b;switch(null==c?3:c){case 1:return function(c){return b.call(a,c)};case 2:return function(c,d){return b.call(a,c,d)};case 3:return function(c,d,e){return b.call(a,c,d,e)};case 4:return function(c,
d,e,l){return b.call(a,c,d,e,l)}}return function(){return b.apply(a,arguments)}},B=function(b,a,c){return null==b?f.identity:f.isFunction(b)?F(b,a,c):f.isObject(b)?f.matcher(b):f.property(b)};f.iteratee=function(b,a){return B(b,a,Infinity)};var H=function(b,a){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;e<d;e++)for(var l=arguments[e],f=b(l),g=f.length,n=0;n<g;n++){var A=f[n];a&&void 0!==c[A]||(c[A]=l[A])}return c}},x=function(b){if(!f.isObject(b))return{};if(D)return D(b);
u.prototype=b;b=new u;u.prototype=null;return b},C=function(b){return function(a){return null==a?void 0:a[b]}},I=Math.pow(2,53)-1,G=C("length"),E=function(b){b=G(b);return"number"==typeof b&&0<=b&&b<=I};f.each=f.forEach=function(b,a,c){a=F(a,c);var d;if(E(b))for(c=0,d=b.length;c<d;c++)a(b[c],c,b);else{var e=f.keys(b);c=0;for(d=e.length;c<d;c++)a(b[e[c]],e[c],b)}return b};f.map=f.collect=function(b,a,c){a=B(a,c);c=!E(b)&&f.keys(b);for(var d=(c||b).length,e=Array(d),l=0;l<d;l++){var g=c?c[l]:l;e[l]=
a(b[g],g,b)}return e};f.reduce=f.foldl=f.inject=a(1);f.reduceRight=f.foldr=a(-1);f.find=f.detect=function(b,a,c){a=E(b)?f.findIndex(b,a,c):f.findKey(b,a,c);if(void 0!==a&&-1!==a)return b[a]};f.filter=f.select=function(b,a,c){var d=[];a=B(a,c);f.each(b,function(b,c,e){a(b,c,e)&&d.push(b)});return d};f.reject=function(b,a,c){return f.filter(b,f.negate(B(a)),c)};f.every=f.all=function(b,a,c){a=B(a,c);c=!E(b)&&f.keys(b);for(var d=(c||b).length,e=0;e<d;e++){var l=c?c[e]:e;if(!a(b[l],l,b))return!1}return!0};
f.some=f.any=function(b,a,c){a=B(a,c);c=!E(b)&&f.keys(b);for(var d=(c||b).length,e=0;e<d;e++){var l=c?c[e]:e;if(a(b[l],l,b))return!0}return!1};f.contains=f.includes=f.include=function(b,a,c,d){E(b)||(b=f.values(b));if("number"!=typeof c||d)c=0;return 0<=f.indexOf(b,a,c)};f.invoke=function(b,a){var c=v.call(arguments,2),d=f.isFunction(a);return f.map(b,function(b){var e=d?a:b[a];return null==e?e:e.apply(b,c)})};f.pluck=function(b,a){return f.map(b,f.property(a))};f.where=function(b,a){return f.filter(b,
f.matcher(a))};f.findWhere=function(b,a){return f.find(b,f.matcher(a))};f.max=function(b,a,c){var d=-Infinity,e=-Infinity,l;if(null==a&&null!=b){b=E(b)?b:f.values(b);for(var g=0,n=b.length;g<n;g++)c=b[g],c>d&&(d=c)}else a=B(a,c),f.each(b,function(b,c,f){l=a(b,c,f);if(l>e||-Infinity===l&&-Infinity===d)d=b,e=l});return d};f.min=function(b,a,c){var d=Infinity,e=Infinity,l;if(null==a&&null!=b){b=E(b)?b:f.values(b);for(var g=0,n=b.length;g<n;g++)c=b[g],c<d&&(d=c)}else a=B(a,c),f.each(b,function(b,c,f){l=
a(b,c,f);if(l<e||Infinity===l&&Infinity===d)d=b,e=l});return d};f.shuffle=function(b){b=E(b)?b:f.values(b);for(var a=b.length,c=Array(a),d=0,e;d<a;d++)e=f.random(0,d),e!==d&&(c[d]=c[e]),c[e]=b[d];return c};f.sample=function(b,a,c){return null==a||c?(E(b)||(b=f.values(b)),b[f.random(b.length-1)]):f.shuffle(b).slice(0,Math.max(0,a))};f.sortBy=function(b,a,c){a=B(a,c);return f.pluck(f.map(b,function(b,c,d){return{value:b,index:c,criteria:a(b,c,d)}}).sort(function(b,a){var c=b.criteria,d=a.criteria;if(c!==
d){if(c>d||void 0===c)return 1;if(c<d||void 0===d)return-1}return b.index-a.index}),"value")};var Q=function(b){return function(a,c,d){var e={};c=B(c,d);f.each(a,function(d,f){f=c(d,f,a);b(e,d,f)});return e}};f.groupBy=Q(function(b,a,c){f.has(b,c)?b[c].push(a):b[c]=[a]});f.indexBy=Q(function(b,a,c){b[c]=a});f.countBy=Q(function(b,a,c){f.has(b,c)?b[c]++:b[c]=1});f.toArray=function(b){return b?f.isArray(b)?v.call(b):E(b)?f.map(b,f.identity):f.values(b):[]};f.size=function(b){return null==b?0:E(b)?b.length:
f.keys(b).length};f.partition=function(b,a,c){a=B(a,c);var d=[],e=[];f.each(b,function(b,c,f){(a(b,c,f)?d:e).push(b)});return[d,e]};f.first=f.head=f.take=function(b,a,c){if(null!=b)return null==a||c?b[0]:f.initial(b,b.length-a)};f.initial=function(b,a,c){return v.call(b,0,Math.max(0,b.length-(null==a||c?1:a)))};f.last=function(b,a,c){if(null!=b)return null==a||c?b[b.length-1]:f.rest(b,Math.max(0,b.length-a))};f.rest=f.tail=f.drop=function(b,a,c){return v.call(b,null==a||c?1:a)};f.compact=function(b){return f.filter(b,
f.identity)};var J=function(b,a,c,d){var e=[],g=0;d=d||0;for(var l=G(b);d<l;d++){var n=b[d];if(E(n)&&(f.isArray(n)||f.isArguments(n))){a||(n=J(n,a,c));var h=0,k=n.length;for(e.length+=k;h<k;)e[g++]=n[h++]}else c||(e[g++]=n)}return e};f.flatten=function(b,a){return J(b,a,!1)};f.without=function(b){return f.difference(b,v.call(arguments,1))};f.uniq=f.unique=function(b,a,c,d){f.isBoolean(a)||(d=c,c=a,a=!1);null!=c&&(c=B(c,d));d=[];for(var e=[],g=0,l=G(b);g<l;g++){var n=b[g],h=c?c(n,g,b):n;a?(g&&e===
h||d.push(n),e=h):c?f.contains(e,h)||(e.push(h),d.push(n)):f.contains(d,n)||d.push(n)}return d};f.union=function(){return f.uniq(J(arguments,!0,!0))};f.intersection=function(b){for(var a=[],c=arguments.length,d=0,e=G(b);d<e;d++){var g=b[d];if(!f.contains(a,g)){for(var l=1;l<c&&f.contains(arguments[l],g);l++);l===c&&a.push(g)}}return a};f.difference=function(b){var a=J(arguments,!0,!0,1);return f.filter(b,function(b){return!f.contains(a,b)})};f.zip=function(){return f.unzip(arguments)};f.unzip=function(b){for(var a=
b&&f.max(b,G).length||0,c=Array(a),d=0;d<a;d++)c[d]=f.pluck(b,d);return c};f.object=function(b,a){for(var c={},d=0,e=G(b);d<e;d++)a?c[b[d]]=a[d]:c[b[d][0]]=b[d][1];return c};f.findIndex=b(1);f.findLastIndex=b(-1);f.sortedIndex=function(b,a,c,d){c=B(c,d,1);a=c(a);d=0;for(var e=G(b);d<e;){var f=Math.floor((d+e)/2);c(b[f])<a?d=f+1:e=f}return d};f.indexOf=c(1,f.findIndex,f.sortedIndex);f.lastIndexOf=c(-1,f.findLastIndex);f.range=function(b,a,c){null==a&&(a=b||0,b=0);c=c||1;a=Math.max(Math.ceil((a-b)/
c),0);for(var d=Array(a),e=0;e<a;e++,b+=c)d[e]=b;return d};var S=function(b,a,c,d,e){if(!(d instanceof a))return b.apply(c,e);a=x(b.prototype);b=b.apply(a,e);return f.isObject(b)?b:a};f.bind=function(b,a){if(z&&b.bind===z)return z.apply(b,v.call(arguments,1));if(!f.isFunction(b))throw new TypeError("Bind must be called on a function");var c=v.call(arguments,2),d=function(){return S(b,d,a,this,c.concat(v.call(arguments)))};return d};f.partial=function(b){var a=v.call(arguments,1),c=function(){for(var d=
0,e=a.length,g=Array(e),l=0;l<e;l++)g[l]=a[l]===f?arguments[d++]:a[l];for(;d<arguments.length;)g.push(arguments[d++]);return S(b,c,this,this,g)};return c};f.bindAll=function(b){var a,c=arguments.length;if(1>=c)throw Error("bindAll must be passed function names");for(a=1;a<c;a++){var d=arguments[a];b[d]=f.bind(b[d],b)}return b};f.memoize=function(b,a){var c=function(d){var e=c.cache,g=""+(a?a.apply(this,arguments):d);f.has(e,g)||(e[g]=b.apply(this,arguments));return e[g]};c.cache={};return c};f.delay=
function(b,a){var c=v.call(arguments,2);return setTimeout(function(){return b.apply(null,c)},a)};f.defer=f.partial(f.delay,f,1);f.throttle=function(b,a,c){var d,e,g,l=null,n=0;c||(c={});var h=function(){n=!1===c.leading?0:f.now();l=null;g=b.apply(d,e);l||(d=e=null)};return function(){var k=f.now();n||!1!==c.leading||(n=k);var A=a-(k-n);d=this;e=arguments;0>=A||A>a?(l&&(clearTimeout(l),l=null),n=k,g=b.apply(d,e),l||(d=e=null)):l||!1===c.trailing||(l=setTimeout(h,A));return g}};f.debounce=function(b,
a,c){var d,e,g,l,n,h=function(){var k=f.now()-l;k<a&&0<=k?d=setTimeout(h,a-k):(d=null,c||(n=b.apply(g,e),d||(g=e=null)))};return function(){g=this;e=arguments;l=f.now();var k=c&&!d;d||(d=setTimeout(h,a));k&&(n=b.apply(g,e),g=e=null);return n}};f.wrap=function(b,a){return f.partial(a,b)};f.negate=function(b){return function(){return!b.apply(this,arguments)}};f.compose=function(){var b=arguments,a=b.length-1;return function(){for(var c=a,d=b[a].apply(this,arguments);c--;)d=b[c].call(this,d);return d}};
f.after=function(b,a){return function(){if(1>--b)return a.apply(this,arguments)}};f.before=function(b,a){var c;return function(){0<--b&&(c=a.apply(this,arguments));1>=b&&(a=null);return c}};f.once=f.partial(f.before,2);var T=!{toString:null}.propertyIsEnumerable("toString"),U="valueOf isPrototypeOf toString propertyIsEnumerable hasOwnProperty toLocaleString".split(" ");f.keys=function(b){if(!f.isObject(b))return[];if(t)return t(b);var a=[],c;for(c in b)f.has(b,c)&&a.push(c);T&&d(b,a);return a};f.allKeys=
function(b){if(!f.isObject(b))return[];var a=[],c;for(c in b)a.push(c);T&&d(b,a);return a};f.values=function(b){for(var a=f.keys(b),c=a.length,d=Array(c),e=0;e<c;e++)d[e]=b[a[e]];return d};f.mapObject=function(b,a,c){a=B(a,c);c=f.keys(b);for(var d=c.length,e={},g,l=0;l<d;l++)g=c[l],e[g]=a(b[g],g,b);return e};f.pairs=function(b){for(var a=f.keys(b),c=a.length,d=Array(c),e=0;e<c;e++)d[e]=[a[e],b[a[e]]];return d};f.invert=function(b){for(var a={},c=f.keys(b),d=0,e=c.length;d<e;d++)a[b[c[d]]]=c[d];return a};
f.functions=f.methods=function(b){var a=[],c;for(c in b)f.isFunction(b[c])&&a.push(c);return a.sort()};f.extend=H(f.allKeys);f.extendOwn=f.assign=H(f.keys);f.findKey=function(b,a,c){a=B(a,c);c=f.keys(b);for(var d,e=0,g=c.length;e<g;e++)if(d=c[e],a(b[d],d,b))return d};f.pick=function(b,a,c){var d={},e=b;if(null==e)return d;if(f.isFunction(a)){var g=f.allKeys(e);var l=F(a,c)}else g=J(arguments,!1,!1,1),l=function(b,a,c){return a in c},e=Object(e);for(var h=0,k=g.length;h<k;h++){var n=g[h],m=e[n];l(m,
n,e)&&(d[n]=m)}return d};f.omit=function(b,a,c){if(f.isFunction(a))a=f.negate(a);else{var d=f.map(J(arguments,!1,!1,1),String);a=function(b,a){return!f.contains(d,a)}}return f.pick(b,a,c)};f.defaults=H(f.allKeys,!0);f.create=function(b,a){b=x(b);a&&f.extendOwn(b,a);return b};f.clone=function(b){return f.isObject(b)?f.isArray(b)?b.slice():f.extend({},b):b};f.tap=function(b,a){a(b);return b};f.isMatch=function(b,a){var c=f.keys(a),d=c.length;if(null==b)return!d;b=Object(b);for(var e=0;e<d;e++){var g=
c[e];if(a[g]!==b[g]||!(g in b))return!1}return!0};var R=function(b,a,c,d){if(b===a)return 0!==b||1/b===1/a;if(null==b||null==a)return b===a;b instanceof f&&(b=b._wrapped);a instanceof f&&(a=a._wrapped);var e=y.call(b);if(e!==y.call(a))return!1;switch(e){case "[object RegExp]":case "[object String]":return""+b===""+a;case "[object Number]":return+b!==+b?+a!==+a:0===+b?1/+b===1/a:+b===+a;case "[object Date]":case "[object Boolean]":return+b===+a}e="[object Array]"===e;if(!e){if("object"!=typeof b||
"object"!=typeof a)return!1;var g=b.constructor,l=a.constructor;if(g!==l&&!(f.isFunction(g)&&g instanceof g&&f.isFunction(l)&&l instanceof l)&&"constructor"in b&&"constructor"in a)return!1}c=c||[];d=d||[];for(g=c.length;g--;)if(c[g]===b)return d[g]===a;c.push(b);d.push(a);if(e){g=b.length;if(g!==a.length)return!1;for(;g--;)if(!R(b[g],a[g],c,d))return!1}else{e=f.keys(b);g=e.length;if(f.keys(a).length!==g)return!1;for(;g--;)if(l=e[g],!f.has(a,l)||!R(b[l],a[l],c,d))return!1}c.pop();d.pop();return!0};
f.isEqual=function(b,a){return R(b,a)};f.isEmpty=function(b){return null==b?!0:E(b)&&(f.isArray(b)||f.isString(b)||f.isArguments(b))?0===b.length:0===f.keys(b).length};f.isElement=function(b){return!(!b||1!==b.nodeType)};f.isArray=w||function(b){return"[object Array]"===y.call(b)};f.isObject=function(b){var a=typeof b;return"function"===a||"object"===a&&!!b};f.each("Arguments Function String Number Date RegExp Error".split(" "),function(b){f["is"+b]=function(a){return y.call(a)==="[object "+b+"]"}});
f.isArguments(arguments)||(f.isArguments=function(b){return f.has(b,"callee")});"function"!=typeof/./&&"object"!=typeof Int8Array&&(f.isFunction=function(b){return"function"==typeof b||!1});f.isFinite=function(b){return isFinite(b)&&!isNaN(parseFloat(b))};f.isNaN=function(b){return f.isNumber(b)&&b!==+b};f.isBoolean=function(b){return!0===b||!1===b||"[object Boolean]"===y.call(b)};f.isNull=function(b){return null===b};f.isUndefined=function(b){return void 0===b};f.has=function(b,a){return null!=b&&
q.call(b,a)};f.noConflict=function(){e._=g;return this};f.identity=function(b){return b};f.constant=function(b){return function(){return b}};f.noop=function(){};f.property=C;f.propertyOf=function(b){return null==b?function(){}:function(a){return b[a]}};f.matcher=f.matches=function(b){b=f.extendOwn({},b);return function(a){return f.isMatch(a,b)}};f.times=function(b,a,c){var d=Array(Math.max(0,b));a=F(a,c,1);for(c=0;c<b;c++)d[c]=a(c);return d};f.random=function(b,a){null==a&&(a=b,b=0);return b+Math.floor(Math.random()*
(a-b+1))};f.now=Date.now||function(){return(new Date).getTime()};w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};H=f.invert(w);C=function(b){var a=function(a){return b[a]},c="(?:"+f.keys(b).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(b){b=null==b?"":""+b;return d.test(b)?b.replace(e,a):b}};f.escape=C(w);f.unescape=C(H);f.result=function(b,a,c){a=null==b?void 0:b[a];void 0===a&&(a=c);return f.isFunction(a)?a.call(b):a};var Z=0;f.uniqueId=function(b){var a=
++Z+"";return b?b+a:a};f.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var m=/(.)^/,X={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Y=/\\|'|\r|\n|\u2028|\u2029/g,W=function(b){return"\\"+X[b]};f.template=function(b,a,c){!a&&c&&(a=c);a=f.defaults({},a,f.templateSettings);c=RegExp([(a.escape||m).source,(a.interpolate||m).source,(a.evaluate||m).source].join("|")+"|$","g");var d=0,e="__p+='";b.replace(c,function(a,c,g,
f,h){e+=b.slice(d,h).replace(Y,W);d=h+a.length;c?e+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":g?e+="'+\n((__t=("+g+"))==null?'':__t)+\n'":f&&(e+="';\n"+f+"\n__p+='");return a});e+="';\n";a.variable||(e="with(obj||{}){\n"+e+"}\n");e="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+e+"return __p;\n";try{var g=new Function(a.variable||"obj","_",e)}catch(O){throw O.source=e,O;}c=function(b){return g.call(this,b,f)};c.source="function("+(a.variable||"obj")+
"){\n"+e+"}";return c};f.chain=function(b){b=f(b);b._chain=!0;return b};var p=function(b,a){return b._chain?f(a).chain():a};f.mixin=function(b){f.each(f.functions(b),function(a){var c=f[a]=b[a];f.prototype[a]=function(){var b=[this._wrapped];r.apply(b,arguments);return p(this,c.apply(f,b))}})};f.mixin(f);f.each("pop push reverse shift sort splice unshift".split(" "),function(b){var a=k[b];f.prototype[b]=function(){var c=this._wrapped;a.apply(c,arguments);"shift"!==b&&"splice"!==b||0!==c.length||delete c[0];
return p(this,c)}});f.each(["concat","join","slice"],function(b){var a=k[b];f.prototype[b]=function(){return p(this,a.apply(this._wrapped,arguments))}});f.prototype.value=function(){return this._wrapped};f.prototype.valueOf=f.prototype.toJSON=f.prototype.value;f.prototype.toString=function(){return""+this._wrapped};"function"===typeof define&&define.amd&&define("underscore",[],function(){return f})}).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 g=d&15;d>>=4;c[e]=b[19==e?g&3|8:g]}return c.join("")};a.pkp.classes.Helper.inherits=function(b,a){var c=function(){};c.prototype=a.prototype;b.parent_=a.prototype;b.prototype=new c;b.prototype.constructor=b;a.prototype.constructor==Object.prototype.constructor&&(a.prototype.constructor=
a)};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(b,a){this.objectName_=b;
this.parent.apply(this,a)};b.objectName_="";b.prototype.parent=function(b,a){};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,a,d){if(2<arguments.length){var c;var g=Array.prototype.slice.call(arguments,2);return function(){c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,g);return b.apply(a,c)}}return function(){return b.apply(a,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 g=Array.prototype.slice.call(arguments);return e.parent_.constructor.apply(this,g)}g=Array.prototype.slice.call(arguments,1);if(this.hasOwnProperty(b)&&this[b]===e)return this.constructor.parent_[b].apply(this,g);var k=!1;for(d=this.constructor;d;d=d.parent_&&d.parent_.constructor)if(d.prototype.hasOwnProperty(b)&&d.prototype[b]===e)k=!0;else if(k)return d.prototype[b].apply(this,g);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(b){a.pkp.classes.Handler.hasHandler(a(d[b]))&&
a.pkp.classes.Handler.getHandler(a(d[b])).handlerChildren_.push(e)});c.eventBridge&&(this.eventBridge_=c.eventBridge);if(c.publishChangeEvents)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 g=a.makeArray(arguments);var k=!0;g.unshift(this);var h=0;for(c=d.length;h<c&&(!1===d[h].apply(e,g)&&(k=!1),!b.isImmediatePropagationStopped());h++);b.stopPropagation();return k};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,a){return this.handleJson(a)};
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(b){var a=_.has(b,"data")?b.data:
null;!_.isNull(a)&&a.isGlobalEvent?(a.handler=this,pkp.eventBus.$emit(b.name,a)):this.trigger(b.name,a)},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,a){"undefined"===
typeof this.globalEventListeners_[b]&&(this.globalEventListeners_[b]=[]);a=this.callbackWrapper(a);this.globalEventListeners_[b].push(a);pkp.eventBus.$on(b,a)};a.pkp.classes.Handler.prototype.unbindGlobal=function(b,a){var c=this.callbackWrapper(a);"undefined"!==typeof this.globalEventListeners_[b]&&(this.globalEventListeners=_.reject(this.globalEventListeners,function(b){return b===c}));pkp.eventBus.$off(b,c)};a.pkp.classes.Handler.prototype.unbindGlobalAll=function(){"undefined"!==typeof this.globalEventListeners_&&
_.each(this.globalEventListeners_,function(b,a){_.each(b,function(b){pkp.eventBus.$off(a,b)})});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,a){void 0===a&&(a=null);this.getHtmlElement().triggerHandler(b,a);this.publishedEvents_[b]||this.triggerPublicEvent_(b,a)};a.pkp.classes.Handler.prototype.publishEvent=function(b){this.publishedEvents_[b]||(this.publishedEvents_[b]=!0,this.bind(b,function(a,d,e){var c=null;2<arguments.length&&(c=Array.prototype.slice.call(arguments,
2));this.triggerPublicEvent_(b,c)}))};a.pkp.classes.Handler.prototype.switchViz=function(b){a(b.currentTarget).parent().parent().find("span").toggle()};a.pkp.classes.Handler.prototype.initializeTinyMCE=function(){if("undefined"!==typeof tinyMCE){var b=this.getHtmlElement().attr("id"),c=tinyMCE.EditorManager.settings;c.defaultToolbar=c.toolbar;a("#"+b).find(".richContent").each(function(){var b=a(this).attr("id"),c=a("<div></div>"),g=a("<div></div>"),k=tinyMCE.EditorManager.settings;a(this).hasClass("extendedRichContent")?
k.toolbar=k.richToolbar:k.toolbar=k.defaultToolbar;tinyMCE.EditorManager.createEditor(b,k).render();if(a(this).hasClass("localizable")||a(this).hasClass("flag"))if(c.addClass("mceLocalizationIcon localizable"),c.attr("id","mceLocalizationIcon-"+b),a(this).wrap(g),a(this).parent().append(c),a(this).hasClass("localizable"))c.addClass("mceGlobe");else if(a(this).hasClass("flag")&&(b=a(this).attr("class").split(" "),b.length))for(g=0;g<b.length;g++)if(b[g].match(/^flag_[a-z]{2}_[A-Z]{2}$/)){c.addClass(b[g]);
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 b=a.pkp.classes.Handler.getHandler(a(this));b.callbackWrapper(b.unbindGlobalAll())}})};a.pkp.classes.Handler.checkContext_=function(b){if(!(b instanceof a.pkp.classes.Handler))throw Error("Trying to call handler method in non-handler context!");}})(jQuery);(function(a){a.pkp.classes.TinyMCEHelper=function(){throw Error("Trying to instantiate the TinyMCEHelper singleton!");};a.pkp.classes.TinyMCEHelper.prototype.getVariableMap=function(b){b=a(b).attr("data-variables");return void 0!==b?a.parseJSON(decodeURIComponent(b)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap=function(b){b=a(b).attr("data-variablesType");return void 0!==b?a.parseJSON(decodeURIComponent(b)):[]};a.pkp.classes.TinyMCEHelper.prototype.getVariableElement=function(b,
c,d){d=a.pkp.classes.TinyMCEHelper.prototype.getVariableTypesMap(d);return void 0!=d[b]&&(d=d[b],d==a.pkp.cons.INSERT_TAG_VARIABLE_TYPE_PLAIN_TEXT)?a("<div/>").append(a("<span/>").text(c)):a("<div/>").append(a("<span/>").addClass("pkpTag mceNonEditable").attr("data-symbolic",b).text(c))}})(jQuery);(function(a){a.pkp.classes.linkAction=a.pkp.classes.linkAction||{};a.pkp.classes.linkAction.LinkActionRequest=function(b,a){this.$linkActionElement=b;this.options=a;b.is("a")&&a.url&&b.attr("href",a.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,a){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,a){this.parent(b,a)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.RedirectRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.RedirectRequest.prototype.activate=function(b,a){var c=this.getOptions();window.open(c.url,c.name,c.specs);return this.parent("activate",b,a)}})(jQuery);(function(a){a.pkp.classes.linkAction.OpenWindowRequest=function(b,a){this.parent(b,a)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.OpenWindowRequest,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.OpenWindowRequest.prototype.activate=function(b,a){var c=this.getOptions();window.open(c.url);return this.parent("activate",b,a)}})(jQuery);(function(a){a.pkp.classes.linkAction.PostAndRedirectRequest=function(b,a){this.parent(b,a)};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,a){this.parent(b,a)};a.pkp.classes.Helper.inherits(a.pkp.classes.linkAction.NullAction,a.pkp.classes.linkAction.LinkActionRequest);a.pkp.classes.linkAction.NullAction.prototype.activate=function(b,a){return this.parent("activate",b,a)};a.pkp.classes.linkAction.NullAction.prototype.shouldDebounce=function(){return!1}})(jQuery);(function(a){a.pkp.classes.linkAction.EventAction=function(b,a){this.parent(b,a)};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,a){this.parent(b,a)};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,a){this.parent(b,a)};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(),g=e.text();void 0===d.title&&(""===g&&(g=e.attr("title")),d.title=g);e=a.pkp.classes.Helper.uuid();if(!d.modalHandler)throw Error('The "modalHandler" setting is required in a ModalRequest');
g=this.getLinkActionElement();g=a.pkp.classes.Handler.getHandler(g);g=a.extend(!0,{eventBridge:g.getStaticId()},d);this.$modal_=a('<div id="'+e+'" class="pkp_modal pkpModalWrapper" tabindex="-1"></div>').pkpHandler(d.modalHandler,g);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 g=b.getHtmlElement();var k=!1;!(b instanceof a.pkp.controllers.SiteHandler)&&0<a(c).parents(".pkp_controllers_grid").length&&(g.parent().trigger("notifyUser"),k=!0);g=a(".pkp_notification",g);var h=
[];var r=0;for(d=g.length;r<d;r++){var v=a(g[r]);if(!(0<v.parents(":hidden").length)){var y=v.parents();var q=0;for(e=y.length;q<e;q++){var w=a(y[q]).data("pkp.handler");if(w instanceof a.pkp.classes.Handler){var t=a(y[q]);break}}if(t.has(c[0]).length||t[0]===c[0]){if(0<v.parents(".ui-accordion:first").length&&(y=v.parents(".ui-accordion:first"),!y.has(c[0])))continue;h.push(v)}}}if(h.length)for(r=h.length-1;-1<r;r--)h[r].triggerHandler("notifyUser");else k||b.getHtmlElement().parent().trigger("notifyUser")}}})(jQuery);(function(a){a.pkp.classes.features=a.pkp.classes.features||{};a.pkp.classes.features.Feature=function(b,a){this.gridHandler=b;this.options_=a;this.addFeatureHtml(this.getGridHtmlElement(),a)};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,
a){return this.gridHandler.callbackWrapper(b,a)};a.pkp.classes.features.Feature.prototype.addFeatureHtml=function(b,a){};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,a,d){};a.pkp.classes.features.OrderItemsFeature.prototype.dragStopCallback=function(b,a,d){};a.pkp.classes.features.OrderItemsFeature.prototype.updateOrderCallback=function(b,a,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(b,c){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,a){};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 g=e.attr("id");this.itemsOrder.push(g);this.storeRowOrder(d,e)}};a.pkp.classes.features.OrderItemsFeature.prototype.toggleItemsDragMode=function(){var b=this.isOrdering,a=this.gridHandler.getRows().filter(".orderable"),d=this.getMoveItemClasses();b?a.addClass(d):a.removeClass(d);this.toggleMoveItemRowAction(b)};a.pkp.classes.features.OrderItemsFeature.prototype.applySortPlgOnElements=function(b,c,d){var e=this.isOrdering,
g=this.gridHandler.callbackWrapper(this.dragStartCallback,this),k=this.gridHandler.callbackWrapper(this.dragStopCallback,this),h=this.gridHandler.callbackWrapper(this.updateOrderCallback,this);c={disabled:!e,items:c,activate:g,deactivate:k,update:h,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()+")",g=d.find(e);d=a(this.getMoveItemRowActionSelector(),c);b?(g.addClass("pkp_helpers_display_none"),d.show(),this.gridHandler.showRowActionsDiv()):(g.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(),a=this.getCancelOrderButton(),d=this.gridHandler.callbackWrapper(this.cancelOrderHandler,this),e=this.gridHandler.callbackWrapper(this.saveOrderHandler,this);b.click(e);a.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,a){this.parent(b,a)};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,a){this.gridHandler.handleJson(a);this.toggleState(!1)}})(jQuery);(function(a){a.pkp.classes.features.OrderCategoryGridItemsFeature=function(b,a){this.parent(b,a)};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 g=
a("#"+b[e]);var k=this.getRowsDataId(g);g=this.gridHandler.getCategoryDataId(g);c.push({categoryId:g,rowsId:k})}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 g=
this.gridHandler.getCategoryDataIdByRowId(b[e]);g=this.gridHandler.getCategoryIdPrefix()+g;-1<a.inArray(g,d)||d.push(g)}return d}})(jQuery);(function(a){a.pkp.classes.features.GeneralPagingFeature=function(b,a){a.defaultItemsPerPage=parseInt(a.defaultItemsPerPage,10);a.currentItemsPerPage=parseInt(a.currentItemsPerPage,10);a.itemsTotal=a.itemsTotal?parseInt(a.itemsTotal,10):0;a.currentPage=parseInt(a.currentPage,10);this.parent(b,a)};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,a){this.parent(b,a)};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,a){b.append(a.pagingMarkup)};a.pkp.classes.features.PagingFeature.prototype.resequenceRows=function(b){b=this.gridHandler.getRows();
var a;var d=this.getOptions();d=b.length-d.currentItemsPerPage;if(0<d)for(a=0;a<d;a++)this.gridHandler.deleteElement(b.first(),!0);return!1};a.pkp.classes.features.PagingFeature.prototype.refreshGrid=function(b){var a=this.getOptions();b=this.gridHandler.getFetchExtraParams();b[a.pageParamName]=a.currentPage;b[a.itemsPerPageParamName]=a.currentItemsPerPage;a=this.gridHandler.getRows().first();var d=this.gridHandler.getRows().last();b.topLimitRowId=0==a.length?0:this.gridHandler.getRowDataId(a);b.bottomLimitRowId=
0==d.length?0:this.gridHandler.getRowDataId(d);this.setGridParams(b);return!1};a.pkp.classes.features.PagingFeature.prototype.replaceElementResponseHandler=function(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 g=this.getOptions();if(b=a("div.gridPaging",this.getGridHtmlElement())){var k=this.callbackWrapper(function(b,c){d=new RegExp("[?&]"+g.pageParamName+"(?:=([^&]*))?","i");e=d.exec(a(c.target).attr("href"));null!=
e&&(g.currentPage=parseInt(e[1],10),this.getGridHtmlElement().trigger("dataChanged"));return!1},this);b=b.find("a").not(".showMoreItems").not(".showLessItems");var h=0;for(c=b.length;h<c;h++){var r=a(b[h]);r.click(k)}}};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(b,d){c.currentItemsPerPage=parseInt(a("option",d.target).filter(":selected").attr("value"),
10);c.currentPage=1;this.getGridHtmlElement().trigger("dataChanged");return!1},this);var e=b.find("select.itemsPerPage");var g=[10,25,50,75,100];0>a.inArray(c.defaultItemsPerPage,g)&&g.push(c.defaultItemsPerPage);g.sort(function(b,a){return b-a});if(c.itemsTotal<=g[0])a("div.gridItemsPerPage",b).hide();else{var k=g.length-1;for(b=0;b<=k;b++)e.append(a('<option value="'+g[b]+'">'+g[b]+"</option>"));e.val(c.currentItemsPerPage.toString());e.change(d)}}}})(jQuery);(function(a){a.pkp.classes.features.InfiniteScrollingFeature=function(b,a){this.parent(b,a)};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,a){b.append(a.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,g,k;0<b.length&&(g=setInterval(function(){if(b.is(":visible"))for(clearInterval(g),k=b.length,c=0,d=k;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 g=this.gridHandler.getRows();g.removeAttr("data-paging");var k=0;for(c=g.length;k<c;k++)a(g[k]).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 a=this.getGridHtmlElement().find("div.gridPagingScrolling div.pkp_loading"),d=this.$scrollableElement_;a=a.height();b?(this.getGridHtmlElement().addClass("loading"),
b=d.scrollTop(),d.scrollTop(b+a)):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,a){this.parent(b,a)};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,a){b.find("div.grid_header_bar").prepend(a.collapsibleLink)};a.pkp.classes.features.CollapsibleGridFeature.prototype.toggleGridClickHandler_=function(b,a){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(b,d,e){var c=new FormData;c.append("file",b.blob(),b.filename());a.ajax({method:"POST",url:a.pkp.plugins.generic.tinymceplugin.uploadUrl,data:c,processData:!1,contentType:!1,headers:{"X-Csrf-Token":a.pkp.currentUser.csrfToken},success:function(b){d(b.url)},error:function(b){e(b.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(b){var c=a("#"+b.id);var d=a("#"+b.id).attr("placeholder");if(""!==d){var k=a("<span></span>");k.html(d);k.addClass("mcePlaceholder");k.attr("id","mcePlaceholder-"+b.id);b.target.getContent().length&&k.hide();b=a("<div></div>");
b.addClass("mcePlaceholderParent");c.wrap(b);c.parent().append(k)}});b.on("activate",function(b){a("#mcePlaceholder-"+b.id).hide()});b.on("deactivate",function(b){b.target.getContent().length||a("#mcePlaceholder-"+b.id).show();b.target.dom.addClass(b.target.dom.select("li"),"show")});b.on("BeforeSetContent",function(c){var d=a.pkp.classes.TinyMCEHelper.prototype.getVariableMap("#"+a.pkp.classes.Helper.escapeJQuerySelector(b.id));c.content=c.content.replace(/\{\$([a-zA-Z]+)\}(?![^<]*>)/g,function(c,
e,h,r){return void 0!==d[e]?a.pkp.classes.TinyMCEHelper.prototype.getVariableElement(e,d[e],"#"+b.id).html():c})});b.on("SaveContent",function(b){var c=a("<div>"+b.content+"</div>");c.find(".pkpTag").replaceWith(function(){return"{$"+a(this).attr("data-symbolic")+"}"});b.content=c.html()});b.on("FullscreenStateChanged init",function(b){b=b.target;var c=a(b.editorContainer);b.plugins.fullscreen&&(b.plugins.fullscreen.isFullscreen()?c.find(".mce-toolbar[role='menubar']").show():c.find(".mce-toolbar[role='menubar']").hide())})};
a.pkp.controllers.SiteHandler.prototype.getWindowDimensions=function(){return{height:a(window).height(),width:a(window).width()}};a.pkp.controllers.SiteHandler.prototype.redirectToUrl=function(b,a,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,a,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,a){if("click"!==a.type&&"mousedown"!==a.type&&"mouseup"!==a.type)throw Error("Can not check outside click with the passed event: "+a.type+".");var c=b.container;return c.is(":hidden")?!1:0===c.has(a.target).length?(delete this.outsideClickChecks_[c.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,a){this.showNotification_(a)};a.pkp.controllers.SiteHandler.prototype.showNotification_=function(b){var a,d;b=this.handleJson(b);if(!1!==b&&b.content.general)for(a in b=b.content.general,
b)for(d in b[a])new PNotify(b[a][d])};a.pkp.controllers.SiteHandler.prototype.handleNotifyEvent=function(b,a){new PNotify(a)};a.pkp.controllers.SiteHandler.prototype.openModal_=function(b,a,d,e){this.getHtmlElement().addClass("modal_is_visible")};a.pkp.controllers.SiteHandler.prototype.closeModal_=function(b,a,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,a){this.parent(b,a);this.sourceUrl_=a.sourceUrl;this.reload();a.refreshOn&&this.bindGlobal(a.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,a){this.parent(b,a);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,a){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,a){b=this.getHtmlElement();a.preventDefault();b.toggleClass("active");b.hasClass("active")&&(a=b.closest(".scrollable"),0<a.length&&this.scrollToMakeVisible_(b,a))};a.pkp.controllers.ExtrasOnDemandHandler.prototype.scrollToMakeVisible_=
function(b,a){var c=b.position().top;var e=a.position().top;var g=parseInt(a.scrollTop(),10);c>e?(b=Math.ceil(c+b.height()-a.height()),0<b&&a.scrollTop(g+b)):(g=Math.max(Math.floor(g+c-e),0),a.scrollTop(g))}})(jQuery);(function(a){a.pkp.controllers.PageHandler=function(b,a){this.parent(b,a);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,a,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 b=0;a(this).find("a").each(function(){a(this).attr("href")==e&&b++});return 0<b});0<b.length&&b.each(function(){a(this).trigger("dataChanged",
[d])})}})(jQuery);(function(a){a.pkp.controllers.TabHandler=function(b,a){var c,e=this;this.parent(b,a);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);a.emptyLastTab&&(this.emptyLastTab_=a.emptyLastTab);var g=document.location.toString();if(g.match("#")){g=
g.split("#")[1];var k=b.find("li a");for(c=0;c<k.length;c++)g==k[c].getAttribute("name")&&(a.selected=c)}b.tabs({beforeLoad:function(b,a){a.ajaxSettings.dataType="json";a.jqXHR.setRequestHeader("Accept","application/json");a.ajaxSettings.dataFilter=e.callbackWrapper(e.dataFilter)},disabled:a.disabled,active:a.selected});window.addEventListener("hashchange",function(a){a=a.newURL.split("#");2>a.length||(a=b.find('li > a[name="'+a[1]+'"]'),a.length&&a.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(b){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(b,a,c){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,a,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(b){e.replaceWith(b.content)})};a.pkp.controllers.TabHandler.prototype.addTab=function(b,c,d){var e=this.getHtmlElement();b=e.children("ul").children("li").length+1;c=a("<a/>").text(d.title).attr("href",d.url);d=a("<a/>").addClass("close").text(a.pkp.locale.common_close).attr("href","#");c=a("<li/>").append(c).append(d);d.click(function(){var b=a(this).closest("li"),c=a("#"+b.attr("aria-controls"));var d=!1;c.find("form").each(function(){if(a.pkp.classes.Handler.getHandler(a(this)).formChangesTracked&&
!confirm(a.pkp.locale.form_dataHasChanged))return d=!0,!1});if(!d){c.find("form").each(function(){var b=a.pkp.classes.Handler.getHandler(a(this));b&&b.unregisterForm()});var r=b.eq(0).index();e.tabs("option","active")==r&&e.tabs("option","active",r-1);b.remove();c.remove();e.tabs("refresh")}});e.children("ul").append(c);e.tabs("refresh");e.tabs("option","active",b-1)};a.pkp.controllers.TabHandler.prototype.getCurrentTab=function(){return this.$currentTab_};a.pkp.controllers.TabHandler.prototype.getCurrentTabIndex=
function(){return this.currentTabIndex_}})(jQuery);(function(a){a.pkp.controllers.MenuHandler=function(b,c){this.parent(b,c);var d=this;setTimeout(function(){d.callbackWrapper(d.setDropdownAlignment())},1);a(window).resize(this.callbackWrapper(this.onResize));this.getHtmlElement().on("focus mouseenter",'[aria-haspopup="true"]',function(b){a(b.currentTarget).attr("aria-expanded","true")});this.getHtmlElement().on("blur mouseleave",'[aria-haspopup="true"]',function(b){a(b.currentTarget).attr("aria-expanded","false")})};a.pkp.classes.Helper.inherits(a.pkp.controllers.MenuHandler,
a.pkp.classes.Handler);a.pkp.controllers.MenuHandler.prototype.setDropdownAlignment=function(){a(this);var b=Math.max(document.documentElement.clientWidth,window.innerWidth||0),c=Math.max(document.documentElement.clientHeight,window.innerHeight||0);this.getHtmlElement().find('[aria-haspopup="true"]').each(function(){var d=a(this),e=d.children("ul");d.offset().left+e.outerWidth()>b?d.addClass("align_right"):d.removeClass("align_right");e.attr("style","");var g=d.offset().top;var k=0;d.hasClass("submenuOpensBelow")&&
(k=g+d.outerHeight());var h=g+e.outerHeight();if(h>c){h-=c;var r=g-h;r<k&&(h=0<k?k:-Math.abs(h)-r,e.css("overflow-y","scroll"),e.css("bottom",-Math.abs(c-g-d.outerHeight())+"px"));e.css("top",h+"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(b){return!1});this.pluploader.refresh();var g=this;setTimeout(function(){g.getHtmlElement().find(".moxie-shim input").focus(function(b){e.addClass("in_focus")}).blur(function(b){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,a,d){1<a.files.length&&a.removeFile(a.files[0]);this.updateStatus("uploading");a.start()};a.pkp.controllers.UploaderHandler.prototype.updateProgress=function(b,a,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,a,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,a,d){a.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,a,d){b=this.hiddenInput_;a=this.textInput;""!==d.item.value&&(b.val(d.item.value),a.val(d.item.label));return!1};a.pkp.controllers.AutocompleteHandler.prototype.itemFocused=function(b,a,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(b){e.removeClass("spinner");d(b.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,a,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,a){this.getHtmlElement().removeClass("isHidden").removeAttr("style");a.preventDefault();a.stopPropagation()}})(jQuery);(function(a){a.pkp.controllers.NotificationHandler=function(b,a){this.parent(b,a);this.options_=a;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 g=
this.concatenateNotifications_(d.content.inPlace);c=this.removeAlreadyShownNotifications_(d);this.unbindPartial(b);b.html(g);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(),g=b.parents(".ui-dialog-content");return 0<g.length&&(b=g.offset().top,g=b+g.height(),c<b||c>g)?!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 g=
a("#pkp_notification_"+e);0<g.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 a="",d,e;for(d in b)for(e in b[d])a+=b[d][e];return a};a.pkp.controllers.NotificationHandler.prototype.getTrivialNotifications_=function(b){var a=[],d,e;for(d in b)if(1==d)for(e in b[d])a.push(e);return a};a.pkp.controllers.NotificationHandler.prototype.addTimerToNotifications=function(b){var c=
this;var d=function(){var b=a(this);c.unbindPartial(b);b.remove()};b.length&&(this.trivialTimer_=setTimeout(function(){var c;for(c in b){var g=a("#pkp_notification_"+b[c]);g.fadeOut(400,d)}},6E3))}})(jQuery);(function(a){a.pkp.controllers.HelpPanelHandler=function(b,c){this.parent(b,{});a("body").click(function(c){var d=a(c.target);if(d.hasClass("requestHelpPanel")||d.parents(".requestHelpPanel").length)c.preventDefault(),c=a.extend({},d.data(),{caller:d}),b.trigger("pkp.HelpPanel.Open",c)});b.find(".pkpCloseHelpPanel").click(function(a){a.preventDefault();b.trigger("pkp.HelpPanel.Close")});b.find(".pkpHomeHelpPanel").click(function(a){a.preventDefault();b.trigger("pkp.HelpPanel.Home")});b.find(".pkpPreviousHelpPanel").click(this.callbackWrapper(function(b){this.loadHelpContent_(this.previousTopic_,
this.helpLocale_)}));b.find(".pkpNextHelpPanel").click(this.callbackWrapper(function(b){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,a){a=this.handleJson(a).content;var c=this.getHtmlElement();this.currentTopic_.indexOf("#");b=c.find(".panel");this.previousTopic_=a.previous;this.nextTopic_=a.next;c.find(".content").replaceWith('<div class="content">'+
a.content+"</div>");b.scrollTop(0);this.requestedSection_&&(a=c.find('a[name="'+this.requestedSection_+'"]'),a.length&&b.scrollTop(a.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 b=a(this);b.datepicker({altField:"#"+b.prop("id")+"-altField",altFormat:"yy-mm-dd",dateFormat:a("#"+b.prop("id")+"-altField").attr("data-date-format")});b.prop("name",
b.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(b,c){a(b).parent().parent().addClass(c)},unhighlight:function(b,c){a(b).parent().parent().removeClass(c)},submitHandler:this.callbackWrapper(this.submitHandler_),showErrors:this.callbackWrapper(this.showErrors),errorPlacement:function(b,a){a.is(":checkbox")?a.parent().closest(":not(label)").append(b):b.insertAfter(a)}});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,a){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,a){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 b=new a.Event("formSubmitRequested");d||(a(this).trigger(b),d=b.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,a){"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(b){b.save();b=
this.getHtmlElement();var c=a("#"+a.pkp.classes.Helper.escapeJQuerySelector(e),b);b.validate().element(c)}))};a.pkp.controllers.form.FormHandler.prototype.containerCloseHandler=function(b,c,d){a(this.getHtmlElement()).find(".hasDatepicker").datepicker("hide");if(this.formChangesTracked)if(confirm(a.pkp.locale.form_dataHasChanged))this.trigger("unregisterAllForms");else return d.closePermitted=!1;"undefined"!==typeof d&&(d.closePermitted=!0);return!0};a.pkp.controllers.form.FormHandler.prototype.onFocusOutValidation_=
function(b,c){var d=this.getHtmlElement();a(c).parents("#"+d.attr("id")).length&&b.element(c);return!0};a.pkp.controllers.form.FormHandler.prototype.hideDatepicker_=function(b,c){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,a){this.parent(b,a);this.eventName_=a.eventName;this.defaultKey_=a.defaultKey;this.publishEvent(this.eventName_);this.getOptionsUrl_=a.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,a){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,a){a.submitHandler=this.submitForm;this.parent(b,a);"undefined"!==typeof a.confirmText&&(this.confirmText=a.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,a,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,a){a.submitHandler=this.submitForm;this.parent(b,a)};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,a){this.parent(b,a);if(void 0===a.readOnly||null===a.readOnly)void 0!==a.resetUploader&&(this.resetUploader_=a.resetUploader),void 0!==a.$preview&&a.$preview.length&&(this.$preview=a.$preview,this.bind("fileDeleted",this.callbackWrapper(this.fileDeleted))),this.attachUploader_(a.$uploader,a.uploaderOptions),this.uploaderSetup(a.$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,a){b.pkpHandler("$.pkp.controllers.UploaderHandler",a)}})(jQuery);(function(a){a.pkp.controllers.form.MultilingualInputHandler=function(b,a){this.parent(b,a);(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,a){this.showPopover_()};a.pkp.controllers.form.MultilingualInputHandler.prototype.blurHandler_=function(b,a){setTimeout(this.callbackWrapper(function(){this.hasElementInFocus_()||this.hidePopover_()}),0);return!0};a.pkp.controllers.form.MultilingualInputHandler.prototype.hidePopover_=function(){var a=this.getHtmlElement();a.removeClass("localization_popover_container_focus");a.find(".localization_popover").hide();this.isIncomplete_()};
a.pkp.controllers.form.MultilingualInputHandler.prototype.showPopover_=function(){var a=this.getHtmlElement();a.addClass("localization_popover_container_focus");a.find(".localization_popover").width(a.width());a.find(".localization_popover").show()};a.pkp.controllers.form.MultilingualInputHandler.prototype.hasElementInFocus_=function(){return this.getHtmlElement().has(document.activeElement).length?!0:!1};a.pkp.controllers.form.MultilingualInputHandler.prototype.isIncomplete_=function(){var b=this.getHtmlElement(),
c=[],d=0;"undefined"!==typeof tinyMCE&&(this.getHtmlElement().find(".richContent").length?b.find("textarea").each(function(){a(this).attr("id");c.push(a(this));tinyMCE.EditorManager.get(a(this).attr("id")).getContent()&&d++}):(c=b.find(":input"),c.each(function(){a(this).val()&&d++})),0<d&&d<c.length?b.removeClass("localizationComplete").addClass("localizationIncomplete"):d===c.length?b.removeClass("localizationIncomplete").addClass("localizationComplete"):b.removeClass("localizationIncomplete localizationComplete"))};
a.pkp.controllers.form.MultilingualInputHandler.prototype.tinyMCEInitHandler_=function(){if(this.getHtmlElement().find(".richContent").length&&"undefined"!==typeof tinyMCE){var b=this.getHtmlElement(),c=tinyMCE.EditorManager.get(b.find("textarea").first().attr("id"));c.on("focus",this.callbackWrapper(function(){this.trigger("callWhenClickOutside",{container:this.getHtmlElement(),callback:this.callbackWrapper(this.hidePopover_)});this.showPopover_()}));c.on("blur",this.callbackWrapper(function(){if(a(c.getContainer()).find("iframe").attr("id")==
a(document.activeElement).attr("id"))return!1;setTimeout(this.callbackWrapper(function(){this.hasElementInFocus_()||this.hidePopover_()}),0)}))}}})(jQuery);(function(a){a.pkp.controllers.form.CancelActionAjaxFormHandler=function(b,c){var d=this;this.parent(b,c);this.cancelUrl_=c.cancelUrl;this.cancelActionHandler=function(){d.handleCancelAction()};a(window).on("unload",this.cancelActionHandler)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.CancelActionAjaxFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.cancelActionHandler=null;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.cancelUrl_=
null;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.isComplete_=!1;a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.containerCloseHandler=function(a,c){this.handleCancelAction();return this.parent("containerCloseHandler",a,c)};a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.submitForm=function(a,c){this.isComplete_=!0;this.parent("submitForm",a,c)};a.pkp.controllers.form.CancelActionAjaxFormHandler.prototype.handleCancelAction=function(){null!==this.cancelActionHandler&&
(a(window).off("unload",this.cancelActionHandler),this.cancelActionHandler=null);this.isComplete_||null===this.cancelUrl_||a.post(this.cancelUrl_)}})(jQuery);(function(a){a.pkp.controllers.form.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(a,c){this.parent(a,c);a.find("[id^='submitFormButton-']").click(this.callbackWrapper(this.updateCommentsRequired_));a.find("[type^='submit']").click(this.callbackWrapper(this.updateRecommendationRequired_))};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(a,c){c=this.getHtmlElement().find('[id^="recommendation"]');c.length&&(a.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}})(jQuery);(function(a){a.pkp.controllers.grid=a.pkp.controllers.grid||{};a.pkp.controllers.grid.GridHandler=function(a,c){this.parent(a,c);this.initialize(c);this.initFeatures_(c.features)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.GridHandler,a.pkp.classes.Handler);a.pkp.controllers.grid.GridHandler.FETCH_ALL_ROWS_ID={};a.pkp.controllers.grid.GridHandler.prototype.bodySelector=null;a.pkp.controllers.grid.GridHandler.prototype.fetchRowUrl=null;a.pkp.controllers.grid.GridHandler.prototype.fetchRowsUrl=
null;a.pkp.controllers.grid.GridHandler.prototype.gridId_=null;a.pkp.controllers.grid.GridHandler.prototype.fetchGridUrl_=null;a.pkp.controllers.grid.GridHandler.prototype.features_=null;a.pkp.controllers.grid.GridHandler.prototype.fetchExtraParams_=null;a.pkp.controllers.grid.GridHandler.prototype.getFetchExtraParams=function(){return this.fetchExtraParams_};a.pkp.controllers.grid.GridHandler.prototype.setFetchExtraParams=function(a){this.fetchExtraParams_=a};a.pkp.controllers.grid.GridHandler.prototype.getFetchRowUrl=
function(){return this.fetchRowUrl};a.pkp.controllers.grid.GridHandler.prototype.getFetchRowsUrl=function(){return this.fetchRowsUrl};a.pkp.controllers.grid.GridHandler.prototype.getRows=function(){return a(".gridRow",this.getHtmlElement()).not(".gridRowDeleted")};a.pkp.controllers.grid.GridHandler.prototype.getGridIdPrefix=function(){return"component-"+this.gridId_};a.pkp.controllers.grid.GridHandler.prototype.getRowIdPrefix=function(){return this.getGridIdPrefix()+"-row-"};a.pkp.controllers.grid.GridHandler.prototype.getRowByDataId=
function(b,c){return a("#"+this.getRowIdPrefix()+a.pkp.classes.Helper.escapeJQuerySelector(String(b)),this.getHtmlElement())};a.pkp.controllers.grid.GridHandler.prototype.getRowDataId=function(a){return a.attr("id").slice(this.getRowIdPrefix().length)};a.pkp.controllers.grid.GridHandler.prototype.getParentRow=function(a){return a.parents(".gridRow:first")};a.pkp.controllers.grid.GridHandler.prototype.getElementsByType=function(b){return b.hasClass("gridRow")?(b=b.parents("tbody:first"),a(".gridRow",
b)):null};a.pkp.controllers.grid.GridHandler.prototype.getEmptyElement=function(a){return a.hasClass("gridRow")?a.parents("tbody:first").next(".empty"):null};a.pkp.controllers.grid.GridHandler.prototype.toggleRowActions=function(b,c){c.preventDefault();a(b).toggleClass("show_extras");a(b).toggleClass("hide_extras");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 c=a.pkp.classes.Handler.getHandler(a(this));
b?c.enableLink():c.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 g=this.getControlRowByGridRow(e);0<g.length&&g.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(a,c){if(1!==a.length)throw Error("There were "+a.length+" rather than 1 element to delete!");a.addClass("gridRowDeleted");var b=!1;1==this.getElementsByType(a).length&&(b=!0);a.hasClass("gridRow")&&this.deleteControlsRow_(a);var e=this.getEmptyElement(a);var g=this;var k=function(){g.unbindPartial(a);a.remove();
b&&e.fadeIn(100)};void 0!=c&&c?k():a.fadeOut(500,k)};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(a,c,d){if(void 0===c||null===c)c=this.getHtmlElement().find(this.bodySelector);void 0!=d&&d?c.prepend(a):c.append(a);(c=this.getEmptyElement(a))&&c.hide();this.callFeaturesHook("addElement",a)};a.pkp.controllers.grid.GridHandler.prototype.replaceElement=function(a,c){c.hasClass("gridRow")&&this.deleteControlsRow_(a);this.replacePartialWith(c,a);this.callFeaturesHook("replaceElement",c)};a.pkp.controllers.grid.GridHandler.prototype.hasSameNumOfColumns=
function(a,c){var b=this.getHtmlElement().find("th").length;a=a.first().find("td");c=c?a.attr("colspan"):a.length;return b==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 g=e.filter("tr.row_controls");var k=0;for(d=c.length;k<
d;k++){e=a(c[k]);var h=this.getControlRowByGridRow(e,g);this.insertOrReplaceElement(e.add(h))}}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 a=this.getHtmlElement();
this.getHtmlElement().find("tr.gridRow").not(".category");a.find("a.show_extras").unbind("click").bind("click",this.callbackWrapper(this.toggleRowActions))};a.pkp.controllers.grid.GridHandler.prototype.applyToggleRowActionEffect_=function(a){a.prev().find("td:not(.indent_row)").add(a.prev());a.toggle()};a.pkp.controllers.grid.GridHandler.prototype.addFeature_=function(a,c){this.features_||(this.features_=[]);this.features_[a]=c};a.pkp.controllers.grid.GridHandler.prototype.initFeatures_=function(b){var c;
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(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.CategoryGridHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryIdPrefix=function(){return this.getGridIdPrefix()+"-category-"};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategories=function(){return a(".category_grid_body:not(.empty)",this.getHtmlElement())};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryByDataId=
function(b){return a("#"+this.getCategoryIdPrefix()+b)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryRow=function(b){var c=this.getHtmlElement();void 0!==b&&(c=b);return a("tr.category",c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getRowsInCategory=function(b){return a("tr.gridRow",b).not(".category")};a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryEmptyPlaceholder=function(b){b="#"+b.attr("id")+"-emptyPlaceholder";return a(b,this.getHtmlElement())};
a.pkp.controllers.grid.CategoryGridHandler.prototype.getCategoryDataId=function(a){a=a.attr("id");var b=this.getCategoryIdPrefix().length;return a.slice(b)};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(a){this.getHtmlElement().find(this.bodySelector).append(a)};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 g=this.getCategoryEmptyPlaceholder(e);0<g.length&&g.insertAfter(e)}};a.pkp.controllers.grid.CategoryGridHandler.prototype.initialize=function(a){this.fetchCategoryUrl_=a.fetchCategoryUrl;this.parent("initialize",a)};
a.pkp.controllers.grid.CategoryGridHandler.prototype.getElementsByType=function(a){return a.hasClass("category_grid_body")?this.getCategories():this.parent("getElementsByType",a)};a.pkp.controllers.grid.CategoryGridHandler.prototype.getEmptyElement=function(a){return a.hasClass("category_grid_body")?this.getHtmlElement().find(".empty").not(".category_placeholder"):this.parent("getEmptyElement",a)};a.pkp.controllers.grid.CategoryGridHandler.prototype.refreshGridHandler=function(b,c,d){var e=!1;void 0!==
d&&(void 0!==d.parentElementId?(e={rowId:d[0],rowCategoryId:d.parentElementId},this.currentCategoryId_=d.parentElementId,a.get(this.fetchRowUrl,e,this.callbackWrapper(this.replaceElementResponseHandler),"json")):a.get(this.fetchCategoryUrl_,{rowId:d},this.callbackWrapper(this.replaceElementResponseHandler),"json"),e=!0);this.parent("refreshGridHandler",b,c,d,e)};a.pkp.controllers.grid.CategoryGridHandler.prototype.deleteElement=function(b){var c;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 g=a(b[e]).parents("#"+d.attr("id"));if(1===g.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(a){var b=null;a.hasClass("gridRow")&&(b=
this.getCategoryDataIdByRowId(a.attr("id")),b=this.getCategoryByDataId(b));this.parent("addElement",a,b);a.hasClass("category_grid_body")&&(a=this.getEmptyElement(a),this.getHtmlElement().find(this.bodySelector).append(a))};a.pkp.controllers.grid.CategoryGridHandler.prototype.replaceElement=function(a,c){if(c.hasClass("category_grid_body")){var b=this.getCategoryEmptyPlaceholder(a);this.unbindPartial(b);b.remove()}this.parent("replaceElement",a,c)};a.pkp.controllers.grid.CategoryGridHandler.prototype.hasSameNumOfColumns=
function(a){var b=a,d=!1;a.hasClass("category_grid_body")&&(b=a.find("tr"),d=!0);return this.parent("hasSameNumOfColumns",b,d)}})(jQuery);(function(a){a.pkp.controllers.grid.files=a.pkp.controllers.grid.files||{review:{}};a.pkp.controllers.grid.files.review.AuthorReviewRevisionsGridHandler=function(a,c){this.parent(a,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(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.listbuilder.ListbuilderHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.sourceType_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveUrl_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveFieldName_=null;
a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.fetchOptionsUrl_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.editItemCallingContext_=null;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.availableOptions_=!1;a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.initialize=function(a){this.parent("initialize",a);this.sourceType_=a.sourceType;this.saveUrl_=a.saveUrl;this.saveFieldName_=a.saveFieldName;this.fetchOptionsUrl_=a.fetchOptionsUrl;this.availableOptions_=
a.availableOptions;a=this.getHtmlElement();a.find(".actions .pkp_linkaction_addItem").mousedown(this.callbackWrapper(this.addItemHandler_));this.attachContentHandlers_(a);this.bind("formSubmitRequested",this.formSubmitHandler_);this.bind("formSubmitted",this.formSubmittedHandler_)};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.getSaveUrl_=function(){return this.saveUrl_};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.getSaveFieldName_=function(){return this.saveFieldName_};
a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.closeEdits=function(){var a=this.getHtmlElement().find(".gridRowEdit:visible");0!==a.length&&(this.saveRow(a),a.removeClass("gridRowEdit"))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.save=function(){var b=this.getHtmlElement().find("input.deletions").val(),c=[],d=this;this.getHtmlElement().find('.gridRow input.isModified[value="1"]').each(function(b,e){b=a(e).parents(".gridRow");b=d.buildParamsFromInputs_(b.find(":input"));
c.push(b)});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 g=this.getSaveFieldName_();e=this.getHtmlElement().find(":input[type=hidden]").filter(function(){return a(this).attr("name")==g}).first();0===e.length&&(e=a('<input type="hidden" />'),e.attr("name",g),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(a){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,g,k;if(!1!==b){c.find(".gridCellDisplay :input").each(function(b,c){d[b]=a(c).val()});c=c.find(".gridRowEdit:visible .selectMenu:input");var h=0;for(e=c.length;h<e;h++){var r=a(c[h]);var v=r.parents(".gridCellContainer");var y=0;r.children().empty();var q=null;
for(q in b.content[h])if(q!=a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL)if("object"==typeof b.content[h][q]){if(void 0!==b.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&"object"==typeof b.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL]&&(k=b.content[h][a.pkp.cons.LISTBUILDER_OPTGROUP_LABEL][q])){var w=a("<optgroup></optgroup>");w.attr("label",k);r.append(w);k=null;var t=0;for(k in b.content[h][q])if(g=this.populatePulldown_(w,d,b.content[h][q][k],k))y++,t++;0===t&&w.remove()}}else(g=this.populatePulldown_(r,
d,b.content[h][q],q))&&y++;r=g;1===y&&r&&(r.attr("selected","selected"),this.availableOptions_=!1);0===y&&(v.find(".gridCellDisplay").show(),v.find(".gridCellEdit").hide())}}this.enableControls();return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.populatePulldown_=function(b,c,d,e){var g=b.parents(".gridCellContainer").find(".gridCellDisplay :input").val(),k=!1,h;if(e!=g)for(h=0;h<c.length;h++)c[h]==e&&(k=!0);if(k)return!1;c=a("<option/>");c.attr("value",e);c.text(d);e==g&&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 b=a(this.editItemCallingContext_).closest(".gridRow");b.addClass("gridRowEdit");b.find(":input").not('[type="hidden"]').first().focus();this.sourceType_==a.pkp.cons.LISTBUILDER_SOURCE_TYPE_SELECT&&(this.disableControls(),a.get(this.fetchOptionsUrl_,{},this.callbackWrapper(this.fetchOptionsResponseHandler_,
null),"json"))}),0);return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.buildParamsFromInputs_=function(b){var c={};a.each(b.serializeArray(),function(b,e){b=e.name;e=e.value;c[b]=void 0===c[b]?e:a.isArray(c[b])?c[b].concat(e):[c[b],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 b=a(".editingRowPlaceholder"),c=!1;b.find(":input").each(function(a,b){b===document.activeElement&&(c=!0)});b.removeClass("editingRowPlaceholder");c||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(a,c){};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.attachContentHandlers_=function(a){a.find(".gridCellDisplay").click(this.callbackWrapper(this.editItemHandler_));
a.find(":input").keypress(this.callbackWrapper(this.inputKeystrokeHandler_)).blur(this.callbackWrapper(this.inputBlurHandler_));a.find(".pkp_linkaction_delete").click(this.callbackWrapper(this.deleteItemHandler_))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.formSubmitHandler_=function(a,c){this.save();this.getHtmlElement().find(".gridRow :input").attr("disabled","disabled");return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.formSubmittedHandler_=function(a,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(a){return"object"===typeof a&&void 0===a.buttons};a.pkp.controllers.modal.ModalHandler.prototype.mergeOptions=function(b){return a.extend(!0,{},this.self("DEFAULT_OPTIONS_"),b)};a.pkp.controllers.modal.ModalHandler.prototype.modalBuild=function(){var b=a('<div class="pkp_modal_panel"></div>');"undefined"!==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(a,c){var b=this,e=this.getHtmlElement();a=e.find("form").first();if(1==a.length&&(c={closePermitted:!0},a.trigger("containerClose",[c]),!c.closePermitted))return!1;e.removeClass("is_visible");this.trigger("pkpModalClose");setTimeout(function(){var a=b.options.closeCleanVueInstances,c;if(a.length)for(c=0;c<a.length;c++){var d=a[c];"undefined"!==typeof pkp.registry._instances[d]&&(d=pkp.registry._instances[d],
d.$destroy())}b.unbindPartial(e);e.empty();b.remove();"function"===typeof b.options.closeCallback&&b.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(a,c){this.options.closeOnFormSuccessId&&this.options.closeOnFormSuccessId===c&&this.modalClose()}})(jQuery);(function(a){a.pkp.controllers.modal.ConfirmationModalHandler=function(a,c){this.parent(a,c);this.callback_=c.callback||null;this.callbackArgs_=c.callbackArgs||null;a.find(".pkpModalConfirmButton").on("click",this.callbackWrapper(this.modalConfirm))};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.ConfirmationModalHandler,a.pkp.controllers.modal.ModalHandler);a.pkp.controllers.modal.ConfirmationModalHandler.prototype.callback_=null;a.pkp.controllers.modal.ConfirmationModalHandler.prototype.callbackArgs_=
null;a.pkp.controllers.modal.ConfirmationModalHandler.prototype.checkOptions=function(a){return this.parent("checkOptions",a)?"string"===typeof a.okButton&&(!1===a.cancelButton||"string"===typeof a.cancelButton)&&"string"===typeof a.dialogText:!1};a.pkp.controllers.modal.ConfirmationModalHandler.prototype.modalBuild=function(){var a=this.parent("modalBuild"),c='<button class="ok pkpModalConfirmButton">'+this.options.okButton+"</button>";a.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>");a.append('<div class="footer">'+c+"</div>");a.attr("role","dialog").attr("aria-label",this.options.title);return a};a.pkp.controllers.modal.ConfirmationModalHandler.prototype.modalConfirm=function(a,c){this.modalClose(a);this.callback_&&this.callback_.call(null,this.callbackArgs_)}})(jQuery);(function(a){a.pkp.controllers.modal.RedirectConfirmationModalHandler=function(a,c){this.parent(a,c);this.remoteUrl_=c.remoteUrl};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.RedirectConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.remoteUrl_=null;a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.checkOptions=function(a){return this.parent("checkOptions",a)?"string"===typeof a.cancelButton&&
"string"===typeof a.remoteUrl:!1};a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.modalConfirm=function(a,c){document.location=this.remoteUrl_}})(jQuery);(function(a){a.pkp.controllers.modal.RemoteActionConfirmationModalHandler=function(a,c){this.parent(a,c);this.remoteAction_=c.remoteAction;this.postData_=c.postData||{};this.postData_.csrfToken=c.csrfToken};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.RemoteActionConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteAction_=null;a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.postData_=
null;a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.checkOptions=function(a){return this.parent("checkOptions",a)?"string"===typeof a.cancelButton&&"string"===typeof a.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(a,c){!1!==this.parent("remoteResponse",a,c)&&this.modalClose(a);return!1}})(jQuery);(function(a){a.pkp.controllers.modal.ButtonConfirmationModalHandler=function(a,c){this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.ButtonConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.ButtonConfirmationModalHandler.prototype.checkOptions=function(a){return this.parent("checkOptions",a)?"object"==typeof a.$button&&1==a.$button.length:!1};a.pkp.controllers.modal.ButtonConfirmationModalHandler.prototype.modalConfirm=function(a,
c){c=this.options.$button;this.modalClose(a);"submit"==c.attr("type")?c.trigger("submit"):c.click()}})(jQuery);(function(a){a.pkp.controllers.modal.JsEventConfirmationModalHandler=function(a,c){this.parent(a,c);this.jsEvent_=c.jsEvent;this.extraArguments_=c.extraArguments};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.JsEventConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.jsEvent_=null;a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.extraArguments_=null;a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.checkOptions=
function(a){return this.parent("checkOptions",a)?"string"===typeof a.cancelButton&&"string"===typeof a.jsEvent:!1};a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.modalConfirm=function(a,c){this.trigger(this.jsEvent_,this.extraArguments_);this.modalClose(a)}})(jQuery);(function(a){a.pkp.controllers.modal.AjaxModalHandler=function(a,c){this.parent(a,c);this.bind("formSubmitted",this.formSubmitted);this.bind("formCanceled",this.modalClose);this.bind("ajaxHtmlError",this.modalClose);this.bind("modalFinished",this.modalClose)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.AjaxModalHandler,a.pkp.controllers.modal.ModalHandler);a.pkp.controllers.modal.AjaxModalHandler.prototype.checkOptions=function(a){return this.parent("checkOptions",a)?"string"===typeof a.url:
!1};a.pkp.controllers.modal.AjaxModalHandler.prototype.mergeOptions=function(a){return this.parent("mergeOptions",a)};a.pkp.controllers.modal.AjaxModalHandler.prototype.modalOpen=function(a){this.parent("modalOpen",a);a.find(".content").pkpAjaxHtml(this.options.url)};a.pkp.controllers.modal.AjaxModalHandler.prototype.formSubmitted=function(a,c){this.getHtmlElement().parent().trigger("notifyUser");this.modalClose()}})(jQuery);(function(a){a.pkp.controllers.modal.WizardModalHandler=function(a,c){this.parent(a,c);this.bind("wizardClose",this.wizardClose);this.bind("wizardCancel",this.wizardClose)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.WizardModalHandler,a.pkp.controllers.modal.AjaxModalHandler);a.pkp.controllers.modal.WizardModalHandler.prototype.modalClose=function(b,c,d){d?this.parent("modalClose",b,c):(d=new a.Event("wizardCancelRequested"),d.stopPropagation(),this.getHtmlElement().children().first().trigger(d),
d.isDefaultPrevented()||this.parent("modalClose",b,c));return!1};a.pkp.controllers.modal.WizardModalHandler.prototype.wizardClose=function(a,c){this.modalClose(a,c,!0)}})(jQuery);(function(a){a.pkp.controllers.modals=a.pkp.controllers.modals||{editorDecision:{form:{}}};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler=function(b,c){this.parent(b,c);null!==c.peerReviewUrl&&(this.peerReviewUrl_=c.peerReviewUrl,a("#importPeerReviews",b).click(this.callbackWrapper(this.importPeerReviews)));null!==c.revisionsEmail&&(this.revisionsEmail_=c.revisionsEmail);null!==c.resubmitEmail&&(this.resubmitEmail_=c.resubmitEmail);a("#skipEmail-send, #skipEmail-skip, #skipDiscussion-send, #skipDiscussion-skip",
b).change(this.callbackWrapper(this.toggleEmailDisplay));a('input[name="decision"]',b).change(this.callbackWrapper(this.toggleDecisionEmail));this.setStep("email");var d=this;a(".promoteForm-step-btn",b).click(function(b){b.preventDefault();b.stopPropagation();b=a(b.target).data("step");d.setStep(b)})};a.pkp.classes.Helper.inherits(a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.peerReviewUrl_=
null;a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.revisionsEmail_=null;a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.resubmitEmail_=null;a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.importPeerReviews=function(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,g=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(),g.fadeIn()):(b.fadeOut(),g.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"),g=this;a('input[name="decision"]').each(function(){"decisionRevisions"===a(this).attr("id")&&a(this).prop("checked")?b=g.revisionsEmail_:"decisionResubmit"===a(this).attr("id")&&a(this).prop("checked")&&(b=g.resubmitEmail_)});tinyMCE.get(e).setContent(b);c&&d.hide().fadeIn()};a.pkp.controllers.modals.editorDecision.form.EditorDecisionFormHandler.prototype.setStep=
function(b){var c=a('#promoteForm-step1, .promoteForm-step-btn[data-step="files"]'),d=a('#promoteForm-step2, #promoteForm-complete-btn, .promoteForm-step-btn[data-step="email"]');"files"===b?(d.show(),c.hide()):(c.show(),d.hide())}})(jQuery);(function(a){jQuery.pkp.controllers.linkAction=jQuery.pkp.controllers.linkAction||{};a.pkp.controllers.linkAction.LinkActionHandler=function(b,c){this.parent(b,c);this.staticId_=c.staticId?c.staticId:b.attr("id");if(!c.actionRequest||!c.actionRequestOptions)throw Error('The "actionRequest" and "actionRequestOptions"settings are required in a LinkActionHandler');c.actionRequestOptions.finishCallback=this.callbackWrapper(this.enableLink);this.linkActionRequest_=a.pkp.classes.Helper.objectFactory(c.actionRequest,
[b,c.actionRequestOptions]);this.bindActionRequest();this.publishEvent("dataChanged");this.bind("dataChanged",this.dataChangedHandler_);this.bind("pkpModalClose",this.removeDisabledAttribute_);c.selfActivate&&this.trigger("click")};a.pkp.classes.Helper.inherits(a.pkp.controllers.linkAction.LinkActionHandler,a.pkp.classes.Handler);a.pkp.controllers.linkAction.LinkActionHandler.prototype.linkActionRequest_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.staticId_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.getStaticId=
function(){return this.staticId_};a.pkp.controllers.linkAction.LinkActionHandler.prototype.getUrl=function(){return this.linkActionRequest_.getUrl()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.activateAction=function(a,c){this.linkActionRequest_.shouldDebounce()&&this.disableLink();return this.linkActionRequest_.activate.call(this.linkActionRequest_,a,c)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.bindActionRequest=function(){this.bind("click",this.activateAction)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.enableLink=
function(){var b=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(a,c,d){0===this.getHtmlElement().parents(".pkp_controllers_grid").length&&this.trigger("redirectDataChangedToGrid",[d]);this.trigger("notifyUser",[this.getHtmlElement()])};a.pkp.controllers.linkAction.LinkActionHandler.prototype.noAction_=function(){return!1}})(jQuery);(function(a){a.pkp.controllers.wizard=a.pkp.controllers.wizard||{};a.pkp.controllers.wizard.WizardHandler=function(a,c){this.parent(a,c);this.addWizardButtons_(a,c);this.enforceLinear_=c.hasOwnProperty("enforceLinear")?c.enforceLinear:!0;this.startWizard();this.bindWizardEvents();this.bind("formValid",this.formValid);this.bind("formInvalid",this.formInvalid);this.bind("formSubmitted",this.formSubmitted)};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.WizardHandler,a.pkp.controllers.TabHandler);
a.pkp.controllers.wizard.WizardHandler.prototype.$continueButton_=null;a.pkp.controllers.wizard.WizardHandler.prototype.$progressIndicator_=null;a.pkp.controllers.wizard.WizardHandler.prototype.continueButtonText_=null;a.pkp.controllers.wizard.WizardHandler.prototype.finishButtonText_=null;a.pkp.controllers.wizard.WizardHandler.prototype.enforceLinear_=null;a.pkp.controllers.wizard.WizardHandler.prototype.showProgressIndicator_=function(){this.getProgressIndicator().css("opacity",1)};a.pkp.controllers.wizard.WizardHandler.prototype.hideProgressIndicator_=
function(){this.getProgressIndicator().css("opacity",0)};a.pkp.controllers.wizard.WizardHandler.prototype.continueRequest=function(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(a,c){this.enableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.formInvalid=function(a,c){this.disableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.formSubmitted=
function(a,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(a,c){return this.checkForm_(!0)?!1:!0};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvanceRequested=function(a,c){if(a=this.getForm_())a.submit()&&
(this.disableContinueButton(),this.showProgressIndicator_()),c.preventDefault()};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvance=function(a,c){var b=this.getCurrentStep();a=this.getNumberOfSteps()-1;c=b+1;if(c>a)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",b);b=this.getContinueButton();c===a&&b.text(this.getFinishButtonText());this.hideProgressIndicator_();this.enableContinueButton()};
a.pkp.controllers.wizard.WizardHandler.prototype.startWizard=function(){var a=this.getHtmlElement(),c;if(0!==this.getCurrentStep()){a.tabs("enable",0);a.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);a.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 a=this.getCurrentStep(),c=this.getNumberOfSteps()-1;a<c?this.trigger("wizardAdvance"):this.trigger("wizardClose")};a.pkp.controllers.wizard.WizardHandler.prototype.checkForm_=function(b){var c=this.getForm_();if(null!==c)if(c=a.pkp.classes.Handler.getHandler(a("#"+c.attr("id"))),b){if(c.formChangesTracked)if(confirm(a.pkp.locale.form_dataHasChanged))c.unregisterForm();else return!0}else c.unregisterForm();return!1};a.pkp.controllers.wizard.WizardHandler.prototype.addWizardButtons_=
function(b,c){var d=a('<div id="wizardButtons" class="modal_buttons"></div>');if(c.continueButtonText){var e=a('<button id="continueButton" class="pkp_button"></button>').text(c.continueButtonText);d.append(e);var g=a('<span class="pkp_spinner"></span>');d.append(g);e.bind("click",this.callbackWrapper(this.continueRequest));this.$continueButton_=e;this.$progressIndicator_=g;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(a,c){this.fetchNoteFormUrl_=c.fetchNoteFormUrl;this.fetchParticipantsListUrl_=c.fetchParticipantsListUrl;a.find(".openNoteForm a").click(this.callbackWrapper(this.showNoteFormHandler_));a.bind("dataChanged",this.callbackWrapper(this.reloadParticipantsList_));a.bind("user-left-discussion",function(){a.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(a,c,d){this.loadParticipantsList()}})(jQuery);(function(a){a.pkp.controllers.wizard.fileUpload=a.pkp.controllers.wizard.fileUpload||{};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler=function(a,c){this.parent(a,c);this.csrfToken_=c.csrfToken;this.deleteUrl_=c.deleteUrl;this.metadataUrl_=c.metadataUrl;this.finishUrl_=c.finishUrl;this.bind("fileUploaded",this.handleFileUploaded);this.bind("filesRemoved",this.handleRemovedFiles);this.disableContinueButton()};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler,
a.pkp.controllers.wizard.WizardHandler);a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.csrfToken_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.deleteUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.metadataUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.finishUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.uploadedFile_=null;a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsBeforeActivate=
function(a,c,d){if(0<d.newTab.index()){if(!this.uploadedFile_)throw Error("Uploaded file missing!");this.getHtmlElement();switch(d.newTab.index()){case 1:var b=this.metadataUrl_;break;case 2:b=this.finishUrl_;break;default:throw Error("Unsupported tab index.");}b=b+"&fileId="+this.uploadedFile_.fileId;d.newTab.find(".ui-tabs-anchor").attr("href",b)}return this.parent("tabsBeforeActivate",a,c,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardAdvance=function(a,c){a=this.getCurrentStep();
c=this.getNumberOfSteps()-1;var b=a+1,e=this.getHtmlElement();if(b>c)throw Error("Trying to set an invalid wizard step!");e.tabs("enable",b);e.tabs("option","active",b);0===a&&e.tabs("disable",a);b===c&&(a=this.getContinueButton(),a.text(this.getFinishButtonText()),this.enableContinueButton())};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsLoad=function(b,c,d){var e=this.getHtmlElement(),g=this.getProgressIndicator();2===d.tab.index()&&(e=a("#newFile",e),e.length&&e.bind("click",
this.callbackWrapper(this.startWizard)));g.hide();return this.parent("tabsLoad",b,c,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.formValid=function(a,c){(0!==this.getCurrentStep()||0!==this.getHtmlElement().find("#uploadConfirmationForm").length||this.uploadedFile_)&&this.parent("formValid",a,c)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelRequested=function(b,c){if(this.parent("wizardCancelRequested",b,c))if(this.uploadedFile_)this.uploadedFile_.csrfToken=
this.csrfToken_,a.post(this.deleteUrl_,this.uploadedFile_,a.pkp.classes.Helper.curry(this.wizardCancelSuccess,this,b,c),"json"),this.uploadedFile_=null,c.preventDefault();else return!0;return!1};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelSuccess=function(a,c,d){!1!==this.handleJson(d)&&this.trigger("wizardCancel")};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleFileUploaded=function(a,c,d){this.uploadedFile_=d};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleRemovedFiles=
function(b,c,d,e){var g;if("undefined"!==typeof e&&e.length)for(g in e){if("undefined"===typeof e[g].storedData)break;e[g].storedData.csrfToken=this.csrfToken_;a.post(this.deleteUrl_,e[g].storedData)}};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.startWizard=function(){this.uploadedFile_=null;this.parent("startWizard")}})(jQuery);(function(a){a.pkp.controllers.wizard.fileUpload.form=a.pkp.controllers.wizard.fileUpload.form||{};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler=function(a,c){this.parent(a,c);this.hasFileSelector_=c.hasFileSelector;this.hasGenreSelector_=c.hasGenreSelector;c.presetRevisedFileId&&(this.presetRevisedFileId_=c.presetRevisedFileId);this.fileGenres_=c.fileGenres;this.$uploader_=c.$uploader;this.attachUploader_(this.$uploader_,c.uploaderOptions);this.uploaderSetup(c.$uploader);this.$revisedFileSelector_=
a.find("#revisedFileId").change(this.callbackWrapper(this.revisedFileChange));this.hasGenreSelector_&&(this.$genreSelector=a.find("#genreId").change(this.callbackWrapper(this.genreChange)));this.setUploaderVisibility_()};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.hasFileSelector_=!1;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$revisedFileSelector_=
null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.hasGenreSelector_=!1;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$genreSelector_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.presetRevisedFileId_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.fileGenres_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$uploader_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.uploaderSetup=
function(b){b=a.pkp.classes.Handler.getHandler(b);b.pluploader.bind("BeforeUpload",this.callbackWrapper(this.prepareFileUploadRequest));b.pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse));b.pluploader.bind("FilesRemoved",this.callbackWrapper(this.handleRemovedFiles))};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.prepareFileUploadRequest=function(a,c){this.getHtmlElement();a={};this.hasFileSelector_?(this.$revisedFileSelector_.attr("disabled",
"disabled"),a.revisedFileId=this.$revisedFileSelector_.val()):a.revisedFileId=null!==this.presetRevisedFileId_?this.presetRevisedFileId_:0;this.hasGenreSelector_?(this.$genreSelector.attr("disabled","disabled"),a.genreId=this.$genreSelector.val()):a.genreId="";c.settings.multipart_params=a};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleUploadResponse=function(b,c,d,e){b=this.handleJson(a.parseJSON(e.response));this.getHtmlElement();!1!==b&&(this.trigger("fileUploaded",
b.uploadedFile),""!==b.content&&this.replaceWith(b.content));this.getHtmlElement().valid()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleRemovedFiles=function(a,c,d){this.trigger("filesRemoved",[c,d])};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.submitForm=function(a,c){this.trigger("formSubmitted")};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.revisedFileChange=function(a,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(a,c){this.setUploaderVisibility_()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.attachUploader_=function(a,c){a.pkpHandler("$.pkp.controllers.UploaderHandler",c)};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.setUploaderVisibility_=
function(){this.hasGenreSelector_&&this.$genreSelector.val()||this.$revisedFileSelector_.val()?this.showUploader_():this.hasGenreSelector_||this.hasFileSelector_?this.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(a,c){this.parent(a,c);a.find("#possibleRevision").show("slide");this.trigger("unregisterChangedForm");this.bind("wizardAdvanceRequested",this.wizardAdvanceRequested);this.trackFormChanges=!1};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler.prototype.wizardAdvanceRequested=
function(a,c){a=this.getHtmlElement();0<parseInt(a.find("#revisedFileId").val(),10)&&(a.submit(),c.preventDefault())};a.pkp.controllers.wizard.fileUpload.form.RevisionConfirmationHandler.prototype.handleResponse=function(a,c){!0===c.status&&this.trigger("fileUploaded",c.uploadedFile);return this.parent("handleResponse",a,c)}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus=a.pkp.controllers.grid.navigationMenus||{form:{}};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler=function(a,c){this.okButton_=c.okButton;this.warningModalTitle_=c.warningModalTitle;this.submenuWarning_=c.submenuWarning;this.itemTypeConditionalWarnings_=c.itemTypeConditionalWarnings;a.on("click",".btnConditionalDisplay",this.callbackWrapper(this.showConditionalDisplayWarning));a.on("click",".btnSubmenuWarning",this.callbackWrapper(this.showSubmenuWarning));
this.parent(a,c);this.initSorting()};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.okButton_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.warningModalTitle_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.submenuWarning_=void 0;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.itemTypeConditionalWarnings_=
null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.initSorting=function(){var b=this;a(".btnSubmenuWarning",this.getHtmlElement()).remove();a("#pkpNavAssigned > li").each(function(){var c=a(this).children("ul"),d=c.children(),e=d.find("li");c.length?d.length?(e.length&&e.each(function(){a(this).appendTo(c)}),a(this).find("> .item > .item_buttons .btnSubmenuWarning").length||a(this).find("> .item > .item_buttons").prepend(a("<button></button>").addClass("btnSubmenuWarning").append(a("<span></span>").addClass("fa fa-exclamation-triangle")).append(a("<span></span>").addClass("-screenReader").text(b.submenuWarning_)))):
c.replaceWith("<ul></ul>"):a(this).append("<ul></ul>")});a("#pkpNavUnassigned > li").each(function(){var b=a(this).children("ul");b.length&&b.find("li").each(function(){a(this).appendTo(a("#pkpNavUnassigned"))});b.remove()});a("#pkpNavManagement ul").sortable({placeholder:"pkp_nav_item_placeholder",delay:250,connectWith:"#pkpNavManagement ul",update:this.callbackWrapper(this.updateSorting),start:function(){a("#pkpNavAssigned").addClass("pkp_is_sorting")},stop:function(){a("#pkpNavAssigned").removeClass("pkp_is_sorting")}})};
a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.updateSorting=function(){var b=a("#pkpNavManagement"),c=0,d="";this.initSorting();a("input",b).remove();a("#pkpNavAssigned > li").each(function(){d="menuTree["+a(this).data("id")+"]";b.append('<input type="hidden" name="'+d+'[seq]" value="'+c+'">');c++;var e=a(this).data("id");a(this).find("li").each(function(){d="menuTree["+a(this).data("id")+"]";b.append('<input type="hidden" name="'+d+'[seq]" value="'+c+'">');b.append('<input type="hidden" name="'+
d+'[parentId]" value="'+e+'">');c++})})};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.showConditionalDisplayWarning=function(b){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(a){var b=window.open("about:blank");b.document.open();b.document.write(a);b.document.close()});return!0};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.setType=function(){var b=a("#menuItemType",this.getHtmlElement()).val(),c=a('#menuItemTypeSection [for="menuItemType"]');a(".NMI_TYPE_CUSTOM_EDIT",this.getHtmlElement()).hide();a("#"+b).fadeIn();"undefined"!==typeof this.itemTypeDescriptions_[b]&&c.text(this.itemTypeDescriptions_[b])}})(jQuery);(function(a){a.pkp.controllers.grid.representations=a.pkp.controllers.grid.representations||{form:{}};a.pkp.controllers.grid.representations.form.RepresentationFormHandler=function(b,c){this.parent(b,c);(this.remoteRepresentation_=c.remoteRepresentation)?(a("#remotelyHostedContent").prop("checked",!0),a("#remote").show(20),a("#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"]'),g=!1;for(d=0;d<this.notChangeMetadataEditPermissionRoles_.length;d++)this.notChangeMetadataEditPermissionRoles_[d]==b&&(g=!0);g?(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"),g;e.removeAttr("disabled");if(void 0!=this.roleForbiddenStages_[b])for(g=0;g<this.roleForbiddenStages_[b].length;g++){var k=this.roleForbiddenStages_[b][g];e.filter('input[value="'+k+'"]').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(a,c){a.find('a[id*="markNew"]').click(this.callbackWrapper(this.markNewHandler_));a.find('a[id*="markRead"]').click(this.callbackWrapper(this.markReadHandler_));a.find('a[id*="deleteNotification"]').click(this.callbackWrapper(this.deleteHandler_));this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.notifications.NotificationsGridHandler,
a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markNewUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markReadUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.deleteUrl_=null;a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.initialize=function(a){this.markNewUrl_=a.markNewUrl;this.markReadUrl_=a.markReadUrl;this.deleteUrl_=a.deleteUrl;this.parent("initialize",
a)};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.getSelectedNotifications_=function(){var b=[];this.getHtmlElement().find("input:checkbox:checked").each(function(){b.push(a(this).val())});return b};a.pkp.controllers.grid.notifications.NotificationsGridHandler.prototype.markNewHandler_=function(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(a,
c){a=this.getFetchExtraParams();a.selectedNotificationIds=c.content;this.setFetchExtraParams(a);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(a,c){var b,e;this.parent(a,c);if(b=document.location.toString().match("workflow/([^/]+)/")){b=b[1];var g=a.find("li a");for(e=0;e<g.length;e++)a=new RegExp(b),g[e].getAttribute("class").match(a)&&(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(a,c){this.parent(a,c);this.bind("noteAdded",this.handleRefreshNoteList);this.bind("noteDeleted",this.handleRefreshNoteList)};a.pkp.classes.Helper.inherits(a.pkp.controllers.informationCenter.NotesHandler,a.pkp.classes.Handler);a.pkp.controllers.informationCenter.NotesHandler.prototype.handleRefreshNoteList=function(b,c,d){a(".pkp_modal").first().scrollTop(0);this.replaceWith(d)}})(jQuery);(function(a){a.pkp.controllers.statistics=a.pkp.controllers.statistics||{};a.pkp.controllers.statistics.ReportGeneratorFormHandler=function(b,c){var d;c.trackFormChanges=!1;c.transformButtons=!1;this.parent(b,c);this.getHtmlElement().find(":submit").button();a("#reportUrlFormArea",b).hide();this.timeFilterWrapperSelector_=c.timeFilterWrapperSelector;this.rangeByDaySelector_=c.rangeByDaySelector;this.rangeByMonthSelector_=c.rangeByMonthSelector;this.startDayElementSelector_=c.startDayElementSelector;
this.endDayElementSelector_=c.endDayElementSelector;this.optionalColumns_=c.optionalColumns;this.aggregationOptionsSelector_=c.aggregationOptionsSelector;this.fetchFormUrl_=c.fetchFormUrl;this.$metricTypeSelectElement_=d=a(c.metricTypeSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));a(".pkp_loading",b).hide();this.$reportTemplateSelectElement_=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(a,b){d[b.name]=b.value});a(".pkp_loading",this.getHtmlElement()).show();b=a("option:selected",this.$metricTypeSelectElement_);void 0!==b[0]&&void 0!==b[0].value&&(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(a,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 a=this.getHtmlElement().find("#multipleContext").val();0!=a&&(window.location.href=a)}})(jQuery);(function(a){a.pkp.pages=a.pkp.pages||{header:{}};a.pkp.pages.header.HeaderHandler=function(a,c){this.options_=c;this.parent(a,c)};a.pkp.classes.Helper.inherits(a.pkp.pages.header.HeaderHandler,a.pkp.classes.Handler);a.pkp.pages.header.HeaderHandler.prototype.options_=null})(jQuery);(function(a){a.pkp.pages.header.TasksHandler=function(b,c){this.options_=c;this.parent(b,c);a("#notificationsToggle").click(this.callbackWrapper(this.appendToggleIndicator_));this.bind("updateUnreadNotificationsCount",this.fetchUnreadNotificationsCountHandler_)};a.pkp.classes.Helper.inherits(a.pkp.pages.header.TasksHandler,a.pkp.classes.Handler);a.pkp.pages.header.TasksHandler.prototype.options_=null;a.pkp.pages.header.TasksHandler.prototype.appendToggleIndicator_=function(a,c){a=this.getHtmlElement();
var b=a.find("#notificationsPopover"),e=a.find("#notificationsToggle");b.toggle();e.toggleClass("expandedIndicator");e.hasClass("expandedIndicator")?(this.trigger("callWhenClickOutside",[{container:a,callback:this.callbackWrapper(this.appendToggleIndicator_)}]),setTimeout(this.callbackWrapper(this.setPopoverSize_),500)):(b.css("height","").css("overflow-y",""),c&&this.trigger("callWhenClickOutside",[{container:a,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(a,c){a=this.getHtmlElement().find("#unreadNotificationCount");
a.html(c.content);"0"==c.content?a.removeClass("hasTasks"):a.addClass("hasTasks")}})(jQuery);(function(a){a.pkp.pages.submission=a.pkp.pages.submission||{};a.pkp.pages.submission.SubmissionTabHandler=function(a,c){this.parent(a,c);this.submissionProgress_=c.submissionProgress;this.cancelUrl_=c.cancelUrl;this.cancelConfirmText_=c.cancelConfirmText;this.bind("setStep",this.setStepHandler);this.bind("formCanceled",this.formCanceledHandler);this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(this.submissionProgress_))};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionTabHandler,
a.pkp.controllers.TabHandler);a.pkp.pages.submission.SubmissionTabHandler.prototype.submissionProgress_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.cancelUrl_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.cancelConfirmText_=null;a.pkp.pages.submission.SubmissionTabHandler.prototype.setStepHandler=function(a,c,d){this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(d));this.getHtmlElement().tabs("option","active",d-1)};a.pkp.pages.submission.SubmissionTabHandler.prototype.formCanceledHandler=
function(a,c,d){confirm(this.cancelConfirmText_)&&(window.location=this.cancelUrl_)};a.pkp.pages.submission.SubmissionTabHandler.prototype.getDisabledSteps=function(a){switch(parseInt(a,10)){case 0:return[];case 1:return[1,2,3,4,5];case 2:return[2,3,4,5];case 3:return[3,4,5];case 4:return[4,5];case 5:return[]}throw Error("Illegal submission step number!");}})(jQuery);jQuery.pkp.pages.submission=jQuery.pkp.pages.submission||{};
(function(a){a.pkp.pages.submission.SubmissionStep1FormHandler=function(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(a,c){this.parent(a,c);this.bind("urlInDivLoaded",this.showFileUploadWizard_)};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionStep2FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.pages.submission.SubmissionStep2FormHandler.prototype.showFileUploadWizard_=function(b,c,d){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(a,c){this.parent(a,c);this.bind("gridRefreshRequested",this.fetchChaptersGrid_);this.authorsGridContainer_=c.authorsGridContainer;this.chaptersGridContainer_=c.chaptersGridContainer};a.pkp.classes.Helper.inherits(a.pkp.pages.submission.SubmissionStep3FormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.pages.submission.SubmissionStep3FormHandler.prototype.chaptersGridContainer_="";a.pkp.pages.submission.SubmissionStep3FormHandler.prototype.fetchChaptersGrid_=
function(b,c){c.target.id==this.authorsGridContainer_&&a("#"+this.chaptersGridContainer_).find(".pkp_controllers_grid").trigger("dataChanged")}})(jQuery);(function(a){a.pkp.pages.workflow=a.pkp.pages.workflow||{};a.pkp.pages.workflow.WorkflowHandler=function(a,c){this.parent(a,c);this.bind("stageParticipantsChanged",this.handleStageParticipantsChanged_);this.bind("dataChanged",this.dataChangedHandler_)};a.pkp.classes.Helper.inherits(a.pkp.pages.workflow.WorkflowHandler,a.pkp.classes.Handler);a.pkp.pages.workflow.WorkflowHandler.prototype.handleStageParticipantsChanged_=function(b,c){var d,e,g,k;b=this.getHtmlElement().find(".editorDecisionActions");
var h=this.getHtmlElement().find("#submissionProgressBarDiv");this.getHtmlElement().find("#stageTabs").find("li").each(function(b){if(a(this).hasClass("ui-state-active")){e=a(this).find("a").attr("class");if(d=e.match(/stageId(\d)/))g=d[1],b=a.pkp.classes.Handler.getHandler(h),k=b.getSourceUrl(),b.setSourceUrl(k.replace(/stageId=\d/,"stageId="+g));return!1}});b.add(h).each(function(){a.pkp.classes.Handler.getHandler(a(this)).reload()})};a.pkp.pages.workflow.WorkflowHandler.prototype.dataChangedHandler_=
function(b,c,d){b=a(c.target,this.getHtmlElement()).children("a");b.length&&b.attr("id").match(/submissionEntry/)&&(b=a('[id^="formatsGridContainer"]',this.getHtmlElement()).children("div"),b.trigger("dataChanged",[d]),b.trigger("notifyUser",[b]))}})(jQuery);(function(a){a.pkp.controllers.grid.users=a.pkp.controllers.grid.users||{};a.pkp.controllers.grid.users.UserGridHandler=function(a,c){this.parent(a,c);this.bindGlobal("userMerged",function(){this.trigger("modalFinished");this.refreshGridHandler()});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(a,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(a,c){this.parent(a,c);a.change(this.callbackWrapper(this.handleFormChange));this.bind("urlInDivLoaded",this.handleFileListLoad_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler,a.pkp.controllers.form.UserFormHandler);a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler.prototype.handleFormChange=
function(){this.getHtmlElement().find('input[name="selectedFiles[]"]:checked').length?this.hideWarning():this.showWarning()};a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler.prototype.hideWarning=function(){this.getHtmlElement().find("#noFilesWarning").hide(250)};a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler.prototype.showWarning=function(){this.getHtmlElement().find("#noFilesWarning").show(250)};a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler.prototype.handleFileListLoad_=
function(a,c,d){this.getHtmlElement().change()}})(jQuery);(function(a){a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler=function(a,c){this.parent(a,c);c.templateUrl&&(this.templateUrl_=c.templateUrl);a.find("#template").change(this.callbackWrapper(this.selectTemplateHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler,a.pkp.controllers.grid.users.reviewer.form.EditReviewFormHandler);a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.templateUrl_=null;a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.showWarning=
function(){this.parent("showWarning");this.getHtmlElement().find("#reviewerFormFooter").trigger("expandFileList")};a.pkp.controllers.grid.users.reviewer.form.AddReviewerFormHandler.prototype.selectTemplateHandler_=function(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(a,c){a=this.getHtmlElement();c=this.handleJson(c);
a=a.find('textarea[name="personalMessage"]');a=tinyMCE.EditorManager.get(a.attr("id"));!1!==c&&""!==c.content&&a.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(a,c){var b=this.getHtmlElement();a=this.handleJson(c);c=c.content;b=b.find('textarea[name="message"]');var e=tinyMCE.EditorManager.get(b.attr("id"));
c.variables&&b.attr("data-variables",JSON.stringify(c.variables));e.setContent(c.body);return a.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 g=!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){g=!0;break}if(g)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 b=a("input[name='userId']:checked").val();a("input[name='userIdSelected']").val(b).trigger("change")});this.addUserGroupId()};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler,a.pkp.controllers.form.ClientFormHandler);
a.pkp.controllers.grid.users.stageParticipant.form.AddParticipantFormHandler.prototype.addUserGroupId=function(){var b=this.getHtmlElement().find("select[name^='filterUserGroupId']").val();a("input[name='userGroupId']").val(b).trigger("change")}})(jQuery);(function(a){a.pkp.pages.reviewer=a.pkp.pages.reviewer||{};a.pkp.pages.reviewer.ReviewerTabHandler=function(a,c){this.parent(a,c);this.reviewStep_=c.reviewStep;this.bind("setStep",this.setStepHandler);this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(this.reviewStep_))};a.pkp.classes.Helper.inherits(a.pkp.pages.reviewer.ReviewerTabHandler,a.pkp.controllers.TabHandler);a.pkp.pages.reviewer.ReviewerTabHandler.prototype.reviewStep_=null;a.pkp.pages.reviewer.ReviewerTabHandler.prototype.setStepHandler=
function(a,c,d){this.getHtmlElement().tabs("option","disabled",this.getDisabledSteps(d));this.getHtmlElement().tabs("option","active",d-1)};a.pkp.pages.reviewer.ReviewerTabHandler.prototype.getDisabledSteps=function(a){switch(a){case 1:return[1,2,3];case 2:return[2,3];case 3:return[3];case 4:return[]}throw Error("Illegal review step number.");}})(jQuery);(function(a){a.pkp.pages.authorDashboard=a.pkp.pages.authorDashboard||{};a.pkp.pages.authorDashboard.SubmissionEmailHandler=function(a,c){this.parent(a,c);a.find('a[id^="submissionEmail"]').click(this.callbackWrapper(this.activateAction))};a.pkp.classes.Helper.inherits(a.pkp.pages.authorDashboard.SubmissionEmailHandler,a.pkp.controllers.linkAction.LinkActionHandler)})(jQuery);(function(a){a.pkp.controllers.grid.articleGalleys=a.pkp.controllers.grid.articleGalleys||{};a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler=function(a,c){this.parent(a,c);a.bind("uploadFile",this.callbackWrapper(this.uploadFileHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler,a.pkp.controllers.grid.GridHandler);a.pkp.controllers.grid.articleGalleys.ArticleGalleyGridHandler.prototype.uploadFileHandler_=function(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(a,c){this.parent(a,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(a,c){this.parent(a,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(a){d.find("#loading").hide();!0===a.status?(a.content&&d.html(a.content),c&&c()):(d.trigger("ajaxHtmlError",a.content),alert(a.content))},error:function(){alert("Failed Ajax request or invalid JSON returned.")}});d.html("<div id='loading' class='throbber'></div>");
return this}})(jQuery);

AnonSec - 2021