From ce7fb5bb37b969528d8cc24d5493163b492361a3 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 27 Jun 2012 16:12:49 +0200 Subject: [CHG] Ashes to ashes, dashes to underscores. bzr revid: fme@openerp.com-20120627141249-o10e2htxqtio72l7 --- addons/web/static/src/js/view_form.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'addons/web/static/src/js/view_form.js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 652ad74c012..bd223cefd78 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2564,8 +2564,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc fade: true, }); - this.$drop_down = this.$element.find(".oe-m2o-drop-down-button"); - this.$follow_button = $(".oe-m2o-cm-button", this.$element); + this.$drop_down = this.$element.find(".oe_m2o_drop_down_button"); + this.$follow_button = $(".oe_m2o_cm_button", this.$element); this.$follow_button.click(function() { if (!self.get('value')) { @@ -3251,8 +3251,8 @@ instance.web.form.One2ManyList = instance.web.ListView.List.extend({ return this._super.apply(this, arguments).then(function () { // Replace the "Save Row" button with "Cancel Edition" self.edition_form.$element - .undelegate('button.oe-edit-row-save', 'click') - .delegate('button.oe-edit-row-save', 'click', function () { + .undelegate('button.oe_list_edit_row_save', 'click') + .delegate('button.oe_list_edit_row_save', 'click', function () { self.cancel_pending_edition(); }); @@ -3852,7 +3852,7 @@ instance.web.form.AbstractFormPopup = instance.web.OldWidget.extend({ if (this.options.alternative_form_view) { this.view_form.set_embedded_view(this.options.alternative_form_view); } - this.view_form.appendTo(this.$element.find(".oe-form-view-popup-form-placeholder")); + this.view_form.appendTo(this.$element.find(".oe_popup_form")); this.view_form.on_loaded.add_last(function() { var $buttons = self.view_form.$element.find(".oe_form_buttons"); var multi_select = self.row_id === null && ! self.options.disable_multiple_selection; @@ -3983,7 +3983,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend 'read_only': true, }, self.options.list_view_options || {})); self.view_list.popup = self; - self.view_list.appendTo($(".oe-select-create-popup-view-list", self.$element)).pipe(function() { + self.view_list.appendTo($(".oe_popup_list", self.$element)).pipe(function() { self.view_list.do_show(); }).pipe(function() { self.searchview.do_search(); @@ -4005,7 +4005,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend }); }); }); - this.searchview.appendTo($(".oe-select-create-popup-view-list", self.$element)); + this.searchview.appendTo($(".oe_popup_list", self.$element)); }, do_search: function(domains, contexts, groupbys) { var self = this; @@ -4167,9 +4167,9 @@ instance.web.form.FieldBinary = instance.web.form.AbstractField.extend(instance. this._super.apply(this, arguments); }, initialize_content: function() { - this.$element.find('input.oe-binary-file').change(this.on_file_change); - this.$element.find('button.oe_binary_file_save').click(this.on_save_as); - this.$element.find('.oe-binary-file-clear').click(this.on_clear); + this.$element.find('input.oe_form_binary_file').change(this.on_file_change); + this.$element.find('button.oe_form_binary_file_save').click(this.on_save_as); + this.$element.find('.oe_form_binary_file_clear').click(this.on_clear); }, human_filesize : function(size) { var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; @@ -4186,10 +4186,10 @@ instance.web.form.FieldBinary = instance.web.form.AbstractField.extend(instance. // http://deepliquid.com/projects/Jcrop/demos.php?demo=handler if ($(e.target).val() !== '') { - this.$element.find('form.oe-binary-form input[name=session_id]').val(this.session.session_id); - this.$element.find('form.oe-binary-form').submit(); - this.$element.find('.oe-binary-progress').show(); - this.$element.find('.oe-binary').hide(); + this.$element.find('form.oe_form_binary_form input[name=session_id]').val(this.session.session_id); + this.$element.find('form.oe_form_binary_form').submit(); + this.$element.find('.oe_form_binary_progress').show(); + this.$element.find('.oe_form_binary').hide(); } }, on_file_uploaded: function(size, name, content_type, file_base64) { @@ -4201,8 +4201,8 @@ instance.web.form.FieldBinary = instance.web.form.AbstractField.extend(instance. this.filename = name; this.on_file_uploaded_and_valid.apply(this, arguments); } - this.$element.find('.oe-binary-progress').hide(); - this.$element.find('.oe-binary').show(); + this.$element.find('.oe_form_binary_progress').hide(); + this.$element.find('.oe_form_binary').show(); }, on_file_uploaded_and_valid: function(size, name, content_type, file_base64) { }, @@ -4212,7 +4212,7 @@ instance.web.form.FieldBinary = instance.web.form.AbstractField.extend(instance. this.do_warn(_t("Save As..."), _t("The field is empty, there's nothing to save !")); ev.stopPropagation(); } else if (this._dirty_flag) { - var link = this.$('.oe_binary_file_save_data')[0]; + var link = this.$('.oe_form_binary_file_save_data')[0]; link.download = this.filename || "download.bin"; // Works on only on Google Chrome //link.target = '_blank'; link.href = "data:application/octet-stream;base64," + value; -- cgit v1.2.3 From 3f59bab1fc6c9e50d77ddb21146f44dd6283d104 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 27 Jun 2012 17:17:59 +0200 Subject: [FIX] problem with float_time bzr revid: nicolas.vanhoren@openerp.com-20120627151759-5hewg29y0cbo6221 --- addons/web/static/src/js/view_form.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/view_form.js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index bd223cefd78..5348550a7e0 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1790,8 +1790,9 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w this._super(field_manager, node); this.field_manager = field_manager; this.name = this.node.attrs.name; - this.set({'value': false}); this.field = this.field_manager.get_field(this.name); + this.widget = this.node.attrs.widget; + this.set({'value': false}); this.set({required: this.modifiers['required'] === true}); // some events to make the property "effective_readonly" sync automatically with "readonly" and -- cgit v1.2.3 From ec92d42e321d07003bd530f6afd165630b769b35 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 27 Jun 2012 17:29:22 +0200 Subject: [FIX] email and url display 'false' bzr revid: nicolas.vanhoren@openerp.com-20120627152922-x1wp96wcu0zbdqyk --- addons/web/static/src/js/view_form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/view_form.js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 5348550a7e0..1941e48affd 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2003,7 +2003,7 @@ instance.web.form.FieldEmail = instance.web.form.FieldChar.extend({ } else { this.$element.find('a') .attr('href', 'mailto:' + this.get('value')) - .text(this.get('value')); + .text(this.get('value') || ''); } }, on_button_clicked: function() { @@ -2032,7 +2032,7 @@ instance.web.form.FieldUrl = instance.web.form.FieldChar.extend({ if (!s) { tmp = "http://" + this.get('value'); } - this.$element.find('a').attr('href', tmp).text(tmp); + this.$element.find('a').attr('href', tmp).text(this.get('value') ? tmp : ''); } }, on_button_clicked: function() { -- cgit v1.2.3 From 06c9e2eb71ba208509ccc2a0a827cbdbd33e5d04 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 28 Jun 2012 12:11:00 +0200 Subject: [IMP] added doc bzr revid: nicolas.vanhoren@openerp.com-20120628101100-27kqrho2ez2xudrm --- addons/web/static/src/js/view_form.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/view_form.js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 1941e48affd..7622d9a0b1f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1513,7 +1513,9 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi this._super.apply(this, arguments); }, /** - * Sets up blur/focus forwarding from DOM elements to a widget (`this`) + * Sets up blur/focus forwarding from DOM elements to a widget (`this`). + * + * This method is an utility method that is meant to be called by child classes. * * @param {jQuery} $e jQuery object of elements to bind focus/blur on */ -- cgit v1.2.3 From 492af8bef457c63e93a952a75a9ba7bae647dc01 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 28 Jun 2012 14:17:45 +0200 Subject: [IMP] support multiple lines in m2o bzr revid: nicolas.vanhoren@openerp.com-20120628121745-9k3r7zfy5edgnivm --- addons/web/static/src/js/view_form.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/view_form.js') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 7622d9a0b1f..9315e08871a 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2722,9 +2722,10 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc if (!this.get("effective_readonly")) { this.$input.val(str); } else { + str = _.escape(str).replace("\n", "
"); this.$element.find('a') .unbind('click') - .text(str) + .html(str) .click(function () { self.do_action({ type: 'ir.actions.act_window', -- cgit v1.2.3