Skip to content

Commit

Permalink
- add ellipsis pug function
Browse files Browse the repository at this point in the history
 - add `tip-fit` class
 - bump version
  • Loading branch information
zbryikt committed May 27, 2022
1 parent 9e072d5 commit 0b72590
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Logs

## v0.0.8

- add `ellipsis` pug function
- add `tip-fit` class


## v0.0.7

- add `a` mixin for handy anchor with rel ( noopener + noreferrer ) attributes to prevent browser hijacking vulnerability
Expand Down
4 changes: 4 additions & 0 deletions dist/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
min-width: 100px;
padding: 0.6em 0.8em;
}
.hover-tip.tip-fit {
min-width: fit-content;
white-space: pre;
}
.hover-tip a {
color: #73baf7;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ if !(libLoader || scriptLoader)
- var escjson = function(obj) { return 'JSON.parse(unescape("' + escape(JSON.stringify(obj)) + '"))'; };
//- escape for html output to prevent xss
- var eschtml = (function() { var MAP = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&#34;', "'": '&#39;' }; var repl = function(c) { return MAP[c]; }; return function(s) { return s.replace(/[&<>'"]/g, repl); }; })();
-
function ellipsis(str, len) {
return ((str || '').substring(0, len || 200) + (((str || '').length > (len || 200)) ? '...' : ''));
}
//- add br x n
mixin nbr(count)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "@loadingio/bootstrap.ext",
"license": "MIT",
"description": "bootstrap extension used by loading.io",
"version": "0.0.7",
"version": "0.0.8",
"style": "dist/index.min.css",
"files": [
"dist/**/*"
Expand Down
4 changes: 4 additions & 0 deletions src/pug/misc.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
- var escjson = function(obj) { return 'JSON.parse(unescape("' + escape(JSON.stringify(obj)) + '"))'; };
//- escape for html output to prevent xss
- var eschtml = (function() { var MAP = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&#34;', "'": '&#39;' }; var repl = function(c) { return MAP[c]; }; return function(s) { return s.replace(/[&<>'"]/g, repl); }; })();
-
function ellipsis(str, len) {
return ((str || '').substring(0, len || 200) + (((str || '').length > (len || 200)) ? '...' : ''));
}
//- add br x n
mixin nbr(count)
Expand Down
5 changes: 5 additions & 0 deletions src/styl/tip.styl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
font-size: .75em
min-width: 100px
padding: .6em .8em
// fit-content to make it small as possible
// white-space: pre to prevent wrapping in smaller container
&.tip-fit
min-width: fit-content
white-space: pre
a
color: #73baf7
&:before
Expand Down
4 changes: 4 additions & 0 deletions web/static/assets/lib/@loadingio/bootstrap.ext/dev/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
min-width: 100px;
padding: 0.6em 0.8em;
}
.hover-tip.tip-fit {
min-width: fit-content;
white-space: pre;
}
.hover-tip a {
color: #73baf7;
}
Expand Down

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions web/static/assets/lib/@loadingio/bootstrap.ext/dev/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ if !(libLoader || scriptLoader)
- var escjson = function(obj) { return 'JSON.parse(unescape("' + escape(JSON.stringify(obj)) + '"))'; };
//- escape for html output to prevent xss
- var eschtml = (function() { var MAP = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&#34;', "'": '&#39;' }; var repl = function(c) { return MAP[c]; }; return function(s) { return s.replace(/[&<>'"]/g, repl); }; })();
-
function ellipsis(str, len) {
return ((str || '').substring(0, len || 200) + (((str || '').length > (len || 200)) ? '...' : ''));
}
//- add br x n
mixin nbr(count)
Expand Down

0 comments on commit 0b72590

Please sign in to comment.