From 7815ebd9206d4fc8a860918080d70f5d0d094dab Mon Sep 17 00:00:00 2001 From: sualko Date: Fri, 11 May 2018 20:23:41 +0200 Subject: [PATCH] build v0.4.1 --- appinfo/info.xml | 2 +- build/appinfo/info.xml | 2 +- build/css/settings.css | 6 +++--- build/js/settings/admin.js | 4 ++++ build/js/settings/admin.min.js | 2 +- build/js/settings/admin.min.js.map | 2 +- build/js/track.js | 8 ++++---- build/js/track.min.js | 2 +- build/js/track.min.js.map | 2 +- package.json | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 776c1c8..f187c5b 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -4,7 +4,7 @@ Piwik/Matomo Tracking Track users with Piwik/Matomo Track users with Piwik/Matomo - 0.4.0 + 0.4.1 agpl Klaus Herberth tools diff --git a/build/appinfo/info.xml b/build/appinfo/info.xml index 776c1c8..f187c5b 100644 --- a/build/appinfo/info.xml +++ b/build/appinfo/info.xml @@ -4,7 +4,7 @@ Piwik/Matomo Tracking Track users with Piwik/Matomo Track users with Piwik/Matomo - 0.4.0 + 0.4.1 agpl Klaus Herberth tools diff --git a/build/css/settings.css b/build/css/settings.css index 2cbe83a..4a7f334 100644 --- a/build/css/settings.css +++ b/build/css/settings.css @@ -10,14 +10,14 @@ width: 100%; } -#piwikSettings input { +#piwikSettings input, #piwikSettings label { transition: background-color 0.5s; } -#piwikSettings input.piwik-success { +#piwikSettings input.piwik-success, #piwikSettings label.piwik-success { background-color: #4eb387; } -#piwikSettings input.piwik-error { +#piwikSettings input.piwik-error, #piwikSettings label.piwik-error { background-color: #f65c38; } \ No newline at end of file diff --git a/build/js/settings/admin.js b/build/js/settings/admin.js index 1b8e2fc..cf5c94f 100644 --- a/build/js/settings/admin.js +++ b/build/js/settings/admin.js @@ -2,6 +2,10 @@ $(function() { function showRequestResult(element, result) { + if (element.attr('type') === 'checkbox') { + element = $('label[for="' + element.attr('id') + '"]'); + } + element.removeClass('piwik-success piwik-error'); element.addClass('piwik-' + result); diff --git a/build/js/settings/admin.min.js b/build/js/settings/admin.min.js index 2f0c581..13b6027 100644 --- a/build/js/settings/admin.min.js +++ b/build/js/settings/admin.min.js @@ -1,2 +1,2 @@ -$(function(){function showRequestResult(element,result){element.removeClass("piwik-success piwik-error"),element.addClass("piwik-"+result);var timeout=element.data("timeout");timeout&&clearTimeout(timeout),timeout=setTimeout(function(){element.removeClass("piwik-success piwik-error")},1e3),element.data("timeout",timeout)}$("#piwikUrl").attr("placeholder","e.g. //"+window.location.host+"/piwik/"),$("#piwikSettings input").change(function(){var element=$(this),key=$(this).attr("name"),value="checkbox"===$(this).attr("type")?$(this).prop("checked"):$(this).val();$.ajax({method:"PUT",url:OC.generateUrl("apps/piwik/settings/"+key),data:{value:value},success:function(response){showRequestResult(element,response.status)},error:function(){showRequestResult(element,"error")}})})}); +$(function(){function showRequestResult(element,result){"checkbox"===element.attr("type")&&(element=$('label[for="'+element.attr("id")+'"]')),element.removeClass("piwik-success piwik-error"),element.addClass("piwik-"+result);var timeout=element.data("timeout");timeout&&clearTimeout(timeout),timeout=setTimeout(function(){element.removeClass("piwik-success piwik-error")},1e3),element.data("timeout",timeout)}$("#piwikUrl").attr("placeholder","e.g. //"+window.location.host+"/piwik/"),$("#piwikSettings input").change(function(){var element=$(this),key=$(this).attr("name"),value="checkbox"===$(this).attr("type")?$(this).prop("checked"):$(this).val();$.ajax({method:"PUT",url:OC.generateUrl("apps/piwik/settings/"+key),data:{value:value},success:function(response){showRequestResult(element,response.status)},error:function(){showRequestResult(element,"error")}})})}); //# sourceMappingURL=admin.min.js.map \ No newline at end of file diff --git a/build/js/settings/admin.min.js.map b/build/js/settings/admin.min.js.map index 0cf7c92..385d7d6 100644 --- a/build/js/settings/admin.min.js.map +++ b/build/js/settings/admin.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../js/settings/admin.js"],"names":["$","showRequestResult","element","result","removeClass","addClass","timeout","data","clearTimeout","setTimeout","attr","window","location","host","change","this","key","value","prop","val","ajax","method","url","OC","generateUrl","success","response","status","error"],"mappings":"AAEAA,EAAE,WACC,SAASC,kBAAkBC,QAASC,QACjCD,QAAQE,YAAY,6BACpBF,QAAQG,SAAS,SAAWF,QAE5B,IAAIG,QAAUJ,QAAQK,KAAK,WAEvBD,SACDE,aAAaF,SAGhBA,QAAUG,WAAW,WAClBP,QAAQE,YAAY,8BACpB,KAEHF,QAAQK,KAAK,UAAWD,SAG3BN,EAAE,aAAaU,KAAK,cAAe,UAAYC,OAAOC,SAASC,KAAO,WAEtEb,EAAE,wBAAwBc,OAAO,WAC9B,IAAIZ,QAAUF,EAAEe,MACZC,IAAMhB,EAAEe,MAAML,KAAK,QACnBO,MAAiC,aAAzBjB,EAAEe,MAAML,KAAK,QAAyBV,EAAEe,MAAMG,KAAK,WAAalB,EAAEe,MAAMI,MAEpFnB,EAAEoB,MACCC,OAAQ,MACRC,IAAKC,GAAGC,YAAY,uBAAyBR,KAC7CT,MACGU,MAAOA,OAEVQ,QAAS,SAASC,UACfzB,kBAAkBC,QAASwB,SAASC,SAEvCC,MAAO,WACJ3B,kBAAkBC,QAAS","file":"admin.min.js"} \ No newline at end of file +{"version":3,"sources":["../../../js/settings/admin.js"],"names":["$","showRequestResult","element","result","attr","removeClass","addClass","timeout","data","clearTimeout","setTimeout","window","location","host","change","this","key","value","prop","val","ajax","method","url","OC","generateUrl","success","response","status","error"],"mappings":"AAEAA,EAAE,WACC,SAASC,kBAAkBC,QAASC,QACJ,aAAzBD,QAAQE,KAAK,UACdF,QAAUF,EAAE,cAAgBE,QAAQE,KAAK,MAAQ,OAGpDF,QAAQG,YAAY,6BACpBH,QAAQI,SAAS,SAAWH,QAE5B,IAAII,QAAUL,QAAQM,KAAK,WAEvBD,SACDE,aAAaF,SAGhBA,QAAUG,WAAW,WAClBR,QAAQG,YAAY,8BACpB,KAEHH,QAAQM,KAAK,UAAWD,SAG3BP,EAAE,aAAaI,KAAK,cAAe,UAAYO,OAAOC,SAASC,KAAO,WAEtEb,EAAE,wBAAwBc,OAAO,WAC9B,IAAIZ,QAAUF,EAAEe,MACZC,IAAMhB,EAAEe,MAAMX,KAAK,QACnBa,MAAiC,aAAzBjB,EAAEe,MAAMX,KAAK,QAAyBJ,EAAEe,MAAMG,KAAK,WAAalB,EAAEe,MAAMI,MAEpFnB,EAAEoB,MACCC,OAAQ,MACRC,IAAKC,GAAGC,YAAY,uBAAyBR,KAC7CR,MACGS,MAAOA,OAEVQ,QAAS,SAASC,UACfzB,kBAAkBC,QAASwB,SAASC,SAEvCC,MAAO,WACJ3B,kBAAkBC,QAAS","file":"admin.min.js"} \ No newline at end of file diff --git a/build/js/track.js b/build/js/track.js index ff49127..df124eb 100644 --- a/build/js/track.js +++ b/build/js/track.js @@ -1,5 +1,5 @@ /*! - * owncloud_piwik v0.4.0 - 2018-04-16 + * owncloud_piwik v0.4.1 - 2018-05-11 * * Copyright (c) 2018 Klaus Herberth
* Released under the MIT license @@ -7,7 +7,7 @@ * Please see https://github.com/sualko/owncloud_piwik * * @author Klaus Herberth - * @version 0.4.0 + * @version 0.4.1 * @license MIT */ @@ -53,7 +53,7 @@ var _paq = _paq || []; function track(options) { var app = null; var path = window.location.pathname; - var pathparts = path.match(/index\.php\/apps\/([a-z0-9]+)\/?/i) || path.match(/index\.php\/([a-z0-9]+)(\/([a-z0-9]+))?/i) || []; + var pathparts = path.match(/(?:index\.php\/)?apps\/([a-z0-9]+)\/?/i) || path.match(/(?:index\.php\/)?([a-z0-9]+)(\/([a-z0-9]+))?/i) || []; if (pathparts.length >= 2) { app = pathparts[1]; @@ -86,7 +86,7 @@ var _paq = _paq || []; _paq.push(['setUserId', OC.currentUser]); } - if (options.trackDir === 'on') { + if (options.trackDir === 'on' || options.trackDir === true) { // track file browsing $('#app-content').delegate('>div', 'afterChangeDirectory', function() { diff --git a/build/js/track.min.js b/build/js/track.min.js index 94ee3e6..d5c6223 100644 --- a/build/js/track.min.js +++ b/build/js/track.min.js @@ -1,2 +1,2 @@ -var _paq=_paq||[];!function(){"use strict";function track(options){var app=null,path=window.location.pathname,pathparts=path.match(/index\.php\/apps\/([a-z0-9]+)\/?/i)||path.match(/index\.php\/([a-z0-9]+)(\/([a-z0-9]+))?/i)||[];if(pathparts.length>=2){if("s"===(app=pathparts[1])){app="share";var sharevalue=$('input[name="filename"]').val();sharevalue?(sharevalue=pathparts[3]+" ("+sharevalue+")",_paq.push(["setCustomVariable","3","ShareNodes",sharevalue,"page"])):sharevalue=pathparts[3],_paq.push(["setCustomVariable","2","Shares",pathparts[3],"page"])}_paq.push(["setCustomVariable","1","App",app,"page"])}if(OC&&OC.currentUser&&_paq.push(["setUserId",OC.currentUser]),"on"===options.trackDir&&$("#app-content").delegate(">div","afterChangeDirectory",function(){_paq.push(["setDocumentTitle",document.title]),_paq.push(["setCustomUrl",window.location.href]),_paq.push(["trackPageView"])}),_paq.push(["setTrackerUrl",options.url+"piwik.php"]),_paq.push(["setSiteId",options.siteId]),"files"===app&&"on"===options.trackDir||_paq.push(["trackPageView"]),"undefined"==typeof Piwik){var d=document,g=d.createElement("script"),s=d.getElementsByTagName("script")[0];g.type="text/javascript",g.async=!0,g.defer=!0,g.src=options.url+"piwik.js",s.parentNode.insertBefore(g,s)}}var piwik;if("undefined"!=typeof localStorage){var piwikString=localStorage.getItem("piwik");try{piwik=JSON.parse(piwikString)}catch(err){}}piwik&&(piwik.validUntil||0)>(new Date).getTime()&&!oc_debug?track(piwik):$.ajax({method:"GET",url:OC.generateUrl("apps/piwik/settings")}).done(function(response){var data=response?response.data:{};data.siteId&&data.url&&(data.validUntil=(new Date).getTime()+1e3*data.validity,localStorage.setItem("piwik",JSON.stringify(data)),track(data))})}(); +var _paq=_paq||[];!function(){"use strict";function track(options){var app=null,path=window.location.pathname,pathparts=path.match(/(?:index\.php\/)?apps\/([a-z0-9]+)\/?/i)||path.match(/(?:index\.php\/)?([a-z0-9]+)(\/([a-z0-9]+))?/i)||[];if(pathparts.length>=2){if("s"===(app=pathparts[1])){app="share";var sharevalue=$('input[name="filename"]').val();sharevalue?(sharevalue=pathparts[3]+" ("+sharevalue+")",_paq.push(["setCustomVariable","3","ShareNodes",sharevalue,"page"])):sharevalue=pathparts[3],_paq.push(["setCustomVariable","2","Shares",pathparts[3],"page"])}_paq.push(["setCustomVariable","1","App",app,"page"])}if(OC&&OC.currentUser&&_paq.push(["setUserId",OC.currentUser]),"on"!==options.trackDir&&!0!==options.trackDir||$("#app-content").delegate(">div","afterChangeDirectory",function(){_paq.push(["setDocumentTitle",document.title]),_paq.push(["setCustomUrl",window.location.href]),_paq.push(["trackPageView"])}),_paq.push(["setTrackerUrl",options.url+"piwik.php"]),_paq.push(["setSiteId",options.siteId]),"files"===app&&"on"===options.trackDir||_paq.push(["trackPageView"]),"undefined"==typeof Piwik){var d=document,g=d.createElement("script"),s=d.getElementsByTagName("script")[0];g.type="text/javascript",g.async=!0,g.defer=!0,g.src=options.url+"piwik.js",s.parentNode.insertBefore(g,s)}}var piwik;if("undefined"!=typeof localStorage){var piwikString=localStorage.getItem("piwik");try{piwik=JSON.parse(piwikString)}catch(err){}}piwik&&(piwik.validUntil||0)>(new Date).getTime()&&!oc_debug?track(piwik):$.ajax({method:"GET",url:OC.generateUrl("apps/piwik/settings")}).done(function(response){var data=response?response.data:{};data.siteId&&data.url&&(data.validUntil=(new Date).getTime()+1e3*data.validity,localStorage.setItem("piwik",JSON.stringify(data)),track(data))})}(); //# sourceMappingURL=track.min.js.map \ No newline at end of file diff --git a/build/js/track.min.js.map b/build/js/track.min.js.map index 1f4a377..cb32883 100644 --- a/build/js/track.min.js.map +++ b/build/js/track.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../js/track.js"],"names":["_paq","track","options","app","path","window","location","pathname","pathparts","match","length","sharevalue","$","val","push","OC","currentUser","trackDir","delegate","document","title","href","url","siteId","Piwik","d","g","createElement","s","getElementsByTagName","type","async","defer","src","parentNode","insertBefore","piwik","localStorage","piwikString","getItem","JSON","parse","err","validU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tC,IAAIC,YAAcD,aAAaE,QAAQ,SAEvC,IACGH,MAAQI,KAAKC,MAAMH,aACpB,MAAOI,OAGRN,QAAUA,MAAMO,YAAc,IAAK,IAAKC,MAAQC,YAAcC,SAE/D7C,MAAMmC,OAGNxB,EAAEmC,MACIC,OAAQ,MACR1B,IAAKP,GAAGkC,YAAY,yBAEtBC,KAAK,SAASC,UACZ,IAAIC,KAAOD,SAAWA,SAASC,QAE3BA,KAAK7B,QAAU6B,KAAK9B,MACrB8B,KAAKT,YAAa,IAAKC,MAAQC,UAA6B,IAAhBO,KAAKC,SAEjDhB,aAAaiB,QAAQ,QAASd,KAAKe,UAAUH,OAE7CnD,MAAMmD,SA9BrB","file":"track.min.js"} \ No newline at end of file +{"version":3,"sources":["../../js/track.js"],"names":["_paq","track","options","app","path","window","location","pathname","pathparts","match","length","sharevalue","$","val","push","OC","currentUser","trackDir","delegate","document","title","href","url","siteId","Piwik","d","g","createElement","s","getElementsByTagName","type","async","defer","src","parentNode","insertBefore","piwik","localStorage","piwikString","getItem","JSON","parse","err","validUntil","Date","getTime","oc_debug","ajax","method","generateUrl","done","response","data","validity","setItem","stringify"],"mappings":"AAEA,IAAIA,KAAOA,UAEV,WACE,aAkCA,SAASC,MAAMC,SACZ,IAAIC,IAAM,KACNC,KAAOC,OAAOC,SAASC,SACvBC,UAAYJ,KAAKK,MAAM,2CAA6CL,KAAKK,MAAM,qDAEnF,GAAID,UAAUE,QAAU,EAAG,CAGxB,GAAY,OAFZP,IAAMK,UAAU,IAEC,CAEdL,IAAM,QAEN,IAAIQ,WAAaC,EAAE,0BAA0BC,MAEzCF,YACDA,WAAaH,UAAU,GAAK,KAAOG,WAAa,IAGhDX,KAAKc,MAAM,oBAAqB,IAAK,aAAcH,WAAY,UAE/DA,WAAaH,UAAU,GAI1BR,KAAKc,MAAM,oBAAqB,IAAK,SAAUN,UAAU,GAAI,SAIhER,KAAKc,MAAM,oBAAqB,IAAK,MAAOX,IAAK,SA4BpD,GAzBIY,IAAMA,GAAGC,aAEVhB,KAAKc,MAAM,YAAaC,GAAGC,cAGL,OAArBd,QAAQe,WAA0C,IAArBf,QAAQe,UAGtCL,EAAE,gBAAgBM,SAAS,OAAQ,uBAAwB,WAExDlB,KAAKc,MAAM,mBAAoBK,SAASC,QACxCpB,KAAKc,MAAM,eAAgBT,OAAOC,SAASe,OAC3CrB,KAAKc,MAAM,oBAKjBd,KAAKc,MAAM,gBAAiBZ,QAAQoB,IAAM,cAC1CtB,KAAKc,MAAM,YAAaZ,QAAQqB,SAEpB,UAARpB,KAAwC,OAArBD,QAAQe,UAE5BjB,KAAKc,MAAM,kBAGO,oBAAVU,MAAuB,CAE/B,IAAIC,EAAIN,SACLO,EAAID,EAAEE,cAAc,UACpBC,EAAIH,EAAEI,qBAAqB,UAAU,GACxCH,EAAEI,KAAO,kBACTJ,EAAEK,OAAQ,EACVL,EAAEM,OAAQ,EACVN,EAAEO,IAAM/B,QAAQoB,IAAM,WACtBM,EAAEM,WAAWC,aAAaT,EAAGE,IAjGnC,IAAIQ,MAEJ,GAA4B,oBAAjBC,aAA8B,CACtC,IAAIC,YAAcD,aAAaE,QAAQ,SAEvC,IACGH,MAAQI,KAAKC,MAAMH,aACpB,MAAOI,OAGRN,QAAUA,MAAMO,YAAc,IAAK,IAAKC,MAAQC,YAAcC,SAE/D7C,MAAMmC,OAGNxB,EAAEmC,MACIC,OAAQ,MACR1B,IAAKP,GAAGkC,YAAY,yBAEtBC,KAAK,SAASC,UACZ,IAAIC,KAAOD,SAAWA,SAASC,QAE3BA,KAAK7B,QAAU6B,KAAK9B,MACrB8B,KAAKT,YAAa,IAAKC,MAAQC,UAA6B,IAAhBO,KAAKC,SAEjDhB,aAAaiB,QAAQ,QAASd,KAAKe,UAAUH,OAE7CnD,MAAMmD,SA9BrB","file":"track.min.js"} \ No newline at end of file diff --git a/package.json b/package.json index 0c7e263..0ae8c44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "owncloud_piwik", - "version": "0.4.0", + "version": "0.4.1", "description": "Track owncloud/nextcloud users with piwik", "repository": { "type": "git",