summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/js/utils.js')
-rw-r--r--addons/mail/static/src/js/utils.js43
1 files changed, 0 insertions, 43 deletions
diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js
index 49d1705eccd..533fe67f91b 100644
--- a/addons/mail/static/src/js/utils.js
+++ b/addons/mail/static/src/js/utils.js
@@ -1,48 +1,6 @@
odoo.define('mail.utils', function (require) {
"use strict";
-var bus = require('bus.bus').bus;
-
-
-function send_notification(widget, title, content) {
- if (window.Notification && Notification.permission === "granted") {
- if (bus.is_master) {
- _send_native_notification(title, content);
- }
- } else {
- widget.do_notify(title, content);
- if (bus.is_master) {
- _beep(widget);
- }
- }
-}
-function _send_native_notification(title, content) {
- var notification = new Notification(title, {body: content, icon: "/mail/static/src/img/odoo_o.png"});
- notification.onclick = function () {
- window.focus();
- if (this.cancel) {
- this.cancel();
- } else if (this.close) {
- this.close();
- }
- };
-}
-var _beep = (function () {
- if (typeof(Audio) === "undefined") {
- return function () {};
- }
- var audio;
- return function (widget) {
- if (!audio) {
- audio = new Audio();
- var ext = audio.canPlayType("audio/ogg; codecs=vorbis") ? ".ogg" : ".mp3";
- var session = widget.getSession();
- audio.src = session.url("/mail/static/src/audio/ting" + ext);
- }
- audio.play();
- };
-})();
-
function parse_and_transform(html_string, transform_function) {
var open_token = "OPEN" + Date.now();
var string = html_string.replace(/</g, open_token);
@@ -141,7 +99,6 @@ function unaccent (str) {
}
return {
- send_notification: send_notification,
parse_and_transform: parse_and_transform,
add_link: add_link,
linkify: linkify,