[DE mobile] Localization Search and Settings.

This commit is contained in:
Alexander Yuzhin 2016-11-17 17:39:30 +03:00
parent bd4da87e74
commit 90da47ad78
8 changed files with 138 additions and 85 deletions

View file

@ -50,7 +50,7 @@ define([
], function (core, $, _, Backbone) { ], function (core, $, _, Backbone) {
'use strict'; 'use strict';
DE.Controllers.Search = Backbone.Controller.extend((function() { DE.Controllers.Search = Backbone.Controller.extend(_.extend((function() {
// private // private
var _isShow = false, var _isShow = false,
@ -305,7 +305,7 @@ define([
// API handlers // API handlers
textNoTextFound : 'Text not found', textNoTextFound : 'Text not found'
} }
})()); })(), DE.Controllers.Search || {}))
}); });

View file

@ -47,7 +47,7 @@ define([
], function (core) { ], function (core) {
'use strict'; 'use strict';
DE.Controllers.Settings = Backbone.Controller.extend((function() { DE.Controllers.Settings = Backbone.Controller.extend(_.extend((function() {
// private // private
var rootView, var rootView,
inProgress, inProgress,
@ -92,12 +92,6 @@ define([
}, },
initEvents: function () { initEvents: function () {
// $('#font-bold').single('click', _.bind(me.onBold, me));
// $('#font-italic').single('click', _.bind(me.onItalic, me));
// $('#font-underline').single('click', _.bind(me.onUnderline, me));
// $('#font-strikethrough').single('click', _.bind(me.onStrikethrough, me));
}, },
rootView : function() { rootView : function() {
@ -272,5 +266,5 @@ define([
notcriticalErrorTitle : 'Warning', notcriticalErrorTitle : 'Warning',
warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?' warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?'
} }
})()); })(), DE.Controllers.Settings || {}))
}); });

View file

