[DE PE] Make new search: add Whole words only, change get/put methods in controllers
This commit is contained in:
parent
37b0fd88d3
commit
e77f9db33d
|
@ -128,6 +128,15 @@ define([
|
||||||
dataHintOffset: 'small'
|
dataHintOffset: 'small'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.chMatchWord = new Common.UI.CheckBox({
|
||||||
|
el: $('#search-adv-match-word'),
|
||||||
|
labelText: window.SSE ? this.textItemEntireCell : this.textWholeWords,
|
||||||
|
value: false,
|
||||||
|
dataHint: '1',
|
||||||
|
dataHintDirection: 'left',
|
||||||
|
dataHintOffset: 'small'
|
||||||
|
});
|
||||||
|
|
||||||
this.buttonClose = new Common.UI.Button({
|
this.buttonClose = new Common.UI.Button({
|
||||||
parentEl: $('#search-btn-close', this.$el),
|
parentEl: $('#search-btn-close', this.$el),
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
|
@ -137,15 +146,6 @@ define([
|
||||||
this.buttonClose.on('click', _.bind(this.onClickClosePanel, this));
|
this.buttonClose.on('click', _.bind(this.onClickClosePanel, this));
|
||||||
|
|
||||||
if (window.SSE) {
|
if (window.SSE) {
|
||||||
this.chMatchWord = new Common.UI.CheckBox({
|
|
||||||
el: $('#search-adv-match-word'),
|
|
||||||
labelText: this.options.matchwordstr || this.textWholeWords,
|
|
||||||
value: false,
|
|
||||||
dataHint: '1',
|
|
||||||
dataHintDirection: 'left',
|
|
||||||
dataHintOffset: 'small'
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cmbWithin = new Common.UI.ComboBox({
|
this.cmbWithin = new Common.UI.ComboBox({
|
||||||
el: $('#search-adv-cmb-within'),
|
el: $('#search-adv-cmb-within'),
|
||||||
menuStyle: 'min-width: 100%;',
|
menuStyle: 'min-width: 100%;',
|
||||||
|
@ -303,7 +303,8 @@ define([
|
||||||
textValues: 'Values',
|
textValues: 'Values',
|
||||||
textSearchOptions: 'Search options',
|
textSearchOptions: 'Search options',
|
||||||
textNoMatches: 'No matches',
|
textNoMatches: 'No matches',
|
||||||
textNoSearchResults: 'No search results'
|
textNoSearchResults: 'No search results',
|
||||||
|
textItemEntireCell: 'Entire cell contents'
|
||||||
|
|
||||||
}, Common.Views.SearchPanel || {}));
|
}, Common.Views.SearchPanel || {}));
|
||||||
});
|
});
|
|
@ -89,7 +89,11 @@ define([
|
||||||
|
|
||||||
onQuerySearch: function (d, w, opts) {
|
onQuerySearch: function (d, w, opts) {
|
||||||
if (opts.textsearch && opts.textsearch.length) {
|
if (opts.textsearch && opts.textsearch.length) {
|
||||||
if (!this.api.asc_findText(opts.textsearch, d != 'back', opts.matchcase)) {
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
|
searchSettings.put_Text(opts.textsearch);
|
||||||
|
searchSettings.put_MatchCase(opts.matchcase);
|
||||||
|
searchSettings.put_WholeWords(opts.matchword);
|
||||||
|
if (!this.api.asc_findText(searchSettings, d != 'back')) {
|
||||||
var me = this;
|
var me = this;
|
||||||
me.view.updateResultsNumber(undefined, 0);
|
me.view.updateResultsNumber(undefined, 0);
|
||||||
Common.UI.info({
|
Common.UI.info({
|
||||||
|
@ -104,7 +108,11 @@ define([
|
||||||
|
|
||||||
onQueryReplace: function(w, opts) {
|
onQueryReplace: function(w, opts) {
|
||||||
if (!_.isEmpty(opts.textsearch)) {
|
if (!_.isEmpty(opts.textsearch)) {
|
||||||
if (!this.api.asc_replaceText(opts.textsearch, opts.textreplace, false, opts.matchcase)) {
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
|
searchSettings.put_Text(opts.textsearch);
|
||||||
|
searchSettings.put_MatchCase(opts.matchcase);
|
||||||
|
searchSettings.put_WholeWords(opts.matchword);
|
||||||
|
if (!this.api.asc_replaceText(searchSettings, opts.textreplace, false)) {
|
||||||
var me = this;
|
var me = this;
|
||||||
me.view.updateResultsNumber(undefined, 0);
|
me.view.updateResultsNumber(undefined, 0);
|
||||||
Common.UI.info({
|
Common.UI.info({
|
||||||
|
@ -119,7 +127,11 @@ define([
|
||||||
|
|
||||||
onQueryReplaceAll: function(w, opts) {
|
onQueryReplaceAll: function(w, opts) {
|
||||||
if (!_.isEmpty(opts.textsearch)) {
|
if (!_.isEmpty(opts.textsearch)) {
|
||||||
this.api.asc_replaceText(opts.textsearch, opts.textreplace, true, opts.matchcase, opts.matchword);
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
|
searchSettings.put_Text(opts.textsearch);
|
||||||
|
searchSettings.put_MatchCase(opts.matchcase);
|
||||||
|
searchSettings.put_WholeWords(opts.matchword);
|
||||||
|
this.api.asc_replaceText(searchSettings, opts.textreplace, true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,11 @@ define([
|
||||||
|
|
||||||
onQuerySearch: function (d, w, opts) {
|
onQuerySearch: function (d, w, opts) {
|
||||||
if (opts.textsearch && opts.textsearch.length) {
|
if (opts.textsearch && opts.textsearch.length) {
|
||||||
if (!this.api.asc_findText(opts.textsearch, d != 'back', opts.matchcase)) {
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
|
searchSettings.put_Text(opts.textsearch);
|
||||||
|
searchSettings.put_MatchCase(opts.matchcase);
|
||||||
|
searchSettings.put_WholeWords(opts.matchword);
|
||||||
|
if (!this.api.asc_findText(searchSettings, d != 'back')) {
|
||||||
var me = this;
|
var me = this;
|
||||||
me.view.updateResultsNumber(undefined, 0);
|
me.view.updateResultsNumber(undefined, 0);
|
||||||
Common.UI.info({
|
Common.UI.info({
|
||||||
|
@ -104,7 +108,11 @@ define([
|
||||||
|
|
||||||
onQueryReplace: function(w, opts) {
|
onQueryReplace: function(w, opts) {
|
||||||
if (!_.isEmpty(opts.textsearch)) {
|
if (!_.isEmpty(opts.textsearch)) {
|
||||||
if (!this.api.asc_replaceText(opts.textsearch, opts.textreplace, false, opts.matchcase)) {
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
|
searchSettings.put_Text(opts.textsearch);
|
||||||
|
searchSettings.put_MatchCase(opts.matchcase);
|
||||||
|
searchSettings.put_WholeWords(opts.matchword);
|
||||||
|
if (!this.api.asc_replaceText(searchSettings, opts.textreplace, false)) {
|
||||||
var me = this;
|
var me = this;
|
||||||
me.view.updateResultsNumber(undefined, 0);
|
me.view.updateResultsNumber(undefined, 0);
|
||||||
Common.UI.info({
|
Common.UI.info({
|
||||||
|
@ -119,7 +127,11 @@ define([
|
||||||
|
|
||||||
onQueryReplaceAll: function(w, opts) {
|
onQueryReplaceAll: function(w, opts) {
|
||||||
if (!_.isEmpty(opts.textsearch)) {
|
if (!_.isEmpty(opts.textsearch)) {
|
||||||
this.api.asc_replaceText(opts.textsearch, opts.textreplace, true, opts.matchcase);
|
var searchSettings = new AscCommon.CSearchSettings();
|
||||||
|
searchSettings.put_Text(opts.textsearch);
|
||||||
|
searchSettings.put_MatchCase(opts.matchcase);
|
||||||
|
searchSettings.put_WholeWords(opts.matchword);
|
||||||
|
this.api.asc_replaceText(searchSettings, opts.textreplace, true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue