Merge branch 'feature/new-mobile'

This commit is contained in:
Maxim Kadushkin 2016-11-24 18:23:22 +03:00
commit 155201ed82
5 changed files with 34 additions and 1 deletions

View file

@ -173,6 +173,9 @@ require([
// Default title for modals // Default title for modals
modalTitle: 'ONLYOFFICE', modalTitle: 'ONLYOFFICE',
// Enable tap hold events
tapHold: true,
// If it is webapp, we can enable hash navigation: // If it is webapp, we can enable hash navigation:
// pushState: false, // pushState: false,

View file

@ -184,6 +184,9 @@ require([
// Default title for modals // Default title for modals
modalTitle: 'ONLYOFFICE', modalTitle: 'ONLYOFFICE',
// Enable tap hold events
tapHold: true,
// If it is webapp, we can enable hash navigation: // If it is webapp, we can enable hash navigation:
// pushState: false, // pushState: false,

View file

@ -156,6 +156,8 @@ define([
me.searchNext.single('click', _.bind(me.onSearchNext, me)); me.searchNext.single('click', _.bind(me.onSearchNext, me));
me.replaceBtn.single('click', _.bind(me.onReplace, me)); me.replaceBtn.single('click', _.bind(me.onReplace, me));
$$('.searchbar.document .link.replace').on('taphold', _.bind(me.onReplaceAll, me));
me.searchBar.search(searchString); me.searchBar.search(searchString);
me.replaceBar.search(replaceString); me.replaceBar.search(replaceString);
}, },
@ -241,6 +243,28 @@ define([
this.onQueryReplace(this.searchBar.query, this.replaceBar.query); this.onQueryReplace(this.searchBar.query, this.replaceBar.query);
}, },
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) { onQuerySearch: function(query, direction) {
var matchcase = Common.SharedSettings.get('search-case-sensitive') || false, var matchcase = Common.SharedSettings.get('search-case-sensitive') || false,
matchword = Common.SharedSettings.get('search-highlight') || false; matchword = Common.SharedSettings.get('search-highlight') || false;
@ -305,7 +329,8 @@ define([
// API handlers // API handlers
textNoTextFound : 'Text not found' textNoTextFound: 'Text not found',
textReplaceAll: 'Replace All'
} }
})(), DE.Controllers.Search || {})) })(), DE.Controllers.Search || {}))
}); });

View file

@ -96,6 +96,7 @@
"DE.Controllers.DocumentHolder.menuOpenLink": "Open Link", "DE.Controllers.DocumentHolder.menuOpenLink": "Open Link",
"DE.Controllers.Search.textNoTextFound": "Text not Found", "DE.Controllers.Search.textNoTextFound": "Text not Found",
"DE.Controllers.Search.textReplaceAll": "Replace All",
"DE.Views.Search.textFind": "Find", "DE.Views.Search.textFind": "Find",
"DE.Views.Search.textFindAndReplace": "Find and Replace", "DE.Views.Search.textFindAndReplace": "Find and Replace",
"DE.Views.Search.textDone": "Done", "DE.Views.Search.textDone": "Done",

File diff suppressed because one or more lines are too long