From 283782e948c951319ecd3255c25a332a87f0f6ce Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Fri, 23 Oct 2015 15:34:45 +0500 Subject: [PATCH 01/11] [ADD] mail_recovery module --- __init__.py | 1 + __openerp__.py | 12 ++++++++++++ data.xml | 10 ++++++++++ static/src/js/mail_recovery.js | 26 ++++++++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 __init__.py create mode 100644 __openerp__.py create mode 100644 data.xml create mode 100644 static/src/js/mail_recovery.js diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..40a96af --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/__openerp__.py b/__openerp__.py new file mode 100644 index 0000000..a149d17 --- /dev/null +++ b/__openerp__.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +{ + 'name': "Mail recovery", + 'author': "IT-Projects LLC, Ildar Nasyrov", + 'website': "https://twitter.com/nasyrov_ildar", + 'category': 'Uncategorized', + 'version': '0.1', + 'depends': ['mail'], + 'data': [ + 'data.xml', + ], +} diff --git a/data.xml b/data.xml new file mode 100644 index 0000000..10ac077 --- /dev/null +++ b/data.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/static/src/js/mail_recovery.js b/static/src/js/mail_recovery.js new file mode 100644 index 0000000..33cd20e --- /dev/null +++ b/static/src/js/mail_recovery.js @@ -0,0 +1,26 @@ +openerp.mail_recovery = function (session) { + var mail = session.mail; + + mail.ThreadComposeMessage = mail.ThreadComposeMessage.extend({ + init: function (parent, datasets, options) { + console.log("privet"); + return this._super(parent, datasets, options); + }, + bind_events: function () { + var self = this; + this.$('textarea').on('focus', self.on_focus_textarea); + this.$('textarea').on('change', self.on_change_textarea); + this._super(); + }, + on_focus_textarea: function(event) { + $(event.target).val(window.localStorage['message_storage']); + }, + on_change_textarea: function(event) { + window.localStorage['message_storage'] = $(event.target).val(); + }, + on_message_post: function (event) { + window.localStorage['message_storage'] = ''; + return this._super(event); + }, + }); +}; \ No newline at end of file From c38d96a9ec2cf080ef5f1f500801558c7af84dd9 Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Fri, 23 Oct 2015 15:38:12 +0500 Subject: [PATCH 02/11] [REF] delete test lines --- static/src/js/mail_recovery.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/static/src/js/mail_recovery.js b/static/src/js/mail_recovery.js index 33cd20e..7ba44e5 100644 --- a/static/src/js/mail_recovery.js +++ b/static/src/js/mail_recovery.js @@ -2,10 +2,6 @@ openerp.mail_recovery = function (session) { var mail = session.mail; mail.ThreadComposeMessage = mail.ThreadComposeMessage.extend({ - init: function (parent, datasets, options) { - console.log("privet"); - return this._super(parent, datasets, options); - }, bind_events: function () { var self = this; this.$('textarea').on('focus', self.on_focus_textarea); From 5542106a05f5c25214c0215461a0e186f58bee8c Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Fri, 23 Oct 2015 15:46:17 +0500 Subject: [PATCH 03/11] [FIX] folder name --- data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data.xml b/data.xml index 10ac077..d035853 100644 --- a/data.xml +++ b/data.xml @@ -3,7 +3,7 @@ From dada5aaf6facbbba4f84b68031b18113dd9f353f Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Fri, 23 Oct 2015 15:51:35 +0500 Subject: [PATCH 04/11] [REF] module version --- __openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__openerp__.py b/__openerp__.py index a149d17..505fc3d 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -4,7 +4,7 @@ 'author': "IT-Projects LLC, Ildar Nasyrov", 'website': "https://twitter.com/nasyrov_ildar", 'category': 'Uncategorized', - 'version': '0.1', + 'version': '1.0.0', 'depends': ['mail'], 'data': [ 'data.xml', From ddb5537d68dd1806e47f71c5d1b687f2ca6cb29e Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Sat, 24 Oct 2015 12:05:47 +0500 Subject: [PATCH 05/11] [FIX] onchange to onkeypress --- static/src/js/mail_recovery.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/src/js/mail_recovery.js b/static/src/js/mail_recovery.js index 7ba44e5..c36235e 100644 --- a/static/src/js/mail_recovery.js +++ b/static/src/js/mail_recovery.js @@ -5,13 +5,16 @@ openerp.mail_recovery = function (session) { bind_events: function () { var self = this; this.$('textarea').on('focus', self.on_focus_textarea); - this.$('textarea').on('change', self.on_change_textarea); + this.$('textarea').on('keypress', self.on_keypress_textarea); this._super(); }, on_focus_textarea: function(event) { - $(event.target).val(window.localStorage['message_storage']); + var $input = $(event.target); + if ($input.val() == false) { + $input.val(window.localStorage['message_storage']); + } }, - on_change_textarea: function(event) { + on_keypress_textarea: function(event) { window.localStorage['message_storage'] = $(event.target).val(); }, on_message_post: function (event) { From 6806d71b4ee9502dd1853ec1c0ee5fbfbef7874f Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Sat, 24 Oct 2015 12:29:18 +0500 Subject: [PATCH 06/11] [FIX] keypress to keyup --- static/src/js/mail_recovery.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/src/js/mail_recovery.js b/static/src/js/mail_recovery.js index c36235e..7a0bfaf 100644 --- a/static/src/js/mail_recovery.js +++ b/static/src/js/mail_recovery.js @@ -5,7 +5,7 @@ openerp.mail_recovery = function (session) { bind_events: function () { var self = this; this.$('textarea').on('focus', self.on_focus_textarea); - this.$('textarea').on('keypress', self.on_keypress_textarea); + this.$('textarea').on('keyup', self.on_keyup_textarea); this._super(); }, on_focus_textarea: function(event) { @@ -14,7 +14,7 @@ openerp.mail_recovery = function (session) { $input.val(window.localStorage['message_storage']); } }, - on_keypress_textarea: function(event) { + on_keyup_textarea: function(event) { window.localStorage['message_storage'] = $(event.target).val(); }, on_message_post: function (event) { From b6b958bb33f14a6cbbe528c403e74e0a0430698c Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Sat, 24 Oct 2015 12:43:58 +0500 Subject: [PATCH 07/11] [FIX] amend code --- static/src/js/mail_recovery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/src/js/mail_recovery.js b/static/src/js/mail_recovery.js index 7a0bfaf..3d52a4a 100644 --- a/static/src/js/mail_recovery.js +++ b/static/src/js/mail_recovery.js @@ -10,7 +10,7 @@ openerp.mail_recovery = function (session) { }, on_focus_textarea: function(event) { var $input = $(event.target); - if ($input.val() == false) { + if (!$input.val()) { $input.val(window.localStorage['message_storage']); } }, From 763e0e2e2df5deeb0c2635cb18abe5ddfe44cce2 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 3 Nov 2015 10:22:20 +0500 Subject: [PATCH 08/11] [DOC] add license tag --- __openerp__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/__openerp__.py b/__openerp__.py index 505fc3d..01cbb40 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -2,6 +2,7 @@ { 'name': "Mail recovery", 'author': "IT-Projects LLC, Ildar Nasyrov", + 'license': 'LGPL-3', 'website': "https://twitter.com/nasyrov_ildar", 'category': 'Uncategorized', 'version': '1.0.0', From 2b77747538eaa84e9c3b3929cb04993050d7c573 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 9 Nov 2015 11:26:31 +0500 Subject: [PATCH 09/11] update license to GPL-3 --- __openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__openerp__.py b/__openerp__.py index 01cbb40..58154be 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -2,7 +2,7 @@ { 'name': "Mail recovery", 'author': "IT-Projects LLC, Ildar Nasyrov", - 'license': 'LGPL-3', + 'license': 'GPL-3', 'website': "https://twitter.com/nasyrov_ildar", 'category': 'Uncategorized', 'version': '1.0.0', From 800155d85415aaba7a6d323aed5f03b68054a505 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 9 Nov 2015 11:36:05 +0500 Subject: [PATCH 10/11] Revert "update license to GPL-3" This reverts commit 6157ee932163b56a3a0ad3a64cefb93e190c5c1d. Conflicts: _web_last_viewed_records/__openerp__.py itprojects_sale/__openerp__.py itprojects_website/__openerp__.py mail_delete_access_link/__openerp__.py mail_delete_sent_by_footer/__openerp__.py money_for/__openerp__.py --- __openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__openerp__.py b/__openerp__.py index 58154be..01cbb40 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -2,7 +2,7 @@ { 'name': "Mail recovery", 'author': "IT-Projects LLC, Ildar Nasyrov", - 'license': 'GPL-3', + 'license': 'LGPL-3', 'website': "https://twitter.com/nasyrov_ildar", 'category': 'Uncategorized', 'version': '1.0.0', From 3e94f6a86d91533cab0019f8efdda1e0681d8159 Mon Sep 17 00:00:00 2001 From: Ildar Nasyrov Date: Sun, 27 Mar 2016 16:28:20 +0500 Subject: [PATCH 11/11] [MOV] module -- mail_recovery --- __init__.py => mail_recovery/__init__.py | 0 __openerp__.py => mail_recovery/__openerp__.py | 0 data.xml => mail_recovery/data.xml | 0 {static => mail_recovery/static}/src/js/mail_recovery.js | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename __init__.py => mail_recovery/__init__.py (100%) rename __openerp__.py => mail_recovery/__openerp__.py (100%) rename data.xml => mail_recovery/data.xml (100%) rename {static => mail_recovery/static}/src/js/mail_recovery.js (100%) diff --git a/__init__.py b/mail_recovery/__init__.py similarity index 100% rename from __init__.py rename to mail_recovery/__init__.py diff --git a/__openerp__.py b/mail_recovery/__openerp__.py similarity index 100% rename from __openerp__.py rename to mail_recovery/__openerp__.py diff --git a/data.xml b/mail_recovery/data.xml similarity index 100% rename from data.xml rename to mail_recovery/data.xml diff --git a/static/src/js/mail_recovery.js b/mail_recovery/static/src/js/mail_recovery.js similarity index 100% rename from static/src/js/mail_recovery.js rename to mail_recovery/static/src/js/mail_recovery.js