htdocs: Tweak JS.

[ci skip]
This commit is contained in:
XhmikosR 2014-03-16 12:39:03 +02:00
parent bfd388dc15
commit 4ab04ef255
3 changed files with 16 additions and 12 deletions

View File

@ -17,22 +17,19 @@
"lint": "node run-tests" "lint": "node run-tests"
}, },
"dependencies": { "dependencies": {
"clean-css": "~2.1.0", "clean-css": "~2.1.6",
"csslint": "~0.10.0", "csslint": "~0.10.0",
"jshint": "~2.4.3", "jshint": "~2.4.4",
"shelljs": "~0.2.6", "shelljs": "~0.2.6",
"uglify-js": "~2.4.12" "uglify-js": "~2.4.13"
}, },
"jshintConfig": { "jshintConfig": {
"bitwise": true,
"boss": true,
"browser": false,
"camelcase": true, "camelcase": true,
"curly": true, "curly": true,
"eqeqeq": true, "eqeqeq": true,
"forin": true,
"indent": 4, "indent": 4,
"latedef": true, "latedef": true,
"multistr": true,
"noarg": true, "noarg": true,
"node": true, "node": true,
"noempty": true, "noempty": true,
@ -40,6 +37,7 @@
"shelljs": true, "shelljs": true,
"strict": true, "strict": true,
"trailing": true, "trailing": true,
"undef": true,
"unused": true "unused": true
}, },
"engines": { "engines": {

View File

@ -1,15 +1,21 @@
/*! Inspired by: http://aboutcode.net/2010/11/11/list-github-projects-using-javascript.html */ /*! Inspired by: http://aboutcode.net/2010/11/11/list-github-projects-using-javascript.html */
/* jshint jquery:true */ /* jshint browser:true, jquery:true */
"use strict";
// htmlEntities taken from http://css-tricks.com/snippets/javascript/htmlentities-for-javascript/ // htmlEntities taken from http://css-tricks.com/snippets/javascript/htmlentities-for-javascript/
function htmlEntities(str) { function htmlEntities(str) {
return String(str).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"); "use strict";
var ret = String(str)
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;");
return ret;
} }
jQuery.fn.listCommits = function(username, repository, branch) { jQuery.fn.listCommits = function(username, repository, branch) {
"use strict";
this.html("<span>Querying GitHub for recent commits&hellip;</span>"); this.html("<span>Querying GitHub for recent commits&hellip;</span>");
var target = this; var target = this;

File diff suppressed because one or more lines are too long