733ba7b804e84d7b60ccad1f137398ecd52db983 chmalee Tue Apr 23 18:15:09 2024 -0700 Add a general highlight trackDb variable(s), working like trackDb filters, except put a color behind the item, refs #24507 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 72896e0..5fe1052 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -990,32 +990,30 @@ $(form).attr('method','get'); }, restoreFromBackButton: function() // Re-enabling vis dropdowns is necessary because initForAjax() disables them on submit. { $('select.normalText,select.hiddenText').attr('disabled',false); } }; //////////////////////////////////////////////////////////// // dragSelect is also known as dragZoom or shift-dragZoom // //////////////////////////////////////////////////////////// var dragSelect = { - //hlColorDefault: '#aaedff', // default highlight color, if nothing specified - //hlColor : '#aaedff', // current highlight color hlColor : '#aac6ff', // current highlight color hlColorDefault: '#aac6ff', // default highlight color, if nothing specified areaSelector: null, // formerly "imgAreaSelect". jQuery element used for imgAreaSelect originalCursor: null, startTime: null, escPressed : false, // flag is set when user presses Escape selectStart: function (img, selection) { initVars(); dragSelect.escPressed = false; if (rightClick.menu) { rightClick.menu.hide(); } var now = new Date(); @@ -1153,70 +1151,48 @@ newPosition.replace("virt:", "multi:"); // if the user hit Escape just before, do not show this dialo if (dragSelect.startTime===null) return; var dragSelectDialog = $("#dragSelectDialog")[0]; if (!dragSelectDialog) { $("body").append("
" + "

" + - "

Highlight color: " + - "  " + - "  Reset

" + - "" + + "

"); + makeHighlightPicker("hlColor", document.getElementById("dragSelectDialog"), null); + document.body.append("" + "Don't show this again and always zoom with shift.
" + "Re-enable via 'View - Configure Browser' (c then f)

"+ "Selected chromosome position: "); dragSelectDialog = $("#dragSelectDialog")[0]; // reset value - $('#hlReset').click(function() { - var hlDefault = dragSelect.hlColorDefault; - $('#hlColorInput').val(hlDefault); - $("#hlColorPicker").spectrum("set", hlDefault); - dragSelect.saveHlColor(hlDefault); - }); // allow to click checkbox by clicking on the label $('#hlNotShowAgainMsg').click(function() { $('#disableDragHighlight').click();}); // click "add highlight" when enter is pressed in color input box $("#hlColorInput").keyup(function(event){ if(event.keyCode == 13){ $(".ui-dialog-buttonset button:nth-child(3)").click(); } }); - // activate the color picker - var opt = { - hideAfterPaletteSelect : true, - color : $('#hlColorInput').val(), - showPalette: true, - showInput: true, - preferredFormat: "hex", - change: function() { var color = $("#hlColorPicker").spectrum("get"); $('#hlColorInput').val(color); }, - }; - $("#hlColorPicker").spectrum(opt); - // update the color picker if you change the input box - $("#hlColorInput").change(function(){ $("#hlColorPicker").spectrum("set", $('#hlColorInput').val()); }); } - $("#hlColorPicker").spectrum("set", $('#hlColorInput').val()); - if (hgTracks.windows) { var i,len; var newerPosition = newPosition; if (hgTracks.virtualSingleChrom && (newPosition.search("multi:")===0)) { newerPosition = genomePos.disguisePosition(newPosition); } var str = newerPosition + "
\n"; var str2 = "
\n"; str2 += "