You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.0 KiB
1 lines
2.0 KiB
define(["jquery","core/log","core/config","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){"use strict";function g(a){this.base=a,this.initEvents()}var h={LINKS:"[data-action]",MAKE_CURRENT:'[data-action="makecurrent"]',INACTIVATE:'[data-action="inactivate"]',DELETE:'[data-action="delete"]'};return g.prototype.initEvents=function(){var g=this;g.base.on("click",h.LINKS,function(g){g.stopPropagation();var i,j,k=a(g.currentTarget);if(k.is(h.MAKE_CURRENT))i=d.get_strings([{key:"activating",component:"tool_policy"},{key:"activateconfirm",component:"tool_policy",param:{name:k.closest("[data-policy-name]").attr("data-policy-name"),revision:k.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"activateconfirmyes",component:"tool_policy"}]);else if(k.is(h.INACTIVATE))i=d.get_strings([{key:"inactivating",component:"tool_policy"},{key:"inactivatingconfirm",component:"tool_policy",param:{name:k.closest("[data-policy-name]").attr("data-policy-name"),revision:k.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"inactivatingconfirmyes",component:"tool_policy"}]);else{if(!k.is(h.DELETE))return void b.error("unknown action type detected","tool_policy/managedocsactions");i=d.get_strings([{key:"deleting",component:"tool_policy"},{key:"deleteconfirm",component:"tool_policy",param:{name:k.closest("[data-policy-name]").attr("data-policy-name"),revision:k.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"delete",component:"core"}])}g.preventDefault(),i.then(function(a){return j=a,e.create({title:j[0],body:j[1],type:e.types.SAVE_CANCEL})}).then(function(a){return a.setSaveButtonText(j[2]),a.getRoot().on(f.save,function(){window.location.href=k.attr("href")+"&sesskey="+c.sesskey+"&confirm=1"}),a.getRoot().on(f.hidden,function(){a.destroy()}),a.show(),!0})["catch"](function(a){return b.error(a),!1})})},{init:function(b){var c=a(document.getElementById(b));if(c.length)return new g(c);throw new Error("managedocsactions: Invalid base element identifier")}}});
|