Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sourcemlbundle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dj3c1t
sourcemlbundle
Commits
f3b287b7
Commit
f3b287b7
authored
Dec 05, 2015
by
dj3c1t
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init source buttons after load
parent
c8e9cf55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
63 deletions
+71
-63
base.html.twig
Resources/views/base.html.twig
+71
-63
No files found.
Resources/views/base.html.twig
View file @
f3b287b7
...
...
@@ -25,77 +25,85 @@ $(document).ready(
);
}
init_players
(
$
(
"#main"
));
function
init_sources_buttons
(
container
)
{
$
(
".toggle_composition_sources"
).
click
(
function
()
{
var
source_id
=
$
(
this
).
data
(
"source-id"
);
var
contentDiv
=
$
(
"#source_"
+
source_id
+
" .composition_sources .loaded"
).
first
();
if
(
contentDiv
.
html
())
{
contentDiv
.
slideUp
(
400
,
function
()
{
contentDiv
.
html
(
""
);
container
.
find
(
".toggle_composition_sources"
).
click
(
function
()
{
var
source_id
=
$
(
this
).
data
(
"source-id"
);
var
contentDiv
=
$
(
"#source_"
+
source_id
+
" .composition_sources .loaded"
).
first
();
if
(
contentDiv
.
html
())
{
contentDiv
.
slideUp
(
400
,
function
()
{
contentDiv
.
html
(
""
);
}
);
return
;
}
var
toggle_button
=
$
(
this
);
var
loading
=
toggle_button
.
parents
(
".composition_sources"
).
first
().
find
(
".loading"
);
loading
.
show
();
var
url
=
"
{{
path
(
'source_composition_sources'
,
{
source
:
1111
}
)
}}
"
;
url
=
url
.
replace
(
"1111"
,
source_id
);
$
.
get
(
url
,
function
(
response
)
{
loading
.
hide
();
if
(
response
[
"error"
])
{
app_message
(
"danger"
,
toggle_button
.
closest
(
".source"
),
response
[
"error"
]);
return
;
}
contentDiv
.
hide
();
contentDiv
.
html
(
response
[
"data"
][
"source_list"
]);
contentDiv
.
slideDown
();
init_players
(
contentDiv
);
init_sources_buttons
(
contentDiv
);
}
);
return
;
}
var
toggle_button
=
$
(
this
);
var
loading
=
toggle_button
.
parents
(
".composition_sources"
).
first
().
find
(
".loading"
);
loading
.
show
();
var
url
=
"
{{
path
(
'source_composition_sources'
,
{
source
:
1111
}
)
}}
"
;
url
=
url
.
replace
(
"1111"
,
source_id
);
$
.
get
(
url
,
function
(
response
)
{
loading
.
hide
();
if
(
response
[
"error"
])
{
app_message
(
"danger"
,
toggle_button
.
closest
(
".source"
),
response
[
"error"
]);
return
;
}
contentDiv
.
hide
();
contentDiv
.
html
(
response
[
"data"
][
"source_list"
]);
contentDiv
.
slideDown
();
init_players
(
contentDiv
);
}
);
}
);
);
$
(
".toggle_source_derivations"
).
click
(
function
()
{
var
source_id
=
$
(
this
).
data
(
"source-id"
);
var
contentDiv
=
$
(
"#source_"
+
source_id
+
" .source_derivations .loaded"
).
first
();
if
(
contentDiv
.
html
())
{
contentDiv
.
slideUp
(
400
,
function
()
{
contentDiv
.
html
(
""
);
container
.
find
(
".toggle_source_derivations"
).
click
(
function
()
{
var
source_id
=
$
(
this
).
data
(
"source-id"
);
var
contentDiv
=
$
(
"#source_"
+
source_id
+
" .source_derivations .loaded"
).
first
();
if
(
contentDiv
.
html
())
{
contentDiv
.
slideUp
(
400
,
function
()
{
contentDiv
.
html
(
""
);
}
);
return
;
}
var
toggle_button
=
$
(
this
);
var
loading
=
toggle_button
.
parents
(
".source_derivations"
).
first
().
find
(
".loading"
);
loading
.
show
();
var
url
=
"
{{
path
(
'source_source_derivations'
,
{
source
:
1111
}
)
}}
"
;
url
=
url
.
replace
(
"1111"
,
source_id
);
$
.
get
(
url
,
function
(
response
)
{
loading
.
hide
();
if
(
response
[
"error"
])
{
app_message
(
"danger"
,
toggle_button
.
closest
(
".source"
),
response
[
"error"
]);
return
;
}
contentDiv
.
hide
();
contentDiv
.
html
(
response
[
"data"
][
"source_list"
]);
contentDiv
.
slideDown
();
init_players
(
contentDiv
);
init_sources_buttons
(
contentDiv
);
}
);
return
;
}
var
toggle_button
=
$
(
this
);
var
loading
=
toggle_button
.
parents
(
".source_derivations"
).
first
().
find
(
".loading"
);
loading
.
show
();
var
url
=
"
{{
path
(
'source_source_derivations'
,
{
source
:
1111
}
)
}}
"
;
url
=
url
.
replace
(
"1111"
,
source_id
);
$
.
get
(
url
,
function
(
response
)
{
loading
.
hide
();
if
(
response
[
"error"
])
{
app_message
(
"danger"
,
toggle_button
.
closest
(
".source"
),
response
[
"error"
]);
return
;
}
contentDiv
.
hide
();
contentDiv
.
html
(
response
[
"data"
][
"source_list"
]);
contentDiv
.
slideDown
();
init_players
(
contentDiv
);
}
);
}
);
);
}
init_players
(
$
(
"#main"
));
init_sources_buttons
(
$
(
"#main"
));
$
(
".toggle_source_xml_view"
).
click
(
function
()
{
...
...
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