Vishmita Jadeja (openerp) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-accesskey_shortcuts into 
lp:~openerp-dev/openerp-web/trunk-improve-little-big-details-bth.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-accesskey_shortcuts/+merge/146393


Improve feature to display all shortcut of accesskey when press 'Altr' in 
formview.

     
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-accesskey_shortcuts/+merge/146393
Your team OpenERP R&D Team is requested to review the proposed merge of 
lp:~openerp-dev/openerp-web/trunk-accesskey_shortcuts into 
lp:~openerp-dev/openerp-web/trunk-improve-little-big-details-bth.
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css	2013-02-01 09:12:31 +0000
+++ addons/web/static/src/css/base.css	2013-02-04 12:40:28 +0000
@@ -30,7 +30,7 @@
   text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
   /* http://www.quirksmode.org/dom/inputfile.html
    * http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image
-   */
+   */ */
 }
 .openerp.openerp_webclient_container {
   height: 100%;
@@ -472,6 +472,11 @@
   max-width: 180px;
   max-height: 180px;
 }
+.openerp .oe_view_manager_current span.access , a.access{
+  text-decoration:underline;
+  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
+  font-weight:bold;
+}
 .openerp .oe_button.oe_link {
   border: none;
   padding: 0;
@@ -1273,7 +1278,7 @@
   color: white;
   padding: 2px 4px;
   margin: 1px 6px 0 0;
-  border: 1px solid lightgrey;
+  border: 1px solid lightGray;
   text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
   -moz-border-radius: 4px;
   -webkit-border-radius: 4px;
@@ -1305,7 +1310,7 @@
   transform: scale(1.1);
 }
 .openerp .oe_secondary_submenu .oe_active {
-  border-top: 1px solid lightgrey;
+  border-top: 1px solid lightGray;
   border-bottom: 1px solid #dedede;
   text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
   -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2);
@@ -2261,7 +2266,7 @@
 }
 .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {
   font-size: 80%;
-  color: darkgreen;
+  color: darkGreen;
   vertical-align: top;
   position: relative;
   top: -4px;
@@ -3298,7 +3303,6 @@
   height: 70px;
   clear: both;
 }
- 
 .res .simtext {
   border-bottom: 0px;
   padding: 5px;

=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass	2013-02-01 09:12:31 +0000
+++ addons/web/static/src/css/base.sass	2013-02-04 12:40:28 +0000
@@ -436,6 +436,10 @@
     .oe_image_medium > img
         max-width: 180px
         max-height: 180px
+    .oe_view_manager_current span.access, a.access
+        text-decoration: underline
+        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2)
+        font-weight: bold
     .oe_button.oe_link
         @include reset()
         img
@@ -2600,31 +2604,14 @@
     .res
         display: table
         width: 100%
-
-div.res
-    border: 1px solid
-
-.resolution .res > div:not(.simtext)
-    border-bottom: 1px solid
-    height: 70px
-    clear: both
-
-.res .simtext
-    border-bottom: 0px
-    padding: 5px
-    height: auto
-
-.simtext span
-    font-size: 8px
-    color: grey
-
-.resolution .res div div
-    display: inline
-    position: absolute
-    padding-top: 30px
-    padding-left: 10px
-
-.res
+        padding: 3px 12px
+
+    .oe_form_buttons button
+        padding-top: 0
+        padding-bottom: 0
+    .oe_sidebar button
+        padding-top: 0
+        padding-bottom: 0
     img
       width: 150px
       height: 40px

=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2013-02-01 06:01:47 +0000
+++ addons/web/static/src/js/view_form.js	2013-02-04 12:40:28 +0000
@@ -123,9 +123,11 @@
         self.set({actual_mode: self.options.initial_mode});
         this.has_been_loaded.done(function() {
             self.on("change:actual_mode", self, self.check_actual_mode);
+            self.widgetAccesskey();
             self.check_actual_mode();
             self.on("change:actual_mode", self, self.init_pager);
             self.init_pager();
+            self.on("change:actual_mode", self, self.widgetAccesskey);
         });
         self.on("load_record", self, self.load_record);
         instance.web.bus.on('clear_uncommitted_changes', this, function(e) {
@@ -220,8 +222,68 @@
             }
          });
         this.trigger('form_view_loaded', data);
+        
         return $.when();
     },
+    widgetAccesskey:function(){
+         var self= this;
+         var list,accesskey = [];
+         $(window).blur(function() {unhighlightAccessKeys()});
+        
+         var highlightAccessKeys = function(){
+            var buttons = _.toArray(self.$el.find('header button:visible,.oe_button_box button:visible'));
+            var form_button = _.toArray(self.$buttons.find('button:visible,a:visible'));
+            var o2m = _.toArray($(document).find('.oe_list_content:visible .oe_form_field_one2many_list_row_add > a'))
+            list = o2m.concat(form_button,buttons);
+            accesskey = _.map(list, function(r){return $(r).attr('accesskey') });
+
+            _.each(list,function(el,i){
+                 if (! $(el).attr("accesskey")) {
+                    if(!accesskey[i]){
+                        var index = 0;
+                        _.each(accesskey,function(_key,j){
+                            if (!_key){
+                                accesskey[i] =  $(el).text().replace(/\s/g, '').toUpperCase().charAt(0);
+                                return 
+                            } else {
+                                if (_.contains(accesskey, $(el).text().replace(/\s/g, '').toUpperCase().charAt(index))) {
+                                    index++;
+                                    return false;
+                                } else {
+                                    if (! accesskey[i]) {
+                                        $(el).attr("accesskey",$(el).text().replace(/\s/g, '').charAt(index))
+                                        index = 0
+                                        return true
+                                    }else {
+                                        $(el).attr("accesskey",accesskey[i])
+                                    }
+                                }
+                            }
+                         return
+                        })
+                    }
+                    
+                 }else {
+                    $(el).attr("accesskey",accesskey[i])
+                 }
+            })
+       }
+       $(document).keydown(function(e){
+           if (e.keyCode === 18 || e.keycode === 16 && e.altkey || e.keyCode == 18 && e.shiftKey) {
+                 highlightAccessKeys();
+                _.each(list,function(rl,i){
+                    $(rl).html(function(i, html){
+                        return $(rl).text().replace($(rl).attr('accesskey'), '<span class ="access">' + $(rl).attr('accesskey') + '</span>');
+                })})
+          }}).keyup(function(){
+            unhighlightAccessKeys();
+        });
+        var unhighlightAccessKeys = function() {
+            _.each(list,function(rl,i){
+                $(rl).find('.access').removeClass('access');
+            })
+        };
+    },
     widgetFocused: function() {
         // Clear click flag if used to focus a widget
         this.__clicked_inside = false;

=== modified file 'addons/web_kanban/static/src/css/kanban.sass'
--- addons/web_kanban/static/src/css/kanban.sass	2013-01-09 09:44:51 +0000
+++ addons/web_kanban/static/src/css/kanban.sass	2013-02-04 12:40:28 +0000
@@ -119,11 +119,11 @@
             overflow: hidden
             text-overflow: ellipsis
         .oe_kanban_group_length
-          position: absolute
-          top: -1px
-          right: -14px
-          text-align: center
-          float: right
+            position: absolute
+            top: -1px
+            right: -14px
+            text-align: center
+            float: right
     &.oe_kanban_grouped
         .oe_kanban_column, .oe_kanban_group_header
             width: 185px

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to