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
3f8f42ac
Commit
3f8f42ac
authored
Jun 17, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PE] Добавлена настройка ориентации слайда.
parent
210327a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
15 deletions
+63
-15
apps/presentationeditor/main/app/controller/Toolbar.js
apps/presentationeditor/main/app/controller/Toolbar.js
+8
-6
apps/presentationeditor/main/app/view/SlideSizeSettings.js
apps/presentationeditor/main/app/view/SlideSizeSettings.js
+52
-9
apps/presentationeditor/main/locale/en.json
apps/presentationeditor/main/locale/en.json
+3
-0
No files found.
apps/presentationeditor/main/app/controller/Toolbar.js
View file @
3f8f42ac
...
...
@@ -525,9 +525,10 @@ define([
this
.
currentPageSize
.
height
=
height
;
this
.
currentPageSize
.
type
=
-
1
;
var
portrait
=
(
height
>
width
);
for
(
var
i
=
0
;
i
<
this
.
slideSizeArr
.
length
;
i
++
)
{
if
(
Math
.
abs
(
this
.
slideSizeArr
[
i
][
0
]
-
this
.
currentPageSize
.
width
)
<
0.001
&&
Math
.
abs
(
this
.
slideSizeArr
[
i
][
1
]
-
this
.
currentPageSize
.
height
)
<
0.001
)
{
if
(
Math
.
abs
(
this
.
slideSizeArr
[
i
][
portrait
?
1
:
0
]
-
this
.
currentPageSize
.
width
)
<
0.001
&&
Math
.
abs
(
this
.
slideSizeArr
[
i
][
portrait
?
0
:
1
]
-
this
.
currentPageSize
.
height
)
<
0.001
)
{
this
.
currentPageSize
.
type
=
i
;
break
;
}
...
...
@@ -1345,16 +1346,17 @@ define([
onSlideSize
:
function
(
menu
,
item
)
{
if
(
item
.
value
!==
'
advanced
'
)
{
var
portrait
=
(
this
.
currentPageSize
.
height
>
this
.
currentPageSize
.
width
);
this
.
currentPageSize
=
{
type
:
item
.
value
,
width
:
this
.
slideSizeArr
[
item
.
value
][
0
],
height
:
this
.
slideSizeArr
[
item
.
value
][
1
]
width
:
this
.
slideSizeArr
[
item
.
value
][
portrait
?
1
:
0
],
height
:
this
.
slideSizeArr
[
item
.
value
][
portrait
?
0
:
1
]
};
if
(
this
.
api
)
this
.
api
.
changeSlideSize
(
this
.
slideSizeArr
[
item
.
value
][
0
],
this
.
slideSizeArr
[
item
.
value
][
1
]
this
.
slideSizeArr
[
item
.
value
][
portrait
?
1
:
0
],
this
.
slideSizeArr
[
item
.
value
][
portrait
?
0
:
1
]
);
Common
.
NotificationCenter
.
trigger
(
'
edit:complete
'
,
this
.
toolbar
);
...
...
apps/presentationeditor/main/app/view/SlideSizeSettings.js
View file @
3f8f42ac
...
...
@@ -58,12 +58,12 @@ define([
},
options
||
{});
this
.
template
=
[
'
<div class="box" style="height:
95
px;">
'
,
'
<div class="box" style="height:
148
px;">
'
,
'
<div class="input-row">
'
,
'
<label class="text columns-text" style="font-weight: bold;">
'
+
this
.
textSlideSize
+
'
</label>
'
,
'
</div>
'
,
'
<div id="slide-size-combo" class="" style="margin-bottom: 10px;"></div>
'
,
'
<table cols="2" style="width: 100%;margin-bottom:
10
px;">
'
,
'
<table cols="2" style="width: 100%;margin-bottom:
7
px;">
'
,
'
<tr>
'
,
'
<td class="padding-small" style="padding-right: 10px;">
'
,
'
<label class="input-label" style="font-weight: bold;">
'
+
this
.
textWidth
+
'
</label>
'
,
...
...
@@ -75,6 +75,10 @@ define([
'
</td>
'
,
'
</tr>
'
,
'
</table>
'
,
'
<div class="input-row">
'
,
'
<label class="text columns-text" style="font-weight: bold;">
'
+
this
.
textSlideOrientation
+
'
</label>
'
,
'
</div>
'
,
'
<div id="slide-orientation-combo" class="" style="margin-bottom: 10px;"></div>
'
,
'
</div>
'
,
'
<div class="separator horizontal"/>
'
,
'
<div class="footer center">
'
,
...
...
@@ -122,8 +126,12 @@ define([
if
(
record
.
value
<
0
)
{
// set current slide size
}
else
{
this
.
spnWidth
.
setValue
(
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
record
.
size
[
0
]),
true
);
this
.
spnHeight
.
setValue
(
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
record
.
size
[
1
]),
true
);
var
w
=
record
.
size
[
0
],
h
=
record
.
size
[
1
],
orient
=
this
.
cmbSlideOrientation
.
getValue
(),
cond
=
orient
==
0
&&
w
>
h
||
orient
==
1
&&
h
>
w
;
this
.
spnWidth
.
setValue
(
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
cond
?
h
:
w
),
true
);
this
.
spnHeight
.
setValue
(
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
cond
?
w
:
h
),
true
);
}
this
.
_noApply
=
false
;
},
this
));
...
...
@@ -139,8 +147,12 @@ define([
});
this
.
spinners
.
push
(
this
.
spnWidth
);
this
.
spnWidth
.
on
(
'
change
'
,
_
.
bind
(
function
(
field
,
newValue
,
oldValue
,
eOpts
){
if
(
!
this
.
_noApply
&&
this
.
cmbSlideSize
.
getValue
()
>-
1
)
{
this
.
cmbSlideSize
.
setValue
(
-
1
);
if
(
!
this
.
_noApply
)
{
if
(
this
.
cmbSlideSize
.
getValue
()
>-
1
)
this
.
cmbSlideSize
.
setValue
(
-
1
);
var
w
=
this
.
spnWidth
.
getNumberValue
(),
h
=
this
.
spnHeight
.
getNumberValue
();
this
.
cmbSlideOrientation
.
setValue
(
h
>
w
?
0
:
1
);
}
},
this
));
...
...
@@ -155,9 +167,36 @@ define([
});
this
.
spinners
.
push
(
this
.
spnHeight
);
this
.
spnHeight
.
on
(
'
change
'
,
_
.
bind
(
function
(
field
,
newValue
,
oldValue
,
eOpts
){
if
(
!
this
.
_noApply
&&
this
.
cmbSlideSize
.
getValue
()
>-
1
)
{
this
.
cmbSlideSize
.
setValue
(
-
1
);
if
(
!
this
.
_noApply
)
{
if
(
this
.
cmbSlideSize
.
getValue
()
>-
1
)
this
.
cmbSlideSize
.
setValue
(
-
1
);
var
w
=
this
.
spnWidth
.
getNumberValue
(),
h
=
this
.
spnHeight
.
getNumberValue
();
this
.
cmbSlideOrientation
.
setValue
(
h
>
w
?
0
:
1
);
}
},
this
));
this
.
cmbSlideOrientation
=
new
Common
.
UI
.
ComboBox
({
el
:
$
(
'
#slide-orientation-combo
'
),
cls
:
'
input-group-nr
'
,
style
:
'
width: 100%;
'
,
menuStyle
:
'
min-width: 218px;
'
,
editable
:
false
,
data
:
[
{
value
:
0
,
displayValue
:
this
.
strPortrait
},
{
value
:
1
,
displayValue
:
this
.
strLandscape
}
]
});
this
.
cmbSlideOrientation
.
setValue
(
1
);
this
.
cmbSlideOrientation
.
on
(
'
selected
'
,
_
.
bind
(
function
(
combo
,
record
)
{
this
.
_noApply
=
true
;
var
w
=
this
.
spnWidth
.
getNumberValue
(),
h
=
this
.
spnHeight
.
getNumberValue
();
if
(
record
.
value
==
0
&&
w
>
h
||
record
.
value
==
1
&&
h
>
w
)
{
this
.
spnWidth
.
setValue
(
h
,
true
);
this
.
spnHeight
.
setValue
(
w
,
true
);
}
this
.
_noApply
=
false
;
},
this
));
var
$window
=
this
.
getChild
();
...
...
@@ -189,6 +228,7 @@ define([
this
.
spnWidth
.
setValue
(
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
pagewitdh
),
true
);
this
.
spnHeight
.
setValue
(
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
pageheight
),
true
);
this
.
cmbSlideSize
.
setValue
(
type
);
this
.
cmbSlideOrientation
.
setValue
((
pageheight
>
pagewitdh
)
?
0
:
1
);
},
...
...
@@ -225,6 +265,9 @@ define([
txt35
:
'
35 mm Slides
'
,
txtOverhead
:
'
Overhead
'
,
txtBanner
:
'
Banner
'
,
txtCustom
:
'
Custom
'
txtCustom
:
'
Custom
'
,
textSlideOrientation
:
'
Slide Orientation
'
,
strPortrait
:
'
Portrait
'
,
strLandscape
:
'
Landscape
'
},
PE
.
Views
.
SlideSizeSettings
||
{}))
});
\ No newline at end of file
apps/presentationeditor/main/locale/en.json
View file @
3f8f42ac
...
...
@@ -611,7 +611,10 @@
"PE.Views.SlideSettings.txtWood"
:
"Wood"
,
"PE.Views.SlideSizeSettings.cancelButtonText"
:
"Cancel"
,
"PE.Views.SlideSizeSettings.okButtonText"
:
"OK"
,
"PE.Views.SlideSizeSettings.strPortrait"
:
"Portrait"
,
"PE.Views.SlideSizeSettings.strLandscape"
:
"Landscape"
,
"PE.Views.SlideSizeSettings.textHeight"
:
"Height"
,
"PE.Views.SlideSizeSettings.textSlideOrientation"
:
"Slide Orientation"
,
"PE.Views.SlideSizeSettings.textSlideSize"
:
"Slide Size"
,
"PE.Views.SlideSizeSettings.textTitle"
:
"Slide Size Settings"
,
"PE.Views.SlideSizeSettings.textWidth"
:
"Width"
,
...
...
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