Browse Source

Initial version of Fullscreen module

pull/1226/head
Dennis Sluijk 8 years ago
committed by KKamaa
parent
commit
4426c5e503
  1. 19
      web_fullscreen/__init__.py
  2. 42
      web_fullscreen/__openerp__.py
  3. 24
      web_fullscreen/static/src/js/web_fullscreen.js
  4. 8
      web_fullscreen/views/web_fullscreen_templates.xml
  5. 10
      web_fullscreen/views/web_fullscreen_views.xml

19
web_fullscreen/__init__.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 ONESTEiN BV (<http://www.onestein.nl>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################

42
web_fullscreen/__openerp__.py

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 ONESTEiN BV (<http://www.onestein.nl>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'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,
}

24
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'));
}
});
}

8
web_fullscreen/views/web_fullscreen_templates.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<templates xml:space="preserve">
<t t-name="FullscreenButton">
<li class="oe_e">
<a>ò</a>
</li>
</t>
</templates>

10
web_fullscreen/views/web_fullscreen_views.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="web_fullscreen assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_fullscreen/static/src/js/web_fullscreen.js"></script>
</xpath>
</template>
</data>
</openerp>
Loading…
Cancel
Save