Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Marketplace.umd.min.js « dist « vue « Marketplace « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0d582d3964d790ed7ceda7e1847cefd5c10e8b62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["Marketplace"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["Marketplace"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(l){if(t[l])return t[l].exports;var a=t[l]={i:l,l:!1,exports:{}};return e[l].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(l,a,function(t){return e[t]}.bind(null,a));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/Marketplace/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"Marketplace",(function(){return P})),n.d(t,"LicenseKey",(function(){return Z})),n.d(t,"PluginName",(function(){return c})),"undefined"!==typeof window){var l=window.document.currentScript,a=l&&l.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}function i(e,t){var n=e.value.pluginName,l=e.value.activePluginTab;t.preventDefault(),l&&(n+="!".concat(l)),window.broadcast.propagateNewPopoverParameter("browsePluginDetail",n)}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
window.broadcast.addPopoverHandler("browsePluginDetail",(function(e){var t=e,n=null;-1!==e.indexOf("!")&&(n=e.substr(e.indexOf("!")+1),t=e.substr(0,e.indexOf("!")));var l="module=Marketplace&action=pluginDetails&pluginName=".concat(encodeURIComponent(t));n&&(l+="&activeTab=".concat(encodeURIComponent(n))),window.Piwik_Popover.createPopupAndLoadUrl(l,"details")}));var o=window,r=o.$,c={mounted:function(e,t){var n=t.value.pluginName;n&&(t.value.onClickHandler=i.bind(null,t),r(e).on("click",t.value.onClickHandler))},unmounted:function(e,t){r(e).off("click",t.value.onClickHandler)}};
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
function s(){return{restrict:"A",link:function(e,t,n){var l={instance:null,value:{pluginName:n.piwikPluginName,activePluginTab:n.activeplugintab},oldValue:null,modifiers:{},dir:{}};c.mounted(t[0],l),t.on("$destroy",(function(){c.unmounted(t[0],l)}))}}}window.angular.module("piwikApp").directive("piwikPluginName",s);var u=n("8bbf"),d={class:"row marketplaceActions",ref:"root"},p={class:"col s12 m6 l4"},m={class:"col s12 m6 l4"},b={key:0,class:"col s12 m12 l4 "},f=["action"];function g(e,t,n,l,a,i){var o=Object(u["resolveComponent"])("Field");return Object(u["openBlock"])(),Object(u["createElementBlock"])("div",d,[Object(u["createElementVNode"])("div",p,[Object(u["createVNode"])(o,{uicontrol:"select",name:"plugin_type","model-value":e.pluginTypeFilter,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.pluginTypeFilter=t,e.changePluginType()}),title:e.translate("Marketplace_Show"),"full-width":!0,options:e.pluginTypeOptions},null,8,["model-value","title","options"])]),Object(u["createElementVNode"])("div",m,[Object(u["createVNode"])(o,{uicontrol:"select",name:"plugin_sort","model-value":e.pluginSort,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.pluginSort=t,e.changePluginSort()}),title:e.translate("Marketplace_Sort"),"full-width":!0,options:e.pluginSortOptions},null,8,["model-value","title","options"])]),e.pluginsToShow.length>20||e.query?(Object(u["openBlock"])(),Object(u["createElementBlock"])("div",b,[Object(u["createElementVNode"])("form",{method:"post",class:"plugin-search",action:e.pluginSearchFormAction,ref:"pluginSearchForm"},[Object(u["createElementVNode"])("div",null,[Object(u["createVNode"])(o,{uicontrol:"text",name:"query",title:e.queryInputTitle,"full-width":!0,modelValue:e.searchQuery,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.searchQuery=t})},null,8,["title","modelValue"])]),Object(u["createElementVNode"])("span",{class:"icon-search",onClick:t[3]||(t[3]=function(t){return e.$refs.pluginSearchForm.submit()})})],8,f)])):Object(u["createCommentVNode"])("",!0)],512)}var v=n("19dc"),O=n("a5a2"),y=function(e){return"".concat(e[0].toLowerCase()).concat(e.substring(1))},h=window,j=h.$,k=Object(u["defineComponent"])({props:{pluginType:{type:String,required:!0},pluginTypeOptions:{type:[Object,Array],required:!0},sort:{type:String,required:!0},pluginSortOptions:{type:[Object,Array],required:!0},pluginsToShow:{type:Array,required:!0},query:{type:String,default:""},numAvailablePlugins:{type:Number,required:!0}},components:{Field:O["Field"]},data:function(){return{pluginSort:this.sort,pluginTypeFilter:this.pluginType,searchQuery:this.query}},created:function(){function e(e){if(e){var t=j(e);if(t&&t.length){var n=void 0,l=void 0,a=void 0,i=[],o=0;t.each((function(e,t){var r=j(t),c=r.offset(),s=c.top;o!==s&&(i=[],o=s,n=void 0,l=void 0,a=void 0),i.push(r);var u=r.find("h3").height(),d=r.find(".metadata").height(),p=r.find(".footer").height();n?n<u&&(n=u):n=u,l?l<d&&(l=d):l=d,a?a<p&&(a=p):a=p,j.each(i,(function(e,t){n&&t.find("h3").height("".concat(n,"px")),l&&t.find(".metadata").height("".concat(l,"px")),a&&t.find(".footer").height("".concat(a,"px"))}))}))}}}Object(u["nextTick"])((function(){var t=j(".marketplace .plugin .description");t.dotdotdot({after:"a.more",watch:"window"}),v["Matomo"].helper.compileVueDirectives(t),e(".marketplace .plugin")}))},methods:{changePluginSort:function(){v["MatomoUrl"].updateUrl(Object.assign(Object.assign({},v["MatomoUrl"].urlParsed.value),{},{query:"",sort:this.pluginSort}),Object.assign(Object.assign({},v["MatomoUrl"].hashParsed.value),{},{query:"",sort:this.pluginSort}))},changePluginType:function(){v["MatomoUrl"].updateUrl(Object.assign(Object.assign({},v["MatomoUrl"].urlParsed.value),{},{query:"",show:this.pluginTypeFilter}),Object.assign(Object.assign({},v["MatomoUrl"].hashParsed.value),{},{query:"",show:this.pluginTypeFilter}))}},computed:{pluginSearchFormAction:function(){return"?".concat(v["MatomoUrl"].stringify(Object.assign(Object.assign({},v["MatomoUrl"].urlParsed.value),{},{sort:"",embed:"0"})),"#?").concat(v["MatomoUrl"].stringify(Object.assign(Object.assign({},v["MatomoUrl"].hashParsed.value),{},{sort:"",embed:"0",query:this.searchQuery})))},queryInputTitle:function(){var e=y(Object(v["translate"])("General_Plugins"));return"".concat(Object(v["translate"])("General_Search")," ").concat(this.numAvailablePlugins," ").concat(e,"...")}}});k.render=g;var P=k,V={class:"marketplace-max-width"},N={class:"marketplace-paid-intro"},S={key:0},A={key:0},U=Object(u["createElementVNode"])("br",null,null,-1),w={class:"licenseToolbar valign-wrapper"},M=["href"],L={key:0},C={class:"ui-confirm",id:"installAllPaidPluginsAtOnce",ref:"installAllPaidPluginsAtOnce"},T=Object(u["createElementVNode"])("br",null,null,-1),E=Object(u["createElementVNode"])("br",null,null,-1),K=["data-href","value"],B=["value"],_={key:1},x={key:0},I=["innerHTML"],q=Object(u["createElementVNode"])("br",null,null,-1),F={class:"licenseToolbar valign-wrapper"},D={key:1},H=["innerHTML"],$={class:"ui-confirm",id:"confirmRemoveLicense",ref:"confirmRemoveLicense"},R=["value"],G=["value"];function Q(e,t,n,l,a,i){var o=Object(u["resolveComponent"])("DefaultLicenseKeyFields"),r=Object(u["resolveComponent"])("SaveButton"),c=Object(u["resolveComponent"])("ActivityIndicator");return Object(u["openBlock"])(),Object(u["createElementBlock"])("div",V,[Object(u["createElementVNode"])("div",N,[e.isValidConsumer?(Object(u["openBlock"])(),Object(u["createElementBlock"])("div",S,[e.isSuperUser?(Object(u["openBlock"])(),Object(u["createElementBlock"])("div",A,[Object(u["createTextVNode"])(Object(u["toDisplayString"])(e.translate("Marketplace_PaidPluginsWithLicenseKeyIntro",""))+" ",1),U,Object(u["createElementVNode"])("div",w,[Object(u["createVNode"])(o,{"model-value":e.licenseKey,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.licenseKey=t,e.updatedLicenseKey()}),onConfirm:t[1]||(t[1]=function(t){return e.updateLicense()}),"has-license-key":e.hasLicenseKey,"is-valid-consumer":e.isValidConsumer,"enable-update":e.enableUpdate},null,8,["model-value","has-license-key","is-valid-consumer","enable-update"]),Object(u["createVNode"])(r,{class:"valign",id:"remove_license_key",onConfirm:t[2]||(t[2]=function(t){return e.removeLicense()}),value:e.translate("Marketplace_RemoveLicenseKey")},null,8,["value"]),Object(u["createElementVNode"])("a",{class:"btn valign",href:e.subscriptionOverviewLink},Object(u["toDisplayString"])(e.translate("Marketplace_ViewSubscriptions")),9,M),e.showInstallAllPaidPlugins?(Object(u["openBlock"])(),Object(u["createElementBlock"])("div",L,[Object(u["createElementVNode"])("a",{href:"",class:"btn installAllPaidPlugins valign",onClick:t[3]||(t[3]=Object(u["withModifiers"])((function(t){return e.onInstallAllPaidPlugins()}),["prevent"]))},Object(u["toDisplayString"])(e.translate("Marketplace_InstallPurchasedPlugins")),1),Object(u["createElementVNode"])("div",C,[Object(u["createElementVNode"])("h2",null,Object(u["toDisplayString"])(e.translate("Marketplace_InstallAllPurchasedPlugins")),1),Object(u["createElementVNode"])("p",null,[Object(u["createTextVNode"])(Object(u["toDisplayString"])(e.translate("Marketplace_InstallThesePlugins"))+" ",1),T,E]),Object(u["createElementVNode"])("ul",null,[(Object(u["openBlock"])(!0),Object(u["createElementBlock"])(u["Fragment"],null,Object(u["renderList"])(e.paidPluginsToInstallAtOnce,(function(e){return Object(u["openBlock"])(),Object(u["createElementBlock"])("li",{key:e},Object(u["toDisplayString"])(e),1)})),128))]),Object(u["createElementVNode"])("p",null,[Object(u["createElementVNode"])("input",{role:"install",type:"button","data-href":e.installAllPaidPluginsLink,value:e.translate("Marketplace_InstallAllPurchasedPluginsAction",e.paidPluginsToInstallAtOnce.length)},null,8,K),Object(u["createElementVNode"])("input",{role:"cancel",type:"button",value:e.translate("General_Cancel")},null,8,B)])],512)])):Object(u["createCommentVNode"])("",!0)]),Object(u["createVNode"])(c,{loading:e.isUpdating},null,8,["loading"])])):Object(u["createCommentVNode"])("",!0)])):(Object(u["openBlock"])(),Object(u["createElementBlock"])("div",_,[e.isSuperUser?(Object(u["openBlock"])(),Object(u["createElementBlock"])("div",x,[Object(u["createElementVNode"])("span",{innerHTML:e.$sanitize(e.noLicenseKeyIntroText)},null,8,I),q,Object(u["createElementVNode"])("div",F,[Object(u["createVNode"])(o,{"model-value":e.licenseKey,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.licenseKey=t,e.updatedLicenseKey()}),onConfirm:t[5]||(t[5]=function(t){return e.updateLicense()}),"has-license-key":e.hasLicenseKey,"is-valid-consumer":e.isValidConsumer,"enable-update":e.enableUpdate},null,8,["model-value","has-license-key","is-valid-consumer","enable-update"])]),Object(u["createVNode"])(c,{loading:e.isUpdating},null,8,["loading"])])):(Object(u["openBlock"])(),Object(u["createElementBlock"])("div",D,[Object(u["createElementVNode"])("span",{innerHTML:e.$sanitize(e.noLicenseKeyIntroNoSuperUserAccessText)},null,8,H)]))]))]),Object(u["createElementVNode"])("div",$,[Object(u["createElementVNode"])("h2",null,Object(u["toDisplayString"])(e.translate("Marketplace_ConfirmRemoveLicense")),1),Object(u["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,R),Object(u["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,G)],512)])}var z={class:"valign licenseKeyText"};function J(e,t,n,l,a,i){var o=Object(u["resolveComponent"])("Field"),r=Object(u["resolveComponent"])("SaveButton");return Object(u["openBlock"])(),Object(u["createElementBlock"])(u["Fragment"],null,[Object(u["createElementVNode"])("div",z,[Object(u["createVNode"])(o,{uicontrol:"text",name:"license_key","full-width":!0,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.$emit("update:modelValue",t)}),placeholder:e.licenseKeyPlaceholder},null,8,["model-value","placeholder"])]),Object(u["createVNode"])(r,{class:"valign",onConfirm:t[1]||(t[1]=function(t){return e.$emit("confirm")}),disabled:!e.enableUpdate,value:e.saveButtonText,id:"submit_license_key"},null,8,["disabled","value"])],64)}var W=Object(u["defineComponent"])({props:{modelValue:String,isValidConsumer:Boolean,hasLicenseKey:Boolean,enableUpdate:Boolean},emits:["update:modelValue","confirm"],components:{Field:O["Field"],SaveButton:O["SaveButton"]},computed:{licenseKeyPlaceholder:function(){return this.isValidConsumer?Object(v["translate"])("Marketplace_LicenseKeyIsValidShort"):Object(v["translate"])("Marketplace_LicenseKey")},saveButtonText:function(){return this.hasLicenseKey?Object(v["translate"])("CoreUpdater_UpdateTitle"):Object(v["translate"])("Marketplace_ActivateLicenseKey")}}});W.render=J;var Y=W,X=Object(u["defineComponent"])({props:{isValidConsumer:Boolean,isSuperUser:Boolean,isAutoUpdatePossible:Boolean,isPluginsAdminEnabled:Boolean,hasLicenseKey:Boolean,paidPluginsToInstallAtOnce:{type:Array,required:!0},installNonce:{type:String,required:!0}},components:{SaveButton:O["SaveButton"],ActivityIndicator:v["ActivityIndicator"],DefaultLicenseKeyFields:Y},data:function(){return{licenseKey:"",enableUpdate:!1,isUpdating:!1}},methods:{onInstallAllPaidPlugins:function(){v["Matomo"].helper.modalConfirm(this.$refs.installAllPaidPluginsAtOnce)},updateLicenseKey:function(e,t,n){var l=this;v["AjaxHelper"].post({module:"API",method:"Marketplace.".concat(e),format:"JSON"},{licenseKey:this.licenseKey},{withTokenInUrl:!0}).then((function(e){l.isUpdating=!1,e&&e.value&&(v["NotificationsStore"].show({message:n,context:"success",type:"transient"}),v["Matomo"].helper.redirect())}),(function(){l.isUpdating=!1}))},removeLicense:function(){var e=this;v["Matomo"].helper.modalConfirm(this.$refs.confirmRemoveLicense,{yes:function(){e.enableUpdate=!1,e.isUpdating=!0,e.updateLicenseKey("deleteLicenseKey","",Object(v["translate"])("Marketplace_LicenseKeyDeletedSuccess"))}})},updatedLicenseKey:function(){this.enableUpdate=!!this.licenseKey},updateLicense:function(){this.enableUpdate=!1,this.isUpdating=!0,this.updateLicenseKey("saveLicenseKey",this.licenseKey,Object(v["translate"])("Marketplace_LicenseKeyActivatedSuccess"))}},computed:{subscriptionOverviewLink:function(){return"?".concat(v["MatomoUrl"].stringify(Object.assign(Object.assign({},v["MatomoUrl"].urlParsed.value),{},{action:"subscriptionOverview"})))},noLicenseKeyIntroText:function(){return Object(v["translate"])("Marketplace_PaidPluginsNoLicenseKeyIntro",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/recommends/premium-plugins/">',"</a>")},noLicenseKeyIntroNoSuperUserAccessText:function(){return Object(v["translate"])("Marketplace_PaidPluginsNoLicenseKeyIntroNoSuperUserAccess",'<a target="_blank" rel="noreferrer noopener" href="https://matomo.org/recommends/premium-plugins/">',"</a>")},installAllPaidPluginsLink:function(){return"?".concat(v["MatomoUrl"].stringify(Object.assign(Object.assign({},v["MatomoUrl"].urlParsed.value),{},{action:"installAllPaidPlugins",nonce:this.installNonce})))},showInstallAllPaidPlugins:function(){return this.isAutoUpdatePossible&&this.isPluginsAdminEnabled&&this.paidPluginsToInstallAtOnce.length}}});X.render=Q;var Z=X;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */}})}));
//# sourceMappingURL=Marketplace.umd.min.js.map