Toggle navigation
Toggle navigation
This project
Loading...
Sign in
digsig
/
digsig-player-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Stefan Huber
2017-05-22 16:56:42 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b4610d17737d8422892d1d34b5de55aeac082c88
b4610d17
1 parent
25c9fe3a
chore: interface updated
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
26 deletions
build/bundle.js
build/bundle.js.map
index.d.ts
package.json
src/program-item/program-item-factory.ts
src/program-item/program-item.ts
build/bundle.js
View file @
b4610d1
...
...
@@ -243,6 +243,8 @@ var PROGRAM_ITEM_TYPE_SLIDESHOW = "slideshow";
var
PROGRAM_ITEM_TYPE_VIDEO
=
"video"
;
var
ProgramItem
=
(
function
()
{
function
ProgramItem
()
{
this
.
_type
=
""
;
this
.
_data
=
{};
}
Object
.
defineProperty
(
ProgramItem
.
prototype
,
"type"
,
{
get
:
function
()
{
...
...
@@ -318,14 +320,16 @@ var ProgramItemFactory = (function () {
var
_this
=
this
;
return
this
.
_programRepository
.
findByIds
(
data
.
images
)
.
then
(
function
(
images
)
{
programItem
.
data
=
{
speed
:
data
.
settings
.
speed
,
effect
:
data
.
settings
.
effect
,
images
:
[]
};
for
(
var
_i
=
0
,
images_1
=
images
;
_i
<
images_1
.
length
;
_i
++
)
{
var
image
=
images_1
[
_i
];
programItem
.
data
.
images
.
push
(
_this
.
basePath
+
image
.
filename
);
programItem
.
data
.
speed
=
data
.
settings
.
speed
;
programItem
.
data
.
effect
=
data
.
settings
.
effect
;
programItem
.
data
.
images
=
[];
if
(
images
&&
images
.
length
>
0
)
{
for
(
var
_i
=
0
,
images_1
=
images
;
_i
<
images_1
.
length
;
_i
++
)
{
var
image
=
images_1
[
_i
];
if
(
image
&&
image
.
filename
)
{
programItem
.
data
.
images
.
push
(
_this
.
basePath
+
image
.
filename
);
}
}
}
return
programItem
;
});
...
...
@@ -334,9 +338,7 @@ var ProgramItemFactory = (function () {
var
_this
=
this
;
return
this
.
_programRepository
.
findById
(
data
.
video
)
.
then
(
function
(
data
)
{
programItem
.
data
=
{
video
:
_this
.
basePath
+
data
[
'filename'
]
};
programItem
.
data
.
video
=
_this
.
basePath
+
data
[
'filename'
];
return
programItem
;
});
};
...
...
build/bundle.js.map
View file @
b4610d1
This diff is collapsed. Click to expand it.
index.d.ts
View file @
b4610d1
...
...
@@ -2,7 +2,7 @@ interface ProgramRepository {
findById
(
id
:
string
)
:
Promise
<
any
>
;
findByIds
(
ids
:
Array
<
string
>
)
:
Promise
<
Array
<
any
>>
;
findByType
(
type
:
string
)
:
Promise
<
Array
<
any
>>
;
replicate
()
:
Promise
<
void
>
;
replicate
()
:
Promise
<
boolean
>
;
}
interface
Player
{
...
...
package.json
View file @
b4610d1
...
...
@@ -7,7 +7,7 @@
"scripts"
:
{
"pretest"
:
"tsc --target es5 --outDir .tmp spec/index.ts"
,
"test"
:
"jasmine .tmp/spec/index.js"
,
"posttest"
:
"rm -
R
.tmp"
,
"posttest"
:
"rm -
rf
.tmp"
,
"build:tsc"
:
"rollup -c rollup.config.js"
},
"author"
:
"Stefan Huber <stefan.huber@beyondit.at>"
,
...
...
src/program-item/program-item-factory.ts
View file @
b4610d1
...
...
@@ -50,15 +50,17 @@ export class ProgramItemFactory {
prepareSlideshowItem
(
programItem
:
ProgramItem
,
data
:
any
)
:
Promise
<
ProgramItem
>
{
return
this
.
_programRepository
.
findByIds
(
data
.
images
)
.
then
(
images
=>
{
programItem
.
data
=
{
speed
:
data
.
settings
.
speed
,
effect
:
data
.
settings
.
effect
,
images
:
[]
};
programItem
.
data
.
speed
=
data
.
settings
.
speed
;
programItem
.
data
.
effect
=
data
.
settings
.
effect
;
programItem
.
data
.
images
=
[];
for
(
let
image
of
images
)
{
programItem
.
data
.
images
.
push
(
this
.
basePath
+
image
.
filename
);
}
if
(
images
&&
images
.
length
>
0
)
{
for
(
let
image
of
images
)
{
if
(
image
&&
image
.
filename
)
{
programItem
.
data
.
images
.
push
(
this
.
basePath
+
image
.
filename
);
}
}
}
return
programItem
;
});
...
...
@@ -67,9 +69,7 @@ export class ProgramItemFactory {
prepareVideoItem
(
programItem
:
ProgramItem
,
data
:
any
)
:
Promise
<
ProgramItem
>
{
return
this
.
_programRepository
.
findById
(
data
.
video
)
.
then
((
data
)
=>
{
programItem
.
data
=
{
video
:
this
.
basePath
+
data
[
'filename'
]
};
programItem
.
data
.
video
=
this
.
basePath
+
data
[
'filename'
];
return
programItem
;
});
}
...
...
src/program-item/program-item.ts
View file @
b4610d1
...
...
@@ -3,8 +3,8 @@ export const PROGRAM_ITEM_TYPE_VIDEO = "video";
export
class
ProgramItem
{
protected
_type
:
string
;
protected
_data
:
any
;
protected
_type
:
string
=
""
;
protected
_data
:
any
=
{}
;
set
type
(
t
:
string
)
{
this
.
_type
=
t
;
...
...
Please
register
or
login
to post a comment