Changeset 3823148
- Timestamp:
- 11/25/2026 02:55:19 PM (90 minutes ago)
- Location:
- floating-action-button
- Files:
-
- 6 edited
- 10 copied
-
tags/1.4.0 (copied) (copied from floating-action-button/trunk )
-
tags/1.4.0/assets/admin-script.js (copied) (copied from floating-action-button/trunk/assets/admin-script.js ) (1 diff)
-
tags/1.4.0/assets/admin-style.css (copied) (copied from floating-action-button/trunk/assets/admin-style.css )
-
tags/1.4.0/assets/home-conditional-script.js (copied) (copied from floating-action-button/trunk/assets/home-conditional-script.js )
-
tags/1.4.0/assets/home-script.js (copied) (copied from floating-action-button/trunk/assets/home-script.js )
-
tags/1.4.0/index.php (copied) (copied from floating-action-button/trunk/index.php ) (5 diffs)
-
tags/1.4.0/readme.txt (copied) (copied from floating-action-button/trunk/readme.txt ) (5 diffs)
-
tags/1.4.0/uninstall.php (copied) (copied from floating-action-button/trunk/uninstall.php ) (1 diff)
-
tags/1.4.0/views/fab-button.php (copied) (copied from floating-action-button/trunk/views/fab-button.php ) (11 diffs)
-
tags/1.4.0/views/settings.php (copied) (copied from floating-action-button/trunk/views/settings.php ) (2 diffs)
-
trunk/assets/admin-script.js (modified) (1 diff)
-
trunk/index.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/uninstall.php (modified) (1 diff)
-
trunk/views/fab-button.php (modified) (11 diffs)
-
trunk/views/settings.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
floating-action-button/tags/1.4.0/assets/admin-script.js
r3823106 r3823148 116 116 position: $("#fz-fab-position").val(), 117 117 type: $("#fz-fab-type").val(), 118 display_on_mobile: $("#fz-fab-display-mobile").is(":checked") ? "TRUE" : "FALSE", 119 display_on_tablet: $("#fz-fab-display-tablet").is(":checked") ? "TRUE" : "FALSE", 120 display_on_desktop: $("#fz-fab-display-desktop").is(":checked") ? "TRUE" : "FALSE", 121 margin: $("#fz-fab-margin").val(), 122 main_size: $("#fz-fab-main-size").val(), 123 sub_size: $("#fz-fab-sub-size").val(), 124 wa_message: $("#fz-fab-wa-message").val(), 118 125 m_img_id: $("#fz-fab-main-btn-icon").data("id"), 119 126 m_color: $("#fz-fab-main-btn-color").val().trim(), -
floating-action-button/tags/1.4.0/index.php
r3823106 r3823148 4 4 * Plugin URI: http://okapitech.in/wordpress-plugin-floating-action-button 5 5 * Description: Display the beautiful FAB (Floating Action Button) on your WordPress front-end. 6 * Version: 1. 3.06 * Version: 1.4.0 7 7 * Requires at least: 4.6 8 8 * Requires PHP: 7.4 … … 19 19 defined('ABSPATH') || exit; 20 20 21 define('FZ_FAB_VERSION', '1. 3.0');21 define('FZ_FAB_VERSION', '1.4.0'); 22 22 define('FZ_FAB_PLUGIN_URL', plugin_dir_url(__FILE__)); 23 23 define('FZ_FAB_PLUGIN_PATH', plugin_dir_path(__FILE__)); … … 221 221 } 222 222 223 $mobile = (isset($_POST['display_on_mobile']) && wp_unslash($_POST['display_on_mobile']) === 'TRUE') ? 'TRUE' : 'FALSE'; 224 $tablet = (isset($_POST['display_on_tablet']) && wp_unslash($_POST['display_on_tablet']) === 'TRUE') ? 'TRUE' : 'FALSE'; 225 $desktop = (isset($_POST['display_on_desktop']) && wp_unslash($_POST['display_on_desktop']) === 'TRUE') ? 'TRUE' : 'FALSE'; 226 $margin = isset($_POST['margin']) ? fz_fab_px(wp_unslash($_POST['margin']), 15, 0, 400) : 15; 227 $main_size = isset($_POST['main_size']) ? fz_fab_px(wp_unslash($_POST['main_size']), 64, 40, 160) : 64; 228 $sub_size = isset($_POST['sub_size']) ? fz_fab_px(wp_unslash($_POST['sub_size']), 48, 32, 128) : 48; 229 $wa_message = isset($_POST['wa_message']) ? sanitize_text_field(wp_unslash($_POST['wa_message'])) : 'Hi'; 230 223 231 $image_id = isset($_POST['m_img_id']) ? absint(wp_unslash($_POST['m_img_id'])) : 0; 224 232 $color = isset($_POST['m_color']) ? sanitize_hex_color(wp_unslash($_POST['m_color'])) : ''; … … 244 252 update_option('fz_fab_position', $position, true); 245 253 update_option('fz_fab_type', $type, true); 254 update_option('fz_fab_display_on_mobile', $mobile, true); 255 update_option('fz_fab_display_on_tablet', $tablet, true); 256 update_option('fz_fab_display_on_desktop', $desktop, true); 257 update_option('fz_fab_margin', (string) $margin, true); 258 update_option('fz_fab_main_size', (string) $main_size, true); 259 update_option('fz_fab_sub_size', (string) $sub_size, true); 260 update_option('fz_fab_wa_message', $wa_message, true); 246 261 update_option('fz_fab_main_img_id', (string) $image_id, true); 247 262 update_option('fz_fab_main_color', $color, true); … … 296 311 297 312 /** 298 * Remove the internal field separator from a saved value. 299 * 300 * @param string $value Raw value. 301 * @return string 302 */ 313 * Keep a pixel setting inside a safe range. 314 * 315 * @param mixed $value Candidate. 316 * @param int $default Fallback. 317 * @param int $min Minimum. 318 * @param int $max Maximum. 319 * @return int 320 */ 321 function fz_fab_px($value, $default, $min, $max) { 322 $value = absint($value); 323 if ($value < $min || $value > $max) { 324 return (int) $default; 325 } 326 return $value; 327 } 328 303 329 function fz_fab_strip_delimiter($value) { 304 330 return str_replace('@ELFIN@', '', (string) $value); -
floating-action-button/tags/1.4.0/readme.txt
r3823106 r3823148 5 5 Requires at least: 4.6 6 6 Tested up to: 7.1 7 Stable tag: 1. 3.07 Stable tag: 1.4.0 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 32 32 2. Change the Position of Floating Action Button to Top-Left/Top-Right/Bottom-Left/Bottom-Right 33 33 3. Option to Trigger Button by Mouse-Click or Mouse-Hover 34 4. Show or hide the button on phone, tablet, and desktop 35 5. Set the distance from the screen edge 36 6. Set the main button size and the sub button size 37 7. Set the WhatsApp greeting that opens in the chat 34 38 35 39 * Main Button Settings … … 83 87 You can use WhatsApp number like that 919806886806 (with country code but without any plus, preceding zero, hyphen, brackets, space) 84 88 89 = Where do I change the WhatsApp greeting? = 90 91 Use Basic Settings > WhatsApp greeting. That text is prefilled when a visitor opens WhatsApp. Leave it blank to open WhatsApp without a message. 92 85 93 = Which value can I use for the content field of Facebook Messenger Button? = 86 94 … … 120 128 == Changelog == 121 129 130 = 1.4.0 = 131 * Choose phone, tablet, and desktop visibility. 132 * Set the distance from the screen edge. 133 * Set the main button size and the sub button size. 134 * Set the WhatsApp greeting message. 135 122 136 = 1.3.0 = 123 137 * Tested with WordPress 7.1 and PHP 7.4 through 8.5. … … 146 160 == Upgrade Notice == 147 161 162 = 1.4.0 = 163 Adds device visibility, button size, edge distance, and a WhatsApp greeting. 164 148 165 = 1.3.0 = 149 166 Tested with WordPress 7.1. Includes display fixes and safer settings handling. Requires PHP 7.4. -
floating-action-button/tags/1.4.0/uninstall.php
r3823106 r3823148 13 13 delete_option('fz_fab_position'); 14 14 delete_option('fz_fab_type'); 15 delete_option('fz_fab_display_on_mobile'); 16 delete_option('fz_fab_display_on_tablet'); 17 delete_option('fz_fab_display_on_desktop'); 18 delete_option('fz_fab_margin'); 19 delete_option('fz_fab_main_size'); 20 delete_option('fz_fab_sub_size'); 21 delete_option('fz_fab_wa_message'); 15 22 delete_option('fz_fab_main_img_id'); 16 23 delete_option('fz_fab_main_color'); -
floating-action-button/tags/1.4.0/views/fab-button.php
r3823106 r3823148 12 12 $position = '3'; 13 13 } 14 15 $on_mobile = (string) get_option('fz_fab_display_on_mobile', 'TRUE') === 'TRUE'; 16 $on_tablet = (string) get_option('fz_fab_display_on_tablet', 'TRUE') === 'TRUE'; 17 $on_desktop = (string) get_option('fz_fab_display_on_desktop', 'TRUE') === 'TRUE'; 18 $edge = fz_fab_px(get_option('fz_fab_margin', 15), 15, 0, 400); 19 $main_size = fz_fab_px(get_option('fz_fab_main_size', 64), 64, 40, 160); 20 $sub_size = fz_fab_px(get_option('fz_fab_sub_size', 48), 48, 32, 128); 21 $wa_message = (string) get_option('fz_fab_wa_message', 'Hi'); 14 22 15 23 $main_img_id = absint(get_option('fz_fab_main_img_id', 0)); … … 44 52 } 45 53 .fz-fab-box{ 46 top: 15px !important;47 left: 15px !important;54 top: <?php echo (int) $edge; ?>px !important; 55 left: <?php echo (int) $edge; ?>px !important; 48 56 } 49 57 <?php elseif ($position === '2') : ?> … … 58 66 } 59 67 .fz-fab-box{ 60 top: 15px !important;61 right: 15px !important;68 top: <?php echo (int) $edge; ?>px !important; 69 right: <?php echo (int) $edge; ?>px !important; 62 70 } 63 71 <?php elseif ($position === '4') : ?> … … 72 80 } 73 81 .fz-fab-box{ 74 bottom: 15px !important;75 left: 15px !important;82 bottom: <?php echo (int) $edge; ?>px !important; 83 left: <?php echo (int) $edge; ?>px !important; 76 84 } 77 85 <?php else : ?> … … 86 94 } 87 95 .fz-fab-box{ 88 bottom: 15px !important;89 right: 15px !important;96 bottom: <?php echo (int) $edge; ?>px !important; 97 right: <?php echo (int) $edge; ?>px !important; 90 98 } 91 99 <?php endif; ?> 92 100 .fz-fab-container{ 93 101 position: fixed !important; 94 margin: 1em!important;102 margin: <?php echo (int) $edge; ?>px !important; 95 103 z-index: 999999999 !important; 96 104 } … … 104 112 border-radius: 100% !important; 105 113 display: block !important; 106 width: 64px !important;107 height: 64px !important;114 width: <?php echo (int) $main_size; ?>px !important; 115 height: <?php echo (int) $main_size; ?>px !important; 108 116 margin: 10px auto 0 !important; 109 117 position: relative !important; … … 116 124 .fz-fab-buttons.fz-fab-primary img{ 117 125 border-radius: 50% !important; 118 width: 64px !important;119 height: 64px !important;126 width: <?php echo (int) $main_size; ?>px !important; 127 height: <?php echo (int) $main_size; ?>px !important; 120 128 } 121 129 .fz-fab-buttons.fz-fab-secondary{ … … 123 131 border-radius: 100% !important; 124 132 display: block !important; 125 width: 48px !important;126 height: 48px !important;133 width: <?php echo (int) $sub_size; ?>px !important; 134 height: <?php echo (int) $sub_size; ?>px !important; 127 135 margin: auto !important; 128 136 position: relative !important; … … 136 144 } 137 145 .fz-fab-buttons.fz-fab-secondary img{ 138 width: 48px !important;139 height: 48px !important;146 width: <?php echo (int) $sub_size; ?>px !important; 147 height: <?php echo (int) $sub_size; ?>px !important; 140 148 border-radius: 50% !important; 141 149 } … … 192 200 .fz-fab-box-hide:hover{ 193 201 opacity: 1 !important; 202 } 203 @media only screen and (min-width: 320px) and (max-width: 767px){ 204 <?php if (!$on_mobile) : ?> 205 .fz-fab-container, 206 .fz-fab-box{ 207 display: none !important; 208 } 209 <?php endif; ?> 210 } 211 @media only screen and (min-width: 768px) and (max-width: 991px){ 212 <?php if (!$on_tablet) : ?> 213 .fz-fab-container, 214 .fz-fab-box{ 215 display: none !important; 216 } 217 <?php endif; ?> 218 } 219 @media only screen and (min-width: 992px){ 220 <?php if (!$on_desktop) : ?> 221 .fz-fab-container, 222 .fz-fab-box{ 223 display: none !important; 224 } 225 <?php endif; ?> 194 226 } 195 227 </style> … … 260 292 <?php 261 293 $number = preg_replace('/\D+/', '', $content); 262 $whatsapp_url = 'https://wa.me/' . rawurlencode($number) . '?text=' . rawurlencode( 'Hi');294 $whatsapp_url = 'https://wa.me/' . rawurlencode($number) . '?text=' . rawurlencode($wa_message); 263 295 ?> 264 296 <div style="display: block; margin-bottom: 32px; text-align: center; font-size: 16px; font-weight: bold;"> -
floating-action-button/tags/1.4.0/views/settings.php
r3823106 r3823148 11 11 $position = get_option('fz_fab_position', '3'); 12 12 $type = get_option('fz_fab_type', '1'); 13 $on_mobile = get_option('fz_fab_display_on_mobile', 'TRUE'); 14 $on_tablet = get_option('fz_fab_display_on_tablet', 'TRUE'); 15 $on_desktop = get_option('fz_fab_display_on_desktop', 'TRUE'); 16 $margin = fz_fab_px(get_option('fz_fab_margin', 15), 15, 0, 400); 17 $main_size = fz_fab_px(get_option('fz_fab_main_size', 64), 64, 40, 160); 18 $sub_size = fz_fab_px(get_option('fz_fab_sub_size', 48), 48, 32, 128); 19 $wa_message = get_option('fz_fab_wa_message', 'Hi'); 13 20 $main_img_id = absint(get_option('fz_fab_main_img_id', 0)); 14 21 $main_color = fz_fab_hex_or_default(get_option('fz_fab_main_color', FZ_FAB_COLOR), FZ_FAB_COLOR); … … 76 83 </td> 77 84 </tr> 85 <tr> 86 <td class="fz-td-1"> 87 <?php esc_html_e('Display on', 'floating-action-button'); ?> 88 </td> 89 <td> 90 <label style="display: block;"> 91 <input id="fz-fab-display-mobile" type="checkbox" value="TRUE" <?php checked((string) $on_mobile, 'TRUE'); ?>> 92 <?php esc_html_e('Phone', 'floating-action-button'); ?> 93 </label> 94 <label style="display: block;"> 95 <input id="fz-fab-display-tablet" type="checkbox" value="TRUE" <?php checked((string) $on_tablet, 'TRUE'); ?>> 96 <?php esc_html_e('Tablet', 'floating-action-button'); ?> 97 </label> 98 <label style="display: block;"> 99 <input id="fz-fab-display-desktop" type="checkbox" value="TRUE" <?php checked((string) $on_desktop, 'TRUE'); ?>> 100 <?php esc_html_e('Desktop', 'floating-action-button'); ?> 101 </label> 102 </td> 103 </tr> 104 <tr> 105 <td class="fz-td-1"> 106 <?php esc_html_e('Distance from edge', 'floating-action-button'); ?> 107 </td> 108 <td> 109 <input id="fz-fab-margin" class="fz-form-element" type="number" min="0" max="400" value="<?php echo esc_attr($margin); ?>"> 110 <small class="fz-fab-small"><?php esc_html_e('In pixels', 'floating-action-button'); ?></small> 111 </td> 112 </tr> 113 <tr> 114 <td class="fz-td-1"> 115 <?php esc_html_e('Main button size', 'floating-action-button'); ?> 116 </td> 117 <td> 118 <input id="fz-fab-main-size" class="fz-form-element" type="number" min="40" max="160" value="<?php echo esc_attr($main_size); ?>"> 119 <small class="fz-fab-small"><?php esc_html_e('In pixels. Default 64.', 'floating-action-button'); ?></small> 120 </td> 121 </tr> 122 <tr> 123 <td class="fz-td-1"> 124 <?php esc_html_e('Sub button size', 'floating-action-button'); ?> 125 </td> 126 <td> 127 <input id="fz-fab-sub-size" class="fz-form-element" type="number" min="32" max="128" value="<?php echo esc_attr($sub_size); ?>"> 128 <small class="fz-fab-small"><?php esc_html_e('In pixels. Default 48.', 'floating-action-button'); ?></small> 129 </td> 130 </tr> 131 <tr> 132 <td class="fz-td-1"> 133 <?php esc_html_e('WhatsApp greeting', 'floating-action-button'); ?> 134 </td> 135 <td> 136 <input id="fz-fab-wa-message" class="fz-form-element" type="text" value="<?php echo esc_attr($wa_message); ?>"> 137 <small class="fz-fab-small"><?php esc_html_e('Message that opens in WhatsApp. Leave blank for no message.', 'floating-action-button'); ?></small> 138 </td> 139 </tr> 78 140 </tbody> 79 141 </table> -
floating-action-button/trunk/assets/admin-script.js
r3823106 r3823148 116 116 position: $("#fz-fab-position").val(), 117 117 type: $("#fz-fab-type").val(), 118 display_on_mobile: $("#fz-fab-display-mobile").is(":checked") ? "TRUE" : "FALSE", 119 display_on_tablet: $("#fz-fab-display-tablet").is(":checked") ? "TRUE" : "FALSE", 120 display_on_desktop: $("#fz-fab-display-desktop").is(":checked") ? "TRUE" : "FALSE", 121 margin: $("#fz-fab-margin").val(), 122 main_size: $("#fz-fab-main-size").val(), 123 sub_size: $("#fz-fab-sub-size").val(), 124 wa_message: $("#fz-fab-wa-message").val(), 118 125 m_img_id: $("#fz-fab-main-btn-icon").data("id"), 119 126 m_color: $("#fz-fab-main-btn-color").val().trim(), -
floating-action-button/trunk/index.php
r3823106 r3823148 4 4 * Plugin URI: http://okapitech.in/wordpress-plugin-floating-action-button 5 5 * Description: Display the beautiful FAB (Floating Action Button) on your WordPress front-end. 6 * Version: 1. 3.06 * Version: 1.4.0 7 7 * Requires at least: 4.6 8 8 * Requires PHP: 7.4 … … 19 19 defined('ABSPATH') || exit; 20 20 21 define('FZ_FAB_VERSION', '1. 3.0');21 define('FZ_FAB_VERSION', '1.4.0'); 22 22 define('FZ_FAB_PLUGIN_URL', plugin_dir_url(__FILE__)); 23 23 define('FZ_FAB_PLUGIN_PATH', plugin_dir_path(__FILE__)); … … 221 221 } 222 222 223 $mobile = (isset($_POST['display_on_mobile']) && wp_unslash($_POST['display_on_mobile']) === 'TRUE') ? 'TRUE' : 'FALSE'; 224 $tablet = (isset($_POST['display_on_tablet']) && wp_unslash($_POST['display_on_tablet']) === 'TRUE') ? 'TRUE' : 'FALSE'; 225 $desktop = (isset($_POST['display_on_desktop']) && wp_unslash($_POST['display_on_desktop']) === 'TRUE') ? 'TRUE' : 'FALSE'; 226 $margin = isset($_POST['margin']) ? fz_fab_px(wp_unslash($_POST['margin']), 15, 0, 400) : 15; 227 $main_size = isset($_POST['main_size']) ? fz_fab_px(wp_unslash($_POST['main_size']), 64, 40, 160) : 64; 228 $sub_size = isset($_POST['sub_size']) ? fz_fab_px(wp_unslash($_POST['sub_size']), 48, 32, 128) : 48; 229 $wa_message = isset($_POST['wa_message']) ? sanitize_text_field(wp_unslash($_POST['wa_message'])) : 'Hi'; 230 223 231 $image_id = isset($_POST['m_img_id']) ? absint(wp_unslash($_POST['m_img_id'])) : 0; 224 232 $color = isset($_POST['m_color']) ? sanitize_hex_color(wp_unslash($_POST['m_color'])) : ''; … … 244 252 update_option('fz_fab_position', $position, true); 245 253 update_option('fz_fab_type', $type, true); 254 update_option('fz_fab_display_on_mobile', $mobile, true); 255 update_option('fz_fab_display_on_tablet', $tablet, true); 256 update_option('fz_fab_display_on_desktop', $desktop, true); 257 update_option('fz_fab_margin', (string) $margin, true); 258 update_option('fz_fab_main_size', (string) $main_size, true); 259 update_option('fz_fab_sub_size', (string) $sub_size, true); 260 update_option('fz_fab_wa_message', $wa_message, true); 246 261 update_option('fz_fab_main_img_id', (string) $image_id, true); 247 262 update_option('fz_fab_main_color', $color, true); … … 296 311 297 312 /** 298 * Remove the internal field separator from a saved value. 299 * 300 * @param string $value Raw value. 301 * @return string 302 */ 313 * Keep a pixel setting inside a safe range. 314 * 315 * @param mixed $value Candidate. 316 * @param int $default Fallback. 317 * @param int $min Minimum. 318 * @param int $max Maximum. 319 * @return int 320 */ 321 function fz_fab_px($value, $default, $min, $max) { 322 $value = absint($value); 323 if ($value < $min || $value > $max) { 324 return (int) $default; 325 } 326 return $value; 327 } 328 303 329 function fz_fab_strip_delimiter($value) { 304 330 return str_replace('@ELFIN@', '', (string) $value); -
floating-action-button/trunk/readme.txt
r3823106 r3823148 5 5 Requires at least: 4.6 6 6 Tested up to: 7.1 7 Stable tag: 1. 3.07 Stable tag: 1.4.0 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 32 32 2. Change the Position of Floating Action Button to Top-Left/Top-Right/Bottom-Left/Bottom-Right 33 33 3. Option to Trigger Button by Mouse-Click or Mouse-Hover 34 4. Show or hide the button on phone, tablet, and desktop 35 5. Set the distance from the screen edge 36 6. Set the main button size and the sub button size 37 7. Set the WhatsApp greeting that opens in the chat 34 38 35 39 * Main Button Settings … … 83 87 You can use WhatsApp number like that 919806886806 (with country code but without any plus, preceding zero, hyphen, brackets, space) 84 88 89 = Where do I change the WhatsApp greeting? = 90 91 Use Basic Settings > WhatsApp greeting. That text is prefilled when a visitor opens WhatsApp. Leave it blank to open WhatsApp without a message. 92 85 93 = Which value can I use for the content field of Facebook Messenger Button? = 86 94 … … 120 128 == Changelog == 121 129 130 = 1.4.0 = 131 * Choose phone, tablet, and desktop visibility. 132 * Set the distance from the screen edge. 133 * Set the main button size and the sub button size. 134 * Set the WhatsApp greeting message. 135 122 136 = 1.3.0 = 123 137 * Tested with WordPress 7.1 and PHP 7.4 through 8.5. … … 146 160 == Upgrade Notice == 147 161 162 = 1.4.0 = 163 Adds device visibility, button size, edge distance, and a WhatsApp greeting. 164 148 165 = 1.3.0 = 149 166 Tested with WordPress 7.1. Includes display fixes and safer settings handling. Requires PHP 7.4. -
floating-action-button/trunk/uninstall.php
r3823106 r3823148 13 13 delete_option('fz_fab_position'); 14 14 delete_option('fz_fab_type'); 15 delete_option('fz_fab_display_on_mobile'); 16 delete_option('fz_fab_display_on_tablet'); 17 delete_option('fz_fab_display_on_desktop'); 18 delete_option('fz_fab_margin'); 19 delete_option('fz_fab_main_size'); 20 delete_option('fz_fab_sub_size'); 21 delete_option('fz_fab_wa_message'); 15 22 delete_option('fz_fab_main_img_id'); 16 23 delete_option('fz_fab_main_color'); -
floating-action-button/trunk/views/fab-button.php
r3823106 r3823148 12 12 $position = '3'; 13 13 } 14 15 $on_mobile = (string) get_option('fz_fab_display_on_mobile', 'TRUE') === 'TRUE'; 16 $on_tablet = (string) get_option('fz_fab_display_on_tablet', 'TRUE') === 'TRUE'; 17 $on_desktop = (string) get_option('fz_fab_display_on_desktop', 'TRUE') === 'TRUE'; 18 $edge = fz_fab_px(get_option('fz_fab_margin', 15), 15, 0, 400); 19 $main_size = fz_fab_px(get_option('fz_fab_main_size', 64), 64, 40, 160); 20 $sub_size = fz_fab_px(get_option('fz_fab_sub_size', 48), 48, 32, 128); 21 $wa_message = (string) get_option('fz_fab_wa_message', 'Hi'); 14 22 15 23 $main_img_id = absint(get_option('fz_fab_main_img_id', 0)); … … 44 52 } 45 53 .fz-fab-box{ 46 top: 15px !important;47 left: 15px !important;54 top: <?php echo (int) $edge; ?>px !important; 55 left: <?php echo (int) $edge; ?>px !important; 48 56 } 49 57 <?php elseif ($position === '2') : ?> … … 58 66 } 59 67 .fz-fab-box{ 60 top: 15px !important;61 right: 15px !important;68 top: <?php echo (int) $edge; ?>px !important; 69 right: <?php echo (int) $edge; ?>px !important; 62 70 } 63 71 <?php elseif ($position === '4') : ?> … … 72 80 } 73 81 .fz-fab-box{ 74 bottom: 15px !important;75 left: 15px !important;82 bottom: <?php echo (int) $edge; ?>px !important; 83 left: <?php echo (int) $edge; ?>px !important; 76 84 } 77 85 <?php else : ?> … … 86 94 } 87 95 .fz-fab-box{ 88 bottom: 15px !important;89 right: 15px !important;96 bottom: <?php echo (int) $edge; ?>px !important; 97 right: <?php echo (int) $edge; ?>px !important; 90 98 } 91 99 <?php endif; ?> 92 100 .fz-fab-container{ 93 101 position: fixed !important; 94 margin: 1em!important;102 margin: <?php echo (int) $edge; ?>px !important; 95 103 z-index: 999999999 !important; 96 104 } … … 104 112 border-radius: 100% !important; 105 113 display: block !important; 106 width: 64px !important;107 height: 64px !important;114 width: <?php echo (int) $main_size; ?>px !important; 115 height: <?php echo (int) $main_size; ?>px !important; 108 116 margin: 10px auto 0 !important; 109 117 position: relative !important; … … 116 124 .fz-fab-buttons.fz-fab-primary img{ 117 125 border-radius: 50% !important; 118 width: 64px !important;119 height: 64px !important;126 width: <?php echo (int) $main_size; ?>px !important; 127 height: <?php echo (int) $main_size; ?>px !important; 120 128 } 121 129 .fz-fab-buttons.fz-fab-secondary{ … … 123 131 border-radius: 100% !important; 124 132 display: block !important; 125 width: 48px !important;126 height: 48px !important;133 width: <?php echo (int) $sub_size; ?>px !important; 134 height: <?php echo (int) $sub_size; ?>px !important; 127 135 margin: auto !important; 128 136 position: relative !important; … … 136 144 } 137 145 .fz-fab-buttons.fz-fab-secondary img{ 138 width: 48px !important;139 height: 48px !important;146 width: <?php echo (int) $sub_size; ?>px !important; 147 height: <?php echo (int) $sub_size; ?>px !important; 140 148 border-radius: 50% !important; 141 149 } … … 192 200 .fz-fab-box-hide:hover{ 193 201 opacity: 1 !important; 202 } 203 @media only screen and (min-width: 320px) and (max-width: 767px){ 204 <?php if (!$on_mobile) : ?> 205 .fz-fab-container, 206 .fz-fab-box{ 207 display: none !important; 208 } 209 <?php endif; ?> 210 } 211 @media only screen and (min-width: 768px) and (max-width: 991px){ 212 <?php if (!$on_tablet) : ?> 213 .fz-fab-container, 214 .fz-fab-box{ 215 display: none !important; 216 } 217 <?php endif; ?> 218 } 219 @media only screen and (min-width: 992px){ 220 <?php if (!$on_desktop) : ?> 221 .fz-fab-container, 222 .fz-fab-box{ 223 display: none !important; 224 } 225 <?php endif; ?> 194 226 } 195 227 </style> … … 260 292 <?php 261 293 $number = preg_replace('/\D+/', '', $content); 262 $whatsapp_url = 'https://wa.me/' . rawurlencode($number) . '?text=' . rawurlencode( 'Hi');294 $whatsapp_url = 'https://wa.me/' . rawurlencode($number) . '?text=' . rawurlencode($wa_message); 263 295 ?> 264 296 <div style="display: block; margin-bottom: 32px; text-align: center; font-size: 16px; font-weight: bold;"> -
floating-action-button/trunk/views/settings.php
r3823106 r3823148 11 11 $position = get_option('fz_fab_position', '3'); 12 12 $type = get_option('fz_fab_type', '1'); 13 $on_mobile = get_option('fz_fab_display_on_mobile', 'TRUE'); 14 $on_tablet = get_option('fz_fab_display_on_tablet', 'TRUE'); 15 $on_desktop = get_option('fz_fab_display_on_desktop', 'TRUE'); 16 $margin = fz_fab_px(get_option('fz_fab_margin', 15), 15, 0, 400); 17 $main_size = fz_fab_px(get_option('fz_fab_main_size', 64), 64, 40, 160); 18 $sub_size = fz_fab_px(get_option('fz_fab_sub_size', 48), 48, 32, 128); 19 $wa_message = get_option('fz_fab_wa_message', 'Hi'); 13 20 $main_img_id = absint(get_option('fz_fab_main_img_id', 0)); 14 21 $main_color = fz_fab_hex_or_default(get_option('fz_fab_main_color', FZ_FAB_COLOR), FZ_FAB_COLOR); … … 76 83 </td> 77 84 </tr> 85 <tr> 86 <td class="fz-td-1"> 87 <?php esc_html_e('Display on', 'floating-action-button'); ?> 88 </td> 89 <td> 90 <label style="display: block;"> 91 <input id="fz-fab-display-mobile" type="checkbox" value="TRUE" <?php checked((string) $on_mobile, 'TRUE'); ?>> 92 <?php esc_html_e('Phone', 'floating-action-button'); ?> 93 </label> 94 <label style="display: block;"> 95 <input id="fz-fab-display-tablet" type="checkbox" value="TRUE" <?php checked((string) $on_tablet, 'TRUE'); ?>> 96 <?php esc_html_e('Tablet', 'floating-action-button'); ?> 97 </label> 98 <label style="display: block;"> 99 <input id="fz-fab-display-desktop" type="checkbox" value="TRUE" <?php checked((string) $on_desktop, 'TRUE'); ?>> 100 <?php esc_html_e('Desktop', 'floating-action-button'); ?> 101 </label> 102 </td> 103 </tr> 104 <tr> 105 <td class="fz-td-1"> 106 <?php esc_html_e('Distance from edge', 'floating-action-button'); ?> 107 </td> 108 <td> 109 <input id="fz-fab-margin" class="fz-form-element" type="number" min="0" max="400" value="<?php echo esc_attr($margin); ?>"> 110 <small class="fz-fab-small"><?php esc_html_e('In pixels', 'floating-action-button'); ?></small> 111 </td> 112 </tr> 113 <tr> 114 <td class="fz-td-1"> 115 <?php esc_html_e('Main button size', 'floating-action-button'); ?> 116 </td> 117 <td> 118 <input id="fz-fab-main-size" class="fz-form-element" type="number" min="40" max="160" value="<?php echo esc_attr($main_size); ?>"> 119 <small class="fz-fab-small"><?php esc_html_e('In pixels. Default 64.', 'floating-action-button'); ?></small> 120 </td> 121 </tr> 122 <tr> 123 <td class="fz-td-1"> 124 <?php esc_html_e('Sub button size', 'floating-action-button'); ?> 125 </td> 126 <td> 127 <input id="fz-fab-sub-size" class="fz-form-element" type="number" min="32" max="128" value="<?php echo esc_attr($sub_size); ?>"> 128 <small class="fz-fab-small"><?php esc_html_e('In pixels. Default 48.', 'floating-action-button'); ?></small> 129 </td> 130 </tr> 131 <tr> 132 <td class="fz-td-1"> 133 <?php esc_html_e('WhatsApp greeting', 'floating-action-button'); ?> 134 </td> 135 <td> 136 <input id="fz-fab-wa-message" class="fz-form-element" type="text" value="<?php echo esc_attr($wa_message); ?>"> 137 <small class="fz-fab-small"><?php esc_html_e('Message that opens in WhatsApp. Leave blank for no message.', 'floating-action-button'); ?></small> 138 </td> 139 </tr> 78 140 </tbody> 79 141 </table>
Note:
See TracChangeset
for help on using the changeset viewer.