diff options
author | sgiehl <stefan@piwik.org> | 2016-03-08 00:40:06 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2016-03-08 01:01:11 +0300 |
commit | 3925e82191580988660c1404c54c56f57b659681 (patch) | |
tree | 216040f1b34e5649e6a02b53e88cc4f740d53728 | |
parent | 1cf04afda315173e7acb0545e76208a1357c440e (diff) |
handle tel links the same as mailto
-rw-r--r-- | js/piwik.js | 2 | ||||
-rw-r--r-- | piwik.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/js/piwik.js b/js/piwik.js index 6739d51b81..cd00196bd2 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -4176,7 +4176,7 @@ if (typeof window.Piwik !== 'object') { var sourceHref = sourceElement.href.replace(originalSourceHostName, sourceHostName); // browsers, such as Safari, don't downcase hostname and href - var scriptProtocol = new RegExp('^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):', 'i'); + var scriptProtocol = new RegExp('^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto|tel):', 'i'); if (!scriptProtocol.test(sourceHref)) { // track outlinks and all downloads @@ -46,7 +46,7 @@ if(!B(cJ[6])){cJ[6]=""}var cI=cJ[6];return{newVisitor:cF,uuid:cG,createTs:cD,vis }if(cX.length||cK.length){cJ=cM;cW=[cK,cC,cJ,bz(cX.slice(0,cG))];cy(cT,JSON2.stringify(cW),cr,a2,cl)}}cE+="&idsite="+bD+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+cD.getHours()+"&m="+cD.getMinutes()+"&s="+cD.getSeconds()+"&url="+n(bz(c2))+(a0.length?"&urlref="+n(bz(a0)):"")+((a9&&a9.length)?"&uid="+n(a9):"")+"&_id="+cS.uuid+"&_idts="+cS.createTs+"&_idvc="+cS.visitCount+"&_idn="+cS.newVisitor+(cK.length?"&_rcn="+n(cK):"")+(cC.length?"&_rck="+n(cC):"")+"&_refts="+cJ+"&_viewts="+cS.lastVisitTs+(String(cS.lastEcommerceOrderTs).length?"&_ects="+cS.lastEcommerceOrderTs:"")+(String(cX).length?"&_ref="+n(bz(cX.slice(0,cG))):"")+(cP?"&cs="+n(cP):"")+"&send_image=0";for(cY in ct){if(Object.prototype.hasOwnProperty.call(ct,cY)){cE+="&"+cY+"="+ct[cY]}}var c4=[];if(cZ){for(cY in cZ){if(Object.prototype.hasOwnProperty.call(cZ,cY)&&/^dimension\d+$/.test(cY)){var cI=cY.replace("dimension","");c4.push(parseInt(cI,10));c4.push(String(cI));cE+="&"+cY+"="+cZ[cY];delete cZ[cY]}}}if(cZ&&v(cZ)){cZ=null }for(cY in aZ){if(Object.prototype.hasOwnProperty.call(aZ,cY)){var cO=(-1===c4.indexOf(cY));if(cO){cE+="&dimension"+cY+"="+aZ[cY]}}}if(cZ){cE+="&data="+n(JSON2.stringify(cZ))}else{if(ac){cE+="&data="+n(JSON2.stringify(ac))}}function cL(c6,c7){var c8=JSON2.stringify(c6);if(c8.length>2){return"&"+c7+"="+n(c8)}return""}var c3=cB(bt);var cU=cB(bS);cE+=cL(c3,"cvar");cE+=cL(cU,"e_cvar");if(ax){cE+=cL(ax,"_cvar");for(cY in cV){if(Object.prototype.hasOwnProperty.call(cV,cY)){if(ax[cY][0]===""||ax[cY][1]===""){delete ax[cY]}}}if(bo){cy(cQ,JSON2.stringify(ax),bV,a2,cl)}}if(aI){if(bT){cE+=">_ms="+bT}else{if(g&&g.timing&&g.timing.requestStart&&g.timing.responseEnd){cE+=">_ms="+(g.timing.responseEnd-g.timing.requestStart)}}}cS.lastEcommerceOrderTs=B(cF)&&String(cF).length?cF:cS.lastEcommerceOrderTs;at(cS);bK();cE+=U(c0);if(cn.length){cE+="&"+cn}if(u(bI)){cE=bI(cE)}return cE}bp=function aM(){var cC=new Date();if(cm+aL<=cC.getTime()){var cD=bY("ping=1",null,"ping");be(cD,bh);return true}return false };function a3(cF,cE,cJ,cG,cC,cM){var cH="idgoal=0",cI,cD=new Date(),cK=[],cL;if(String(cF).length){cH+="&ec_id="+n(cF);cI=Math.round(cD.getTime()/1000)}cH+="&revenue="+cE;if(String(cJ).length){cH+="&ec_st="+cJ}if(String(cG).length){cH+="&ec_tx="+cG}if(String(cC).length){cH+="&ec_sh="+cC}if(String(cM).length){cH+="&ec_dt="+cM}if(co){for(cL in co){if(Object.prototype.hasOwnProperty.call(co,cL)){if(!B(co[cL][1])){co[cL][1]=""}if(!B(co[cL][2])){co[cL][2]=""}if(!B(co[cL][3])||String(co[cL][3]).length===0){co[cL][3]=0}if(!B(co[cL][4])||String(co[cL][4]).length===0){co[cL][4]=1}cK.push(co[cL])}}cH+="&ec_items="+n(JSON2.stringify(cK))}cH=bY(cH,ac,"ecommerce",cI);be(cH,bh)}function bw(cC,cG,cF,cE,cD,cH){if(String(cC).length&&B(cG)){a3(cC,cG,cF,cE,cD,cH)}}function a4(cC){if(B(cC)){a3("",cC,"","","","")}}function bx(cD,cE){var cC=bY("action_name="+n(Z(cD||aW)),cE,"log");be(cC,bh)}function aG(cE,cD){var cF,cC="(^| )(piwik[_-]"+cD;if(cE){for(cF=0;cF<cE.length;cF++){cC+="|"+cE[cF]}}cC+=")( |$)";return new RegExp(cC) -}function aB(cC){return(am&&cC&&0===String(cC).indexOf(am))}function bZ(cG,cC,cH,cD){if(aB(cC)){return 0}var cF=aG(bj,"download"),cE=aG(aN,"link"),cI=new RegExp("\\.("+cs.join("|")+")([?&#]|$)","i");if(cE.test(cG)){return"link"}if(cD||cF.test(cG)||cI.test(cC)){return"download"}if(cH){return 0}return"link"}function ag(cD){var cC;cC=cD.parentNode;while(cC!==null&&B(cC)){if(W.isLinkElement(cD)){break}cD=cC;cC=cD.parentNode}return cD}function cw(cH){cH=ag(cH);if(!W.hasNodeAttribute(cH,"href")){return}if(!B(cH.href)){return}var cG=W.getAttributeValueFromNode(cH,"href");if(aB(cG)){return}var cD=cH.pathname||bR(cH.href);var cI=cH.hostname||c(cH.href);var cJ=cI.toLowerCase();var cE=cH.href.replace(cI,cJ);var cF=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):","i");if(!cF.test(cE)){var cC=bZ(cH.className,cE,af(cJ,cD),W.hasNodeAttribute(cH,"download"));if(cC){return{type:cC,href:cE}}}}function aw(cC,cD,cE,cF){var cG=p.buildInteractionRequestParams(cC,cD,cE,cF);if(!cG){return +}function aB(cC){return(am&&cC&&0===String(cC).indexOf(am))}function bZ(cG,cC,cH,cD){if(aB(cC)){return 0}var cF=aG(bj,"download"),cE=aG(aN,"link"),cI=new RegExp("\\.("+cs.join("|")+")([?&#]|$)","i");if(cE.test(cG)){return"link"}if(cD||cF.test(cG)||cI.test(cC)){return"download"}if(cH){return 0}return"link"}function ag(cD){var cC;cC=cD.parentNode;while(cC!==null&&B(cC)){if(W.isLinkElement(cD)){break}cD=cC;cC=cD.parentNode}return cD}function cw(cH){cH=ag(cH);if(!W.hasNodeAttribute(cH,"href")){return}if(!B(cH.href)){return}var cG=W.getAttributeValueFromNode(cH,"href");if(aB(cG)){return}var cD=cH.pathname||bR(cH.href);var cI=cH.hostname||c(cH.href);var cJ=cI.toLowerCase();var cE=cH.href.replace(cI,cJ);var cF=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto|tel):","i");if(!cF.test(cE)){var cC=bZ(cH.className,cE,af(cJ,cD),W.hasNodeAttribute(cH,"download"));if(cC){return{type:cC,href:cE}}}}function aw(cC,cD,cE,cF){var cG=p.buildInteractionRequestParams(cC,cD,cE,cF);if(!cG){return }return bY(cG,null,"contentInteraction")}function cc(cE,cF,cJ,cC,cD){if(!B(cE)){return}if(aB(cE)){return cE}var cH=p.toAbsoluteUrl(cE);var cG="redirecturl="+n(cH)+"&";cG+=aw(cF,cJ,cC,(cD||cE));var cI="&";if(am.indexOf("?")<0){cI="?"}return am+cI+cG}function aR(cC,cD){if(!cC||!cD){return false}var cE=p.findTargetNode(cC);if(p.shouldIgnoreInteraction(cE)){return false}cE=p.findTargetNodeNoDefault(cC);if(cE&&!N(cE,cD)){return false}return true}function b0(cE,cD,cG){if(!cE){return}var cC=p.findParentContentNode(cE);if(!cC){return}if(!aR(cC,cE)){return}var cF=p.buildContentBlock(cC);if(!cF){return}if(!cF.target&&cG){cF.target=cG}return p.buildInteractionRequestParams(cD,cF.name,cF.piece,cF.target)}function aD(cD){if(!bH||!bH.length){return false}var cC,cE;for(cC=0;cC<bH.length;cC++){cE=bH[cC];if(cE&&cE.name===cD.name&&cE.piece===cD.piece&&cE.target===cD.target){return true}}return false}function bd(cF){if(!cF){return false}var cI=p.findTargetNode(cF);if(!cI||p.shouldIgnoreInteraction(cI)){return false }var cJ=cw(cI);if(cu&&cJ&&cJ.type){return false}if(W.isLinkElement(cI)&&W.hasNodeAttributeWithValue(cI,"href")){var cC=String(W.getAttributeValueFromNode(cI,"href"));if(0===cC.indexOf("#")){return false}if(aB(cC)){return true}if(!p.isUrlToCurrentDomain(cC)){return false}var cG=p.buildContentBlock(cF);if(!cG){return}var cE=cG.name;var cK=cG.piece;var cH=cG.target;if(!W.hasNodeAttributeWithValue(cI,p.CONTENT_TARGET_ATTR)||cI.wasContentTargetAttrReplaced){cI.wasContentTargetAttrReplaced=true;cH=p.toAbsoluteUrl(cC);W.setAnyAttribute(cI,p.CONTENT_TARGET_ATTR,cH)}var cD=cc(cC,"click",cE,cK,cH);p.setHrefAttribute(cI,cD);return true}return false}function au(cD){if(!cD||!cD.length){return}var cC;for(cC=0;cC<cD.length;cC++){bd(cD[cC])}}function aF(cC){return function(cD){if(!cC){return}var cG=p.findParentContentNode(cC);var cH;if(cD){cH=cD.target||cD.srcElement}if(!cH){cH=cC}if(!aR(cG,cH)){return}bN(bh);if(W.isLinkElement(cC)&&W.hasNodeAttributeWithValue(cC,"href")&&W.hasNodeAttributeWithValue(cC,p.CONTENT_TARGET_ATTR)){var cE=W.getAttributeValueFromNode(cC,"href"); if(!aB(cE)&&cC.wasContentTargetAttrReplaced){W.setAnyAttribute(cC,p.CONTENT_TARGET_ATTR,"")}}var cL=cw(cC);if(ad&&cL&&cL.type){return cL.type}if(bd(cG)){return"href"}var cI=p.buildContentBlock(cG);if(!cI){return}var cF=cI.name;var cM=cI.piece;var cK=cI.target;var cJ=aw("click",cF,cM,cK);be(cJ,bh);return cJ}}function by(cE){if(!cE||!cE.length){return}var cC,cD;for(cC=0;cC<cE.length;cC++){cD=p.findTargetNode(cE[cC]);if(cD&&!cD.contentInteractionTrackingSetupDone){cD.contentInteractionTrackingSetupDone=true;ab(cD,"click",aF(cD))}}}function a8(cE,cF){if(!cE||!cE.length){return[]}var cC,cD;for(cC=0;cC<cE.length;cC++){if(aD(cE[cC])){cE.splice(cC,1);cC--}else{bH.push(cE[cC])}}if(!cE||!cE.length){return[]}au(cF);by(cF);var cG=[];for(cC=0;cC<cE.length;cC++){cD=bY(p.buildImpressionRequestParams(cE[cC].name,cE[cC].piece,cE[cC].target),undefined,"contentImpressions");cG.push(cD)}return cG}function b3(cD){var cC=p.collectContent(cD);return a8(cC,cD)}function aP(cD){if(!cD||!cD.length){return[]}var cC; |