Merge lp:~openerp-dev/openerp-web/7.0-bug-1097757-ggh into lp:openerp-web/7.0

Proposed by Farid Ghanchi
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/7.0-bug-1097757-ggh
Merge into: lp:openerp-web/7.0
Diff against target: 34 lines (+10/-2)
2 files modified
addons/web/static/src/js/chrome.js (+9/-1)
addons/web/static/src/xml/base.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-bug-1097757-ggh
Reviewer Review Type Date Requested Status
Farid Ghanchi (community) Needs Resubmitting
Xavier (Open ERP) (community) Needs Fixing
Review via email: mp+145306@code.launchpad.net

Description of the change

Hello,

I had fixed the issue of Deactivate Developer mode in 7.0.
About OpenERP >> Activate the Developer mode and Deactivate the Developer mode.

Thanks

To post a comment you must log in.
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

This is broken, for instance the first test will match any "debug" anywhere in the url, if somebody creates a page served through a controller on /debug or the web client is embedded in a page whose URL contains the word "debug", it'll match and this bit will believe it is in debug mode somehow.

Considering we are already using jquery-bbq for query parameters manipulation, I would suggest learning the library and using it for this case as well, instead of doing the same thing by hand incorrectly.

review: Needs Fixing
3732. By Farid Ghanchi

[FIx]Fixed the issue of Deactivate Developer mode with BBQ lib

3733. By Farid Ghanchi

[Fix]match debug only querystring(?#) in url

Revision history for this message
Farid Ghanchi (gfarid) wrote :

Hello sir,
I have improved code as you suggest
And now debug is match in url but not whole url only query_string area, Its match in only window.location.href means before # code.
Also change code for deactivate mode to remove debug in url using jquery-bbq

Thanks

review: Needs Resubmitting
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

1. Why are you still doing a match on the querystring instead of using $.deparam.querystring, which returns a parsed and structured object?
2. The current JS code "untranslates" terms
3. Why is there a reference to "window.location.hash" to deactivate the developer mode? Also why do you check for the devmode status based on the label of a button instead of checking the actual devmode status (which you're supposed to have already done once above, so you could just memoize that)

review: Needs Fixing
3734. By Farid Ghanchi

[Merge] with trunk

3735. By Farid Ghanchi

[Fix] Used to deparam.querystring in deactivat devmode

Revision history for this message
Farid Ghanchi (gfarid) wrote :

Hello,

Improved code,
Used deparam.querystring() in directly get debug so we remove match code,
and set translated tearms.
And I had used windows.location.hash because its get hash string and debug is set on that(before #) so we used ,'#'.

Thanks...
Farid Ghanchi

review: Needs Resubmitting

Unmerged revisions

3735. By Farid Ghanchi

[Fix] Used to deparam.querystring in deactivat devmode

3734. By Farid Ghanchi

[Merge] with trunk

3733. By Farid Ghanchi

[Fix]match debug only querystring(?#) in url

3732. By Farid Ghanchi

[FIx]Fixed the issue of Deactivate Developer mode with BBQ lib

3731. By Farid Ghanchi

[Fix ] FIxed the issue of Developer mode Deactivate

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js 2013-02-13 14:39:53 +0000
+++ addons/web/static/src/js/chrome.js 2013-02-15 06:16:31 +0000
@@ -1067,9 +1067,17 @@
1067 var self = this;1067 var self = this;
1068 self.rpc("/web/webclient/version_info", {}).done(function(res) {1068 self.rpc("/web/webclient/version_info", {}).done(function(res) {
1069 var $help = $(QWeb.render("UserMenu.about", {version_info: res}));1069 var $help = $(QWeb.render("UserMenu.about", {version_info: res}));
1070 if ($.deparam.querystring().debug == undefined){
1071 $help.find('span.oe_debug_activate').text(_t("Activate"));
1072 } else {
1073 $help.find('span.oe_debug_activate').text(_t("Deactivate"));
1074 }
1070 $help.find('a.oe_activate_debug_mode').click(function (e) {1075 $help.find('a.oe_activate_debug_mode').click(function (e) {
1071 e.preventDefault();1076 e.preventDefault();
1072 window.location = $.param.querystring( window.location.href, 'debug');1077 if ($help.find('span.oe_debug_activate').text() == _t("Activate")) {
1078 window.location = $.param.querystring( window.location.href, 'debug');
1079 } else {
1080 window.location = $.param.querystring( window.location.hash, '#');}
1073 });1081 });
1074 instance.web.dialog($help, {autoOpen: true,1082 instance.web.dialog($help, {autoOpen: true,
1075 modal: true, width: 507, height: 290, resizable: false, title: _t("About")});1083 modal: true, width: 507, height: 290, resizable: false, title: _t("About")});
10761084
=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml 2013-02-13 15:21:58 +0000
+++ addons/web/static/src/xml/base.xml 2013-02-15 06:16:31 +0000
@@ -413,7 +413,7 @@
413<t t-name="UserMenu.about">413<t t-name="UserMenu.about">
414414
415 <div class="oe_about">415 <div class="oe_about">
416 <a class="oe_activate_debug_mode oe_right" href="?debug" style="background-color: white; padding:2px 6px; border-radius: 10px;">Activate the developer mode</a>416 <a class="oe_activate_debug_mode oe_right" href="?debug" style="background-color: white; padding:2px 6px; border-radius: 10px;"><span class="oe_debug_activate">Activate</span> the developer mode</a>
417 <img class="oe_logo" src="/web/static/src/img/logo2.png"/>417 <img class="oe_logo" src="/web/static/src/img/logo2.png"/>
418 <h3>Version <t t-esc="version_info.server_version"/></h3>418 <h3>Version <t t-esc="version_info.server_version"/></h3>
419419