diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6479ed09..d0058df3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,46 @@ # Contributing to JSPerf -## Submitting a Pull Request +Submit a pull request to `master` with passing tests (`npm test`) and properly [styled](https://github.com/Flet/semistandard) code. [Rebase](https://git-scm.com/docs/git-rebase) as needed. -* Make all changes in a *new* branch of `master`, e.g., `feature/new-logo` -* Follow all coding rules below -* Ensure all tests are passing (`npm test`) -* In GitHub send a pull request to "jsperf:master" -* If we suggest changes, always re-run tests after completing those changes -* Rebase feature branches as needed (do not merge) +## Building the client -## Coding Rules +If you make any changes inside [`client/`](https://github.com/jsperf/jsperf.com/tree/master/client), then you'll need to manually re-build the final asset. -These guidelines help keep the codebase consistent. -* All features or bugs must be tested -* Code coverage shall remain at 100% after any new feature or bug fix -* Code should pass ESLint which follows the [semistandard style](https://github.com/Flet/semistandard) +``` +npm run build +``` + +## Testing + +We use [lab](https://github.com/hapijs/lab) as our test utility and [code](https://github.com/hapijs/code) as our assertion library. Lab lints with [eslint](http://eslint.org/) using the [semistandard style](https://github.com/Flet/semistandard). 100% code coverage by unit tests is required. To run the test suite: + +``` +npm test +``` + +_If you want to only lint and save a little time, use `npm run lint` which skips the tests._ + +_If you are missing code coverage, open `coverage.html` in the root of the project for a detailed visual report._ + +## Adding new dependencies + +1. Install using `npm` and either `--save` or `--save-dev`. **Do not edit `package.json` manually.** +2. Run `npm shrinkwrap --dev` to update `npm-shrinkwrap.json` + +If you get an error while shrinkwrapping, try pruning your `node_modules` directory by running `npm prune`. If that doesn't work, try removing what you have installed currently, reinstalling based on `package.json` instead of `npm-shrinkwrap.json`, and then shrinkwrap again. + +``` +rm -r node_modules/ && npm install --no-shrinkwrap && npm shrinkwrap --dev +``` + +### Greenkeeper + +Greenkeeper [is working on updating `npm-shrinkwrap.json`](https://github.com/greenkeeperio/greenkeeper/issues/96). In the meantime, here is how [**@maxbeatty**](https://github.com/maxbeatty) has been shrinkwrapping the updates: + +1. Get remote branch `git pull origin` +2. Checkout branch locally `git co greenkeeper--0.0.0` +3. Install updated dependency defined in `package.json` instead of `npm-shrinkwrap.json` `npm i --no-shrinkwrap` +4. Remove anything you no longer need `npm prune` +5. Shrinkwrap the updated dependency `npm shrinkwrap --dev` +6. Commit `git commit -am 'shrinkwrap updated dependency'` +7. Push so updated dependency is tested and Pull Request can be merged `git push origin greenkeeper--0.0.0` diff --git a/README.md b/README.md index 7e2c81d7..296ceb2d 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,6 @@ COOKIE_PASS=password-should-be-32-characters # LOGGLY_SUBDOMAIN= ``` -Lastly, create the necessary tables: - -``` -node setup/tables.js -``` - ### Start - [x] correct version of `node` @@ -63,47 +57,6 @@ node setup/tables.js npm start ``` -## Contributing - -### Building the client - -If you make any changes inside [`client/`](https://github.com/jsperf/jsperf.com/tree/master/client), then you'll need to manually re-build the final asset. - -``` -npm run build -``` - -### Testing - -We use [lab](https://github.com/hapijs/lab) as our test utility and [code](https://github.com/hapijs/code) as our assertion library. Lab lints with [eslint](http://eslint.org/) using the [semistandard style](https://github.com/Flet/semistandard). 100% code coverage by unit tests is required. To run the test suite: - -``` -npm test -``` - -_If you want to only lint and save a little time, use `npm run lint` which skips the tests._ - -_If you are missing code coverage, open `coverage.html` in the root of the project for a detailed visual report._ - -### Adding new dependencies - -1. Install using `npm` and either `--save` or `--save-dev`. **Do not edit `package.json` manually.** -2. Run `npm shrinkwrap --dev` to update `npm-shrinkwrap.json` - -If you get an error while shrinkwrapping, try pruning your `node_modules` directory by running `npm prune`. If that doesn't work, try removing what you have installed currently, reinstalling based on `package.json` instead of `npm-shrinkwrap.json`, and then shrinkwrap again. - -``` -rm -r node_modules/ && npm install --no-shrinkwrap && npm shrinkwrap --dev -``` - -#### Greenkeeper - -Greenkeeper [is working on updating `npm-shrinkwrap.json`](https://github.com/greenkeeperio/greenkeeper/issues/96). In the meantime, here is how **@maxbeatty** has been shrinkwrapping the updates: +## Sponsorship -1. Get remote branch `git pull origin` -2. Checkout branch locally `git co greenkeeper--0.0.0` -3. Install updated dependency defined in `package.json` instead of `npm-shrinkwrap.json` `npm i --no-shrinkwrap` -4. Remove anything you no longer need `npm prune` -5. Shrinkwrap the updated dependency `npm shrinkwrap --dev` -6. Commit `git commit -am 'shrinkwrap updated dependency'` -7. Push so updated dependency is tested and Pull Request can be merged `git push origin greenkeeper--0.0.0` +Development of [jsperf.com](https://jsperf.com) is generously supported by contributions from individuals and corporations. If you are benefiting from jsPerf and would like to help keep the project financially sustainable, please visit [https://jsperf.com/sponsor](https://jsperf.com/sponsor). diff --git a/SPONSORS.md b/SPONSORS.md new file mode 100644 index 00000000..ed43b13b --- /dev/null +++ b/SPONSORS.md @@ -0,0 +1,11 @@ +# Sponsors + +[Learn how to become a sponsor.](https://jsperf.com/sponsor) + +## Leaders + +- + +## Supporters + +- diff --git a/gulpfile.js b/gulpfile.js index 09a9b07a..92a8bc0e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,6 +10,8 @@ const insert = require('gulp-insert'); const remoteSrc = require('gulp-remote-src'); const replace = require('gulp-replace'); // const uglify = require('gulp-uglify'); +const cleanCSS = require('gulp-clean-css'); +const rename = require('gulp-rename'); const BENCHMARKJS_VERSION = require('./package.json').devDependencies.benchmark; @@ -84,4 +86,13 @@ gulp.task('js', function () { .pipe(gulp.dest('./public/_js/')); }); -gulp.task('default', ['js']); +gulp.task('css', function () { + return gulp.src('public/_css/main.src.css') + .pipe(cleanCSS({ + rebase: false + })) + .pipe(rename('main.css')) + .pipe(gulp.dest('public/_css/')); +}); + +gulp.task('default', ['js', 'css']); diff --git a/manifest.js b/manifest.js index f4a67c42..2d41d978 100644 --- a/manifest.js +++ b/manifest.js @@ -165,7 +165,9 @@ var manifest = { { plugin: './server/web/redirects' }, { plugin: './server/web/search' }, { plugin: './server/web/sitemap/xml' }, + { plugin: './server/web/sponsor' }, { plugin: './server/web/test' }, + { plugin: './server/web/testimonials' }, { plugin: './server/web/edit' }, { plugin: './server/web/delete' } ] diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 01e768d7..f94a12a4 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -359,6 +359,12 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "dev": true }, + "buffer-shims": { + "version": "1.0.0", + "from": "buffer-shims@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "dev": true + }, "builtin-modules": { "version": "1.1.1", "from": "builtin-modules@>=1.0.0 <2.0.0", @@ -434,6 +440,20 @@ "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", "dev": true }, + "clean-css": { + "version": "3.4.23", + "from": "clean-css@>=3.4.23 <4.0.0", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.23.tgz", + "dev": true, + "dependencies": { + "commander": { + "version": "2.8.1", + "from": "commander@>=2.8.0 <2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "dev": true + } + } + }, "cli-cursor": { "version": "1.0.2", "from": "cli-cursor@>=1.0.1 <2.0.0", @@ -1481,6 +1501,26 @@ } } }, + "gulp-clean-css": { + "version": "2.3.2", + "from": "gulp-clean-css@latest", + "resolved": "https://registry.npmjs.org/gulp-clean-css/-/gulp-clean-css-2.3.2.tgz", + "dev": true, + "dependencies": { + "readable-stream": { + "version": "2.2.2", + "from": "readable-stream@>=2.1.5 <3.0.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz", + "dev": true + }, + "through2": { + "version": "2.0.3", + "from": "through2@>=2.0.3 <3.0.0", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "dev": true + } + } + }, "gulp-concat": { "version": "2.6.1", "from": "gulp-concat@2.6.1", @@ -1695,6 +1735,12 @@ } } }, + "gulp-rename": { + "version": "1.2.2", + "from": "gulp-rename@latest", + "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.2.tgz", + "dev": true + }, "gulp-replace": { "version": "0.5.4", "from": "gulp-replace@0.5.4", diff --git a/package.json b/package.json index f996b0ea..72d36e66 100644 --- a/package.json +++ b/package.json @@ -67,9 +67,11 @@ "eslint-plugin-standard": "2.0.1", "gulp": "3.9.1", "gulp-add-src": "0.2.0", + "gulp-clean-css": "^2.3.2", "gulp-concat": "^2.6.1", "gulp-insert": "0.5.0", "gulp-remote-src": "0.4.1", + "gulp-rename": "^1.2.2", "gulp-replace": "0.5.4", "gulp-uglify": "2.0.0", "lab": "^11.2.0", diff --git a/public/_css/main.css b/public/_css/main.css index 0b07def1..709211fb 100644 --- a/public/_css/main.css +++ b/public/_css/main.css @@ -1 +1 @@ -pre,table{width:100%}pre,tbody th div{word-wrap:break-word;overflow:auto}#bs-chart,pre,tbody th div{overflow:auto}#faq,#faq dd,#faq dt,body,fieldset,h1,h2,h3,html{margin:0;padding:0;border:0}#error-info,#faq,.bs-rt,form div,h1,h2,h3,p,table,ul{margin-bottom:1em}.bs-rt,a,button,input,textarea{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}button,html,input,textarea{font:1em/1.5 sans-serif}h1 em,label em{font-style:normal}#add-buttons button,#bs-results .rt-ua-cur,#comments .meta a,#faq dt,caption,h1,h2,h3,h4,td.error,thead th{font-weight:700}html{background:#c4c4c4;height:100%}body{background:#fff;border:solid #aaa;border-width:0 1px;width:60em;padding:0 2.5em;margin:0 auto;min-height:100%}a{color:#357ab0;padding:.2em}a:focus,a:hover{text-decoration:none}blockquote{margin:0 0 1em;border-left:5px solid #b4b4b4;padding-left:.5em}table{border-collapse:collapse}#comments .meta a:focus,#comments .meta a:hover,#comments .owner .meta,.submit:focus,.submit:hover,a:focus,a:hover,button:focus,button:hover,form h3,li.current a:focus,li.current a:hover,thead th{background:#1a6ab9;background-image:-moz-linear-gradient(top,#6ca5dd,#1a6ab9);background-image:-o-linear-gradient(top,#6ca5dd,#1a6ab9);background-image:-webkit-gradient(linear,left top,left bottom,from(#6ca5dd),to(#1a6ab9));background-image:-webkit-linear-gradient(#6ca5dd,#1a6ab9);background-image:linear-gradient(top,#6ca5dd,#1a6ab9);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#6ca5dd', EndColorStr='#1a6ab9');color:#fff}#comments .meta,caption{background:#bcbcbc;background-image:-moz-linear-gradient(top,#d0d0d0,#a7a7a7);background-image:-o-linear-gradient(top,#d0d0d0,#a7a7a7);background-image:-webkit-gradient(linear,left top,left bottom,from(#d0d0d0),to(#a7a7a7));background-image:-webkit-linear-gradient(#d0d0d0,#a7a7a7);background-image:linear-gradient(top,#d0d0d0,#a7a7a7);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#d0d0d0', EndColorStr='#a7a7a7');color:#555}.js tbody th:focus,.js tbody th:hover{text-decoration:underline;cursor:pointer}tbody th,td{border:solid #b4b4b4;border-width:0 1px 1px 0}tbody th{background:#dde4ea;min-width:100px}tbody th div{max-width:200px}td.results{text-align:center;border-right:0}.results span,small{display:block;font-size:.8em}caption,td,th{padding:.2em .5em}td.fastest{background:#9cee82}tr:last-child td,tr:last-child th{border-bottom:0}.login,.submit,button{padding:.35em .5em;color:#000;border:1px solid #999;filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#ebebeb', EndColorStr='#b8b8b8');cursor:pointer}.invalid,:focus:invalid,td.error,td.slowest{background:pink}td.error{text-transform:uppercase}.submit,button{background:#dadada;background-image:-moz-linear-gradient(top,#ebebeb,#b8b8b8);background-image:-o-linear-gradient(top,#ebebeb,#b8b8b8);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#b8b8b8));background-image:-webkit-linear-gradient(top,#ebebeb,#b8b8b8);background-image:linear-gradient(top,#ebebeb,#b8b8b8)}.login{text-decoration:none;background:#dadada;background-image:-moz-linear-gradient(top,#ebebeb,#b8b8b8);background-image:-o-linear-gradient(top,#ebebeb,#b8b8b8);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#b8b8b8));background-image:-webkit-linear-gradient(top,#ebebeb,#b8b8b8);background-image:linear-gradient(top,#ebebeb,#b8b8b8)}#comments .owner .meta a,a:focus span,a:hover span{color:#fff}#controls,#run,.buttons{float:right}.submit:focus,.submit:hover,button:focus,button:hover{border-color:#357ab0}#add-buttons button{padding:.15em .4em;font-size:11px}form label{float:left;width:14em;cursor:pointer;text-align:right;margin-right:1em;padding:.4em}label.inline{float:none;padding:0;margin:0}label[for$="][defer]"],label[for=visible]{position:relative;top:-.37em}label span{display:block;font-size:90%;color:#b4b4b4}label em{color:red}#show-advanced,.js #advanced{display:none}#bs-logo a,#carbonads a,#comments article,#controls.show,#donate,#firebug.show,#java.show,.js #show-advanced,footer,section{display:block}section{border-top:1px solid #ccc;padding-top:2em;margin:2em 0}textarea{resize:vertical;height:15em;width:42.6em}input,textarea{border:1px solid #b4b4b4;padding:.4em}input[type=search]{-webkit-appearance:none}#calibrate,#visible{border:0;padding:0}#add-buttons,#add-libraries,.preview,form h2,form h3,form h4,p.error{padding-left:250px;display:block}#controls,#faq dt a,#firebug,#java,hgroup h2{display:none}pre{white-space:pre;white-space:pre-wrap}table #results-1{width:100px}table pre,table td.code{width:650px}mark{background:#ff9;padding:.2em .1em}h1,h2,h3,h4{font-size:1em}h1{padding-top:1em;font-size:1.4em}form h3{padding-top:.2em;padding-bottom:.2em}h1 strong{font-style:italic;font-family:Monaco,'Lucida Console',monospace}li.current a{background:#90ee85}#donate{background:#ffffdc;border:1px solid #faa700;padding:1em}#donate h1{padding-top:0;font-size:16px}#paypal{text-align:center}footer{margin-top:2em;padding:.5em 0 1.5em;border-top:2px solid #c4c4c4}#add-test{margin-right:.3em}#bs-chart-frame{height:240px;width:100%}#bs-logo{margin:0}#bs-logo span,applet{position:absolute;left:-9999em}#bs-logo a{width:232px;height:39px;filter:none;background:url(//www.browserscope.org/static/img/logo.png) no-repeat}#bs-ua{padding:.5em .5em 0;color:#555}#bs-results .bs-rt{font-size:10pt;padding:.5em;background:#ddd}#bs-results td{border:1px solid #ddd;padding:.4em;white-space:nowrap}#bs-results .rt-ua-cur{font-style:italic}#bs-results .bs-rt-message{padding:3em;text-align:center;font-weight:700;color:#555}#bs-results .google-visualization-table-tr-head td{white-space:normal}#controls{margin-top:-3.35em}#comments h1{padding:0}#comments .meta img{position:absolute;margin:0;top:2px;left:2px}#comments .meta{padding-left:35px;margin-top:0;width:923px;line-height:30px}#comments .meta a{color:#555}#comments article div{padding:0 1em}#comments article{border:1px solid #b4b4b4;position:relative;margin-bottom:1em}#comments article:target{background:#dde4ea}#error-info.show,#firebug strong,#java strong,#status strong,.meta strong{background:pink;border:1px solid #b00b00;padding:.4em}#error-info.show{padding:.5em 1em}#error-info,#slug,code,samp,textarea,var{font-family:Monaco,monospace;font-size:.9em;-moz-tab-size:2;-o-tab-size:2;tab-size:2}#java strong{background:#ffffdc;border:1px solid #faa700}#slug{font-size:1em}#faq dt{margin-top:1em}#faq dt:hover a{display:inline}#faq dt:target,#faq dt:target+dd{background:#90ee85;margin:0 -.8em;padding:0 .8em}#faq dt:target+dd{padding-bottom:.5em;margin-bottom:-.5em}#faq dt:target{margin-top:.5em;padding-top:.5em}#firebug,#java,#status{margin:0 0 1em;padding:.3em 0}#prep-code pre{max-height:500px;overflow:auto}.co1,.co2,.coMULTI{font-style:italic;color:#060}.error{color:#b00b00}.imp{color:red}.kw1,.kw3{color:#006}.kw2{color:#036}.es0{color:#009}.br0{color:#090}.sy0{color:#393}.st0{color:#36c}.nu0{color:#c00}.me1{color:#606}#carbonads{float:right;width:130px;font-size:80%}@media (max-width:1050px){table pre,table td.code{width:550px}}@media (max-width:1040px){body{margin:0;border:0}#comments .meta,body{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}}@media (max-width:800px){table pre,table td.code{width:450px}}@media (max-width:680px){table pre,table td.code{width:350px}}@media (max-width:650px){table pre,table td.code{width:200px}} +pre,table{width:100%}pre,tbody th div{word-wrap:break-word;overflow:auto}#bs-chart,pre,tbody th div{overflow:auto}#faq,#faq dd,#faq dt,body,fieldset,h1,h2,h3,html{margin:0;padding:0;border:0}#error-info,#faq,.bs-rt,form div,h1,h2,h3,p,table,ul{margin-bottom:1em}.bs-rt,a,button,input,textarea{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}button,html,input,textarea{font:1em/1.5 sans-serif}h1 em,label em{font-style:normal}#add-buttons button,#bs-results .rt-ua-cur,#comments .meta a,#faq dt,caption,h1,h2,h3,h4,td.error,thead th{font-weight:700}html{background:#c4c4c4;height:100%}body{background:#fff;border:solid #aaa;border-width:0 1px;width:60em;padding:0 2.5em;margin:0 auto;min-height:100%}.btn-link,a{color:#357ab0;padding:.2em}.btn-link:focus,.btn-link:hover,a:focus,a:hover{text-decoration:none}.btn-link{background-color:transparent;border:0;text-decoration:underline}.btn-link:focus,.btn-link:hover{cursor:pointer}blockquote{margin:0 0 1em;border-left:5px solid #b4b4b4;padding-left:.5em}table{border-collapse:collapse}#comments .meta a:focus,#comments .meta a:hover,#comments .owner .meta,.btn-link:focus,.btn-link:hover,.submit:focus,.submit:hover,a:focus,a:hover,button:focus,button:hover,form h3,li.current a:focus,li.current a:hover,thead th{background:#1a6ab9;background-image:-moz-linear-gradient(top,#6ca5dd,#1a6ab9);background-image:-o-linear-gradient(top,#6ca5dd,#1a6ab9);background-image:-webkit-gradient(linear,left top,left bottom,from(#6ca5dd),to(#1a6ab9));background-image:-webkit-linear-gradient(#6ca5dd,#1a6ab9);background-image:linear-gradient(top,#6ca5dd,#1a6ab9);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#6ca5dd', EndColorStr='#1a6ab9');color:#fff}#comments .meta,caption{background:#bcbcbc;background-image:-moz-linear-gradient(top,#d0d0d0,#a7a7a7);background-image:-o-linear-gradient(top,#d0d0d0,#a7a7a7);background-image:-webkit-gradient(linear,left top,left bottom,from(#d0d0d0),to(#a7a7a7));background-image:-webkit-linear-gradient(#d0d0d0,#a7a7a7);background-image:linear-gradient(top,#d0d0d0,#a7a7a7);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#d0d0d0', EndColorStr='#a7a7a7');color:#555}.js tbody th:focus,.js tbody th:hover{text-decoration:underline;cursor:pointer}tbody th,td{border:solid #b4b4b4;border-width:0 1px 1px 0}tbody th{background:#dde4ea;min-width:100px}tbody th div{max-width:200px}td.results{text-align:center;border-right:0}.results span,small{display:block;font-size:.8em}caption,td,th{padding:.2em .5em}td.fastest{background:#9cee82}tr:last-child td,tr:last-child th{border-bottom:0}.login,.submit,button{padding:.35em .5em;color:#000;border:1px solid #999;filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#ebebeb', EndColorStr='#b8b8b8');cursor:pointer}.invalid,:focus:invalid,td.error,td.slowest{background:pink}td.error{text-transform:uppercase}.submit,button{background:#dadada;background-image:-moz-linear-gradient(top,#ebebeb,#b8b8b8);background-image:-o-linear-gradient(top,#ebebeb,#b8b8b8);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#b8b8b8));background-image:-webkit-linear-gradient(top,#ebebeb,#b8b8b8);background-image:linear-gradient(top,#ebebeb,#b8b8b8)}.login{text-decoration:none;background:#dadada;background-image:-moz-linear-gradient(top,#ebebeb,#b8b8b8);background-image:-o-linear-gradient(top,#ebebeb,#b8b8b8);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#b8b8b8));background-image:-webkit-linear-gradient(top,#ebebeb,#b8b8b8);background-image:linear-gradient(top,#ebebeb,#b8b8b8)}#comments .owner .meta a,a:focus span,a:hover span{color:#fff}#controls,#run,.buttons{float:right}.submit:focus,.submit:hover,button:focus,button:hover{border-color:#357ab0}#add-buttons button{padding:.15em .4em;font-size:11px}form label{float:left;width:14em;cursor:pointer;text-align:right;margin-right:1em;padding:.4em}label.inline{float:none;padding:0;margin:0}label[for$="][defer]"],label[for=visible]{position:relative;top:-.37em}label span{display:block;font-size:90%;color:#b4b4b4}label em{color:red}#show-advanced,.js #advanced{display:none}#bs-logo a,#carbonads a,#comments article,#controls.show,#firebug.show,#java.show,.js #show-advanced,footer,section{display:block}section{border-top:1px solid #ccc;padding-top:2em;margin:2em 0}textarea{resize:vertical;height:15em;width:42.6em}input,textarea{border:1px solid #b4b4b4;padding:.4em}input[type=search]{-webkit-appearance:none}#calibrate,#visible{border:0;padding:0}#add-buttons,#add-libraries,.preview,form h2,form h3,form h4,p.error{padding-left:250px;display:block}#controls,#faq dt a,#firebug,#java,hgroup h2{display:none}pre{white-space:pre;white-space:pre-wrap}table #results-1{width:100px}table pre,table td.code{width:650px}mark{background:#ff9;padding:.2em .1em}h1,h2,h3,h4{font-size:1em}h1{padding-top:1em;font-size:1.4em}form h3{padding-top:.2em;padding-bottom:.2em}h1 strong{font-style:italic;font-family:Monaco,'Lucida Console',monospace}li.current a{background:#90ee85}footer{margin-top:2em;border-top:2px solid #c4c4c4;font-size:.9em}footer ul{list-style:none;padding:0;margin:0}footer>ul>li{float:left;width:15%}footer>ul>li:first-child{width:55%}footer ul ul li{margin-bottom:.1em}footer h4{margin-bottom:.2em}#add-test{margin-right:.3em}#bs-chart-frame{height:240px;width:100%}#bs-logo{margin:0}#bs-logo span,applet{position:absolute;left:-9999em}#bs-logo a{width:232px;height:39px;filter:none;background:url(//www.browserscope.org/static/img/logo.png) no-repeat}#bs-ua{padding:.5em .5em 0;color:#555}#bs-results .bs-rt{font-size:10pt;padding:.5em;background:#ddd}#bs-results td{border:1px solid #ddd;padding:.4em;white-space:nowrap}#bs-results .rt-ua-cur{font-style:italic}#bs-results .bs-rt-message{padding:3em;text-align:center;font-weight:700;color:#555}#bs-results .google-visualization-table-tr-head td{white-space:normal}#controls{margin-top:-3.35em}#comments h1{padding:0}#comments .meta img{position:absolute;margin:0;top:2px;left:2px}#comments .meta{padding-left:35px;margin-top:0;width:923px;line-height:30px}#comments .meta a{color:#555}#comments article div{padding:0 1em}#comments article{border:1px solid #b4b4b4;position:relative;margin-bottom:1em}#comments article:target{background:#dde4ea}#error-info.show,#firebug strong,#java strong,#status strong,.meta strong{background:pink;border:1px solid #b00b00;padding:.4em}#error-info.show{padding:.5em 1em}#error-info,#slug,code,samp,textarea,var{font-family:Monaco,monospace;font-size:.9em;-moz-tab-size:2;-o-tab-size:2;tab-size:2}#java strong{background:#ffffdc;border:1px solid #faa700}#slug{font-size:1em}#faq dt{margin-top:1em}#faq dt:hover a{display:inline}#faq dt:target,#faq dt:target+dd{background:#90ee85;margin:0 -.8em;padding:0 .8em}#faq dt:target+dd{padding-bottom:.5em;margin-bottom:-.5em}#faq dt:target{margin-top:.5em;padding-top:.5em}#firebug,#java,#status{margin:0 0 1em;padding:.3em 0}#prep-code pre{max-height:500px;overflow:auto}.co1,.co2,.coMULTI{font-style:italic;color:#060}.error{color:#b00b00}.imp{color:red}.kw1,.kw3{color:#006}.kw2{color:#036}.es0{color:#009}.br0{color:#090}.sy0{color:#393}.st0{color:#36c}.nu0{color:#c00}.me1{color:#606}#carbonads{float:right;width:130px;font-size:80%}@media (max-width:1050px){table pre,table td.code{width:550px}}@media (max-width:1040px){body{margin:0;border:0}#comments .meta,body{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}}@media (max-width:800px){table pre,table td.code{width:450px}}@media (max-width:680px){table pre,table td.code{width:350px}}@media (max-width:650px){table pre,table td.code{width:200px}} \ No newline at end of file diff --git a/public/_css/main.src.css b/public/_css/main.src.css index dbd95bac..97f67aa9 100644 --- a/public/_css/main.src.css +++ b/public/_css/main.src.css @@ -33,15 +33,26 @@ body { min-height: 100%; } -a { +a, .btn-link { color: #357ab0; padding: .2em; } -a:hover, a:focus { +a:hover, a:focus, +.btn-link:hover, .btn-link:focus { text-decoration: none; } +.btn-link { + background-color: transparent; + border: 0; + text-decoration: underline; +} + +.btn-link:hover, .btn-link:focus { + cursor: pointer; +} + blockquote { margin: 0 0 1em; border-left: 5px solid #b4b4b4; @@ -53,7 +64,7 @@ table { border-collapse: collapse; } -thead th, button:hover, button:focus, .submit:hover, .submit:focus, a:hover, a:focus, #comments .meta a:hover, #comments .meta a:focus, li.current a:hover, li.current a:focus, form h3, #comments .owner .meta { +thead th, button:hover, button:focus, .submit:hover, .submit:focus, a:hover, a:focus, .btn-link:hover, .btn-link:focus, #comments .meta a:hover, #comments .meta a:focus, li.current a:hover, li.current a:focus, form h3, #comments .owner .meta { background: #1a6ab9; background-image: -moz-linear-gradient(top, #6ca5dd, #1a6ab9); background-image: -o-linear-gradient(top, #6ca5dd, #1a6ab9); @@ -317,27 +328,34 @@ li.current a { background: #90ee85; } -#donate { +footer { display: block; - background: #ffffdc; - border: 1px solid #faa700; - padding: 1em; + margin-top: 2em; + border-top: 2px solid #c4c4c4; + font-size: 0.9em; } -#donate h1 { - padding-top: 0; - font-size: 16px; +footer ul { + list-style: none; + padding: 0; + margin: 0; } -#paypal { - text-align: center; +footer > ul > li { + float: left; + width: 15%; } -footer { - display: block; - margin-top: 2em; - padding: .5em 0 1.5em; - border-top: 2px solid #c4c4c4; +footer > ul > li:first-child { + width: 55%; +} + +footer ul ul li { + margin-bottom: 0.1em; +} + +footer h4 { + margin-bottom: 0.2em; } #add-test { diff --git a/server/web/faq/index.hbs b/server/web/faq/index.hbs index 36116c02..0f186390 100644 --- a/server/web/faq/index.hbs +++ b/server/web/faq/index.hbs @@ -1,4 +1,4 @@ -

