Browse Source

[MIG] 10.0 web_fullscreen

pull/1226/head
KKamaa 6 years ago
parent
commit
7976daf4f6
  1. 32
      web_fullscreen/README.rst
  2. 1
      web_fullscreen/__init__.py
  3. 12
      web_fullscreen/__manifest__.py
  4. 3
      web_fullscreen/static/src/css/web_fullscreen.css
  5. BIN
      web_fullscreen/static/src/img/web_fullscreen.gif
  6. 34
      web_fullscreen/static/src/js/web_fullscreen.js
  7. 15
      web_fullscreen/static/src/xml/web_fullscreen_templates.xml
  8. 8
      web_fullscreen/views/web_fullscreen_templates.xml
  9. 12
      web_fullscreen/views/web_fullscreen_view.xml
  10. 10
      web_fullscreen/views/web_fullscreen_views.xml

32
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 <https://github.com/onesteinbv/addons-onestein/tree/8.0/web_fullscreen>`_ 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 <d.sluijk@onestein.nl>
* Tom Blauwendraat <tblauwendraat@therp.nl>
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.

1
web_fullscreen/__init__.py

@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

12
web_fullscreen/__openerp__.py → web_fullscreen/__manifest__.py

@ -1,20 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)
# Copyright 2019 Sunflower IT (<http://www.sunflowerweb.nl>)
# 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,
}

3
web_fullscreen/static/src/css/web_fullscreen.css

@ -0,0 +1,3 @@
.o_control_panel .o_cp_fullscreen {
padding-left: 5px;
}

BIN
web_fullscreen/static/src/img/web_fullscreen.gif

After

Width: 1362  |  Height: 684  |  Size: 732 KiB

34
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;
odoo.define('web.fullscreen', function (require) {
"use strict";
local.FullscreenButton = instance.Widget.extend({
template: 'FullscreenButton',
events: {
"click a": "toggle"
},
toggle: function() {
var ControlPanel = require('web.ControlPanel');
ControlPanel.include({
start: function () {
this._super.apply(this, arguments);
this.$el.on('click', '.o_cp_fullscreen', function () {
$("#oe_main_menu_navbar").toggle();
$(".oe_leftbar").toggle();
$(".o_sub_menu").toggle();
});
},
start: function() {
this.$el.find('a').tooltip();
}
});
/* eslint require-jsdoc: 0*/
});
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'));
}
});
}

15
web_fullscreen/static/src/xml/web_fullscreen_templates.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<templates xml:space="preserve">
<t t-extend="ControlPanel">
<t t-jquery=".o_cp_switch_buttons" t-operation="after">
<div class="btn-group btn-group-sm o_cp_fullscreen">
<button class="btn btn-icon fa fa-lg fa-tablet"
data-toggle="tooltip" data-placement="top"
aria-expanded="false" href="#">
<i title="Fullscreen Mode"
aria-hidden="true"/>
</button>
</div>
</t>
</t>
</templates>

8
web_fullscreen/views/web_fullscreen_templates.xml

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

12
web_fullscreen/views/web_fullscreen_view.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_backend" name="web_fullscreen assets"
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/css"
href="/web_fullscreen/static/src/css/web_fullscreen.css"/>
<script type="text/javascript"
src="/web_fullscreen/static/src/js/web_fullscreen.js"></script>
</xpath>
</template>
</odoo>

10
web_fullscreen/views/web_fullscreen_views.xml

@ -1,10 +0,0 @@
<?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