@ -24,11 +24,11 @@
<a href="#" class="link icon-only next disabled"><i class="icon icon-next"></i></a> <a href="#" class="link icon-only next disabled"><i class="icon icon-next"></i></a>
</p> </p>
<p class="buttons-row replace"> <p class="buttons-row replace">
<a href="#" class="link replace disabled">Replace</a> <a href="#" class="link replace disabled"><%= scope.textReplace %></a>
</p> </p>
<% } else { %> <% } else { %>
<p class="buttons-row"> <p class="buttons-row">
<a href="#" class="link replace disabled">Replace</a> <a href="#" class="link replace disabled"><%= scope.textReplace %></a>
<a href="#" class="link icon-only prev disabled"><i class="icon icon-prev"></i></a> <a href="#" class="link icon-only prev disabled"><i class="icon icon-prev"></i></a>
<a href="#" class="link icon-only next disabled"><i class="icon icon-next"></i></a> <a href="#" class="link icon-only next disabled"><i class="icon icon-next"></i></a>
</p> </p>
@ -42,8 +42,8 @@
<div id="search-settings-view"> <div id="search-settings-view">
<div class="navbar"> <div class="navbar">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="center sliding"><% if (isEdit) { %>Find and Replace<% } else { %>Find<% } %></div> <div class="center sliding"><%= isEdit ? scope.textFindAndReplace : scope.textFind %></div>
<div class="right"><% if (phone) { %><a href="#" class="link close-popup"><b>Done</b></a><% } %></div> <div class="right"><% if (phone) { %><a href="#" class="link close-popup"><b><%= scope.textDone %></b></a><% } %></div>
</div> </div>
</div> </div>
<div class="page" data-page="search-settings"> <div class="page" data-page="search-settings">
@ -56,7 +56,7 @@
<input type="radio" name="search-type" value="search"> <input type="radio" name="search-type" value="search">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %> <% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Find</div> <div class="item-title"><%= scope.textFind %></div>
</div> </div>
</label> </label>
</li> </li>
@ -65,7 +65,7 @@
<input type="radio" name="search-type" value="replace"> <input type="radio" name="search-type" value="replace">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %> <% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Find and Replace</div> <div class="item-title"><%= scope.textFindAndReplace %></div>
</div> </div>
</label> </label>
</li> </li>
@ -77,7 +77,7 @@
<li> <li>
<div id="search-case-sensitive" class="item-content"> <div id="search-case-sensitive" class="item-content">
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Case sensitive</div> <div class="item-title"><%= scope.textCase %></div>
<div class="item-after"> <div class="item-after">
<label class="label-switch"> <label class="label-switch">
<input type="checkbox"> <input type="checkbox">
@ -90,7 +90,7 @@
<li> <li>
<div id="search-highlight-results" class="item-content"> <div id="search-highlight-results" class="item-content">
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Highlight results</div> <div class="item-title"><%= scope.textHighlight %></div>
<div class="item-after"> <div class="item-after">
<label class="label-switch"> <label class="label-switch">
<input type="checkbox"> <input type="checkbox">

View file

@ -2,8 +2,8 @@
<div id="settings-root-view"> <div id="settings-root-view">
<div class="navbar"> <div class="navbar">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="center sliding">Settings</div> <div class="center sliding"><%= scope.textSettings %></div>
<div class="right"><% if (phone) { %><a href="#" class="link close-popup">Done</a><% } %></div> <div class="right"><% if (phone) { %><a href="#" class="link close-popup"><%= scope.textDone %></a><% } %></div>
</div> </div>
</div> </div>
<div class="pages"> <div class="pages">
@ -18,7 +18,7 @@
<i class="icon icon-search"></i> <i class="icon icon-search"></i>
</div> </div>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Find</div> <div class="item-title"><%= scope.textFind %></div>
</div> </div>
</div> </div>
</a> </a>
@ -30,7 +30,7 @@
<i class="icon icon-edit"></i> <i class="icon icon-edit"></i>
</div> </div>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Edit Document</div> <div class="item-title"><%= scope.textEditDoc %></div>
</div> </div>
</div> </div>
</a> </a>
@ -41,7 +41,7 @@
<i class="icon icon-reader"></i> <i class="icon icon-reader"></i>
</div> </div>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Reader Mode</div> <div class="item-title"><%= scope.textReader %></div>
<div class="item-after"> <div class="item-after">
<label class="label-switch"> <label class="label-switch">
<input type="checkbox"> <input type="checkbox">
@ -58,7 +58,7 @@
<i class="icon icon-download"></i> <i class="icon icon-download"></i>
</div> </div>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Download</div> <div class="item-title"><%= scope.textDownload %></div>
</div> </div>
</div> </div>
</a> </a>
@ -70,7 +70,7 @@
<i class="icon icon-info"></i> <i class="icon icon-info"></i>
</div> </div>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Document Info</div> <div class="item-title"><%= scope.textDocInfo %></div>
</div> </div>
</div> </div>
</a> </a>
@ -94,7 +94,7 @@
<i class="icon icon-help"></i> <i class="icon icon-help"></i>
</div> </div>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Help</div> <div class="item-title"><%= scope.textHelp %></div>
</div> </div>
</div> </div>
</a> </a>
@ -106,7 +106,7 @@
<i class="icon icon-about"></i> <i class="icon icon-about"></i>
</div> </div>
<div class="item-inner"> <div class="item-inner">
<div class="item-title">About</div> <div class="item-title"><%= scope.textAbout %></div>
</div> </div>
</div> </div>
</a> </a>
@ -124,78 +124,75 @@
<div class="navbar-inner"> <div class="navbar-inner">
<div class="left sliding"> <div class="left sliding">
<a href="#" class="back link"> <a href="#" class="back link">
<i class="icon icon-back"></i> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %>
<% if (!android) { %>
<span>Back</span>
<% } %>
</a> </a>
</div> </div>
<div class="center sliding">Document Info</div> <div class="center sliding"><%= scope.textDocInfo %></div>
</div> </div>
</div> </div>
<div class="pages"> <div class="pages">
<div class="page" data-page="settings-info-view"> <div class="page" data-page="settings-info-view">
<div class="page-content"> <div class="page-content">
<div class="content-block-title">Document title</div> <div class="content-block-title"><%= scope.textDocTitle %></div>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li class="item-content"> <li class="item-content">
<div class="item-inner"> <div class="item-inner">
<div id="settings-document-title" class="item-title">Loading...</div> <div id="settings-document-title" class="item-title"><%= scope.textLoading %></div>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="content-block-title">Author</div> <div class="content-block-title"><%= scope.textAuthor %></div>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li class="item-content"> <li class="item-content">
<div class="item-inner"> <div class="item-inner">
<div id="settings-document-autor" class="item-title">Loading...</div> <div id="settings-document-autor" class="item-title"><%= scope.textLoading %></div>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="content-block-title">Create date</div> <div class="content-block-title"><%= scope.textCreateDate %></div>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li class="item-content"> <li class="item-content">
<div class="item-inner"> <div class="item-inner">
<div id="settings-document-date" class="item-title">Loading...</div> <div id="settings-document-date" class="item-title"><%= scope.textLoading %></div>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="content-block-title">Statistic</div> <div class="content-block-title"><%= scope.textStatistic %></div>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li class="item-content"> <li class="item-content">
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Pages</div> <div class="item-title"><%= scope.textPages %></div>
<div class="item-after" id="statistic-pages">0</div> <div class="item-after" id="statistic-pages">0</div>
</div> </div>
</li> </li>
<li class="item-content"> <li class="item-content">
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Paragraphs</div> <div class="item-title"><%= scope.textParagraphs %></div>
<div class="item-after" id="statistic-paragraphs">0</div> <div class="item-after" id="statistic-paragraphs">0</div>
</div> </div>
</li> </li>
<li class="item-content"> <li class="item-content">
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Words</div> <div class="item-title"><%= scope.textWords %></div>
<div class="item-after" id="statistic-words">0</div> <div class="item-after" id="statistic-words">0</div>
</div> </div>
</li> </li>
<li class="item-content"> <li class="item-content">
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Symbols</div> <div class="item-title"><%= scope.textSymbols %></div>
<div class="item-after" id="statistic-symbols">0</div> <div class="item-after" id="statistic-symbols">0</div>
</div> </div>
</li> </li>
<li class="item-content"> <li class="item-content">
<div class="item-inner"> <div class="item-inner">
<div class="item-title">Spaces</div> <div class="item-title"><%= scope.textSpaces %></div>
<div class="item-after" id="statistic-spaces">0</div> <div class="item-after" id="statistic-spaces">0</div>
</div> </div>
</li> </li>
@ -212,16 +209,16 @@
<div class="navbar-inner"> <div class="navbar-inner">
<div class="left sliding"> <div class="left sliding">
<a href="#" class="back link"> <a href="#" class="back link">
<i class="icon icon-back"></i><% if (!android) { %><span>Back</span><% } %> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %>
</a> </a>
</div> </div>
<div class="center sliding">Download</div> <div class="center sliding"><%= scope.textDownload %></div>
</div> </div>
</div> </div>
<div class="pages"> <div class="pages">
<div class="page formats" data-page="settings-download-view"> <div class="page formats" data-page="settings-download-view">
<div class="page-content"> <div class="page-content">
<div class="content-block-title">Download As...</div> <div class="content-block-title"><%= scope.textDownloadAs %></div>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li> <li>
@ -297,10 +294,7 @@
<div class="navbar-inner"> <div class="navbar-inner">
<div class="left sliding"> <div class="left sliding">
<a href="#" class="back link"> <a href="#" class="back link">
<i class="icon icon-back"></i> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %>
<% if (!android) { %>
<span>Back</span>
<% } %>
</a> </a>
</div> </div>
<div class="center sliding">Version History</div> <div class="center sliding">Version History</div>
@ -326,13 +320,10 @@
<div class="navbar-inner"> <div class="navbar-inner">
<div class="left sliding"> <div class="left sliding">
<a href="#" class="back link"> <a href="#" class="back link">
<i class="icon icon-back"></i> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %>
<% if (!android) { %>
<span>Back</span>
<% } %>
</a> </a>
</div> </div>
<div class="center sliding">About</div> <div class="center sliding"><%= scope.textAbout %></div>
</div> </div>
</div> </div>
<div class="pages"> <div class="pages">
@ -343,13 +334,13 @@
</div> </div>
<div class="content-block"> <div class="content-block">
<h3>DOCUMENT EDITOR</h3> <h3>DOCUMENT EDITOR</h3>
<h3>Version 4.1</h3> <h3><%= scope.textVersion %> 4.2</h3>
</div> </div>
<div class="content-block"> <div class="content-block">
<h3 class="vendor">Ascensio System SIA</h3> <h3 class="vendor">Ascensio System SIA</h3>
<p><label>address:</label><a class="external" href="#">Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021</a></p> <p><label><%= scope.textAddress %>:</label><a class="external" href="#">Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021</a></p>
<p><label>email:</label><a class="external" target="_blank" href="mailto:support@onlyoffice.com">support@onlyoffice.com</a></p> <p><label><%= scope.textEmail %>:</label><a class="external" target="_blank" href="mailto:support@onlyoffice.com">support@onlyoffice.com</a></p>
<p><label>tel:</label><a class="external" target="_blank" href="tel:+371 660-16425">+371 660-16425</a></p> <p><label><%= scope.textTel %>:</label><a class="external" target="_blank" href="tel:+371 660-16425">+371 660-16425</a></p>
<p><a class="external" target="_blank" href="http://www.onlyoffice.com">www.onlyoffice.com</a></p> <p><a class="external" target="_blank" href="http://www.onlyoffice.com">www.onlyoffice.com</a></p>
</div> </div>
</div> </div>

View file

@ -67,14 +67,7 @@ define([
// Render layout // Render layout
render: function() { render: function() {
var el = $(this.el); var el = $(this.el);
el.append(this.template({}));
el.append(this.template({
//
}));
// this.f7View = uiApp.addView('.view-main', {
// // params
// });
return this; return this;
}, },

View file

@ -48,7 +48,7 @@ define([
], function (searchTemplate, $, _, Backbone) { ], function (searchTemplate, $, _, Backbone) {
'use strict'; 'use strict';
DE.Views.Search = Backbone.View.extend((function() { DE.Views.Search = Backbone.View.extend(_.extend((function() {
// private // private
var _isEdit = false, var _isEdit = false,
_layout; _layout;
@ -76,7 +76,8 @@ define([
_layout = $('<div/>').append(this.template({ _layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'), android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'), phone : Common.SharedSettings.get('phone'),
isEdit : _isEdit isEdit : _isEdit,
scope : this
})); }));
return this; return this;
@ -183,7 +184,14 @@ define([
uiApp.hideNavbar(searchBar); uiApp.hideNavbar(searchBar);
}, 10); }, 10);
} }
} },
textFind: 'Find',
textFindAndReplace: 'Find and Replace',
textDone: 'Done',
textReplace: 'Replace',
textCase: 'Case sensitive',
textHighlight: 'Highlight results'
} }
})()); })(), DE.Views.Search || {}))
}); });

View file

@ -48,7 +48,7 @@ define([
], function (settingsTemplate, $, _, Backbone) { ], function (settingsTemplate, $, _, Backbone) {
'use strict'; 'use strict';
DE.Views.Settings = Backbone.View.extend((function() { DE.Views.Settings = Backbone.View.extend(_.extend((function() {
// private // private
var isEdit; var isEdit;
@ -83,7 +83,8 @@ define([
render: function() { render: function() {
this.layout = $('<div/>').append(this.template({ this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'), android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone') phone : Common.SharedSettings.get('phone'),
scope : this
})); }));
return this; return this;
@ -95,14 +96,13 @@ define([
rootLayout: function () { rootLayout: function () {
if (this.layout) { if (this.layout) {
var $layour = this.layout var $layour = this.layout.find('#settings-root-view'),
.find('#settings-root-view'); isPhone = Common.SharedSettings.get('phone');
var isPhone = Common.SharedSettings.get('phone');
if (isEdit) { if (isEdit) {
$layour.find('#settings-edit-document').hide(); $layour.find('#settings-edit-document').hide();
$layour.find('#settings-readermode').hide(); $layour.find('#settings-readermode').hide();
$layour.find('#settings-search .item-title').text('Find and Replace') $layour.find('#settings-search .item-title').text(this.textFindAndReplace)
} else { } else {
$layour.find('#settings-readermode input:checkbox') $layour.find('#settings-readermode input:checkbox')
.attr('checked', Common.SharedSettings.get('readerMode')) .attr('checked', Common.SharedSettings.get('readerMode'))
@ -183,7 +183,34 @@ define([
} }
}, },
unknownText: 'Unknown' unknownText: 'Unknown',
} textFindAndReplace: 'Find and Replace',
})()); textSettings: 'Settings',
textDone: 'Done',
textFind: 'Find',
textEditDoc: 'Edit Document',
textReader: 'Reader Mode',
textDownload: 'Download',
textDocInfo: 'Document Info',
textHelp: 'Help',
textAbout: 'About',
textBack: 'Back',
textDocTitle: 'Document title',
textLoading: 'Loading...',
textAuthor: 'Author',
textCreateDate: 'Create date',
textStatistic: 'Statistic',
textPages: 'Pages',
textParagraphs: 'Paragraphs',
textWords: 'Words',
textSymbols: 'Symbols',
textSpaces: 'Spaces',
textDownloadAs: 'Download As...',
textVersion: 'Version',
textAddress: 'address',
textEmail: 'email',
textTel: 'tel'
}
})(), DE.Views.Settings || {}))
}); });

View file

@ -83,11 +83,51 @@
"DE.Controllers.Main.advDRMOptions": "Protected File", "DE.Controllers.Main.advDRMOptions": "Protected File",
"DE.Controllers.Main.advDRMEnterPassword": "You password please:", "DE.Controllers.Main.advDRMEnterPassword": "You password please:",
"DE.Controllers.Main.advDRMPassword": "Password", "DE.Controllers.Main.advDRMPassword": "Password",
"DE.Controllers.DocumentHolder.menuCut": "Cut", "DE.Controllers.DocumentHolder.menuCut": "Cut",
"DE.Controllers.DocumentHolder.menuCopy": "Copy", "DE.Controllers.DocumentHolder.menuCopy": "Copy",
"DE.Controllers.DocumentHolder.menuPaste": "Paste", "DE.Controllers.DocumentHolder.menuPaste": "Paste",
"DE.Controllers.DocumentHolder.menuEdit": "Edit", "DE.Controllers.DocumentHolder.menuEdit": "Edit",
"DE.Controllers.DocumentHolder.menuDelete": "Delete", "DE.Controllers.DocumentHolder.menuDelete": "Delete",
"DE.Controllers.DocumentHolder.menuAddLink": "Add Link", "DE.Controllers.DocumentHolder.menuAddLink": "Add Link",
"DE.Controllers.DocumentHolder.menuOpenLink": "Open Link" "DE.Controllers.DocumentHolder.menuOpenLink": "Open Link",
"DE.Controllers.Search.textNoTextFound": "Text not Found",
"DE.Views.Search.textFind": "Find",
"DE.Views.Search.textFindAndReplace": "Find and Replace",
"DE.Views.Search.textDone": "Done",
"DE.Views.Search.textReplace": "Replace",
"DE.Views.Search.textCase": "Case sensitive",
"DE.Views.Search.textHighlight": "Highlight results",
"DE.Controllers.Settings.txtLoading": "Loading...",
"DE.Controllers.Settings.notcriticalErrorTitle": "Warning",
"DE.Controllers.Settings.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
"DE.Views.Settings.unknownText": "Unknown",
"DE.Views.Settings.textFindAndReplace": "Find and Replace",
"DE.Views.Settings.textSettings": "Settings",
"DE.Views.Settings.textDone": "Done",
"DE.Views.Settings.textFind": "Find",
"DE.Views.Settings.textEditDoc": "Edit Document",
"DE.Views.Settings.textReader": "Reader Mode",
"DE.Views.Settings.textDownload": "Download",
"DE.Views.Settings.textDocInfo": "Document Info",
"DE.Views.Settings.textHelp": "Help",
"DE.Views.Settings.textAbout": "About",
"DE.Views.Settings.textBack": "Back",
"DE.Views.Settings.textDocTitle": "Document title",
"DE.Views.Settings.textLoading": "Loading...",
"DE.Views.Settings.textAuthor": "Author",
"DE.Views.Settings.textCreateDate": "Create date",
"DE.Views.Settings.textStatistic": "Statistic",
"DE.Views.Settings.textPages": "Pages",
"DE.Views.Settings.textParagraphs": "Paragraphs",
"DE.Views.Settings.textWords": "Words",
"DE.Views.Settings.textSymbols": "Symbols",
"DE.Views.Settings.textSpaces": "Spaces",
"DE.Views.Settings.textDownloadAs": "Download As...",
"DE.Views.Settings.textVersion": "Version",
"DE.Views.Settings.textAddress": "address",
"DE.Views.Settings.textEmail": "email",
"DE.Views.Settings.textTel": "tel"
} }