Changeset 3086889
- Timestamp:
- 05/15/2024 07:35:31 AM (20 months ago)
- Location:
- show-current-width/trunk
- Files:
-
- 6 edited
-
assets/show-current-width.js (modified) (1 diff)
-
assets/show-current-width.min.js (modified) (1 diff)
-
class/class-showcurrentwidth-admin.php (modified) (1 diff)
-
class/class-showcurrentwidth-core.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
-
w83-show-current-width.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
show-current-width/trunk/assets/show-current-width.js
r3022094 r3086889 17 17 showWidth() { 18 18 this.widthTo = window.innerWidth; 19 if(document.getElementById('wp adminbar') == null) {19 if(document.getElementById('wp-admin-bar-show-current-width') == null) { 20 20 return; 21 21 } -
show-current-width/trunk/assets/show-current-width.min.js
r3022094 r3086889 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("wp adminbar")&&(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("wp-admin-bar-show-current-width")&&(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
r3022094 r3086889 556 556 return $actions; 557 557 } 558 559 558 } -
show-current-width/trunk/class/class-showcurrentwidth-core.php
r3022094 r3086889 23 23 * Plugin constant. 24 24 */ 25 const PLUGIN_VERSION = '1.2. 6';25 const PLUGIN_VERSION = '1.2.7'; 26 26 const PLUGIN_PREFIX = 'show-current-width'; 27 27 const PLUGIN_PREFIX_DEPRECATED = 'w83-show-current-width'; … … 127 127 wp_enqueue_style( 128 128 self::PLUGIN_PREFIX . '-css', 129 plugins_url( 'assets/show-current-width.min.css', dirname( __FILE__ )),129 plugins_url( 'assets/show-current-width.min.css', __DIR__ ), 130 130 array(), 131 131 self::PLUGIN_VERSION … … 161 161 wp_enqueue_script( 162 162 self::PLUGIN_PREFIX . '-js', 163 plugins_url( 'assets/show-current-width.min.js', dirname( __FILE__ )),163 plugins_url( 'assets/show-current-width.min.js', __DIR__ ), 164 164 array(), 165 165 self::PLUGIN_VERSION, … … 253 253 ) 254 254 ); 255 $breakpoint_index++;255 ++$breakpoint_index; 256 256 } 257 257 } else { -
show-current-width/trunk/readme.txt
r3022094 r3086889 4 4 Tags: admin,width,developement,design 5 5 Requires at least: 6.2 6 Tested up to: 6. 4.26 Tested up to: 6.5.3 7 7 Requires PHP: 7.4 8 Stable tag: 1.2. 68 Stable tag: 1.2.7 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.7 - 2025-05-15 = 24 * Tested up to WordPress 6.5.3. 22 25 23 26 = 1.2.6 - 2024-01-16 = … … 84 87 1. Apple iPhone XS Max. 85 88 2. Apple iPad Pro (11 inch). 86 3. Mac OS Safari. 89 3. Mac OS Chrome. 90 4. Plugin setting page. 87 91 88 92 == Donation == -
show-current-width/trunk/w83-show-current-width.php
r3022094 r3086889 12 12 * Plugin URI: 13 13 * Description: This plugin shows a current screen width on WP adminbar. 14 * Version: 1.2. 614 * Version: 1.2.7 15 15 * Requires at least: 6.0 16 * Tested up to: 6. 4.216 * Tested up to: 6.5.3 17 17 * Requires PHP: 7.4 18 18 * Author: web83info <[email protected]>
Note: See TracChangeset
for help on using the changeset viewer.