Frequently asked questions

+

Frequently Asked Questions

{{> advertisement}}
    @@ -11,16 +11,6 @@ {{/each}}
- -
{{#each faq}}
diff --git a/server/web/redirects.js b/server/web/redirects.js index 643f336a..e26793dc 100644 --- a/server/web/redirects.js +++ b/server/web/redirects.js @@ -26,7 +26,7 @@ exports.register = function (server, options, next) { redirect: '/removechildren/3' }, { path: '/donate', - redirect: '/faq#donate' + redirect: '/sponsor' } ]; diff --git a/server/web/sponsor/index.hbs b/server/web/sponsor/index.hbs new file mode 100644 index 00000000..9418f737 --- /dev/null +++ b/server/web/sponsor/index.hbs @@ -0,0 +1,34 @@ +

Sponsor

+ +

+ Development of jsPerf is generously supported by contributions from individuals and corporations. If you are benefiting from jsPerf and would like to help keep the project financially sustainable, please donate to a core contributor. +

+ +

Core Contributors

+ +
+
+ Mathias Bynens +
+
+
+ + + +
+
+ +
+ Max Beatty +
+
+ Patreon +
+ +
+ Andrew Silluron +
+
+ Patreon +
+
diff --git a/server/web/sponsor/index.js b/server/web/sponsor/index.js new file mode 100644 index 00000000..8a592dad --- /dev/null +++ b/server/web/sponsor/index.js @@ -0,0 +1,18 @@ +exports.register = function (server, options, next) { + server.route({ + method: 'GET', + path: '/sponsor', + handler: function (request, reply) { + reply.view('sponsor/index', { + headTitle: 'Sponsor', + ga: true + }); + } + }); + + return next(); +}; + +exports.register.attributes = { + name: 'web/sponsor' +}; diff --git a/templates/partials/footer.hbs b/templates/partials/footer.hbs index 103c8f42..b269f310 100644 --- a/templates/partials/footer.hbs +++ b/templates/partials/footer.hbs @@ -1,31 +1,72 @@ {{#if benchmark}} diff --git a/test/unit/server/web/redirects.js b/test/unit/server/web/redirects.js index d039d991..23004c7e 100644 --- a/test/unit/server/web/redirects.js +++ b/test/unit/server/web/redirects.js @@ -39,7 +39,7 @@ lab.experiment('redirects', function () { server.inject(request, function (response) { Code.expect(response.statusCode).to.equal(301); - Code.expect(response.headers.location).to.equal('/faq#donate'); + Code.expect(response.headers.location).to.equal('/sponsor'); done(); }); diff --git a/test/unit/server/web/sponsor/index.js b/test/unit/server/web/sponsor/index.js new file mode 100644 index 00000000..d6c78d57 --- /dev/null +++ b/test/unit/server/web/sponsor/index.js @@ -0,0 +1,52 @@ +const path = require('path'); + +const Lab = require('lab'); +const Code = require('code'); +const Hapi = require('hapi'); + +const HomePlugin = require('../../../../../server/web/sponsor/index'); + +const lab = exports.lab = Lab.script(); +let request, server; + +lab.beforeEach(function (done) { + const plugins = [ HomePlugin ]; + server = new Hapi.Server(); + server.connection(); + server.register(require('vision'), () => { + server.views({ + engines: { + hbs: require('handlebars') + }, + path: './server/web', + layout: true, + helpersPath: 'templates/helpers', + partialsPath: 'templates/partials', + relativeTo: path.join(__dirname, '..', '..', '..', '..', '..') + }); + server.register(plugins, done); + }); +}); + +lab.experiment('sponsor', function () { + lab.beforeEach(function (done) { + request = { + method: 'GET', + url: '/sponsor' + }; + + done(); + }); + + lab.test('it responds with the sponsor page', function (done) { + server.inject(request, function (response) { + Code.expect(response.statusCode).to.equal(200); + Code.expect(response.result).to.include([ + 'PayPal', + 'Patreon' + ]); + + done(); + }); + }); +});