OneSignal – Free Web Push Notifications - Version 1.0.2

Version Description

Fixed bug with OneSignal not getting initialized in some cases. Now omits extra unneeded manifest link from the head tag when using HTTP. Clicks handler added to elements with the class OneSignal-prompt are now setup in a more compatible way.

Download this release

Release Info

Developer OneSignal
Plugin Icon 128x128 OneSignal – Free Web Push Notifications
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.0 to 1.0.2

js/onesignal.js DELETED
@@ -1,4 +0,0 @@
1
- $(".help").click(funtion() {
2
- alert('hi');
3
- this.first().show();
4
- })
 
 
 
 
onesignal-public.php CHANGED
@@ -13,7 +13,9 @@ class OneSignal_Public {
13
  $onesignal_wp_settings = OneSignal::get_onesignal_settings();
14
  ?>
15
  <script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async></script>
 
16
  <link rel="manifest" href="<?php echo( ONESIGNAL_PLUGIN_URL . 'sdk_files/manifest.json' ) ?>" />
 
17
  <script>
18
  var OneSignal = OneSignal || [];
19
 
@@ -46,17 +48,14 @@ class OneSignal_Public {
46
  path: "<?php echo ONESIGNAL_PLUGIN_URL . 'sdk_files' ?>/"});
47
  }
48
 
49
- window.onload = function() {
50
  OneSignal.push(initOneSignal);
51
 
52
  var oneSignal_elements = document.getElementsByClassName("OneSignal-prompt");
53
- for(var i = 0; i < oneSignal_elements.length; i++) {
54
- oneSignal_elements[i].onclick = function() {
55
- OneSignal.push(['registerForPushNotifications']);
56
- return false;
57
- };
58
- }
59
- }
60
  </script>
61
 
62
  <?php
13
  $onesignal_wp_settings = OneSignal::get_onesignal_settings();
14
  ?>
15
  <script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async></script>
16
+ <?php if ($onesignal_wp_settings["subdomain"] == "") { ?>
17
  <link rel="manifest" href="<?php echo( ONESIGNAL_PLUGIN_URL . 'sdk_files/manifest.json' ) ?>" />
18
+ <?php } ?>
19
  <script>
20
  var OneSignal = OneSignal || [];
21
 
48
  path: "<?php echo ONESIGNAL_PLUGIN_URL . 'sdk_files' ?>/"});
49
  }
50
 
51
+ window.addEventListener("load", function(event){
52
  OneSignal.push(initOneSignal);
53
 
54
  var oneSignal_elements = document.getElementsByClassName("OneSignal-prompt");
55
+ var oneSignalLinkClickHandler = function(event) { OneSignal.push(['registerForPushNotifications']); event.preventDefault(); };
56
+ for(var i = 0; i < oneSignal_elements.length; i++)
57
+ oneSignal_elements[i].addEventListener('click', oneSignalLinkClickHandler, false);
58
+ });
 
 
 
59
  </script>
60
 
61
  <?php
onesignal.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: OneSignal Push Notifications
4
  * Plugin URI: https://onesignal.com/
5
  * Description:
6
- * Version: 1.0.0
7
  * Author: OneSignal
8
  * Author URI: https://onesignal.com
9
  * License: MIT
3
  * Plugin Name: OneSignal Push Notifications
4
  * Plugin URI: https://onesignal.com/
5
  * Description:
6
+ * Version: 1.0.2
7
  * Author: OneSignal
8
  * Author URI: https://onesignal.com
9
  * License: MIT
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === OneSignal - Free Web Push Notifications ===
2
  Contributors: OneSignal
3
  Donate link: https://onesignal.com
4
- Tags: chrome, push, push notifications, safari, chrome push, safari push, notifications, web push, notification, notify, gcm, push messages, onesignal
5
  Requires at least: 3.8
6
  Tested up to: 4.2.1
7
- Stable tag: 1.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -46,5 +46,13 @@ Features:
46
 
47
  == Changelog ==
48
 
 
 
 
 
 
 
 
 
49
  = 1.0.0 =
50
  Initial release of the plugin
1
  === OneSignal - Free Web Push Notifications ===
2
  Contributors: OneSignal
3
  Donate link: https://onesignal.com
4
+ Tags: chrome, push, push notifications, safari, chrome push, safari push, notifications, web push, notification, notify, mavericks, firefox push, android, android push, android notifications, mobile notifications, mobile, desktop notifications, gcm, push messages, onesignal
5
  Requires at least: 3.8
6
  Tested up to: 4.2.1
7
+ Stable tag: 1.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
46
 
47
  == Changelog ==
48
 
49
+ = 1.0.2 =
50
+ Fixed bug with OneSignal not getting initialized in some cases.
51
+ Now omits extra unneeded manifest link from the head tag when using HTTP.
52
+ Clicks handler added to elements with the class OneSignal-prompt are now setup in a more compatible way.
53
+
54
+ = 1.0.1 =
55
+ Modified description
56
+
57
  = 1.0.0 =
58
  Initial release of the plugin
views/config.php CHANGED
@@ -300,7 +300,7 @@ if ($_POST['app_id']) {
300
  <p> <strong> Directions: </strong> </p>
301
  <br/>
302
  <p> Assign the class <span class="sample-code"> "OneSignal-prompt" </span> to any element. Example:</p>
303
- <p> <xmp class="sample-code"><a class="OneSignal-prompt"> Subscribe to Notifications </a></xmp></p>
304
  </div>
305
  </div>
306
  </div>
300
  <p> <strong> Directions: </strong> </p>
301
  <br/>
302
  <p> Assign the class <span class="sample-code"> "OneSignal-prompt" </span> to any element. Example:</p>
303
+ <p> <xmp class="sample-code"><a href="#" class="OneSignal-prompt"> Subscribe to Notifications </a></xmp></p>
304
  </div>
305
  </div>
306
  </div>
views/javascript/settings.js CHANGED
@@ -1,8 +1,3 @@
1
- /*$(".help").click(funtion() {
2
- alert('hi');
3
- this.first().show();
4
- }); */
5
-
6
  function showProjectNumberHelper() {
7
  var tutorial_image = document.getElementById("project-number-helper");
8
  if (tutorial_image.style.display == 'none') {
 
 
 
 
 
1
  function showProjectNumberHelper() {
2
  var tutorial_image = document.getElementById("project-number-helper");
3
  if (tutorial_image.style.display == 'none') {