Changeset 2444566
- Timestamp:
- 12/22/2020 07:00:31 PM (5 years ago)
- Location:
- i2-pro-cons/trunk
- Files:
-
- 4 edited
-
dist/js/admin-popup-classic-editor.js (modified) (4 diffs)
-
i2-pros-and-cons.php (modified) (2 diffs)
-
include/ce-popup.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2-pro-cons/trunk/dist/js/admin-popup-classic-editor.js
r2418679 r2444566 1 jQuery(function ($) { 1 //jQuery(function ($) { 2 var i2pcModule = {}; 3 (function() { 4 console.log("init 0"); 5 console.log(tinymce); 2 6 tinymce.create('tinymce.plugins.i2pc_ce_popup_plugin', { 3 //url argument holds the absolute url of our plugin directory 7 //url argument holds the absolute url of our plugin directory 4 8 init: function (ed, url) { 9 console.log("init 11"); 10 console.log(ed); 5 11 //add new button 6 12 ed.addButton('i2pc_ce_popup_button', { … … 21 27 var attrs = wp.shortcode.attrs(content).named; 22 28 console.log(attrs); 23 24 if (attrs.hasOwnProperty('pros_icon')) { 25 $('#pros-icon').val(attrs.pros_icon); 26 } 27 if (attrs.hasOwnProperty('cons_icon')) { 28 $('#cons-icon').val(attrs.cons_icon); 29 } 30 if (attrs.hasOwnProperty('show_title')) { 31 $('#show_title').prop('checked', attrs.show_title == 'true'); 32 $('#show_title').trigger('change'); 33 } else { 34 $('#show_title').prop('checked', true); 35 } 36 37 if (attrs.hasOwnProperty('show_button')) { 38 $('#show_button').prop('checked', attrs.show_button == 'true'); 39 $('#show_button').trigger('change'); 40 } else { 41 $('#show_button').trigger('change'); 42 } 43 44 if (attrs.hasOwnProperty('title')) { 45 $('#main-title').val(attrs.title); 46 } 47 if (attrs.hasOwnProperty('use_heading_icon')) { 48 $('#use_heading_icon').val(attrs.use_heading_icon); 49 } 50 51 if (attrs.hasOwnProperty('pros_title')) { 52 $('#pros_title').val(attrs.pros_title); 53 } 54 if (attrs.hasOwnProperty('cons_title')) { 55 $('#cons_title').val(attrs.cons_title); 56 } 57 if (attrs.hasOwnProperty('heading_pros_icon')) { 58 $('#heading_pros_icon').val(attrs.heading_pros_icon); 59 } 60 if (attrs.hasOwnProperty('heading_cons_icon')) { 61 $('#heading_cons_icon').val(attrs.heading_cons_icon); 62 } 63 if (attrs.hasOwnProperty('button_icon')) { 64 $('#button_icon').val(attrs.button_icon); 65 } 66 if (attrs.hasOwnProperty('link_text')) { 67 $('#link_text').val(attrs.link_text); 68 } 69 if (attrs.hasOwnProperty('link')) { 70 $('#link').val(attrs.link); 71 } 72 73 if (wp.shortcode.regexp('i2pc').test(content)) { 74 var i2pros = content.match(wp.shortcode.regexp('i2pros'))[0]; 75 i2pros = i2pros.substr(8, i2pros.length - 17); 76 $('#i2pc_ce_editor_popup #i2pc-pros').val(i2pros.replace(/<br\s*[\/]?>/gi, '\n')); 77 78 var i2cons = content.match(wp.shortcode.regexp('i2cons'))[0]; 79 i2cons = i2cons.substr(8, i2cons.length - 17); 80 $('#i2pc_ce_editor_popup #i2pc-cons').val(i2cons.replace(/<br\s*[\/]?>/gi, '\n')); 81 } 82 83 //console.log($('#i2pc_ce_editor_popup').length); 84 $('#i2pc_ce_editor_popup').addClass('i2pc-ce-popup-display'); 85 $('body').css('overflow', 'hidden'); 29 i2pcModule.i2pc_show_popup(attrs,content); 30 86 31 }); 87 32 }, … … 97 42 98 43 tinymce.PluginManager.add('i2pc_ce_popup_button', tinymce.plugins.i2pc_ce_popup_plugin); 44 })(); 45 46 47 48 49 jQuery(function ($) { 50 i2pcModule.i2pc_show_popup = function (attrs,content){ 51 console.log("inside dd"); 52 console.log(attrs); 53 54 if (attrs.hasOwnProperty('pros_icon')) { 55 $('#pros-icon').val(attrs.pros_icon); 56 } 57 if (attrs.hasOwnProperty('cons_icon')) { 58 $('#cons-icon').val(attrs.cons_icon); 59 } 60 if (attrs.hasOwnProperty('show_title')) { 61 $('#show_title').prop('checked', attrs.show_title == 'true'); 62 $('#show_title').trigger('change'); 63 } else { 64 $('#show_title').prop('checked', true); 65 } 66 67 if (attrs.hasOwnProperty('show_button')) { 68 $('#show_button').prop('checked', attrs.show_button == 'true'); 69 $('#show_button').trigger('change'); 70 } else { 71 $('#show_button').trigger('change'); 72 } 73 74 if (attrs.hasOwnProperty('title')) { 75 $('#main-title').val(attrs.title); 76 } 77 if (attrs.hasOwnProperty('use_heading_icon')) { 78 $('#use_heading_icon').val(attrs.use_heading_icon); 79 } 80 81 if (attrs.hasOwnProperty('pros_title')) { 82 $('#pros_title').val(attrs.pros_title); 83 } 84 if (attrs.hasOwnProperty('cons_title')) { 85 $('#cons_title').val(attrs.cons_title); 86 } 87 if (attrs.hasOwnProperty('heading_pros_icon')) { 88 $('#heading_pros_icon').val(attrs.heading_pros_icon); 89 } 90 if (attrs.hasOwnProperty('heading_cons_icon')) { 91 $('#heading_cons_icon').val(attrs.heading_cons_icon); 92 } 93 if (attrs.hasOwnProperty('button_icon')) { 94 $('#button_icon').val(attrs.button_icon); 95 } 96 if (attrs.hasOwnProperty('link_text')) { 97 $('#link_text').val(attrs.link_text); 98 } 99 if (attrs.hasOwnProperty('link')) { 100 $('#link').val(attrs.link); 101 } 102 103 if (wp.shortcode.regexp('i2pc').test(content)) { 104 var i2pros = content.match(wp.shortcode.regexp('i2pros'))[0]; 105 i2pros = i2pros.substr(8, i2pros.length - 17); 106 $('#i2pc_ce_editor_popup #i2pc-pros').val(i2pros.replace(/<br\s*[\/]?>/gi, '\n')); 107 108 var i2cons = content.match(wp.shortcode.regexp('i2cons'))[0]; 109 i2cons = i2cons.substr(8, i2cons.length - 17); 110 $('#i2pc_ce_editor_popup #i2pc-cons').val(i2cons.replace(/<br\s*[\/]?>/gi, '\n')); 111 } 112 113 //console.log($('#i2pc_ce_editor_popup').length); 114 $('#i2pc_ce_editor_popup').addClass('i2pc-ce-popup-display'); 115 $('body').css('overflow', 'hidden'); 116 } 117 //i2pcModule.i2pc_show_popup = i2pc_show_popup; 99 118 100 119 $('#i2pc-ce-submit').on('click', function (e) { … … 197 216 } 198 217 }); 199 200 218 String.prototype.isEmpty = function () { 201 219 return this.length === 0 || !this.trim(); 202 }; 220 }; 203 221 }); -
i2-pro-cons/trunk/i2-pros-and-cons.php
r2422759 r2444566 8 8 * Author URI: https://github.com/imibrar 9 9 * Text Domain: i2-pros-and-cons 10 * Version: 1. 2.710 * Version: 1.3.0 11 11 * License: GPLv3 12 12 * License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 19 19 20 20 define('I2PC_MORE_THEMES_PLUGINS_URL', 'https://themesfirst.com'); 21 define('I2PC_VER', '1. 2.6');22 define('I2PC_CSS_VER', '1. 2.6');21 define('I2PC_VER', '1.3.0'); 22 define('I2PC_CSS_VER', '1.3.0'); 23 23 24 24 //include_once('include/ibr-test-block.php'); -
i2-pro-cons/trunk/include/ce-popup.php
r2418679 r2444566 18 18 function i2pc_ce_editor_style($hook) 19 19 { 20 if ( $hook == 'post-new.php' || $hook == 'post.php') {20 if ( ($hook == 'post-new.php' || $hook == 'post.php') && get_user_option( 'rich_editing' ) == 'true') { 21 21 wp_enqueue_style('i2pc_ce_editor_style', plugins_url('../dist/css/admin-ce-popup.min.css', __FILE__), null, I2PC_CSS_VER); 22 i2pc_ce_editor_popup();22 add_filter('admin_footer', 'i2pc_ce_editor_popup'); 23 23 } 24 24 } -
i2-pro-cons/trunk/readme.txt
r2422759 r2444566 2 2 Contributors: imibrar 3 3 Tags: Pros & Cons, Amazon Pros & Cons, Pros and Cons, WP Pros & Cons 4 Tested up to: 5. 5.35 Stable tag: 1. 2.64 Tested up to: 5.6 5 Stable tag: 1.3.0 6 6 Requires PHP: 5.x 7 7 License: GPLv3 … … 13 13 14 14 **Update** 15 v1.3.0 bug fix, popup button not visible in WordPress 5.6 in classic editor. 15 16 v1.2.6 bug fix, showing notice "rest_validate_value_from_schema was called incorrectly" in debug mode. 16 17 v1.2.4 allow to add pros and cons in single popup for gutenberg. … … 83 84 84 85 You can contact me from [here](https://themesfirst.com/ "i2 Pros & Cons") 85 Waiting for your [Suggestion, feedback](https://themesfirst.com/feedback/ ,"i2 Pros & Cons Feedback")86 Waiting for your [Suggestion, feedback](https://themesfirst.com/feedback/ "i2 Pros & Cons Feedback") 86 87 87 88 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.