Changeset 2149034
- Timestamp:
- 08/31/2019 08:20:50 PM (7 years ago)
- Location:
- last-comments-vk-widget/trunk
- Files:
-
- 2 edited
-
Readme.txt (modified) (2 diffs)
-
last-comments-vk-widget.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
last-comments-vk-widget/trunk/Readme.txt
r2015675 r2149034 12 12 13 13 == Installation == 14 1. Install Vk comments in your site. 15 2. Install this plugin. 16 3. Add widget. 17 4. Use. 14 1. Install Vk comments in your site 15 2. Install this plugin 16 3. Add widget 18 17 19 18 == Frequently Asked Questions == … … 27 26 1.0 Release 28 27 1.1 Completely rewritten code 28 1.2 Minification of the layout code, processing the required fields -
last-comments-vk-widget/trunk/last-comments-vk-widget.php
r2015675 r2149034 4 4 Plugin URI: 5 5 Description: Widget last comments VK 6 Version: 1. 16 Version: 1.2 7 7 Author: Somonator 8 8 Author URI: … … 65 65 <p> 66 66 <label><?php echo $translate; ?> 67 <input type="text" name="<?php echo $this->get_field_name($name); ?>" value="<?php echo esc_attr($val); ?>" class="widefat" <?php echo !empty($required)?'required':null; ?>> 67 <input type="text" name="<?php echo $this->get_field_name($name); ?>" value="<?php echo esc_attr($val); ?>" class="widefat" <?php echo !empty($required)?'required':null; ?>> 68 </label> 68 69 </p> 69 70 <?php … … 86 87 add_action('wp_footer', array($this, 'inner_scripts')); 87 88 } 89 add_action('admin_footer', array($this, 'add_scripts_to_admin')); 88 90 add_action('plugins_loaded', array($this, 'lang_load')); 89 91 } … … 93 95 wp_enqueue_script('vk-api', '//vk.com/js/api/openapi.js'); 94 96 } 95 wp_add_inline_script('vk-api', ' 96 window.onload = function () { 97 VK.init({apiId: lcv.appid, onlyWidgets: false}); 98 VK.Widgets.CommentsBrowse("last-comments-vk", {limit: lcv.limit, mini: 0}); 99 } 100 '); 97 wp_add_inline_script('vk-api', 'window.onload = function () {VK.init({apiId: lcv.appid, onlyWidgets: false}); VK.Widgets.CommentsBrowse("last-comments-vk", {limit: lcv.limit, mini: 0});}'); 101 98 } 102 99 103 100 public function inner_scripts() { 104 101 ?> 105 <style> 106 #last-comments-vk, 107 #last-comments-vk iframe { 108 width: 100% !important; 109 max-width: 100% !important; 110 display: table; 111 } 112 </style> 102 <style>#last-comments-vk,#last-comments-vk iframe{width:100%!important;max-width:100%!important;display:table;}</style> 113 103 <?php 104 } 105 106 public function add_scripts_to_admin() { 107 if (get_current_screen()->base == 'widgets') { 108 ?> 109 <script>jQuery(function($){$(document).delegate('[id*="lcv_widget"] input[name="savewidget"]', 'click', function() {var $form = $(this).parents().closest('form');$form.find('input[required]').each(function() {if (!$(this)[0].checkValidity()) {$(this)[0].reportValidity();}});});});</script> 110 <?php 111 } 114 112 } 115 113
Note: See TracChangeset
for help on using the changeset viewer.