mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-25 02:32:52 -05:00
Added highligting CSS
This commit is contained in:
parent
c0ee2db8a4
commit
4f155f5004
10 changed files with 1229 additions and 298 deletions
153
lib/GUI/css/highlight.js.less
Normal file
153
lib/GUI/css/highlight.js.less
Normal file
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
|
||||
Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
|
||||
|
||||
*/
|
||||
|
||||
.hljs {
|
||||
display: block; padding: 0.5em;
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
||||
.hljs,
|
||||
.hljs-subst,
|
||||
.hljs-tag .hljs-title,
|
||||
.lisp .hljs-title,
|
||||
.clojure .hljs-built_in,
|
||||
.nginx .hljs-title {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-title,
|
||||
.hljs-constant,
|
||||
.hljs-parent,
|
||||
.hljs-tag .hljs-value,
|
||||
.hljs-rules .hljs-value,
|
||||
.hljs-rules .hljs-value .hljs-number,
|
||||
.hljs-preprocessor,
|
||||
.hljs-pragma,
|
||||
.haml .hljs-symbol,
|
||||
.ruby .hljs-symbol,
|
||||
.ruby .hljs-symbol .hljs-string,
|
||||
.hljs-aggregate,
|
||||
.hljs-template_tag,
|
||||
.django .hljs-variable,
|
||||
.smalltalk .hljs-class,
|
||||
.hljs-addition,
|
||||
.hljs-flow,
|
||||
.hljs-stream,
|
||||
.bash .hljs-variable,
|
||||
.apache .hljs-tag,
|
||||
.apache .hljs-cbracket,
|
||||
.tex .hljs-command,
|
||||
.tex .hljs-special,
|
||||
.erlang_repl .hljs-function_or_atom,
|
||||
.asciidoc .hljs-header,
|
||||
.markdown .hljs-header,
|
||||
.coffeescript .hljs-attribute {
|
||||
color: #800;
|
||||
}
|
||||
|
||||
.smartquote,
|
||||
.hljs-comment,
|
||||
.hljs-annotation,
|
||||
.hljs-template_comment,
|
||||
.diff .hljs-header,
|
||||
.hljs-chunk,
|
||||
.asciidoc .hljs-blockquote,
|
||||
.markdown .hljs-blockquote {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.hljs-number,
|
||||
.hljs-date,
|
||||
.hljs-regexp,
|
||||
.hljs-literal,
|
||||
.hljs-hexcolor,
|
||||
.smalltalk .hljs-symbol,
|
||||
.smalltalk .hljs-char,
|
||||
.go .hljs-constant,
|
||||
.hljs-change,
|
||||
.lasso .hljs-variable,
|
||||
.makefile .hljs-variable,
|
||||
.asciidoc .hljs-bullet,
|
||||
.markdown .hljs-bullet,
|
||||
.asciidoc .hljs-link_url,
|
||||
.markdown .hljs-link_url {
|
||||
color: #080;
|
||||
}
|
||||
|
||||
.hljs-label,
|
||||
.hljs-javadoc,
|
||||
.ruby .hljs-string,
|
||||
.hljs-decorator,
|
||||
.hljs-filter .hljs-argument,
|
||||
.hljs-localvars,
|
||||
.hljs-array,
|
||||
.hljs-attr_selector,
|
||||
.hljs-important,
|
||||
.hljs-pseudo,
|
||||
.hljs-pi,
|
||||
.haml .hljs-bullet,
|
||||
.hljs-doctype,
|
||||
.hljs-deletion,
|
||||
.hljs-envvar,
|
||||
.hljs-shebang,
|
||||
.apache .hljs-sqbracket,
|
||||
.nginx .hljs-built_in,
|
||||
.tex .hljs-formula,
|
||||
.erlang_repl .hljs-reserved,
|
||||
.hljs-prompt,
|
||||
.asciidoc .hljs-link_label,
|
||||
.markdown .hljs-link_label,
|
||||
.vhdl .hljs-attribute,
|
||||
.clojure .hljs-attribute,
|
||||
.asciidoc .hljs-attribute,
|
||||
.lasso .hljs-attribute,
|
||||
.coffeescript .hljs-property,
|
||||
.hljs-phony {
|
||||
color: #88F
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-id,
|
||||
.hljs-title,
|
||||
.hljs-built_in,
|
||||
.hljs-aggregate,
|
||||
.css .hljs-tag,
|
||||
.hljs-javadoctag,
|
||||
.hljs-phpdoc,
|
||||
.hljs-yardoctag,
|
||||
.smalltalk .hljs-class,
|
||||
.hljs-winutils,
|
||||
.bash .hljs-variable,
|
||||
.apache .hljs-tag,
|
||||
.go .hljs-typename,
|
||||
.tex .hljs-command,
|
||||
.asciidoc .hljs-strong,
|
||||
.markdown .hljs-strong,
|
||||
.hljs-request,
|
||||
.hljs-status {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.asciidoc .hljs-emphasis,
|
||||
.markdown .hljs-emphasis {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.nginx .hljs-built_in {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.coffeescript .javascript,
|
||||
.javascript .xml,
|
||||
.lasso .markup,
|
||||
.tex .hljs-formula,
|
||||
.xml .javascript,
|
||||
.xml .vbscript,
|
||||
.xml .css,
|
||||
.xml .hljs-cdata {
|
||||
opacity: 0.5;
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
@import "../../../node_modules/helpers.less/helpers.less";
|
||||
@import "./markdown.css";
|
||||
@import "./markdown.less";
|
||||
@import "./highlight.js.less";
|
||||
|
||||
/*** Main Styles ***/
|
||||
body {
|
||||
|
@ -47,13 +48,41 @@ h1 {
|
|||
/*** Search Box ***/
|
||||
#search-form {
|
||||
float: right;
|
||||
|
||||
@height: 30px;
|
||||
|
||||
input, button {
|
||||
margin: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 200px;
|
||||
height: @height;
|
||||
.border-box;
|
||||
padding: 0 5px;
|
||||
font-size: 16px;
|
||||
border: 1px solid #444;
|
||||
border-right: 0;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
height: @height;
|
||||
width: @height;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*** Package Entries ***/
|
||||
.entry {
|
||||
background: #EEE;
|
||||
background: #F3F3F3;
|
||||
.border-radius(4px);
|
||||
padding: 12px 15px;
|
||||
padding: 12px 15px 15px;
|
||||
|
||||
h3 {
|
||||
font-size: 24px;
|
||||
|
@ -68,12 +97,20 @@ h1 {
|
|||
.author {
|
||||
font-size: 16px;
|
||||
float: right;
|
||||
color: #555;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.readme {
|
||||
font-size: 14px;
|
||||
margin-top: 10px;
|
||||
background: #FFF;
|
||||
padding: 10px 12px;
|
||||
.border-radius(3px);
|
||||
}
|
||||
}
|
||||
|
||||
/*** Search Results ***/
|
||||
|
|
|
@ -1,279 +0,0 @@
|
|||
/*** Sourced from this Gist: https://gist.github.com/andyferra/2554919 ***/
|
||||
|
||||
body {
|
||||
font-family: Helvetica, arial, sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
background-color: white;
|
||||
padding: 30px; }
|
||||
|
||||
body > *:first-child {
|
||||
margin-top: 0 !important; }
|
||||
body > *:last-child {
|
||||
margin-bottom: 0 !important; }
|
||||
|
||||
a {
|
||||
color: #4183C4; }
|
||||
a.absent {
|
||||
color: #cc0000; }
|
||||
a.anchor {
|
||||
display: block;
|
||||
padding-left: 30px;
|
||||
margin-left: -30px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0; }
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 20px 0 10px;
|
||||
padding: 0;
|
||||
font-weight: bold;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
cursor: text;
|
||||
position: relative; }
|
||||
|
||||
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor {
|
||||
background: url("../../images/modules/styleguide/para.png") no-repeat 10px center;
|
||||
text-decoration: none; }
|
||||
|
||||
h1 tt, h1 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h2 tt, h2 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h3 tt, h3 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h4 tt, h4 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h5 tt, h5 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h6 tt, h6 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h1 {
|
||||
font-size: 28px;
|
||||
color: black; }
|
||||
|
||||
h2 {
|
||||
font-size: 24px;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
color: black; }
|
||||
|
||||
h3 {
|
||||
font-size: 18px; }
|
||||
|
||||
h4 {
|
||||
font-size: 16px; }
|
||||
|
||||
h5 {
|
||||
font-size: 14px; }
|
||||
|
||||
h6 {
|
||||
color: #777777;
|
||||
font-size: 14px; }
|
||||
|
||||
p, blockquote, ul, ol, dl, li, table, pre {
|
||||
margin: 15px 0; }
|
||||
|
||||
hr {
|
||||
background: transparent url("../../images/modules/pulls/dirty-shade.png") repeat-x 0 0;
|
||||
border: 0 none;
|
||||
color: #cccccc;
|
||||
height: 4px;
|
||||
padding: 0; }
|
||||
|
||||
body > h2:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
body > h1:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
body > h1:first-child + h2 {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
|
||||
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
|
||||
h1 p, h2 p, h3 p, h4 p, h5 p, h6 p {
|
||||
margin-top: 0; }
|
||||
|
||||
li p.first {
|
||||
display: inline-block; }
|
||||
|
||||
ul, ol {
|
||||
padding-left: 30px; }
|
||||
|
||||
ul :first-child, ol :first-child {
|
||||
margin-top: 0; }
|
||||
|
||||
ul :last-child, ol :last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
dl {
|
||||
padding: 0; }
|
||||
dl dt {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
padding: 0;
|
||||
margin: 15px 0 5px; }
|
||||
dl dt:first-child {
|
||||
padding: 0; }
|
||||
dl dt > :first-child {
|
||||
margin-top: 0; }
|
||||
dl dt > :last-child {
|
||||
margin-bottom: 0; }
|
||||
dl dd {
|
||||
margin: 0 0 15px;
|
||||
padding: 0 15px; }
|
||||
dl dd > :first-child {
|
||||
margin-top: 0; }
|
||||
dl dd > :last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
blockquote {
|
||||
border-left: 4px solid #dddddd;
|
||||
padding: 0 15px;
|
||||
color: #777777; }
|
||||
blockquote > :first-child {
|
||||
margin-top: 0; }
|
||||
blockquote > :last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
table {
|
||||
padding: 0; }
|
||||
table tr {
|
||||
border-top: 1px solid #cccccc;
|
||||
background-color: white;
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
table tr:nth-child(2n) {
|
||||
background-color: #f8f8f8; }
|
||||
table tr th {
|
||||
font-weight: bold;
|
||||
border: 1px solid #cccccc;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 6px 13px; }
|
||||
table tr td {
|
||||
border: 1px solid #cccccc;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 6px 13px; }
|
||||
table tr th :first-child, table tr td :first-child {
|
||||
margin-top: 0; }
|
||||
table tr th :last-child, table tr td :last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
span.frame {
|
||||
display: block;
|
||||
overflow: hidden; }
|
||||
span.frame > span {
|
||||
border: 1px solid #dddddd;
|
||||
display: block;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
margin: 13px 0 0;
|
||||
padding: 7px;
|
||||
width: auto; }
|
||||
span.frame span img {
|
||||
display: block;
|
||||
float: left; }
|
||||
span.frame span span {
|
||||
clear: both;
|
||||
color: #333333;
|
||||
display: block;
|
||||
padding: 5px 0 0; }
|
||||
span.align-center {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both; }
|
||||
span.align-center > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px auto 0;
|
||||
text-align: center; }
|
||||
span.align-center span img {
|
||||
margin: 0 auto;
|
||||
text-align: center; }
|
||||
span.align-right {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both; }
|
||||
span.align-right > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px 0 0;
|
||||
text-align: right; }
|
||||
span.align-right span img {
|
||||
margin: 0;
|
||||
text-align: right; }
|
||||
span.float-left {
|
||||
display: block;
|
||||
margin-right: 13px;
|
||||
overflow: hidden;
|
||||
float: left; }
|
||||
span.float-left span {
|
||||
margin: 13px 0 0; }
|
||||
span.float-right {
|
||||
display: block;
|
||||
margin-left: 13px;
|
||||
overflow: hidden;
|
||||
float: right; }
|
||||
span.float-right > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px auto 0;
|
||||
text-align: right; }
|
||||
|
||||
code, tt {
|
||||
margin: 0 2px;
|
||||
padding: 0 5px;
|
||||
white-space: nowrap;
|
||||
border: 1px solid #eaeaea;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 3px; }
|
||||
|
||||
pre code {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
border: none;
|
||||
background: transparent; }
|
||||
|
||||
.highlight pre {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #cccccc;
|
||||
font-size: 13px;
|
||||
line-height: 19px;
|
||||
overflow: auto;
|
||||
padding: 6px 10px;
|
||||
border-radius: 3px; }
|
||||
|
||||
pre {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #cccccc;
|
||||
font-size: 13px;
|
||||
line-height: 19px;
|
||||
overflow: auto;
|
||||
padding: 6px 10px;
|
||||
border-radius: 3px; }
|
||||
pre code, pre tt {
|
||||
background-color: transparent;
|
||||
border: none; }
|
267
lib/GUI/css/markdown.less
Normal file
267
lib/GUI/css/markdown.less
Normal file
|
@ -0,0 +1,267 @@
|
|||
/*** Sourced from this Gist: https://gist.github.com/andyferra/2554919 ***/
|
||||
|
||||
.readme {
|
||||
a {
|
||||
color: #4183C4; }
|
||||
a.absent {
|
||||
color: #cc0000; }
|
||||
a.anchor {
|
||||
display: block;
|
||||
padding-left: 30px;
|
||||
margin-left: -30px;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0; }
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 20px 0 10px;
|
||||
padding: 0;
|
||||
font-weight: bold;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
cursor: text;
|
||||
position: relative; }
|
||||
|
||||
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor {
|
||||
background: url("../../images/modules/styleguide/para.png") no-repeat 10px center;
|
||||
text-decoration: none; }
|
||||
|
||||
h1 tt, h1 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h2 tt, h2 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h3 tt, h3 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h4 tt, h4 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h5 tt, h5 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h6 tt, h6 code {
|
||||
font-size: inherit; }
|
||||
|
||||
h1 {
|
||||
font-size: 28px;
|
||||
color: black; }
|
||||
|
||||
h2 {
|
||||
font-size: 24px;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
color: black; }
|
||||
|
||||
h3 {
|
||||
font-size: 18px; }
|
||||
|
||||
h4 {
|
||||
font-size: 16px; }
|
||||
|
||||
h5 {
|
||||
font-size: 14px; }
|
||||
|
||||
h6 {
|
||||
color: #777777;
|
||||
font-size: 14px; }
|
||||
|
||||
p, blockquote, ul, ol, dl, li, table, pre {
|
||||
margin: 15px 0; }
|
||||
|
||||
hr {
|
||||
background: transparent url("../../images/modules/pulls/dirty-shade.png") repeat-x 0 0;
|
||||
border: 0 none;
|
||||
color: #cccccc;
|
||||
height: 4px;
|
||||
padding: 0; }
|
||||
|
||||
body > h2:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
body > h1:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
body > h1:first-child + h2 {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
|
||||
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
|
||||
margin-top: 0;
|
||||
padding-top: 0; }
|
||||
|
||||
h1 p, h2 p, h3 p, h4 p, h5 p, h6 p {
|
||||
margin-top: 0; }
|
||||
|
||||
li p.first {
|
||||
display: inline-block; }
|
||||
|
||||
ul, ol {
|
||||
padding-left: 30px; }
|
||||
|
||||
ul :first-child, ol :first-child {
|
||||
margin-top: 0; }
|
||||
|
||||
ul :last-child, ol :last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
dl {
|
||||
padding: 0; }
|
||||
dl dt {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
padding: 0;
|
||||
margin: 15px 0 5px; }
|
||||
dl dt:first-child {
|
||||
padding: 0; }
|
||||
dl dt > :first-child {
|
||||
margin-top: 0; }
|
||||
dl dt > :last-child {
|
||||
margin-bottom: 0; }
|
||||
dl dd {
|
||||
margin: 0 0 15px;
|
||||
padding: 0 15px; }
|
||||
dl dd > :first-child {
|
||||
margin-top: 0; }
|
||||
dl dd > :last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
blockquote {
|
||||
border-left: 4px solid #dddddd;
|
||||
padding: 0 15px;
|
||||
color: #777777; }
|
||||
blockquote > :first-child {
|
||||
margin-top: 0; }
|
||||
blockquote > :last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
table {
|
||||
padding: 0; }
|
||||
table tr {
|
||||
border-top: 1px solid #cccccc;
|
||||
background-color: white;
|
||||
margin: 0;
|
||||
padding: 0; }
|
||||
table tr:nth-child(2n) {
|
||||
background-color: #f8f8f8; }
|
||||
table tr th {
|
||||
font-weight: bold;
|
||||
border: 1px solid #cccccc;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 6px 13px; }
|
||||
table tr td {
|
||||
border: 1px solid #cccccc;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 6px 13px; }
|
||||
table tr th :first-child, table tr td :first-child {
|
||||
margin-top: 0; }
|
||||
table tr th :last-child, table tr td :last-child {
|
||||
margin-bottom: 0; }
|
||||
|
||||
img {
|
||||
max-width: 100%; }
|
||||
|
||||
span.frame {
|
||||
display: block;
|
||||
overflow: hidden; }
|
||||
span.frame > span {
|
||||
border: 1px solid #dddddd;
|
||||
display: block;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
margin: 13px 0 0;
|
||||
padding: 7px;
|
||||
width: auto; }
|
||||
span.frame span img {
|
||||
display: block;
|
||||
float: left; }
|
||||
span.frame span span {
|
||||
clear: both;
|
||||
color: #333333;
|
||||
display: block;
|
||||
padding: 5px 0 0; }
|
||||
span.align-center {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both; }
|
||||
span.align-center > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px auto 0;
|
||||
text-align: center; }
|
||||
span.align-center span img {
|
||||
margin: 0 auto;
|
||||
text-align: center; }
|
||||
span.align-right {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
clear: both; }
|
||||
span.align-right > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px 0 0;
|
||||
text-align: right; }
|
||||
span.align-right span img {
|
||||
margin: 0;
|
||||
text-align: right; }
|
||||
span.float-left {
|
||||
display: block;
|
||||
margin-right: 13px;
|
||||
overflow: hidden;
|
||||
float: left; }
|
||||
span.float-left span {
|
||||
margin: 13px 0 0; }
|
||||
span.float-right {
|
||||
display: block;
|
||||
margin-left: 13px;
|
||||
overflow: hidden;
|
||||
float: right; }
|
||||
span.float-right > span {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 13px auto 0;
|
||||
text-align: right; }
|
||||
|
||||
code, tt {
|
||||
margin: 0 2px;
|
||||
padding: 0 5px;
|
||||
white-space: nowrap;
|
||||
border: 1px solid #eaeaea;
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 3px; }
|
||||
|
||||
pre code {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
border: none;
|
||||
background: transparent; }
|
||||
|
||||
.highlight pre {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #cccccc;
|
||||
font-size: 13px;
|
||||
line-height: 19px;
|
||||
overflow: auto;
|
||||
padding: 6px 10px;
|
||||
border-radius: 3px; }
|
||||
|
||||
pre {
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #cccccc;
|
||||
font-size: 13px;
|
||||
line-height: 19px;
|
||||
overflow: auto;
|
||||
padding: 6px 10px;
|
||||
border-radius: 3px; }
|
||||
pre code, pre tt {
|
||||
background-color: transparent;
|
||||
border: none; }
|
||||
}
|
|
@ -1,4 +1,8 @@
|
|||
<article class='entry'>
|
||||
<h3>{{ name }} <small class='version'>v{{ version }}</small><div class='author'>By: {{ _npmUser.name }}</div></h3>
|
||||
<article class='entry' data-name='{{ name }}' data-version='{{ version }}'>
|
||||
<h3>
|
||||
<a class='name' href='javascript:void(0)'>{{ name }}</a>
|
||||
<small class='version'>v{{ version }}</small>
|
||||
<div class='author'>By: {{ _npmUser.name }}</div>
|
||||
</h3>
|
||||
<p>{{ description }}</p>
|
||||
</article>
|
|
@ -20,8 +20,7 @@
|
|||
<h2>
|
||||
Available Packages:
|
||||
<form id='search-form'>
|
||||
<input type='text' placeholder='Search' name='q' />
|
||||
<button class='clear'>x</button>
|
||||
<input type='text' placeholder='Search' name='q' /><button class='clear'>X</button>
|
||||
</form>
|
||||
</h2>
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
var $ = require('unopinionate').selector,
|
||||
onClick = require('onclick');
|
||||
|
||||
$(function() {
|
||||
onClick('.entry .name', function() {
|
||||
var $this = $(this),
|
||||
$entry = $this.closest('.entry');
|
||||
|
||||
if($entry.hasClass('open')) {
|
||||
$entry
|
||||
.removeClass('open')
|
||||
.find('.readme').remove();
|
||||
}
|
||||
else {
|
||||
$entry.addClass('open');
|
||||
|
||||
$.ajax({
|
||||
url: '/-/readme/'+$entry.attr('data-name')+'/'+$entry.attr('data-version'),
|
||||
dataType: 'text',
|
||||
success: function(html) {
|
||||
console.log(html);
|
||||
$("<div class='readme'>")
|
||||
.html(html)
|
||||
.appendTo($entry);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
File diff suppressed because one or more lines are too long
|
@ -5,17 +5,25 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|||
var buffer = "", stack1, helper, functionType="function", escapeExpression=this.escapeExpression;
|
||||
|
||||
|
||||
buffer += "<article class='entry'>\n <h3>";
|
||||
buffer += "<article class='entry' data-name='";
|
||||
if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
||||
else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
||||
buffer += escapeExpression(stack1)
|
||||
+ " <small class='version'>v";
|
||||
+ "' data-version='";
|
||||
if (helper = helpers.version) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
||||
else { helper = (depth0 && depth0.version); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
||||
buffer += escapeExpression(stack1)
|
||||
+ "</small><div class='author'>By: "
|
||||
+ "'>\n <h3>\n <a class='name' href='javascript:void(0)'>";
|
||||
if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
||||
else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
||||
buffer += escapeExpression(stack1)
|
||||
+ "</a>\n <small class='version'>v";
|
||||
if (helper = helpers.version) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
||||
else { helper = (depth0 && depth0.version); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
||||
buffer += escapeExpression(stack1)
|
||||
+ "</small>\n <div class='author'>By: "
|
||||
+ escapeExpression(((stack1 = ((stack1 = (depth0 && depth0._npmUser)),stack1 == null || stack1 === false ? stack1 : stack1.name)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
|
||||
+ "</div></h3>\n <p>";
|
||||
+ "</div>\n </h3>\n <p>";
|
||||
if (helper = helpers.description) { stack1 = helper.call(depth0, {hash:{},data:data}); }
|
||||
else { helper = (depth0 && depth0.description); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
|
||||
buffer += escapeExpression(stack1)
|
||||
|
@ -23,8 +31,36 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
|||
return buffer;
|
||||
});
|
||||
},{"handlebars/runtime":11}],2:[function(require,module,exports){
|
||||
var $ = require('unopinionate').selector,
|
||||
onClick = require('onclick');
|
||||
|
||||
},{}],3:[function(require,module,exports){
|
||||
$(function() {
|
||||
onClick('.entry .name', function() {
|
||||
var $this = $(this),
|
||||
$entry = $this.closest('.entry');
|
||||
|
||||
if($entry.hasClass('open')) {
|
||||
$entry
|
||||
.removeClass('open')
|
||||
.find('.readme').remove();
|
||||
}
|
||||
else {
|
||||
$entry.addClass('open');
|
||||
|
||||
$.ajax({
|
||||
url: '/-/readme/'+$entry.attr('data-name')+'/'+$entry.attr('data-version'),
|
||||
dataType: 'text',
|
||||
success: function(html) {
|
||||
console.log(html);
|
||||
$("<div class='readme'>")
|
||||
.html(html)
|
||||
.appendTo($entry);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},{"onclick":12,"unopinionate":13}],3:[function(require,module,exports){
|
||||
require('./search');
|
||||
require('./entry');
|
||||
|
||||
|
@ -79,7 +115,7 @@ $(function() {
|
|||
});
|
||||
});
|
||||
|
||||
},{"../entry.handlebars":1,"unopinionate":12}],5:[function(require,module,exports){
|
||||
},{"../entry.handlebars":1,"unopinionate":13}],5:[function(require,module,exports){
|
||||
"use strict";
|
||||
/*globals Handlebars: true */
|
||||
var base = require("./handlebars/base");
|
||||
|
@ -555,6 +591,171 @@ exports.isEmpty = isEmpty;
|
|||
module.exports = require('./dist/cjs/handlebars.runtime');
|
||||
|
||||
},{"./dist/cjs/handlebars.runtime":5}],12:[function(require,module,exports){
|
||||
var $ = require('unopinionate').selector;
|
||||
|
||||
var $document = $(document),
|
||||
bindings = {};
|
||||
|
||||
var click = function(events) {
|
||||
click.bind.apply(click, arguments);
|
||||
return click;
|
||||
};
|
||||
|
||||
/*** Configuration Options ***/
|
||||
click.distanceLimit = 10;
|
||||
click.timeLimit = 140;
|
||||
|
||||
/*** Useful Properties ***/
|
||||
click.isTouch = ('ontouchstart' in window) ||
|
||||
window.DocumentTouch &&
|
||||
document instanceof DocumentTouch;
|
||||
|
||||
/*** Cached Functions ***/
|
||||
var onTouchstart = function(e) {
|
||||
e.stopPropagation(); //Prevents multiple click events from happening
|
||||
|
||||
click._doAnywheres(e);
|
||||
|
||||
var $this = $(this),
|
||||
startTime = new Date().getTime(),
|
||||
startPos = click._getPos(e);
|
||||
|
||||
$this.one('touchend', function(e) {
|
||||
e.preventDefault(); //Prevents click event from firing
|
||||
|
||||
var time = new Date().getTime() - startTime,
|
||||
endPos = click._getPos(e),
|
||||
distance = Math.sqrt(
|
||||
Math.pow(endPos.x - startPos.x, 2) +
|
||||
Math.pow(endPos.y - startPos.y, 2)
|
||||
);
|
||||
|
||||
if(time < click.timeLimit && distance < click.distanceLimit) {
|
||||
//Find the correct callback
|
||||
$.each(bindings, function(selector, callback) {
|
||||
if($this.is(selector)) {
|
||||
callback.apply(e.target, [e]);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*** API ***/
|
||||
click.bind = function(events) {
|
||||
|
||||
//Argument Surgery
|
||||
if(!$.isPlainObject(events)) {
|
||||
newEvents = {};
|
||||
newEvents[arguments[0]] = arguments[1];
|
||||
events = newEvents;
|
||||
}
|
||||
|
||||
$.each(events, function(selector, callback) {
|
||||
|
||||
/*** Register Binding ***/
|
||||
if(typeof bindings[selector] != 'undefined') {
|
||||
click.unbind(selector); //Ensure no duplicates
|
||||
}
|
||||
|
||||
bindings[selector] = callback;
|
||||
|
||||
/*** Touch Support ***/
|
||||
if(click.isTouch) {
|
||||
$document.delegate(selector, 'touchstart', onTouchstart);
|
||||
}
|
||||
|
||||
/*** Mouse Support ***/
|
||||
$document.delegate(selector, 'click', function(e) {
|
||||
e.stopPropagation(); //Prevents multiple click events from happening
|
||||
//click._doAnywheres(e); //Do anywheres first to be consistent with touch order
|
||||
callback.apply(this, [e]);
|
||||
});
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
click.unbind = function(selector) {
|
||||
$document
|
||||
.undelegate(selector, 'touchstart')
|
||||
.undelegate(selector, 'click');
|
||||
|
||||
delete bindings[selector];
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
click.unbindAll = function() {
|
||||
$.each(bindings, function(selector, callback) {
|
||||
$document
|
||||
.undelegate(selector, 'touchstart')
|
||||
.undelegate(selector, 'click');
|
||||
});
|
||||
|
||||
bindings = {};
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
click.trigger = function(selector, e) {
|
||||
e = e || $.Event('click');
|
||||
|
||||
if(typeof bindings[selector] != 'undefined') {
|
||||
bindings[selector](e);
|
||||
}
|
||||
else {
|
||||
console.error("No click events bound for selector '"+selector+"'.");
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
click.anywhere = function(callback) {
|
||||
click._anywheres.push(callback);
|
||||
return this;
|
||||
};
|
||||
|
||||
/*** Internal (but useful) Methods ***/
|
||||
click._getPos = function(e) {
|
||||
e = e.originalEvent;
|
||||
|
||||
if(e.pageX || e.pageY) {
|
||||
return {
|
||||
x: e.pageX,
|
||||
y: e.pageY
|
||||
};
|
||||
}
|
||||
else if(e.changedTouches) {
|
||||
return {
|
||||
x: e.changedTouches[0].clientX,
|
||||
y: e.changedTouches[0].clientY
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
x: e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft,
|
||||
y: e.clientY + document.body.scrollTop + document.documentElement.scrollTop
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
click._anywheres = [];
|
||||
|
||||
click._doAnywheres = function(e) {
|
||||
var i = click._anywheres.length;
|
||||
while(i--) {
|
||||
click._anywheres[i](e);
|
||||
}
|
||||
};
|
||||
|
||||
$(document).bind('mousedown', click._doAnywheres);
|
||||
|
||||
module.exports = click;
|
||||
|
||||
|
||||
},{"unopinionate":13}],13:[function(require,module,exports){
|
||||
(function (global){
|
||||
(function(root) {
|
||||
var unopinionate = {
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
"marked": "^0.3.2",
|
||||
"minimatch": ">= 0.2.14",
|
||||
"mkdirp": ">= 0.3.5",
|
||||
"onclick": "^0.1.0",
|
||||
"request": ">= 2.31.0",
|
||||
"semver": ">= 2.2.1",
|
||||
"tar.gz": "^0.1.1",
|
||||
|
|
Loading…
Add table
Reference in a new issue