2 Commits d46b38afe6 ... 625e893f74

Author SHA1 Message Date
  Bachir Soussi Chiadmi 625e893f74 tracking link actions in connection mode 5 years ago
  Bachir Soussi Chiadmi c29d18cf86 tracking link actions in text mode 5 years ago

+ 4 - 0
assets/dist/main.css

@@ -883,6 +883,10 @@ main#content.mode-text section.enonce {
         color: inherit; }
       main#content.mode-text section.enonce div.text div.paragraph span.link.text:after {
         content: ':'; }
+      main#content.mode-text section.enonce div.text div.paragraph span.unknown-link {
+        font-weight: 600;
+        text-decoration: line-through;
+        color: inherit; }
       main#content.mode-text section.enonce div.text div.paragraph section.enonce, main#content.mode-text section.enonce div.text div.paragraph section.item {
         padding-left: 2em;
         border-left: 1px solid #999; }

File diff suppressed because it is too large
+ 0 - 0
assets/dist/main.js


File diff suppressed because it is too large
+ 0 - 0
assets/dist/main.js.map


+ 2 - 0
assets/main.js

@@ -33,7 +33,9 @@ var Layout = {
 		if(typeof _paq !== 'undefined'){
 		  _paq.push(['setCustomUrl', m.route.get()]);
 		  // _paq.push(['setDocumentTitle', e.title]);
+			_paq.push(['setGenerationTimeMs', 0]);
 		  _paq.push(['trackPageView']);
+			// _paq.push(['trackEvent', 'Audio', 'play', node.title]);
 		}
 
 		return [

+ 5 - 0
assets/main.scss

@@ -373,6 +373,11 @@ main#content.mode-text{
         span.link.text:after{
           content:':'
         }
+        span.unknown-link{
+          font-weight: 600;
+          text-decoration:line-through;
+          color: inherit;
+        }
         section.enonce, section.item{
           padding-left:2em;
           border-left: 1px solid #999;

+ 15 - 0
assets/modules/ModeConnections.js

@@ -160,6 +160,11 @@ var _Dot = {
             'class':'close-link-btn',
             onclick(e){
               vn.state.opened = 0;
+              // matomo
+              if(typeof _paq !== 'undefined'){
+                console.log('Matomo Connection closed', vn.state.breadcrumb);
+                _paq.push(['trackEvent', 'Connections', 'closed', vn.state.breadcrumb]);
+              }
             }
           }//, m('span') // , m.trust("🗙")
         ),
@@ -209,12 +214,22 @@ var _Dot = {
           'class':'title',
           onclick(e){
             if(!vn.state.opened) vn.state.opened = 1;
+            // matomo
+            if(typeof _paq !== 'undefined'){
+              console.log('Matomo Connection opened', vn.state.breadcrumb);
+              _paq.push(['trackEvent', 'Connections', 'open', vn.state.breadcrumb]);
+            }
           }
         }, m.trust(this.nested || _dbs.active_type_filter ? this.breadcrumb : this.title)),
         m('p', {
           'class':'summary',
           onclick(e){
             if(!vn.state.opened) vn.state.opened = 1;
+            // matomo
+            if(typeof _paq !== 'undefined'){
+              console.log('Matomo Connection opened', vn.state.breadcrumb);
+              _paq.push(['trackEvent', 'Connections', 'open', vn.state.breadcrumb]);
+            }
           }
         }, m.trust(this.summary))
       ]

+ 23 - 3
assets/modules/ModeText.js

@@ -39,10 +39,11 @@ var _Link = {
     if (!this.tid_known) {
       // console.log(`!! in ${this.id}, target id ${this.tid} is unkonwn !!`);
     }
+
     if(this.opened && this.tid_known){
       console.log('link vn.state', vn.state);
-      // traget object
 
+      // traget object
       this.tob = Object.assign({"nested":true},_dbs.data_byid[vn.attrs.lang][this.tid]);
       // this.tob = Object.assign({'lang':vn.attrs.lang}, this.tob);
       console.log('this.tob',this.tob);
@@ -56,6 +57,11 @@ var _Link = {
                 // e.preventDefault();
                 console.log('click close btn', this);
                 vn.state.opened = false;
+                // matomo
+            		if(typeof _paq !== 'undefined'){
+                  // console.log('Matomo text closed', vn.state.tob.breadcrumb);
+            			_paq.push(['trackEvent', 'Text', 'closed', vn.state.tob.breadcrumb]);
+            		}
                 // return false;
               }
             }),//, m('span', m.trust("🗙"))),
@@ -64,19 +70,33 @@ var _Link = {
               : m(_Item, this.tob)
           ]
         );
-    }else{
+    }else if(this.tid_known){
       // console.log(vn);
+      this.tob = _dbs.data_byid[vn.attrs.lang][this.tid];
+
       return m('a', {
           'class':'link',
           'href':'#'+this.tid,
           'rel':this.tid,
           onclick(e){
             e.preventDefault();
-            console.log('click', this);
+            // console.log('click open this', this);
+            console.log('click open vn', vn);
+
             vn.state.opened = true;
+            // matomo
+            if(typeof _paq !== 'undefined'){
+              // console.log('Matomo text opened', vn.state.tob.breadcrumb);
+              _paq.push(['trackEvent', 'Text', 'opened', vn.state.tob.breadcrumb]);
+            }
             return false;
           }
         }, vn.children);
+    }else{
+      // if target is unknown
+      return m('span', {
+        'class':'unknown-link'
+      }, vn.children);
     }
 
   }

Some files were not shown because too many files changed in this diff