Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
IGWN Computing and Software
GraceDB
GraceDB Server
Commits
5ca7e5cf
Commit
5ca7e5cf
authored
10 years ago
by
Roy Williams
Browse files
Options
Downloads
Plain Diff
Merge branch 'skymap_buttons'
parents
2b780249
729b6272
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/gracedb/event_detail_script.js
+47
-37
47 additions, 37 deletions
templates/gracedb/event_detail_script.js
with
47 additions
and
37 deletions
templates/gracedb/event_detail_script.js
+
47
−
37
View file @
5ca7e5cf
...
...
@@ -122,7 +122,7 @@ var eventLogSaveUrl = '{% url "logentry" object.graceid "" %}';
var
embbEventLogListUrl
=
'
{% url "api:embbeventlog-list" object.graceid %}
'
;
// XXX Branson made this change on 3/3/15
//var skymapJsonUrl = '{% url "file" object.graceid "skymap.json" %}';
var
skymapJsonUrl
=
'
{% url "file" object.graceid "
bayestar.json
" %}
'
;
var
skymapJsonUrl
=
'
{% url "file" object.graceid "" %}
'
;
var
skymapViewerUrl
=
'
{{ SKYMAP_VIEWER_SERVICE_URL }}
'
;
// This little list determines the priority ordering of the digest sections.
...
...
@@ -605,8 +605,11 @@ require([
if
(
object
.
filename
)
put
(
commentDiv
,
'
a[href=$]
'
,
object
.
file
,
object
.
filename
);
// Branson, 3/3/15
//if (object.filename == 'skymap.json') {
if
(
object
.
filename
==
'
bayestar.json
'
)
{
var
svButton
=
put
(
commentDiv
,
'
button.modButtonClass#sV_button
'
,
'
View in SkymapViewer!
'
);
var
isItJson
=
object
.
filename
.
indexOf
(
"
.json
"
);
if
(
isItJson
>
-
1
)
{
var
skymapName
=
object
.
filename
.
substring
(
0
,
isItJson
);
var
svButton
=
put
(
commentDiv
,
'
button.modButtonClass.sV_button#
'
+
skymapName
,
'
View in SkymapViewer!
'
);
put
(
svButton
,
'
[type="button"][data-dojo-type="dijit/form/Button"]
'
);
put
(
svButton
,
'
[style="float: right"]
'
);
}
...
...
@@ -958,44 +961,51 @@ require([
});
// Handle the post to skymapViewer button.
// Tacking on an invisible div with a form inside.
sVdiv
=
put
(
annotationsDiv
,
'
div#sV_form_div[style="display: none"]
'
);
sVform
=
put
(
sVdiv
,
'
form#sV_form[method="post"][action="$"]
'
,
var
nodeList
=
query
(
'
.sV_button
'
);
for
(
var
i
=
0
;
i
<
nodeList
.
length
;
i
++
){
node
=
nodeList
[
i
];
var
skymapName
=
node
.
id
;
// Handle the post to skymapViewer button.
// Tacking on an invisible div with a form inside.
sVdiv
=
put
(
annotationsDiv
,
'
div#sV_form_div[style="display: none"]
'
);
sVform
=
put
(
sVdiv
,
'
form#sV_form[method="post"][action="$"]
'
,
encodeURI
(
skymapViewerUrl
));
put
(
sVform
,
'
input[type="hidden"][name="skymapid"][value="{{ object.graceid }}"]
'
);
put
(
sVform
,
'
input[type="hidden"][name="json"]
'
);
put
(
sVform
,
'
input[type="hidden"][name="embb"]
'
);
put
(
sVform
,
'
input[type="submit"][value="View in skymapViewer!"]
'
);
put
(
sVform
,
'
input[type="hidden"][name="skymapid"][value="{{ object.graceid }}"]
'
);
put
(
sVform
,
'
input[type="hidden"][name="json"]
'
);
put
(
sVform
,
'
input[type="hidden"][name="embb"]
'
);
put
(
sVform
,
'
input[type="submit"][value="View in skymapViewer!"]
'
);
var
sV_button
=
dom
.
byId
(
"
sV_button
"
);
if
(
sV_button
)
{
on
(
sV_button
,
"
click
"
,
function
()
{
console
.
log
(
"
You clicked the button!
"
);
var
embblog_json_url
=
embbEventLogListUrl
;
var
embblog_json
;
dojo
.
xhrGet
({
url
:
embblog_json_url
+
"
?format=json
"
,
async
:
true
,
load
:
function
(
embblog_json
)
{
// fetch JSON content.
var
sV_button
=
dom
.
byId
(
skymapName
);
if
(
sV_button
)
{
on
(
sV_button
,
"
click
"
,
function
(
e
)
{
sjurl
=
skymapJsonUrl
+
'
/
'
+
e
.
toElement
.
id
+
'
.json
'
;
console
.
log
(
"
You clicked the button for
"
+
sjurl
);
var
embblog_json_url
=
embbEventLogListUrl
;
var
embblog_json
;
dojo
.
xhrGet
({
url
:
skymapJsonUrl
,
load
:
function
(
result
)
{
// Find the form and set its value to the appropriate JSON
sV_form
=
dom
.
byId
(
"
sV_form
"
);
// Shove the skymap.json contents into the value for the second form field.
sV_form
.
elements
[
1
].
value
=
result
;
sV_form
.
elements
[
2
].
value
=
embblog_json
;
// Submit the form, which takes the user to the skymapViewer server.
sV_form
.
submit
();
url
:
embblog_json_url
+
"
?format=json
"
,
async
:
true
,
load
:
function
(
embblog_json
)
{
// fetch JSON content.
dojo
.
xhrGet
({
url
:
sjurl
,
load
:
function
(
result
)
{
// Find the form and set its value to the appropriate JSON
sV_form
=
dom
.
byId
(
"
sV_form
"
);
// Shove the skymap.json contents into the value for the second form field.
sV_form
.
elements
[
1
].
value
=
result
;
sV_form
.
elements
[
2
].
value
=
embblog_json
;
// Submit the form, which takes the user to the skymapViewer server.
sV_form
.
submit
();
}
});
// end of inside ajax
}
});
// end of inside ajax
}
});
// end of outside ajax
});
}
});
// end of outside ajax
});
}
}
// end of loop over buttons
});
...
...
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