From 4426c5e503e336158022892d177e8e54c0c39e68 Mon Sep 17 00:00:00 2001 From: Dennis Sluijk Date: Tue, 16 Feb 2016 15:43:17 +0100 Subject: [PATCH] Initial version of Fullscreen module --- web_fullscreen/__init__.py | 19 +++++++++ web_fullscreen/__openerp__.py | 42 +++++++++++++++++++ .../static/src/js/web_fullscreen.js | 24 +++++++++++ .../views/web_fullscreen_templates.xml | 8 ++++ web_fullscreen/views/web_fullscreen_views.xml | 10 +++++ 5 files changed, 103 insertions(+) create mode 100644 web_fullscreen/__init__.py create mode 100644 web_fullscreen/__openerp__.py create mode 100644 web_fullscreen/static/src/js/web_fullscreen.js create mode 100644 web_fullscreen/views/web_fullscreen_templates.xml create mode 100644 web_fullscreen/views/web_fullscreen_views.xml diff --git a/web_fullscreen/__init__.py b/web_fullscreen/__init__.py new file mode 100644 index 00000000..ba15f90f --- /dev/null +++ b/web_fullscreen/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2016 ONESTEiN BV (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## diff --git a/web_fullscreen/__openerp__.py b/web_fullscreen/__openerp__.py new file mode 100644 index 00000000..6fc350d3 --- /dev/null +++ b/web_fullscreen/__openerp__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2016 ONESTEiN BV (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': "Fullscreen", + 'summary': """""", + 'description': """ +Adds a fullscreen mode button that toggles the primary and secondary menu. +""", + 'author': "ONESTEiN BV", + 'website': "http://www.onestein.eu", + 'category': 'Extra Tools', + 'version': '1.0', + 'depends': ['web'], + 'data': [ + 'views/web_fullscreen_views.xml' + ], + 'qweb': [ + 'views/web_fullscreen_templates.xml' + ], + 'demo': [], + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/web_fullscreen/static/src/js/web_fullscreen.js b/web_fullscreen/static/src/js/web_fullscreen.js new file mode 100644 index 00000000..9b0b4718 --- /dev/null +++ b/web_fullscreen/static/src/js/web_fullscreen.js @@ -0,0 +1,24 @@ +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(); + } + }); + + instance.web.ViewManager.include({ + start: function() { + this._super.apply(this, arguments); + var btn = new local.FullscreenButton(this); + return btn.appendTo(this.$el.find('.oe_view_manager_switch')); + } + }); +} diff --git a/web_fullscreen/views/web_fullscreen_templates.xml b/web_fullscreen/views/web_fullscreen_templates.xml new file mode 100644 index 00000000..ebfc60d7 --- /dev/null +++ b/web_fullscreen/views/web_fullscreen_templates.xml @@ -0,0 +1,8 @@ + + + +
  • + ò +
  • +
    +
    \ No newline at end of file diff --git a/web_fullscreen/views/web_fullscreen_views.xml b/web_fullscreen/views/web_fullscreen_views.xml new file mode 100644 index 00000000..c88c2643 --- /dev/null +++ b/web_fullscreen/views/web_fullscreen_views.xml @@ -0,0 +1,10 @@ + + + + + +