= schedule page added;

+ clients dir for browser code;
+ some models (course);
= other (main style, etc);
This commit is contained in:
tmshv committed 2014-03-18 23:16:45 +04:00
1 parent c1e160d779
commit 8784043f1d
12 files changed
+285 -81

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
const TEAM = require("./team.json");
exports.team = TEAM;
exports.person = getPersonByID;
exports.name = getNameByID;
exports.short = getShortNameByID;
function getPersonByID(id){
for(var i=0; i<TEAM.length; i++){
var p = TEAM[i];
if(p.id == id){
return p;
}
}
return null;
}
function getNameByID(id){
var p = getPersonByID(id);
if(p) return p.name;
else return null;
}
function getShortNameByID(id){
var n = getNameByID(id);
if(n) return shortifyName(n)
else return null;
}
function shortifyName(name){
var m = /(.+)\s(.+)\s(.+)/.exec(name);
var n = m[1].replace(/^(.).+/, "$1. ") +
m[2].replace(/^(.).+/, "$1. ") +
m[3];
return n;
}