Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nabil Sadki
cordova-plugin-local-notifications
Commits
831c96d3
Commit
831c96d3
authored
Aug 17, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy sealed windows objects to JS objects
parent
04e5ef63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
11 deletions
+66
-11
LocalNotificationProxy.js
src/windows/LocalNotificationProxy.js
+66
-11
No files found.
src/windows/LocalNotificationProxy.js
View file @
831c96d3
...
@@ -166,7 +166,7 @@ exports.triggeredIds = function (success, error) {
...
@@ -166,7 +166,7 @@ exports.triggeredIds = function (success, error) {
exports
.
notification
=
function
(
success
,
error
,
args
)
{
exports
.
notification
=
function
(
success
,
error
,
args
)
{
var
obj
=
impl
.
notification
(
args
[
0
]);
var
obj
=
impl
.
notification
(
args
[
0
]);
success
(
obj
);
success
(
exports
.
clone
(
obj
)
);
};
};
/**
/**
...
@@ -181,7 +181,7 @@ exports.notification = function (success, error, args) {
...
@@ -181,7 +181,7 @@ exports.notification = function (success, error, args) {
exports
.
notifications
=
function
(
success
,
error
,
args
)
{
exports
.
notifications
=
function
(
success
,
error
,
args
)
{
var
objs
=
impl
.
notifications
(
args
)
||
[];
var
objs
=
impl
.
notifications
(
args
)
||
[];
success
(
Array
.
from
(
objs
));
success
(
exports
.
cloneAll
(
objs
));
};
};
/**
/**
...
@@ -195,7 +195,7 @@ exports.notifications = function (success, error, args) {
...
@@ -195,7 +195,7 @@ exports.notifications = function (success, error, args) {
exports
.
scheduledNotifications
=
function
(
success
,
error
)
{
exports
.
scheduledNotifications
=
function
(
success
,
error
)
{
var
objs
=
impl
.
scheduledNotifications
()
||
[];
var
objs
=
impl
.
scheduledNotifications
()
||
[];
success
(
Array
.
from
(
objs
));
success
(
exports
.
cloneAll
(
objs
));
};
};
/**
/**
...
@@ -209,7 +209,7 @@ exports.scheduledNotifications = function (success, error) {
...
@@ -209,7 +209,7 @@ exports.scheduledNotifications = function (success, error) {
exports
.
triggeredNotifications
=
function
(
success
,
error
)
{
exports
.
triggeredNotifications
=
function
(
success
,
error
)
{
var
objs
=
impl
.
triggeredNotifications
()
||
[];
var
objs
=
impl
.
triggeredNotifications
()
||
[];
success
(
Array
.
from
(
objs
));
success
(
exports
.
cloneAll
(
objs
));
};
};
/**
/**
...
@@ -222,20 +222,75 @@ exports.triggeredNotifications = function (success, error) {
...
@@ -222,20 +222,75 @@ exports.triggeredNotifications = function (success, error) {
exports
.
clicked
=
function
(
xml
,
input
)
{
exports
.
clicked
=
function
(
xml
,
input
)
{
var
toast
=
LocalNotification
.
Options
.
parse
(
xml
),
var
toast
=
LocalNotification
.
Options
.
parse
(
xml
),
event
=
toast
.
action
||
'click'
,
event
=
toast
.
action
||
'click'
,
e
=
{
event
:
event
}
;
meta
=
Object
.
assign
({},
input
)
;
if
(
input
&&
input
.
size
>
0
)
{
if
(
input
&&
input
.
size
>
0
)
{
var
it
=
input
.
first
();
meta
.
text
=
input
.
first
().
current
.
value
;
}
exports
.
fireEvent
(
event
,
toast
,
meta
);
};
e
.
text
=
it
.
current
.
value
;
/**
* Invoke listeners for the given event.
*
* @param [ String ] event The name of the event.
* @param [ Object ] toast Optional notification object.
* @param [ Object ] data Optional meta data about the event.
*
* @return [ Void ]
*/
exports
.
fireEvent
=
function
(
event
,
toast
,
data
)
{
var
meta
=
Object
.
assign
({
event
:
event
},
data
),
plugin
=
cordova
.
plugins
.
notification
.
local
.
core
;
if
(
toast
)
{
plugin
.
fireEvent
(
event
,
exports
.
clone
(
toast
),
meta
);
}
else
{
plugin
.
fireEvent
(
event
,
meta
);
}
};
while
(
it
.
hasCurrent
)
{
/**
e
[
it
.
current
.
key
]
=
it
.
current
.
value
;
* Clone the objects and delete internal properties.
it
.
moveNext
();
*
* @param [ Array<Object> ] objs The objects to clone for.
*
* @return [ Array<Object> ]
*/
exports
.
cloneAll
=
function
(
objs
)
{
var
clones
=
[];
for
(
var
i
=
0
;
i
<
objs
.
length
;
i
++
)
{
clones
.
push
(
exports
.
clone
(
objs
[
i
]));
}
return
clones
;
};
/**
* Clone the object and delete internal properties.
*
* @param [ Object ] obj The object to clone for.
*
* @return [ Object ]
*/
exports
.
clone
=
function
(
obj
)
{
var
ignore
=
[
'action'
],
clone
=
{};
for
(
var
prop
in
obj
)
{
if
(
ignore
.
includes
(
prop
)
||
typeof
obj
[
prop
]
===
'function'
)
continue
;
try
{
clone
[
prop
]
=
obj
[
prop
];
}
catch
(
e
)
{
clone
[
prop
]
=
null
;
}
}
}
}
cordova
.
plugins
.
notification
.
local
.
core
.
fireEvent
(
event
,
toast
,
e
)
;
return
clone
;
};
};
// Handle onclick event
// Handle onclick event
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment