[de mobile] transfer color schemes to document settings and transfer spellcheck to application settings

This commit is contained in:
Julia Svinareva 2019-04-16 20:33:47 +03:00
parent 1ae45b6f2a
commit 42667a48bf
2 changed files with 34 additions and 32 deletions

View file

@ -225,18 +225,18 @@ define([
Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content');
} else if ('#settings-advanced-view' == pageId) {
me.initPageAdvancedSettings();
$('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false));
$('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me));
$('#settings-orthography').single('click', _.bind(me.onOrthographyCheck, me));
Common.Utils.addScrollIfNeed('.page[data-page=settings-advanced-view]', '.page[data-page=settings-advanced-view] .page-content');
} else if ('#color-schemes-view' == pageId) {
me.initPageColorSchemes();
Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content');
} else {
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
$('#settings-spellcheck input:checkbox').attr('checked', Common.localStorage.getBool("de-mobile-spellcheck", false));
$('#settings-review input:checkbox').attr('checked', _isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || '')));
$('#settings-search').single('click', _.bind(me.onSearch, me));
$('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me));
$('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me));
$('#settings-orthography').single('click', _.bind(me.onOrthographyCheck, me));
$('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me));
$('#settings-help').single('click', _.bind(me.onShowHelp, me));
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
@ -253,7 +253,7 @@ define([
templateInsert = "";
_.each(schemas, function (schema, index) {
var colors = schema.get_colors();//schema.colors;
templateInsert = templateInsert + "<a class='color-schemes-menu'><input type='hidden' value='" + index + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + index + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
for (var j = 2; j < 7; j++) {
var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b());
templateInsert = templateInsert + "<span class='color' style='background: " + clr + ";'></span>"

View file

@ -41,22 +41,6 @@
</div>
</div>
</li>
<li>
<div id="settings-spellcheck" class="item-content">
<div class="item-media">
<i class="icon icon-spellcheck"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textSpellcheck %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</li>
<% if (orthography) { %>
<li>
<a id="settings-orthography" class="item-link no-indicator">
@ -111,18 +95,6 @@
</div>
</a>
</li>
<li>
<a id="color-schemes" class="item-link" data-page="#color-schemes-view">
<div class="item-content">
<div class="item-media">
<i class="icon icon-doc-setup"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textColorSchemes %></div>
</div>
</div>
</a>
</li>
<li>
<a id="settings-download-as" class="item-link" data-page="#settings-download-view">
<div class="item-content">
@ -328,6 +300,19 @@
</li>
</ul>
</div>
<div class="list-block media-list">
<ul>
<li>
<a id="color-schemes" class="item-link item-content" data-page="#color-schemes-view">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><%= scope.textColorSchemes %></div>
</div>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
@ -637,6 +622,7 @@
<div class="pages">
<div class="page" data-page="settings-advanced-view">
<div class="page-content">
<div class="content-block-title"><%= scope.textUnitOfMeasurement %></div>
<div class="list-block">
<ul>
@ -670,6 +656,22 @@
</ul>
</div>
<div class="list-block">
<ul>
<div id="settings-spellcheck" class="item-content">
<div class="item-inner">
<div class="item-title"><%= scope.textSpellcheck %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
<div class="checkbox"></div>
</label>
</div>
</div>
</div>
</ul>
</div>
</div>
</div>
</div>