Merge lp:~openerp-dev/openerp-web/trunk-improve-shortcutkeys-hotkeys-bth into lp:openerp-web

Proposed by Harry (OpenERP)
Status: Work in progress
Proposed branch: lp:~openerp-dev/openerp-web/trunk-improve-shortcutkeys-hotkeys-bth
Merge into: lp:openerp-web
Diff against target: 240 lines (+129/-9)
6 files modified
addons/web/static/src/css/base.css (+7/-2)
addons/web/static/src/css/base.sass (+3/-0)
addons/web/static/src/js/chrome.js (+87/-0)
addons/web/static/src/js/view_form.js (+25/-0)
addons/web/static/src/xml/base.xml (+6/-6)
addons/web_kanban/static/src/xml/web_kanban.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-improve-shortcutkeys-hotkeys-bth
Reviewer Review Type Date Requested Status
OpenERP R&D Web Team Pending
Review via email: mp+196239@code.launchpad.net
To post a comment you must log in.
3875. By Bhumi Thakkar (Open ERP)

[MERGE]With Trunk.

3876. By Dharmraj Zala(OpenERP)

[MERGE] with trunk

3877. By Dharmraj Zala(OpenERP)

[MERGE] with trunk

Unmerged revisions

3877. By Dharmraj Zala(OpenERP)

[MERGE] with trunk

3876. By Dharmraj Zala(OpenERP)

[MERGE] with trunk

3875. By Bhumi Thakkar (Open ERP)

[MERGE]With Trunk.

3874. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

3873. By Bhumi Thakkar (Open ERP)

[IMP]Removed code shortcuts for switch view and links. added for pager on left & right arrows.

3872. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

3871. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

3870. By Bhumi Thakkar (Open ERP)

[IMP]IMproved code for accesskeys.Accesskeys in lowercase.

3869. By Bhumi Thakkar (Open ERP)

[MERGE]Merge trunk.

3868. By Bhumi Thakkar (Open ERP)

