├── CNAME
├── css
└── style.css
├── img
├── github.png
└── npm.png
├── index.html
└── js
├── fnSetFilteringDelay.js
└── main.js
/CNAME:
--------------------------------------------------------------------------------
1 | nipstr.com
2 |
--------------------------------------------------------------------------------
/css/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: none repeat scroll 0 0 #EFF2F3;
3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
4 | }
5 |
6 | a {
7 | color: #00B7FF;
8 | }
9 |
10 | th {
11 | cursor: pointer;
12 | }
13 |
14 | .wrapper {
15 | background: none repeat scroll 0 0 #FFFFFF;
16 | border: 1px solid #AFAFAF;
17 | -moz-border-radius: 5px 5px 5px 5px;
18 | -webkit-border-radius: 10px;
19 | -moz-border-radius: 10px;
20 | border-radius: 10px;
21 | min-width: 1000px;
22 | margin: 10px auto;
23 | }
24 |
25 | .content {
26 | padding: 10px;
27 | }
28 |
29 | .npm {
30 | height: 100px;
31 | }
32 |
33 | .npm img {
34 | height: 50px;
35 | display: inline;
36 | }
37 |
38 | .npm span {
39 | margin-left: 15px;
40 | margin-right: 15px;
41 | }
42 |
43 | .plus {
44 | font-size: 40px;
45 | }
46 |
47 | span.big {
48 | margin-left: 0px;
49 | font-size: 30px;
50 | }
51 |
52 | input {
53 | -moz-border-radius: 5px 5px 5px 5px;
54 | -webkit-border-radius: 10px;
55 | -moz-border-radius: 10px;
56 | border-radius: 10px;
57 | border: solid 1px #494949;
58 | outline: none;
59 | padding: 5px;
60 | }
61 |
62 | table {
63 | width: 100%;
64 | table-layout: fixed;
65 | }
66 |
67 | .dataTables_paginate {
68 | padding-top: 10px;
69 | }
70 |
71 | .dataTables_paginate a {
72 | color: #000000;
73 | }
74 |
75 | .paging_full_numbers .paginate_button,
76 | .paging_full_numbers .paginate_active {
77 | border: 1px solid #494949;
78 | -webkit-border-radius: 5px;
79 | -moz-border-radius: 5px;
80 | padding: 2px 5px;
81 | margin: 0 3px;
82 | cursor: pointer;
83 | }
84 |
85 | .dataTables_paginate {
86 | padding-top: 10px;
87 | }
88 |
89 | .paging_full_numbers .paginate_button {
90 | background-color: #FEFEFE;
91 | }
92 |
93 | .paging_full_numbers .paginate_button:hover {
94 | background-color: #EFF2F3;
95 | }
96 |
97 | .paging_full_numbers .paginate_active {
98 | background-color: #BEDCE7;
99 | }
100 |
101 | .sorting_desc, .sorting_asc {
102 | text-decoration: underline;
103 | }
104 |
105 | tr {
106 | height: 1em;
107 | }
108 |
109 | tr.odd {
110 | background-color: #FFCCCC;
111 | }
112 |
113 | tr.even {
114 | background-color: white;
115 | }
116 |
117 | th.medium {
118 | width: 15%;
119 | }
120 |
121 | th.small {
122 | width: 9%;
123 | }
124 |
125 | th.tiny {
126 | width: 6%;
127 | }
128 |
129 | a.npm {
130 | margin-left: 15px;
131 | }
132 |
133 | tr {
134 | line-height: 20px;
135 | }
136 |
137 | tr.odd:hover, tr.even:hover {
138 | background-color: #FFAAAA;
139 | }
140 |
141 | td {
142 | overflow: hidden;
143 | white-space: nowrap;
144 | }
145 |
146 | .lastUpdate {
147 | float: right;
148 | padding-right: 200px;
149 | }
150 |
151 | .fork {
152 | position: absolute;
153 | top: 0;
154 | right: 0;
155 | border: 0;
156 | z-index: 50;
157 | }
158 |
--------------------------------------------------------------------------------
/img/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eirikb/nipster/a69dedfd5adabfcf127f7432229d18746e1adb71/img/github.png
--------------------------------------------------------------------------------
/img/npm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eirikb/nipster/a69dedfd5adabfcf127f7432229d18746e1adb71/img/npm.png
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Nipster! npm search tool for Node.js
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
+
36 |
=
37 |
Perfect rating!
38 |
39 |
40 |
41 |
42 |
43 | Package |
44 | Repo |
45 | Description |
46 | Author |
47 | Modified |
48 | Forks |
49 | Stargazers |
50 | Watchers |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/js/fnSetFilteringDelay.js:
--------------------------------------------------------------------------------
1 | // http://www.datatables.net/plug-ins/api#fnSetFilteringDelay
2 | jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function(oSettings, iDelay) {
3 | var _that = this;
4 |
5 | if (iDelay === undefined) {
6 | iDelay = 250;
7 | }
8 |
9 | this.each(function(i) {
10 | $.fn.dataTableExt.iApiIndex = i;
11 | var
12 | $this = this,
13 | oTimerId = null,
14 | sPreviousSearch = null,
15 | anControl = $('input', _that.fnSettings().aanFeatures.f);
16 |
17 | anControl.unbind('keyup').bind('keyup', function() {
18 | var $$this = $this;
19 |
20 | if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
21 | window.clearTimeout(oTimerId);
22 | sPreviousSearch = anControl.val();
23 | oTimerId = window.setTimeout(function() {
24 | $.fn.dataTableExt.iApiIndex = i;
25 | _that.fnFilter(anControl.val());
26 | }, iDelay);
27 | }
28 | });
29 |
30 | return this;
31 | });
32 | return this;
33 | };
34 |
--------------------------------------------------------------------------------
/js/main.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | var $table = $('table').dataTable({
3 | sAjaxSource: '//nipster.blob.core.windows.net/npm-datatables.json',
4 | fnServerData: function(sSource, aoData, fnCallback, oSettings) {
5 | oSettings.jqXHR = $.ajax({
6 | url: sSource,
7 | success: function(data) {
8 | $('#last-update').text('Last update: ' + data.lastUpdate);
9 | fnCallback(data);
10 | }
11 | });
12 | },
13 | aaSorting: [
14 | [6, 'desc']
15 | ],
16 | bLengthChange: false,
17 | sPaginationType: 'full_numbers',
18 | iDisplayLength: 21,
19 | bProcessing: true,
20 | bAutoWidth: false,
21 | bDeferRender: true,
22 | fnRowCallback: function(tr, data) {
23 | var $c = $(tr).children();
24 | $c.eq(0).html($('', { title: data[7], href: 'https://www.npmjs.org/package/' + data[0], target: '_blank'}).text(data[0]));
25 |
26 | if (data[1]) {
27 | var name = data[1].split('/');
28 | $c.eq(1).html($('', {href: 'https://github.com/' + data[1], target: '_blank'}).text(name[name.length - 1]));
29 | }
30 |
31 | var desc = $c.eq(2).text();
32 | $c.eq(2).prop('title', desc).text(desc);
33 |
34 | var author = data[3].split(';');
35 | $c.eq(3).html($('', {href: author[0], target: '_blank'}).text(author[1]));
36 | }
37 | }).fnSetFilteringDelay(300);
38 |
39 | var $input = $(':input[type=text]').focus();
40 |
41 | $input.keyup(function(e) {
42 | if (e.keyCode === 27) {
43 | $table.fnFilter('');
44 | $input.val('');
45 | $input.click();
46 | }
47 | if (window.location.hash.length > 1) {
48 | window.History.replaceState({}, '', '#' + $input.val());
49 | }
50 | window.location.hash = $input.val();
51 | });
52 |
53 | var hash = window.location.hash.slice(1);
54 | if (hash.length > 0) {
55 | hash = decodeURIComponent(hash);
56 | $input.val(hash);
57 | $table.fnFilter($input.val());
58 | } else {
59 | $input.val('');
60 | $table.fnFilter('');
61 | }
62 | });
63 |
--------------------------------------------------------------------------------