Skip to content

Commit e0eb89e

Browse files
tulinkryVladimir Kotal
authored andcommitted
adding more colors for symbol highlighting (#1662)
* adding more colors for symbol highlighting fixes #1634 * different class names + updating the other css styles
1 parent 6fb2132 commit e0eb89e

File tree

6 files changed

+63
-12
lines changed

6 files changed

+63
-12
lines changed

src/org/opensolaris/opengrok/web/Scripts.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public String toHtml() {
125125
SCRIPTS.put("jquery-tablesorter", new FileScript("js/jquery-tablesorter-2.26.6.min.js", 12));
126126
SCRIPTS.put("tablesorter-parsers", new FileScript("js/tablesorter-parsers-0.0.1.js", 13));
127127
SCRIPTS.put("searchable-option-list", new FileScript("js/searchable-option-list-2.0.3.min.js", 14));
128-
SCRIPTS.put("utils", new FileScript("js/utils-0.0.9.js", 15));
128+
SCRIPTS.put("utils", new FileScript("js/utils-0.0.10.js", 15));
129129
SCRIPTS.put("repos", new FileScript("js/repos-0.0.1.js", 20));
130130
SCRIPTS.put("diff", new FileScript("js/diff-0.0.1.js", 20));
131131
}

web/default/style.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,11 +833,24 @@ a.scope { /* scope */ color: steelblue; font-weight: bol
833833
max-height: 400px;
834834
}
835835

836-
.symbol-highlighted {
836+
.symbol-highlighted.hightlight-color-1 {
837+
/* yellow */
837838
background-color: #ffd700;
838839
background-color: rgb(255, 215, 0);
839840
}
840841

842+
.symbol-highlighted.hightlight-color-2 {
843+
/* green */
844+
background-color: #00ff00;
845+
background-color: rgb(0, 255, 0);
846+
}
847+
848+
.symbol-highlighted.hightlight-color-3 {
849+
/* blue */
850+
background-color: #00ccff;
851+
background-color: rgb(0, 204, 255);
852+
}
853+
841854
.messages-window {
842855
width: 40%;
843856
max-height: 400px;

web/help.jsp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ Key "1" toggles <dfn>Intelligence Window</dfn>. It gives the user many helper a
202202

203203
<h5>Symbol Highlighting</h5>
204204
<p>
205-
Key "2" toggles highlighting of the last symbol pointed by the mouse cursor. This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
205+
Keys "2", "3", "4" toggles highlighting of the last symbol pointed by the mouse cursor. This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
206206
</p>
207207
<p>
208-
Key "3" toggles unhighlighting all symbols. This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
208+
Key "5" toggles unhighlighting all symbols. This functionality is also accessible via the <dfn>Intelligence Window</dfn>.
209209
</p>
210210
<img src="<%= PageConfig.get(request).getCssDir() %>/img/symbol-highlighting.png"/>
211211

@@ -216,7 +216,7 @@ Key "3" toggles unhighlighting all symbols. This functionality is also accessibl
216216
<h5>Symbol jumping</h5>
217217
<p>
218218
By 'n' for next and 'b' for back you can jump between the symbols easily only with keyboard. When there is no symbol highlighted then the jump
219-
is made to the next symbol in the file from the current one. If you have highlighted a specific symbol then the jump is done only among the highlighted symbols.
219+
is made to the next symbol in the file from the current one. If you have highlighted a specific symbol then the jump is done only among the highlighted symbols regardless the color of the symbol.
220220
</p>
221221

222222
<h4>Diff jumper</h4>

web/js/utils-0.0.9.js renamed to web/js/utils-0.0.10.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,20 @@
807807
break;
808808
case 50: // 2
809809
if (that.symbol) {
810-
that.unhighlight(that.symbol).length === 0 && that.highlight(that.symbol);
810+
that.unhighlight(that.symbol).length === 0 && that.highlight(that.symbol, 1);
811811
}
812812
break;
813813
case 51: // 3
814+
if (that.symbol) {
815+
that.unhighlight(that.symbol).length === 0 && that.highlight(that.symbol, 2);
816+
}
817+
break;
818+
case 52: // 4
819+
if (that.symbol) {
820+
that.unhighlight(that.symbol).length === 0 && that.highlight(that.symbol, 3);
821+
}
822+
break;
823+
case 53: // 5
814824
that.unhighlightAll();
815825
break;
816826
case 110: // n
@@ -882,13 +892,13 @@
882892
getSymbols: function () {
883893
return (this.$symbols = this.$symbols || $(this.options.selector));
884894
},
885-
highlight: function (symbol) {
895+
highlight: function (symbol, color) {
886896
if (this.$current.text() === symbol) {
887897
this.$last_highlighted_current = this.$current;
888898
}
889899
return this.getSymbols().filter(function () {
890900
return $(this).text() === symbol;
891-
}).addClass('symbol-highlighted')
901+
}).addClass('symbol-highlighted').addClass('hightlight-color-' + (color || 1))
892902
},
893903
unhighlight: function (symbol) {
894904
if (this.$last_highlighted_current &&
@@ -900,11 +910,13 @@
900910
return this.getSymbols().filter(".symbol-highlighted").filter(function () {
901911
return $(this).text() === symbol;
902912
}).removeClass('symbol-highlighted')
903-
913+
.removeClass("hightlight-color-1 hightlight-color-2 hightlight-color-3");
904914
},
905915
unhighlightAll: function () {
906916
this.$last_highlighted_current = undefined
907-
return this.getSymbols().filter(".symbol-highlighted").removeClass("symbol-highlighted")
917+
return this.getSymbols().filter(".symbol-highlighted")
918+
.removeClass("symbol-highlighted")
919+
.removeClass("hightlight-color-1 hightlight-color-2 hightlight-color-3");
908920
},
909921
scrollTop: function ($el) {
910922
if (this.options.scrollTop) {

web/offwhite/style.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,11 +878,24 @@ a.scope { /* scope */ color: steelblue; font-weight: bol
878878
max-height: 400px;
879879
}
880880

881-
.symbol-highlighted {
881+
.symbol-highlighted.hightlight-color-1 {
882+
/* yellow */
882883
background-color: #ffd700;
883884
background-color: rgb(255, 215, 0);
884885
}
885886

887+
.symbol-highlighted.hightlight-color-2 {
888+
/* green */
889+
background-color: #00ff00;
890+
background-color: rgb(0, 255, 0);
891+
}
892+
893+
.symbol-highlighted.hightlight-color-3 {
894+
/* blue */
895+
background-color: #00ccff;
896+
background-color: rgb(0, 204, 255);
897+
}
898+
886899
.messages-window {
887900
width: 40%;
888901
max-height: 400px;

web/polished/style.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,11 +933,24 @@ a.scope { /* scope */ color: steelblue; font-weight: bol
933933
max-height: 400px;
934934
}
935935

936-
.symbol-highlighted {
936+
.symbol-highlighted.hightlight-color-1 {
937+
/* yellow */
937938
background-color: #ffd700;
938939
background-color: rgb(255, 215, 0);
939940
}
940941

942+
.symbol-highlighted.hightlight-color-2 {
943+
/* green */
944+
background-color: #00ff00;
945+
background-color: rgb(0, 255, 0);
946+
}
947+
948+
.symbol-highlighted.hightlight-color-3 {
949+
/* blue */
950+
background-color: #00ccff;
951+
background-color: rgb(0, 204, 255);
952+
}
953+
941954
.messages-window {
942955
width: 40%;
943956
max-height: 400px;

0 commit comments

Comments
 (0)