diff --git a/apps/common/main/lib/view/AutoCorrectDialog.js b/apps/common/main/lib/view/AutoCorrectDialog.js
index d2ef90c61..ba49b37a0 100644
--- a/apps/common/main/lib/view/AutoCorrectDialog.js
+++ b/apps/common/main/lib/view/AutoCorrectDialog.js
@@ -62,13 +62,25 @@ define([
'
',
'
',
'',
- '',
- '',
+ ' | ',
+ '',
' | ',
'
',
'',
'',
- '',
+ '',
+ '',
+ ' | ',
+ '
',
+ '',
+ '',
+ '',
+ '',
+ ' | ',
+ '
',
+ '',
+ '',
+ '',
' | ',
'
',
'
',
@@ -89,6 +101,7 @@ define([
Common.UI.Window.prototype.render.call(this);
var $window = this.getChild();
+ var me = this;
// special
this.mathList = new Common.UI.ListView({
@@ -104,9 +117,57 @@ define([
].join('')),
scrollAlwaysVisible: true
});
+ this.mathList.on('item:select', _.bind(this.onSelectMathItem, this));
+
+ this.inputReplace = new Common.UI.InputField({
+ el : $window.find('#auto-correct-replace'),
+ allowBlank : true,
+ validateOnChange : true,
+ validation : function () { return true; }
+ }).on ('changing', function (input, value) {
+ if (value.length) {
+ var store = me.mathList.store;
+ var _selectedItem = store.find(function(item) {
+ if ( item.get('replaced').indexOf(value) == 0) {
+ return true;
+ }
+ });
+ if (_selectedItem) {
+ me.mathList.selectRecord(_selectedItem, true);
+ me.mathList.scrollToRecord(_selectedItem);
+ } else {
+ me.mathList.deselectAll();
+ }
+ } else {
+ me.mathList.deselectAll();
+ }
+ });
+
+ this.inputBy = new Common.UI.InputField({
+ el : $window.find('#auto-correct-by'),
+ allowBlank : true,
+ validateOnChange : true,
+ validation : function () { return true; }
+ });
+ // this.inputBy.cmpEl.find('input').css('font-size', '13px');
+
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
+ onSelectMathItem: function(lisvView, itemView, record) {
+ this.inputReplace.setValue(record.get('replaced'));
+ this.inputBy.setValue(record.get('by'));
+ },
+
+ show: function() {
+ Common.UI.Window.prototype.show.apply(this, arguments);
+
+ var me = this;
+ _.delay(function(){
+ $('input', me.inputReplace.cmpEl).select().focus();
+ },100);
+ },
+
onBtnClick: function(event) {
this.close();
},
@@ -116,7 +177,9 @@ define([
},
textTitle: 'AutoCorrect',
- textMathCorrect: 'Math AutoCorrect'
+ textMathCorrect: 'Math AutoCorrect',
+ textReplace: 'Replace:',
+ textBy: 'By:'
}, Common.Views.AutoCorrectDialog || {}))
});
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index d871d544c..79b088a3a 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -159,6 +159,8 @@
"Common.Views.About.txtVersion": "Version ",
"Common.Views.AutoCorrectDialog.textTitle": "AutoCorrect",
"Common.Views.AutoCorrectDialog.textMathCorrect": "Math AutoCorrect",
+ "Common.Views.AutoCorrectDialog.textReplace": "Replace:",
+ "Common.Views.AutoCorrectDialog.textBy": "By:",
"Common.Views.Chat.textSend": "Send",
"Common.Views.Comments.textAdd": "Add",
"Common.Views.Comments.textAddComment": "Add Comment",
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index fd52cf811..6ae930552 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -60,6 +60,8 @@
"Common.Views.About.txtVersion": "Version ",
"Common.Views.AutoCorrectDialog.textTitle": "AutoCorrect",
"Common.Views.AutoCorrectDialog.textMathCorrect": "Math AutoCorrect",
+ "Common.Views.AutoCorrectDialog.textReplace": "Replace:",
+ "Common.Views.AutoCorrectDialog.textBy": "By:",
"Common.Views.Chat.textSend": "Send",
"Common.Views.Comments.textAdd": "Add",
"Common.Views.Comments.textAddComment": "Add Comment",
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index 7d7a4d017..d21b9534b 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -61,6 +61,8 @@
"Common.Views.About.txtVersion": "Version ",
"Common.Views.AutoCorrectDialog.textTitle": "AutoCorrect",
"Common.Views.AutoCorrectDialog.textMathCorrect": "Math AutoCorrect",
+ "Common.Views.AutoCorrectDialog.textReplace": "Replace:",
+ "Common.Views.AutoCorrectDialog.textBy": "By:",
"Common.Views.Chat.textSend": "Send",
"Common.Views.Comments.textAdd": "Add",
"Common.Views.Comments.textAddComment": "Add Comment",