[SSE mobile] Add Look in formulas/values
This commit is contained in:
parent
ca34b2f594
commit
304baedd80
|
@ -171,13 +171,15 @@ define([
|
||||||
isMatchCell = Common.SharedSettings.get('search-match-cell') === true,
|
isMatchCell = Common.SharedSettings.get('search-match-cell') === true,
|
||||||
isHighlightRes = Common.SharedSettings.get('search-highlight-res') === true,
|
isHighlightRes = Common.SharedSettings.get('search-highlight-res') === true,
|
||||||
searchBy = Common.SharedSettings.get('search-by') === 'rows' ? 'rows' : 'columns',
|
searchBy = Common.SharedSettings.get('search-by') === 'rows' ? 'rows' : 'columns',
|
||||||
|
lookIn = Common.SharedSettings.get('look-in') === 'formulas' ? 'formulas' : 'values',
|
||||||
$pageSettings = $('.page[data-page=search-settings]'),
|
$pageSettings = $('.page[data-page=search-settings]'),
|
||||||
$inputType = $pageSettings.find('input[name=search-type]'),
|
$inputType = $pageSettings.find('input[name=search-type]'),
|
||||||
$inputSearchIn = $pageSettings.find('input[name=search-in]'),
|
$inputSearchIn = $pageSettings.find('input[name=search-in]'),
|
||||||
$inputSearchBy = $pageSettings.find('input[name=search-by]'),
|
$inputSearchBy = $pageSettings.find('input[name=search-by]'),
|
||||||
$inputMatchCase = $pageSettings.find('#search-match-case input:checkbox'),
|
$inputMatchCase = $pageSettings.find('#search-match-case input:checkbox'),
|
||||||
$inputMatchCell = $pageSettings.find('#search-match-cell input:checkbox'),
|
$inputMatchCell = $pageSettings.find('#search-match-cell input:checkbox'),
|
||||||
$inputHighlightResults = $pageSettings.find('#search-highlight-res input:checkbox');
|
$inputHighlightResults = $pageSettings.find('#search-highlight-res input:checkbox'),
|
||||||
|
$inputLookIn = $pageSettings.find('input[name=look-in]');
|
||||||
|
|
||||||
$inputType.val([isReplace ? 'replace' : 'search']);
|
$inputType.val([isReplace ? 'replace' : 'search']);
|
||||||
$inputSearchIn.val([searchIn]);
|
$inputSearchIn.val([searchIn]);
|
||||||
|
@ -185,11 +187,13 @@ define([
|
||||||
$inputMatchCell.prop('checked', isMatchCell);
|
$inputMatchCell.prop('checked', isMatchCell);
|
||||||
$inputHighlightResults.prop('checked', isHighlightRes);
|
$inputHighlightResults.prop('checked', isHighlightRes);
|
||||||
$inputSearchBy.val([searchBy]);
|
$inputSearchBy.val([searchBy]);
|
||||||
|
$inputLookIn.val([lookIn]);
|
||||||
|
|
||||||
// init events
|
// init events
|
||||||
$inputType.single('change', _.bind(me.onTypeChange, me));
|
$inputType.single('change', _.bind(me.onTypeChange, me));
|
||||||
$inputSearchIn.single('change', _.bind(me.onSearchInChange, me));
|
$inputSearchIn.single('change', _.bind(me.onSearchInChange, me));
|
||||||
$inputSearchBy.single('change', _.bind(me.onSearchByChange, me));
|
$inputSearchBy.single('change', _.bind(me.onSearchByChange, me));
|
||||||
|
$inputLookIn.single('change', _.bind(me.onLookInChange, me));
|
||||||
$inputMatchCase.single('change', _.bind(me.onMatchCaseClick, me));
|
$inputMatchCase.single('change', _.bind(me.onMatchCaseClick, me));
|
||||||
$inputMatchCell.single('change', _.bind(me.onMatchCellClick, me));
|
$inputMatchCell.single('change', _.bind(me.onMatchCellClick, me));
|
||||||
$inputHighlightResults.single('change', _.bind(me.onHighlightResultsClick, me));
|
$inputHighlightResults.single('change', _.bind(me.onHighlightResultsClick, me));
|
||||||
|
@ -254,7 +258,7 @@ define([
|
||||||
me.onQueryReplace(me.searchBar.query, me.replaceBar.query);
|
me.onQueryReplace(me.searchBar.query, me.replaceBar.query);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
me.onQuerySearch(me.searchBar.query, 'next');
|
me.onQuerySearch(me.searchBar.query, 'next');
|
||||||
}, 10);
|
}, 20);
|
||||||
},
|
},
|
||||||
|
|
||||||
onReplaceAll: function (e) {
|
onReplaceAll: function (e) {
|
||||||
|
@ -283,7 +287,8 @@ define([
|
||||||
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
||||||
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
||||||
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
||||||
searchBy = Common.SharedSettings.get('search-by') === 'rows';
|
searchBy = Common.SharedSettings.get('search-by') === 'rows',
|
||||||
|
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
|
||||||
|
|
||||||
if (query && query.length) {
|
if (query && query.length) {
|
||||||
var options = new Asc.asc_CFindOptions();
|
var options = new Asc.asc_CFindOptions();
|
||||||
|
@ -293,7 +298,7 @@ define([
|
||||||
options.asc_setIsWholeCell(matchCell);
|
options.asc_setIsWholeCell(matchCell);
|
||||||
options.asc_setScanOnOnlySheet(lookInSheet);
|
options.asc_setScanOnOnlySheet(lookInSheet);
|
||||||
options.asc_setScanByRows(searchBy);
|
options.asc_setScanByRows(searchBy);
|
||||||
// options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
options.asc_setLookIn(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;
|
||||||
|
@ -313,7 +318,8 @@ define([
|
||||||
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
||||||
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
||||||
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
||||||
searchBy = Common.SharedSettings.get('search-by') === 'rows';
|
searchBy = Common.SharedSettings.get('search-by') === 'rows',
|
||||||
|
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
|
||||||
|
|
||||||
if (search && search.length) {
|
if (search && search.length) {
|
||||||
this.api.isReplaceAll = false;
|
this.api.isReplaceAll = false;
|
||||||
|
@ -325,7 +331,7 @@ define([
|
||||||
options.asc_setIsWholeCell(matchCell);
|
options.asc_setIsWholeCell(matchCell);
|
||||||
options.asc_setScanOnOnlySheet(lookInSheet);
|
options.asc_setScanOnOnlySheet(lookInSheet);
|
||||||
options.asc_setScanByRows(searchBy);
|
options.asc_setScanByRows(searchBy);
|
||||||
// options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
options.asc_setLookIn(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);
|
||||||
|
@ -336,7 +342,8 @@ define([
|
||||||
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
||||||
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
||||||
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
||||||
searchBy = Common.SharedSettings.get('search-by') === 'rows';
|
searchBy = Common.SharedSettings.get('search-by') === 'rows',
|
||||||
|
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
|
||||||
|
|
||||||
if (search && search.length) {
|
if (search && search.length) {
|
||||||
this.api.isReplaceAll = true;
|
this.api.isReplaceAll = true;
|
||||||
|
@ -348,7 +355,7 @@ define([
|
||||||
options.asc_setIsWholeCell(matchCell);
|
options.asc_setIsWholeCell(matchCell);
|
||||||
options.asc_setScanOnOnlySheet(lookInSheet);
|
options.asc_setScanOnOnlySheet(lookInSheet);
|
||||||
options.asc_setScanByRows(searchBy);
|
options.asc_setScanByRows(searchBy);
|
||||||
// options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
options.asc_setLookIn(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);
|
||||||
|
@ -371,6 +378,10 @@ define([
|
||||||
Common.SharedSettings.set('search-by', $(e.currentTarget).val());
|
Common.SharedSettings.set('search-by', $(e.currentTarget).val());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onLookInChange: function(e) {
|
||||||
|
Common.SharedSettings.set('look-in', $(e.currentTarget).val());
|
||||||
|
},
|
||||||
|
|
||||||
onMatchCaseClick: function (e) {
|
onMatchCaseClick: function (e) {
|
||||||
Common.SharedSettings.set('search-match-case', $(e.currentTarget).is(':checked'));
|
Common.SharedSettings.set('search-match-case', $(e.currentTarget).is(':checked'));
|
||||||
},
|
},
|
||||||
|
|
|
@ -118,6 +118,29 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="content-block-title"><%= scope.textLookIn %></div>
|
||||||
|
<div class="list-block">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label class="label-radio item-content">
|
||||||
|
<input type="radio" name="look-in" value="formulas">
|
||||||
|
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title"><%= scope.textFormulas %></div>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label class="label-radio item-content">
|
||||||
|
<input type="radio" name="look-in" value="values">
|
||||||
|
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||||
|
<div class="item-inner">
|
||||||
|
<div class="item-title"><%= scope.textValues %></div>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div class="list-block">
|
<div class="list-block">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -164,6 +164,9 @@ define([
|
||||||
if(Common.SharedSettings.get('search-by') === undefined) {
|
if(Common.SharedSettings.get('search-by') === undefined) {
|
||||||
Common.SharedSettings.set('search-by', 'rows');
|
Common.SharedSettings.set('search-by', 'rows');
|
||||||
}
|
}
|
||||||
|
if(Common.SharedSettings.get('look-in') === undefined) {
|
||||||
|
Common.SharedSettings.set('look-in', 'formulas');
|
||||||
|
}
|
||||||
|
|
||||||
searchBar = $$('.searchbar.document');
|
searchBar = $$('.searchbar.document');
|
||||||
|
|
||||||
|
@ -215,7 +218,10 @@ define([
|
||||||
textHighlightRes: 'Highlight results',
|
textHighlightRes: 'Highlight results',
|
||||||
textByColumns: 'By columns',
|
textByColumns: 'By columns',
|
||||||
textByRows: 'By rows',
|
textByRows: 'By rows',
|
||||||
textSearchBy: 'Search'
|
textSearchBy: 'Search',
|
||||||
|
textLookIn: 'Look In',
|
||||||
|
textFormulas: 'Formulas',
|
||||||
|
textValues: 'Values'
|
||||||
}
|
}
|
||||||
})(), SSE.Views.Search || {}))
|
})(), SSE.Views.Search || {}))
|
||||||
});
|
});
|
Loading…
Reference in a new issue