Changeset 2452249
- Timestamp:
- 01/08/2021 02:31:38 AM (5 years ago)
- Location:
- croct
- Files:
-
- 10 edited
- 1 copied
-
tags/1.0.5 (copied) (copied from croct/trunk)
-
tags/1.0.5/croct.php (modified) (1 diff)
-
tags/1.0.5/src/Dependency/BootstrapScript.php (modified) (1 diff)
-
tags/1.0.5/src/Dependency/InterestTrackingScript.php (modified) (1 diff)
-
tags/1.0.5/src/Plugin.php (modified) (1 diff)
-
tags/1.0.5/static/js/wp-croct.js (modified) (1 diff)
-
trunk/croct.php (modified) (1 diff)
-
trunk/src/Dependency/BootstrapScript.php (modified) (1 diff)
-
trunk/src/Dependency/InterestTrackingScript.php (modified) (1 diff)
-
trunk/src/Plugin.php (modified) (1 diff)
-
trunk/static/js/wp-croct.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
croct/tags/1.0.5/croct.php
r2452232 r2452249 6 6 * Plugin Name: Croct 7 7 * Plugin URI: https://croct.com/wordpress 8 * Version: 1.0. 48 * Version: 1.0.5 9 9 * Description: Content Personalization for WordPress. 10 10 * Requires at least: 4.0 -
croct/tags/1.0.5/src/Dependency/BootstrapScript.php
r2452232 r2452249 19 19 } 20 20 21 if (typeof wpCroct === 'undefined') { 21 if (typeof wpCroct === 'undefined' ) { 22 const queue = []; 23 24 window.wpCroct = { 25 queue: queue, 26 enqueue: (method, args) => queue.push([method, args]), 27 }; 28 22 29 const script = document.getElementById(%s); 23 30 -
croct/tags/1.0.5/src/Dependency/InterestTrackingScript.php
r2384748 r2452249 53 53 { 54 54 return \sprintf( 55 'wpCroct.trackInterests(%s, %s);', 56 \json_encode($this->trigger), 57 \json_encode($this->interests) 55 'wpCroct.enqueue("trackInterests", %s);', 56 \json_encode([$this->trigger, $this->interests]) 58 57 ); 59 58 } -
croct/tags/1.0.5/src/Plugin.php
r2452232 r2452249 13 13 final class Plugin 14 14 { 15 const VERSION = '1.0. 4';15 const VERSION = '1.0.5'; 16 16 17 17 const OPTIONS_GROUP = 'croct'; -
croct/tags/1.0.5/static/js/wp-croct.js
r2384748 r2452249 1 1 (function (window, croct) { 2 const queue = typeof window.wpCroct === 'undefined' ? [] : (window.wpCroct.queue || []); 3 2 4 const wpCroct = { 5 enqueue: (method, args) => { 6 if (typeof wpCroct[method] !== 'function') { 7 console.warn('Croct: Invalid method "' + method + '" enqueued.'); 8 9 return; 10 } 11 12 wpCroct[method].apply(wpCroct, args); 13 }, 3 14 init: (config) => { 4 15 croct.plug(config); 5 window.addEventListener('DOMContentLoaded', wpCroct.applyPersonalization); 16 17 window.addEventListener('DOMContentLoaded', () => { 18 wpCroct.processQueue(); 19 wpCroct.applyPersonalization(); 20 }); 21 }, 22 23 processQueue: () => { 24 queue.forEach(call => wpCroct.enqueue(call[0], call[1])); 6 25 }, 7 26 -
croct/trunk/croct.php
r2452232 r2452249 6 6 * Plugin Name: Croct 7 7 * Plugin URI: https://croct.com/wordpress 8 * Version: 1.0. 48 * Version: 1.0.5 9 9 * Description: Content Personalization for WordPress. 10 10 * Requires at least: 4.0 -
croct/trunk/src/Dependency/BootstrapScript.php
r2452232 r2452249 19 19 } 20 20 21 if (typeof wpCroct === 'undefined') { 21 if (typeof wpCroct === 'undefined' ) { 22 const queue = []; 23 24 window.wpCroct = { 25 queue: queue, 26 enqueue: (method, args) => queue.push([method, args]), 27 }; 28 22 29 const script = document.getElementById(%s); 23 30 -
croct/trunk/src/Dependency/InterestTrackingScript.php
r2384748 r2452249 53 53 { 54 54 return \sprintf( 55 'wpCroct.trackInterests(%s, %s);', 56 \json_encode($this->trigger), 57 \json_encode($this->interests) 55 'wpCroct.enqueue("trackInterests", %s);', 56 \json_encode([$this->trigger, $this->interests]) 58 57 ); 59 58 } -
croct/trunk/src/Plugin.php
r2452232 r2452249 13 13 final class Plugin 14 14 { 15 const VERSION = '1.0. 4';15 const VERSION = '1.0.5'; 16 16 17 17 const OPTIONS_GROUP = 'croct'; -
croct/trunk/static/js/wp-croct.js
r2384748 r2452249 1 1 (function (window, croct) { 2 const queue = typeof window.wpCroct === 'undefined' ? [] : (window.wpCroct.queue || []); 3 2 4 const wpCroct = { 5 enqueue: (method, args) => { 6 if (typeof wpCroct[method] !== 'function') { 7 console.warn('Croct: Invalid method "' + method + '" enqueued.'); 8 9 return; 10 } 11 12 wpCroct[method].apply(wpCroct, args); 13 }, 3 14 init: (config) => { 4 15 croct.plug(config); 5 window.addEventListener('DOMContentLoaded', wpCroct.applyPersonalization); 16 17 window.addEventListener('DOMContentLoaded', () => { 18 wpCroct.processQueue(); 19 wpCroct.applyPersonalization(); 20 }); 21 }, 22 23 processQueue: () => { 24 queue.forEach(call => wpCroct.enqueue(call[0], call[1])); 6 25 }, 7 26
Note: See TracChangeset
for help on using the changeset viewer.