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
cce1155b
Commit
cce1155b
authored
Oct 27, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix array is not an object on windows
parent
0d6b4926
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
22 deletions
+21
-22
LocalNotificationProxy.js
src/windows/LocalNotificationProxy.js
+16
-20
Trigger.cs
...Proxy/LocalNotificationProxy/LocalNotification/Trigger.cs
+2
-2
local-notification-core.js
www/local-notification-core.js
+3
-0
No files found.
src/windows/LocalNotificationProxy.js
View file @
cce1155b
...
@@ -51,8 +51,8 @@ exports.launch = function (success, error, args) {
...
@@ -51,8 +51,8 @@ exports.launch = function (success, error, args) {
exports
.
ready
=
function
()
{
exports
.
ready
=
function
()
{
ready
=
true
;
ready
=
true
;
for
(
var
i
=
0
;
i
<
queue
.
length
;
i
++
)
{
for
(
var
i
tem
of
queue
)
{
exports
.
fireEvent
.
apply
(
exports
,
queue
[
i
]
);
exports
.
fireEvent
.
apply
(
exports
,
item
);
}
}
queue
=
[];
queue
=
[];
...
@@ -96,16 +96,15 @@ exports.request = function (success, error) {
...
@@ -96,16 +96,15 @@ exports.request = function (success, error) {
exports
.
schedule
=
function
(
success
,
error
,
args
)
{
exports
.
schedule
=
function
(
success
,
error
,
args
)
{
var
options
=
[];
var
options
=
[];
for
(
var
i
=
0
,
props
,
opts
;
i
<
args
.
length
;
i
++
)
{
for
(
var
props
of
args
)
{
props
=
args
[
i
];
opts
=
exports
.
parseOptions
(
props
);
opts
=
exports
.
parseOptions
(
props
);
options
.
push
(
opts
);
options
.
push
(
opts
);
}
}
impl
.
schedule
(
options
);
impl
.
schedule
(
options
);
for
(
i
=
0
;
i
<
options
.
length
;
i
++
)
{
for
(
var
toast
of
options
)
{
exports
.
fireEvent
(
'add'
,
options
[
i
]
);
exports
.
fireEvent
(
'add'
,
toast
);
}
}
success
();
success
();
...
@@ -123,16 +122,15 @@ exports.schedule = function (success, error, args) {
...
@@ -123,16 +122,15 @@ exports.schedule = function (success, error, args) {
exports
.
update
=
function
(
success
,
error
,
args
)
{
exports
.
update
=
function
(
success
,
error
,
args
)
{
var
options
=
[];
var
options
=
[];
for
(
var
i
=
0
,
props
,
opts
;
i
<
args
.
length
;
i
++
)
{
for
(
var
props
of
args
)
{
props
=
args
[
i
];
opts
=
exports
.
parseOptions
(
props
);
opts
=
exports
.
parseOptions
(
props
);
options
.
push
(
opts
);
options
.
push
(
opts
);
}
}
impl
.
update
(
options
);
impl
.
update
(
options
);
for
(
i
=
0
;
i
<
options
.
length
;
i
++
)
{
for
(
var
toast
of
options
)
{
exports
.
fireEvent
(
'update'
,
options
[
i
]
);
exports
.
fireEvent
(
'update'
,
toast
);
}
}
success
();
success
();
...
@@ -150,8 +148,8 @@ exports.update = function (success, error, args) {
...
@@ -150,8 +148,8 @@ exports.update = function (success, error, args) {
exports
.
clear
=
function
(
success
,
error
,
args
)
{
exports
.
clear
=
function
(
success
,
error
,
args
)
{
var
toasts
=
impl
.
clear
(
args
)
||
[];
var
toasts
=
impl
.
clear
(
args
)
||
[];
for
(
var
i
=
0
;
i
<
toasts
.
length
;
i
++
)
{
for
(
var
toast
of
toasts
)
{
exports
.
fireEvent
(
'clear'
,
toast
s
[
i
]
);
exports
.
fireEvent
(
'clear'
,
toast
);
}
}
success
();
success
();
...
@@ -183,8 +181,8 @@ exports.clearAll = function (success, error) {
...
@@ -183,8 +181,8 @@ exports.clearAll = function (success, error) {
exports
.
cancel
=
function
(
success
,
error
,
args
)
{
exports
.
cancel
=
function
(
success
,
error
,
args
)
{
var
toasts
=
impl
.
cancel
(
args
)
||
[];
var
toasts
=
impl
.
cancel
(
args
)
||
[];
for
(
var
i
=
0
;
i
<
toasts
.
length
;
i
++
)
{
for
(
var
toast
of
toasts
)
{
exports
.
fireEvent
(
'cancel'
,
toast
s
[
i
]
);
exports
.
fireEvent
(
'cancel'
,
toast
);
}
}
success
();
success
();
...
@@ -377,8 +375,8 @@ exports.fireEvent = function (event, toast, data) {
...
@@ -377,8 +375,8 @@ exports.fireEvent = function (event, toast, data) {
exports
.
cloneAll
=
function
(
objs
)
{
exports
.
cloneAll
=
function
(
objs
)
{
var
clones
=
[];
var
clones
=
[];
for
(
var
i
=
0
;
i
<
objs
.
length
;
i
++
)
{
for
(
var
obj
of
objs
)
{
clones
.
push
(
exports
.
clone
(
obj
s
[
i
]
));
clones
.
push
(
exports
.
clone
(
obj
));
}
}
return
clones
;
return
clones
;
...
@@ -490,13 +488,11 @@ exports.parseEvery = function (spec) {
...
@@ -490,13 +488,11 @@ exports.parseEvery = function (spec) {
* @return [ Array<LocalNotification.Action> ]
* @return [ Array<LocalNotification.Action> ]
*/
*/
exports
.
parseActions
=
function
(
obj
)
{
exports
.
parseActions
=
function
(
obj
)
{
var
actions
=
[];
var
actions
=
[]
,
btn
;
if
(
!
obj
.
actions
)
return
actions
;
if
(
!
obj
.
actions
)
return
actions
;
for
(
var
i
=
0
,
action
,
btn
;
i
<
obj
.
actions
.
length
;
i
++
)
{
for
(
var
action
of
obj
.
actions
)
{
action
=
obj
.
actions
[
i
];
if
(
!
action
.
type
||
action
.
type
==
'button'
)
{
if
(
!
action
.
type
||
action
.
type
==
'button'
)
{
btn
=
new
LocalNotification
.
Button
();
btn
=
new
LocalNotification
.
Button
();
}
else
}
else
...
...
src/windows/LocalNotificationProxy/LocalNotificationProxy/LocalNotification/Trigger.cs
View file @
cce1155b
...
@@ -143,7 +143,7 @@ namespace LocalNotificationProxy.LocalNotification
...
@@ -143,7 +143,7 @@ namespace LocalNotificationProxy.LocalNotification
node
.
SetAttribute
(
"count"
,
this
.
Count
.
ToString
());
node
.
SetAttribute
(
"count"
,
this
.
Count
.
ToString
());
node
.
SetAttribute
(
"occurrence"
,
this
.
Occurrence
.
ToString
());
node
.
SetAttribute
(
"occurrence"
,
this
.
Occurrence
.
ToString
());
if
(!(
this
.
Every
is
Every
))
if
(
this
.
Every
!=
null
&&
!(
this
.
Every
is
Every
))
{
{
node
.
SetAttribute
(
"every"
,
this
.
Every
.
ToString
());
node
.
SetAttribute
(
"every"
,
this
.
Every
.
ToString
());
}
}
...
@@ -192,7 +192,7 @@ namespace LocalNotificationProxy.LocalNotification
...
@@ -192,7 +192,7 @@ namespace LocalNotificationProxy.LocalNotification
/// <returns>The fix date specified by trigger.at or trigger.in</returns>
/// <returns>The fix date specified by trigger.at or trigger.in</returns>
private
DateTime
?
GetFixDate
()
private
DateTime
?
GetFixDate
()
{
{
if
(
this
.
In
!
=
0
)
if
(
this
.
At
=
=
0
)
{
{
return
this
.
AddInterval
(
DateTime
.
Now
,
this
.
Unit
,
this
.
In
);
return
this
.
AddInterval
(
DateTime
.
Now
,
this
.
Unit
,
this
.
In
);
}
}
...
...
www/local-notification-core.js
View file @
cce1155b
...
@@ -338,6 +338,9 @@ exports.getDefaults = function () {
...
@@ -338,6 +338,9 @@ exports.getDefaults = function () {
var
map
=
Object
.
create
(
this
.
_defaults
);
var
map
=
Object
.
create
(
this
.
_defaults
);
for
(
var
key
in
map
)
{
for
(
var
key
in
map
)
{
if
(
Array
.
isArray
(
map
[
key
]))
{
map
[
key
]
=
Array
.
from
(
map
[
key
]);
}
else
if
(
Object
.
prototype
.
isPrototypeOf
(
map
[
key
]))
{
if
(
Object
.
prototype
.
isPrototypeOf
(
map
[
key
]))
{
map
[
key
]
=
Object
.
create
(
map
[
key
]);
map
[
key
]
=
Object
.
create
(
map
[
key
]);
}
}
...
...
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