From 91778aae92515939462bd25884a488492b42d7f8 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 21:18:54 +0200 Subject: [PATCH 01/57] Make library container width 100% and tweak colors --- frontend/app/styles/main.css | 10 +++++++++- frontend/app/views/main.html | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index d9bb73942..32d58124e 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -1,5 +1,5 @@ body { - background-color: #ebebeb; + background-color: #f4f4f4; color: #5e5b64; margin: 40px; font: 15px/1.3 "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; @@ -82,6 +82,10 @@ ul li p { margin-top: 1em; } +.libraries { + width: 100%; +} + .library { -webkit-touch-callout: none; -webkit-user-select: none; @@ -89,6 +93,10 @@ ul li p { -moz-user-select: none; -ms-user-select: none; user-select: none; + + background-color: white; + border-radius: 0.2em 0.1em 0.1em 0.1em; + border: 0.1em solid #e3e3e3; } .library:hover { diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index c139d4cf4..d26600c8a 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -11,7 +11,7 @@
-
\ No newline at end of file From ada7be6e5db0bf6a808c68bd5f449a524f90028e Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 21:25:18 +0200 Subject: [PATCH 03/57] Remove sorting --- frontend/app/styles/main.css | 11 ----------- frontend/app/views/main.html | 5 ----- 2 files changed, 16 deletions(-) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index 32d58124e..8a561cf15 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -119,20 +119,9 @@ ul li p { display: block; } -.sort { - margin-right: 1em; -} - .label { margin-right: 0.5em; } - -.pageSelector, -.sort { - padding: 0; - cursor: pointer; -} - .loader { text-align: center; } diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 1e42b9921..c6effc5a5 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -2,11 +2,6 @@ - -
Loading
From 4d785d0901283fb5b0e2b04d66cc4f57b9792ed5 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 21:26:08 +0200 Subject: [PATCH 04/57] Add some margin below libraries --- frontend/app/styles/main.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index 8a561cf15..a7a2f990b 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -94,6 +94,8 @@ ul li p { -ms-user-select: none; user-select: none; + margin-bottom: 1em; + background-color: white; border-radius: 0.2em 0.1em 0.1em 0.1em; border: 0.1em solid #e3e3e3; From 6b915b6c7c0ab383b9e2e6c0628414cf96d342cd Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 21:28:22 +0200 Subject: [PATCH 05/57] Show only ten results --- frontend/app/views/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index c6effc5a5..2d4cf317d 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -6,7 +6,7 @@
    -
  • +
  • {{library.name}}

    From c9045c4f6f7560ad11b05913418a4f8abddc79d6 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 21:31:14 +0200 Subject: [PATCH 06/57] Add search filter --- frontend/app/views/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 2d4cf317d..65df41649 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -6,7 +6,7 @@
      -
    • +
    • {{library.name}}

      From 4adaab94a17c1e1464dbad4c86c97de59ada610a Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 21:31:21 +0200 Subject: [PATCH 07/57] Remove pagination imports --- frontend/app/index.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frontend/app/index.html b/frontend/app/index.html index f027faa82..d35d8d131 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -40,10 +40,6 @@ - - - - From 0ca2d28c6bc1a661d29ac8c900da437ab50339d0 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 22:03:34 +0200 Subject: [PATCH 08/57] Sketch out a priority search filter Note that this is still WIP. Need to think about it. --- frontend/app/index.html | 1 + .../app/scripts/filters/prioritysearch.js | 32 +++++++++++++++++++ frontend/app/views/main.html | 2 +- frontend/test/spec/filters/prioritysearch.js | 19 +++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 frontend/app/scripts/filters/prioritysearch.js create mode 100644 frontend/test/spec/filters/prioritysearch.js diff --git a/frontend/app/index.html b/frontend/app/index.html index d35d8d131..cb5366476 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -40,6 +40,7 @@ + diff --git a/frontend/app/scripts/filters/prioritysearch.js b/frontend/app/scripts/filters/prioritysearch.js new file mode 100644 index 000000000..e5bc8b57b --- /dev/null +++ b/frontend/app/scripts/filters/prioritysearch.js @@ -0,0 +1,32 @@ +'use strict'; + +angular.module('osscdnApp').filter('prioritysearch', function() { + return function(input, queries) { + if(!queries) { + return input; + } + + var queryNames = Object.keys(queries); + var qLen = queryNames.length; + var scores = {}; + + return input.filter(function(inp) { + return queryNames.filter(function(k) { + var ret = inp[k].indexOf(queries[k]); + + if(ret === 0) { + scores[inp[k]] = inp[k].length - queries[k].length; + + return true; + } + }).length === qLen; + }); + + // XXX: this is problematic because it mutates the original somehow + // ie. empty -> entry -> empty doesn't yield the same result! + /*.sort(function(a, b) { + // TODO: figure out a proper scoring function for multiple properties + return scores[a[queryNames[0]]] >= scores[b[queryNames[0]]]; + });*/ + }; +}); diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 65df41649..ad33d568b 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -6,7 +6,7 @@
        -
      • +
      • {{library.name}}

        diff --git a/frontend/test/spec/filters/prioritysearch.js b/frontend/test/spec/filters/prioritysearch.js new file mode 100644 index 000000000..501fd37d2 --- /dev/null +++ b/frontend/test/spec/filters/prioritysearch.js @@ -0,0 +1,19 @@ +'use strict'; + +describe('Filter: prioritysearch', function () { + + // load the filter's module + beforeEach(module('osscdnApp')); + + // initialize a new instance of the filter before each test + var prioritysearch; + beforeEach(inject(function ($filter) { + prioritysearch = $filter('prioritysearch'); + })); + + it('should return the input prefixed with "prioritysearch filter:"', function () { + var text = 'angularjs'; + expect(prioritysearch(text)).toBe('prioritysearch filter: ' + text); + }); + +}); From d5f3ef7d4bfccd40ba4925fa5d00b165f967d5fb Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 22:09:26 +0200 Subject: [PATCH 09/57] Attach GitHub urls to data Note that they have .git suffix but it doesn't seem to hurt. Ideally we would eliminate those from the output to save some bytes, though. --- walker/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/walker/index.js b/walker/index.js index f6d3249b0..64d00d540 100755 --- a/walker/index.js +++ b/walker/index.js @@ -87,6 +87,7 @@ function walk(root, cb) { return cb(null, ret); } + ret.github = repoUrl; ret.stars = stars; cb(null, ret); From e84cc1575cfa12d92a71000137340c1dc84338b6 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 22:10:53 +0200 Subject: [PATCH 10/57] Make search look nicer --- frontend/app/styles/main.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index a7a2f990b..ca84110d5 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -21,10 +21,8 @@ a:hover{ --------------------------*/ .search { - background-color: #00571E; box-shadow: 0 1px 1px #ccc; border-radius: 2px; - width: 400px; padding: 14px; margin: 45px auto 20px; position: relative; From f1935807088b9f65567d5aff1df539a9a836a6be Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 22:42:50 +0200 Subject: [PATCH 11/57] Sketch out a dropdown (WIP) Still need to figure out why actual items don't show up and prepare the data and logic to work with this. --- frontend/app/index.html | 2 ++ frontend/app/scripts/app.js | 2 +- frontend/app/scripts/controllers/main.js | 27 +++++++++++++++++++----- frontend/app/styles/main.css | 18 +++++++++------- frontend/app/views/main.html | 18 ++-------------- frontend/bower.json | 4 +++- 6 files changed, 40 insertions(+), 31 deletions(-) diff --git a/frontend/app/index.html b/frontend/app/index.html index cb5366476..39c8d5abd 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -33,9 +33,11 @@

        Brought to you by your friends at MaxCDN

        + + diff --git a/frontend/app/scripts/app.js b/frontend/app/scripts/app.js index 495d64cf8..8c6b5d58b 100644 --- a/frontend/app/scripts/app.js +++ b/frontend/app/scripts/app.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('osscdnApp', ['ngAnimate', 'ngRoute']). +angular.module('osscdnApp', ['ngAnimate', 'ngRoute', '$strap.directives']). config(function($locationProvider, $routeProvider) { $locationProvider.html5Mode(true); diff --git a/frontend/app/scripts/controllers/main.js b/frontend/app/scripts/controllers/main.js index 246d2eb94..6c40ab4a4 100644 --- a/frontend/app/scripts/controllers/main.js +++ b/frontend/app/scripts/controllers/main.js @@ -1,14 +1,31 @@ 'use strict'; -angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http) { +angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http, $window) { $http.get('data/index.json').then(function(res) { - $scope.libraries = res.data; + // XXX: mock dropdown data + $scope.$alert = $window.alert.bind(null); + $scope.libraries = res.data.map(function(v) { + v.versions = [ + { + "text": "demo", + "click": "$alert('demo')" + }, + { + "text": "demo2", + "click": "$alert('demo')" + } + ]; + + return v; + }); }); $scope.getLibrary = function($index, library) { library.showExtra =! library.showExtra; - if(library.description || !library.showExtra) return; + if(library.description || !library.showExtra) { + return; + } $http.get('data/' + library.name + '.json').then(function(res) { var d = res.data; @@ -18,5 +35,5 @@ angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http) { library[k] = d[k]; } }); - } -}); \ No newline at end of file + }; +}); diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index ca84110d5..84d1f1da9 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -21,6 +21,7 @@ a:hover{ --------------------------*/ .search { + width: 90%; box-shadow: 0 1px 1px #ccc; border-radius: 2px; padding: 14px; @@ -81,7 +82,7 @@ ul li p { } .libraries { - width: 100%; + width: 90%; } .library { @@ -99,8 +100,14 @@ ul li p { border: 0.1em solid #e3e3e3; } -.library:hover { - background-color: #ddd; +.library .name { + float: left; +} + +.library .versionSelector { + float: left; + + margin-left: 1em; } .library.visible { @@ -114,11 +121,6 @@ ul li p { cursor: pointer; } -.library:hover > .displayHelp, -.versionContainer:hover .displayHelp { - display: block; -} - .label { margin-right: 0.5em; } diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index ad33d568b..6c5f5efb3 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -7,23 +7,9 @@
        diff --git a/frontend/bower.json b/frontend/bower.json index 1ea918245..1ecc726d3 100644 --- a/frontend/bower.json +++ b/frontend/bower.json @@ -7,7 +7,9 @@ "json3": "~3.2.6", "es5-shim": "~2.1.0", "angular-route": "1.2.5", - "bootstrap": "~3.0.3" + "bootstrap": "~3.0.3", + "angular-strap": "~0.7.8", + "jquery": "~2.0.3" }, "devDependencies": { "angular-mocks": "1.2.5", From 0feef8eb6a37ddf10c4880669dc20918e5548b57 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Mon, 23 Dec 2013 23:17:55 +0200 Subject: [PATCH 12/57] Sort search based on length if there is query It sorts alphabetically by default. Using `orderBy` with custom sorter allows us to avoid having to implement priority search of our own. --- frontend/app/index.html | 1 - frontend/app/scripts/controllers/main.js | 8 +++++ .../app/scripts/filters/prioritysearch.js | 32 ------------------- frontend/app/views/main.html | 2 +- frontend/test/spec/filters/prioritysearch.js | 19 ----------- 5 files changed, 9 insertions(+), 53 deletions(-) delete mode 100644 frontend/app/scripts/filters/prioritysearch.js delete mode 100644 frontend/test/spec/filters/prioritysearch.js diff --git a/frontend/app/index.html b/frontend/app/index.html index 39c8d5abd..16c86ecc0 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -42,7 +42,6 @@ - diff --git a/frontend/app/scripts/controllers/main.js b/frontend/app/scripts/controllers/main.js index 6c40ab4a4..7a7699088 100644 --- a/frontend/app/scripts/controllers/main.js +++ b/frontend/app/scripts/controllers/main.js @@ -20,6 +20,14 @@ angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http, $win }); }); + $scope.orderByName = function(library) { + if($scope.search && $scope.search.name) { + return library.name.length; + } + + return library.name; + }; + $scope.getLibrary = function($index, library) { library.showExtra =! library.showExtra; diff --git a/frontend/app/scripts/filters/prioritysearch.js b/frontend/app/scripts/filters/prioritysearch.js deleted file mode 100644 index e5bc8b57b..000000000 --- a/frontend/app/scripts/filters/prioritysearch.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -angular.module('osscdnApp').filter('prioritysearch', function() { - return function(input, queries) { - if(!queries) { - return input; - } - - var queryNames = Object.keys(queries); - var qLen = queryNames.length; - var scores = {}; - - return input.filter(function(inp) { - return queryNames.filter(function(k) { - var ret = inp[k].indexOf(queries[k]); - - if(ret === 0) { - scores[inp[k]] = inp[k].length - queries[k].length; - - return true; - } - }).length === qLen; - }); - - // XXX: this is problematic because it mutates the original somehow - // ie. empty -> entry -> empty doesn't yield the same result! - /*.sort(function(a, b) { - // TODO: figure out a proper scoring function for multiple properties - return scores[a[queryNames[0]]] >= scores[b[queryNames[0]]]; - });*/ - }; -}); diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 6c5f5efb3..76f3be71c 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -6,7 +6,7 @@
          -
        • +
        • {{library.name}}

          diff --git a/frontend/test/spec/filters/prioritysearch.js b/frontend/test/spec/filters/prioritysearch.js deleted file mode 100644 index 501fd37d2..000000000 --- a/frontend/test/spec/filters/prioritysearch.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -describe('Filter: prioritysearch', function () { - - // load the filter's module - beforeEach(module('osscdnApp')); - - // initialize a new instance of the filter before each test - var prioritysearch; - beforeEach(inject(function ($filter) { - prioritysearch = $filter('prioritysearch'); - })); - - it('should return the input prefixed with "prioritysearch filter:"', function () { - var text = 'angularjs'; - expect(prioritysearch(text)).toBe('prioritysearch filter: ' + text); - }); - -}); From 61aaa3864b9ed8b7f98d715d5f874843f0555762 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 12:40:16 +0200 Subject: [PATCH 13/57] Hook up alternative dropdown This works way better than angular-strap. And in addition it allows us to drop jQuery dependency again. Still need to connect this with real data and logic. --- frontend/app/index.html | 4 ++-- frontend/app/scripts/app.js | 2 +- frontend/app/scripts/controllers/main.js | 14 ++++++++------ frontend/app/styles/main.css | 13 ++++++++++--- frontend/app/views/main.html | 6 +++++- frontend/bower.json | 3 +-- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/frontend/app/index.html b/frontend/app/index.html index 16c86ecc0..e8ec10d93 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -11,6 +11,7 @@ + @@ -33,11 +34,10 @@

          Brought to you by your friends at MaxCDN

          - - + diff --git a/frontend/app/scripts/app.js b/frontend/app/scripts/app.js index 8c6b5d58b..3010d792e 100644 --- a/frontend/app/scripts/app.js +++ b/frontend/app/scripts/app.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('osscdnApp', ['ngAnimate', 'ngRoute', '$strap.directives']). +angular.module('osscdnApp', ['ngAnimate', 'ngRoute', 'ngDropdowns']). config(function($locationProvider, $routeProvider) { $locationProvider.html5Mode(true); diff --git a/frontend/app/scripts/controllers/main.js b/frontend/app/scripts/controllers/main.js index 7a7699088..b446d002c 100644 --- a/frontend/app/scripts/controllers/main.js +++ b/frontend/app/scripts/controllers/main.js @@ -1,20 +1,22 @@ 'use strict'; -angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http, $window) { +angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http) { $http.get('data/index.json').then(function(res) { // XXX: mock dropdown data - $scope.$alert = $window.alert.bind(null); $scope.libraries = res.data.map(function(v) { v.versions = [ { - "text": "demo", - "click": "$alert('demo')" + text: 'demo', + value: 'one' }, { - "text": "demo2", - "click": "$alert('demo')" + text: 'demo2', + value: 'two' } ]; + v.selectedVersion = { + text: 'select a version' + }; return v; }); diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index 84d1f1da9..d61d9ef1e 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -60,7 +60,6 @@ ul li { border-bottom: 1px solid #ddd; padding: 10px; margin: 0; - overflow: hidden; } ul li img { @@ -81,6 +80,15 @@ ul li p { margin-top: 1em; } +.dropdown { + z-index: 10; +} + +.dropdown:before, .dropdown:after { + right: inherit; + left: 2em; +} + .libraries { width: 90%; } @@ -101,11 +109,10 @@ ul li p { } .library .name { - float: left; + display: inline; } .library .versionSelector { - float: left; margin-left: 1em; } diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 76f3be71c..aa63e3c33 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -9,7 +9,11 @@
        • {{library.name}}

          - + + Versions +
        diff --git a/frontend/bower.json b/frontend/bower.json index 1ecc726d3..33eb890dd 100644 --- a/frontend/bower.json +++ b/frontend/bower.json @@ -8,8 +8,7 @@ "es5-shim": "~2.1.0", "angular-route": "1.2.5", "bootstrap": "~3.0.3", - "angular-strap": "~0.7.8", - "jquery": "~2.0.3" + "angular-dropdowns": "*" }, "devDependencies": { "angular-mocks": "1.2.5", From 6c0b7e780d5d528fdcf3c25c1766ac2c87cd2820 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 15:12:39 +0200 Subject: [PATCH 14/57] Load dropdown data dynamically This means it loads library specific data on search on demand and then populates client model accordingly. --- frontend/app/index.html | 2 +- frontend/app/scripts/controllers/main.js | 59 +++++++++++++++--------- frontend/app/views/main.html | 2 +- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/frontend/app/index.html b/frontend/app/index.html index e8ec10d93..08b6f34fd 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -34,7 +34,7 @@

        Brought to you by your friends at MaxCDN

        - + diff --git a/frontend/app/scripts/controllers/main.js b/frontend/app/scripts/controllers/main.js index b446d002c..bbbf22871 100644 --- a/frontend/app/scripts/controllers/main.js +++ b/frontend/app/scripts/controllers/main.js @@ -1,25 +1,11 @@ 'use strict'; angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http) { + $scope.search = {}; + $scope.libraries = []; + $http.get('data/index.json').then(function(res) { - // XXX: mock dropdown data - $scope.libraries = res.data.map(function(v) { - v.versions = [ - { - text: 'demo', - value: 'one' - }, - { - text: 'demo2', - value: 'two' - } - ]; - v.selectedVersion = { - text: 'select a version' - }; - - return v; - }); + $scope.libraries = res.data; }); $scope.orderByName = function(library) { @@ -30,10 +16,12 @@ angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http) { return library.name; }; - $scope.getLibrary = function($index, library) { - library.showExtra =! library.showExtra; + $scope.getLibraries = function() { + $scope.libraries.filtered.forEach(getLibrary); + } - if(library.description || !library.showExtra) { + function getLibrary(library) { + if(library.description) { return; } @@ -44,6 +32,35 @@ angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http) { for(k in d) { library[k] = d[k]; } + + library.versions = Object.keys(library.cdn).map(function(version) { + return { + text: version, + value: version + }; + }); + + library.selectedVersion = library.versions[0]; }); + } +}); + +angular.module('osscdnApp').filter('as', function($parse) { + return function(value, path) { + return $parse(path).assign(this, value); + }; +}); + +angular.module('osscdnApp').directive('repeatDone', function() { + return { + restrict: 'A', + scope: { + method: '&repeatDone' + }, + link: function($scope) { + if($scope.$parent.$last) { + $scope.method()(); + } + } }; }); diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index aa63e3c33..c0d671537 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -6,7 +6,7 @@ \ No newline at end of file From d74bc49910494752add614c20cc2741631ec6666 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 15:34:55 +0200 Subject: [PATCH 16/57] Fix maximum height of file listings --- frontend/app/styles/main.css | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index 17f1caad9..ebaa94a9b 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -112,24 +112,14 @@ ul li p { } .library .versionSelector { - margin-left: 1em; } -.library.visible { - background-color: #ccc; -} - -.displayHelp { - float: right; - color: #aaa; - display: none; - cursor: pointer; +.library .files { + overflow: auto; + max-height: 15em; } -.label { - margin-right: 0.5em; -} .loader { text-align: center; } From 9b4a651f74e2182d8bba0f84247c3627969be0f5 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 15:48:39 +0200 Subject: [PATCH 17/57] Make file listing look better --- frontend/app/styles/main.css | 21 ++++++++++++++------- frontend/app/views/main.html | 1 - 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index ebaa94a9b..0bc27654c 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -6,11 +6,6 @@ body { text-align: center; } -a, -a:visited { - color: #00AE3B; -} - a:hover{ text-decoration: none; } @@ -56,9 +51,9 @@ ul { } ul li { - border-bottom: 1px solid #ddd; + box-sizing: border-box; + padding: 0.5em; - margin: 0; } ul li img { @@ -120,6 +115,18 @@ ul li p { max-height: 15em; } +.library .file:nth-child(odd) { + background-color: #f9f9f9; +} + +.library .file:nth-of-type(1) { + border-top: 0.1em solid #ddd; +} + +.library .file { + border-bottom: 0.1em solid #ddd; +} + .loader { text-align: center; } diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index b013830c0..4dc5354ac 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -17,7 +17,6 @@

        {{library.name}}

        • -
          {{version}}
          From 70b356a113f65075365ee488f09b9fb594d866ee Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 16:01:46 +0200 Subject: [PATCH 18/57] Add stubs for /network and /about I replaced angular-route with angular-ui-router while at it. ui-router works better when developing with Grunt. I also updated the server a bit to take this change in count. --- frontend/app/index.html | 19 ++++++++++++++----- frontend/app/scripts/app.js | 19 +++++++++++++------ frontend/app/views/about.html | 1 + frontend/app/views/network.html | 1 + frontend/bower.json | 4 ++-- frontend/serve.js | 4 ++-- 6 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 frontend/app/views/about.html create mode 100644 frontend/app/views/network.html diff --git a/frontend/app/index.html b/frontend/app/index.html index 08b6f34fd..3c56c1495 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -26,18 +26,27 @@
          logo + +
          -
          +

          Brought to you by your friends at MaxCDN

          - - - - + + + + + + + diff --git a/frontend/app/scripts/app.js b/frontend/app/scripts/app.js index 3010d792e..97192c5d0 100644 --- a/frontend/app/scripts/app.js +++ b/frontend/app/scripts/app.js @@ -1,13 +1,20 @@ 'use strict'; -angular.module('osscdnApp', ['ngAnimate', 'ngRoute', 'ngDropdowns']). - config(function($locationProvider, $routeProvider) { +angular.module('osscdnApp', ['ngAnimate', 'ui.router', 'ngDropdowns']). + config(function($locationProvider, $stateProvider, $urlRouterProvider) { $locationProvider.html5Mode(true); - $routeProvider.when('/', { + $urlRouterProvider.otherwise('/'); + + $stateProvider.state('libraries', { + url: '/', templateUrl: 'views/main.html', controller: 'MainCtrl' - }).otherwise({ - redirectTo: '/' + }).state('network', { + url: '/network', + templateUrl: 'views/network.html' + }).state('about', { + url: '/about', + templateUrl: 'views/about.html' }); -}); \ No newline at end of file +}); diff --git a/frontend/app/views/about.html b/frontend/app/views/about.html new file mode 100644 index 000000000..f115f2279 --- /dev/null +++ b/frontend/app/views/about.html @@ -0,0 +1 @@ +TODO: about diff --git a/frontend/app/views/network.html b/frontend/app/views/network.html new file mode 100644 index 000000000..67e771126 --- /dev/null +++ b/frontend/app/views/network.html @@ -0,0 +1 @@ +TODO: network diff --git a/frontend/bower.json b/frontend/bower.json index 33eb890dd..960fea477 100644 --- a/frontend/bower.json +++ b/frontend/bower.json @@ -6,9 +6,9 @@ "angular-animate": "1.2.5", "json3": "~3.2.6", "es5-shim": "~2.1.0", - "angular-route": "1.2.5", "bootstrap": "~3.0.3", - "angular-dropdowns": "*" + "angular-dropdowns": "*", + "angular-ui-router": "~0.2.7" }, "devDependencies": { "angular-mocks": "1.2.5", diff --git a/frontend/serve.js b/frontend/serve.js index ed526825b..b26cf5d95 100755 --- a/frontend/serve.js +++ b/frontend/serve.js @@ -28,7 +28,7 @@ function main() { app.use(express.errorHandler()); }); - app.get('/', function(req, res) { + app.use(function(req, res) { res.sendfile(__dirname + '/dist/index.html'); }); @@ -36,7 +36,7 @@ function main() { ['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGPIPE', 'SIGTERM' - ].forEach(function(element, index, array) { + ].forEach(function(element) { process.on(element, function() { terminator(element); }); }); From 3ea54f59436976585d60a1c65d26a82a88d804d6 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 16:51:34 +0200 Subject: [PATCH 19/57] Make it possible to link to individual libraries This uses /#/jquery kind of routing. The query after hash will be passed to search. Simple as that for now. --- frontend/app/scripts/app.js | 14 ++++++-------- frontend/app/scripts/controllers/main.js | 6 ++++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/app/scripts/app.js b/frontend/app/scripts/app.js index 97192c5d0..5d2b95777 100644 --- a/frontend/app/scripts/app.js +++ b/frontend/app/scripts/app.js @@ -1,20 +1,18 @@ 'use strict'; angular.module('osscdnApp', ['ngAnimate', 'ui.router', 'ngDropdowns']). - config(function($locationProvider, $stateProvider, $urlRouterProvider) { - $locationProvider.html5Mode(true); - + config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/'); - $stateProvider.state('libraries', { - url: '/', - templateUrl: 'views/main.html', - controller: 'MainCtrl' - }).state('network', { + $stateProvider.state('network', { url: '/network', templateUrl: 'views/network.html' }).state('about', { url: '/about', templateUrl: 'views/about.html' + }).state('libraries', { + url: '/:name', + templateUrl: 'views/main.html', + controller: 'MainCtrl' }); }); diff --git a/frontend/app/scripts/controllers/main.js b/frontend/app/scripts/controllers/main.js index f30ddd2c8..a29fcac77 100644 --- a/frontend/app/scripts/controllers/main.js +++ b/frontend/app/scripts/controllers/main.js @@ -1,7 +1,9 @@ 'use strict'; -angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http) { - $scope.search = {}; +angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http, $state) { + $scope.search = { + name: $state.params.name + }; $scope.libraries = []; $http.get('data/index.json').then(function(res) { From 5ccbbb3a34967c446e31e2e707f2ae42261799ab Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 18:13:09 +0200 Subject: [PATCH 20/57] Remove hits from output Not used yet. --- walker/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/walker/index.js b/walker/index.js index 64d00d540..d1b51c1f7 100755 --- a/walker/index.js +++ b/walker/index.js @@ -114,7 +114,7 @@ function walk(root, cb) { }).on('error', cb).on('done', cb.bind(null, null, ret)).walk(); }, function(ret, cb) { - ret.hits = 0; // TODO: fetch this through API + //ret.hits = 0; // TODO: fetch this through API cb(null, ret); } From eab1f335dc0d31a49db252bb2d06ec857c7450d7 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 18:29:54 +0200 Subject: [PATCH 21/57] Allow results to be excluded from walker results Simply add `exclude: ["lib", "another lib"]` to your configuration to exclude. --- generate_data.sh | 2 +- walker/index.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/generate_data.sh b/generate_data.sh index fc0db16e9..72487cb3a 100755 --- a/generate_data.sh +++ b/generate_data.sh @@ -1,4 +1,4 @@ #!/bin/bash cd walker -./index.js -i ../files/ -o ../frontend/app/data/ +./index.js -i ../files/ -o ../frontend/app/data/ -c config.js cd .. diff --git a/walker/index.js b/walker/index.js index d1b51c1f7..1df2fc4ba 100755 --- a/walker/index.js +++ b/walker/index.js @@ -25,7 +25,7 @@ function main() { if(!program.input) return console.error('Missing input!'); if(!program.output) return console.error('Missing output!'); - var config = {github: ''}; + var config = {github: '', exclude: []}; try { config = require('./' + program.config); @@ -41,7 +41,7 @@ function main() { }; } - walk(program.input, utils.catchError(write.bind(null, program.output))); + walk(program.input, utils.catchError(write.bind(null, program.output, config.exclude))); } function walk(root, cb) { @@ -127,7 +127,11 @@ function walk(root, cb) { }); } -function write(output, d) { +function write(output, exclude, d) { + d = d.filter(function(v) { + return exclude.indexOf(v.name) === -1; + }); + var indexData = d.map(function(v) { return { name: v.name, From 6a6c86808598937c54aaa2eaddc1c5ce072b668b Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 18:35:11 +0200 Subject: [PATCH 22/57] Attach author name to walker output --- walker/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/walker/index.js b/walker/index.js index 1df2fc4ba..13c28feaf 100755 --- a/walker/index.js +++ b/walker/index.js @@ -65,9 +65,16 @@ function walk(root, cb) { return cb(); } + var author = d.author && d.author.name; + + if(!author && d.maintainers) { + author = d.maintainers[0].name; + } + async.waterfall([ function(cb) { var ret = { + author: author, name: d.name, version: d.version, description: d.description, From eeeddae28f77154146d71d0c8d56b5653deed425 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 18:36:55 +0200 Subject: [PATCH 23/57] Show author names --- frontend/app/styles/main.css | 4 ++++ frontend/app/views/main.html | 1 + 2 files changed, 5 insertions(+) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index 0bc27654c..c1a226f64 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -106,6 +106,10 @@ ul li p { display: inline; } +.library .author { + float: right; +} + .library .versionSelector { margin-left: 1em; } diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 4dc5354ac..c471101a5 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -8,6 +8,7 @@
          • {{library.name}}

            +
            {{library.author}}
            Date: Tue, 24 Dec 2013 18:38:20 +0200 Subject: [PATCH 24/57] Link to library specific view when name is clicked --- frontend/app/views/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index c471101a5..0d9718806 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -7,7 +7,7 @@
            • -

              {{library.name}}

              +

              {{library.name}}

              {{library.author}}
              +
              {{library.description}}
                • From 46cc752aa9792b329da2f6ec336f12c5d2de8126 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 18:53:19 +0200 Subject: [PATCH 27/57] Remove .git from github urls --- walker/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/walker/index.js b/walker/index.js index 13c28feaf..39140b5d9 100755 --- a/walker/index.js +++ b/walker/index.js @@ -94,7 +94,7 @@ function walk(root, cb) { return cb(null, ret); } - ret.github = repoUrl; + ret.github = repoUrl.split('.git')[0]; ret.stars = stars; cb(null, ret); From 4f5721cd7bd7f53c4683062a9c33e4276955fc90 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 19:02:26 +0200 Subject: [PATCH 28/57] Attach GitHub and homepage links --- frontend/app/images/github.png | Bin 0 -> 1482 bytes frontend/app/images/web.png | Bin 0 -> 682 bytes frontend/app/styles/main.css | 33 +++++++++++++++------------------ frontend/app/views/main.html | 6 +++++- 4 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 frontend/app/images/github.png create mode 100644 frontend/app/images/web.png diff --git a/frontend/app/images/github.png b/frontend/app/images/github.png new file mode 100644 index 0000000000000000000000000000000000000000..e0f4651bab7f32290369b17c60de609ab2740bd0 GIT binary patch literal 1482 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+n3Xa^B1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%s|1+P|wiV z#N6CmN5ROz&_Lh7NZ-&%*U;R`*vQJjKmiJrfVLH-q*(>IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8EkR}&8R-I5=oVMzl_XZ^<`pZ$OmImpPAEg{v+u2}(t{7puX=A(aKG z`a!A1`K3k4z=%sz23b{L-^Aq1JP;qO z-q+X4Gq1QLF)umQ)5TT^Xo6m5W{Q=Yk&Bb5p^K@piLsNRp{t>Vv#Fz_s{t^$oXy-U z4Gmy=UGkGlb5rw5V0u#!dd+a^1to>t0-((r(S)aWAs50ixkl?Az~z%6LW`l7`@kxO$rBqlP5&6uIA3dnwSnvdJ{9o?jZ@CNb5PxIy5{$@ z&wUe9+3(GqJK1mh@3(K)vpr<1#It^8o| zWwF~1p##grCon8w_~Ctf?T4TW?p8*&n8({R=gwu`@K=;WVe1Fko$jso_;!3}JvKAi zzO|Um+sYxNvW&xpGu`L}%Zn8Yi^Vy_Bs~-lweJ7NxFIYxWZHpc*6W-fWbfu=DfutE z@xqTOzZ(*_9{U^`tDA0gGy245?!Fb=vl;ImOA4Aak26eEs=H}gUhYN@O|x%nTN(v- z&1NZ0(tNYIHCx$AAXp~0jP1n=9cxi##nrcM8}GL~esNi~L(|yzWqEa=kw7AM@N+HjW)pAA4qPIOFAiWoFmB`igy9 zmn1FdXo^;nl+t>XykZMq-=V*ZUIzYkSx$TfRc0aFwJQsf4|%1RTFUU5UjNS#fAVwK z{nq7&;;XD9!}A{eHS6a3%vSnE-S|LNZ11d_3%JjJm>0Rc;O_*@WdDHwzZ(jBYtHMw z*77<#(=^m}O`~YogYR;s$tKGDA=b_Or*c+_WvG|Ve9cYi_RyL;XD7SFj=?I-3Qk>UB_!LxJ5l?s<~ xKcAaFdGo)#w~ReAHpJRb@Sgu@-ab|dhTA*;&70sBc?49tdb;|#taD0e0sxmWFMa?3 literal 0 HcmV?d00001 diff --git a/frontend/app/images/web.png b/frontend/app/images/web.png new file mode 100644 index 0000000000000000000000000000000000000000..ee238aabfdaec873b310425bf779aa8ec00334a4 GIT binary patch literal 682 zcmV;b0#*HqP)`1LNs*nuqvA0Rh7BR57+R-5{bH>;p|``hzuqx z5^&4SEZh^#A3Opyi3^Q&-DyC8&88pei#3VGARuJHJ7S$Ydk!qjUQuTgx_2p2TyMnm ztxJO{LP*vcDh2+kMoGox&8WdcYBISTQ!0C{`6epoWq~Z(AQ|} ziy1l^PZ;o8Ne%5YiHs-HG!+t~O}y*@FTj&i3(}QSoOuU65VKc(TVe=Y05{l=$j3)l zx?pq0=Q*I6bcnM+CO)WiFO+AtVzw5;+0$jLeoY)PiQ{^K5g9h?Y;4ZiO0qvBKwk~Y zB`+-I5!-%d6M&oh&V^i!aUboJ^h>ie_}JTKYG@f+XX!>y%#t6NTxH)(_e*!e_LMM5 zibrKd$ZfXR6S{9kUg5tWXWHguAkPbEIr3O?tm5MxFaP$t75&!_
                • {{library.name}}

                  -
                  {{library.author}}
                  {{library.name}} Versions
                  +
                  + {{library.author}} + github + homepage +
                  {{library.description}}
                  • From d41fac2406315d07799b5479516e5f56031b5f2f Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 19:11:19 +0200 Subject: [PATCH 29/57] Make the dropdown more compact --- frontend/app/styles/main.css | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index 331f4425f..f450a407f 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -50,16 +50,14 @@ ul { text-align: left; } -ul li { - box-sizing: border-box; - - padding: 0.5em; -} - .extra { margin-top: 1em; } +.wrap-dd-select { + padding: 0.25em; +} + .dropdown { z-index: 10; } @@ -73,14 +71,13 @@ ul li { width: 90%; } -.library { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; +.library, .file { + box-sizing: border-box; + + padding: 0.5em; +} +.library { margin-bottom: 1em; background-color: white; From 534b44837967ae6dfc9d9c0ac40609624f1e4f28 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 19:14:57 +0200 Subject: [PATCH 30/57] Do not fail in case exclude is not provided --- walker/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/walker/index.js b/walker/index.js index 39140b5d9..8ba16a04c 100755 --- a/walker/index.js +++ b/walker/index.js @@ -135,6 +135,8 @@ function walk(root, cb) { } function write(output, exclude, d) { + exclude = exclude || []; + d = d.filter(function(v) { return exclude.indexOf(v.name) === -1; }); From 53981dc7cab3dbbb72e46a6354a3c8c49594e41f Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 19:32:57 +0200 Subject: [PATCH 31/57] Do not rev images Not ideal but looks like usemin doesn't work with views without some tweaks. Ok for now. --- frontend/Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/Gruntfile.js b/frontend/Gruntfile.js index 6922fc8b9..f2fa78e76 100644 --- a/frontend/Gruntfile.js +++ b/frontend/Gruntfile.js @@ -120,7 +120,7 @@ module.exports = function (grunt) { src: [ '<%= yeoman.dist %>/scripts/{,*/}*.js', '<%= yeoman.dist %>/styles/{,*/}*.css', - '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', + //'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', '<%= yeoman.dist %>/styles/fonts/*' ] } From 3b51b2be18cf885c953d3736e250ed703f370be9 Mon Sep 17 00:00:00 2001 From: Dmitriy Akulov Date: Tue, 24 Dec 2013 19:51:19 +0200 Subject: [PATCH 32/57] Update index.html --- frontend/app/index.html | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/frontend/app/index.html b/frontend/app/index.html index 3c56c1495..8bfbcd034 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -23,16 +23,17 @@ - -
                    - logo - - -
                    +
                    +
                    +

                    logo

                    + +
                    @@ -52,5 +53,6 @@ +
                    From 5a88dcddd4f36de5e45610860c3cca26529afa18 Mon Sep 17 00:00:00 2001 From: Dmitriy Akulov Date: Tue, 24 Dec 2013 19:51:53 +0200 Subject: [PATCH 33/57] Update main.html --- frontend/app/views/main.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 904e26216..07f3e0d53 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -1,6 +1,6 @@ - + + +
                    Loading
                    @@ -30,4 +30,4 @@

                    {{library.name}}

                -
            \ No newline at end of file +
            From 598b6e8bba6c9f9409cc4e2a2b3b323672431035 Mon Sep 17 00:00:00 2001 From: Dmitriy Akulov Date: Tue, 24 Dec 2013 19:54:43 +0200 Subject: [PATCH 34/57] Update main.html --- frontend/app/views/main.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 07f3e0d53..0be89e7f0 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -1,5 +1,4 @@ - - +
            Loading
            From 7afebeca1d1bf289ed161a7ab533d2c86d2ddad1 Mon Sep 17 00:00:00 2001 From: Dmitriy Akulov Date: Tue, 24 Dec 2013 19:56:00 +0200 Subject: [PATCH 35/57] Update main.css --- frontend/app/styles/main.css | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index f450a407f..5608f43d5 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -14,34 +14,13 @@ a:hover{ /*------------------------- The search input --------------------------*/ - -.search { +#s { width: 90%; - box-shadow: 0 1px 1px #ccc; - border-radius: 2px; - padding: 14px; - margin: 45px auto 20px; - position: relative; + margin: 0 auto; + padding: 20px; + margin-bottom: 15px; } -.search input { - background: #fff no-repeat 13px 13px; - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAWlBMVEWHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKCHmKBNnrrDAAAAHnRSTlMAAgUaJCYpKy4wMmBiam5xc3Z6f4SJrba5vsXHyswZmlxOAAAAe0lEQVR4AV3M2w6CQAxF0c1lQHC4CTgIPf//m2bSF2U9NTvNAaj3pLTXOMp4Kbti4WGRTU3RTKaFrJP1ZL2pA9g04AZtAEkVrlICuFTiStn94/CNiIu+0el8kLWn/HjJxkAYTVp9azA5L0DYD723dvXyI5f5Xj78mc/nFz8cCbx5SV/CAAAAAElFTkSuQmCC); - - border: none; - width: 100%; - line-height: 19px; - padding: 11px 0; - - border-radius: 2px; - box-shadow: 0 2px 8px #c4c4c4 inset; - text-align: left; - font-size: 14px; - font-family: inherit; - font-weight: bold; - color: #738289; - text-indent: 40px; -} ul { list-style-type: none; From 196c7d454ab85bc1b872af1c2181838c52a0d5e1 Mon Sep 17 00:00:00 2001 From: Dmitriy Akulov Date: Tue, 24 Dec 2013 20:03:54 +0200 Subject: [PATCH 36/57] Update main.css --- frontend/app/styles/main.css | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index 5608f43d5..4bac38f25 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -146,3 +146,35 @@ ul { footer { padding-top: 20px; } + +#logo { + width: 400px; + margin-left: 50px; + margin-bottom: 20px; + float:left; +} + +nav { + position: relative; + top: 0.3em; + float: right; +} +nav ul { + list-style-type: none; + margin: 0; + margin-right: 40px; +} +nav ul li { + display: inline; + background: #e3e3e3; + cursor: pointer; + border-radius: .3em; + padding: 1em; + padding-top: .5em; + padding-bottom: .5em; + margin-right: 10px; +} +nav ul li:hover { background: #005494 } +nav ul li:hover a { color: white } +nav ul li a { color: #575757 } +nav ul li a:hover { text-decoration: none } From 7454773340d88e5eb891bec062922358e4e85674 Mon Sep 17 00:00:00 2001 From: Dmitriy Akulov Date: Tue, 24 Dec 2013 20:03:56 +0200 Subject: [PATCH 37/57] Update index.html --- frontend/app/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/index.html b/frontend/app/index.html index 8bfbcd034..f3bef6b66 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -25,7 +25,7 @@
            -

            logo

            +
            From d7ebda8ce79386b959c68977091429e51c643a86 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 21:03:04 +0200 Subject: [PATCH 47/57] Clarify markup --- frontend/app/views/main.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 896845c77..ea726a6a9 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -20,12 +20,12 @@

            {{library.name}}

            homepage
            {{library.description}}
            -
              -
            • - -
            • +
              Show less
              From 9fe7dc6beda14ad22fc22ecf78fe8d3ef91db337 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 21:08:33 +0200 Subject: [PATCH 48/57] Make show more/less cursor a hand --- frontend/app/styles/main.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index be332460c..267f12f16 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -120,6 +120,8 @@ ul { .library .show { text-align: center; + + cursor: pointer; } .loader { From d13d4c4233f691bbc74520cff3312cdb1f4640d8 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 21:12:48 +0200 Subject: [PATCH 49/57] Add exclude example --- walker/template.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/walker/template.config.js b/walker/template.config.js index 08155515c..1d865ea31 100644 --- a/walker/template.config.js +++ b/walker/template.config.js @@ -1,3 +1,4 @@ module.exports = { - github: 'replacethis' // generate through GitHub settings -> Applications + github: 'replacethis', // generate through GitHub settings -> Applications + exclude: ['foo', 'bar'] // libraries to exclude (by project name) }; From 06865feb56f26889e6e3273e4d6dbd59c1b2ce2a Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 21:20:35 +0200 Subject: [PATCH 50/57] Fix navigation buttons --- frontend/app/index.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/app/index.html b/frontend/app/index.html index 9d1c8c092..e2f2659c2 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -26,13 +26,11 @@
              - +
              From 2447e0016f18575202a5c3c8c278df6ca6773adb Mon Sep 17 00:00:00 2001 From: Dmitriy Akulov Date: Tue, 24 Dec 2013 21:26:42 +0200 Subject: [PATCH 51/57] Update index.html --- frontend/app/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/index.html b/frontend/app/index.html index e2f2659c2..779495ed4 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -26,7 +26,7 @@
              -
              + -
              +
              -
              -

              Brought to you by your friends at MaxCDN

              -
              +
              +

              Brought to you by your friends at MaxCDN

              +
              +
              @@ -51,6 +52,5 @@ -
              From 461af6f30c96361e4a4c40b5f6f3bd216a90ae55 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 21:43:57 +0200 Subject: [PATCH 54/57] Use ng-if for selectedVersion instead of ng-show This should avoid plenty of work (generate DOM on demand). --- frontend/app/views/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index ea726a6a9..251a44ee6 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -21,7 +21,7 @@

              {{library.name}}

              {{library.description}}
                -
              • +
              • From c09f165e92be27348d11a3ee5fbd697006d9aa19 Mon Sep 17 00:00:00 2001 From: Dmitriy Akulov Date: Tue, 24 Dec 2013 21:45:49 +0200 Subject: [PATCH 55/57] Update index.html --- frontend/app/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/app/index.html b/frontend/app/index.html index 219fa5734..db7c94247 100644 --- a/frontend/app/index.html +++ b/frontend/app/index.html @@ -37,6 +37,7 @@
        From 0b959e7e1338ef9d1c3306adfe8a21c39ab5acd4 Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 21:50:04 +0200 Subject: [PATCH 56/57] Show "show more"/"show less" only if there are enough items --- frontend/app/scripts/controllers/main.js | 11 +++++++++++ frontend/app/views/main.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/app/scripts/controllers/main.js b/frontend/app/scripts/controllers/main.js index 6c1a37136..c19fabe96 100644 --- a/frontend/app/scripts/controllers/main.js +++ b/frontend/app/scripts/controllers/main.js @@ -31,6 +31,17 @@ angular.module('osscdnApp').controller('MainCtrl', function ($scope, $http, $sta } }; + $scope.hasEnoughItems = function(library) { + if(!library.selectedVersion) { + return; + } + + // it would be better to calculate visibility status via CSS + var version = library.selectedVersion.value; + + return library.cdn[version].length > 6; + }; + function getLibrary(library) { if(library.description) { return; diff --git a/frontend/app/views/main.html b/frontend/app/views/main.html index 251a44ee6..0e0de509f 100644 --- a/frontend/app/views/main.html +++ b/frontend/app/views/main.html @@ -27,7 +27,7 @@

        {{library.name}}

    -
    +
    Show less
    Show more
    From 098c2de0dcdfdfece7f2243420dc4b5a3bd8614c Mon Sep 17 00:00:00 2001 From: Juho Vepsalainen Date: Tue, 24 Dec 2013 21:54:13 +0200 Subject: [PATCH 57/57] Fix dropdown max-height to 20em Way nicer to use this way. --- frontend/app/styles/main.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/app/styles/main.css b/frontend/app/styles/main.css index 267f12f16..36596fb60 100644 --- a/frontend/app/styles/main.css +++ b/frontend/app/styles/main.css @@ -40,6 +40,9 @@ ul { .dropdown { z-index: 10; + + overflow: auto; + max-height: 20em; } .dropdown:before, .dropdown:after {