From 8224b76b5e1762a08798ddb5b7ec4c543695063d Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Thu, 19 Sep 2013 12:23:08 +0200 Subject: [PATCH 1/2] [ADD] Module to set default pop-up width to 95% --- web_popup_large/__init__.py | 0 web_popup_large/__openerp__.py | 34 +++++++++++++++++++ .../static/src/js/web_popup_large.js | 25 ++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 web_popup_large/__init__.py create mode 100644 web_popup_large/__openerp__.py create mode 100644 web_popup_large/static/src/js/web_popup_large.js diff --git a/web_popup_large/__init__.py b/web_popup_large/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/web_popup_large/__openerp__.py b/web_popup_large/__openerp__.py new file mode 100644 index 00000000..371627dd --- /dev/null +++ b/web_popup_large/__openerp__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp 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": "Large pop-ups in web client", + "version": "7.0.1.0", + "author": "Therp BV", + "category": 'Usability', + "description": """ +Pop-ups in the web client have a default width of 900 pixels by default. +This module changes this default width to 95% of the parent window. + """, + 'website': 'http://therp.nl', + 'depends': ['web'], + "license": 'AGPL-3', + "js": ['static/src/js/web_popup_large.js'], +} diff --git a/web_popup_large/static/src/js/web_popup_large.js b/web_popup_large/static/src/js/web_popup_large.js new file mode 100644 index 00000000..a8747264 --- /dev/null +++ b/web_popup_large/static/src/js/web_popup_large.js @@ -0,0 +1,25 @@ +/* + + Copyright (C) 2013 Therp BV + License: GNU AFFERO GENERAL PUBLIC LICENSE + Version 3 or any later version + + @authors: Holger Brunn (hbrunn@therp.nl) + Stefan Rijnhart (stefan@therp.nl) + +*/ + +openerp.web_popup_large = function(instance) { + instance.web.Dialog.include({ + init: function(parent, options, content) + { + if(!options) { + options = {} + } + if (!options.width) { + options.width = '95%'; + } + return this._super(parent, options, content); + }, + }); +} From 78c03883681f2f990f0ec01338546c73f9ee87f4 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Thu, 19 Sep 2013 12:27:57 +0200 Subject: [PATCH 2/2] [FIX] Fix the wording of the description in the module description --- web_popup_large/__openerp__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_popup_large/__openerp__.py b/web_popup_large/__openerp__.py index 371627dd..ab02cb8f 100644 --- a/web_popup_large/__openerp__.py +++ b/web_popup_large/__openerp__.py @@ -24,10 +24,10 @@ "author": "Therp BV", "category": 'Usability', "description": """ -Pop-ups in the web client have a default width of 900 pixels by default. +Pop-ups in the web client have a width of 900 pixels by default. This module changes this default width to 95% of the parent window. """, - 'website': 'http://therp.nl', + 'website': 'https://launchpad.net/web-addons', 'depends': ['web'], "license": 'AGPL-3', "js": ['static/src/js/web_popup_large.js'],