Changeset 2199241
- Timestamp:
- 11/23/2019 01:06:19 AM (6 years ago)
- Location:
- wysiwyg-custom-products
- Files:
-
- 6 edited
-
tags/1.2/common/class-layout.php (modified) (20 diffs)
-
tags/1.2/readme.txt (modified) (1 diff)
-
tags/1.2/wysiwyg-custom-products.php (modified) (2 diffs)
-
trunk/common/class-layout.php (modified) (20 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wysiwyg-custom-products.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wysiwyg-custom-products/tags/1.2/common/class-layout.php
r2011778 r2199241 7 7 * 8 8 * @since 1.0.0 9 * @updated 1.2. 09 * @updated 1.2.5 10 10 */ 11 11 … … 38 38 * 39 39 * @since 1.0.0 40 * @updated 1.2. 340 * @updated 1.2.5 41 41 */ 42 42 class Layout { … … 127 127 'NumberOfLines' => '', 128 128 'SinglelineReformat' => '', 129 'IeMessage' => '', 129 130 'InkColor' => 0x000000, // Black 130 131 'ActiveMouseColor' => 0x00FFFF, // Aqua … … 175 176 private $singleLineReformatMsg; 176 177 /** 178 * @var string Message used at the frontend if ie is detected 179 */ 180 private $ieMsg; 181 /** 177 182 * @var int $setupWidth of layout, Used for scaling 178 183 */ … … 295 300 * 296 301 * @since 1.0.1 302 * @updated 1.2.5 297 303 */ 298 304 public static function ajax_get( $layoutName ) { … … 304 310 $result['NumberOfLines'] = esc_textarea_json_output( $result['NumberOfLines'] ); 305 311 $result['SinglelineReformat'] = esc_textarea_json_output( $result['SinglelineReformat'] ); 312 $result['IeMessage'] = esc_textarea_json_output( $result['IeMessage'] ); 306 313 } 307 314 … … 336 343 * 337 344 * @since 1.0.1 338 * @updated 1. 1.9345 * @updated 1.2.5 339 346 */ 340 347 public static function is_layout_valid( array &$layout, $sanitize = false ) { … … 347 354 $layout['ActiveMouseColor'] = self::$defaultLayout['template']['ActiveMouseColor']; 348 355 $layout['InactiveMouseColor'] = self::$defaultLayout['template']['InactiveMouseColor']; 356 } 357 358 if ( ! isset( $layout['IeMessage'] ) ) { // 1.2.5 Format update 359 $layout['IeMessage'] = self::$defaultLayout['template']['IeMessage']; 349 360 } 350 361 … … 364 375 self::is_string( $layout['NumberOfLines'] ); 365 376 self::is_string( $layout['SinglelineReformat'] ); 377 self::is_string( $layout['IeMessage'] ); 366 378 self::int_check( $layout['InkColor'], 0, 0xFFFFFF ); 367 379 self::int_check( $layout['ActiveMouseColor'], 0, 0xFFFFFF ); … … 372 384 $layout['NumberOfLines'] = sanitize_textarea_field( $layout['NumberOfLines'] ); 373 385 $layout['SinglelineReformat'] = sanitize_textarea_field( $layout['SinglelineReformat'] ); 386 $layout['IeMessage'] = sanitize_textarea_field( $layout['IeMessage'] ); 374 387 } 375 388 … … 513 526 public function setSingleLineReformatMsg( $msg ) { 514 527 $this->singleLineReformatMsg = sanitize_textarea_input( $msg ); 528 } 529 /** 530 * Message getter 531 * 532 * @return string 533 * 534 * @since 1.2.5 535 * @updated 1.2.5 536 */ 537 public function getIeMessage() { 538 return $this->ieMsg; 539 } 540 541 /** 542 * Message setter 543 * 544 * @param string $msg 545 * 546 * @since 1.2.5 547 * @updated 1.2.5 548 */ 549 public function setIeMessage( $msg ) { 550 $this->ieMsg = sanitize_textarea_input( $msg ); 515 551 } 516 552 … … 558 594 * 559 595 * @since 1.0.0 560 * @updated 1. 1.1596 * @updated 1.2.5 561 597 */ 562 598 public function load_layout( $layout, $layoutName ) { … … 581 617 $this->setNumberOfLinesMsg( $layout['NumberOfLines'] ); 582 618 $this->setSingleLineReformatMsg( $layout['SinglelineReformat'] ); 619 $this->setIeMessage( $layout['IeMessage'] ); 583 620 584 621 $this->formats = $layout['Formats']; … … 593 630 * 594 631 * @since 1.0.0 595 * @updated 1. 1.1632 * @updated 1.2.5 596 633 */ 597 634 public function as_array() { … … 610 647 $result['NumberOfLines'] = $this->numberOfLinesMsg; 611 648 $result['SinglelineReformat'] = $this->singleLineReformatMsg; 649 $result['IeMessage'] = $this->ieMsg; 612 650 613 651 $result = apply_filters( 'layout_as_array', $result ); … … 637 675 * 638 676 * @since 1.0.0 639 * @updated 1. 0.1677 * @updated 1.2.5 640 678 */ 641 679 public function save_defaults( $overwrite = false ) { … … 649 687 foreach ( self::$defaultLayout as $name => $option ) { 650 688 if ( '' === $option['MultilineReformat'] ) { 651 $option['MultilineReformat'] = self::get_ overflow_message( 'MultilineReformat' );689 $option['MultilineReformat'] = self::get_customer_message( 'MultilineReformat' ); 652 690 } 653 691 if ( '' === $option['NumberOfLines'] ) { 654 $option['NumberOfLines'] = self::get_ overflow_message( 'NumberOfLines' );692 $option['NumberOfLines'] = self::get_customer_message( 'NumberOfLines' ); 655 693 } 656 694 if ( '' === $option['SinglelineReformat'] ) { 657 $option['SinglelineReformat'] = self::get_overflow_message( 'SinglelineReformat' ); 695 $option['SinglelineReformat'] = self::get_customer_message( 'SinglelineReformat' ); 696 } 697 if ( '' === $option['IeMessage'] ) { 698 $option['IeMessage'] = self::get_customer_message( 'IeMessage' ); 658 699 } 659 700 … … 825 866 } 826 867 /** 827 * Gets a default overflowmessage when one isn't specified. Done this way to allow for translation868 * Gets a default message when one isn't specified. Done this way to allow for translation 828 869 * 829 870 * @param string $messageName … … 832 873 * 833 874 * @since 1.0.0 834 * @updated 1. 0.1835 */ 836 private static function get_ overflow_message( $messageName ) {875 * @updated 1.2.5 876 */ 877 private static function get_customer_message( $messageName ) { 837 878 switch ( $messageName ) { 838 879 case 'MultilineReformat': … … 850 891 'wysiwyg-custom-products' ); 851 892 break; 893 case 'IeMessage': 894 // TRANSLATORS: text used when to let customer know that Edge or IE aren't the best 895 $message = esc_html__( 'This site uses internet standards (SVG) that are not fully supported by Microsoft browsers (Edge or Internet Explorer). The preview images are best viewed using Chrome or Firefox.', 896 'wysiwyg-custom-products' ); 897 break; 852 898 default: 853 899 $message = ''; -
wysiwyg-custom-products/tags/1.2/readme.txt
r2152603 r2199241 4 4 Tags: WYSIWYG, wysiwyg, custom, customised, customized, preview, live, update, view, woocommerce 5 5 Requires at least: 4.5.4 6 Tested up to: 5. 2.36 Tested up to: 5.3.0 7 7 Stable tag: 1.2 8 8 License: GPLv3 or later -
wysiwyg-custom-products/tags/1.2/wysiwyg-custom-products.php
r2011778 r2199241 4 4 * Plugin URI: https://tazziedave.com/wp-plugins/wysiwyg-custom-products 5 5 * Description: Enables a live WYSIWYG preview of custom products where text is edited in text area or text field in woo commerce. 6 * Version: 1.2. 46 * Version: 1.2.5 7 7 * Author: Tazziedave 8 8 * Author URI: https://tazziedave.com … … 76 76 * Plug in version 77 77 */ 78 const VER = '1.2. 4';78 const VER = '1.2.5'; 79 79 /** 80 80 * Database version. Used in class-plugin to run updates as necessary -
wysiwyg-custom-products/trunk/common/class-layout.php
r2011778 r2199241 7 7 * 8 8 * @since 1.0.0 9 * @updated 1.2. 09 * @updated 1.2.5 10 10 */ 11 11 … … 38 38 * 39 39 * @since 1.0.0 40 * @updated 1.2. 340 * @updated 1.2.5 41 41 */ 42 42 class Layout { … … 127 127 'NumberOfLines' => '', 128 128 'SinglelineReformat' => '', 129 'IeMessage' => '', 129 130 'InkColor' => 0x000000, // Black 130 131 'ActiveMouseColor' => 0x00FFFF, // Aqua … … 175 176 private $singleLineReformatMsg; 176 177 /** 178 * @var string Message used at the frontend if ie is detected 179 */ 180 private $ieMsg; 181 /** 177 182 * @var int $setupWidth of layout, Used for scaling 178 183 */ … … 295 300 * 296 301 * @since 1.0.1 302 * @updated 1.2.5 297 303 */ 298 304 public static function ajax_get( $layoutName ) { … … 304 310 $result['NumberOfLines'] = esc_textarea_json_output( $result['NumberOfLines'] ); 305 311 $result['SinglelineReformat'] = esc_textarea_json_output( $result['SinglelineReformat'] ); 312 $result['IeMessage'] = esc_textarea_json_output( $result['IeMessage'] ); 306 313 } 307 314 … … 336 343 * 337 344 * @since 1.0.1 338 * @updated 1. 1.9345 * @updated 1.2.5 339 346 */ 340 347 public static function is_layout_valid( array &$layout, $sanitize = false ) { … … 347 354 $layout['ActiveMouseColor'] = self::$defaultLayout['template']['ActiveMouseColor']; 348 355 $layout['InactiveMouseColor'] = self::$defaultLayout['template']['InactiveMouseColor']; 356 } 357 358 if ( ! isset( $layout['IeMessage'] ) ) { // 1.2.5 Format update 359 $layout['IeMessage'] = self::$defaultLayout['template']['IeMessage']; 349 360 } 350 361 … … 364 375 self::is_string( $layout['NumberOfLines'] ); 365 376 self::is_string( $layout['SinglelineReformat'] ); 377 self::is_string( $layout['IeMessage'] ); 366 378 self::int_check( $layout['InkColor'], 0, 0xFFFFFF ); 367 379 self::int_check( $layout['ActiveMouseColor'], 0, 0xFFFFFF ); … … 372 384 $layout['NumberOfLines'] = sanitize_textarea_field( $layout['NumberOfLines'] ); 373 385 $layout['SinglelineReformat'] = sanitize_textarea_field( $layout['SinglelineReformat'] ); 386 $layout['IeMessage'] = sanitize_textarea_field( $layout['IeMessage'] ); 374 387 } 375 388 … … 513 526 public function setSingleLineReformatMsg( $msg ) { 514 527 $this->singleLineReformatMsg = sanitize_textarea_input( $msg ); 528 } 529 /** 530 * Message getter 531 * 532 * @return string 533 * 534 * @since 1.2.5 535 * @updated 1.2.5 536 */ 537 public function getIeMessage() { 538 return $this->ieMsg; 539 } 540 541 /** 542 * Message setter 543 * 544 * @param string $msg 545 * 546 * @since 1.2.5 547 * @updated 1.2.5 548 */ 549 public function setIeMessage( $msg ) { 550 $this->ieMsg = sanitize_textarea_input( $msg ); 515 551 } 516 552 … … 558 594 * 559 595 * @since 1.0.0 560 * @updated 1. 1.1596 * @updated 1.2.5 561 597 */ 562 598 public function load_layout( $layout, $layoutName ) { … … 581 617 $this->setNumberOfLinesMsg( $layout['NumberOfLines'] ); 582 618 $this->setSingleLineReformatMsg( $layout['SinglelineReformat'] ); 619 $this->setIeMessage( $layout['IeMessage'] ); 583 620 584 621 $this->formats = $layout['Formats']; … … 593 630 * 594 631 * @since 1.0.0 595 * @updated 1. 1.1632 * @updated 1.2.5 596 633 */ 597 634 public function as_array() { … … 610 647 $result['NumberOfLines'] = $this->numberOfLinesMsg; 611 648 $result['SinglelineReformat'] = $this->singleLineReformatMsg; 649 $result['IeMessage'] = $this->ieMsg; 612 650 613 651 $result = apply_filters( 'layout_as_array', $result ); … … 637 675 * 638 676 * @since 1.0.0 639 * @updated 1. 0.1677 * @updated 1.2.5 640 678 */ 641 679 public function save_defaults( $overwrite = false ) { … … 649 687 foreach ( self::$defaultLayout as $name => $option ) { 650 688 if ( '' === $option['MultilineReformat'] ) { 651 $option['MultilineReformat'] = self::get_ overflow_message( 'MultilineReformat' );689 $option['MultilineReformat'] = self::get_customer_message( 'MultilineReformat' ); 652 690 } 653 691 if ( '' === $option['NumberOfLines'] ) { 654 $option['NumberOfLines'] = self::get_ overflow_message( 'NumberOfLines' );692 $option['NumberOfLines'] = self::get_customer_message( 'NumberOfLines' ); 655 693 } 656 694 if ( '' === $option['SinglelineReformat'] ) { 657 $option['SinglelineReformat'] = self::get_overflow_message( 'SinglelineReformat' ); 695 $option['SinglelineReformat'] = self::get_customer_message( 'SinglelineReformat' ); 696 } 697 if ( '' === $option['IeMessage'] ) { 698 $option['IeMessage'] = self::get_customer_message( 'IeMessage' ); 658 699 } 659 700 … … 825 866 } 826 867 /** 827 * Gets a default overflowmessage when one isn't specified. Done this way to allow for translation868 * Gets a default message when one isn't specified. Done this way to allow for translation 828 869 * 829 870 * @param string $messageName … … 832 873 * 833 874 * @since 1.0.0 834 * @updated 1. 0.1835 */ 836 private static function get_ overflow_message( $messageName ) {875 * @updated 1.2.5 876 */ 877 private static function get_customer_message( $messageName ) { 837 878 switch ( $messageName ) { 838 879 case 'MultilineReformat': … … 850 891 'wysiwyg-custom-products' ); 851 892 break; 893 case 'IeMessage': 894 // TRANSLATORS: text used when to let customer know that Edge or IE aren't the best 895 $message = esc_html__( 'This site uses internet standards (SVG) that are not fully supported by Microsoft browsers (Edge or Internet Explorer). The preview images are best viewed using Chrome or Firefox.', 896 'wysiwyg-custom-products' ); 897 break; 852 898 default: 853 899 $message = ''; -
wysiwyg-custom-products/trunk/readme.txt
r2152603 r2199241 4 4 Tags: WYSIWYG, wysiwyg, custom, customised, customized, preview, live, update, view, woocommerce 5 5 Requires at least: 4.5.4 6 Tested up to: 5. 2.36 Tested up to: 5.3.0 7 7 Stable tag: 1.2 8 8 License: GPLv3 or later -
wysiwyg-custom-products/trunk/wysiwyg-custom-products.php
r2011778 r2199241 4 4 * Plugin URI: https://tazziedave.com/wp-plugins/wysiwyg-custom-products 5 5 * Description: Enables a live WYSIWYG preview of custom products where text is edited in text area or text field in woo commerce. 6 * Version: 1.2. 46 * Version: 1.2.5 7 7 * Author: Tazziedave 8 8 * Author URI: https://tazziedave.com … … 76 76 * Plug in version 77 77 */ 78 const VER = '1.2. 4';78 const VER = '1.2.5'; 79 79 /** 80 80 * Database version. Used in class-plugin to run updates as necessary
Note: See TracChangeset
for help on using the changeset viewer.