diff --git a/apps/presentationeditor/mobile/app-dev.js b/apps/presentationeditor/mobile/app-dev.js index 51e0f331e..117c3c160 100644 --- a/apps/presentationeditor/mobile/app-dev.js +++ b/apps/presentationeditor/mobile/app-dev.js @@ -140,8 +140,8 @@ require([ // 'DocumentHolder', 'Settings', 'EditContainer', - // 'EditText', - // 'EditParagraph', + 'EditText', + 'EditParagraph', // 'EditTable', // 'EditImage', // 'EditShape', @@ -205,8 +205,8 @@ require([ // 'presentationeditor/mobile/app/controller/DocumentHolder', 'presentationeditor/mobile/app/controller/Settings', 'presentationeditor/mobile/app/controller/edit/EditContainer', - // 'presentationeditor/mobile/app/controller/edit/EditText', - // 'presentationeditor/mobile/app/controller/edit/EditParagraph', + 'presentationeditor/mobile/app/controller/edit/EditText', + 'presentationeditor/mobile/app/controller/edit/EditParagraph', // 'presentationeditor/mobile/app/controller/edit/EditTable', // 'presentationeditor/mobile/app/controller/edit/EditImage', // 'presentationeditor/mobile/app/controller/edit/EditShape', diff --git a/apps/presentationeditor/mobile/app.js b/apps/presentationeditor/mobile/app.js index 0796b8307..4dcfd6535 100644 --- a/apps/presentationeditor/mobile/app.js +++ b/apps/presentationeditor/mobile/app.js @@ -147,12 +147,12 @@ require([ 'Editor', 'Toolbar', // 'Search', - 'Main' + 'Main', // 'DocumentHolder', // 'Settings', // 'EditContainer', - // 'EditText', - // 'EditParagraph', + 'EditText', + 'EditParagraph' // 'EditTable', // 'EditImage', // 'EditShape', @@ -212,12 +212,12 @@ require([ 'presentationeditor/mobile/app/controller/Editor', 'presentationeditor/mobile/app/controller/Toolbar', // 'presentationeditor/mobile/app/controller/Search', - 'presentationeditor/mobile/app/controller/Main' + 'presentationeditor/mobile/app/controller/Main', // 'presentationeditor/mobile/app/controller/DocumentHolder', // 'presentationeditor/mobile/app/controller/Settings', - // 'presentationeditor/mobile/app/controller/edit/EditContainer', - // 'presentationeditor/mobile/app/controller/edit/EditText', - // 'presentationeditor/mobile/app/controller/edit/EditParagraph', + 'presentationeditor/mobile/app/controller/edit/EditContainer', + 'presentationeditor/mobile/app/controller/edit/EditText', + 'presentationeditor/mobile/app/controller/edit/EditParagraph' // 'presentationeditor/mobile/app/controller/edit/EditTable', // 'presentationeditor/mobile/app/controller/edit/EditImage', // 'presentationeditor/mobile/app/controller/edit/EditShape', diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js b/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js index 450b8cc6b..b32cb85e5 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js @@ -109,13 +109,20 @@ define([ editors = []; // TODO: Debug only - editors.push(me._emptyEditController()); - return editors; + // editors.push(me._emptyEditController()); + // return editors; if (_settings.length < 0) { editors.push(me._emptyEditController()); } else { + if (_.contains(_settings, 'slide')) { + editors.push({ + caption: me.textSlide, + id: 'edit-text', + layout: PE.getController('EditText').getView('EditSlide').rootLayout() + }) + } if (_.contains(_settings, 'text')) { editors.push({ caption: me.textText, @@ -319,35 +326,33 @@ define([ onApiFocusObject: function (objects) { _settings = []; - // Paragraph : 0, - // Table : 1, - // Image : 2, - // Header : 3, - // Shape : 4, - // Slide : 5, - // Chart : 6, - // MailMerge : 7, - // TextArt : 8 - + var no_text = true; _.each(objects, function(object) { var type = object.get_ObjectType(); if (Asc.c_oAscTypeSelectElement.Paragraph == type) { - _settings.push('text', 'paragraph'); + _settings.push('paragraph'); + no_text = false; } else if (Asc.c_oAscTypeSelectElement.Table == type) { - _settings.push('table'); + // _settings.push('table'); + no_text = false; + } else if (Asc.c_oAscTypeSelectElement.Slide == type) { + // _settings.push('slide'); + no_text = false; } else if (Asc.c_oAscTypeSelectElement.Image == type) { - if (object.get_ObjectValue().get_ChartProperties()) { - _settings.push('chart'); - } else if (object.get_ObjectValue().get_ShapeProperties()) { - _settings.push('shape'); - } else { - _settings.push('image'); - } + // _settings.push('image'); + } else if (Asc.c_oAscTypeSelectElement.Chart == type) { + // _settings.push('chart'); + no_text = false; + } else if (Asc.c_oAscTypeSelectElement.Shape == type) { + // _settings.push('shape'); + no_text = false; } else if (Asc.c_oAscTypeSelectElement.Hyperlink == type) { - _settings.push('hyperlink'); + // _settings.push('hyperlink'); } }); + if (!no_text) + _settings.unshift('text'); // Exclude shapes if chart exist if (_settings.indexOf('chart') > -1) { @@ -364,7 +369,8 @@ define([ textShape: 'Shape', textImage: 'Image', textChart: 'Chart', - textHyperlink: 'Hyperlink' + textHyperlink: 'Hyperlink', + textSlide: 'Slide' } })(), PE.Controllers.EditContainer || {})) diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditParagraph.js b/apps/presentationeditor/mobile/app/controller/edit/EditParagraph.js new file mode 100644 index 000000000..485cfa464 --- /dev/null +++ b/apps/presentationeditor/mobile/app/controller/edit/EditParagraph.js @@ -0,0 +1,321 @@ +/* + * + * (c) Copyright Ascensio System Limited 2010-2016 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, + * EU, LV-1021. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +/** + * EditParagraph.js + * Presentation Editor + * + * Created by Alexander Yuzhin on 10/14/16 + * Copyright (c) 2016 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'core', + 'presentationeditor/mobile/app/view/edit/EditParagraph' +], function (core) { + 'use strict'; + + PE.Controllers.EditParagraph = Backbone.Controller.extend(_.extend((function() { + // Private + var _stack = [], + _paragraphInfo = {}, + _paragraphObject = undefined, + metricText = Common.Utils.Metric.getCurrentMetricName(); + + return { + models: [], + collections: [], + views: [ + 'EditParagraph' + ], + + initialize: function () { + Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this)); + Common.NotificationCenter.on('editcategory:show', _.bind(this.categoryShow, this)); + + this.addListeners({ + 'EditParagraph': { + 'page:show' : this.onPageShow + } + }); + }, + + setApi: function (api) { + var me = this; + me.api = api; + me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me)); + me.api.asc_registerCallback('asc_onListType', _.bind(me.onApiBullets, me)); + me.api.asc_registerCallback('asc_onPrAlign', _.bind(me.onApiParagraphAlign, me)); + me.api.asc_registerCallback('asc_canIncreaseIndent', _.bind(me.onApiCanIncreaseIndent, me)); + me.api.asc_registerCallback('asc_canDecreaseIndent', _.bind(me.onApiCanDecreaseIndent, me)); + me.api.asc_registerCallback('asc_onLineSpacing', _.bind(me.onApiLineSpacing, me)); + me.api.asc_registerCallback('asc_onVerticalTextAlign', _.bind(me.onApiVerticalTextAlign, me)); + + }, + + onLaunch: function () { + this.createView('EditParagraph').render(); + }, + + initEvents: function () { + var me = this; + + $('#paragraph-align .button').single('click', _.bind(me.onParagraphAlign, me)); + $('#paragraph-valign .button').single('click', _.bind(me.onParagraphVAlign, me)); + $('#font-moveleft, #font-moveright').single('click', _.bind(me.onParagraphMove, me)); + + $('#paragraph-distance-before .button').single('click', _.bind(me.onDistanceBefore, me)); + $('#paragraph-distance-after .button').single('click', _.bind(me.onDistanceAfter, me)); + + me.initSettings(); + }, + + categoryShow: function (e) { + var $target = $(e.currentTarget); + + if ($target && $target.prop('id') === 'edit-paragraph') { + this.initSettings(); + } + }, + + onPageShow: function (view, pageId) { + var me = this; + + $('#page-text-linespacing li').single('click', _.buffered(me.onLineSpacing, 100, me)); + $('.dataview.bullets li').single('click', _.buffered(me.onBullet, 100, me)); + $('.dataview.numbers li').single('click', _.buffered(me.onNumber, 100, me)); + + me.initSettings(pageId); + }, + + initSettings: function (pageId) { + var me = this; + + me.api && me.api.UpdateInterfaceState(); + + if (_paragraphObject) { + _paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before()); + _paragraphInfo.spaceAfter = _paragraphObject.get_Spacing().get_After() < 0 ? _paragraphObject.get_Spacing().get_After() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_After()); + $('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : _paragraphInfo.spaceBefore + ' ' + metricText); + $('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : _paragraphInfo.spaceAfter + ' ' + metricText); + } + }, + + // Handlers + onParagraphAlign: function (e) { + var $target = $(e.currentTarget); + + if ($target) { + var id = $target.attr('id'), + type = 1; + + if ('font-just' == id) { + type = 3; + } else if ('font-right' == id) { + type = 0; + } else if ('font-center' == id) { + type = 2; + } + + $('#paragraph-align .button').removeClass('active'); + $target.addClass('active'); + + this.api.put_PrAlign(type); + } + }, + + onParagraphVAlign: function (e) { + var $target = $(e.currentTarget); + + if ($target) { + var id = $target.attr('id'), + type = Asc.c_oAscVAlign.Bottom; + + if ('font-top' == id) { + type = Asc.c_oAscVAlign.Top; + } else if ('font-middle' == id) { + type = Asc.c_oAscVAlign.Center; + } + + $('#paragraph-align .button').removeClass('active'); + $target.addClass('active'); + + this.api.setVerticalAlign(type); + } + }, + + onParagraphMove: function (e) { + var $target = $(e.currentTarget); + + if ($target && this.api) { + var id = $target.attr('id'); + + if ('font-moveleft' == id) { + this.api.DecreaseIndent(); + } else { + this.api.IncreaseIndent(); + } + } + }, + + onLineSpacing: function (e) { + var $target = $(e.currentTarget).find('input'); + + if ($target && this.api) { + var value = parseFloat($target.prop('value')), + LINERULE_AUTO = 1; + + this.api.put_PrLineSpacing(LINERULE_AUTO, value); + } + }, + + onBullet: function (e) { + var $bullet = $(e.currentTarget), + type = $bullet.data('type'); + + $('.dataview.bullets li').removeClass('active'); + $bullet.addClass('active'); + + this.api.put_ListType(0, parseInt(type)); + }, + + onNumber: function (e) { + var $number = $(e.currentTarget), + type = $number.data('type'); + + $('.dataview.numbers li').removeClass('active'); + $number.addClass('active'); + + this.api.put_ListType(1, parseInt(type)); + }, + + onDistanceBefore: function (e) { + var $button = $(e.currentTarget), + distance = _paragraphInfo.spaceBefore; + + if ($button.hasClass('decrement')) { + distance = Math.max(-1, --distance); + } else { + distance = Math.min(100, ++distance); + } + + _paragraphInfo.spaceBefore = distance; + + $('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : (_paragraphInfo.spaceBefore) + ' ' + metricText); + + this.api.put_LineSpacingBeforeAfter(0, (_paragraphInfo.spaceBefore < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(_paragraphInfo.spaceBefore)); + }, + + onDistanceAfter: function (e) { + var $button = $(e.currentTarget), + distance = _paragraphInfo.spaceAfter; + + if ($button.hasClass('decrement')) { + distance = Math.max(-1, --distance); + } else { + distance = Math.min(100, ++distance); + } + + _paragraphInfo.spaceAfter = distance; + + $('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : (_paragraphInfo.spaceAfter) + ' ' + metricText); + + this.api.put_LineSpacingBeforeAfter(1, (_paragraphInfo.spaceAfter < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(_paragraphInfo.spaceAfter)); + }, + + // API handlers + + onApiFocusObject: function (objects) { + _stack = objects; + + var paragraphs = []; + + _.each(_stack, function(object) { + if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Paragraph) { + paragraphs.push(object); + } + }); + + if (paragraphs.length > 0) { + var object = paragraphs[paragraphs.length - 1]; // get top + _paragraphObject = object.get_ObjectValue(); + } else { + _paragraphObject = undefined; + } + }, + + onApiBullets: function(data) { + var type = data.get_ListType(), + subtype = data.get_ListSubType(); + + switch (type) { + case 0: + $('.dataview.bullets li[data-type=' + subtype + ']').addClass('active'); + break; + case 1: + $('.dataview.numbers li[data-type=' + subtype + ']').addClass('active'); + break; + } + }, + + onApiParagraphAlign: function(align) { + $('#font-right').toggleClass('active', align===0); + $('#font-left').toggleClass('active', align===1); + $('#font-center').toggleClass('active', align===2); + $('#font-just').toggleClass('active', align===3); + }, + + onApiVerticalTextAlign: function(align) { + $('#font-top').toggleClass('active', align===Asc.c_oAscVAlign.Top); + $('#font-middle').toggleClass('active', align===Asc.c_oAscVAlign.Center); + $('#font-bottom').toggleClass('active', align===Asc.c_oAscVAlign.Bottom); + }, + + onApiLineSpacing: function(vc) { + var line = (vc.get_Line() === null || vc.get_LineRule() === null || vc.get_LineRule() != 1) ? -1 : vc.get_Line(); + + $('#page-text-linespacing input').val([line]); + }, + + + onApiCanIncreaseIndent: function(value) { + $('#font-moveright').toggleClass('disabled', !value); + }, + + onApiCanDecreaseIndent: function(value) { + $('#font-moveleft').toggleClass('disabled', !value); + } + } + })(), PE.Controllers.EditParagraph || {})) +}); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditText.js b/apps/presentationeditor/mobile/app/controller/edit/EditText.js new file mode 100644 index 000000000..7247f6e75 --- /dev/null +++ b/apps/presentationeditor/mobile/app/controller/edit/EditText.js @@ -0,0 +1,433 @@ +/* + * + * (c) Copyright Ascensio System Limited 2010-2016 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, + * EU, LV-1021. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +/** + * EditText.js + * Presentation Editor + * + * Created by Alexander Yuzhin on 10/4/16 + * Copyright (c) 2016 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'core', + 'presentationeditor/mobile/app/view/edit/EditText' +], function (core) { + 'use strict'; + + PE.Controllers.EditText = Backbone.Controller.extend(_.extend((function() { + var _fontsArray = [], + _stack = [], + _paragraphObject = undefined, + _fontInfo = {}; + + function onApiLoadFonts(fonts, select) { + _.each(fonts, function(font){ + var fontId = font.asc_getFontId(); + _fontsArray.push({ + id : fontId, + name : font.asc_getFontName(), +// displayValue: font.asc_getFontName(), + imgidx : font.asc_getFontThumbnail(), + type : font.asc_getFontType() + }); + }); + + Common.NotificationCenter.trigger('fonts:load', _fontsArray, select); + } + + return { + models: [], + collections: [], + views: [ + 'EditText' + ], + + initialize: function () { + Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this)); + + this.addListeners({ + 'EditText': { + 'page:show' : this.onPageShow, + 'font:click': this.onFontClick + } + }); + }, + + setApi: function (api) { + var me = this; + me.api = api; + + me.api.asc_registerCallback('asc_onInitEditorFonts', _.bind(onApiLoadFonts, me)); + me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me)); + me.api.asc_registerCallback('asc_onFontFamily', _.bind(me.onApiChangeFont, me)); + me.api.asc_registerCallback('asc_onFontSize', _.bind(me.onApiFontSize, me)); + me.api.asc_registerCallback('asc_onBold', _.bind(me.onApiBold, me)); + me.api.asc_registerCallback('asc_onItalic', _.bind(me.onApiItalic, me)); + me.api.asc_registerCallback('asc_onUnderline', _.bind(me.onApiUnderline, me)); + me.api.asc_registerCallback('asc_onStrikeout', _.bind(me.onApiStrikeout, me)); + me.api.asc_registerCallback('asc_onVerticalAlign', _.bind(me.onApiVerticalAlign, me)); + me.api.asc_registerCallback('asc_onTextColor', _.bind(me.onApiTextColor, me)); + + // me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(this.onApiUpdateThemeIndex, this)); + // me.api.asc_registerCallback('asc_onCanGroup', _.bind(this.onApiCanGroup, this)); + // me.api.asc_registerCallback('asc_onCanUnGroup', _.bind(this.onApiCanUnGroup, this)); + // me.api.asc_registerCallback('asc_onPresentationSize', _.bind(this.onApiPageSize, this)); + // me.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(this.onApiInitEditorStyles, this)); + }, + + onLaunch: function () { + this.createView('EditText').render(); + }, + + initEvents: function () { + var me = this; + $('#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)); + + me.initSettings(); + }, + + onPageShow: function (view, pageId) { + var me = this, + paletteTextColor = me.getView('EditText').paletteTextColor; + + $('#text-additional li').single('click', _.buffered(me.onAdditional, 100, me)); + $('#page-text-linespacing li').single('click', _.buffered(me.onLineSpacing, 100, me)); + $('#font-size .button').single('click', _.bind(me.onFontSize, me)); + $('#letter-spacing .button').single('click', _.bind(me.onLetterSpacing, me)); + + $('.dataview.bullets li').single('click', _.buffered(me.onBullet, 100, me)); + $('.dataview.numbers li').single('click', _.buffered(me.onNumber, 100, me)); + + paletteTextColor && paletteTextColor.on('select', _.bind(me.onTextColor, me)); + + me.initSettings(pageId); + }, + + initSettings: function (pageId) { + var me = this; + + me.api && me.api.UpdateInterfaceState(); // TODO: refactor me + + if (_paragraphObject) { + var $inputStrikethrough = $('#text-additional input[name=text-strikethrough]'); + var $inputTextCaps = $('#text-additional input[name=text-caps]'); + + _paragraphObject.get_Strikeout() && $inputStrikethrough.val(['strikethrough']).prop('prevValue', 'strikethrough'); + _paragraphObject.get_DStrikeout() && $inputStrikethrough.val(['double-strikethrough']).prop('prevValue', 'double-strikethrough'); + + _paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small'); + _paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all'); + + _fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); + $('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); + } + }, + + // Public + + getFonts: function() { + return _fontsArray; + }, + + getStack: function() { + return _stack; + }, + + getFontInfo: function () { + return _fontInfo; + }, + + getParagraph: function () { + return _paragraphObject; + }, + + // Handlers + + onBold: function (e) { + var pressed = this._toggleButton(e); + + if (this.api) { + this.api.put_TextPrBold(pressed); + } + }, + + onItalic: function (e) { + var pressed = this._toggleButton(e); + + if (this.api) { + this.api.put_TextPrItalic(pressed); + } + }, + + onUnderline: function (e) { + var pressed = this._toggleButton(e); + + if (this.api) { + this.api.put_TextPrUnderline(pressed); + } + }, + + onStrikethrough: function (e) { + var pressed = this._toggleButton(e); + + if (this.api) { + this.api.put_TextPrStrikeout(pressed); + } + }, + + onAdditionalStrikethrough : function ($target) { + var value = $target.prop('value'), + checked = $target.prop('checked'), + paragraphProps = new Asc.asc_CParagraphProperty(); + + if ('strikethrough' == value) { + paragraphProps.put_DStrikeout(false); + paragraphProps.put_Strikeout(checked); + } else { + paragraphProps.put_DStrikeout(checked); + paragraphProps.put_Strikeout(false); + } + this.api.paraApply(paragraphProps); + }, + + onAdditionalScript : function ($target) { + var value = $target.prop('value'), + checked = $target.prop('checked'); + + if ('superscript' == value) { + this.api.put_TextPrBaseline(checked ? 1 : 0); + } else { + this.api.put_TextPrBaseline(checked ? 2 : 0); + } + }, + + onAdditionalCaps : function ($target) { + var value = $target.prop('value'), + checked = $target.prop('checked'), + paragraphProps = new Asc.asc_CParagraphProperty(); + + if ('small' == value) { + paragraphProps.put_AllCaps(false); + paragraphProps.put_SmallCaps(checked); + } else { + paragraphProps.put_AllCaps(checked); + paragraphProps.put_SmallCaps(false); + } + + this.api.paraApply(paragraphProps); + }, + + onAdditional: function(e) { + var me = this, + $target = $(e.currentTarget).find('input'), + prevValue = $target.prop('prevValue'); + + if (prevValue == $target.prop('value')) { + $target.prop('checked', false); + prevValue = null; + } else { + $target.prop('checked', true); + prevValue = $target.prop('value'); + } + + $('#page-text-additional input[name="'+ $target.prop('name') +'"]').prop('prevValue', prevValue); + + var radioName = $target.prop('name'); + if ('text-strikethrough' == radioName) { + me.onAdditionalStrikethrough($target); + } else if ('text-script' == radioName) { + me.onAdditionalScript($target); + } else if ('text-caps' == radioName){ + me.onAdditionalCaps($target); + } + }, + + onFontClick: function (view, e) { + var $item = $(e.currentTarget).find('input'); + + if ($item) { + this.api.put_TextPrFontName($item.prop('value')); + } + }, + + onFontSize: function (e) { + var $button = $(e.currentTarget), + fontSize = _fontInfo.size; + + if ($button.hasClass('decrement')) { + _.isUndefined(fontSize) ? this.api.FontSizeOut() : fontSize = Math.max(1, --fontSize); + } else { + _.isUndefined(fontSize) ? this.api.FontSizeIn() : fontSize = Math.min(100, ++fontSize); + } + + if (! _.isUndefined(fontSize)) { + this.api.put_TextPrFontSize(fontSize); + } + }, + + onLetterSpacing: function (e) { + var $button = $(e.currentTarget), + spacing = _fontInfo.letterSpacing; + + if ($button.hasClass('decrement')) { + spacing = Math.max(-100, --spacing); + } else { + spacing = Math.min(100, ++spacing); + } + _fontInfo.letterSpacing = spacing; + + $('#letter-spacing .item-after label').text(spacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); + + var properties = new Asc.asc_CParagraphProperty(); + properties.put_TextSpacing(Common.Utils.Metric.fnRecalcToMM(spacing)); + + this.api.paraApply(properties); + }, + + onTextColor: function (palette, color) { + // $('.btn-color-value-line', this.toolbar.btnFontColor.cmpEl).css('background-color', '#' + clr); + + if (this.api) { + this.api.put_TextColor(Common.Utils.ThemeColor.getRgbColor(color)); + } + }, + + // API handlers + + onApiFocusObject: function (objects) { + _stack = objects; + + var paragraphs = []; + + _.each(_stack, function(object) { + if (object.get_ObjectType() == Asc.c_oAscTypeSelectElement.Paragraph) { + paragraphs.push(object); + } + }); + + if (paragraphs.length > 0) { + var object = paragraphs[paragraphs.length - 1]; // get top + _paragraphObject = object.get_ObjectValue(); + } else { + _paragraphObject = undefined; + } + }, + + onApiChangeFont: function(font) { + var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getName()) || this.textFonts; + _fontInfo.name = name; + + $('#font-fonts .item-title').html(name); + }, + + onApiFontSize: function(size) { + _fontInfo.size = size; + var displaySize = _fontInfo.size; + + _.isUndefined(displaySize) ? displaySize = this.textAuto : displaySize = displaySize + ' ' + this.textPt; + + $('#font-fonts .item-after span:first-child').html(displaySize); + $('#font-size .item-after label').html(displaySize); + }, + + onApiBold: function(on) { + $('#font-bold').toggleClass('active', on); + }, + + onApiItalic: function(on) { + $('#font-italic').toggleClass('active', on); + }, + + onApiUnderline: function(on) { + $('#font-underline').toggleClass('active', on); + }, + + onApiStrikeout: function(on) { + $('#font-strikethrough').toggleClass('active', on); + }, + + onApiVerticalAlign: function(typeBaseline) { + var value; + + typeBaseline==1 && (value = 'superscript'); + typeBaseline==2 && (value = 'subscript'); + + if (!_.isUndefined(value)) { + $('#text-additional input[name=text-script]').val([value]).prop('prevValue', value); + } + }, + + onApiTextColor: function (color) { + var me = this; + + if (color.get_auto()) { + // on auto + } else { + var palette = me.getView('EditText').paletteTextColor, + clr; + + if (color) { + if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { + clr = { + color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), + effectValue: color.get_value() + } + } else { + clr = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()); + } + + $('#font-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr)); + } + + if (palette) { + palette.select(clr); + } + } + }, + + // Helpers + _toggleButton: function (e) { + return $(e.currentTarget).toggleClass('active').hasClass('active'); + }, + + textFonts: 'Fonts', + textAuto: 'Auto', + textPt: 'pt' + } + })(), PE.Controllers.EditText || {})) +}); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/template/EditParagraph.template b/apps/presentationeditor/mobile/app/template/EditParagraph.template new file mode 100644 index 000000000..adc05c599 --- /dev/null +++ b/apps/presentationeditor/mobile/app/template/EditParagraph.template @@ -0,0 +1,219 @@ + +
+
+ +
+
<%= scope.textFromText %>
+
+ +
+
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+
+
+
+ + +
+ +
+
+ <% _.each(bullets, function(row) { %> +
    + <% _.each(row, function(bullet) { %> +
  • + <% if (bullet.thumb.length < 1) { %> +
    + <% } else { %> +
    + <% } %> +
  • + <% }); %> +
+ <% }); %> +
+
+
+ + +
+ +
+
+ <% _.each(numbers, function(row) { %> +
    + <% _.each(row, function(number) { %> +
  • + <% if (number.thumb.length < 1) { %> +
    + <% } else { %> +
    + <% } %> +
  • + <% }); %> +
+ <% }); %> +
+
+
diff --git a/apps/presentationeditor/mobile/app/template/EditText.template b/apps/presentationeditor/mobile/app/template/EditText.template new file mode 100644 index 000000000..daada5abb --- /dev/null +++ b/apps/presentationeditor/mobile/app/template/EditText.template @@ -0,0 +1,194 @@ + +
+
+ +
+
+ + +
+ +
+
+
+
    +
  • +
    +
    +
    <%= scope.textSize %>
    +
    + <% if (!android) { %><% } %> +

    + <% if (android) { %><% } else { %>-<% } %> + <% if (android) { %><% } %> + <% if (android) { %><% } else { %>+<% } %> +

    +
    +
    +
    +
  • +
+
+
<%= scope.textFonts %>
+
+ +
+
+
+
+ + +
+ +
+
+
+
    +
+
+
+
+
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+
+
    +
  • +
    +
    +
    <%= scope.textLetterSpacing %>
    +
    + <% if (!android) { %><% } %> +

    + <% if (android) { %><% } else { %>-<% } %> + <% if (android) { %><% } %> + <% if (android) { %><% } else { %>+<% } %> +

    +
    +
    +
    +
  • +
+
+
+
+
\ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/view/edit/EditParagraph.js b/apps/presentationeditor/mobile/app/view/edit/EditParagraph.js new file mode 100644 index 000000000..58c3b6d8a --- /dev/null +++ b/apps/presentationeditor/mobile/app/view/edit/EditParagraph.js @@ -0,0 +1,172 @@ +/* + * + * (c) Copyright Ascensio System Limited 2010-2016 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, + * EU, LV-1021. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +/** + * EditParagraph.js + * Presentation Editor + * + * Created by Alexander Yuzhin on 10/14/16 + * Copyright (c) 2016 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'text!presentationeditor/mobile/app/template/EditParagraph.template', + 'jquery', + 'underscore', + 'backbone' +], function (editTemplate, $, _, Backbone) { + 'use strict'; + + PE.Views.EditParagraph = Backbone.View.extend(_.extend((function() { + // private + + var _bullets = [ + [ + {type: -1, thumb: ''}, + {type: 1, thumb: 'bullet-01.png'}, + {type: 2, thumb: 'bullet-02.png'}, + {type: 3, thumb: 'bullet-03.png'} + ], + [ + {type: 4, thumb: 'bullet-04.png'}, + {type: 5, thumb: 'bullet-05.png'}, + {type: 6, thumb: 'bullet-06.png'}, + {type: 7, thumb: 'bullet-07.png'} + ] + ]; + + var _numbers = [ + [ + {type: -1, thumb: ''}, + {type: 4, thumb: 'number-01.png'}, + {type: 5, thumb: 'number-02.png'}, + {type: 6, thumb: 'number-03.png'} + ], + [ + {type: 1, thumb: 'number-04.png'}, + {type: 2, thumb: 'number-05.png'}, + {type: 3, thumb: 'number-06.png'}, + {type: 7, thumb: 'number-07.png'} + ] + ]; + + return { + // el: '.view-main', + + template: _.template(editTemplate), + + events: { + }, + + initialize: function () { + Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this)); + }, + + initEvents: function () { + var me = this; + + $('#font-line-spacing').single('click', _.bind(me.showLineSpacing, me)); + $('#font-bullets').single('click', _.bind(me.showBullets, me)); + $('#font-numbers').single('click', _.bind(me.showNumbers, me)); + + PE.getController('EditParagraph').initSettings(); + }, + + // Render layout + render: function () { + this.layout = $('
').append(this.template({ + android : Common.SharedSettings.get('android'), + phone : Common.SharedSettings.get('phone'), + scope : this, + bullets : _bullets, + numbers : _numbers + })); + + return this; + }, + + rootLayout: function () { + if (this.layout) { + return this.layout + .find('#edit-paragraph-root') + .html(); + } + + return ''; + }, + + showPage: function (templateId, suspendEvent) { + var rootView = PE.getController('EditContainer').rootView; + + if (rootView && this.layout) { + var $content = this.layout.find(templateId); + + // Android fix for navigation + if (Framework7.prototype.device.android) { + $content.find('.page').append($content.find('.navbar')); + } + + rootView.router.load({ + content: $content.html() + }); + + if (suspendEvent !== true) { + this.fireEvent('page:show', [this, templateId]); + } + } + }, + + showLineSpacing: function () { + this.showPage('#edit-text-linespacing'); + }, + + showBullets: function () { + this.showPage('#edit-text-bullets'); + }, + + showNumbers: function () { + this.showPage('#edit-text-numbers'); + }, + + textBack: 'Back', + textFromText: 'Distance from Text', + textBefore: 'Before', + textAfter: 'After', + textLineSpacing: 'Line Spacing', + textBullets: 'Bullets', + textNone: 'None', + textNumbers: 'Numbers' + } + })(), PE.Views.EditParagraph || {})) +}); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/app/view/edit/EditText.js b/apps/presentationeditor/mobile/app/view/edit/EditText.js new file mode 100644 index 000000000..34078c2ec --- /dev/null +++ b/apps/presentationeditor/mobile/app/view/edit/EditText.js @@ -0,0 +1,189 @@ +/* + * + * (c) Copyright Ascensio System Limited 2010-2016 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, + * EU, LV-1021. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ + +/** + * EditText.js + * Presentation Editor + * + * Created by Alexander Yuzhin on 10/4/16 + * Copyright (c) 2016 Ascensio System SIA. All rights reserved. + * + */ + +define([ + 'text!presentationeditor/mobile/app/template/EditText.template', + 'jquery', + 'underscore', + 'backbone', + 'common/mobile/lib/component/ThemeColorPalette' +], function (editTemplate, $, _, Backbone) { + 'use strict'; + + PE.Views.EditText = Backbone.View.extend(_.extend((function() { + // private + var _fontsList, + _editTextController; + + return { + // el: '.view-main', + + template: _.template(editTemplate), + + events: { + }, + + initialize: function () { + _editTextController = PE.getController('EditText'); + Common.NotificationCenter.on('editcontainer:show', _.bind(this.initEvents, this)); + }, + + initEvents: function () { + var me = this; + + $('#font-fonts').single('click', _.bind(me.showFonts, me)); + $('#font-color').single('click', _.bind(me.showFontColor, me)); + $('#font-additional').single('click', _.bind(me.showAdditional, me)); + + me.initControls(); + }, + + // Render layout + render: function () { + this.layout = $('
').append(this.template({ + android : Common.SharedSettings.get('android'), + phone : Common.SharedSettings.get('phone'), + scope : this + })); + + return this; + }, + + rootLayout: function () { + if (this.layout) { + return this.layout + .find('#edit-text-root') + .html(); + } + + return ''; + }, + + initControls: function () { + // + }, + + showPage: function (templateId, suspendEvent) { + var rootView = PE.getController('EditContainer').rootView; + + if (rootView && this.layout) { + var $content = this.layout.find(templateId); + + // Android fix for navigation + if (Framework7.prototype.device.android) { + $content.find('.page').append($content.find('.navbar')); + } + + rootView.router.load({ + content: $content.html() + }); + + if (suspendEvent !== true) { + this.fireEvent('page:show', [this, templateId]); + } + } + }, + + showFonts: function () { + this.showPage('#edit-text-fonts'); + + var me = this, + $template = $( + '
' + + '
  • ' + + '' + + '
  • ' + + '
    ' + ); + + _fontsList = uiApp.virtualList('#font-list.virtual-list', { + items: PE.getController('EditText').getFonts(), + template: $template.html(), + onItemsAfterInsert: function (list, fragment) { + var fontInfo = _editTextController.getFontInfo(); + $('#font-list input[name=font-name]').val([fontInfo.name]); + + $('#font-list li').single('click', _.buffered(function (e) { + me.fireEvent('font:click', [me, e]); + }, 100)); + } + }); + }, + + showFontColor: function () { + this.showPage('#edit-text-color', true); + + this.paletteTextColor = new Common.UI.ThemeColorPalette({ + el: $('.page[data-page=edit-text-font-color] .page-content') + }); + + this.fireEvent('page:show', [this, '#edit-text-color']); + }, + + showAdditional: function () { + this.showPage('#edit-text-additional'); + }, + + textFonts: 'Fonts', + textFontColor: 'Font Color', + textAdditionalFormat: 'Additional Formatting', + textBack: 'Back', + textSize: 'Size', + textFontColors: 'Font Colors', + textAutomatic: 'Automatic', + textAdditional: 'Additional', + textStrikethrough: 'Strikethrough', + textDblStrikethrough: 'Double Strikethrough', + textDblSuperscript: 'Superscript', + textSubscript: 'Subscript', + textSmallCaps: 'Small Caps', + textAllCaps: 'All Caps', + textLetterSpacing: 'Letter Spacing' + } + })(), PE.Views.EditText || {})) +}); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/resources/css/app-ios.css b/apps/presentationeditor/mobile/resources/css/app-ios.css index 59620473b..81600650c 100644 --- a/apps/presentationeditor/mobile/resources/css/app-ios.css +++ b/apps/presentationeditor/mobile/resources/css/app-ios.css @@ -6500,3 +6500,36 @@ i.icon.icon-link { height: 100%; background-color: #DF6737; } +.bullets ul, +.numbers ul { + margin-top: 10px; +} +.bullets li, +.numbers li { + width: 70px; + height: 70px; + margin-right: 1px; + border: 1px solid #c4c4c4; +} +html.pixel-ratio-2 .bullets li, +html.pixel-ratio-2 .numbers li { + border: 0.5px solid #c4c4c4; +} +html.pixel-ratio-3 .bullets li, +html.pixel-ratio-3 .numbers li { + border: 0.33px solid #c4c4c4; +} +.bullets li .thumb, +.numbers li .thumb { + width: 100%; + height: 100%; + background-color: #ffffff; + background-size: cover; +} +.bullets li .thumb label, +.numbers li .thumb label { + width: 100%; + text-align: center; + position: absolute; + top: 34%; +} diff --git a/apps/presentationeditor/mobile/resources/css/app-material.css b/apps/presentationeditor/mobile/resources/css/app-material.css index 223fc8886..3563089d2 100644 --- a/apps/presentationeditor/mobile/resources/css/app-material.css +++ b/apps/presentationeditor/mobile/resources/css/app-material.css @@ -6099,3 +6099,36 @@ textarea { height: 100%; background-color: #DF6737; } +.bullets ul, +.numbers ul { + margin-top: 10px; +} +.bullets li, +.numbers li { + width: 70px; + height: 70px; + margin-right: 1px; + border: 1px solid #c4c4c4; +} +html.pixel-ratio-2 .bullets li, +html.pixel-ratio-2 .numbers li { + border: 0.5px solid #c4c4c4; +} +html.pixel-ratio-3 .bullets li, +html.pixel-ratio-3 .numbers li { + border: 0.33px solid #c4c4c4; +} +.bullets li .thumb, +.numbers li .thumb { + width: 100%; + height: 100%; + background-color: #ffffff; + background-size: cover; +} +.bullets li .thumb label, +.numbers li .thumb label { + width: 100%; + text-align: center; + position: absolute; + top: 34%; +} diff --git a/apps/presentationeditor/mobile/resources/img/bullets/bullet-01.png b/apps/presentationeditor/mobile/resources/img/bullets/bullet-01.png new file mode 100644 index 000000000..8409a08a6 Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/bullets/bullet-01.png differ diff --git a/apps/presentationeditor/mobile/resources/img/bullets/bullet-02.png b/apps/presentationeditor/mobile/resources/img/bullets/bullet-02.png new file mode 100644 index 000000000..7b6a9e583 Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/bullets/bullet-02.png differ diff --git a/apps/presentationeditor/mobile/resources/img/bullets/bullet-03.png b/apps/presentationeditor/mobile/resources/img/bullets/bullet-03.png new file mode 100644 index 000000000..bd01e1b0e Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/bullets/bullet-03.png differ diff --git a/apps/presentationeditor/mobile/resources/img/bullets/bullet-04.png b/apps/presentationeditor/mobile/resources/img/bullets/bullet-04.png new file mode 100644 index 000000000..12e27abda Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/bullets/bullet-04.png differ diff --git a/apps/presentationeditor/mobile/resources/img/bullets/bullet-05.png b/apps/presentationeditor/mobile/resources/img/bullets/bullet-05.png new file mode 100644 index 000000000..c553621a6 Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/bullets/bullet-05.png differ diff --git a/apps/presentationeditor/mobile/resources/img/bullets/bullet-06.png b/apps/presentationeditor/mobile/resources/img/bullets/bullet-06.png new file mode 100644 index 000000000..137fbdd3c Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/bullets/bullet-06.png differ diff --git a/apps/presentationeditor/mobile/resources/img/bullets/bullet-07.png b/apps/presentationeditor/mobile/resources/img/bullets/bullet-07.png new file mode 100644 index 000000000..0136e7fed Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/bullets/bullet-07.png differ diff --git a/apps/presentationeditor/mobile/resources/img/numbers/number-01.png b/apps/presentationeditor/mobile/resources/img/numbers/number-01.png new file mode 100644 index 000000000..296f5e082 Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/numbers/number-01.png differ diff --git a/apps/presentationeditor/mobile/resources/img/numbers/number-02.png b/apps/presentationeditor/mobile/resources/img/numbers/number-02.png new file mode 100644 index 000000000..8d0a362a6 Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/numbers/number-02.png differ diff --git a/apps/presentationeditor/mobile/resources/img/numbers/number-03.png b/apps/presentationeditor/mobile/resources/img/numbers/number-03.png new file mode 100644 index 000000000..6912e2a6a Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/numbers/number-03.png differ diff --git a/apps/presentationeditor/mobile/resources/img/numbers/number-04.png b/apps/presentationeditor/mobile/resources/img/numbers/number-04.png new file mode 100644 index 000000000..ffa1fbce3 Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/numbers/number-04.png differ diff --git a/apps/presentationeditor/mobile/resources/img/numbers/number-05.png b/apps/presentationeditor/mobile/resources/img/numbers/number-05.png new file mode 100644 index 000000000..efc0c7f81 Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/numbers/number-05.png differ diff --git a/apps/presentationeditor/mobile/resources/img/numbers/number-06.png b/apps/presentationeditor/mobile/resources/img/numbers/number-06.png new file mode 100644 index 000000000..da293183f Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/numbers/number-06.png differ diff --git a/apps/presentationeditor/mobile/resources/img/numbers/number-07.png b/apps/presentationeditor/mobile/resources/img/numbers/number-07.png new file mode 100644 index 000000000..c6b05f401 Binary files /dev/null and b/apps/presentationeditor/mobile/resources/img/numbers/number-07.png differ diff --git a/apps/presentationeditor/mobile/resources/less/app-ios.less b/apps/presentationeditor/mobile/resources/less/app-ios.less index 622b58f94..d2a67e694 100644 --- a/apps/presentationeditor/mobile/resources/less/app-ios.less +++ b/apps/presentationeditor/mobile/resources/less/app-ios.less @@ -125,4 +125,44 @@ input, textarea { background-color: @themeColor; } } +} + +// Bullets and numbers + +.bullets, +.numbers { + ul { + margin-top: 10px; + } + + li { + width: 70px; + height: 70px; + margin-right: 1px; + border: 1px solid #c4c4c4; + html.pixel-ratio-2 & { + border: 0.5px solid #c4c4c4; + } + html.pixel-ratio-3 & { + border: 0.33px solid #c4c4c4; + } + + &.active { + // + } + + .thumb { + width: 100%; + height: 100%; + background-color: @white; + background-size: cover; + + label { + width: 100%; + text-align: center; + position: absolute; + top: 34%; + } + } + } } \ No newline at end of file diff --git a/apps/presentationeditor/mobile/resources/less/app-material.less b/apps/presentationeditor/mobile/resources/less/app-material.less index d731c9203..25b1283cc 100644 --- a/apps/presentationeditor/mobile/resources/less/app-material.less +++ b/apps/presentationeditor/mobile/resources/less/app-material.less @@ -120,3 +120,43 @@ input, textarea { } } +// Bullets and numbers + +.bullets, +.numbers { + ul { + margin-top: 10px; + } + + li { + width: 70px; + height: 70px; + margin-right: 1px; + border: 1px solid #c4c4c4; + html.pixel-ratio-2 & { + border: 0.5px solid #c4c4c4; + } + html.pixel-ratio-3 & { + border: 0.33px solid #c4c4c4; + } + + &.active { + // + } + + .thumb { + width: 100%; + height: 100%; + background-color: @white; + background-size: cover; + + label { + width: 100%; + text-align: center; + position: absolute; + top: 34%; + } + } + } +} +