@@ -389,7 +389,7 @@ Aladin = (function() {
389389 return 0 ;
390390 } ;
391391 } ) ;
392- var multSelectBoxes = $ ( this . aladinDiv ) . find ( '.aladin-footprintSelection2 ' ) ;
392+ var multSelectBoxes = $ ( this . aladinDiv ) . find ( '.aladin-footprintSelection ' ) ;
393393 multSelectBoxes . empty ( ) ;
394394 overlayNames = aladin . getOverlayNames ( ) ;
395395 overlayColors = aladin . getOverlayColors ( ) ;
@@ -471,7 +471,7 @@ Aladin = (function() {
471471 if ( plotInstr_arr [ i ] ) {
472472 listentry . append ( multSelectEntries [ i ] ) ;
473473 checkboxEntries [ i ] . attr ( "checked" , true ) ;
474- colorselect = $ ( "<select>" ) . attr ( "class" , '.aladin-footprintColor2 ' ) . attr ( "name" , instrNames [ i ] + 'color' ) ;
474+ colorselect = $ ( "<select>" ) . attr ( "class" , '.aladin-footprintColor ' ) . attr ( "name" , instrNames [ i ] + 'color' ) ;
475475 colorselect . append ( $ ( "<option />" ) . text ( "Red" ) . attr ( "selected" , colorIndex_arr [ i ] == 0 ) ) ;
476476 colorselect . append ( $ ( "<option />" ) . text ( "Green" ) . attr ( "selected" , colorIndex_arr [ i ] == 1 ) ) ;
477477 colorselect . append ( $ ( "<option />" ) . text ( "Blue" ) . attr ( "selected" , colorIndex_arr [ i ] == 2 ) ) ;
@@ -492,67 +492,6 @@ Aladin = (function() {
492492
493493 } ;
494494
495- Aladin . prototype . createFootprintsCheckbox = function ( surveys ) {
496- surveys . sort ( function ( a , b ) {
497- if ( a . name > b . name ) {
498- return 1 ;
499- } else if ( a . name < b . name ) {
500- return - 1 ;
501- } else {
502- return 0 ;
503- } ;
504- } ) ;
505- var checkboxes = $ ( this . aladinDiv ) . find ( '.aladin-footprintSelection' ) ;
506- checkboxes . empty ( ) ;
507- overlayNames = aladin . getOverlayNames ( ) ;
508- overlayColors = aladin . getOverlayColors ( ) ;
509- hipsFootprints = aladin . getOverlayImageLayers ( ) ;
510- for ( var i = 0 ; i < surveys . length ; i ++ ) {
511- var listentry = $ ( "<li>" ) . attr ( "name" , surveys [ i ] . id ) ;
512- var checkboxentry = $ ( "<input type='checkbox'>" ) . attr ( "name" , surveys [ i ] . id ) ;
513- var index = $ . inArray ( surveys [ i ] . id , overlayNames ) ;
514- var found = index > - 1 ;
515- if ( found ) {
516- colorIndex = overlayColors [ index ] ;
517- checkboxentry . attr ( "checked" , true ) ;
518- }
519-
520- foundHiPS = false ;
521- for ( var j = 0 ; j < hipsFootprints . length ; j ++ ) {
522- if ( hipsFootprints [ j ] . id == surveys [ i ] . id ) {
523- foundHiPS = true ;
524- checkboxentry . attr ( "checked" , true ) ;
525- color = hipsFootprints [ j ] . getColorMap ( ) [ 'map' ] ;
526- if ( color == 'red' ) {
527- colorIndex = 0 ;
528- } else if ( color == 'green' ) {
529- colorIndex = 1 ;
530- } else if ( color == 'blue' ) {
531- colorIndex = 2 ;
532- } else if ( color == 'aqua' ) {
533- colorIndex = 3 ;
534- } else if ( color == 'magenta' ) {
535- colorIndex = 4 ;
536- }
537- break ;
538- }
539- }
540-
541- listentry . append ( checkboxentry ) ;
542- listentry . append ( surveys [ i ] . name ) ;
543- if ( found || foundHiPS ) {
544- colorselect = $ ( "<select>" ) . attr ( "class" , '.aladin-footprintColor' ) . attr ( "name" , surveys [ i ] . id ) ;
545- colorselect . append ( $ ( "<option />" ) . text ( "Red" ) . attr ( "selected" , colorIndex == 0 ) ) ;
546- colorselect . append ( $ ( "<option />" ) . text ( "Green" ) . attr ( "selected" , colorIndex == 1 ) ) ;
547- colorselect . append ( $ ( "<option />" ) . text ( "Blue" ) . attr ( "selected" , colorIndex == 2 ) ) ;
548- colorselect . append ( $ ( "<option />" ) . text ( "Aqua" ) . attr ( "selected" , colorIndex == 3 ) ) ;
549- colorselect . append ( $ ( "<option />" ) . text ( "Magenta" ) . attr ( "selected" , colorIndex == 4 ) ) ;
550- listentry . append ( colorselect ) ;
551- }
552- checkboxes . append ( listentry ) ;
553- } ;
554- } ;
555-
556495 Aladin . prototype . getOptionsFromQueryString = function ( ) {
557496 var options = { } ;
558497 var requestedTarget = $ . urlParam ( 'target' ) ;
@@ -1059,10 +998,8 @@ Aladin = (function() {
1059998 '<div class="aladin-cmap">Color map:' +
1060999 '<div><select class="aladin-cmSelection"></select><button class="aladin-btn aladin-btn-small aladin-reverseCm" type="button">Reverse</button></div></div>' +
10611000 '<div class="aladin-box-separator"></div>' +
1062- //'<div class="aladin-label">Footprint</div>' +
1063- //'<div class="aladin-footprintSelection"></div>' +
10641001 '<div class="aladin-label">Footprint</div>' +
1065- '<div class="aladin-footprintSelection2 "></div>' +
1002+ '<div class="aladin-footprintSelection "></div>' +
10661003 '<div class="aladin-label">Overlay layers</div>' ) ;
10671004
10681005 var cmDiv = layerBox . find ( '.aladin-cmap' ) ;
@@ -1159,96 +1096,17 @@ Aladin = (function() {
11591096
11601097 } ) ;
11611098
1162- // update list of overlaid footprints
1163- /*
1164- this.createFootprintsCheckbox(HpxImageSurvey.getAvailableFootprints());
1165- var footprintSelection = $(this.aladinDiv).find('.aladin-footprintSelection');
1166- footprintSelection.change(function() {
1167- aladin.removeOverlays();
1168- var selected = [];
1169- $('.aladin-footprintSelection input:checked').each(function() {
1170- selected.push($(this).attr('name'));
1171- });
1172- var footprints = HpxImageSurvey.getAvailableFootprints();
1173- for (var i=0; i<footprints.length; i++) {
1174- var found = $.inArray(footprints[i].id, selected) > -1;
1175- if (found) {
1176- try {
1177- var colorIndex = $("select[name='"+footprints[i].id+"']")[0].selectedIndex;
1178- } catch(err) {
1179- var colorIndex = 0;
1180- var listentry = $("li[name='"+footprints[i].id+"']");
1181- colorselect = $("<select>").attr("class", '.aladin-footprintColor').attr("name", footprints[i].id);
1182- colorselect.append($("<option />").text("Red"));
1183- colorselect.append($("<option />").text("Green"));
1184- colorselect.append($("<option />").text("Blue"));
1185- colorselect.append($("<option />").text("Aqua"));
1186- colorselect.append($("<option />").text("Magenta"));
1187- listentry.append(colorselect);
1188- }
1189- if (footprints[i].url) {
1190- self.setOverlayImageLayer(footprints[i].id);
1191- if (colorIndex == 0) {
1192- color = 'red';
1193- } else if (colorIndex == 1) {
1194- color = 'green';
1195- } else if (colorIndex == 2) {
1196- color = 'blue';
1197- } else if (colorIndex == 3) {
1198- color = 'aqua';
1199- } else if (colorIndex == 4) {
1200- color = 'magenta';
1201- }
1202- //self.getOverlayImageLayer().getColorMap().update(color);
1203- self.getOverlayImageLayer().setAlpha(1.0);
1204- self.addOverlayImageLayer(footprints[i].id, color);
1205- } else {
1206- if (colorIndex == 0) {
1207- //colorval = '#ee2345'; //red
1208- colorval = '#FF0000'; //red
1209- } else if (colorIndex == 1) {
1210- colorval = '#00FF00'; // green
1211- } else if (colorIndex == 2) {
1212- colorval = '#0000FF'; // blue
1213- } else if (colorIndex == 3) {
1214- colorval = '#00FFFF'; // aqua
1215- } else if (colorIndex == 4) {
1216- colorval = '#FF00FF'; // magenta
1217- }
1218- var overlay = A.graphicOverlay({color: colorval, lineWidth: 3});
1219- aladin.addOverlay(overlay, footprints[i].id, colorIndex);
1220- var ras = footprints[i].ras;
1221- var decs = footprints[i].decs;
1222- var polygon = new Array(1);
1223- for (var k=0; k<ras.length; k++) {
1224- var tmp2 = [ras[k], decs[k]];
1225- polygon[k] = tmp2;
1226- }
1227- overlay.addFootprints(A.polygon(polygon));
1228- }
1229- } else {
1230- var colorSelect = $("select[name='"+footprints[i].id+"']")[0];
1231- if (colorSelect) {
1232- colorSelect.remove();
1233- }
1234- }
1235- }
1236- });
1237- */
1238-
12391099 this . createFootprintsMultSelectDrop ( HpxImageSurvey . getAvailableFootprints ( ) ) ;
1240- var footprintSelection2 = $ ( this . aladinDiv ) . find ( '.aladin-footprintSelection2 ' ) ;
1100+ var footprintSelection2 = $ ( this . aladinDiv ) . find ( '.aladin-footprintSelection ' ) ;
12411101 footprintSelection2 . change ( function ( ) {
12421102 aladin . removeOverlays ( ) ;
12431103 var footprints = HpxImageSurvey . getAvailableFootprints ( ) ;
12441104
12451105 //Construct a list of all experiments to plot
12461106 var selected = [ ] ;
1247- $ ( '.aladin-footprintSelection2 input:checked' ) . each ( function ( ) {
1107+ $ ( '.aladin-footprintSelection input:checked' ) . each ( function ( ) {
12481108 var instrname = $ ( this ) . attr ( 'name' ) ;
12491109 var selvals = $ ( "#" + instrname + 'multi' ) . chosen ( ) . val ( ) ;
1250- //var temp = $("#"+instrname+'multi').chosen();
1251- //var temp2 = $("select[name='"+instrname+"']");
12521110
12531111 if ( selvals === undefined ) {
12541112 //This occurs if this checkmark was the change and the multiselect doesn't exist
@@ -1276,21 +1134,20 @@ Aladin = (function() {
12761134
12771135 listentry . append ( multSelectEntry ) ;
12781136 } else if ( selvals === null ) {
1279- console . log ( "NULL" ) ;
1137+ // console.log("NULL");
12801138 } else {
12811139 for ( i = 0 ; i < selvals . length ; i ++ ) {
12821140 selected . push ( selvals [ i ] ) ;
12831141 }
12841142 }
12851143 $ ( function ( ) {
1286- console . log ( "CHOSENING" ) ;
12871144 $ ( ".chosen-select" ) . chosen ( {
12881145 width : "300px"
12891146 } ) ;
12901147 } ) ;
12911148 } ) ;
12921149
1293- $ ( '.aladin-footprintSelection2 input:not(:checked)' ) . each ( function ( ) {
1150+ $ ( '.aladin-footprintSelection input:not(:checked)' ) . each ( function ( ) {
12941151
12951152 instrname = $ ( this ) . attr ( 'name' ) ;
12961153
@@ -1313,7 +1170,6 @@ Aladin = (function() {
13131170
13141171 } ) ;
13151172
1316- console . log ( "Selected: " , selected ) ;
13171173 for ( var i = 0 ; i < footprints . length ; i ++ ) {
13181174 var found = $ . inArray ( footprints [ i ] . id , selected ) > - 1 ;
13191175 if ( found ) {
@@ -1324,7 +1180,7 @@ Aladin = (function() {
13241180 } catch ( err ) {
13251181 var colorIndex = 0 ;
13261182 var listentry = $ ( "li[name='" + footprints [ i ] . instrument + "']" ) ;
1327- colorselect = $ ( "<select>" ) . attr ( "class" , '.aladin-footprintColor2 ' ) . attr ( "name" , footprints [ i ] . instrument + 'color' ) ;
1183+ colorselect = $ ( "<select>" ) . attr ( "class" , '.aladin-footprintColor ' ) . attr ( "name" , footprints [ i ] . instrument + 'color' ) ;
13281184 colorselect . attr ( "id" , footprints [ i ] . instrument + 'color' ) ;
13291185 colorselect . append ( $ ( "<option />" ) . text ( "Red" ) ) ;
13301186 colorselect . append ( $ ( "<option />" ) . text ( "Green" ) ) ;
0 commit comments