diff --git a/src/common.js b/src/common.js index 9027db0aa3..50f9f8a4e6 100644 --- a/src/common.js +++ b/src/common.js @@ -156,14 +156,16 @@ jQuery('', { 'class': 'btn btn-link', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Cancel"), }).text(Sao.i18n.gettext('Cancel')).click(function() { dialog.modal.modal('hide'); prm.reject(); }).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("OK"), }).text(Sao.i18n.gettext('OK')).click(function() { var i = dialog.body.find('input:checked').attr('value'); dialog.modal.modal('hide'); @@ -3142,7 +3144,8 @@ .css('white-space', 'pre-wrap'))); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("OK"), }).text(Sao.i18n.gettext('OK')).click(function() { this.close(dialog); prm.resolve('ok'); @@ -3180,7 +3183,8 @@ dialog.body.append(content); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("OK"), }).text(Sao.i18n.gettext('OK')).click(function() { this.close(dialog); prm.resolve('ok'); @@ -3209,14 +3213,16 @@ dialog.footer.empty(); jQuery('', { 'class': 'btn btn-link', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("No"), }).text(Sao.i18n.gettext('No')).click(function() { this.close(dialog); prm.reject(); }.bind(this)).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Yes"), }).text(Sao.i18n.gettext('Yes')).click(function() { this.close(dialog); if (always.prop('checked')) { @@ -3256,14 +3262,16 @@ this, message); jQuery('', { 'class': 'btn btn-link', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Cancel"), }).text(Sao.i18n.gettext('Cancel')).click(function() { this.close(dialog); prm.reject(); }.bind(this)).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("OK"), }).text(Sao.i18n.gettext('OK')).click(function() { this.close(dialog); prm.resolve(); @@ -3279,21 +3287,24 @@ this, message); jQuery('', { 'class': 'btn btn-link', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Cancel"), }).text(Sao.i18n.gettext('Cancel')).click(function() { this.close(dialog); prm.resolve('cancel'); }.bind(this)).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-default', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("No"), }).text(Sao.i18n.gettext('No')).click(function() { this.close(dialog); prm.resolve('ko'); }.bind(this)).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Yes"), }).text(Sao.i18n.gettext('Yes')).click(function() { this.close(dialog); prm.resolve('ok'); @@ -3327,14 +3338,16 @@ }).text(question)).append(entry)); jQuery('', { 'class': 'btn btn-link', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Cancel"), }).text(Sao.i18n.gettext('Cancel')).click(function() { this.close(dialog); prm.reject(); }.bind(this)).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("OK"), }).text(Sao.i18n.gettext('OK')).click(function() { this.close(dialog); prm.resolve(entry.val()); @@ -3376,14 +3389,16 @@ ); jQuery('', { 'class': 'btn btn-link', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Cancel"), }).text(Sao.i18n.gettext('Cancel')).click(function() { this.close(dialog); prm.reject(); }.bind(this)).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-default', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Compare"), }).text(Sao.i18n.gettext('Compare')).click(function() { this.close(dialog); Sao.rpc({ @@ -3404,7 +3419,8 @@ }.bind(this)).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-default', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Write Anyway"), }).text(Sao.i18n.gettext('Write Anyway')).click(function() { this.close(dialog); prm.resolve(); @@ -3442,7 +3458,8 @@ }).text(Sao.i18n.gettext('Report Bug'))))); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Close"), }).text(Sao.i18n.gettext('Close')).click(function() { this.close(dialog); prm.resolve(); @@ -3849,7 +3866,8 @@ .click(close); var button = jQuery('', { 'class': 'btn btn-default', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Close"), }).text(Sao.i18n.gettext('Close')).click(close) .appendTo(dialog.footer); dialog.modal.on('shown.bs.modal', function() { @@ -4035,7 +4053,8 @@ var properties = buttons[i]; var button = jQuery('', { 'class': 'btn btn-default', - 'type': 'button' + 'type': 'button', + 'title': properties.label, }).append(Sao.common.ICONFACTORY.get_icon_img( 'tryton-format-' + properties.icon) ).appendTo(group); @@ -4046,13 +4065,16 @@ add_buttons([ { 'icon': 'bold', - 'command': 'bold' + 'command': 'bold', + 'label': Sao.i18n.gettext("Bold"), }, { 'icon': 'italic', - 'command': 'italic' + 'command': 'italic', + 'label': Sao.i18n.gettext("Italic"), }, { 'icon': 'underline', - 'command': 'underline' + 'command': 'underline', + 'label': Sao.i18n.gettext("Underline"), }]); var selections = [ @@ -4101,15 +4123,23 @@ { 'icon': 'align-left', 'command': Sao.i18n.rtl? 'justifyRight' : 'justifyLeft', + 'label': (Sao.i18n.rtl? + Sao.i18n.gettext("Justify Right") : + Sao.i18n.gettext("Justify Left")), }, { 'icon': 'align-center', - 'command': 'justifyCenter' + 'command': 'justifyCenter', + 'label': Sao.i18n.gettext("Justify Center"), }, { 'icon': 'align-right', 'command': Sao.i18n.rtl? 'justifyLeft': 'justifyRight', + 'label': (Sao.i18n.rtl? + Sao.i18n.gettext("Justify Left") : + Sao.i18n.gettext("Justify Right")), }, { 'icon': 'align-justify', - 'command': 'justifyFull' + 'command': 'justifyFull', + 'label': Sao.i18n.gettext("Justify Full"), }]); // TODO backColor diff --git a/src/sao.less b/src/sao.less index 663b174258..ee7130d4b7 100644 --- a/src/sao.less +++ b/src/sao.less @@ -42,6 +42,10 @@ html[theme="default"] { } } +button { + overflow-y: hidden; + text-overflow: ellipsis; +} .navbar-inverse { .close { diff --git a/src/screen.js b/src/screen.js index 691284a5a0..bbe9e0e634 100644 --- a/src/screen.js +++ b/src/screen.js @@ -29,7 +29,8 @@ this.el.append(this.filter_box); this.filter_button = jQuery('', { type: 'button', - 'class': 'btn btn-link' + 'class': 'btn btn-link', + 'title': Sao.i18n.gettext("Filters"), }).text(Sao.i18n.gettext('Filters')); this.filter_button.click(this.search_box.bind(this)); this.search_entry = jQuery('', { @@ -558,7 +559,8 @@ jQuery('', { 'class': 'btn btn-primary', - type: 'submit' + type: 'submit', + 'title': Sao.i18n.gettext("Find"), }).text(Sao.i18n.gettext('Find')) .click(search).appendTo(dialog.footer); } diff --git a/src/session.js b/src/session.js index 0fbc6ddc6b..1e6431a15e 100644 --- a/src/session.js +++ b/src/session.js @@ -205,7 +205,8 @@ ); dialog.button = jQuery('', { 'class': 'btn btn-primary', - 'type': 'submit' + 'type': 'submit', + 'title': Sao.i18n.gettext("Login"), }).text(' ' + Sao.i18n.gettext("Login")).appendTo(dialog.footer); return dialog; }; diff --git a/src/tab.js b/src/tab.js index 195b39f4e8..713effdeed 100644 --- a/src/tab.js +++ b/src/tab.js @@ -192,7 +192,8 @@ })).append(jQuery('', { 'type': 'button', 'class': 'close visible-xs', - 'aria-label': Sao.i18n.gettext('Close') + 'aria-label': Sao.i18n.gettext("Close"), + 'title': Sao.i18n.gettext("Close"), }).append(jQuery('', { 'aria-hidden': true }).append('×')).click(function() { @@ -399,12 +400,12 @@ Sao.set_url(tab.get_url(), tab.name.split(' / ').pop()); }) .append(jQuery('', { - 'class': 'close' + 'class': 'close', + 'aria-label': Sao.i18n.gettext("Close"), + 'title': Sao.i18n.gettext("Close"), }).append(jQuery('', { 'aria-hidden': true - }).append('×')).append(jQuery('', { - 'class': 'sr-only' - }).text(Sao.i18n.gettext('Close'))).click(function(evt) { + }).append('×')).click(function(evt) { evt.preventDefault(); tab.close(); })) diff --git a/src/view/form.js b/src/view/form.js index f5e4240c7a..e7af3f47d0 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -996,6 +996,7 @@ function eval_pyson(value){ 'params': [this.action_id, context], }, Sao.Session.current_session, false); this.label.text(action.name); + this.el.attr('title', action.name); var decoder = new Sao.PYSON.Decoder(pyson_ctx); var domain = decoder.decode(action.pyson_domain); @@ -1282,13 +1283,15 @@ function eval_pyson(value){ this.read(widget, dialog); jQuery('', { 'class': 'btn btn-link', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("Cancel"), }).text(Sao.i18n.gettext('Cancel')).click(function() { this.close(dialog); }.bind(this)).appendTo(dialog.footer); jQuery('', { 'class': 'btn btn-primary', - 'type': 'button' + 'type': 'button', + 'title': Sao.i18n.gettext("OK"), }).text(Sao.i18n.gettext('OK')).click(this.write .bind(this, widget, dialog)) .appendTo(dialog.footer); @@ -1617,8 +1620,10 @@ function eval_pyson(value){ _set_password_label: function() { if (this.input.prop('type') == 'password') { this.button.text(Sao.i18n.gettext('Show')); + this.button.attr('title', Sao.i18n.gettext("Show")); } else { this.button.text(Sao.i18n.gettext('Hide')); + this.button.attr('title', Sao.i18n.gettext("Hide")); } } }); @@ -2193,7 +2198,8 @@ function eval_pyson(value){ var button = jQuery('', { 'class': 'btn btn-default btn-sm form-control', 'type': 'button', - 'aria-label': Sao.i18n.gettext('Translate') + 'aria-label': Sao.i18n.gettext('Translate'), + 'title': Sao.i18n.gettext("Translate"), }).appendTo(jQuery('', { 'class': 'input-group-btn' }).appendTo(this.el)); @@ -2271,6 +2277,7 @@ function eval_pyson(value){ 'class': 'btn btn-default btn-sm form-control', 'type': 'button', 'aria-label': Sao.i18n.gettext("Translate"), + 'title': Sao.i18n.gettext("Translate"), }).appendTo(jQuery('', { 'class': 'input-group-btn', }).appendTo(this.el)); @@ -4114,7 +4121,9 @@ function eval_pyson(value){ this.but_open = jQuery('', { 'class': 'btn btn-default', - 'type': 'button' + 'type': 'button', + 'aria-label': Sao.i18n.gettext("Open..."), + 'title': Sao.i18n.gettext("Open..."), }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-open') ).appendTo(jQuery('', { 'class': 'input-group-btn', @@ -4478,6 +4487,7 @@ function eval_pyson(value){ 'class': 'btn btn-default btn-sm', 'type': 'button', 'aria-label': Sao.i18n.gettext('Translate'), + 'title': Sao.i18n.gettext("Translate"), }).appendTo(this.el); button.append( Sao.common.ICONFACTORY.get_icon_img('tryton-translate')); @@ -4618,7 +4628,8 @@ function eval_pyson(value){ this.but_add = jQuery('', { 'class': 'btn btn-default btn-sm', 'type': 'button', - 'aria-label': Sao.i18n.gettext('Add') + 'aria-label': Sao.i18n.gettext("Add"), + 'title': Sao.i18n.gettext("Add"), }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-add') ).appendTo(jQuery('
', { 'class': 'input-group-btn' @@ -4908,7 +4919,8 @@ function eval_pyson(value){ this.button = jQuery('', { 'class': 'btn btn-default', 'type': 'button', - 'arial-label': Sao.i18n.gettext('Remove') + 'arial-label': Sao.i18n.gettext("Remove"), + 'title': Sao.i18n.gettext("Remove"), }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-remove') ).appendTo(jQuery('', { 'class': 'input-group-btn' diff --git a/src/view/tree.js b/src/view/tree.js index 64b5e9dc9f..12289386fe 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -822,7 +822,8 @@ var more_cell = jQuery('