Changeset 2529523
- Timestamp:
- 05/11/2021 07:33:15 AM (5 years ago)
- Location:
- prodalet/trunk
- Files:
-
- 4 edited
-
README.md (modified) (1 diff)
-
admin_panel.php (modified) (5 diffs)
-
prodalet.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
prodalet/trunk/README.md
r2414651 r2529523 82 82 83 83 ### 1.0 84 Initial release 84 Релиз 85 ### 1.2 86 Настройка возможности отложенной загрузки -
prodalet/trunk/admin_panel.php
r2414651 r2529523 8 8 9 9 var $script_position_array = array( 10 ' header' => 'Подключается в начале странице',11 'footer' => 'Подключается в конце страницы' 10 'footer' => 'Подключается в конце страницы', 11 'header' => 'Подключается в начале странице', 12 12 ); 13 13 … … 103 103 ); 104 104 add_settings_field( 'script_api_secret', 'API SECRET ProdaLet', array(&$this, 'display_settings'), 'prodalet_page', 'prodalet', $field_params ); 105 105 106 106 107 $field_params = array( … … 109 110 'label_for' => 'position' , 110 111 'desc' => 'Выберите место расположения сервиса. Если установить наш код в начале странице - то виджеты будут показывать быстрее.', // описание 111 'vals' => $this->script_position_array 112 'vals' => $this->script_position_array, 113 'defautl' => 'footer', 112 114 ); 113 115 add_settings_field( 'position', 'Подключение кода установки', array(&$this, 'display_settings'), 'prodalet_page', 'prodalet', $field_params ); 114 116 117 $field_params = array( 118 'type' => 'text', 119 'id' => 'lazy_load_desctop', 120 'desc' => 'Через сколько секунд после загрузки сайта будет подгружаться сервис Prodalet на компьютерах. 0 - сразу после загрузки. ', // описание 121 'label_for' => 'lazy_load_desctop', 122 'default' => 0, 123 ); 124 add_settings_field( 'lazy_load_desctop', 'Отложенная загрузка для КОМПЬЮТЕРОВ, секунд ', array(&$this, 'display_settings'), 'prodalet_page', 'prodalet', $field_params ); 125 126 $field_params = array( 127 'type' => 'text', 128 'id' => 'lazy_load_mobile', 129 'desc' => 'Через сколько секунд после загрузки сайта на мобильных телефонах будет подгружаться сервис Prodalet . 0 - сразу после загрузки. ', // описание 130 'label_for' => 'lazy_load_mobile', 131 'default' => 0, 132 ); 133 add_settings_field( 'lazy_load_mobile', 'Отложенная загрузка для МОБИЛЬНЫХ, секунд ', array(&$this, 'display_settings'), 'prodalet_page', 'prodalet', $field_params ); 134 115 135 $field_params = array( 116 136 'type' => 'checkbox-group', … … 154 174 $o = get_option( $option_name ); 155 175 156 switch ( $type ) { 157 case 'text': 158 $o[$id] = esc_attr( stripslashes($o[$id]) ); 159 echo "<input class='regular-text' type='text' id='$id' name='" . $option_name . "[$id]' value='$o[$id]' />"; 160 echo (isset($args['desc'])) ? '<br /><span class="description">'.$args['desc'].'</span>' : ""; 161 break; 176 switch ( $type ) { 177 case 'text': 178 $o[$id] = esc_attr( stripslashes($o[$id]) ); 179 if(isset($o[$id]) && $o[$id] !=='') { 180 $val = $o[$id]; 181 } elseif(isset($args['default'])) { 182 $val = $args['default']; 183 } 184 echo "<input class='regular-text' type='text' id='$id' name='" . $option_name . "[$id]' value='$val' />"; 185 echo (isset($args['desc'])) ? '<br /><span class="description">'.$args['desc'].'</span>' : ""; 186 break; 162 187 case 'textarea': 163 188 $o[$id] = esc_attr( stripslashes($o[$id]) ); … … 223 248 } 224 249 } 225 ?> -
prodalet/trunk/prodalet.php
r2414651 r2529523 4 4 Plugin URI: https://prodalet.ru/cms-ext_plugins/wordpress/prodalet.zip 5 5 Description: Подключение сервиса повышения конверсии ProdaLet.ru 6 Version: 1 6 Version: 1.2 7 7 Author: ProdaLet 8 8 Author URI: https://prodalet.ru … … 19 19 'position' => 'header', 20 20 'mode' => 'all', 21 'lazy_load_desctop' => 0, 22 'lazy_load_mobile' => 0, 21 23 'activate_admin_panel' => null 22 24 ); … … 111 113 //Формируем код для встраивания в страницу 112 114 $ret = " 113 <!--Start Prodalet code WordPress plugin vers 1. 1{literal}-->115 <!--Start Prodalet code WordPress plugin vers 1.2 {literal}--> 114 116 <script> 117 lazy=0;lM=". $this->options['lazy_load_mobile']*1000 ."; lD=". $this->options['lazy_load_desctop']*1000 ."; if( window.matchMedia(\"only screen and (max-width: 760px)\").matches ) {lazy = lM;} else {lazy = lD;} 115 118 setTimeout(function (){ 116 119 var PLTQ = []; {$js_client_info_query} var d = new Date().getTime(); … … 135 138 } 136 139 137 , {$lazy_load_time});</script>140 ,lazy);</script> 138 141 <!--End Prodalet code {/literal}-->"; 139 142 -
prodalet/trunk/readme.txt
r2416342 r2529523 90 90 = 1.0 = 91 91 Initial release 92 93 = 1.2 = 94 Настройка возможности отложенной загрузки
Note: See TracChangeset
for help on using the changeset viewer.