Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 3448499

Browse files
committed
Fine tuning the UI and embedding js doc limiting to max 2 lines.
1 parent b646430 commit 3448499

File tree

2 files changed

+53
-15
lines changed

2 files changed

+53
-15
lines changed

src/extensions/default/JavaScriptCodeHints/main.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,22 @@ define(function (require, exports, module) {
272272

273273
$hintObj.data("token", token);
274274

275+
function _appendLink() {
276+
if (token.url) {
277+
$('<a><&nbsp;></a>').appendTo($hintObj).addClass("jshint-link").attr('href', token.url).on("click", function (event) {
278+
event.stopImmediatePropagation();
279+
event.stopPropagation();
280+
});
281+
}
282+
}
283+
275284
if (token.type) {
276285
if (token.type.length > 40) {
277-
if (token.url) {
278-
$('<a>' + " " + token.type.split('->').join(':').trim() + '</a>').appendTo($hintObj).addClass("jshint-description").attr('href', token.url);
279-
} else {
280-
$('<span>' + " " + token.type.split('->').join(':').trim() + '</span>').appendTo($hintObj).addClass("jshint-description");
281-
}
286+
_appendLink();
287+
$('<span>' + " " + token.type.split('->').join(':').trim() + '</span>').appendTo($hintObj).addClass("jshint-description");
282288
} else {
283-
if (token.url) {
284-
$('<a>' + " " + token.type.split('->').join(':').trim() + '</a>').appendTo($hintObj).addClass("brackets-js-hints-type-details").attr('href', token.url);
285-
} else {
286-
$('<span>' + " " + token.type.split('->').join(':').trim() + '</span>').appendTo($hintObj).addClass("brackets-js-hints-type-details");
287-
}
289+
$('<span>' + " " + token.type.split('->').join(':').trim() + '</span>').appendTo($hintObj).addClass("brackets-js-hints-type-details");
290+
_appendLink();
288291
}
289292
} else {
290293
if (token.keyword) {
@@ -294,6 +297,7 @@ define(function (require, exports, module) {
294297

295298
if (token.doc) {
296299
$hintObj.attr('title', token.doc);
300+
$('<span>' + " " + token.doc.trim() + '</span>').appendTo($hintObj).addClass("jshint-jsdoc");
297301
}
298302

299303
$('<div class="hint-width-limiter"></div>').appendTo($hintObj);

src/extensions/default/JavaScriptCodeHints/styles/brackets-js-hints.css

+39-5
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ span.brackets-js-hints {
129129

130130
.brackets-js-hints.type-boolean:before {
131131
color: cornflowerblue;
132-
content: 't/f';
132+
content: 'bool';
133133
border: 1px cornflowerblue solid;
134134
float:left;
135135
width:25px;
@@ -143,15 +143,15 @@ span.brackets-js-hints {
143143
color: #d3d3d3 !important;
144144
font-weight: 100;
145145
font-style: italic !important;
146-
margin-right: 25px;
146+
margin-right: 5px;
147147
float:right;
148148
}
149149

150150
.jshint-description {
151151
display: none;
152152
padding-left: 35px !important;
153153
padding-right:10px !important;
154-
color: #d3d3d3;
154+
color: #d4d4d4;
155155
word-wrap: break-word;
156156
white-space: normal;
157157
width:400px;
@@ -162,9 +162,43 @@ span.brackets-js-hints {
162162
color: #696969;
163163
}
164164

165+
.jshint-jsdoc {
166+
display: none;
167+
padding-left: 28px !important;
168+
padding-right: 10px !important;
169+
color: grey;
170+
word-wrap: break-word;
171+
white-space: normal;
172+
width: 400px;
173+
box-sizing: border-box;
174+
float: left;
175+
clear: left;
176+
max-height: 3em;
177+
overflow: hidden;
178+
opacity:0.7;
179+
}
180+
181+
.jshint-link {
182+
float:right;
183+
display:none;
184+
color:orangered !important;
185+
margin:0px !important;
186+
margin-right: 10px !important;
187+
padding:0px !important;
188+
font-weight: 900 !important;
189+
}
190+
191+
.highlight .jshint-link {
192+
display:block;
193+
}
194+
165195
.highlight .jshint-description {
166196
display: block;
167-
color:#6495ed !important;
197+
color: #6495ed !important;
198+
}
199+
200+
.highlight .jshint-jsdoc {
201+
display: block;
168202
}
169203

170204
.dark .brackets-js-hints-type-details {
@@ -177,7 +211,7 @@ span.brackets-js-hints {
177211
}
178212

179213
.brackets-js-hints-type-details.keyword {
180-
color: #6495ed;
214+
color: #6495ed !important;
181215
}
182216

183217

0 commit comments

Comments
 (0)