Changeset 1688743
- Timestamp:
- 07/01/2017 01:52:49 PM (9 years ago)
- Location:
- pushpad-web-push-notifications/trunk
- Files:
-
- 3 edited
-
admin/pushpad-settings.php (modified) (1 diff)
-
pushpad.php (modified) (5 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pushpad-web-push-notifications/trunk/admin/pushpad-settings.php
r1688741 r1688743 104 104 <td> 105 105 <p class="description"> 106 You can style the Pushpad button by adding your CSS rules for <code>.pushpad-button</code><span class="custom-api-only"> or <code>.pushpad-button.subscribed</code></span>.<br> 106 You can style the Pushpad button by adding your CSS rules for <code>.pushpad-button</code><span class="custom-api-only"> and <code>.pushpad-button.subscribed</code></span>.<br> 107 You can style the Pushpad notices by adding your CSS rules for <code>.pushpad-notice</code> and <code>.pushpad-alert</code></span>.<br> 107 108 Go to <i>Appearance -> Customize -> Additional CSS</i>. 108 109 </p> 109 110 </td> 110 111 </tr> 111 <tr class="simple-api-only">112 <tr> 112 113 <th><label for="token">Custom text</label></th> 113 114 <td> -
pushpad-web-push-notifications/trunk/pushpad.php
r1688742 r1688743 4 4 * Plugin URI: https://pushpad.xyz/docs/wordpress 5 5 * Description: Real push notifications for your website. Uses the W3C Push API for Chrome and Firefox and supports Safari. 6 * Version: 1. 5.06 * Version: 1.6.0 7 7 * Author: Pushpad 8 8 * Author URI: https://pushpad.xyz … … 51 51 52 52 function pushpad_add_wp_head() { 53 $pushpad_settings = get_option ( 'pushpad_settings', array ());53 $pushpad_settings = pushpad_get_settings(); 54 54 if ( !isset($pushpad_settings ["api"]) || $pushpad_settings ["api"] != 'custom' ) return; 55 55 ?> … … 61 61 echo "pushpad('init', '" . esc_js ( $pushpad_settings ["project_id"] ) . "');"; 62 62 ?> 63 64 function pushpadShowMessage(notice_or_alert, text) { 65 jQuery('body').append('<div class="pushpad-' + notice_or_alert + '">' + text + ' <a href="#" onclick="javascript:this.parentNode.style.display=\'none\';" class="close">×</a></div>'); 66 } 63 67 64 68 jQuery(function () { … … 91 95 if (isSubscribed) { 92 96 updateButton(true); 97 pushpadShowMessage('notice', '<?php echo esc_js( esc_html( $pushpad_settings ["subscribed_notice"] ) ); ?>'); 93 98 } else { 94 99 updateButton(false); 95 alert('You have blocked notifications for this website. Please change your browser preferences and try again.');100 pushpadShowMessage('alert', '<?php echo esc_js( esc_html( $pushpad_settings ["not_subscribed_notice"] ) ); ?>'); 96 101 } 97 102 }); … … 101 106 pushpad('unsupported', function() { 102 107 jQuery('.pushpad-button').on('click', function() { 103 alert('Sorry, your browser does not support web push notifications.');108 pushpadShowMessage('alert', '<?php echo esc_js( esc_html( $pushpad_settings ["unsupported_notice"] ) ); ?>'); 104 109 }); 105 110 }); -
pushpad-web-push-notifications/trunk/readme.txt
r1688742 r1688743 4 4 Requires at least: 4.4.0 5 5 Tested up to: 4.8.0 6 Stable tag: 1. 56 Stable tag: 1.6 7 7 8 8 Real push notifications for your website. Uses the W3C Push API for Chrome and Firefox and supports Safari.
Note: See TracChangeset
for help on using the changeset viewer.