[SSE] New search: make search options (2)
This commit is contained in:
parent
92e95b1509
commit
2de78cda79
|
@ -115,6 +115,7 @@ define([
|
||||||
this.chCaseSensitive = new Common.UI.CheckBox({
|
this.chCaseSensitive = new Common.UI.CheckBox({
|
||||||
el: $('#search-adv-case-sensitive'),
|
el: $('#search-adv-case-sensitive'),
|
||||||
labelText: this.textCaseSensitive,
|
labelText: this.textCaseSensitive,
|
||||||
|
value: false,
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'left',
|
dataHintDirection: 'left',
|
||||||
dataHintOffset: 'small'
|
dataHintOffset: 'small'
|
||||||
|
@ -131,47 +132,12 @@ define([
|
||||||
this.chMatchWord = new Common.UI.CheckBox({
|
this.chMatchWord = new Common.UI.CheckBox({
|
||||||
el: $('#search-adv-match-word'),
|
el: $('#search-adv-match-word'),
|
||||||
labelText: this.options.matchwordstr || this.textWholeWords,
|
labelText: this.options.matchwordstr || this.textWholeWords,
|
||||||
|
value: false,
|
||||||
dataHint: '1',
|
dataHint: '1',
|
||||||
dataHintDirection: 'left',
|
dataHintDirection: 'left',
|
||||||
dataHintOffset: 'small'
|
dataHintOffset: 'small'
|
||||||
});
|
});
|
||||||
|
|
||||||
this.cmbWithin = new Common.UI.ComboBox({
|
|
||||||
el: $('#search-adv-cmb-within'),
|
|
||||||
menuStyle: 'min-width: 100%;',
|
|
||||||
style: "width: 219px;",
|
|
||||||
editable: false,
|
|
||||||
cls: 'input-group-nr',
|
|
||||||
data: [
|
|
||||||
{ value: 0, displayValue: this.textSheet },
|
|
||||||
{ value: 1, displayValue: this.textWorkbook }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cmbSearch = new Common.UI.ComboBox({
|
|
||||||
el: $('#search-adv-cmb-search'),
|
|
||||||
menuStyle: 'min-width: 100%;',
|
|
||||||
style: "width: 219px;",
|
|
||||||
editable: false,
|
|
||||||
cls: 'input-group-nr',
|
|
||||||
data: [
|
|
||||||
{ value: 0, displayValue: this.textByRows },
|
|
||||||
{ value: 1, displayValue: this.textByColumns }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
this.cmbLookIn = new Common.UI.ComboBox({
|
|
||||||
el: $('#search-adv-cmb-look-in'),
|
|
||||||
menuStyle: 'min-width: 100%;',
|
|
||||||
style: "width: 219px;",
|
|
||||||
editable: false,
|
|
||||||
cls: 'input-group-nr',
|
|
||||||
data: [
|
|
||||||
{ value: 0, displayValue: this.textFormulas },
|
|
||||||
{ value: 1, displayValue: this.textValues }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
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',
|
||||||
|
@ -181,9 +147,54 @@ define([
|
||||||
this.buttonClose.on('click', _.bind(this.onClickClosePanel, this));
|
this.buttonClose.on('click', _.bind(this.onClickClosePanel, this));
|
||||||
|
|
||||||
if (window.SSE) {
|
if (window.SSE) {
|
||||||
|
|
||||||
|
this.cmbWithin = new Common.UI.ComboBox({
|
||||||
|
el: $('#search-adv-cmb-within'),
|
||||||
|
menuStyle: 'min-width: 100%;',
|
||||||
|
style: "width: 219px;",
|
||||||
|
editable: false,
|
||||||
|
cls: 'input-group-nr',
|
||||||
|
data: [
|
||||||
|
{ value: 0, displayValue: this.textSheet },
|
||||||
|
{ value: 1, displayValue: this.textWorkbook }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
this.cmbSearch = new Common.UI.ComboBox({
|
||||||
|
el: $('#search-adv-cmb-search'),
|
||||||
|
menuStyle: 'min-width: 100%;',
|
||||||
|
style: "width: 219px;",
|
||||||
|
editable: false,
|
||||||
|
cls: 'input-group-nr',
|
||||||
|
data: [
|
||||||
|
{ value: 0, displayValue: this.textByRows },
|
||||||
|
{ value: 1, displayValue: this.textByColumns }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
this.cmbLookIn = new Common.UI.ComboBox({
|
||||||
|
el: $('#search-adv-cmb-look-in'),
|
||||||
|
menuStyle: 'min-width: 100%;',
|
||||||
|
style: "width: 219px;",
|
||||||
|
editable: false,
|
||||||
|
cls: 'input-group-nr',
|
||||||
|
data: [
|
||||||
|
{ value: 0, displayValue: this.textFormulas },
|
||||||
|
{ value: 1, displayValue: this.textValues }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
this.$searchOptionsBlock = $('.search-options-block');
|
this.$searchOptionsBlock = $('.search-options-block');
|
||||||
this.$searchOptionsBlock.show();
|
this.$searchOptionsBlock.show();
|
||||||
$('#open-search-options').on('click', _.bind(this.expandSearchOptions, this));
|
$('#open-search-options').on('click', _.bind(this.expandSearchOptions, this));
|
||||||
|
|
||||||
|
if (!this.extendedOptions) {
|
||||||
|
this.$searchOptionsBlock.addClass('no-expand');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.cmbWithin.setValue(0);
|
||||||
|
this.cmbSearch.setValue(0);
|
||||||
|
this.cmbLookIn.setValue(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,9 +252,18 @@ define([
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getExtraSettings: function () {
|
||||||
|
return {
|
||||||
|
within: !this.cmbWithin.getValue(),
|
||||||
|
search: !this.cmbSearch.getValue(),
|
||||||
|
lookIn: !this.cmbLookIn.getValue()
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
expandSearchOptions: function () {
|
expandSearchOptions: function () {
|
||||||
this.extendedOptions = !this.extendedOptions;
|
this.extendedOptions = !this.extendedOptions;
|
||||||
this.$searchOptionsBlock[this.extendedOptions ? 'removeClass' : 'addClass']('no-expand');
|
this.$searchOptionsBlock[this.extendedOptions ? 'removeClass' : 'addClass']('no-expand');
|
||||||
|
Common.localStorage.setBool('sse-search-options-extended', this.extendedOptions);
|
||||||
},
|
},
|
||||||
|
|
||||||
textFind: 'Find',
|
textFind: 'Find',
|
||||||
|
|
|
@ -94,9 +94,11 @@ define([
|
||||||
options.asc_setScanForward(d != 'back');
|
options.asc_setScanForward(d != 'back');
|
||||||
options.asc_setIsMatchCase(opts.matchcase);
|
options.asc_setIsMatchCase(opts.matchcase);
|
||||||
options.asc_setIsWholeCell(opts.matchword);
|
options.asc_setIsWholeCell(opts.matchword);
|
||||||
//options.asc_setScanOnOnlySheet(this.dlgSearch.menuWithin.menu.items[0].checked);
|
|
||||||
//options.asc_setScanByRows(this.dlgSearch.menuSearch.menu.items[0].checked);
|
var extraOptions = this.view.getExtraSettings();
|
||||||
//options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
options.asc_setScanOnOnlySheet(extraOptions.within);
|
||||||
|
options.asc_setScanByRows(extraOptions.search);
|
||||||
|
options.asc_setLookIn(extraOptions.lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
||||||
|
|
||||||
if (!this.api.asc_findText(options)) {
|
if (!this.api.asc_findText(options)) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -121,9 +123,11 @@ define([
|
||||||
options.asc_setReplaceWith(opts.textreplace);
|
options.asc_setReplaceWith(opts.textreplace);
|
||||||
options.asc_setIsMatchCase(opts.matchcase);
|
options.asc_setIsMatchCase(opts.matchcase);
|
||||||
options.asc_setIsWholeCell(opts.matchword);
|
options.asc_setIsWholeCell(opts.matchword);
|
||||||
//options.asc_setScanOnOnlySheet(this.dlgSearch.menuWithin.menu.items[0].checked);
|
|
||||||
//options.asc_setScanByRows(this.dlgSearch.menuSearch.menu.items[0].checked);
|
var extraOptions = this.view.getExtraSettings();
|
||||||
//options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
options.asc_setScanOnOnlySheet(extraOptions.within);
|
||||||
|
options.asc_setScanByRows(extraOptions.search);
|
||||||
|
options.asc_setLookIn(extraOptions.lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
||||||
options.asc_setIsReplaceAll(false);
|
options.asc_setIsReplaceAll(false);
|
||||||
|
|
||||||
this.api.asc_replaceText(options);
|
this.api.asc_replaceText(options);
|
||||||
|
@ -137,9 +141,11 @@ define([
|
||||||
options.asc_setReplaceWith(opts.textreplace);
|
options.asc_setReplaceWith(opts.textreplace);
|
||||||
options.asc_setIsMatchCase(opts.matchcase);
|
options.asc_setIsMatchCase(opts.matchcase);
|
||||||
options.asc_setIsWholeCell(opts.matchword);
|
options.asc_setIsWholeCell(opts.matchword);
|
||||||
//options.asc_setScanOnOnlySheet(this.dlgSearch.menuWithin.menu.items[0].checked);
|
|
||||||
//options.asc_setScanByRows(this.dlgSearch.menuSearch.menu.items[0].checked);
|
var extraOptions = this.view.getExtraSettings();
|
||||||
//options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
options.asc_setScanOnOnlySheet(extraOptions.within);
|
||||||
|
options.asc_setScanByRows(extraOptions.search);
|
||||||
|
options.asc_setLookIn(extraOptions.lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
||||||
options.asc_setIsReplaceAll(true);
|
options.asc_setIsReplaceAll(true);
|
||||||
|
|
||||||
this.api.asc_replaceText(options);
|
this.api.asc_replaceText(options);
|
||||||
|
@ -161,9 +167,11 @@ define([
|
||||||
options.asc_setScanForward(true);
|
options.asc_setScanForward(true);
|
||||||
options.asc_setIsMatchCase(sett.matchcase);
|
options.asc_setIsMatchCase(sett.matchcase);
|
||||||
options.asc_setIsWholeCell(sett.matchword);
|
options.asc_setIsWholeCell(sett.matchword);
|
||||||
//options.asc_setScanOnOnlySheet(this.dlgSearch.menuWithin.menu.items[0].checked);
|
|
||||||
//options.asc_setScanByRows(this.dlgSearch.menuSearch.menu.items[0].checked);
|
var extraOptions = this.view.getExtraSettings();
|
||||||
//options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
options.asc_setScanOnOnlySheet(extraOptions.within);
|
||||||
|
options.asc_setScanByRows(extraOptions.search);
|
||||||
|
options.asc_setLookIn(extraOptions.lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
||||||
|
|
||||||
|
|
||||||
if (!me.api.asc_findText(options)) {
|
if (!me.api.asc_findText(options)) {
|
||||||
|
|
Loading…
Reference in a new issue