From 0038b713700a2570078af584367a8c04a719eed1 Mon Sep 17 00:00:00 2001 From: Alexander Yuzhin Date: Tue, 12 Mar 2019 13:42:21 +0300 Subject: [PATCH] [DE] Preparing check of orthography --- .../documenteditor/mobile/app/controller/Editor.js | 6 ++++++ .../mobile/app/controller/Settings.js | 7 +++++++ .../mobile/app/template/Settings.template | 14 ++++++++++++++ apps/documenteditor/mobile/app/view/Settings.js | 2 ++ 4 files changed, 29 insertions(+) diff --git a/apps/documenteditor/mobile/app/controller/Editor.js b/apps/documenteditor/mobile/app/controller/Editor.js index 9be613d37..b968233bf 100644 --- a/apps/documenteditor/mobile/app/controller/Editor.js +++ b/apps/documenteditor/mobile/app/controller/Editor.js @@ -66,6 +66,11 @@ define([ (/MSIE 10/.test(ua) && /; Touch/.test(ua))); } + function isSailfish() { + var ua = navigator.userAgent; + return /Sailfish/.test(ua) || /Jolla/.test(ua); + } + return { // Specifying a EditorController model models: [], @@ -95,6 +100,7 @@ define([ Common.SharedSettings.set('android', Framework7.prototype.device.android); Common.SharedSettings.set('phone', phone); + Common.SharedSettings.set('sailfish', isSailfish()); $('html').addClass(phone ? 'phone' : 'tablet'); diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 67ab14766..2ba298624 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -223,6 +223,7 @@ define([ $('#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)); @@ -372,6 +373,12 @@ define([ this.api && this.api.asc_setSpellCheck(state); }, + onOrthographyCheck: function (e) { + this.hideModal(); + + // TODO: Do check of orthography + }, + onTrackChanges: function(e) { var $checkbox = $(e.currentTarget), state = $checkbox.is(':checked'); diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 0d2279387..0b6717542 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -57,6 +57,20 @@ + <% if (orthography) { %> +
  • + +
    +
    + +
    +
    +
    Проверка правописания
    +
    +
    +
    +
  • + <% } %>
  • diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index d6cac7c18..5f482ea1b 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -88,6 +88,7 @@ define([ this.layout = $('
    ').append(this.template({ android : Common.SharedSettings.get('android'), phone : Common.SharedSettings.get('phone'), + orthography: Common.SharedSettings.get('sailfish'), scope : this })); @@ -123,6 +124,7 @@ define([ } else { $layour.find('#settings-document').hide(); $layour.find('#settings-spellcheck').hide(); + $layour.find('#settings-orthography').hide(); } if (!_canReader) $layour.find('#settings-readermode').hide();