Commit 97ec7f09 authored by Julia Radzhabova's avatar Julia Radzhabova

[PE mobile] Join text and paragraph settings into one panel Text.

parent 39c860a8
......@@ -141,7 +141,7 @@ require([
'Settings',
'EditContainer',
'EditText',
'EditParagraph',
// 'EditParagraph',
// 'EditTable',
// 'EditImage',
// 'EditShape',
......@@ -206,7 +206,7 @@ require([
'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/EditParagraph',
// 'presentationeditor/mobile/app/controller/edit/EditTable',
// 'presentationeditor/mobile/app/controller/edit/EditImage',
// 'presentationeditor/mobile/app/controller/edit/EditShape',
......
......@@ -151,8 +151,8 @@ require([
// 'DocumentHolder',
// 'Settings',
// 'EditContainer',
'EditText',
'EditParagraph'
'EditText'
// 'EditParagraph'
// 'EditTable',
// 'EditImage',
// 'EditShape',
......@@ -216,8 +216,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',
......
......@@ -119,7 +119,7 @@ define([
if (_.contains(_settings, 'slide')) {
editors.push({
caption: me.textSlide,
id: 'edit-text',
id: 'edit-slide',
layout: PE.getController('EditText').getView('EditSlide').rootLayout()
})
}
......@@ -130,13 +130,6 @@ define([
layout: PE.getController('EditText').getView('EditText').rootLayout()
})
}
if (_.contains(_settings, 'paragraph')) {
editors.push({
caption: me.textParagraph,
id: 'edit-paragraph',
layout: PE.getController('EditParagraph').getView('EditParagraph').rootLayout()
})
}
if (_.contains(_settings, 'table')) {
editors.push({
caption: me.textTable,
......@@ -331,7 +324,6 @@ define([
var type = object.get_ObjectType();
if (Asc.c_oAscTypeSelectElement.Paragraph == type) {
_settings.push('paragraph');
no_text = false;
} else if (Asc.c_oAscTypeSelectElement.Table == type) {
// _settings.push('table');
......@@ -364,7 +356,6 @@ define([
textSettings: 'Settings',
textText: 'Text',
textParagraph: 'Paragraph',
textTable: 'Table',
textShape: 'Shape',
textImage: 'Image',
......
/*
*
* (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 = $('<div/>').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
......@@ -54,6 +54,36 @@ define([
var _fontsList,
_editTextController;
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',
......@@ -73,8 +103,12 @@ define([
$('#font-fonts').single('click', _.bind(me.showFonts, me));
$('#font-color').single('click', _.bind(me.showFontColor, me));
$('#font-additional').single('click', _.bind(me.showAdditional, me));
$('#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));
me.initControls();
PE.getController('EditText').initSettings();
},
// Render layout
......@@ -82,7 +116,9 @@ define([
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone'),
scope : this
scope : this,
bullets : _bullets,
numbers : _numbers
}));
return this;
......@@ -169,6 +205,18 @@ define([
this.showPage('#edit-text-additional');
},
showLineSpacing: function () {
this.showPage('#edit-text-linespacing');
},
showBullets: function () {
this.showPage('#edit-text-bullets');
},
showNumbers: function () {
this.showPage('#edit-text-numbers');
},
textFonts: 'Fonts',
textFontColor: 'Font Color',
textAdditionalFormat: 'Additional Formatting',
......@@ -183,7 +231,14 @@ define([
textSubscript: 'Subscript',
textSmallCaps: 'Small Caps',
textAllCaps: 'All Caps',
textLetterSpacing: 'Letter Spacing'
textLetterSpacing: 'Letter Spacing',
textFromText: 'Distance from Text',
textBefore: 'Before',
textAfter: 'After',
textLineSpacing: 'Line Spacing',
textBullets: 'Bullets',
textNone: 'None',
textNumbers: 'Numbers'
}
})(), PE.Views.EditText || {}))
});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -195,4 +195,19 @@ i.icon {
height: 22px;
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M12.4,9.8c0,0-2.1-0.1-3.8,1.2c-2.8,2-3.3,4.3-3.3,4.3s1.6-1.7,3.5-2.5c1.7-0.7,3.7-0.4,3.7-0.4v1.9l4.8-3.3V11l-4.8-3.3V9.8z M11,1C5.5,1,1,5.5,1,11c0,5.5,4.5,10,10,10s10-4.5,10-10C21,5.5,16.5,1,11,1z M11,20c-5,0-9-4.1-9-9C2,6,6,2,11,2s9,4.1,9,9C20,16,16,20,11,20z"/></g></svg>');
}
&.icon-text-valign-top {
width: 22px;
height: 22px;
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><rect class="cls-1" x="2" y="2" width="19" height="1"/><rect class="cls-1" x="2" y="4" width="19" height="1"/><polygon class="cls-1" points="12 18 11 18 11 7.83 8.65 9.8 8 8.94 11.5 6 15 9 14.35 9.8 12 7.83 12 18"/></g></svg>');
}
&.icon-text-valign-middle {
width: 22px;
height: 22px;
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><rect class="cls-1" x="2" y="10" width="19" height="1"/><rect class="cls-1" x="2" y="12" width="19" height="1"/><polygon class="cls-1" points="11 2 12 2 12 7.17 14.35 5.2 15 6.06 11.5 9 8 6 8.65 5.2 11 7.17 11 2"/><polygon class="cls-1" points="12 21 11 21 11 15.83 8.65 17.8 8 16.94 11.5 14 15 17 14.35 17.8 12 15.83 12 21"/></g></svg>');
}
&.icon-text-valign-bottom {
width: 22px;
height: 22px;
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><rect class="cls-1" x="2" y="18" width="19" height="1"/><rect class="cls-1" x="2" y="20" width="19" height="1"/><polygon class="cls-1" points="11 4 12 4 12 15.17 14.35 13.2 15 14.06 11.5 17 8 14 8.65 13.2 11 15.17 11 4"/></g></svg>');
}
}
\ No newline at end of file
......@@ -165,6 +165,21 @@ i.icon {
height: 22px;
.encoded-svg-background('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><path d="M12.4,9.8c0,0-2.1-0.1-3.8,1.2c-2.8,2-3.3,4.3-3.3,4.3s1.6-1.7,3.5-2.5c1.7-0.7,3.7-0.4,3.7-0.4v1.9l4.8-3.3V11l-4.8-3.3V9.8z M11,1C5.5,1,1,5.5,1,11c0,5.5,4.5,10,10,10s10-4.5,10-10C21,5.5,16.5,1,11,1z M11,20c-5,0-9-4.1-9-9C2,6,6,2,11,2s9,4.1,9,9C20,16,16,20,11,20z"/></g></svg>');
}
&.icon-text-valign-top {
width: 22px;
height: 22px;
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><rect class="cls-1" x="2" y="2" width="19" height="1"/><rect class="cls-1" x="2" y="4" width="19" height="1"/><polygon class="cls-1" points="12 18 11 18 11 7.83 8.65 9.8 8 8.94 11.5 6 15 9 14.35 9.8 12 7.83 12 18"/></g></svg>');
}
&.icon-text-valign-middle {
width: 22px;
height: 22px;
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><rect class="cls-1" x="2" y="10" width="19" height="1"/><rect class="cls-1" x="2" y="12" width="19" height="1"/><polygon class="cls-1" points="11 2 12 2 12 7.17 14.35 5.2 15 6.06 11.5 9 8 6 8.65 5.2 11 7.17 11 2"/><polygon class="cls-1" points="12 21 11 21 11 15.83 8.65 17.8 8 16.94 11.5 14 15 17 14.35 17.8 12 15.83 12 21"/></g></svg>');
}
&.icon-text-valign-bottom {
width: 22px;
height: 22px;
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{themeColor}"><g><rect class="cls-1" x="2" y="18" width="19" height="1"/><rect class="cls-1" x="2" y="20" width="19" height="1"/><polygon class="cls-1" points="11 4 12 4 12 15.17 14.35 13.2 15 14.06 11.5 17 8 14 8.65 13.2 11 15.17 11 4"/></g></svg>');
}
}
// Overwrite color for toolbar
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment