Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
web-apps
Commits
02230651
Commit
02230651
authored
Nov 28, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PE mobile] Add shapes.
parent
8754588b
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
391 additions
and
67 deletions
+391
-67
apps/presentationeditor/mobile/app-dev.js
apps/presentationeditor/mobile/app-dev.js
+4
-4
apps/presentationeditor/mobile/app.js
apps/presentationeditor/mobile/app.js
+6
-6
apps/presentationeditor/mobile/app/controller/add/AddContainer.js
...sentationeditor/mobile/app/controller/add/AddContainer.js
+3
-1
apps/presentationeditor/mobile/app/controller/add/AddShape.js
.../presentationeditor/mobile/app/controller/add/AddShape.js
+232
-0
apps/presentationeditor/mobile/app/template/AddShape.template
.../presentationeditor/mobile/app/template/AddShape.template
+14
-0
apps/presentationeditor/mobile/app/view/add/AddShape.js
apps/presentationeditor/mobile/app/view/add/AddShape.js
+98
-0
apps/presentationeditor/mobile/resources/css/app-ios.css
apps/presentationeditor/mobile/resources/css/app-ios.css
+18
-38
apps/presentationeditor/mobile/resources/css/app-material.css
.../presentationeditor/mobile/resources/css/app-material.css
+16
-18
No files found.
apps/presentationeditor/mobile/app-dev.js
View file @
02230651
...
...
@@ -147,9 +147,9 @@ require([
'
EditShape
'
,
// 'EditChart',
// 'EditHyperlink',
'
AddContainer
'
'
AddContainer
'
,
// 'AddTable',
// 'AddShape',
'
AddShape
'
// 'AddImage',
// 'AddOther'
]
...
...
@@ -212,9 +212,9 @@ require([
'
presentationeditor/mobile/app/controller/edit/EditShape
'
,
// 'presentationeditor/mobile/app/controller/edit/EditChart',
// 'presentationeditor/mobile/app/controller/edit/EditHyperlink',
'
presentationeditor/mobile/app/controller/add/AddContainer
'
'
presentationeditor/mobile/app/controller/add/AddContainer
'
,
// 'presentationeditor/mobile/app/controller/add/AddTable',
// 'presentationeditor/mobile/app/controller/add/AddShape',
'
presentationeditor/mobile/app/controller/add/AddShape
'
// 'presentationeditor/mobile/app/controller/add/AddImage',
// 'presentationeditor/mobile/app/controller/add/AddOther'
...
...
apps/presentationeditor/mobile/app.js
View file @
02230651
...
...
@@ -155,12 +155,12 @@ require([
// 'EditParagraph'
// 'EditTable',
// 'EditImage',
'
EditShape
'
'
EditShape
'
,
// 'EditChart',
// 'EditHyperlink',
//
'AddContainer',
'
AddContainer
'
,
// 'AddTable',
// 'AddShape',
'
AddShape
'
// 'AddImage',
// 'AddOther'
]
...
...
@@ -220,12 +220,12 @@ require([
// 'presentationeditor/mobile/app/controller/edit/EditParagraph'
// 'presentationeditor/mobile/app/controller/edit/EditTable',
// 'presentationeditor/mobile/app/controller/edit/EditImage',
'
presentationeditor/mobile/app/controller/edit/EditShape
'
'
presentationeditor/mobile/app/controller/edit/EditShape
'
,
// 'presentationeditor/mobile/app/controller/edit/EditChart',
// 'presentationeditor/mobile/app/controller/edit/EditHyperlink',
//
'presentationeditor/mobile/app/controller/add/AddContainer',
'
presentationeditor/mobile/app/controller/add/AddContainer
'
,
// 'presentationeditor/mobile/app/controller/add/AddTable',
// 'presentationeditor/mobile/app/controller/add/AddShape',
'
presentationeditor/mobile/app/controller/add/AddShape
'
// 'presentationeditor/mobile/app/controller/add/AddImage',
// 'presentationeditor/mobile/app/controller/add/AddOther'
],
function
()
{
...
...
apps/presentationeditor/mobile/app/controller/add/AddContainer.js
View file @
02230651
...
...
@@ -118,7 +118,9 @@ define([
addViews
.
push
({
caption
:
me
.
textShape
,
id
:
'
add-shape
'
,
layout
:
me
.
_dummyEditController
().
getLayout
()
layout
:
PE
.
getController
(
'
AddShape
'
)
.
getView
(
'
AddShape
'
)
.
rootLayout
()
});
addViews
.
push
({
...
...
apps/presentationeditor/mobile/app/controller/add/AddShape.js
0 → 100644
View file @
02230651
/*
*
* (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
*
*/
/**
* AddShape.js
* Presentation Editor
*
* Created by Julia Radzhabova on 11/28/16
* Copyright (c) 2016 Ascensio System SIA. All rights reserved.
*
*/
define
([
'
core
'
,
'
presentationeditor/mobile/app/view/add/AddShape
'
],
function
(
core
)
{
'
use strict
'
;
PE
.
Controllers
.
AddShape
=
Backbone
.
Controller
.
extend
(
_
.
extend
((
function
()
{
var
_styles
=
[];
return
{
models
:
[],
collections
:
[],
views
:
[
'
AddShape
'
],
initialize
:
function
()
{
Common
.
NotificationCenter
.
on
(
'
addcontainer:show
'
,
_
.
bind
(
this
.
initEvents
,
this
));
// Fill shapes
function
randomColor
()
{
return
'
#
'
+
Math
.
floor
(
Math
.
random
()
*
16777215
).
toString
(
16
);
}
_styles
=
[
{
title
:
'
Text
'
,
thumb
:
'
shape-01.svg
'
,
type
:
'
textRect
'
},
{
title
:
'
Line
'
,
thumb
:
'
shape-02.svg
'
,
type
:
'
line
'
},
{
title
:
'
Line with arrow
'
,
thumb
:
'
shape-03.svg
'
,
type
:
'
lineWithArrow
'
},
{
title
:
'
Line with two arrows
'
,
thumb
:
'
shape-04.svg
'
,
type
:
'
lineWithTwoArrows
'
},
{
title
:
'
Rect
'
,
thumb
:
'
shape-05.svg
'
,
type
:
'
rect
'
},
{
title
:
'
Hexagon
'
,
thumb
:
'
shape-06.svg
'
,
type
:
'
hexagon
'
},
{
title
:
'
Round rect
'
,
thumb
:
'
shape-07.svg
'
,
type
:
'
roundRect
'
},
{
title
:
'
Ellipse
'
,
thumb
:
'
shape-08.svg
'
,
type
:
'
ellipse
'
},
{
title
:
'
Triangle
'
,
thumb
:
'
shape-09.svg
'
,
type
:
'
triangle
'
},
{
title
:
'
Triangle
'
,
thumb
:
'
shape-10.svg
'
,
type
:
'
rtTriangle
'
},
{
title
:
'
Trapezoid
'
,
thumb
:
'
shape-11.svg
'
,
type
:
'
trapezoid
'
},
{
title
:
'
Diamond
'
,
thumb
:
'
shape-12.svg
'
,
type
:
'
diamond
'
},
{
title
:
'
Right arrow
'
,
thumb
:
'
shape-13.svg
'
,
type
:
'
rightArrow
'
},
{
title
:
'
Left-right arrow
'
,
thumb
:
'
shape-14.svg
'
,
type
:
'
leftRightArrow
'
},
{
title
:
'
Left arrow callout
'
,
thumb
:
'
shape-15.svg
'
,
type
:
'
leftArrowCallout
'
},
{
title
:
'
Right arrow callout
'
,
thumb
:
'
shape-16.svg
'
,
type
:
'
rightArrowCallout
'
},
{
title
:
'
Flow chart off page connector
'
,
thumb
:
'
shape-17.svg
'
,
type
:
'
flowChartOffpageConnector
'
},
{
title
:
'
Heart
'
,
thumb
:
'
shape-18.svg
'
,
type
:
'
heart
'
},
{
title
:
'
Math minus
'
,
thumb
:
'
shape-19.svg
'
,
type
:
'
mathMinus
'
},
{
title
:
'
Math plus
'
,
thumb
:
'
shape-20.svg
'
,
type
:
'
mathPlus
'
},
{
title
:
'
Parallelogram
'
,
thumb
:
'
shape-21.svg
'
,
type
:
'
parallelogram
'
},
{
title
:
'
Wedge rect callout
'
,
thumb
:
'
shape-22.svg
'
,
type
:
'
wedgeRectCallout
'
},
{
title
:
'
Wedge ellipse callout
'
,
thumb
:
'
shape-23.svg
'
,
type
:
'
wedgeEllipseCallout
'
},
{
title
:
'
Cloud callout
'
,
thumb
:
'
shape-24.svg
'
,
type
:
'
cloudCallout
'
}
];
var
elementsInRow
=
4
;
var
groups
=
_
.
chain
(
_styles
).
groupBy
(
function
(
element
,
index
){
return
Math
.
floor
(
index
/
elementsInRow
);
}).
toArray
().
value
();
Common
.
SharedSettings
.
set
(
'
shapes
'
,
groups
);
Common
.
NotificationCenter
.
trigger
(
'
shapes:load
'
,
groups
);
},
setApi
:
function
(
api
)
{
this
.
api
=
api
;
},
onLaunch
:
function
()
{
this
.
createView
(
'
AddShape
'
).
render
();
},
initEvents
:
function
()
{
var
me
=
this
;
$
(
'
#add-shape li
'
).
single
(
'
click
'
,
_
.
buffered
(
me
.
onShapeClick
,
100
,
me
));
},
onShapeClick
:
function
(
e
)
{
var
me
=
this
,
$target
=
$
(
e
.
currentTarget
);
if
(
$target
&&
me
.
api
)
{
me
.
api
.
AddShapeOnCurrentPage
(
$target
.
data
(
'
type
'
));
}
PE
.
getController
(
'
AddContainer
'
).
hideModal
();
},
// Public
getStyles
:
function
()
{
return
_styles
;
}
}
})(),
PE
.
Controllers
.
AddShape
||
{}))
});
\ No newline at end of file
apps/presentationeditor/mobile/app/template/AddShape.template
0 → 100644
View file @
02230651
<!-- Root view -->
<div id="add-shapes-root">
<div class="page-content dataview shapes">
<% _.each(shapes, function(row) { %>
<ul class="row">
<% _.each(row, function(shape) { %>
<li data-type="<%= shape.type %>">
<div class="thumb" style="-webkit-mask-image:url('../mobile/resources/img/shapes/<%= shape.thumb %>')"></div>
</li>
<% }); %>
</ul>
<% }); %>
</div>
</div>
\ No newline at end of file
apps/presentationeditor/mobile/app/view/add/AddShape.js
0 → 100644
View file @
02230651
/*
*
* (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
*
*/
/**
* AddShape.js
* Presentation Editor
*
* Created by Julia Radzhabova on 11/28/16
* Copyright (c) 2016 Ascensio System SIA. All rights reserved.
*
*/
define
([
'
text!presentationeditor/mobile/app/template/AddShape.template
'
,
'
jquery
'
,
'
underscore
'
,
'
backbone
'
],
function
(
addTemplate
,
$
,
_
,
Backbone
)
{
'
use strict
'
;
PE
.
Views
.
AddShape
=
Backbone
.
View
.
extend
(
_
.
extend
((
function
()
{
// private
return
{
// el: '.view-main',
template
:
_
.
template
(
addTemplate
),
events
:
{
},
initialize
:
function
()
{
Common
.
NotificationCenter
.
on
(
'
addcontainer:show
'
,
_
.
bind
(
this
.
initEvents
,
this
));
Common
.
NotificationCenter
.
on
(
'
shapes:load
'
,
_
.
bind
(
this
.
render
,
this
));
},
initEvents
:
function
()
{
this
.
initControls
();
},
// Render layout
render
:
function
()
{
this
.
layout
=
$
(
'
<div/>
'
).
append
(
this
.
template
({
android
:
Common
.
SharedSettings
.
get
(
'
android
'
),
phone
:
Common
.
SharedSettings
.
get
(
'
phone
'
),
shapes
:
Common
.
SharedSettings
.
get
(
'
shapes
'
)
}));
return
this
;
},
rootLayout
:
function
()
{
if
(
this
.
layout
)
{
return
this
.
layout
.
find
(
'
#add-shapes-root
'
)
.
html
();
}
return
''
;
},
initControls
:
function
()
{
//
}
}
})(),
PE
.
Views
.
AddShape
||
{}))
});
\ No newline at end of file
apps/presentationeditor/mobile/resources/css/app-ios.css
View file @
02230651
This diff is collapsed.
Click to expand it.
apps/presentationeditor/mobile/resources/css/app-material.css
View file @
02230651
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment