[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
14082024
/
Data
/
htdocs
/
htdocs
/
ojs
/
248
/
js
/
[
Home
]
File: pkp.min.js
(function(a){a.widget("ui.tagit",{options:{itemName:"item",fieldName:"tags",availableTags:[],tagSource:null,removeConfirmation:!1,caseSensitive:!0,allowSpaces:!1,animate:!0,singleField:!1,singleFieldDelimiter:",",singleFieldNode:null,tabIndex:null,onTagAdded:null,onTagRemoved:null,onTagClicked:null},_create:function(){var c=this;this.element.is("input")?(this.tagList=a("<ul></ul>").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.css("display", "none")):this.tagList=this.element.find("ul, ol").andSelf().last();this._tagInput=a('<input type="text" />').addClass("ui-widget-content");this.options.tabIndex&&this._tagInput.attr("tabindex",this.options.tabIndex);this.options.tagSource=this.options.tagSource||function(c,b){var d=c.term.toLowerCase(),h=a.grep(this.options.availableTags,function(a){return 0===a.toLowerCase().indexOf(d)});b(this._subtractArray(h,this.assignedTags()))};a.isFunction(this.options.tagSource)&&(this.options.tagSource= a.proxy(this.options.tagSource,this));this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(a('<li class="tagit-new"></li>').append(this._tagInput)).click(function(b){var d=a(b.target);d.hasClass("tagit-label")?c._trigger("onTagClicked",b,d.closest(".tagit-choice")):c._tagInput.focus()});this.tagList.children("li").each(function(){a(this).hasClass("tagit-new")||(c.createTag(a(this).html(),a(this).attr("class"),!0),a(this).remove())});if(this.options.singleField)if(this.options.singleFieldNode){var b= a(this.options.singleFieldNode),d=b.val().split(this.options.singleFieldDelimiter);b.val("");a.each(d,function(a,b){c.createTag(b,null,!1)})}else this.options.singleFieldNode=this.tagList.after('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />');this._tagInput.keydown(function(b){if(b.which==a.ui.keyCode.BACKSPACE&&""===c._tagInput.val()){var d=c._lastTag();!c.options.removeConfirmation||d.hasClass("remove")?c.removeTag(d):c.options.removeConfirmation&&d.addClass("remove ui-state-highlight")}else c.options.removeConfirmation&& c._lastTag().removeClass("remove ui-state-highlight");if(b.which==a.ui.keyCode.COMMA||b.which==a.ui.keyCode.ENTER||b.which==a.ui.keyCode.TAB&&""!==c._tagInput.val()||b.which==a.ui.keyCode.SPACE&&!0!==c.options.allowSpaces&&('"'!=a.trim(c._tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==a.trim(c._tagInput.val()).charAt(0)&&'"'==a.trim(c._tagInput.val()).charAt(a.trim(c._tagInput.val()).length-1)&&0!==a.trim(c._tagInput.val()).length-1))b.preventDefault(),c.createTag(c._cleanedInput(),null,!1),c._tagInput.autocomplete("close")}).blur(function(){c.createTag(c._cleanedInput(), null,!1)});this._autocompleteVal=null;this._selectAction=function(){if(c._tagInput.val()==c._autocompleteVal)return c.createTag(c._autocompleteVal,null,!0),c.tagList.children(".tagit-new").children("input").val(""),!1};(this.options.availableTags||this.options.tagSource)&&this._tagInput.autocomplete({source:this.options.tagSource,close:this._selectAction,select:this._selectAction,minLength:2,autoFocus:!0,focus:function(b,d){c._autocompleteVal=d.item.value;a(this).val(c._unescapeHTML(d.item.value)); return!1}})},_cleanedInput:function(){return a.trim(this._tagInput.val().replace(/^"(.*)"$/,"$1"))},_lastTag:function(){return this.tagList.children(".tagit-choice:last")},assignedTags:function(){var c=this,b=[];this.options.singleField?(b=a(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter),""===b[0]&&(b=[])):this.tagList.children(".tagit-choice").each(function(){b.push(c.tagLabel(this))});return b},_updateSingleTagsField:function(c){a(this.options.singleFieldNode).val(c.join(this.options.singleFieldDelimiter))}, _subtractArray:function(c,b){for(var d=[],e=0;e<c.length;e++)-1==a.inArray(c[e],b)&&d.push(c[e]);return d},tagLabel:function(c){return this.options.singleField?a(c).children(".tagit-label").text():a(c).children("input").val()},_isNew:function(a){var b=this,d=!0;this.tagList.children(".tagit-choice").each(function(){if(b._formatStr(urlEncode(a))==b._formatStr(b.tagLabel(this)))return d=!1});return d},_formatStr:function(c){return this.options.caseSensitive?c:a.trim(c.toLowerCase())},_unescapeHTML:function(c){return a("<div/>").html(c).text()}, createTag:function(c,b,d){d&&(c=this._unescapeHTML(c));var e=this,c=a.trim(c);if(!this._isNew(c)||""===c)return!1;var d=a(this.options.onTagClicked?'<a class="tagit-label"></a>':'<span class="tagit-label"></span>').text(c),f=a("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(b).append(d),b=a("<span></span>").addClass("ui-icon ui-icon-close"),b=a('<a><span class="text-icon">\u00d7</span></a>').addClass("tagit-close").append(b).click(function(){e.removeTag(f)}); f.append(b);this.options.singleField?(b=this.assignedTags(),b.push(c),this._updateSingleTagsField(b)):(c=urlEncode(c),f.append('<input type="hidden" style="display:none;" value="'+c+'" name="'+this.options.itemName+"["+this.options.fieldName+'][]" />'));this._trigger("onTagAdded",null,f);this._tagInput.val("");this._tagInput.parent().before(f)},removeTag:function(c,b){b=b||this.options.animate;c=a(c);this._trigger("onTagRemoved",null,c);if(this.options.singleField){var d=this.assignedTags(),e=this.tagLabel(c), d=a.grep(d,function(a){return a!=e});this._updateSingleTagsField(d)}b?c.fadeOut("fast").hide("blind",{direction:"horizontal"},"fast",function(){c.remove()}).dequeue():c.remove()},removeAll:function(){var a=this;this.tagList.children(".tagit-choice").each(function(b,d){a.removeTag(d,!1)})}})})(jQuery);jQuery.cookie=function(a,c,b){if("undefined"!=typeof c){b=b||{};null===c&&(c="",b.expires=-1);var d="";if(b.expires&&("number"==typeof b.expires||b.expires.toUTCString))"number"==typeof b.expires?(d=new Date,d.setTime(d.getTime()+864E5*b.expires)):d=b.expires,d="; expires="+d.toUTCString();var e=b.path?"; path="+b.path:"",f=b.domain?"; domain="+b.domain:"",b=b.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(c),d,e,f,b].join("")}else{c=null;if(document.cookie&&""!=document.cookie){b= document.cookie.split(";");for(d=0;d<b.length;d++)if(e=jQuery.trim(b[d]),e.substring(0,a.length+1)==a+"="){c=decodeURIComponent(e.substring(a.length+1));break}}return c}};function fontSize(a,c,b,d,e,f){function g(a,c){void 0!=$.cookie&&$.cookie("font-size",a,{path:c})}$(a).html("<a href='javascript:void(0);' class='pkp_controllers_fontController_smallFont' title='Make font size smaller'>Make font size smaller</a> <a href='javascript:void(0);' class='pkp_controllers_fontController_defaultFont' title='Make font size default'>Make font size default</a> <a href='javascript:void(0);' class='pkp_controllers_fontController_largeFont' title='Make font size larger'>Make font size larger</a> "); if(void 0!=$.cookie){var h=$.cookie("font-size");null!=h&&$(c).css("font-size",parseInt(h,10))}$(a+" .pkp_controllers_fontController_smallFont").click(function(){var d=parseInt($(c).css("font-size"),10)-1;d>=b&&$(c).css("font-size",d);d<=b&&$(a+" .pkp_controllers_fontController_smallFont").addClass("pkp_controllers_fontController_sdisabled");d<e&&$(a+" .pkp_controllers_fontController_largeFont").removeClass("pkp_controllers_fontController_ldisabled");g(d,f)});$(a+" .pkp_controllers_fontController_defaultFont").click(function(){$(c).css("font-size", d);$(a+" .pkp_controllers_fontController_smallFont").removeClass("pkp_controllers_fontController_sdisabled");$(a+" .pkp_controllers_fontController_largeFont").removeClass("pkp_controllers_fontController_ldisabled");g(d,f)});$(a+" .pkp_controllers_fontController_largeFont").click(function(){var d=parseInt($(c).css("font-size"),10)+1;d<=e&&$(c).css("font-size",d);d>b&&$(a+" .pkp_controllers_fontController_smallFont").removeClass("pkp_controllers_fontController_sdisabled");d>=e&&$(a+" .pkp_controllers_fontController_largeFont").addClass("pkp_controllers_fontController_ldisabled"); g(d,f)})};function confirmAction(a,c){return confirm(c)?(a&&(document.location.href=a),!0):!1}function openHelp(a){window.open(a,"Help","width=700,height=600,screenX=100,screenY=100,toolbar=0,scrollbars=1")}function openComments(a){window.open(a,"Comments","width=700,height=600,screenX=100,screenY=100,toolbar=0,resizable=1,scrollbars=1")}function openWindow(a){window.open(a,"Window","width=600,height=550,screenX=100,screenY=100,toolbar=0,resizable=1,scrollbars=1")} function openRTWindow(a){window.open(a,"RT","width=700,height=500,screenX=100,screenY=100,toolbar=0,resizable=1,scrollbars=1")}function openRTWindowWithToolbar(a){window.open(a,"RT","width=700,height=500,screenX=100,screenY=100,toolbar=1,resizable=1,scrollbars=1")}function getBrowserObject(a,c){var b=0,d;document.getElementById?d=document.getElementById(a):document.all?d=document.all[a]:document.layers&&(d=document.layers[a],b=1);c&&!b&&(d=d.style);return d} function loadUrl(a){document.location.href=a}function createCookie(a,c,b){if(b){var d=new Date;d.setTime(d.getTime()+864E5*b);b="; expires="+d.toGMTString()}else b="";document.cookie=a+"="+c+b+"; path=/"}function readCookie(a){for(var a=a+"=",c=document.cookie.split(";"),b=0;b<c.length;b++){for(var d=c[b];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null} function makeAsyncRequest(){return window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")}function sendAsyncRequest(a,c,b,d){a.open(d,c,!0);a.setRequestHeader("Content-Type","text/html; Charset=utf-8");a.send(b)}function changeFormAction(a,c){document.getElementById(a).action=c;document.getElementById(a).submit()} function urlEncode(a){return encodeURIComponent(a).replace(/\%20/g,"+").replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/\~/g,"%7E")}function escapeHTML(a){return $("<div/>").text(a).html()}function unescapeHTML(a){return $("<div/>").html(a).text()};function jqueryValidatorI18n(a,c){var b;b=a+"/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_";switch(c){case "fr_FR":case "ca_FR":eval($.getScript(b+"fr.js"));break;case "pt_BR":eval($.getScript(b+"ptbr.js"));break;case "pt_PT":eval($.getScript(b+"ptpt.js"));break;case "es_AR":case "es_ES":eval($.getScript(b+"es.js"))}};(function(a){a.pkp=a.pkp||{};a.pkp.classes=a.pkp.classes||{};a.pkp.controllers=a.pkp.controllers||{};a.pkp.controllers.form=a.pkp.controllers.form||{};a.pkp.plugins=a.pkp.plugins||{};a.pkp.plugins.blocks=a.pkp.plugins.blocks||{};a.pkp.plugins.generic=a.pkp.plugins.generic||{};a.pkp.classes.Helper=function(){throw Error("Trying to instantiate the Helper singleton!");};a.pkp.classes.Helper.CHARS_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");a.pkp.classes.Helper.uuid=function(){var c= a.pkp.classes.Helper.CHARS_,b=Array(36),d=0,e,f;for(f=0;36>f;f++)8==f||13==f||18==f||23==f?b[f]="-":14==f?b[f]="4":(2>=d&&(d=33554432+16777216*Math.random()|0),e=d&15,d>>=4,b[f]=c[19==f?e&3|8:e]);return b.join("")};a.pkp.classes.Helper.inherits=function(a,b){var d=function(){return this};d.prototype=b.prototype;a.parent_=b.prototype;a.prototype=new d;a.prototype.constructor=a;b.prototype.constructor==Object.prototype.constructor&&(b.prototype.constructor=b)};a.pkp.classes.Helper.objectFactory=function(c, b){var d,e;d=a.pkp.classes.Helper.resolveObjectName(c);e=a.pkp.classes.Helper.getObjectProxyInstance();a.extend(!0,e,a.pkp.classes.ObjectProxy);a.pkp.classes.Helper.inherits(e,d);a.extend(!0,e.prototype,a.pkp.classes.ObjectProxy.prototype);return new e(c,b)};a.pkp.classes.Helper.resolveObjectName=function(c){var b,d,e;b=c.split(".");if("$"!=b.shift())throw Error(['Namespace "',b[0],'" for object"',c,'" is currently not supported!'].join(""));e=b[b.length-1];if(e.charAt(0).toUpperCase()!==e.charAt(0))throw Error(['The name "', c,'" does not point to aconstructor which must always be upper case!'].join(""));e=a;for(d in b)if(e=e[b[d]],void 0===e)throw Error(['Constructor for object "',c,'" not found!'].join(""));if(!a.isFunction(e))throw Error(['The name "',c,'" does not point to a,constructor which must always be a function!'].join());return e};a.pkp.classes.Helper.getObjectProxyInstance=function(){var a=function(a,c){this.objectName_=a;this.parent.apply(this,c)};a.objectName_="";a.prototype.parent=function(){return this}; return a};a.pkp.classes.Helper.injectMixin=function(c,b){var d=a.pkp.classes.Helper.objectFactory(b,[]);a.extend(!0,c,d)};a.pkp.classes.Helper.curry=function(a,b){if(2<arguments.length){var d,e;d=Array.prototype.slice.call(arguments,2);return function(){e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}})(jQuery);(function(a){a.pkp.classes.ObjectProxy=function(){return this};a.pkp.classes.ObjectProxy.prototype.objectName_="";a.pkp.classes.ObjectProxy.prototype.self=function(c){var b,d;for(b=this.constructor;b;b=b.parent_&&b.parent_.constructor)if(b.hasOwnProperty(c))return b=b[c],a.isFunction(b)?(d=Array.prototype.slice.call(arguments,1),b.apply(this,d)):b;throw Error(['Static property "',c,'" not found!'].join(""));};a.pkp.classes.ObjectProxy.prototype.parent=function(c,b){var d,e,f,g;d=a.pkp.classes.ObjectProxy.prototype.parent.caller; if(d.parent_)return e=Array.prototype.slice.call(arguments),d.parent_.constructor.apply(this,e);e=Array.prototype.slice.call(arguments,1);if(this.hasOwnProperty(c)&&this[c]===d)return this.constructor.parent_[c].apply(this,e);f=!1;for(g=this.constructor;g;g=g.parent_&&g.parent_.constructor)if(g.prototype.hasOwnProperty(c)&&g.prototype[c]===d)f=!0;else if(f)return g.prototype[c].apply(this,e);throw Error("Trying to call parent from a method of one name to a method of a different name");};a.pkp.classes.ObjectProxy.prototype.getObjectName= function(){return this.objectName_}})(jQuery);(function(a){a.pkp.classes.Handler=function(a,b){if(1<a.length)throw Error("jQuery selector contained more than one handler!");this.$htmlElement_=a;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_={};b.$eventBridge&&(this.$eventBridge_=b.$eventBridge);if(b.publishChangeEvents){this.publishChangeEvents_=b.publishChangeEvents;var d;for(d=0;d< this.publishChangeEvents_.length;d++)this.publishEvent(this.publishChangeEvents_[d])}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.getHandler=function(c){c= c.data("pkp.handler");if(!(c instanceof a.pkp.classes.Handler))throw Error("There is no handler bound to this element!");return c};a.pkp.classes.Handler.prototype.getHtmlElement=function(){a.pkp.classes.Handler.checkContext_(this);return this.$htmlElement_};a.pkp.classes.Handler.prototype.publishChangeEvents=function(){var a;for(a=0;a<this.publishChangeEvents_.length;a++)this.trigger(this.publishChangeEvents_[a])};a.pkp.classes.Handler.prototype.handleEvent=function(c){var b,d,e,f,g,h;b=a(this);d= a.pkp.classes.Handler.getHandler(b);if(b[0]!==d.getHtmlElement()[0])throw Error("An invalid handler is bound to the calling element of an event!");b=d.eventBindings_[c.type];if(void 0===b)return!1;e=a.makeArray(arguments);f=!0;e.unshift(this);g=0;for(h=b.length;g<h&&!(!1===b[g].apply(d,e)&&(f=!1),c.isImmediatePropagationStopped());g++);c.stopPropagation();return f};a.pkp.classes.Handler.prototype.callbackWrapper=function(c,b){a.pkp.classes.Handler.checkContext_(this);b||(b=this);return function(){var d; d=a.makeArray(arguments);d.unshift(this);return c.apply(b,d)}};a.pkp.classes.Handler.prototype.remoteResponse=function(a,b){return this.handleJson(b)};a.pkp.classes.Handler.prototype.remove=function(){a.pkp.classes.Handler.checkContext_(this);var c,b;c=this.getHtmlElement();c.unbind(".pkpHandler");for(b in this.dataItems_)"pkp.handler"!==b&&c.removeData(b);c.trigger("pkpRemoveHandler");c.unbind(".pkpHandlerRemove");c.removeData("pkp.handler")};a.pkp.classes.Handler.prototype.bind=function(c,b){a.pkp.classes.Handler.checkContext_(this); if(!this.eventBindings_[c]){this.eventBindings_[c]=[];var d;d=".pkpHandler";"pkpRemoveHandler"===c&&(d=".pkpHandlerRemove");this.getHtmlElement().bind(c+d,this.handleEvent)}this.eventBindings_[c].push(b)};a.pkp.classes.Handler.prototype.unbind=function(c,b){a.pkp.classes.Handler.checkContext_(this);if(!this.eventBindings_[c])return!1;var d,e;d=0;for(e=this.eventBindings_[c].length;d<e;d++)if(this.eventBindings_[c][d]===b){this.eventBindings_[c].splice([d],1);break}0===this.eventBindings_[c].length&& (delete this.eventBindings_[c],this.getHtmlElement().unbind(c,this.handleEvent));return!0};a.pkp.classes.Handler.prototype.data=function(c,b){a.pkp.classes.Handler.checkContext_(this);c="pkp."+c;void 0!==b&&(this.dataItems_[c]=!0);return this.getHtmlElement().data(c,b)};a.pkp.classes.Handler.prototype.handleJson=function(a){if(!a)throw Error("Server error: Server returned no or invalid data!");if(!0===a.status)return a.event&&(a.event.data?this.trigger(a.event.name,a.event.data):this.trigger(a.event.name)), a;a.content&&alert(a.content);return!1};a.pkp.classes.Handler.prototype.trigger=function(a,b){void 0===b&&(b=null);this.getHtmlElement().triggerHandler(a,b);this.publishedEvents_[a]||this.triggerPublicEvent_(a,b)};a.pkp.classes.Handler.prototype.publishEvent=function(a){this.publishedEvents_[a]||(this.publishedEvents_[a]=!0,this.bind(a,function(b,d,e){var f=null;2<arguments.length&&(f=Array.prototype.slice.call(arguments,2));this.triggerPublicEvent_(a,f)}))};a.pkp.classes.Handler.prototype.switchViz= function(c){a(c.currentTarget).parent().parent().find("span").toggle()};a.pkp.classes.Handler.prototype.triggerPublicEvent_=function(c,b){this.getHtmlElement().parent().trigger(c,b);this.$eventBridge_&&a('[id^="'+this.$eventBridge_+'"]').trigger(c,b)};a.pkp.classes.Handler.checkContext_=function(c){if(!(c instanceof a.pkp.classes.Handler))throw Error("Trying to call handler method in non-handler context!");}})(jQuery);(function(a){a.pkp.classes.linkAction=a.pkp.classes.linkAction||{};a.pkp.classes.linkAction.LinkActionRequest=function(a,b){this.$linkActionElement=a;this.options=b;a.is("a")&&b.url&&a.attr("href",b.url)};a.pkp.classes.linkAction.LinkActionRequest.prototype.$linkActionElement=null;a.pkp.classes.linkAction.LinkActionRequest.prototype.options=null;a.pkp.classes.linkAction.LinkActionRequest.prototype.activate=function(){this.getLinkActionElement().trigger("actionStart");return!1};a.pkp.classes.linkAction.LinkActionRequest.prototype.finish= function(){this.options.finishCallback&&this.options.finishCallback();this.getLinkActionElement().trigger("actionStop");return!1};a.pkp.classes.linkAction.LinkActionRequest.prototype.getUrl=function(){return this.options.url?this.options.url:null};a.pkp.classes.linkAction.LinkActionRequest.prototype.getOptions=function(){return this.options};a.pkp.classes.linkAction.LinkActionRequest.prototype.getLinkActionElement=function(){return this.$linkActionElement}})(jQuery);(function(a){a.pkp.classes.features=a.pkp.classes.features||{};a.pkp.classes.features.Feature=function(a,b){this.gridHandler_=a;this.options_=b;this.addFeatureHtml(this.getGridHtmlElement(),b)};a.pkp.classes.features.Feature.prototype.gridHandler_=null;a.pkp.classes.features.Feature.prototype.options_=null;a.pkp.classes.features.Feature.prototype.init=function(){throw Error("Abstract method!");};a.pkp.classes.features.Feature.prototype.appendElement=function(){return!1};a.pkp.classes.features.Feature.prototype.replaceElement= function(){return!1};a.pkp.classes.features.Feature.prototype.callbackWrapper=function(a,b){return this.gridHandler_.callbackWrapper(a,b)};a.pkp.classes.features.Feature.prototype.addFeatureHtml=function(){};a.pkp.classes.features.Feature.prototype.getGridHtmlElement=function(){return this.gridHandler_.getHtmlElement()}})(jQuery);(function(a){a.pkp.controllers.SiteHandler=function(c,b){this.parent(c,b);this.options_=b;this.unsavedFormElements_=[];a(".go").button();this.bind("redirectRequested",this.redirectToUrl);this.bind("notifyUser",this.fetchNotificationHandler_);this.bind("updateHeader",this.updateHeaderHandler_);this.bind("updateSidebar",this.updateSidebarHandler_);this.bind("callWhenClickOutside",this.callWhenClickOutsideHandler_);this.bind("gridInitialized",this.updateHelpDisplayHandler_);this.bind("toggleInlineHelp", this.toggleInlineHelpHandler_);a(window).bind("beforeunload",this.pageUnloadHandler_);a.ajaxSetup({cache:!1});this.setMainMaxWidth_();b.hasSystemNotifications&&this.trigger("notifyUser");this.bind("formChanged",this.callbackWrapper(this.registerUnsavedFormElement_));this.bind("unregisterChangedForm",this.callbackWrapper(this.unregisterUnsavedFormElement_));this.bind("modalCanceled",this.callbackWrapper(this.unregisterUnsavedFormElement_));this.bind("unregisterAllForms",this.callbackWrapper(this.unregisterAllFormElements_))}; a.pkp.classes.Helper.inherits(a.pkp.controllers.SiteHandler,a.pkp.classes.Handler);a.pkp.controllers.SiteHandler.prototype.options_=null;a.pkp.controllers.SiteHandler.prototype.unsavedFormElements_=null;a.pkp.controllers.SiteHandler.prototype.redirectToUrl=function(a,b,d){window.location=d};a.pkp.controllers.SiteHandler.prototype.registerUnsavedFormElement_=function(c,b,d){c=a(d.target.lastElementChild).attr("id");-1==a.inArray(c,this.unsavedFormElements_)&&this.unsavedFormElements_.push(c)};a.pkp.controllers.SiteHandler.prototype.unregisterUnsavedFormElement_= function(c,b,d){c=a(d.target.lastElementChild).attr("id");c=a.inArray(c,this.unsavedFormElements_);-1!==c&&delete this.unsavedFormElements_[c]};a.pkp.controllers.SiteHandler.prototype.unregisterAllFormElements_=function(){this.unsavedFormElements_=[]};a.pkp.controllers.SiteHandler.prototype.toggleInlineHelpHandler_=function(){a.ajax({url:this.options_.toggleHelpUrl});this.options_.inlineHelpState=this.options_.inlineHelpState?0:1;this.updateHelpDisplayHandler_();return!1};a.pkp.controllers.SiteHandler.prototype.updateHelpDisplayHandler_= function(){var a;a=this.getHtmlElement();this.options_.inlineHelpState?(a.find(".pkp_grid_description, #legend, .pkp_help").css("visibility","visible").show(),a.find('[id^="toggleHelp"]').html(this.options_.toggleHelpOffText)):(a.find(".pkp_grid_description, #legend, .pkp_help").hide(),a.find('[id^="toggleHelp"]').html(this.options_.toggleHelpOnText))};a.pkp.controllers.SiteHandler.prototype.fetchNotificationHandler_=function(c,b,d){void 0!==d?this.showNotification_(d):a.ajax({url:this.options_.fetchNotificationUrl, data:this.options_.requestOptions,success:this.callbackWrapper(this.showNotificationResponseHandler_),dataType:"json",async:!1})};a.pkp.controllers.SiteHandler.prototype.updateHeaderHandler_=function(){a.pkp.classes.Handler.getHandler(a("#headerContainer")).reload()};a.pkp.controllers.SiteHandler.prototype.updateSidebarHandler_=function(){a.pkp.classes.Handler.getHandler(a("#sidebarContainer")).reload()};a.pkp.controllers.SiteHandler.prototype.callWhenClickOutsideHandler_=function(a,b,d){if(void 0!== this.callWhenClickOutsideEventParams_)throw Error("Another widget is already using this structure.");this.callWhenClickOutsideEventParams_=d;setTimeout(this.callbackWrapper(function(){this.bind("mousedown",this.checkOutsideClickHandler_)}),25)};a.pkp.controllers.SiteHandler.prototype.checkOutsideClickHandler_=function(a,b){var d,e;if(void 0!==this.callWhenClickOutsideEventParams_){if(void 0!==this.callWhenClickOutsideEventParams_.container)d=this.callWhenClickOutsideEventParams_.container;else return!1; if(void 0!==this.callWhenClickOutsideEventParams_.callback)e=this.callWhenClickOutsideEventParams_.callback;else return!1;if(void 0!==this.callWhenClickOutsideEventParams_.skipWhenVisibleModals&&this.callWhenClickOutsideEventParams_.skipWhenVisibleModals&&0<this.getHtmlElement().find("div.ui-dialog").length)return!1;0===d.has(b.target).length&&(this.unbind("mousedown",this.checkOutsideClickHandler_),this.callWhenClickOutsideEventParams_=null,d.is(":hidden")||e())}return!1};a.pkp.controllers.SiteHandler.prototype.pageUnloadHandler_= function(){var c,b,d;c=a.pkp.classes.Handler.getHandler(a("body"));b=0;for(d in c.unsavedFormElements_)d&&b++;return 0<b?a.pkp.locale.form_dataHasChanged:null};a.pkp.controllers.SiteHandler.prototype.isFormUnsaved=function(a){return null!==this.unsavedFormElements_&&void 0!==this.unsavedFormElements_[a]?!0:!1};a.pkp.controllers.SiteHandler.prototype.showNotificationResponseHandler_=function(a,b){this.showNotification_(b)};a.pkp.controllers.SiteHandler.prototype.showNotification_=function(c){var b, d,c=this.handleJson(c);if(!1!==c&&c.content.general)for(b in c=c.content.general,c)for(d in c[b])a.pnotify(c[b][d])};a.pkp.controllers.SiteHandler.prototype.setMainMaxWidth_=function(){var c,b,d,e,f;c=this.getHtmlElement();b=a(".pkp_structure_content",c).width();d=a(".pkp_structure_sidebar_left",c).outerWidth(!0);e=a(".pkp_structure_sidebar_right",c).outerWidth(!0);c=a(".pkp_structure_main",c);f=c.outerWidth(!0)-c.width();c.css("max-width",b-(d+e+f))}})(jQuery);(function(a){a.pkp.controllers.UrlInDivHandler=function(a,b){this.parent(a,b);this.sourceUrl_=b.sourceUrl;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.handleLoadedContent_=function(a,b){var d=this.handleJson(b); !0===d.status?this.getHtmlElement().hide().html(d.content).fadeIn(400):alert(d.content);return!1}})(jQuery);(function(a){a.pkp.controllers.AutocompleteHandler=function(c,b){var d;this.parent(c,b);this.textInput=c.find(":text");this.textInput.keyup(this.callbackWrapper(this.synchronizeFields_));this.hiddenInput_=c.find(":hidden");this.sourceUrl_=b.sourceUrl;b.sourceUrl=void 0;d={};d.source=this.callbackWrapper(this.fetchAutocomplete);d=a.extend({},this.self("DEFAULT_PROPERTIES_"),d,b);this.textInput.autocomplete(d);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.DEFAULT_PROPERTIES_={minLength:2};a.pkp.controllers.AutocompleteHandler.prototype.hiddenInput_=null;a.pkp.controllers.AutocompleteHandler.prototype.sourceUrl_=null;a.pkp.controllers.AutocompleteHandler.prototype.textInput=null;a.pkp.controllers.AutocompleteHandler.prototype.itemSelected=function(a,b, d){a=this.hiddenInput_;b=this.textInput;""!==d.item.value&&(a.val(d.item.value),b.val(d.item.label));return!1};a.pkp.controllers.AutocompleteHandler.prototype.itemFocused=function(a,b,d){a=this.textInput;""!==d.item.value&&a.val(d.item.label);return!1};a.pkp.controllers.AutocompleteHandler.prototype.fetchAutocomplete=function(c,b,d){var e;e=this.textInput;e.addClass("spinner");a.post(this.getAutocompleteUrl(),{term:b.term},function(a){e.removeClass("spinner");d(a.content)},"json")};a.pkp.controllers.AutocompleteHandler.prototype.getAutocompleteUrl= function(){return this.sourceUrl_};a.pkp.controllers.AutocompleteHandler.prototype.setAutocompleteUrl=function(a){this.sourceUrl_=a};a.pkp.controllers.AutocompleteHandler.prototype.synchronizeFields_=function(){this.hiddenInput_.val(String(this.textInput.val()))};a.pkp.controllers.AutocompleteHandler.prototype.textInputBlurHandler_=function(){""==this.hiddenInput_.val()&&this.textInput.val("")}})(jQuery);(function(a){a.pkp.controllers.ExtrasOnDemandHandler=function(c,b){this.parent(c,b);a(".toggleExtras",c).show().click(this.callbackWrapper(this.toggleExtras));this.deactivateExtraContent_()};a.pkp.classes.Helper.inherits(a.pkp.controllers.ExtrasOnDemandHandler,a.pkp.classes.Handler);a.pkp.controllers.ExtrasOnDemandHandler.prototype.toggleExtras=function(c){var b=this.getHtmlElement();a(c,b).hasClass("active")?this.deactivateExtraContent_("slow"):this.activateExtraContent_("slow")};a.pkp.controllers.ExtrasOnDemandHandler.prototype.activateExtraContent_= function(c){var b,d;b=this.getHtmlElement();a(".toggleExtras .toggleExtras-inactive",b).hide();a(".extrasContainer",b).show(c);a(".toggleExtras .toggleExtras-active",b).show();a(".toggleExtras",b).removeClass("inactive").addClass("active");a(".ui-icon",b).removeClass("ui-icon-triangle-1-e").addClass("ui-icon-triangle-1-s");d=b.closest(".scrollable");0<d.size()&&(a.browser.msie&&7>=parseInt(a.browser.version.substring(0,1),10)?setTimeout(function(){this.scrollToMakeVisible_(b,d)},500):this.scrollToMakeVisible_(b, d))};a.pkp.controllers.ExtrasOnDemandHandler.prototype.deactivateExtraContent_=function(c){var b=this.getHtmlElement();a(".extrasContainer",b).hide(c);a(".toggleExtras .toggleExtras-active",b).hide();a(".toggleExtras .toggleExtras-inactive",b).show();a(".toggleExtras",b).removeClass("active").addClass("inactive");a(".ui-icon",b).removeClass("ui-icon-triangle-1-s").addClass("ui-icon-triangle-1-e")};a.pkp.controllers.ExtrasOnDemandHandler.prototype.scrollToMakeVisible_=function(a,b){var d,e,f;d=a.position().top; e=b.position().top;f=parseInt(b.scrollTop(),10);d>e?(d=Math.ceil(d+a.height()-b.height()),0<d&&b.scrollTop(f+d)):(f=Math.max(Math.floor(f+d-e),0),b.scrollTop(f))}})(jQuery);(function(a){a.pkp.controllers.form.FormHandler=function(c,b){this.parent(c,b);if(!c.is("form"))throw Error("A form handler controller can only be bound to an HTML form element!");!1!==b.transformButtons&&a(".button",c).button();b.submitHandler&&(this.callerSubmitHandler_=b.submitHandler);b.cancelRedirectUrl&&(this.cancelRedirectUrl_=b.cancelRedirectUrl);"undefined"!==typeof b.trackFormChanges&&(this.trackFormChanges_=b.trackFormChanges);b.disableControlsOnSubmit&&(this.disableControlsOnSubmit=b.disableControlsOnSubmit); b.enableDisablePairs&&(this.enableDisablePairs_=b.enableDisablePairs,this.setupEnableDisablePairs());var d=c.validate({onfocusout:!1,errorClass:"error",highlight:function(b,c){a(b).parent().parent().addClass(c)},unhighlight:function(b,c){a(b).parent().parent().removeClass(c)},submitHandler:this.callbackWrapper(this.submitHandler_),showErrors:this.callbackWrapper(this.showErrors)});a("#cancelFormButton",c).click(this.callbackWrapper(this.cancelForm));a("#resetFormButton",c).click(this.callbackWrapper(this.resetForm)); c.find(".showMore, .showLess").bind("click",this.switchViz);d.checkForm()?this.trigger("formValid"):this.trigger("formInvalid");this.initializeTinyMCE_();a("#submitFormButton",c).click(this.callbackWrapper(this.pushTinyMCEChanges_));a(":input",c).change(this.callbackWrapper(this.formChange))};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.FormHandler,a.pkp.classes.Handler);a.pkp.controllers.form.FormHandler.prototype.callerSubmitHandler_=null;a.pkp.controllers.form.FormHandler.prototype.cancelRedirectUrl_= null;a.pkp.controllers.form.FormHandler.prototype.trackFormChanges_=!0;a.pkp.controllers.form.FormHandler.prototype.formChangesTracked=!1;a.pkp.controllers.form.FormHandler.prototype.disableControlsOnSubmit=!1;a.pkp.controllers.form.FormHandler.prototype.enableDisablePairs_=null;a.pkp.controllers.form.FormHandler.prototype.showErrors=function(a){"undefined"!==typeof tinyMCE&&tinyMCE.triggerSave();a.defaultShowErrors();a.checkForm()?this.trigger("formValid"):(this.trigger("formInvalid"),this.enableFormControls())}; a.pkp.controllers.form.FormHandler.prototype.formChange=function(){this.trackFormChanges_&&!this.formChangesTracked&&(this.trigger("formChanged"),this.formChangesTracked=!0)};a.pkp.controllers.form.FormHandler.prototype.disableFormControls=function(){this.disableControlsOnSubmit&&this.getHtmlElement().find(":submit").attr("disabled","disabled").addClass("ui-state-disabled");return!0};a.pkp.controllers.form.FormHandler.prototype.enableFormControls=function(){this.getHtmlElement().find(":submit").removeAttr("disabled").removeClass("ui-state-disabled"); return!0};a.pkp.controllers.form.FormHandler.prototype.cancelForm=function(){this.formChangesTracked=!1;this.trigger("unregisterChangedForm");this.trigger("formCanceled");return!1};a.pkp.controllers.form.FormHandler.prototype.resetForm=function(){this.formChangesTracked=!1;this.trigger("unregisterChangedForm");this.getHtmlElement().each(function(){this.reset()});return!1};a.pkp.controllers.form.FormHandler.prototype.submitFormWithoutValidation=function(a){a.settings.submitHandler=null;this.disableFormControls(); this.getHtmlElement().submit();this.formChangesTracked=!1};a.pkp.controllers.form.FormHandler.prototype.initializeTinyMCE_=function(){if("undefined"!==typeof tinyMCE){var c;c=this.getHtmlElement().attr("id");setTimeout(function(){a("#"+c).find(".richContent").each(function(){tinyMCE.execCommand("mceAddControl",!1,a(this).attr("id").toString())})},500)}};a.pkp.controllers.form.FormHandler.prototype.submitHandler_=function(c,b){var d=new a.Event("formSubmitRequested");a(b).find(".formWidget").trigger(d); d.isDefaultPrevented()||(a(b).find(".pkp_helpers_progressIndicator").show(),this.trigger("unregisterChangedForm"),null!==this.callerSubmitHandler_?(this.formChangesTracked=!1,this.callbackWrapper(this.callerSubmitHandler_).call(c,b)):this.submitFormWithoutValidation(c))};a.pkp.controllers.form.FormHandler.prototype.pushTinyMCEChanges_=function(){"undefined"!==typeof tinyMCE&&tinyMCE.triggerSave();return!0};a.pkp.controllers.form.FormHandler.prototype.setupEnableDisablePairs=function(){var c,b;c=this.getHtmlElement(); for(b in this.enableDisablePairs_)a(c).find("[id^='"+b+"']").bind("click",this.callbackWrapper(this.toggleDependentElement_));return!0};a.pkp.controllers.form.FormHandler.prototype.toggleDependentElement_=function(c){var b,d;b=this.getHtmlElement();d=a(c).attr("id");b=a(b).find("[id^='"+this.enableDisablePairs_[d]+"']");a(c).is(":checked")?a(b).attr("disabled",""):a(b).attr("disabled","disabled");return!0}})(jQuery);(function(a){a.pkp.controllers.form.AjaxFormHandler=function(a,b){this.disableControlsOnSubmit=!0;b.submitHandler=this.submitForm;this.parent(a,b);this.bind("refreshForm",this.refreshFormHandler_);this.publishEvent("containerReloadRequested")};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.AjaxFormHandler,a.pkp.controllers.form.FormHandler);a.pkp.controllers.form.AjaxFormHandler.prototype.submitForm=function(){var c=this.getHtmlElement();this.disableFormControls();a.post(c.attr("action"),c.serialize(), this.callbackWrapper(this.handleResponse),"json")};a.pkp.controllers.form.AjaxFormHandler.prototype.refreshFormHandler_=function(a,b,d){d&&this.getHtmlElement().replaceWith(d)};a.pkp.controllers.form.AjaxFormHandler.prototype.handleResponse=function(c,b){var d,e;e=this.handleJson(b);if(!1!==e)if(""===e.content)d=new a.Event("formSubmitted"),a(this.getHtmlElement()).find(".formWidget").trigger(d),this.trigger("formSubmitted"),this.publishChangeEvents(),this.disableControlsOnSubmit&&this.enableFormControls(); else{if(void 0!==e.reloadContainer)return this.trigger("dataChanged"),this.trigger("containerReloadRequested",[e]),e.status;d=this.getHtmlElement();d.replaceWith(e.content)}a(this.getHtmlElement()).find(".pkp_helpers_progressIndicator").hide();this.getHtmlElement().find(":submit").button();this.trigger("notifyUser",[this.getHtmlElement()]);return e.status}})(jQuery);(function(a){a.pkp.controllers.form.ClientFormHandler=function(a,b){b.submitHandler=this.submitForm;this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.controllers.form.ClientFormHandler,a.pkp.controllers.form.FormHandler);a.pkp.controllers.form.ClientFormHandler.prototype.submitForm=function(){var c;c=this.getHtmlElement().serializeArray();c.push({name:"clientSubmit",value:!0});this.trigger("formSubmitted",[a.param(c)])}})(jQuery);(function(a){a.pkp.controllers.grid=a.pkp.controllers.grid||{};a.pkp.controllers.grid.GridHandler=function(a,b){this.parent(a,b);this.initialize(b);this.initFeatures_(b.features)};a.pkp.classes.Helper.inherits(a.pkp.controllers.grid.GridHandler,a.pkp.classes.Handler);a.pkp.controllers.grid.GridHandler.prototype.gridId_=null;a.pkp.controllers.grid.GridHandler.prototype.fetchRowUrl_=null;a.pkp.controllers.grid.GridHandler.prototype.fetchGridUrl_=null;a.pkp.controllers.grid.GridHandler.prototype.bodySelector_= null;a.pkp.controllers.grid.GridHandler.prototype.features_=null;a.pkp.controllers.grid.GridHandler.prototype.getFetchRowUrl=function(){return this.fetchRowUrl_};a.pkp.controllers.grid.GridHandler.prototype.getRows=function(){return a(".gridRow",this.getHtmlElement())};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.getRowDataId= function(a){var b,d,e,a=a.attr("class").split(" ");for(b in a)if(e=a[b].indexOf("element"),-1!=e){d=a[b].slice(7);break}return d};a.pkp.controllers.grid.GridHandler.prototype.getParentRow=function(a){return a.parents(".gridRow:first")};a.pkp.controllers.grid.GridHandler.prototype.getElementsByType=function(c){return c.hasClass("gridRow")?(c=c.parents("tbody:first"),a(".gridRow",c)):null};a.pkp.controllers.grid.GridHandler.prototype.getEmptyElement=function(a){return a.hasClass("gridRow")?a.parents("tbody:first").next(".empty"): null};a.pkp.controllers.grid.GridHandler.prototype.toggleRowActions=function(c){c=a(c).parents("tr").next(".row_controls");this.applyToggleRowActionEffect_(c)};a.pkp.controllers.grid.GridHandler.prototype.hideAllVisibleRowActions=function(){var c,b,d;c=a(".row_controls:visible",this.getHtmlElement());b=0;for(d=c.length;b<d;b++)this.applyToggleRowActionEffect_(a(c[b]))};a.pkp.controllers.grid.GridHandler.prototype.hideRowActionsDiv=function(){var c,b,d,e;c=a(".gridRow div.row_actions",this.getHtmlElement()); c.hide();b=0;for(d=c.length;b<d;b++)e=a(c[b]),e.parents(".row_container:first").attr("style","padding-left:0px !important")};a.pkp.controllers.grid.GridHandler.prototype.showRowActionsDiv=function(){var c,b,d,e;c=a(".gridRow div.row_actions",this.getHtmlElement());c.show();b=0;for(d=c.length;b<d;b++)e=a(c[b]),e.parents(".row_container:first").removeAttr("style")};a.pkp.controllers.grid.GridHandler.prototype.changeLinkActionsState=function(c,b){void 0===b&&(b=a(".pkp_controllers_linkAction",this.getHtmlElement())); b.each(function(){var b;b=a.pkp.classes.Handler.getHandler(a(this));c?b.enableLink():b.disableLink()})};a.pkp.controllers.grid.GridHandler.prototype.resequenceRows=function(c){var b,d;for(d in c)b=c[d],b=a("#"+b),this.appendElement(b);this.updateControlRowsPosition()};a.pkp.controllers.grid.GridHandler.prototype.updateControlRowsPosition=function(){var c,b,d,e,f;c=this.getRows();b=0;for(d=c.length;b<d;b++)e=a(c[b]),f=this.getControlRowByGridRow(e),0<f.length&&f.insertAfter(e)};a.pkp.controllers.grid.GridHandler.prototype.initialize= function(a){this.bind("dataChanged",this.refreshGridHandler);this.bind("addRow",this.addRowHandler_);this.bind("formSubmitted",this.refreshGridWithFilterHandler_);this.gridId_=a.gridId;this.fetchRowUrl_=a.fetchRowUrl;this.fetchGridUrl_=a.fetchGridUrl;this.bodySelector_=a.bodySelector;this.activateRowActions_();this.trigger("gridInitialized")};a.pkp.controllers.grid.GridHandler.prototype.callFeaturesHook=function(c,b){var d;a.isArray(b)||(b=[b]);for(d in this.features_)this.features_[d][c].apply(this.features_[d], b)};a.pkp.controllers.grid.GridHandler.prototype.refreshGridHandler=function(c,b,d,e){e||(d?a.get(this.fetchRowUrl_,{rowId:d},this.callbackWrapper(this.replaceElementResponseHandler_),"json"):a.get(this.fetchGridUrl_,null,this.callbackWrapper(this.replaceGridResponseHandler_),"json"));this.trigger("gridRefreshRequested");this.publishChangeEvents()};a.pkp.controllers.grid.GridHandler.prototype.deleteElement=function(c){var b,d;if(1!==c.length)throw Error("There were "+c.length+" rather than 1 element to delete!"); b=!1;1==this.getElementsByType(c).length&&(b=!0);c.hasClass("gridRow")&&this.deleteControlsRow_(c);d=this.getEmptyElement(c);c.fadeOut(500,function(){a(this).remove();b&&d.fadeIn(500)})};a.pkp.controllers.grid.GridHandler.prototype.appendElement=function(a,b){void 0===b&&(b=this.getHtmlElement().find(this.bodySelector_));b.append(a);this.getEmptyElement(a).hide();this.callFeaturesHook("appendElement",a)};a.pkp.controllers.grid.GridHandler.prototype.replaceElement=function(a,b){b.hasClass("gridRow")&& this.deleteControlsRow_(a);a.replaceWith(b);this.callFeaturesHook("replaceElement",b)};a.pkp.controllers.grid.GridHandler.prototype.hasSameNumOfColumns=function(a,b){var d,e;d=this.getHtmlElement().find("th").length;e=a.first().find("td");e=b?e.attr("colspan"):e.length;return d==e};a.pkp.controllers.grid.GridHandler.prototype.refreshGridWithFilterHandler_=function(c,b,d){a.post(this.fetchGridUrl_,d,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.addRowHandler_= function(c,b,d){a.get(this.fetchRowUrl_,d,this.callbackWrapper(this.replaceElementResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.replaceElementResponseHandler_=function(a,b){var d;d=this.handleJson(b);if(!1!==d)if(d.elementNotFound){d=d.elementNotFound;d=this.getHtmlElement().find(".element"+d);if(0===d.length)return!1;this.deleteElement(d)}else this.insertOrReplaceElement_(d.content),this.activateRowActions_()};a.pkp.controllers.grid.GridHandler.prototype.replaceGridResponseHandler_= function(a,b){var d,e;d=this.handleJson(b);!1!==d&&(e=this.getHtmlElement(),e.replaceWith(d.content),this.activateRowActions_())};a.pkp.controllers.grid.GridHandler.prototype.insertOrReplaceElement_=function(c){var b,d,c=a(c);b=c.attr("id");d=this.getHtmlElement();b=b?d.find("#"+b):null;if(null!==b&&1<b.length)throw Error("There were "+b.length+" rather than 0 or 1 elements to be replaced!");this.hasSameNumOfColumns(c)?null!==b&&1===b.length?this.replaceElement(b,c):this.appendElement(c):a.get(this.fetchGridUrl_, null,this.callbackWrapper(this.replaceGridResponseHandler_),"json")};a.pkp.controllers.grid.GridHandler.prototype.deleteControlsRow_=function(c){c=a("#"+c.attr("id")+"-control-row",this.getHtmlElement());c.is("tr")&&c.hasClass("row_controls")&&c.remove()};a.pkp.controllers.grid.GridHandler.prototype.getControlRowByGridRow=function(c){c=c.attr("id")+"-control-row";return a("#"+c)};a.pkp.controllers.grid.GridHandler.prototype.activateRowActions_=function(){this.getHtmlElement().find("a.settings").unbind("click").bind("click", this.callbackWrapper(this.toggleRowActions))};a.pkp.controllers.grid.GridHandler.prototype.applyToggleRowActionEffect_=function(a){var b;b=a.prev().find("td:not(.indent_row)");b=b.add(a.prev());a.is(":visible")?(setTimeout(function(){b.removeClass("no_border")},0),a.hide(0)):(b.addClass("no_border"),a.show(0))};a.pkp.controllers.grid.GridHandler.prototype.addFeature_=function(a,b){this.features_||(this.features_=[]);this.features_[a]=b};a.pkp.controllers.grid.GridHandler.prototype.initFeatures_=function(c){var b, d;for(b in c)d=a.pkp.classes.Helper.objectFactory(c[b].JSClass,[this,c[b].options]),this.addFeature_(b,d),this.features_[b].init()}})(jQuery);jQuery.pkp.controllers.linkAction=jQuery.pkp.controllers.linkAction||{}; (function(a){a.pkp.controllers.linkAction.LinkActionHandler=function(c,b){this.parent(c,b);this.staticId_=b.staticId?b.staticId:c.attr("id");if(!b.actionRequest||!b.actionRequestOptions)throw Error('The "actionRequest" and "actionRequestOptions"settings are required in a LinkActionHandler');c.hasClass("image")&&this.bind("mouseover",this.imagePreviewHandler_);b.actionRequestOptions.finishCallback=this.callbackWrapper(this.enableLink);this.linkActionRequest_=a.pkp.classes.Helper.objectFactory(b.actionRequest, [c,b.actionRequestOptions]);this.bindActionRequest();this.publishEvent("dataChanged");this.bind("dataChanged",this.dataChangedHandler_);this.bind("modalCanceled",this.removeDisabledCssClass_);b.selfActivate&&this.trigger("click")};a.pkp.classes.Helper.inherits(a.pkp.controllers.linkAction.LinkActionHandler,a.pkp.classes.Handler);a.pkp.controllers.linkAction.LinkActionHandler.prototype.linkActionRequest_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.staticId_=null;a.pkp.controllers.linkAction.LinkActionHandler.prototype.getStaticId= function(){return this.staticId_};a.pkp.controllers.linkAction.LinkActionHandler.prototype.getUrl=function(){return this.linkActionRequest_.getUrl()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.imagePreviewHandler_=function(c){a(c).imgPreview({preloadImages:!1,imgCSS:{width:"300px"}})};a.pkp.controllers.linkAction.LinkActionHandler.prototype.activateAction=function(a,b){"$.pkp.classes.linkAction.NullAction"!=this.linkActionRequest_.getObjectName()&&this.disableLink();return this.linkActionRequest_.activate(a, b)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.bindActionRequest=function(){this.bind("click",this.activateAction)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.enableLink=function(){var c,b;c=a(this.getHtmlElement());this.getHtmlElement().is(":submit")||this.removeDisabledCssClass_();b=this.getUrl();this.getHtmlElement().is("a")&&b&&c.attr("href",b);this.unbind("click",this.noAction_);this.bindActionRequest()};a.pkp.controllers.linkAction.LinkActionHandler.prototype.disableLink= function(){var c=a(this.getHtmlElement());c.addClass("ui-state-disabled");this.getHtmlElement().is("a")&&c.attr("href","#");this.unbind("click",this.activateAction);this.bind("click",this.noAction_)};a.pkp.controllers.linkAction.LinkActionHandler.prototype.removeDisabledCssClass_=function(){a(this.getHtmlElement()).removeClass("ui-state-disabled")};a.pkp.controllers.linkAction.LinkActionHandler.prototype.dataChangedHandler_=function(a,b,d){0===this.getHtmlElement().parents(".pkp_controllers_grid").length&& this.trigger("redirectDataChangedToGrid",[d]);this.trigger("notifyUser",[this.getHtmlElement()])};a.pkp.controllers.linkAction.LinkActionHandler.prototype.noAction_=function(){return!1}})(jQuery);(function(a){a.pkp.pages=a.pkp.pages||{};a.pkp.pages.search=a.pkp.pages.search||{};a.pkp.pages.search.SearchFormHandler=function(a,b){a.find('input[name="query"]').focus().select();b.submitHandler=this.submitForm;b.trackFormChanges=!1;b.transformButtons=!1;this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.pages.search.SearchFormHandler,a.pkp.controllers.form.FormHandler);a.pkp.pages.search.SearchFormHandler.prototype.submitForm=function(c){var b,d,e,f,g;b=this.getHtmlElement();e="query authors title abstract discipline subject type coverage indexTerms suppFiles galleyFullText".split(" "); f=0;for(g=e.length;f<g&&!(d=""==b.find('input[name="'+e[f]+'"]').val(),!d);f++);d?alert(a.pkp.locale.search_noKeywordError):this.submitFormWithoutValidation(c)}})(jQuery);(function(a){a.pkp.statistics=a.pkp.statistics||{};a.pkp.statistics.ReportGeneratorFormHandler=function(c,b){var d,e;b.trackFormChanges=!1;b.transformButtons=!1;this.parent(c,b);this.getHtmlElement().find(":submit").button();a("#reportUrlFormArea",c).hide();this.timeFilterWrapperSelector_=b.timeFilterWrapperSelector;this.rangeByDaySelector_=b.rangeByDaySelector;this.rangeByMonthSelector_=b.rangeByMonthSelector;this.startDayElementSelector_=b.startDayElementSelector;this.endDayElementSelector_=b.endDayElementSelector; this.optionalColumns_=b.optionalColumns;this.aggregationOptionsSelector_=b.aggregationOptionsSelector;this.fetchFormUrl_=b.fetchFormUrl;this.$metricTypeSelectElement_=d=a(b.metricTypeSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));this.$reportTemplateSelectElement_=d=a(b.reportTemplateSelectSelector,this.getHtmlElement());1==d.length&&d.change(this.callbackWrapper(this.fetchFormHandler_));this.columnsSelector_=b.columnsSelector;d=a(b.aggregationOptionsSelector); 0<d.length&&d.change(this.callbackWrapper(this.aggregationOptionsChangeHandler_));d=a(b.yesterdaySelector,this.getHtmlElement());d=a(b.currentMonthSelector,this.getHtmlElement()).add(d);2==d.length&&d.click(this.callbackWrapper(this.currentTimeElementsClickHandler_));d=a(b.rangeByDaySelector,this.getHtmlElement());d=a(b.rangeByMonthSelector,this.getHtmlElement()).add(d);2==d.length&&d.click(this.callbackWrapper(this.rangeTimeElementsClickHandler_));this.dateRangeElementsWrapper_=a(b.dateRangeWrapperSelector, this.getHtmlElement());1==d.filter("input:checked").length?d.filter("input:checked").click():this.dateRangeElementsWrapper_.hide();this.fetchArticlesUrl_=b.fetchArticlesUrl;this.$articleSelectElement_=a(b.articleSelectSelector,this.getHtmlElement());1==this.$articleSelectElement_.length&&(d=a(b.issueSelectSelector,this.getHtmlElement()),d.change(this.callbackWrapper(this.fetchArticleInfoHandler_)));this.fileAssocTypes_=b.fileAssocTypes;this.fileTypeSelectSelector_=b.fileTypeSelectSelector;e=a(this.fileTypeSelectSelector_, this.getHtmlElement());d=a(b.objectTypeSelectSelector,this.getHtmlElement());1==e.length&&(e.attr("disabled","disabled"),d.change(this.callbackWrapper(this.updateFileTypeSelectHandler_)));d.change();this.fetchRegionsUrl_=b.fetchRegionsUrl;this.$regionSelectElement_=a(b.regionSelectSelector,this.getHtmlElement());1==this.$regionSelectElement_.length&&(d=a(b.countrySelectSelector,this.getHtmlElement()),d.change(this.callbackWrapper(this.fetchRegionHandler_)));this.addOptionalColumnsClass_()};a.pkp.classes.Helper.inherits(a.pkp.statistics.ReportGeneratorFormHandler, a.pkp.controllers.form.AjaxFormHandler);a.pkp.statistics.ReportGeneratorFormHandler.prototype.fetchFormUrl_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.fetchArticlesUrl_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.$metricTypeSelectElement_={};a.pkp.statistics.ReportGeneratorFormHandler.prototype.$reportTemplateSelectElement_={};a.pkp.statistics.ReportGeneratorFormHandler.prototype.$articleSelectElement_={};a.pkp.statistics.ReportGeneratorFormHandler.prototype.$regionSelectElement_= {};a.pkp.statistics.ReportGeneratorFormHandler.prototype.fetchRegionsUrl_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.$fileAssocTypes_={};a.pkp.statistics.ReportGeneratorFormHandler.prototype.rangeByDaySelector_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.rangeByMonthSelector_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.startDayElementSelector_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.endDayElementSelector_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.timeFilterWrapperSelector_= null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.columnsSelector_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.fileTypeSelectSelector_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.optionalColumns_={};a.pkp.statistics.ReportGeneratorFormHandler.prototype.aggregationOptionsSelector_=null;a.pkp.statistics.ReportGeneratorFormHandler.prototype.handleResponse=function(c,b){var d=this.handleJson(b);!1!==d&&void 0!==d.reportUrl&&(a("#reportUrlFormArea",this.getHtmlElement()).show().find(":input").val(d.reportUrl), window.location=d.reportUrl);return this.parent("handleResponse",c,b)};a.pkp.statistics.ReportGeneratorFormHandler.prototype.fetchFormHandler_=function(){var c,b={};c=a(this.timeFilterWrapperSelector_,this.getHtmlElement()).serializeArray();a.each(c,function(a,c){b[c.name]=c.value});c=a("option:selected",this.$metricTypeSelectElement_);void 0!==c[0]&&void 0!==c[0].value&&(b.metricType=c[0].value);c=a("option:selected",this.$reportTemplateSelectElement_);void 0!==c[0]&&void 0!==c[0].value&&(b.reportTemplate= c[0].value);b.refreshForm=!0;a.get(this.fetchFormUrl_,b,this.callbackWrapper(this.handleResponse,null),"json");return!1};a.pkp.statistics.ReportGeneratorFormHandler.prototype.fetchArticleInfoHandler_=function(c){this.$articleSelectElement_.empty();c=a(c);c=a("option:selected",c);1==c.length&&(c=c[0].value,a.get(this.fetchArticlesUrl_,{issueId:c},this.callbackWrapper(this.updateArticleSelectCallback_,null),"json"));return!1};a.pkp.statistics.ReportGeneratorFormHandler.prototype.updateArticleSelectCallback_= function(c,b){var d,e,f,g;d=this.$articleSelectElement_;e=this.handleJson(b);if(!1!==e){f=e.content;g=0;for(e=f.length;g<e;g++)d.append(a("<option />").val(f[g].id).text(f[g].title))}return!1};a.pkp.statistics.ReportGeneratorFormHandler.prototype.updateFileTypeSelectHandler_=function(c){var b,c=a(c),c=a("option:selected",c);if(1==c.length)for(b in c=c[0].value,this.fileAssocTypes_)if(this.fileAssocTypes_[b]==c)return a(this.fileTypeSelectSelector_,this.getHtmlElement()).removeAttr("disabled"),!1; a(this.fileTypeSelectSelector_,this.getHtmlElement()).attr("disabled","disabled");return!1};a.pkp.statistics.ReportGeneratorFormHandler.prototype.fetchRegionHandler_=function(c){this.$regionSelectElement_.empty();c=a(c);c=a("option:selected",c);1==c.length&&(c=c[0].label,a.get(this.fetchRegionsUrl_,{countryId:c},this.callbackWrapper(this.updateRegionSelectCallback_,null),"json"));return!1};a.pkp.statistics.ReportGeneratorFormHandler.prototype.updateRegionSelectCallback_=function(c,b){var d,e,f,g; d=this.$regionSelectElement_;d.empty();e=this.handleJson(b);if(!1!==e){f=e.content;g=0;for(e=f.length;g<e;g++)d.append(a("<option />").val(f[g].id).text(f[g].name))}return!1};a.pkp.statistics.ReportGeneratorFormHandler.prototype.currentTimeElementsClickHandler_=function(){this.dateRangeElementsWrapper_.hide()};a.pkp.statistics.ReportGeneratorFormHandler.prototype.rangeTimeElementsClickHandler_=function(c){var b=a(this.startDayElementSelector_).add(this.endDayElementSelector_);this.dateRangeElementsWrapper_.show(); "#"+a(c).attr("id")==this.rangeByDaySelector_&&b.show();"#"+a(c).attr("id")==this.rangeByMonthSelector_&&b.hide()};a.pkp.statistics.ReportGeneratorFormHandler.prototype.aggregationOptionsChangeHandler_=function(c){var b;b=a(this.columnsSelector_);c=a(c);b=b.find('option[value="'+c.attr("value")+'"]');c.attr("checked")?b.attr("selected","selected"):b.removeAttr("selected");return!1};a.pkp.statistics.ReportGeneratorFormHandler.prototype.addOptionalColumnsClass_=function(){var c,b,d,e;d=a(this.columnsSelector_); e=a(this.aggregationOptionsSelector_);b=a("#orderByFormArea select",this.getHtmlElement());d=d.add(b);b=this.optionalColumns_;for(c in b)d.find('option[value="'+c+'"]').addClass("optionalColumn"),e.filter('input[value="'+c+'"]').next("label").addClass("optionalColumn")}})(jQuery);(function(a){a.pkp.plugins.generic.lucene=a.pkp.plugins.generic.lucene||{};a.pkp.plugins.generic.lucene.LuceneAutocompleteHandler=function(a,b){b.minLength=1;b.searchForm=b.searchForm||"searchForm";this.searchForm_=b.searchForm;this.parent(a,b)};a.pkp.classes.Helper.inherits(a.pkp.plugins.generic.lucene.LuceneAutocompleteHandler,a.pkp.controllers.AutocompleteHandler);a.pkp.plugins.generic.lucene.LuceneAutocompleteHandler.prototype.searchForm_="";a.pkp.plugins.generic.lucene.LuceneAutocompleteHandler.prototype.fetchAutocomplete= function(c,b,d){var e;e=this.textInput;e.addClass("spinner");a.post(this.getAutocompleteUrl(),a("#"+this.searchForm_).serialize(),function(a){e.removeClass("spinner");d(a.content)},"json")}})(jQuery);(function(a){a.fn.pkpHandler=function(c,b){this.each(function(){var d=a(this);b=b||{};a.pkp.classes.Helper.objectFactory(c,[d,b])});return this};a.fn.pkpAjaxHtml=function(c,b){var d=this.first();a.ajax({url:c,dataType:"json",success:function(a){d.find("#loading").hide();!0===a.status?(a.content&&d.html(a.content),b&&b()):(d.trigger("ajaxHtmlError",a.content),alert(a.content))},error:function(){alert("Failed Ajax request or invalid JSON returned.")}});d.html("<div id='loading' class='throbber'></div>"); return this}})(jQuery);