Bläddra i källkod

Removed support to query for notifications by type and id

Sebastián Katzer 8 år sedan
förälder
incheckning
703d40c8e7
2 ändrade filer med 9 tillägg och 121 borttagningar
  1. 3 80
      www/local-notification-core.js
  2. 6 41
      www/local-notification.js

+ 3 - 80
www/local-notification-core.js

@@ -222,17 +222,10 @@ exports.isTriggered = function (id, callback, scope) {
  *
  * @return [ Void ]
  */
-exports.getAllIds = function (callback, scope) {
+exports.getIds = function (callback, scope) {
     this.exec('ids', null, callback, scope);
 };
 
-/**
- * Alias for `getAllIds`.
- */
-exports.getIds = function () {
-    this.getAllIds.apply(this, arguments);
-};
-
 /**
  * List of all scheduled notification IDs.
  *
@@ -300,93 +293,23 @@ exports.getAll = function (callback, scope) {
     this.exec('notifications', null, callback, scope);
 };
 
-/**
- * List of scheduled notifications specified by id.
- * If called without IDs, all notification will be returned.
- *
- * @param [ Array<Int> ] ids      The IDs of the notifications.
- * @param [ Function ]   callback The function to be exec as the callback.
- * @param [ Object ]     scope    The callback function's scope.
- *
- * @return [ Void ]
- */
-exports.getScheduled = function () {
-    var args = Array.apply(null, arguments);
-
-    if (typeof args[0] == 'function') {
-        args.unshift([]);
-    }
-
-    var ids      = args[0],
-        callback = args[1],
-        scope    = args[2];
-
-    if (!Array.isArray(ids)) {
-        ids = [ids];
-    }
-
-    if (!Array.isArray(ids)) {
-        this.exec('scheduledNotification', Number(ids), callback, scope);
-        return;
-    }
-
-    ids = this.convertIds(ids);
-
-    this.exec('scheduledNotifications', ids, callback, scope);
-};
-
 /**
  * List of all scheduled notifications.
  *
  * @param [ Function ]   callback The function to be exec as the callback.
  * @param [ Object ]     scope    The callback function's scope.
  */
-exports.getAllScheduled = function (callback, scope) {
+exports.getScheduled = function (callback, scope) {
     this.exec('scheduledNotifications', null, callback, scope);
 };
 
-/**
- * List of triggered notifications specified by id.
- * If called without IDs, all notification will be returned.
- *
- * @param [ Array<Int> ] ids      The IDs of the notifications.
- * @param [ Function ]   callback The function to be exec as the callback.
- * @param [ Object ]     scope    The callback function's scope.
- *
- * @return [ Void ]
- */
-exports.getTriggered = function () {
-    var args = Array.apply(null, arguments);
-
-    if (typeof args[0] == 'function') {
-        args.unshift([]);
-    }
-
-    var ids      = args[0],
-        callback = args[1],
-        scope    = args[2];
-
-    if (!Array.isArray(ids)) {
-        ids = [ids];
-    }
-
-    if (!Array.isArray(ids)) {
-        this.exec('triggeredNotification', Number(ids), callback, scope);
-        return;
-    }
-
-    ids = this.convertIds(ids);
-
-    this.exec('triggeredNotifications', ids, callback, scope);
-};
-
 /**
  * List of all triggered notifications.
  *
  * @param [ Function ]   callback The function to be exec as the callback.
  * @param [ Object ]     scope    The callback function's scope.
  */
-exports.getAllTriggered = function (callback, scope) {
+exports.getTriggered = function (callback, scope) {
     this.exec('triggeredNotifications', null, callback, scope);
 };
 

+ 6 - 41
www/local-notification.js

@@ -171,15 +171,8 @@ exports.isTriggered = function (id, callback, scope) {
  *
  * @return [ Void ]
  */
-exports.getAllIds = function (callback, scope) {
-    this.core.getAllIds(callback, scope);
-};
-
-/**
- * Alias for `getAllIds`.
- */
-exports.getIds = function () {
-    this.getAllIds.apply(this, arguments);
+exports.getIds = function (callback, scope) {
+    this.core.getIds(callback, scope);
 };
 
 /**
@@ -232,42 +225,14 @@ exports.getAll = function (callback, scope) {
     this.core.getAll(callback, scope);
 };
 
-/**
- * List of scheduled notifications specified by id.
- * If called without IDs, all notification will be returned.
- *
- * @param [ Array<Int> ] ids      The IDs of the notifications.
- * @param [ Function ]   callback The function to be exec as the callback.
- * @param [ Object ]     scope    The callback function's scope.
- *
- * @return [ Void ]
- */
-exports.getScheduled = function (ids, callback, scope) {
-    this.core.getScheduled(ids, callback, scope);
-};
-
 /**
  * List of all scheduled notifications.
  *
  * @param [ Function ]   callback The function to be exec as the callback.
  * @param [ Object ]     scope    The callback function's scope.
  */
-exports.getAllScheduled = function (callback, scope) {
-    this.core.getAllScheduled(callback, scope);
-};
-
-/**
- * List of triggered notifications specified by id.
- * If called without IDs, all notification will be returned.
- *
- * @param [ Array<Int> ] ids      The IDs of the notifications.
- * @param [ Function ]   callback The function to be exec as the callback.
- * @param [ Object ]     scope    The callback function's scope.
- *
- * @return [ Void ]
- */
-exports.getTriggered = function (ids, callback, scope) {
-    this.core.getTriggered(ids, callback, scope);
+exports.getScheduled = function (callback, scope) {
+    this.core.getScheduled(callback, scope);
 };
 
 /**
@@ -276,8 +241,8 @@ exports.getTriggered = function (ids, callback, scope) {
  * @param [ Function ]   callback The function to be exec as the callback.
  * @param [ Object ]     scope    The callback function's scope.
  */
-exports.getAllTriggered = function (callback, scope) {
-    this.core.getAllTriggered(callback, scope);
+exports.getTriggered = function (callback, scope) {
+    this.core.getTriggered(callback, scope);
 };
 
 /**