Commit 05431979 authored by Julia Radzhabova's avatar Julia Radzhabova

[PE] Added equations.

parent 0a853a9c
/*
*
* (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
*
*/
/**
* EquationGroups.js
*
* Created by Alexey Musinov on 29/10/14
* Copyright (c) 2014 Ascensio System SIA. All rights reserved.
*
*/
define([
'backbone',
'presentationeditor/main/app/model/EquationGroup'
], function(Backbone){ 'use strict';
if (Common === undefined)
var Common = {};
Common.Collections = Common.Collections || {};
PE.Collections.EquationGroups = Backbone.Collection.extend({
model: PE.Models.EquationGroup
});
});
......@@ -50,7 +50,8 @@ define([
'common/main/lib/collection/TextArt',
'common/main/lib/view/OpenDialog',
'presentationeditor/main/app/collection/ShapeGroups',
'presentationeditor/main/app/collection/SlideLayouts'
'presentationeditor/main/app/collection/SlideLayouts',
'presentationeditor/main/app/collection/EquationGroups'
], function () { 'use strict';
PE.Controllers.Main = Backbone.Controller.extend(_.extend((function() {
......@@ -72,6 +73,7 @@ define([
collections: [
'ShapeGroups',
'SlideLayouts',
'EquationGroups',
'Common.Collections.TextArt'
],
views: [],
......
/*
*
* (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
*
*/
/**
* EquationGroup.js
*
* Created by Alexey Musinov on 29/10/14
* Copyright (c) 2014 Ascensio System SIA. All rights reserved.
*
*/
define([
'backbone'
], function(Backbone){ 'use strict';
PE.Models = PE.Models || {};
PE.Models.EquationModel = Backbone.Model.extend({
defaults: function() {
return {
id : Common.UI.getId(),
data : null,
width : 0,
height : 0,
posX : 0,
posY : 0
}
}
});
PE.Models.EquationGroup = Backbone.Model.extend({
defaults: function() {
return {
id : Common.UI.getId(),
groupName : null,
groupId : null,
groupStore : null
}
}
});
});
......@@ -163,6 +163,7 @@
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-insertimage"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-insertchart"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-inserttext"></span>
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-insertequation"></span>
</div>
<div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-full-placeholder-btn-inserttable"></span>
......
......@@ -80,7 +80,8 @@ define([
noObjectSelected: 'no-object',
disableOnStart: 'on-start',
cantPrint: 'cant-print',
noTextSelected: 'no-text'
noTextSelected: 'no-text',
inEquation: 'in-equation'
};
PE.Views.Toolbar = Backbone.View.extend(_.extend({
......@@ -297,7 +298,7 @@ define([
id : 'id-toolbar-btn-superscript',
cls : 'btn-toolbar',
iconCls : 'btn-superscript',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock, _set.inEquation],
enableToggle: true,
toggleGroup : 'superscriptGroup'
});
......@@ -307,7 +308,7 @@ define([
id : 'id-toolbar-btn-subscript',
cls : 'btn-toolbar',
iconCls : 'btn-subscript',
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock],
lock : [_set.slideDeleted, _set.paragraphLock, _set.lostConnect, _set.noSlides, _set.noTextSelected, _set.shapeLock, _set.inEquation],
enableToggle: true,
toggleGroup : 'superscriptGroup'
});
......@@ -632,6 +633,16 @@ define([
});
me.slideOnlyControls.push(me.btnInsertText);
this.btnInsertEquation = new Common.UI.Button({
id : 'id-toolbar-btn-insertequation',
cls : 'btn-toolbar',
iconCls : 'btn-insertequation',
lock : [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
split : true,
menu : new Common.UI.Menu({cls: 'menu-shapes'})
});
this.slideOnlyControls.push(this.btnInsertEquation);
me.btnInsertHyperlink = new Common.UI.Button({
id : 'id-toolbar-btn-inserthyperlink',
cls : 'btn-toolbar',
......@@ -899,7 +910,7 @@ define([
this.btnSubscript, this.btnFontColor, this.btnClearStyle, this.btnCopyStyle, this.btnMarkers,
this.btnNumbers, this.btnDecLeftOffset, this.btnIncLeftOffset, this.btnLineSpace, this.btnHorizontalAlign,
this.btnVerticalAlign, this.btnShapeArrange, this.btnShapeAlign, this.btnInsertTable, this.btnInsertImage,
this.btnInsertChart, this.btnInsertText,
this.btnInsertChart, this.btnInsertText, this.btnInsertEquation,
this.btnInsertHyperlink, this.btnInsertShape, this.btnColorSchemas, this.btnSlideSize, this.listTheme, this.mnuShowSettings
];
......@@ -1034,6 +1045,7 @@ define([
replacePlacholder('#id-toolbar-' + prefix + '-placeholder-btn-align-shape', this.btnShapeAlign);
replacePlacholder('#id-toolbar-' + prefix + '-placeholder-btn-insertshape', this.btnInsertShape);
replacePlacholder('#id-toolbar-' + prefix + '-placeholder-btn-inserttext', this.btnInsertText);
replacePlacholder('#id-toolbar-' + prefix + '-placeholder-btn-insertequation', this.btnInsertEquation);
replacePlacholder('#id-toolbar-' + prefix + '-placeholder-btn-inserthyperlink',this.btnInsertHyperlink);
replacePlacholder('#id-toolbar-' + prefix + '-placeholder-btn-inserttable', this.btnInsertTable);
replacePlacholder('#id-toolbar-' + prefix + '-placeholder-btn-insertimage', this.btnInsertImage);
......@@ -1080,6 +1092,7 @@ define([
this.btnInsertImage.updateHint(this.tipInsertImage);
this.btnInsertChart.updateHint(this.tipInsertChart);
this.btnInsertText.updateHint(this.tipInsertText);
this.btnInsertEquation.updateHint(this.tipInsertEquation);
this.btnInsertHyperlink.updateHint(this.tipInsertHyperlink + Common.Utils.String.platformKey('Ctrl+K'));
this.btnInsertShape.updateHint(this.tipInsertShape);
this.btnColorSchemas.updateHint(this.tipColorSchemas);
......@@ -1397,6 +1410,10 @@ define([
if (me.listTheme.menuPicker.store.length > 0 && listStylesVisible){
me.listTheme.fillComboView(me.listTheme.menuPicker.getSelectedRec(), true);
}
if (me.btnInsertEquation.rendered)
PE.getController('Toolbar').fillEquations();
}, 100);
}
......@@ -1694,6 +1711,7 @@ define([
textInsTextArt: 'Insert Text Art',
textShowBegin: 'Show from Beginning',
textShowCurrent: 'Show from Current slide',
textShowSettings: 'Show Settings'
textShowSettings: 'Show Settings',
tipInsertEquation: 'Insert Equation'
}, PE.Views.Toolbar || {}));
});
\ No newline at end of file
This diff is collapsed.
......@@ -344,6 +344,7 @@
.toolbar-btn-icon(btn-zoomin, 61, @toolbar-icon-size);
.toolbar-btn-icon(btn-zoomout, 60, @toolbar-icon-size);
.toolbar-btn-icon(btn-save-coauth, 69, @toolbar-icon-size);
.toolbar-btn-icon(btn-insertequation, 74, @toolbar-icon-size);
// add slide
.btn-toolbar .btn-addslide {background-position: 0 -120px;}
......@@ -393,4 +394,9 @@
color: #ffffff;
font: 11px arial;
white-space: nowrap;
}
.item-equation {
border: 1px solid @gray;
.background-ximage('@{app-image-path}/toolbar/math.png', '@{app-image-path}/toolbar/math@2x.png', 1500px);
}
\ No newline at end of file
......@@ -2128,7 +2128,7 @@ define([
},
onInsertEquationClick: function() {
if (this.api && !this._state.in_equation) {
if (this.api) {
this.api.asc_AddMath();
Common.component.Analytics.trackEvent('ToolBar', 'Add Equation');
}
......
......@@ -1464,6 +1464,7 @@
"SSE.Views.Toolbar.tipIncDecimal": "Increase Decimal",
"SSE.Views.Toolbar.tipIncFont": "Increment font size",
"SSE.Views.Toolbar.tipInsertChart": "Insert Chart",
"SSE.Views.Toolbar.tipInsertEquation": "Insert Equation",
"SSE.Views.Toolbar.tipInsertHyperlink": "Add Hyperlink",
"SSE.Views.Toolbar.tipInsertImage": "Insert Picture",
"SSE.Views.Toolbar.tipInsertOpt": "Insert Cells",
......
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