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
e1991660
Commit
e1991660
authored
Dec 20, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PE mobile] Add slide size settings.
parent
90ffc633
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
3 deletions
+80
-3
apps/presentationeditor/mobile/app/controller/Settings.js
apps/presentationeditor/mobile/app/controller/Settings.js
+33
-1
apps/presentationeditor/mobile/app/template/Settings.template
.../presentationeditor/mobile/app/template/Settings.template
+36
-0
apps/presentationeditor/mobile/app/view/Settings.js
apps/presentationeditor/mobile/app/view/Settings.js
+11
-2
No files found.
apps/presentationeditor/mobile/app/controller/Settings.js
View file @
e1991660
...
...
@@ -54,6 +54,10 @@ define([
infoObj
,
modalView
;
var
_slideSizeArr
=
[
[
254
,
190.5
],
[
254
,
143
]
];
return
{
models
:
[],
collections
:
[],
...
...
@@ -74,6 +78,8 @@ define([
setApi
:
function
(
api
)
{
this
.
api
=
api
;
this
.
api
.
asc_registerCallback
(
'
asc_onPresentationSize
'
,
_
.
bind
(
this
.
onApiPageSize
,
this
));
},
onLaunch
:
function
()
{
...
...
@@ -137,17 +143,35 @@ define([
}
},
onPageShow
:
function
(
view
)
{
onPageShow
:
function
(
view
,
pageId
)
{
var
me
=
this
;
$
(
'
#settings-search
'
).
single
(
'
click
'
,
_
.
bind
(
me
.
_onSearch
,
me
));
$
(
'
#settings-readermode input:checkbox
'
).
single
(
'
change
'
,
_
.
bind
(
me
.
_onReaderMode
,
me
));
$
(
'
#settings-edit-presentation
'
).
single
(
'
click
'
,
_
.
bind
(
me
.
_onEditPresentation
,
me
));
$
(
modalView
).
find
(
'
.formats a
'
).
single
(
'
click
'
,
_
.
bind
(
me
.
_onSaveFormat
,
me
));
$
(
'
#page-settings-setup-view li
'
).
single
(
'
click
'
,
_
.
bind
(
me
.
_onSlideSize
,
me
));
me
.
initSettings
(
pageId
);
},
initSettings
:
function
(
pageId
)
{
var
me
=
this
;
if
(
pageId
==
'
#settings-setup-view
'
)
{
me
.
onApiPageSize
(
me
.
api
.
get_PresentationWidth
(),
me
.
api
.
get_PresentationHeight
());
}
},
// API handlers
onApiPageSize
:
function
(
width
,
height
)
{
for
(
var
i
=
0
;
i
<
_slideSizeArr
.
length
;
i
++
)
{
if
(
Math
.
abs
(
_slideSizeArr
[
i
][
0
]
-
width
)
<
0.001
&&
Math
.
abs
(
_slideSizeArr
[
i
][
1
]
-
height
)
<
0.001
)
{
$
(
'
#page-settings-setup-view input
'
).
val
([
i
]);
break
;
}
}
},
_onApiDocumentName
:
function
(
name
)
{
$
(
'
#settings-presentation-title
'
).
html
(
name
?
name
:
'
-
'
);
},
...
...
@@ -195,6 +219,14 @@ define([
me
.
hideModal
();
},
_onSlideSize
:
function
(
e
)
{
var
$target
=
$
(
e
.
currentTarget
).
find
(
'
input
'
);
if
(
$target
&&
this
.
api
)
{
var
value
=
parseFloat
(
$target
.
prop
(
'
value
'
));
this
.
api
.
changeSlideSize
(
_slideSizeArr
[
value
][
0
],
_slideSizeArr
[
value
][
1
]);
}
},
txtLoading
:
'
Loading...
'
,
notcriticalErrorTitle
:
'
Warning
'
,
warnDownloadAs
:
'
If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?
'
...
...
apps/presentationeditor/mobile/app/template/Settings.template
View file @
e1991660
...
...
@@ -235,4 +235,40 @@
</div>
</div>
</div>
</div>
<div id="settings-setup-view">
<div class="navbar">
<div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></a></div>
<div class="center sliding"><%= scope.textSlideSize %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
<div class="page" id="page-settings-setup-view" data-page="settings-setup-view">
<div class="page-content">
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="slide-size" value="0">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.mniSlideStandard %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="slide-size" value="1">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.mniSlideWide %></div>
</div>
</label>
</li>
</ul>
</div>
</div>
</div>
</div>
\ No newline at end of file
apps/presentationeditor/mobile/app/view/Settings.js
View file @
e1991660
...
...
@@ -74,6 +74,7 @@ define([
$
(
'
#settings-history
'
).
single
(
'
click
'
,
_
.
bind
(
me
.
showHistory
,
me
));
$
(
'
#settings-help
'
).
single
(
'
click
'
,
_
.
bind
(
me
.
showHelp
,
me
));
$
(
'
#settings-about
'
).
single
(
'
click
'
,
_
.
bind
(
me
.
showAbout
,
me
));
$
(
'
#settings-presentation-setup
'
).
single
(
'
click
'
,
_
.
bind
(
me
.
showSetup
,
me
));
me
.
initControls
();
},
...
...
@@ -103,6 +104,7 @@ define([
$layour
.
find
(
'
#settings-readermode
'
).
hide
();
$layour
.
find
(
'
#settings-search .item-title
'
).
text
(
this
.
textFindAndReplace
)
}
else
{
$layour
.
find
(
'
#settings-presentation-setup
'
).
hide
();
$layour
.
find
(
'
#settings-readermode input:checkbox
'
)
.
attr
(
'
checked
'
,
Common
.
SharedSettings
.
get
(
'
readerMode
'
))
.
prop
(
'
checked
'
,
Common
.
SharedSettings
.
get
(
'
readerMode
'
));
...
...
@@ -133,7 +135,7 @@ define([
content
:
$content
.
html
()
});
this
.
fireEvent
(
'
page:show
'
,
this
);
this
.
fireEvent
(
'
page:show
'
,
[
this
,
templateId
]
);
}
},
...
...
@@ -165,6 +167,10 @@ define([
this
.
showPage
(
'
#settings-about-view
'
);
},
showSetup
:
function
()
{
this
.
showPage
(
'
#settings-setup-view
'
);
},
loadDocument
:
function
(
data
)
{
var
permissions
=
{};
...
...
@@ -196,7 +202,10 @@ define([
textVersion
:
'
Version
'
,
textAddress
:
'
address
'
,
textEmail
:
'
email
'
,
textTel
:
'
tel
'
textTel
:
'
tel
'
,
textSlideSize
:
'
Slide Size
'
,
mniSlideStandard
:
'
Standard (4:3)
'
,
mniSlideWide
:
'
Widescreen (16:9)
'
}
})(),
PE
.
Views
.
Settings
||
{}))
});
\ No newline at end of file
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