Changeset 1745720
- Timestamp:
- 10/12/2017 10:42:33 PM (8 years ago)
- Location:
- botosub
- Files:
-
- 5 added
- 5 deleted
- 2 edited
- 1 copied
-
tags/1.3.1 (copied) (copied from botosub/trunk)
-
tags/1.3.1/botosubPlugin.css (deleted)
-
tags/1.3.1/botosubPlugin.min.js (deleted)
-
trunk/botosub.php (modified) (20 diffs)
-
trunk/botosubPlugin.css (deleted)
-
trunk/botosubPlugin.min.js (deleted)
-
trunk/css (added)
-
trunk/css/adminStyle.css (added)
-
trunk/css/botosubPlugin.css (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src (added)
-
trunk/src/botosubPlugin.min.js (added)
-
trunk/style.css (deleted)
Legend:
- Unmodified
- Added
- Removed
-
botosub/trunk/botosub.php
r1742440 r1745720 4 4 Plugin URI: https://www.botosub.com/ 5 5 Description: Send Newsletters directly to Facebook Messenger users 6 Version: 1.3 6 Version: 1.3.1 7 7 Author: Botosub Dev 8 8 License: GPL2 … … 16 16 add_action('admin_init', 'botosub_admin_init'); 17 17 add_action('admin_menu', 'botosub_plugin_menu'); 18 add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' ); 18 19 19 20 $botosub_newsletter_text = "Subscribe to our Newsletters from Messenger Chatbot!"; … … 29 30 register_setting('bs_botosub_options', 'botosub_switch_color'); 30 31 register_setting('bs_botosub_options', 'botosub_plugin_type'); 32 register_setting('bs_botosub_options', 'botosub_bar_type'); 31 33 32 34 register_setting('bs_botosub_options', 'botosub_sc_title'); … … 47 49 register_setting('bs_botosub_options', 'botosub_mod_img_when_val'); 48 50 register_setting('bs_botosub_options', 'botosub_mod_img_again'); 49 register_setting('bs_botosub_options', 'botosub_mod_img_again_val'); 51 52 register_setting('bs_botosub_options', 'botosub_bar_enabled'); 53 register_setting('bs_botosub_options', 'botosub_scode_enabled'); 54 register_setting('bs_botosub_options', 'botosub_mod_enabled'); 55 } 56 57 function load_custom_wp_admin_style() { 58 wp_enqueue_style("botosub-admin-style", plugins_url('/css/adminStyle.css', __FILE__)); 50 59 } 51 60 … … 73 82 </script> 74 83 '; // sdk.js 75 wp_enqueue_style("botosub-plugin", plugins_url('/ botosubPlugin.css', __FILE__));76 wp_enqueue_script("botosub-plugin", plugins_url('/ botosubPlugin.min.js', __FILE__));84 wp_enqueue_style("botosub-plugin", plugins_url('/css/botosubPlugin.css', __FILE__)); 85 wp_enqueue_script("botosub-plugin", plugins_url('/src/botosubPlugin.min.js', __FILE__)); 77 86 78 87 } … … 85 94 function botosub_plugin_options() 86 95 { 87 // echo '<div class="wrap">'; ?> 96 ?> 97 88 98 <div class="wrap"> 89 99 <h2>Botosub - Newsletters From Messenger Chatbot</h2> … … 119 129 120 130 <select id="botosub_plugin_type" name="botosub_plugin_type" onchange="botosubChangeHandler()" style="width:40%"> 121 <option value="Top" <?php if ($tab_location == "Top") echo "selected"; ?>>Top Bar</option> 122 <option value="Bottom" <?php if ($tab_location == "Bottom") echo "selected"; ?>>Bottom Bar</option> 131 <option value="Bar" <?php if ($tab_location == "Top" || $tab_location == "Bottom" || $tab_location == "Bar") echo "selected"; ?>>Bar</option> 123 132 <option value="Shortcode" <?php if ($tab_location == "Shortcode") echo "selected"; ?>>Shortcode</option> 124 133 <option value="Modal" <?php if ($tab_location == "Modal") echo "selected"; ?>>Modal</option> 125 <option value="None" <?php if ($tab_location == "None") echo "selected"; ?>>None</option>126 134 </select> 127 135 </td> 128 136 129 </tr> 137 <!-- bar --> 138 <th id="botosub_bar_enabled_title" class="botosub_bar_class" scope="row">Disabled</th> 139 <td class="botosub_bar_class"> 140 <label class="btsSwitch"> 141 <input id="botosub_bar_enabled" name="botosub_bar_enabled" type="checkbox" onchange="return enabledChTitle(this.id);"> 142 <span class="btsSlider btsRound"></span> 143 </label> 144 </td> 145 146 <!-- scode --> 147 <th id="botosub_scode_enabled_title" class="botosub_scode_class" scope="row">Disabled</th> 148 <td class="botosub_scode_class"> 149 <label class="btsSwitch"> 150 <input id="botosub_scode_enabled" name="botosub_scode_enabled" type="checkbox" onchange="return enabledChTitle(this.id);"> 151 <span class="btsSlider btsRound"></span> 152 </label> 153 </td> 154 155 <!-- modal --> 156 <th id="botosub_mod_enabled_title" class="botosub_mod_class" scope="row">Disabled</th> 157 <td class="botosub_mod_class"> 158 <label class="btsSwitch"> 159 <input id="botosub_mod_enabled" name="botosub_mod_enabled" type="checkbox" onchange="return enabledChTitle(this.id);"> 160 <span class="btsSlider btsRound"></span> 161 </label> 162 </td> 163 164 </tr> 165 166 <tr valign="top"> 167 <!-- bar --> 168 <th class="botosub_bar_class" scope="row">Bar Type</th> 169 <td class="botosub_bar_class"> 170 <?php 171 $bar_type = (get_option('botosub_bar_type') == FALSE) ? 'Bottom' : get_option('botosub_bar_type'); 172 ?> 173 174 <select id="botosub_bar_type" name="botosub_bar_type" style="width:40%"> 175 <option value="Top" <?php if ($bar_type == "Top") echo "selected"; ?>>Top</option> 176 <option value="Bottom" <?php if ($bar_type == "Bottom") echo "selected"; ?>>Bottom</option> 177 </select> 178 </td> 179 </tr> 180 130 181 <tr valign="top"> 131 182 <!-- bar --> … … 272 323 273 324 </table> 274 275 <p class="submit" style="text-align: center"><input type="submit" class="button-primary" value="<?php e sc_attr_e('Save Changes')?>"/></p>325 326 <p class="submit" style="text-align: center"><input type="submit" class="button-primary" value="<?php echo 'Save Changes'; ?>"/></p> 276 327 </form> 277 328 <br/><br/> … … 288 339 var val = document.getElementById('botosub_plugin_type').value; 289 340 290 if ( val === 'Shortcode' ) { 291 displBar = "none"; 292 displSCode = "table-cell"; 293 displModal = "none"; 294 } else if ( val === 'Modal' ) { 295 displBar = "none"; 296 displSCode = "none"; 297 displModal = "table-cell"; 298 } else if ( val === 'None' ) { 299 displBar = "none"; 300 displSCode = "none"; 301 displModal = "none"; 302 } else { 303 displBar = "table-cell"; 304 displSCode = "none"; 305 displModal = "none"; 306 } 341 342 if ( val === 'Shortcode' ) { 343 displBar = "none"; 344 displSCode = "table-cell"; 345 displModal = "none"; 346 } else if ( val === 'Modal' ) { 347 displBar = "none"; 348 displSCode = "none"; 349 displModal = "table-cell"; 350 } else if ( val === 'None' ) { 351 displBar = "none"; 352 displSCode = "none"; 353 displModal = "none"; 354 } else { 355 displBar = "table-cell"; 356 displSCode = "none"; 357 displModal = "none"; 358 } 307 359 308 360 var barElements = document.getElementsByClassName("botosub_bar_class"); … … 320 372 modElements[ind].style.display = displModal; 321 373 } 322 323 374 } 324 375 … … 351 402 } 352 403 353 botosubChangeHandler(); 354 botosubWhenChHandler(); 355 botosubAgainChHandler(); 356 404 405 btsInit(); 406 407 function btsInit() { 408 409 botosubChangeHandler(); 410 botosubWhenChHandler(); 411 botosubAgainChHandler(); 412 413 414 var botosub_bar_enabled = <?php echo (get_option('botosub_bar_enabled') === FALSE || get_option('botosub_bar_enabled') === "") ? "false" : "true"; ?>; 415 var botosub_scode_enabled = <?php echo (get_option('botosub_scode_enabled') === FALSE || get_option('botosub_scode_enabled') === "") ? "false" : "true"; ?>; 416 var botosub_mod_enabled = <?php echo (get_option('botosub_mod_enabled') === FALSE || get_option('botosub_mod_enabled') === "") ? "false" : "true"; ?>; 417 418 if (botosub_bar_enabled) { 419 document.getElementById("botosub_bar_enabled").checked = true; 420 enabledChTitle("botosub_bar_enabled"); 421 } 422 if (botosub_scode_enabled) { 423 document.getElementById("botosub_scode_enabled").checked = true; 424 enabledChTitle("botosub_scode_enabled"); 425 } 426 if (botosub_mod_enabled) { 427 document.getElementById("botosub_mod_enabled").checked = true; 428 enabledChTitle("botosub_mod_enabled"); 429 } 430 } 431 432 function enabledChTitle(id) { 433 434 if (document.getElementById(id).checked) { 435 document.getElementById(id + "_title").innerHTML = "Enabled"; 436 } 437 else { 438 document.getElementById(id + "_title").innerHTML = "Disabled"; 439 } 440 } 441 357 442 </script> 358 443 <?php … … 370 455 if (get_option('botosub_fb_lang')==''){ $lang = "en_US"; } else { $lang = esc_attr( get_option('botosub_fb_lang') ); } 371 456 372 $tab_location_default = ' None';457 $tab_location_default = 'Modal'; 373 458 $tab_location = (get_option('botosub_plugin_type') == FALSE) ? $tab_location_default : get_option('botosub_plugin_type'); 374 459 460 $bar_enabled = (get_option('botosub_bar_enabled') === FALSE || get_option('botosub_bar_enabled') === "") ? "false" : "true"; 461 $scode_enabled = (get_option('botosub_scode_enabled') === FALSE || get_option('botosub_scode_enabled') === "") ? "false" : "true"; 462 $mod_enabled = (get_option('botosub_mod_enabled') === FALSE || get_option('botosub_mod_enabled') === "") ? "false" : "true"; 463 375 464 ?> 376 465 <script> 377 466 467 var botosub_bar_enabled = <?php echo $bar_enabled; ?>; 468 var botosub_scode_enabled = <?php echo $scode_enabled; ?>; 469 var botosub_mod_enabled = <?php echo $mod_enabled; ?>; 470 378 471 botosubPlugin.page_id = <?php echo $botosub_page_id; ?>; 379 472 … … 385 478 386 479 387 if ($ tab_location === 'Top' || $tab_location === 'Bottom') {480 if ($bar_enabled === "true") { 388 481 ?> 389 482 … … 391 484 392 485 var botosub_bar_position = ""; 393 var botosub_tab_location = "<?php echo $tab_location?>";486 var botosub_tab_location = "<?php echo (get_option('botosub_bar_type') == FALSE) ? 'Bottom' : get_option('botosub_bar_type'); ?>"; 394 487 if (botosub_tab_location === "Top") { 395 488 botosub_bar_position = "top"; … … 416 509 417 510 botosubPlugin.confBar({ 418 /*1*/ enabled : true,511 /*1*/ enabled : botosub_bar_enabled, 419 512 /*2*/ type : botosub_bar_position ,//type "top" or "bottom" with lowercase 420 513 /*3*/ hidden : false, … … 430 523 <?php 431 524 } 432 else if ($tab_location === 'Modal') {525 if ($mod_enabled === "true") { 433 526 ?> 434 527 … … 455 548 botosubPlugin.confModal({ 456 549 457 /*1*/ enabled : true,550 /*1*/ enabled : botosub_mod_enabled, 458 551 /* 459 552 MODAL TYPE … … 497 590 498 591 } 499 else if ($tab_location === 'Shortcode') {592 if ($scode_enabled === "true") { 500 593 ?> 501 594 … … 514 607 botosubPlugin.confInline ({ 515 608 516 /*1*/ enabled : true,609 /*1*/ enabled : botosub_scode_enabled, 517 610 /*2*/ imageURL : sc_img, 518 611 /*3*/ title: botosub_sc_title, … … 534 627 function botosub_letter_shortcode( $atts , $content = null ) { 535 628 536 $ tab_location = (get_option('botosub_plugin_type') == FALSE) ? $tab_location_default : get_option('botosub_plugin_type');537 538 if ($ tab_location == 'Shortcode') {629 $scode_enabled = (get_option('botosub_scode_enabled') === FALSE || get_option('botosub_scode_enabled') === "") ? "false" : "true"; 630 631 if ($scode_enabled == 'true') { 539 632 return "<div class=\"botosubInline\"></div>"; 540 633 } -
botosub/trunk/readme.txt
r1742450 r1745720 4 4 Requires at least: 3.1 5 5 Tested up to: 4.8 6 Stable tag: 1.3 6 Stable tag: 1.3.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 64 64 == Changelog == 65 65 66 = 1.3.1 = 67 68 * Multiple widgets can be added to a page now 69 66 70 = 1.3 = 67 71
Note: See TracChangeset
for help on using the changeset viewer.