umberto 4.2.2 → 4.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## [4.2.3](https://github.com/cksource/umberto/compare/v4.2.2...v4.2.3) (2024-07-10)
5
+
6
+ ### Other changes
7
+
8
+ * Replaced Goptimize with VWO. Closes [#1196](https://github.com/cksource/umberto/issues/1196). ([commit](https://github.com/cksource/umberto/commit/6390d8a56b74a202ed81d68764a087c3a2d09f0c))
9
+
10
+
4
11
  ## [4.2.2](https://github.com/cksource/umberto/compare/v4.2.1...v4.2.2) (2024-06-25)
5
12
 
6
13
  ### Other changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umberto",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "description": "CKSource Documentation builder",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -60,7 +60,7 @@ if projectLocals
60
60
  if page.isSnippetPage
61
61
  //UMBERTO: SNIPPET: CSS
62
62
 
63
- include google-optimize
63
+ include vwo
64
64
  include google-tag-manager
65
65
  include google-analytics
66
66
 
@@ -0,0 +1,14 @@
1
+ if vwo
2
+
3
+ // VWO
4
+ link(rel="preconnect", href="https://dev.visualwebsiteoptimizer.com")
5
+ script#vwoCode(type="text/javascript").
6
+ window._vwo_code || (function() {
7
+ var account_id='!{ vwo.config.trackingId }',
8
+ version=2.1,
9
+ settings_tolerance=2000,
10
+ hide_element='body',
11
+ hide_element_style = 'opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important',
12
+ f=false,w=window,d=document,v=d.querySelector('#vwoCode'),cK='_vwo_'+account_id+'_settings',cc={};try{var c=JSON.parse(localStorage.getItem('_vwo_'+account_id+'_config'));cc=c&&typeof c==='object'?c:{}}catch(e){}var stT=cc.stT==='session'?w.sessionStorage:w.localStorage;code={use_existing_jquery:function(){return typeof use_existing_jquery!=='undefined'?use_existing_jquery:undefined},library_tolerance:function(){return typeof library_tolerance!=='undefined'?library_tolerance:undefined},settings_tolerance:function(){return cc.sT||settings_tolerance},hide_element_style:function(){return'{'+(cc.hES||hide_element_style)+'}'},hide_element:function(){if(performance.getEntriesByName('first-contentful-paint')[0]){return''}return typeof cc.hE==='string'?cc.hE:hide_element},getVersion:function(){return version},finish:function(e){if(!f){f=true;var t=d.getElementById('_vis_opt_path_hides');if(t)t.parentNode.removeChild(t);if(e)(new Image).src='https://dev.visualwebsiteoptimizer.com/ee.gif?a='+account_id+e}},finished:function(){return f},addScript:function(e){var t=d.createElement('script');t.type='text/javascript';if(e.src){t.src=e.src}else{t.text=e.text}d.getElementsByTagName('head')[0].appendChild(t)},load:function(e,t){var i=this.getSettings(),n=d.createElement('script'),r=this;t=t||{};if(i){n.textContent=i;d.getElementsByTagName('head')[0].appendChild(n);if(!w.VWO||VWO.caE){stT.removeItem(cK);r.load(e)}}else{var o=new XMLHttpRequest;o.open('GET',e,true);o.withCredentials=!t.dSC;o.responseType=t.responseType||'text';o.onload=function(){if(t.onloadCb){return t.onloadCb(o,e)}if(o.status===200){_vwo_code.addScript({text:o.responseText})}else{_vwo_code.finish('&e=loading_failure:'+e)}};o.onerror=function(){if(t.onerrorCb){return t.onerrorCb(e)}_vwo_code.finish('&e=loading_failure:'+e)};o.send()}},getSettings:function(){try{var e=stT.getItem(cK);if(!e){return}e=JSON.parse(e);if(Date.now()>e.e){stT.removeItem(cK);return}return e.s}catch(e){return}},init:function(){if(d.URL.indexOf('__vwo_disable__')>-1)return;var e=this.settings_tolerance();w._vwo_settings_timer=setTimeout(function(){_vwo_code.finish();stT.removeItem(cK)},e);var t;if(this.hide_element()!=='body'){t=d.createElement('style');var i=this.hide_element(),n=i?i+this.hide_element_style():'',r=d.getElementsByTagName('head')[0];t.setAttribute('id','_vis_opt_path_hides');v&&t.setAttribute('nonce',v.nonce);t.setAttribute('type','text/css');if(t.styleSheet)t.styleSheet.cssText=n;else t.appendChild(d.createTextNode(n));r.appendChild(t)}else{t=d.getElementsByTagName('head')[0];var n=d.createElement('div');n.style.cssText='z-index: 2147483647 !important;position: fixed !important;left: 0 !important;top: 0 !important;width: 100% !important;height: 100% !important;background: white !important;';n.setAttribute('id','_vis_opt_path_hides');n.classList.add('_vis_hide_layer');t.parentNode.insertBefore(n,t.nextSibling)}var o='https://dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&vn='+version;if(w.location.search.indexOf('_vwo_xhr')!==-1){this.addScript({src:o})}else{this.load(o+'&x=true')}}};w._vwo_code=code;code.init();})();
13
+
14
+ // End VWO
@@ -1,15 +0,0 @@
1
- if googleoptimize
2
-
3
- // Google Optimize
4
- script.
5
- if (!{ JSON.stringify(googleoptimize.domains) }.indexOf(location.hostname) !== -1) {
6
- (function (w, d, s, i) {
7
- var f = d.getElementsByTagName(s)[0],
8
- j = d.createElement(s);
9
- j.async = true;
10
- j.src = 'https://www.googleoptimize.com/optimize.js?id=' + i;
11
- f.parentNode.insertBefore(j, f);
12
- })( window, document, 'script', '!{ googleoptimize.id }' );
13
- }
14
-
15
- // End Google Optimize