2016-12-05 15:25:58 +00:00
|
|
|
/*
|
|
|
|
*
|
2019-01-17 13:05:03 +00:00
|
|
|
* (c) Copyright Ascensio System SIA 2010-2019
|
2016-12-05 15:25:58 +00:00
|
|
|
*
|
|
|
|
* This program is a free software product. You can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
|
|
|
* version 3 as published by the Free Software Foundation. In accordance with
|
|
|
|
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
|
|
|
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
|
|
|
* of any third-party rights.
|
|
|
|
*
|
|
|
|
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
|
|
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
|
|
|
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
|
|
|
*
|
2019-01-17 13:00:34 +00:00
|
|
|
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
|
|
|
* street, Riga, Latvia, EU, LV-1050.
|
2016-12-05 15:25:58 +00:00
|
|
|
*
|
|
|
|
* The interactive user interfaces in modified source and object code versions
|
|
|
|
* of the Program must display Appropriate Legal Notices, as required under
|
|
|
|
* Section 5 of the GNU AGPL version 3.
|
|
|
|
*
|
|
|
|
* Pursuant to Section 7(b) of the License you must retain the original Product
|
|
|
|
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
|
|
|
* grant you any rights under trademark law for use of our trademarks.
|
|
|
|
*
|
|
|
|
* All the Product's GUI elements, including illustrations and icon sets, as
|
|
|
|
* well as technical writing content are licensed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
|
|
|
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Search.js
|
|
|
|
* Spreadsheet Editor
|
|
|
|
*
|
|
|
|
* Created by Alexander Yuzhin on 12/5/16
|
2018-03-01 12:16:38 +00:00
|
|
|
* Copyright (c) 2018 Ascensio System SIA. All rights reserved.
|
2016-12-05 15:25:58 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
define([
|
|
|
|
'core',
|
|
|
|
'jquery',
|
|
|
|
'underscore',
|
|
|
|
'backbone',
|
|
|
|
'spreadsheeteditor/mobile/app/view/Search'
|
|
|
|
], function (core, $, _, Backbone) {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
SSE.Controllers.Search = Backbone.Controller.extend(_.extend((function() {
|
|
|
|
// private
|
|
|
|
|
|
|
|
var _isShow = false,
|
|
|
|
_startPoint = {};
|
|
|
|
|
|
|
|
var pointerEventToXY = function(e){
|
|
|
|
var out = {x:0, y:0};
|
|
|
|
if(e.type == 'touchstart' || e.type == 'touchend'){
|
|
|
|
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
|
|
|
|
out.x = touch.pageX;
|
|
|
|
out.y = touch.pageY;
|
|
|
|
} else if (e.type == 'mousedown' || e.type == 'mouseup') {
|
|
|
|
out.x = e.pageX;
|
|
|
|
out.y = e.pageY;
|
|
|
|
}
|
|
|
|
return out;
|
|
|
|
};
|
|
|
|
|
2020-07-16 10:43:30 +00:00
|
|
|
function iOSVersion() {
|
|
|
|
var ua = navigator.userAgent;
|
|
|
|
var m;
|
|
|
|
return (m = /(iPad|iPhone|iphone).*?(OS |os |OS\_)(\d+((_|\.)\d)?((_|\.)\d)?)/.exec(ua)) ? parseFloat(m[3]) : 0;
|
|
|
|
}
|
|
|
|
|
2016-12-05 15:25:58 +00:00
|
|
|
return {
|
|
|
|
models: [],
|
|
|
|
collections: [],
|
|
|
|
views: [
|
|
|
|
'Search'
|
|
|
|
],
|
|
|
|
|
|
|
|
initialize: function() {
|
|
|
|
this.addListeners({
|
|
|
|
'Search': {
|
|
|
|
'searchbar:show' : this.onSearchbarShow,
|
|
|
|
'searchbar:hide' : this.onSearchbarHide,
|
|
|
|
'searchbar:render' : this.onSearchbarRender,
|
2019-06-06 11:44:02 +00:00
|
|
|
'searchbar:showsettings': this.onSearchbarSettings,
|
|
|
|
'search:highlight' : this.onSearchHighlight
|
2016-12-05 15:25:58 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
setApi: function(api) {
|
|
|
|
this.api = api;
|
2019-06-13 07:58:23 +00:00
|
|
|
this.api.asc_registerCallback('asc_onRenameCellTextEnd', _.bind(this.onReplaceNext, this));
|
2016-12-05 15:25:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setMode: function (mode) {
|
|
|
|
this.getView('Search').setMode(mode);
|
|
|
|
},
|
|
|
|
|
|
|
|
onLaunch: function() {
|
|
|
|
var me = this;
|
|
|
|
me.createView('Search').render();
|
|
|
|
|
2020-07-16 10:43:30 +00:00
|
|
|
if (iOSVersion()<13) {
|
|
|
|
$('#editor_sdk').single('mousedown touchstart', _.bind(me.onEditorTouchStart, me));
|
|
|
|
$('#editor_sdk').single('mouseup touchend', _.bind(me.onEditorTouchEnd, me));
|
|
|
|
} else {
|
|
|
|
$('#editor_sdk').single('pointerdown', _.bind(me.onEditorTouchStart, me));
|
|
|
|
$('#editor_sdk').single('pointerup', _.bind(me.onEditorTouchEnd, me));
|
|
|
|
}
|
2016-12-05 15:25:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
showSearch: function () {
|
|
|
|
this.getView('Search').showSearch();
|
|
|
|
},
|
|
|
|
|
|
|
|
hideSearch: function () {
|
|
|
|
this.getView('Search').hideSearch();
|
|
|
|
},
|
|
|
|
|
|
|
|
// Handlers
|
|
|
|
|
|
|
|
onEditorTouchStart: function (e) {
|
|
|
|
_startPoint = pointerEventToXY(e);
|
|
|
|
},
|
|
|
|
|
|
|
|
onEditorTouchEnd: function (e) {
|
|
|
|
var _endPoint = pointerEventToXY(e);
|
|
|
|
|
|
|
|
if (_isShow) {
|
2019-04-04 12:15:11 +00:00
|
|
|
var distance = (_startPoint.x===undefined || _startPoint.y===undefined) ? 0 :
|
|
|
|
Math.sqrt((_endPoint.x -= _startPoint.x) * _endPoint.x + (_endPoint.y -= _startPoint.y) * _endPoint.y);
|
2016-12-05 15:25:58 +00:00
|
|
|
|
|
|
|
if (distance < 1) {
|
|
|
|
this.hideSearch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchbarRender: function(bar) {
|
|
|
|
var me = this,
|
|
|
|
searchString = Common.SharedSettings.get('search-search') || '',
|
|
|
|
replaceString = Common.SharedSettings.get('search-replace')|| '';
|
|
|
|
|
|
|
|
me.searchBar = uiApp.searchbar('.searchbar.document .searchbar.search', {
|
|
|
|
customSearch: true,
|
|
|
|
onSearch : _.bind(me.onSearchChange, me),
|
|
|
|
onEnable : _.bind(me.onSearchEnable, me),
|
|
|
|
onClear : _.bind(me.onSearchClear, me)
|
|
|
|
});
|
|
|
|
|
|
|
|
me.replaceBar = uiApp.searchbar('.searchbar.document .searchbar.replace', {
|
|
|
|
customSearch: true,
|
|
|
|
onSearch : _.bind(me.onReplaceChange, me),
|
|
|
|
onEnable : _.bind(me.onReplaceEnable, me),
|
|
|
|
onClear : _.bind(me.onReplaceClear, me)
|
|
|
|
});
|
|
|
|
|
|
|
|
me.searchPrev = $('.searchbar.document .prev');
|
|
|
|
me.searchNext = $('.searchbar.document .next');
|
|
|
|
me.replaceBtn = $('.searchbar.document .link.replace');
|
|
|
|
|
|
|
|
me.searchPrev.single('click', _.bind(me.onSearchPrev, me));
|
|
|
|
me.searchNext.single('click', _.bind(me.onSearchNext, me));
|
|
|
|
me.replaceBtn.single('click', _.bind(me.onReplace, me));
|
|
|
|
|
|
|
|
$$('.searchbar.document .link.replace').on('taphold', _.bind(me.onReplaceAll, me));
|
|
|
|
|
|
|
|
me.searchBar.search(searchString);
|
|
|
|
me.replaceBar.search(replaceString);
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchbarSettings: function (view) {
|
|
|
|
var me = this,
|
|
|
|
isReplace = Common.SharedSettings.get('search-is-replace') === true,
|
|
|
|
searchIn = Common.SharedSettings.get('search-in') === 'sheet' ? 'sheet' : 'workbook',
|
|
|
|
isMatchCase = Common.SharedSettings.get('search-match-case') === true,
|
|
|
|
isMatchCell = Common.SharedSettings.get('search-match-cell') === true,
|
2019-06-06 11:44:02 +00:00
|
|
|
isHighlightRes = Common.SharedSettings.get('search-highlight-res') === true,
|
2019-06-07 10:53:47 +00:00
|
|
|
searchBy = Common.SharedSettings.get('search-by') === 'rows' ? 'rows' : 'columns',
|
2019-06-07 12:58:30 +00:00
|
|
|
lookIn = Common.SharedSettings.get('look-in') === 'formulas' ? 'formulas' : 'values',
|
2016-12-05 15:25:58 +00:00
|
|
|
$pageSettings = $('.page[data-page=search-settings]'),
|
|
|
|
$inputType = $pageSettings.find('input[name=search-type]'),
|
|
|
|
$inputSearchIn = $pageSettings.find('input[name=search-in]'),
|
2019-06-07 10:53:47 +00:00
|
|
|
$inputSearchBy = $pageSettings.find('input[name=search-by]'),
|
2016-12-05 15:25:58 +00:00
|
|
|
$inputMatchCase = $pageSettings.find('#search-match-case input:checkbox'),
|
2019-06-06 11:44:02 +00:00
|
|
|
$inputMatchCell = $pageSettings.find('#search-match-cell input:checkbox'),
|
2019-06-07 12:58:30 +00:00
|
|
|
$inputHighlightResults = $pageSettings.find('#search-highlight-res input:checkbox'),
|
|
|
|
$inputLookIn = $pageSettings.find('input[name=look-in]');
|
2016-12-05 15:25:58 +00:00
|
|
|
|
|
|
|
$inputType.val([isReplace ? 'replace' : 'search']);
|
|
|
|
$inputSearchIn.val([searchIn]);
|
|
|
|
$inputMatchCase.prop('checked', isMatchCase);
|
|
|
|
$inputMatchCell.prop('checked', isMatchCell);
|
2019-06-06 11:44:02 +00:00
|
|
|
$inputHighlightResults.prop('checked', isHighlightRes);
|
2019-06-07 10:53:47 +00:00
|
|
|
$inputSearchBy.val([searchBy]);
|
2019-06-07 12:58:30 +00:00
|
|
|
$inputLookIn.val([lookIn]);
|
2016-12-05 15:25:58 +00:00
|
|
|
|
|
|
|
// init events
|
|
|
|
$inputType.single('change', _.bind(me.onTypeChange, me));
|
|
|
|
$inputSearchIn.single('change', _.bind(me.onSearchInChange, me));
|
2019-06-07 10:53:47 +00:00
|
|
|
$inputSearchBy.single('change', _.bind(me.onSearchByChange, me));
|
2019-06-07 12:58:30 +00:00
|
|
|
$inputLookIn.single('change', _.bind(me.onLookInChange, me));
|
2016-12-05 15:25:58 +00:00
|
|
|
$inputMatchCase.single('change', _.bind(me.onMatchCaseClick, me));
|
|
|
|
$inputMatchCell.single('change', _.bind(me.onMatchCellClick, me));
|
2019-06-06 11:44:02 +00:00
|
|
|
$inputHighlightResults.single('change', _.bind(me.onHighlightResultsClick, me));
|
2019-06-11 12:11:35 +00:00
|
|
|
|
|
|
|
if (isReplace) {
|
|
|
|
Common.SharedSettings.set('look-in', 'formulas');
|
|
|
|
$('input[name=look-in]').val(['formulas']);
|
|
|
|
$('input[name=look-in]:eq(1)').parent().addClass('disabled');
|
|
|
|
}
|
2016-12-05 15:25:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
onSearchbarShow: function(bar) {
|
|
|
|
_isShow = true;
|
|
|
|
// this.api.asc_selectSearchingResults(Common.SharedSettings.get('search-highlight'));
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchEnable: function (bar) {
|
|
|
|
this.replaceBar.container.removeClass('searchbar-active');
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchbarHide: function(bar) {
|
|
|
|
_isShow = false;
|
|
|
|
// this.api.asc_selectSearchingResults(false);
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchChange: function(search) {
|
|
|
|
var me = this,
|
|
|
|
isEmpty = (search.query.trim().length < 1);
|
|
|
|
|
|
|
|
Common.SharedSettings.set('search-search', search.query);
|
|
|
|
|
|
|
|
_.each([me.searchPrev, me.searchNext, me.replaceBtn], function(btn) {
|
|
|
|
btn.toggleClass('disabled', isEmpty);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchClear: function(search) {
|
|
|
|
Common.SharedSettings.set('search-search', '');
|
|
|
|
// window.focus();
|
|
|
|
// document.activeElement.blur();
|
|
|
|
},
|
|
|
|
|
|
|
|
onReplaceChange: function(replace) {
|
|
|
|
var me = this,
|
|
|
|
isEmpty = (replace.query.trim().length < 1);
|
|
|
|
|
|
|
|
Common.SharedSettings.set('search-replace', replace.query);
|
|
|
|
},
|
|
|
|
|
|
|
|
onReplaceEnable: function (bar) {
|
|
|
|
this.searchBar.container.removeClass('searchbar-active');
|
|
|
|
},
|
|
|
|
|
|
|
|
onReplaceClear: function(replace) {
|
|
|
|
Common.SharedSettings.set('search-replace', '');
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchPrev: function(btn) {
|
|
|
|
this.onQuerySearch(this.searchBar.query, 'back');
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchNext: function(btn) {
|
|
|
|
this.onQuerySearch(this.searchBar.query, 'next');
|
|
|
|
},
|
|
|
|
|
|
|
|
onReplace: function (btn) {
|
2019-06-06 11:44:02 +00:00
|
|
|
var me = this;
|
2019-06-11 12:19:16 +00:00
|
|
|
me.onQueryReplace(me.searchBar.query, me.replaceBar.query ? me.replaceBar.query : "");
|
2019-06-13 07:58:23 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
onReplaceNext: function() {
|
|
|
|
this.onQuerySearch(this.searchBar.query, 'next');
|
2016-12-05 15:25:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
onReplaceAll: function (e) {
|
|
|
|
var me = this,
|
|
|
|
popover = [
|
|
|
|
'<div class="popover" style="width: auto;">',
|
|
|
|
'<div class="popover-inner">',
|
|
|
|
'<div class="list-block">',
|
|
|
|
'<ul>',
|
|
|
|
'<li><a href="#" id="replace-all" class="item-link list-button">{0}</li>'.format(me.textReplaceAll),
|
|
|
|
'</ul>',
|
|
|
|
'</div>',
|
|
|
|
'</div>',
|
|
|
|
'</div>'
|
|
|
|
].join('');
|
|
|
|
|
|
|
|
popover = uiApp.popover(popover, $$(e.currentTarget));
|
|
|
|
|
|
|
|
$('#replace-all').single('click', _.bind(function () {
|
|
|
|
me.onQueryReplaceAll(this.searchBar.query, this.replaceBar.query);
|
|
|
|
uiApp.closeModal(popover);
|
|
|
|
}, me))
|
|
|
|
},
|
|
|
|
|
|
|
|
onQuerySearch: function(query, direction) {
|
|
|
|
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
|
|
|
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
2019-06-07 10:53:47 +00:00
|
|
|
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
2019-06-07 12:58:30 +00:00
|
|
|
searchBy = Common.SharedSettings.get('search-by') === 'rows',
|
|
|
|
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
|
2016-12-05 15:25:58 +00:00
|
|
|
|
|
|
|
if (query && query.length) {
|
|
|
|
var options = new Asc.asc_CFindOptions();
|
|
|
|
options.asc_setFindWhat(query);
|
|
|
|
options.asc_setScanForward(direction != 'back');
|
|
|
|
options.asc_setIsMatchCase(matchCase);
|
|
|
|
options.asc_setIsWholeCell(matchCell);
|
|
|
|
options.asc_setScanOnOnlySheet(lookInSheet);
|
2019-06-07 10:53:47 +00:00
|
|
|
options.asc_setScanByRows(searchBy);
|
2019-06-07 12:58:30 +00:00
|
|
|
options.asc_setLookIn(lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
2016-12-05 15:25:58 +00:00
|
|
|
|
|
|
|
if (!this.api.asc_findText(options)) {
|
|
|
|
var me = this;
|
|
|
|
uiApp.alert(
|
|
|
|
'',
|
|
|
|
me.textNoTextFound,
|
|
|
|
function () {
|
|
|
|
me.searchBar.input.focus();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onQueryReplace: function(search, replace) {
|
|
|
|
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
|
|
|
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
2019-06-07 10:53:47 +00:00
|
|
|
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
2019-06-07 12:58:30 +00:00
|
|
|
searchBy = Common.SharedSettings.get('search-by') === 'rows',
|
|
|
|
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
|
2016-12-05 15:25:58 +00:00
|
|
|
|
|
|
|
if (search && search.length) {
|
|
|
|
this.api.isReplaceAll = false;
|
|
|
|
|
|
|
|
var options = new Asc.asc_CFindOptions();
|
|
|
|
options.asc_setFindWhat(search);
|
|
|
|
options.asc_setReplaceWith(replace);
|
|
|
|
options.asc_setIsMatchCase(matchCase);
|
|
|
|
options.asc_setIsWholeCell(matchCell);
|
|
|
|
options.asc_setScanOnOnlySheet(lookInSheet);
|
2019-06-07 10:53:47 +00:00
|
|
|
options.asc_setScanByRows(searchBy);
|
2019-06-07 12:58:30 +00:00
|
|
|
options.asc_setLookIn(lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
2016-12-05 15:25:58 +00:00
|
|
|
options.asc_setIsReplaceAll(false);
|
|
|
|
|
|
|
|
this.api.asc_replaceText(options);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onQueryReplaceAll: function(search, replace) {
|
|
|
|
var matchCase = Common.SharedSettings.get('search-match-case') || false,
|
|
|
|
matchCell = Common.SharedSettings.get('search-match-cell') || false,
|
2019-06-07 10:53:47 +00:00
|
|
|
lookInSheet = Common.SharedSettings.get('search-in') === 'sheet',
|
2019-06-07 12:58:30 +00:00
|
|
|
searchBy = Common.SharedSettings.get('search-by') === 'rows',
|
|
|
|
lookIn = Common.SharedSettings.get('look-in') === 'formulas';
|
2016-12-05 15:25:58 +00:00
|
|
|
|
|
|
|
if (search && search.length) {
|
|
|
|
this.api.isReplaceAll = true;
|
|
|
|
|
|
|
|
var options = new Asc.asc_CFindOptions();
|
|
|
|
options.asc_setFindWhat(search);
|
|
|
|
options.asc_setReplaceWith(replace);
|
|
|
|
options.asc_setIsMatchCase(matchCase);
|
|
|
|
options.asc_setIsWholeCell(matchCell);
|
|
|
|
options.asc_setScanOnOnlySheet(lookInSheet);
|
2019-06-07 10:53:47 +00:00
|
|
|
options.asc_setScanByRows(searchBy);
|
2019-06-07 12:58:30 +00:00
|
|
|
options.asc_setLookIn(lookIn ? Asc.c_oAscFindLookIn.Formulas : Asc.c_oAscFindLookIn.Value);
|
2016-12-05 15:25:58 +00:00
|
|
|
options.asc_setIsReplaceAll(true);
|
|
|
|
|
|
|
|
this.api.asc_replaceText(options);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onTypeChange: function (e) {
|
|
|
|
var $target = $(e.currentTarget),
|
|
|
|
isReplace = ($target.val() === 'replace');
|
|
|
|
|
|
|
|
Common.SharedSettings.set('search-is-replace', isReplace);
|
|
|
|
$('.searchbar.document').toggleClass('replace', isReplace);
|
2019-06-11 12:11:35 +00:00
|
|
|
|
|
|
|
if (isReplace) {
|
|
|
|
Common.SharedSettings.set('look-in', 'formulas');
|
|
|
|
$('input[name=look-in]').val(['formulas']);
|
|
|
|
$('input[name=look-in]:eq(1)').parent().addClass('disabled');
|
|
|
|
} else {
|
|
|
|
$('input[name=look-in]:eq(1)').parent().removeClass('disabled');
|
|
|
|
}
|
2016-12-05 15:25:58 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
onSearchInChange: function (e) {
|
|
|
|
Common.SharedSettings.set('search-in', $(e.currentTarget).val());
|
|
|
|
},
|
|
|
|
|
2019-06-07 10:53:47 +00:00
|
|
|
onSearchByChange: function(e) {
|
|
|
|
Common.SharedSettings.set('search-by', $(e.currentTarget).val());
|
|
|
|
},
|
|
|
|
|
2019-06-07 12:58:30 +00:00
|
|
|
onLookInChange: function(e) {
|
|
|
|
Common.SharedSettings.set('look-in', $(e.currentTarget).val());
|
|
|
|
},
|
|
|
|
|
2016-12-05 15:25:58 +00:00
|
|
|
onMatchCaseClick: function (e) {
|
|
|
|
Common.SharedSettings.set('search-match-case', $(e.currentTarget).is(':checked'));
|
|
|
|
},
|
|
|
|
|
|
|
|
onMatchCellClick: function (e) {
|
|
|
|
Common.SharedSettings.set('search-match-cell', $(e.currentTarget).is(':checked'));
|
|
|
|
},
|
|
|
|
|
2019-06-06 11:44:02 +00:00
|
|
|
onHighlightResultsClick: function (e) {
|
|
|
|
var value = $(e.currentTarget).is(':checked');
|
|
|
|
Common.SharedSettings.set('search-highlight-res', value);
|
|
|
|
this.api.asc_selectSearchingResults(value);
|
|
|
|
},
|
|
|
|
|
|
|
|
onSearchHighlight: function(w, highlight) {
|
|
|
|
this.api.asc_selectSearchingResults(highlight);
|
|
|
|
},
|
|
|
|
|
2016-12-05 15:25:58 +00:00
|
|
|
// API handlers
|
|
|
|
|
|
|
|
textNoTextFound: 'Text not found',
|
|
|
|
textReplaceAll: 'Replace All'
|
|
|
|
}
|
|
|
|
})(), SSE.Controllers.Search || {}))
|
|
|
|
});
|