Changeset 3322545
- Timestamp:
- 07/04/2025 11:43:00 PM (8 months ago)
- Location:
- word-balloon/trunk
- Files:
-
- 8 edited
-
changelog.txt (modified) (1 diff)
-
css/word_balloon_block.min.css (modified) (1 diff)
-
inc/admin.php (modified) (5 diffs)
-
inc/ajax_nonce.php (modified) (1 diff)
-
js/wp-color-picker-alpha.js (modified) (40 diffs)
-
js/wp-color-picker-alpha.min.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
word-balloon.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
word-balloon/trunk/changelog.txt
r3307744 r3322545 1 = 4.22.5 = 2 * Released: July 5, 2025 3 * fixed: Minor fix. 4 1 5 = 4.22.4 = 2 6 * Released: June 7, 2025 -
word-balloon/trunk/css/word_balloon_block.min.css
r2437006 r3322545 1 .w_b_block_ed .w_b_ava_L{-webkit-order:1;order:1}.w_b_block_ed .w_b_ava_R{-webkit-order:3;order:3}.w_b_block_ed .w_b_bal_box{-webkit-order:2;order:2}.w_b_block_ed .w_b_ava_img{cursor: default}.w_b_block_ed .w_b_bal_wrap_L{-webkit-order:1;order:1}.w_b_block_ed .w_b_bal_wrap_R{-webkit-order:3;order:3}.w_b_block_ed .w_b_status_box{-webkit-order:2;order:2}.w_b_block_ed .w_b_bal{min-width:90px}.w_b_block_ed .components-autocomplete{word-break:break-word}.w_b_mb_32{margin-bottom:32px}.w_b_annotation{border-top:1px solid #e2e4e7;padding-top:16px;margin-bottom:16px}.w_b_block_over>div,.w_b_block_under>div{-webkit-flex-direction:column;flex-direction:column}.w_b_block_over .w_b_bal_box{-webkit-order:0;order:0}.w_b_block_under .w_b_ava_R{-webkit-order:0;order:0}.w_b_block_label_title{font-weight:bold}.w_b_block_bal .block-editor-inner-blocks .block-editor-block-list__block{margin:0}.w_b_block_bal .block-editor-inner-blocks .block-editor-block-list__block p.block-editor-rich-text__editable{margin:0}.w_b_block_side_by_side .block-editor-inner-blocks .block-editor-block-list__layout{display:flex}.w_b_block_side_by_side .block-editor-inner-blocks .block-editor-block-list__layout>*{margin:0}.w_b_block_side_by_side.space-between .block-editor-block-list__layout{justify-content:space-between}.w_b_block_side_by_side.center .block-editor-block-list__layout{justify-content:center}.w_b_block_side_by_side.flex-end .block-editor-block-list__layout{justify-content:flex-end}.w_b_block_side_by_side.flex-start .block-editor-block-list__layout{justify-content:flex-start}.w_b_block_side_by_side.flex-start .block-editor-block-list__layout{justify-content:flex-start}.w_b_block_side_by_side.true .block-editor-block-list__layout{flex-wrap:wrap}.w_b_block_side_by_side.reverse .block-editor-block-list__layout{flex-wrap:wrap-reverse}.w_b_block_out_innerblocks_mode{color:#9e9e9e;pointer-events:'none'}.w_b_block_out_innerblocks_mode .components-form-toggle .components-form-toggle__track{background:#9e9e9e;cursor:not-allowed}.w_b_block_out_innerblocks_mode label,.w_b_block_out_innerblocks_mode .components-form-toggle__input{cursor:not-allowed}.w_b_avatar_active_position_L .w_b_avatar_position_L{fill:#007cba}.w_b_avatar_active_position_R .w_b_avatar_position_R{fill:#007cba}#w_b_avatar_position_arrows_div .w_b_avatar_position_R{margin-left:8px;transform:rotate(180deg)}#w_b_avatar_position_arrows_div label{margin-right:auto}#w_b_avatar_position_arrows_div svg{cursor:pointer}.w_b_icon_position_arrows_div div:nth-child(3n+2){margin-left:8px;margin-right:8px}.w_b_icon_position_arrows_div{margin-bottom:24px;line-height:0;width:138px;margin-left:auto;justify-content:flex-end}.w_b_icon_position_arrows_div>div{margin:2px}.w_b_icon_position_arrows_div svg{cursor:pointer}.w_b_icon_position_top_left{transform:rotate(45deg)}.w_b_icon_position_top_center{transform:rotate(90deg)}.w_b_icon_position_top_right{transform:rotate(135deg)}.w_b_icon_position_center_right{transform:rotate(180deg)}.w_b_icon_position_bottom_right{transform:rotate(225deg)}.w_b_icon_position_bottom_center{transform:rotate(270deg)}.w_b_icon_position_bottom_left{transform:rotate(315deg)}.w_b_icon_active_position.active{fill:#007cba}.w_b_size_option_wrap{margin-bottom:20px}.w_b_size_option_wrap div:first-child{margin-left:auto;border-radius:6px 0 0 6px}.w_b_size_option_wrap div:last-child{border-radius:0 6px 6px 0}.w_b_size_option{font-size:20px;padding:8px;border:1px solid #ccc;background:#fafafa;border-bottom-width:3px;cursor:pointer;transition:all .1s ease}.w_b_size_option.active,.w_b_size_option:hover{background:#007cba;border-color:#007cba;border-bottom-color:#003753;color:#fff}1 .w_b_block_ed .w_b_ava_L{-webkit-order:1;order:1}.w_b_block_ed .w_b_ava_R{-webkit-order:3;order:3}.w_b_block_ed .w_b_bal_box{-webkit-order:2;order:2}.w_b_block_ed .w_b_ava_img{cursor:pointer;pointer-events:auto !important}.w_b_block_ed .w_b_bal_wrap_L{-webkit-order:1;order:1}.w_b_block_ed .w_b_bal_wrap_R{-webkit-order:3;order:3}.w_b_block_ed .w_b_status_box{-webkit-order:2;order:2}.w_b_block_ed .w_b_bal{min-width:90px}.w_b_block_ed .components-autocomplete{word-break:break-word}.w_b_mb_32{margin-bottom:32px}.w_b_annotation{border-top:1px solid #e2e4e7;padding-top:16px;margin-bottom:16px}.w_b_block_over>div,.w_b_block_under>div{-webkit-flex-direction:column;flex-direction:column}.w_b_block_over .w_b_bal_box{-webkit-order:0;order:0}.w_b_block_under .w_b_ava_R{-webkit-order:0;order:0}.w_b_block_label_title{font-weight:bold}.w_b_block_bal .block-editor-inner-blocks .block-editor-block-list__block{margin:0}.w_b_block_bal .block-editor-inner-blocks .block-editor-block-list__block p.block-editor-rich-text__editable{margin:0}.w_b_block_side_by_side .block-editor-inner-blocks .block-editor-block-list__layout{display:flex}.w_b_block_side_by_side .block-editor-inner-blocks .block-editor-block-list__layout>*{margin:0}.w_b_block_side_by_side.space-between .block-editor-block-list__layout{justify-content:space-between}.w_b_block_side_by_side.center .block-editor-block-list__layout{justify-content:center}.w_b_block_side_by_side.flex-end .block-editor-block-list__layout{justify-content:flex-end}.w_b_block_side_by_side.flex-start .block-editor-block-list__layout{justify-content:flex-start}.w_b_block_side_by_side.flex-start .block-editor-block-list__layout{justify-content:flex-start}.w_b_block_side_by_side.true .block-editor-block-list__layout{flex-wrap:wrap}.w_b_block_side_by_side.reverse .block-editor-block-list__layout{flex-wrap:wrap-reverse}.w_b_block_out_innerblocks_mode{color:#9e9e9e;pointer-events:"none"}.w_b_block_out_innerblocks_mode .components-form-toggle .components-form-toggle__track{background:#9e9e9e;cursor:not-allowed}.w_b_block_out_innerblocks_mode label,.w_b_block_out_innerblocks_mode .components-form-toggle__input{cursor:not-allowed}.w_b_avatar_active_position_L .w_b_avatar_position_L{fill:#007cba}.w_b_avatar_active_position_R .w_b_avatar_position_R{fill:#007cba}#w_b_avatar_position_arrows_div .w_b_avatar_position_R{margin-left:8px;transform:rotate(180deg)}#w_b_avatar_position_arrows_div label{margin-right:auto}#w_b_avatar_position_arrows_div svg{cursor:pointer}.w_b_icon_position_arrows_div div:nth-child(3n+2){margin-left:8px;margin-right:8px}.w_b_icon_position_arrows_div{margin-bottom:24px;line-height:0;width:138px;margin-left:auto;justify-content:flex-end}.w_b_icon_position_arrows_div>div{margin:2px}.w_b_icon_position_arrows_div svg{cursor:pointer}.w_b_icon_position_top_left{transform:rotate(45deg)}.w_b_icon_position_top_center{transform:rotate(90deg)}.w_b_icon_position_top_right{transform:rotate(135deg)}.w_b_icon_position_center_right{transform:rotate(180deg)}.w_b_icon_position_bottom_right{transform:rotate(225deg)}.w_b_icon_position_bottom_center{transform:rotate(270deg)}.w_b_icon_position_bottom_left{transform:rotate(315deg)}.w_b_icon_active_position.active{fill:#007cba}.w_b_size_option_wrap{margin-bottom:20px}.w_b_size_option_wrap div:first-child{margin-left:auto;border-radius:6px 0 0 6px}.w_b_size_option_wrap div:last-child{border-radius:0 6px 6px 0}.w_b_size_option{font-size:20px;padding:8px;border:1px solid #ccc;background:#fafafa;border-bottom-width:3px;cursor:pointer;transition:all .1s ease}.w_b_size_option.active,.w_b_size_option:hover{background:#007cba;border-color:#007cba;border-bottom-color:#003753;color:#fff} -
word-balloon/trunk/inc/admin.php
r3103805 r3322545 2 2 3 3 defined( 'ABSPATH' ) || exit; 4 4 5 5 6 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); … … 55 56 wp_enqueue_style('word_balloon_font', WORD_BALLOON_URI . 'css/font/style.min.css',array(),WORD_BALLOON_VERSION); 56 57 //add_action( 'wp_enqueue_scripts', 'word_balloon_translations_edit' ); 58 57 59 58 60 wp_enqueue_script('word_balloon_base_script', WORD_BALLOON_URI . 'js/action/word_balloon_action_base.min.js',array(),WORD_BALLOON_VERSION,true); … … 60 62 wp_enqueue_script('word_balloon_edit'); 61 63 wp_enqueue_script('word_balloon_avatar_register', WORD_BALLOON_URI . 'js/word_balloon_avatar_register.min.js',array('word_balloon_edit'),WORD_BALLOON_VERSION,true); 64 62 65 63 66 $translations = word_balloon_script_translations(); 64 67 wp_localize_script( 'word_balloon_base_script', 'translations_word_balloon', $translations ); 68 65 69 66 70 wp_localize_script('word_balloon_base_script','word_balloon_nonce_ajax_object',array( … … 181 185 182 186 183 function word_balloon_scriput_translations(){ 184 return word_balloon_script_translations();185 } 187 188 189 186 190 187 191 … … 195 199 196 200 197 wp_register_script( 'wp-color-picker-alpha', WORD_BALLOON_URI . 'js/wp-color-picker-alpha.min.js', array( ' wp-color-picker' ), WORD_BALLOON_VERSION, true );201 wp_register_script( 'wp-color-picker-alpha', WORD_BALLOON_URI . 'js/wp-color-picker-alpha.min.js', array( 'jquery', 'wp-color-picker' ), WORD_BALLOON_VERSION, true ); 198 202 199 203 wp_add_inline_script( -
word-balloon/trunk/inc/ajax_nonce.php
r3103805 r3322545 26 26 27 27 28 28 29 29 if( $_POST['datauri'] === 'true' && defined('WORD_BALLOON_PRO_DIR') && file_exists( WORD_BALLOON_PRO_DIR . 'inc/save/admin-avatar_save.php' ) ){ 30 30 -
word-balloon/trunk/js/wp-color-picker-alpha.js
r2912717 r3322545 5 5 * Only run in input and is defined data alpha in true 6 6 * 7 * Version: 3.0. 27 * Version: 3.0.4 8 8 * https://github.com/kallookoo/wp-color-picker-alpha 9 9 * Licensed under the GPLv2 license or later. 10 10 */ 11 11 12 ( function ( $, undef ) {12 ( function ( $, undef ) { 13 13 14 14 var wpColorPickerAlpha = { 15 'version' : 30215 'version': 304 16 16 }; 17 17 … … 19 19 if ( 'wpColorPickerAlpha' in window && 'version' in window.wpColorPickerAlpha ) { 20 20 var version = parseInt( window.wpColorPickerAlpha.version, 10 ); 21 if ( ! isNaN( version ) && version >= wpColorPickerAlpha.version ) {21 if ( !isNaN( version ) && version >= wpColorPickerAlpha.version ) { 22 22 return; 23 23 } … … 30 30 31 31 // 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 } 33 36 type = ( type || 'hex' ); 34 37 // Change hex to rgba to return the correct color. … … 40 43 if ( 'hex' === type ) { 41 44 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 { 43 53 color = this.toCSS( type ).replace( /\(\s+/, '(' ).replace( /\s+\)/, ')' ); 44 54 } 55 45 56 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 ) ); 46 90 } 47 91 … … 72 116 * @access private 73 117 * 74 * @param {Object|*} The color instance if not defined return the cu urent color.118 * @param {Object|*} The color instance if not defined return the current color. 75 119 * 76 120 * @return {string} The element's color. 77 121 */ 78 _getColor: function ( color ) {122 _getColor: function ( color ) { 79 123 if ( color === undef ) { 80 124 color = this._color; … … 83 127 if ( this.alphaOptions.alphaEnabled ) { 84 128 color = color.to_s( this.alphaOptions.alphaColorType ); 85 if ( ! this.alphaOptions.alphaColorWithSpace ) {129 if ( !this.alphaOptions.alphaColorWithSpace ) { 86 130 color = color.replace( /\s+/g, '' ); 87 131 } … … 98 142 * @return {void} 99 143 */ 100 _create: function () {144 _create: function () { 101 145 try { 102 146 // Try to get the wpColorPicker alpha options. 103 147 this.alphaOptions = this.element.wpColorPicker( 'instance' ).alphaOptions; 104 } catch ( e ) {}148 } catch ( e ) { } 105 149 106 150 // We make sure there are all options … … 111 155 alphaColorType: 'hex', 112 156 alphaColorWithSpace: false, 157 alphaSkipDebounce: false, 158 alphaDebounceTimeout: 100, 113 159 } ); 114 160 … … 123 169 * @return {void} 124 170 */ 125 _addInputListeners: function ( input ) {171 _addInputListeners: function ( input ) { 126 172 var self = this, 127 debounceTimeout = 100, 128 callback = function( event ){ 173 callback = function ( event ) { 129 174 var val = input.val(), 130 175 color = new Color( val ), … … 134 179 input.removeClass( 'iris-error' ); 135 180 136 if ( ! color.error ) {181 if ( !color.error ) { 137 182 // let's not do this on keyup for hex shortcodes 138 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}$/ ) ) ) { 139 184 // Compare color ( #AARRGGBB ) 140 185 if ( color.toIEOctoHex() !== self._color.toIEOctoHex() ) { … … 147 192 }; 148 193 149 input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) ); 194 input.on( 'change', callback ); 195 196 if ( !self.alphaOptions.alphaSkipDebounce ) { 197 input.on( 'keyup', self._debounce( callback, self.alphaOptions.alphaDebounceTimeout ) ); 198 } 150 199 151 200 // If we initialized hidden, show on first focus. The rest is up to you. 152 201 if ( self.options.hide ) { 153 input.one( 'focus', function () {202 input.one( 'focus', function () { 154 203 self.show(); 155 } );204 } ); 156 205 } 157 206 }, … … 164 213 * @return {void} 165 214 */ 166 _initControls: function () {215 _initControls: function () { 167 216 this._super(); 168 217 … … 170 219 // Create Alpha controls 171 220 var self = this, 172 stripAlpha = self.controls.strip.clone( false, false),221 stripAlpha = self.controls.strip.clone( false, false ), 173 222 stripAlphaSlider = stripAlpha.find( '.iris-slider-offset' ), 174 223 controls = { 175 stripAlpha : stripAlpha,176 stripAlphaSlider : stripAlphaSlider224 stripAlpha: stripAlpha, 225 stripAlphaSlider: stripAlphaSlider 177 226 }; 178 227 … … 182 231 183 232 // Push new controls 184 $.each( controls, function ( k, v ) {185 self.controls[ k] = v;233 $.each( controls, function ( k, v ) { 234 self.controls[ k ] = v; 186 235 } ); 187 236 188 237 // Create slider 189 238 self.controls.stripAlphaSlider.slider( { 190 orientation : 'vertical',191 min : 0,192 max : 100,193 step : 1,194 value : parseInt( self._color._alpha * 100 ),195 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 ) { 196 245 self.active = 'strip'; 197 246 // Update alpha value … … 212 261 * @return {void} 213 262 */ 214 _dimensions: function ( reset ) {263 _dimensions: function ( reset ) { 215 264 this._super( reset ); 216 265 … … 250 299 } 251 300 252 253 301 square.css( 'margin', '0' ); 254 302 strip.width( stripWidth ).css( 'margin-left', stripMargin + 'px' ); … … 263 311 * @return {void} 264 312 */ 265 _change: function () {266 var self = this,313 _change: function () { 314 var self = this, 267 315 active = self.active; 268 316 … … 270 318 271 319 if ( self.alphaOptions.alphaEnabled ) { 272 var controls= self.controls,273 alpha = parseInt( self._color._alpha * 100 ),274 color = self._color.toRgb(),275 gradient = [320 var controls = self.controls, 321 alpha = parseInt( self._color._alpha * 100 ), 322 color = self._color.toRgb(), 323 gradient = [ 276 324 'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%', 277 325 'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%' 278 326 ], 279 target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );327 target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' ); 280 328 281 329 self.options.color = self._getColor(); 282 330 // Generate background slider alpha, only for CSS3. 283 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 + ')' } ); 284 332 // Update alpha value 285 333 if ( active ) { … … 287 335 } 288 336 289 if ( ! self._color.error ) {337 if ( !self._color.error ) { 290 338 self.element.removeClass( 'iris-error' ).val( self.options.color ); 291 339 } 292 340 293 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 () { 294 342 var color = $( this ).data( 'color' ); 295 343 if ( self.alphaOptions.alphaReset ) { … … 312 360 * @return {void} 313 361 */ 314 _paintDimension: function ( origin, control ) {362 _paintDimension: function ( origin, control ) { 315 363 var self = this, 316 364 color = false; … … 340 388 * @return {void} 341 389 */ 342 _setOption: function ( key, value ) {390 _setOption: function ( key, value ) { 343 391 var self = this; 344 392 if ( 'color' === key && self.alphaOptions.alphaEnabled ) { … … 347 395 newColor = new Color( value ).setHSpace( self.options.mode ); 348 396 // Check if error && Check the color to prevent callbacks with the same color. 349 if ( ! newColor.error && self._getColor( newColor ) !== self._getColor() ) {397 if ( !newColor.error && self._getColor( newColor ) !== self._getColor() ) { 350 398 self._color = newColor; 351 399 self.options.color = self._getColor(); … … 366 414 * @return {string} The element's color. 367 415 */ 368 color: function ( newColor ) {416 color: function ( newColor ) { 369 417 if ( newColor === true ) { 370 418 return this._color.clone(); … … 399 447 * @return {object} The current alpha options. 400 448 */ 401 _getAlphaOptions: function () {449 _getAlphaOptions: function () { 402 450 var el = this.element, 403 type = ( el.data( 'type' ) || this.options.type ),451 type = ( el.data( 'type' ) || this.options.type ), 404 452 color = ( el.data( 'defaultColor' ) || el.val() ), 405 453 options = { … … 409 457 alphaColorType: 'rgb', 410 458 alphaColorWithSpace: false, 459 alphaSkipDebounce: ( !!el.data( 'alphaSkipDebounce' ) || false ), 411 460 }; 412 461 … … 415 464 } 416 465 417 if ( ! options.alphaEnabled ) {466 if ( !options.alphaEnabled ) { 418 467 return options; 419 468 } … … 421 470 options.alphaColorWithSpace = ( color && color.match( /\s/ ) ); 422 471 423 $.each( options, function ( name, defaultValue ) {472 $.each( options, function ( name, defaultValue ) { 424 473 var value = ( el.data( name ) || defaultValue ); 425 474 switch ( name ) { … … 429 478 break; 430 479 case 'alphaColorType': 431 if ( ! value.match( /^(hex|(rgb|hsl)a?)$/ ) ) {480 if ( !value.match( /^((octo)?hex|(rgb|hsl)a?)$/ ) ) { 432 481 if ( color && color.match( /^#/ ) ) { 433 482 value = 'hex'; … … 443 492 break; 444 493 } 445 options[ name] = value;494 options[ name ] = value; 446 495 } ); 447 496 … … 456 505 * @return {void} 457 506 */ 458 _create: function () {507 _create: function () { 459 508 // Return early if Iris support is missing. 460 if ( ! $.support.iris ) {509 if ( !$.support.iris ) { 461 510 return; 462 511 } … … 476 525 * @return {void} 477 526 */ 478 _addListeners: function () {479 if ( ! this.alphaOptions.alphaEnabled ) {527 _addListeners: function () { 528 if ( !this.alphaOptions.alphaEnabled ) { 480 529 return this._super(); 481 530 } … … 492 541 self.toggler.css( { 493 542 'position': 'relative', 494 'background-image' : 'url(' + backgroundImage + ')'543 'background-image': 'url(' + backgroundImage + ')' 495 544 } ); 496 545 … … 502 551 503 552 self.colorAlpha = self.toggler.find( 'span.color-alpha' ).css( { 504 'width' : '30px',505 'height' : '100%',506 'position' : 'absolute',507 'top' : 0,508 'background-color' : el.val(),553 'width': '30px', 554 'height': '100%', 555 'position': 'absolute', 556 'top': 0, 557 'background-color': el.val(), 509 558 } ); 510 559 … … 512 561 if ( 'ltr' === self.colorAlpha.css( 'direction' ) ) { 513 562 self.colorAlpha.css( { 514 'border-bottom-left-radius' : '2px',515 'border-top-left-radius' : '2px',516 'left' : 0563 'border-bottom-left-radius': '2px', 564 'border-top-left-radius': '2px', 565 'left': 0 517 566 } ); 518 567 } else { 519 568 self.colorAlpha.css( { 520 'border-bottom-right-radius' : '2px',521 'border-top-right-radius' : '2px',522 'right' : 0569 'border-bottom-right-radius': '2px', 570 'border-top-right-radius': '2px', 571 'right': 0 523 572 } ); 524 573 } … … 539 588 * @returns {void} 540 589 */ 541 change: function ( event, ui ) {590 change: function ( event, ui ) { 542 591 self.colorAlpha.css( { 'background-color': ui.color.to_s( self.alphaOptions.alphaColorType ) } ); 543 592 … … 559 608 * @return {void} 560 609 */ 561 self.wrap.on( 'click.wpcolorpicker', function ( event ) {610 self.wrap.on( 'click.wpcolorpicker', function ( event ) { 562 611 event.stopPropagation(); 563 } );612 } ); 564 613 565 614 /** … … 568 617 * @since 3.0.0 569 618 */ 570 self.toggler.on( 'click', function () {619 self.toggler.on( 'click', function () { 571 620 if ( self.toggler.hasClass( 'wp-picker-open' ) ) { 572 621 self.close(); … … 574 623 self.open(); 575 624 } 576 } );625 } ); 577 626 578 627 /** … … 586 635 * @return {void} 587 636 */ 588 el.on( 'change', function ( event ) {637 el.on( 'change', function ( event ) { 589 638 var val = $( this ).val(); 590 639 … … 612 661 * @return {void} 613 662 */ 614 self.button.on( 'click', function ( event ) {663 self.button.on( 'click', function ( event ) { 615 664 if ( $( this ).hasClass( 'wp-picker-default' ) ) { 616 665 el.val( self.options.defaultColor ).change(); -
word-balloon/trunk/js/wp-color-picker-alpha.min.js
r2912717 r3322545 5 5 * Only run in input and is defined data alpha in true 6 6 * 7 * Version: 3.0. 27 * Version: 3.0.4 8 8 * https://github.com/kallookoo/wp-color-picker-alpha 9 9 * Licensed under the GPLv2 license or later. 10 10 */ 11 (function(o,a){var t={version:302};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var r=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(r)&&r>=t.version)return}if(!Color.fn.hasOwnProperty("to_s")){Color.fn.to_s=function(o){o=o||"hex","hex"===o&&this._alpha<1&&(o="rgba");var a="";return"hex"===o?a=this.toString():this.error||(a=this.toCSS(o).replace(/\(\s+/,"(").replace(/\s+\)/,")")),a},window.wpColorPickerAlpha=t;var i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";o.widget("a8c.iris",o.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(o){return o===a&&(o=this._color),this.alphaOptions.alphaEnabled?(o=o.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(o=o.replace(/\s+/g,"")),o):o.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(o){}o.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(o){var a=this,t=100,r=function(t){var r=o.val(),i=new Color(r),l=(r=r.replace(/^(#|(rgb|hsl)a?)/,""),a.alphaOptions.alphaColorType);o.removeClass("iris-error"),i.error?""!==r&&o.addClass("iris-error"):"hex"===l&&"keyup"===t.type&&r.match(/^[0-9a-fA-F]{3}$/)||i.toIEOctoHex()!==a._color.toIEOctoHex()&&a._setOption("color",a._getColor(i))};o.on("change",r).on("keyup",a._debounce(r,t)),a.options.hide&&o.one("focus",function(){a.show()})},_initControls:function(){if(this._super(),this.alphaOptions.alphaEnabled){var a=this,t=a.controls.strip.clone(!1,!1),r=t.find(".iris-slider-offset"),i={stripAlpha:t,stripAlphaSlider:r};t.addClass("iris-strip-alpha"),r.addClass("iris-slider-offset-alpha"),t.appendTo(a.picker.find(".iris-picker-inner")),o.each(i,function(o,t){a.controls[o]=t}),a.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*a._color._alpha),slide:function(o,t){a.active="strip",a._color._alpha=parseFloat(t.value/100),a._change.apply(a,arguments)}})}},_dimensions:function(o){if(this._super(o),this.alphaOptions.alphaEnabled){var a,t,r,i,l,e=this,s=e.options,n=e.controls,p=n.square,h=e.picker.find(".iris-strip");for(a=Math.round(e.picker.outerWidth(!0)-(s.border?22:0)),t=Math.round(p.outerWidth()),r=Math.round((a-t)/2),i=Math.round(r/2),l=Math.round(t+2*r+2*i);l>a;)r=Math.round(r-2),i=Math.round(i-1),l=Math.round(t+2*r+2*i);p.css("margin","0"),h.width(r).css("margin-left",i+"px")}},_change:function(){var a=this,t=a.active;if(a._super(),a.alphaOptions.alphaEnabled){var r=a.controls,l=parseInt(100*a._color._alpha),e=a._color.toRgb(),s=["rgb("+e.r+","+e.g+","+e.b+") 0%","rgba("+e.r+","+e.g+","+e.b+", 0) 100%"];a.picker.closest(".wp-picker-container").find(".wp-color-result");a.options.color=a._getColor(),r.stripAlpha.css({background:"linear-gradient(to bottom, "+s.join(", ")+"), url("+i+")"}),t&&r.stripAlphaSlider.slider("value",l),a._color.error||a.element.removeClass("iris-error").val(a.options.color),a.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(){var t=o(this).data("color");a.alphaOptions.alphaReset&&(a._color._alpha=1,t=a._getColor()),a._setOption("color",t)})}},_paintDimension:function(o,a){var t=this,r=!1;t.alphaOptions.alphaEnabled&&"strip"===a&&(r=t._color,t._color=new Color(r.toString()),t.hue=t._color.h()),t._super(o,a),r&&(t._color=r)},_setOption:function(o,a){var t=this;if("color"!==o||!t.alphaOptions.alphaEnabled)return t._super(o,a);a=""+a,newColor=new Color(a).setHSpace(t.options.mode),newColor.error||t._getColor(newColor)===t._getColor()||(t._color=newColor,t.options.color=t._getColor(),t.active="external",t._change())},color:function(o){return!0===o?this._color.clone():o===a?this._getColor():void this.option("color",o)}}),o.widget("wp.wpColorPicker",o.wp.wpColorPicker,{alphaOptions:{alphaEnabled:!1},_getAlphaOptions:function(){var a=this.element,t=a.data("type")||this.options.type,r=a.data("defaultColor")||a.val(),i={alphaEnabled:a.data("alphaEnabled")||!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"rgb",alphaColorWithSpace:!1};return i.alphaEnabled&&(i.alphaEnabled=a.is("input")&&"full"===t),i.alphaEnabled?(i.alphaColorWithSpace=r&&r.match(/\s/),o.each(i,function(o,t){var l=a.data(o)||t;switch(o){case"alphaCustomWidth":l=l?parseInt(l,10):0,l=isNaN(l)?t:l;break;case"alphaColorType":l.match(/^(hex|(rgb|hsl)a?)$/)||(l=r&&r.match(/^#/)?"hex":r&&r.match(/^hsla?/)?"hsl":t);break;default:l=!!l}i[o]=l}),i):i},_create:function(){o.support.iris&&(this.alphaOptions=this._getAlphaOptions(),this._super())},_addListeners:function(){if(!this.alphaOptions.alphaEnabled)return this._super();var a=this,t=a.element,r=a.toggler.is("a");this.alphaOptions.defaultWidth=t.width(),this.alphaOptions.alphaCustomWidth&&t.width(parseInt(this.alphaOptions.defaultWidth+this.alphaOptions.alphaCustomWidth,10)),a.toggler.css({position:"relative","background-image":"url("+i+")"}),r?a.toggler.html('<span class="color-alpha" />'):a.toggler.append('<span class="color-alpha" />'),a.colorAlpha=a.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":t.val()}),"ltr"===a.colorAlpha.css("direction")?a.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):a.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),t.iris({change:function(o,t){a.colorAlpha.css({"background-color":t.color.to_s(a.alphaOptions.alphaColorType)}),"function"==typeof a.options.change&&a.options.change.call(this,o,t)}}),a.wrap.on("click.wpcolorpicker",function(o){o.stopPropagation()}),a.toggler.on("click",function(){a.toggler.hasClass("wp-picker-open")?a.close():a.open()}),t.on("change",function(i){var l=o(this).val();(t.hasClass("iris-error")||""===l||l.match(/^(#|(rgb|hsl)a?)$/))&&(r&&a.toggler.removeAttr("style"),a.colorAlpha.css("background-color",""),"function"==typeof a.options.clear&&a.options.clear.call(this,i))}),a.button.on("click",function(i){o(this).hasClass("wp-picker-default")?t.val(a.options.defaultColor).change():o(this).hasClass("wp-picker-clear")&&(t.val(""),r&&a.toggler.removeAttr("style"),a.colorAlpha.css("background-color",""),"function"==typeof a.options.clear&&a.options.clear.call(this,i),t.trigger("change"))})}})}})(jQuery);11 !function($){var wpColorPickerAlpha={version:304};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var version=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(version)&&version>=wpColorPickerAlpha.version)return}if(!Color.fn.hasOwnProperty("to_s")){Color.fn.to_s=function(type){if(this.error)return"";"hex"===(type=type||"hex")&&this._alpha<1&&(type="rgba");var color="";if("hex"===type)color=this.toString();else if("octohex"===type){color=this.toString();var alpha=parseInt(255*this._alpha,10).toString(16);1===alpha.length&&(alpha=`0${alpha}`),color+=alpha}else color=this.toCSS(type).replace(/\(\s+/,"(").replace(/\s+\)/,")");return color},Color.fn.fromHex=function(color){if(3===(color=color.replace(/^#/,"").replace(/^0x/,"")).length||4===color.length){for(var extendedColor="",index=0;index<color.length;index++)extendedColor+=""+color[index],extendedColor+=""+color[index];color=extendedColor}if(8===color.length){if(/^[0-9A-F]{8}$/i.test(color)){var alpha=parseInt(color.substring(6),16);isNaN(alpha)?this._error():this.a(alpha/255)}else this._error();color=color.substring(0,6)}return this.error||(this.error=!/^[0-9A-F]{6}$/i.test(color)),this.fromInt(parseInt(color,16))},window.wpColorPickerAlpha=wpColorPickerAlpha;var backgroundImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";$.widget("a8c.iris",$.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(color){return undefined===color&&(color=this._color),this.alphaOptions.alphaEnabled?(color=color.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(color=color.replace(/\s+/g,"")),color):color.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(e){}$.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1,alphaSkipDebounce:!1,alphaDebounceTimeout:100}),this._super()},_addInputListeners:function(input){var self=this,callback=function(event){var val=input.val(),color=new Color(val),type=(val=val.replace(/^(#|(rgb|hsl)a?)/,""),self.alphaOptions.alphaColorType);input.removeClass("iris-error"),color.error?""!==val&&input.addClass("iris-error"):"hex"===type&&"keyup"===event.type&&val.match(/^[0-9a-fA-F]{3}$/)||color.toIEOctoHex()!==self._color.toIEOctoHex()&&self._setOption("color",self._getColor(color))};input.on("change",callback),self.alphaOptions.alphaSkipDebounce||input.on("keyup",self._debounce(callback,self.alphaOptions.alphaDebounceTimeout)),self.options.hide&&input.one("focus",(function(){self.show()}))},_initControls:function(){if(this._super(),this.alphaOptions.alphaEnabled){var self=this,stripAlpha=self.controls.strip.clone(!1,!1),stripAlphaSlider=stripAlpha.find(".iris-slider-offset"),controls={stripAlpha:stripAlpha,stripAlphaSlider:stripAlphaSlider};stripAlpha.addClass("iris-strip-alpha"),stripAlphaSlider.addClass("iris-slider-offset-alpha"),stripAlpha.appendTo(self.picker.find(".iris-picker-inner")),$.each(controls,(function(k,v){self.controls[k]=v})),self.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*self._color._alpha),slide:function(event,ui){self.active="strip",self._color._alpha=parseFloat(ui.value/100),self._change.apply(self,arguments)}})}},_dimensions:function(reset){if(this._super(reset),this.alphaOptions.alphaEnabled){var innerWidth,squareWidth,stripWidth,stripMargin,totalWidth,opts=this.options,square=this.controls.square,strip=this.picker.find(".iris-strip");for(innerWidth=Math.round(this.picker.outerWidth(!0)-(opts.border?22:0)),squareWidth=Math.round(square.outerWidth()),stripWidth=Math.round((innerWidth-squareWidth)/2),stripMargin=Math.round(stripWidth/2),totalWidth=Math.round(squareWidth+2*stripWidth+2*stripMargin);totalWidth>innerWidth;)stripWidth=Math.round(stripWidth-2),stripMargin=Math.round(stripMargin-1),totalWidth=Math.round(squareWidth+2*stripWidth+2*stripMargin);square.css("margin","0"),strip.width(stripWidth).css("margin-left",stripMargin+"px")}},_change:function(){var self=this,active=self.active;if(self._super(),self.alphaOptions.alphaEnabled){var controls=self.controls,alpha=parseInt(100*self._color._alpha),color=self._color.toRgb(),gradient=["rgb("+color.r+","+color.g+","+color.b+") 0%","rgba("+color.r+","+color.g+","+color.b+", 0) 100%"];self.picker.closest(".wp-picker-container").find(".wp-color-result");self.options.color=self._getColor(),controls.stripAlpha.css({background:"linear-gradient(to bottom, "+gradient.join(", ")+"), url("+backgroundImage+")"}),active&&controls.stripAlphaSlider.slider("value",alpha),self._color.error||self.element.removeClass("iris-error").val(self.options.color),self.picker.find(".iris-palette-container").on("click.palette",".iris-palette",(function(){var color=$(this).data("color");self.alphaOptions.alphaReset&&(self._color._alpha=1,color=self._getColor()),self._setOption("color",color)}))}},_paintDimension:function(origin,control){var color=!1;this.alphaOptions.alphaEnabled&&"strip"===control&&(color=this._color,this._color=new Color(color.toString()),this.hue=this._color.h()),this._super(origin,control),color&&(this._color=color)},_setOption:function(key,value){if("color"!==key||!this.alphaOptions.alphaEnabled)return this._super(key,value);value=""+value,newColor=new Color(value).setHSpace(this.options.mode),newColor.error||this._getColor(newColor)===this._getColor()||(this._color=newColor,this.options.color=this._getColor(),this.active="external",this._change())},color:function(newColor){return!0===newColor?this._color.clone():undefined===newColor?this._getColor():void this.option("color",newColor)}}),$.widget("wp.wpColorPicker",$.wp.wpColorPicker,{alphaOptions:{alphaEnabled:!1},_getAlphaOptions:function(){var el=this.element,type=el.data("type")||this.options.type,color=el.data("defaultColor")||el.val(),options={alphaEnabled:el.data("alphaEnabled")||!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"rgb",alphaColorWithSpace:!1,alphaSkipDebounce:!!el.data("alphaSkipDebounce")||!1};return options.alphaEnabled&&(options.alphaEnabled=el.is("input")&&"full"===type),options.alphaEnabled?(options.alphaColorWithSpace=color&&color.match(/\s/),$.each(options,(function(name,defaultValue){var value=el.data(name)||defaultValue;switch(name){case"alphaCustomWidth":value=value?parseInt(value,10):0,value=isNaN(value)?defaultValue:value;break;case"alphaColorType":value.match(/^((octo)?hex|(rgb|hsl)a?)$/)||(value=color&&color.match(/^#/)?"hex":color&&color.match(/^hsla?/)?"hsl":defaultValue);break;default:value=!!value}options[name]=value})),options):options},_create:function(){$.support.iris&&(this.alphaOptions=this._getAlphaOptions(),this._super())},_addListeners:function(){if(!this.alphaOptions.alphaEnabled)return this._super();var self=this,el=self.element,isDeprecated=self.toggler.is("a");this.alphaOptions.defaultWidth=el.width(),this.alphaOptions.alphaCustomWidth&&el.width(parseInt(this.alphaOptions.defaultWidth+this.alphaOptions.alphaCustomWidth,10)),self.toggler.css({position:"relative","background-image":"url("+backgroundImage+")"}),isDeprecated?self.toggler.html('<span class="color-alpha" />'):self.toggler.append('<span class="color-alpha" />'),self.colorAlpha=self.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":el.val()}),"ltr"===self.colorAlpha.css("direction")?self.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):self.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),el.iris({change:function(event,ui){self.colorAlpha.css({"background-color":ui.color.to_s(self.alphaOptions.alphaColorType)}),"function"==typeof self.options.change&&self.options.change.call(this,event,ui)}}),self.wrap.on("click.wpcolorpicker",(function(event){event.stopPropagation()})),self.toggler.on("click",(function(){self.toggler.hasClass("wp-picker-open")?self.close():self.open()})),el.on("change",(function(event){var val=$(this).val();(el.hasClass("iris-error")||""===val||val.match(/^(#|(rgb|hsl)a?)$/))&&(isDeprecated&&self.toggler.removeAttr("style"),self.colorAlpha.css("background-color",""),"function"==typeof self.options.clear&&self.options.clear.call(this,event))})),self.button.on("click",(function(event){$(this).hasClass("wp-picker-default")?el.val(self.options.defaultColor).change():$(this).hasClass("wp-picker-clear")&&(el.val(""),isDeprecated&&self.toggler.removeAttr("style"),self.colorAlpha.css("background-color",""),"function"==typeof self.options.clear&&self.options.clear.call(this,event),el.trigger("change"))}))}})}}(jQuery); -
word-balloon/trunk/readme.txt
r3307744 r3322545 5 5 Requires at least: 3.9.3 6 6 Tested up to: 6.7 7 Stable tag: 4.22. 47 Stable tag: 4.22.5 8 8 Requires PHP: 5.3 9 9 License: GNU General Public License v3 or later … … 51 51 52 52 == Changelog == 53 54 = 4.22.5 = 55 * Released: July 5, 2025 56 * fixed: Minor fix. 53 57 54 58 = 4.22.4 = -
word-balloon/trunk/word-balloon.php
r3307744 r3322545 4 4 Plugin URI: https://dev.word-balloon.com/en/word-balloon/ 5 5 Description: Support for Block editor(Gutenberg) & Classic Editor.You will easy to add speech balloon in your post. 6 Version: 4.22. 46 Version: 4.22.5 7 7 Author: YAHMAN 8 8 Author URI: https://back2nature.jp/en/
Note: See TracChangeset
for help on using the changeset viewer.