Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
erp5
Commits
cec042df
Commit
cec042df
authored
Oct 04, 2018
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_jabber_client] Handle redirection on desktop notification click
parent
ad602133
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jio_js.js
.../PathTemplateItem/web_page_module/jabber_gadget_jio_js.js
+19
-3
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jio_js.xml
...PathTemplateItem/web_page_module/jabber_gadget_jio_js.xml
+2
-2
No files found.
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jio_js.js
View file @
cec042df
...
@@ -193,12 +193,27 @@
...
@@ -193,12 +193,27 @@
});
});
}
}
function
createNotification
(
title
,
body
)
{
function
createNotification
(
gadget
,
message
)
{
if
(
window
.
Notification
!==
undefined
)
{
if
(
window
.
Notification
!==
undefined
)
{
return
window
.
Notification
.
requestPermission
()
return
window
.
Notification
.
requestPermission
()
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
if
(
result
===
'
granted
'
)
{
if
(
result
===
'
granted
'
)
{
return
new
window
.
Notification
(
title
,
{
body
:
body
});
var
notification
=
new
window
.
Notification
(
message
[
0
],
{
body
:
message
[
2
]});
notification
.
onclick
=
function
()
{
window
.
focus
();
return
gadget
.
getUrlParameter
(
'
jio_key
'
)
.
push
(
function
(
key
)
{
if
(
key
!==
message
[
0
])
{
return
gadget
.
redirect
({
'
command
'
:
'
change
'
,
'
options
'
:
{
'
jio_key
'
:
message
[
0
],
'
page
'
:
'
jabberclient_dialog
'
}
});
}
});
};
}
}
});
});
}
}
...
@@ -280,7 +295,7 @@
...
@@ -280,7 +295,7 @@
// It simplifies a lot notification status
// It simplifies a lot notification status
document
.
querySelector
(
"
link[rel='shortcut icon']
"
).
setAttribute
(
"
href
"
,
"
gadget_jabberclient_notification_warning.ico
"
);
document
.
querySelector
(
"
link[rel='shortcut icon']
"
).
setAttribute
(
"
href
"
,
"
gadget_jabberclient_notification_warning.ico
"
);
createNotification
(
argument_list
[
0
],
argument_list
[
0
][
2
]
);
createNotification
(
this
,
argument_list
);
}
}
var
gadget
=
this
;
var
gadget
=
this
;
...
@@ -394,6 +409,7 @@
...
@@ -394,6 +409,7 @@
.
declareAcquiredMethod
(
'
redirect
'
,
'
redirect
'
)
.
declareAcquiredMethod
(
'
redirect
'
,
'
redirect
'
)
.
declareAcquiredMethod
(
'
getUrlFor
'
,
'
getUrlFor
'
)
.
declareAcquiredMethod
(
'
getUrlFor
'
,
'
getUrlFor
'
)
.
declareAcquiredMethod
(
'
refresh
'
,
'
refresh
'
)
.
declareAcquiredMethod
(
'
refresh
'
,
'
refresh
'
)
.
declareAcquiredMethod
(
'
getUrlParameter
'
,
'
getUrlParameter
'
)
.
declareMethod
(
'
createJio
'
,
function
()
{
.
declareMethod
(
'
createJio
'
,
function
()
{
return
this
.
state_parameter_dict
.
persistent_jio
.
createJio
({
return
this
.
state_parameter_dict
.
persistent_jio
.
createJio
({
...
...
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jio_js.xml
View file @
cec042df
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
970.4
5900.44706.11212
</string>
</value>
<value>
<string>
970.4
7251.8439.43008
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1538
581284.9
1
</float>
<float>
1538
662464.7
1
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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