forked from Helioviewer-Project/helioviewer.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fe0f7f
commit 7f05bc5
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
$(document).ready(function() { | ||
|
||
$('#stereo_a-psp-tree-trajectory .button, #soho-psp-tree-trajectory .button').click(function(){ | ||
|
||
$.getJSON("https://api.beta.helioviewer.org/resources/JSON/celestial-objects/soho/psp/soho_psp_dictionary.json?rndnm=<?php echo (rand(9999,9999999)); ?>", function(pspdata){ | ||
|
||
var pspencnum=0; | ||
|
||
// loop through each encounter | ||
$.each(pspdata, function(pspvalue, pspkey){ | ||
//console.log(pspkey, pspvalue); | ||
|
||
pspencnum++; | ||
|
||
$('#showjsondata').append('<span style="font-weight:bold;">Dates: '+JSON.stringify(pspvalue)+'</span><br>'); | ||
|
||
//JSON.stringify(pspkey.start); | ||
|
||
// parse the JSON data: get the "start" value | ||
var myPSPObj = JSON.parse(pspkey.start); | ||
var pspstartenc = myPSPObj; | ||
|
||
|
||
// if the very first appropriate encounter div exists | ||
if($('#soho-psp-container-hover-date-'+pspstartenc).length > 0 || $('#stereo_a-psp-trajectory-hover-date-'+pspstartenc).length > 0) { | ||
|
||
if($('#soho-psp-container-hover-date-'+pspstartenc).length > 0) { | ||
var numEncPoints= $('#soho-psp-trajectory .hover-date-container').length; | ||
else if($('#stereo_a-psp-trajectory-hover-date-'+pspstartenc).length > 0) { | ||
var numEncPoints= $('#soho-psp-trajectory .hover-date-container').length; | ||
} | ||
|
||
|
||
// go through each encounter unix time and append the Encounter to each label | ||
for(var psp_subenc=1;psp_subenc<=numEncPoints;psp_subenc++) { | ||
$('#soho-psp-trajectory .hover-date-container, #stereo_a-psp-trajectory .hover-date-container').css('height','33px'); | ||
$('#soho-psp-trajectory .hover-date-container, #stereo_a-psp-trajectory .hover-date-container').append('<br>Encounter '+pspencnum); | ||
$('#showjsondata').append('#stereo_a-psp-trajectory-hover-date-'+pspstartenc+' // Encounter '+pspencnum+'<br>'); | ||
pspstartenc+=21600000; | ||
} | ||
|
||
|
||
} | ||
|
||
}); | ||
|
||
|
||
|
||
|
||
}).fail(function(){ | ||
//console.log(''); | ||
}); | ||
|
||
|
||
}); | ||
|
||
}); |