Changeset 1675072
- Timestamp:
- 06/09/2017 08:23:20 PM (9 years ago)
- Location:
- botosub/trunk
- Files:
-
- 2 added
- 2 edited
-
botosub.php (modified) (16 diffs)
-
readme.txt (modified) (1 diff)
-
tingle.min.css (added)
-
tingle.min.js (added)
Legend:
- Unmodified
- Added
- Removed
-
botosub/trunk/botosub.php
r1673372 r1675072 4 4 Plugin URI: https://www.botosub.com/ 5 5 Description: Send Newsletters directly to Facebook Messenger users 6 Version: 1. 16 Version: 1.2 7 7 Author: Botosub Dev 8 8 License: GPL2 … … 29 29 register_setting('bs_botosub_options', 'botosub_switch_color'); 30 30 register_setting('bs_botosub_options', 'botosub_plugin_type'); 31 31 32 register_setting('bs_botosub_options', 'botosub_sc_title'); 32 33 register_setting('bs_botosub_options', 'botosub_sc_title_color'); … … 35 36 register_setting('bs_botosub_options', 'botosub_sc_bg_color'); 36 37 register_setting('bs_botosub_options', 'botosub_sc_img'); 38 39 register_setting('bs_botosub_options', 'botosub_mod_title'); 40 register_setting('bs_botosub_options', 'botosub_mod_title_color'); 41 register_setting('bs_botosub_options', 'botosub_mod_desc'); 42 register_setting('bs_botosub_options', 'botosub_mod_desc_color'); 43 register_setting('bs_botosub_options', 'botosub_mod_bg_color'); 44 register_setting('bs_botosub_options', 'botosub_mod_img'); 45 register_setting('bs_botosub_options', 'botosub_mod_img_pos'); 37 46 } 38 47 … … 61 70 '; 62 71 wp_enqueue_style("botosub-top-plugin", plugins_url('/style.css', __FILE__)); 72 wp_enqueue_style("tingle", plugins_url('/tingle.min.css', __FILE__)); 73 wp_enqueue_script("tingle", plugins_url('/tingle.min.js', __FILE__)); 74 63 75 64 76 } … … 102 114 103 115 ?> 104 <input type="radio" name="botosub_plugin_type" 105 value="Top" <?php echo $tab_location == "Top" ? "checked" : "" ?> > Top Bar 106 <input type="radio" name="botosub_plugin_type" 107 value="Bottom" <?php echo $tab_location == "Bottom" ? "checked" : "" ?> > Bottom Bar 108 <input type="radio" name="botosub_plugin_type" 109 value="Shortcode" <?php echo $tab_location == "Shortcode" ? "checked" : "" ?> > Shortcode 116 117 <select id="botosub_plugin_type" name="botosub_plugin_type" onchange="changeHandler()" style="width:40%"> 118 <option value="Top" <?php if ($tab_location == "Top") echo "selected"; ?>>Top Bar</option> 119 <option value="Bottom" <?php if ($tab_location == "Bottom") echo "selected"; ?>>Bottom Bar</option> 120 <option value="Shortcode" <?php if ($tab_location == "Shortcode") echo "selected"; ?>>Shortcode</option> 121 <option value="Modal" <?php if ($tab_location == "Modal") echo "selected"; ?>>Modal</option> 122 <option value="None" <?php if ($tab_location == "None") echo "selected"; ?>>None</option> 123 </select> 110 124 </td> 111 125 … … 121 135 <td class="botosub_bar_class"><input type="text" name="botosub_text_color" placeholder="#ffffff" 122 136 value="<?php echo get_option('botosub_text_color'); ?>"/></td> 123 137 124 138 <!-- scode --> 125 139 <th class="botosub_scode_class" scope="row">Title</th> … … 131 145 <td class="botosub_scode_class"><input type="text" name="botosub_sc_title_color" placeholder="#333" 132 146 value="<?php echo get_option('botosub_sc_title_color'); ?>"/></td> 147 148 <!-- modal --> 149 <th class="botosub_mod_class" scope="row">Title</th> 150 <td class="botosub_mod_class"> 151 <input type="text" name="botosub_mod_title" style="width:70%;" placeholder="<?php echo $botosub_newsletter_text; ?>" value="<?php echo get_option('botosub_mod_title'); ?>" /> 152 </td> 153 154 <th class="botosub_mod_class" scope="row">Title Color</th> 155 <td class="botosub_mod_class"><input type="text" name="botosub_mod_title_color" placeholder="#333" 156 value="<?php echo get_option('botosub_mod_title_color'); ?>"/></td> 133 157 134 158 </tr> … … 154 178 <td class="botosub_scode_class"><input type="text" name="botosub_sc_desc_color" placeholder="#333" 155 179 value="<?php echo get_option('botosub_sc_desc_color'); ?>"/></td> 180 181 <!-- modal --> 182 <th class="botosub_mod_class" scope="row">Description</th> 183 <td class="botosub_mod_class"> 184 <input type="text" name="botosub_mod_desc" style="width:70%;" value="<?php echo get_option('botosub_mod_desc'); ?>" /> 185 </td> 186 187 <th class="botosub_mod_class" scope="row">Description Color</th> 188 <td class="botosub_mod_class"><input type="text" name="botosub_mod_desc_color" placeholder="#333" 189 value="<?php echo get_option('botosub_mod_desc_color'); ?>"/></td> 156 190 </tr> 157 191 <tr valign="top"> … … 169 203 <th class="botosub_scode_class" scope="row">Shortcode</th> 170 204 <td class="botosub_scode_class"><span style="margin-bottom: 20px; font-size: 21px; font-weight: 300; line-height: 1.4;">[botosub_newsletters]</span></td> 205 206 <!-- modal --> 207 <th class="botosub_mod_class" scope="row">Background Color</th> 208 <td class="botosub_mod_class"> 209 <input type="text" name="botosub_mod_bg_color" placeholder="#ffffff" style="width:70%;" value="<?php echo get_option('botosub_mod_bg_color'); ?>" /> 210 </td> 211 171 212 </tr> 172 213 … … 178 219 <input type="text" name="botosub_sc_img" placeholder="" style="width:70%;" value="<?php echo get_option('botosub_sc_img'); ?>" /> 179 220 </td> 221 222 <!-- modal --> 223 <th class="botosub_mod_class" scope="row">Image URL</th> 224 <td class="botosub_mod_class"> 225 <input type="text" name="botosub_mod_img" style="width:70%" placeholder="" value="<?php echo get_option('botosub_mod_img'); ?>" /> 226 </td> 227 228 <th class="botosub_mod_class" scope="row">Image Position</th> 229 <td class="botosub_mod_class"> 230 <?php $mod_img_pos = (get_option('botosub_mod_img_pos') == FALSE) ? "" : get_option('botosub_mod_img_pos'); ?> 231 <select name="botosub_mod_img_pos" style="width:100%"> 232 <option value="0" <?php if ($mod_img_pos == "0" || $mod_img_pos == "") echo "selected"; ?>>Above Title</option> 233 <option value="1" <?php if ($mod_img_pos == "1") echo "selected"; ?>>Above Description</option> 234 <option value="2" <?php if ($mod_img_pos == "2") echo "selected"; ?>>Below Description</option> 235 </select> 236 </td> 180 237 181 238 </tr> … … 190 247 191 248 <script> 192 var radios = document.querySelectorAll('input[type=radio][name="botosub_plugin_type"]'); 193 194 function changeHandler(event) { 195 196 var displBar = "", displSCode = ""; 197 var val = document.querySelector('input[type=radio][name="botosub_plugin_type"]:checked').value; 249 250 251 function changeHandler() { 252 253 var displBar = "", displSCode = "", displModal = ""; 254 var val = document.getElementById('botosub_plugin_type').value; 255 198 256 if ( val === 'Shortcode' ) { 199 257 displBar = "none"; 200 258 displSCode = "table-cell"; 259 displModal = "none"; 260 } else if ( val === 'Modal' ) { 261 displBar = "none"; 262 displSCode = "none"; 263 displModal = "table-cell"; 264 } else if ( val === 'None' ) { 265 displBar = "none"; 266 displSCode = "none"; 267 displModal = "none"; 201 268 } else { 202 269 displBar = "table-cell"; 203 270 displSCode = "none"; 271 displModal = "none"; 204 272 } 205 273 … … 213 281 scodeElements[ind].style.display = displSCode; 214 282 } 215 216 var barInputs = document.getElementsByClassName("bar_input"); 217 for (var ind = 0; ind < barInputs.length; ind++) { 218 if (val === "Shortcode"){ 219 var att = document.createAttribute("disabled"); 220 att.value = "disabled"; 221 barInputs[ind].setAttributeNode(att); 222 } 223 else { 224 barInputs[ind].removeAttribute("disabled"); 225 } 283 284 var modElements = document.getElementsByClassName("botosub_mod_class"); 285 for (var ind = 0; ind < modElements.length; ind++) { 286 modElements[ind].style.display = displModal; 226 287 } 288 227 289 } 228 290 291 229 292 changeHandler(); 230 293 231 Array.prototype.forEach.call(radios, function(radio) {232 radio.addEventListener('change', changeHandler);233 });234 294 </script> 235 295 <?php … … 243 303 244 304 245 $tab_location_default = ' Bottom';305 $tab_location_default = 'None'; 246 306 247 307 $tab_location = (get_option('botosub_plugin_type') == FALSE) ? $tab_location_default : get_option('botosub_plugin_type'); … … 249 309 $plugin_class = "botosub-plugin-top"; 250 310 $plugin_switch_class = "botosub-plugin-switch-top"; 251 } else {311 } else if ($tab_location == 'Bottom') { 252 312 $plugin_class = "botosub-plugin-bottom"; 253 313 $plugin_switch_class = "botosub-plugin-switch-bottom"; … … 290 350 }, 500) 291 351 352 353 // NEW MODAL 354 var modal = new tingle.modal({ 355 footer: false, 356 stickyFooter: false, 357 closeMethods: ['overlay', 'button', 'escape'], 358 closeLabel: "Close", 359 onOpen: function() { 360 361 }, 362 onClose: function() { 363 364 }, 365 beforeClose: function() { 366 return true; // close the modal 367 } 368 }); 369 370 371 var mTitle = "<span style='display:block; font-size:2.5em; margin-bottom:15px;'>GET FREE UPDATES</span>"; 372 var mDesc = "<span style='display:block; font-size:26px; font-weight:300; line-height:36.4px; margin-bottom:15px; color:#666; '>JOIN OVER 200,000 SUBSCRIBERS</span>"; 373 var mImg = "<img style='max-height:500px; margin-bottom:15px;' src='https://image.freepik.com/free-vector/magic-wand-and-rabbit-in-a-hat_23-2147493063.jpg'>"; 374 var mButton = '<div class="fb-messengermessageus" messenger_app_id="627891880745321" page_id="<?php echo get_option("botosub_page_id"); ?>" color="blue" size="xlarge"></div>'; 375 376 var cnt = "<div style='text-align:center; font-family:alright_sansmedium,HelveticaNeue,Helvetica,Arial,sans-serif; -webkit-font-smoothing:antialiased;'>" + mImg + mTitle + mDesc + mButton; 377 cnt += "</div>"; 378 379 // set content 380 modal.setContent(cnt); 381 modal.open(); 382 292 383 </script> 293 384 … … 357 448 page_id=" . get_option('botosub_page_id') . " 358 449 color='blue' 359 size=' large' >450 size='xlarge' > 360 451 </div> 361 452 </div> -
botosub/trunk/readme.txt
r1673372 r1675072 3 3 Tags: newsletter, facebook, messenger, chatbot, bots, email, marketing, newsletters, opt-in, social, signup 4 4 Requires at least: 3.1 5 Tested up to: 4. 7.55 Tested up to: 4.8 6 6 Stable tag: 1.1 7 7 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.