diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 2efcf0de6..d0a9b4c2c 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -201,7 +201,7 @@ define([ if (typeof value == 'object') { _.each(value, function(obj) { if (typeof obj === 'string') - changetext += (' ' + obj); + changetext += (' ' + Common.Utils.String.htmlEncode(obj)); else { switch (obj) { case 0: @@ -220,7 +220,7 @@ define([ } }) } else if (typeof value === 'string') { - changetext += (' ' + value); + changetext += (' ' + Common.Utils.String.htmlEncode(value)); } break; case Asc.c_oAscRevisionsChangeType.TextRem: @@ -228,7 +228,7 @@ define([ if (typeof value == 'object') { _.each(value, function(obj) { if (typeof obj === 'string') - changetext += (' ' + obj); + changetext += (' ' + Common.Utils.String.htmlEncode(obj)); else { switch (obj) { case 0: @@ -247,7 +247,7 @@ define([ } }) } else if (typeof value === 'string') { - changetext += (' ' + value); + changetext += (' ' + Common.Utils.String.htmlEncode(value)); } break; case Asc.c_oAscRevisionsChangeType.ParaAdd: diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index a3cdb84de..5aedde16e 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -104,15 +104,21 @@ define([ this.$window.find('.tool').hide(); this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); if (this.type == Asc.c_oAscAdvancedOptionsID.DRM) { - var me = this; - me.inputPwd = new Common.UI.InputField({ + this.inputPwd = new Common.UI.InputField({ el: $('#id-password-txt'), type: 'password', allowBlank: false, validateOnBlur: false }); - } else + this.$window.find('input').on('keypress', _.bind(this.onKeyPress, this)); + } else { + var me = this; this.initCodePages(); + this.onPrimary = function() { + me.onBtnClick(); + return false; + }; + } } }, @@ -138,9 +144,9 @@ define([ this.close(); }, - onPrimary: function() { - this.onBtnClick(); - return false; + onKeyPress: function(event) { + if (event.keyCode == Common.UI.Keys.RETURN) + this.onBtnClick(); }, initCodePages: function () {