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

Feedback.umd.min.js « dist « vue « Feedback « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 690932aefa8ef1a8e1aeb049bd499e5dd44dd589 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["Feedback"]=t(require("CoreHome"),require("vue")):e["Feedback"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},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/Feedback/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"RateFeature",(function(){return F})),n.d(t,"FeedbackQuestion",(function(){return U})),"undefined"!==typeof window){var a=window.document.currentScript,o=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var r=n("19dc"),c=n("8bbf"),l=["title"],i={class:"ui-confirm ratefeatureDialog"},s={key:0},u={key:1},d=Object(c["createElementVNode"])("br",null,null,-1),b={class:"messageContainer"},m=["title","value"],f=["value"],k={class:"ui-confirm ratefeatureDialog"},p={key:0},j=["value"];function O(e,t,n,a,o,r){var O=Object(c["resolveComponent"])("MatomoDialog");return Object(c["openBlock"])(),Object(c["createElementBlock"])("div",{title:e.translate("Feedback_RateFeatureTitle",e.$sanitize(e.title)),class:"ratefeature"},[Object(c["createElementVNode"])("div",{class:"iconContainer",onMouseenter:t[2]||(t[2]=function(t){return e.expanded=!0}),onMouseleave:t[3]||(t[3]=function(t){return e.expanded=!1})},[Object(c["createElementVNode"])("img",{onClick:t[0]||(t[0]=function(t){e.likeFeature(),e.showFeedbackForm=!0}),class:"like-icon",src:"plugins/Feedback/vue/src/RateFeature/thumbs-up.png"}),Object(c["withDirectives"])(Object(c["createElementVNode"])("img",{onClick:t[1]||(t[1]=function(t){e.dislikeFeature(),e.showFeedbackForm=!0}),class:"dislike-icon",src:"plugins/Feedback/vue/src/RateFeature/thumbs-down.png"},null,512),[[c["vShow"],e.expanded]])],32),Object(c["createVNode"])(O,{modelValue:e.showFeedbackForm,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showFeedbackForm=t}),onYes:t[6]||(t[6]=function(t){return e.sendFeedback()})},{default:Object(c["withCtx"])((function(){return[Object(c["createElementVNode"])("div",i,[Object(c["createElementVNode"])("h2",null,Object(c["toDisplayString"])(e.translate("Feedback_RateFeatureThankYouTitle",e.title)),1),e.like?(Object(c["openBlock"])(),Object(c["createElementBlock"])("p",s,Object(c["toDisplayString"])(e.translate("Feedback_RateFeatureLeaveMessageLike")),1)):Object(c["createCommentVNode"])("",!0),e.like?Object(c["createCommentVNode"])("",!0):(Object(c["openBlock"])(),Object(c["createElementBlock"])("p",u,Object(c["toDisplayString"])(e.translate("Feedback_RateFeatureLeaveMessageDislike")),1)),d,Object(c["createElementVNode"])("div",b,[Object(c["withDirectives"])(Object(c["createElementVNode"])("textarea",{"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.feedbackMessage=t})},null,512),[[c["vModelText"],e.feedbackMessage]])]),Object(c["createElementVNode"])("input",{type:"button",title:e.translate("Feedback_RateFeatureSendFeedbackInformation"),value:e.translate("Feedback_SendFeedback"),role:"yes"},null,8,m),Object(c["createElementVNode"])("input",{type:"button",role:"cancel",value:e.translate("General_Cancel")},null,8,f)])]})),_:1},8,["modelValue"]),Object(c["createVNode"])(O,{modelValue:e.ratingDone,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.ratingDone=t})},{default:Object(c["withCtx"])((function(){return[Object(c["createElementVNode"])("div",k,[Object(c["createElementVNode"])("h2",null,Object(c["toDisplayString"])(e.translate("Feedback_ThankYou",e.title)),1),e.like?(Object(c["openBlock"])(),Object(c["createElementBlock"])("div",p)):Object(c["createCommentVNode"])("",!0),Object(c["createElementVNode"])("input",{type:"button",value:e.translate("General_Ok"),role:"yes"},null,8,j)])]})),_:1},8,["modelValue"])],8,l)}var h=Object(c["defineComponent"])({props:{title:String},components:{MatomoDialog:r["MatomoDialog"]},data:function(){return{like:!1,ratingDone:!1,expanded:!1,showFeedbackForm:!1,feedbackMessage:""}},methods:{dislikeFeature:function(){this.like=!1},likeFeature:function(){this.like=!0},sendFeedback:function(){r["AjaxHelper"].fetch({method:"Feedback.sendFeedbackForFeature",featureName:this.title,like:this.like?"1":"0",message:this.feedbackMessage}),this.ratingDone=!0}}});h.render=O;var F=h,g=(Object(r["createAngularJsAdapter"])({component:F,scope:{title:{angularJsBind:"@"}},directiveName:"piwikRateFeature"}),{key:0,class:"bannerHeader"}),v=Object(c["createElementVNode"])("i",{class:"icon-heart red-text"},null,-1),V=Object(c["createElementVNode"])("i",{class:"icon-close white-text"},null,-1),y=[V],N={class:"ratefeature"},w={class:"ui-confirm ratefeatureDialog"},M=["innerHTML"],E=Object(c["createElementVNode"])("br",null,null,-1),x={class:"messageContainer"},D={key:0,class:"error-text"},C=Object(c["createElementVNode"])("br",null,null,-1),_=["innerHTML"],S=["value"],B=["value"],T={class:"ui-confirm ratefeatureDialog"},q=["innerHTML"],H=["value"];
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function R(e,t,n,a,o,r){var l=Object(c["resolveComponent"])("MatomoDialog");return Object(c["openBlock"])(),Object(c["createElementBlock"])("div",null,[e.isHidden?Object(c["createCommentVNode"])("",!0):(Object(c["openBlock"])(),Object(c["createElementBlock"])("div",g,[Object(c["createElementVNode"])("span",null,[Object(c["createTextVNode"])(Object(c["toDisplayString"])(e.translate("Feedback_FeedbackTitle"))+" ",1),v]),Object(c["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(){return e.showQuestion&&e.showQuestion.apply(e,arguments)}),class:"btn"},Object(c["toDisplayString"])(e.translate("Feedback_Question".concat(e.question))),1),Object(c["createElementVNode"])("a",{class:"close-btn",onClick:t[1]||(t[1]=function(){return e.disableReminder&&e.disableReminder.apply(e,arguments)})},y)])),Object(c["createElementVNode"])("div",N,[Object(c["createVNode"])(l,{modelValue:e.showFeedbackForm,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.showFeedbackForm=t}),onValidation:t[4]||(t[4]=function(t){return e.sendFeedback()})},{default:Object(c["withCtx"])((function(){return[Object(c["createElementVNode"])("div",w,[Object(c["createElementVNode"])("h2",null,Object(c["toDisplayString"])(e.translate("Feedback_Question".concat(e.question))),1),Object(c["createElementVNode"])("p",{innerHTML:e.translate("Feedback_FeedbackSubtitle","<i class='icon-heart red-text'></i>")},null,8,M),E,Object(c["createElementVNode"])("div",x,[e.errorMessage?(Object(c["openBlock"])(),Object(c["createElementBlock"])("div",D,Object(c["toDisplayString"])(e.errorMessage),1)):Object(c["createCommentVNode"])("",!0),Object(c["withDirectives"])(Object(c["createElementVNode"])("textarea",{id:"message",class:Object(c["normalizeClass"])({"has-error":e.errorMessage}),"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.feedbackMessage=t})},null,2),[[c["vModelText"],e.feedbackMessage]])]),C,Object(c["createElementVNode"])("p",{innerHTML:e.translate("Feedback_Policy","<a rel='nofollow' href='https://matomo.org/privacy-policy/' target='_blank'>","</a>")},null,8,_),Object(c["createElementVNode"])("input",{type:"button",role:"validation",value:e.translate("Feedback_SendFeedback")},null,8,S),Object(c["createElementVNode"])("input",{type:"button",role:"cancel",value:e.translate("General_Cancel")},null,8,B)])]})),_:1},8,["modelValue"]),Object(c["createVNode"])(l,{modelValue:e.feedbackDone,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.feedbackDone=t})},{default:Object(c["withCtx"])((function(){return[Object(c["createElementVNode"])("div",T,[Object(c["createElementVNode"])("h2",null,Object(c["toDisplayString"])(e.translate("Feedback_ThankYou")),1),Object(c["createElementVNode"])("p",{innerHTML:e.translate("Feedback_ThankYourForFeedback","<i class='icon-heart red-text'></i>")},null,8,q),Object(c["createElementVNode"])("input",{type:"button",role:"cancel",value:e.translate("General_Close")},null,8,H)])]})),_:1},8,["modelValue"])])])}var Q=window,L=Q.$,A="feedback-question",P=Object(c["defineComponent"])({props:{showQuestionBanner:String},components:{MatomoDialog:r["MatomoDialog"]},computed:{isHidden:function(){return"0"===this.showQuestionBanner||!!this.hide}},data:function(){return{questionText:"",question:0,hide:null,feedbackDone:!1,expanded:!1,showFeedbackForm:!1,feedbackMessage:null,errorMessage:null}},watch:{showFeedbackForm:function(e){this.questionText=Object(r["translate"])("Feedback_Question".concat(this.question)),e&&setInterval((function(){L("#message").focus()}),500)}},created:function(){"0"!==this.showQuestionBanner&&this.initQuestion()},methods:{initQuestion:function(){Object(r["getCookie"])(A)?this.question=parseInt(Object(r["getCookie"])(A)):this.question=this.getRandomIntBetween(0,4);var e=(this.question+1)%4,t=6048e5;Object(r["setCookie"])(A,e,t)},getRandomIntBetween:function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)},showQuestion:function(){this.showFeedbackForm=!0,this.errorMessage=null},disableReminder:function(){r["AjaxHelper"].fetch({method:"Feedback.updateFeedbackReminderDate"}),this.hide=!0},sendFeedback:async function(){this.errorMessage=null;var e=await r["AjaxHelper"].fetch({method:"Feedback.sendFeedbackForSurvey",question:this.questionText,message:this.feedbackMessage});"success"===e.value?(L(".modal").modal("close"),this.feedbackDone=!0,this.hide=!0):this.errorMessage=e.value}}});P.render=R;var U=P;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */Object(r["createAngularJsAdapter"])({component:U,scope:{showQuestionBanner:{angularJsBind:"@"}},directiveName:"piwikFeedbackQuestion"})}})}));
//# sourceMappingURL=Feedback.umd.min.js.map