Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Infoscreen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evy Storozhenko
Infoscreen
Commits
16918e3c
Commit
16918e3c
authored
8 years ago
by
Hotte
Browse files
Options
Downloads
Patches
Plain Diff
*fixed PanelSkip *Pretty Log
parent
bef6af0d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/layoutloader.js
+20
-21
20 additions, 21 deletions
js/layoutloader.js
with
20 additions
and
21 deletions
js/layoutloader.js
+
20
−
21
View file @
16918e3c
...
...
@@ -69,7 +69,11 @@ layout.createCycler = function (dom, panels, duration_, forceDuration) {
for
(
var
i
=
1
;
i
<=
panels
.
length
;
i
++
)
{
var
j
=
(
i
+
panelIdx
)
%
panels
.
length
;
var
panelDuration
=
panels
[
j
].
inner
.
checkShowCondition
();
if
(
panelDuration
>=
0
)
{
if
(
panelDuration
==
0
)
{
console
.
log
(
"
Layout: Panel skipped
"
);
}
else
if
(
panelDuration
<
0
){
// TODO access default Duration
}
else
if
(
panelDuration
>
0
)
{
gefunden
=
true
;
panels
[
panelIdx
].
inner
.
hide
();
...
...
@@ -83,13 +87,13 @@ layout.createCycler = function (dom, panels, duration_, forceDuration) {
var
realDuration
=
(
realForceDuration
||
(
panelDuration
==
0
))
?
(
panels
[
j
].
inner
.
json
.
duration
||
this
.
duration
)
:
panelDuration
;
panels
[
panelIdx
].
inner
.
show
(
realDuration
);
console
.
log
(
realDuration
);
console
.
log
(
"
Layout: Panelduration
"
+
realDuration
);
interval
=
setTimeout
(
doTick
.
bind
(
c
),
realDuration
*
1000
);
break
;
}
}
if
(
!
gefunden
)
{
layout
.
error
(
"
n
o panel found to show in cycler
D: search
again in
"
+
layout
.
defaultCycleTime
+
"
seconds
"
);
console
.
error
(
"
Layout: N
o panel found to show in cycler
. Try
again in
"
+
layout
.
defaultCycleTime
+
"
seconds
.
"
);
interval
=
setTimeout
(
doTick
.
bind
(
c
),
layout
.
defaultCycleTime
*
1000
);
}
...
...
@@ -184,7 +188,7 @@ layout.processLayout = function (json, container) {
$
(
container
).
append
(
dom
);
json
.
panels
.
forEach
(
function
(
subpanel
)
{
console
.
log
(
subpanel
);
console
.
log
(
"
Layout: Subpanel
"
+
subpanel
);
var
subcont
=
$
(
"
<div>
"
).
attr
(
"
data-container
"
,
"
cycleContainer
"
);
$
(
dom
).
append
(
subcont
);
var
subsubpanel
=
layout
.
processLayout
(
subpanel
,
subcont
);
...
...
@@ -200,7 +204,7 @@ layout.processLayout = function (json, container) {
return
thisCycler
;
case
"
panel
"
:
if
(
json
.
name
==
""
)
{
layout
.
error
(
json
);
console
.
error
(
"
Layout:
"
+
json
);
}
var
innerDOM
=
$
(
"
<div>
"
)
...
...
@@ -216,7 +220,7 @@ layout.processLayout = function (json, container) {
return
panelWrapper
;
default
:
layout
.
error
(
json
);
console
.
error
(
"
Layout:
"
+
json
);
break
;
}
}
...
...
@@ -267,7 +271,7 @@ layout.insertTemplate = function (wrap) {
try
{
panel
.
js
.
hide
.
call
(
panel
.
js
);
}
catch
(
ex
)
{
console
.
log
(
"
Layout:
e
xception when running hide for
"
+
panel
.
name
+
"
\n
"
+
ex
);
console
.
log
(
"
Layout:
E
xception when running hide for
"
+
panel
.
name
+
"
\n
"
+
ex
);
}
}
//show function
...
...
@@ -334,12 +338,12 @@ layout.insertTemplate = function (wrap) {
}
var
n
=
this
.
name
;
$
.
get
(
"
panels/
"
+
n
+
"
/template.html
"
,
function
(
k
)
{
console
.
log
(
"
g
et success
o
f template
"
+
n
)
console
.
log
(
"
Layout: G
et success f
or
template
"
+
n
+
"
.
"
)
e
.
template
=
k
;
doMore
();
},
"
text
"
)
.
fail
(
function
()
{
layout
.
error
(
"
g
et fail
of
template
"
+
n
);
console
.
error
(
"
Layout: G
et fail
ed for
template
"
+
n
+
"
.
"
);
});
...
...
@@ -347,26 +351,26 @@ layout.insertTemplate = function (wrap) {
t
.
css
.
on
(
"
load
"
,
function
()
{
console
.
log
(
"
g
et success
o
f style
"
+
n
);
console
.
log
(
"
Layout: G
et success f
or
style
"
+
n
+
"
.
"
);
e
.
css
=
t
.
css
;
doMore
();
});
/*.fail(function() {
layout
.error("
g
et fail
o
f style " + n);
console
.error("
Layout: G
et fail f
or
style " + n
+ "."
);
});*/
$
(
"
head
"
).
append
(
t
.
css
);
$
.
get
(
"
panels/
"
+
n
+
"
/script.js
"
,
function
(
k
)
{
console
.
log
(
"
g
et success
o
f script
"
+
n
)
console
.
log
(
"
Layout: G
et success f
or
script
"
+
n
+
"
.
"
)
e
.
js
=
k
;
doMore
();
},
"
text
"
)
.
fail
(
function
(
e
)
{
layout
.
error
(
"
g
et fail
o
f script
"
+
n
);
console
.
log
(
e
);
console
.
error
(
"
Layout: G
et fail f
or
script
"
+
n
+
"
.
"
);
console
.
log
(
"
Layout:
"
+
e
);
});
}
...
...
@@ -376,7 +380,7 @@ layout.insertTemplate = function (wrap) {
layout
.
loadLayout
=
function
(
layoutname
)
{
var
w
=
"
config/layouts/
"
+
layoutname
+
"
.json
"
;
console
.
log
(
w
);
console
.
log
(
"
Layout:
"
+
w
);
$
.
get
(
w
,
function
(
e
)
{
var
mainLayout
=
layout
.
processLayout
(
e
,
$
(
"
[data-container=main]
"
));
...
...
@@ -391,11 +395,6 @@ layout.loadLayout = function (layoutname) {
}
}).
fail
(
function
()
{
layout
.
error
(
"
g
et fail
"
);
console
.
error
(
"
Layout: G
et fail
"
);
});
}
layout
.
error
=
function
(
e
)
{
console
.
error
(
"
Layout: Error
"
+
e
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment