Changeset 3022094
- Timestamp:
- 01/16/2024 02:35:51 AM (2 years ago)
- Location:
- show-current-width
- Files:
-
- 21 added
- 7 edited
-
tags/1.2.6 (added)
-
tags/1.2.6/LICENSE.txt (added)
-
tags/1.2.6/assets (added)
-
tags/1.2.6/assets/show-current-width.css (added)
-
tags/1.2.6/assets/show-current-width.css.map (added)
-
tags/1.2.6/assets/show-current-width.js (added)
-
tags/1.2.6/assets/show-current-width.min.css (added)
-
tags/1.2.6/assets/show-current-width.min.css.map (added)
-
tags/1.2.6/assets/show-current-width.min.js (added)
-
tags/1.2.6/assets/show-current-width.scss (added)
-
tags/1.2.6/class (added)
-
tags/1.2.6/class/class-showcurrentwidth-admin.php (added)
-
tags/1.2.6/class/class-showcurrentwidth-core.php (added)
-
tags/1.2.6/class/trait-singleton.php (added)
-
tags/1.2.6/readme.txt (added)
-
tags/1.2.6/screenshot-1.png (added)
-
tags/1.2.6/screenshot-2.png (added)
-
tags/1.2.6/screenshot-3.png (added)
-
tags/1.2.6/show-current-width.php (added)
-
tags/1.2.6/uninstall.php (added)
-
tags/1.2.6/w83-show-current-width.php (added)
-
trunk/assets/show-current-width.js (modified) (1 diff)
-
trunk/assets/show-current-width.min.js (modified) (1 diff)
-
trunk/class/class-showcurrentwidth-admin.php (modified) (1 diff)
-
trunk/class/class-showcurrentwidth-core.php (modified) (1 diff)
-
trunk/class/trait-singleton.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/w83-show-current-width.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
show-current-width/trunk/assets/show-current-width.js
r3014928 r3022094 11 11 this.widthNow = 0; 12 12 this.countUpProceeding = false; 13 window.addEventListener('load', this.showWidth());14 window.addEventListener('load', this.showWidthDelay());13 window.addEventListener('load', () => { this.showWidth(); }); 14 window.addEventListener('load', () => { this.showWidthDelay(); }); 15 15 } 16 16 -
show-current-width/trunk/assets/show-current-width.min.js
r3014928 r3022094 1 "use strict";class ShowCurrentWidth{constructor(){this.timeoutWidth=void 0,this.timeoutCountUp=void 0,this.delay=ShowCurrentWidthVariables.animation_timeout,this.widthFrom=0,this.widthTo=window.innerWidth,this.widthNow=0,this.countUpProceeding=!1,window.addEventListener("load", this.showWidth()),window.addEventListener("load",this.showWidthDelay())}showWidth(){this.widthTo=window.innerWidth,null!=document.getElementById("wpadminbar")&&(1==ShowCurrentWidthVariables.animation_show?(this.countUpProceeding=!0,this.showWidthWithAnimation()):this.showWidthWithoutAnimation())}showWidthWithAnimation(){let t=Math.abs(this.widthTo-this.widthFrom)/30;if(this.showWidthCore(this.widthNow),!this.countUpProceeding)return clearTimeout(this.timeoutCountUp),void(this.widthFrom=this.widthTo);this.widthNow>this.widthTo?this.widthNow-=t:this.widthNow<this.widthTo&&(this.widthNow+=t),Math.abs(this.widthNow-this.widthTo)<=t&&(this.widthNow=this.widthTo,this.countUpProceeding=!1),this.timeoutCountUp=setTimeout(()=>{this.showWidthWithAnimation()},7)}showWidthWithoutAnimation(){this.showWidthCore(this.widthTo)}showWidthCore(t){let i=void 0,h=void 0,o=new Array,e="»",d=void 0;ShowCurrentWidthVariables.breakpoints_definition.split("\n").forEach((t,e)=>{let d=t.trim().split(/\s*,\s*/);d[0]<=this.widthNow&&this.widthNow<d[1]?(i=d[2],h=d[3],o[e]=!0):o[e]=!1}),document.querySelector("#wp-admin-bar-show-current-width .ab-icon .width").textContent=Math.round(t),document.querySelector("#wp-admin-bar-show-current-width .ab-label .width").textContent=Math.round(t),1==ShowCurrentWidthVariables.breakpoints_show&&(document.querySelector("#wp-admin-bar-show-current-width .breakpoint").textContent=i,document.querySelector("#wp-admin-bar-show-current-width-breakpoint .breakpoint").textContent=h,o.forEach((t,i)=>{d=t?e:"",document.querySelector("#wp-admin-bar-show-current-width-breakpoint-"+i+" .icon").textContent=d}))}showWidthDelay(){window.addEventListener("resize",()=>{clearTimeout(this.timeoutWidth),this.timeoutWidth=setTimeout(()=>{this.showWidth()},this.delay)},!1)}}new ShowCurrentWidth;1 "use strict";class ShowCurrentWidth{constructor(){this.timeoutWidth=void 0,this.timeoutCountUp=void 0,this.delay=ShowCurrentWidthVariables.animation_timeout,this.widthFrom=0,this.widthTo=window.innerWidth,this.widthNow=0,this.countUpProceeding=!1,window.addEventListener("load",()=>{this.showWidth()}),window.addEventListener("load",()=>{this.showWidthDelay()})}showWidth(){this.widthTo=window.innerWidth,null!=document.getElementById("wpadminbar")&&(1==ShowCurrentWidthVariables.animation_show?(this.countUpProceeding=!0,this.showWidthWithAnimation()):this.showWidthWithoutAnimation())}showWidthWithAnimation(){let t=Math.abs(this.widthTo-this.widthFrom)/30;if(this.showWidthCore(this.widthNow),!this.countUpProceeding)return clearTimeout(this.timeoutCountUp),void(this.widthFrom=this.widthTo);this.widthNow>this.widthTo?this.widthNow-=t:this.widthNow<this.widthTo&&(this.widthNow+=t),Math.abs(this.widthNow-this.widthTo)<=t&&(this.widthNow=this.widthTo,this.countUpProceeding=!1),this.timeoutCountUp=setTimeout(()=>{this.showWidthWithAnimation()},7)}showWidthWithoutAnimation(){this.showWidthCore(this.widthTo)}showWidthCore(t){let i=void 0,h=void 0,o=new Array,e="»",d=void 0;ShowCurrentWidthVariables.breakpoints_definition.split("\n").forEach((t,e)=>{let d=t.trim().split(/\s*,\s*/);d[0]<=this.widthNow&&this.widthNow<d[1]?(i=d[2],h=d[3],o[e]=!0):o[e]=!1}),document.querySelector("#wp-admin-bar-show-current-width .ab-icon .width").textContent=Math.round(t),document.querySelector("#wp-admin-bar-show-current-width .ab-label .width").textContent=Math.round(t),1==ShowCurrentWidthVariables.breakpoints_show&&(document.querySelector("#wp-admin-bar-show-current-width .breakpoint").textContent=i,document.querySelector("#wp-admin-bar-show-current-width-breakpoint .breakpoint").textContent=h,o.forEach((t,i)=>{d=t?e:"",document.querySelector("#wp-admin-bar-show-current-width-breakpoint-"+i+" .icon").textContent=d}))}showWidthDelay(){window.addEventListener("resize",()=>{clearTimeout(this.timeoutWidth),this.timeoutWidth=setTimeout(()=>{this.showWidth()},this.delay)},!1)}}new ShowCurrentWidth; -
show-current-width/trunk/class/class-showcurrentwidth-admin.php
r3009226 r3022094 357 357 echo '</li>'; 358 358 } 359 echo '</ul>'; 359 360 } 360 361 -
show-current-width/trunk/class/class-showcurrentwidth-core.php
r3014928 r3022094 23 23 * Plugin constant. 24 24 */ 25 const PLUGIN_VERSION = '1.2. 5';25 const PLUGIN_VERSION = '1.2.6'; 26 26 const PLUGIN_PREFIX = 'show-current-width'; 27 27 const PLUGIN_PREFIX_DEPRECATED = 'w83-show-current-width'; 28 28 const PLUGIN_GITHUB = 'https://github.com/web83info/show-current-width'; 29 29 30 const OPTION_DEFAULT_BREAKPOINTS_DEFINITION = <<< EOT 31 0,576,xs,X-Small 32 576,768,sm,Small 33 768,992,md,Medium 34 992,1200,lg,Large 35 1200,1400,xl,Extra large 36 1400,9999,xll,Extra extra large 37 EOT; 30 const OPTION_DEFAULT_BREAKPOINTS_DEFINITION = 31 '0,576,xs,X-Small' . PHP_EOL . 32 '576,768,sm,Small' . PHP_EOL . 33 '768,992,md,Medium' . PHP_EOL . 34 '992,1200,lg,Large' . PHP_EOL . 35 '1200,1400,xl,Extra large' . PHP_EOL . 36 '1400,9999,xll,Extra extra large'; 38 37 const OPTION_DEFAULT_BREAKPOINTS_SHOW = 1; 39 38 const OPTION_DEFAULT_BREAKPOINTS_LIMITWIDTH = 0; -
show-current-width/trunk/class/trait-singleton.php
r2973725 r3022094 1 1 <?php 2 2 /** 3 * S howCurrentWidth_Core3 * Singleton 4 4 * 5 5 * @package None -
show-current-width/trunk/readme.txt
r3014928 r3022094 6 6 Tested up to: 6.4.2 7 7 Requires PHP: 7.4 8 Stable tag: 1.2. 58 Stable tag: 1.2.6 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 21 21 == Changelog == 22 22 23 = 1.2.6 - 2024-01-16 = 24 * Fix: Minor bug fix. 25 23 26 = 1.2.5 - 2023-12-28 = 24 27 * Fix: JS error when no WP adminbar. 25 * Tested up to WordPress 6.4.2.26 28 27 29 = 1.2.4 - 2023-12-13 = -
show-current-width/trunk/w83-show-current-width.php
r3014928 r3022094 1 1 <?php 2 2 /** 3 * Show Current Width 4 * 5 * @package Show_Current_Width 6 * @author web83info 7 * @copyright 2023 web83info 8 * @license GPL-2.0-or-later 9 * 10 * @wordpress-plugin 3 11 * Plugin Name: Show Current Width 4 12 * Plugin URI: 5 13 * Description: This plugin shows a current screen width on WP adminbar. 6 * Version: 1.2. 514 * Version: 1.2.6 7 15 * Requires at least: 6.0 8 16 * Tested up to: 6.4.2 … … 10 18 * Author: web83info <[email protected]> 11 19 * Author URI: 12 * Requires License: no 13 * License: GPLv2+ 14 * 15 * @package Show_Current_Width 16 * @author web83info 17 * @link 18 * @license 20 * License: GPL v2 or later 21 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 19 22 */ 20 23
Note: See TracChangeset
for help on using the changeset viewer.