Skip to content

Commit 9408fc2

Browse files
tulinkryvladak
authored andcommitted
add new highlight colors
1 parent ffda442 commit 9408fc2

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

opengrok-web/src/main/webapp/default/style-1.0.4.css

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ a.scope { /* scope */ color: steelblue; font-weight: bol
876876
width: calc(
877877
100% /* whole window */
878878
- 20px /* padding-left + padding-right */
879-
);
879+
);
880880
}
881881

882882
.intelli-window {
@@ -887,19 +887,31 @@ a.scope { /* scope */ color: steelblue; font-weight: bol
887887
.symbol-highlighted.hightlight-color-1 {
888888
/* yellow */
889889
background-color: #ffd700;
890-
background-color: rgb(255, 215, 0);
891890
}
892891

893892
.symbol-highlighted.hightlight-color-2 {
894893
/* green */
895894
background-color: #00ff00;
896-
background-color: rgb(0, 255, 0);
897895
}
898896

899897
.symbol-highlighted.hightlight-color-3 {
900898
/* blue */
901899
background-color: #00ccff;
902-
background-color: rgb(0, 204, 255);
900+
}
901+
902+
.symbol-highlighted.hightlight-color-4 {
903+
/* purple */
904+
background-color: #F653F8;
905+
}
906+
907+
.symbol-highlighted.hightlight-color-5 {
908+
/* orange */
909+
background-color: rgb(242, 132, 34);
910+
}
911+
912+
.symbol-highlighted.hightlight-color-6 {
913+
/* light green */
914+
background-color: #B6EBB5;
903915
}
904916

905917
.messages-window {

opengrok-web/src/main/webapp/js/utils-0.0.44.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,21 @@
875875
}
876876
break;
877877
case 53: // 5
878+
if (that.symbol && that.unhighlight(that.symbol).length === 0) {
879+
that.highlight(that.symbol, 4);
880+
}
881+
break;
882+
case 54: // 6
883+
if (that.symbol && that.unhighlight(that.symbol).length === 0) {
884+
that.highlight(that.symbol, 5);
885+
}
886+
break;
887+
case 55: // 5
888+
if (that.symbol && that.unhighlight(that.symbol).length === 0) {
889+
that.highlight(that.symbol, 6);
890+
}
891+
break;
892+
case 56: // 7
878893
that.unhighlightAll();
879894
break;
880895
case 110: // n
@@ -963,14 +978,18 @@
963978
}
964979
return this.getSymbols().filter(".symbol-highlighted").filter(function () {
965980
return $(this).text() === symbol;
966-
}).removeClass('symbol-highlighted').
967-
removeClass("hightlight-color-1 hightlight-color-2 hightlight-color-3");
981+
}).removeClass('symbol-highlighted')
982+
.removeClass(function (index, className) {
983+
return (className.match(/(^|\s)hightlight-color-\S+/g) || []).join(' ');
984+
});
968985
},
969986
unhighlightAll: function () {
970987
this.$last_highlighted_current = undefined;
971988
return this.getSymbols().filter(".symbol-highlighted").
972989
removeClass("symbol-highlighted").
973-
removeClass("hightlight-color-1 hightlight-color-2 hightlight-color-3");
990+
removeClass(function (index, className) {
991+
return (className.match (/(^|\s)hightlight-color-\S+/g) || []).join(' ');
992+
});
974993
},
975994
scrollTop: function ($el) {
976995
if (this.options.scrollTop) {

0 commit comments

Comments
 (0)