[DE PE SSE] Remove unused code
This commit is contained in:
parent
5696c4820d
commit
e57fed6bc8
|
@ -97,14 +97,6 @@ define([
|
||||||
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
||||||
'save:disabled': this.changeToolbarSaveState.bind(this)
|
'save:disabled': this.changeToolbarSaveState.bind(this)
|
||||||
},
|
},
|
||||||
'SearchDialog': {
|
|
||||||
'hide': _.bind(this.onSearchDlgHide, this),
|
|
||||||
'search:back': _.bind(this.onQuerySearch, this, 'back'),
|
|
||||||
'search:next': _.bind(this.onQuerySearch, this, 'next'),
|
|
||||||
'search:replace': _.bind(this.onQueryReplace, this),
|
|
||||||
'search:replaceall': _.bind(this.onQueryReplaceAll, this),
|
|
||||||
'search:highlight': _.bind(this.onSearchHighlight, this)
|
|
||||||
},
|
|
||||||
'Common.Views.ReviewChanges': {
|
'Common.Views.ReviewChanges': {
|
||||||
'collaboration:chat': _.bind(this.onShowHideChat, this)
|
'collaboration:chat': _.bind(this.onShowHideChat, this)
|
||||||
},
|
},
|
||||||
|
@ -126,7 +118,6 @@ define([
|
||||||
|
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
this.leftMenu = this.createView('LeftMenu').render();
|
this.leftMenu = this.createView('LeftMenu').render();
|
||||||
this.leftMenu.btnSearch.on('toggle', _.bind(this.onMenuSearch, this));
|
|
||||||
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
||||||
|
|
||||||
Common.util.Shortcuts.delegateShortcuts({
|
Common.util.Shortcuts.delegateShortcuts({
|
||||||
|
@ -149,7 +140,6 @@ define([
|
||||||
|
|
||||||
setApi: function(api) {
|
setApi: function(api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.api.asc_registerCallback('asc_onReplaceAll', _.bind(this.onApiTextReplaced, this));
|
|
||||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
|
||||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
|
||||||
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
|
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
|
||||||
|
@ -564,86 +554,6 @@ define([
|
||||||
},
|
},
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
|
|
||||||
onQuerySearch: function(d, w, opts) {
|
|
||||||
if (opts.textsearch && opts.textsearch.length) {
|
|
||||||
if (!this.api.asc_findText(opts.textsearch, d != 'back', opts.matchcase, opts.matchword)) {
|
|
||||||
var me = this;
|
|
||||||
Common.UI.info({
|
|
||||||
msg: this.textNoTextFound,
|
|
||||||
callback: function() {
|
|
||||||
me.dlgSearch.focus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onQueryReplace: function(w, opts) {
|
|
||||||
if (!_.isEmpty(opts.textsearch)) {
|
|
||||||
if (!this.api.asc_replaceText(opts.textsearch, opts.textreplace, false, opts.matchcase, opts.matchword)) {
|
|
||||||
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, opts.matchword);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onSearchHighlight: function(w, highlight) {
|
|
||||||
this.api.asc_selectSearchingResults(highlight);
|
|
||||||
},
|
|
||||||
|
|
||||||
showSearchDlg: function(show,action) {
|
|
||||||
if ( !this.dlgSearch ) {
|
|
||||||
this.dlgSearch = (new Common.UI.SearchDialog({
|
|
||||||
matchcase: true,
|
|
||||||
markresult: {applied: true}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (show) {
|
|
||||||
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
|
|
||||||
if (this.dlgSearch.isVisible()) {
|
|
||||||
this.dlgSearch.setMode(mode);
|
|
||||||
this.dlgSearch.setSearchText(this.api.asc_GetSelectedText());
|
|
||||||
this.dlgSearch.focus();
|
|
||||||
} else {
|
|
||||||
this.dlgSearch.show(mode, this.api.asc_GetSelectedText());
|
|
||||||
}
|
|
||||||
} else this.dlgSearch['hide']();
|
|
||||||
},
|
|
||||||
|
|
||||||
onMenuSearch: function(obj, show) {
|
|
||||||
this.showSearchDlg(show);
|
|
||||||
},
|
|
||||||
|
|
||||||
onSearchDlgHide: function() {
|
|
||||||
this.leftMenu.btnSearch.toggle(false, true);
|
|
||||||
this.api.asc_selectSearchingResults(false);
|
|
||||||
$(this.leftMenu.btnSearch.el).blur();
|
|
||||||
this.api.asc_enableKeyEvents(true);
|
|
||||||
},
|
|
||||||
|
|
||||||
onApiTextReplaced: function(found,replaced) {
|
|
||||||
var me = this;
|
|
||||||
if (found) {
|
|
||||||
!(found - replaced > 0) ?
|
|
||||||
Common.UI.info( {msg: Common.Utils.String.format(this.textReplaceSuccess, replaced)} ) :
|
|
||||||
Common.UI.warning( {msg: Common.Utils.String.format(this.textReplaceSkipped, found-replaced)} );
|
|
||||||
} else {
|
|
||||||
Common.UI.info({msg: this.textNoTextFound});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onApiServerDisconnect: function(enableDownload) {
|
onApiServerDisconnect: function(enableDownload) {
|
||||||
this.mode.isEdit = false;
|
this.mode.isEdit = false;
|
||||||
this.leftMenu.close();
|
this.leftMenu.close();
|
||||||
|
@ -656,18 +566,12 @@ define([
|
||||||
this.leftMenu.btnNavigation.setDisabled(true);
|
this.leftMenu.btnNavigation.setDisabled(true);
|
||||||
|
|
||||||
this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload});
|
this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload});
|
||||||
if ( this.dlgSearch ) {
|
|
||||||
this.leftMenu.btnSearch.toggle(false, true);
|
|
||||||
this.dlgSearch['hide']();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setPreviewMode: function(mode) {
|
setPreviewMode: function(mode) {
|
||||||
if (this.viewmode === mode) return;
|
if (this.viewmode === mode) return;
|
||||||
this.viewmode = mode;
|
this.viewmode = mode;
|
||||||
|
|
||||||
this.dlgSearch && this.dlgSearch.setMode(this.viewmode ? 'no-replace' : 'search');
|
|
||||||
|
|
||||||
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -762,12 +666,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
menuFilesShowHide: function(state) {
|
menuFilesShowHide: function(state) {
|
||||||
if ( this.dlgSearch ) {
|
|
||||||
if ( state == 'show' )
|
|
||||||
this.dlgSearch.suspendKeyEvents();
|
|
||||||
else
|
|
||||||
Common.Utils.asyncCall(this.dlgSearch.resumeKeyEvents, this.dlgSearch);
|
|
||||||
}
|
|
||||||
if (this.api && state == 'hide')
|
if (this.api && state == 'hide')
|
||||||
this.api.asc_enableKeyEvents(true);
|
this.api.asc_enableKeyEvents(true);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<div id="view-left-menu" class="tool-menu left">
|
<div id="view-left-menu" class="tool-menu left">
|
||||||
<div class="tool-menu-btns">
|
<div class="tool-menu-btns">
|
||||||
<button id="left-btn-search" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
|
||||||
<button id="left-btn-searchbar" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
<button id="left-btn-searchbar" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
||||||
<!-- /** coauthoring begin **/ -->
|
<!-- /** coauthoring begin **/ -->
|
||||||
<button id="left-btn-comments" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target="left-panel-comments"><i class="icon toolbar__icon btn-menu-comments"> </i></button>
|
<button id="left-btn-comments" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target="left-panel-comments"><i class="icon toolbar__icon btn-menu-comments"> </i></button>
|
||||||
|
|
|
@ -97,14 +97,6 @@ define([
|
||||||
render: function () {
|
render: function () {
|
||||||
var $markup = $(this.template({}));
|
var $markup = $(this.template({}));
|
||||||
|
|
||||||
this.btnSearch = new Common.UI.Button({
|
|
||||||
action: 'search',
|
|
||||||
el: $markup.elementById('#left-btn-search'),
|
|
||||||
hint: this.tipSearch + Common.Utils.String.platformKey('Ctrl+F'),
|
|
||||||
disabled: true,
|
|
||||||
enableToggle: true
|
|
||||||
});
|
|
||||||
|
|
||||||
this.btnSearchBar = new Common.UI.Button({
|
this.btnSearchBar = new Common.UI.Button({
|
||||||
action: 'advancedsearch',
|
action: 'advancedsearch',
|
||||||
el: $markup.elementById('#left-btn-searchbar'),
|
el: $markup.elementById('#left-btn-searchbar'),
|
||||||
|
@ -174,7 +166,6 @@ define([
|
||||||
});
|
});
|
||||||
this.btnNavigation.on('click', this.onBtnMenuClick.bind(this));
|
this.btnNavigation.on('click', this.onBtnMenuClick.bind(this));
|
||||||
|
|
||||||
this.btnSearch.on('click', this.onBtnMenuClick.bind(this));
|
|
||||||
this.btnSearchBar.on('click', this.onBtnMenuClick.bind(this));
|
this.btnSearchBar.on('click', this.onBtnMenuClick.bind(this));
|
||||||
this.btnAbout.on('toggle', this.onBtnMenuToggle.bind(this));
|
this.btnAbout.on('toggle', this.onBtnMenuToggle.bind(this));
|
||||||
|
|
||||||
|
@ -202,9 +193,6 @@ define([
|
||||||
btn.panel['show']();
|
btn.panel['show']();
|
||||||
if (!this._state.pluginIsRunning)
|
if (!this._state.pluginIsRunning)
|
||||||
this.$el.width(SCALE_MIN);
|
this.$el.width(SCALE_MIN);
|
||||||
|
|
||||||
if (this.btnSearch.isActive())
|
|
||||||
this.btnSearch.toggle(false);
|
|
||||||
} else {
|
} else {
|
||||||
btn.panel['hide']();
|
btn.panel['hide']();
|
||||||
}
|
}
|
||||||
|
@ -370,7 +358,6 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
disableMenu: function(menu, disable) {
|
disableMenu: function(menu, disable) {
|
||||||
this.btnSearch.setDisabled(false);
|
|
||||||
this.btnSearchBar.setDisabled(false);
|
this.btnSearchBar.setDisabled(false);
|
||||||
this.btnAbout.setDisabled(false);
|
this.btnAbout.setDisabled(false);
|
||||||
this.btnSupport.setDisabled(false);
|
this.btnSupport.setDisabled(false);
|
||||||
|
|
|
@ -82,8 +82,6 @@ define([
|
||||||
'comments:hide': _.bind(this.commentsShowHide, this, 'hide')
|
'comments:hide': _.bind(this.commentsShowHide, this, 'hide')
|
||||||
},
|
},
|
||||||
'FileMenu': {
|
'FileMenu': {
|
||||||
'menu:hide': _.bind(this.menuFilesShowHide, this, 'hide'),
|
|
||||||
'menu:show': _.bind(this.menuFilesShowHide, this, 'show'),
|
|
||||||
'filemenu:hide': _.bind(this.menuFilesHide, this),
|
'filemenu:hide': _.bind(this.menuFilesHide, this),
|
||||||
'item:click': _.bind(this.clickMenuFileItem, this),
|
'item:click': _.bind(this.clickMenuFileItem, this),
|
||||||
'saveas:format': _.bind(this.clickSaveAsFormat, this),
|
'saveas:format': _.bind(this.clickSaveAsFormat, this),
|
||||||
|
@ -98,13 +96,6 @@ define([
|
||||||
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
||||||
'save:disabled' : this.changeToolbarSaveState.bind(this)
|
'save:disabled' : this.changeToolbarSaveState.bind(this)
|
||||||
},
|
},
|
||||||
'SearchDialog': {
|
|
||||||
'hide': _.bind(this.onSearchDlgHide, this),
|
|
||||||
'search:back': _.bind(this.onQuerySearch, this, 'back'),
|
|
||||||
'search:next': _.bind(this.onQuerySearch, this, 'next'),
|
|
||||||
'search:replace': _.bind(this.onQueryReplace, this),
|
|
||||||
'search:replaceall': _.bind(this.onQueryReplaceAll, this)
|
|
||||||
},
|
|
||||||
'Common.Views.ReviewChanges': {
|
'Common.Views.ReviewChanges': {
|
||||||
'collaboration:chat': _.bind(this.onShowHideChat, this)
|
'collaboration:chat': _.bind(this.onShowHideChat, this)
|
||||||
},
|
},
|
||||||
|
@ -121,7 +112,6 @@ define([
|
||||||
|
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
this.leftMenu = this.createView('LeftMenu').render();
|
this.leftMenu = this.createView('LeftMenu').render();
|
||||||
this.leftMenu.btnSearch.on('toggle', _.bind(this.onMenuSearch, this));
|
|
||||||
this.leftMenu.btnThumbs.on('toggle', _.bind(this.onShowTumbnails, this));
|
this.leftMenu.btnThumbs.on('toggle', _.bind(this.onShowTumbnails, this));
|
||||||
this.isThumbsShown = true;
|
this.isThumbsShown = true;
|
||||||
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
||||||
|
@ -150,7 +140,6 @@ define([
|
||||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this));
|
||||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this));
|
||||||
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
|
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
|
||||||
this.api.asc_registerCallback('asc_onReplaceAll', _.bind(this.onApiTextReplaced, this));
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (this.mode.canCoAuthoring) {
|
if (this.mode.canCoAuthoring) {
|
||||||
if (this.mode.canChat)
|
if (this.mode.canChat)
|
||||||
|
@ -442,66 +431,6 @@ define([
|
||||||
},
|
},
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
|
|
||||||
onQuerySearch: function(d, w, opts) {
|
|
||||||
if (opts.textsearch && opts.textsearch.length) {
|
|
||||||
if (!this.api.findText(opts.textsearch, d != 'back', opts.matchcase)) {
|
|
||||||
var me = this;
|
|
||||||
Common.UI.info({
|
|
||||||
msg: this.textNoTextFound,
|
|
||||||
callback: function() {
|
|
||||||
me.dlgSearch.focus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
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({
|
|
||||||
matchcase: true
|
|
||||||
}));
|
|
||||||
var me = this;
|
|
||||||
Common.NotificationCenter.on('preview:start', function() {
|
|
||||||
me.dlgSearch.hide();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (show) {
|
|
||||||
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
|
|
||||||
if (this.dlgSearch.isVisible()) {
|
|
||||||
this.dlgSearch.setMode(mode);
|
|
||||||
this.dlgSearch.focus();
|
|
||||||
} else {
|
|
||||||
this.dlgSearch.show(mode);
|
|
||||||
}
|
|
||||||
} else this.dlgSearch['hide']();
|
|
||||||
},
|
|
||||||
|
|
||||||
onMenuSearch: function(obj, show) {
|
|
||||||
this.showSearchDlg(show);
|
|
||||||
},
|
|
||||||
|
|
||||||
onShowTumbnails: function(obj, show) {
|
onShowTumbnails: function(obj, show) {
|
||||||
this.api.ShowThumbnails(show);
|
this.api.ShowThumbnails(show);
|
||||||
|
|
||||||
|
@ -515,30 +444,10 @@ define([
|
||||||
this.isThumbsShown = isShow;
|
this.isThumbsShown = isShow;
|
||||||
},
|
},
|
||||||
|
|
||||||
onSearchDlgHide: function() {
|
|
||||||
this.leftMenu.btnSearch.toggle(false, true);
|
|
||||||
$(this.leftMenu.btnSearch.el).blur();
|
|
||||||
this.api.asc_enableKeyEvents(true);
|
|
||||||
// this.api.asc_selectSearchingResults(false);
|
|
||||||
},
|
|
||||||
|
|
||||||
onApiTextReplaced: function(found,replaced) {
|
|
||||||
var me = this;
|
|
||||||
if (found) {
|
|
||||||
!(found - replaced > 0) ?
|
|
||||||
Common.UI.info( {msg: Common.Utils.String.format(this.textReplaceSuccess, replaced)} ) :
|
|
||||||
Common.UI.warning( {msg: Common.Utils.String.format(this.textReplaceSkipped, found-replaced)} );
|
|
||||||
} else {
|
|
||||||
Common.UI.info({msg: this.textNoTextFound});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setPreviewMode: function(mode) {
|
setPreviewMode: function(mode) {
|
||||||
if (this.viewmode === mode) return;
|
if (this.viewmode === mode) return;
|
||||||
this.viewmode = mode;
|
this.viewmode = mode;
|
||||||
|
|
||||||
this.dlgSearch && this.dlgSearch.setMode(this.viewmode ? 'no-replace' : 'search');
|
|
||||||
|
|
||||||
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -553,10 +462,6 @@ define([
|
||||||
this.leftMenu.btnPlugins.setDisabled(true);
|
this.leftMenu.btnPlugins.setDisabled(true);
|
||||||
|
|
||||||
this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload});
|
this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload});
|
||||||
if ( this.dlgSearch ) {
|
|
||||||
this.leftMenu.btnSearch.toggle(false, true);
|
|
||||||
this.dlgSearch['hide']();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiCountPages: function(count) {
|
onApiCountPages: function(count) {
|
||||||
|
@ -628,15 +533,6 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
menuFilesShowHide: function(state) {
|
|
||||||
if ( this.dlgSearch ) {
|
|
||||||
if ( state == 'show' )
|
|
||||||
this.dlgSearch.suspendKeyEvents();
|
|
||||||
else
|
|
||||||
Common.Utils.asyncCall(this.dlgSearch.resumeKeyEvents, this.dlgSearch);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
onShortcut: function(s, e) {
|
onShortcut: function(s, e) {
|
||||||
if (!this.mode) return;
|
if (!this.mode) return;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<div id="view-left-menu" class="tool-menu left">
|
<div id="view-left-menu" class="tool-menu left">
|
||||||
<div class="tool-menu-btns">
|
<div class="tool-menu-btns">
|
||||||
<button id="left-btn-search" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
|
||||||
<button id="left-btn-searchbar" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
<button id="left-btn-searchbar" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
||||||
<button id="left-btn-thumbs" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-thumbs"> </i></button>
|
<button id="left-btn-thumbs" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-thumbs"> </i></button>
|
||||||
<!-- /** coauthoring begin **/ -->
|
<!-- /** coauthoring begin **/ -->
|
||||||
|
|
|
@ -93,14 +93,6 @@ define([
|
||||||
render: function () {
|
render: function () {
|
||||||
var $markup = $(this.template({}));
|
var $markup = $(this.template({}));
|
||||||
|
|
||||||
this.btnSearch = new Common.UI.Button({
|
|
||||||
action: 'search',
|
|
||||||
el: $markup.elementById('#left-btn-search'),
|
|
||||||
hint: this.tipSearch + Common.Utils.String.platformKey('Ctrl+F'),
|
|
||||||
disabled: true,
|
|
||||||
enableToggle: true
|
|
||||||
});
|
|
||||||
|
|
||||||
this.btnSearchBar = new Common.UI.Button({
|
this.btnSearchBar = new Common.UI.Button({
|
||||||
action: 'advancedsearch',
|
action: 'advancedsearch',
|
||||||
el: $markup.elementById('#left-btn-searchbar'),
|
el: $markup.elementById('#left-btn-searchbar'),
|
||||||
|
@ -168,8 +160,6 @@ define([
|
||||||
});
|
});
|
||||||
this.btnPlugins.hide();
|
this.btnPlugins.hide();
|
||||||
this.btnPlugins.on('click', _.bind(this.onBtnMenuClick, this));
|
this.btnPlugins.on('click', _.bind(this.onBtnMenuClick, this));
|
||||||
|
|
||||||
this.btnSearch.on('click', _.bind(this.onBtnMenuClick, this));
|
|
||||||
this.btnSearchBar.on('click', _.bind(this.onBtnMenuClick, this));
|
this.btnSearchBar.on('click', _.bind(this.onBtnMenuClick, this));
|
||||||
this.btnThumbs.on('click', _.bind(this.onBtnMenuClick, this));
|
this.btnThumbs.on('click', _.bind(this.onBtnMenuClick, this));
|
||||||
this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this));
|
this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this));
|
||||||
|
@ -187,9 +177,6 @@ define([
|
||||||
btn.panel['show']();
|
btn.panel['show']();
|
||||||
if (!this._state.pluginIsRunning)
|
if (!this._state.pluginIsRunning)
|
||||||
this.$el.width(SCALE_MIN);
|
this.$el.width(SCALE_MIN);
|
||||||
|
|
||||||
if (this.btnSearch.isActive())
|
|
||||||
this.btnSearch.toggle(false);
|
|
||||||
} else {
|
} else {
|
||||||
btn.panel['hide']();
|
btn.panel['hide']();
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,14 +89,6 @@ define([
|
||||||
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
||||||
'save:disabled' : this.changeToolbarSaveState.bind(this)
|
'save:disabled' : this.changeToolbarSaveState.bind(this)
|
||||||
},
|
},
|
||||||
'SearchDialog': {
|
|
||||||
'hide': _.bind(this.onSearchDlgHide, this),
|
|
||||||
'search:back': _.bind(this.onQuerySearch, this, 'back'),
|
|
||||||
'search:next': _.bind(this.onQuerySearch, this, 'next'),
|
|
||||||
'search:replace': _.bind(this.onQueryReplace, this),
|
|
||||||
'search:replaceall': _.bind(this.onQueryReplaceAll, this),
|
|
||||||
'search:highlight': _.bind(this.onSearchHighlight, this)
|
|
||||||
},
|
|
||||||
'Common.Views.ReviewChanges': {
|
'Common.Views.ReviewChanges': {
|
||||||
'collaboration:chat': _.bind(this.onShowHideChat, this)
|
'collaboration:chat': _.bind(this.onShowHideChat, this)
|
||||||
},
|
},
|
||||||
|
@ -115,7 +107,6 @@ define([
|
||||||
|
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
this.leftMenu = this.createView('LeftMenu').render();
|
this.leftMenu = this.createView('LeftMenu').render();
|
||||||
this.leftMenu.btnSearch.on('toggle', _.bind(this.onMenuSearch, this));
|
|
||||||
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
this.leftMenu.btnSearchBar.on('toggle', _.bind(this.onMenuSearchBar, this));
|
||||||
|
|
||||||
Common.util.Shortcuts.delegateShortcuts({
|
Common.util.Shortcuts.delegateShortcuts({
|
||||||
|
@ -560,170 +551,10 @@ define([
|
||||||
},
|
},
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
|
|
||||||
onQuerySearch: function(d, w, opts) {
|
|
||||||
// if (opts.textsearch && opts.textsearch.length) {
|
|
||||||
var options = this.dlgSearch.findOptions;
|
|
||||||
options.asc_setFindWhat(opts.textsearch);
|
|
||||||
options.asc_setScanForward(d != 'back');
|
|
||||||
options.asc_setIsMatchCase(opts.matchcase);
|
|
||||||
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);
|
|
||||||
options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
|
||||||
|
|
||||||
if (!this.api.asc_findText(options)) {
|
|
||||||
var me = this;
|
|
||||||
Common.UI.info({
|
|
||||||
msg: this.textNoTextFound,
|
|
||||||
callback: function() {
|
|
||||||
me.dlgSearch.focus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
|
|
||||||
onQueryReplace: function(w, opts) {
|
|
||||||
// if (!_.isEmpty(opts.textsearch)) {
|
|
||||||
this.api.isReplaceAll = false;
|
|
||||||
|
|
||||||
var options = this.dlgSearch.findOptions;
|
|
||||||
options.asc_setFindWhat(opts.textsearch);
|
|
||||||
options.asc_setReplaceWith(opts.textreplace);
|
|
||||||
options.asc_setIsMatchCase(opts.matchcase);
|
|
||||||
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);
|
|
||||||
options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
|
||||||
options.asc_setIsReplaceAll(false);
|
|
||||||
|
|
||||||
this.api.asc_replaceText(options);
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
|
|
||||||
onQueryReplaceAll: function(w, opts) {
|
|
||||||
// if (!_.isEmpty(opts.textsearch)) {
|
|
||||||
this.api.isReplaceAll = true;
|
|
||||||
|
|
||||||
var options = this.dlgSearch.findOptions;
|
|
||||||
options.asc_setFindWhat(opts.textsearch);
|
|
||||||
options.asc_setReplaceWith(opts.textreplace);
|
|
||||||
options.asc_setIsMatchCase(opts.matchcase);
|
|
||||||
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);
|
|
||||||
options.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value);
|
|
||||||
options.asc_setIsReplaceAll(true);
|
|
||||||
|
|
||||||
this.api.asc_replaceText(options);
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
|
|
||||||
onSearchHighlight: function(w, highlight) {
|
|
||||||
this.api.asc_selectSearchingResults(highlight);
|
|
||||||
},
|
|
||||||
|
|
||||||
showSearchDlg: function(show,action) {
|
|
||||||
if ( !this.dlgSearch ) {
|
|
||||||
var menuWithin = new Common.UI.MenuItem({
|
|
||||||
caption : this.textWithin,
|
|
||||||
menu : new Common.UI.Menu({
|
|
||||||
menuAlign : 'tl-tr',
|
|
||||||
items : [{
|
|
||||||
caption : this.textSheet,
|
|
||||||
toggleGroup : 'searchWithih',
|
|
||||||
checkable : true,
|
|
||||||
checked : true
|
|
||||||
},{
|
|
||||||
caption : this.textWorkbook,
|
|
||||||
toggleGroup : 'searchWithih',
|
|
||||||
checkable : true,
|
|
||||||
checked : false
|
|
||||||
}]
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
var menuSearch = new Common.UI.MenuItem({
|
|
||||||
caption : this.textSearch,
|
|
||||||
menu : new Common.UI.Menu({
|
|
||||||
menuAlign : 'tl-tr',
|
|
||||||
items : [{
|
|
||||||
caption : this.textByRows,
|
|
||||||
toggleGroup : 'searchByrows',
|
|
||||||
checkable : true,
|
|
||||||
checked : true
|
|
||||||
},{
|
|
||||||
caption : this.textByColumns,
|
|
||||||
toggleGroup : 'searchByrows',
|
|
||||||
checkable : true,
|
|
||||||
checked : false
|
|
||||||
}]
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
var menuLookin = new Common.UI.MenuItem({
|
|
||||||
caption : this.textLookin,
|
|
||||||
menu : new Common.UI.Menu({
|
|
||||||
menuAlign : 'tl-tr',
|
|
||||||
items : [{
|
|
||||||
caption : this.textFormulas,
|
|
||||||
toggleGroup : 'searchLookin',
|
|
||||||
checkable : true,
|
|
||||||
checked : true
|
|
||||||
},{
|
|
||||||
caption : this.textValues,
|
|
||||||
toggleGroup : 'searchLookin',
|
|
||||||
checkable : true,
|
|
||||||
checked : false
|
|
||||||
}]
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
this.dlgSearch = (new Common.UI.SearchDialog({
|
|
||||||
matchcase: true,
|
|
||||||
matchword: true,
|
|
||||||
matchwordstr: this.textItemEntireCell,
|
|
||||||
markresult: {applied: true},
|
|
||||||
extraoptions : [menuWithin,menuSearch,menuLookin]
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.dlgSearch.menuWithin = menuWithin;
|
|
||||||
this.dlgSearch.menuSearch = menuSearch;
|
|
||||||
this.dlgSearch.menuLookin = menuLookin;
|
|
||||||
this.dlgSearch.findOptions = new Asc.asc_CFindOptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (show) {
|
|
||||||
var mode = this.mode.isEdit && !this.viewmode ? (action || undefined) : 'no-replace';
|
|
||||||
|
|
||||||
if (this.dlgSearch.isVisible()) {
|
|
||||||
this.dlgSearch.setMode(mode);
|
|
||||||
this.dlgSearch.focus();
|
|
||||||
} else {
|
|
||||||
this.dlgSearch.show(mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.api.asc_closeCellEditor();
|
|
||||||
} else this.dlgSearch['hide']();
|
|
||||||
},
|
|
||||||
|
|
||||||
onMenuSearch: function(obj, show) {
|
|
||||||
this.showSearchDlg(show);
|
|
||||||
},
|
|
||||||
|
|
||||||
onSearchDlgHide: function() {
|
|
||||||
this.leftMenu.btnSearch.toggle(false, true);
|
|
||||||
this.api.asc_selectSearchingResults(false);
|
|
||||||
$(this.leftMenu.btnSearch.el).blur();
|
|
||||||
this.api.asc_enableKeyEvents(true);
|
|
||||||
},
|
|
||||||
|
|
||||||
setPreviewMode: function(mode) {
|
setPreviewMode: function(mode) {
|
||||||
if (this.viewmode === mode) return;
|
if (this.viewmode === mode) return;
|
||||||
this.viewmode = mode;
|
this.viewmode = mode;
|
||||||
|
|
||||||
this.dlgSearch && this.dlgSearch.setMode(this.viewmode ? 'no-replace' : 'search');
|
|
||||||
|
|
||||||
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
this.leftMenu.panelSearch && this.leftMenu.panelSearch.setSearchMode(this.viewmode ? 'no-replace' : 'search');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -739,10 +570,6 @@ define([
|
||||||
this.leftMenu.btnSpellcheck.setDisabled(true);
|
this.leftMenu.btnSpellcheck.setDisabled(true);
|
||||||
|
|
||||||
this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload});
|
this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload});
|
||||||
if ( this.dlgSearch ) {
|
|
||||||
this.leftMenu.btnSearch.toggle(false, true);
|
|
||||||
this.dlgSearch['hide']();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<div id="view-left-menu" class="tool-menu left">
|
<div id="view-left-menu" class="tool-menu left">
|
||||||
<div class="tool-menu-btns">
|
<div class="tool-menu-btns">
|
||||||
<button id="left-btn-search" class="btn btn-category" content-target="" data-hint="0" data-hint-direction="right" data-hint-offset="big"><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
|
||||||
<button id="left-btn-searchbar" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
<button id="left-btn-searchbar" class="btn btn-category" data-hint="0" data-hint-direction="right" data-hint-offset="big" content-target=""><i class="icon toolbar__icon btn-menu-search"> </i></button>
|
||||||
<!-- /** coauthoring begin **/ -->
|
<!-- /** coauthoring begin **/ -->
|
||||||
<button id="left-btn-comments" class="btn btn-category" content-target="left-panel-comments" data-hint="0" data-hint-direction="right" data-hint-offset="big"><i class="icon toolbar__icon btn-menu-comments"> </i></button>
|
<button id="left-btn-comments" class="btn btn-category" content-target="left-panel-comments" data-hint="0" data-hint-direction="right" data-hint-offset="big"><i class="icon toolbar__icon btn-menu-comments"> </i></button>
|
||||||
|
|
|
@ -83,14 +83,6 @@ define([
|
||||||
render: function () {
|
render: function () {
|
||||||
var $markup = $(this.template({}));
|
var $markup = $(this.template({}));
|
||||||
|
|
||||||
this.btnSearch = new Common.UI.Button({
|
|
||||||
action: 'search',
|
|
||||||
el: $markup.elementById('#left-btn-search'),
|
|
||||||
hint: this.tipSearch + Common.Utils.String.platformKey('Ctrl+F'),
|
|
||||||
disabled: true,
|
|
||||||
enableToggle: true
|
|
||||||
});
|
|
||||||
|
|
||||||
this.btnSearchBar = new Common.UI.Button({
|
this.btnSearchBar = new Common.UI.Button({
|
||||||
action: 'advancedsearch',
|
action: 'advancedsearch',
|
||||||
el: $markup.elementById('#left-btn-searchbar'),
|
el: $markup.elementById('#left-btn-searchbar'),
|
||||||
|
@ -161,7 +153,6 @@ define([
|
||||||
this.btnSpellcheck.hide();
|
this.btnSpellcheck.hide();
|
||||||
this.btnSpellcheck.on('click', _.bind(this.onBtnMenuClick, this));
|
this.btnSpellcheck.on('click', _.bind(this.onBtnMenuClick, this));
|
||||||
|
|
||||||
this.btnSearch.on('click', _.bind(this.onBtnMenuClick, this));
|
|
||||||
this.btnSearchBar.on('click', _.bind(this.onBtnMenuClick, this));
|
this.btnSearchBar.on('click', _.bind(this.onBtnMenuClick, this));
|
||||||
this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this));
|
this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this));
|
||||||
|
|
||||||
|
@ -177,9 +168,6 @@ define([
|
||||||
btn.panel['show']();
|
btn.panel['show']();
|
||||||
if (!this._state.pluginIsRunning)
|
if (!this._state.pluginIsRunning)
|
||||||
this.$el.width(SCALE_MIN);
|
this.$el.width(SCALE_MIN);
|
||||||
|
|
||||||
if (this.btnSearch.isActive())
|
|
||||||
this.btnSearch.toggle(false);
|
|
||||||
} else {
|
} else {
|
||||||
btn.panel['hide']();
|
btn.panel['hide']();
|
||||||
}
|
}
|
||||||
|
@ -327,7 +315,6 @@ define([
|
||||||
disableMenu: function(menu, disable) {
|
disableMenu: function(menu, disable) {
|
||||||
this.btnAbout.setDisabled(false);
|
this.btnAbout.setDisabled(false);
|
||||||
this.btnSupport.setDisabled(false);
|
this.btnSupport.setDisabled(false);
|
||||||
this.btnSearch.setDisabled(false);
|
|
||||||
this.btnSearchBar.setDisabled(false);
|
this.btnSearchBar.setDisabled(false);
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
this.btnComments.setDisabled(false);
|
this.btnComments.setDisabled(false);
|
||||||
|
|
Loading…
Reference in a new issue