Merge "Fix 'data:,'-uri attachement treatment"
diff --git a/dev/demo/vcdemo.js b/dev/demo/vcdemo.js
index b9a7b1a..e0b9f16 100644
--- a/dev/demo/vcdemo.js
+++ b/dev/demo/vcdemo.js
@@ -129,9 +129,6 @@
       ['author', 'text']
     ]).fromJson(json);
 
-    document.addEventListener('vcChange', function (e) {
-      KorAP.vc.checkStatActive(e.detail);
-      }, false);
     
     document.getElementById('vc-view').appendChild(KorAP.vc.element());
 
diff --git a/dev/js/spec/statSpec.js b/dev/js/spec/statSpec.js
index 25e55a2..93001bd 100644
--- a/dev/js/spec/statSpec.js
+++ b/dev/js/spec/statSpec.js
@@ -356,11 +356,6 @@
      */
 	describe ('KorAP.CorpusStat.Disable', function(){
 	
-	  document.addEventListener('vcChange', function (e) {
-	    if(KorAP.vc){
-        KorAP.vc.checkStatActive(e.detail);
-	    }
-        }, false);
 	  
 	  /**
 	   * If the user defines a new vc, the statistic should be disabled,
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index d94b1b5..cc1d53b 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -91,10 +91,6 @@
 
     var vc = KorAP.vc;
     
-    document.addEventListener('vcChange', function (e) {
-      vc.checkStatActive(e.detail);
-      }, false);
-
     // Add vc name object
     if (input) {
       input.style.display = 'none';
diff --git a/dev/js/src/loc/de.js b/dev/js/src/loc/de.js
index 8192df3..f7f16ca 100644
--- a/dev/js/src/loc/de.js
+++ b/dev/js/src/loc/de.js
@@ -40,4 +40,6 @@
   loc.SHOW_STAT = 'Korpusstatistik';
   //verbose description, for title attributes for example
   //loc.VERB_SHOWSTAT = 'Korpusstatistik';
+
+  loc.NEW_CONSTRAINT = 'Neue Bedingung';
 });
diff --git a/dev/js/src/vc.js b/dev/js/src/vc.js
index 4bc5e13..fd67863 100644
--- a/dev/js/src/vc.js
+++ b/dev/js/src/vc.js
@@ -329,6 +329,11 @@
       // Add panel to display corpus statistic, ...
       this.addVcInfPanel();
       
+      //Adds EventListener for corpus changes
+      this._element.addEventListener('vcChange', function (e) {
+        that.checkStatActive(e.detail);
+      }, false);
+      
       return this._element;
     },
 
@@ -367,9 +372,10 @@
      */    
     update : function() {
       this._root.update();
-      var vcchevent = new CustomEvent('vcChange', {'detail':this});
-      document.dispatchEvent(vcchevent);
-      
+      if (KorAP.vc){
+        var vcchevent = new CustomEvent('vcChange', {'detail':this});
+        this.element().dispatchEvent(vcchevent);
+      };
       return this;
     },
     /**
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index 132c4a8..b012e1f 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -150,10 +150,8 @@
       };
       
       if(KorAP.vc){
-      //Replaced through Event
-      //KorAP.vc.checkGrayingStat(this); 
       var vcchevent = new CustomEvent('vcChange', {'detail':this});
-      document.dispatchEvent(vcchevent);
+      KorAP.vc.element().dispatchEvent(vcchevent);
       }
       
       return e;
diff --git a/dev/js/src/vc/docgroup.js b/dev/js/src/vc/docgroup.js
index 858e847..c73a325 100644
--- a/dev/js/src/vc/docgroup.js
+++ b/dev/js/src/vc/docgroup.js
@@ -211,7 +211,7 @@
       group.appendChild(op.element());
 
       var vcchevent = new CustomEvent('vcChange', {'detail':this});
-      document.dispatchEvent(vcchevent);
+      KorAP.vc.element().dispatchEvent(vcchevent);
       
       return this;
     },
diff --git a/dev/js/src/vc/docgroupref.js b/dev/js/src/vc/docgroupref.js
index f72e27a..9425fb3 100644
--- a/dev/js/src/vc/docgroupref.js
+++ b/dev/js/src/vc/docgroupref.js
@@ -111,7 +111,7 @@
       };  
      
       var vcchevent = new CustomEvent('vcChange', {'detail':this});
-      document.dispatchEvent(vcchevent);
+      KorAP.vc.element().dispatchEvent(vcchevent);
       
       return this.element();
     },
diff --git a/dev/js/src/view/corpstatv.js b/dev/js/src/view/corpstatv.js
index fa9a135..81c18cd 100644
--- a/dev/js/src/view/corpstatv.js
+++ b/dev/js/src/view/corpstatv.js
@@ -142,19 +142,19 @@
         var reloadspan = document.createElement('div');
         reloadspan.classList.add('reloadStatB'); 
         reloadspan.classList.add('button-group');
-        reloadspan.classList.add('button-panel');    
+        reloadspan.classList.add('button-panel');
         reloadb = reloadspan.addE('span');
         reloadb.classList.add('refresh');
           
-        var that = this;          
-        reloadb.addEventListener("click", function (e){    
+        var that = this;
+        reloadb.addEventListener("click", function (e){
         statt.classList.remove('stdisabled');
         that.panel.reloadCorpStat(); 
         });
           
 
         statt.appendChild(reloadspan);
-        statt.classList.add('stdisabled');        
+        statt.classList.add('stdisabled');
         }
     },
 
diff --git a/lib/Kalamar/Plugin/Piwik.pm b/lib/Kalamar/Plugin/Piwik.pm
index 9b0c909..e991250 100644
--- a/lib/Kalamar/Plugin/Piwik.pm
+++ b/lib/Kalamar/Plugin/Piwik.pm
@@ -31,7 +31,7 @@
   $mojo->content_block(
     'faq' => {
       inline => '<section name="piwik-opt-out">' .
-        '<h3><%= loc("Piwik_HowToOptOut", "How can I opt-out?") %></h3>' .
+        '<h3><%= loc("Piwik_HowToOptOut", "How can I opt-out from Matomo?") %></h3>' .
         '<%= piwik_tag "opt-out" %>' .
         '</section>'
       }