Changeset 3014928
- Timestamp:
- 12/28/2023 06:42:56 AM (2 years ago)
- Location:
- show-current-width
- Files:
-
- 21 added
- 5 edited
-
tags/1.2.5 (added)
-
tags/1.2.5/LICENSE.txt (added)
-
tags/1.2.5/assets (added)
-
tags/1.2.5/assets/show-current-width.css (added)
-
tags/1.2.5/assets/show-current-width.css.map (added)
-
tags/1.2.5/assets/show-current-width.js (added)
-
tags/1.2.5/assets/show-current-width.min.css (added)
-
tags/1.2.5/assets/show-current-width.min.css.map (added)
-
tags/1.2.5/assets/show-current-width.min.js (added)
-
tags/1.2.5/assets/show-current-width.scss (added)
-
tags/1.2.5/class (added)
-
tags/1.2.5/class/class-showcurrentwidth-admin.php (added)
-
tags/1.2.5/class/class-showcurrentwidth-core.php (added)
-
tags/1.2.5/class/trait-singleton.php (added)
-
tags/1.2.5/readme.txt (added)
-
tags/1.2.5/screenshot-1.png (added)
-
tags/1.2.5/screenshot-2.png (added)
-
tags/1.2.5/screenshot-3.png (added)
-
tags/1.2.5/show-current-width.php (added)
-
tags/1.2.5/uninstall.php (added)
-
tags/1.2.5/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-core.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/w83-show-current-width.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
show-current-width/trunk/assets/show-current-width.js
r3009226 r3014928 17 17 showWidth() { 18 18 this.widthTo = window.innerWidth; 19 if(document.getElementById('wpadminbar') == null) { 20 return; 21 } 19 22 if(1 == ShowCurrentWidthVariables.animation_show) { 20 23 // Animation -
show-current-width/trunk/assets/show-current-width.min.js
r3009226 r3014928 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, 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-core.php
r3009226 r3014928 23 23 * Plugin constant. 24 24 */ 25 const PLUGIN_VERSION = '1.2. 4';25 const PLUGIN_VERSION = '1.2.5'; 26 26 const PLUGIN_PREFIX = 'show-current-width'; 27 27 const PLUGIN_PREFIX_DEPRECATED = 'w83-show-current-width'; -
show-current-width/trunk/readme.txt
r3009226 r3014928 6 6 Tested up to: 6.4.2 7 7 Requires PHP: 7.4 8 Stable tag: 1.2. 48 Stable tag: 1.2.5 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 20 20 21 21 == Changelog == 22 23 = 1.2.5 - 2023-12-28 = 24 * Fix: JS error when no WP adminbar. 25 * Tested up to WordPress 6.4.2. 22 26 23 27 = 1.2.4 - 2023-12-13 = -
show-current-width/trunk/w83-show-current-width.php
r3009226 r3014928 4 4 * Plugin URI: 5 5 * Description: This plugin shows a current screen width on WP adminbar. 6 * Version: 1.2. 46 * Version: 1.2.5 7 7 * Requires at least: 6.0 8 8 * Tested up to: 6.4.2
Note: See TracChangeset
for help on using the changeset viewer.