Plugin Directory

Changeset 3388100


Ignore:
Timestamp:
11/01/2025 01:08:10 PM (5 months ago)
Author:
Wpcalc
Message:

Update Popup Box to version 3.2.12

Location:
popup-box
Files:
170 added
4 edited

Legend:

Unmodified
Added
Removed
  • popup-box/assets/blueprints/blueprint.json

    r3338850 r3388100  
    1616      "pluginZipFile": {
    1717        "resource": "url",
    18         "url": "https://downloads.wordpress.org/plugin/popup-box.3.2.11.zip"
     18        "url": "https://downloads.wordpress.org/plugin/popup-box.3.2.12.zip"
    1919      },
    2020      "options": {
  • popup-box/trunk/README.txt

    r3359962 r3388100  
    66Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable tag: 3.2.11
     8Stable tag: 3.2.12
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Popup Box lets you create responsive, customizable WordPress popups with a live preview and flexible triggers to boost engagement and conversions.
     12Popup Box lets you create responsive, customizable WordPress popups with live preview, flexible triggers, and smart targeting to boost engagement and conversions.
    1313
    1414== Description ==
     
    179179
    180180== Changelog ==
     181= 3.2.12 =
     182* Updated: `wp-color-picker-alpha` to version **3.0.4**.
     183* Fixed: minor bug fixes
     184
    181185= 3.2.11 =
    182186* Improved: Refactored AdminActions class for better performance and readability
  • popup-box/trunk/admin/assets/js/1.wp-color-picker-alpha.js

    r3223386 r3388100  
    55 * Only run in input and is defined data alpha in true
    66 *
    7  * Version: 3.0.3
     7 * Version: 3.0.4
    88 * https://github.com/kallookoo/wp-color-picker-alpha
    99 * Licensed under the GPLv2 license or later.
    1010 */
    1111
    12 ( function( $, undef ) {
     12( function ( $, undef ) {
    1313
    1414    var wpColorPickerAlpha = {
    15         'version' : 302
     15        'version': 304
    1616    };
    1717
     
    1919    if ( 'wpColorPickerAlpha' in window && 'version' in window.wpColorPickerAlpha ) {
    2020        var version = parseInt( window.wpColorPickerAlpha.version, 10 );
    21         if ( ! isNaN( version ) && version >= wpColorPickerAlpha.version ) {
     21        if ( !isNaN( version ) && version >= wpColorPickerAlpha.version ) {
    2222            return;
    2323        }
     
    3030
    3131    // Create new method to replace the `Color.toString()` inside the scripts.
    32     Color.fn.to_s = function( type ) {
     32    Color.fn.to_s = function ( type ) {
     33        if ( this.error ) {
     34            return '';
     35        }
    3336        type = ( type || 'hex' );
    3437        // Change hex to rgba to return the correct color.
     
    4043        if ( 'hex' === type ) {
    4144            color = this.toString();
    42         } else if ( ! this.error ) {
     45        } else if ( 'octohex' === type ) {
     46            color = this.toString();
     47            var alpha = parseInt( 255 * this._alpha, 10 ).toString( 16 );
     48            if ( alpha.length === 1 ) {
     49                alpha = `0${alpha}`;
     50            }
     51            color += alpha;
     52        } else {
    4353            color = this.toCSS( type ).replace( /\(\s+/, '(' ).replace( /\s+\)/, ')' );
    4454        }
     55
    4556        return color;
     57    }
     58
     59    Color.fn.fromHex = function ( color ) {
     60        color = color.replace( /^#/, '' ).replace( /^0x/, '' );
     61        if ( 3 === color.length || 4 === color.length ) {
     62            var extendedColor = '';
     63            for ( var index = 0; index < color.length; index++ ) {
     64                extendedColor += '' + color[ index ];
     65                extendedColor += '' + color[ index ];
     66            }
     67            color = extendedColor;
     68        }
     69
     70        if ( color.length === 8 ) {
     71            if ( /^[0-9A-F]{8}$/i.test( color ) ) {
     72                var alpha = parseInt( color.substring( 6 ), 16 );
     73                if ( !isNaN( alpha ) ) {
     74                    this.a( alpha / 255 );
     75                } else {
     76                    this._error();
     77                }
     78            } else {
     79                this._error();
     80            }
     81            color = color.substring( 0, 6 );
     82        }
     83
     84        if ( !this.error ) {
     85            this.error = ! /^[0-9A-F]{6}$/i.test( color );
     86        }
     87
     88        // console.log(color + ': ' + this.a())
     89        return this.fromInt( parseInt( color, 16 ) );
    4690    }
    4791
     
    72116         * @access private
    73117         *
    74          * @param {Object|*} The color instance if not defined return the cuurent color.
     118         * @param {Object|*} The color instance if not defined return the current color.
    75119         *
    76120         * @return {string} The element's color.
    77121         */
    78         _getColor: function( color ) {
     122        _getColor: function ( color ) {
    79123            if ( color === undef ) {
    80124                color = this._color;
     
    83127            if ( this.alphaOptions.alphaEnabled ) {
    84128                color = color.to_s( this.alphaOptions.alphaColorType );
    85                 if ( ! this.alphaOptions.alphaColorWithSpace ) {
     129                if ( !this.alphaOptions.alphaColorWithSpace ) {
    86130                    color = color.replace( /\s+/g, '' );
    87131                }
     
    98142         * @return {void}
    99143         */
    100         _create: function() {
     144        _create: function () {
    101145            try {
    102146                // Try to get the wpColorPicker alpha options.
    103147                this.alphaOptions = this.element.wpColorPicker( 'instance' ).alphaOptions;
    104             } catch( e ) {}
     148            } catch ( e ) { }
    105149
    106150            // We make sure there are all options
     
    125169         * @return {void}
    126170         */
    127         _addInputListeners: function( input ) {
     171        _addInputListeners: function ( input ) {
    128172            var self = this,
    129                     callback = function( event ){
     173                    callback = function ( event ) {
    130174                        var val = input.val(),
    131175                                color = new Color( val ),
     
    135179                        input.removeClass( 'iris-error' );
    136180
    137                         if ( ! color.error ) {
     181                        if ( !color.error ) {
    138182                            // let's not do this on keyup for hex shortcodes
    139                             if ( 'hex' !== type || ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) {
     183                            if ( 'hex' !== type || !( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) {
    140184                                // Compare color ( #AARRGGBB )
    141185                                if ( color.toIEOctoHex() !== self._color.toIEOctoHex() ) {
     
    150194            input.on( 'change', callback );
    151195
    152             if( ! self.alphaOptions.alphaSkipDebounce ) {
     196            if ( !self.alphaOptions.alphaSkipDebounce ) {
    153197                input.on( 'keyup', self._debounce( callback, self.alphaOptions.alphaDebounceTimeout ) );
    154198            }
     
    156200            // If we initialized hidden, show on first focus. The rest is up to you.
    157201            if ( self.options.hide ) {
    158                 input.one( 'focus', function() {
     202                input.one( 'focus', function () {
    159203                    self.show();
    160                 });
     204                } );
    161205            }
    162206        },
     
    169213         * @return {void}
    170214         */
    171         _initControls: function() {
     215        _initControls: function () {
    172216            this._super();
    173217
     
    175219                // Create Alpha controls
    176220                var self = this,
    177                         stripAlpha = self.controls.strip.clone(false, false),
     221                        stripAlpha = self.controls.strip.clone( false, false ),
    178222                        stripAlphaSlider = stripAlpha.find( '.iris-slider-offset' ),
    179223                        controls = {
    180                             stripAlpha       : stripAlpha,
    181                             stripAlphaSlider : stripAlphaSlider
     224                            stripAlpha: stripAlpha,
     225                            stripAlphaSlider: stripAlphaSlider
    182226                        };
    183227
     
    187231
    188232                // Push new controls
    189                 $.each( controls, function( k, v ) {
    190                     self.controls[k] = v;
     233                $.each( controls, function ( k, v ) {
     234                    self.controls[ k ] = v;
    191235                } );
    192236
    193237                // Create slider
    194238                self.controls.stripAlphaSlider.slider( {
    195                     orientation : 'vertical',
    196                     min         : 0,
    197                     max         : 100,
    198                     step        : 1,
    199                     value       : parseInt( self._color._alpha * 100 ),
    200                     slide       : function( event, ui ) {
     239                    orientation: 'vertical',
     240                    min: 0,
     241                    max: 100,
     242                    step: 1,
     243                    value: parseInt( self._color._alpha * 100 ),
     244                    slide: function ( event, ui ) {
    201245                        self.active = 'strip';
    202246                        // Update alpha value
     
    217261         * @return {void}
    218262         */
    219         _dimensions: function( reset ) {
     263        _dimensions: function ( reset ) {
    220264            this._super( reset );
    221265
     
    255299                }
    256300
    257 
    258301                square.css( 'margin', '0' );
    259302                strip.width( stripWidth ).css( 'margin-left', stripMargin + 'px' );
     
    268311         * @return {void}
    269312         */
    270         _change: function() {
    271             var self   = this,
     313        _change: function () {
     314            var self = this,
    272315                    active = self.active;
    273316
     
    275318
    276319            if ( self.alphaOptions.alphaEnabled ) {
    277                 var controls    = self.controls,
    278                         alpha        = parseInt( self._color._alpha * 100 ),
    279                         color        = self._color.toRgb(),
    280                         gradient     = [
     320                var controls = self.controls,
     321                        alpha = parseInt( self._color._alpha * 100 ),
     322                        color = self._color.toRgb(),
     323                        gradient = [
    281324                            'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
    282325                            'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
    283326                        ],
    284                         target       = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
     327                        target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
    285328
    286329                self.options.color = self._getColor();
    287330                // Generate background slider alpha, only for CSS3.
    288                 controls.stripAlpha.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + backgroundImage + ')' } );
     331                controls.stripAlpha.css( { 'background': 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + backgroundImage + ')' } );
    289332                // Update alpha value
    290333                if ( active ) {
     
    292335                }
    293336
    294                 if ( ! self._color.error ) {
     337                if ( !self._color.error ) {
    295338                    self.element.removeClass( 'iris-error' ).val( self.options.color );
    296339                }
    297340
    298                 self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
     341                self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function () {
    299342                    var color = $( this ).data( 'color' );
    300343                    if ( self.alphaOptions.alphaReset ) {
     
    317360         * @return {void}
    318361         */
    319         _paintDimension: function( origin, control ) {
     362        _paintDimension: function ( origin, control ) {
    320363            var self = this,
    321364                    color = false;
     
    345388         * @return {void}
    346389         */
    347         _setOption: function( key, value ) {
     390        _setOption: function ( key, value ) {
    348391            var self = this;
    349392            if ( 'color' === key && self.alphaOptions.alphaEnabled ) {
     
    352395                newColor = new Color( value ).setHSpace( self.options.mode );
    353396                // Check if error && Check the color to prevent callbacks with the same color.
    354                 if ( ! newColor.error && self._getColor( newColor ) !== self._getColor() ) {
     397                if ( !newColor.error && self._getColor( newColor ) !== self._getColor() ) {
    355398                    self._color = newColor;
    356399                    self.options.color = self._getColor();
     
    371414         * @return {string} The element's color.
    372415         */
    373         color: function( newColor ) {
     416        color: function ( newColor ) {
    374417            if ( newColor === true ) {
    375418                return this._color.clone();
     
    404447         * @return {object} The current alpha options.
    405448         */
    406         _getAlphaOptions: function() {
     449        _getAlphaOptions: function () {
    407450            var el = this.element,
    408                     type  = ( el.data( 'type' ) || this.options.type ),
     451                    type = ( el.data( 'type' ) || this.options.type ),
    409452                    color = ( el.data( 'defaultColor' ) || el.val() ),
    410453                    options = {
     
    421464            }
    422465
    423             if ( ! options.alphaEnabled ) {
     466            if ( !options.alphaEnabled ) {
    424467                return options;
    425468            }
     
    427470            options.alphaColorWithSpace = ( color && color.match( /\s/ ) );
    428471
    429             $.each( options, function( name, defaultValue ) {
     472            $.each( options, function ( name, defaultValue ) {
    430473                var value = ( el.data( name ) || defaultValue );
    431474                switch ( name ) {
     
    435478                        break;
    436479                    case 'alphaColorType':
    437                         if ( ! value.match( /^(hex|(rgb|hsl)a?)$/ ) ) {
     480                        if ( !value.match( /^((octo)?hex|(rgb|hsl)a?)$/ ) ) {
    438481                            if ( color && color.match( /^#/ ) ) {
    439482                                value = 'hex';
     
    449492                        break;
    450493                }
    451                 options[name] = value;
     494                options[ name ] = value;
    452495            } );
    453496
     
    462505         * @return {void}
    463506         */
    464         _create: function() {
     507        _create: function () {
    465508            // Return early if Iris support is missing.
    466             if ( ! $.support.iris ) {
     509            if ( !$.support.iris ) {
    467510                return;
    468511            }
     
    482525         * @return {void}
    483526         */
    484         _addListeners: function() {
    485             if ( ! this.alphaOptions.alphaEnabled ) {
     527        _addListeners: function () {
     528            if ( !this.alphaOptions.alphaEnabled ) {
    486529                return this._super();
    487530            }
     
    498541            self.toggler.css( {
    499542                'position': 'relative',
    500                 'background-image' : 'url(' + backgroundImage + ')'
     543                'background-image': 'url(' + backgroundImage + ')'
    501544            } );
    502545
     
    508551
    509552            self.colorAlpha = self.toggler.find( 'span.color-alpha' ).css( {
    510                 'width'            : '30px',
    511                 'height'           : '100%',
    512                 'position'         : 'absolute',
    513                 'top'              : 0,
    514                 'background-color' : el.val(),
     553                'width': '30px',
     554                'height': '100%',
     555                'position': 'absolute',
     556                'top': 0,
     557                'background-color': el.val(),
    515558            } );
    516559
     
    518561            if ( 'ltr' === self.colorAlpha.css( 'direction' ) ) {
    519562                self.colorAlpha.css( {
    520                     'border-bottom-left-radius' : '2px',
    521                     'border-top-left-radius'    : '2px',
    522                     'left'                      : 0
     563                    'border-bottom-left-radius': '2px',
     564                    'border-top-left-radius': '2px',
     565                    'left': 0
    523566                } );
    524567            } else {
    525568                self.colorAlpha.css( {
    526                     'border-bottom-right-radius' : '2px',
    527                     'border-top-right-radius'    : '2px',
    528                     'right'                      : 0
     569                    'border-bottom-right-radius': '2px',
     570                    'border-top-right-radius': '2px',
     571                    'right': 0
    529572                } );
    530573            }
     
    545588                 * @returns {void}
    546589                 */
    547                 change: function( event, ui ) {
     590                change: function ( event, ui ) {
    548591                    self.colorAlpha.css( { 'background-color': ui.color.to_s( self.alphaOptions.alphaColorType ) } );
    549592
     
    565608             * @return {void}
    566609             */
    567             self.wrap.on( 'click.wpcolorpicker', function( event ) {
     610            self.wrap.on( 'click.wpcolorpicker', function ( event ) {
    568611                event.stopPropagation();
    569             });
     612            } );
    570613
    571614            /**
     
    574617             * @since 3.0.0
    575618             */
    576             self.toggler.on( 'click', function() {
     619            self.toggler.on( 'click', function () {
    577620                if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
    578621                    self.close();
     
    580623                    self.open();
    581624                }
    582             });
     625            } );
    583626
    584627            /**
     
    592635             * @return {void}
    593636             */
    594             el.on( 'change', function( event ) {
     637            el.on( 'change', function ( event ) {
    595638                var val = $( this ).val();
    596639
     
    618661             * @return {void}
    619662             */
    620             self.button.on( 'click', function( event ) {
     663            self.button.on( 'click', function ( event ) {
    621664                if ( $( this ).hasClass( 'wp-picker-default' ) ) {
    622665                    el.val( self.options.defaultColor ).change();
  • popup-box/trunk/popup-box.php

    r3338850 r3388100  
    44 *  Plugin URI:        https://wordpress.org/plugin/popup-box/
    55 *  Description:       The most powerful creator of popups & flyouts
    6  *  Version:           3.2.11
     6 *  Version:           3.2.12
    77 *  Author:            Wow-Company
    88 *  Author URI:        https://wow-estore.com/
     
    184184        public function loaded(): void {
    185185            UpdateDB::init();
    186             $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
    187             load_plugin_textdomain( 'popup-box', false, $languages_folder );
    188186        }
    189187    }
Note: See TracChangeset for help on using the changeset viewer.