You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by he...@apache.org on 2014/04/25 22:00:29 UTC
[2/2] git commit: Removing FirefoxOS Quirks * no need to add special
permission (it's different API with the same name) * notification.css is
added automatically
Removing FirefoxOS Quirks
* no need to add special permission (it's different API with the same name)
* notification.css is added automatically
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/commit/59b70c43
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/tree/59b70c43
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/diff/59b70c43
Branch: refs/heads/master
Commit: 59b70c4349316c4cd479b54eb83b91d60ab94c6d
Parents: 8a23a2a
Author: Piotr Zalewa <zalun@ubuntu.(none)>
Authored: Wed Mar 26 06:20:19 2014 -0700
Committer: hermwong <he...@gmail.com>
Committed: Fri Apr 25 13:00:18 2014 -0700
----------------------------------------------------------------------
doc/index.md | 16 ----------------
src/firefoxos/notification.js | 13 +++++++++++++
2 files changed, 13 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/59b70c43/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index 1cb3e09..e07d21f 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -25,22 +25,6 @@ This plugin provides access to some native dialog UI elements.
cordova plugin add org.apache.cordova.dialogs
-### Firefox OS Quirks
-
-Create __www/manifest.webapp__ as described in
-[Manifest Docs](https://developer.mozilla.org/en-US/Apps/Developing/Manifest).
-Add permisions:
-
- "permissions": {
- "desktop-notification": {
- "description": "Describe why you need to enable notifications"
- }
- }
-
-Edit __www/index.html__ and add following in `head` section:
-
- <link rel="stylesheet" type="text/css" href="css/notification.css" />
-
## Methods
- `navigator.notification.alert`
http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/59b70c43/src/firefoxos/notification.js
----------------------------------------------------------------------
diff --git a/src/firefoxos/notification.js b/src/firefoxos/notification.js
index ca7c5c0..08f0a39 100644
--- a/src/firefoxos/notification.js
+++ b/src/firefoxos/notification.js
@@ -19,6 +19,19 @@
*
*/
+var cssId = 'notification-plugin-css';
+if (!document.getElementById(cssId))
+{
+ var head = document.getElementsByTagName('head')[0];
+ var link = document.createElement('link');
+ link.id = cssId;
+ link.rel = 'stylesheet';
+ link.type = 'text/css';
+ link.href = '/css/notification.css';
+ link.media = 'all';
+ head.appendChild(link);
+}
+
function _empty() {}
function modal(message, callback, title, buttonLabels, domObjects) {