[IMP]Using hotkeys events called.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css 2014-01-31 00:52:02 +0000
+++ addons/web/static/src/css/base.css 2014-02-03 06:03:15 +0000
@@ -1,4 +1,4 @@
1@charset "UTF-8";1@charset "utf-8";
2@font-face {2@font-face {
3 font-family: "mnmliconsRegular";3 font-family: "mnmliconsRegular";
4 src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot");4 src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot");
@@ -893,7 +893,7 @@
893 background-image: -moz-linear-gradient(top, #fc8787, maroon);893 background-image: -moz-linear-gradient(top, #fc8787, maroon);
894 background-image: -ms-linear-gradient(top, #fc8787, maroon);894 background-image: -ms-linear-gradient(top, #fc8787, maroon);
895 background-image: -o-linear-gradient(top, #fc8787, maroon);895 background-image: -o-linear-gradient(top, #fc8787, maroon);
896 background-image: linear-gradient(to bottom, #fc8787, #800000);896 background-image: linear-gradient(to bottom, #fc8787, maroon);
897}897}
898.openerp .navbar .oe_topbar_anonymous_login a {898.openerp .navbar .oe_topbar_anonymous_login a {
899 display: block;899 display: block;
@@ -3153,6 +3153,10 @@
3153 margin: 3px 3px 0 !important;3153 margin: 3px 3px 0 !important;
3154}3154}
31553155
3156.accesshighlight:first-letter, .highlight {
3157 text-decoration: underline;
3158}
3159
3156@-moz-document url-prefix() {3160@-moz-document url-prefix() {
3157 .openerp .oe_searchview .oe_searchview_search {3161 .openerp .oe_searchview .oe_searchview_search {
3158 top: -1px;3162 top: -1px;
@@ -3434,6 +3438,7 @@
3434 overflow: hidden !important;3438 overflow: hidden !important;
3435 }3439 }
3436}3440}
3441
3437.ui-icon {3442.ui-icon {
3438 width: 18px;3443 width: 18px;
3439 height: 18px;3444 height: 18px;
34403445
=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass 2014-01-31 00:52:02 +0000
+++ addons/web/static/src/css/base.sass 2014-02-03 06:03:15 +0000
@@ -2531,6 +2531,9 @@
2531 .oe_msg_subtype_check2531 .oe_msg_subtype_check
2532 margin: 3px 3px 0 !important2532 margin: 3px 3px 0 !important
2533 // }}}2533 // }}}
2534
2535.accesshighlight:first-letter, .highlight
2536 text-decoration: underline
25342537
2535@-moz-document url-prefix()2538@-moz-document url-prefix()
2536 .openerp2539 .openerp
25372540
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js 2014-01-16 18:15:19 +0000
+++ addons/web/static/src/js/chrome.js 2014-02-03 06:03:15 +0000
@@ -9,6 +9,93 @@
9var QWeb = instance.web.qweb,9var QWeb = instance.web.qweb,
10 _t = instance.web._t;10 _t = instance.web._t;
1111
12/* using jquery.hotkeys */
13$(document).bind('keydown', 'alt', function(e) {
14 highlightAccessKeys();
15}).bind('keydown', 'shift', function(e) {
16 highlightAccessKeys();
17}).keyup(function() {
18 unhighlightAccessKeys();
19});
20
21/* replace character with span tag into exist element */
22function replaceHtml(key, el) {
23 $(el).html($(el).text().replace(key, '<span class ="highlight">' + key + '</span>'))
24}
25/*
26 * find accesskey is assigned to anyother element. if assigned then find nextone character else assign.
27 * */
28function addkey(key, el, index, flag) {
29 if ($.inArray(key,this.keys) == -1) {
30 $(el).attr('accesskey', key.toLowerCase());
31 if (index == 0) {
32 replaceHtml($(el).attr('accesskey').toUpperCase(), el);
33 } else {
34 if (flag) keyval = key;
35 else keyval = key.toLowerCase();
36 replaceHtml(keyval, el);
37 }
38 this.keys.push(key);
39 } else {
40 index++;
41 val = $(el).text().replace(/\s/g, '').charAt(index);
42 conval = $(el).text().replace(/\s/g, '').charAt(index).toUpperCase();
43 key = $(el).text().replace(/\s/g, '').charAt(index).toUpperCase();
44 if(index < ($.trim($(el).text()).length + 1)){
45 addkey(key, el, index, val == conval);
46 }
47 }
48}
49/*
50 * highlightAccesskeys() - find element which has accesskey attribute and also element which has to assign accesskey attribute
51 * */
52function highlightAccessKeys() {
53 var keys = [];
54
55 // accesskey for header
56 $hedaer = $('.oe_view_manager_current > table');
57
58 _.each($($hedaer).find('.oe_view_manager_buttons > div'), function(el) {
59 if ($(el).css('display') == 'block') {
60 _.each($(el).find('button[accesskey]'), function (btn) {
61 replaceHtml($(btn).attr('accesskey').toUpperCase(), btn);
62 keys.push($(btn).attr('accesskey').toUpperCase())
63 });
64 _.each($(el).find('a[accesskey]:visible'), function ($a) {
65 $($a).attr('accesskey').toLowerCase()
66 replaceHtml($($a).attr('accesskey').toUpperCase(), $a);
67 keys.push($($a).attr('accesskey').toUpperCase())
68 });
69 }
70 });
71
72 // sidebar menu
73 _.each($hedaer.find('.oe_view_manager_sidebar').find('button[accesskey]'), function (el) {
74 $(el).attr('accesskey', $(el).attr('accesskey').toLowerCase());
75 replaceHtml($(el).attr('accesskey').toUpperCase(), el);
76 keys.push($(el).attr('accesskey').toUpperCase());
77 });
78
79 this.keys = keys;
80
81 // accesskey for body
82 _.each ($('.oe_view_manager_body > div:not(.oe_view_manager_view_kanban)'), function(el) {
83 if ($(el).css('display') == 'block') {
84 _.each($(el).find('button:not(.oe_form_invisible):visible'), function (el) {
85 var index = 0;
86 if (!$(el).hasClass('oe_follower') && !$(el).hasClass('oe_link') && !$(el).hasClass('oe_i')) {
87 key = $(el).text().replace(/\s/g, '').charAt(0).toUpperCase();
88 if (key)
89 addkey(key, el, index);
90 }
91 });
92 }
93 });
94}
95function unhighlightAccessKeys() {
96 $('span.highlight').removeClass('highlight');
97 $('li.highlight').removeClass('highlight');
98}
12instance.web.Notification = instance.web.Widget.extend({99instance.web.Notification = instance.web.Widget.extend({
13 template: 'Notification',100 template: 'Notification',
14 init: function() {101 init: function() {
15102
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2014-01-31 00:52:02 +0000
+++ addons/web/static/src/js/view_form.js 2014-02-03 06:03:15 +0000
@@ -359,6 +359,31 @@
359 }359 }
360 self.$el.add(self.$buttons).removeClass('oe_form_dirty');360 self.$el.add(self.$buttons).removeClass('oe_form_dirty');
361 self.autofocus();361 self.autofocus();
362
363 // shortcut for pager (on left arrow - right arrow)
364 $(document).bind('keydown', 'left', function (event) {
365 event.stopPropagation();
366 event.stopImmediatePropagation();
367 switch (event.data) {
368 case 'left':
369 self.dataset.previous();
370 break;
371 }
372 var def = self.reload();
373 self.trigger('pager_action_executed');
374 return def;
375 }).bind('keydown', 'right', function(event) {
376 event.stopPropagation();
377 event.stopImmediatePropagation();
378 switch (event.data) {
379 case 'right':
380 self.dataset.next();
381 break;
382 }
383 var def = self.reload();
384 self.trigger('pager_action_executed');
385 return def;
386 });
362 });387 });
363 },388 },
364 /**389 /**
365390
=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml 2014-01-14 13:39:53 +0000
+++ addons/web/static/src/xml/base.xml 2014-02-03 06:03:15 +0000
@@ -583,7 +583,7 @@
583 <div class="oe_sidebar">583 <div class="oe_sidebar">
584 <t t-foreach="widget.sections" t-as="section">584 <t t-foreach="widget.sections" t-as="section">
585 <div class="oe_form_dropdown_section">585 <div class="oe_form_dropdown_section">
586 <button class="oe_dropdown_toggle oe_dropdown_arrow">586 <button class="oe_dropdown_toggle oe_dropdown_arrow" t-att-accesskey="section.label[0]">
587 <t t-if="section.name == 'files'" t-raw="widget.items[section.name].length || ''"/>587 <t t-if="section.name == 'files'" t-raw="widget.items[section.name].length || ''"/>
588 <t t-esc="section.label"/>588 <t t-esc="section.label"/>
589 </button>589 </button>
@@ -710,7 +710,7 @@
710<t t-name="ListView.buttons">710<t t-name="ListView.buttons">
711 <div class="oe_list_buttons">711 <div class="oe_list_buttons">
712 <t t-if="!widget.no_leaf and widget.options.action_buttons !== false and widget.options.addable and widget.is_action_enabled('create')">712 <t t-if="!widget.no_leaf and widget.options.action_buttons !== false and widget.options.addable and widget.is_action_enabled('create')">
713 <button type="button" class="oe_button oe_list_add oe_highlight">713 <button type="button" class="oe_button oe_list_add oe_highlight" accesskey="c">
714 <t t-esc="widget.options.addable"/>714 <t t-esc="widget.options.addable"/>
715 </button>715 </button>
716 </t>716 </t>
@@ -791,15 +791,15 @@
791 <span class="oe_form_buttons_view">791 <span class="oe_form_buttons_view">
792 <!-- required for the bounce effect on button -->792 <!-- required for the bounce effect on button -->
793 <div t-if="widget.is_action_enabled('edit')" style="display: inline-block;">793 <div t-if="widget.is_action_enabled('edit')" style="display: inline-block;">
794 <button type="button" class="oe_button oe_form_button_edit" accesskey="E">Edit</button>794 <button type="button" class="oe_button oe_form_button_edit" accesskey="e">Edit</button>
795 </div>795 </div>
796 <button t-if="widget.is_action_enabled('create')"796 <button t-if="widget.is_action_enabled('create')"
797 type="button" class="oe_button oe_form_button_create" accesskey="C">Create</button>797 type="button" class="oe_button oe_form_button_create" accesskey="c">Create</button>
798 </span>798 </span>
799 <span class="oe_form_buttons_edit">799 <span class="oe_form_buttons_edit">
800 <button type="button" class="oe_button oe_form_button_save oe_highlight" accesskey="S">Save</button>800 <button type="button" class="oe_button oe_form_button_save oe_highlight" accesskey="s">Save</button>
801 <span class="oe_fade">or</span>801 <span class="oe_fade">or</span>
802 <a href="#" class="oe_bold oe_form_button_cancel" accesskey="D">Discard</a>802 <a href="#" class="oe_bold oe_form_button_cancel" accesskey="d">Discard</a>
803 </span>803 </span>
804 </t>804 </t>
805</div>805</div>
806806
=== modified file 'addons/web_kanban/static/src/xml/web_kanban.xml'
--- addons/web_kanban/static/src/xml/web_kanban.xml 2013-05-17 05:41:10 +0000
+++ addons/web_kanban/static/src/xml/web_kanban.xml 2014-02-03 06:03:15 +0000
@@ -15,7 +15,7 @@
15<div t-name="KanbanView.buttons" class="oe_kanban_buttons">15<div t-name="KanbanView.buttons" class="oe_kanban_buttons">
16 <t t-if="widget.options.action_buttons !== false">16 <t t-if="widget.options.action_buttons !== false">
17 <t t-if="widget.is_action_enabled('create')">17 <t t-if="widget.is_action_enabled('create')">
18 <button type="button" class="oe_kanban_button_new oe_highlight">18 <button type="button" class="oe_kanban_button_new oe_highlight" accesskey="c">
19 <t t-esc="widget.options.create_text || _t('Create')"/>19 <t t-esc="widget.options.create_text || _t('Create')"/>
20 </button>20 </button>
21 <span class="oe_alternative" style="display: none">21 <span class="oe_alternative" style="display: none">