Plugin Directory

Changeset 3086889


Ignore:
Timestamp:
05/15/2024 07:35:31 AM (20 months ago)
Author:
web83info
Message:

Tested up to WordPress 6.5.3.

Location:
show-current-width/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • show-current-width/trunk/assets/show-current-width.js

    r3022094 r3086889  
    1717    showWidth() {
    1818        this.widthTo = window.innerWidth;
    19         if(document.getElementById('wpadminbar') == null) {
     19        if(document.getElementById('wp-admin-bar-show-current-width') == null) {
    2020            return;
    2121        }
  • 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("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("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  
    556556        return $actions;
    557557    }
    558 
    559558}
  • show-current-width/trunk/class/class-showcurrentwidth-core.php

    r3022094 r3086889  
    2323     * Plugin constant.
    2424     */
    25     const PLUGIN_VERSION           = '1.2.6';
     25    const PLUGIN_VERSION           = '1.2.7';
    2626    const PLUGIN_PREFIX            = 'show-current-width';
    2727    const PLUGIN_PREFIX_DEPRECATED = 'w83-show-current-width';
     
    127127        wp_enqueue_style(
    128128            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__ ),
    130130            array(),
    131131            self::PLUGIN_VERSION
     
    161161        wp_enqueue_script(
    162162            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__ ),
    164164            array(),
    165165            self::PLUGIN_VERSION,
     
    253253                    )
    254254                );
    255                 $breakpoint_index++;
     255                ++$breakpoint_index;
    256256            }
    257257        } else {
  • show-current-width/trunk/readme.txt

    r3022094 r3086889  
    44Tags: admin,width,developement,design
    55Requires at least: 6.2
    6 Tested up to: 6.4.2
     6Tested up to: 6.5.3
    77Requires PHP: 7.4
    8 Stable tag: 1.2.6
     8Stable tag: 1.2.7
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2020
    2121== Changelog ==
     22
     23= 1.2.7 - 2025-05-15 =
     24* Tested up to WordPress 6.5.3.
    2225
    2326= 1.2.6 - 2024-01-16 =
     
    84871. Apple iPhone XS Max.
    85882. Apple iPad Pro (11 inch).
    86 3. Mac OS Safari.
     893. Mac OS Chrome.
     904. Plugin setting page.
    8791
    8892== Donation ==
  • show-current-width/trunk/w83-show-current-width.php

    r3022094 r3086889  
    1212 * Plugin URI:
    1313 * Description:         This plugin shows a current screen width on WP adminbar.
    14  * Version:             1.2.6
     14 * Version:             1.2.7
    1515 * Requires at least:   6.0
    16  * Tested up to:        6.4.2
     16 * Tested up to:        6.5.3
    1717 * Requires PHP:        7.4
    1818 * Author:              web83info <[email protected]>
Note: See TracChangeset for help on using the changeset viewer.