[PE] Add text replacement

This commit is contained in:
Julia Radzhabova 2018-12-05 19:45:21 +03:00
parent d16c421113
commit 40d8352177
20 changed files with 72 additions and 41 deletions

View file

@ -98,7 +98,9 @@ define([
'SearchDialog': {
'hide': _.bind(this.onSearchDlgHide, this),
'search:back': _.bind(this.onQuerySearch, this, 'back'),
'search:next': _.bind(this.onQuerySearch, this, 'next')
'search:next': _.bind(this.onQuerySearch, this, 'next'),
'search:replace': _.bind(this.onQueryReplace, this),
'search:replaceall': _.bind(this.onQueryReplaceAll, this)
},
'Common.Views.ReviewChanges': {
'collaboration:chat': _.bind(this.onShowHideChat, this)
@ -117,6 +119,7 @@ define([
shortcuts: {
'command+shift+s,ctrl+shift+s': _.bind(this.onShortcut, this, 'save'),
'command+f,ctrl+f': _.bind(this.onShortcut, this, 'search'),
'ctrl+h': _.bind(this.onShortcut, this, 'replace'),
'alt+f': _.bind(this.onShortcut, this, 'file'),
'esc': _.bind(this.onShortcut, this, 'escape'),
/** coauthoring begin **/
@ -375,7 +378,7 @@ define([
onQuerySearch: function(d, w, opts) {
if (opts.textsearch && opts.textsearch.length) {
if (!this.api.findText(opts.textsearch, d != 'back')) {
if (!this.api.findText(opts.textsearch, d != 'back', opts.matchcase)) {
var me = this;
Common.UI.info({
msg: this.textNoTextFound,
@ -387,14 +390,41 @@ define([
}
},
showSearchDlg: function(show) {
onQueryReplace: function(w, opts) {
if (!_.isEmpty(opts.textsearch)) {
if (!this.api.asc_replaceText(opts.textsearch, opts.textreplace, false, opts.matchcase)) {
var me = this;
Common.UI.info({
msg: this.textNoTextFound,
callback: function() {
me.dlgSearch.focus();
}
});
}
}
},
onQueryReplaceAll: function(w, opts) {
if (!_.isEmpty(opts.textsearch)) {
this.api.asc_replaceText(opts.textsearch, opts.textreplace, true, opts.matchcase);
}
},
showSearchDlg: function(show,action) {
if ( !this.dlgSearch ) {
this.dlgSearch = (new Common.UI.SearchDialog({}));
this.dlgSearch = (new Common.UI.SearchDialog({
matchcase: true
}));
}
if (show) {
this.dlgSearch.isVisible() ? this.dlgSearch.focus() :
this.dlgSearch.show('no-replace');
var mode = this.mode.isEdit ? (action || undefined) : 'no-replace';
if (this.dlgSearch.isVisible()) {
this.dlgSearch.setMode(mode);
this.dlgSearch.focus();
} else {
this.dlgSearch.show(mode);
}
} else this.dlgSearch['hide']();
},
@ -515,11 +545,12 @@ define([
var previewPanel = PE.getController('Viewport').getView('DocumentPreview');
switch (s) {
case 'replace':
case 'search':
if ((!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) {
Common.UI.Menu.Manager.hideAll();
var full_menu_pressed = this.leftMenu.btnAbout.pressed;
this.showSearchDlg(true);
this.showSearchDlg(true,s);
this.leftMenu.btnSearch.toggle(true,true);
this.leftMenu.btnAbout.toggle(false);
full_menu_pressed && this.menuExpand(this.leftMenu.btnAbout, 'files', false);

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Rozlišovat malá a velká písmena",
"Common.UI.SearchDialog.textReplaceDef": "Zadejte nahrazující text",
"Common.UI.SearchDialog.textSearchStart": "Zde pište text",
"Common.UI.SearchDialog.textTitle": "Hledání",
"Common.UI.SearchDialog.textTitle2": "Hledání",
"Common.UI.SearchDialog.textTitle": "Najít a nahradit",
"Common.UI.SearchDialog.textTitle2": "Najít",
"Common.UI.SearchDialog.textWholeWords": "Pouze celá slova",
"Common.UI.SearchDialog.txtBtnHideReplace": "Skrýt náhradu",
"Common.UI.SearchDialog.txtBtnReplace": "Nahradit",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Groß-/Kleinschreibung beachten",
"Common.UI.SearchDialog.textReplaceDef": "Geben Sie den Ersetzungstext ein",
"Common.UI.SearchDialog.textSearchStart": "Geben Sie den Text hier ein",
"Common.UI.SearchDialog.textTitle": "Suche",
"Common.UI.SearchDialog.textTitle2": "Suche",
"Common.UI.SearchDialog.textTitle": "Suchen und ersetzen",
"Common.UI.SearchDialog.textTitle2": "Suchen",
"Common.UI.SearchDialog.textWholeWords": "Nur ganze Wörter",
"Common.UI.SearchDialog.txtBtnHideReplace": "Ersetzen verbergen",
"Common.UI.SearchDialog.txtBtnReplace": "Ersetzen",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Case sensitive",
"Common.UI.SearchDialog.textReplaceDef": "Enter the replacement text",
"Common.UI.SearchDialog.textSearchStart": "Enter your text here",
"Common.UI.SearchDialog.textTitle": "Search",
"Common.UI.SearchDialog.textTitle2": "Search",
"Common.UI.SearchDialog.textTitle": "Find and Replace",
"Common.UI.SearchDialog.textTitle2": "Find",
"Common.UI.SearchDialog.textWholeWords": "Whole words only",
"Common.UI.SearchDialog.txtBtnHideReplace": "Hide Replace",
"Common.UI.SearchDialog.txtBtnReplace": "Replace",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Sensible a mayúsculas y minúsculas",
"Common.UI.SearchDialog.textReplaceDef": "Introduzca el texto de sustitución",
"Common.UI.SearchDialog.textSearchStart": "Introduzca su texto aquí",
"Common.UI.SearchDialog.textTitle": "Buscar",
"Common.UI.SearchDialog.textTitle2": "Buscar",
"Common.UI.SearchDialog.textTitle": "Encontrar y reemplazar",
"Common.UI.SearchDialog.textTitle2": "Encontrar",
"Common.UI.SearchDialog.textWholeWords": "Sólo palabras completas",
"Common.UI.SearchDialog.txtBtnHideReplace": "Esconder Sustitución",
"Common.UI.SearchDialog.txtBtnReplace": "Reemplazar",

View file

@ -20,7 +20,7 @@
"Common.UI.SearchDialog.textMatchCase": "Сas sensible",
"Common.UI.SearchDialog.textReplaceDef": "Saisissez le texte de remplacement",
"Common.UI.SearchDialog.textSearchStart": "Entrez votre texte ici",
"Common.UI.SearchDialog.textTitle": "Recherche",
"Common.UI.SearchDialog.textTitle": "Rechercher et remplacer",
"Common.UI.SearchDialog.textTitle2": "Rechercher",
"Common.UI.SearchDialog.textWholeWords": "Seulement les mots entiers",
"Common.UI.SearchDialog.txtBtnHideReplace": "Masquer le champ de remplacement",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Sensibile al maiuscolo/minuscolo",
"Common.UI.SearchDialog.textReplaceDef": "Inserisci testo sostitutivo",
"Common.UI.SearchDialog.textSearchStart": "Inserisci il tuo testo qui",
"Common.UI.SearchDialog.textTitle": "Ricerca",
"Common.UI.SearchDialog.textTitle2": "Ricerca",
"Common.UI.SearchDialog.textTitle": "Trova e sostituisci",
"Common.UI.SearchDialog.textTitle2": "Trova",
"Common.UI.SearchDialog.textWholeWords": "Solo parole intere",
"Common.UI.SearchDialog.txtBtnHideReplace": "Nascondi Sostituzione",
"Common.UI.SearchDialog.txtBtnReplace": "Sostituisci",

View file

@ -20,7 +20,7 @@
"Common.UI.SearchDialog.textMatchCase": "大文字と小文字の区別",
"Common.UI.SearchDialog.textReplaceDef": "代替テキストの挿入",
"Common.UI.SearchDialog.textSearchStart": "ここでテキストを挿入してください。",
"Common.UI.SearchDialog.textTitle": "検索",
"Common.UI.SearchDialog.textTitle": "検索と置換",
"Common.UI.SearchDialog.textTitle2": "検索",
"Common.UI.SearchDialog.textWholeWords": "単語全体",
"Common.UI.SearchDialog.txtBtnHideReplace": "変更を表示しない",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "대소 문자를 구분합니다",
"Common.UI.SearchDialog.textReplaceDef": "대체 텍스트 입력",
"Common.UI.SearchDialog.textSearchStart": "여기에 텍스트를 입력하십시오",
"Common.UI.SearchDialog.textTitle": "검색",
"Common.UI.SearchDialog.textTitle2": "검색",
"Common.UI.SearchDialog.textTitle": "찾기 및 바꾸기",
"Common.UI.SearchDialog.textTitle2": "찾기",
"Common.UI.SearchDialog.textWholeWords": "전체 단어 만",
"Common.UI.SearchDialog.txtBtnHideReplace": "바꾸기 숨기기",
"Common.UI.SearchDialog.txtBtnReplace": "Replace",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Case sensitive",
"Common.UI.SearchDialog.textReplaceDef": "Enter the replacement text",
"Common.UI.SearchDialog.textSearchStart": "Enter your text here",
"Common.UI.SearchDialog.textTitle": "Search",
"Common.UI.SearchDialog.textTitle2": "Search",
"Common.UI.SearchDialog.textTitle": "Find and Replace",
"Common.UI.SearchDialog.textTitle2": "Find",
"Common.UI.SearchDialog.textWholeWords": "Whole words only",
"Common.UI.SearchDialog.txtBtnHideReplace": "Nerādīt aizvietošanas lauku",
"Common.UI.SearchDialog.txtBtnReplace": "Replace",

View file

@ -20,7 +20,7 @@
"Common.UI.SearchDialog.textMatchCase": "Hoofdlettergevoelig",
"Common.UI.SearchDialog.textReplaceDef": "Voer de vervangende tekst in",
"Common.UI.SearchDialog.textSearchStart": "Voer hier uw tekst in",
"Common.UI.SearchDialog.textTitle": "Zoeken",
"Common.UI.SearchDialog.textTitle": "Zoeken en vervangen",
"Common.UI.SearchDialog.textTitle2": "Zoeken",
"Common.UI.SearchDialog.textWholeWords": "Alleen hele woorden",
"Common.UI.SearchDialog.txtBtnHideReplace": "Vervanging verbergen",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Rozróżniana wielkość liter",
"Common.UI.SearchDialog.textReplaceDef": "Wprowadź tekst zastępczy",
"Common.UI.SearchDialog.textSearchStart": "Wprowadź tekst tutaj",
"Common.UI.SearchDialog.textTitle": "Wyszukiwanie",
"Common.UI.SearchDialog.textTitle2": "Wyszukiwanie",
"Common.UI.SearchDialog.textTitle": "Znajdź i zamień",
"Common.UI.SearchDialog.textTitle2": "Znajdź",
"Common.UI.SearchDialog.textWholeWords": "Tylko całe słowa",
"Common.UI.SearchDialog.txtBtnHideReplace": "Ukryj Zamień",
"Common.UI.SearchDialog.txtBtnReplace": "Zamienić",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Diferenciar maiúsculas de minúsculas",
"Common.UI.SearchDialog.textReplaceDef": "Inserir o texto de substituição",
"Common.UI.SearchDialog.textSearchStart": "Inserir seu texto aqui",
"Common.UI.SearchDialog.textTitle": "Pesquisar",
"Common.UI.SearchDialog.textTitle2": "Pesquisar",
"Common.UI.SearchDialog.textTitle": "Localizar e substituir",
"Common.UI.SearchDialog.textTitle2": "Localizar",
"Common.UI.SearchDialog.textWholeWords": "Palavras inteiras apenas",
"Common.UI.SearchDialog.txtBtnHideReplace": "Ocultar Substituição",
"Common.UI.SearchDialog.txtBtnReplace": "Substituir",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "С учетом регистра",
"Common.UI.SearchDialog.textReplaceDef": "Введите текст для замены",
"Common.UI.SearchDialog.textSearchStart": "Введите здесь текст",
"Common.UI.SearchDialog.textTitle": "Поиск",
"Common.UI.SearchDialog.textTitle2": "Поиск",
"Common.UI.SearchDialog.textTitle": "Поиск и замена",
"Common.UI.SearchDialog.textTitle2": "Найти",
"Common.UI.SearchDialog.textWholeWords": "Только слово целиком",
"Common.UI.SearchDialog.txtBtnHideReplace": "Скрыть поле замены",
"Common.UI.SearchDialog.txtBtnReplace": "Заменить",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Rozlišovať veľkosť písmen",
"Common.UI.SearchDialog.textReplaceDef": "Zadať náhradný text",
"Common.UI.SearchDialog.textSearchStart": "Zadať svoj text tu",
"Common.UI.SearchDialog.textTitle": "Hľadať",
"Common.UI.SearchDialog.textTitle2": "Hľadať",
"Common.UI.SearchDialog.textTitle": "Nájsť a nahradiť",
"Common.UI.SearchDialog.textTitle2": "Nájsť",
"Common.UI.SearchDialog.textWholeWords": "Len celé slová",
"Common.UI.SearchDialog.txtBtnHideReplace": "Skryť náhradu",
"Common.UI.SearchDialog.txtBtnReplace": "Nahradiť",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Občutljiv na velike in male črke",
"Common.UI.SearchDialog.textReplaceDef": "Vnesi nadomestno besedilo",
"Common.UI.SearchDialog.textSearchStart": "Svoje besedilo vnesite tu",
"Common.UI.SearchDialog.textTitle": "Iskanje",
"Common.UI.SearchDialog.textTitle2": "Iskanje",
"Common.UI.SearchDialog.textTitle": "Najdi in zamenjaj",
"Common.UI.SearchDialog.textTitle2": "Najdi",
"Common.UI.SearchDialog.textWholeWords": "Le cele besede",
"Common.UI.SearchDialog.txtBtnReplace": "Zamenjaj",
"Common.UI.SearchDialog.txtBtnReplaceAll": "Zamenjaj vse",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Büyük küçük harfe duyarlı",
"Common.UI.SearchDialog.textReplaceDef": "Yerine geçecek metini giriniz",
"Common.UI.SearchDialog.textSearchStart": "Metninizi buraya giriniz",
"Common.UI.SearchDialog.textTitle": "Ara",
"Common.UI.SearchDialog.textTitle2": "Ara",
"Common.UI.SearchDialog.textTitle": "Bul ve Değiştir",
"Common.UI.SearchDialog.textTitle2": "Bul",
"Common.UI.SearchDialog.textWholeWords": "Sadece tam kelimeler",
"Common.UI.SearchDialog.txtBtnHideReplace": "Değiştirmeyi Gizle",
"Common.UI.SearchDialog.txtBtnReplace": "Değiştir",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "Чутливість до регістору символів",
"Common.UI.SearchDialog.textReplaceDef": "Введіть текст заміни",
"Common.UI.SearchDialog.textSearchStart": "Введіть свій текст тут",
"Common.UI.SearchDialog.textTitle": "Пошук",
"Common.UI.SearchDialog.textTitle2": "Пошук",
"Common.UI.SearchDialog.textTitle": "Знайти та перемістити",
"Common.UI.SearchDialog.textTitle2": "Знайти",
"Common.UI.SearchDialog.textWholeWords": "Тільки цілі слова",
"Common.UI.SearchDialog.txtBtnHideReplace": "Сховати заміни",
"Common.UI.SearchDialog.txtBtnReplace": "Замінити",

View file

@ -20,7 +20,7 @@
"Common.UI.SearchDialog.textMatchCase": "Phân biệt chữ hoa chữ thường",
"Common.UI.SearchDialog.textReplaceDef": "Nhập văn bản thay thế",
"Common.UI.SearchDialog.textSearchStart": "Nhập từ khóa của bạn ở đây",
"Common.UI.SearchDialog.textTitle": "Tìm kiếm",
"Common.UI.SearchDialog.textTitle": "Tìm và Thay thế",
"Common.UI.SearchDialog.textTitle2": "Tìm kiếm",
"Common.UI.SearchDialog.textWholeWords": "Chỉ toàn bộ từ",
"Common.UI.SearchDialog.txtBtnHideReplace": "Ẩn Thay thế",

View file

@ -20,8 +20,8 @@
"Common.UI.SearchDialog.textMatchCase": "区分大小写",
"Common.UI.SearchDialog.textReplaceDef": "输入替换文字",
"Common.UI.SearchDialog.textSearchStart": "在这里输入你的文字",
"Common.UI.SearchDialog.textTitle": "搜索",
"Common.UI.SearchDialog.textTitle2": "搜索",
"Common.UI.SearchDialog.textTitle": "查找和替换",
"Common.UI.SearchDialog.textTitle2": "发现",
"Common.UI.SearchDialog.textWholeWords": "只有整个字",
"Common.UI.SearchDialog.txtBtnHideReplace": "隐藏替换",
"Common.UI.SearchDialog.txtBtnReplace": "替换",