");A.attr("label",k);n.append(A);k=null;var B=0;for(k in b.content[g][q])if(f=this.populatePulldown_(A,d,b.content[g][q][k],k))t++,B++;0===B&&A.remove()}}else(f=this.populatePulldown_(n,
d,b.content[g][q],q))&&t++;n=f;1===t&&n&&(n.attr("selected","selected"),this.availableOptions_=!1);0===t&&(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 f=b.parents(".gridCellContainer").find(".gridCellDisplay :input").val(),k=!1,g;if(e!=f)for(g=0;g");c.attr("value",e);c.text(d);e==f&&c.attr("selected",
"selected");b.append(c);return c};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.editItemHandler_=function(b,c){this.closeEdits();this.editItemCallingContext_=b;setTimeout(this.callbackWrapper(function(){var d=a(this.editItemCallingContext_).closest(".gridRow");d.addClass("gridRowEdit");d.find(":input").not('[type="hidden"]').first().focus();this.sourceType_==a.pkp.cons.LISTBUILDER_SOURCE_TYPE_SELECT&&(this.disableControls(),a.get(this.fetchOptionsUrl_,{},this.callbackWrapper(this.fetchOptionsResponseHandler_,
null),"json"))}),0);return!1};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.buildParamsFromInputs_=function(b){var c={};a.each(b.serializeArray(),function(d,e){d=e.name;e=e.value;c[d]=void 0===c[d]?e:a.isArray(c[d])?c[d].concat(e):[c[d],e]});return c};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.inputKeystrokeHandler_=function(b,c){if(13==c.which){var d=a(b);b=d.parents(".gridRow");c=b.find(":input:visible");d=c.index(d);c.length==d+1?this.saveRow(b):c[d+1].focus();return!1}return!0};
a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.inputBlurHandler_=function(b,c){a(b).closest(".gridRow").addClass("editingRowPlaceholder");setTimeout(this.callbackWrapper(function(){var d=a(".editingRowPlaceholder"),e=!1;d.find(":input").each(function(f,k){k===document.activeElement&&(e=!0)});d.removeClass("editingRowPlaceholder");e||this.closeEdits()}),0);return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveRowResponseHandler_=function(b,c){b=this.handleJson(c);!1!==
b&&(b=a(b.content),c=this.getHtmlElement().find(".saveRowResponsePlaceholder").attr("id"),this.getHtmlElement().find(".saveRowResponsePlaceholder").replaceWith(b),b.attr("id",c),this.attachContentHandlers_(b),this.callFeaturesHook("replaceElement",b));this.getHtmlElement().trigger("formChange");this.enableControls()};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.saveResponseHandler_=function(b,c){};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.attachContentHandlers_=function(b){b.find(".gridCellDisplay").click(this.callbackWrapper(this.editItemHandler_));
b.find(":input").keypress(this.callbackWrapper(this.inputKeystrokeHandler_)).blur(this.callbackWrapper(this.inputBlurHandler_));b.find(".pkp_linkaction_delete").click(this.callbackWrapper(this.deleteItemHandler_))};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.formSubmitHandler_=function(b,c){this.save();this.getHtmlElement().find(".gridRow :input").attr("disabled","disabled");return!0};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.formSubmittedHandler_=function(b,c){this.getHtmlElement().find(".gridRow :input").removeAttr("disabled")};
a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.disableControls=function(){this.getHtmlElement().find('span[class="options"] > a[id*="addItem"]').unbind("mousedown");this.getHtmlElement().find('span[class="options"] > a[id*="addItem"]').mousedown(function(){return!1});this.getHtmlElement().find(".h3").addClass("spinner")};a.pkp.controllers.listbuilder.ListbuilderHandler.prototype.enableControls=function(){this.getHtmlElement().find('span[class="options"] > a[id*="addItem"]').mousedown(this.callbackWrapper(this.addItemHandler_));
this.getHtmlElement().find(".h3").removeClass("spinner")}})(jQuery);(function(a){a.pkp.controllers.modal=a.pkp.controllers.modal||{};a.pkp.controllers.modal.ModalHandler=function(b,c){this.parent(b,c);if(!this.checkOptions(c))throw Error("Missing or invalid modal options!");c=a.extend(!0,{},c);this.options=this.mergeOptions(c);b.html(this.modalBuild()[0].outerHTML);this.modalOpen(b);b.find(".pkpModalCloseButton").click(this.callbackWrapper(this.modalClose));b.on("click keyup",this.callbackWrapper(this.handleWrapperEvents));this.publishEvent("redirectRequested");this.publishEvent("dataChanged");
this.publishEvent("updateHeader");this.publishEvent("gridRefreshRequested");this.bind("notifyUser",this.redirectNotifyUserEventHandler_);this.bindGlobal("form-success",this.onFormSuccess_)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.ModalHandler,a.pkp.classes.Handler);a.pkp.controllers.modal.ModalHandler.DEFAULT_OPTIONS_={autoOpen:!0,width:710,modal:!0,draggable:!1,resizable:!1,position:{my:"center",at:"center center-10%",of:window},canClose:!0,closeCallback:!1,closeCleanVueInstances:[]};
a.pkp.controllers.modal.ModalHandler.options=null;a.pkp.controllers.modal.ModalHandler.prototype.checkOptions=function(b){return"object"===typeof b&&void 0===b.buttons};a.pkp.controllers.modal.ModalHandler.prototype.mergeOptions=function(b){return a.extend(!0,{},this.self("DEFAULT_OPTIONS_"),b)};a.pkp.controllers.modal.ModalHandler.prototype.modalBuild=function(){var b=a('');if("undefined"!==typeof this.options.textTitle){var c=a('').text(this.options.textTitle);
b.append(c)}else"undefined"!==typeof this.options.title?b.append('"):b.append('');this.options.canClose&&b.append('\u00d7'+this.options.closeButtonText+"");b.append('');b.attr("role","dialog").attr("aria-label",this.options.title);return b};a.pkp.controllers.modal.ModalHandler.prototype.modalOpen=
function(b){a("body").append(b);setTimeout(function(){b.addClass("is_visible")},10);setTimeout(function(){b.focus()},300);b.trigger("pkpModalOpen",[b])};a.pkp.controllers.modal.ModalHandler.prototype.modalClose=function(b,c){var d=this,e=this.getHtmlElement();b=e.find("form").first();if(1==b.length&&(c={closePermitted:!0},b.trigger("containerClose",[c]),!c.closePermitted))return!1;e.removeClass("is_visible");this.trigger("pkpModalClose");setTimeout(function(){var f=d.options.closeCleanVueInstances,
k;if(f.length)for(k=0;k'+this.options.okButton+"";b.addClass("pkp_modal_confirmation").find(".content").append(''+
this.options.dialogText+"
");this.options.cancelButton&&(c+='");b.append('");b.attr("role","dialog").attr("aria-label",this.options.title);return b};a.pkp.controllers.modal.ConfirmationModalHandler.prototype.modalConfirm=function(b,c){this.modalClose(b);this.callback_&&this.callback_.call(null,this.callbackArgs_)}})(jQuery);(function(a){a.pkp.controllers.modal.RedirectConfirmationModalHandler=function(b,c){this.parent(b,c);this.remoteUrl_=c.remoteUrl};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.RedirectConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.remoteUrl_=null;a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.checkOptions=function(b){return this.parent("checkOptions",b)?"string"===typeof b.cancelButton&&
"string"===typeof b.remoteUrl:!1};a.pkp.controllers.modal.RedirectConfirmationModalHandler.prototype.modalConfirm=function(b,c){document.location=this.remoteUrl_}})(jQuery);(function(a){a.pkp.controllers.modal.RemoteActionConfirmationModalHandler=function(b,c){this.parent(b,c);this.remoteAction_=c.remoteAction;this.postData_=c.postData||{};this.postData_.csrfToken=c.csrfToken};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.RemoteActionConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteAction_=null;a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.postData_=
null;a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.checkOptions=function(b){return this.parent("checkOptions",b)?"string"===typeof b.cancelButton&&"string"===typeof b.remoteAction:!1};a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.modalConfirm=function(b,c){c.preventDefault();a.post(this.remoteAction_,this.postData_,this.callbackWrapper(this.remoteResponse),"json")};a.pkp.controllers.modal.RemoteActionConfirmationModalHandler.prototype.remoteResponse=
function(b,c){!1!==this.parent("remoteResponse",b,c)&&this.modalClose(b);return!1}})(jQuery);(function(a){a.pkp.controllers.modal.ButtonConfirmationModalHandler=function(b,c){this.parent(b,c)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.ButtonConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.ButtonConfirmationModalHandler.prototype.checkOptions=function(b){return this.parent("checkOptions",b)?"object"==typeof b.$button&&1==b.$button.length:!1};a.pkp.controllers.modal.ButtonConfirmationModalHandler.prototype.modalConfirm=function(b,
c){c=this.options.$button;this.modalClose(b);"submit"==c.attr("type")?c.trigger("submit"):c.click()}})(jQuery);(function(a){a.pkp.controllers.modal.JsEventConfirmationModalHandler=function(b,c){this.parent(b,c);this.jsEvent_=c.jsEvent;this.extraArguments_=c.extraArguments};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.JsEventConfirmationModalHandler,a.pkp.controllers.modal.ConfirmationModalHandler);a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.jsEvent_=null;a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.extraArguments_=null;a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.checkOptions=
function(b){return this.parent("checkOptions",b)?"string"===typeof b.cancelButton&&"string"===typeof b.jsEvent:!1};a.pkp.controllers.modal.JsEventConfirmationModalHandler.prototype.modalConfirm=function(b,c){this.trigger(this.jsEvent_,this.extraArguments_);this.modalClose(b)}})(jQuery);(function(a){a.pkp.controllers.modal.AjaxModalHandler=function(b,c){this.parent(b,c);this.bind("formSubmitted",this.formSubmitted);this.bind("formCanceled",this.modalClose);this.bind("ajaxHtmlError",this.modalClose);this.bind("modalFinished",this.modalClose)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.AjaxModalHandler,a.pkp.controllers.modal.ModalHandler);a.pkp.controllers.modal.AjaxModalHandler.prototype.checkOptions=function(b){return this.parent("checkOptions",b)?"string"===typeof b.url:
!1};a.pkp.controllers.modal.AjaxModalHandler.prototype.mergeOptions=function(b){return this.parent("mergeOptions",b)};a.pkp.controllers.modal.AjaxModalHandler.prototype.modalOpen=function(b){this.parent("modalOpen",b);b.find(".content").pkpAjaxHtml(this.options.url)};a.pkp.controllers.modal.AjaxModalHandler.prototype.formSubmitted=function(b,c){this.getHtmlElement().parent().trigger("notifyUser");this.modalClose()}})(jQuery);(function(a){a.pkp.controllers.modal.WizardModalHandler=function(b,c){this.parent(b,c);this.bind("wizardClose",this.wizardClose);this.bind("wizardCancel",this.wizardClose)};a.pkp.classes.Helper.inherits(a.pkp.controllers.modal.WizardModalHandler,a.pkp.controllers.modal.AjaxModalHandler);a.pkp.controllers.modal.WizardModalHandler.prototype.modalClose=function(b,c,d){d?this.parent("modalClose",b,c):(d=new a.Event("wizardCancelRequested"),d.stopPropagation(),this.getHtmlElement().children().first().trigger(d),
d.isDefaultPrevented()||this.parent("modalClose",b,c));return!1};a.pkp.controllers.modal.WizardModalHandler.prototype.wizardClose=function(b,c){this.modalClose(b,c,!0)}})(jQuery);(function(a){jQuery.pkp.controllers.linkAction=jQuery.pkp.controllers.linkAction||{};a.pkp.controllers.linkAction.LinkActionHandler=function(b,c){this.parent(b,c);this.staticId_=c.staticId?c.staticId:b.attr("id");if(!c.actionRequest||!c.actionRequestOptions)throw Error('The "actionRequest" and "actionRequestOptions"settings are required in a LinkActionHandler');c.actionRequestOptions.finishCallback=this.callbackWrapper(this.enableLink);this.linkActionRequest_=a.pkp.classes.Helper.objectFactory(c.actionRequest,
[b,c.actionRequestOptions]);this.bindActionRequest();this.publishEvent("dataChanged");this.bind("dataChanged",this.dataChangedHandler_);this.bind("pkpModalClose",this.removeDisabledAttribute_);c.selfActivate&&this.trigger("click")};a.pkp.classes.Helper.inherits(a.pkp.controllers.linkAction.LinkActionHandler,a.pkp.classes.Handler);a.pkp.controllers.linkAction.LinkActionHandler.prototype.linkActionRequest_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.staticId_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.getStaticId=
function(){return this.staticId_};a.pkp.controllers.linkAction.LinkActionHandler.prototype.getUrl=function(){return this.linkActionRequest_.getUrl()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.activateAction=function(b,c){this.linkActionRequest_.shouldDebounce()&&this.disableLink();return this.linkActionRequest_.activate.call(this.linkActionRequest_,b,c)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.bindActionRequest=function(){this.bind("click",this.activateAction)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.enableLink=
function(){var b=a(this.getHtmlElement());this.getHtmlElement().is(":submit")||this.removeDisabledAttribute_();var c=this.getUrl();this.getHtmlElement().is("a")&&c&&b.attr("href",c);this.unbind("click",this.noAction_);this.bindActionRequest()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.disableLink=function(){var b=a(this.getHtmlElement());b.attr("disabled","disabled");this.getHtmlElement().is("a")&&b.attr("href","#");this.unbind("click",this.activateAction);this.bind("click",this.noAction_)};
a.pkp.controllers.linkAction.LinkActionHandler.prototype.removeDisabledAttribute_=function(){a(this.getHtmlElement()).removeAttr("disabled")};a.pkp.controllers.linkAction.LinkActionHandler.prototype.dataChangedHandler_=function(b,c,d){0===this.getHtmlElement().parents(".pkp_controllers_grid").length&&this.trigger("redirectDataChangedToGrid",[d]);this.trigger("notifyUser")};a.pkp.controllers.linkAction.LinkActionHandler.prototype.noAction_=function(){return!1}})(jQuery);(function(a){a.pkp.controllers.wizard=a.pkp.controllers.wizard||{};a.pkp.controllers.wizard.WizardHandler=function(b,c){this.parent(b,c);this.addWizardButtons_(b,c);this.enforceLinear_=c.hasOwnProperty("enforceLinear")?c.enforceLinear:!0;this.startWizard();this.bindWizardEvents();this.bind("formValid",this.formValid);this.bind("formInvalid",this.formInvalid);this.bind("formSubmitted",this.formSubmitted)};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.WizardHandler,a.pkp.controllers.TabHandler);
a.pkp.controllers.wizard.WizardHandler.prototype.$continueButton_=null;a.pkp.controllers.wizard.WizardHandler.prototype.$progressIndicator_=null;a.pkp.controllers.wizard.WizardHandler.prototype.continueButtonText_=null;a.pkp.controllers.wizard.WizardHandler.prototype.finishButtonText_=null;a.pkp.controllers.wizard.WizardHandler.prototype.enforceLinear_=null;a.pkp.controllers.wizard.WizardHandler.prototype.showProgressIndicator_=function(){this.getProgressIndicator().css("opacity",1)};a.pkp.controllers.wizard.WizardHandler.prototype.hideProgressIndicator_=
function(){this.getProgressIndicator().css("opacity",0)};a.pkp.controllers.wizard.WizardHandler.prototype.continueRequest=function(b,c){b=new a.Event("wizardAdvanceRequested");this.getCurrentTab().children().first().trigger(b);b.isDefaultPrevented()||this.advanceOrClose_();return!1};a.pkp.controllers.wizard.WizardHandler.prototype.formValid=function(b,c){this.enableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.formInvalid=function(b,c){this.disableContinueButton()};a.pkp.controllers.wizard.WizardHandler.prototype.formSubmitted=
function(b,c){this.advanceOrClose_()};a.pkp.controllers.wizard.WizardHandler.prototype.cancelRequest=function(b,c){this.checkForm_(!1);b=new a.Event("wizardCancelRequested");this.getCurrentTab().children().first().trigger(b);b.isDefaultPrevented()||this.trigger("wizardCancel");return!1};a.pkp.controllers.wizard.WizardHandler.prototype.wizardCancelRequested=function(b,c){return this.checkForm_(!0)?!1:!0};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvanceRequested=function(b,c){if(b=this.getForm_())b.submit()&&
(this.disableContinueButton(),this.showProgressIndicator_()),c.preventDefault()};a.pkp.controllers.wizard.WizardHandler.prototype.wizardAdvance=function(b,c){var d=this.getCurrentStep();b=this.getNumberOfSteps()-1;c=d+1;if(c>b)throw Error("Trying to set an invalid wizard step!");var e=this.getHtmlElement();e.tabs("enable",c);e.tabs("option","active",c);this.enforceLinear_&&e.tabs("disable",d);d=this.getContinueButton();c===b&&d.text(this.getFinishButtonText());this.hideProgressIndicator_();this.enableContinueButton()};
a.pkp.controllers.wizard.WizardHandler.prototype.startWizard=function(){var b=this.getHtmlElement(),c;if(0!==this.getCurrentStep()){b.tabs("enable",0);b.tabs("option","active",0);var d=this.getContinueButton();d.text(this.getContinueButtonText())}if(this.enforceLinear_){d=[];for(c=1;c');if(c.continueButtonText){var e=a('').text(c.continueButtonText);d.append(e);var f=a('');d.append(f);e.bind("click",this.callbackWrapper(this.continueRequest));this.$continueButton_=e;this.$progressIndicator_=f;this.continueButtonText_=c.continueButtonText;this.finishButtonText_=c.finishButtonText?c.finishButtonText:c.continueButtonText}c.cancelButtonText&&
(c=a('').text(c.cancelButtonText),d.append(c),c.bind("click",this.callbackWrapper(this.cancelRequest)));b.after(d)};a.pkp.controllers.wizard.WizardHandler.prototype.disableContinueButton=function(){this.getContinueButton().attr("disabled","disabled")};a.pkp.controllers.wizard.WizardHandler.prototype.enableContinueButton=function(){this.getContinueButton().removeAttr("disabled")}})(jQuery);(function(a){a.pkp.controllers.grid.queries=a.pkp.controllers.grid.queries||{};a.pkp.controllers.grid.queries.ReadQueryHandler=function(b,c){this.fetchNoteFormUrl_=c.fetchNoteFormUrl;this.fetchParticipantsListUrl_=c.fetchParticipantsListUrl;b.find(".openNoteForm a").click(this.callbackWrapper(this.showNoteFormHandler_));b.bind("dataChanged",this.callbackWrapper(this.reloadParticipantsList_));b.bind("user-left-discussion",function(){b.parent().trigger("modalFinished")});this.loadParticipantsList()};
a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.queries.ReadQueryHandler,a.pkp.classes.Handler);a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.fetchNoteFormUrl_=null;a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.fetchParticipantsListUrl_=null;a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.loadParticipantsList=function(){a.get(this.fetchParticipantsListUrl_,this.callbackWrapper(this.showFetchedParticipantsList_),"json")};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showNoteFormHandler_=
function(b){a(b).parents(".queryEditButtons").addClass("is_loading");a.get(this.fetchNoteFormUrl_,this.callbackWrapper(this.showFetchedNoteForm_),"json")};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showFetchedNoteForm_=function(b,c){b=this.handleJson(c);c=a("#newNotePlaceholder",this.getHtmlElement());var d=a(".queryEditButtons.is_loading",this.getHtmlElement());this.unbindPartial(d);d.remove();this.unbindPartial(c);c.html(b.content)};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.showFetchedParticipantsList_=
function(b,c){b=this.handleJson(c);c=a("#participantsListPlaceholder",this.getHtmlElement());var d=a(".leaveQueryForm",this.getHtmlElement());b.showLeaveQueryButton?d.show():d.hide();this.unbindPartial(c);c.children().remove();c.append(b.content)};a.pkp.controllers.grid.queries.ReadQueryHandler.prototype.reloadParticipantsList_=function(b,c,d){this.loadParticipantsList()}})(jQuery);(function(a){a.pkp.controllers.grid.queries=a.pkp.controllers.grid.queries||{};a.pkp.controllers.grid.queries.QueryFormHandler=function(b,c){this.parent(b,c);c.templateUrl&&(this.templateUrl_=c.templateUrl);b.find("#template").change(this.callbackWrapper(this.selectTemplateHandler_))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.queries.QueryFormHandler,a.pkp.controllers.form.CancelActionAjaxFormHandler);a.pkp.controllers.grid.queries.QueryFormHandler.prototype.templateUrl_=null;a.pkp.controllers.grid.queries.QueryFormHandler.prototype.selectTemplateHandler_=
function(b,c){b=this.getHtmlElement().find('[name="template"]');a.post(this.templateUrl_,b.serialize(),this.callbackWrapper(this.updateTemplate),"json")};a.pkp.controllers.grid.queries.QueryFormHandler.prototype.updateTemplate=function(b,c){b=this.getHtmlElement();var d=this.handleJson(c);c=c.content;var e=b.find('textarea[name="comment"]'),f=tinyMCE.EditorManager.get(e.attr("id"));c.variables&&e.attr("data-variables",JSON.stringify(c.variables));f.setContent(c.body);b.find('[name="subject"]').val(c.subject);
return d.status}})(jQuery);(function(a){a.pkp.controllers.wizard.fileUpload=a.pkp.controllers.wizard.fileUpload||{};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler=function(b,c){this.parent(b,c);this.csrfToken_=c.csrfToken;this.deleteUrl_=c.deleteUrl;this.metadataUrl_=c.metadataUrl;this.finishUrl_=c.finishUrl;this.cancelUrl_=c.cancelUrl;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.cancelUrl_="";a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.uploadedFile_=
null;a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.originalFile_=null;a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsBeforeActivate=function(b,c,d){if(0c)throw Error("Trying to set an invalid wizard step!");e.tabs("enable",d);e.tabs("option","active",d);0===b&&e.tabs("disable",b);d===c&&(b=this.getContinueButton(),b.text(this.getFinishButtonText()),this.enableContinueButton())};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.tabsLoad=
function(b,c,d){var e=this.getHtmlElement(),f=this.getProgressIndicator();2===d.tab.index()&&(e=a("#newFile",e),e.length&&e.bind("click",this.callbackWrapper(this.startWizard)));f.hide();return this.parent("tabsLoad",b,c,d)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.formValid=function(b,c){(0!==this.getCurrentStep()||0!==this.getHtmlElement().find("#uploadConfirmationForm").length||this.uploadedFile_)&&this.parent("formValid",b,c)};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelRequested=
function(b,c){if(this.parent("wizardCancelRequested",b,c))if(this.uploadedFile_)this.uploadedFile_.csrfToken=this.csrfToken_,this.uploadedFile_.submissionFileId=this.uploadedFile_.id,this.uploadedFile_.originalFile=this.originalFile_,a.post(this.cancelUrl_,this.uploadedFile_,a.pkp.classes.Helper.curry(this.wizardCancelSuccess,this,b,c),"json"),this.uploadedFile_=null,c.preventDefault();else return!0;return!1};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.wizardCancelSuccess=
function(b,c,d){!1!==this.handleJson(d)&&this.trigger("wizardCancel")};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleFileUploaded=function(b,c,d){null===this.originalFile_&&(this.originalFile_=d.originalFile);delete d.originalFile;this.uploadedFile_=d};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.handleRemovedFiles=function(b,c,d,e){var f;if("undefined"!==typeof e&&e.length)for(f in e){if("undefined"===typeof e[f].storedData)break;e[f].storedData.csrfToken=
this.csrfToken_;a.post(this.deleteUrl_,e[f].storedData)}};a.pkp.controllers.wizard.fileUpload.FileUploadWizardHandler.prototype.startWizard=function(){this.uploadedFile_=this.originalFile_=null;this.parent("startWizard")}})(jQuery);(function(a){a.pkp.controllers.wizard.fileUpload.form=a.pkp.controllers.wizard.fileUpload.form||{};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler=function(b,c){this.parent(b,c);this.hasFileSelector_=c.hasFileSelector;this.hasGenreSelector_=c.hasGenreSelector;c.presetRevisedFileId&&(this.presetRevisedFileId_=c.presetRevisedFileId);this.fileGenres_=c.fileGenres;this.$uploader_=c.$uploader;this.attachUploader_(this.$uploader_,c.uploaderOptions);this.uploaderSetup(c.$uploader);this.$revisedFileSelector_=
b.find("#revisedFileId").change(this.callbackWrapper(this.revisedFileChange));this.hasGenreSelector_&&(this.$genreSelector=b.find("#genreId").change(this.callbackWrapper(this.genreChange)));this.setUploaderVisibility_()};a.pkp.classes.Helper.inherits(a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.hasFileSelector_=!1;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$revisedFileSelector_=
null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.hasGenreSelector_=!1;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$genreSelector_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.presetRevisedFileId_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.fileGenres_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.$uploader_=null;a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.uploaderSetup=
function(b){b=a.pkp.classes.Handler.getHandler(b);b.pluploader.bind("BeforeUpload",this.callbackWrapper(this.prepareFileUploadRequest));b.pluploader.bind("FileUploaded",this.callbackWrapper(this.handleUploadResponse));b.pluploader.bind("FilesRemoved",this.callbackWrapper(this.handleRemovedFiles))};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.prepareFileUploadRequest=function(b,c){this.getHtmlElement();b={};this.hasFileSelector_?(this.$revisedFileSelector_.attr("disabled",
"disabled"),b.revisedFileId=this.$revisedFileSelector_.val()):b.revisedFileId=null!==this.presetRevisedFileId_?this.presetRevisedFileId_:0;this.hasGenreSelector_?(this.$genreSelector.attr("disabled","disabled"),b.genreId=this.$genreSelector.val()):b.genreId="";c.settings.multipart_params=b};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleUploadResponse=function(b,c,d,e){b=this.handleJson(a.parseJSON(e.response));this.getHtmlElement();!1!==b&&(this.trigger("fileUploaded",
b.uploadedFile),""!==b.content&&this.replaceWith(b.content));this.getHtmlElement().valid()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.handleRemovedFiles=function(b,c,d){this.trigger("filesRemoved",[c,d])};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.submitForm=function(b,c){this.trigger("formSubmitted")};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.revisedFileChange=function(b,c){this.$revisedFileSelector_.val()?
(this.$genreSelector.val(this.fileGenres_[this.$revisedFileSelector_.val()]),this.$genreSelector.attr("disabled","disabled")):this.$genreSelector.removeAttr("disabled");this.setUploaderVisibility_();return!1};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.genreChange=function(b,c){this.setUploaderVisibility_()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.attachUploader_=function(b,c){b.pkpHandler("$.pkp.controllers.UploaderHandler",c)};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.setUploaderVisibility_=
function(){this.hasGenreSelector_&&this.$genreSelector.val()||this.$revisedFileSelector_.val()?this.showUploader_():this.hasGenreSelector_||this.hasFileSelector_?this.hideUploader_():this.showUploader_()};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.hideUploader_=function(){this.$uploader_.addClass("pkp_screen_reader")};a.pkp.controllers.wizard.fileUpload.form.FileUploadFormHandler.prototype.showUploader_=function(){this.$uploader_.removeClass("pkp_screen_reader");a.pkp.classes.Handler.getHandler(this.$uploader_).pluploader.refresh()}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus=a.pkp.controllers.grid.navigationMenus||{form:{}};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler=function(b,c){this.okButton_=c.okButton;this.warningModalTitle_=c.warningModalTitle;this.submenuWarning_=c.submenuWarning;this.itemTypeConditionalWarnings_=c.itemTypeConditionalWarnings;b.on("click",".btnConditionalDisplay",this.callbackWrapper(this.showConditionalDisplayWarning));b.on("click",".btnSubmenuWarning",this.callbackWrapper(this.showSubmenuWarning));
this.parent(b,c);this.initSorting()};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.okButton_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.warningModalTitle_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.submenuWarning_=void 0;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.itemTypeConditionalWarnings_=
null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.initSorting=function(){var b=this;a(".btnSubmenuWarning",this.getHtmlElement()).remove();a("#pkpNavAssigned > li").each(function(){var c=a(this).children("ul"),d=c.children(),e=d.find("li");c.length?d.length?(e.length&&e.each(function(){a(this).appendTo(c)}),a(this).find("> .item > .item_buttons .btnSubmenuWarning").length||a(this).find("> .item > .item_buttons").prepend(a("").addClass("btnSubmenuWarning").append(a("").addClass("fa fa-exclamation-triangle")).append(a("").addClass("-screenReader").text(b.submenuWarning_)))):
c.replaceWith(""):a(this).append("")});a("#pkpNavUnassigned > li").each(function(){var c=a(this).children("ul");c.length&&c.find("li").each(function(){a(this).appendTo(a("#pkpNavUnassigned"))});c.remove()});a("#pkpNavManagement ul").sortable({placeholder:"pkp_nav_item_placeholder",delay:250,connectWith:"#pkpNavManagement ul",update:this.callbackWrapper(this.updateSorting),start:function(){a("#pkpNavAssigned").addClass("pkp_is_sorting")},stop:function(){a("#pkpNavAssigned").removeClass("pkp_is_sorting")}})};
a.pkp.controllers.grid.navigationMenus.form.NavigationMenuFormHandler.prototype.updateSorting=function(){var b=a("#pkpNavManagement"),c=0,d="";this.initSorting();a("input",b).remove();a("#pkpNavAssigned > li").each(function(){d="menuTree["+a(this).data("id")+"]";b.append('');c++;var e=a(this).data("id");a(this).find("li").each(function(){d="menuTree["+a(this).data("id")+"]";b.append('');b.append('');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('').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('').pkpHandler("$.pkp.controllers.modal.ConfirmationModalHandler",b);return!1}})(jQuery);(function(a){a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler=function(b,c){this.parent(b,c);this.previewUrl_=c.previewUrl;this.itemTypeDescriptions_=c.itemTypeDescriptions;this.itemTypeConditionalWarnings_=c.itemTypeConditionalWarnings;a("#previewButton",b).click(this.callbackWrapper(this.showPreview_));a("#menuItemType",b).change(this.callbackWrapper(this.setType));a("#menuItemType",b).trigger("change")};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler,
a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.previewUrl_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.itemTypeDescriptions_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.itemTypeConditionalWarnings_=null;a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.showPreview_=function(b,c){b=this.getHtmlElement();
a.post(this.previewUrl_,b.serialize(),function(d){var e=window.open("about:blank");e.document.open();e.document.write(d);e.document.close()});return!0};a.pkp.controllers.grid.navigationMenus.form.NavigationMenuItemsFormHandler.prototype.setType=function(){var b=a("#menuItemType",this.getHtmlElement()).val(),c=a('#menuItemTypeSection [for="menuItemType"]');a(".NMI_TYPE_CUSTOM_EDIT",this.getHtmlElement()).hide();a("#"+b).fadeIn();"undefined"!==typeof this.itemTypeDescriptions_[b]&&c.text(this.itemTypeDescriptions_[b])}})(jQuery);(function(a){a.pkp.controllers.grid.representations=a.pkp.controllers.grid.representations||{form:{}};a.pkp.controllers.grid.representations.form.RepresentationFormHandler=function(b,c){this.parent(b,c);(this.remoteRepresentation_=c.remoteRepresentation)?(a("#remotelyHostedContent").prop("checked",!0),a("#remote").show(20),a("#urlPathSection").hide()):(a("#remotelyHostedContent").prop("checked",!1),a("#remote").hide(),a("#urlPathSection").show(20));a("#remotelyHostedContent").change(this.callbackWrapper(this.toggleRemote_))};
a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.representations.form.RepresentationFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.representations.form.RepresentationFormHandler.prototype.toggleRemote_=function(b,c){a("#remotelyHostedContent").prop("checked")?(a("#remote").show(20),a("#urlPathSection").hide(),a('input[id^="urlPath"]').val("")):(a("#remote").hide(20),a('input[id^="urlRemote"]').val(""),a("#urlPathSection").show(20));return!0}})(jQuery);(function(a){a.pkp.controllers.grid.settings=a.pkp.controllers.grid.settings||{user:{form:{}}};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler=function(b,c){this.parent(b,c);a('[id^="generatePassword"]',b).click(this.callbackWrapper(this.setGenerateRandom));a('[id^="generatePassword"]',b).attr("checked")&&this.setGenerateRandom('[id^="generatePassword"]')};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler,a.pkp.controllers.form.UserFormHandler);
a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler.prototype.submitForm=function(b,c){var d=this.getHtmlElement();a(":password",d).removeAttr("disabled");this.parent("submitForm",b,c)};a.pkp.controllers.grid.settings.user.form.UserDetailsFormHandler.prototype.setGenerateRandom=function(b){var c=a(b);b=this.getHtmlElement();if(c.prop("checked")){c="********";var d="disabled"}else d=c="";a(":password",b).prop("disabled",d).val(c);a('[id^="sendNotify"]',b).attr("disabled",d).prop("checked",
d)}})(jQuery);(function(a){a.pkp.controllers.grid.settings.roles=a.pkp.controllers.grid.settings.roles||{form:{}};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler=function(b,c){var d=a('[id^="roleId"]',b);this.parent(b,c);c.selfRegistrationRoleIds&&(this.selfRegistrationRoleIds_=c.selfRegistrationRoleIds);c.recommendOnlyRoleIds&&(this.recommendOnlyRoleIds_=c.recommendOnlyRoleIds);c.notChangeMetadataEditPermissionRoles&&(this.notChangeMetadataEditPermissionRoles_=c.notChangeMetadataEditPermissionRoles);
this.roleForbiddenStages_=c.roleForbiddenStagesJSON.content;this.stagesSelector_=c.stagesSelector;this.updatePermitSelfRegistration(d.val());this.updatePermitMetadataEdit(d.val(),!1);this.updateStageOptions(d.val());this.updateRecommendOnly(d.val());d.change(this.callbackWrapper(this.changeRoleId))};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler,a.pkp.controllers.form.AjaxFormHandler);a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.selfRegistrationRoleIds_=
null;a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.roleForbiddenStages_=null;a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.stagesSelector_=null;a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.notChangeMetadataEditPermissionRoles_=null;a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.changeRoleId=function(b){b=a(b).val();this.updatePermitSelfRegistration(b);this.updatePermitMetadataEdit(b,!0);
this.updateStageOptions(b);this.updateRecommendOnly(b)};a.pkp.controllers.grid.settings.roles.form.UserGroupFormHandler.prototype.updatePermitSelfRegistration=function(b){var c=a('[id^="permitSelfRegistration"]');this.getHtmlElement();var d,e=!1;for(d=0;dthis.anonymousReviewerIds_.indexOf(b)||(b={title:"",okButton:this.anonymousReviewerWarningOk_,cancelButton:!1,dialogText:this.anonymousReviewerWarning_},a('').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 f=!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");
return this}})(jQuery);