diff --git a/web_fullscreen/README.rst b/web_fullscreen/README.rst index 5ac6cdbe..642d5bcf 100644 --- a/web_fullscreen/README.rst +++ b/web_fullscreen/README.rst @@ -6,7 +6,22 @@ Fullscreen ========== -Adds a fullscreen mode button that toggles the primary and secondary menu. +Adds a fullscreen mode button that toggles the primary +and secondary menu. + +**NB:** This module will be less useful if *web_responsive* module is installed +since it contains the functionality described above. The major reason why this +module was ported from `8 `_ to 10 is because, it targets the traditional GUI and +just adds a small fullscreen button on views, in order to see more clearly on +small screens. + +Usage +====== + +.. image:: /web_fullscreen/static/src/img/web_fullscreen.gif + :width: 1063 + :alt: check the static/img folder for a demo + Credits @@ -16,3 +31,18 @@ Contributors ------------ * Dennis Sluijk +* Tom Blauwendraat + + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/web_fullscreen/__init__.py b/web_fullscreen/__init__.py index 9b9ad0f1..94673b34 100644 --- a/web_fullscreen/__init__.py +++ b/web_fullscreen/__init__.py @@ -1,3 +1,2 @@ # -*- coding: utf-8 -*- -# Copyright 2016 Onestein () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/web_fullscreen/__openerp__.py b/web_fullscreen/__manifest__.py similarity index 53% rename from web_fullscreen/__openerp__.py rename to web_fullscreen/__manifest__.py index 1c7c8940..823afb0d 100644 --- a/web_fullscreen/__openerp__.py +++ b/web_fullscreen/__manifest__.py @@ -1,20 +1,22 @@ # -*- coding: utf-8 -*- # Copyright 2016 Onestein () +# Copyright 2019 Sunflower IT () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Fullscreen', 'summary': 'Adds a fullscreen mode button', - 'author': 'Onestein', - 'website': 'http://www.onestein.eu', + 'author': 'Onestein, Sunflower IT, Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'website': 'https://github.com/OCA/web/', 'category': 'Extra Tools', - 'version': '8.0.1.0.0', + 'version': '10.0.1.0.0', 'depends': ['web'], 'data': [ - 'views/web_fullscreen_views.xml' + 'views/web_fullscreen_view.xml' ], 'qweb': [ - 'views/web_fullscreen_templates.xml' + 'static/src/xml/*.xml' ], 'installable': True, } diff --git a/web_fullscreen/static/src/css/web_fullscreen.css b/web_fullscreen/static/src/css/web_fullscreen.css new file mode 100644 index 00000000..e6d686a9 --- /dev/null +++ b/web_fullscreen/static/src/css/web_fullscreen.css @@ -0,0 +1,3 @@ +.o_control_panel .o_cp_fullscreen { + padding-left: 5px; +} diff --git a/web_fullscreen/static/src/img/web_fullscreen.gif b/web_fullscreen/static/src/img/web_fullscreen.gif new file mode 100644 index 00000000..9a82311b Binary files /dev/null and b/web_fullscreen/static/src/img/web_fullscreen.gif differ diff --git a/web_fullscreen/static/src/js/web_fullscreen.js b/web_fullscreen/static/src/js/web_fullscreen.js index 6c5ff83f..9c20a03c 100644 --- a/web_fullscreen/static/src/js/web_fullscreen.js +++ b/web_fullscreen/static/src/js/web_fullscreen.js @@ -1,27 +1,17 @@ -openerp.web_fullscreen = function(instance, local) { - var _t = instance.web._t, - _lt = instance.web._lt; - var QWeb = instance.web.qweb; - - local.FullscreenButton = instance.Widget.extend({ - template: 'FullscreenButton', - events: { - "click a": "toggle" - }, - toggle: function() { - $("#oe_main_menu_navbar").toggle(); - $(".oe_leftbar").toggle(); - }, - start: function() { - this.$el.find('a').tooltip(); - } - }); - - instance.web.ViewManager.include({ - start: function() { +odoo.define('web.fullscreen', function (require) { + "use strict"; + + var ControlPanel = require('web.ControlPanel'); + + ControlPanel.include({ + start: function () { this._super.apply(this, arguments); - var btn = new local.FullscreenButton(this); - return btn.appendTo(this.$el.find('.oe_view_manager_switch')); - } + this.$el.on('click', '.o_cp_fullscreen', function () { + $("#oe_main_menu_navbar").toggle(); + $(".o_sub_menu").toggle(); + }); + }, }); -} + /* eslint require-jsdoc: 0*/ +}); + diff --git a/web_fullscreen/static/src/xml/web_fullscreen_templates.xml b/web_fullscreen/static/src/xml/web_fullscreen_templates.xml new file mode 100644 index 00000000..8ad30d39 --- /dev/null +++ b/web_fullscreen/static/src/xml/web_fullscreen_templates.xml @@ -0,0 +1,15 @@ + + + + +
+